apitestcenter 0.11.0 → 0.12.0

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 (55) hide show
  1. package/dist/THIRD-PARTY-NOTICES-UI.txt +1 -1
  2. package/dist/THIRD-PARTY-NOTICES.txt +1 -1
  3. package/dist/cli.mjs +1964 -911
  4. package/dist/ui/404/index.html +1 -1
  5. package/dist/ui/404.html +1 -1
  6. package/dist/ui/__next.__PAGE__.txt +11 -11
  7. package/dist/ui/__next._full.txt +12 -12
  8. package/dist/ui/__next._tree.txt +2 -2
  9. package/dist/ui/_next/static/chunks/{2xiq0vxqp_rsu.js → 1-6_oo-9egb_t.js} +1 -1
  10. package/dist/ui/_next/static/chunks/1_537szc_614o.js +1 -0
  11. package/dist/ui/_next/static/chunks/{1ffsp9e_ihf8c.js → 1_q4bnjjia0y5.js} +2 -2
  12. package/dist/ui/_next/static/chunks/{37izghagcat04.js → 1zmkb7tfqygqs.js} +1 -1
  13. package/dist/ui/_next/static/chunks/{0gfm4dc7bjzy1.js → 2t9juu3lz_5u-.js} +1 -1
  14. package/dist/ui/_next/static/chunks/3238j0_19x8_p.js +2 -0
  15. package/dist/ui/_next/static/chunks/{199g-q88qtg_i.js → 388t7tbteqx_j.js} +179 -89
  16. package/dist/ui/_next/static/chunks/3_q1wiq483s-m.css +3 -0
  17. package/dist/ui/_not-found/__next._full.txt +11 -11
  18. package/dist/ui/_not-found/__next._not-found.__PAGE__.txt +10 -10
  19. package/dist/ui/_not-found/__next._tree.txt +2 -2
  20. package/dist/ui/_not-found/index.html +1 -1
  21. package/dist/ui/_not-found/index.txt +11 -11
  22. package/dist/ui/compare/__next._full.txt +12 -12
  23. package/dist/ui/compare/__next._tree.txt +2 -2
  24. package/dist/ui/compare/__next.compare.__PAGE__.txt +11 -11
  25. package/dist/ui/compare/index.html +1 -1
  26. package/dist/ui/compare/index.txt +12 -12
  27. package/dist/ui/history/__next._full.txt +13 -13
  28. package/dist/ui/history/__next._tree.txt +2 -2
  29. package/dist/ui/history/__next.history.__PAGE__.txt +12 -12
  30. package/dist/ui/history/index.html +1 -1
  31. package/dist/ui/history/index.txt +13 -13
  32. package/dist/ui/index.html +1 -1
  33. package/dist/ui/index.txt +12 -12
  34. package/dist/ui/preview/__next._full.txt +13 -13
  35. package/dist/ui/preview/__next._tree.txt +2 -2
  36. package/dist/ui/preview/__next.preview.__PAGE__.txt +12 -12
  37. package/dist/ui/preview/index.html +1 -1
  38. package/dist/ui/preview/index.txt +13 -13
  39. package/dist/ui/suite/__next._full.txt +12 -12
  40. package/dist/ui/suite/__next._tree.txt +2 -2
  41. package/dist/ui/suite/__next.suite.__PAGE__.txt +11 -11
  42. package/dist/ui/suite/index.html +1 -1
  43. package/dist/ui/suite/index.txt +12 -12
  44. package/dist/ui/tests/__next._full.txt +11 -11
  45. package/dist/ui/tests/__next._tree.txt +2 -2
  46. package/dist/ui/tests/__next.tests.__PAGE__.txt +10 -10
  47. package/dist/ui/tests/index.html +1 -1
  48. package/dist/ui/tests/index.txt +11 -11
  49. package/package.json +1 -1
  50. package/dist/ui/_next/static/chunks/01tk3yrimgagm.js +0 -2
  51. package/dist/ui/_next/static/chunks/1ax1v4312l2w9.js +0 -1
  52. package/dist/ui/_next/static/chunks/239j59-_u852y.css +0 -3
  53. /package/dist/ui/_next/static/{XGxojrJs_nD9y7xtRMI1q → Tiehe_bgMIxGzSdltdXXB}/_buildManifest.js +0 -0
  54. /package/dist/ui/_next/static/{XGxojrJs_nD9y7xtRMI1q → Tiehe_bgMIxGzSdltdXXB}/_clientMiddlewareManifest.js +0 -0
  55. /package/dist/ui/_next/static/{XGxojrJs_nD9y7xtRMI1q → Tiehe_bgMIxGzSdltdXXB}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,22543,e=>{"use strict";var t=e.i(61666),r=e.i(83067),n=e.i(65296);e.s(["Hint",0,function({text:e,label:i="More information"}){let a=(0,r.useRef)(null),s=(0,r.useRef)(null),[o,l]=(0,r.useState)(!1),[u,c]=(0,r.useState)(!1),[d,f]=(0,r.useState)(null),p=o||u;return(0,r.useLayoutEffect)(()=>{if(!p)return f(null);let e=()=>{let e=a.current?.getBoundingClientRect();if(!e)return;let t=Math.min(256,window.innerWidth-32),r=s.current?.offsetHeight??80,n=Math.min(Math.max(16,e.left),window.innerWidth-t-16);f({top:e.bottom+6+r<=window.innerHeight-8?e.bottom+6:Math.max(8,e.top-6-r),left:n})};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)}},[p]),(0,r.useEffect)(()=>{if(!o)return;let e=e=>{let t=e.target;a.current?.contains(t)||s.current?.contains(t)||l(!1)},t=e=>{"Escape"===e.key&&l(!1)};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[o]),(0,t.jsxs)("span",{ref:a,className:"relative inline-flex align-middle",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!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":p,onClick:e=>{e.stopPropagation(),l(e=>!e)},onFocus:()=>c(!0),onBlur:()=>c(!1),children:"?"}),p&&"u">typeof document?(0,n.createPortal)((0,t.jsx)("span",{ref:s,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:()=>c(!0),onMouseLeave:()=>c(!1),children:e}),document.body):null]})}])},39170,e=>{"use strict";var t=e.i(61666),r=e.i(53012),n=e.i(83067);let i=(0,n.createContext)(async()=>!1);function a({options:e,onClose:i}){let s=(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-50 grid place-items-center bg-black/50 p-4 backdrop-blur-sm",onMouseDown:e=>{e.target===e.currentTarget&&i(!1)},children:(0,t.jsxs)("div",{ref:s,role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-title",onKeyDown:function(e){if("Escape"===e.key&&(e.stopPropagation(),i(!1)),"Tab"===e.key){let t=s.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.AlertTriangle,{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:()=>i(!1),children:e.cancelLabel??"Cancel"}),(0,t.jsx)("button",{ref:l,type:"button",className:"btn btn-primary",onClick:()=>i(!0),children:e.confirmLabel??"Continue"})]})]})})}e.s(["ConfirmProvider",0,function({children:e}){let[r,s]=(0,n.useState)(null),o=(0,n.useCallback)(e=>new Promise(t=>s({...e,resolve:t})),[]);return(0,t.jsxs)(i.Provider,{value:o,children:[e,r?(0,t.jsx)(a,{options:r,onClose:function(e){r?.resolve(e),s(null)}}):null]})},"useConfirm",0,function(){return(0,n.useContext)(i)}])},28867,e=>{"use strict";var t=e.i(61666);e.s(["Segmented",0,function({value:e,options:r,onChange:n,label:i,size:a="sm"}){return(0,t.jsx)("div",{role:"group","aria-label":i,className:"inline-flex flex-wrap rounded-md border border-line bg-panel-2 p-0.5",children:r.map(r=>{let i=r.value===e;return(0,t.jsx)("button",{type:"button","aria-pressed":i,title:r.title,onClick:()=>n(r.value),className:`rounded px-2.5 ${"md"===a?"py-1.5 text-sm":"py-1 text-xs"} transition-colors ${i?"bg-panel text-ink shadow-sm":"text-mute hover:text-ink"}`,children:r.label},r.value)})})}])},56396,e=>{"use strict";var t=e.i(61666),r=e.i(17118),n=e.i(42967),i=e.i(87283),a=e.i(27122),s=e.i(83067);let o=(0,s.createContext)(()=>{}),l=1;e.s(["ToastProvider",0,function({children:e}){let[u,c]=(0,s.useState)([]),d=(0,s.useCallback)(e=>c(t=>t.filter(t=>t.id!==e)),[]),f=(0,s.useCallback)((e,t="info")=>{let r=l++;c(n=>[...n.slice(-3),{id:r,tone:t,message:e}]),window.setTimeout(()=>d(r),"error"===t?6e3:3200)},[d]);return(0,t.jsxs)(o.Provider,{value:f,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 s="success"===e.tone?r.CheckCircle2:"error"===e.tone?a.XCircle:n.Info,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)(s,{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:()=>d(e.id),children:(0,t.jsx)(i.X,{size:14})})]},e.id)})})]})},"useToast",0,function(){return(0,s.useContext)(o)}])},59180,e=>{"use strict";var t=e.i(61666),r=e.i(83067);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 i=(e,t)=>fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),a={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=>i("/engine/history/delete",e).then(e=>n(e)),saveCompare:e=>i("/engine/history/compares",e).then(e=>n(e)),import:e=>i("/engine/history/import",e).then(e=>n(e)),reveal:e=>i("/engine/history/reveal",e??{}).then(e=>n(e))},s=(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 a.import({report:t}).catch(()=>void 0);for(let e of Array.isArray(t)?t:[])e?.apis&&!(e.apis.length<2)&&await a.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(["HistoryProvider",0,function({children:e}){let[n,i]=(0,r.useState)(null),[o,u]=(0,r.useState)(null),[c,d]=(0,r.useState)(!0),f=(0,r.useRef)(null),p=(0,r.useCallback)(()=>{if(f.current)return f.current;let e=a.index().then(e=>(i(e),u(null),e)).catch(e=>(u(e instanceof Error?e.message:"History unavailable"),null)).finally(()=>{d(!1),f.current=null});return f.current=e,e},[]);(0,r.useEffect)(()=>{l().finally(()=>void p());let e=()=>void p();return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[p]);let m=(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:p,baselineFor:t=>e.get(t)}},[n,o,c,p]);return(0,t.jsx)(s.Provider,{value:m,children:e})},"historyApi",0,a,"useHistory",0,function(){return(0,r.useContext)(s)}])},99522,e=>{"use strict";var t=e.i(83067);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 i={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 a=(0,t.forwardRef)(({color:e="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:o="",children:l,iconNode:u,...c},d)=>(0,t.createElement)("svg",{ref:d,...i,width:r,height:r,stroke:e,strokeWidth:s?24*Number(a)/Number(r):a,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(["default",0,(e,i)=>{let s=(0,t.forwardRef)(({className:s,...o},l)=>(0,t.createElement)(a,{ref:l,iconNode:i,className:n(`lucide-${r(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,s),...o}));return s.displayName=r(e),s}],99522)},1675,e=>{"use strict";let t=(0,e.i(99522).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,t],1675)},95486,e=>{"use strict";let t=(0,e.i(99522).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],95486)},17118,e=>{"use strict";let t=(0,e.i(99522).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["CheckCircle2",0,t],17118)},27122,e=>{"use strict";let t=(0,e.i(99522).default)("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(["XCircle",0,t],27122)},89932,e=>{"use strict";let t=(0,e.i(99522).default)("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(["Copy",0,t],89932)},75117,e=>{"use strict";let t=(0,e.i(99522).default)("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(["Download",0,t],75117)},67938,e=>{"use strict";let t=(0,e.i(99522).default)("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(["FileUp",0,t],67938)},42967,e=>{"use strict";let t=(0,e.i(99522).default)("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(["Info",0,t],42967)},27813,e=>{"use strict";let t=(0,e.i(99522).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",0,t],27813)},71189,e=>{"use strict";let t=(0,e.i(99522).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],71189)},43514,e=>{"use strict";let t=(0,e.i(99522).default)("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(["Settings2",0,t],43514)},53012,30844,e=>{"use strict";let t=(0,e.i(99522).default)("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(["default",0,t],30844),e.s(["AlertTriangle",0,t],53012)},87283,e=>{"use strict";let t=(0,e.i(99522).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],87283)},53267,(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,a=l(e),s=a[0],o=a[1],u=new i((s+o)*3/4-o),c=0,d=o>0?s-4:s;for(r=0;r<d;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,i=n%3,a=[],s=0,o=n-i;s<o;s+=16383)a.push(function(e,t,n){for(var i,a=[],s=t;s<n;s+=3)i=(e[s]<<16&0xff0000)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}(e,s,s+16383>o?o:s+16383));return 1===i?a.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&a.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),a.join("")};for(var r=[],n=[],i="u">typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=a.length;s<o;++s)r[s]=a[s],n[a.charCodeAt(s)]=s;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),i=r(321),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(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,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!o.isEncoding(i))throw TypeError("Unknown encoding: "+i);var a=0|p(n,i),l=s(a),u=l.write(n,i);return u!==a&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e))return d(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(A(e,ArrayBuffer)||e&&A(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(A(e,SharedArrayBuffer)||e&&A(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 m=function(e){if(o.isBuffer(e)){var t=0|f(e.length),r=s(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)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(m)return m;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),s(e<0?0:0|f(e))}function d(e){for(var t=e.length<0?0:0|f(e.length),r=s(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)?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)};function f(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||A(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 i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return S(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return O(e).length;default:if(i)return n?-1:S(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){var i,a,s,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 i="",a=t;a<r;++a)i+=N[e[a]];return i}(this,t,r);case"utf8":case"utf-8":return y(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return i=this,a=t,s=r,0===a&&s===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(a,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}(this,t,r);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function h(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){var a;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(a=r*=1)!=a&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return v(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){var a,s=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;s=2,o/=2,l/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(a=r;a<o;a++)if(u(e,a)===u(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===l)return c*s}else -1!==c&&(a-=a-c),c=-1}else for(r+l>o&&(r=o-l),a=r;a>=0;a--){for(var d=!0,f=0;f<l;f++)if(u(e,a+f)!==u(t,f)){d=!1;break}if(d)return a}return -1}o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(A(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),A(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,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];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),i=0;for(r=0;r<e.length;++r){var a=e[r];if(A(a,Uint8Array)&&(a=o.from(a)),!o.isBuffer(a))throw TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},o.byteLength=p,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)h(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)h(this,t,t+3),h(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)h(this,t,t+7),h(this,t+1,t+6),h(this,t+2,t+5),h(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?y(this,0,e):m.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+">"},a&&(o.prototype[a]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if(A(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===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var a=i-n,s=r-t,l=Math.min(a,s),u=this.slice(n,i),c=e.slice(t,r),d=0;d<l;++d)if(u[d]!==c[d]){a=u[d],s=c[d];break}return a<s?-1:+(s<a)},o.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)};function y(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,s,o,l,u=e[i],c=null,d=u>239?4:u>223?3:u>191?2:1;if(i+d<=r)switch(d){case 1:u<128&&(c=u);break;case 2:(192&(a=e[i+1]))==128&&(l=(31&u)<<6|63&a)>127&&(c=l);break;case 3:a=e[i+1],s=e[i+2],(192&a)==128&&(192&s)==128&&(l=(15&u)<<12|(63&a)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=e[i+1],s=e[i+2],o=e[i+3],(192&a)==128&&(192&s)==128&&(192&o)==128&&(l=(15&u)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=d}var f=n,p=f.length;if(p<=4096)return String.fromCharCode.apply(String,f);for(var m="",h=0;h<p;)m+=String.fromCharCode.apply(String,f.slice(h,h+=4096));return m}function b(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 $(e,t,r,n,i,a){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function x(e,t,r,n,i,a){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function k(e,t,r,n,a){return t*=1,r>>>=0,a||x(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function w(e,t,r,n,a){return t*=1,r>>>=0,a||x(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.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 i,a,s,o,l,u,c,d,f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;n>a/2&&(n=a/2);for(var s=0;s<n;++s){var o,l=parseInt(t.substr(2*s,2),16);if((o=l)!=o)break;e[r+s]=l}return s}(this,e,t,r);case"utf8":case"utf-8":return i=t,a=r,E(S(e,this.length-i),this,i,a);case"ascii":return s=t,o=r,E(I(e),this,s,o);case"latin1":case"binary":return function(e,t,r,n){return E(I(t),e,r,n)}(this,e,t,r);case"base64":return l=t,u=r,E(O(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,d=r,E(function(e,t){for(var r,n,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i.push(r%256),i.push(n);return i}(e,this.length-c),this,c,d);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!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||b(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(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||b(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||b(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(e,t){return(e>>>=0,t||b(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||b(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||b(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||b(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||b(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||b(e,4,this.length),i.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),i.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),i.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),i.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;$(this,e,t,r,i,0)}var a=1,s=0;for(this[t]=255&e;++s<r&&(a*=256);)this[t+s]=e/a&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;$(this,e,t,r,i,0)}var a=r-1,s=1;for(this[t+a]=255&e;--a>=0&&(s*=256);)this[t+a]=e/s&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||$(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||$(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||$(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||$(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||$(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 i=Math.pow(2,8*r-1);$(this,e,t,r,i-1,-i)}var a=0,s=1,o=0;for(this[t]=255&e;++a<r&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);$(this,e,t,r,i-1,-i)}var a=r-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||$(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||$(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||$(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||$(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||$(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 k(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return k(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return w(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return w(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 i=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 a=i-1;a>=0;--a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},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 i,a=e.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(e=a)}}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(i=t;i<r;++i)this[i]=e;else{var s=o.isBuffer(e)?e:o.from(e,n),l=s.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%l]}return this};var _=/[^+/0-9A-Za-z-_]/g;function S(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return a}function I(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function O(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(_,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function E(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var N=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},321:function(e,t){t.read=function(e,t,r,n,i){var a,s,o=8*i-n-1,l=(1<<o)-1,u=l>>1,c=-7,d=r?i-1:0,f=r?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-c)-1,p>>=-c,c+=o;c>0;a=256*a+e[t+d],d+=f,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=n;c>0;s=256*s+e[t+d],d+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),a-=u}return(p?-1:1)*s*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var s,o,l,u=8*a-i-1,c=(1<<u)-1,d=c>>1,f=5960464477539062e-23*(23===i),p=n?0:a-1,m=n?1:-1,h=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(o=+!!isNaN(t),s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+d>=1?t+=f/l:t+=f*Math.pow(2,1-d),t*l>=2&&(s++,l/=2),s+d>=c?(o=0,s=c):s+d>=1?(o=(t*l-1)*Math.pow(2,i),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&o,p+=m,o/=256,i-=8);for(s=s<<i|o,u+=i;u>0;e[r+p]=255&s,p+=m,s/=256,u-=8);e[r+p-m]|=128*h}}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}},s=!0;try{n[e](r,r.exports,a),s=!1}finally{s&&delete i[e]}return r.exports}a.ab="/ROOT/node_modules/.pnpm/next@16.3.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=a(230)},24856,86483,70632,59100,99112,36163,78451,5305,90372,47253,48191,2385,94122,54608,55658,46306,60617,81609,88491,94713,e=>{"use strict";let t;e.s(["ZodAny",()=>o1,"ZodArray",()=>lt,"ZodBase64",()=>ox,"ZodBase64URL",()=>ow,"ZodBigInt",()=>oB,"ZodBigIntFormat",()=>oK,"ZodBoolean",()=>oq,"ZodCIDRv4",()=>ov,"ZodCIDRv6",()=>ob,"ZodCUID",()=>ot,"ZodCUID2",()=>on,"ZodCatch",()=>lH,"ZodCodec",()=>l2,"ZodCustom",()=>us,"ZodCustomStringFormat",()=>oA,"ZodDate",()=>o7,"ZodDefault",()=>lq,"ZodDiscriminatedUnion",()=>lf,"ZodE164",()=>oS,"ZodEmail",()=>sG,"ZodEmoji",()=>s3,"ZodEnum",()=>lI,"ZodExactOptional",()=>lD,"ZodFile",()=>lU,"ZodFunction",()=>ui,"ZodGUID",()=>sX,"ZodIPv4",()=>od,"ZodIPv6",()=>oh,"ZodIntersection",()=>lm,"ZodJWT",()=>oO,"ZodKSUID",()=>ou,"ZodLazy",()=>ue,"ZodLiteral",()=>lA,"ZodMAC",()=>op,"ZodMap",()=>lk,"ZodNaN",()=>lY,"ZodNanoID",()=>s7,"ZodNever",()=>o5,"ZodNonOptional",()=>lK,"ZodNull",()=>oQ,"ZodNullable",()=>lC,"ZodNumber",()=>oT,"ZodNumberFormat",()=>oM,"ZodObject",()=>li,"ZodOptional",()=>lP,"ZodPipe",()=>l0,"ZodPrefault",()=>lB,"ZodPreprocess",()=>l5,"ZodPromise",()=>ur,"ZodReadonly",()=>l9,"ZodRecord",()=>ly,"ZodSet",()=>l_,"ZodString",()=>sK,"ZodStringFormat",()=>sV,"ZodSuccess",()=>lV,"ZodSymbol",()=>oG,"ZodTemplateLiteral",()=>l8,"ZodTransform",()=>lz,"ZodTuple",()=>lg,"ZodType",()=>sB,"ZodULID",()=>oa,"ZodURL",()=>s4,"ZodUUID",()=>sQ,"ZodUndefined",()=>oX,"ZodUnion",()=>ll,"ZodUnknown",()=>o6,"ZodVoid",()=>o3,"ZodXID",()=>oo,"ZodXor",()=>lc,"_ZodString",()=>sJ,"_default",()=>lF,"_function",()=>ua,"any",()=>o2,"array",()=>lr,"base64",()=>ok,"base64url",()=>o_,"bigint",()=>oJ,"boolean",()=>oF,"catch",()=>lX,"check",()=>uo,"cidrv4",()=>oy,"cidrv6",()=>o$,"codec",()=>l6,"cuid",()=>or,"cuid2",()=>oi,"custom",()=>ul,"date",()=>le,"describe",()=>ud,"discriminatedUnion",()=>lp,"e164",()=>oI,"email",()=>sH,"emoji",()=>s8,"enum",()=>lO,"exactOptional",()=>lZ,"file",()=>lj,"float32",()=>oZ,"float64",()=>oC,"function",()=>ua,"guid",()=>sY,"hash",()=>oz,"hex",()=>oj,"hostname",()=>oU,"httpUrl",()=>s9,"instanceof",()=>up,"int",()=>oD,"int32",()=>oL,"int64",()=>oW,"intersection",()=>lh,"invertCodec",()=>l4,"ipv4",()=>of,"ipv6",()=>og,"json",()=>uh,"jwt",()=>oE,"keyof",()=>ln,"ksuid",()=>oc,"lazy",()=>ut,"literal",()=>lN,"looseObject",()=>lo,"looseRecord",()=>lx,"mac",()=>om,"map",()=>lw,"meta",()=>uf,"nan",()=>lQ,"nanoid",()=>oe,"nativeEnum",()=>lE,"never",()=>o9,"nonoptional",()=>lW,"null",()=>o0,"nullable",()=>lL,"nullish",()=>lR,"number",()=>oP,"object",()=>la,"optional",()=>lM,"partialRecord",()=>l$,"pipe",()=>l1,"prefault",()=>lJ,"preprocess",()=>ug,"promise",()=>un,"readonly",()=>l3,"record",()=>lb,"refine",()=>uu,"set",()=>lS,"strictObject",()=>ls,"string",()=>sW,"stringFormat",()=>oN,"stringbool",()=>um,"success",()=>lG,"superRefine",()=>uc,"symbol",()=>oH,"templateLiteral",()=>l7,"transform",()=>lT,"tuple",()=>lv,"uint32",()=>oR,"uint64",()=>oV,"ulid",()=>os,"undefined",()=>oY,"union",()=>lu,"unknown",()=>o4,"url",()=>s5,"uuid",()=>s0,"uuidv4",()=>s1,"uuidv6",()=>s2,"uuidv7",()=>s6,"void",()=>o8,"xid",()=>ol,"xor",()=>ld],3573),e.s(["ZodISODate",()=>sx,"ZodISODateTime",()=>sb,"ZodISODuration",()=>sS,"ZodISOTime",()=>sw,"date",()=>sk,"datetime",()=>s$,"duration",()=>sI,"time",()=>s_],49648),Date.parse("2026-08-20T10:00:00.000Z");let r=["p50","p90","p95","p99","p999","max"],n={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)"},i=["throughput","peakRps","p95","p50","avg","p99","max","ttfb","errors","checks","vus","requests","dropped","apdex","data","sent","duration"],a={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"},s={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"},o=["ttfb","connect","tls","blocked"],l={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}},u=Object.keys(l);function c(e,t,r,n,i={}){let a=l[t];return{id:e,metric:t,kind:a.kinds[0],x:r,y:n,w:a.size.w,h:a.size.h,options:a.defaults,...i}}let d=[{id:"builtin-overview",name:"Overview",scope:"run",builtIn:!0,widgets:[c("kpis","kpis",0,0),c("verdict","verdict",0,3),c("latency","latency",0,6),c("throughput","throughput",6,6),c("status","status",0,14),c("percentiles","percentiles",6,14,{h:8}),c("phases","phases",0,22),c("targets","targets",6,22),c("config","config",0,29)]},{id:"builtin-developer",name:"Developer",scope:"run",builtIn:!0,widgets:[c("latency","latency",0,0,{w:12,options:{percentiles:["p50","p90","p95","p99","max"],showTarget:!0}}),c("server","serverTime",0,8),c("phases","phases",6,8,{h:8}),c("histogram","histogram",0,16),c("status","status",6,16),c("heatmap","heatmap",0,24),c("targets","targets",0,32),c("codes","statusTable",6,32,{w:6,h:7})]},{id:"builtin-capacity",name:"Capacity",scope:"run",builtIn:!0,widgets:[c("kpis","kpis",0,0,{options:{kpis:["throughput","p95","errors","vus","dropped"]}}),c("concurrency","concurrency",0,3),c("throughput","throughput",6,3),c("latency","latency",0,11,{options:{percentiles:["p95","p99"],showTarget:!0}}),c("vus","vus",6,11,{h:8}),c("errors","errors",0,19),c("dropped","dropped",6,19)]},{id:"builtin-executive",name:"Executive",scope:"run",builtIn:!0,widgets:[c("verdict","verdict",0,0),c("kpis","kpis",0,3,{w:9,options:{kpis:["p95","errors","throughput","requests"]}}),c("apdex","apdex",9,3,{h:3}),c("latency","latency",0,6,{options:{percentiles:["p95"],showTarget:!0}}),c("targets","targets",6,6,{h:8})]},{id:"builtin-topics",name:"By topic",scope:"run",builtIn:!0,widgets:[c("verdict","verdict",0,0),c("h-speed","heading",0,3,{title:"Speed",options:{note:"How fast the API answers"}}),c("n-p95","number",0,5,{options:{kpis:["p95"]}}),c("n-p50","number",3,5,{options:{kpis:["p50"]}}),c("n-max","number",6,5,{options:{kpis:["max"]}}),c("n-ttfb","number",9,5,{options:{kpis:["ttfb"]}}),c("latency","latency",0,8,{options:{percentiles:["p50","p95","p99"],showTarget:!0}}),c("percentiles","percentiles",6,8),c("h-rel","heading",0,18,{title:"Reliability",options:{note:"Did it answer correctly, every time?"}}),c("n-errors","number",0,20,{options:{kpis:["errors"]}}),c("n-checks","number",3,20,{options:{kpis:["checks"]}}),c("status","status",6,20,{w:6}),c("targets","targets",0,23,{w:6}),c("h-load","heading",0,33,{title:"Load",options:{note:"How much traffic it handled"}}),c("n-rps","number",0,35,{options:{kpis:["throughput"]}}),c("n-peak","number",3,35,{options:{kpis:["peakRps"]}}),c("n-vus","number",6,35,{options:{kpis:["vus"]}}),c("n-total","number",9,35,{options:{kpis:["requests"]}}),c("throughput","throughput",0,38),c("concurrency","concurrency",6,38)]},{id:"builtin-compare",name:"Compare overview",scope:"compare",builtIn:!0,widgets:[c("kpis","kpis",0,0,{kind:"table",h:6,options:{kpis:["throughput","p95","p99","errors","requests"]}}),c("verdict","verdict",0,6,{h:7}),c("latency","latency",0,13,{options:{percentiles:["p95"],showTarget:!0}}),c("throughput","throughput",6,13),c("errors","errors",0,21,{h:7}),c("vus","vus",6,21,{h:7}),c("phases","phases",0,28,{w:12,kind:"table"})]}];function f(e){return d.find(t=>t.scope===e)}let p=(e,t,r)=>Math.min(r,Math.max(t,Math.round(e)));function m(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",n=new Set,a=[];for(let s of Array.isArray(e.widgets)?e.widgets:[]){let e=l[s.metric];if(!e||"compare"===t&&!e.compare)continue;let u="string"==typeof s.id&&s.id?s.id:`${e.id}-${a.length}`;for(;n.has(u);)u=`${u}-x`;n.add(u);let c=e.kinds.includes(s.kind)?s.kind:e.kinds[0],d=p(s.w??e.size.w,e.min.w,12);a.push({id:u,metric:e.id,kind:c,title:"string"==typeof s.title&&s.title.trim()?s.title.trim().slice(0,80):void 0,options:function(e,t){let n=t&&"object"==typeof t?t:{},a=(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=a(n.percentiles,r,e.defaults.percentiles)),e.defaults?.kpis){let t=[...new Set(a(n.kpis,i,e.defaults.kpis))];s.kpis="number"===e.id?t.slice(0,1):t}return e.defaults?.note!==void 0&&(s.note="string"==typeof n.note?n.note.slice(0,200):""),e.defaults?.phases&&(s.phases=a(n.phases,o,e.defaults.phases)),e.defaults?.showTarget!==void 0&&(s.showTarget=n.showTarget??e.defaults.showTarget),Object.keys(s).length?s:void 0}(e,s.options),x:p(s.x??0,0,12-d),y:p(s.y??0,0,1e4),w:d,h:p(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:a}}function h(e){return e.title?e.title:"number"===e.metric?a[e.options?.kpis?.[0]??"p95"]:l[e.metric].label}function g(e){if(!e.title)return"number"===e.metric?s[e.options?.kpis?.[0]??"p95"]:l[e.metric].tech}function v(e){return[...e].sort((e,t)=>e.y-t.y||e.x-t.x)}e.s(["BUILT_IN_VIEWS",0,d,"CHART_KIND_LABEL",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"},"GRID_COLUMNS",0,12,"GRID_ROW_PX",0,36,"KPI_KEYS",0,i,"KPI_LABEL",0,a,"KPI_TECH",0,s,"METRICS",0,l,"PERCENTILE_KEYS",0,r,"PERCENTILE_LABEL",0,n,"PHASE_KEYS",0,o,"PHASE_LABEL",0,{ttfb:"Server time (TTFB)",connect:"TCP connect",tls:"TLS handshake",blocked:"Waiting for a connection"},"defaultViewFor",0,f,"exportLayoutFromView",0,function(e){let t={latency:"latency",throughput:"throughput",status:"status",phases:"phase",percentiles:"percentiles",targets:"thresholds"},r=[];for(let n of v(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},"metricsFor",0,function(e){return u.map(e=>l[e]).filter(t=>"run"===e||t.compare)},"moveWidget",0,function(e,t,r){let n=v(e),i=n.findIndex(e=>e.id===t);if(i<0)return e;if("first"===r||"last"===r){let e=n[i],a=n.filter(e=>e.id!==t);if("first"===r)return[{...e,x:0,y:0},...a.map(t=>({...t,y:t.y+e.h}))];let s=a.reduce((e,t)=>Math.max(e,t.y+t.h),0);return[...a,{...e,x:0,y:s}]}let a="earlier"===r?i-1:i+1;if(a<0||a>=n.length)return e;let s=n[i],o=n[a];return e.map(e=>e.id===s.id?{...e,x:Math.min(o.x,12-e.w),y:o.y}:e.id===o.id?{...e,x:Math.min(s.x,12-e.w),y:s.y}:e)},"newWidget",0,function(e,t){let r=l[e],n=t.reduce((e,t)=>Math.max(e,t.y+t.h),0),i=t.length+1,a=new Set(t.map(e=>e.id));for(;a.has(`${e}-${i}`);)i++;return{id:`${e}-${i}`,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}},"normalizeView",0,m,"normalizeViewsFile",0,function(e){let t=e&&"object"==typeof e?e:{},r=(Array.isArray(t.views)?t.views:[]).map(m).filter(e=>!!e&&!e.builtIn&&!e.id.startsWith("builtin-")),n=[...d,...r],i=(e,t)=>"string"==typeof t&&n.some(r=>r.id===t&&r.scope===e)?t:f(e).id;return{version:1,defaults:{run:i("run",t.defaults?.run),compare:i("compare",t.defaults?.compare)},views:r}},"readingOrder",0,v,"resizeWidget",0,function(e,t,r,n){return e.map(e=>{if(e.id!==t)return e;let i=l[e.metric],a=p(e.w+r,i.min.w,12);return{...e,w:a,h:p(e.h+n,i.min.h,40),x:Math.min(e.x,12-a)}})},"widgetTech",0,g,"widgetTitle",0,h],86483);let y=Object.freeze({status:"aborted"});function b(e,t,r){function n(r,n){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:n,constr:s,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,n);let i=s.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in r||(r[t]=i[t].bind(r))}}let i=r?.Parent??Object;class a extends i{}function s(e){var t;let i=r?.Parent?new a:this;for(let r of(n(i,e),(t=i._zod).deferred??(t.deferred=[]),i._zod.deferred))r();return i}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}let $=Symbol("zod_brand");class x extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class k extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(nw=globalThis).__zod_globalConfig??(nw.__zod_globalConfig={});let w=globalThis.__zod_globalConfig;function _(e){return e&&Object.assign(w,e),w}function S(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 I(e,t="|"){return e.map(e=>V(e)).join(t)}function O(e,t){return"bigint"==typeof t?t.toString():t}function E(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function A(e){return null==e}function N(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function U(e,t){let r=e/t,n=Math.round(r),i=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<i?0:r-n}e.s(["$ZodAsyncError",0,x,"$ZodEncodeError",0,k,"$brand",0,$,"$constructor",0,b,"NEVER",0,y,"config",0,_,"globalConfig",0,w],2108);let j=Symbol("evaluating");function z(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==j)return void 0===n&&(n=j,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function T(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function P(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function M(e){return JSON.stringify(e)}function D(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let Z="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function C(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let L=E(()=>{if(w.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function R(e){if(!1===C(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==C(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function q(e){return R(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let F=new Set(["string","number","symbol"]),B=new Set(["string","number","bigint","boolean","symbol","undefined"]);function J(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function K(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function W(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 V(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function G(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let H={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]},X={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Y(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 Q(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 ee(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function et(e){return"string"==typeof e?e:e?.message}function er(e,t,r){let n=e.message?e.message:et(e.inst?._zod.def?.error?.(e))??et(t?.error?.(e))??et(r.customError?.(e))??et(r.localeError?.(e))??"Invalid input",{inst:i,continue:a,input:s,...o}=e;return o.path??(o.path=[]),o.message=n,t?.reportInput&&(o.input=s),o}function en(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ei(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ea(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 es(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}function eo(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 el(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function eu(){let e,t,r;return{localeError:(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",jwt:"JWT",template_literal:"input"},r={nan:"NaN"},n=>{switch(n.code){case"invalid_type":{let e=r[n.expected]??n.expected,t=ea(n.input),i=r[t]??t;return`Invalid input: expected ${e}, received ${i}`}case"invalid_value":if(1===n.values.length)return`Invalid input: expected ${V(n.values[0])}`;return`Invalid option: expected one of ${I(n.values,"|")}`;case"too_big":{let t=n.inclusive?"<=":"<",r=e[n.origin]??null;if(r)return`Too big: expected ${n.origin??"value"} to have ${t}${n.maximum.toString()} ${r.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${t}${n.maximum.toString()}`}case"too_small":{let t=n.inclusive?">=":">",r=e[n.origin]??null;if(r)return`Too small: expected ${n.origin} to have ${t}${n.minimum.toString()} ${r.unit}`;return`Too small: expected ${n.origin} to be ${t}${n.minimum.toString()}`}case"invalid_format":if("starts_with"===n.format)return`Invalid string: must start with "${n.prefix}"`;if("ends_with"===n.format)return`Invalid string: must end with "${n.suffix}"`;if("includes"===n.format)return`Invalid string: must include "${n.includes}"`;if("regex"===n.format)return`Invalid string: must match pattern ${n.pattern}`;return`Invalid ${t[n.format]??n.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":if(n.options&&Array.isArray(n.options)&&n.options.length>0){let e=n.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}})}}e.s(["BIGINT_FORMAT_RANGES",0,X,"Class",0,class{constructor(...e){}},"NUMBER_FORMAT_RANGES",0,H,"aborted",0,Y,"allowsEval",0,L,"assert",0,function(e){},"assertEqual",0,function(e){return e},"assertIs",0,function(e){},"assertNever",0,function(e){throw Error("Unexpected value in exhaustive check")},"assertNotEqual",0,function(e){return e},"assignProp",0,T,"base64ToUint8Array",0,eo,"base64urlToUint8Array",0,function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return eo(t+r)},"cached",0,E,"captureStackTrace",0,Z,"cleanEnum",0,function(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])},"cleanRegex",0,N,"clone",0,K,"cloneDef",0,function(e){return P(e._zod.def)},"createTransparentProxy",0,function(e){let t;return new Proxy({},{get:(r,n,i)=>(t??(t=e()),Reflect.get(t,n,i)),set:(r,n,i,a)=>(t??(t=e()),Reflect.set(t,n,i,a)),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,i)=>(t??(t=e()),Reflect.defineProperty(t,n,i))})},"defineLazy",0,z,"esc",0,M,"escapeRegex",0,J,"explicitlyAborted",0,Q,"extend",0,function(e,t){if(!R(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=P(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return T(this,"shape",r),r}});return K(e,n)},"finalizeIssue",0,er,"floatSafeRemainder",0,U,"getElementAtPath",0,function(e,t){return t?t.reduce((e,t)=>e?.[t],e):e},"getEnumValues",0,S,"getLengthableOrigin",0,ei,"getParsedType",0,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}`)}},"getSizableOrigin",0,en,"hexToUint8Array",0,function(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},"isObject",0,C,"isPlainObject",0,R,"issue",0,es,"joinValues",0,I,"jsonStringifyReplacer",0,O,"merge",0,function(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=P(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return T(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return K(e,r)},"mergeDefs",0,P,"normalizeParams",0,W,"nullish",0,A,"numKeys",0,function(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t},"objectClone",0,function(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))},"omit",0,function(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 i=P(e._zod.def,{get shape(){let n={...e._zod.def.shape};for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return T(this,"shape",n),n},checks:[]});return K(e,i)},"optionalKeys",0,G,"parsedType",0,ea,"partial",0,function(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=P(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in n))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(let t in n)i[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return T(this,"shape",i),i},checks:[]});return K(t,i)},"pick",0,function(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 i=P(e._zod.def,{get shape(){let e={};for(let n in t){if(!(n in r.shape))throw Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return T(this,"shape",e),e},checks:[]});return K(e,i)},"prefixIssues",0,ee,"primitiveTypes",0,B,"promiseAllObject",0,function(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})},"propertyKeyTypes",0,F,"randomString",0,function(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r},"required",0,function(e,t,r){let n=P(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(let t in n)i[t]=new e({type:"nonoptional",innerType:n[t]});return T(this,"shape",i),i}});return K(t,n)},"safeExtend",0,function(e,t){if(!R(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=P(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return T(this,"shape",r),r}});return K(e,r)},"shallowClone",0,q,"slugify",0,D,"stringifyPrimitive",0,V,"uint8ArrayToBase64",0,el,"uint8ArrayToBase64url",0,function(e){return el(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},"uint8ArrayToHex",0,function(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")},"unwrapMessage",0,et],69547),_(eu()),e.s([],12929),e.i(12929),e.s([],16876),e.i(16876),e.i(2108);let ec=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,O,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ed=b("$ZodError",ec),ef=b("$ZodError",ec,{Parent:Error});function ep(e,t=e=>e.message){let r={},n=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}function em(e,t=e=>e.message){let r={_errors:[]},n=(e,i=[])=>{for(let a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>n({issues:e},[...i,...a.path]));else if("invalid_key"===a.code)n({issues:a.issues},[...i,...a.path]);else if("invalid_element"===a.code)n({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(0===e.length)r._errors.push(t(a));else{let n=r,i=0;for(;i<e.length;){let r=e[i];i===e.length-1?(n[r]=n[r]||{_errors:[]},n[r]._errors.push(t(a))):n[r]=n[r]||{_errors:[]},n=n[r],i++}}}};return n(e),r}function eh(e,t=e=>e.message){let r={errors:[]},n=(e,i=[])=>{var a,s;for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>n({issues:e},[...i,...o.path]));else if("invalid_key"===o.code)n({issues:o.issues},[...i,...o.path]);else if("invalid_element"===o.code)n({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(0===e.length){r.errors.push(t(o));continue}let n=r,l=0;for(;l<e.length;){let r=e[l],i=l===e.length-1;"string"==typeof r?(n.properties??(n.properties={}),(a=n.properties)[r]??(a[r]={errors:[]}),n=n.properties[r]):(n.items??(n.items=[]),(s=n.items)[r]??(s[r]={errors:[]}),n=n.items[r]),i&&n.errors.push(t(o)),l++}}};return n(e),r}function eg(e){let t=[];for(let r of e.map(e=>"object"==typeof e?e.key:e))"number"==typeof r?t.push(`[${r}]`):"symbol"==typeof r?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function ev(e){let t=[];for(let r of[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length))t.push(`✖ ${r.message}`),r.path?.length&&t.push(` → at ${eg(r.path)}`);return t.join("\n")}e.s(["$ZodError",0,ed,"$ZodRealError",0,ef,"flattenError",0,ep,"formatError",0,em,"prettifyError",0,ev,"toDotPath",0,eg,"treeifyError",0,eh],67416);let ey=e=>(t,r,n,i)=>{let a=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new x;if(s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>er(e,a,_())));throw Z(t,i?.callee),t}return s.value},eb=ey(ef),e$=e=>async(t,r,n,i)=>{let a=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>er(e,a,_())));throw Z(t,i?.callee),t}return s.value},ex=e$(ef),ek=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new x;return a.issues.length?{success:!1,error:new(e??ed)(a.issues.map(e=>er(e,i,_())))}:{success:!0,data:a.value}},ew=ek(ef),e_=e=>async(t,r,n)=>{let i=n?{...n,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>er(e,i,_())))}:{success:!0,data:a.value}},eS=e_(ef),eI=e=>(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return ey(e)(t,r,i)},eO=eI(ef),eE=e=>(t,r,n)=>ey(e)(t,r,n),eA=eE(ef),eN=e=>async(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return e$(e)(t,r,i)},eU=eN(ef),ej=e=>async(t,r,n)=>e$(e)(t,r,n),ez=ej(ef),eT=e=>(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return ek(e)(t,r,i)},eP=eT(ef),eM=e=>(t,r,n)=>ek(e)(t,r,n),eD=eM(ef),eZ=e=>async(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return e_(e)(t,r,i)},eC=eZ(ef),eL=e=>async(t,r,n)=>e_(e)(t,r,n),eR=eL(ef);e.s(["_decode",0,eE,"_decodeAsync",0,ej,"_encode",0,eI,"_encodeAsync",0,eN,"_parse",0,ey,"_parseAsync",0,e$,"_safeDecode",0,eM,"_safeDecodeAsync",0,eL,"_safeEncode",0,eT,"_safeEncodeAsync",0,eZ,"_safeParse",0,ek,"_safeParseAsync",0,e_,"decode",0,eA,"decodeAsync",0,ez,"encode",0,eO,"encodeAsync",0,eU,"parse",0,eb,"parseAsync",0,ex,"safeDecode",0,eD,"safeDecodeAsync",0,eR,"safeEncode",0,eP,"safeEncodeAsync",0,eC,"safeParse",0,ew,"safeParseAsync",0,eS],5772),e.i(5772),e.i(67416);let eq=/^[cC][0-9a-z]{6,}$/,eF=/^[0-9a-z]+$/,eB=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,eJ=/^[0-9a-vA-V]{20}$/,eK=/^[A-Za-z0-9]{27}$/,eW=/^[a-zA-Z0-9_-]{21}$/,eV=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,eG=/^([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})$/,eH=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)$/,eX=eH(4),eY=eH(6),eQ=eH(7),e0=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,e1=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function e2(){return RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}let e6=/^(?:(?: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])$/,e4=/^(([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}|:))$/,e5=e=>{let t=J(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},e9=/^((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])$/,e3=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,e8=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,e7=/^[A-Za-z0-9_-]*$/,te=/^https?$/,tt=/^\+[1-9]\d{6,14}$/,tr="(?:(?:\\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])))",tn=RegExp(`^${tr}$`);function ti(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}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ta(e){return RegExp(`^${ti(e)}$`)}function ts(e){let t=ti({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return RegExp(`^${tr}T(?:${n})$`)}let to=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},tl=/^-?\d+n?$/,tu=/^-?\d+$/,tc=/^-?\d+(?:\.\d+)?$/,td=/^(?:true|false)$/i,tf=/^null$/i,tp=/^undefined$/i,tm=/^[^A-Z]*$/,th=/^[^a-z]*$/;function tg(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function tv(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let ty=tg(22,"=="),tb=tv(22),t$=tg(27,"="),tx=tv(27),tk=tg(43,"="),tw=tv(43),t_=tg(64,""),tS=tv(64),tI=tg(86,"=="),tO=tv(86);e.s(["base64",0,e8,"base64url",0,e7,"bigint",0,tl,"boolean",0,td,"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,e9,"cidrv6",0,e3,"cuid",0,eq,"cuid2",0,eF,"date",0,tn,"datetime",0,ts,"domain",0,/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,"duration",0,eV,"e164",0,tt,"email",0,e0,"emoji",0,e2,"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,eG,"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,te,"idnEmail",0,e1,"integer",0,tu,"ipv4",0,e6,"ipv6",0,e4,"ksuid",0,eK,"lowercase",0,tm,"mac",0,e5,"md5_base64",0,ty,"md5_base64url",0,tb,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,eW,"null",0,tf,"number",0,tc,"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,t$,"sha1_base64url",0,tx,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,tk,"sha256_base64url",0,tw,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,t_,"sha384_base64url",0,tS,"sha384_hex",0,/^[0-9a-fA-F]{96}$/,"sha512_base64",0,tI,"sha512_base64url",0,tO,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,to,"time",0,ta,"ulid",0,eB,"undefined",0,tp,"unicodeEmail",0,e1,"uppercase",0,th,"uuid",0,eH,"uuid4",0,eX,"uuid6",0,eY,"uuid7",0,eQ,"xid",0,eJ],53563);let tE=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),tA={number:"number",bigint:"bigint",object:"date"},tN=b("$ZodCheckLessThan",(e,t)=>{tE.init(e,t);let r=tA[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<n&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin: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})}}),tU=b("$ZodCheckGreaterThan",(e,t)=>{tE.init(e,t);let r=tA[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>n&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin: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})}}),tj=b("$ZodCheckMultipleOf",(e,t)=>{tE.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),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?r.value%t.value===BigInt(0):0===U(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})}}),tz=b("$ZodCheckNumberFormat",(e,t)=>{tE.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,a]=H[t.format];e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,n.minimum=i,n.maximum=a,r&&(n.pattern=tu)}),e._zod.check=s=>{let o=s.value;if(r){if(!Number.isInteger(o))return void s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});if(!Number.isSafeInteger(o))return void(o>0?s.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}):s.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<i&&s.issues.push({origin:"number",input:o,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),o>a&&s.issues.push({origin:"number",input:o,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),tT=b("$ZodCheckBigIntFormat",(e,t)=>{tE.init(e,t);let[r,n]=X[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=r,i.maximum=n}),e._zod.check=i=>{let a=i.value;a<r&&i.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>n&&i.issues.push({origin:"bigint",input:a,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),tP=b("$ZodCheckMaxSize",(e,t)=>{var r;tE.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!A(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:en(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tM=b("$ZodCheckMinSize",(e,t)=>{var r;tE.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!A(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:en(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tD=b("$ZodCheckSizeEquals",(e,t)=>{var r;tE.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!A(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=r=>{let n=r.value,i=n.size;if(i===t.size)return;let a=i>t.size;r.issues.push({origin:en(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),tZ=b("$ZodCheckMaxLength",(e,t)=>{var r;tE.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!A(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let i=ei(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tC=b("$ZodCheckMinLength",(e,t)=>{var r;tE.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!A(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let i=ei(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tL=b("$ZodCheckLengthEquals",(e,t)=>{var r;tE.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!A(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let n=r.value,i=n.length;if(i===t.length)return;let a=ei(n),s=i>t.length;r.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),tR=b("$ZodCheckStringFormat",(e,t)=>{var r,n;tE.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),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=()=>{})}),tq=b("$ZodCheckRegex",(e,t)=>{tR.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})}}),tF=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tm),tR.init(e,t)}),tB=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=th),tR.init(e,t)}),tJ=b("$ZodCheckIncludes",(e,t)=>{tE.init(e,t);let r=J(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(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})}}),tK=b("$ZodCheckStartsWith",(e,t)=>{tE.init(e,t);let r=RegExp(`^${J(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(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})}}),tW=b("$ZodCheckEndsWith",(e,t)=>{tE.init(e,t);let r=RegExp(`.*${J(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(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 tV(e,t,r){e.issues.length&&t.issues.push(...ee(r,e.issues))}let tG=b("$ZodCheckProperty",(e,t)=>{tE.init(e,t),e._zod.check=e=>{let r=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(r=>tV(r,e,t.property));tV(r,e,t.property)}}),tH=b("$ZodCheckMimeType",(e,t)=>{tE.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=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})}}),tX=b("$ZodCheckOverwrite",(e,t)=>{tE.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});e.s(["$ZodCheck",0,tE,"$ZodCheckBigIntFormat",0,tT,"$ZodCheckEndsWith",0,tW,"$ZodCheckGreaterThan",0,tU,"$ZodCheckIncludes",0,tJ,"$ZodCheckLengthEquals",0,tL,"$ZodCheckLessThan",0,tN,"$ZodCheckLowerCase",0,tF,"$ZodCheckMaxLength",0,tZ,"$ZodCheckMaxSize",0,tP,"$ZodCheckMimeType",0,tH,"$ZodCheckMinLength",0,tC,"$ZodCheckMinSize",0,tM,"$ZodCheckMultipleOf",0,tj,"$ZodCheckNumberFormat",0,tz,"$ZodCheckOverwrite",0,tX,"$ZodCheckProperty",0,tG,"$ZodCheckRegex",0,tq,"$ZodCheckSizeEquals",0,tD,"$ZodCheckStartsWith",0,tK,"$ZodCheckStringFormat",0,tR,"$ZodCheckUpperCase",0,tB],94320);class tY{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),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(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}e.s(["Doc",0,tY],73885);let tQ={major:4,minor:4,patch:3};e.s(["version",0,tQ],38857);let t0=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tQ;let n=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&n.unshift(e),n))for(let r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let n,i=Y(e);for(let a of t){if(a._zod.def.when){if(Q(e)||!a._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,s=a._zod.check(e);if(s instanceof Promise&&r?.async===!1)throw new x;if(n||s instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(i||(i=Y(e,t)))});else{if(e.issues.length===t)continue;i||(i=Y(e,t))}}return n?n.then(()=>e):e},r=(r,i,a)=>{if(Y(r))return r.aborted=!0,r;let s=t(i,n,a);if(s instanceof Promise){if(!1===a.async)throw new x;return s.then(t=>e._zod.parse(t,a))}return e._zod.parse(s,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if("backward"===a.direction){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,i,a)):r(t,i,a)}let s=e._zod.parse(i,a);if(s instanceof Promise){if(!1===a.async)throw new x;return s.then(e=>t(e,n,a))}return t(s,n,a)}}z(e,"~standard",()=>({validate:t=>{try{let r=ew(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return eS(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),t1=b("$ZodString",(e,t)=>{t0.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??to(e._zod.bag),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}}),t2=b("$ZodStringFormat",(e,t)=>{tR.init(e,t),t1.init(e,t)}),t6=b("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=eG),t2.init(e,t)}),t4=b("$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=eH(e))}else t.pattern??(t.pattern=eH());t2.init(e,t)}),t5=b("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=e0),t2.init(e,t)}),t9=b("$ZodURL",(e,t)=>{t2.init(e,t),e._zod.check=r=>{try{let n=r.value.trim();if(!t.normalize&&t.protocol?.source===te.source&&!/^https?:\/\//i.test(n))return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});let i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),t3=b("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=e2()),t2.init(e,t)}),t8=b("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=eW),t2.init(e,t)}),t7=b("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=eq),t2.init(e,t)}),re=b("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=eF),t2.init(e,t)}),rt=b("$ZodULID",(e,t)=>{t.pattern??(t.pattern=eB),t2.init(e,t)}),rr=b("$ZodXID",(e,t)=>{t.pattern??(t.pattern=eJ),t2.init(e,t)}),rn=b("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=eK),t2.init(e,t)}),ri=b("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ts(t)),t2.init(e,t)}),ra=b("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tn),t2.init(e,t)}),rs=b("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ta(t)),t2.init(e,t)}),ro=b("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eV),t2.init(e,t)}),rl=b("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=e6),t2.init(e,t),e._zod.bag.format="ipv4"}),ru=b("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=e4),t2.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),rc=b("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=e5(t.delimiter)),t2.init(e,t),e._zod.bag.format="mac"}),rd=b("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=e9),t2.init(e,t)}),rf=b("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=e3),t2.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(2!==n.length)throw Error();let[e,t]=n;if(!t)throw Error();let r=Number(t);if(`${r}`!==t||r<0||r>128)throw Error();new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function rp(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let rm=b("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=e8),t2.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{rp(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function rh(e){if(!e7.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return rp(t.padEnd(4*Math.ceil(t.length/4),"="))}let rg=b("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=e7),t2.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{rh(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),rv=b("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tt),t2.init(e,t)});function ry(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}let rb=b("$ZodJWT",(e,t)=>{t2.init(e,t),e._zod.check=r=>{ry(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),r$=b("$ZodCustomStringFormat",(e,t)=>{t2.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})}}),rx=b("$ZodNumber",(e,t)=>{t0.init(e,t),e._zod.pattern=e._zod.bag.pattern??tc,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let i=r.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return r;let a="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),r}}),rk=b("$ZodNumberFormat",(e,t)=>{tz.init(e,t),rx.init(e,t)}),rw=b("$ZodBoolean",(e,t)=>{t0.init(e,t),e._zod.pattern=td,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let i=r.value;return"boolean"==typeof i||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),r_=b("$ZodBigInt",(e,t)=>{t0.init(e,t),e._zod.pattern=tl,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}}),rS=b("$ZodBigIntFormat",(e,t)=>{tT.init(e,t),r_.init(e,t)}),rI=b("$ZodSymbol",(e,t)=>{t0.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return"symbol"==typeof n||t.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),t}}),rO=b("$ZodUndefined",(e,t)=>{t0.init(e,t),e._zod.pattern=tp,e._zod.values=new Set([void 0]),e._zod.parse=(t,r)=>{let n=t.value;return void 0===n||t.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),t}}),rE=b("$ZodNull",(e,t)=>{t0.init(e,t),e._zod.pattern=tf,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let n=t.value;return null===n||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),t}}),rA=b("$ZodAny",(e,t)=>{t0.init(e,t),e._zod.parse=e=>e}),rN=b("$ZodUnknown",(e,t)=>{t0.init(e,t),e._zod.parse=e=>e}),rU=b("$ZodNever",(e,t)=>{t0.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),rj=b("$ZodVoid",(e,t)=>{t0.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}}),rz=b("$ZodDate",(e,t)=>{t0.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let i=r.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:e}),r}});function rT(e,t,r){e.issues.length&&t.issues.push(...ee(r,e.issues)),t.value[r]=e.value}let rP=b("$ZodArray",(e,t)=>{t0.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let s=i[e],o=t.element._zod.run({value:s,issues:[]},n);o instanceof Promise?a.push(o.then(t=>rT(t,r,e))):rT(o,r,e)}return a.length?Promise.all(a).then(()=>r):r}});function rM(e,t,r,n,i,a){let s=r in n;if(e.issues.length){if(i&&a&&!s)return;t.issues.push(...ee(r,e.issues))}if(!s&&!i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?s&&(t.value[r]=void 0):t.value[r]=e.value}function rD(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let r=G(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function rZ(e,t,r,n,i,a){let s=[],o=i.keySet,l=i.catchall._zod,u=l.def.type,c="optional"===l.optin,d="optional"===l.optout;for(let i in t){if("__proto__"===i||o.has(i))continue;if("never"===u){s.push(i);continue}let a=l.run({value:t[i],issues:[]},n);a instanceof Promise?e.push(a.then(e=>rM(e,r,i,t,c,d))):rM(a,r,i,t,c,d)}return(s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:a}),e.length)?Promise.all(e).then(()=>r):r}let rC=b("$ZodObject",(e,t)=>{let r;t0.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}let i=E(()=>rD(t));z(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let n=e[t]._zod;if(n.values)for(let e of(r[t]??(r[t]=new Set),n.values))r[t].add(e)}return r});let a=t.catchall;e._zod.parse=(t,n)=>{r??(r=i.value);let s=t.value;if(!C(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};let o=[],l=r.shape;for(let e of r.keys){let r=l[e],i="optional"===r._zod.optin,a="optional"===r._zod.optout,u=r._zod.run({value:s[e],issues:[]},n);u instanceof Promise?o.push(u.then(r=>rM(r,t,e,s,i,a))):rM(u,t,e,s,i,a)}return a?rZ(o,s,t,n,i.value,e):o.length?Promise.all(o).then(()=>t):t}}),rL=b("$ZodObjectJIT",(e,t)=>{let r,n;rC.init(e,t);let i=e._zod.parse,a=E(()=>rD(t)),s=!w.jitless,o=s&&L.value,l=t.catchall;e._zod.parse=(u,c)=>{n??(n=a.value);let d=u.value;return C(d)?s&&o&&c?.async===!1&&!0!==c.jitless?(r||(r=(e=>{let t=new tY(["shape","payload","ctx"]),r=a.value,n=e=>{let t=M(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let i=Object.create(null),s=0;for(let e of r.keys)i[e]=`key_${s++}`;for(let a of(t.write("const newResult = {};"),r.keys)){let r=i[a],s=M(a),o=e[a],l=o?._zod?.optin==="optional",u=o?._zod?.optout==="optional";t.write(`const ${r} = ${n(a)};`),l&&u?t.write(`
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,22543,e=>{"use strict";var t=e.i(61666),r=e.i(83067),n=e.i(65296);e.s(["Hint",0,function({text:e,label:i="More information"}){let a=(0,r.useRef)(null),s=(0,r.useRef)(null),[o,l]=(0,r.useState)(!1),[u,c]=(0,r.useState)(!1),[d,f]=(0,r.useState)(null),p=o||u;return(0,r.useLayoutEffect)(()=>{if(!p)return f(null);let e=()=>{let e=a.current?.getBoundingClientRect();if(!e)return;let t=Math.min(256,window.innerWidth-32),r=s.current?.offsetHeight??80,n=Math.min(Math.max(16,e.left),window.innerWidth-t-16);f({top:e.bottom+6+r<=window.innerHeight-8?e.bottom+6:Math.max(8,e.top-6-r),left:n})};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)}},[p]),(0,r.useEffect)(()=>{if(!o)return;let e=e=>{let t=e.target;a.current?.contains(t)||s.current?.contains(t)||l(!1)},t=e=>{"Escape"===e.key&&l(!1)};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[o]),(0,t.jsxs)("span",{ref:a,className:"relative inline-flex align-middle",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!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":p,onClick:e=>{e.stopPropagation(),l(e=>!e)},onFocus:()=>c(!0),onBlur:()=>c(!1),children:"?"}),p&&"u">typeof document?(0,n.createPortal)((0,t.jsx)("span",{ref:s,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:()=>c(!0),onMouseLeave:()=>c(!1),children:e}),document.body):null]})}])},39170,e=>{"use strict";var t=e.i(61666),r=e.i(53012),n=e.i(83067);let i=(0,n.createContext)(async()=>!1);function a({options:e,onClose:i}){let s=(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-50 grid place-items-center bg-black/50 p-4 backdrop-blur-sm",onMouseDown:e=>{e.target===e.currentTarget&&i(!1)},children:(0,t.jsxs)("div",{ref:s,role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-title",onKeyDown:function(e){if("Escape"===e.key&&(e.stopPropagation(),i(!1)),"Tab"===e.key){let t=s.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.AlertTriangle,{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:()=>i(!1),children:e.cancelLabel??"Cancel"}),(0,t.jsx)("button",{ref:l,type:"button",className:"btn btn-primary",onClick:()=>i(!0),children:e.confirmLabel??"Continue"})]})]})})}e.s(["ConfirmProvider",0,function({children:e}){let[r,s]=(0,n.useState)(null),o=(0,n.useCallback)(e=>new Promise(t=>s({...e,resolve:t})),[]);return(0,t.jsxs)(i.Provider,{value:o,children:[e,r?(0,t.jsx)(a,{options:r,onClose:function(e){r?.resolve(e),s(null)}}):null]})},"useConfirm",0,function(){return(0,n.useContext)(i)}])},28867,e=>{"use strict";var t=e.i(61666);e.s(["Segmented",0,function({value:e,options:r,onChange:n,label:i,size:a="sm"}){return(0,t.jsx)("div",{role:"group","aria-label":i,className:"inline-flex flex-wrap rounded-md border border-line bg-panel-2 p-0.5",children:r.map(r=>{let i=r.value===e;return(0,t.jsx)("button",{type:"button","aria-pressed":i,title:r.title,onClick:()=>n(r.value),className:`rounded px-2.5 ${"md"===a?"py-1.5 text-sm":"py-1 text-xs"} transition-colors ${i?"bg-panel text-ink shadow-sm":"text-mute hover:text-ink"}`,children:r.label},r.value)})})}])},56396,e=>{"use strict";var t=e.i(61666),r=e.i(17118),n=e.i(42967),i=e.i(87283),a=e.i(27122),s=e.i(83067);let o=(0,s.createContext)(()=>{}),l=1;e.s(["ToastProvider",0,function({children:e}){let[u,c]=(0,s.useState)([]),d=(0,s.useCallback)(e=>c(t=>t.filter(t=>t.id!==e)),[]),f=(0,s.useCallback)((e,t="info")=>{let r=l++;c(n=>[...n.slice(-3),{id:r,tone:t,message:e}]),window.setTimeout(()=>d(r),"error"===t?6e3:3200)},[d]);return(0,t.jsxs)(o.Provider,{value:f,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 s="success"===e.tone?r.CheckCircle2:"error"===e.tone?a.XCircle:n.Info,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)(s,{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:()=>d(e.id),children:(0,t.jsx)(i.X,{size:14})})]},e.id)})})]})},"useToast",0,function(){return(0,s.useContext)(o)}])},59180,e=>{"use strict";var t=e.i(61666),r=e.i(83067);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 i=(e,t)=>fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),a={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=>i("/engine/history/delete",e).then(e=>n(e)),saveCompare:e=>i("/engine/history/compares",e).then(e=>n(e)),import:e=>i("/engine/history/import",e).then(e=>n(e)),reveal:e=>i("/engine/history/reveal",e??{}).then(e=>n(e))},s=(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 a.import({report:t}).catch(()=>void 0);for(let e of Array.isArray(t)?t:[])e?.apis&&!(e.apis.length<2)&&await a.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(["HistoryProvider",0,function({children:e}){let[n,i]=(0,r.useState)(null),[o,u]=(0,r.useState)(null),[c,d]=(0,r.useState)(!0),f=(0,r.useRef)(null),p=(0,r.useCallback)(()=>{if(f.current)return f.current;let e=a.index().then(e=>(i(e),u(null),e)).catch(e=>(u(e instanceof Error?e.message:"History unavailable"),null)).finally(()=>{d(!1),f.current=null});return f.current=e,e},[]);(0,r.useEffect)(()=>{l().finally(()=>void p());let e=()=>void p();return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[p]);let m=(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:p,baselineFor:t=>e.get(t)}},[n,o,c,p]);return(0,t.jsx)(s.Provider,{value:m,children:e})},"historyApi",0,a,"useHistory",0,function(){return(0,r.useContext)(s)}])},99522,e=>{"use strict";var t=e.i(83067);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 i={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 a=(0,t.forwardRef)(({color:e="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:o="",children:l,iconNode:u,...c},d)=>(0,t.createElement)("svg",{ref:d,...i,width:r,height:r,stroke:e,strokeWidth:s?24*Number(a)/Number(r):a,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(["default",0,(e,i)=>{let s=(0,t.forwardRef)(({className:s,...o},l)=>(0,t.createElement)(a,{ref:l,iconNode:i,className:n(`lucide-${r(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,s),...o}));return s.displayName=r(e),s}],99522)},1675,e=>{"use strict";let t=(0,e.i(99522).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,t],1675)},95486,e=>{"use strict";let t=(0,e.i(99522).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],95486)},17118,e=>{"use strict";let t=(0,e.i(99522).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["CheckCircle2",0,t],17118)},27122,e=>{"use strict";let t=(0,e.i(99522).default)("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(["XCircle",0,t],27122)},89932,e=>{"use strict";let t=(0,e.i(99522).default)("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(["Copy",0,t],89932)},75117,e=>{"use strict";let t=(0,e.i(99522).default)("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(["Download",0,t],75117)},67938,e=>{"use strict";let t=(0,e.i(99522).default)("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(["FileUp",0,t],67938)},42967,e=>{"use strict";let t=(0,e.i(99522).default)("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(["Info",0,t],42967)},27813,e=>{"use strict";let t=(0,e.i(99522).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",0,t],27813)},71189,e=>{"use strict";let t=(0,e.i(99522).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],71189)},43514,e=>{"use strict";let t=(0,e.i(99522).default)("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(["Settings2",0,t],43514)},53012,30844,e=>{"use strict";let t=(0,e.i(99522).default)("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(["default",0,t],30844),e.s(["AlertTriangle",0,t],53012)},87283,e=>{"use strict";let t=(0,e.i(99522).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],87283)},53267,(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,a=l(e),s=a[0],o=a[1],u=new i((s+o)*3/4-o),c=0,d=o>0?s-4:s;for(r=0;r<d;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,i=n%3,a=[],s=0,o=n-i;s<o;s+=16383)a.push(function(e,t,n){for(var i,a=[],s=t;s<n;s+=3)i=(e[s]<<16&0xff0000)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}(e,s,s+16383>o?o:s+16383));return 1===i?a.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&a.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),a.join("")};for(var r=[],n=[],i="u">typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=a.length;s<o;++s)r[s]=a[s],n[a.charCodeAt(s)]=s;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),i=r(321),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(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,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!o.isEncoding(i))throw TypeError("Unknown encoding: "+i);var a=0|p(n,i),l=s(a),u=l.write(n,i);return u!==a&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e))return d(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(A(e,ArrayBuffer)||e&&A(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(A(e,SharedArrayBuffer)||e&&A(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 m=function(e){if(o.isBuffer(e)){var t=0|f(e.length),r=s(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)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(m)return m;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),s(e<0?0:0|f(e))}function d(e){for(var t=e.length<0?0:0|f(e.length),r=s(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)?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)};function f(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||A(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 i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return S(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return O(e).length;default:if(i)return n?-1:S(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){var i,a,s,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 i="",a=t;a<r;++a)i+=N[e[a]];return i}(this,t,r);case"utf8":case"utf-8":return y(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return i=this,a=t,s=r,0===a&&s===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(a,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}(this,t,r);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function h(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){var a;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(a=r*=1)!=a&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return v(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){var a,s=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;s=2,o/=2,l/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(a=r;a<o;a++)if(u(e,a)===u(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===l)return c*s}else -1!==c&&(a-=a-c),c=-1}else for(r+l>o&&(r=o-l),a=r;a>=0;a--){for(var d=!0,f=0;f<l;f++)if(u(e,a+f)!==u(t,f)){d=!1;break}if(d)return a}return -1}o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(A(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),A(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,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];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),i=0;for(r=0;r<e.length;++r){var a=e[r];if(A(a,Uint8Array)&&(a=o.from(a)),!o.isBuffer(a))throw TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},o.byteLength=p,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)h(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)h(this,t,t+3),h(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)h(this,t,t+7),h(this,t+1,t+6),h(this,t+2,t+5),h(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?y(this,0,e):m.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+">"},a&&(o.prototype[a]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if(A(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===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var a=i-n,s=r-t,l=Math.min(a,s),u=this.slice(n,i),c=e.slice(t,r),d=0;d<l;++d)if(u[d]!==c[d]){a=u[d],s=c[d];break}return a<s?-1:+(s<a)},o.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)};function y(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,s,o,l,u=e[i],c=null,d=u>239?4:u>223?3:u>191?2:1;if(i+d<=r)switch(d){case 1:u<128&&(c=u);break;case 2:(192&(a=e[i+1]))==128&&(l=(31&u)<<6|63&a)>127&&(c=l);break;case 3:a=e[i+1],s=e[i+2],(192&a)==128&&(192&s)==128&&(l=(15&u)<<12|(63&a)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=e[i+1],s=e[i+2],o=e[i+3],(192&a)==128&&(192&s)==128&&(192&o)==128&&(l=(15&u)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=d}var f=n,p=f.length;if(p<=4096)return String.fromCharCode.apply(String,f);for(var m="",h=0;h<p;)m+=String.fromCharCode.apply(String,f.slice(h,h+=4096));return m}function b(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 $(e,t,r,n,i,a){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function x(e,t,r,n,i,a){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function k(e,t,r,n,a){return t*=1,r>>>=0,a||x(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function w(e,t,r,n,a){return t*=1,r>>>=0,a||x(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.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 i,a,s,o,l,u,c,d,f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;n>a/2&&(n=a/2);for(var s=0;s<n;++s){var o,l=parseInt(t.substr(2*s,2),16);if((o=l)!=o)break;e[r+s]=l}return s}(this,e,t,r);case"utf8":case"utf-8":return i=t,a=r,E(S(e,this.length-i),this,i,a);case"ascii":return s=t,o=r,E(I(e),this,s,o);case"latin1":case"binary":return function(e,t,r,n){return E(I(t),e,r,n)}(this,e,t,r);case"base64":return l=t,u=r,E(O(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,d=r,E(function(e,t){for(var r,n,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i.push(r%256),i.push(n);return i}(e,this.length-c),this,c,d);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!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||b(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(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||b(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||b(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(e,t){return(e>>>=0,t||b(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||b(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||b(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||b(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||b(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||b(e,4,this.length),i.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),i.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),i.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),i.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;$(this,e,t,r,i,0)}var a=1,s=0;for(this[t]=255&e;++s<r&&(a*=256);)this[t+s]=e/a&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;$(this,e,t,r,i,0)}var a=r-1,s=1;for(this[t+a]=255&e;--a>=0&&(s*=256);)this[t+a]=e/s&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||$(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||$(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||$(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||$(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||$(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 i=Math.pow(2,8*r-1);$(this,e,t,r,i-1,-i)}var a=0,s=1,o=0;for(this[t]=255&e;++a<r&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);$(this,e,t,r,i-1,-i)}var a=r-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||$(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||$(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||$(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||$(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||$(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 k(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return k(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return w(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return w(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 i=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 a=i-1;a>=0;--a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},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 i,a=e.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(e=a)}}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(i=t;i<r;++i)this[i]=e;else{var s=o.isBuffer(e)?e:o.from(e,n),l=s.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%l]}return this};var _=/[^+/0-9A-Za-z-_]/g;function S(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return a}function I(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function O(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(_,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function E(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var N=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},321:function(e,t){t.read=function(e,t,r,n,i){var a,s,o=8*i-n-1,l=(1<<o)-1,u=l>>1,c=-7,d=r?i-1:0,f=r?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-c)-1,p>>=-c,c+=o;c>0;a=256*a+e[t+d],d+=f,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=n;c>0;s=256*s+e[t+d],d+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),a-=u}return(p?-1:1)*s*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var s,o,l,u=8*a-i-1,c=(1<<u)-1,d=c>>1,f=5960464477539062e-23*(23===i),p=n?0:a-1,m=n?1:-1,h=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(o=+!!isNaN(t),s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+d>=1?t+=f/l:t+=f*Math.pow(2,1-d),t*l>=2&&(s++,l/=2),s+d>=c?(o=0,s=c):s+d>=1?(o=(t*l-1)*Math.pow(2,i),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&o,p+=m,o/=256,i-=8);for(s=s<<i|o,u+=i;u>0;e[r+p]=255&s,p+=m,s/=256,u-=8);e[r+p-m]|=128*h}}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}},s=!0;try{n[e](r,r.exports,a),s=!1}finally{s&&delete i[e]}return r.exports}a.ab="/ROOT/node_modules/.pnpm/next@16.3.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=a(230)},24856,86483,70632,15487,59100,99112,36163,78451,5305,90372,47253,48191,2385,94122,54608,55658,46306,60617,81609,88491,94713,e=>{"use strict";let t;e.s(["ZodAny",()=>o1,"ZodArray",()=>lt,"ZodBase64",()=>ox,"ZodBase64URL",()=>ow,"ZodBigInt",()=>oB,"ZodBigIntFormat",()=>oK,"ZodBoolean",()=>oq,"ZodCIDRv4",()=>ov,"ZodCIDRv6",()=>ob,"ZodCUID",()=>ot,"ZodCUID2",()=>on,"ZodCatch",()=>lH,"ZodCodec",()=>l2,"ZodCustom",()=>us,"ZodCustomStringFormat",()=>oA,"ZodDate",()=>o7,"ZodDefault",()=>lq,"ZodDiscriminatedUnion",()=>lf,"ZodE164",()=>oS,"ZodEmail",()=>sG,"ZodEmoji",()=>s3,"ZodEnum",()=>lI,"ZodExactOptional",()=>lD,"ZodFile",()=>lU,"ZodFunction",()=>ui,"ZodGUID",()=>sX,"ZodIPv4",()=>od,"ZodIPv6",()=>oh,"ZodIntersection",()=>lm,"ZodJWT",()=>oO,"ZodKSUID",()=>ou,"ZodLazy",()=>ue,"ZodLiteral",()=>lA,"ZodMAC",()=>op,"ZodMap",()=>lk,"ZodNaN",()=>lY,"ZodNanoID",()=>s7,"ZodNever",()=>o5,"ZodNonOptional",()=>lK,"ZodNull",()=>oQ,"ZodNullable",()=>lC,"ZodNumber",()=>oT,"ZodNumberFormat",()=>oM,"ZodObject",()=>li,"ZodOptional",()=>lP,"ZodPipe",()=>l0,"ZodPrefault",()=>lB,"ZodPreprocess",()=>l5,"ZodPromise",()=>ur,"ZodReadonly",()=>l9,"ZodRecord",()=>ly,"ZodSet",()=>l_,"ZodString",()=>sK,"ZodStringFormat",()=>sV,"ZodSuccess",()=>lV,"ZodSymbol",()=>oG,"ZodTemplateLiteral",()=>l8,"ZodTransform",()=>lz,"ZodTuple",()=>lg,"ZodType",()=>sB,"ZodULID",()=>oa,"ZodURL",()=>s4,"ZodUUID",()=>sQ,"ZodUndefined",()=>oX,"ZodUnion",()=>ll,"ZodUnknown",()=>o6,"ZodVoid",()=>o3,"ZodXID",()=>oo,"ZodXor",()=>lc,"_ZodString",()=>sJ,"_default",()=>lF,"_function",()=>ua,"any",()=>o2,"array",()=>lr,"base64",()=>ok,"base64url",()=>o_,"bigint",()=>oJ,"boolean",()=>oF,"catch",()=>lX,"check",()=>uo,"cidrv4",()=>oy,"cidrv6",()=>o$,"codec",()=>l6,"cuid",()=>or,"cuid2",()=>oi,"custom",()=>ul,"date",()=>le,"describe",()=>ud,"discriminatedUnion",()=>lp,"e164",()=>oI,"email",()=>sH,"emoji",()=>s8,"enum",()=>lO,"exactOptional",()=>lZ,"file",()=>lj,"float32",()=>oZ,"float64",()=>oC,"function",()=>ua,"guid",()=>sY,"hash",()=>oz,"hex",()=>oj,"hostname",()=>oU,"httpUrl",()=>s9,"instanceof",()=>up,"int",()=>oD,"int32",()=>oL,"int64",()=>oW,"intersection",()=>lh,"invertCodec",()=>l4,"ipv4",()=>of,"ipv6",()=>og,"json",()=>uh,"jwt",()=>oE,"keyof",()=>ln,"ksuid",()=>oc,"lazy",()=>ut,"literal",()=>lN,"looseObject",()=>lo,"looseRecord",()=>lx,"mac",()=>om,"map",()=>lw,"meta",()=>uf,"nan",()=>lQ,"nanoid",()=>oe,"nativeEnum",()=>lE,"never",()=>o9,"nonoptional",()=>lW,"null",()=>o0,"nullable",()=>lL,"nullish",()=>lR,"number",()=>oP,"object",()=>la,"optional",()=>lM,"partialRecord",()=>l$,"pipe",()=>l1,"prefault",()=>lJ,"preprocess",()=>ug,"promise",()=>un,"readonly",()=>l3,"record",()=>lb,"refine",()=>uu,"set",()=>lS,"strictObject",()=>ls,"string",()=>sW,"stringFormat",()=>oN,"stringbool",()=>um,"success",()=>lG,"superRefine",()=>uc,"symbol",()=>oH,"templateLiteral",()=>l7,"transform",()=>lT,"tuple",()=>lv,"uint32",()=>oR,"uint64",()=>oV,"ulid",()=>os,"undefined",()=>oY,"union",()=>lu,"unknown",()=>o4,"url",()=>s5,"uuid",()=>s0,"uuidv4",()=>s1,"uuidv6",()=>s2,"uuidv7",()=>s6,"void",()=>o8,"xid",()=>ol,"xor",()=>ld],3573),e.s(["ZodISODate",()=>sx,"ZodISODateTime",()=>sb,"ZodISODuration",()=>sS,"ZodISOTime",()=>sw,"date",()=>sk,"datetime",()=>s$,"duration",()=>sI,"time",()=>s_],49648),Date.parse("2026-08-20T10:00:00.000Z");let r=["p50","p90","p95","p99","p999","max"],n={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)"},i=["throughput","peakRps","p95","p50","avg","p99","max","ttfb","errors","checks","vus","requests","dropped","apdex","data","sent","duration"],a={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"},s={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"},o=["ttfb","connect","tls","blocked"],l={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}},u=Object.keys(l);function c(e,t,r,n,i={}){let a=l[t];return{id:e,metric:t,kind:a.kinds[0],x:r,y:n,w:a.size.w,h:a.size.h,options:a.defaults,...i}}let d=[{id:"builtin-overview",name:"Overview",scope:"run",builtIn:!0,widgets:[c("kpis","kpis",0,0),c("verdict","verdict",0,3),c("latency","latency",0,6),c("throughput","throughput",6,6),c("status","status",0,14),c("percentiles","percentiles",6,14,{h:8}),c("phases","phases",0,22),c("targets","targets",6,22),c("config","config",0,29)]},{id:"builtin-developer",name:"Developer",scope:"run",builtIn:!0,widgets:[c("latency","latency",0,0,{w:12,options:{percentiles:["p50","p90","p95","p99","max"],showTarget:!0}}),c("server","serverTime",0,8),c("phases","phases",6,8,{h:8}),c("histogram","histogram",0,16),c("status","status",6,16),c("heatmap","heatmap",0,24),c("targets","targets",0,32),c("codes","statusTable",6,32,{w:6,h:7})]},{id:"builtin-capacity",name:"Capacity",scope:"run",builtIn:!0,widgets:[c("kpis","kpis",0,0,{options:{kpis:["throughput","p95","errors","vus","dropped"]}}),c("concurrency","concurrency",0,3),c("throughput","throughput",6,3),c("latency","latency",0,11,{options:{percentiles:["p95","p99"],showTarget:!0}}),c("vus","vus",6,11,{h:8}),c("errors","errors",0,19),c("dropped","dropped",6,19)]},{id:"builtin-executive",name:"Executive",scope:"run",builtIn:!0,widgets:[c("verdict","verdict",0,0),c("kpis","kpis",0,3,{w:9,options:{kpis:["p95","errors","throughput","requests"]}}),c("apdex","apdex",9,3,{h:3}),c("latency","latency",0,6,{options:{percentiles:["p95"],showTarget:!0}}),c("targets","targets",6,6,{h:8})]},{id:"builtin-topics",name:"By topic",scope:"run",builtIn:!0,widgets:[c("verdict","verdict",0,0),c("h-speed","heading",0,3,{title:"Speed",options:{note:"How fast the API answers"}}),c("n-p95","number",0,5,{options:{kpis:["p95"]}}),c("n-p50","number",3,5,{options:{kpis:["p50"]}}),c("n-max","number",6,5,{options:{kpis:["max"]}}),c("n-ttfb","number",9,5,{options:{kpis:["ttfb"]}}),c("latency","latency",0,8,{options:{percentiles:["p50","p95","p99"],showTarget:!0}}),c("percentiles","percentiles",6,8),c("h-rel","heading",0,18,{title:"Reliability",options:{note:"Did it answer correctly, every time?"}}),c("n-errors","number",0,20,{options:{kpis:["errors"]}}),c("n-checks","number",3,20,{options:{kpis:["checks"]}}),c("status","status",6,20,{w:6}),c("targets","targets",0,23,{w:6}),c("h-load","heading",0,33,{title:"Load",options:{note:"How much traffic it handled"}}),c("n-rps","number",0,35,{options:{kpis:["throughput"]}}),c("n-peak","number",3,35,{options:{kpis:["peakRps"]}}),c("n-vus","number",6,35,{options:{kpis:["vus"]}}),c("n-total","number",9,35,{options:{kpis:["requests"]}}),c("throughput","throughput",0,38),c("concurrency","concurrency",6,38)]},{id:"builtin-compare",name:"Compare overview",scope:"compare",builtIn:!0,widgets:[c("kpis","kpis",0,0,{kind:"table",h:6,options:{kpis:["throughput","p95","p99","errors","requests"]}}),c("verdict","verdict",0,6,{h:7}),c("latency","latency",0,13,{options:{percentiles:["p95"],showTarget:!0}}),c("throughput","throughput",6,13),c("errors","errors",0,21,{h:7}),c("vus","vus",6,21,{h:7}),c("phases","phases",0,28,{w:12,kind:"table"})]}];function f(e){return d.find(t=>t.scope===e)}let p=(e,t,r)=>Math.min(r,Math.max(t,Math.round(e)));function m(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",n=new Set,a=[];for(let s of Array.isArray(e.widgets)?e.widgets:[]){let e=l[s.metric];if(!e||"compare"===t&&!e.compare)continue;let u="string"==typeof s.id&&s.id?s.id:`${e.id}-${a.length}`;for(;n.has(u);)u=`${u}-x`;n.add(u);let c=e.kinds.includes(s.kind)?s.kind:e.kinds[0],d=p(s.w??e.size.w,e.min.w,12);a.push({id:u,metric:e.id,kind:c,title:"string"==typeof s.title&&s.title.trim()?s.title.trim().slice(0,80):void 0,options:function(e,t){let n=t&&"object"==typeof t?t:{},a=(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=a(n.percentiles,r,e.defaults.percentiles)),e.defaults?.kpis){let t=[...new Set(a(n.kpis,i,e.defaults.kpis))];s.kpis="number"===e.id?t.slice(0,1):t}return e.defaults?.note!==void 0&&(s.note="string"==typeof n.note?n.note.slice(0,200):""),e.defaults?.phases&&(s.phases=a(n.phases,o,e.defaults.phases)),e.defaults?.showTarget!==void 0&&(s.showTarget=n.showTarget??e.defaults.showTarget),Object.keys(s).length?s:void 0}(e,s.options),x:p(s.x??0,0,12-d),y:p(s.y??0,0,1e4),w:d,h:p(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:a}}function h(e){return e.title?e.title:"number"===e.metric?a[e.options?.kpis?.[0]??"p95"]:l[e.metric].label}function g(e){if(!e.title)return"number"===e.metric?s[e.options?.kpis?.[0]??"p95"]:l[e.metric].tech}function v(e){return[...e].sort((e,t)=>e.y-t.y||e.x-t.x)}e.s(["BUILT_IN_VIEWS",0,d,"CHART_KIND_LABEL",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"},"GRID_COLUMNS",0,12,"GRID_ROW_PX",0,36,"KPI_KEYS",0,i,"KPI_LABEL",0,a,"KPI_TECH",0,s,"METRICS",0,l,"PERCENTILE_KEYS",0,r,"PERCENTILE_LABEL",0,n,"PHASE_KEYS",0,o,"PHASE_LABEL",0,{ttfb:"Server time (TTFB)",connect:"TCP connect",tls:"TLS handshake",blocked:"Waiting for a connection"},"defaultViewFor",0,f,"exportLayoutFromView",0,function(e){let t={latency:"latency",throughput:"throughput",status:"status",phases:"phase",percentiles:"percentiles",targets:"thresholds"},r=[];for(let n of v(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},"metricsFor",0,function(e){return u.map(e=>l[e]).filter(t=>"run"===e||t.compare)},"moveWidget",0,function(e,t,r){let n=v(e),i=n.findIndex(e=>e.id===t);if(i<0)return e;if("first"===r||"last"===r){let e=n[i],a=n.filter(e=>e.id!==t);if("first"===r)return[{...e,x:0,y:0},...a.map(t=>({...t,y:t.y+e.h}))];let s=a.reduce((e,t)=>Math.max(e,t.y+t.h),0);return[...a,{...e,x:0,y:s}]}let a="earlier"===r?i-1:i+1;if(a<0||a>=n.length)return e;let s=n[i],o=n[a];return e.map(e=>e.id===s.id?{...e,x:Math.min(o.x,12-e.w),y:o.y}:e.id===o.id?{...e,x:Math.min(s.x,12-e.w),y:s.y}:e)},"newWidget",0,function(e,t){let r=l[e],n=t.reduce((e,t)=>Math.max(e,t.y+t.h),0),i=t.length+1,a=new Set(t.map(e=>e.id));for(;a.has(`${e}-${i}`);)i++;return{id:`${e}-${i}`,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}},"normalizeView",0,m,"normalizeViewsFile",0,function(e){let t=e&&"object"==typeof e?e:{},r=(Array.isArray(t.views)?t.views:[]).map(m).filter(e=>!!e&&!e.builtIn&&!e.id.startsWith("builtin-")),n=[...d,...r],i=(e,t)=>"string"==typeof t&&n.some(r=>r.id===t&&r.scope===e)?t:f(e).id;return{version:1,defaults:{run:i("run",t.defaults?.run),compare:i("compare",t.defaults?.compare)},views:r}},"readingOrder",0,v,"resizeWidget",0,function(e,t,r,n){return e.map(e=>{if(e.id!==t)return e;let i=l[e.metric],a=p(e.w+r,i.min.w,12);return{...e,w:a,h:p(e.h+n,i.min.h,40),x:Math.min(e.x,12-a)}})},"widgetTech",0,g,"widgetTitle",0,h],86483);let y=Object.freeze({status:"aborted"});function b(e,t,r){function n(r,n){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:n,constr:s,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,n);let i=s.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in r||(r[t]=i[t].bind(r))}}let i=r?.Parent??Object;class a extends i{}function s(e){var t;let i=r?.Parent?new a:this;for(let r of(n(i,e),(t=i._zod).deferred??(t.deferred=[]),i._zod.deferred))r();return i}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}let $=Symbol("zod_brand");class x extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class k extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(nw=globalThis).__zod_globalConfig??(nw.__zod_globalConfig={});let w=globalThis.__zod_globalConfig;function _(e){return e&&Object.assign(w,e),w}function S(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 I(e,t="|"){return e.map(e=>V(e)).join(t)}function O(e,t){return"bigint"==typeof t?t.toString():t}function E(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function A(e){return null==e}function N(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function U(e,t){let r=e/t,n=Math.round(r),i=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<i?0:r-n}e.s(["$ZodAsyncError",0,x,"$ZodEncodeError",0,k,"$brand",0,$,"$constructor",0,b,"NEVER",0,y,"config",0,_,"globalConfig",0,w],2108);let j=Symbol("evaluating");function z(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==j)return void 0===n&&(n=j,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function T(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function P(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function M(e){return JSON.stringify(e)}function D(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let Z="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function C(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let L=E(()=>{if(w.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function R(e){if(!1===C(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==C(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function q(e){return R(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let F=new Set(["string","number","symbol"]),B=new Set(["string","number","bigint","boolean","symbol","undefined"]);function J(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function K(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function W(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 V(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function G(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let H={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]},X={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Y(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 Q(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 ee(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function et(e){return"string"==typeof e?e:e?.message}function er(e,t,r){let n=e.message?e.message:et(e.inst?._zod.def?.error?.(e))??et(t?.error?.(e))??et(r.customError?.(e))??et(r.localeError?.(e))??"Invalid input",{inst:i,continue:a,input:s,...o}=e;return o.path??(o.path=[]),o.message=n,t?.reportInput&&(o.input=s),o}function en(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ei(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ea(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 es(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}function eo(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 el(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function eu(){let e,t,r;return{localeError:(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",jwt:"JWT",template_literal:"input"},r={nan:"NaN"},n=>{switch(n.code){case"invalid_type":{let e=r[n.expected]??n.expected,t=ea(n.input),i=r[t]??t;return`Invalid input: expected ${e}, received ${i}`}case"invalid_value":if(1===n.values.length)return`Invalid input: expected ${V(n.values[0])}`;return`Invalid option: expected one of ${I(n.values,"|")}`;case"too_big":{let t=n.inclusive?"<=":"<",r=e[n.origin]??null;if(r)return`Too big: expected ${n.origin??"value"} to have ${t}${n.maximum.toString()} ${r.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${t}${n.maximum.toString()}`}case"too_small":{let t=n.inclusive?">=":">",r=e[n.origin]??null;if(r)return`Too small: expected ${n.origin} to have ${t}${n.minimum.toString()} ${r.unit}`;return`Too small: expected ${n.origin} to be ${t}${n.minimum.toString()}`}case"invalid_format":if("starts_with"===n.format)return`Invalid string: must start with "${n.prefix}"`;if("ends_with"===n.format)return`Invalid string: must end with "${n.suffix}"`;if("includes"===n.format)return`Invalid string: must include "${n.includes}"`;if("regex"===n.format)return`Invalid string: must match pattern ${n.pattern}`;return`Invalid ${t[n.format]??n.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":if(n.options&&Array.isArray(n.options)&&n.options.length>0){let e=n.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}})}}e.s(["BIGINT_FORMAT_RANGES",0,X,"Class",0,class{constructor(...e){}},"NUMBER_FORMAT_RANGES",0,H,"aborted",0,Y,"allowsEval",0,L,"assert",0,function(e){},"assertEqual",0,function(e){return e},"assertIs",0,function(e){},"assertNever",0,function(e){throw Error("Unexpected value in exhaustive check")},"assertNotEqual",0,function(e){return e},"assignProp",0,T,"base64ToUint8Array",0,eo,"base64urlToUint8Array",0,function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return eo(t+r)},"cached",0,E,"captureStackTrace",0,Z,"cleanEnum",0,function(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])},"cleanRegex",0,N,"clone",0,K,"cloneDef",0,function(e){return P(e._zod.def)},"createTransparentProxy",0,function(e){let t;return new Proxy({},{get:(r,n,i)=>(t??(t=e()),Reflect.get(t,n,i)),set:(r,n,i,a)=>(t??(t=e()),Reflect.set(t,n,i,a)),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,i)=>(t??(t=e()),Reflect.defineProperty(t,n,i))})},"defineLazy",0,z,"esc",0,M,"escapeRegex",0,J,"explicitlyAborted",0,Q,"extend",0,function(e,t){if(!R(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=P(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return T(this,"shape",r),r}});return K(e,n)},"finalizeIssue",0,er,"floatSafeRemainder",0,U,"getElementAtPath",0,function(e,t){return t?t.reduce((e,t)=>e?.[t],e):e},"getEnumValues",0,S,"getLengthableOrigin",0,ei,"getParsedType",0,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}`)}},"getSizableOrigin",0,en,"hexToUint8Array",0,function(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},"isObject",0,C,"isPlainObject",0,R,"issue",0,es,"joinValues",0,I,"jsonStringifyReplacer",0,O,"merge",0,function(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=P(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return T(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return K(e,r)},"mergeDefs",0,P,"normalizeParams",0,W,"nullish",0,A,"numKeys",0,function(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t},"objectClone",0,function(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))},"omit",0,function(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 i=P(e._zod.def,{get shape(){let n={...e._zod.def.shape};for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return T(this,"shape",n),n},checks:[]});return K(e,i)},"optionalKeys",0,G,"parsedType",0,ea,"partial",0,function(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=P(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in n))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(let t in n)i[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return T(this,"shape",i),i},checks:[]});return K(t,i)},"pick",0,function(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 i=P(e._zod.def,{get shape(){let e={};for(let n in t){if(!(n in r.shape))throw Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return T(this,"shape",e),e},checks:[]});return K(e,i)},"prefixIssues",0,ee,"primitiveTypes",0,B,"promiseAllObject",0,function(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})},"propertyKeyTypes",0,F,"randomString",0,function(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r},"required",0,function(e,t,r){let n=P(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(let t in n)i[t]=new e({type:"nonoptional",innerType:n[t]});return T(this,"shape",i),i}});return K(t,n)},"safeExtend",0,function(e,t){if(!R(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=P(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return T(this,"shape",r),r}});return K(e,r)},"shallowClone",0,q,"slugify",0,D,"stringifyPrimitive",0,V,"uint8ArrayToBase64",0,el,"uint8ArrayToBase64url",0,function(e){return el(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},"uint8ArrayToHex",0,function(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")},"unwrapMessage",0,et],69547),_(eu()),e.s([],12929),e.i(12929),e.s([],16876),e.i(16876),e.i(2108);let ec=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,O,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ed=b("$ZodError",ec),ef=b("$ZodError",ec,{Parent:Error});function ep(e,t=e=>e.message){let r={},n=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}function em(e,t=e=>e.message){let r={_errors:[]},n=(e,i=[])=>{for(let a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>n({issues:e},[...i,...a.path]));else if("invalid_key"===a.code)n({issues:a.issues},[...i,...a.path]);else if("invalid_element"===a.code)n({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(0===e.length)r._errors.push(t(a));else{let n=r,i=0;for(;i<e.length;){let r=e[i];i===e.length-1?(n[r]=n[r]||{_errors:[]},n[r]._errors.push(t(a))):n[r]=n[r]||{_errors:[]},n=n[r],i++}}}};return n(e),r}function eh(e,t=e=>e.message){let r={errors:[]},n=(e,i=[])=>{var a,s;for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>n({issues:e},[...i,...o.path]));else if("invalid_key"===o.code)n({issues:o.issues},[...i,...o.path]);else if("invalid_element"===o.code)n({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(0===e.length){r.errors.push(t(o));continue}let n=r,l=0;for(;l<e.length;){let r=e[l],i=l===e.length-1;"string"==typeof r?(n.properties??(n.properties={}),(a=n.properties)[r]??(a[r]={errors:[]}),n=n.properties[r]):(n.items??(n.items=[]),(s=n.items)[r]??(s[r]={errors:[]}),n=n.items[r]),i&&n.errors.push(t(o)),l++}}};return n(e),r}function eg(e){let t=[];for(let r of e.map(e=>"object"==typeof e?e.key:e))"number"==typeof r?t.push(`[${r}]`):"symbol"==typeof r?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function ev(e){let t=[];for(let r of[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length))t.push(`✖ ${r.message}`),r.path?.length&&t.push(` → at ${eg(r.path)}`);return t.join("\n")}e.s(["$ZodError",0,ed,"$ZodRealError",0,ef,"flattenError",0,ep,"formatError",0,em,"prettifyError",0,ev,"toDotPath",0,eg,"treeifyError",0,eh],67416);let ey=e=>(t,r,n,i)=>{let a=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new x;if(s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>er(e,a,_())));throw Z(t,i?.callee),t}return s.value},eb=ey(ef),e$=e=>async(t,r,n,i)=>{let a=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>er(e,a,_())));throw Z(t,i?.callee),t}return s.value},ex=e$(ef),ek=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new x;return a.issues.length?{success:!1,error:new(e??ed)(a.issues.map(e=>er(e,i,_())))}:{success:!0,data:a.value}},ew=ek(ef),e_=e=>async(t,r,n)=>{let i=n?{...n,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>er(e,i,_())))}:{success:!0,data:a.value}},eS=e_(ef),eI=e=>(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return ey(e)(t,r,i)},eO=eI(ef),eE=e=>(t,r,n)=>ey(e)(t,r,n),eA=eE(ef),eN=e=>async(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return e$(e)(t,r,i)},eU=eN(ef),ej=e=>async(t,r,n)=>e$(e)(t,r,n),ez=ej(ef),eT=e=>(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return ek(e)(t,r,i)},eP=eT(ef),eM=e=>(t,r,n)=>ek(e)(t,r,n),eD=eM(ef),eZ=e=>async(t,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return e_(e)(t,r,i)},eC=eZ(ef),eL=e=>async(t,r,n)=>e_(e)(t,r,n),eR=eL(ef);e.s(["_decode",0,eE,"_decodeAsync",0,ej,"_encode",0,eI,"_encodeAsync",0,eN,"_parse",0,ey,"_parseAsync",0,e$,"_safeDecode",0,eM,"_safeDecodeAsync",0,eL,"_safeEncode",0,eT,"_safeEncodeAsync",0,eZ,"_safeParse",0,ek,"_safeParseAsync",0,e_,"decode",0,eA,"decodeAsync",0,ez,"encode",0,eO,"encodeAsync",0,eU,"parse",0,eb,"parseAsync",0,ex,"safeDecode",0,eD,"safeDecodeAsync",0,eR,"safeEncode",0,eP,"safeEncodeAsync",0,eC,"safeParse",0,ew,"safeParseAsync",0,eS],5772),e.i(5772),e.i(67416);let eq=/^[cC][0-9a-z]{6,}$/,eF=/^[0-9a-z]+$/,eB=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,eJ=/^[0-9a-vA-V]{20}$/,eK=/^[A-Za-z0-9]{27}$/,eW=/^[a-zA-Z0-9_-]{21}$/,eV=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,eG=/^([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})$/,eH=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)$/,eX=eH(4),eY=eH(6),eQ=eH(7),e0=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,e1=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function e2(){return RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}let e6=/^(?:(?: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])$/,e4=/^(([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}|:))$/,e5=e=>{let t=J(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},e9=/^((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])$/,e3=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,e8=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,e7=/^[A-Za-z0-9_-]*$/,te=/^https?$/,tt=/^\+[1-9]\d{6,14}$/,tr="(?:(?:\\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])))",tn=RegExp(`^${tr}$`);function ti(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}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ta(e){return RegExp(`^${ti(e)}$`)}function ts(e){let t=ti({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return RegExp(`^${tr}T(?:${n})$`)}let to=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},tl=/^-?\d+n?$/,tu=/^-?\d+$/,tc=/^-?\d+(?:\.\d+)?$/,td=/^(?:true|false)$/i,tf=/^null$/i,tp=/^undefined$/i,tm=/^[^A-Z]*$/,th=/^[^a-z]*$/;function tg(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function tv(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let ty=tg(22,"=="),tb=tv(22),t$=tg(27,"="),tx=tv(27),tk=tg(43,"="),tw=tv(43),t_=tg(64,""),tS=tv(64),tI=tg(86,"=="),tO=tv(86);e.s(["base64",0,e8,"base64url",0,e7,"bigint",0,tl,"boolean",0,td,"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,e9,"cidrv6",0,e3,"cuid",0,eq,"cuid2",0,eF,"date",0,tn,"datetime",0,ts,"domain",0,/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,"duration",0,eV,"e164",0,tt,"email",0,e0,"emoji",0,e2,"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,eG,"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,te,"idnEmail",0,e1,"integer",0,tu,"ipv4",0,e6,"ipv6",0,e4,"ksuid",0,eK,"lowercase",0,tm,"mac",0,e5,"md5_base64",0,ty,"md5_base64url",0,tb,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,eW,"null",0,tf,"number",0,tc,"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,t$,"sha1_base64url",0,tx,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,tk,"sha256_base64url",0,tw,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,t_,"sha384_base64url",0,tS,"sha384_hex",0,/^[0-9a-fA-F]{96}$/,"sha512_base64",0,tI,"sha512_base64url",0,tO,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,to,"time",0,ta,"ulid",0,eB,"undefined",0,tp,"unicodeEmail",0,e1,"uppercase",0,th,"uuid",0,eH,"uuid4",0,eX,"uuid6",0,eY,"uuid7",0,eQ,"xid",0,eJ],53563);let tE=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),tA={number:"number",bigint:"bigint",object:"date"},tN=b("$ZodCheckLessThan",(e,t)=>{tE.init(e,t);let r=tA[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<n&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin: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})}}),tU=b("$ZodCheckGreaterThan",(e,t)=>{tE.init(e,t);let r=tA[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>n&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin: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})}}),tj=b("$ZodCheckMultipleOf",(e,t)=>{tE.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),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?r.value%t.value===BigInt(0):0===U(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})}}),tz=b("$ZodCheckNumberFormat",(e,t)=>{tE.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,a]=H[t.format];e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,n.minimum=i,n.maximum=a,r&&(n.pattern=tu)}),e._zod.check=s=>{let o=s.value;if(r){if(!Number.isInteger(o))return void s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});if(!Number.isSafeInteger(o))return void(o>0?s.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}):s.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<i&&s.issues.push({origin:"number",input:o,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),o>a&&s.issues.push({origin:"number",input:o,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),tT=b("$ZodCheckBigIntFormat",(e,t)=>{tE.init(e,t);let[r,n]=X[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=r,i.maximum=n}),e._zod.check=i=>{let a=i.value;a<r&&i.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>n&&i.issues.push({origin:"bigint",input:a,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),tP=b("$ZodCheckMaxSize",(e,t)=>{var r;tE.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!A(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:en(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tM=b("$ZodCheckMinSize",(e,t)=>{var r;tE.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!A(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:en(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tD=b("$ZodCheckSizeEquals",(e,t)=>{var r;tE.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!A(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=r=>{let n=r.value,i=n.size;if(i===t.size)return;let a=i>t.size;r.issues.push({origin:en(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),tZ=b("$ZodCheckMaxLength",(e,t)=>{var r;tE.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!A(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let i=ei(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tC=b("$ZodCheckMinLength",(e,t)=>{var r;tE.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!A(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let i=ei(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tL=b("$ZodCheckLengthEquals",(e,t)=>{var r;tE.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!A(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let n=r.value,i=n.length;if(i===t.length)return;let a=ei(n),s=i>t.length;r.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),tR=b("$ZodCheckStringFormat",(e,t)=>{var r,n;tE.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),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=()=>{})}),tq=b("$ZodCheckRegex",(e,t)=>{tR.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})}}),tF=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tm),tR.init(e,t)}),tB=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=th),tR.init(e,t)}),tJ=b("$ZodCheckIncludes",(e,t)=>{tE.init(e,t);let r=J(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(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})}}),tK=b("$ZodCheckStartsWith",(e,t)=>{tE.init(e,t);let r=RegExp(`^${J(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(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})}}),tW=b("$ZodCheckEndsWith",(e,t)=>{tE.init(e,t);let r=RegExp(`.*${J(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(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 tV(e,t,r){e.issues.length&&t.issues.push(...ee(r,e.issues))}let tG=b("$ZodCheckProperty",(e,t)=>{tE.init(e,t),e._zod.check=e=>{let r=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(r=>tV(r,e,t.property));tV(r,e,t.property)}}),tH=b("$ZodCheckMimeType",(e,t)=>{tE.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=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})}}),tX=b("$ZodCheckOverwrite",(e,t)=>{tE.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});e.s(["$ZodCheck",0,tE,"$ZodCheckBigIntFormat",0,tT,"$ZodCheckEndsWith",0,tW,"$ZodCheckGreaterThan",0,tU,"$ZodCheckIncludes",0,tJ,"$ZodCheckLengthEquals",0,tL,"$ZodCheckLessThan",0,tN,"$ZodCheckLowerCase",0,tF,"$ZodCheckMaxLength",0,tZ,"$ZodCheckMaxSize",0,tP,"$ZodCheckMimeType",0,tH,"$ZodCheckMinLength",0,tC,"$ZodCheckMinSize",0,tM,"$ZodCheckMultipleOf",0,tj,"$ZodCheckNumberFormat",0,tz,"$ZodCheckOverwrite",0,tX,"$ZodCheckProperty",0,tG,"$ZodCheckRegex",0,tq,"$ZodCheckSizeEquals",0,tD,"$ZodCheckStartsWith",0,tK,"$ZodCheckStringFormat",0,tR,"$ZodCheckUpperCase",0,tB],94320);class tY{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),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(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}e.s(["Doc",0,tY],73885);let tQ={major:4,minor:4,patch:3};e.s(["version",0,tQ],38857);let t0=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tQ;let n=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&n.unshift(e),n))for(let r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let n,i=Y(e);for(let a of t){if(a._zod.def.when){if(Q(e)||!a._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,s=a._zod.check(e);if(s instanceof Promise&&r?.async===!1)throw new x;if(n||s instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(i||(i=Y(e,t)))});else{if(e.issues.length===t)continue;i||(i=Y(e,t))}}return n?n.then(()=>e):e},r=(r,i,a)=>{if(Y(r))return r.aborted=!0,r;let s=t(i,n,a);if(s instanceof Promise){if(!1===a.async)throw new x;return s.then(t=>e._zod.parse(t,a))}return e._zod.parse(s,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if("backward"===a.direction){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,i,a)):r(t,i,a)}let s=e._zod.parse(i,a);if(s instanceof Promise){if(!1===a.async)throw new x;return s.then(e=>t(e,n,a))}return t(s,n,a)}}z(e,"~standard",()=>({validate:t=>{try{let r=ew(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return eS(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),t1=b("$ZodString",(e,t)=>{t0.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??to(e._zod.bag),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}}),t2=b("$ZodStringFormat",(e,t)=>{tR.init(e,t),t1.init(e,t)}),t6=b("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=eG),t2.init(e,t)}),t4=b("$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=eH(e))}else t.pattern??(t.pattern=eH());t2.init(e,t)}),t5=b("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=e0),t2.init(e,t)}),t9=b("$ZodURL",(e,t)=>{t2.init(e,t),e._zod.check=r=>{try{let n=r.value.trim();if(!t.normalize&&t.protocol?.source===te.source&&!/^https?:\/\//i.test(n))return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});let i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),t3=b("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=e2()),t2.init(e,t)}),t8=b("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=eW),t2.init(e,t)}),t7=b("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=eq),t2.init(e,t)}),re=b("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=eF),t2.init(e,t)}),rt=b("$ZodULID",(e,t)=>{t.pattern??(t.pattern=eB),t2.init(e,t)}),rr=b("$ZodXID",(e,t)=>{t.pattern??(t.pattern=eJ),t2.init(e,t)}),rn=b("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=eK),t2.init(e,t)}),ri=b("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ts(t)),t2.init(e,t)}),ra=b("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tn),t2.init(e,t)}),rs=b("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ta(t)),t2.init(e,t)}),ro=b("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eV),t2.init(e,t)}),rl=b("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=e6),t2.init(e,t),e._zod.bag.format="ipv4"}),ru=b("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=e4),t2.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),rc=b("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=e5(t.delimiter)),t2.init(e,t),e._zod.bag.format="mac"}),rd=b("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=e9),t2.init(e,t)}),rf=b("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=e3),t2.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(2!==n.length)throw Error();let[e,t]=n;if(!t)throw Error();let r=Number(t);if(`${r}`!==t||r<0||r>128)throw Error();new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function rp(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let rm=b("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=e8),t2.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{rp(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function rh(e){if(!e7.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return rp(t.padEnd(4*Math.ceil(t.length/4),"="))}let rg=b("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=e7),t2.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{rh(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),rv=b("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tt),t2.init(e,t)});function ry(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}let rb=b("$ZodJWT",(e,t)=>{t2.init(e,t),e._zod.check=r=>{ry(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),r$=b("$ZodCustomStringFormat",(e,t)=>{t2.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})}}),rx=b("$ZodNumber",(e,t)=>{t0.init(e,t),e._zod.pattern=e._zod.bag.pattern??tc,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let i=r.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return r;let a="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),r}}),rk=b("$ZodNumberFormat",(e,t)=>{tz.init(e,t),rx.init(e,t)}),rw=b("$ZodBoolean",(e,t)=>{t0.init(e,t),e._zod.pattern=td,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let i=r.value;return"boolean"==typeof i||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),r_=b("$ZodBigInt",(e,t)=>{t0.init(e,t),e._zod.pattern=tl,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}}),rS=b("$ZodBigIntFormat",(e,t)=>{tT.init(e,t),r_.init(e,t)}),rI=b("$ZodSymbol",(e,t)=>{t0.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return"symbol"==typeof n||t.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),t}}),rO=b("$ZodUndefined",(e,t)=>{t0.init(e,t),e._zod.pattern=tp,e._zod.values=new Set([void 0]),e._zod.parse=(t,r)=>{let n=t.value;return void 0===n||t.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),t}}),rE=b("$ZodNull",(e,t)=>{t0.init(e,t),e._zod.pattern=tf,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let n=t.value;return null===n||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),t}}),rA=b("$ZodAny",(e,t)=>{t0.init(e,t),e._zod.parse=e=>e}),rN=b("$ZodUnknown",(e,t)=>{t0.init(e,t),e._zod.parse=e=>e}),rU=b("$ZodNever",(e,t)=>{t0.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),rj=b("$ZodVoid",(e,t)=>{t0.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}}),rz=b("$ZodDate",(e,t)=>{t0.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let i=r.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:e}),r}});function rT(e,t,r){e.issues.length&&t.issues.push(...ee(r,e.issues)),t.value[r]=e.value}let rP=b("$ZodArray",(e,t)=>{t0.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let s=i[e],o=t.element._zod.run({value:s,issues:[]},n);o instanceof Promise?a.push(o.then(t=>rT(t,r,e))):rT(o,r,e)}return a.length?Promise.all(a).then(()=>r):r}});function rM(e,t,r,n,i,a){let s=r in n;if(e.issues.length){if(i&&a&&!s)return;t.issues.push(...ee(r,e.issues))}if(!s&&!i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?s&&(t.value[r]=void 0):t.value[r]=e.value}function rD(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let r=G(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function rZ(e,t,r,n,i,a){let s=[],o=i.keySet,l=i.catchall._zod,u=l.def.type,c="optional"===l.optin,d="optional"===l.optout;for(let i in t){if("__proto__"===i||o.has(i))continue;if("never"===u){s.push(i);continue}let a=l.run({value:t[i],issues:[]},n);a instanceof Promise?e.push(a.then(e=>rM(e,r,i,t,c,d))):rM(a,r,i,t,c,d)}return(s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:a}),e.length)?Promise.all(e).then(()=>r):r}let rC=b("$ZodObject",(e,t)=>{let r;t0.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}let i=E(()=>rD(t));z(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let n=e[t]._zod;if(n.values)for(let e of(r[t]??(r[t]=new Set),n.values))r[t].add(e)}return r});let a=t.catchall;e._zod.parse=(t,n)=>{r??(r=i.value);let s=t.value;if(!C(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};let o=[],l=r.shape;for(let e of r.keys){let r=l[e],i="optional"===r._zod.optin,a="optional"===r._zod.optout,u=r._zod.run({value:s[e],issues:[]},n);u instanceof Promise?o.push(u.then(r=>rM(r,t,e,s,i,a))):rM(u,t,e,s,i,a)}return a?rZ(o,s,t,n,i.value,e):o.length?Promise.all(o).then(()=>t):t}}),rL=b("$ZodObjectJIT",(e,t)=>{let r,n;rC.init(e,t);let i=e._zod.parse,a=E(()=>rD(t)),s=!w.jitless,o=s&&L.value,l=t.catchall;e._zod.parse=(u,c)=>{n??(n=a.value);let d=u.value;return C(d)?s&&o&&c?.async===!1&&!0!==c.jitless?(r||(r=(e=>{let t=new tY(["shape","payload","ctx"]),r=a.value,n=e=>{let t=M(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let i=Object.create(null),s=0;for(let e of r.keys)i[e]=`key_${s++}`;for(let a of(t.write("const newResult = {};"),r.keys)){let r=i[a],s=M(a),o=e[a],l=o?._zod?.optin==="optional",u=o?._zod?.optout==="optional";t.write(`const ${r} = ${n(a)};`),l&&u?t.write(`
2
2
  if (${r}.issues.length) {
3
3
  if (${s} in input) {
4
4
  payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
@@ -259,7 +259,7 @@ function __atcCheck(check, res) {
259
259
  }
260
260
  return false;
261
261
  }
262
- `,e.s(["JSON_TYPES",0,["string","number","integer","boolean","array","object","null"],"checkLabel",0,function(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 /${uE(e.value)}/`;return`body ${"contains"===e.op?"contains":"does not contain"} "${uE(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} > ${uE(e.value)}`;case"less":return`${r} < ${uE(e.value)}`;case"matches":return`${r} matches /${uE(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"} "${uE(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 /${uE(e.value)}/`;return`header ${e.name} ${"equals"===e.op?"=":"contains"} "${uE(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 "${uE(t)}"`:"body matches the JSON schema"}}},"responseCheckSchema",0,uO,"schemaFromValue",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]:[],i=[...new Set([...n(t),...n(r)])];i.includes("integer")&&i.includes("number")&&(i=i.filter(e=>"integer"!==e));let a={type:1===i.length?i[0]:i};if(t.properties||r.properties){let n=t.properties??{},i=r.properties??{},s=[...new Set([...Object.keys(n),...Object.keys(i)])];a.properties=Object.fromEntries(s.map(t=>[t,n[t]&&i[t]?e(n[t],i[t]):n[t]??i[t]]));let o=new Set(t.required??(t.properties?[]:Object.keys(i))),l=new Set(r.required??(r.properties?[]:Object.keys(n)));a.required=s.filter(e=>o.has(e)&&l.has(e))}return(t.items||r.items)&&(a.items=t.items&&r.items?e(t.items,r.items):t.items??r.items),a})}:{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 uI=uI;String.raw`
262
+ `,e.s(["JSON_TYPES",0,["string","number","integer","boolean","array","object","null"],"checkLabel",0,function(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 /${uE(e.value)}/`;return`body ${"contains"===e.op?"contains":"does not contain"} "${uE(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} > ${uE(e.value)}`;case"less":return`${r} < ${uE(e.value)}`;case"matches":return`${r} matches /${uE(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"} "${uE(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 /${uE(e.value)}/`;return`header ${e.name} ${"equals"===e.op?"=":"contains"} "${uE(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 "${uE(t)}"`:"body matches the JSON schema"}}},"responseCheckSchema",0,uO,"schemaFromValue",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]:[],i=[...new Set([...n(t),...n(r)])];i.includes("integer")&&i.includes("number")&&(i=i.filter(e=>"integer"!==e));let a={type:1===i.length?i[0]:i};if(t.properties||r.properties){let n=t.properties??{},i=r.properties??{},s=[...new Set([...Object.keys(n),...Object.keys(i)])];a.properties=Object.fromEntries(s.map(t=>[t,n[t]&&i[t]?e(n[t],i[t]):n[t]??i[t]]));let o=new Set(t.required??(t.properties?[]:Object.keys(i))),l=new Set(r.required??(r.properties?[]:Object.keys(n)));a.required=s.filter(e=>o.has(e)&&l.has(e))}return(t.items||r.items)&&(a.items=t.items&&r.items?e(t.items,r.items):t.items??r.items),a})}:{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 uI=uI;function uA(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`
263
263
  function __atcScriptText(v) {
264
264
  if (typeof v === "string") return v;
265
265
  if (v === undefined) return "undefined";
@@ -349,7 +349,7 @@ function __atcExpect(actual) {
349
349
  self.status = function (code) { return check(actual && actual.code === code, "expected status " + code + " (it is " + (actual && actual.code) + ")", "expected status not to be " + code); };
350
350
  return self;
351
351
  }
352
- function __atcScriptRun(fn, input) {
352
+ function __atcScriptStart(fn, input, host) {
353
353
  var out = { request: input.request, set: {}, unset: [], tests: [], logs: [] };
354
354
  var vars = {};
355
355
  for (var k in input.vars) vars[k] = input.vars[k];
@@ -408,13 +408,11 @@ function __atcScriptRun(fn, input) {
408
408
  addHeader: function (h) { request.headers.add ? request.headers.add(h) : null; },
409
409
  removeHeader: function (name) { request.headers.remove ? request.headers.remove(name) : null; }
410
410
  };
411
- var response;
412
- if (input.response) {
413
- var r = input.response;
411
+ function makeResponse(r) {
414
412
  var rh = [];
415
413
  for (var hk in r.headers) rh.push([hk, r.headers[hk]]);
416
414
  var parsed;
417
- response = {
415
+ var response = {
418
416
  code: r.code,
419
417
  status: String(r.code),
420
418
  responseTime: r.responseTime,
@@ -448,8 +446,69 @@ function __atcScriptRun(fn, input) {
448
446
  };
449
447
  to.not = { have: { status: function (code) { if (r.code === code) throw new Error("expected status not to be " + code); return true; } } };
450
448
  response.to = to;
449
+ return response;
450
+ }
451
+ var response = input.response ? makeResponse(input.response) : undefined;
452
+ var legacyTests = {};
453
+ var state = { out: out, done: false, bodyDone: false, pending: 0, sends: 0, listeners: [] };
454
+ function fail(e) { if (!out.error) out.error = String(e && e.message || e).slice(0, 500); }
455
+ // Finished when the script body has run (an async one: settled) and nothing is outstanding.
456
+ function settle() {
457
+ if (state.done || !state.bodyDone || state.pending > 0) return;
458
+ state.done = true;
459
+ for (var t in legacyTests) out.tests.push({ name: t, ok: !!legacyTests[t] });
460
+ for (var i = 0; i < state.listeners.length; i++) state.listeners[i](out);
461
+ }
462
+ // pm.sendRequest(url | { url, method, header, body }, callback?) — Postman's, both styles.
463
+ function normRequest(req) {
464
+ if (typeof req === "string") return { method: "GET", url: store.replaceIn(req), headers: {} };
465
+ if (!req || typeof req !== "object") throw new Error("pm.sendRequest needs an address or { url, method, header, body }");
466
+ 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() : "";
467
+ if (!url) throw new Error("pm.sendRequest: the request has no url");
468
+ var headers = {};
469
+ var h = req.header !== undefined ? req.header : req.headers;
470
+ 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)); }
471
+ 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()); } }
472
+ else if (h && typeof h === "object") { for (var k in h) headers[k] = store.replaceIn(String(h[k])); }
473
+ var hasType = function () { for (var n in headers) if (n.toLowerCase() === "content-type") return true; return false; };
474
+ var body;
475
+ var b = req.body;
476
+ if (typeof b === "string") body = b;
477
+ else if (b && typeof b === "object") {
478
+ if (b.mode === "raw" || (b.mode === undefined && typeof b.raw === "string")) body = String(b.raw === undefined ? "" : b.raw);
479
+ else if (b.mode === "urlencoded" || b.mode === "formdata") {
480
+ var pairs = Array.isArray(b[b.mode]) ? b[b.mode] : [];
481
+ var parts = [];
482
+ 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))));
483
+ body = parts.join("&");
484
+ if (!hasType()) headers["Content-Type"] = "application/x-www-form-urlencoded";
485
+ } else if (b.mode === "graphql" && b.graphql) {
486
+ body = JSON.stringify({ query: b.graphql.query, variables: typeof b.graphql.variables === "string" ? JSON.parse(b.graphql.variables || "{}") : b.graphql.variables || {} });
487
+ if (!hasType()) headers["Content-Type"] = "application/json";
488
+ }
489
+ if (body !== undefined) body = store.replaceIn(body);
490
+ }
491
+ return { method: String(req.method || "GET").toUpperCase(), url: store.replaceIn(url), headers: headers, body: body };
492
+ }
493
+ function sendRequest(req, cb) {
494
+ if (!host || typeof host.send !== "function") throw new Error("pm.sendRequest isn't available here");
495
+ if (++state.sends > 20) throw new Error("A script can make at most 20 requests with pm.sendRequest");
496
+ var norm = normRequest(req);
497
+ state.pending++;
498
+ return new Promise(function (resolve, reject) {
499
+ host.send(norm, function (err, raw) {
500
+ var res = raw ? makeResponse(raw) : undefined;
501
+ var e = err ? new Error(String(err)) : null;
502
+ if (typeof cb === "function") {
503
+ try { cb(e, res); } catch (x) { fail(x); }
504
+ resolve(res);
505
+ } else if (e) reject(e);
506
+ else resolve(res);
507
+ state.pending--;
508
+ settle();
509
+ });
510
+ });
451
511
  }
452
- var notHere = function () { throw new Error("pm.sendRequest isn't supported yet — use Run first to make a request before this one"); };
453
512
  var pm = {
454
513
  environment: store, variables: store, collectionVariables: store, globals: store,
455
514
  iterationData: { get: store.get, has: store.has, toObject: store.toObject },
@@ -457,11 +516,20 @@ function __atcScriptRun(fn, input) {
457
516
  response: response,
458
517
  info: { requestName: input.name, iteration: input.iteration, eventName: input.phase === "pre" ? "prerequest" : "test" },
459
518
  test: function (name, f) {
460
- try { f(); out.tests.push({ name: String(name), ok: true }); }
461
- catch (e) { out.tests.push({ name: String(name), ok: false, error: String(e && e.message || e).slice(0, 300) }); }
519
+ var at = out.tests.length;
520
+ var bad = function (e) { out.tests[at] = { name: String(name), ok: false, error: String(e && e.message || e).slice(0, 300) }; };
521
+ out.tests.push({ name: String(name), ok: true });
522
+ try {
523
+ var ret = f();
524
+ // An async test (it awaits pm.sendRequest, say) counts when it settles.
525
+ if (ret && typeof ret.then === "function") {
526
+ state.pending++;
527
+ ret.then(function () { state.pending--; settle(); }, function (e) { bad(e); state.pending--; settle(); });
528
+ }
529
+ } catch (e) { bad(e); }
462
530
  },
463
531
  expect: __atcExpect,
464
- sendRequest: notHere,
532
+ sendRequest: sendRequest,
465
533
  require: function (name) { throw new Error("require(\"" + name + "\") isn't available in scripts"); }
466
534
  };
467
535
  pm.test.skip = function (name) { out.tests.push({ name: String(name) + " (skipped)", ok: true }); };
@@ -470,24 +538,42 @@ function __atcScriptRun(fn, input) {
470
538
  setEnvironmentVariable: store.set, getEnvironmentVariable: store.get, clearEnvironmentVariable: store.unset,
471
539
  setGlobalVariable: store.set, getGlobalVariable: store.get, clearGlobalVariable: store.unset
472
540
  };
473
- var legacyTests = {};
474
541
  var r0 = input.response;
475
542
  try {
476
- fn(pm, con, postman, legacyTests,
543
+ var ret = fn(pm, con, postman, legacyTests,
477
544
  r0 ? r0.body : undefined, r0 ? { code: r0.code } : undefined, r0 ? r0.responseTime : undefined, r0 ? r0.headers : undefined,
478
545
  store.toObject(), store.toObject());
546
+ if (ret && typeof ret.then === "function") ret.then(function () { state.bodyDone = true; settle(); }, function (e) { fail(e); state.bodyDone = true; settle(); });
547
+ else state.bodyDone = true;
479
548
  } catch (e) {
480
- out.error = String(e && e.message || e).slice(0, 500);
549
+ fail(e);
550
+ state.bodyDone = true;
481
551
  }
482
- // Old-style tests["name"] = true.
483
- for (var t in legacyTests) out.tests.push({ name: t, ok: !!legacyTests[t] });
484
- return out;
552
+ // Old-style tests["name"] = true are added in settle().
553
+ settle();
554
+ return state;
555
+ }
556
+ /** Run to the end when nothing is asynchronous (tests, and sendRequest answered at once). */
557
+ function __atcScriptRun(fn, input, host) {
558
+ return __atcScriptStart(fn, input, host).out;
559
+ }
560
+ /** Run, and resolve when the script and every pm.sendRequest it made have finished. */
561
+ function __atcScriptRunAsync(fn, input, host) {
562
+ var st = __atcScriptStart(fn, input, host);
563
+ if (st.done) return Promise.resolve(st.out);
564
+ return new Promise(function (resolve) { st.listeners.push(resolve); });
485
565
  }
486
566
  `,String.raw`
487
567
  function __atcScriptCompile(code) {
488
- return new Function("pm", "console", "postman", "tests", "responseBody", "responseCode", "responseTime", "responseHeaders", "environment", "globals", code);
568
+ var params = ["pm", "console", "postman", "tests", "responseBody", "responseCode", "responseTime", "responseHeaders", "environment", "globals"];
569
+ // A script that awaits (const res = await pm.sendRequest(…)) runs as an async function.
570
+ if (/\bawait\b/.test(code)) {
571
+ var AsyncFunction = Object.getPrototypeOf(async function () {}).constructor;
572
+ return AsyncFunction.apply(null, params.concat([code]));
573
+ }
574
+ return Function.apply(null, params.concat([code]));
489
575
  }
490
- `;let uA=uI.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),uN=uI.string().regex(/^\d+(\.\d+)?(ms|s|m|h)$/,"Use a duration like 30s, 5m, or 1h"),uU=uI.string().min(1).refine(e=>!/^authorization$/i.test(e)&&!/^cookie$/i.test(e),{message:"Put credentials on auth, not on request headers"}),uj=uI.object({key:uI.string().min(1),value:uI.string()}),uz=uI.object({key:uU,value:uI.string()}),uT=uI.discriminatedUnion("mode",[uI.object({mode:uI.literal("none")}).strict(),uI.object({mode:uI.literal("json"),json:uI.unknown()}).strict(),uI.object({mode:uI.literal("text"),text:uI.string()}).strict(),uI.object({mode:uI.literal("form"),fields:uI.array(uj)}).strict(),uI.object({mode:uI.literal("raw"),raw:uI.string(),contentType:uI.string().min(1)}).strict()]),uP=uI.object({method:uA,url:uI.string().min(1).refine(e=>e.startsWith("/")||/^https?:\/\//i.test(e),{message:"URL must be http(s) or a path starting with /"}),query:uI.array(uj).default([]),headers:uI.array(uz).default([]),body:uT.default({mode:"none"}),expectedStatus:uI.array(uI.number().int().min(0).max(599)).default([]),checks:uI.array(uO).max(20).default([])}).strict(),uM=uI.object({duration:uN,target:uI.number().int().min(0).max(1e5)}).strict();function uD(e){return"constant-arrival-rate"===e||"ramping-arrival-rate"===e}let uZ=uI.object({executor:uI.enum(["constant-vus","ramping-vus","constant-arrival-rate","ramping-arrival-rate"]),vus:uI.number().int().min(1).max(500).default(10),rate:uI.number().int().min(1).max(1e5).optional(),maxVUs:uI.number().int().min(1).max(2e3).optional(),startVUs:uI.number().int().min(0).max(500).default(0),duration:uN.default("30s"),stages:uI.array(uM).default([]),thinkTimeMs:uI.number().min(0).default(0),thinkJitterMs:uI.number().min(0).default(0),gracefulStop:uN.default("10s")}).strict().superRefine((e,t)=>{("ramping-vus"===e.executor||"ramping-arrival-rate"===e.executor)&&0===e.stages.length&&t.addIssue({code:uI.ZodIssueCode.custom,message:`${e.executor} requires at least one stage`,path:["stages"]}),"constant-arrival-rate"!==e.executor||e.rate||t.addIssue({code:uI.ZodIssueCode.custom,message:"constant-arrival-rate needs a rate",path:["rate"]}),!uD(e.executor)&&e.stages.some(e=>e.target>500)&&t.addIssue({code:uI.ZodIssueCode.custom,message:"A stage can use at most 500 virtual users",path:["stages"]})}),uC=uI.object({p95Ms:uI.number().positive().optional(),p99Ms:uI.number().positive().optional(),errorRate:uI.number().min(0).max(1).optional(),checksRate:uI.number().min(0).max(1).optional(),abortOnFail:uI.boolean().default(!1)}).strict(),uL=uI.object({source:uI.enum(["http_req_duration","http_req_failed","http_reqs"]),agg:uI.enum(["p95","p99","rate","count"]),op:uI.enum(["<","<=",">",">="]),value:uI.number()}).strict(),uR=uI.object({timeout:uN.default("60s"),maxRedirects:uI.number().int().min(0).max(20).default(5),httpVersion:uI.enum(["1.1","2"]).default("1.1"),tlsSkipVerify:uI.boolean().default(!1),connectionReuse:uI.boolean().default(!0),cookies:uI.boolean().default(!0)}).strict(),uq=uI.object({grant:uI.enum(["client_credentials","password","authorization_code","jwt_bearer","saml_bearer"]),tokenUrl:uI.string().url(),authUrl:uI.string().default(""),redirectUri:uI.string().default(""),clientId:uI.string().default(""),clientSecret:uI.string().default(""),scope:uI.string().default(""),username:uI.string().default(""),password:uI.string().default(""),clientAuth:uI.enum(["basic","body","private_key_jwt"]).default("basic"),privateKey:uI.string().default(""),assertionAlgorithm:uI.enum(["RS256","RS384","RS512","PS256","ES256","ES384"]).default("RS256"),issuer:uI.string().default(""),subject:uI.string().default(""),audience:uI.string().default(""),kid:uI.string().default(""),certificate:uI.string().default(""),extraClaims:uI.string().default(""),samlSource:uI.enum(["idp","assertion"]).default("idp"),idpUrl:uI.string().default(""),userId:uI.string().default(""),companyId:uI.string().default(""),assertion:uI.string().default(""),pkce:uI.boolean().default(!0),extra:uI.array(uj).max(20).default([])}).strict(),uF=uI.discriminatedUnion("mode",[uI.object({mode:uI.literal("oauth2"),oauth:uq}).strict(),uI.object({mode:uI.literal("digest"),username:uI.string().min(1),password:uI.string()}).strict(),uI.object({mode:uI.literal("ntlm"),username:uI.string().min(1),password:uI.string(),domain:uI.string().default("")}).strict(),uI.object({mode:uI.literal("jwt"),algorithm:uI.enum(["HS256","HS384","HS512","RS256","RS384","RS512","PS256","ES256","ES384","ES512"]),key:uI.string().min(1),payload:uI.string().max(2e4).default("{}"),lifetimeSec:uI.number().int().min(10).max(31536e3).default(3600),kid:uI.string().default(""),headerName:uI.string().min(1).default("Authorization"),prefix:uI.string().default("Bearer")}).strict(),uI.object({mode:uI.literal("oauth1"),consumerKey:uI.string().min(1),consumerSecret:uI.string(),token:uI.string().default(""),tokenSecret:uI.string().default(""),signatureMethod:uI.enum(["HMAC-SHA256","HMAC-SHA1","PLAINTEXT"]).default("HMAC-SHA256"),realm:uI.string().default(""),addTo:uI.enum(["header","query"]).default("header")}).strict(),uI.object({mode:uI.literal("aws_sigv4"),accessKeyId:uI.string().min(1),secretAccessKey:uI.string().min(1),sessionToken:uI.string().default(""),region:uI.string().min(1),service:uI.string().min(1)}).strict(),uI.object({mode:uI.literal("none")}).strict(),uI.object({mode:uI.literal("bearer"),token:uI.string().min(1)}).strict(),uI.object({mode:uI.literal("basic"),username:uI.string().min(1),password:uI.string()}).strict(),uI.object({mode:uI.literal("api_key"),name:uI.string().min(1),value:uI.string().min(1),in:uI.enum(["header","query"]).default("header")}).strict()]),uB=/^[A-Za-z_][\w.-]*$/,uJ=uI.string().max(60).regex(uB,"Use letters, numbers, _ . or - (start with a letter)"),uK=uI.object({name:uJ,from:uI.enum(["json","header","body"]),path:uI.string().min(1).max(300)}).strict(),uW=uI.object({label:uI.string().min(1).max(120),request:uP,auth:uF.default({mode:"none"}),options:uR.prefault({}),extract:uI.array(uK).min(1).max(20)}).strict(),uV=uI.object({fileName:uI.string().max(200).default("data.csv"),columns:uI.array(uJ).min(1).max(50),rows:uI.array(uI.array(uI.string().max(1e4))).min(1).max(1e5),order:uI.enum(["sequential","random","per-user"]).default("sequential")}).strict();function uG(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"]})}uI.object({id:uI.string().uuid().optional(),name:uI.string().min(1).max(120),request:uP,auth:uF.default({mode:"none"}),load:uZ,thresholds:uI.array(uL).default([]),options:uR.prefault({})}).strict();let uH=uI.object({pre:uI.string().max(1e5).default(""),post:uI.string().max(1e5).default("")}).strict();function uX(e){return e.replace(/^\s*Bearer\s+/i,"").trim()}function uY(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}}uI.object({request:uP,auth:uF.default({mode:"none"}),options:uR.prefault({}),setup:uW.optional(),data:uV.optional(),save:uI.array(uK).max(20).optional(),scripts:uH.optional()}).strict().superRefine(uG),uI.object({name:uI.string().min(1).max(120).default("Lab run"),request:uP,auth:uF.default({mode:"none"}),options:uR.prefault({}),load:uZ,targets:uC.optional(),setup:uW.optional(),data:uV.optional(),save:uI.array(uK).max(20).optional(),scripts:uH.optional()}).strict().superRefine(uG);let uQ={thinkTimeMs:0,thinkJitterMs:0,gracefulStop:"10s"},u0={smoke:{vus:2,duration:"30s",rampUp:"0s",rampDown:"0s",...uQ},average:{vus:10,duration:"5m",rampUp:"0s",rampDown:"0s",...uQ},stress:{vus:20,duration:"1m",rampUp:"30s",rampDown:"30s",...uQ},spike:{vus:50,duration:"1m",rampUp:"10s",rampDown:"10s",...uQ,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",...uQ}};function u1(e){let t={thinkTimeMs:e.thinkTimeMs,thinkJitterMs:e.thinkJitterMs,gracefulStop:e.gracefulStop},r=uY(e.rampUp),n=uY(e.rampDown),i=e.stages&&e.stages.length>0?e.stages:null;if("rate"===e.mode){let a=Math.max(1,Math.min(2e3,e.maxVus??100)),s=i?Math.max(1,...i.map(e=>e.target)):Math.max(1,e.rps??10),o={vus:Math.max(1,Math.min(a,500,Math.ceil(s/10))),maxVUs:a,startVUs:0,duration:e.duration,...t};if(i)return{executor:"ramping-arrival-rate",...o,stages:i};if(r<=0&&n<=0)return{executor:"constant-arrival-rate",...o,rate:s,stages:[]};let l=[];return r>0&&l.push({duration:e.rampUp,target:s}),l.push({duration:e.duration,target:s}),n>0&&l.push({duration:e.rampDown,target:0}),{executor:"ramping-arrival-rate",...o,stages:l}}if(i)return{executor:"ramping-vus",vus:Math.max(1,...i.map(e=>e.target)),startVUs:0,duration:e.duration,stages:i,...t};if(r<=0&&n<=0)return{executor:"constant-vus",vus:e.vus,startVUs:0,duration:e.duration,stages:[],...t};let a=[];return r>0&&a.push({duration:e.rampUp,target:e.vus}),a.push({duration:e.duration,target:e.vus}),n>0&&a.push({duration:e.rampDown,target:0}),{executor:"ramping-vus",vus:e.vus,startVUs:r>0?0:e.vus,duration:e.duration,stages:a,...t}}function u2(e){return[...e.setup?.extract.map(e=>e.name)??[],...e.data?.columns??[]]}function u6(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}}e.s(["LOAD_KNOB_PRESETS",0,u0,"VARIABLE_NAME",0,uB,"durationToMs",0,uY,"extractRuleSchema",0,uK,"isArrivalRate",0,uD,"loadFromLabKnobs",0,u1,"normalizeBearerToken",0,uX,"testDataSchema",0,uV],59100),String.raw`
576
+ `,e.s(["SCRIPT_MAX",0,1e5,"scriptSetNames",0,uA],15487);let uN=uI.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),uU=uI.string().regex(/^\d+(\.\d+)?(ms|s|m|h)$/,"Use a duration like 30s, 5m, or 1h"),uj=uI.string().min(1).refine(e=>!/^authorization$/i.test(e)&&!/^cookie$/i.test(e),{message:"Put credentials on auth, not on request headers"}),uz=uI.object({key:uI.string().min(1),value:uI.string()}),uT=uI.object({key:uj,value:uI.string()}),uP=uI.discriminatedUnion("mode",[uI.object({mode:uI.literal("none")}).strict(),uI.object({mode:uI.literal("json"),json:uI.unknown()}).strict(),uI.object({mode:uI.literal("text"),text:uI.string()}).strict(),uI.object({mode:uI.literal("form"),fields:uI.array(uz)}).strict(),uI.object({mode:uI.literal("raw"),raw:uI.string(),contentType:uI.string().min(1)}).strict()]),uM=uI.object({method:uN,url:uI.string().min(1).refine(e=>e.startsWith("/")||/^https?:\/\//i.test(e),{message:"URL must be http(s) or a path starting with /"}),query:uI.array(uz).default([]),headers:uI.array(uT).default([]),body:uP.default({mode:"none"}),expectedStatus:uI.array(uI.number().int().min(0).max(599)).default([]),checks:uI.array(uO).max(20).default([])}).strict(),uD=uI.object({duration:uU,target:uI.number().int().min(0).max(1e5)}).strict();function uZ(e){return"constant-arrival-rate"===e||"ramping-arrival-rate"===e}let uC=uI.object({executor:uI.enum(["constant-vus","ramping-vus","constant-arrival-rate","ramping-arrival-rate"]),vus:uI.number().int().min(1).max(500).default(10),rate:uI.number().int().min(1).max(1e5).optional(),maxVUs:uI.number().int().min(1).max(2e3).optional(),startVUs:uI.number().int().min(0).max(500).default(0),duration:uU.default("30s"),stages:uI.array(uD).default([]),thinkTimeMs:uI.number().min(0).default(0),thinkJitterMs:uI.number().min(0).default(0),gracefulStop:uU.default("10s")}).strict().superRefine((e,t)=>{("ramping-vus"===e.executor||"ramping-arrival-rate"===e.executor)&&0===e.stages.length&&t.addIssue({code:uI.ZodIssueCode.custom,message:`${e.executor} requires at least one stage`,path:["stages"]}),"constant-arrival-rate"!==e.executor||e.rate||t.addIssue({code:uI.ZodIssueCode.custom,message:"constant-arrival-rate needs a rate",path:["rate"]}),!uZ(e.executor)&&e.stages.some(e=>e.target>500)&&t.addIssue({code:uI.ZodIssueCode.custom,message:"A stage can use at most 500 virtual users",path:["stages"]})}),uL=uI.object({p95Ms:uI.number().positive().optional(),p99Ms:uI.number().positive().optional(),errorRate:uI.number().min(0).max(1).optional(),checksRate:uI.number().min(0).max(1).optional(),abortOnFail:uI.boolean().default(!1)}).strict(),uR=uI.object({source:uI.enum(["http_req_duration","http_req_failed","http_reqs"]),agg:uI.enum(["p95","p99","rate","count"]),op:uI.enum(["<","<=",">",">="]),value:uI.number()}).strict(),uq=uI.object({timeout:uU.default("60s"),maxRedirects:uI.number().int().min(0).max(20).default(5),httpVersion:uI.enum(["1.1","2"]).default("1.1"),tlsSkipVerify:uI.boolean().default(!1),connectionReuse:uI.boolean().default(!0),cookies:uI.boolean().default(!0)}).strict(),uF=uI.object({grant:uI.enum(["client_credentials","password","authorization_code","jwt_bearer","saml_bearer"]),tokenUrl:uI.string().url(),authUrl:uI.string().default(""),redirectUri:uI.string().default(""),clientId:uI.string().default(""),clientSecret:uI.string().default(""),scope:uI.string().default(""),username:uI.string().default(""),password:uI.string().default(""),clientAuth:uI.enum(["basic","body","private_key_jwt"]).default("basic"),privateKey:uI.string().default(""),assertionAlgorithm:uI.enum(["RS256","RS384","RS512","PS256","ES256","ES384"]).default("RS256"),issuer:uI.string().default(""),subject:uI.string().default(""),audience:uI.string().default(""),kid:uI.string().default(""),certificate:uI.string().default(""),extraClaims:uI.string().default(""),samlSource:uI.enum(["idp","assertion"]).default("idp"),idpUrl:uI.string().default(""),userId:uI.string().default(""),companyId:uI.string().default(""),assertion:uI.string().default(""),pkce:uI.boolean().default(!0),extra:uI.array(uz).max(20).default([])}).strict(),uB=uI.discriminatedUnion("mode",[uI.object({mode:uI.literal("oauth2"),oauth:uF}).strict(),uI.object({mode:uI.literal("digest"),username:uI.string().min(1),password:uI.string()}).strict(),uI.object({mode:uI.literal("ntlm"),username:uI.string().min(1),password:uI.string(),domain:uI.string().default("")}).strict(),uI.object({mode:uI.literal("jwt"),algorithm:uI.enum(["HS256","HS384","HS512","RS256","RS384","RS512","PS256","ES256","ES384","ES512"]),key:uI.string().min(1),payload:uI.string().max(2e4).default("{}"),lifetimeSec:uI.number().int().min(10).max(31536e3).default(3600),kid:uI.string().default(""),headerName:uI.string().min(1).default("Authorization"),prefix:uI.string().default("Bearer")}).strict(),uI.object({mode:uI.literal("oauth1"),consumerKey:uI.string().min(1),consumerSecret:uI.string(),token:uI.string().default(""),tokenSecret:uI.string().default(""),signatureMethod:uI.enum(["HMAC-SHA256","HMAC-SHA1","PLAINTEXT"]).default("HMAC-SHA256"),realm:uI.string().default(""),addTo:uI.enum(["header","query"]).default("header")}).strict(),uI.object({mode:uI.literal("aws_sigv4"),accessKeyId:uI.string().min(1),secretAccessKey:uI.string().min(1),sessionToken:uI.string().default(""),region:uI.string().min(1),service:uI.string().min(1)}).strict(),uI.object({mode:uI.literal("none")}).strict(),uI.object({mode:uI.literal("bearer"),token:uI.string().min(1)}).strict(),uI.object({mode:uI.literal("basic"),username:uI.string().min(1),password:uI.string()}).strict(),uI.object({mode:uI.literal("api_key"),name:uI.string().min(1),value:uI.string().min(1),in:uI.enum(["header","query"]).default("header")}).strict()]),uJ=/^[A-Za-z_][\w.-]*$/,uK=uI.string().max(60).regex(uJ,"Use letters, numbers, _ . or - (start with a letter)"),uW=uI.object({name:uK,from:uI.enum(["json","header","body"]),path:uI.string().min(1).max(300)}).strict(),uV=uI.object({label:uI.string().min(1).max(120),request:uM,auth:uB.default({mode:"none"}),options:uq.prefault({}),extract:uI.array(uW).min(1).max(20)}).strict(),uG=uI.object({fileName:uI.string().max(200).default("data.csv"),columns:uI.array(uK).min(1).max(50),rows:uI.array(uI.array(uI.string().max(1e4))).min(1).max(1e5),order:uI.enum(["sequential","random","per-user"]).default("sequential")}).strict();function uH(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"]})}uI.object({id:uI.string().uuid().optional(),name:uI.string().min(1).max(120),request:uM,auth:uB.default({mode:"none"}),load:uC,thresholds:uI.array(uR).default([]),options:uq.prefault({})}).strict();let uX=uI.object({pre:uI.string().max(1e5).default(""),post:uI.string().max(1e5).default("")}).strict();function uY(e){return e.replace(/^\s*Bearer\s+/i,"").trim()}function uQ(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}}uI.object({request:uM,auth:uB.default({mode:"none"}),options:uq.prefault({}),setup:uV.optional(),data:uG.optional(),save:uI.array(uW).max(20).optional(),scripts:uX.optional(),live:uI.boolean().optional()}).strict().superRefine(uH),uI.object({name:uI.string().min(1).max(120).default("Lab run"),request:uM,auth:uB.default({mode:"none"}),options:uq.prefault({}),load:uC,targets:uL.optional(),setup:uV.optional(),data:uG.optional(),save:uI.array(uW).max(20).optional(),scripts:uX.optional()}).strict().superRefine(uH);let u0={thinkTimeMs:0,thinkJitterMs:0,gracefulStop:"10s"},u1={smoke:{vus:2,duration:"30s",rampUp:"0s",rampDown:"0s",...u0},average:{vus:10,duration:"5m",rampUp:"0s",rampDown:"0s",...u0},stress:{vus:20,duration:"1m",rampUp:"30s",rampDown:"30s",...u0},spike:{vus:50,duration:"1m",rampUp:"10s",rampDown:"10s",...u0,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",...u0}};function u2(e){let t={thinkTimeMs:e.thinkTimeMs,thinkJitterMs:e.thinkJitterMs,gracefulStop:e.gracefulStop},r=uQ(e.rampUp),n=uQ(e.rampDown),i=e.stages&&e.stages.length>0?e.stages:null;if("rate"===e.mode){let a=Math.max(1,Math.min(2e3,e.maxVus??100)),s=i?Math.max(1,...i.map(e=>e.target)):Math.max(1,e.rps??10),o={vus:Math.max(1,Math.min(a,500,Math.ceil(s/10))),maxVUs:a,startVUs:0,duration:e.duration,...t};if(i)return{executor:"ramping-arrival-rate",...o,stages:i};if(r<=0&&n<=0)return{executor:"constant-arrival-rate",...o,rate:s,stages:[]};let l=[];return r>0&&l.push({duration:e.rampUp,target:s}),l.push({duration:e.duration,target:s}),n>0&&l.push({duration:e.rampDown,target:0}),{executor:"ramping-arrival-rate",...o,stages:l}}if(i)return{executor:"ramping-vus",vus:Math.max(1,...i.map(e=>e.target)),startVUs:0,duration:e.duration,stages:i,...t};if(r<=0&&n<=0)return{executor:"constant-vus",vus:e.vus,startVUs:0,duration:e.duration,stages:[],...t};let a=[];return r>0&&a.push({duration:e.rampUp,target:e.vus}),a.push({duration:e.duration,target:e.vus}),n>0&&a.push({duration:e.rampDown,target:0}),{executor:"ramping-vus",vus:e.vus,startVUs:r>0?0:e.vus,duration:e.duration,stages:a,...t}}function u6(e){return[...e.setup?.extract.map(e=>e.name)??[],...e.data?.columns??[]]}function u4(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}}e.s(["LOAD_KNOB_PRESETS",0,u1,"VARIABLE_NAME",0,uJ,"durationToMs",0,uQ,"extractRuleSchema",0,uW,"isArrivalRate",0,uZ,"loadFromLabKnobs",0,u2,"normalizeBearerToken",0,uY,"testDataSchema",0,uG],59100),String.raw`
491
577
  var __ATC_FIRST = ["Alex", "Maria", "Sam", "Priya", "Omar", "Lena", "Kofi", "Yuki", "Diego", "Emma", "Noah", "Aisha", "Ivan", "Sofia", "Liam", "Mei"];
492
578
  var __ATC_LAST = ["Smith", "Garcia", "Kim", "Patel", "Muller", "Silva", "Nguyen", "Okafor", "Rossi", "Cohen", "Tanaka", "Novak", "Brown", "Khan", "Lopez", "Berg"];
493
579
  function __atcRand(n) { return Math.floor(Math.random() * n); }
@@ -545,53 +631,57 @@ function __atcFill(text, vars, mode, builtins) {
545
631
  return v;
546
632
  });
547
633
  }
548
- `,e.s(["BUILTIN_VALUES",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."}],"parseCsv",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],i=[],a="",s=[],o=!1;for(let e=0;e<t.length;e++){let r=t[e];o?'"'===r?'"'===t[e+1]?(a+='"',e++):o=!1:a+=r:'"'===r&&""===a?o=!0:r===n?(s.push(a),a=""):"\n"===r||"\r"===r?("\r"===r&&"\n"===t[e+1]&&e++,s.push(a),i.push(s),s=[],a=""):a+=r}(""!==a||s.length)&&(s.push(a),i.push(s));let l=i.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=uB.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}),d=new Set;c.forEach((e,t)=>{d.has(e)&&(c[t]=`${e}_${t+1}`,u.push(`Two columns are called “${e}”; the second is used as {{${c[t]}}}`)),d.add(c[t])});let f=0,p=l.map(e=>(e.length!==c.length&&f++,c.map((t,r)=>e[r]??"")));return f&&u.push(`${f} row${1===f?" has":"s have"} a different number of values than the header; missing values are left empty`),{columns:c,rows:p,problems:u}},"runtimeVariableNames",0,u2],99112);let u4=/^(content-type|location|cache-control|etag|x-[\w-]+|link|retry-after|www-authenticate)$/i;e.s(["exampleFromResponse",0,function(e,t,r){return{status:e,headers:Object.entries(t).filter(([e,t])=>u4.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}},"mockExampleFrom",0,u6],36163);let u5=Symbol.for("yaml.alias"),u9=Symbol.for("yaml.document"),u3=Symbol.for("yaml.map"),u8=Symbol.for("yaml.pair"),u7=Symbol.for("yaml.scalar"),ce=Symbol.for("yaml.seq"),ct=Symbol.for("yaml.node.type"),cr=e=>!!e&&"object"==typeof e&&e[ct]===u5,cn=e=>!!e&&"object"==typeof e&&e[ct]===u9,ci=e=>!!e&&"object"==typeof e&&e[ct]===u3,ca=e=>!!e&&"object"==typeof e&&e[ct]===u8,cs=e=>!!e&&"object"==typeof e&&e[ct]===u7,co=e=>!!e&&"object"==typeof e&&e[ct]===ce;function cl(e){if(e&&"object"==typeof e)switch(e[ct]){case u3:case ce:return!0}return!1}function cu(e){if(e&&"object"==typeof e)switch(e[ct]){case u5:case u3:case u7:case ce:return!0}return!1}let cc=e=>(cs(e)||cl(e))&&!!e.anchor,cd=Symbol("break visit"),cf=Symbol("skip children"),cp=Symbol("remove node");function cm(e,t){let r=cy(t);cn(e)?ch(null,e.contents,r,Object.freeze([e]))===cp&&(e.contents=null):ch(null,e,r,Object.freeze([]))}function ch(e,t,r,n){let i=cb(e,t,r,n);if(cu(i)||ca(i))return c$(e,n,i),ch(e,i,r,n);if("symbol"!=typeof i){if(cl(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let i=ch(e,t.items[e],r,n);if("number"==typeof i)e=i-1;else{if(i===cd)return cd;i===cp&&(t.items.splice(e,1),e-=1)}}}else if(ca(t)){n=Object.freeze(n.concat(t));let e=ch("key",t.key,r,n);if(e===cd)return cd;e===cp&&(t.key=null);let i=ch("value",t.value,r,n);if(i===cd)return cd;i===cp&&(t.value=null)}}return i}async function cg(e,t){let r=cy(t);cn(e)?await cv(null,e.contents,r,Object.freeze([e]))===cp&&(e.contents=null):await cv(null,e,r,Object.freeze([]))}async function cv(e,t,r,n){let i=await cb(e,t,r,n);if(cu(i)||ca(i))return c$(e,n,i),cv(e,i,r,n);if("symbol"!=typeof i){if(cl(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let i=await cv(e,t.items[e],r,n);if("number"==typeof i)e=i-1;else{if(i===cd)return cd;i===cp&&(t.items.splice(e,1),e-=1)}}}else if(ca(t)){n=Object.freeze(n.concat(t));let e=await cv("key",t.key,r,n);if(e===cd)return cd;e===cp&&(t.key=null);let i=await cv("value",t.value,r,n);if(i===cd)return cd;i===cp&&(t.value=null)}}return i}function cy(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 cb(e,t,r,n){return"function"==typeof r?r(e,t,n):ci(t)?r.Map?.(e,t,n):co(t)?r.Seq?.(e,t,n):ca(t)?r.Pair?.(e,t,n):cs(t)?r.Scalar?.(e,t,n):cr(t)?r.Alias?.(e,t,n):void 0}function c$(e,t,r){let n=t[t.length-1];if(cl(n))n.items[e]=r;else if(ca(n))"key"===e?n.key=r:n.value=r;else if(cn(n))n.contents=r;else{let e=cr(n)?"alias":"scalar";throw Error(`Cannot replace node with ${e} parent`)}}cm.BREAK=cd,cm.SKIP=cf,cm.REMOVE=cp,cg.BREAK=cd,cg.SKIP=cf,cg.REMOVE=cp;let cx={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ck=e=>e.replace(/[!,[\]{}]/g,e=>cx[e]);class cw{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},cw.defaultYaml,e),this.tags=Object.assign({},cw.defaultTags,t)}clone(){let e=new cw(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new cw(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:cw.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},cw.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:cw.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},cw.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 i=this.tags[r];if(i)try{return i+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+ck(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&&cu(e.contents)){let r={};cm(e.contents,(e,t)=>{cu(t)&&t.tag&&(r[t.tag]=!0)}),t=Object.keys(r)}else t=[];for(let[i,a]of n)("!!"!==i||"tag:yaml.org,2002:"!==a)&&(!e||t.some(e=>e.startsWith(a)))&&r.push(`%TAG ${i} ${a}`);return r.join("\n")}}function c_(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 cS(e){let t=new Set;return cm(e,{Value(e,r){r.anchor&&t.add(r.anchor)}}),t}function cI(e,t){for(let r=1;;++r){let n=`${e}${r}`;if(!t.has(n))return n}}function cO(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],i=cO(e,n,String(t),r);void 0===i?delete n[t]:i!==r&&(n[t]=i)}else if(n instanceof Map)for(let t of Array.from(n.keys())){let r=n.get(t),i=cO(e,n,t,r);void 0===i?n.delete(t):i!==r&&n.set(t,i)}else if(n instanceof Set)for(let t of Array.from(n)){let r=cO(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 i=cO(e,n,t,r);void 0===i?delete n[t]:i!==r&&(n[t]=i)}return e.call(t,r,n)}function cE(e,t,r){if(Array.isArray(e))return e.map((e,t)=>cE(e,String(t),r));if(e&&"function"==typeof e.toJSON){if(!r||!cc(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 i=e.toJSON(t,r);return r.onCreate&&r.onCreate(i),i}return"bigint"!=typeof e||r?.keep?e:Number(e)}cw.defaultYaml={explicit:!1,version:"1.2"},cw.defaultTags={"!!":"tag:yaml.org,2002:"};class cA{constructor(e){Object.defineProperty(this,ct,{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:i}={}){if(!cn(e))throw TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},s=cE(this,"",a);if("function"==typeof n)for(let{count:e,res:t}of a.anchors.values())n(t,e);return"function"==typeof i?cO(i,{"":s},"",s):s}}class cN extends cA{constructor(e){super(u5),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 i of(t?.aliasResolveCache?r=t.aliasResolveCache:(r=[],cm(e,{Node:(e,t)=>{(cr(t)||cc(t))&&r.push(t)}}),t&&(t.aliasResolveCache=r)),r)){if(i===this)break;i.anchor===this.source&&(n=i)}if(n&&t){let{anchors:e,doc:r,maxAliasCount:i}=t,a=e.get(n);if(a||(cE(n,null,t),a=e.get(n)),a?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(a.count+=1,0===a.aliasCount&&(a.aliasCount=function e(t,r,n){if(cr(r)){let e=r.resolve(t),i=n&&e&&n.get(e);return i?i.count*i.aliasCount:0}if(cl(r)){let i=0;for(let a of r.items){let r=e(t,a,n);r>i&&(i=r)}return i}return ca(r)?Math.max(e(t,r.key,n),e(t,r.value,n)):1}(r,n,e)),a.count*a.aliasCount>i))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(c_(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 cU=e=>!e||"function"!=typeof e&&"object"!=typeof e;class cj extends cA{constructor(e){super(u7),this.value=e}toJSON(e,t){return t?.keep?this.value:cE(this.value,e,t)}toString(){return String(this.value)}}function cz(e,t,r){let n;if(cn(e)&&(e=e.contents),cu(e))return e;if(ca(e)){let t=r.schema[u3].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:i,onAnchor:a,onTagObj:s,schema:o,sourceObjects:l}=r;if(i&&e&&"object"==typeof e){if(n=l.get(e))return n.anchor??(n.anchor=a(e)),new cN(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 cj(e);return n&&(n.node=t),t}u=e instanceof Map?o[u3]:Symbol.iterator in Object(e)?o[ce]:o[u3]}s&&(s(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 cj(e);return t?c.tag=t:u.default||(c.tag=u.tag),n&&(n.node=c),c}function cT(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 cz(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}cj.BLOCK_FOLDED="BLOCK_FOLDED",cj.BLOCK_LITERAL="BLOCK_LITERAL",cj.PLAIN="PLAIN",cj.QUOTE_DOUBLE="QUOTE_DOUBLE",cj.QUOTE_SINGLE="QUOTE_SINGLE";let cP=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class cM extends cA{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=>cu(t)||ca(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(cP(e))this.add(t);else{let[r,...n]=e,i=this.get(r,!0);if(cl(i))i.addIn(n,t);else if(void 0===i&&this.schema)this.set(r,cT(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(cl(n))return n.deleteIn(r);throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...n]=e,i=this.get(r,!0);return 0===n.length?!t&&cs(i)?i.value:i:cl(i)?i.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!ca(t))return!1;let r=t.value;return null==r||e&&cs(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!!cl(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(cl(e))e.setIn(n,t);else if(void 0===e&&this.schema)this.set(r,cT(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}}let cD=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function cZ(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}let cC=(e,t,r)=>e.endsWith("\n")?cZ(r,t):r.includes("\n")?"\n"+cZ(r,t):(e.endsWith(" ")?"":" ")+r,cL="flow",cR="block",cq="quoted";function cF(e,t,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:a=20,onFold:s,onOverflow:o}={}){let l,u,c;if(!i||i<0)return e;i<a&&(a=0);let d=Math.max(1+a,1+i-t.length);if(e.length<=d)return e;let f=[],p={},m=i-t.length;"number"==typeof n&&(n>i-Math.max(2,a)?f.push(0):m=i-n);let h=!1,g=-1,v=-1,y=-1;for(r===cR&&-1!==(g=cB(e,g,t.length))&&(m=g+d);c=e[g+=1];){if(r===cq&&"\\"===c){switch(v=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}y=g}if("\n"===c)r===cR&&(g=cB(e,g,t.length)),m=g+t.length+d,l=void 0;else{if(" "===c&&u&&" "!==u&&"\n"!==u&&" "!==u){let t=e[g+1];t&&" "!==t&&"\n"!==t&&" "!==t&&(l=g)}if(g>=m)if(l)f.push(l),m=l+d,l=void 0;else if(r===cq){for(;" "===u||" "===u;)u=c,c=e[g+=1],h=!0;let t=g>y+1?g-2:v-1;if(p[t])return e;f.push(t),p[t]=!0,m=t+d,l=void 0}else h=!0}u=c}if(h&&o&&o(),0===f.length)return e;s&&s();let b=e.slice(0,f[0]);for(let n=0;n<f.length;++n){let i=f[n],a=f[n+1]||e.length;0===i?b=`
549
- ${t}${e.slice(0,a)}`:(r===cq&&p[i]&&(b+=`${e[i]}\\`),b+=`
550
- ${t}${e.slice(i+1,a)}`)}return b}function cB(e,t,r){let n=t,i=t+1,a=e[i];for(;" "===a||" "===a;)if(t<i+r)a=e[++t];else{do a=e[++t];while(a&&"\n"!==a)n=t,a=e[i=t+1]}return n}let cJ=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth});function cK(e,t){let r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(/^(%|---|\.\.\.)/m.test(e)?" ":""),s="",o=0;for(let e=0,t=r[e];t;t=r[++e])if(" "===t&&"\\"===r[e+1]&&"n"===r[e+2]&&(s+=r.slice(o,e)+"\\ ",e+=1,o=e,t="\\"),"\\"===t)switch(r[e+1]){case"u":{s+=r.slice(o,e);let t=r.substr(e+2,4);switch(t){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:"00"===t.substr(0,2)?s+="\\x"+t.substr(2):s+=r.substr(e,6)}e+=5,o=e+1}break;case"n":if(n||'"'===r[e+2]||r.length<i)e+=1;else{for(s+=r.slice(o,e)+"\n\n";"\\"===r[e+2]&&"n"===r[e+3]&&'"'!==r[e+4];)s+="\n",e+=2;s+=a," "===r[e+2]&&(s+="\\"),e+=1,o=e+1}break;default:e+=1}return s=o?s+r.slice(o):r,n?s:cF(s,a,cq,cJ(t,!1))}function cW(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return cK(e,t);let r=t.indent||(/^(%|---|\.\.\.)/m.test(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
551
- ${r}`)+"'";return t.implicitKey?n:cF(n,r,cL,cJ(t,!1))}function cV(e,t){let r,{singleQuote:n}=t.options;if(!1===n)r=cK;else{let t=e.includes('"'),i=e.includes("'");r=t&&!i?cW:i&&!t?cK:n?cW:cK}return r(e,t)}try{t=RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{t=/\n+(?!\n|$)/g}function cG({comment:e,type:r,value:n},i,a,s){let o,l,u,c,{blockQuote:d,commentString:f,lineWidth:p}=i.options;if(!d||/\n[\t ]+$/.test(n))return cV(n,i);let m=i.indent||(i.forceBlockIndent||(c=n,/^(%|---|\.\.\.)/m.test(c))?" ":""),h="literal"===d||"folded"!==d&&r!==cj.BLOCK_FOLDED&&(r===cj.BLOCK_LITERAL||!function(e,t,r){if(!t||t<0)return!1;let n=t-r,i=e.length;if(i<=n)return!1;for(let t=0,r=0;t<i;++t)if("\n"===e[t]){if(t-r>n)return!0;if(i-(r=t+1)<=n)return!1}return!0}(n,p,m.length));if(!n)return h?"|\n":">\n";for(l=n.length;l>0;--l){let e=n[l-1];if("\n"!==e&&" "!==e&&" "!==e)break}let g=n.substring(l),v=g.indexOf("\n");-1===v?o="-":n===g||v!==g.length-1?(o="+",s&&s()):o="",g&&(n=n.slice(0,-g.length),"\n"===g[g.length-1]&&(g=g.slice(0,-1)),g=g.replace(t,`$&${m}`));let y=!1,b=-1;for(u=0;u<n.length;++u){let e=n[u];if(" "===e)y=!0;else if("\n"===e)b=u;else break}let $=n.substring(0,b<u?b+1:u);$&&(n=n.substring($.length),$=$.replace(/\n+/g,`$&${m}`));let x=m?"2":"1",k=(y?x:"")+o;if(e&&(k+=" "+f(e.replace(/ ?[\r\n]+/g," ")),a&&a()),!h){let e=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`),t=!1,a=cJ(i,!0);"folded"!==d&&r!==cj.BLOCK_FOLDED&&(a.onOverflow=()=>{t=!0});let s=cF(`${$}${e}${g}`,m,cR,a);if(!t)return`>${k}
634
+ `,e.s(["BUILTIN_VALUES",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."}],"parseCsv",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],i=[],a="",s=[],o=!1;for(let e=0;e<t.length;e++){let r=t[e];o?'"'===r?'"'===t[e+1]?(a+='"',e++):o=!1:a+=r:'"'===r&&""===a?o=!0:r===n?(s.push(a),a=""):"\n"===r||"\r"===r?("\r"===r&&"\n"===t[e+1]&&e++,s.push(a),i.push(s),s=[],a=""):a+=r}(""!==a||s.length)&&(s.push(a),i.push(s));let l=i.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=uJ.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}),d=new Set;c.forEach((e,t)=>{d.has(e)&&(c[t]=`${e}_${t+1}`,u.push(`Two columns are called “${e}”; the second is used as {{${c[t]}}}`)),d.add(c[t])});let f=0,p=l.map(e=>(e.length!==c.length&&f++,c.map((t,r)=>e[r]??"")));return f&&u.push(`${f} row${1===f?" has":"s have"} a different number of values than the header; missing values are left empty`),{columns:c,rows:p,problems:u}},"runtimeVariableNames",0,u6],99112);let u5=/^(content-type|location|cache-control|etag|x-[\w-]+|link|retry-after|www-authenticate)$/i;e.s(["exampleFromResponse",0,function(e,t,r){return{status:e,headers:Object.entries(t).filter(([e,t])=>u5.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}},"mockExampleFrom",0,u4],36163);let u9=Symbol.for("yaml.alias"),u3=Symbol.for("yaml.document"),u8=Symbol.for("yaml.map"),u7=Symbol.for("yaml.pair"),ce=Symbol.for("yaml.scalar"),ct=Symbol.for("yaml.seq"),cr=Symbol.for("yaml.node.type"),cn=e=>!!e&&"object"==typeof e&&e[cr]===u9,ci=e=>!!e&&"object"==typeof e&&e[cr]===u3,ca=e=>!!e&&"object"==typeof e&&e[cr]===u8,cs=e=>!!e&&"object"==typeof e&&e[cr]===u7,co=e=>!!e&&"object"==typeof e&&e[cr]===ce,cl=e=>!!e&&"object"==typeof e&&e[cr]===ct;function cu(e){if(e&&"object"==typeof e)switch(e[cr]){case u8:case ct:return!0}return!1}function cc(e){if(e&&"object"==typeof e)switch(e[cr]){case u9:case u8:case ce:case ct:return!0}return!1}let cd=e=>(co(e)||cu(e))&&!!e.anchor,cf=Symbol("break visit"),cp=Symbol("skip children"),cm=Symbol("remove node");function ch(e,t){let r=cb(t);ci(e)?cg(null,e.contents,r,Object.freeze([e]))===cm&&(e.contents=null):cg(null,e,r,Object.freeze([]))}function cg(e,t,r,n){let i=c$(e,t,r,n);if(cc(i)||cs(i))return cx(e,n,i),cg(e,i,r,n);if("symbol"!=typeof i){if(cu(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let i=cg(e,t.items[e],r,n);if("number"==typeof i)e=i-1;else{if(i===cf)return cf;i===cm&&(t.items.splice(e,1),e-=1)}}}else if(cs(t)){n=Object.freeze(n.concat(t));let e=cg("key",t.key,r,n);if(e===cf)return cf;e===cm&&(t.key=null);let i=cg("value",t.value,r,n);if(i===cf)return cf;i===cm&&(t.value=null)}}return i}async function cv(e,t){let r=cb(t);ci(e)?await cy(null,e.contents,r,Object.freeze([e]))===cm&&(e.contents=null):await cy(null,e,r,Object.freeze([]))}async function cy(e,t,r,n){let i=await c$(e,t,r,n);if(cc(i)||cs(i))return cx(e,n,i),cy(e,i,r,n);if("symbol"!=typeof i){if(cu(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let i=await cy(e,t.items[e],r,n);if("number"==typeof i)e=i-1;else{if(i===cf)return cf;i===cm&&(t.items.splice(e,1),e-=1)}}}else if(cs(t)){n=Object.freeze(n.concat(t));let e=await cy("key",t.key,r,n);if(e===cf)return cf;e===cm&&(t.key=null);let i=await cy("value",t.value,r,n);if(i===cf)return cf;i===cm&&(t.value=null)}}return i}function cb(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 c$(e,t,r,n){return"function"==typeof r?r(e,t,n):ca(t)?r.Map?.(e,t,n):cl(t)?r.Seq?.(e,t,n):cs(t)?r.Pair?.(e,t,n):co(t)?r.Scalar?.(e,t,n):cn(t)?r.Alias?.(e,t,n):void 0}function cx(e,t,r){let n=t[t.length-1];if(cu(n))n.items[e]=r;else if(cs(n))"key"===e?n.key=r:n.value=r;else if(ci(n))n.contents=r;else{let e=cn(n)?"alias":"scalar";throw Error(`Cannot replace node with ${e} parent`)}}ch.BREAK=cf,ch.SKIP=cp,ch.REMOVE=cm,cv.BREAK=cf,cv.SKIP=cp,cv.REMOVE=cm;let ck={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},cw=e=>e.replace(/[!,[\]{}]/g,e=>ck[e]);class c_{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},c_.defaultYaml,e),this.tags=Object.assign({},c_.defaultTags,t)}clone(){let e=new c_(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new c_(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:c_.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},c_.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:c_.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},c_.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 i=this.tags[r];if(i)try{return i+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+cw(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&&cc(e.contents)){let r={};ch(e.contents,(e,t)=>{cc(t)&&t.tag&&(r[t.tag]=!0)}),t=Object.keys(r)}else t=[];for(let[i,a]of n)("!!"!==i||"tag:yaml.org,2002:"!==a)&&(!e||t.some(e=>e.startsWith(a)))&&r.push(`%TAG ${i} ${a}`);return r.join("\n")}}function cS(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 cI(e){let t=new Set;return ch(e,{Value(e,r){r.anchor&&t.add(r.anchor)}}),t}function cO(e,t){for(let r=1;;++r){let n=`${e}${r}`;if(!t.has(n))return n}}function cE(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],i=cE(e,n,String(t),r);void 0===i?delete n[t]:i!==r&&(n[t]=i)}else if(n instanceof Map)for(let t of Array.from(n.keys())){let r=n.get(t),i=cE(e,n,t,r);void 0===i?n.delete(t):i!==r&&n.set(t,i)}else if(n instanceof Set)for(let t of Array.from(n)){let r=cE(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 i=cE(e,n,t,r);void 0===i?delete n[t]:i!==r&&(n[t]=i)}return e.call(t,r,n)}function cA(e,t,r){if(Array.isArray(e))return e.map((e,t)=>cA(e,String(t),r));if(e&&"function"==typeof e.toJSON){if(!r||!cd(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 i=e.toJSON(t,r);return r.onCreate&&r.onCreate(i),i}return"bigint"!=typeof e||r?.keep?e:Number(e)}c_.defaultYaml={explicit:!1,version:"1.2"},c_.defaultTags={"!!":"tag:yaml.org,2002:"};class cN{constructor(e){Object.defineProperty(this,cr,{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:i}={}){if(!ci(e))throw TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},s=cA(this,"",a);if("function"==typeof n)for(let{count:e,res:t}of a.anchors.values())n(t,e);return"function"==typeof i?cE(i,{"":s},"",s):s}}class cU extends cN{constructor(e){super(u9),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 i of(t?.aliasResolveCache?r=t.aliasResolveCache:(r=[],ch(e,{Node:(e,t)=>{(cn(t)||cd(t))&&r.push(t)}}),t&&(t.aliasResolveCache=r)),r)){if(i===this)break;i.anchor===this.source&&(n=i)}if(n&&t){let{anchors:e,doc:r,maxAliasCount:i}=t,a=e.get(n);if(a||(cA(n,null,t),a=e.get(n)),a?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(a.count+=1,0===a.aliasCount&&(a.aliasCount=function e(t,r,n){if(cn(r)){let e=r.resolve(t),i=n&&e&&n.get(e);return i?i.count*i.aliasCount:0}if(cu(r)){let i=0;for(let a of r.items){let r=e(t,a,n);r>i&&(i=r)}return i}return cs(r)?Math.max(e(t,r.key,n),e(t,r.value,n)):1}(r,n,e)),a.count*a.aliasCount>i))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(cS(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 cj=e=>!e||"function"!=typeof e&&"object"!=typeof e;class cz extends cN{constructor(e){super(ce),this.value=e}toJSON(e,t){return t?.keep?this.value:cA(this.value,e,t)}toString(){return String(this.value)}}function cT(e,t,r){let n;if(ci(e)&&(e=e.contents),cc(e))return e;if(cs(e)){let t=r.schema[u8].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:i,onAnchor:a,onTagObj:s,schema:o,sourceObjects:l}=r;if(i&&e&&"object"==typeof e){if(n=l.get(e))return n.anchor??(n.anchor=a(e)),new cU(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 cz(e);return n&&(n.node=t),t}u=e instanceof Map?o[u8]:Symbol.iterator in Object(e)?o[ct]:o[u8]}s&&(s(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 cz(e);return t?c.tag=t:u.default||(c.tag=u.tag),n&&(n.node=c),c}function cP(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 cT(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}cz.BLOCK_FOLDED="BLOCK_FOLDED",cz.BLOCK_LITERAL="BLOCK_LITERAL",cz.PLAIN="PLAIN",cz.QUOTE_DOUBLE="QUOTE_DOUBLE",cz.QUOTE_SINGLE="QUOTE_SINGLE";let cM=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class cD extends cN{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=>cc(t)||cs(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(cM(e))this.add(t);else{let[r,...n]=e,i=this.get(r,!0);if(cu(i))i.addIn(n,t);else if(void 0===i&&this.schema)this.set(r,cP(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(cu(n))return n.deleteIn(r);throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...n]=e,i=this.get(r,!0);return 0===n.length?!t&&co(i)?i.value:i:cu(i)?i.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!cs(t))return!1;let r=t.value;return null==r||e&&co(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!!cu(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(cu(e))e.setIn(n,t);else if(void 0===e&&this.schema)this.set(r,cP(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}}let cZ=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function cC(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}let cL=(e,t,r)=>e.endsWith("\n")?cC(r,t):r.includes("\n")?"\n"+cC(r,t):(e.endsWith(" ")?"":" ")+r,cR="flow",cq="block",cF="quoted";function cB(e,t,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:a=20,onFold:s,onOverflow:o}={}){let l,u,c;if(!i||i<0)return e;i<a&&(a=0);let d=Math.max(1+a,1+i-t.length);if(e.length<=d)return e;let f=[],p={},m=i-t.length;"number"==typeof n&&(n>i-Math.max(2,a)?f.push(0):m=i-n);let h=!1,g=-1,v=-1,y=-1;for(r===cq&&-1!==(g=cJ(e,g,t.length))&&(m=g+d);c=e[g+=1];){if(r===cF&&"\\"===c){switch(v=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}y=g}if("\n"===c)r===cq&&(g=cJ(e,g,t.length)),m=g+t.length+d,l=void 0;else{if(" "===c&&u&&" "!==u&&"\n"!==u&&" "!==u){let t=e[g+1];t&&" "!==t&&"\n"!==t&&" "!==t&&(l=g)}if(g>=m)if(l)f.push(l),m=l+d,l=void 0;else if(r===cF){for(;" "===u||" "===u;)u=c,c=e[g+=1],h=!0;let t=g>y+1?g-2:v-1;if(p[t])return e;f.push(t),p[t]=!0,m=t+d,l=void 0}else h=!0}u=c}if(h&&o&&o(),0===f.length)return e;s&&s();let b=e.slice(0,f[0]);for(let n=0;n<f.length;++n){let i=f[n],a=f[n+1]||e.length;0===i?b=`
635
+ ${t}${e.slice(0,a)}`:(r===cF&&p[i]&&(b+=`${e[i]}\\`),b+=`
636
+ ${t}${e.slice(i+1,a)}`)}return b}function cJ(e,t,r){let n=t,i=t+1,a=e[i];for(;" "===a||" "===a;)if(t<i+r)a=e[++t];else{do a=e[++t];while(a&&"\n"!==a)n=t,a=e[i=t+1]}return n}let cK=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth});function cW(e,t){let r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(/^(%|---|\.\.\.)/m.test(e)?" ":""),s="",o=0;for(let e=0,t=r[e];t;t=r[++e])if(" "===t&&"\\"===r[e+1]&&"n"===r[e+2]&&(s+=r.slice(o,e)+"\\ ",e+=1,o=e,t="\\"),"\\"===t)switch(r[e+1]){case"u":{s+=r.slice(o,e);let t=r.substr(e+2,4);switch(t){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:"00"===t.substr(0,2)?s+="\\x"+t.substr(2):s+=r.substr(e,6)}e+=5,o=e+1}break;case"n":if(n||'"'===r[e+2]||r.length<i)e+=1;else{for(s+=r.slice(o,e)+"\n\n";"\\"===r[e+2]&&"n"===r[e+3]&&'"'!==r[e+4];)s+="\n",e+=2;s+=a," "===r[e+2]&&(s+="\\"),e+=1,o=e+1}break;default:e+=1}return s=o?s+r.slice(o):r,n?s:cB(s,a,cF,cK(t,!1))}function cV(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return cW(e,t);let r=t.indent||(/^(%|---|\.\.\.)/m.test(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
637
+ ${r}`)+"'";return t.implicitKey?n:cB(n,r,cR,cK(t,!1))}function cG(e,t){let r,{singleQuote:n}=t.options;if(!1===n)r=cW;else{let t=e.includes('"'),i=e.includes("'");r=t&&!i?cV:i&&!t?cW:n?cV:cW}return r(e,t)}try{t=RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{t=/\n+(?!\n|$)/g}function cH({comment:e,type:r,value:n},i,a,s){let o,l,u,c,{blockQuote:d,commentString:f,lineWidth:p}=i.options;if(!d||/\n[\t ]+$/.test(n))return cG(n,i);let m=i.indent||(i.forceBlockIndent||(c=n,/^(%|---|\.\.\.)/m.test(c))?" ":""),h="literal"===d||"folded"!==d&&r!==cz.BLOCK_FOLDED&&(r===cz.BLOCK_LITERAL||!function(e,t,r){if(!t||t<0)return!1;let n=t-r,i=e.length;if(i<=n)return!1;for(let t=0,r=0;t<i;++t)if("\n"===e[t]){if(t-r>n)return!0;if(i-(r=t+1)<=n)return!1}return!0}(n,p,m.length));if(!n)return h?"|\n":">\n";for(l=n.length;l>0;--l){let e=n[l-1];if("\n"!==e&&" "!==e&&" "!==e)break}let g=n.substring(l),v=g.indexOf("\n");-1===v?o="-":n===g||v!==g.length-1?(o="+",s&&s()):o="",g&&(n=n.slice(0,-g.length),"\n"===g[g.length-1]&&(g=g.slice(0,-1)),g=g.replace(t,`$&${m}`));let y=!1,b=-1;for(u=0;u<n.length;++u){let e=n[u];if(" "===e)y=!0;else if("\n"===e)b=u;else break}let $=n.substring(0,b<u?b+1:u);$&&(n=n.substring($.length),$=$.replace(/\n+/g,`$&${m}`));let x=m?"2":"1",k=(y?x:"")+o;if(e&&(k+=" "+f(e.replace(/ ?[\r\n]+/g," ")),a&&a()),!h){let e=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`),t=!1,a=cK(i,!0);"folded"!==d&&r!==cz.BLOCK_FOLDED&&(a.onOverflow=()=>{t=!0});let s=cB(`${$}${e}${g}`,m,cq,a);if(!t)return`>${k}
552
638
  ${m}${s}`}return n=n.replace(/\n+/g,`$&${m}`),`|${k}
553
- ${m}${$}${n}${g}`}function cH(e,t,r,n){let{implicitKey:i,inFlow:a}=t,s="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)}),{type:o}=e;o!==cj.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(o=cj.QUOTE_DOUBLE);let l=e=>{switch(e){case cj.BLOCK_FOLDED:case cj.BLOCK_LITERAL:return i||a?cV(s.value,t):cG(s,t,r,n);case cj.QUOTE_DOUBLE:return cK(s.value,t);case cj.QUOTE_SINGLE:return cW(s.value,t);case cj.PLAIN:return function(e,t,r,n){let{type:i,value:a}=e,{actualString:s,implicitKey:o,indent:l,indentStep:u,inFlow:c}=t;if(o&&a.includes("\n")||c&&/[[\]{},]/.test(a))return cV(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return o||c||!a.includes("\n")?cV(a,t):cG(e,t,r,n);if(!o&&!c&&i!==cj.PLAIN&&a.includes("\n"))return cG(e,t,r,n);if(/^(%|---|\.\.\.)/m.test(a)){if(""===l)return t.forceBlockIndent=!0,cG(e,t,r,n);else if(o&&l===u)return cV(a,t)}let d=a.replace(/\n+/g,`$&
554
- ${l}`);if(s){let e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(d),{compat:r,tags:n}=t.doc.schema;if(n.some(e)||r?.some(e))return cV(a,t)}return o?d:cF(d,l,cL,cJ(t,!1))}(s,t,r,n);default:return null}},u=l(o);if(null===u){let{defaultKeyType:e,defaultStringType:r}=t.options,n=i&&e||r;if(null===(u=l(n)))throw Error(`Unsupported default string type ${n}`)}return u}function cX(e,t){let r,n=Object.assign({blockQuote:!0,commentString:cD,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 cY(e,t,r,n){let i;if(ca(e))return e.toString(t,r,n);if(cr(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 a=cu(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??(i=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(cs(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.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,a));let s=function(e,t,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],a=(cs(e)||cl(e))&&e.anchor;a&&c_(a)&&(r.add(a),i.push(`&${a}`));let s=e.tag??(t.default?null:t.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}(a,i,t);s.length>0&&(t.indentAtStart=(t.indentAtStart??0)+s.length+1);let o="function"==typeof i.stringify?i.stringify(a,t,r,n):cs(a)?cH(a,t,r,n):a.toString(t,r,n);return s?cs(a)||"{"===o[0]||"["===o[0]?`${s} ${o}`:`${s}
555
- ${t.indent}${o}`:o}function cQ(e,t){("debug"===e||"warn"===e)&&console.warn(t)}let c0={identify:e=>"<<"===e||"symbol"==typeof e&&"<<"===e.description,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new cj(Symbol("<<")),{addToJSMap:c1}),stringify:()=>"<<"};function c1(e,t,r){let n=c6(e,r);if(co(n))for(let r of n.items)c2(e,t,r);else if(Array.isArray(n))for(let r of n)c2(e,t,r);else c2(e,t,n)}function c2(e,t,r){let n=c6(e,r);if(!ci(n))throw Error("Merge sources must be maps or map aliases");for(let[r,i]of n.toJSON(null,e,Map))t instanceof Map?t.has(r)||t.set(r,i):t instanceof Set?t.add(r):Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{value:i,writable:!0,enumerable:!0,configurable:!0});return t}function c6(e,t){return e&&cr(t)?t.resolve(e.doc,e):t}function c4(e,t,{key:r,value:n}){if(cu(r)&&r.addToJSMap)r.addToJSMap(e,t,n);else if((c0.identify(r)||cs(r)&&(!r.type||r.type===cj.PLAIN)&&c0.identify(r.value))&&e?.doc.schema.tags.some(e=>e.tag===c0.tag&&e.default))c1(e,t,n);else{let i=cE(r,"",e);if(t instanceof Map)t.set(i,cE(n,i,e));else if(t instanceof Set)t.add(i);else{let a=function(e,t,r){if(null===t)return"";if("object"!=typeof t)return String(t);if(cu(e)&&r?.doc){let t=cX(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)+'..."'),cQ(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,i,e),s=cE(n,a,e);a in t?Object.defineProperty(t,a,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[a]=s}}return t}function c5(e,t,r){return new c9(cz(e,void 0,r),cz(t,void 0,r))}class c9{constructor(e,t=null){Object.defineProperty(this,ct,{value:u8}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return cu(t)&&(t=t.clone(e)),cu(r)&&(r=r.clone(e)),new c9(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return c4(t,r,this)}toString(e,t,r){return e?.doc?function({key:e,value:t},r,n,i){let a,s,o,{allNullValues:l,doc:u,indent:c,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:m}}=r,h=cu(e)&&e.comment||null;if(m){if(h)throw Error("With simple keys, key nodes cannot have comments");if(cl(e)||!cu(e)&&"object"==typeof e)throw Error("With simple keys, collection cannot be used as a key value")}let g=!m&&(!e||h&&null==t&&!r.inFlow||cl(e)||(cs(e)?e.type===cj.BLOCK_FOLDED||e.type===cj.BLOCK_LITERAL:"object"==typeof e));r=Object.assign({},r,{allNullValues:!1,implicitKey:!g&&(m||!l),indent:c+d});let v=!1,y=!1,b=cY(e,r,()=>v=!0,()=>y=!0);if(!g&&!r.inFlow&&b.length>1024){if(m)throw Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(r.inFlow){if(l||null==t)return v&&n&&n(),""===b?"?":g?`? ${b}`:b}else if(l&&!m||null==t&&g)return b=`? ${b}`,h&&!v?b+=cC(b,r.indent,f(h)):y&&i&&i(),b;v&&(h=null),g?(h&&(b+=cC(b,r.indent,f(h))),b=`? ${b}
556
- ${c}:`):(b=`${b}:`,h&&(b+=cC(b,r.indent,f(h)))),cu(t)?(a=!!t.spaceBefore,s=t.commentBefore,o=t.comment):(a=!1,s=null,o=null,t&&"object"==typeof t&&(t=u.createNode(t))),r.implicitKey=!1,!g&&!h&&cs(t)&&(r.indentAtStart=b.length+1),y=!1,!(!p&&d.length>=2&&!r.inFlow&&!g&&co(t))||t.flow||t.tag||t.anchor||(r.indent=r.indent.substring(2));let $=!1,x=cY(t,r,()=>$=!0,()=>y=!0),k=" ";if(h||a||s){if(k=a?"\n":"",s){let e=f(s);k+=`
557
- ${cZ(e,r.indent)}`}""!==x||r.inFlow?k+=`
558
- ${r.indent}`:"\n"===k&&o&&(k="\n\n")}else if(!g&&cl(t)){let e=x[0],n=x.indexOf("\n"),i=-1!==n,a=r.inFlow??t.flow??0===t.items.length;if(i||!a){let t=!1;if(i&&("&"===e||"!"===e)){let r=x.indexOf(" ");"&"===e&&-1!==r&&r<n&&"!"===x[r+1]&&(r=x.indexOf(" ",r+1)),(-1===r||n<r)&&(t=!0)}t||(k=`
559
- ${r.indent}`)}}else(""===x||"\n"===x[0])&&(k="");return b+=k+x,r.inFlow?$&&n&&n():o&&!$?b+=cC(b,r.indent,f(o)):y&&i&&i(),b}(this,e,t,r):JSON.stringify(this)}}function c3(e,t,r){return(t.inFlow??e.flow?function({items:e},t,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:a,flowCollectionPadding:s,options:{commentString:o}}=t,l=Object.assign({},t,{indent:n+=a,inFlow:!0,type:null}),u=!1,c=0,d=[];for(let r=0;r<e.length;++r){let i=e[r],a=null;if(cu(i))i.spaceBefore&&d.push(""),c8(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(ca(i)){let e=cu(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(""),c8(t,d,e.commentBefore,!1),e.comment&&(u=!0));let r=cu(i.value)?i.value:null;r?(r.comment&&(a=r.comment),r.commentBefore&&(u=!0)):null==i.value&&e?.comment&&(a=e.comment)}a&&(u=!0);let s=cY(i,l,()=>a=null);u||(u=d.length>c||s.includes("\n")),r<e.length-1?s+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(u||(u=d.reduce((e,t)=>e+t.length+2,2)+(s.length+2)>t.options.lineWidth)),u&&(s+=",")),a&&(s+=cC(s,n,o(a))),d.push(s),c=d.length}let{start:f,end:p}=r;if(0===d.length)return f+p;if(!u){let e=d.reduce((e,t)=>e+t.length+2,2);u=t.options.lineWidth>0&&e>t.options.lineWidth}if(!u)return`${f}${s}${d.join(" ")}${s}${p}`;{let e=f;for(let t of d)e+=t?`
639
+ ${m}${$}${n}${g}`}function cX(e,t,r,n){let{implicitKey:i,inFlow:a}=t,s="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)}),{type:o}=e;o!==cz.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(o=cz.QUOTE_DOUBLE);let l=e=>{switch(e){case cz.BLOCK_FOLDED:case cz.BLOCK_LITERAL:return i||a?cG(s.value,t):cH(s,t,r,n);case cz.QUOTE_DOUBLE:return cW(s.value,t);case cz.QUOTE_SINGLE:return cV(s.value,t);case cz.PLAIN:return function(e,t,r,n){let{type:i,value:a}=e,{actualString:s,implicitKey:o,indent:l,indentStep:u,inFlow:c}=t;if(o&&a.includes("\n")||c&&/[[\]{},]/.test(a))return cG(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return o||c||!a.includes("\n")?cG(a,t):cH(e,t,r,n);if(!o&&!c&&i!==cz.PLAIN&&a.includes("\n"))return cH(e,t,r,n);if(/^(%|---|\.\.\.)/m.test(a)){if(""===l)return t.forceBlockIndent=!0,cH(e,t,r,n);else if(o&&l===u)return cG(a,t)}let d=a.replace(/\n+/g,`$&
640
+ ${l}`);if(s){let e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(d),{compat:r,tags:n}=t.doc.schema;if(n.some(e)||r?.some(e))return cG(a,t)}return o?d:cB(d,l,cR,cK(t,!1))}(s,t,r,n);default:return null}},u=l(o);if(null===u){let{defaultKeyType:e,defaultStringType:r}=t.options,n=i&&e||r;if(null===(u=l(n)))throw Error(`Unsupported default string type ${n}`)}return u}function cY(e,t){let r,n=Object.assign({blockQuote:!0,commentString:cZ,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 cQ(e,t,r,n){let i;if(cs(e))return e.toString(t,r,n);if(cn(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 a=cc(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??(i=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(co(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.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,a));let s=function(e,t,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],a=(co(e)||cu(e))&&e.anchor;a&&cS(a)&&(r.add(a),i.push(`&${a}`));let s=e.tag??(t.default?null:t.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}(a,i,t);s.length>0&&(t.indentAtStart=(t.indentAtStart??0)+s.length+1);let o="function"==typeof i.stringify?i.stringify(a,t,r,n):co(a)?cX(a,t,r,n):a.toString(t,r,n);return s?co(a)||"{"===o[0]||"["===o[0]?`${s} ${o}`:`${s}
641
+ ${t.indent}${o}`:o}function c0(e,t){("debug"===e||"warn"===e)&&console.warn(t)}let c1={identify:e=>"<<"===e||"symbol"==typeof e&&"<<"===e.description,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new cz(Symbol("<<")),{addToJSMap:c2}),stringify:()=>"<<"};function c2(e,t,r){let n=c4(e,r);if(cl(n))for(let r of n.items)c6(e,t,r);else if(Array.isArray(n))for(let r of n)c6(e,t,r);else c6(e,t,n)}function c6(e,t,r){let n=c4(e,r);if(!ca(n))throw Error("Merge sources must be maps or map aliases");for(let[r,i]of n.toJSON(null,e,Map))t instanceof Map?t.has(r)||t.set(r,i):t instanceof Set?t.add(r):Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{value:i,writable:!0,enumerable:!0,configurable:!0});return t}function c4(e,t){return e&&cn(t)?t.resolve(e.doc,e):t}function c5(e,t,{key:r,value:n}){if(cc(r)&&r.addToJSMap)r.addToJSMap(e,t,n);else if((c1.identify(r)||co(r)&&(!r.type||r.type===cz.PLAIN)&&c1.identify(r.value))&&e?.doc.schema.tags.some(e=>e.tag===c1.tag&&e.default))c2(e,t,n);else{let i=cA(r,"",e);if(t instanceof Map)t.set(i,cA(n,i,e));else if(t instanceof Set)t.add(i);else{let a=function(e,t,r){if(null===t)return"";if("object"!=typeof t)return String(t);if(cc(e)&&r?.doc){let t=cY(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)+'..."'),c0(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,i,e),s=cA(n,a,e);a in t?Object.defineProperty(t,a,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[a]=s}}return t}function c9(e,t,r){return new c3(cT(e,void 0,r),cT(t,void 0,r))}class c3{constructor(e,t=null){Object.defineProperty(this,cr,{value:u7}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return cc(t)&&(t=t.clone(e)),cc(r)&&(r=r.clone(e)),new c3(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return c5(t,r,this)}toString(e,t,r){return e?.doc?function({key:e,value:t},r,n,i){let a,s,o,{allNullValues:l,doc:u,indent:c,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:m}}=r,h=cc(e)&&e.comment||null;if(m){if(h)throw Error("With simple keys, key nodes cannot have comments");if(cu(e)||!cc(e)&&"object"==typeof e)throw Error("With simple keys, collection cannot be used as a key value")}let g=!m&&(!e||h&&null==t&&!r.inFlow||cu(e)||(co(e)?e.type===cz.BLOCK_FOLDED||e.type===cz.BLOCK_LITERAL:"object"==typeof e));r=Object.assign({},r,{allNullValues:!1,implicitKey:!g&&(m||!l),indent:c+d});let v=!1,y=!1,b=cQ(e,r,()=>v=!0,()=>y=!0);if(!g&&!r.inFlow&&b.length>1024){if(m)throw Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(r.inFlow){if(l||null==t)return v&&n&&n(),""===b?"?":g?`? ${b}`:b}else if(l&&!m||null==t&&g)return b=`? ${b}`,h&&!v?b+=cL(b,r.indent,f(h)):y&&i&&i(),b;v&&(h=null),g?(h&&(b+=cL(b,r.indent,f(h))),b=`? ${b}
642
+ ${c}:`):(b=`${b}:`,h&&(b+=cL(b,r.indent,f(h)))),cc(t)?(a=!!t.spaceBefore,s=t.commentBefore,o=t.comment):(a=!1,s=null,o=null,t&&"object"==typeof t&&(t=u.createNode(t))),r.implicitKey=!1,!g&&!h&&co(t)&&(r.indentAtStart=b.length+1),y=!1,!(!p&&d.length>=2&&!r.inFlow&&!g&&cl(t))||t.flow||t.tag||t.anchor||(r.indent=r.indent.substring(2));let $=!1,x=cQ(t,r,()=>$=!0,()=>y=!0),k=" ";if(h||a||s){if(k=a?"\n":"",s){let e=f(s);k+=`
643
+ ${cC(e,r.indent)}`}""!==x||r.inFlow?k+=`
644
+ ${r.indent}`:"\n"===k&&o&&(k="\n\n")}else if(!g&&cu(t)){let e=x[0],n=x.indexOf("\n"),i=-1!==n,a=r.inFlow??t.flow??0===t.items.length;if(i||!a){let t=!1;if(i&&("&"===e||"!"===e)){let r=x.indexOf(" ");"&"===e&&-1!==r&&r<n&&"!"===x[r+1]&&(r=x.indexOf(" ",r+1)),(-1===r||n<r)&&(t=!0)}t||(k=`
645
+ ${r.indent}`)}}else(""===x||"\n"===x[0])&&(k="");return b+=k+x,r.inFlow?$&&n&&n():o&&!$?b+=cL(b,r.indent,f(o)):y&&i&&i(),b}(this,e,t,r):JSON.stringify(this)}}function c8(e,t,r){return(t.inFlow??e.flow?function({items:e},t,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:a,flowCollectionPadding:s,options:{commentString:o}}=t,l=Object.assign({},t,{indent:n+=a,inFlow:!0,type:null}),u=!1,c=0,d=[];for(let r=0;r<e.length;++r){let i=e[r],a=null;if(cc(i))i.spaceBefore&&d.push(""),c7(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(cs(i)){let e=cc(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(""),c7(t,d,e.commentBefore,!1),e.comment&&(u=!0));let r=cc(i.value)?i.value:null;r?(r.comment&&(a=r.comment),r.commentBefore&&(u=!0)):null==i.value&&e?.comment&&(a=e.comment)}a&&(u=!0);let s=cQ(i,l,()=>a=null);u||(u=d.length>c||s.includes("\n")),r<e.length-1?s+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(u||(u=d.reduce((e,t)=>e+t.length+2,2)+(s.length+2)>t.options.lineWidth)),u&&(s+=",")),a&&(s+=cL(s,n,o(a))),d.push(s),c=d.length}let{start:f,end:p}=r;if(0===d.length)return f+p;if(!u){let e=d.reduce((e,t)=>e+t.length+2,2);u=t.options.lineWidth>0&&e>t.options.lineWidth}if(!u)return`${f}${s}${d.join(" ")}${s}${p}`;{let e=f;for(let t of d)e+=t?`
560
646
  ${a}${i}${t}`:"\n";return`${e}
561
- ${i}${p}`}}:function({comment:e,items:t},r,{blockItemPrefix:n,flowChars:i,itemIndent:a,onChompKeep:s,onComment:o}){let l,{indent:u,options:{commentString:c}}=r,d=Object.assign({},r,{indent:a,type:null}),f=!1,p=[];for(let e=0;e<t.length;++e){let i=t[e],s=null;if(cu(i))!f&&i.spaceBefore&&p.push(""),c8(r,p,i.commentBefore,f),i.comment&&(s=i.comment);else if(ca(i)){let e=cu(i.key)?i.key:null;e&&(!f&&e.spaceBefore&&p.push(""),c8(r,p,e.commentBefore,f))}f=!1;let o=cY(i,d,()=>s=null,()=>f=!0);s&&(o+=cC(o,a,c(s))),f&&s&&(f=!1),p.push(n+o)}if(0===p.length)l=i.start+i.end;else{l=p[0];for(let e=1;e<p.length;++e){let t=p[e];l+=t?`
562
- ${u}${t}`:"\n"}}return e?(l+="\n"+cZ(c(e),u),o&&o()):f&&s&&s(),l})(e,t,r)}function c8({indent:e,options:{commentString:t}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let i=cZ(t(n),e);r.push(i.trimStart())}}function c7(e,t){let r=cs(t)?t.value:t;for(let n of e)if(ca(n)&&(n.key===t||n.key===r||cs(n.key)&&n.key.value===r))return n}class de extends cM{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(u3,e),this.items=[]}static from(e,t,r){let{keepUndefined:n,replacer:i}=r,a=new this(e),s=(e,s)=>{if("function"==typeof i)s=i.call(t,e,s);else if(Array.isArray(i)&&!i.includes(e))return;(void 0!==s||n)&&a.items.push(c5(e,s,r))};if(t instanceof Map)for(let[e,r]of t)s(e,r);else if(t&&"object"==typeof t)for(let e of Object.keys(t))s(e,t[e]);return"function"==typeof e.sortMapEntries&&a.items.sort(e.sortMapEntries),a}add(e,t){let r;r=ca(e)?e:e&&"object"==typeof e&&"key"in e?new c9(e.key,e.value):new c9(e,e?.value);let n=c7(this.items,r.key),i=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${r.key} already set`);cs(n.value)&&cU(r.value)?n.value.value=r.value:n.value=r.value}else if(i){let e=this.items.findIndex(e=>0>i(r,e));-1===e?this.items.push(r):this.items.splice(e,0,r)}else this.items.push(r)}delete(e){let t=c7(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let r=c7(this.items,e),n=r?.value;return(!t&&cs(n)?n.value:n)??void 0}has(e){return!!c7(this.items,e)}set(e,t){this.add(new c9(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))c4(t,n,e);return n}toString(e,t,r){if(!e)return JSON.stringify(this);for(let e of this.items)if(!ca(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})),c3(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}let dt={collection:"map",default:!0,nodeClass:de,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(ci(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,r)=>de.from(e,t,r)};class dr extends cM{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ce,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=dn(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){let r=dn(e);if("number"!=typeof r)return;let n=this.items[r];return!t&&cs(n)?n.value:n}has(e){let t=dn(e);return"number"==typeof t&&t<this.items.length}set(e,t){let r=dn(e);if("number"!=typeof r)throw Error(`Expected a valid index, not ${e}.`);let n=this.items[r];cs(n)&&cU(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(cE(e,String(n++),t));return r}toString(e,t,r){return e?c3(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,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if("function"==typeof n){let r=t instanceof Set?a:String(e++);a=n.call(t,r,a)}i.items.push(cz(a,void 0,r))}}return i}}function dn(e){let t=cs(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}let di={collection:"seq",default:!0,nodeClass:dr,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(co(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,r)=>dr.from(e,t,r)},da={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,r,n)=>cH(e,t=Object.assign({actualString:!0},t),r,n)},ds={identify:e=>null==e,createNode:()=>new cj(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new cj(null),stringify:({source:e},t)=>"string"==typeof e&&ds.test.test(e)?e:t.options.nullStr},dl={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new cj("t"===e[0]||"T"===e[0]),stringify:({source:e,value:t},r)=>e&&dl.test.test(e)&&t===("t"===e[0]||"T"===e[0])?e:t?r.options.trueStr:r.options.falseStr};function du({format:e,minFractionDigits:t,tag:r,value:n}){if("bigint"==typeof n)return String(n);let i="number"==typeof n?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let a=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!r||"tag:yaml.org,2002:float"===r)&&/^-?\d/.test(a)&&!a.includes("e")){let e=a.indexOf(".");e<0&&(e=a.length,a+=".");let r=t-(a.length-e-1);for(;r-- >0;)a+="0"}return a}let dc={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()?NaN:"-"===e[0]?-1/0:1/0,stringify:du},dd={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():du(e)}},df={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 cj(parseFloat(e)),r=e.indexOf(".");return -1!==r&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-r-1),t},stringify:du},dp=e=>"bigint"==typeof e||Number.isInteger(e),dm=(e,t,r,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),r);function dh(e,t,r){let{value:n}=e;return dp(n)&&n>=0?r+n.toString(t):du(e)}let dg={identify:e=>dp(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>dm(e,2,8,r),stringify:e=>dh(e,8,"0o")},dv={identify:dp,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>dm(e,0,10,r),stringify:du},dy={identify:e=>dp(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>dm(e,2,16,r),stringify:e=>dh(e,16,"0x")},db=[dt,di,da,ds,dl,dg,dv,dy,dc,dd,df];function d$(e){return"bigint"==typeof e||Number.isInteger(e)}let dx=({value:e})=>JSON.stringify(e),dk=[dt,di].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:dx},{identify:e=>null==e,createNode:()=>new cj(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:dx},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:dx},{identify:d$,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})=>d$(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:dx}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),dw={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,i,a){let s;if(!r)return"";if("function"==typeof btoa){let e="";for(let t=0;t<r.length;++t)e+=String.fromCharCode(r[t]);s=btoa(e)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=cj.BLOCK_LITERAL),t!==cj.QUOTE_DOUBLE){let e=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),r=Math.ceil(s.length/e),i=Array(r);for(let t=0,n=0;t<r;++t,n+=e)i[t]=s.substr(n,e);s=i.join(t===cj.BLOCK_LITERAL?"\n":" ")}return cH({comment:e,type:t,value:s},n,i,a)}};function d_(e,t){if(co(e))for(let r=0;r<e.items.length;++r){let n=e.items[r];if(!ca(n)){if(ci(n)){n.items.length>1&&t("Each pair must have its own sequence indicator");let e=n.items[0]||new c9(new cj(null));if(n.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${n.commentBefore}
647
+ ${i}${p}`}}:function({comment:e,items:t},r,{blockItemPrefix:n,flowChars:i,itemIndent:a,onChompKeep:s,onComment:o}){let l,{indent:u,options:{commentString:c}}=r,d=Object.assign({},r,{indent:a,type:null}),f=!1,p=[];for(let e=0;e<t.length;++e){let i=t[e],s=null;if(cc(i))!f&&i.spaceBefore&&p.push(""),c7(r,p,i.commentBefore,f),i.comment&&(s=i.comment);else if(cs(i)){let e=cc(i.key)?i.key:null;e&&(!f&&e.spaceBefore&&p.push(""),c7(r,p,e.commentBefore,f))}f=!1;let o=cQ(i,d,()=>s=null,()=>f=!0);s&&(o+=cL(o,a,c(s))),f&&s&&(f=!1),p.push(n+o)}if(0===p.length)l=i.start+i.end;else{l=p[0];for(let e=1;e<p.length;++e){let t=p[e];l+=t?`
648
+ ${u}${t}`:"\n"}}return e?(l+="\n"+cC(c(e),u),o&&o()):f&&s&&s(),l})(e,t,r)}function c7({indent:e,options:{commentString:t}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let i=cC(t(n),e);r.push(i.trimStart())}}function de(e,t){let r=co(t)?t.value:t;for(let n of e)if(cs(n)&&(n.key===t||n.key===r||co(n.key)&&n.key.value===r))return n}class dt extends cD{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(u8,e),this.items=[]}static from(e,t,r){let{keepUndefined:n,replacer:i}=r,a=new this(e),s=(e,s)=>{if("function"==typeof i)s=i.call(t,e,s);else if(Array.isArray(i)&&!i.includes(e))return;(void 0!==s||n)&&a.items.push(c9(e,s,r))};if(t instanceof Map)for(let[e,r]of t)s(e,r);else if(t&&"object"==typeof t)for(let e of Object.keys(t))s(e,t[e]);return"function"==typeof e.sortMapEntries&&a.items.sort(e.sortMapEntries),a}add(e,t){let r;r=cs(e)?e:e&&"object"==typeof e&&"key"in e?new c3(e.key,e.value):new c3(e,e?.value);let n=de(this.items,r.key),i=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${r.key} already set`);co(n.value)&&cj(r.value)?n.value.value=r.value:n.value=r.value}else if(i){let e=this.items.findIndex(e=>0>i(r,e));-1===e?this.items.push(r):this.items.splice(e,0,r)}else this.items.push(r)}delete(e){let t=de(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let r=de(this.items,e),n=r?.value;return(!t&&co(n)?n.value:n)??void 0}has(e){return!!de(this.items,e)}set(e,t){this.add(new c3(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))c5(t,n,e);return n}toString(e,t,r){if(!e)return JSON.stringify(this);for(let e of this.items)if(!cs(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})),c8(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}let dr={collection:"map",default:!0,nodeClass:dt,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(ca(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,r)=>dt.from(e,t,r)};class dn extends cD{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ct,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=di(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){let r=di(e);if("number"!=typeof r)return;let n=this.items[r];return!t&&co(n)?n.value:n}has(e){let t=di(e);return"number"==typeof t&&t<this.items.length}set(e,t){let r=di(e);if("number"!=typeof r)throw Error(`Expected a valid index, not ${e}.`);let n=this.items[r];co(n)&&cj(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(cA(e,String(n++),t));return r}toString(e,t,r){return e?c8(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,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if("function"==typeof n){let r=t instanceof Set?a:String(e++);a=n.call(t,r,a)}i.items.push(cT(a,void 0,r))}}return i}}function di(e){let t=co(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}let da={collection:"seq",default:!0,nodeClass:dn,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(cl(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,r)=>dn.from(e,t,r)},ds={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,r,n)=>cX(e,t=Object.assign({actualString:!0},t),r,n)},dl={identify:e=>null==e,createNode:()=>new cz(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new cz(null),stringify:({source:e},t)=>"string"==typeof e&&dl.test.test(e)?e:t.options.nullStr},du={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new cz("t"===e[0]||"T"===e[0]),stringify:({source:e,value:t},r)=>e&&du.test.test(e)&&t===("t"===e[0]||"T"===e[0])?e:t?r.options.trueStr:r.options.falseStr};function dc({format:e,minFractionDigits:t,tag:r,value:n}){if("bigint"==typeof n)return String(n);let i="number"==typeof n?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let a=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!r||"tag:yaml.org,2002:float"===r)&&/^-?\d/.test(a)&&!a.includes("e")){let e=a.indexOf(".");e<0&&(e=a.length,a+=".");let r=t-(a.length-e-1);for(;r-- >0;)a+="0"}return a}let dd={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()?NaN:"-"===e[0]?-1/0:1/0,stringify:dc},df={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():dc(e)}},dp={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 cz(parseFloat(e)),r=e.indexOf(".");return -1!==r&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-r-1),t},stringify:dc},dm=e=>"bigint"==typeof e||Number.isInteger(e),dh=(e,t,r,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),r);function dg(e,t,r){let{value:n}=e;return dm(n)&&n>=0?r+n.toString(t):dc(e)}let dv={identify:e=>dm(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>dh(e,2,8,r),stringify:e=>dg(e,8,"0o")},dy={identify:dm,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>dh(e,0,10,r),stringify:dc},db={identify:e=>dm(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>dh(e,2,16,r),stringify:e=>dg(e,16,"0x")},d$=[dr,da,ds,dl,du,dv,dy,db,dd,df,dp];function dx(e){return"bigint"==typeof e||Number.isInteger(e)}let dk=({value:e})=>JSON.stringify(e),dw=[dr,da].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:dk},{identify:e=>null==e,createNode:()=>new cz(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:dk},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:dk},{identify:dx,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})=>dx(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:dk}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),d_={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,i,a){let s;if(!r)return"";if("function"==typeof btoa){let e="";for(let t=0;t<r.length;++t)e+=String.fromCharCode(r[t]);s=btoa(e)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=cz.BLOCK_LITERAL),t!==cz.QUOTE_DOUBLE){let e=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),r=Math.ceil(s.length/e),i=Array(r);for(let t=0,n=0;t<r;++t,n+=e)i[t]=s.substr(n,e);s=i.join(t===cz.BLOCK_LITERAL?"\n":" ")}return cX({comment:e,type:t,value:s},n,i,a)}};function dS(e,t){if(cl(e))for(let r=0;r<e.items.length;++r){let n=e.items[r];if(!cs(n)){if(ca(n)){n.items.length>1&&t("Each pair must have its own sequence indicator");let e=n.items[0]||new c3(new cz(null));if(n.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${n.commentBefore}
563
649
  ${e.key.commentBefore}`:n.commentBefore),n.comment){let t=e.value??e.key;t.comment=t.comment?`${n.comment}
564
- ${t.comment}`:n.comment}n=e}e.items[r]=ca(n)?n:new c9(n)}}else t("Expected a sequence for this tag");return e}function dS(e,t,r){let{replacer:n}=r,i=new dr(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let s,o;if("function"==typeof n&&(e=n.call(t,String(a++),e)),Array.isArray(e))if(2===e.length)s=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[s=t[0]];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else s=e;i.items.push(c5(s,o,r))}return i}let dI={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:d_,createNode:dS};class dO extends dr{constructor(){super(),this.add=de.prototype.add.bind(this),this.delete=de.prototype.delete.bind(this),this.get=de.prototype.get.bind(this),this.has=de.prototype.has.bind(this),this.set=de.prototype.set.bind(this),this.tag=dO.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,i;if(ca(e)?(n=cE(e.key,"",t),i=cE(e.value,n,t)):n=cE(e,"",t),r.has(n))throw Error("Ordered maps must not include duplicate keys");r.set(n,i)}return r}static from(e,t,r){let n=dS(e,t,r),i=new this;return i.items=n.items,i}}dO.tag="tag:yaml.org,2002:omap";let dE={collection:"seq",identify:e=>e instanceof Map,nodeClass:dO,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=d_(e,t),n=[];for(let{key:e}of r.items)cs(e)&&(n.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):n.push(e.value));return Object.assign(new dO,r)},createNode:(e,t,r)=>dO.from(e,t,r)};function dA({value:e,source:t},r){return t&&(e?dN:dU).test.test(t)?t:e?r.options.trueStr:r.options.falseStr}let dN={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 cj(!0),stringify:dA},dU={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 cj(!1),stringify:dA},dj=e=>"bigint"==typeof e||Number.isInteger(e);function dz(e,t,r,{intAsBigInt:n}){let i=e[0];if(("-"===i||"+"===i)&&(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"-"===i?BigInt(-1)*t:t}let a=parseInt(e,r);return"-"===i?-1*a:a}function dT(e,t,r){let{value:n}=e;if(dj(n)){let e=n.toString(t);return n<0?"-"+r+e.substr(1):r+e}return du(e)}class dP extends de{constructor(e){super(e),this.tag=dP.tag}add(e){let t;t=ca(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new c9(e.key,null):new c9(e,null),c7(this.items,t.key)||this.items.push(t)}get(e,t){let r=c7(this.items,e);return!t&&ca(r)?cs(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=c7(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new c9(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,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof n&&(e=n.call(t,e,e)),i.items.push(c5(e,null,r));return i}}dP.tag="tag:yaml.org,2002:set";let dM={collection:"map",identify:e=>e instanceof Set,nodeClass:dP,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>dP.from(e,t,r),resolve(e,t){if(ci(e))if(e.hasAllNullValues(!0))return Object.assign(new dP,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};function dD(e,t){let r=e[0],n="-"===r||"+"===r?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=n.replace(/_/g,"").split(":").reduce((e,t)=>e*i(60)+i(t),i(0));return"-"===r?i(-1)*a:a}function dZ(e){let{value:t}=e,r=e=>e;if("bigint"==typeof t)r=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return du(e);let n="";t<0&&(n="-",t*=r(-1));let i=r(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),n+a.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}let dC={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})=>dD(e,r),stringify:dZ},dL={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=>dD(e,!1),stringify:dZ},dR={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(dR.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,a,s,o]=t.map(Number),l=Date.UTC(r,n-1,i,a||0,s||0,o||0,t[7]?Number((t[7]+"00").substr(1,3)):0),u=t[8];if(u&&"Z"!==u){let e=dD(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$/,"")??""},dq=[dt,di,da,ds,dN,dU,{identify:dj,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>dz(e,2,2,r),stringify:e=>dT(e,2,"0b")},{identify:dj,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>dz(e,1,8,r),stringify:e=>dT(e,8,"0")},{identify:dj,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>dz(e,0,10,r),stringify:du},{identify:dj,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>dz(e,2,16,r),stringify:e=>dT(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()?NaN:"-"===e[0]?-1/0:1/0,stringify:du},{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():du(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 cj(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:du},dw,c0,dE,dI,dM,dC,dL,dR],dF=new Map([["core",db],["failsafe",[dt,di,da]],["json",dk],["yaml11",dq],["yaml-1.1",dq]]),dB={binary:dw,bool:dl,float:df,floatExp:dd,floatNaN:dc,floatTime:dL,int:dv,intHex:dy,intOct:dg,intTime:dC,map:dt,merge:c0,null:ds,omap:dE,pairs:dI,seq:di,set:dM,timestamp:dR},dJ={"tag:yaml.org,2002:binary":dw,"tag:yaml.org,2002:merge":c0,"tag:yaml.org,2002:omap":dE,"tag:yaml.org,2002:pairs":dI,"tag:yaml.org,2002:set":dM,"tag:yaml.org,2002:timestamp":dR};function dK(e,t,r){let n=dF.get(t);if(n&&!e)return r&&!n.includes(c0)?n.concat(c0):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(dF.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)i=i.concat(t);else"function"==typeof e&&(i=e(i.slice()));return r&&(i=i.concat(c0)),i.reduce((e,t)=>{let r="string"==typeof t?dB[t]:t;if(!r){let e=JSON.stringify(t),r=Object.keys(dB).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 dW=(e,t)=>e.key<t.key?-1:+(e.key>t.key);class dV{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:i,sortMapEntries:a,toStringDefaults:s}){this.compat=Array.isArray(e)?dK(e,"compat"):e?dK(null,e):null,this.name="string"==typeof i&&i||"core",this.knownTags=n?dJ:{},this.tags=dK(t,this.name,r),this.toStringOptions=s??null,Object.defineProperty(this,u3,{value:dt}),Object.defineProperty(this,u7,{value:da}),Object.defineProperty(this,ce,{value:di}),this.sortMapEntries="function"==typeof a?a:!0===a?dW:null}clone(){let e=Object.create(dV.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}class dG{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ct,{value:u9});let n=null;"function"==typeof t||Array.isArray(t)?n=t:void 0===r&&t&&(r=t,t=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:a}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new cw({version:a}),this.setSchema(a,r),this.contents=void 0===e?null:this.createNode(e,n,r)}clone(){let e=Object.create(dG.prototype,{[ct]:{value:u9}});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=cu(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){dH(this.contents)&&this.contents.add(e)}addIn(e,t){dH(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=cS(this);e.anchor=!t||r.has(t)?cI(t||"a",r):t}return new cN(e.anchor)}createNode(e,t,r){var n,i;let a,s,o,l;if("function"==typeof t)e=t.call({"":e},"",e),a=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)),a=t}else void 0===r&&t&&(r=t,t=void 0);let{aliasDuplicateObjects:u,anchorPrefix:c,flow:d,keepUndefined:f,onTagObj:p,tag:m}=r??{},{onAnchor:h,setAnchors:g,sourceObjects:v}=(n=this,i=c||"a",s=[],o=new Map,l=null,{onAnchor:e=>{s.push(e),l??(l=cS(n));let t=cI(i,l);return l.add(t),t},setAnchors:()=>{for(let e of s){let t=o.get(e);if("object"==typeof t&&t.anchor&&(cs(t.node)||cl(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}),y={aliasDuplicateObjects:u??!0,keepUndefined:f??!1,onAnchor:h,onTagObj:p,replacer:a,schema:this.schema,sourceObjects:v},b=cz(e,m,y);return d&&cl(b)&&(b.flow=!0),g(),b}createPair(e,t,r={}){return new c9(this.createNode(e,null,r),this.createNode(t,null,r))}delete(e){return!!dH(this.contents)&&this.contents.delete(e)}deleteIn(e){return cP(e)?null!=this.contents&&(this.contents=null,!0):!!dH(this.contents)&&this.contents.deleteIn(e)}get(e,t){return cl(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return cP(e)?!t&&cs(this.contents)?this.contents.value:this.contents:cl(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!cl(this.contents)&&this.contents.has(e)}hasIn(e){return cP(e)?void 0!==this.contents:!!cl(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=cT(this.schema,[e],t):dH(this.contents)&&this.contents.set(e,t)}setIn(e,t){cP(e)?this.contents=t:null==this.contents?this.contents=cT(this.schema,Array.from(e),t):dH(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 cw({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 cw({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 dV(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:i,reviver:a}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===r,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},o=cE(this.contents,t??"",s);if("function"==typeof i)for(let{count:e,res:t}of s.anchors.values())i(t,e);return"function"==typeof a?cO(a,{"":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 i=cX(e,t),{commentString:a}=i.options;if(e.commentBefore){1!==r.length&&r.unshift("");let t=a(e.commentBefore);r.unshift(cZ(t,""))}let s=!1,o=null;if(e.contents){if(cu(e.contents)){if(e.contents.spaceBefore&&n&&r.push(""),e.contents.commentBefore){let t=a(e.contents.commentBefore);r.push(cZ(t,""))}i.forceBlockIndent=!!e.comment,o=e.contents.comment}let t=o?void 0:()=>s=!0,l=cY(e.contents,i,()=>o=null,t);o&&(l+=cC(l,"",a(o))),("|"===l[0]||">"===l[0])&&"---"===r[r.length-1]?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(cY(e.contents,i));if(e.directives?.docEnd)if(e.comment){let t=a(e.comment);t.includes("\n")?(r.push("..."),r.push(cZ(t,""))):r.push(`... ${t}`)}else r.push("...");else{let t=e.comment;t&&s&&(t=t.replace(/^\n+/,"")),t&&((!s||o)&&""!==r[r.length-1]&&r.push(""),r.push(cZ(a(t),"")))}return r.join("\n")+"\n"}(this,e)}}function dH(e){if(cl(e))return!0;throw Error("Expected a YAML collection as document contents")}class dX extends Error{constructor(e,t,r,n){super(),this.name=e,this.code=r,this.message=n,this.pos=t}}class dY extends dX{constructor(e,t,r){super("YAMLParseError",e,t,r)}}class dQ extends dX{constructor(e,t,r){super("YAMLWarning",e,t,r)}}let d0=(e,t)=>r=>{if(-1===r.pos[0])return;r.linePos=r.pos.map(e=>t.linePos(e));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let a=i-1,s=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(a>=60&&s.length>80){let e=Math.min(a-39,s.length-79);s="…"+s.substring(e),a-=e-1}if(s.length>80&&(s=s.substring(0,79)+"…"),n>1&&/^ *$/.test(s.substring(0,a))){let r=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);r.length>80&&(r=r.substring(0,79)+"…\n"),s=r+s}if(/[^ ]/.test(s)){let e=1,t=r.linePos[1];t?.line===n&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let o=" ".repeat(a)+"^".repeat(e);r.message+=`:
650
+ ${t.comment}`:n.comment}n=e}e.items[r]=cs(n)?n:new c3(n)}}else t("Expected a sequence for this tag");return e}function dI(e,t,r){let{replacer:n}=r,i=new dn(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let s,o;if("function"==typeof n&&(e=n.call(t,String(a++),e)),Array.isArray(e))if(2===e.length)s=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[s=t[0]];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else s=e;i.items.push(c9(s,o,r))}return i}let dO={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:dS,createNode:dI};class dE extends dn{constructor(){super(),this.add=dt.prototype.add.bind(this),this.delete=dt.prototype.delete.bind(this),this.get=dt.prototype.get.bind(this),this.has=dt.prototype.has.bind(this),this.set=dt.prototype.set.bind(this),this.tag=dE.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,i;if(cs(e)?(n=cA(e.key,"",t),i=cA(e.value,n,t)):n=cA(e,"",t),r.has(n))throw Error("Ordered maps must not include duplicate keys");r.set(n,i)}return r}static from(e,t,r){let n=dI(e,t,r),i=new this;return i.items=n.items,i}}dE.tag="tag:yaml.org,2002:omap";let dA={collection:"seq",identify:e=>e instanceof Map,nodeClass:dE,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=dS(e,t),n=[];for(let{key:e}of r.items)co(e)&&(n.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):n.push(e.value));return Object.assign(new dE,r)},createNode:(e,t,r)=>dE.from(e,t,r)};function dN({value:e,source:t},r){return t&&(e?dU:dj).test.test(t)?t:e?r.options.trueStr:r.options.falseStr}let dU={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 cz(!0),stringify:dN},dj={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 cz(!1),stringify:dN},dz=e=>"bigint"==typeof e||Number.isInteger(e);function dT(e,t,r,{intAsBigInt:n}){let i=e[0];if(("-"===i||"+"===i)&&(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"-"===i?BigInt(-1)*t:t}let a=parseInt(e,r);return"-"===i?-1*a:a}function dP(e,t,r){let{value:n}=e;if(dz(n)){let e=n.toString(t);return n<0?"-"+r+e.substr(1):r+e}return dc(e)}class dM extends dt{constructor(e){super(e),this.tag=dM.tag}add(e){let t;t=cs(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new c3(e.key,null):new c3(e,null),de(this.items,t.key)||this.items.push(t)}get(e,t){let r=de(this.items,e);return!t&&cs(r)?co(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=de(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new c3(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,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof n&&(e=n.call(t,e,e)),i.items.push(c9(e,null,r));return i}}dM.tag="tag:yaml.org,2002:set";let dD={collection:"map",identify:e=>e instanceof Set,nodeClass:dM,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>dM.from(e,t,r),resolve(e,t){if(ca(e))if(e.hasAllNullValues(!0))return Object.assign(new dM,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};function dZ(e,t){let r=e[0],n="-"===r||"+"===r?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=n.replace(/_/g,"").split(":").reduce((e,t)=>e*i(60)+i(t),i(0));return"-"===r?i(-1)*a:a}function dC(e){let{value:t}=e,r=e=>e;if("bigint"==typeof t)r=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return dc(e);let n="";t<0&&(n="-",t*=r(-1));let i=r(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),n+a.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}let dL={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})=>dZ(e,r),stringify:dC},dR={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=>dZ(e,!1),stringify:dC},dq={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(dq.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,a,s,o]=t.map(Number),l=Date.UTC(r,n-1,i,a||0,s||0,o||0,t[7]?Number((t[7]+"00").substr(1,3)):0),u=t[8];if(u&&"Z"!==u){let e=dZ(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$/,"")??""},dF=[dr,da,ds,dl,dU,dj,{identify:dz,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>dT(e,2,2,r),stringify:e=>dP(e,2,"0b")},{identify:dz,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>dT(e,1,8,r),stringify:e=>dP(e,8,"0")},{identify:dz,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>dT(e,0,10,r),stringify:dc},{identify:dz,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>dT(e,2,16,r),stringify:e=>dP(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()?NaN:"-"===e[0]?-1/0:1/0,stringify:dc},{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():dc(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 cz(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:dc},d_,c1,dA,dO,dD,dL,dR,dq],dB=new Map([["core",d$],["failsafe",[dr,da,ds]],["json",dw],["yaml11",dF],["yaml-1.1",dF]]),dJ={binary:d_,bool:du,float:dp,floatExp:df,floatNaN:dd,floatTime:dR,int:dy,intHex:db,intOct:dv,intTime:dL,map:dr,merge:c1,null:dl,omap:dA,pairs:dO,seq:da,set:dD,timestamp:dq},dK={"tag:yaml.org,2002:binary":d_,"tag:yaml.org,2002:merge":c1,"tag:yaml.org,2002:omap":dA,"tag:yaml.org,2002:pairs":dO,"tag:yaml.org,2002:set":dD,"tag:yaml.org,2002:timestamp":dq};function dW(e,t,r){let n=dB.get(t);if(n&&!e)return r&&!n.includes(c1)?n.concat(c1):n.slice();let i=n;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(dB.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)i=i.concat(t);else"function"==typeof e&&(i=e(i.slice()));return r&&(i=i.concat(c1)),i.reduce((e,t)=>{let r="string"==typeof t?dJ[t]:t;if(!r){let e=JSON.stringify(t),r=Object.keys(dJ).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 dV=(e,t)=>e.key<t.key?-1:+(e.key>t.key);class dG{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:i,sortMapEntries:a,toStringDefaults:s}){this.compat=Array.isArray(e)?dW(e,"compat"):e?dW(null,e):null,this.name="string"==typeof i&&i||"core",this.knownTags=n?dK:{},this.tags=dW(t,this.name,r),this.toStringOptions=s??null,Object.defineProperty(this,u8,{value:dr}),Object.defineProperty(this,ce,{value:ds}),Object.defineProperty(this,ct,{value:da}),this.sortMapEntries="function"==typeof a?a:!0===a?dV:null}clone(){let e=Object.create(dG.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}class dH{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,cr,{value:u3});let n=null;"function"==typeof t||Array.isArray(t)?n=t:void 0===r&&t&&(r=t,t=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:a}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new c_({version:a}),this.setSchema(a,r),this.contents=void 0===e?null:this.createNode(e,n,r)}clone(){let e=Object.create(dH.prototype,{[cr]:{value:u3}});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=cc(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){dX(this.contents)&&this.contents.add(e)}addIn(e,t){dX(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=cI(this);e.anchor=!t||r.has(t)?cO(t||"a",r):t}return new cU(e.anchor)}createNode(e,t,r){var n,i;let a,s,o,l;if("function"==typeof t)e=t.call({"":e},"",e),a=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)),a=t}else void 0===r&&t&&(r=t,t=void 0);let{aliasDuplicateObjects:u,anchorPrefix:c,flow:d,keepUndefined:f,onTagObj:p,tag:m}=r??{},{onAnchor:h,setAnchors:g,sourceObjects:v}=(n=this,i=c||"a",s=[],o=new Map,l=null,{onAnchor:e=>{s.push(e),l??(l=cI(n));let t=cO(i,l);return l.add(t),t},setAnchors:()=>{for(let e of s){let t=o.get(e);if("object"==typeof t&&t.anchor&&(co(t.node)||cu(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}),y={aliasDuplicateObjects:u??!0,keepUndefined:f??!1,onAnchor:h,onTagObj:p,replacer:a,schema:this.schema,sourceObjects:v},b=cT(e,m,y);return d&&cu(b)&&(b.flow=!0),g(),b}createPair(e,t,r={}){return new c3(this.createNode(e,null,r),this.createNode(t,null,r))}delete(e){return!!dX(this.contents)&&this.contents.delete(e)}deleteIn(e){return cM(e)?null!=this.contents&&(this.contents=null,!0):!!dX(this.contents)&&this.contents.deleteIn(e)}get(e,t){return cu(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return cM(e)?!t&&co(this.contents)?this.contents.value:this.contents:cu(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!cu(this.contents)&&this.contents.has(e)}hasIn(e){return cM(e)?void 0!==this.contents:!!cu(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=cP(this.schema,[e],t):dX(this.contents)&&this.contents.set(e,t)}setIn(e,t){cM(e)?this.contents=t:null==this.contents?this.contents=cP(this.schema,Array.from(e),t):dX(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 c_({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 c_({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 dG(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:i,reviver:a}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===r,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},o=cA(this.contents,t??"",s);if("function"==typeof i)for(let{count:e,res:t}of s.anchors.values())i(t,e);return"function"==typeof a?cE(a,{"":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 i=cY(e,t),{commentString:a}=i.options;if(e.commentBefore){1!==r.length&&r.unshift("");let t=a(e.commentBefore);r.unshift(cC(t,""))}let s=!1,o=null;if(e.contents){if(cc(e.contents)){if(e.contents.spaceBefore&&n&&r.push(""),e.contents.commentBefore){let t=a(e.contents.commentBefore);r.push(cC(t,""))}i.forceBlockIndent=!!e.comment,o=e.contents.comment}let t=o?void 0:()=>s=!0,l=cQ(e.contents,i,()=>o=null,t);o&&(l+=cL(l,"",a(o))),("|"===l[0]||">"===l[0])&&"---"===r[r.length-1]?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(cQ(e.contents,i));if(e.directives?.docEnd)if(e.comment){let t=a(e.comment);t.includes("\n")?(r.push("..."),r.push(cC(t,""))):r.push(`... ${t}`)}else r.push("...");else{let t=e.comment;t&&s&&(t=t.replace(/^\n+/,"")),t&&((!s||o)&&""!==r[r.length-1]&&r.push(""),r.push(cC(a(t),"")))}return r.join("\n")+"\n"}(this,e)}}function dX(e){if(cu(e))return!0;throw Error("Expected a YAML collection as document contents")}class dY extends Error{constructor(e,t,r,n){super(),this.name=e,this.code=r,this.message=n,this.pos=t}}class dQ extends dY{constructor(e,t,r){super("YAMLParseError",e,t,r)}}class d0 extends dY{constructor(e,t,r){super("YAMLWarning",e,t,r)}}let d1=(e,t)=>r=>{if(-1===r.pos[0])return;r.linePos=r.pos.map(e=>t.linePos(e));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let a=i-1,s=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(a>=60&&s.length>80){let e=Math.min(a-39,s.length-79);s="…"+s.substring(e),a-=e-1}if(s.length>80&&(s=s.substring(0,79)+"…"),n>1&&/^ *$/.test(s.substring(0,a))){let r=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);r.length>80&&(r=r.substring(0,79)+"…\n"),s=r+s}if(/[^ ]/.test(s)){let e=1,t=r.linePos[1];t?.line===n&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let o=" ".repeat(a)+"^".repeat(e);r.message+=`:
565
651
 
566
652
  ${s}
567
653
  ${o}
568
- `}};function d1(e,{flow:t,indicator:r,next:n,offset:i,onError:a,parentIndent:s,startOnNewline:o}){let l=!1,u=o,c=o,d="",f="",p=!1,m=!1,h=null,g=null,v=null,y=null,b=null,$=null,x=null;for(let i of e)switch(m&&("space"!==i.type&&"newline"!==i.type&&"comma"!==i.type&&a(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(u&&"comment"!==i.type&&"newline"!==i.type&&a(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),i.type){case"space":!t&&("doc-start"!==r||n?.type!=="flow-collection")&&i.source.includes(" ")&&(h=i),c=!0;break;case"comment":{c||a(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let e=i.source.substring(1)||" ";d?d+=f+e:d=e,f="",u=!1;break}case"newline":u?d?d+=i.source:$&&"seq-item-ind"===r||(l=!0):f+=i.source,u=!0,p=!0,(g||v)&&(y=i),c=!0;break;case"anchor":g&&a(i,"MULTIPLE_ANCHORS","A node can have at most one anchor"),i.source.endsWith(":")&&a(i.offset+i.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=i,x??(x=i.offset),u=!1,c=!1,m=!0;break;case"tag":v&&a(i,"MULTIPLE_TAGS","A node can have at most one tag"),v=i,x??(x=i.offset),u=!1,c=!1,m=!0;break;case r:(g||v)&&a(i,"BAD_PROP_ORDER",`Anchors and tags must be after the ${i.source} indicator`),$&&a(i,"UNEXPECTED_TOKEN",`Unexpected ${i.source} in ${t??"collection"}`),$=i,u="seq-item-ind"===r||"explicit-key-ind"===r,c=!1;break;case"comma":if(t){b&&a(i,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=i,u=!1,c=!1;break}default:a(i,"UNEXPECTED_TOKEN",`Unexpected ${i.type} token`),u=!1,c=!1}let k=e[e.length-1],w=k?k.offset+k.source.length:i;return m&&n&&"space"!==n.type&&"newline"!==n.type&&"comma"!==n.type&&("scalar"!==n.type||""!==n.source)&&a(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(u&&h.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&a(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:$,spaceBefore:l,comment:d,hasNewline:p,anchor:g,tag:v,newlineAfterProp:y,end:w,start:x??w}}function d2(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(d2(t.key)||d2(t.value))return!0}return!1;default:return!0}}function d6(e,t,r){if(t?.type==="flow-collection"){let n=t.end[0];n.indent===e&&("]"===n.source||"}"===n.source)&&d2(t)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function d4(e,t,r){let{uniqueKeys:n}=e.options;if(!1===n)return!1;let i="function"==typeof n?n:(e,t)=>e===t||cs(e)&&cs(t)&&e.value===t.value;return t.some(e=>i(e.key,r))}let d5="All mapping items must start at the same column";function d9(e,t,r,n){let i="";if(e){let a=!1,s="";for(let o of e){let{source:e,type:l}=o;switch(l){case"space":a=!0;break;case"comment":{r&&!a&&n(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let t=e.substring(1)||" ";i?i+=s+t:i=t,s="";break}case"newline":i&&(s+=e),a=!0;break;default:n(o,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=e.length}}return{comment:i,offset:t}}let d3="Block collections are not allowed within flow collections",d8=e=>e&&("block-map"===e.type||"block-seq"===e.type);function d7(e,t,r,n,i,a){let s="block-map"===r.type?function({composeNode:e,composeEmptyNode:t},r,n,i,a){let s=new(a?.nodeClass??de)(r.schema);r.atRoot&&(r.atRoot=!1);let o=n.offset,l=null;for(let a of n.items){let{start:u,key:c,sep:d,value:f}=a,p=d1(u,{indicator:"explicit-key-ind",next:c??d?.[0],offset:o,onError:i,parentIndent:n.indent,startOnNewline:!0}),m=!p.found;if(m){if(c&&("block-seq"===c.type?i(o,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in c&&c.indent!==n.indent&&i(o,"BAD_INDENT",d5)),!p.anchor&&!p.tag&&!d){l=p.end,p.comment&&(s.comment?s.comment+="\n"+p.comment:s.comment=p.comment);continue}(p.newlineAfterProp||d2(c))&&i(c??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==n.indent&&i(o,"BAD_INDENT",d5);r.atKey=!0;let h=p.end,g=c?e(r,c,p,i):t(r,h,u,null,p,i);r.schema.compat&&d6(n.indent,c,i),r.atKey=!1,d4(r,s.items,g)&&i(h,"DUPLICATE_KEY","Map keys must be unique");let v=d1(d??[],{indicator:"map-value-ind",next:f,offset:g.range[2],onError:i,parentIndent:n.indent,startOnNewline:!c||"block-scalar"===c.type});if(o=v.end,v.found){m&&(f?.type!=="block-map"||v.hasNewline||i(o,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&p.start<v.found.offset-1024&&i(g.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let l=f?e(r,f,v,i):t(r,o,d,null,v,i);r.schema.compat&&d6(n.indent,f,i),o=l.range[2];let u=new c9(g,l);r.options.keepSourceTokens&&(u.srcToken=a),s.items.push(u)}else{m&&i(g.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(g.comment?g.comment+="\n"+v.comment:g.comment=v.comment);let e=new c9(g);r.options.keepSourceTokens&&(e.srcToken=a),s.items.push(e)}}return l&&l<o&&i(l,"IMPOSSIBLE","Map comment with trailing content"),s.range=[n.offset,o,l??o],s}(e,t,r,n,a):"block-seq"===r.type?function({composeNode:e,composeEmptyNode:t},r,n,i,a){let s=new(a?.nodeClass??dr)(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let o=n.offset,l=null;for(let{start:a,value:u}of n.items){let c=d1(a,{indicator:"seq-item-ind",next:u,offset:o,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!c.found)if(c.anchor||c.tag||u)u?.type==="block-seq"?i(c.end,"BAD_INDENT","All sequence items must start at the same column"):i(o,"MISSING_CHAR","Sequence item without - indicator");else{l=c.end,c.comment&&(s.comment=c.comment);continue}let d=u?e(r,u,c,i):t(r,c.end,a,null,c,i);r.schema.compat&&d6(n.indent,u,i),o=d.range[2],s.items.push(d)}return s.range=[n.offset,o,l??o],s}(e,t,r,n,a):function({composeNode:e,composeEmptyNode:t},r,n,i,a){let s="{"===n.start.source,o=s?"flow map":"flow sequence",l=new(a?.nodeClass??(s?de:dr))(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 a=0;a<n.items.length;++a){let u=n.items[a],{start:d,key:f,sep:p,value:m}=u,h=d1(d,{flow:o,indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){0===a&&h.comma?i(h.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):a<n.items.length-1&&i(h.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),h.comment&&(l.comment?l.comment+="\n"+h.comment:l.comment=h.comment),c=h.end;continue}!s&&r.options.strict&&d2(f)&&i(f,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===a)h.comma&&i(h.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(h.comma||i(h.start,"MISSING_CHAR",`Missing , between ${o} items`),h.comment){let e="";e:for(let t of d)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];ca(t)&&(t=t.value??t.key),t.comment?t.comment+="\n"+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(s||p||h.found){r.atKey=!0;let a=h.end,g=f?e(r,f,h,i):t(r,a,d,null,h,i);d8(f)&&i(g.range,"BLOCK_IN_FLOW",d3),r.atKey=!1;let v=d1(p??[],{flow:o,indicator:"map-value-ind",next:m,offset:g.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(v.found){if(!s&&!h.found&&r.options.strict){if(p)for(let e of p){if(e===v.found)break;if("newline"===e.type){i(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}h.start<v.found.offset-1024&&i(v.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else m&&("source"in m&&m.source?.[0]===":"?i(m,"MISSING_CHAR",`Missing space after : in ${o}`):i(v.start,"MISSING_CHAR",`Missing , or : between ${o} items`));let y=m?e(r,m,v,i):v.found?t(r,v.end,p,null,v,i):null;y?d8(m)&&i(y.range,"BLOCK_IN_FLOW",d3):v.comment&&(g.comment?g.comment+="\n"+v.comment:g.comment=v.comment);let b=new c9(g,y);if(r.options.keepSourceTokens&&(b.srcToken=u),s)d4(r,l.items,g)&&i(a,"DUPLICATE_KEY","Map keys must be unique"),l.items.push(b);else{let e=new de(r.schema);e.flow=!0,e.items.push(b);let t=(y??g).range;e.range=[g.range[0],t[1],t[2]],l.items.push(e)}c=y?y.range[2]:v.end}else{let n=m?e(r,m,h,i):t(r,h.end,p,null,h,i);l.items.push(n),c=n.range[2],d8(m)&&i(n.range,"BLOCK_IN_FLOW",d3)}}let d=s?"}":"]",[f,...p]=n.end,m=c;if(f?.source===d)m=f.offset+f.source.length;else{let e=o[0].toUpperCase()+o.substring(1),t=u?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(c,u?"MISSING_CHAR":"BAD_INDENT",t),f&&1!==f.source.length&&p.unshift(f)}if(p.length>0){let e=d9(p,m,r.options.strict,i);e.comment&&(l.comment?l.comment+="\n"+e.comment:l.comment=e.comment),l.range=[n.offset,m,e.offset]}else l.range=[n.offset,m,m];return l}(e,t,r,n,a),o=s.constructor;return"!"===i||i===o.tagName?s.tag=o.tagName:i&&(s.tag=i),s}function fe(e,t,r){let n=t.offset,i=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:i}=t[0],a=i[0],s=0,o="",l=-1;for(let t=1;t<i.length;++t){let r=i[t];if(o||"-"!==r&&"+"!==r){let n=Number(r);!s&&n?s=n:-1===l&&(l=e+t)}else o=r}-1!==l&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let u=!1,c="",d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case"space":u=!0;case"newline":d+=i.source.length;break;case"comment":r&&!u&&n(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=i.source.length,c=i.source.substring(1);break;case"error":n(i,"UNEXPECTED_TOKEN",i.message),d+=i.source.length;break;default:{let e=`Unexpected token in block scalar header: ${i.type}`;n(i,"UNEXPECTED_TOKEN",e);let t=i.source;t&&"string"==typeof t&&(d+=t.length)}}}return{mode:a,indent:s,chomp:o,comment:c,length:d}}(t,e.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let a=">"===i.mode?cj.BLOCK_FOLDED:cj.BLOCK_LITERAL,s=t.source?function(e){let t=e.split(/\n( *)/),r=t[0],n=r.match(/^( *)/),i=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}(t.source):[],o=s.length;for(let e=s.length-1;e>=0;--e){let t=s[e][1];if(""===t||"\r"===t)o=e;else break}if(0===o){let e="+"===i.chomp&&s.length>0?"\n".repeat(Math.max(1,s.length-1)):"",r=n+i.length;return t.source&&(r+=t.source.length),{value:e,type:a,comment:i.comment,range:[n,r,r]}}let l=t.indent+i.indent,u=t.offset+i.length,c=0;for(let t=0;t<o;++t){let[n,a]=s[t];if(""===a||"\r"===a)0===i.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===i.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+a.length+1}for(let e=s.length-1;e>=o;--e)s[e][0].length>l&&(o=e+1);let d="",f="",p=!1;for(let e=0;e<c;++e)d+=s[e][0].slice(l)+"\n";for(let e=c;e<o;++e){let[t,n]=s[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=i.indent?"explicit indentation indicator":"first line",a=`Block scalar lines must not be less indented than their ${e}`;r(u-n.length-(o?2:1),"BAD_INDENT",a),t=""}a===cj.BLOCK_LITERAL?(d+=f+t.slice(l)+n,f="\n"):t.length>l||" "===n[0]?(" "===f?f="\n":p||"\n"!==f||(f="\n\n"),d+=f+t.slice(l)+n,f="\n",p=!0):""===n?"\n"===f?d+="\n":f="\n":(d+=f+n,f=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let e=o;e<s.length;++e)d+="\n"+s[e][0].slice(l);"\n"!==d[d.length-1]&&(d+="\n");break;default:d+="\n"}let m=n+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[n,m,m]}}function ft(e,t,r){let n,i,{offset:a,type:s,source:o,end:l}=e,u=(e,t,n)=>r(a+e,t,n);switch(s){case"scalar":n=cj.PLAIN,i=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}`),fr(e)}(o,u);break;case"single-quoted-scalar":var c,d;n=cj.QUOTE_SINGLE,c=o,d=u,("'"!==c[c.length-1]||1===c.length)&&d(c.length,"MISSING_CHAR","Missing closing 'quote"),i=fr(c.slice(1,-1)).replace(/''/g,"'");break;case"double-quoted-scalar":n=cj.QUOTE_DOUBLE,i=function(e,t){let r="";for(let n=1;n<e.length-1;++n){let i=e[n];if("\r"!==i||"\n"!==e[n+1])if("\n"===i){let{fold:t,offset:i}=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=i}else if("\\"===i){let i=e[++n],a=fn[i];if(a)r+=a;else if("\n"===i)for(i=e[n+1];" "===i||" "===i;)i=e[++n+1];else if("\r"===i&&"\n"===e[n+1])for(i=e[++n+1];" "===i||" "===i;)i=e[++n+1];else if("x"===i||"u"===i||"U"===i){let a="x"===i?2:"u"===i?4:8;r+=function(e,t,r,n){let i=e.substr(t,r),a=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,r+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),i}}(e,n+1,a,t),n+=a}else{let i=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),r+=i}}else if(" "===i||" "===i){let t=n,a=e[n+1];for(;" "===a||" "===a;)a=e[++n+1];"\n"!==a&&("\r"!==a||"\n"!==e[n+2])&&(r+=n>t?e.slice(t,n+1):i)}else r+=i}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: ${s}`),{value:"",type:null,comment:"",range:[a,a+o.length,a+o.length]}}let f=a+o.length,p=d9(l,f,t,r);return{value:i,type:n,comment:p.comment,range:[a,f,p.offset]}}function fr(e){let t,r,n=/(.*?)\r?\n/sy,i=n.exec(e);if(!i)return e;try{t=RegExp("(?<![ ])[ ]+$"),r=RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{t=/[ \t]+$/,r=/^[ \t]+|[ \t]+$/g}let a=i[1].replace(t,""),s=" ",o=n.lastIndex;for(;i=n.exec(e);){let e=i[1].replace(r,"");""===e?"\n"===s?a+=s:s="\n":(a+=s+e,s=" "),o=n.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=o,i=l.exec(e),a+s+(i?.[1]??"")}let fn={0:"\0",a:"\x07",b:"\b",e:"\x1b",f:"\f",n:"\n",r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function fi(e,t,r,n){let i,a,{value:s,type:o,comment:l,range:u}="block-scalar"===t.type?fe(e,t,n):ft(t,e.options.strict,n),c=r?e.directives.tagName(r.source,e=>n(r,"TAG_RESOLVE_FAILED",e)):null;i=e.options.stringKeys&&e.atKey?e.schema[u7]:c?function(e,t,r,n,i){if("!"===r)return e[u7];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===r)if(!t.default||!t.test)return t;else a.push(t);for(let e of a)if(e.test?.test(t))return e;let s=e.knownTags[r];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,"tag:yaml.org,2002:str"!==r),e[u7])}(e.schema,s,c,r,n):"scalar"===t.type?function({atKey:e,directives:t,schema:r},n,i,a){let s=r.tags.find(t=>(!0===t.default||e&&"key"===t.default)&&t.test?.test(n))||r[u7];if(r.compat){let e=r.compat.find(e=>e.default&&e.test?.test(n))??r[u7];if(s.tag!==e.tag){let r=t.tagString(s.tag),n=t.tagString(e.tag);a(i,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${r} or ${n}`,!0)}}return s}(e,s,t,n):e.schema[u7];try{let o=i.resolve(s,e=>n(r??t,"TAG_RESOLVE_FAILED",e),e.options);a=cs(o)?o:new cj(o)}catch(e){n(r??t,"TAG_RESOLVE_FAILED",e instanceof Error?e.message:String(e)),a=new cj(s)}return a.range=u,a.source=s,o&&(a.type=o),c&&(a.tag=c),i.format&&(a.format=i.format),l&&(a.comment=l),a}let fa={composeNode:fs,composeEmptyNode:fo};function fs(e,t,r,n){let i,a=e.atKey,{spaceBefore:s,comment:o,anchor:l,tag:u}=r,c=!0;switch(t.type){case"alias":i=function({options:e},{offset:t,source:r,end:n},i){let a=new cN(r.substring(1));""===a.source&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&i(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+r.length,o=d9(n,s,e.strict,i);return a.range=[t,s,o.offset],o.comment&&(a.comment=o.comment),a}(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":i=fi(e,t,u,n),l&&(i.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{i=function(e,t,r,n,i){let a=n.tag,s=a?t.directives.tagName(a.source,e=>i(a,"TAG_RESOLVE_FAILED",e)):null;if("block-seq"===r.type){let{anchor:e,newlineAfterProp:t}=n,r=e&&a?e.offset>a.offset?e:a:e??a;r&&(!t||t.offset<r.offset)&&i(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(!a||!s||"!"===s||s===de.tagName&&"map"===o||s===dr.tagName&&"seq"===o)return d7(e,t,r,i,s);let l=t.schema.tags.find(e=>e.tag===s&&e.collection===o);if(!l){let n=t.schema.knownTags[s];if(n?.collection!==o)return n?i(a,"BAD_COLLECTION_TYPE",`${n.tag} used for ${o} collection, but expects ${n.collection??"scalar"}`,!0):i(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),d7(e,t,r,i,s);t.schema.tags.push(Object.assign({},n,{default:!1})),l=n}let u=d7(e,t,r,i,s,l),c=l.resolve?.(u,e=>i(a,"TAG_RESOLVE_FAILED",e),t.options)??u,d=cu(c)?c:new cj(c);return d.range=u.range,d.tag=s,l?.format&&(d.format=l.format),d}(fa,e,t,r,n),l&&(i.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 i??(i=fo(e,t.offset,void 0,null,r,n)),l&&""===i.anchor&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),a&&e.options.stringKeys&&(!cs(i)||"string"!=typeof i.value||i.tag&&"tag:yaml.org,2002:str"!==i.tag)&&n(u??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(i.spaceBefore=!0),o&&("scalar"===t.type&&""===t.source?i.comment=o:i.commentBefore=o),e.options.keepSourceTokens&&c&&(i.srcToken=t),i}function fo(e,t,r,n,{spaceBefore:i,comment:a,anchor:s,tag:o,end:l},u){let c=fi(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 s&&(c.anchor=s.source.substring(1),""===c.anchor&&u(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(c.spaceBefore=!0),a&&(c.comment=a,c.range[2]=l),c}function fl(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 fu(e){let t="",r=!1,n=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case"#":t+=(""===t?"":n?"\n\n":"\n")+(a.substring(1)||" "),r=!0,n=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:t,afterEmptyLine:n}}class fc{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,r,n)=>{let i=fl(e);n?this.warnings.push(new dQ(i,t,r)):this.errors.push(new dY(i,t,r))},this.directives=new cw({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:n}=fu(this.prelude);if(r){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
569
- ${r}`:r;else if(n||e.directives.docStart||!i)e.commentBefore=r;else if(cl(i)&&!i.flow&&i.items.length>0){let e=i.items[0];ca(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${r}
654
+ `}};function d2(e,{flow:t,indicator:r,next:n,offset:i,onError:a,parentIndent:s,startOnNewline:o}){let l=!1,u=o,c=o,d="",f="",p=!1,m=!1,h=null,g=null,v=null,y=null,b=null,$=null,x=null;for(let i of e)switch(m&&("space"!==i.type&&"newline"!==i.type&&"comma"!==i.type&&a(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(u&&"comment"!==i.type&&"newline"!==i.type&&a(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),i.type){case"space":!t&&("doc-start"!==r||n?.type!=="flow-collection")&&i.source.includes(" ")&&(h=i),c=!0;break;case"comment":{c||a(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let e=i.source.substring(1)||" ";d?d+=f+e:d=e,f="",u=!1;break}case"newline":u?d?d+=i.source:$&&"seq-item-ind"===r||(l=!0):f+=i.source,u=!0,p=!0,(g||v)&&(y=i),c=!0;break;case"anchor":g&&a(i,"MULTIPLE_ANCHORS","A node can have at most one anchor"),i.source.endsWith(":")&&a(i.offset+i.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=i,x??(x=i.offset),u=!1,c=!1,m=!0;break;case"tag":v&&a(i,"MULTIPLE_TAGS","A node can have at most one tag"),v=i,x??(x=i.offset),u=!1,c=!1,m=!0;break;case r:(g||v)&&a(i,"BAD_PROP_ORDER",`Anchors and tags must be after the ${i.source} indicator`),$&&a(i,"UNEXPECTED_TOKEN",`Unexpected ${i.source} in ${t??"collection"}`),$=i,u="seq-item-ind"===r||"explicit-key-ind"===r,c=!1;break;case"comma":if(t){b&&a(i,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=i,u=!1,c=!1;break}default:a(i,"UNEXPECTED_TOKEN",`Unexpected ${i.type} token`),u=!1,c=!1}let k=e[e.length-1],w=k?k.offset+k.source.length:i;return m&&n&&"space"!==n.type&&"newline"!==n.type&&"comma"!==n.type&&("scalar"!==n.type||""!==n.source)&&a(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(u&&h.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&a(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:$,spaceBefore:l,comment:d,hasNewline:p,anchor:g,tag:v,newlineAfterProp:y,end:w,start:x??w}}function d6(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(d6(t.key)||d6(t.value))return!0}return!1;default:return!0}}function d4(e,t,r){if(t?.type==="flow-collection"){let n=t.end[0];n.indent===e&&("]"===n.source||"}"===n.source)&&d6(t)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function d5(e,t,r){let{uniqueKeys:n}=e.options;if(!1===n)return!1;let i="function"==typeof n?n:(e,t)=>e===t||co(e)&&co(t)&&e.value===t.value;return t.some(e=>i(e.key,r))}let d9="All mapping items must start at the same column";function d3(e,t,r,n){let i="";if(e){let a=!1,s="";for(let o of e){let{source:e,type:l}=o;switch(l){case"space":a=!0;break;case"comment":{r&&!a&&n(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let t=e.substring(1)||" ";i?i+=s+t:i=t,s="";break}case"newline":i&&(s+=e),a=!0;break;default:n(o,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=e.length}}return{comment:i,offset:t}}let d8="Block collections are not allowed within flow collections",d7=e=>e&&("block-map"===e.type||"block-seq"===e.type);function fe(e,t,r,n,i,a){let s="block-map"===r.type?function({composeNode:e,composeEmptyNode:t},r,n,i,a){let s=new(a?.nodeClass??dt)(r.schema);r.atRoot&&(r.atRoot=!1);let o=n.offset,l=null;for(let a of n.items){let{start:u,key:c,sep:d,value:f}=a,p=d2(u,{indicator:"explicit-key-ind",next:c??d?.[0],offset:o,onError:i,parentIndent:n.indent,startOnNewline:!0}),m=!p.found;if(m){if(c&&("block-seq"===c.type?i(o,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in c&&c.indent!==n.indent&&i(o,"BAD_INDENT",d9)),!p.anchor&&!p.tag&&!d){l=p.end,p.comment&&(s.comment?s.comment+="\n"+p.comment:s.comment=p.comment);continue}(p.newlineAfterProp||d6(c))&&i(c??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==n.indent&&i(o,"BAD_INDENT",d9);r.atKey=!0;let h=p.end,g=c?e(r,c,p,i):t(r,h,u,null,p,i);r.schema.compat&&d4(n.indent,c,i),r.atKey=!1,d5(r,s.items,g)&&i(h,"DUPLICATE_KEY","Map keys must be unique");let v=d2(d??[],{indicator:"map-value-ind",next:f,offset:g.range[2],onError:i,parentIndent:n.indent,startOnNewline:!c||"block-scalar"===c.type});if(o=v.end,v.found){m&&(f?.type!=="block-map"||v.hasNewline||i(o,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&p.start<v.found.offset-1024&&i(g.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let l=f?e(r,f,v,i):t(r,o,d,null,v,i);r.schema.compat&&d4(n.indent,f,i),o=l.range[2];let u=new c3(g,l);r.options.keepSourceTokens&&(u.srcToken=a),s.items.push(u)}else{m&&i(g.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(g.comment?g.comment+="\n"+v.comment:g.comment=v.comment);let e=new c3(g);r.options.keepSourceTokens&&(e.srcToken=a),s.items.push(e)}}return l&&l<o&&i(l,"IMPOSSIBLE","Map comment with trailing content"),s.range=[n.offset,o,l??o],s}(e,t,r,n,a):"block-seq"===r.type?function({composeNode:e,composeEmptyNode:t},r,n,i,a){let s=new(a?.nodeClass??dn)(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let o=n.offset,l=null;for(let{start:a,value:u}of n.items){let c=d2(a,{indicator:"seq-item-ind",next:u,offset:o,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!c.found)if(c.anchor||c.tag||u)u?.type==="block-seq"?i(c.end,"BAD_INDENT","All sequence items must start at the same column"):i(o,"MISSING_CHAR","Sequence item without - indicator");else{l=c.end,c.comment&&(s.comment=c.comment);continue}let d=u?e(r,u,c,i):t(r,c.end,a,null,c,i);r.schema.compat&&d4(n.indent,u,i),o=d.range[2],s.items.push(d)}return s.range=[n.offset,o,l??o],s}(e,t,r,n,a):function({composeNode:e,composeEmptyNode:t},r,n,i,a){let s="{"===n.start.source,o=s?"flow map":"flow sequence",l=new(a?.nodeClass??(s?dt:dn))(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 a=0;a<n.items.length;++a){let u=n.items[a],{start:d,key:f,sep:p,value:m}=u,h=d2(d,{flow:o,indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){0===a&&h.comma?i(h.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):a<n.items.length-1&&i(h.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),h.comment&&(l.comment?l.comment+="\n"+h.comment:l.comment=h.comment),c=h.end;continue}!s&&r.options.strict&&d6(f)&&i(f,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===a)h.comma&&i(h.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(h.comma||i(h.start,"MISSING_CHAR",`Missing , between ${o} items`),h.comment){let e="";e:for(let t of d)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];cs(t)&&(t=t.value??t.key),t.comment?t.comment+="\n"+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(s||p||h.found){r.atKey=!0;let a=h.end,g=f?e(r,f,h,i):t(r,a,d,null,h,i);d7(f)&&i(g.range,"BLOCK_IN_FLOW",d8),r.atKey=!1;let v=d2(p??[],{flow:o,indicator:"map-value-ind",next:m,offset:g.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(v.found){if(!s&&!h.found&&r.options.strict){if(p)for(let e of p){if(e===v.found)break;if("newline"===e.type){i(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}h.start<v.found.offset-1024&&i(v.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else m&&("source"in m&&m.source?.[0]===":"?i(m,"MISSING_CHAR",`Missing space after : in ${o}`):i(v.start,"MISSING_CHAR",`Missing , or : between ${o} items`));let y=m?e(r,m,v,i):v.found?t(r,v.end,p,null,v,i):null;y?d7(m)&&i(y.range,"BLOCK_IN_FLOW",d8):v.comment&&(g.comment?g.comment+="\n"+v.comment:g.comment=v.comment);let b=new c3(g,y);if(r.options.keepSourceTokens&&(b.srcToken=u),s)d5(r,l.items,g)&&i(a,"DUPLICATE_KEY","Map keys must be unique"),l.items.push(b);else{let e=new dt(r.schema);e.flow=!0,e.items.push(b);let t=(y??g).range;e.range=[g.range[0],t[1],t[2]],l.items.push(e)}c=y?y.range[2]:v.end}else{let n=m?e(r,m,h,i):t(r,h.end,p,null,h,i);l.items.push(n),c=n.range[2],d7(m)&&i(n.range,"BLOCK_IN_FLOW",d8)}}let d=s?"}":"]",[f,...p]=n.end,m=c;if(f?.source===d)m=f.offset+f.source.length;else{let e=o[0].toUpperCase()+o.substring(1),t=u?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(c,u?"MISSING_CHAR":"BAD_INDENT",t),f&&1!==f.source.length&&p.unshift(f)}if(p.length>0){let e=d3(p,m,r.options.strict,i);e.comment&&(l.comment?l.comment+="\n"+e.comment:l.comment=e.comment),l.range=[n.offset,m,e.offset]}else l.range=[n.offset,m,m];return l}(e,t,r,n,a),o=s.constructor;return"!"===i||i===o.tagName?s.tag=o.tagName:i&&(s.tag=i),s}function ft(e,t,r){let n=t.offset,i=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:i}=t[0],a=i[0],s=0,o="",l=-1;for(let t=1;t<i.length;++t){let r=i[t];if(o||"-"!==r&&"+"!==r){let n=Number(r);!s&&n?s=n:-1===l&&(l=e+t)}else o=r}-1!==l&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let u=!1,c="",d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case"space":u=!0;case"newline":d+=i.source.length;break;case"comment":r&&!u&&n(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=i.source.length,c=i.source.substring(1);break;case"error":n(i,"UNEXPECTED_TOKEN",i.message),d+=i.source.length;break;default:{let e=`Unexpected token in block scalar header: ${i.type}`;n(i,"UNEXPECTED_TOKEN",e);let t=i.source;t&&"string"==typeof t&&(d+=t.length)}}}return{mode:a,indent:s,chomp:o,comment:c,length:d}}(t,e.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let a=">"===i.mode?cz.BLOCK_FOLDED:cz.BLOCK_LITERAL,s=t.source?function(e){let t=e.split(/\n( *)/),r=t[0],n=r.match(/^( *)/),i=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}(t.source):[],o=s.length;for(let e=s.length-1;e>=0;--e){let t=s[e][1];if(""===t||"\r"===t)o=e;else break}if(0===o){let e="+"===i.chomp&&s.length>0?"\n".repeat(Math.max(1,s.length-1)):"",r=n+i.length;return t.source&&(r+=t.source.length),{value:e,type:a,comment:i.comment,range:[n,r,r]}}let l=t.indent+i.indent,u=t.offset+i.length,c=0;for(let t=0;t<o;++t){let[n,a]=s[t];if(""===a||"\r"===a)0===i.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===i.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+a.length+1}for(let e=s.length-1;e>=o;--e)s[e][0].length>l&&(o=e+1);let d="",f="",p=!1;for(let e=0;e<c;++e)d+=s[e][0].slice(l)+"\n";for(let e=c;e<o;++e){let[t,n]=s[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=i.indent?"explicit indentation indicator":"first line",a=`Block scalar lines must not be less indented than their ${e}`;r(u-n.length-(o?2:1),"BAD_INDENT",a),t=""}a===cz.BLOCK_LITERAL?(d+=f+t.slice(l)+n,f="\n"):t.length>l||" "===n[0]?(" "===f?f="\n":p||"\n"!==f||(f="\n\n"),d+=f+t.slice(l)+n,f="\n",p=!0):""===n?"\n"===f?d+="\n":f="\n":(d+=f+n,f=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let e=o;e<s.length;++e)d+="\n"+s[e][0].slice(l);"\n"!==d[d.length-1]&&(d+="\n");break;default:d+="\n"}let m=n+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[n,m,m]}}function fr(e,t,r){let n,i,{offset:a,type:s,source:o,end:l}=e,u=(e,t,n)=>r(a+e,t,n);switch(s){case"scalar":n=cz.PLAIN,i=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}`),fn(e)}(o,u);break;case"single-quoted-scalar":var c,d;n=cz.QUOTE_SINGLE,c=o,d=u,("'"!==c[c.length-1]||1===c.length)&&d(c.length,"MISSING_CHAR","Missing closing 'quote"),i=fn(c.slice(1,-1)).replace(/''/g,"'");break;case"double-quoted-scalar":n=cz.QUOTE_DOUBLE,i=function(e,t){let r="";for(let n=1;n<e.length-1;++n){let i=e[n];if("\r"!==i||"\n"!==e[n+1])if("\n"===i){let{fold:t,offset:i}=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=i}else if("\\"===i){let i=e[++n],a=fi[i];if(a)r+=a;else if("\n"===i)for(i=e[n+1];" "===i||" "===i;)i=e[++n+1];else if("\r"===i&&"\n"===e[n+1])for(i=e[++n+1];" "===i||" "===i;)i=e[++n+1];else if("x"===i||"u"===i||"U"===i){let a="x"===i?2:"u"===i?4:8;r+=function(e,t,r,n){let i=e.substr(t,r),a=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,r+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),i}}(e,n+1,a,t),n+=a}else{let i=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),r+=i}}else if(" "===i||" "===i){let t=n,a=e[n+1];for(;" "===a||" "===a;)a=e[++n+1];"\n"!==a&&("\r"!==a||"\n"!==e[n+2])&&(r+=n>t?e.slice(t,n+1):i)}else r+=i}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: ${s}`),{value:"",type:null,comment:"",range:[a,a+o.length,a+o.length]}}let f=a+o.length,p=d3(l,f,t,r);return{value:i,type:n,comment:p.comment,range:[a,f,p.offset]}}function fn(e){let t,r,n=/(.*?)\r?\n/sy,i=n.exec(e);if(!i)return e;try{t=RegExp("(?<![ ])[ ]+$"),r=RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{t=/[ \t]+$/,r=/^[ \t]+|[ \t]+$/g}let a=i[1].replace(t,""),s=" ",o=n.lastIndex;for(;i=n.exec(e);){let e=i[1].replace(r,"");""===e?"\n"===s?a+=s:s="\n":(a+=s+e,s=" "),o=n.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=o,i=l.exec(e),a+s+(i?.[1]??"")}let fi={0:"\0",a:"\x07",b:"\b",e:"\x1b",f:"\f",n:"\n",r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function fa(e,t,r,n){let i,a,{value:s,type:o,comment:l,range:u}="block-scalar"===t.type?ft(e,t,n):fr(t,e.options.strict,n),c=r?e.directives.tagName(r.source,e=>n(r,"TAG_RESOLVE_FAILED",e)):null;i=e.options.stringKeys&&e.atKey?e.schema[ce]:c?function(e,t,r,n,i){if("!"===r)return e[ce];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===r)if(!t.default||!t.test)return t;else a.push(t);for(let e of a)if(e.test?.test(t))return e;let s=e.knownTags[r];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,"tag:yaml.org,2002:str"!==r),e[ce])}(e.schema,s,c,r,n):"scalar"===t.type?function({atKey:e,directives:t,schema:r},n,i,a){let s=r.tags.find(t=>(!0===t.default||e&&"key"===t.default)&&t.test?.test(n))||r[ce];if(r.compat){let e=r.compat.find(e=>e.default&&e.test?.test(n))??r[ce];if(s.tag!==e.tag){let r=t.tagString(s.tag),n=t.tagString(e.tag);a(i,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${r} or ${n}`,!0)}}return s}(e,s,t,n):e.schema[ce];try{let o=i.resolve(s,e=>n(r??t,"TAG_RESOLVE_FAILED",e),e.options);a=co(o)?o:new cz(o)}catch(e){n(r??t,"TAG_RESOLVE_FAILED",e instanceof Error?e.message:String(e)),a=new cz(s)}return a.range=u,a.source=s,o&&(a.type=o),c&&(a.tag=c),i.format&&(a.format=i.format),l&&(a.comment=l),a}let fs={composeNode:fo,composeEmptyNode:fl};function fo(e,t,r,n){let i,a=e.atKey,{spaceBefore:s,comment:o,anchor:l,tag:u}=r,c=!0;switch(t.type){case"alias":i=function({options:e},{offset:t,source:r,end:n},i){let a=new cU(r.substring(1));""===a.source&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&i(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+r.length,o=d3(n,s,e.strict,i);return a.range=[t,s,o.offset],o.comment&&(a.comment=o.comment),a}(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":i=fa(e,t,u,n),l&&(i.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{i=function(e,t,r,n,i){let a=n.tag,s=a?t.directives.tagName(a.source,e=>i(a,"TAG_RESOLVE_FAILED",e)):null;if("block-seq"===r.type){let{anchor:e,newlineAfterProp:t}=n,r=e&&a?e.offset>a.offset?e:a:e??a;r&&(!t||t.offset<r.offset)&&i(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(!a||!s||"!"===s||s===dt.tagName&&"map"===o||s===dn.tagName&&"seq"===o)return fe(e,t,r,i,s);let l=t.schema.tags.find(e=>e.tag===s&&e.collection===o);if(!l){let n=t.schema.knownTags[s];if(n?.collection!==o)return n?i(a,"BAD_COLLECTION_TYPE",`${n.tag} used for ${o} collection, but expects ${n.collection??"scalar"}`,!0):i(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),fe(e,t,r,i,s);t.schema.tags.push(Object.assign({},n,{default:!1})),l=n}let u=fe(e,t,r,i,s,l),c=l.resolve?.(u,e=>i(a,"TAG_RESOLVE_FAILED",e),t.options)??u,d=cc(c)?c:new cz(c);return d.range=u.range,d.tag=s,l?.format&&(d.format=l.format),d}(fs,e,t,r,n),l&&(i.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 i??(i=fl(e,t.offset,void 0,null,r,n)),l&&""===i.anchor&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),a&&e.options.stringKeys&&(!co(i)||"string"!=typeof i.value||i.tag&&"tag:yaml.org,2002:str"!==i.tag)&&n(u??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(i.spaceBefore=!0),o&&("scalar"===t.type&&""===t.source?i.comment=o:i.commentBefore=o),e.options.keepSourceTokens&&c&&(i.srcToken=t),i}function fl(e,t,r,n,{spaceBefore:i,comment:a,anchor:s,tag:o,end:l},u){let c=fa(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 s&&(c.anchor=s.source.substring(1),""===c.anchor&&u(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(c.spaceBefore=!0),a&&(c.comment=a,c.range[2]=l),c}function fu(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 fc(e){let t="",r=!1,n=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case"#":t+=(""===t?"":n?"\n\n":"\n")+(a.substring(1)||" "),r=!0,n=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:t,afterEmptyLine:n}}class fd{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,r,n)=>{let i=fu(e);n?this.warnings.push(new d0(i,t,r)):this.errors.push(new dQ(i,t,r))},this.directives=new c_({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:n}=fc(this.prelude);if(r){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
655
+ ${r}`:r;else if(n||e.directives.docStart||!i)e.commentBefore=r;else if(cu(i)&&!i.flow&&i.items.length>0){let e=i.items[0];cs(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${r}
570
656
  ${t}`:r}else{let e=i.commentBefore;i.commentBefore=e?`${r}
571
- ${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:fu(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 i=fl(e);i[0]+=t,this.onError(i,"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:i,end:a},s){let o=new dG(void 0,Object.assign({_directives:t},e)),l={atKey:!1,atRoot:!0,directives:o.directives,options:o.options,schema:o.schema},u=d1(n,{indicator:"doc-start",next:i??a?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(o.directives.docStart=!0,i&&("block-map"===i.type||"block-seq"===i.type)&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),o.contents=i?fs(l,i,u,s):fo(l,u.end,n,null,u,s);let c=o.contents.range[2],d=d9(a,c,!1,s);return d.comment&&(o.comment=d.comment),o.range=[r,c,d.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 dY(fl(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 dY(fl(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=d9(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}
572
- ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new dY(fl(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 dG(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 fd(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 ff(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),i=t.length;for(let t of("block-scalar-header"===e.props[0].type&&(i-=e.props[0].source.length),n))t.offset+=i;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,i="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:i})}}}let fp=Symbol("break visit"),fm=Symbol("skip children"),fh=Symbol("remove item");function fg(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),function e(t,r,n){let i=n(r,t);if("symbol"==typeof i)return i;for(let a of["key","value"]){let s=r[a];if(s&&"items"in s){for(let r=0;r<s.items.length;++r){let i=e(Object.freeze(t.concat([[a,r]])),s.items[r],n);if("number"==typeof i)r=i-1;else{if(i===fp)return fp;i===fh&&(s.items.splice(r,1),r-=1)}}"function"==typeof i&&"key"===a&&(i=i(r,t))}}return"function"==typeof i?i(r,t):i}(Object.freeze([]),e,t)}fg.BREAK=fp,fg.SKIP=fm,fg.REMOVE=fh,fg.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},fg.parentCollection=(e,t)=>{let r=fg.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw Error("Parent collection not found")};let fv=e=>!!e&&"items"in e,fy=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type);function fb(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)}}function f$(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 fx(e){switch(e.type){case"block-scalar":{let t="";for(let r of e.props)t+=fx(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(let r of e.items)t+=fk(r);return t}case"flow-collection":{let t=e.start.source;for(let r of e.items)t+=fk(r);for(let r of e.end)t+=r.source;return t}case"document":{let t=fk(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 fk({start:e,key:t,sep:r,value:n}){let i="";for(let t of e)i+=t.source;if(t&&(i+=fx(t)),r)for(let e of r)i+=e.source;return n&&(i+=fx(n)),i}e.s(["BOM",0,"\uFEFF","DOCUMENT",0,"\x02","FLOW_END",0,"\x18","SCALAR",0,"\x1f","isCollection",0,fv,"isScalar",0,fy,"prettyToken",0,fb,"tokenType",0,f$],66269),e.i(66269),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:i=!1,offset:a=-1,type:s="PLAIN"}=t,o=cH({type:s,value:e},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,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",i=[{type:"block-scalar-header",offset:a,indent:n,source:t}];return fd(i,l)||i.push({type:"newline",offset:-1,indent:n,source:"\n"}),{type:"block-scalar",offset:a,indent:n,props:i,source:r}}case'"':return{type:"double-quoted-scalar",offset:a,indent:n,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:a,indent:n,source:o,end:l};default:return{type:"scalar",offset:a,indent:n,source:o,end:l}}},"isCollection",0,fv,"isScalar",0,fy,"prettyToken",0,fb,"resolveAsScalar",0,function(e,t=!0,r){if(e){let n=(e,t,n)=>{let i="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(r)r(i,t,n);else throw new dY([i,i+1],t,n)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return ft(e,t,n);case"block-scalar":return fe({options:{strict:t}},e,n)}}return null},"setScalarValue",0,function(e,t,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:a=!1,type:s}=r,o="indent"in e?e.indent:null;if(n&&"number"==typeof o&&(o+=2),!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");s=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let l=cH({type:s,value:t},{implicitKey:i||null===o,indent:null!==o&&o>0?" ".repeat(o):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":!function(e,t){let r=t.indexOf("\n"),n=t.substring(0,r),i=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=i}else{let{offset:t}=e,r="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:t,indent:r,source:n}];for(let t of(fd(a,"end"in e?e.end:void 0)||a.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:a,source:i})}}(e,l);break;case'"':ff(e,l,"double-quoted-scalar");break;case"'":ff(e,l,"single-quoted-scalar");break;default:ff(e,l,"scalar")}},"stringify",0,e=>"type"in e?fx(e):fk(e),"tokenType",0,f$,"visit",0,fg],91723);var fw=e.i(91723);function f_(e){switch(e){case void 0:case" ":case"\n":case"\r":case" ":return!0;default:return!1}}let fS=new Set("0123456789ABCDEFabcdef"),fI=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),fO=new Set(",[]{}"),fE=new Set(" ,[]{}\n\r "),fA=e=>!e||fE.has(e);class fN{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)&&f_(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)&&f_(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&&!f_(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)&&f_(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(fA),"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("..."))&&f_(n[3]))&&(r!==this.indentNext-1||1!==this.flowLevel||"]"!==n[0]&&"}"!==n[0]))return this.flowLevel=0,yield"\x18",yield*this.parseLineStart();let i=0;for(;","===n[i];)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(n[i+=yield*this.pushIndicators()]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-i),"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(fA),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let e=this.charAt(1);if(this.flowKey||f_(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=>f_(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 i=e;for(;" "===n;)n=this.buffer[--e];if("\n"===n&&e>=this.pos&&e+1+r>i)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(f_(e)||t&&fO.has(e))break;r=n}else if(f_(e)){let i=this.buffer[n+1];if("\r"===e&&("\n"===i?(n+=1,e="\n",i=this.buffer[n+1]):r=n),"#"===i||t&&fO.has(i))break;if("\n"===e){let e=this.continueScalar(n+1);if(-1===e)break;n=Math.max(n,e-2)}}else{if(t&&fO.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(fA),e+=yield*this.pushSpaces(!0);continue;case"-":case"?":case":":{let t=this.flowLevel>0,r=this.charAt(1);if(f_(r)||t&&fO.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(;!f_(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(fI.has(t))t=this.buffer[++e];else if("%"===t&&fS.has(this.buffer[e+1])&&fS.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 fU(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}function fj(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 fz(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 fT(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 fP(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 fM(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 fD(e){if("flow-seq-start"===e.start.type)for(let t of e.items)!t.sep||t.value||fU(t.start,"explicit-key-ind")||fU(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,fz(t.value)?t.value.end?fM(t.value.end,t.sep):t.value.end=t.sep:fM(t.start,t.sep),delete t.sep)}class fZ{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 fN,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=f$(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&&fD(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===fj(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!==fj(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=fP(fT(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)){fM(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,i=[];if(n&&t.sep&&!t.value){let r=[];for(let n=0;n<t.sep.length;++n){let i=t.sep[n];switch(i.type){case"newline":r.push(n);break;case"space":break;case"comment":i.indent>e.indent&&(r.length=0);break;default:r.length=0}}r.length>=2&&(i=t.sep.splice(r[1]))}switch(this.type){case"anchor":case"tag":n||t.value?(i.push(this.sourceToken),e.items.push({start:i}),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?(i.push(this.sourceToken),e.items.push({start:i,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(fU(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(fz(t.key)&&!fU(t.sep,"newline")){let e=fP(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 i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(fU(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=fP(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:i,key:null,sep:[this.sourceToken]}):fU(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:i,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&&!fU(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:i});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)){fM(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||fU(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=fP(fT(t));fD(e);let n=e.end.splice(1,e.end.length);n.push(this.sourceToken);let i={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]=i}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=fP(fT(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=fP(fT(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 fC{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 fL(e){let t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new fC||null,prettyErrors:t}}function fR(e,t={}){let{lineCounter:r,prettyErrors:n}=fL(t),i=new fZ(r?.addNewLine),a=new fc(t),s=null;for(let t of a.compose(i.parse(e),!0,e.length))if(s){if("silent"!==s.options.logLevel){s.errors.push(new dY(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else s=t;return n&&r&&(s.errors.forEach(d0(e,r)),s.warnings.forEach(d0(e,r))),s}function fq(e,t,r){let n;"function"==typeof t?n=t:void 0===r&&t&&"object"==typeof t&&(r=t);let i=fR(e,r);if(!i)return null;if(i.warnings.forEach(e=>cQ(i.options.logLevel,e)),i.errors.length>0)if("silent"!==i.options.logLevel)throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:n},r))}e.s([],97850),e.i(97850),e.s(["Alias",0,cN,"CST",0,fw,"Composer",0,fc,"Document",0,dG,"Lexer",0,fN,"LineCounter",0,fC,"Pair",0,c9,"Parser",0,fZ,"Scalar",0,cj,"Schema",0,dV,"YAMLError",0,dX,"YAMLMap",0,de,"YAMLParseError",0,dY,"YAMLSeq",0,dr,"YAMLWarning",0,dQ,"isAlias",0,cr,"isCollection",0,cl,"isDocument",0,cn,"isMap",0,ci,"isNode",0,cu,"isPair",0,ca,"isScalar",0,cs,"isSeq",0,co,"parse",0,fq,"parseAllDocuments",0,function(e,t={}){let{lineCounter:r,prettyErrors:n}=fL(t),i=new fZ(r?.addNewLine),a=new fc(t),s=Array.from(a.compose(i.parse(e)));if(n&&r)for(let t of s)t.errors.forEach(d0(e,r)),t.warnings.forEach(d0(e,r));return s.length>0?s:Object.assign([],{empty:!0},a.streamInfo())},"parseDocument",0,fR,"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 cn(e)&&!n?e.toString(r):new dG(e,n,r).toString(r)},"visit",0,cm,"visitAsync",0,cg],32861),e.i(32861);var fF=e.i(53267);let fB={baseUrl:"",endpoint:"",params:[],valid:!1};function fJ(e){let t=e.trim();if(!t)return fB;try{let e=new URL(t);if("http:"!==e.protocol&&"https:"!==e.protocol)return fB;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 fB}}function fK(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&&r.searchParams.append(e,t.value)}return r.toString()}catch{return""}}let fW=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]);function fV(e){if(!e)return;let t=e.toUpperCase();return fW.has(t)?t:void 0}function fG(e){return e.replace(/[),.;]+$/g,"").replace(/[<>]/g,"")}let fH=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),fX=new Set(["-d","--data","--data-raw","--data-binary","--data-ascii","--data-urlencode","--json"]),fY=new Set(["-A","--user-agent","-b","--cookie","-e","--referer","-o","--output","-m","--max-time","--connect-timeout","-x","--proxy","-w","--write-out"]),fQ=/\{\{\s*([A-Za-z_][\w.-]*)\s*\}\}/g;function f0(e,t){let r=new Set;return{text:e.replace(fQ,(e,n)=>Object.prototype.hasOwnProperty.call(t,n)?t[n]:(r.add(n),e)),missing:[...r]}}function f1(e,t){let r=new Set,n=e=>{if("string"==typeof e){let n=f0(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 f2(){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 f6(e){let t=f2();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 f4(){return{accessKeyId:"",secretAccessKey:"",sessionToken:"",region:"us-east-1",service:"execute-api"}}function f5(e){let t=f4();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 f9(){return{algorithm:"HS256",secret:"",privateKey:"",payload:'{\n "sub": "load-test-user"\n}',lifetimeSec:3600,kid:"",headerName:"Authorization",prefix:"Bearer"}}function f3(e){let t=f9();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 f8(){return{consumerKey:"",consumerSecret:"",token:"",tokenSecret:"",signatureMethod:"HMAC-SHA256",realm:"",addTo:"header"}}function f7(e){let t=f8();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"}}function pe(){return{auth:{authMode:"inherit",oauth:f2(),oauth1:f8(),aws:f4(),jwt:f9(),domain:"",token:"",username:"",password:"",apiName:"X-API-Key",apiValue:"",apiIn:"header"},headers:[],variables:[]}}function pt(e){return"inherit"===e.auth.authMode&&!e.headers.some(e=>e.key.trim())&&0===e.variables.length}function pr(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(["MAX_FOLDER_DEPTH",0,6,"awsFromUnknown",0,f5,"defaultAws",0,f4,"defaultJwt",0,f9,"defaultOAuth",0,f2,"defaultOAuth1",0,f8,"emptyFolderSettings",0,pe,"findVariables",0,function(e){let t=new Set;for(let r of e.matchAll(fQ))t.add(r[1]);return[...t]},"folderChain",0,function(e){let t=e?e.split("/"):[];return t.map((e,r)=>t.slice(0,r+1).join("/"))},"folderName",0,function(e){return e.split("/").at(-1)??""},"folderPath",0,pr,"inFolder",0,function(e,t){return""===t||e===t||e.startsWith(`${t}/`)},"isEmptyFolder",0,pt,"jwtFromUnknown",0,f3,"oauth1FromUnknown",0,f7,"oauthFromUnknown",0,f6,"parentFolder",0,function(e){return e.split("/").slice(0,-1).join("/")},"substitute",0,f0,"substituteDeep",0,f1,"variablesOf",0,function(e){let t={};for(let r of e?.variables??[])r.key.trim()&&(t[r.key.trim()]=r.value);return t}],78451);let pn=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],pi=["smoke","average","stress","spike","soak","custom"],pa={preset:"smoke",...u0.smoke};function ps(){return{method:"GET",url:"",baseUrl:"",endpoint:"",params:[],headers:[],bodyMode:"none",graphqlQuery:"",graphqlVariables:"",graphqlOperation:"",graphqlErrorsFail:!0,bodyText:"",authMode:"inherit",oauth:f2(),oauth1:f8(),aws:f4(),jwt:f9(),domain:"",token:"",username:"",password:"",apiName:"X-API-Key",apiValue:"",apiIn:"header",timeout:"60s",maxRedirects:5,connectionReuse:!0,useCookies:!0,tlsSkip:!0,checks:[],before:null,testData:null,saveValues:[],preScript:"",postScript:"",mock:null}}function po(e){return Array.isArray(e)?e.map(e=>({key:"string"==typeof e?.key?e.key:"",value:"string"==typeof e?.value?e.value:""})).filter(e=>e.key||e.value):[]}let pl=(e,t)=>"string"==typeof e?e:t,pu=(e,t)=>"number"==typeof e&&Number.isFinite(e)?e:t;function pc(e,t){if(!t.trim())return{...e,url:"",baseUrl:"",endpoint:"",params:[]};let r=fJ(t);return r.valid?{...e,url:t,baseUrl:r.baseUrl,endpoint:r.endpoint,params:r.params}:{...e,url:t}}function pd(e){return"GET"!==e&&"HEAD"!==e}function pf(e){return[...u2({setup:e.before,data:e.testData}),...function(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]}(e.preScript??"")]}function pp(e){let t=fJ(e.url),r=t.valid?t:fK({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=fK({baseUrl:r.baseUrl,endpoint:r.endpoint,params:[]}),i={mode:"none"};if("bearer"===e.authMode){let t=uX(e.token);if(!t)throw Error("Bearer auth is on but the token is empty");i={mode:"bearer",token:t}}else if("basic"===e.authMode){if(!e.username)throw Error("Basic auth needs a username");i={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");i={mode:"api_key",name:e.apiName.trim(),value:e.apiValue,in:e.apiIn}}else if("oauth2"===e.authMode)i={mode:"oauth2",oauth:pv(e.oauth)};else if("digest"===e.authMode){if(!e.username)throw Error("Digest auth needs a username");i={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];i={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)");i={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");i={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" }')}i={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 a={mode:"none"};if(pd(e.method)&&"json"===e.bodyMode)try{a={mode:"json",json:e.bodyText.trim()?JSON.parse(e.bodyText):{}}}catch(n){let t=pf(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(pd(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`)}a={mode:"json",json:{query:e.graphqlQuery,variables:t,...e.graphqlOperation.trim()?{operationName:e.graphqlOperation.trim()}:{}}}}else pd(e.method)&&"text"===e.bodyMode&&(a={mode:"text",text:e.bodyText});return{request:{method:e.method,url:n,query:r.params.filter(e=>e.key.trim()),headers:e.headers.filter(e=>e.key.trim()),body:a,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}),...pd(e.method)&&"graphql"===e.bodyMode&&e.graphqlErrorsFail?[{type:"json",path:"errors",op:"not_exists",value:""}]:[]]},auth:i,options:{timeout:e.timeout,maxRedirects:e.maxRedirects,httpVersion:"1.1",tlsSkipVerify:e.tlsSkip,connectionReuse:e.connectionReuse,cookies:e.useCookies}}}let pm=["url","baseUrl","endpoint","params","headers","bodyText","graphqlQuery","graphqlVariables","token","username","password","apiName","apiValue","oauth","oauth1","aws","jwt","domain"],ph=/^\d+(\.\d+)?(ms|s|m|h)$/;function pg(e,t=!0){return ph.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 pv(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(["DEFAULT_LOAD",0,pa,"METHODS",0,pn,"applyFolders",0,function(e,t){let r=e,n=null;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,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(e=>e.key.trim()).map(e=>e.key.trim().toLowerCase())),a=new Map;for(let e of t)for(let t of e.settings.headers)t.key.trim()&&a.set(t.key.trim().toLowerCase(),{key:t.key.trim(),value:t.value});let s=[...a.entries()].filter(([e])=>!i.has(e)).map(([,e])=>e);s.length&&(r={...r,headers:[...s,...r.headers]});let o={};for(let e of t)for(let t of e.settings.variables)o[t.key]=t.value;return{draft:r,vars:o,inherited:{authFrom:n,headers:s.map(e=>e.key)}}},"applyPreset",0,function(e,t){return"custom"===t?{...e,preset:t}:{preset:t,mode:"users",rps:e.rps,maxVus:e.maxVus,stages:null,...u0[t]}},"autoRunName",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}`},"buildPayload",0,function(e,t,r,n){let i,a=pp(e);return{name:r.slice(0,120),...a,load:t,targets:n,setup:void 0,data:e.testData&&e.testData.rows.length?e.testData:void 0,save:(i=e.saveValues.filter(e=>e.name.trim()&&e.path.trim()&&uB.test(e.name.trim()))).length?i.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}},"buildSetup",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=pp({...t,checks:[],before:null,testData:null,saveValues:[],preScript:"",postScript:""});return{label:e.requestName.slice(0,120)||"Run first",...r,extract:e.extract}},"defaultRequestDraft",0,ps,"draftCounts",0,function(e){return{params:e.params.filter(e=>e.key.trim()).length,headers:e.headers.filter(e=>e.key.trim()).length,auth:"none"!==e.authMode&&"inherit"!==e.authMode,body:pd(e.method)&&("graphql"===e.bodyMode?e.graphqlQuery.trim().length>0:"none"!==e.bodyMode&&e.bodyText.trim().length>0),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()}},"draftRuntimeNames",0,pf,"durationError",0,pg,"hasBody",0,pd,"isReady",0,function(e){return fJ(e.url).valid||!!fK(e)||/\{\{.+\}\}/.test(e.url)},"loadFromUnknown",0,function(e){return e&&"object"==typeof e?{preset:pi.includes(e.preset)?e.preset:"smoke",vus:pu(e.vus,pa.vus),duration:pl(e.duration,pa.duration),rampUp:pl(e.rampUp,pa.rampUp),rampDown:pl(e.rampDown,pa.rampDown),thinkTimeMs:pu(e.thinkTimeMs,pa.thinkTimeMs),thinkJitterMs:pu(e.thinkJitterMs,pa.thinkJitterMs),gracefulStop:pl(e.gracefulStop,pa.gracefulStop),mode:"rate"===e.mode?"rate":"users",rps:pu(e.rps,20),maxVus:pu(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)}:{...pa}},"loadProblem",0,function(e){if(e.stages&&e.stages.length){for(let[t,r]of e.stages.entries()){let n=pg(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)?pg(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 pg(e.duration,!1)??pg(e.rampUp)??pg(e.rampDown)??pg(e.gracefulStop)??null},"oauthWire",0,pv,"requestFromUnknown",0,function(e){var t;let r=ps();if(!e||"object"!=typeof e)return r;let n="json"===e.bodyMode||"text"===e.bodyMode||"graphql"===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:pn.includes(e.method)?e.method:"GET",url:pl(e.url,""),baseUrl:pl(e.baseUrl,""),endpoint:pl(e.endpoint,""),params:po(e.params),headers:po(e.headers),bodyMode:n,bodyText:pl(e.bodyText,""),graphqlQuery:pl(e.graphqlQuery,""),graphqlVariables:pl(e.graphqlVariables,""),graphqlOperation:pl(e.graphqlOperation,""),graphqlErrorsFail:!1!==e.graphqlErrorsFail,authMode:i,oauth:f6(e.oauth),oauth1:f7(e.oauth1),aws:f5(e.aws),jwt:f3(e.jwt),domain:pl(e.domain,""),token:pl(e.token,""),username:pl(e.username,""),password:pl(e.password,""),apiName:pl(e.apiName,r.apiName),apiValue:pl(e.apiValue,""),apiIn:"query"===e.apiIn?"query":"header",timeout:pl(e.timeout,r.timeout),maxRedirects:pu(e.maxRedirects,r.maxRedirects),connectionReuse:!1!==e.connectionReuse,useCookies:!1!==e.useCookies,tlsSkip:!0===e.tlsSkip,checks:Array.isArray(t=e.checks)?t.flatMap(e=>{let t=uO.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=uK.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=uV.safeParse(e);return t.success?t.data:null}(e.testData),saveValues:(Array.isArray(e.saveValues)?e.saveValues:[]).flatMap(e=>{let t=uK.safeParse(e);return t.success?[t.data]:[]}),preScript:pl(e.preScript,"").slice(0,1e5),postScript:pl(e.postScript,"").slice(0,1e5),mock:u6(e.mock)}},"resolveDraft",0,function(e,t,r){let n=Object.fromEntries(pm.map(t=>[t,e[t]])),i=new Set(pf(e)),a={...t};for(let e of i)a[e]=`{{${e}}}`;let{value:s,missing:o}=f1(n,a);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,...s};return l.url!==e.url?pc(l,l.url):l},"targetsFromSlo",0,function(e){if(e)return{p95Ms:e.p95Ms,p99Ms:e.p99Ms||void 0,errorRate:e.errorRate,checksRate:e.checksRate,abortOnFail:!0===e.abortOnFail}},"toLoadConfig",0,function(e){let{preset:t,...r}=e;return u1(r)},"withParts",0,function(e,t){let r={...e,...t},n=fK({baseUrl:r.baseUrl,endpoint:r.endpoint,params:r.params});return{...r,url:n||e.url}},"withPaste",0,function(e,t){let r=function(e){let t,r,n,i,a=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="",i=!1,a=null;for(let e=0;e<t.length;e++){let s=t[e];if("'"===a){"'"===s?a=null:n+=s;continue}if('"'===a){'"'===s?a=null:"\\"===s&&e+1<t.length&&'"\\$`'.includes(t[e+1])?n+=t[++e]:n+=s;continue}if("'"===s||'"'===s){a=s,i=!0;continue}if("\\"===s&&e+1<t.length){n+=t[++e],i=!0;continue}if(/\s/.test(s)){(i||n)&&r.push(n),n="",i=!1;continue}n+=s,i=!0}return(i||n)&&r.push(n),r}(e.trim());if(0===a.length||!/^curl(\.exe)?$/i.test(a[0]))return null;let s=[],o=[],l=!1,u=!1,c=!1;for(let e=1;e<a.length;e++){let i=a[e],d=()=>a[++e]??"",[f,p]=i.startsWith("--")&&i.includes("=")?[i.slice(0,i.indexOf("=")),i.slice(i.indexOf("=")+1)]:[i,void 0],m=()=>p??d();if("-X"===f||"--request"===f)t=m().toUpperCase();else if(/^-X[A-Za-z]+$/.test(i))t=i.slice(2).toUpperCase();else if("-H"===f||"--header"===f){let e=m(),t=e.indexOf(":");t>0&&s.push({key:e.slice(0,t).trim(),value:e.slice(t+1).trim()})}else if(fX.has(f))"--json"===f&&(c=!0),o.push(m());else if("-u"===f||"--user"===f){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"===f||"--insecure"===f?l=!0:"-G"===f||"--get"===f?u=!0:"--url"===f?r=m():fY.has(f)?m():!i.startsWith("-")&&!r&&/^https?:\/\//i.test(i)&&(r=i)}if(!r||!fJ(r).valid)return null;let d=[];for(let e of s){if("authorization"===e.key.toLowerCase()){let[t,...r]=e.value.split(/\s+/),i=r.join(" ");if(/^bearer$/i.test(t??"")&&i){n={mode:"bearer",token:i};continue}if(/^basic$/i.test(t??"")&&i){let e=function(e){try{let t="function"==typeof atob?atob(e):fF.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}}(i);if(e){n=e;continue}}}d.push(e)}let f=o.join("&"),p=d.find(e=>"content-type"===e.key.toLowerCase())?.value??"",m=r;return f&&u?m=`${r}${r.includes("?")?"&":"?"}${f}`:f&&(i={mode:c||p.includes("json")||function(e){let t=e.trim();if(!(t.startsWith("{")||t.startsWith("[")))return!1;try{return JSON.parse(t),!0}catch{return!1}}(f)?"json":"text",text:f}),{method:t&&fH.has(t)?t:i?"POST":"GET",url:m,headers:d,body:i,auth:n,tlsSkip:l}}(t);if(r){let t=pc({...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.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.auth?`${r.auth.mode} auth`:null].filter(Boolean);return{draft:t,note:`Imported curl${n.length?`: ${n.join(", ")}`:""}`}}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=fG(r[2]??"");if(fJ(e).valid)return{url:e,method:fV(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=fG(e[0]);if(fJ(t).valid)return{url:t,method:fV(r?.[1])??"GET"}}}let n=t.match(/https?:\/\/[^\s'"]+/);if(n){let e=fG(n[0]);if(fJ(e).valid)return{url:e}}return null}(t);return n?{draft:pc(n.method?{...e,method:n.method}:e,n.url)}:null},"withUrl",0,pc],5305);let py=(e,t="")=>"string"==typeof e?e:"number"==typeof e||"boolean"==typeof e?String(e):t,pb=e=>Array.isArray(e)?e:[],p$=e=>{let t=py(e,"GET").toUpperCase();return pn.includes(t)?t:null};function px(e,t,r,n){let i=[],a=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()),i=/^basic\s+(.+)$/i.exec(t.value.trim()),s="none"===a.authMode||"inherit"===a.authMode;if(e&&s)a={...a,authMode:"bearer",token:e[1]};else if(i&&s)try{let[e,...t]=atob(i[1]).split(":");a={...a,authMode:"basic",username:e??"",password:t.join(":")}}catch{r(`${n}: an Authorization header could not be read; set Auth by hand`)}else s&&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&&i.push({key:e,value:t.value})}return{draft:a,headers:i}}function pk(e,t,r){let n=e[t],i=e=>"boolean"==typeof e||"number"==typeof e?String(e):py(e);return Array.isArray(n)?i(n.find(e=>e.key===r)?.value):n&&"object"==typeof n?i(n[r]):""}function pw(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:pk(t,"bearer","token")};if("basic"===t.type)return{...e,authMode:"basic",username:pk(t,"basic","username"),password:pk(t,"basic","password")};if("apikey"===t.type)return{...e,authMode:"api_key",apiName:pk(t,"apikey","key")||"X-API-Key",apiValue:pk(t,"apikey","value"),apiIn:"query"===pk(t,"apikey","in")?"query":"header"};if("digest"===t.type)return{...e,authMode:"digest",username:pk(t,t.type,"username"),password:pk(t,t.type,"password")};if("ntlm"===t.type)return{...e,authMode:"ntlm",username:pk(t,t.type,"username"),password:pk(t,t.type,"password"),domain:pk(t,t.type,"domain")};if("awsv4"===t.type)return{...e,authMode:"aws_sigv4",aws:{accessKeyId:pk(t,t.type,"accessKey"),secretAccessKey:pk(t,t.type,"secretKey"),sessionToken:pk(t,t.type,"sessionToken"),region:pk(t,t.type,"region")||"us-east-1",service:pk(t,t.type,"service")||"execute-api"}};if("oauth1"===t.type){let r=pk(t,t.type,"signatureMethod").toUpperCase();return{...e,authMode:"oauth1",oauth1:{consumerKey:pk(t,t.type,"consumerKey"),consumerSecret:pk(t,t.type,"consumerSecret"),token:pk(t,t.type,"token"),tokenSecret:pk(t,t.type,"tokenSecret"),signatureMethod:"HMAC-SHA1"===r||"PLAINTEXT"===r?r:"HMAC-SHA256",realm:pk(t,t.type,"realm"),addTo:"false"===pk(t,t.type,"addParamsToHeader")?"query":"header"}}}if("jwt"===t.type){let r=pk(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:pk(t,t.type,"secret"),privateKey:pk(t,t.type,"privateKey"),payload:pk(t,t.type,"payload")||e.jwt.payload,prefix:pk(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 p_(e,t){return pb(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=>py(e)).join("\n"):py(t)}).filter(e=>e.trim()).join("\n")}let pS=new Set(["$guid","$uuid","$randomuuid","$timestamp","$isotimestamp","$randomint","$randomemail","$randomfirstname","$randomlastname","$randomfullname","$randomboolean","$randomalphanumeric"]);function pI(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 pO(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 pE(e,t,r=0,n=new Set){let i=pO(e,t);if(r>6||n.has(i))return null;if("example"in i)return i.example;if(Array.isArray(i.examples)&&i.examples.length)return i.examples[0];if("default"in i)return i.default;if(Array.isArray(i.enum)&&i.enum.length)return i.enum[0];let a=new Set(n).add(i),s=pb(i.allOf);if(s.length)return Object.assign({},...s.map(t=>pE(e,t,r+1,a)).filter(e=>e&&"object"==typeof e));let o=pb(i.oneOf).concat(pb(i.anyOf));if(o.length)return pE(e,o[0],r+1,a);let l=Array.isArray(i.type)?i.type.find(e=>"null"!==e):i.type;if("object"===l||i.properties){let t={};for(let[n,s]of Object.entries(i.properties??{}))t[n]=pE(e,s,r+1,a);return t}if("array"===l)return[pE(e,i.items,r+1,a)];if("integer"===l||"number"===l)return 0;if("boolean"===l)return!1;if("string"===l){let e=py(i.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 pA(e,t){let r=py((e.info??{}).title,"Imported API").trim()||"Imported API",n=new Set,i=e=>n.add(e),a=[],s=0,o=new Map,l=(e,t="",r=!1)=>{/^[A-Za-z_][\w.-]*$/.test(e)&&!o.has(e)&&o.set(e,{key:e,value:t,secret:r})},u=function(e,t){if("swagger"===t){let t=py(e.host);if(!t)return null;let r=pb(e.schemes).includes("https")||!pb(e.schemes).length?"https":py(pb(e.schemes)[0]);return`${r}://${t}${py(e.basePath).replace(/\/$/,"")}`}let r=pb(e.servers)[0];if(!r)return null;let n=py(r.url);for(let[e,t]of Object.entries(r.variables??{}))n=n.replace(`{${e}}`,py(t.default));return n.replace(/\/$/,"")}(e,t);u&&/^https?:\/\//i.test(u)?l("baseUrl",u):(l("baseUrl","https://api.example.com"),i(u?`The server URL “${u}” is relative — set baseUrl in the “${r}” environment`:`No server URL in the file — set baseUrl in the “${r}” environment`));let c="swagger"===t?e.securityDefinitions:(e.components??{}).securitySchemes,d=(t,r)=>{let n=pb(t)[0],a=n?Object.keys(n)[0]:void 0,s=a?pO(e,c?.[a]):void 0;if(!s)return r;let o=py(s.type),u=py(s.scheme).toLowerCase();return"http"===o&&"bearer"===u||"oauth2"===o||"openIdConnect"===o?(l("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"===u||"basic"===o?(l("username"),l("password","",!0),{...r,authMode:"basic",username:"{{username}}",password:"{{password}}"}):"apiKey"===o?"cookie"===s.in?(i("Cookie API keys are not supported; set Auth by hand"),r):(l("apiKey","",!0),{...r,authMode:"api_key",apiName:py(s.name,"X-API-Key"),apiValue:"{{apiKey}}",apiIn:"query"===s.in?"query":"header"}):r};for(let[n,o]of Object.entries(e.paths??{})){let u=pO(e,o),c=pb(u.parameters);for(let[o,f]of Object.entries(u)){let u,p,m=p$(o);if(!m||"parameters"===o||"object"!=typeof f)continue;if(a.length>=2e3){i("Only the first 2000 operations were imported");break}let h=py(pb(f.tags)[0]),g=py(f.summary).trim()||py(f.operationId).trim()||`${m} ${n}`,v=h?`${h} › ${g}`:g,y=[...c,...pb(f.parameters)].map(t=>pO(e,t)),b=n.replace(/\{([^}]+)\}/g,(t,r)=>{let n=r.replace(/[^\w.-]/g,"_"),i=y.find(e=>"path"===e.in&&e.name===r);return l(n,py(i?.example??pO(e,i?.schema).example??"")),`{{${n}}}`}),$=y.filter(e=>"query"===e.in&&(e.required||"example"in e)).map(t=>({key:py(t.name),value:py(t.example??pE(e,t.schema)??"")})),x=pc({...ps(),method:m},`{{baseUrl}}${b}`);x={...x,url:`{{baseUrl}}${b}${$.length?`?${$.map(e=>`${e.key}=${e.value}`).join("&")}`:""}`,params:$};let k=px(y.filter(e=>"header"===e.in).map(e=>({key:py(e.name),value:py(e.example??"")})),x=d(f.security??e.security,x),i,v);x={...k.draft,headers:k.headers};let w=!0;if("openapi"===t&&f.requestBody){let t=pO(e,f.requestBody).content??{},r=Object.keys(t).find(e=>/json/i.test(e))??Object.keys(t)[0];if(r){let e=t[r];w=/json/i.test(r),u=e.schema,p=e.example??Object.values(e.examples??{})[0]?.value,!/json/i.test(r)&&(/x-www-form-urlencoded/i.test(r)&&!x.headers.some(e=>/^content-type$/i.test(e.key))?x={...x,headers:[...x.headers,{key:"Content-Type",value:r}]}:/multipart/i.test(r)&&i(`${v}: multipart bodies are not supported yet; the body was left out`))}}else if("swagger"===t){let e=y.find(e=>"body"===e.in);e&&(u=e.schema)}if((u||void 0!==p)&&"GET"!==m&&"HEAD"!==m){let t=p??pE(e,u);x=w?{...x,bodyMode:"json",bodyText:JSON.stringify(t??{},null,2)}:{...x,bodyMode:"text",bodyText:"object"==typeof t&&t?new URLSearchParams(Object.entries(t).map(([e,t])=>[e,py(t)])).toString():py(t)}}let _=Object.keys(f.responses??{}).find(e=>/^2\d\d$/.test(e)),S=[{type:"status",expect:_??"2xx"}],I=null;if(_){let r=pO(e,(f.responses??{})[_]),n=r.content??{},i=Object.keys(n).find(e=>/json/i.test(e)),a="swagger"===t?r.schema:i?n[i].schema:void 0,o=function(e,t,r){if(!t||"object"!=typeof t)return null;let n=new Map,i=(t,r)=>{if(!(r>60)&&t&&"object"==typeof t){if(Array.isArray(t))return t.forEach(e=>i(e,r+1));if("string"==typeof t.$ref&&t.$ref.startsWith("#/")&&!n.has(t.$ref)){let a=pO(e,{$ref:t.$ref});n.set(t.$ref,a),i(a,r+1)}for(let[e,n]of Object.entries(t))"$ref"!==e&&"example"!==e&&"examples"!==e&&i(n,r+1)}};i(t,0);let a=pO(e,t);if(!["type","properties","items","allOf","anyOf","oneOf","enum","required"].some(e=>e in a)||n.size>200)return null;let s={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=s;for(let e of r.slice(0,-1))n=n[e]??={};n[r[r.length-1]]=t}let o=JSON.stringify(s);return o.length<=2e5?o:null}(e,a,`${g} (${_})`);o&&(S.push({type:"schema",schema:o}),s++);let l=i?n[i]:void 0,u="swagger"===t?(r.examples??{})["application/json"]:l?.example??Object.values(l?.examples??{})[0]?.value,c=void 0!==u?u:a?pE(e,a):void 0;void 0!==c?I={status:Number(_),headers:[["Content-Type","application/json"]],body:JSON.stringify(c,null,2),delayMs:0}:"204"!==_&&Object.keys(n).length||(I={status:Number(_),headers:[],body:"",delayMs:0})}a.push({collection:r,name:v,request:{...x,checks:S,mock:I}})}}return a.length||i("The file has no operations under “paths”"),s&&i(`${s} request${1===s?" 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`),{kind:t,title:r,requests:a,environments:[{name:r,variables:[...o.values()]}],warnings:[...n]}}let pN=/\.(png|jpe?g|gif|svg|webp|avif|ico|bmp|css|js|mjs|map|woff2?|ttf|otf|eot|mp4|webm|mp3|wav|pdf)(\?|$)/i,pU=/^(image|font|audio|video)\/|^text\/(css|javascript)|javascript/i,pj=/^(:|host$|content-length$|connection$|accept-encoding$|accept-language$|user-agent$|origin$|referer$|priority$|upgrade-insecure-requests$|cache-control$|pragma$|dnt$|sec-|te$)/i;function pz(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 pT(e,t=""){if(!e||"object"!=typeof e||Array.isArray(e))return[];let r=[];for(let[n,i]of Object.entries(e)){let e=t?`${t}.${n}`:n;i&&"object"==typeof i&&!Array.isArray(i)?r.push(...pT(i,e)):/^[A-Za-z_][\w.-]*$/.test(e)&&r.push({key:e,value:"string"==typeof i?i:JSON.stringify(i),secret:!1})}return r}function pP(e,t,r,n,i){if(!t||!t.type||"none"===t.type||t.disabled)return t?.type==="none"?{...e,authMode:"none"}:e;let a=e=>i(py(t[e]));switch(t.type){case"bearer":return{...e,authMode:"bearer",token:a("token")};case"basic":return{...e,authMode:"basic",username:a("username"),password:a("password")};case"digest":return{...e,authMode:"digest",username:a("username"),password:a("password")};case"ntlm":return{...e,authMode:"ntlm",username:a("username"),password:a("password")};case"apikey":return{...e,authMode:"api_key",apiName:a("key")||"X-API-Key",apiValue:a("value"),apiIn:"queryParams"===py(t.addTo)?"query":"header"};case"iam":return{...e,authMode:"aws_sigv4",aws:{accessKeyId:a("accessKeyId"),secretAccessKey:a("secretAccessKey"),sessionToken:a("sessionToken"),region:a("region")||"us-east-1",service:a("service")||"execute-api"}};case"oauth1":{let i=py(t.signatureMethod).toUpperCase();return i.startsWith("RSA")&&r(`${n}: OAuth 1.0 with ${i} isn't supported; set the signature method by hand`),{...e,authMode:"oauth1",oauth1:{consumerKey:a("consumerKey"),consumerSecret:a("consumerSecret"),token:a("tokenKey"),tokenSecret:a("tokenSecret"),signatureMethod:"HMAC-SHA1"===i||"PLAINTEXT"===i?i:"HMAC-SHA256",realm:a("realm"),addTo:"header"}}}case"oauth2":{let i=py(t.grantType);return"implicit"===i&&r(`${n}: the OAuth 2.0 implicit grant is outdated and not supported — it was set to client credentials`),{...e,authMode:"oauth2",oauth:{...f2(),grant:"password"===i||"authorization_code"===i?i:"client_credentials",tokenUrl:a("accessTokenUrl"),authUrl:a("authorizationUrl"),clientId:a("clientId"),clientSecret:a("clientSecret"),scope:a("scope"),username:a("username"),password:a("password"),redirectUri:a("redirectUrl")||f2().redirectUri,pkce:!1!==t.usePkce}}}default:return r(`${n}: ${t.type} auth is not supported yet; set Auth by hand`),e}}e.s(["importFile",0,function(e,t=""){var r,n;let i=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 fq(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(!i||"object"!=typeof i)throw Error("This file is empty or not JSON/YAML");let a=i.info;if("string"==typeof a?.schema&&/collection\/v2/.test(a.schema)||Array.isArray(i.item)&&a){let e,t,n,a,s,o,l,u,c,d,f;return e=py(((r=i).info??{}).name,"Imported collection").trim()||"Imported collection",t=[],n=new Set,a=e=>n.add(e),s=0,o=new Set,l=[],u=t=>pr([e,...t].map(e=>e.replace(/[\\/]/g," ")).join("/")),c=(e,t,r,n)=>{let i=pe();if(t?.type&&"inherit"!==t.type){let e=pw({...ps(),authMode:"inherit"},t,a,n);i={...i,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 s=pb(r).map(e=>e).filter(e=>py(e.key).trim()&&!e.disabled).map(e=>({key:py(e.key).trim(),value:py(e.value),secret:"secret"===e.type}));s.length&&(i={...i,variables:pI(s)}),pt(i)||l.push({path:u(e),settings:i})},d=(e,t,r)=>{let n=p_(t,"prerequest"),i=p_(t,"test");return{pre:n?[...e.pre,`// From ${r}
573
- ${n}`]:e.pre,post:i?[...e.post,`// From ${r}
574
- ${i}`]:e.post}},f=(e,r,n)=>{for(let i of e){if(Array.isArray(i.item)){let e=[...r,py(i.name,"Folder")];e.length>=6&&a(`${e.join(" › ")}: folders deeper than 6 levels were put in the folder above`),c(e,i.auth,i.variable,e.join(" › ")),f(i.item,e,d(n,i,`the folder “${py(i.name,"Folder")}”`));continue}if(t.length>=2e3)return void a("Only the first 2000 requests were imported");let e=py(i.name,"Request"),l=[...r,e].join(" › "),p="string"==typeof i.request?{url:i.request}:i.request??{},m=p$(p.method);if(!m){a(`${l}: ${py(p.method)} requests are not supported; skipped`);continue}let h=function(e){if("string"==typeof e)return e;let t=e??{};if("string"==typeof t.raw)return t.raw;let r=py(t.protocol),n=Array.isArray(t.host)?t.host.map(e=>py(e)).join("."):py(t.host),i=Array.isArray(t.path)?t.path.map(e=>py(e)).join("/"):py(t.path),a=pb(t.query).filter(e=>!e.disabled).map(e=>`${py(e.key)}=${py(e.value)}`).join("&");return`${r?`${r}://`:""}${n}${i?`/${i}`:""}${a?`?${a}`:""}`}(p.url);for(let e of JSON.stringify(p).matchAll(/\{\{\s*(\$[A-Za-z]+)/g))pS.has(e[1].toLowerCase())||o.add(e[1]);let g=pc({...ps(),method:m},h);!g.baseUrl&&h&&(g={...g,url:h}),g=pw({...g,authMode:"inherit"},p.auth,a,l);let v=px(pb(p.header).filter(e=>!e.disabled).map(e=>({key:py(e.key),value:py(e.value)})),g,a,l);v=function(e,t,r,n,i){if(!t||t.disabled)return{draft:e,headers:r};let a=r.some(e=>/^content-type$/i.test(e.key));switch(t.mode){case"raw":{let n=py(t.raw),i="json"===py(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:i?"json":"text",bodyText:n},headers:r}}case"urlencoded":{let n=pb(t.urlencoded).filter(e=>!e.disabled).map(e=>`${encodeURIComponent(py(e.key))}=${encodeURIComponent(py(e.value))}`).join("&");return{draft:{...e,bodyMode:"text",bodyText:n},headers:a?r:[...r,{key:"Content-Type",value:"application/x-www-form-urlencoded"}]}}case"graphql":{let n=t.graphql??{},i="string"==typeof n.variables?n.variables:n.variables?JSON.stringify(n.variables,null,2):"";return{draft:{...e,bodyMode:"graphql",graphqlQuery:py(n.query),graphqlVariables:i},headers:r.filter(e=>!/^content-type$/i.test(e.key))}}case"formdata":return n(`${i}: multipart form-data bodies are not supported yet; the body was left out`),{draft:e,headers:r};case"file":return n(`${i}: file bodies are not supported; the body was left out`),{draft:e,headers:r};default:return{draft:e,headers:r}}}(v.draft,p.body,v.headers,a,l);let y=d(n,i,"this request"),b=y.pre.join("\n\n").slice(0,1e5),$=y.post.join("\n\n").slice(0,1e5);(b||$)&&s++,/pm\.sendRequest\(/.test(b+$)&&a(`${l}: its script uses pm.sendRequest, which isn't supported yet — use Run first for the request it makes`),t.push({collection:u(r),name:e,request:{...v.draft,headers:v.headers,preScript:b,postScript:$}})}},c([],r.auth,r.variable,e),f(pb(r.item),[],d({pre:[],post:[]},r,`the collection “${e}”`)),s&&a(`${s} request${1===s?" has":"s have"} pre-request or test scripts — they run as in Postman (see the Scripts tab)`),o.size&&a(`Postman dynamic values the app doesn't make: ${[...o].slice(0,8).map(e=>`{{${e}}}`).join(", ")} — they are sent as written`),{kind:"postman",title:e,requests:t,folders:l,environments:[],warnings:[...n]}}if(Array.isArray(i.values)&&("environment"===i._postman_variable_scope||"string"==typeof i.name)){let e;return{kind:"postman-environment",title:e=py((n=i).name,"Imported environment").trim()||"Imported environment",requests:[],environments:[{name:e,variables:pI(pb(n.values).map(e=>e).filter(e=>py(e.key).trim()&&!1!==e.enabled).map(e=>({key:py(e.key).trim(),value:py(e.value),secret:"secret"===e.type})))}],warnings:[]}}if(i.log&&"object"==typeof i.log&&Array.isArray(i.log.entries))return function(e,t){let r=e.log,n=t.replace(/\.har$/i,"").replace(/[_-]+/g," ").trim()||"Browser recording",i=[],a=new Set,s=e=>a.add(e),o=new Set,l=0,u=0;for(let e of pb(r.entries)){var c;let t=e.request??{},r=py(t.url);if(!/^https?:\/\//i.test(r))continue;let a=p$(t.method);if(!a||"OPTIONS"===a)continue;let d=py(e._resourceType),f=py(e.response?.content?.mimeType);if(d&&!["xhr","fetch","document",""].includes(d)||pN.test(r)||pU.test(f)){l++;continue}let p=`${a} ${r}`;if(o.has(p))continue;if(o.add(p),i.length>=2e3){s("Only the first 2000 requests were imported");break}let m=new URL(r),h=`${a} ${m.pathname}`,g=pc({...ps(),method:a},r),v=pb(t.headers).map(e=>({key:py(e.name),value:py(e.value)})).filter(e=>e.key&&!pj.test(e.key));v.some(e=>/^cookie$/i.test(e.key))&&u++;let y=px(v.filter(e=>!/^cookie$/i.test(e.key)),g,s,h);g=y.draft;let b=t.postData;if(b&&("POST"===(c=a)||"PUT"===c||"PATCH"===c||"DELETE"===c)){let e=py(b.mimeType),t=py(b.text);/json/i.test(e)?g={...g,bodyMode:"json",bodyText:t}:/multipart\/form-data/i.test(e)?s(`${h}: multipart form-data bodies are not supported yet; the body was left out`):t&&(g={...g,bodyMode:"text",bodyText:t}),!e||y.headers.some(e=>/^content-type$/i.test(e.key))||/multipart/i.test(e)||(y={...y,headers:[...y.headers,{key:"Content-Type",value:e.split(";")[0]}]})}i.push({collection:pr(`${n}/${m.host.replace(/:/g," ")}`),name:h.slice(0,120),request:{...g,headers:y.headers}})}if(!i.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&&s(`${l} page files (images, scripts, styles, fonts) were left out — only API calls are imported`),u&&s(`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:i,environments:[],warnings:[...a]}}(i,t);if("export"===i._type&&Array.isArray(i.resources)||"string"==typeof i.type&&i.type.startsWith("collection.insomnia.rest/"))return function(e){let t=new Set,r=e=>t.add(e),n=e=>pz(e,r,"Some values"),i="Insomnia collection",a=[],s=[];if("export"===e._type){let t=pb(e.resources).map(e=>e),r=t.find(e=>"workspace"===e._type);i=py(r?.name,i)||i;let n=new Map;for(let e of t)"request_group"===e._type&&n.set(py(e._id),{kind:"folder",name:py(e.name,"Folder"),raw:e,children:[]}),"request"===e._type&&n.set(py(e._id),{kind:"request",name:py(e.name,"Request"),raw:e,children:[]});for(let e of t){let t=n.get(py(e._id));if(!t)continue;let r=n.get(py(e.parentId));r?r.children.push(t):a.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=pT(o?.data);if(l.length)for(let e of l)s.push({name:py(e.name,"Environment"),variables:pI([...u,...pT(e.data)])});else u.length&&s.push({name:`${i} (base)`,variables:u})}else{i=py(e.name,i)||i;let t=e=>e.map(e=>Array.isArray(e.children)?{kind:"folder",name:py(e.name,"Folder"),raw:e,children:t(e.children)}:{kind:"request",name:py(e.name,"Request"),raw:e,children:[]});a=t(pb(e.collection));let r=e.environments;if(r){let e=pT(r.data),t=pb(r.subEnvironments).map(e=>e);if(t.length)for(let r of t)s.push({name:py(r.name,"Environment"),variables:pI([...e,...pT(r.data)])});else e.length&&s.push({name:`${i} (base)`,variables:e})}}let o=[],l=[],u=pr(i),c=(e,t)=>{for(let i of e){if("folder"===i.kind){let e=[...t,i.name],a=pe();a={...a,auth:pP(a.auth,i.raw.authentication,r,e.join(" › "),n)};let s=pT(i.raw.environment);s.length&&(a={...a,variables:s}),pt(a)||l.push({path:pr(`${u}/${e.map(e=>e.replace(/[\\/]/g," ")).join("/")}`),settings:a}),c(i.children,e);continue}if(o.length>=2e3)return void r("Only the first 2000 requests were imported");let e=i.raw,a=[...t,i.name].join(" › "),s=p$(e.method);if(!s){r(`${a}: ${py(e.method)} requests are not supported; skipped`);continue}let d=pc({...ps(),method:s},pz(py(e.url),r,a)),f=pb(e.parameters).filter(e=>!e.disabled).map(e=>({key:py(e.name),value:n(py(e.value))})).filter(e=>e.key);f.length&&(d={...d,params:[...d.params,...f]}),d=pP(d,e.authentication,r,a,n);let p=px(pb(e.headers).filter(e=>!e.disabled).map(e=>({key:py(e.name),value:n(py(e.value))})),d,r,a);d=p.draft;let m=e.body??{},h=py(m.mimeType);if("application/graphql"===h)try{let e=JSON.parse(py(m.text,"{}"));d={...d,bodyMode:"graphql",graphqlQuery:n(py(e.query)),graphqlVariables:e.variables?JSON.stringify(e.variables,null,2):""}}catch{r(`${a}: the GraphQL body could not be read`)}else if(/json/i.test(h))d={...d,bodyMode:"json",bodyText:n(py(m.text))};else if("application/x-www-form-urlencoded"===h){let e=pb(m.params).filter(e=>!e.disabled).map(e=>`${encodeURIComponent(py(e.name))}=${encodeURIComponent(n(py(e.value)))}`).join("&");d={...d,bodyMode:"text",bodyText:e}}else"multipart/form-data"===h?r(`${a}: multipart form-data bodies are not supported yet; the body was left out`):py(m.text)&&(d={...d,bodyMode:"text",bodyText:n(py(m.text))});let g=!h||/graphql|multipart/.test(h)||p.headers.some(e=>/^content-type$/i.test(e.key))?p.headers:[...p.headers,{key:"Content-Type",value:h}];o.push({collection:pr(`${u}/${t.map(e=>e.replace(/[\\/]/g," ")).join("/")}`),name:i.name.slice(0,120),request:{...d,headers:"graphql"===d.bodyMode?p.headers:g}})}};if(c(a,[]),!o.length)throw Error("No requests found in this Insomnia file");return{kind:"insomnia",title:i,requests:o,folders:l,environments:s,warnings:[...t]}}(i);if("string"==typeof i.openapi&&i.openapi.startsWith("3"))return pA(i,"openapi");if("2.0"===i.swagger)return pA(i,"swagger");if("string"==typeof i.openapi)throw Error(`OpenAPI ${i.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, or an OpenAPI/Swagger file")}],90372);let pM=[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 pD(e){let t=pM[e]??1/0,r=0===e?0:pM[e-1],n=e=>e>=1e3?`${e/1e3}s`:`${e}ms`;return t===1/0?`> ${n(r)}`:`${n(r)}–${n(t)}`}function pZ(e){let t=Array(pM.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 pC(e,t){let r=0,n=0,i=0;for(let a=0;a<e.length;a++){let s=e[a]??0;r+=s;let o=pM[a]??1/0;o<=t?n+=s:o<=4*t&&(i+=s)}return r?(n+i/2)/r:null}function pL(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(["LATENCY_BIN_EDGES_MS",0,pM,"apdexFromHistogram",0,pC,"latencyBinLabel",0,pD,"sumHistograms",0,pZ],47253);let pR=new Set(["429","403"]);function pq(e){let t=e.summary,r=t.http.failed.rate,n=Object.entries(t.http.status).filter(([e])=>"0"===e||Number(e)>=400),i=n.reduce((e,[,t])=>e+t,0),a=[...n].sort((e,t)=>t[1]-e[1])[0],s=a&&i?{code:a[0],count:a[1],share:a[1]/i,meaning:pL(a[0])}:null,o=n.filter(([e])=>pR.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,d=c?{elapsedS:c.elapsedS,vus:Math.round(c.vus),rps:Math.round(c.rps)}:null,f=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));f=e.reduce((e,t)=>e+t.failedRate,0)/e.length<.1}}let p=c?l.slice(0,u).filter(e=>e.rps>0&&e.failedRate<.5):[],m=p.length?{vus:Math.round(Math.max(...p.map(e=>e.vus))),rps:Math.round(Math.max(...p.map(e=>e.rps)))}:null,h=null;if(t.latencyOkMs&&t.latencyOkMs.p95>0)h=t.latencyOkMs.p95;else{let e=pZ((c?p:l.filter(e=>e.failedRate<.5)).map(e=>e.hist));h=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=pM[n];return Number.isFinite(e)?e:pM[pM.length-2]}return null}(e):null}return{failedRate:r,dominant:s,blocked:i>0&&o/i>=.5,timingsUnreliable:r>=.5,onset:d,recovered:f,lastHealthy:m,healthyP95Ms:h}}e.s(["BLOCKING_CODES",0,pR,"failureStory",0,pq,"repairSummary",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,i=e.summary.http.rps.avg||r.reduce((e,t)=>e+t,0)/e.buckets.length,a=e.buckets.filter(e=>e.vus>0);return{rps:{min:n(r[0]),max:n(r[r.length-1]),avg:n(i),p95:n(r[Math.min(r.length-1,Math.max(0,Math.ceil(.95*r.length)-1))])},vusAvg:a.length?n(a.reduce((e,t)=>e+t.vus,0)/a.length):e.summary.vus.avg}}(e);if(!t)return e;let{rps:r}=e.summary.http,n=r.min===r.max,i=e.summary.vus.avg<t.vusAvg/2;return n||i?{...e,summary:{...e.summary,http:{...e.summary.http,rps:n?t.rps:r},vus:{...e.summary.vus,avg:i?t.vusAvg:e.summary.vus.avg}}}:e},"statusMeaning",0,pL],48191);let pF={errorWarn:.01,errorFail:.05,p95WarnMs:500,p95FailMs:2e3,stabilityWarn:1.5,stabilityFail:2.5};function pB(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}:{...pF,owned:!1}}function pJ(e,t,r){let{buckets:n}=e;if(0===n.length)return 0;let i=Math.floor(n.length*t),a=Math.max(i+1,Math.ceil(n.length*r)),s=n.slice(i,a).map(e=>e.p95Ms).filter(e=>e>0);return 0===s.length?0:s.reduce((e,t)=>e+t,0)/s.length}function pK(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:pJ(e,0,.33),lateP95:pJ(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])=>pR.has(e)).reduce((e,[,t])=>e+t,0),status503:r["503"]??0,okP95:e.summary.latencyOkMs?.p95||null}}function pW(e,t={}){return pV(pK(e),t)}function pV(e,t={}){var r;let{failedRate:n,p95:i,requests:a,status5xx:s,status0:o}=e,l=pB(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%",d=Math.round(n*a),f=n>=l.errorFail&&(e.blockedCount??0)>=.5*d&&d>0,p=a>0&&n>=.5,m=e.topFailure,h=m&&d?` Mostly ${"0"===m.code?"no answer":m.code}: ${pL(m.code)}.`:"",g=l.owned?`your target: fail ≥ ${Math.round(l.p95FailMs)} ms`:"default: fail ≥ 2 s",v=l.owned?`your target: warn ≥ ${Math.round(l.p95WarnMs)} ms`:"default: warn ≥ 500 ms",y=0===a?{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}).${h||" Clients would see this as broken."}`}:n>=l.errorWarn?{id:"errors",title:"Errors",level:"warn",summary:`${(100*n).toFixed(1)}% failed (${c}).${h||" 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.`},b=(()=>{if(p){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 i<=0&&0===a?{id:"latency",title:"Latency",level:"fail",summary:"No latency samples. Nothing to judge."}:i>=l.p95FailMs?{id:"latency",title:"Latency",level:"fail",summary:`p95 is ${Math.round(i)} ms (${g}). Most users would feel this as stuck.`}:i>=l.p95WarnMs?{id:"latency",title:"Latency",level:"warn",summary:`p95 is ${Math.round(i)} ms (${v}). OK for a heavy report API; slow for a ping/health check.`}:{id:"latency",title:"Latency",level:"pass",summary:`p95 is ${Math.round(i)} ms. 95% of calls were faster than that under this load.`}})(),$=e.earlyP95,x=e.lateP95,k=$>0?x/$:1,w=x-$>=Math.max(20,.1*l.p95WarnMs),_=p?{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."}:w&&k>=pF.stabilityFail?{id:"stability",title:"Stability",level:"fail",summary:`p95 grew ~${k.toFixed(1)}\xd7 from the first third to the last third. The API (or the generator) degraded as the test went on.`}:w&&k>=pF.stabilityWarn?{id:"stability",title:"Stability",level:"warn",summary:`p95 rose ~${k.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."},S=e.dropped??0,I=f?{id:"capacity",title:"Capacity",level:"fail",summary:`Refused on purpose (${m&&pR.has(m.code)?m.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*d&&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."}:S>0&&S>=Math.max(1,(a+S)*.05)?{id:"capacity",title:"Capacity",level:"fail",summary:`${S.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*a&&a>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."}:s>0&&s/Math.max(a,1)>=.02?{id:"capacity",title:"Capacity",level:"fail",summary:"Server 5xx responses appeared. The API is shedding load or crashing under these VUs."}:S>0?{id:"capacity",title:"Capacity",level:"warn",summary:`${S.toLocaleString("en-US")} requests were dropped because no virtual user was free. The rate you asked for was not fully held.`}:i>=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."},O=e.checksPassed??0,E=e.checksFailed??0,A=O+E,N=t.slo?.checksRate??.99,U=0===A?null:O/A<N?{id:"checks",title:"Checks",level:"fail",summary:`${(O/A*100).toFixed(1)}% of checks passed (needs ${(100*N).toFixed(+(N<1))}%). Responses arrived, but not all of them were correct.`}:E>0?{id:"checks",title:"Checks",level:"warn",summary:`${E.toLocaleString("en-US")} of ${A.toLocaleString("en-US")} checks failed — within your bar, but look at which ones.`}:{id:"checks",title:"Checks",level:"pass",summary:`All ${A.toLocaleString("en-US")} checks passed. Responses were correct, not just fast.`},j=[y,b,_,I,...U?[U]:[]],z=(r=j.map(e=>e.level)).includes("fail")?"fail":r.includes("warn")?"warn":"pass",T=f?"Blocked by a rate limit or firewall at this load — the results show that limit, not the API’s speed.":l.owned?"pass"===z?"Meets your performance targets under this load.":"warn"===z?"Close to your performance targets. Read the checks before you trust it in UAT.":"Misses your performance targets at this load.":"pass"===z?"Looks healthy under this load (built-in defaults — set your own under Goals).":"warn"===z?"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:z,headline:T,aspects:j,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 pG(e,t){try{let r=new URL(t);return`${e.toUpperCase()} ${r.origin}${r.pathname.replace(/\/+$/,"")||"/"}`}catch{return`${e.toUpperCase()} ${t}`}}function pH(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(["buildVerdict",0,pW,"buildVerdictFromInputs",0,pV,"expectedLoadMs",0,function(e){let t=e.definition.load.stages;return t.length>0?t.reduce((e,t)=>e+uY(t.duration),0):3e4},"formatVerdictEmail",0,function(e,t){let r=pW(e,{slo:t}),n=e=>"pass"===e?"[PASS]":"warn"===e?"[WARN]":"[FAIL]",i=e.summary.http.rps.avg,a=i>=100?String(Math.round(i)):i>=10?i.toFixed(1):i.toFixed(2),s=["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 ${a}`,"","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:s.join("\n")}},"verdictBars",0,pB,"verdictInputs",0,pK],2385),e.s(["deltaVsBaseline",0,pH,"endpointKey",0,pG],94122);let pX=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),pY=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`,pQ=e=>`${(100*e).toFixed(e>0&&e<.001?3:2)}%`,p0={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"}},p1={"constant-vus":"Steady users","ramping-vus":"Changing users","constant-arrival-rate":"Steady request rate","ramping-arrival-rate":"Changing request rate"};function p2(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 p6(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 p4(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(["buildEmailReport",0,function(e,t={}){let r,n=pW(e,{slo:t.slo??null}),i=p0[n.overall],a=e.summary,s=t.appUrl??"https://apitestcenter.com",o=t.baseline?pH({p95:a.latencyMs.p95,rps:a.http.rps.avg,errorRate:a.http.failed.rate},t.baseline):null;a.checks.reduce((e,t)=>e+t.passes,0),a.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:pY(a.latencyMs.p95),change:p6(o?.p95??null,!0)},{label:"Requests per second",tech:"throughput",value:(r=a.http.rps.avg)>=100?String(Math.round(r)):r>=10?r.toFixed(1):r.toFixed(2),change:p6(o?.rps??null,!1)},{label:"Failed requests",tech:"error rate",value:pQ(a.http.failed.rate),change:p6(o?.errorRate??null,!0)},{label:"Typical response",tech:"median (p50)",value:pY(a.latencyMs.median)},{label:"Slowest 1%",tech:"p99",value:pY(a.latencyMs.p99)},{label:l?"Users needed":"Simulated users",tech:"peak VUs",value:String(a.vus.max)}],d=[["Fastest",a.latencyMs.min],["Typical (p50)",a.latencyMs.median],["Most (p90)",a.latencyMs.p90],["95% (p95)",a.latencyMs.p95],["Slowest 1% (p99)",a.latencyMs.p99],["Slowest",a.latencyMs.max]],f=Math.max(...d.map(([,e])=>e),1),p="font-family:Segoe UI,Roboto,Helvetica,Arial,sans-serif",m=(e,t="")=>`<td style="${p};font-size:14px;color:#12151c;${t}">${e}</td>`,h=e=>`<tr><td style="${p};padding:22px 24px 8px;font-size:13px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:#5c6778">${pX(e)}</td></tr>`,g=c.map(e=>`<td width="33%" valign="top" style="${p};padding:6px">
657
+ ${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:fc(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 i=fu(e);i[0]+=t,this.onError(i,"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:i,end:a},s){let o=new dH(void 0,Object.assign({_directives:t},e)),l={atKey:!1,atRoot:!0,directives:o.directives,options:o.options,schema:o.schema},u=d2(n,{indicator:"doc-start",next:i??a?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(o.directives.docStart=!0,i&&("block-map"===i.type||"block-seq"===i.type)&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),o.contents=i?fo(l,i,u,s):fl(l,u.end,n,null,u,s);let c=o.contents.range[2],d=d3(a,c,!1,s);return d.comment&&(o.comment=d.comment),o.range=[r,c,d.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 dQ(fu(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 dQ(fu(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=d3(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}
658
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new dQ(fu(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 dH(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 ff(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 fp(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),i=t.length;for(let t of("block-scalar-header"===e.props[0].type&&(i-=e.props[0].source.length),n))t.offset+=i;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,i="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:i})}}}let fm=Symbol("break visit"),fh=Symbol("skip children"),fg=Symbol("remove item");function fv(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),function e(t,r,n){let i=n(r,t);if("symbol"==typeof i)return i;for(let a of["key","value"]){let s=r[a];if(s&&"items"in s){for(let r=0;r<s.items.length;++r){let i=e(Object.freeze(t.concat([[a,r]])),s.items[r],n);if("number"==typeof i)r=i-1;else{if(i===fm)return fm;i===fg&&(s.items.splice(r,1),r-=1)}}"function"==typeof i&&"key"===a&&(i=i(r,t))}}return"function"==typeof i?i(r,t):i}(Object.freeze([]),e,t)}fv.BREAK=fm,fv.SKIP=fh,fv.REMOVE=fg,fv.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},fv.parentCollection=(e,t)=>{let r=fv.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw Error("Parent collection not found")};let fy=e=>!!e&&"items"in e,fb=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type);function f$(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)}}function fx(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 fk(e){switch(e.type){case"block-scalar":{let t="";for(let r of e.props)t+=fk(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(let r of e.items)t+=fw(r);return t}case"flow-collection":{let t=e.start.source;for(let r of e.items)t+=fw(r);for(let r of e.end)t+=r.source;return t}case"document":{let t=fw(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 fw({start:e,key:t,sep:r,value:n}){let i="";for(let t of e)i+=t.source;if(t&&(i+=fk(t)),r)for(let e of r)i+=e.source;return n&&(i+=fk(n)),i}e.s(["BOM",0,"\uFEFF","DOCUMENT",0,"\x02","FLOW_END",0,"\x18","SCALAR",0,"\x1f","isCollection",0,fy,"isScalar",0,fb,"prettyToken",0,f$,"tokenType",0,fx],66269),e.i(66269),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:i=!1,offset:a=-1,type:s="PLAIN"}=t,o=cX({type:s,value:e},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,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",i=[{type:"block-scalar-header",offset:a,indent:n,source:t}];return ff(i,l)||i.push({type:"newline",offset:-1,indent:n,source:"\n"}),{type:"block-scalar",offset:a,indent:n,props:i,source:r}}case'"':return{type:"double-quoted-scalar",offset:a,indent:n,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:a,indent:n,source:o,end:l};default:return{type:"scalar",offset:a,indent:n,source:o,end:l}}},"isCollection",0,fy,"isScalar",0,fb,"prettyToken",0,f$,"resolveAsScalar",0,function(e,t=!0,r){if(e){let n=(e,t,n)=>{let i="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(r)r(i,t,n);else throw new dQ([i,i+1],t,n)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return fr(e,t,n);case"block-scalar":return ft({options:{strict:t}},e,n)}}return null},"setScalarValue",0,function(e,t,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:a=!1,type:s}=r,o="indent"in e?e.indent:null;if(n&&"number"==typeof o&&(o+=2),!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");s=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let l=cX({type:s,value:t},{implicitKey:i||null===o,indent:null!==o&&o>0?" ".repeat(o):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":!function(e,t){let r=t.indexOf("\n"),n=t.substring(0,r),i=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=i}else{let{offset:t}=e,r="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:t,indent:r,source:n}];for(let t of(ff(a,"end"in e?e.end:void 0)||a.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:a,source:i})}}(e,l);break;case'"':fp(e,l,"double-quoted-scalar");break;case"'":fp(e,l,"single-quoted-scalar");break;default:fp(e,l,"scalar")}},"stringify",0,e=>"type"in e?fk(e):fw(e),"tokenType",0,fx,"visit",0,fv],91723);var f_=e.i(91723);function fS(e){switch(e){case void 0:case" ":case"\n":case"\r":case" ":return!0;default:return!1}}let fI=new Set("0123456789ABCDEFabcdef"),fO=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),fE=new Set(",[]{}"),fA=new Set(" ,[]{}\n\r "),fN=e=>!e||fA.has(e);class fU{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)&&fS(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)&&fS(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&&!fS(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)&&fS(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(fN),"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("..."))&&fS(n[3]))&&(r!==this.indentNext-1||1!==this.flowLevel||"]"!==n[0]&&"}"!==n[0]))return this.flowLevel=0,yield"\x18",yield*this.parseLineStart();let i=0;for(;","===n[i];)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(n[i+=yield*this.pushIndicators()]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-i),"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(fN),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let e=this.charAt(1);if(this.flowKey||fS(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=>fS(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 i=e;for(;" "===n;)n=this.buffer[--e];if("\n"===n&&e>=this.pos&&e+1+r>i)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(fS(e)||t&&fE.has(e))break;r=n}else if(fS(e)){let i=this.buffer[n+1];if("\r"===e&&("\n"===i?(n+=1,e="\n",i=this.buffer[n+1]):r=n),"#"===i||t&&fE.has(i))break;if("\n"===e){let e=this.continueScalar(n+1);if(-1===e)break;n=Math.max(n,e-2)}}else{if(t&&fE.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(fN),e+=yield*this.pushSpaces(!0);continue;case"-":case"?":case":":{let t=this.flowLevel>0,r=this.charAt(1);if(fS(r)||t&&fE.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(;!fS(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(fO.has(t))t=this.buffer[++e];else if("%"===t&&fI.has(this.buffer[e+1])&&fI.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 fj(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}function fz(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 fT(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 fP(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 fM(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 fD(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 fZ(e){if("flow-seq-start"===e.start.type)for(let t of e.items)!t.sep||t.value||fj(t.start,"explicit-key-ind")||fj(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,fT(t.value)?t.value.end?fD(t.value.end,t.sep):t.value.end=t.sep:fD(t.start,t.sep),delete t.sep)}class fC{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 fU,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=fx(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&&fZ(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===fz(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!==fz(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=fM(fP(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)){fD(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,i=[];if(n&&t.sep&&!t.value){let r=[];for(let n=0;n<t.sep.length;++n){let i=t.sep[n];switch(i.type){case"newline":r.push(n);break;case"space":break;case"comment":i.indent>e.indent&&(r.length=0);break;default:r.length=0}}r.length>=2&&(i=t.sep.splice(r[1]))}switch(this.type){case"anchor":case"tag":n||t.value?(i.push(this.sourceToken),e.items.push({start:i}),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?(i.push(this.sourceToken),e.items.push({start:i,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(fj(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(fT(t.key)&&!fj(t.sep,"newline")){let e=fM(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 i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(fj(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=fM(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:i,key:null,sep:[this.sourceToken]}):fj(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:i,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&&!fj(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:i});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)){fD(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||fj(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=fM(fP(t));fZ(e);let n=e.end.splice(1,e.end.length);n.push(this.sourceToken);let i={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]=i}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=fM(fP(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=fM(fP(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 fL{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 fR(e){let t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new fL||null,prettyErrors:t}}function fq(e,t={}){let{lineCounter:r,prettyErrors:n}=fR(t),i=new fC(r?.addNewLine),a=new fd(t),s=null;for(let t of a.compose(i.parse(e),!0,e.length))if(s){if("silent"!==s.options.logLevel){s.errors.push(new dQ(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else s=t;return n&&r&&(s.errors.forEach(d1(e,r)),s.warnings.forEach(d1(e,r))),s}function fF(e,t,r){let n;"function"==typeof t?n=t:void 0===r&&t&&"object"==typeof t&&(r=t);let i=fq(e,r);if(!i)return null;if(i.warnings.forEach(e=>c0(i.options.logLevel,e)),i.errors.length>0)if("silent"!==i.options.logLevel)throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:n},r))}e.s([],97850),e.i(97850),e.s(["Alias",0,cU,"CST",0,f_,"Composer",0,fd,"Document",0,dH,"Lexer",0,fU,"LineCounter",0,fL,"Pair",0,c3,"Parser",0,fC,"Scalar",0,cz,"Schema",0,dG,"YAMLError",0,dY,"YAMLMap",0,dt,"YAMLParseError",0,dQ,"YAMLSeq",0,dn,"YAMLWarning",0,d0,"isAlias",0,cn,"isCollection",0,cu,"isDocument",0,ci,"isMap",0,ca,"isNode",0,cc,"isPair",0,cs,"isScalar",0,co,"isSeq",0,cl,"parse",0,fF,"parseAllDocuments",0,function(e,t={}){let{lineCounter:r,prettyErrors:n}=fR(t),i=new fC(r?.addNewLine),a=new fd(t),s=Array.from(a.compose(i.parse(e)));if(n&&r)for(let t of s)t.errors.forEach(d1(e,r)),t.warnings.forEach(d1(e,r));return s.length>0?s:Object.assign([],{empty:!0},a.streamInfo())},"parseDocument",0,fq,"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 ci(e)&&!n?e.toString(r):new dH(e,n,r).toString(r)},"visit",0,ch,"visitAsync",0,cv],32861),e.i(32861);var fB=e.i(53267);let fJ={baseUrl:"",endpoint:"",params:[],valid:!1};function fK(e){let t=e.trim();if(!t)return fJ;try{let e=new URL(t);if("http:"!==e.protocol&&"https:"!==e.protocol)return fJ;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 fJ}}function fW(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&&r.searchParams.append(e,t.value)}return r.toString()}catch{return""}}let fV=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]);function fG(e){if(!e)return;let t=e.toUpperCase();return fV.has(t)?t:void 0}function fH(e){return e.replace(/[),.;]+$/g,"").replace(/[<>]/g,"")}let fX=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),fY=new Set(["-d","--data","--data-raw","--data-binary","--data-ascii","--data-urlencode","--json"]),fQ=new Set(["-A","--user-agent","-b","--cookie","-e","--referer","-o","--output","-m","--max-time","--connect-timeout","-x","--proxy","-w","--write-out"]),f0=/\{\{\s*([A-Za-z_][\w.-]*)\s*\}\}/g;function f1(e,t){let r=new Set;return{text:e.replace(f0,(e,n)=>Object.prototype.hasOwnProperty.call(t,n)?t[n]:(r.add(n),e)),missing:[...r]}}function f2(e,t){let r=new Set,n=e=>{if("string"==typeof e){let n=f1(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 f6(){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 f4(e){let t=f6();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 f5(){return{accessKeyId:"",secretAccessKey:"",sessionToken:"",region:"us-east-1",service:"execute-api"}}function f9(e){let t=f5();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 f3(){return{algorithm:"HS256",secret:"",privateKey:"",payload:'{\n "sub": "load-test-user"\n}',lifetimeSec:3600,kid:"",headerName:"Authorization",prefix:"Bearer"}}function f8(e){let t=f3();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 f7(){return{consumerKey:"",consumerSecret:"",token:"",tokenSecret:"",signatureMethod:"HMAC-SHA256",realm:"",addTo:"header"}}function pe(e){let t=f7();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"}}function pt(){return{auth:{authMode:"inherit",oauth:f6(),oauth1:f7(),aws:f5(),jwt:f3(),domain:"",token:"",username:"",password:"",apiName:"X-API-Key",apiValue:"",apiIn:"header"},headers:[],variables:[],preScript:"",postScript:""}}function pr(e){return"inherit"===e.auth.authMode&&!e.headers.some(e=>e.key.trim())&&0===e.variables.length&&!e.preScript.trim()&&!e.postScript.trim()}function pn(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(["MAX_FOLDER_DEPTH",0,6,"awsFromUnknown",0,f9,"defaultAws",0,f5,"defaultJwt",0,f3,"defaultOAuth",0,f6,"defaultOAuth1",0,f7,"emptyFolderSettings",0,pt,"findVariables",0,function(e){let t=new Set;for(let r of e.matchAll(f0))t.add(r[1]);return[...t]},"folderChain",0,function(e){let t=e?e.split("/"):[];return t.map((e,r)=>t.slice(0,r+1).join("/"))},"folderName",0,function(e){return e.split("/").at(-1)??""},"folderPath",0,pn,"inFolder",0,function(e,t){return""===t||e===t||e.startsWith(`${t}/`)},"isEmptyFolder",0,pr,"jwtFromUnknown",0,f8,"oauth1FromUnknown",0,pe,"oauthFromUnknown",0,f4,"parentFolder",0,function(e){return e.split("/").slice(0,-1).join("/")},"substitute",0,f1,"substituteDeep",0,f2,"variablesOf",0,function(e){let t={};for(let r of e?.variables??[])r.key.trim()&&(t[r.key.trim()]=r.value);return t}],78451);let pi=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],pa=["smoke","average","stress","spike","soak","custom"],ps={preset:"smoke",...u1.smoke};function po(){return{method:"GET",url:"",baseUrl:"",endpoint:"",params:[],headers:[],bodyMode:"none",graphqlQuery:"",graphqlVariables:"",graphqlOperation:"",graphqlErrorsFail:!0,bodyText:"",authMode:"inherit",oauth:f6(),oauth1:f7(),aws:f5(),jwt:f3(),domain:"",token:"",username:"",password:"",apiName:"X-API-Key",apiValue:"",apiIn:"header",timeout:"60s",maxRedirects:5,connectionReuse:!0,useCookies:!0,tlsSkip:!0,checks:[],before:null,testData:null,saveValues:[],preScript:"",postScript:"",mock:null}}function pl(e){return Array.isArray(e)?e.map(e=>({key:"string"==typeof e?.key?e.key:"",value:"string"==typeof e?.value?e.value:""})).filter(e=>e.key||e.value):[]}let pu=(e,t)=>"string"==typeof e?e:t,pc=(e,t)=>"number"==typeof e&&Number.isFinite(e)?e:t;function pd(e,t){if(!t.trim())return{...e,url:"",baseUrl:"",endpoint:"",params:[]};let r=fK(t);return r.valid?{...e,url:t,baseUrl:r.baseUrl,endpoint:r.endpoint,params:r.params}:{...e,url:t}}function pf(e){return"GET"!==e&&"HEAD"!==e}function pp(e){return[...u6({setup:e.before,data:e.testData}),...uA(e.preScript??"")]}function pm(e){let t=fK(e.url),r=t.valid?t:fW({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=fW({baseUrl:r.baseUrl,endpoint:r.endpoint,params:[]}),i={mode:"none"};if("bearer"===e.authMode){let t=uY(e.token);if(!t)throw Error("Bearer auth is on but the token is empty");i={mode:"bearer",token:t}}else if("basic"===e.authMode){if(!e.username)throw Error("Basic auth needs a username");i={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");i={mode:"api_key",name:e.apiName.trim(),value:e.apiValue,in:e.apiIn}}else if("oauth2"===e.authMode)i={mode:"oauth2",oauth:py(e.oauth)};else if("digest"===e.authMode){if(!e.username)throw Error("Digest auth needs a username");i={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];i={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)");i={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");i={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" }')}i={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 a={mode:"none"};if(pf(e.method)&&"json"===e.bodyMode)try{a={mode:"json",json:e.bodyText.trim()?JSON.parse(e.bodyText):{}}}catch(n){let t=pp(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(pf(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`)}a={mode:"json",json:{query:e.graphqlQuery,variables:t,...e.graphqlOperation.trim()?{operationName:e.graphqlOperation.trim()}:{}}}}else pf(e.method)&&"text"===e.bodyMode&&(a={mode:"text",text:e.bodyText});return{request:{method:e.method,url:n,query:r.params.filter(e=>e.key.trim()),headers:e.headers.filter(e=>e.key.trim()),body:a,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}),...pf(e.method)&&"graphql"===e.bodyMode&&e.graphqlErrorsFail?[{type:"json",path:"errors",op:"not_exists",value:""}]:[]]},auth:i,options:{timeout:e.timeout,maxRedirects:e.maxRedirects,httpVersion:"1.1",tlsSkipVerify:e.tlsSkip,connectionReuse:e.connectionReuse,cookies:e.useCookies}}}let ph=["url","baseUrl","endpoint","params","headers","bodyText","graphqlQuery","graphqlVariables","token","username","password","apiName","apiValue","oauth","oauth1","aws","jwt","domain"],pg=/^\d+(\.\d+)?(ms|s|m|h)$/;function pv(e,t=!0){return pg.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 py(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(["DEFAULT_LOAD",0,ps,"METHODS",0,pi,"applyFolders",0,function(e,t){let r=e,n=null;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,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(e=>e.key.trim()).map(e=>e.key.trim().toLowerCase())),a=new Map;for(let e of t)for(let t of e.settings.headers)t.key.trim()&&a.set(t.key.trim().toLowerCase(),{key:t.key.trim(),value:t.value});let s=[...a.entries()].filter(([e])=>!i.has(e)).map(([,e])=>e);s.length&&(r={...r,headers:[...s,...r.headers]});let o=t.filter(e=>e.settings.preScript.trim()||e.settings.postScript.trim()).map(e=>e.path),l=(e,r)=>{let n=t.filter(e=>r(e.settings).trim()).map(e=>`// From the folder “${e.path}”
659
+ {
660
+ ${r(e.settings)}
661
+ }`);return n.length?[...n,...e.trim()?[`// This request's own
662
+ {
663
+ ${e}
664
+ }`]:[]].join("\n\n"):e};r={...r,preScript:l(e.preScript,e=>e.preScript),postScript:l(e.postScript,e=>e.postScript)};let u={};for(let e of t)for(let t of e.settings.variables)u[t.key]=t.value;return{draft:r,vars:u,inherited:{authFrom:n,headers:s.map(e=>e.key),scripts:o}}},"applyPreset",0,function(e,t){return"custom"===t?{...e,preset:t}:{preset:t,mode:"users",rps:e.rps,maxVus:e.maxVus,stages:null,...u1[t]}},"autoRunName",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}`},"buildPayload",0,function(e,t,r,n){let i,a=pm(e);return{name:r.slice(0,120),...a,load:t,targets:n,setup:void 0,data:e.testData&&e.testData.rows.length?e.testData:void 0,save:(i=e.saveValues.filter(e=>e.name.trim()&&e.path.trim()&&uJ.test(e.name.trim()))).length?i.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}},"buildSetup",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=pm({...t,checks:[],before:null,testData:null,saveValues:[],preScript:"",postScript:""});return{label:e.requestName.slice(0,120)||"Run first",...r,extract:e.extract}},"defaultRequestDraft",0,po,"draftCounts",0,function(e){return{params:e.params.filter(e=>e.key.trim()).length,headers:e.headers.filter(e=>e.key.trim()).length,auth:"none"!==e.authMode&&"inherit"!==e.authMode,body:pf(e.method)&&("graphql"===e.bodyMode?e.graphqlQuery.trim().length>0:"none"!==e.bodyMode&&e.bodyText.trim().length>0),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()}},"draftRuntimeNames",0,pp,"durationError",0,pv,"hasBody",0,pf,"isReady",0,function(e){return fK(e.url).valid||!!fW(e)||/\{\{.+\}\}/.test(e.url)},"loadFromUnknown",0,function(e){return e&&"object"==typeof e?{preset:pa.includes(e.preset)?e.preset:"smoke",vus:pc(e.vus,ps.vus),duration:pu(e.duration,ps.duration),rampUp:pu(e.rampUp,ps.rampUp),rampDown:pu(e.rampDown,ps.rampDown),thinkTimeMs:pc(e.thinkTimeMs,ps.thinkTimeMs),thinkJitterMs:pc(e.thinkJitterMs,ps.thinkJitterMs),gracefulStop:pu(e.gracefulStop,ps.gracefulStop),mode:"rate"===e.mode?"rate":"users",rps:pc(e.rps,20),maxVus:pc(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)}:{...ps}},"loadProblem",0,function(e){if(e.stages&&e.stages.length){for(let[t,r]of e.stages.entries()){let n=pv(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)?pv(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 pv(e.duration,!1)??pv(e.rampUp)??pv(e.rampDown)??pv(e.gracefulStop)??null},"oauthWire",0,py,"requestFromUnknown",0,function(e){var t;let r=po();if(!e||"object"!=typeof e)return r;let n="json"===e.bodyMode||"text"===e.bodyMode||"graphql"===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:pi.includes(e.method)?e.method:"GET",url:pu(e.url,""),baseUrl:pu(e.baseUrl,""),endpoint:pu(e.endpoint,""),params:pl(e.params),headers:pl(e.headers),bodyMode:n,bodyText:pu(e.bodyText,""),graphqlQuery:pu(e.graphqlQuery,""),graphqlVariables:pu(e.graphqlVariables,""),graphqlOperation:pu(e.graphqlOperation,""),graphqlErrorsFail:!1!==e.graphqlErrorsFail,authMode:i,oauth:f4(e.oauth),oauth1:pe(e.oauth1),aws:f9(e.aws),jwt:f8(e.jwt),domain:pu(e.domain,""),token:pu(e.token,""),username:pu(e.username,""),password:pu(e.password,""),apiName:pu(e.apiName,r.apiName),apiValue:pu(e.apiValue,""),apiIn:"query"===e.apiIn?"query":"header",timeout:pu(e.timeout,r.timeout),maxRedirects:pc(e.maxRedirects,r.maxRedirects),connectionReuse:!1!==e.connectionReuse,useCookies:!1!==e.useCookies,tlsSkip:!0===e.tlsSkip,checks:Array.isArray(t=e.checks)?t.flatMap(e=>{let t=uO.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=uW.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=uG.safeParse(e);return t.success?t.data:null}(e.testData),saveValues:(Array.isArray(e.saveValues)?e.saveValues:[]).flatMap(e=>{let t=uW.safeParse(e);return t.success?[t.data]:[]}),preScript:pu(e.preScript,"").slice(0,1e5),postScript:pu(e.postScript,"").slice(0,1e5),mock:u4(e.mock)}},"resolveDraft",0,function(e,t,r){let n=Object.fromEntries(ph.map(t=>[t,e[t]])),i=new Set(pp(e)),a={...t};for(let e of i)a[e]=`{{${e}}}`;let{value:s,missing:o}=f2(n,a);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,...s};return l.url!==e.url?pd(l,l.url):l},"targetsFromSlo",0,function(e){if(e)return{p95Ms:e.p95Ms,p99Ms:e.p99Ms||void 0,errorRate:e.errorRate,checksRate:e.checksRate,abortOnFail:!0===e.abortOnFail}},"toLoadConfig",0,function(e){let{preset:t,...r}=e;return u2(r)},"withParts",0,function(e,t){let r={...e,...t},n=fW({baseUrl:r.baseUrl,endpoint:r.endpoint,params:r.params});return{...r,url:n||e.url}},"withPaste",0,function(e,t){let r=function(e){let t,r,n,i,a=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="",i=!1,a=null;for(let e=0;e<t.length;e++){let s=t[e];if("'"===a){"'"===s?a=null:n+=s;continue}if('"'===a){'"'===s?a=null:"\\"===s&&e+1<t.length&&'"\\$`'.includes(t[e+1])?n+=t[++e]:n+=s;continue}if("'"===s||'"'===s){a=s,i=!0;continue}if("\\"===s&&e+1<t.length){n+=t[++e],i=!0;continue}if(/\s/.test(s)){(i||n)&&r.push(n),n="",i=!1;continue}n+=s,i=!0}return(i||n)&&r.push(n),r}(e.trim());if(0===a.length||!/^curl(\.exe)?$/i.test(a[0]))return null;let s=[],o=[],l=!1,u=!1,c=!1;for(let e=1;e<a.length;e++){let i=a[e],d=()=>a[++e]??"",[f,p]=i.startsWith("--")&&i.includes("=")?[i.slice(0,i.indexOf("=")),i.slice(i.indexOf("=")+1)]:[i,void 0],m=()=>p??d();if("-X"===f||"--request"===f)t=m().toUpperCase();else if(/^-X[A-Za-z]+$/.test(i))t=i.slice(2).toUpperCase();else if("-H"===f||"--header"===f){let e=m(),t=e.indexOf(":");t>0&&s.push({key:e.slice(0,t).trim(),value:e.slice(t+1).trim()})}else if(fY.has(f))"--json"===f&&(c=!0),o.push(m());else if("-u"===f||"--user"===f){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"===f||"--insecure"===f?l=!0:"-G"===f||"--get"===f?u=!0:"--url"===f?r=m():fQ.has(f)?m():!i.startsWith("-")&&!r&&/^https?:\/\//i.test(i)&&(r=i)}if(!r||!fK(r).valid)return null;let d=[];for(let e of s){if("authorization"===e.key.toLowerCase()){let[t,...r]=e.value.split(/\s+/),i=r.join(" ");if(/^bearer$/i.test(t??"")&&i){n={mode:"bearer",token:i};continue}if(/^basic$/i.test(t??"")&&i){let e=function(e){try{let t="function"==typeof atob?atob(e):fB.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}}(i);if(e){n=e;continue}}}d.push(e)}let f=o.join("&"),p=d.find(e=>"content-type"===e.key.toLowerCase())?.value??"",m=r;return f&&u?m=`${r}${r.includes("?")?"&":"?"}${f}`:f&&(i={mode:c||p.includes("json")||function(e){let t=e.trim();if(!(t.startsWith("{")||t.startsWith("[")))return!1;try{return JSON.parse(t),!0}catch{return!1}}(f)?"json":"text",text:f}),{method:t&&fX.has(t)?t:i?"POST":"GET",url:m,headers:d,body:i,auth:n,tlsSkip:l}}(t);if(r){let t=pd({...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.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.auth?`${r.auth.mode} auth`:null].filter(Boolean);return{draft:t,note:`Imported curl${n.length?`: ${n.join(", ")}`:""}`}}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=fH(r[2]??"");if(fK(e).valid)return{url:e,method:fG(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=fH(e[0]);if(fK(t).valid)return{url:t,method:fG(r?.[1])??"GET"}}}let n=t.match(/https?:\/\/[^\s'"]+/);if(n){let e=fH(n[0]);if(fK(e).valid)return{url:e}}return null}(t);return n?{draft:pd(n.method?{...e,method:n.method}:e,n.url)}:null},"withUrl",0,pd],5305);let pb=(e,t="")=>"string"==typeof e?e:"number"==typeof e||"boolean"==typeof e?String(e):t,p$=e=>Array.isArray(e)?e:[],px=e=>{let t=pb(e,"GET").toUpperCase();return pi.includes(t)?t:null};function pk(e,t,r,n){let i=[],a=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()),i=/^basic\s+(.+)$/i.exec(t.value.trim()),s="none"===a.authMode||"inherit"===a.authMode;if(e&&s)a={...a,authMode:"bearer",token:e[1]};else if(i&&s)try{let[e,...t]=atob(i[1]).split(":");a={...a,authMode:"basic",username:e??"",password:t.join(":")}}catch{r(`${n}: an Authorization header could not be read; set Auth by hand`)}else s&&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&&i.push({key:e,value:t.value})}return{draft:a,headers:i}}function pw(e,t,r){let n=e[t],i=e=>"boolean"==typeof e||"number"==typeof e?String(e):pb(e);return Array.isArray(n)?i(n.find(e=>e.key===r)?.value):n&&"object"==typeof n?i(n[r]):""}function p_(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:pw(t,"bearer","token")};if("basic"===t.type)return{...e,authMode:"basic",username:pw(t,"basic","username"),password:pw(t,"basic","password")};if("apikey"===t.type)return{...e,authMode:"api_key",apiName:pw(t,"apikey","key")||"X-API-Key",apiValue:pw(t,"apikey","value"),apiIn:"query"===pw(t,"apikey","in")?"query":"header"};if("digest"===t.type)return{...e,authMode:"digest",username:pw(t,t.type,"username"),password:pw(t,t.type,"password")};if("ntlm"===t.type)return{...e,authMode:"ntlm",username:pw(t,t.type,"username"),password:pw(t,t.type,"password"),domain:pw(t,t.type,"domain")};if("awsv4"===t.type)return{...e,authMode:"aws_sigv4",aws:{accessKeyId:pw(t,t.type,"accessKey"),secretAccessKey:pw(t,t.type,"secretKey"),sessionToken:pw(t,t.type,"sessionToken"),region:pw(t,t.type,"region")||"us-east-1",service:pw(t,t.type,"service")||"execute-api"}};if("oauth1"===t.type){let r=pw(t,t.type,"signatureMethod").toUpperCase();return{...e,authMode:"oauth1",oauth1:{consumerKey:pw(t,t.type,"consumerKey"),consumerSecret:pw(t,t.type,"consumerSecret"),token:pw(t,t.type,"token"),tokenSecret:pw(t,t.type,"tokenSecret"),signatureMethod:"HMAC-SHA1"===r||"PLAINTEXT"===r?r:"HMAC-SHA256",realm:pw(t,t.type,"realm"),addTo:"false"===pw(t,t.type,"addParamsToHeader")?"query":"header"}}}if("jwt"===t.type){let r=pw(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:pw(t,t.type,"secret"),privateKey:pw(t,t.type,"privateKey"),payload:pw(t,t.type,"payload")||e.jwt.payload,prefix:pw(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 pS(e,t){return p$(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=>pb(e)).join("\n"):pb(t)}).filter(e=>e.trim()).join("\n")}let pI=new Set(["$guid","$uuid","$randomuuid","$timestamp","$isotimestamp","$randomint","$randomemail","$randomfirstname","$randomlastname","$randomfullname","$randomboolean","$randomalphanumeric"]);function pO(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 pE(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 pA(e,t,r=0,n=new Set){let i=pE(e,t);if(r>6||n.has(i))return null;if("example"in i)return i.example;if(Array.isArray(i.examples)&&i.examples.length)return i.examples[0];if("default"in i)return i.default;if(Array.isArray(i.enum)&&i.enum.length)return i.enum[0];let a=new Set(n).add(i),s=p$(i.allOf);if(s.length)return Object.assign({},...s.map(t=>pA(e,t,r+1,a)).filter(e=>e&&"object"==typeof e));let o=p$(i.oneOf).concat(p$(i.anyOf));if(o.length)return pA(e,o[0],r+1,a);let l=Array.isArray(i.type)?i.type.find(e=>"null"!==e):i.type;if("object"===l||i.properties){let t={};for(let[n,s]of Object.entries(i.properties??{}))t[n]=pA(e,s,r+1,a);return t}if("array"===l)return[pA(e,i.items,r+1,a)];if("integer"===l||"number"===l)return 0;if("boolean"===l)return!1;if("string"===l){let e=pb(i.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 pN(e,t){let r=pb((e.info??{}).title,"Imported API").trim()||"Imported API",n=new Set,i=e=>n.add(e),a=[],s=0,o=new Map,l=(e,t="",r=!1)=>{/^[A-Za-z_][\w.-]*$/.test(e)&&!o.has(e)&&o.set(e,{key:e,value:t,secret:r})},u=function(e,t){if("swagger"===t){let t=pb(e.host);if(!t)return null;let r=p$(e.schemes).includes("https")||!p$(e.schemes).length?"https":pb(p$(e.schemes)[0]);return`${r}://${t}${pb(e.basePath).replace(/\/$/,"")}`}let r=p$(e.servers)[0];if(!r)return null;let n=pb(r.url);for(let[e,t]of Object.entries(r.variables??{}))n=n.replace(`{${e}}`,pb(t.default));return n.replace(/\/$/,"")}(e,t);u&&/^https?:\/\//i.test(u)?l("baseUrl",u):(l("baseUrl","https://api.example.com"),i(u?`The server URL “${u}” is relative — set baseUrl in the “${r}” environment`:`No server URL in the file — set baseUrl in the “${r}” environment`));let c="swagger"===t?e.securityDefinitions:(e.components??{}).securitySchemes,d=(t,r)=>{let n=p$(t)[0],a=n?Object.keys(n)[0]:void 0,s=a?pE(e,c?.[a]):void 0;if(!s)return r;let o=pb(s.type),u=pb(s.scheme).toLowerCase();return"http"===o&&"bearer"===u||"oauth2"===o||"openIdConnect"===o?(l("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"===u||"basic"===o?(l("username"),l("password","",!0),{...r,authMode:"basic",username:"{{username}}",password:"{{password}}"}):"apiKey"===o?"cookie"===s.in?(i("Cookie API keys are not supported; set Auth by hand"),r):(l("apiKey","",!0),{...r,authMode:"api_key",apiName:pb(s.name,"X-API-Key"),apiValue:"{{apiKey}}",apiIn:"query"===s.in?"query":"header"}):r};for(let[n,o]of Object.entries(e.paths??{})){let u=pE(e,o),c=p$(u.parameters);for(let[o,f]of Object.entries(u)){let u,p,m=px(o);if(!m||"parameters"===o||"object"!=typeof f)continue;if(a.length>=2e3){i("Only the first 2000 operations were imported");break}let h=pb(p$(f.tags)[0]),g=pb(f.summary).trim()||pb(f.operationId).trim()||`${m} ${n}`,v=h?`${h} › ${g}`:g,y=[...c,...p$(f.parameters)].map(t=>pE(e,t)),b=n.replace(/\{([^}]+)\}/g,(t,r)=>{let n=r.replace(/[^\w.-]/g,"_"),i=y.find(e=>"path"===e.in&&e.name===r);return l(n,pb(i?.example??pE(e,i?.schema).example??"")),`{{${n}}}`}),$=y.filter(e=>"query"===e.in&&(e.required||"example"in e)).map(t=>({key:pb(t.name),value:pb(t.example??pA(e,t.schema)??"")})),x=pd({...po(),method:m},`{{baseUrl}}${b}`);x={...x,url:`{{baseUrl}}${b}${$.length?`?${$.map(e=>`${e.key}=${e.value}`).join("&")}`:""}`,params:$};let k=pk(y.filter(e=>"header"===e.in).map(e=>({key:pb(e.name),value:pb(e.example??"")})),x=d(f.security??e.security,x),i,v);x={...k.draft,headers:k.headers};let w=!0;if("openapi"===t&&f.requestBody){let t=pE(e,f.requestBody).content??{},r=Object.keys(t).find(e=>/json/i.test(e))??Object.keys(t)[0];if(r){let e=t[r];w=/json/i.test(r),u=e.schema,p=e.example??Object.values(e.examples??{})[0]?.value,!/json/i.test(r)&&(/x-www-form-urlencoded/i.test(r)&&!x.headers.some(e=>/^content-type$/i.test(e.key))?x={...x,headers:[...x.headers,{key:"Content-Type",value:r}]}:/multipart/i.test(r)&&i(`${v}: multipart bodies are not supported yet; the body was left out`))}}else if("swagger"===t){let e=y.find(e=>"body"===e.in);e&&(u=e.schema)}if((u||void 0!==p)&&"GET"!==m&&"HEAD"!==m){let t=p??pA(e,u);x=w?{...x,bodyMode:"json",bodyText:JSON.stringify(t??{},null,2)}:{...x,bodyMode:"text",bodyText:"object"==typeof t&&t?new URLSearchParams(Object.entries(t).map(([e,t])=>[e,pb(t)])).toString():pb(t)}}let _=Object.keys(f.responses??{}).find(e=>/^2\d\d$/.test(e)),S=[{type:"status",expect:_??"2xx"}],I=null;if(_){let r=pE(e,(f.responses??{})[_]),n=r.content??{},i=Object.keys(n).find(e=>/json/i.test(e)),a="swagger"===t?r.schema:i?n[i].schema:void 0,o=function(e,t,r){if(!t||"object"!=typeof t)return null;let n=new Map,i=(t,r)=>{if(!(r>60)&&t&&"object"==typeof t){if(Array.isArray(t))return t.forEach(e=>i(e,r+1));if("string"==typeof t.$ref&&t.$ref.startsWith("#/")&&!n.has(t.$ref)){let a=pE(e,{$ref:t.$ref});n.set(t.$ref,a),i(a,r+1)}for(let[e,n]of Object.entries(t))"$ref"!==e&&"example"!==e&&"examples"!==e&&i(n,r+1)}};i(t,0);let a=pE(e,t);if(!["type","properties","items","allOf","anyOf","oneOf","enum","required"].some(e=>e in a)||n.size>200)return null;let s={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=s;for(let e of r.slice(0,-1))n=n[e]??={};n[r[r.length-1]]=t}let o=JSON.stringify(s);return o.length<=2e5?o:null}(e,a,`${g} (${_})`);o&&(S.push({type:"schema",schema:o}),s++);let l=i?n[i]:void 0,u="swagger"===t?(r.examples??{})["application/json"]:l?.example??Object.values(l?.examples??{})[0]?.value,c=void 0!==u?u:a?pA(e,a):void 0;void 0!==c?I={status:Number(_),headers:[["Content-Type","application/json"]],body:JSON.stringify(c,null,2),delayMs:0}:"204"!==_&&Object.keys(n).length||(I={status:Number(_),headers:[],body:"",delayMs:0})}a.push({collection:r,name:v,request:{...x,checks:S,mock:I}})}}return a.length||i("The file has no operations under “paths”"),s&&i(`${s} request${1===s?" 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`),{kind:t,title:r,requests:a,environments:[{name:r,variables:[...o.values()]}],warnings:[...n]}}let pU=/\.(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,pz=/^(:|host$|content-length$|connection$|accept-encoding$|accept-language$|user-agent$|origin$|referer$|priority$|upgrade-insecure-requests$|cache-control$|pragma$|dnt$|sec-|te$)/i;function pT(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 pP(e,t=""){if(!e||"object"!=typeof e||Array.isArray(e))return[];let r=[];for(let[n,i]of Object.entries(e)){let e=t?`${t}.${n}`:n;i&&"object"==typeof i&&!Array.isArray(i)?r.push(...pP(i,e)):/^[A-Za-z_][\w.-]*$/.test(e)&&r.push({key:e,value:"string"==typeof i?i:JSON.stringify(i),secret:!1})}return r}function pM(e,t,r,n,i){if(!t||!t.type||"none"===t.type||t.disabled)return t?.type==="none"?{...e,authMode:"none"}:e;let a=e=>i(pb(t[e]));switch(t.type){case"bearer":return{...e,authMode:"bearer",token:a("token")};case"basic":return{...e,authMode:"basic",username:a("username"),password:a("password")};case"digest":return{...e,authMode:"digest",username:a("username"),password:a("password")};case"ntlm":return{...e,authMode:"ntlm",username:a("username"),password:a("password")};case"apikey":return{...e,authMode:"api_key",apiName:a("key")||"X-API-Key",apiValue:a("value"),apiIn:"queryParams"===pb(t.addTo)?"query":"header"};case"iam":return{...e,authMode:"aws_sigv4",aws:{accessKeyId:a("accessKeyId"),secretAccessKey:a("secretAccessKey"),sessionToken:a("sessionToken"),region:a("region")||"us-east-1",service:a("service")||"execute-api"}};case"oauth1":{let i=pb(t.signatureMethod).toUpperCase();return i.startsWith("RSA")&&r(`${n}: OAuth 1.0 with ${i} isn't supported; set the signature method by hand`),{...e,authMode:"oauth1",oauth1:{consumerKey:a("consumerKey"),consumerSecret:a("consumerSecret"),token:a("tokenKey"),tokenSecret:a("tokenSecret"),signatureMethod:"HMAC-SHA1"===i||"PLAINTEXT"===i?i:"HMAC-SHA256",realm:a("realm"),addTo:"header"}}}case"oauth2":{let i=pb(t.grantType);return"implicit"===i&&r(`${n}: the OAuth 2.0 implicit grant is outdated and not supported — it was set to client credentials`),{...e,authMode:"oauth2",oauth:{...f6(),grant:"password"===i||"authorization_code"===i?i:"client_credentials",tokenUrl:a("accessTokenUrl"),authUrl:a("authorizationUrl"),clientId:a("clientId"),clientSecret:a("clientSecret"),scope:a("scope"),username:a("username"),password:a("password"),redirectUri:a("redirectUrl")||f6().redirectUri,pkce:!1!==t.usePkce}}}default:return r(`${n}: ${t.type} auth is not supported yet; set Auth by hand`),e}}e.s(["importFile",0,function(e,t=""){var r,n;let i=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 fF(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(!i||"object"!=typeof i)throw Error("This file is empty or not JSON/YAML");let a=i.info;if("string"==typeof a?.schema&&/collection\/v2/.test(a.schema)||Array.isArray(i.item)&&a){let e,t,n,a,s,o,l,u,c,d;return e=pb(((r=i).info??{}).name,"Imported collection").trim()||"Imported collection",t=[],n=new Set,a=e=>n.add(e),s=new Set,o=[],l=t=>pn([e,...t].map(e=>e.replace(/[\\/]/g," ")).join("/")),u=0,c=(e,t,r,n,i)=>{let s=pt(),c=pS(i,"prerequest").slice(0,1e5),d=pS(i,"test").slice(0,1e5);if((c||d)&&(s={...s,preScript:c,postScript:d},u++),t?.type&&"inherit"!==t.type){let e=p_({...po(),authMode:"inherit"},t,a,n);s={...s,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 f=p$(r).map(e=>e).filter(e=>pb(e.key).trim()&&!e.disabled).map(e=>({key:pb(e.key).trim(),value:pb(e.value),secret:"secret"===e.type}));f.length&&(s={...s,variables:pO(f)}),pr(s)||o.push({path:l(e),settings:s})},d=(e,r)=>{for(let n of e){if(Array.isArray(n.item)){let e=[...r,pb(n.name,"Folder")];e.length>=6&&a(`${e.join(" › ")}: folders deeper than 6 levels were put in the folder above`),c(e,n.auth,n.variable,e.join(" › "),n),d(n.item,e);continue}if(t.length>=2e3)return void a("Only the first 2000 requests were imported");let e=pb(n.name,"Request"),i=[...r,e].join(" › "),o="string"==typeof n.request?{url:n.request}:n.request??{},f=px(o.method);if(!f){a(`${i}: ${pb(o.method)} requests are not supported; skipped`);continue}let p=function(e){if("string"==typeof e)return e;let t=e??{};if("string"==typeof t.raw)return t.raw;let r=pb(t.protocol),n=Array.isArray(t.host)?t.host.map(e=>pb(e)).join("."):pb(t.host),i=Array.isArray(t.path)?t.path.map(e=>pb(e)).join("/"):pb(t.path),a=p$(t.query).filter(e=>!e.disabled).map(e=>`${pb(e.key)}=${pb(e.value)}`).join("&");return`${r?`${r}://`:""}${n}${i?`/${i}`:""}${a?`?${a}`:""}`}(o.url);for(let e of JSON.stringify(o).matchAll(/\{\{\s*(\$[A-Za-z]+)/g))pI.has(e[1].toLowerCase())||s.add(e[1]);let m=pd({...po(),method:f},p);!m.baseUrl&&p&&(m={...m,url:p}),m=p_({...m,authMode:"inherit"},o.auth,a,i);let h=pk(p$(o.header).filter(e=>!e.disabled).map(e=>({key:pb(e.key),value:pb(e.value)})),m,a,i);h=function(e,t,r,n,i){if(!t||t.disabled)return{draft:e,headers:r};let a=r.some(e=>/^content-type$/i.test(e.key));switch(t.mode){case"raw":{let n=pb(t.raw),i="json"===pb(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:i?"json":"text",bodyText:n},headers:r}}case"urlencoded":{let n=p$(t.urlencoded).filter(e=>!e.disabled).map(e=>`${encodeURIComponent(pb(e.key))}=${encodeURIComponent(pb(e.value))}`).join("&");return{draft:{...e,bodyMode:"text",bodyText:n},headers:a?r:[...r,{key:"Content-Type",value:"application/x-www-form-urlencoded"}]}}case"graphql":{let n=t.graphql??{},i="string"==typeof n.variables?n.variables:n.variables?JSON.stringify(n.variables,null,2):"";return{draft:{...e,bodyMode:"graphql",graphqlQuery:pb(n.query),graphqlVariables:i},headers:r.filter(e=>!/^content-type$/i.test(e.key))}}case"formdata":return n(`${i}: multipart form-data bodies are not supported yet; the body was left out`),{draft:e,headers:r};case"file":return n(`${i}: file bodies are not supported; the body was left out`),{draft:e,headers:r};default:return{draft:e,headers:r}}}(h.draft,o.body,h.headers,a,i);let g=pS(n,"prerequest").slice(0,1e5),v=pS(n,"test").slice(0,1e5);(g||v)&&u++,t.push({collection:l(r),name:e,request:{...h.draft,headers:h.headers,preScript:g,postScript:v}})}},c([],r.auth,r.variable,e,r),d(p$(r.item),[]),u&&a(`Pre-request or test scripts came along on ${u} request${1===u?"":"s"} or folder${1===u?"":"s"} — they run as in Postman (Scripts tab, and Folder settings → Scripts)`),s.size&&a(`Postman dynamic values the app doesn't make: ${[...s].slice(0,8).map(e=>`{{${e}}}`).join(", ")} — they are sent as written`),{kind:"postman",title:e,requests:t,folders:o,environments:[],warnings:[...n]}}if(Array.isArray(i.values)&&("environment"===i._postman_variable_scope||"string"==typeof i.name)){let e;return{kind:"postman-environment",title:e=pb((n=i).name,"Imported environment").trim()||"Imported environment",requests:[],environments:[{name:e,variables:pO(p$(n.values).map(e=>e).filter(e=>pb(e.key).trim()&&!1!==e.enabled).map(e=>({key:pb(e.key).trim(),value:pb(e.value),secret:"secret"===e.type})))}],warnings:[]}}if(i.log&&"object"==typeof i.log&&Array.isArray(i.log.entries))return function(e,t){let r=e.log,n=t.replace(/\.har$/i,"").replace(/[_-]+/g," ").trim()||"Browser recording",i=[],a=new Set,s=e=>a.add(e),o=new Set,l=0,u=0;for(let e of p$(r.entries)){var c;let t=e.request??{},r=pb(t.url);if(!/^https?:\/\//i.test(r))continue;let a=px(t.method);if(!a||"OPTIONS"===a)continue;let d=pb(e._resourceType),f=pb(e.response?.content?.mimeType);if(d&&!["xhr","fetch","document",""].includes(d)||pU.test(r)||pj.test(f)){l++;continue}let p=`${a} ${r}`;if(o.has(p))continue;if(o.add(p),i.length>=2e3){s("Only the first 2000 requests were imported");break}let m=new URL(r),h=`${a} ${m.pathname}`,g=pd({...po(),method:a},r),v=p$(t.headers).map(e=>({key:pb(e.name),value:pb(e.value)})).filter(e=>e.key&&!pz.test(e.key));v.some(e=>/^cookie$/i.test(e.key))&&u++;let y=pk(v.filter(e=>!/^cookie$/i.test(e.key)),g,s,h);g=y.draft;let b=t.postData;if(b&&("POST"===(c=a)||"PUT"===c||"PATCH"===c||"DELETE"===c)){let e=pb(b.mimeType),t=pb(b.text);/json/i.test(e)?g={...g,bodyMode:"json",bodyText:t}:/multipart\/form-data/i.test(e)?s(`${h}: multipart form-data bodies are not supported yet; the body was left out`):t&&(g={...g,bodyMode:"text",bodyText:t}),!e||y.headers.some(e=>/^content-type$/i.test(e.key))||/multipart/i.test(e)||(y={...y,headers:[...y.headers,{key:"Content-Type",value:e.split(";")[0]}]})}i.push({collection:pn(`${n}/${m.host.replace(/:/g," ")}`),name:h.slice(0,120),request:{...g,headers:y.headers}})}if(!i.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&&s(`${l} page files (images, scripts, styles, fonts) were left out — only API calls are imported`),u&&s(`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:i,environments:[],warnings:[...a]}}(i,t);if("export"===i._type&&Array.isArray(i.resources)||"string"==typeof i.type&&i.type.startsWith("collection.insomnia.rest/"))return function(e){let t=new Set,r=e=>t.add(e),n=e=>pT(e,r,"Some values"),i="Insomnia collection",a=[],s=[];if("export"===e._type){let t=p$(e.resources).map(e=>e),r=t.find(e=>"workspace"===e._type);i=pb(r?.name,i)||i;let n=new Map;for(let e of t)"request_group"===e._type&&n.set(pb(e._id),{kind:"folder",name:pb(e.name,"Folder"),raw:e,children:[]}),"request"===e._type&&n.set(pb(e._id),{kind:"request",name:pb(e.name,"Request"),raw:e,children:[]});for(let e of t){let t=n.get(pb(e._id));if(!t)continue;let r=n.get(pb(e.parentId));r?r.children.push(t):a.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=pP(o?.data);if(l.length)for(let e of l)s.push({name:pb(e.name,"Environment"),variables:pO([...u,...pP(e.data)])});else u.length&&s.push({name:`${i} (base)`,variables:u})}else{i=pb(e.name,i)||i;let t=e=>e.map(e=>Array.isArray(e.children)?{kind:"folder",name:pb(e.name,"Folder"),raw:e,children:t(e.children)}:{kind:"request",name:pb(e.name,"Request"),raw:e,children:[]});a=t(p$(e.collection));let r=e.environments;if(r){let e=pP(r.data),t=p$(r.subEnvironments).map(e=>e);if(t.length)for(let r of t)s.push({name:pb(r.name,"Environment"),variables:pO([...e,...pP(r.data)])});else e.length&&s.push({name:`${i} (base)`,variables:e})}}let o=[],l=[],u=pn(i),c=(e,t)=>{for(let i of e){if("folder"===i.kind){let e=[...t,i.name],a=pt();a={...a,auth:pM(a.auth,i.raw.authentication,r,e.join(" › "),n)};let s=pP(i.raw.environment);s.length&&(a={...a,variables:s}),pr(a)||l.push({path:pn(`${u}/${e.map(e=>e.replace(/[\\/]/g," ")).join("/")}`),settings:a}),c(i.children,e);continue}if(o.length>=2e3)return void r("Only the first 2000 requests were imported");let e=i.raw,a=[...t,i.name].join(" › "),s=px(e.method);if(!s){r(`${a}: ${pb(e.method)} requests are not supported; skipped`);continue}let d=pd({...po(),method:s},pT(pb(e.url),r,a)),f=p$(e.parameters).filter(e=>!e.disabled).map(e=>({key:pb(e.name),value:n(pb(e.value))})).filter(e=>e.key);f.length&&(d={...d,params:[...d.params,...f]}),d=pM(d,e.authentication,r,a,n);let p=pk(p$(e.headers).filter(e=>!e.disabled).map(e=>({key:pb(e.name),value:n(pb(e.value))})),d,r,a);d=p.draft;let m=e.body??{},h=pb(m.mimeType);if("application/graphql"===h)try{let e=JSON.parse(pb(m.text,"{}"));d={...d,bodyMode:"graphql",graphqlQuery:n(pb(e.query)),graphqlVariables:e.variables?JSON.stringify(e.variables,null,2):""}}catch{r(`${a}: the GraphQL body could not be read`)}else if(/json/i.test(h))d={...d,bodyMode:"json",bodyText:n(pb(m.text))};else if("application/x-www-form-urlencoded"===h){let e=p$(m.params).filter(e=>!e.disabled).map(e=>`${encodeURIComponent(pb(e.name))}=${encodeURIComponent(n(pb(e.value)))}`).join("&");d={...d,bodyMode:"text",bodyText:e}}else"multipart/form-data"===h?r(`${a}: multipart form-data bodies are not supported yet; the body was left out`):pb(m.text)&&(d={...d,bodyMode:"text",bodyText:n(pb(m.text))});let g=!h||/graphql|multipart/.test(h)||p.headers.some(e=>/^content-type$/i.test(e.key))?p.headers:[...p.headers,{key:"Content-Type",value:h}];o.push({collection:pn(`${u}/${t.map(e=>e.replace(/[\\/]/g," ")).join("/")}`),name:i.name.slice(0,120),request:{...d,headers:"graphql"===d.bodyMode?p.headers:g}})}};if(c(a,[]),!o.length)throw Error("No requests found in this Insomnia file");return{kind:"insomnia",title:i,requests:o,folders:l,environments:s,warnings:[...t]}}(i);if("string"==typeof i.openapi&&i.openapi.startsWith("3"))return pN(i,"openapi");if("2.0"===i.swagger)return pN(i,"swagger");if("string"==typeof i.openapi)throw Error(`OpenAPI ${i.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, or an OpenAPI/Swagger file")}],90372);let pD=[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 pZ(e){let t=pD[e]??1/0,r=0===e?0:pD[e-1],n=e=>e>=1e3?`${e/1e3}s`:`${e}ms`;return t===1/0?`> ${n(r)}`:`${n(r)}–${n(t)}`}function pC(e){let t=Array(pD.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 pL(e,t){let r=0,n=0,i=0;for(let a=0;a<e.length;a++){let s=e[a]??0;r+=s;let o=pD[a]??1/0;o<=t?n+=s:o<=4*t&&(i+=s)}return r?(n+i/2)/r:null}function pR(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(["LATENCY_BIN_EDGES_MS",0,pD,"apdexFromHistogram",0,pL,"latencyBinLabel",0,pZ,"sumHistograms",0,pC],47253);let pq=new Set(["429","403"]);function pF(e){let t=e.summary,r=t.http.failed.rate,n=Object.entries(t.http.status).filter(([e])=>"0"===e||Number(e)>=400),i=n.reduce((e,[,t])=>e+t,0),a=[...n].sort((e,t)=>t[1]-e[1])[0],s=a&&i?{code:a[0],count:a[1],share:a[1]/i,meaning:pR(a[0])}:null,o=n.filter(([e])=>pq.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,d=c?{elapsedS:c.elapsedS,vus:Math.round(c.vus),rps:Math.round(c.rps)}:null,f=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));f=e.reduce((e,t)=>e+t.failedRate,0)/e.length<.1}}let p=c?l.slice(0,u).filter(e=>e.rps>0&&e.failedRate<.5):[],m=p.length?{vus:Math.round(Math.max(...p.map(e=>e.vus))),rps:Math.round(Math.max(...p.map(e=>e.rps)))}:null,h=null;if(t.latencyOkMs&&t.latencyOkMs.p95>0)h=t.latencyOkMs.p95;else{let e=pC((c?p:l.filter(e=>e.failedRate<.5)).map(e=>e.hist));h=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=pD[n];return Number.isFinite(e)?e:pD[pD.length-2]}return null}(e):null}return{failedRate:r,dominant:s,blocked:i>0&&o/i>=.5,timingsUnreliable:r>=.5,onset:d,recovered:f,lastHealthy:m,healthyP95Ms:h}}e.s(["BLOCKING_CODES",0,pq,"failureStory",0,pF,"repairSummary",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,i=e.summary.http.rps.avg||r.reduce((e,t)=>e+t,0)/e.buckets.length,a=e.buckets.filter(e=>e.vus>0);return{rps:{min:n(r[0]),max:n(r[r.length-1]),avg:n(i),p95:n(r[Math.min(r.length-1,Math.max(0,Math.ceil(.95*r.length)-1))])},vusAvg:a.length?n(a.reduce((e,t)=>e+t.vus,0)/a.length):e.summary.vus.avg}}(e);if(!t)return e;let{rps:r}=e.summary.http,n=r.min===r.max,i=e.summary.vus.avg<t.vusAvg/2;return n||i?{...e,summary:{...e.summary,http:{...e.summary.http,rps:n?t.rps:r},vus:{...e.summary.vus,avg:i?t.vusAvg:e.summary.vus.avg}}}:e},"statusMeaning",0,pR],48191);let pB={errorWarn:.01,errorFail:.05,p95WarnMs:500,p95FailMs:2e3,stabilityWarn:1.5,stabilityFail:2.5};function pJ(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}:{...pB,owned:!1}}function pK(e,t,r){let{buckets:n}=e;if(0===n.length)return 0;let i=Math.floor(n.length*t),a=Math.max(i+1,Math.ceil(n.length*r)),s=n.slice(i,a).map(e=>e.p95Ms).filter(e=>e>0);return 0===s.length?0:s.reduce((e,t)=>e+t,0)/s.length}function pW(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:pK(e,0,.33),lateP95:pK(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])=>pq.has(e)).reduce((e,[,t])=>e+t,0),status503:r["503"]??0,okP95:e.summary.latencyOkMs?.p95||null}}function pV(e,t={}){return pG(pW(e),t)}function pG(e,t={}){var r;let{failedRate:n,p95:i,requests:a,status5xx:s,status0:o}=e,l=pJ(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%",d=Math.round(n*a),f=n>=l.errorFail&&(e.blockedCount??0)>=.5*d&&d>0,p=a>0&&n>=.5,m=e.topFailure,h=m&&d?` Mostly ${"0"===m.code?"no answer":m.code}: ${pR(m.code)}.`:"",g=l.owned?`your target: fail ≥ ${Math.round(l.p95FailMs)} ms`:"default: fail ≥ 2 s",v=l.owned?`your target: warn ≥ ${Math.round(l.p95WarnMs)} ms`:"default: warn ≥ 500 ms",y=0===a?{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}).${h||" Clients would see this as broken."}`}:n>=l.errorWarn?{id:"errors",title:"Errors",level:"warn",summary:`${(100*n).toFixed(1)}% failed (${c}).${h||" 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.`},b=(()=>{if(p){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 i<=0&&0===a?{id:"latency",title:"Latency",level:"fail",summary:"No latency samples. Nothing to judge."}:i>=l.p95FailMs?{id:"latency",title:"Latency",level:"fail",summary:`p95 is ${Math.round(i)} ms (${g}). Most users would feel this as stuck.`}:i>=l.p95WarnMs?{id:"latency",title:"Latency",level:"warn",summary:`p95 is ${Math.round(i)} ms (${v}). OK for a heavy report API; slow for a ping/health check.`}:{id:"latency",title:"Latency",level:"pass",summary:`p95 is ${Math.round(i)} ms. 95% of calls were faster than that under this load.`}})(),$=e.earlyP95,x=e.lateP95,k=$>0?x/$:1,w=x-$>=Math.max(20,.1*l.p95WarnMs),_=p?{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."}:w&&k>=pB.stabilityFail?{id:"stability",title:"Stability",level:"fail",summary:`p95 grew ~${k.toFixed(1)}\xd7 from the first third to the last third. The API (or the generator) degraded as the test went on.`}:w&&k>=pB.stabilityWarn?{id:"stability",title:"Stability",level:"warn",summary:`p95 rose ~${k.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."},S=e.dropped??0,I=f?{id:"capacity",title:"Capacity",level:"fail",summary:`Refused on purpose (${m&&pq.has(m.code)?m.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*d&&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."}:S>0&&S>=Math.max(1,(a+S)*.05)?{id:"capacity",title:"Capacity",level:"fail",summary:`${S.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*a&&a>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."}:s>0&&s/Math.max(a,1)>=.02?{id:"capacity",title:"Capacity",level:"fail",summary:"Server 5xx responses appeared. The API is shedding load or crashing under these VUs."}:S>0?{id:"capacity",title:"Capacity",level:"warn",summary:`${S.toLocaleString("en-US")} requests were dropped because no virtual user was free. The rate you asked for was not fully held.`}:i>=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."},O=e.checksPassed??0,E=e.checksFailed??0,A=O+E,N=t.slo?.checksRate??.99,U=0===A?null:O/A<N?{id:"checks",title:"Checks",level:"fail",summary:`${(O/A*100).toFixed(1)}% of checks passed (needs ${(100*N).toFixed(+(N<1))}%). Responses arrived, but not all of them were correct.`}:E>0?{id:"checks",title:"Checks",level:"warn",summary:`${E.toLocaleString("en-US")} of ${A.toLocaleString("en-US")} checks failed — within your bar, but look at which ones.`}:{id:"checks",title:"Checks",level:"pass",summary:`All ${A.toLocaleString("en-US")} checks passed. Responses were correct, not just fast.`},j=[y,b,_,I,...U?[U]:[]],z=(r=j.map(e=>e.level)).includes("fail")?"fail":r.includes("warn")?"warn":"pass",T=f?"Blocked by a rate limit or firewall at this load — the results show that limit, not the API’s speed.":l.owned?"pass"===z?"Meets your performance targets under this load.":"warn"===z?"Close to your performance targets. Read the checks before you trust it in UAT.":"Misses your performance targets at this load.":"pass"===z?"Looks healthy under this load (built-in defaults — set your own under Goals).":"warn"===z?"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:z,headline:T,aspects:j,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 pH(e,t){try{let r=new URL(t);return`${e.toUpperCase()} ${r.origin}${r.pathname.replace(/\/+$/,"")||"/"}`}catch{return`${e.toUpperCase()} ${t}`}}function pX(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(["buildVerdict",0,pV,"buildVerdictFromInputs",0,pG,"expectedLoadMs",0,function(e){let t=e.definition.load.stages;return t.length>0?t.reduce((e,t)=>e+uQ(t.duration),0):3e4},"formatVerdictEmail",0,function(e,t){let r=pV(e,{slo:t}),n=e=>"pass"===e?"[PASS]":"warn"===e?"[WARN]":"[FAIL]",i=e.summary.http.rps.avg,a=i>=100?String(Math.round(i)):i>=10?i.toFixed(1):i.toFixed(2),s=["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 ${a}`,"","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:s.join("\n")}},"verdictBars",0,pJ,"verdictInputs",0,pW],2385),e.s(["deltaVsBaseline",0,pX,"endpointKey",0,pH],94122);let pY=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),pQ=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`,p0=e=>`${(100*e).toFixed(e>0&&e<.001?3:2)}%`,p1={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"}},p2={"constant-vus":"Steady users","ramping-vus":"Changing users","constant-arrival-rate":"Steady request rate","ramping-arrival-rate":"Changing request rate"};function p6(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 p4(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 p5(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(["buildEmailReport",0,function(e,t={}){let r,n=pV(e,{slo:t.slo??null}),i=p1[n.overall],a=e.summary,s=t.appUrl??"https://apitestcenter.com",o=t.baseline?pX({p95:a.latencyMs.p95,rps:a.http.rps.avg,errorRate:a.http.failed.rate},t.baseline):null;a.checks.reduce((e,t)=>e+t.passes,0),a.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:pQ(a.latencyMs.p95),change:p4(o?.p95??null,!0)},{label:"Requests per second",tech:"throughput",value:(r=a.http.rps.avg)>=100?String(Math.round(r)):r>=10?r.toFixed(1):r.toFixed(2),change:p4(o?.rps??null,!1)},{label:"Failed requests",tech:"error rate",value:p0(a.http.failed.rate),change:p4(o?.errorRate??null,!0)},{label:"Typical response",tech:"median (p50)",value:pQ(a.latencyMs.median)},{label:"Slowest 1%",tech:"p99",value:pQ(a.latencyMs.p99)},{label:l?"Users needed":"Simulated users",tech:"peak VUs",value:String(a.vus.max)}],d=[["Fastest",a.latencyMs.min],["Typical (p50)",a.latencyMs.median],["Most (p90)",a.latencyMs.p90],["95% (p95)",a.latencyMs.p95],["Slowest 1% (p99)",a.latencyMs.p99],["Slowest",a.latencyMs.max]],f=Math.max(...d.map(([,e])=>e),1),p="font-family:Segoe UI,Roboto,Helvetica,Arial,sans-serif",m=(e,t="")=>`<td style="${p};font-size:14px;color:#12151c;${t}">${e}</td>`,h=e=>`<tr><td style="${p};padding:22px 24px 8px;font-size:13px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:#5c6778">${pY(e)}</td></tr>`,g=c.map(e=>`<td width="33%" valign="top" style="${p};padding:6px">
575
665
  <table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:#f4f6f9;border-radius:8px"><tr><td style="${p};padding:12px 14px">
576
- <div style="font-size:13px;color:#5c6778">${pX(e.label)}</div>
577
- <div style="font-size:11px;color:#8b97a8">${pX(e.tech)}</div>
578
- <div style="font-size:22px;font-weight:600;color:#12151c;margin-top:4px;font-family:Consolas,Menlo,monospace">${pX(e.value)}</div>
579
- ${e.change?`<div style="font-size:12px;color:${e.change.ink};margin-top:2px">${pX(e.change.text)} vs reference run</div>`:""}
666
+ <div style="font-size:13px;color:#5c6778">${pY(e.label)}</div>
667
+ <div style="font-size:11px;color:#8b97a8">${pY(e.tech)}</div>
668
+ <div style="font-size:22px;font-weight:600;color:#12151c;margin-top:4px;font-family:Consolas,Menlo,monospace">${pY(e.value)}</div>
669
+ ${e.change?`<div style="font-size:12px;color:${e.change.ink};margin-top:2px">${pY(e.change.text)} vs reference run</div>`:""}
580
670
  </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(""),v=d.map(([e,t])=>{let r=Math.max(1,Math.round(t/f*100));return`<tr>
581
- ${m(pX(e),"padding:3px 10px 3px 0;color:#5c6778;font-size:13px;white-space:nowrap")}
671
+ ${m(pY(e),"padding:3px 10px 3px 0;color:#5c6778;font-size:13px;white-space:nowrap")}
582
672
  <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>
583
- ${m(pX(pY(t)),"padding:3px 0 3px 10px;font-family:Consolas,Menlo,monospace;font-size:13px;white-space:nowrap;text-align:right")}
584
- </tr>`}).join(""),y=a.thresholds.length?a.thresholds.map(e=>`<tr>${m(e.ok?"✓":"✕",`padding:4px 8px 4px 0;color:${e.ok?"#137333":"#c62828"};font-weight:700`)}${m(pX(e.name),"padding:4px 0")}${m(pX(e.actual?`measured ${e.actual}`:""),"padding:4px 0;color:#5c6778;font-size:13px;text-align:right")}</tr>`).join(""):`<tr>${m("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>`,b=a.checks.map(e=>{let t=e.passes+e.fails,r=0===e.fails;return`<tr>${m(r?"✓":"✕",`padding:4px 8px 4px 0;color:${r?"#137333":"#c62828"};font-weight:700`)}${m(pX(e.name),"padding:4px 0;font-family:Consolas,Menlo,monospace;font-size:13px")}${m(`${t?pQ(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(""),$=n.aspects.map(e=>{let t=p0[e.level];return`<tr>${m(t.mark,`padding:5px 8px 5px 0;color:${t.ink};font-weight:700`)}${m(`<b>${pX(e.title)}</b> — ${pX(e.summary)}`,"padding:5px 0;font-size:13px")}</tr>`}).join(""),x=[["Request",`${e.definition.method} ${e.definition.url}`],["Load style",p1[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",p2(e)],["Total requests",a.http.requests.toLocaleString("en-US")],["Sign-in type","none"===e.definition.auth.mode?"none":e.definition.auth.mode]];e.definition.data?.before&&x.push(["Runs first",e.definition.data.before.label]),e.definition.data?.testData&&x.push(["Test data",`${e.definition.data.testData.fileName} \xb7 ${e.definition.data.testData.rows.toLocaleString("en-US")} rows`]);let k=x.map(([e,t])=>`<tr>${m(pX(e),"padding:4px 16px 4px 0;color:#5c6778;font-size:13px;white-space:nowrap;vertical-align:top")}${m(pX(t),"padding:4px 0;font-size:13px;word-break:break-all")}</tr>`).join(""),w=`<!doctype html>
585
- <html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>${pX(e.testName)}</title></head>
673
+ ${m(pY(pQ(t)),"padding:3px 0 3px 10px;font-family:Consolas,Menlo,monospace;font-size:13px;white-space:nowrap;text-align:right")}
674
+ </tr>`}).join(""),y=a.thresholds.length?a.thresholds.map(e=>`<tr>${m(e.ok?"✓":"✕",`padding:4px 8px 4px 0;color:${e.ok?"#137333":"#c62828"};font-weight:700`)}${m(pY(e.name),"padding:4px 0")}${m(pY(e.actual?`measured ${e.actual}`:""),"padding:4px 0;color:#5c6778;font-size:13px;text-align:right")}</tr>`).join(""):`<tr>${m("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>`,b=a.checks.map(e=>{let t=e.passes+e.fails,r=0===e.fails;return`<tr>${m(r?"✓":"✕",`padding:4px 8px 4px 0;color:${r?"#137333":"#c62828"};font-weight:700`)}${m(pY(e.name),"padding:4px 0;font-family:Consolas,Menlo,monospace;font-size:13px")}${m(`${t?p0(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(""),$=n.aspects.map(e=>{let t=p1[e.level];return`<tr>${m(t.mark,`padding:5px 8px 5px 0;color:${t.ink};font-weight:700`)}${m(`<b>${pY(e.title)}</b> — ${pY(e.summary)}`,"padding:5px 0;font-size:13px")}</tr>`}).join(""),x=[["Request",`${e.definition.method} ${e.definition.url}`],["Load style",p2[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",p6(e)],["Total requests",a.http.requests.toLocaleString("en-US")],["Sign-in type","none"===e.definition.auth.mode?"none":e.definition.auth.mode]];e.definition.data?.before&&x.push(["Runs first",e.definition.data.before.label]),e.definition.data?.testData&&x.push(["Test data",`${e.definition.data.testData.fileName} \xb7 ${e.definition.data.testData.rows.toLocaleString("en-US")} rows`]);let k=x.map(([e,t])=>`<tr>${m(pY(e),"padding:4px 16px 4px 0;color:#5c6778;font-size:13px;white-space:nowrap;vertical-align:top")}${m(pY(t),"padding:4px 0;font-size:13px;word-break:break-all")}</tr>`).join(""),w=`<!doctype html>
675
+ <html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>${pY(e.testName)}</title></head>
586
676
  <body style="margin:0;padding:0;background:#f4f6f9">
587
677
  <table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:#f4f6f9"><tr><td align="center" style="padding:24px 12px">
588
678
  <table role="presentation" width="640" cellpadding="0" cellspacing="0" style="max-width:640px;width:100%;background:#ffffff;border:1px solid #d5dce6;border-radius:12px">
589
679
  <tr><td style="${p};padding:20px 24px 4px;font-size:12px;color:#5c6778">APITestCenter \xb7 Load test result</td></tr>
590
- <tr><td style="${p};padding:0 24px;font-size:20px;font-weight:600;color:#12151c">${pX(e.testName)}</td></tr>
591
- <tr><td style="${p};padding:4px 24px 0;font-size:13px;color:#5c6778">${pX(u)} \xb7 ${pX(p2(e))} \xb7 ${pX(e.definition.method)} <span style="font-family:Consolas,Menlo,monospace">${pX(e.definition.url)}</span></td></tr>
680
+ <tr><td style="${p};padding:0 24px;font-size:20px;font-weight:600;color:#12151c">${pY(e.testName)}</td></tr>
681
+ <tr><td style="${p};padding:4px 24px 0;font-size:13px;color:#5c6778">${pY(u)} \xb7 ${pY(p6(e))} \xb7 ${pY(e.definition.method)} <span style="font-family:Consolas,Menlo,monospace">${pY(e.definition.url)}</span></td></tr>
592
682
  <tr><td style="padding:16px 24px 0">
593
683
  <table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:${i.bg};border:1px solid ${i.line};border-radius:10px"><tr>
594
- <td style="${p};padding:14px 16px;font-size:15px;color:${i.ink}"><b style="font-size:13px;letter-spacing:.06em">${i.mark} ${i.word}</b><br><span style="color:#12151c">${pX(n.headline)}</span></td>
684
+ <td style="${p};padding:14px 16px;font-size:15px;color:${i.ink}"><b style="font-size:13px;letter-spacing:.06em">${i.mark} ${i.word}</b><br><span style="color:#12151c">${pY(n.headline)}</span></td>
595
685
  </tr></table>
596
686
  </td></tr>
597
687
  ${h("Key numbers")}
@@ -605,69 +695,69 @@ ${i}`]:e.post}},f=(e,r,n)=>{for(let i of e){if(Array.isArray(i.item)){let e=[...
605
695
  <tr><td style="padding:0 24px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0">${$}</table></td></tr>
606
696
  ${h("Test settings")}
607
697
  <tr><td style="padding:0 24px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0">${k}</table></td></tr>
608
- <tr><td style="${p};padding:22px 24px 6px;font-size:12px;color:#5c6778">${pX(n.disclaimer)}</td></tr>
609
- <tr><td style="${p};padding:0 24px 22px;font-size:12px;color:#5c6778">The full report with charts is attached as an HTML file. Made with <a href="${pX(s)}" style="color:#08705f">APITestCenter</a>. No tokens or passwords are included.</td></tr>
698
+ <tr><td style="${p};padding:22px 24px 6px;font-size:12px;color:#5c6778">${pY(n.disclaimer)}</td></tr>
699
+ <tr><td style="${p};padding:0 24px 22px;font-size:12px;color:#5c6778">The full report with charts is attached as an HTML file. Made with <a href="${pY(s)}" style="color:#08705f">APITestCenter</a>. No tokens or passwords are included.</td></tr>
610
700
  </table>
611
701
  </td></tr></table>
612
- </body></html>`,_=["APITestCenter — load test result",`${e.testName}`,`${u} \xb7 ${p2(e)} \xb7 ${e.definition.method} ${e.definition.url}`,"",`${i.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",...a.thresholds.length?a.thresholds.map(e=>` ${e.ok?"[met] ":"[missed]"} ${e.name}${e.actual?` — measured ${e.actual}`:""}`):[" None set — built-in defaults were used."],...a.checks.length?["","Checks",...a.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=>` [${p0[e.level].word}] ${e.title} — ${e.summary}`),"",n.disclaimer,`Made with APITestCenter — ${s}`].join("\n");return{subject:`Load test ${p0[n.overall].word}: ${e.testName} — ${pY(a.latencyMs.p95)} p95, ${pQ(a.http.failed.rate)} failed`,html:w,text:_}},"buildEml",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?${p4(e).replace(/\r\n/g,"")}?=`,i=["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","",p4(e.text),`--${r}`,"Content-Type: text/html; charset=UTF-8","Content-Transfer-Encoding: base64","",p4(e.html),`--${r}--`];for(let r of e.attachments??[])i.push(`--${t}`,`Content-Type: ${r.type}; charset=UTF-8; name="${n(r.name)}"`,`Content-Disposition: attachment; filename="${n(r.name)}"`,"Content-Transfer-Encoding: base64","",p4(r.content));return i.push(`--${t}--`,""),i.join("\r\n")}],54608);let p5={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 p9(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 p3(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+uY(t.duration),0)}}let p8=e=>`${Math.round(100*Math.abs(e))}%`,p7=e=>e>=1e3?`${(e/1e3).toFixed(2)} s`:`${Math.round(e)} ms`,me=e=>`${(100*e).toFixed(+(e<.1))}%`;function mt(e,t,r={}){let n,i,a=r.minRelative??.05,s=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,i)=>{let[u,c]=p5[e],d={key:e,label:u,tech:c,before:t,after:r};if(null==t||null==r)return{...d,relative:null,absolute:null,direction:"n/a",note:"not measured in both runs"};let f=r-t,p=t>0?r/t-1:r>0?null:0;if("ms"===i&&l)return{...d,relative:p,absolute:f,direction:"n/a",note:"mostly error responses — not the API's speed"};let m="rate"===i?Math.abs(f)<o:Math.abs(p??1)<a||"ms"===i&&Math.abs(f)<s;return{...d,relative:p,absolute:f,direction:m||0===f?"same":f>0===n?"better":"worse"}},c=e.summary,d=t.summary,f=[u("p95",c.latencyMs.p95,d.latencyMs.p95,!1,"ms"),u("p50",c.latencyMs.median,d.latencyMs.median,!1,"ms"),u("p99",c.latencyMs.p99,d.latencyMs.p99,!1,"ms"),u("rps",c.http.rps.avg,d.http.rps.avg,!0,"count"),u("errorRate",c.http.failed.rate,d.http.failed.rate,!1,"rate")],p=p9(e),m=p9(t);(null!=p||null!=m)&&f.push(u("checksRate",p,m,!0,"rate"));let{unfair:h,caveats:g}=function(e,t){let r=[],n=[],i=pG(e.definition.method,e.definition.url),a=pG(t.definition.method,t.definition.url);i!==a&&r.push(`they test different requests (${i} and ${a})`);let s=p3(e),o=p3(t);for(let[i,a]of(s.rate!==o.rate?r.push("one held a request rate and the other used simulated users"):s.peak!==o.peak&&r.push(`the load was different (${s.peak} vs ${o.peak} ${s.rate?"requests per second":"users"} at the peak)`),s.ms&&o.ms&&Math.abs(s.ms-o.ms)/Math.max(s.ms,o.ms)>.25&&n.push("the runs were planned for different lengths"),[[e,"before"],[t,"after"]]))"stopped"===i.endReason&&n.push(`the ${a} run was stopped early`),"target-missed"===i.endReason&&n.push(`the ${a} run stopped early because a goal was missed`);return{unfair:r,caveats:n}}(e,t),v=Object.fromEntries(f.map(e=>[e.key,e])),y=v.p95,b=v.errorRate,$=v.checksRate;if(h.length)n="unfair",i=`Not a fair comparison: ${h.join("; ")}. The numbers are shown, but don't read them as better or worse.`;else if("worse"===b.direction)n="worse",i=`After fails more often: ${me(b.before)} → ${me(b.after)} of requests failed.`;else if($?.direction==="worse")n="worse",i=`After gives more wrong answers: checks passed ${me($.before)} → ${me($.after)}.`;else if("worse"===y.direction)n="worse",i=`After is ${p8(y.relative??0)} slower: 95% of requests within ${p7(y.before)} → ${p7(y.after)}. That is more than normal run-to-run variation.`;else if("better"===y.direction){let e=f.some(e=>"worse"===e.direction);n=e?"mixed":"better",i=`After is ${p8(y.relative??0)} faster: 95% of requests within ${p7(y.before)} → ${p7(y.after)}.${e?" Some other measures got worse — see below.":""}`}else if("better"===b.direction)n="better",i=`After fails less often: ${me(b.before)} → ${me(b.after)} of requests failed. Speed is about the same.`;else if("n/a"===y.direction)n="same",i="Speed can't be compared: most responses in at least one run were errors.";else{let e=f.filter(e=>"worse"===e.direction);n=e.length?"mixed":"same",i=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!h.length&&g.length&&(i+=` Note: ${g.join("; ")}.`),{before:{id:e.id,name:e.testName,startedAt:e.startedAt},after:{id:t.id,name:t.testName,startedAt:t.startedAt},metrics:f,fair:0===h.length,reasons:[...h,...g],level:n,headline:i}}e.s(["compareFairness",0,function(e,t){let r=[],n=e.map((e,n)=>{let i=p3(e),a=Date.parse(e.endedAt)-Date.parse(e.startedAt),s=Number.isFinite(a)&&a>0?a:(e.buckets.at(-1)?.elapsedS??0)*1e3,o=i.rate?i.peak:Math.max(0,...e.buckets.map(e=>e.vus))||i.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:i.rate,peak:o,ms:s,stopped:"stopped"===e.endReason||"target-missed"===e.endReason}});if(n.length<2)return{unfair:null,caveats:r};let i=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=>i>0&&(i-e.ms)/i>.25)))return{unfair:null,caveats:r};let a=[];for(let e of n){let t=(e,t)=>Math.abs(e-t)<=.1*Math.max(e,t),r=a.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):a.push({first:e,names:[e.label]})}let s=[...a].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: ${s.join("; ")}.`,caveats:[]}},"compareRuns",0,mt],55658);let mr=["latency","throughput","status","phase","percentiles","thresholds"],mn=mr.map(e=>({id:e,w:1,h:1}));function mi(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 i=e[n]??0,a=e[r]??0;("lower"===t?i<a:i>a)&&(r=n)}let n=e[r];return null==n||e.filter(e=>e===n).length>1?null:r}(r,t.better)}})}e.s(["CHART_TILE_TITLES",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"},"hasThresholdTiles",0,function(e){return e.summary.thresholds.length>0||e.summary.checks.length>0},"normalizeChartLayout",0,function(e,t){let r=new Set,n=[];if(Array.isArray(e))for(let i of e){if(!mr.includes(i.id))continue;let e=i.id;!r.has(e)&&("thresholds"!==e||t)&&(r.add(e),n.push({id:e,w:2===i.w?2:1,h:2===i.h?2:1}))}for(let e of mn)("thresholds"!==e.id||t)&&(r.has(e.id)||n.push({...e}));return n}],46306),e.s(["compareKpis",0,mi,"compareSeriesLabel",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})`},"overlayBuckets",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()]))],i=n.length?Math.max(...n):0;return Array.from({length:Math.max(t.durationS&&t.durationS>0?Math.ceil(t.durationS):0,i,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(["EXPORT_SCHEMA_VERSION",0,1],81609),e.s(["compareVerdictRows",0,function(e,t){return e.map(e=>{let r=pW(e.report,{slo:t});return{id:e.id,title:e.title,overall:r.overall,headline:r.headline}})},"compareWinnerLabel",0,function(e,t){return null==e.winner?"tie":t[e.winner]??`API ${e.winner+1}`},"exportCompareJson",0,function(e,t,r=new Date().toISOString()){let n=e.map(e=>e.report),i={exportedAt:r,exporter:"ApiTestCenter",version:1,kind:"compare",mode:t,apis:e,kpis:n.length>=2?mi(n):[]};return`${JSON.stringify(i,null,2)}
702
+ </body></html>`,_=["APITestCenter — load test result",`${e.testName}`,`${u} \xb7 ${p6(e)} \xb7 ${e.definition.method} ${e.definition.url}`,"",`${i.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",...a.thresholds.length?a.thresholds.map(e=>` ${e.ok?"[met] ":"[missed]"} ${e.name}${e.actual?` — measured ${e.actual}`:""}`):[" None set — built-in defaults were used."],...a.checks.length?["","Checks",...a.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=>` [${p1[e.level].word}] ${e.title} — ${e.summary}`),"",n.disclaimer,`Made with APITestCenter — ${s}`].join("\n");return{subject:`Load test ${p1[n.overall].word}: ${e.testName} — ${pQ(a.latencyMs.p95)} p95, ${p0(a.http.failed.rate)} failed`,html:w,text:_}},"buildEml",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?${p5(e).replace(/\r\n/g,"")}?=`,i=["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","",p5(e.text),`--${r}`,"Content-Type: text/html; charset=UTF-8","Content-Transfer-Encoding: base64","",p5(e.html),`--${r}--`];for(let r of e.attachments??[])i.push(`--${t}`,`Content-Type: ${r.type}; charset=UTF-8; name="${n(r.name)}"`,`Content-Disposition: attachment; filename="${n(r.name)}"`,"Content-Transfer-Encoding: base64","",p5(r.content));return i.push(`--${t}--`,""),i.join("\r\n")}],54608);let p9={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 p3(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 p8(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+uQ(t.duration),0)}}let p7=e=>`${Math.round(100*Math.abs(e))}%`,me=e=>e>=1e3?`${(e/1e3).toFixed(2)} s`:`${Math.round(e)} ms`,mt=e=>`${(100*e).toFixed(+(e<.1))}%`;function mr(e,t,r={}){let n,i,a=r.minRelative??.05,s=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,i)=>{let[u,c]=p9[e],d={key:e,label:u,tech:c,before:t,after:r};if(null==t||null==r)return{...d,relative:null,absolute:null,direction:"n/a",note:"not measured in both runs"};let f=r-t,p=t>0?r/t-1:r>0?null:0;if("ms"===i&&l)return{...d,relative:p,absolute:f,direction:"n/a",note:"mostly error responses — not the API's speed"};let m="rate"===i?Math.abs(f)<o:Math.abs(p??1)<a||"ms"===i&&Math.abs(f)<s;return{...d,relative:p,absolute:f,direction:m||0===f?"same":f>0===n?"better":"worse"}},c=e.summary,d=t.summary,f=[u("p95",c.latencyMs.p95,d.latencyMs.p95,!1,"ms"),u("p50",c.latencyMs.median,d.latencyMs.median,!1,"ms"),u("p99",c.latencyMs.p99,d.latencyMs.p99,!1,"ms"),u("rps",c.http.rps.avg,d.http.rps.avg,!0,"count"),u("errorRate",c.http.failed.rate,d.http.failed.rate,!1,"rate")],p=p3(e),m=p3(t);(null!=p||null!=m)&&f.push(u("checksRate",p,m,!0,"rate"));let{unfair:h,caveats:g}=function(e,t){let r=[],n=[],i=pH(e.definition.method,e.definition.url),a=pH(t.definition.method,t.definition.url);i!==a&&r.push(`they test different requests (${i} and ${a})`);let s=p8(e),o=p8(t);for(let[i,a]of(s.rate!==o.rate?r.push("one held a request rate and the other used simulated users"):s.peak!==o.peak&&r.push(`the load was different (${s.peak} vs ${o.peak} ${s.rate?"requests per second":"users"} at the peak)`),s.ms&&o.ms&&Math.abs(s.ms-o.ms)/Math.max(s.ms,o.ms)>.25&&n.push("the runs were planned for different lengths"),[[e,"before"],[t,"after"]]))"stopped"===i.endReason&&n.push(`the ${a} run was stopped early`),"target-missed"===i.endReason&&n.push(`the ${a} run stopped early because a goal was missed`);return{unfair:r,caveats:n}}(e,t),v=Object.fromEntries(f.map(e=>[e.key,e])),y=v.p95,b=v.errorRate,$=v.checksRate;if(h.length)n="unfair",i=`Not a fair comparison: ${h.join("; ")}. The numbers are shown, but don't read them as better or worse.`;else if("worse"===b.direction)n="worse",i=`After fails more often: ${mt(b.before)} → ${mt(b.after)} of requests failed.`;else if($?.direction==="worse")n="worse",i=`After gives more wrong answers: checks passed ${mt($.before)} → ${mt($.after)}.`;else if("worse"===y.direction)n="worse",i=`After is ${p7(y.relative??0)} slower: 95% of requests within ${me(y.before)} → ${me(y.after)}. That is more than normal run-to-run variation.`;else if("better"===y.direction){let e=f.some(e=>"worse"===e.direction);n=e?"mixed":"better",i=`After is ${p7(y.relative??0)} faster: 95% of requests within ${me(y.before)} → ${me(y.after)}.${e?" Some other measures got worse — see below.":""}`}else if("better"===b.direction)n="better",i=`After fails less often: ${mt(b.before)} → ${mt(b.after)} of requests failed. Speed is about the same.`;else if("n/a"===y.direction)n="same",i="Speed can't be compared: most responses in at least one run were errors.";else{let e=f.filter(e=>"worse"===e.direction);n=e.length?"mixed":"same",i=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!h.length&&g.length&&(i+=` Note: ${g.join("; ")}.`),{before:{id:e.id,name:e.testName,startedAt:e.startedAt},after:{id:t.id,name:t.testName,startedAt:t.startedAt},metrics:f,fair:0===h.length,reasons:[...h,...g],level:n,headline:i}}e.s(["compareFairness",0,function(e,t){let r=[],n=e.map((e,n)=>{let i=p8(e),a=Date.parse(e.endedAt)-Date.parse(e.startedAt),s=Number.isFinite(a)&&a>0?a:(e.buckets.at(-1)?.elapsedS??0)*1e3,o=i.rate?i.peak:Math.max(0,...e.buckets.map(e=>e.vus))||i.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:i.rate,peak:o,ms:s,stopped:"stopped"===e.endReason||"target-missed"===e.endReason}});if(n.length<2)return{unfair:null,caveats:r};let i=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=>i>0&&(i-e.ms)/i>.25)))return{unfair:null,caveats:r};let a=[];for(let e of n){let t=(e,t)=>Math.abs(e-t)<=.1*Math.max(e,t),r=a.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):a.push({first:e,names:[e.label]})}let s=[...a].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: ${s.join("; ")}.`,caveats:[]}},"compareRuns",0,mr],55658);let mn=["latency","throughput","status","phase","percentiles","thresholds"],mi=mn.map(e=>({id:e,w:1,h:1}));function ma(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 i=e[n]??0,a=e[r]??0;("lower"===t?i<a:i>a)&&(r=n)}let n=e[r];return null==n||e.filter(e=>e===n).length>1?null:r}(r,t.better)}})}e.s(["CHART_TILE_TITLES",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"},"hasThresholdTiles",0,function(e){return e.summary.thresholds.length>0||e.summary.checks.length>0},"normalizeChartLayout",0,function(e,t){let r=new Set,n=[];if(Array.isArray(e))for(let i of e){if(!mn.includes(i.id))continue;let e=i.id;!r.has(e)&&("thresholds"!==e||t)&&(r.add(e),n.push({id:e,w:2===i.w?2:1,h:2===i.h?2:1}))}for(let e of mi)("thresholds"!==e.id||t)&&(r.has(e.id)||n.push({...e}));return n}],46306),e.s(["compareKpis",0,ma,"compareSeriesLabel",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})`},"overlayBuckets",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()]))],i=n.length?Math.max(...n):0;return Array.from({length:Math.max(t.durationS&&t.durationS>0?Math.ceil(t.durationS):0,i,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(["EXPORT_SCHEMA_VERSION",0,1],81609),e.s(["compareVerdictRows",0,function(e,t){return e.map(e=>{let r=pV(e.report,{slo:t});return{id:e.id,title:e.title,overall:r.overall,headline:r.headline}})},"compareWinnerLabel",0,function(e,t){return null==e.winner?"tie":t[e.winner]??`API ${e.winner+1}`},"exportCompareJson",0,function(e,t,r=new Date().toISOString()){let n=e.map(e=>e.report),i={exportedAt:r,exporter:"ApiTestCenter",version:1,kind:"compare",mode:t,apis:e,kpis:n.length>=2?ma(n):[]};return`${JSON.stringify(i,null,2)}
613
703
  `},"exportProbeJson",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)}
614
- `}],88491);let ma="#12151c",ms="#5c6778",mo="#d5dce6",ml="#ffffff",mu="#137333",mc="#975300",md="#c62828",mf={p50:"#86b6ef",p90:"#3987e5",p95:"#256abf",p99:"#104281",p999:"#6250d6",max:"#12151c"},mp="#0ca30c",mm="#fab219",mh="#d03b3b",mg="#898781",mv=["#eef4fc","#c3d9f5","#86b6ef","#3987e5","#256abf","#104281"],my=e=>String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),mb=e=>Number.isFinite(e)?e<10?`${e.toFixed(1)} ms`:e>=1e4?`${(e/1e3).toFixed(1)} s`:`${Math.round(e)} ms`:"—",m$=e=>Number.isFinite(e)?e>=1e3?`${(e/1e3).toFixed(2)}k`:e.toFixed(e>=100?0:1):"—",mx=e=>`${(100*e).toFixed(e<.01?2:1)}%`,mk=e=>new Intl.NumberFormat("en-US").format(Math.round(e)),mw=e=>e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(2)} MB`,m_=e=>e>=60?`${Math.floor(e/60)}m ${e%60?`${e%60}s`:""}`.trim():`${e}s`,mS=e=>Math.max(0,Math.round((Date.parse(e.endedAt)-Date.parse(e.startedAt))/1e3)),mI=e=>"ok"===e?mu:"warn"===e?mc:"bad"===e?md:ma;function mO(e,t,r){let n=e.summary;switch(t){case"throughput":return{text:`${m$(n.http.rps.avg)} rps`,hint:`max ${m$(n.http.rps.max)}`};case"peakRps":return{text:`${m$(n.http.rps.max)} rps`,hint:`average ${m$(n.http.rps.avg)}`};case"p95":{let e=r?.p95Ms??500;if(n.http.failed.rate>=.5)return{text:mb(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:mb(n.latencyMs.p95),hint:`slowest 1% ${mb(n.latencyMs.p99)}`,tone:t}}case"p50":return{text:mb(n.latencyMs.median),hint:"half of requests were faster"};case"avg":return{text:mb(n.latencyMs.mean),hint:`typical spread \xb1${mb(n.latencyMs.stdDev)}`};case"p99":return{text:mb(n.latencyMs.p99),hint:`slowest ${mb(n.latencyMs.max)}`};case"max":return{text:mb(n.latencyMs.max),hint:`fastest ${mb(n.latencyMs.min)}`};case"ttfb":{let e=n.latencyMs.mean>0?Math.min(1,n.phasesMs.ttfb.avg/n.latencyMs.mean):0;return{text:mb(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:mx(e),hint:`${mk(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 i=e/(e+t),a=r?.checksRate??.99;return{text:mx(i),hint:`${mk(t)} failed`,tone:i>=a?"ok":i>=a-.05?"warn":"bad"}}case"vus":return{text:String(n.vus.max),hint:`average ${n.vus.avg.toFixed(1)}`};case"requests":return{text:mk(n.http.requests),hint:`${mk(n.iterations.count)} iterations`};case"dropped":{let e=n.droppedIterations;return null==e?{text:"—",hint:"rate mode only"}:{text:mk(e),tone:e>0?"warn":"ok",hint:"requests that could not start on time"}}case"apdex":{let t=pZ(e.buckets.map(e=>e.hist)),n=t?pC(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:mw(n.data.bytesIn),hint:`sent ${mw(n.data.bytesOut)}`};case"sent":return{text:mw(n.data.bytesOut),hint:`received ${mw(n.data.bytesIn)}`};case"duration":return{text:m_(mS(e)),hint:`${mk(n.http.requests)} requests`}}}let mE=640;function mA(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 mN(e,t,r,n={}){let i=n.h??210;if(!e.length||!t.length)return'<p class="empty">Not recorded for this run.</p>';let a=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),s=mA(Math.max(...a.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)*(mE-52-12),c=e=>i-24-e/s*(i-10-24),d=[0,.25,.5,.75,1].map(e=>s*e).map(e=>`<line x1="52" x2="${mE-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">${my(r(e))}</text>`).join(""),f=Array.from({length:6},(e,t)=>Math.round(o+(l-o)*t/5)).map(e=>`<text x="${u(e).toFixed(1)}" y="${i-6}" class="t" text-anchor="middle">${my(m_(e))}</text>`).join(""),p=a.map((r,i)=>{let s,o,l,d=t[i],f="",p=!1;if(r.forEach((t,r)=>{null!=t&&Number.isFinite(t)?(f+=`${p?"L":"M"}${u(e[r]).toFixed(1)},${c(t).toFixed(1)}`,p=!0):p=!1}),!f)return"";let m=n.area||n.stacked?(s=n.stacked&&i>0?a[i-1]:e.map(()=>0),o=r.map((t,r)=>`${u(e[r]).toFixed(1)},${c(t??0).toFixed(1)}`).join(" L"),l=[...s].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="${d.color}" fill-opacity="${n.stacked?.85:.18}" stroke="none"/>`):"";return`${m}<path d="${f}" fill="none" stroke="${d.color}" stroke-width="2" stroke-linejoin="round"${d.dash?' stroke-dasharray="5 4"':""}/>`}).join(""),m=n.ref?`<line x1="52" x2="${mE-12}" y1="${c(n.ref.value).toFixed(1)}" y2="${c(n.ref.value).toFixed(1)}" stroke="${ms}" stroke-dasharray="6 4"/><text x="${mE-12}" y="${(c(n.ref.value)-4).toFixed(1)}" class="t" text-anchor="end">${my(n.ref.label)}</text>`:"",h=Math.max(1,Math.ceil(e.length/240)),g=(mE-52-12)/Math.max(1,(e.length-1)/h),v=e.map((e,n)=>n%h?"":`<rect x="${(u(e)-g/2).toFixed(1)}" y="10" width="${g.toFixed(1)}" height="${i-10-24}" fill="transparent"><title>${my(m_(e))}
615
- ${t.map(e=>`${e.label}: ${null==e.values[n]?"—":r(e.values[n])}`).join("\n")}</title></rect>`).join(""),y=t.length>1?`<div class="legend">${t.map(e=>`<span><i style="background:${e.color}"></i>${my(e.label)}</span>`).join("")}</div>`:"";return`<svg viewBox="0 0 ${mE} ${i}" role="img" aria-label="${my(t.map(e=>e.label).join(", "))} over time">${d}${f}${m}${p}${v}</svg>${y}`}function mU(e){let t=Math.max(...e.map(e=>e.value),1);return`<table class="bars">${e.map(e=>`<tr><th>${my(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">${my(e.text)}</td></tr>`).join("")}</table>`}let mj={"constant-vus":"Steady users","ramping-vus":"Changing users","constant-arrival-rate":"Steady request rate","ramping-arrival-rate":"Changing request rate"};function mz(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,i=e.definition.load.executor.startsWith("constant")?n[0]?.target??0:0,a=n.map(e=>{let t=e.target===i?`stay at ${r(e.target)} for ${e.duration}`:`${e.target>i?"go up":"go down"} to ${r(e.target)} over ${e.duration}`;return i=e.target,t}).join(", then ");return a.charAt(0).toUpperCase()+a.slice(1)}e.s(["exportRunHtml",0,function(e,t={}){let r=t.generatedAt??new Date().toISOString(),i=t.view??f("run"),o=pW(e,{slo:t.slo??null}),u=function(e,t={}){let r=e.summary,n=e.buckets,i=t.slo??null,a=pK(e),s=[],o=[],l=e.definition.load.executor.endsWith("arrival-rate"),u=pq(e);s.push(`<b>Load.</b> ${my(mz(e))}. In ${my(m_(mS(e)))} the API answered ${my(mk(r.http.requests))} requests — ${my(m$(r.http.rps.avg))} per second on average, ${my(m$(r.http.rps.max))} at the busiest second.`);let c=r.latencyMs.p95;if(u.timingsUnreliable){let e=u.healthyP95Ms;s.push(`<b>Speed.</b> The response times of this run are not meaningful: ${my(mx(r.http.failed.rate))} of responses were errors, and errors come back almost instantly.${e?u.onset?` While requests were still succeeding (before ${my(m_(u.onset.elapsedS))}), 95% took about ${my(mb(e))}.`:` Successful requests alone: 95% took about ${my(mb(e))}.`:""}`)}else{let e=`<b>Speed.</b> A typical request took ${my(mb(r.latencyMs.median))}; 95% finished within ${my(mb(c))}, and the slowest took ${my(mb(r.latencyMs.max))}.`;i?.p95Ms&&(e+=c<=i.p95Ms?` That is within your ${my(mb(i.p95Ms))} goal.`:` That is over your ${my(mb(i.p95Ms))} goal by ${my(mb(c-i.p95Ms))}.`),r.latencyMs.p99>3*c&&r.latencyMs.p99>100&&(e+=` The slowest 1% (${my(mb(r.latencyMs.p99))}) is much slower than the rest — a few requests hit something slow, like a cold cache, a lock, or garbage collection.`),s.push(e)}if(n.length>=6&&a.earlyP95>0&&!u.onset&&!u.timingsUnreliable){let e=a.lateP95/a.earlyP95;e>1.5?(s.push(`<b>Over time.</b> It got slower as the test went on: 95% of requests took ${my(mb(a.earlyP95))} early on and ${my(mb(a.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?s.push(`<b>Over time.</b> It got faster after the start (${my(mb(a.earlyP95))} → ${my(mb(a.lateP95))}) — typical of warm-up: caches filling, connections opening, code getting compiled.`):s.push("<b>Over time.</b> Response time stayed steady from start to finish.")}let d=r.http.failed.count;if(d){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${mk(t)}`).join(", "),t=n.find(e=>e.failedRate>0),i=u.dominant,l=`<b>Errors.</b> ${my(mk(d))} requests failed (${my(mx(r.http.failed.rate))})${e?`: ${my(e)}`:""}.`;i&&(l+=` ${my("0"===i.code?"No answer":i.code)} means ${my(i.meaning)}.`),u.onset?(l+=` From ${my(m_(u.onset.elapsedS))} on — at about ${my(mk(u.onset.vus))} simultaneous users and ${my(m$(u.onset.rps))} requests per second — most requests failed.`,u.lastHealthy&&(l+=` Up to about ${my(mk(u.lastHealthy.vus))} users (${my(m$(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 ${my(m_(t.elapsedS))}.`),s.push(l),u.blocked?o.push(i?.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."):i?.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."),a.status5xx>0&&o.push("Look at the server logs around the time of the 5xx errors — the API itself reported a problem."),a.status0>0&&o.push("Some requests got no answer at all: check timeouts, the network, and whether the API was overloaded.")}else s.push("<b>Errors.</b> No request failed.");let f=r.checks.reduce((e,t)=>e+t.passes,0),p=r.checks.reduce((e,t)=>e+t.fails,0);if(f+p>0){let e=[...r.checks].sort((e,t)=>t.fails-e.fails)[0];s.push(p?`<b>Correctness.</b> ${my(mk(p))} of ${my(mk(f+p))} checks failed; the most often failed was <code>${my(e.name)}</code>. A fast answer is not a correct one.`:`<b>Correctness.</b> Every check passed on every response (${my(mk(f))} checks).`)}else o.push("Add checks (Checks tab) so a fast answer that is wrong still counts as a failure.");let m=r.phasesMs,h=m.blocked.avg+m.dns.avg+m.tcp.avg+m.tls.avg+m.send.avg+m.ttfb.avg+m.download.avg;if(h>0&&!u.timingsUnreliable){let e=m.ttfb.avg/h,t=(m.blocked.avg+m.dns.avg+m.tcp.avg+m.tls.avg)/h;e>=.7?s.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?(s.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.")):s.push(`<b>Where the time went.</b> Time was split between the server (${Math.round(100*e)}%) and moving data or connecting.`)}let g=n.filter(e=>e.rps>0);if(g.length>=8&&!u.onset&&!u.timingsUnreliable){let e=e=>l?e.rps:e.vus,t=[...g].sort((t,r)=>e(t)-e(r)),r=Math.max(1,Math.floor(t.length/4)),n=t.slice(0,r),i=t.slice(-r),a=(e,t)=>e.reduce((e,r)=>e+t(r),0)/e.length,u=a(n,e=>e.p95Ms),c=a(i,e=>e.p95Ms);if(e(i[0])>e(n[n.length-1])&&u>0){let t=c/u;t>2?(s.push(`<b>Capacity.</b> Under the heaviest load, 95% of requests took ${my(mb(c))}, against ${my(mb(u))} at light load (\xd7${t.toFixed(1)}). The API is near its comfortable limit at about ${my(l?`${m$(a(i,e))} requests per second`:`${Math.round(a(i,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.")):(s.push(`<b>Capacity.</b> Response time barely changed between light and full load (${my(mb(u))} → ${my(mb(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&&(s.push(`<b>Requests not sent.</b> ${my(mk(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=pH({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)}%`;s.push(`<b>Against your reference run.</b> Response time ${my(n(e.p95,!0))}; requests per second ${my(n(e.rps,!1))}; failed requests ${my(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 i||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:s,next:o.slice(0,5)}}(e,t),c=o.overall,d=r=>{let i=l[r.metric],o=h(r),u=g(r);mE=Math.max(320,Math.round(r.w/12*1080));let c=function(e,t,r){let i=t.buckets,o=i.map(e=>e.elapsedS),l=e.options??{},u=r.slo??null,c=pW(t,{slo:u});switch(e.metric){case"kpis":case"number":{let n=l.kpis?.length?l.kpis:["throughput","p95","errors","vus","requests"],i=r.baseline?pH({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=mO(t,r,u),o=i&&("p95"===r?i.p95:"throughput"===r?i.rps:"errors"===r?i.errorRate:null),l=null!=o&&Number.isFinite(o)?`<div class="chg" style="color:${("throughput"===r?o<0:o>0)?md:mu}">${o>0?"▲":"▼"} ${Math.abs(100*o).toFixed(0)}% vs reference run</div>`:"";return`<div class="kpi">${"number"===e.metric?"":`<div class="kl">${my(a[r])}</div><div class="kt">${my(s[r])}</div>`}<div class="kv" style="color:${mI(n.tone)}">${my(n.text)}</div>${n.hint?`<div class="kh">${my(n.hint)}</div>`:""}${l}</div>`}).join("")}</div>`}case"verdict":{let e=c.overall;return`<div class="verdict ${e}"><b>${"pass"===e?"✓ PASS":"warn"===e?"! WARNING":"✕ FAIL"}</b> ${my(c.headline)}</div><ul class="aspects">${c.aspects.map(e=>`<li><b class="${e.level}">${"pass"===e.level?"✓":"warn"===e.level?"!":"✕"}</b> <strong>${my(e.title)}</strong> — ${my(e.summary)}</li>`).join("")}</ul><p class="note">${my(c.disclaimer)}</p>`}case"heading":return l.note?`<p class="note">${my(l.note)}</p>`:"";case"latency":{let e=l.percentiles?.length?l.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 mN(o,e.map(e=>({label:n[e],color:mf[e],values:i.map(r=>t[e](r)??null)})),mb,{ref:!1!==l.showTarget&&u?.p95Ms?{value:u.p95Ms,label:`goal ${mb(u.p95Ms)}`}:void 0})}case"throughput":return mN(o,[{label:"Requests per second",color:"#2a78d6",values:i.map(e=>e.rps)}],m$,{area:"area"===e.kind});case"vus":return mN(o,[{label:"Simulated users",color:"#6250d6",values:i.map(e=>e.vus)}],e=>String(Math.round(e)),{area:!0});case"errors":return mN(o,[{label:"Failed requests",color:md,values:i.map(e=>e.failedRate)}],mx,{ref:!1!==l.showTarget&&u?{value:u.errorRate,label:`goal ${mx(u.errorRate)}`}:void 0});case"status":return mN(o,[{label:"2xx success",color:mp,values:i.map(e=>e.http2xx)},{label:"4xx client error",color:mm,values:i.map(e=>e.http4xx)},{label:"5xx server error",color:mh,values:i.map(e=>e.http5xx)},{label:"No answer",color:mg,values:i.map(e=>e.http0)}],e=>String(Math.round(e)),{stacked:!0});case"data":return mN(o,[{label:"Received",color:"#2a78d6",values:i.map(e=>e.bytesIn)},{label:"Sent",color:"#eb6834",values:i.map(e=>e.bytesOut)}],e=>`${mw(Math.round(e))}/s`);case"serverTime":return mN(o,[{label:"Server time (TTFB)",color:"#2a78d6",values:i.map(e=>e.ttfbMs??null)},{label:"TCP connect",color:"#eb6834",values:i.map(e=>e.connectMs??null)},{label:"TLS handshake",color:"#1baf7a",values:i.map(e=>e.tlsMs??null)}],mb);case"checksRate":return mN(o,[{label:"Checks passing",color:mu,values:i.map(e=>null!=e.checksPassed&&e.checksPassed+(e.checksFailed??0)>0?e.checksPassed/(e.checksPassed+(e.checksFailed??0)):null)}],mx);case"dropped":return mN(o,[{label:"Requests not sent",color:mc,values:i.map(e=>e.dropped??null)}],e=>String(Math.round(e)));case"histogram":return function(e){let t=pZ(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,i=r[r.length-1]?.[1]??0,a=t.slice(n,i+1),s=Math.max(...a,1),o=(mE-52-12)/a.length,l=a.map((e,t)=>{let r=e/s*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>${my(pD(n+t))}: ${my(mk(e))} requests</title></rect>`}).join(""),u=a.map((e,t)=>t%Math.ceil(a.length/6)?"":`<text x="${(52+t*o+o/2).toFixed(1)}" y="184" class="t" text-anchor="middle">${my(pD(n+t))}</text>`).join("");return`<svg viewBox="0 0 ${mE} 190" role="img" aria-label="How many requests took each amount of time"><line x1="52" x2="${mE-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=pM.map((e,t)=>t).filter(e=>t.some(t=>(t.hist[e]??0)>0)),n=Math.max(1,Math.ceil(t.length/120)),i=[];for(let e=0;e<t.length;e+=n)i.push(t.slice(e,e+n));let a=Math.min(260,24+14*r.length),s=(mE-52-12)/i.length,o=(a-10-24)/r.length,l=1,u=i.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(mv.length-1,Math.floor(e/l*mv.length));return`<rect x="${(52+t*s).toFixed(1)}" y="${(a-24-(n+1)*o).toFixed(1)}" width="${(s+.3).toFixed(1)}" height="${(o+.3).toFixed(1)}" fill="${mv[u]}"><title>${my(m_(i[t][0].elapsedS))} \xb7 ${my(pD(r[n]))}: ${my(mk(e))}</title></rect>`}).join("")).join(""),d=r.map((e,t)=>t%Math.ceil(r.length/6)?"":`<text x="${46}" y="${(a-24-t*o-o/2+3).toFixed(1)}" class="t" text-anchor="end">${my(pD(e))}</text>`).join("");return`<svg viewBox="0 0 ${mE} ${a}" role="img" aria-label="Response times each second; darker means more requests">${c}${d}</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 mU([{label:"Fastest",value:e.min,color:ms,text:mb(e.min)},{label:n.p50,value:e.median,color:mf.p50,text:mb(e.median)},{label:n.p90,value:e.p90,color:mf.p90,text:mb(e.p90)},{label:n.p95,value:e.p95,color:mf.p95,text:mb(e.p95)},{label:n.p99,value:e.p99,color:mf.p99,text:mb(e.p99)},{label:n.max,value:e.max,color:ma,text:mb(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="${my(e.label)} ${my(mb(e.value))}"></span>`).join("")}</div>${mU(r.map(e=>({...e,text:`${mb(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=mA(Math.max(...r.map(e=>e.x))),i=mA(Math.max(...r.map(e=>e.y))),a=e=>52+e/n*(mE-52-12),s=e=>186-e/i*176,o=r.map(e=>`<circle cx="${a(e.x).toFixed(1)}" cy="${s(e.y).toFixed(1)}" r="4" fill="#2a78d6" fill-opacity=".75" stroke="#fff" stroke-width="1.5"><title>${my(m_(e.t))}: ${t?`${m$(e.x)} rps`:`${e.x} users`} → ${my(mb(e.y))}</title></circle>`).join(""),l=[0,.5,1].map(e=>`<line x1="52" x2="${mE-12}" y1="${s(i*e)}" y2="${s(i*e)}" class="g"/><text x="${46}" y="${s(i*e)+3.5}" class="t" text-anchor="end">${my(mb(i*e))}</text><text x="${a(n*e)}" y="204" class="t" text-anchor="middle">${my(t?m$(n*e):String(Math.round(n*e)))}</text>`).join("");return`<svg viewBox="0 0 ${mE} 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=mO(t,"apdex",u);return`<div class="kpis one"><div class="kpi"><div class="kv" style="color:${mI(e.tone)}">${my(e.text)}</div><div class="kh">${my(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> ${my(e.name)}${e.actual?` <span class="note">measured ${my(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>${my(e.name)}</code> <span class="note">${my(mx(e.passes/Math.max(1,e.passes+e.fails)))} \xb7 ${my(mk(e.fails))} failed of ${my(mk(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>${my(e)}</code></td><td>${my("0"===e?"No answer (timeout or connection error)":n<300?"Success":n<400?"Redirect":n<500?"Client error":"Server error")}</td><td>${my(mk(t))}</td><td>${my(mx(t/r))}</td></tr>`}).join("")}</tbody></table>`}case"config":var d;let f,p;return f=(d=t).definition,p=[["Request",`${f.method} ${f.url}`],["Sign-in type","none"===f.auth.mode?"none":f.auth.mode],["Load style",`${mj[f.load.executor]??f.load.executor}`],["Load over time",mz(d)],["Started",new Date(d.startedAt).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"medium"})],["Length",m_(mS(d))],["Data received / sent",`${mw(d.summary.data.bytesIn)} / ${mw(d.summary.data.bytesOut)}`]],f.data?.before&&p.push(["Runs first",`${f.data.before.label} → ${f.data.before.values.map(e=>`{{${e}}}`).join(", ")}`]),f.data?.testData&&p.push(["Test data",`${f.data.testData.fileName} \xb7 ${mk(f.data.testData.rows)} rows`]),`<table class="kv-tbl">${p.map(([e,t])=>`<tr><th>${my(e)}</th><td>${my(t)}</td></tr>`).join("")}</table>`}}(r,e,t),d=i.bare?"w head":"w";return`<section class="${d}">${i.bare?`<h2>${my(o)}</h2>`:`<h3>${my(o)}${u?` <small>${my(u)}</small>`:""}</h3>`}${c}</section>`},p=(function(e){let t=[],r=-1;for(let n of v(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)}))})})(i.widgets).map(e=>`<div class="band">${e.map(e=>`<div class="lane" style="--x:${e.x+1};--w:${e.w}">${e.widgets.map(d).join("")}</div>`).join("")}</div>`).join("\n");mE=640;let m=e.buckets.map(e=>`<tr><td>${my(m_(e.elapsedS))}</td><td>${e.vus}</td><td>${my(m$(e.rps))}</td><td>${my(mb(e.p50Ms))}</td><td>${my(mb(e.p95Ms))}</td><td>${my(mb(e.p99Ms))}</td><td>${my(mx(e.failedRate))}</td><td>${e.http2xx}</td><td>${e.http4xx}</td><td>${e.http5xx}</td><td>${e.http0}</td></tr>`).join("");return`<!DOCTYPE html>
704
+ `}],88491);let ms="#12151c",mo="#5c6778",ml="#d5dce6",mu="#ffffff",mc="#137333",md="#975300",mf="#c62828",mp={p50:"#86b6ef",p90:"#3987e5",p95:"#256abf",p99:"#104281",p999:"#6250d6",max:"#12151c"},mm="#0ca30c",mh="#fab219",mg="#d03b3b",mv="#898781",my=["#eef4fc","#c3d9f5","#86b6ef","#3987e5","#256abf","#104281"],mb=e=>String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),m$=e=>Number.isFinite(e)?e<10?`${e.toFixed(1)} ms`:e>=1e4?`${(e/1e3).toFixed(1)} s`:`${Math.round(e)} ms`:"—",mx=e=>Number.isFinite(e)?e>=1e3?`${(e/1e3).toFixed(2)}k`:e.toFixed(e>=100?0:1):"—",mk=e=>`${(100*e).toFixed(e<.01?2:1)}%`,mw=e=>new Intl.NumberFormat("en-US").format(Math.round(e)),m_=e=>e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(2)} MB`,mS=e=>e>=60?`${Math.floor(e/60)}m ${e%60?`${e%60}s`:""}`.trim():`${e}s`,mI=e=>Math.max(0,Math.round((Date.parse(e.endedAt)-Date.parse(e.startedAt))/1e3)),mO=e=>"ok"===e?mc:"warn"===e?md:"bad"===e?mf:ms;function mE(e,t,r){let n=e.summary;switch(t){case"throughput":return{text:`${mx(n.http.rps.avg)} rps`,hint:`max ${mx(n.http.rps.max)}`};case"peakRps":return{text:`${mx(n.http.rps.max)} rps`,hint:`average ${mx(n.http.rps.avg)}`};case"p95":{let e=r?.p95Ms??500;if(n.http.failed.rate>=.5)return{text:m$(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:m$(n.latencyMs.p95),hint:`slowest 1% ${m$(n.latencyMs.p99)}`,tone:t}}case"p50":return{text:m$(n.latencyMs.median),hint:"half of requests were faster"};case"avg":return{text:m$(n.latencyMs.mean),hint:`typical spread \xb1${m$(n.latencyMs.stdDev)}`};case"p99":return{text:m$(n.latencyMs.p99),hint:`slowest ${m$(n.latencyMs.max)}`};case"max":return{text:m$(n.latencyMs.max),hint:`fastest ${m$(n.latencyMs.min)}`};case"ttfb":{let e=n.latencyMs.mean>0?Math.min(1,n.phasesMs.ttfb.avg/n.latencyMs.mean):0;return{text:m$(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:mk(e),hint:`${mw(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 i=e/(e+t),a=r?.checksRate??.99;return{text:mk(i),hint:`${mw(t)} failed`,tone:i>=a?"ok":i>=a-.05?"warn":"bad"}}case"vus":return{text:String(n.vus.max),hint:`average ${n.vus.avg.toFixed(1)}`};case"requests":return{text:mw(n.http.requests),hint:`${mw(n.iterations.count)} iterations`};case"dropped":{let e=n.droppedIterations;return null==e?{text:"—",hint:"rate mode only"}:{text:mw(e),tone:e>0?"warn":"ok",hint:"requests that could not start on time"}}case"apdex":{let t=pC(e.buckets.map(e=>e.hist)),n=t?pL(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:m_(n.data.bytesIn),hint:`sent ${m_(n.data.bytesOut)}`};case"sent":return{text:m_(n.data.bytesOut),hint:`received ${m_(n.data.bytesIn)}`};case"duration":return{text:mS(mI(e)),hint:`${mw(n.http.requests)} requests`}}}let mA=640;function mN(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 mU(e,t,r,n={}){let i=n.h??210;if(!e.length||!t.length)return'<p class="empty">Not recorded for this run.</p>';let a=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),s=mN(Math.max(...a.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)*(mA-52-12),c=e=>i-24-e/s*(i-10-24),d=[0,.25,.5,.75,1].map(e=>s*e).map(e=>`<line x1="52" x2="${mA-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">${mb(r(e))}</text>`).join(""),f=Array.from({length:6},(e,t)=>Math.round(o+(l-o)*t/5)).map(e=>`<text x="${u(e).toFixed(1)}" y="${i-6}" class="t" text-anchor="middle">${mb(mS(e))}</text>`).join(""),p=a.map((r,i)=>{let s,o,l,d=t[i],f="",p=!1;if(r.forEach((t,r)=>{null!=t&&Number.isFinite(t)?(f+=`${p?"L":"M"}${u(e[r]).toFixed(1)},${c(t).toFixed(1)}`,p=!0):p=!1}),!f)return"";let m=n.area||n.stacked?(s=n.stacked&&i>0?a[i-1]:e.map(()=>0),o=r.map((t,r)=>`${u(e[r]).toFixed(1)},${c(t??0).toFixed(1)}`).join(" L"),l=[...s].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="${d.color}" fill-opacity="${n.stacked?.85:.18}" stroke="none"/>`):"";return`${m}<path d="${f}" fill="none" stroke="${d.color}" stroke-width="2" stroke-linejoin="round"${d.dash?' stroke-dasharray="5 4"':""}/>`}).join(""),m=n.ref?`<line x1="52" x2="${mA-12}" y1="${c(n.ref.value).toFixed(1)}" y2="${c(n.ref.value).toFixed(1)}" stroke="${mo}" stroke-dasharray="6 4"/><text x="${mA-12}" y="${(c(n.ref.value)-4).toFixed(1)}" class="t" text-anchor="end">${mb(n.ref.label)}</text>`:"",h=Math.max(1,Math.ceil(e.length/240)),g=(mA-52-12)/Math.max(1,(e.length-1)/h),v=e.map((e,n)=>n%h?"":`<rect x="${(u(e)-g/2).toFixed(1)}" y="10" width="${g.toFixed(1)}" height="${i-10-24}" fill="transparent"><title>${mb(mS(e))}
705
+ ${t.map(e=>`${e.label}: ${null==e.values[n]?"—":r(e.values[n])}`).join("\n")}</title></rect>`).join(""),y=t.length>1?`<div class="legend">${t.map(e=>`<span><i style="background:${e.color}"></i>${mb(e.label)}</span>`).join("")}</div>`:"";return`<svg viewBox="0 0 ${mA} ${i}" role="img" aria-label="${mb(t.map(e=>e.label).join(", "))} over time">${d}${f}${m}${p}${v}</svg>${y}`}function mj(e){let t=Math.max(...e.map(e=>e.value),1);return`<table class="bars">${e.map(e=>`<tr><th>${mb(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">${mb(e.text)}</td></tr>`).join("")}</table>`}let mz={"constant-vus":"Steady users","ramping-vus":"Changing users","constant-arrival-rate":"Steady request rate","ramping-arrival-rate":"Changing request rate"};function mT(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,i=e.definition.load.executor.startsWith("constant")?n[0]?.target??0:0,a=n.map(e=>{let t=e.target===i?`stay at ${r(e.target)} for ${e.duration}`:`${e.target>i?"go up":"go down"} to ${r(e.target)} over ${e.duration}`;return i=e.target,t}).join(", then ");return a.charAt(0).toUpperCase()+a.slice(1)}e.s(["exportRunHtml",0,function(e,t={}){let r=t.generatedAt??new Date().toISOString(),i=t.view??f("run"),o=pV(e,{slo:t.slo??null}),u=function(e,t={}){let r=e.summary,n=e.buckets,i=t.slo??null,a=pW(e),s=[],o=[],l=e.definition.load.executor.endsWith("arrival-rate"),u=pF(e);s.push(`<b>Load.</b> ${mb(mT(e))}. In ${mb(mS(mI(e)))} the API answered ${mb(mw(r.http.requests))} requests — ${mb(mx(r.http.rps.avg))} per second on average, ${mb(mx(r.http.rps.max))} at the busiest second.`);let c=r.latencyMs.p95;if(u.timingsUnreliable){let e=u.healthyP95Ms;s.push(`<b>Speed.</b> The response times of this run are not meaningful: ${mb(mk(r.http.failed.rate))} of responses were errors, and errors come back almost instantly.${e?u.onset?` While requests were still succeeding (before ${mb(mS(u.onset.elapsedS))}), 95% took about ${mb(m$(e))}.`:` Successful requests alone: 95% took about ${mb(m$(e))}.`:""}`)}else{let e=`<b>Speed.</b> A typical request took ${mb(m$(r.latencyMs.median))}; 95% finished within ${mb(m$(c))}, and the slowest took ${mb(m$(r.latencyMs.max))}.`;i?.p95Ms&&(e+=c<=i.p95Ms?` That is within your ${mb(m$(i.p95Ms))} goal.`:` That is over your ${mb(m$(i.p95Ms))} goal by ${mb(m$(c-i.p95Ms))}.`),r.latencyMs.p99>3*c&&r.latencyMs.p99>100&&(e+=` The slowest 1% (${mb(m$(r.latencyMs.p99))}) is much slower than the rest — a few requests hit something slow, like a cold cache, a lock, or garbage collection.`),s.push(e)}if(n.length>=6&&a.earlyP95>0&&!u.onset&&!u.timingsUnreliable){let e=a.lateP95/a.earlyP95;e>1.5?(s.push(`<b>Over time.</b> It got slower as the test went on: 95% of requests took ${mb(m$(a.earlyP95))} early on and ${mb(m$(a.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?s.push(`<b>Over time.</b> It got faster after the start (${mb(m$(a.earlyP95))} → ${mb(m$(a.lateP95))}) — typical of warm-up: caches filling, connections opening, code getting compiled.`):s.push("<b>Over time.</b> Response time stayed steady from start to finish.")}let d=r.http.failed.count;if(d){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${mw(t)}`).join(", "),t=n.find(e=>e.failedRate>0),i=u.dominant,l=`<b>Errors.</b> ${mb(mw(d))} requests failed (${mb(mk(r.http.failed.rate))})${e?`: ${mb(e)}`:""}.`;i&&(l+=` ${mb("0"===i.code?"No answer":i.code)} means ${mb(i.meaning)}.`),u.onset?(l+=` From ${mb(mS(u.onset.elapsedS))} on — at about ${mb(mw(u.onset.vus))} simultaneous users and ${mb(mx(u.onset.rps))} requests per second — most requests failed.`,u.lastHealthy&&(l+=` Up to about ${mb(mw(u.lastHealthy.vus))} users (${mb(mx(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 ${mb(mS(t.elapsedS))}.`),s.push(l),u.blocked?o.push(i?.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."):i?.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."),a.status5xx>0&&o.push("Look at the server logs around the time of the 5xx errors — the API itself reported a problem."),a.status0>0&&o.push("Some requests got no answer at all: check timeouts, the network, and whether the API was overloaded.")}else s.push("<b>Errors.</b> No request failed.");let f=r.checks.reduce((e,t)=>e+t.passes,0),p=r.checks.reduce((e,t)=>e+t.fails,0);if(f+p>0){let e=[...r.checks].sort((e,t)=>t.fails-e.fails)[0];s.push(p?`<b>Correctness.</b> ${mb(mw(p))} of ${mb(mw(f+p))} checks failed; the most often failed was <code>${mb(e.name)}</code>. A fast answer is not a correct one.`:`<b>Correctness.</b> Every check passed on every response (${mb(mw(f))} checks).`)}else o.push("Add checks (Checks tab) so a fast answer that is wrong still counts as a failure.");let m=r.phasesMs,h=m.blocked.avg+m.dns.avg+m.tcp.avg+m.tls.avg+m.send.avg+m.ttfb.avg+m.download.avg;if(h>0&&!u.timingsUnreliable){let e=m.ttfb.avg/h,t=(m.blocked.avg+m.dns.avg+m.tcp.avg+m.tls.avg)/h;e>=.7?s.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?(s.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.")):s.push(`<b>Where the time went.</b> Time was split between the server (${Math.round(100*e)}%) and moving data or connecting.`)}let g=n.filter(e=>e.rps>0);if(g.length>=8&&!u.onset&&!u.timingsUnreliable){let e=e=>l?e.rps:e.vus,t=[...g].sort((t,r)=>e(t)-e(r)),r=Math.max(1,Math.floor(t.length/4)),n=t.slice(0,r),i=t.slice(-r),a=(e,t)=>e.reduce((e,r)=>e+t(r),0)/e.length,u=a(n,e=>e.p95Ms),c=a(i,e=>e.p95Ms);if(e(i[0])>e(n[n.length-1])&&u>0){let t=c/u;t>2?(s.push(`<b>Capacity.</b> Under the heaviest load, 95% of requests took ${mb(m$(c))}, against ${mb(m$(u))} at light load (\xd7${t.toFixed(1)}). The API is near its comfortable limit at about ${mb(l?`${mx(a(i,e))} requests per second`:`${Math.round(a(i,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.")):(s.push(`<b>Capacity.</b> Response time barely changed between light and full load (${mb(m$(u))} → ${mb(m$(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&&(s.push(`<b>Requests not sent.</b> ${mb(mw(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=pX({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)}%`;s.push(`<b>Against your reference run.</b> Response time ${mb(n(e.p95,!0))}; requests per second ${mb(n(e.rps,!1))}; failed requests ${mb(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 i||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:s,next:o.slice(0,5)}}(e,t),c=o.overall,d=r=>{let i=l[r.metric],o=h(r),u=g(r);mA=Math.max(320,Math.round(r.w/12*1080));let c=function(e,t,r){let i=t.buckets,o=i.map(e=>e.elapsedS),l=e.options??{},u=r.slo??null,c=pV(t,{slo:u});switch(e.metric){case"kpis":case"number":{let n=l.kpis?.length?l.kpis:["throughput","p95","errors","vus","requests"],i=r.baseline?pX({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=mE(t,r,u),o=i&&("p95"===r?i.p95:"throughput"===r?i.rps:"errors"===r?i.errorRate:null),l=null!=o&&Number.isFinite(o)?`<div class="chg" style="color:${("throughput"===r?o<0:o>0)?mf:mc}">${o>0?"▲":"▼"} ${Math.abs(100*o).toFixed(0)}% vs reference run</div>`:"";return`<div class="kpi">${"number"===e.metric?"":`<div class="kl">${mb(a[r])}</div><div class="kt">${mb(s[r])}</div>`}<div class="kv" style="color:${mO(n.tone)}">${mb(n.text)}</div>${n.hint?`<div class="kh">${mb(n.hint)}</div>`:""}${l}</div>`}).join("")}</div>`}case"verdict":{let e=c.overall;return`<div class="verdict ${e}"><b>${"pass"===e?"✓ PASS":"warn"===e?"! WARNING":"✕ FAIL"}</b> ${mb(c.headline)}</div><ul class="aspects">${c.aspects.map(e=>`<li><b class="${e.level}">${"pass"===e.level?"✓":"warn"===e.level?"!":"✕"}</b> <strong>${mb(e.title)}</strong> — ${mb(e.summary)}</li>`).join("")}</ul><p class="note">${mb(c.disclaimer)}</p>`}case"heading":return l.note?`<p class="note">${mb(l.note)}</p>`:"";case"latency":{let e=l.percentiles?.length?l.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 mU(o,e.map(e=>({label:n[e],color:mp[e],values:i.map(r=>t[e](r)??null)})),m$,{ref:!1!==l.showTarget&&u?.p95Ms?{value:u.p95Ms,label:`goal ${m$(u.p95Ms)}`}:void 0})}case"throughput":return mU(o,[{label:"Requests per second",color:"#2a78d6",values:i.map(e=>e.rps)}],mx,{area:"area"===e.kind});case"vus":return mU(o,[{label:"Simulated users",color:"#6250d6",values:i.map(e=>e.vus)}],e=>String(Math.round(e)),{area:!0});case"errors":return mU(o,[{label:"Failed requests",color:mf,values:i.map(e=>e.failedRate)}],mk,{ref:!1!==l.showTarget&&u?{value:u.errorRate,label:`goal ${mk(u.errorRate)}`}:void 0});case"status":return mU(o,[{label:"2xx success",color:mm,values:i.map(e=>e.http2xx)},{label:"4xx client error",color:mh,values:i.map(e=>e.http4xx)},{label:"5xx server error",color:mg,values:i.map(e=>e.http5xx)},{label:"No answer",color:mv,values:i.map(e=>e.http0)}],e=>String(Math.round(e)),{stacked:!0});case"data":return mU(o,[{label:"Received",color:"#2a78d6",values:i.map(e=>e.bytesIn)},{label:"Sent",color:"#eb6834",values:i.map(e=>e.bytesOut)}],e=>`${m_(Math.round(e))}/s`);case"serverTime":return mU(o,[{label:"Server time (TTFB)",color:"#2a78d6",values:i.map(e=>e.ttfbMs??null)},{label:"TCP connect",color:"#eb6834",values:i.map(e=>e.connectMs??null)},{label:"TLS handshake",color:"#1baf7a",values:i.map(e=>e.tlsMs??null)}],m$);case"checksRate":return mU(o,[{label:"Checks passing",color:mc,values:i.map(e=>null!=e.checksPassed&&e.checksPassed+(e.checksFailed??0)>0?e.checksPassed/(e.checksPassed+(e.checksFailed??0)):null)}],mk);case"dropped":return mU(o,[{label:"Requests not sent",color:md,values:i.map(e=>e.dropped??null)}],e=>String(Math.round(e)));case"histogram":return function(e){let t=pC(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,i=r[r.length-1]?.[1]??0,a=t.slice(n,i+1),s=Math.max(...a,1),o=(mA-52-12)/a.length,l=a.map((e,t)=>{let r=e/s*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>${mb(pZ(n+t))}: ${mb(mw(e))} requests</title></rect>`}).join(""),u=a.map((e,t)=>t%Math.ceil(a.length/6)?"":`<text x="${(52+t*o+o/2).toFixed(1)}" y="184" class="t" text-anchor="middle">${mb(pZ(n+t))}</text>`).join("");return`<svg viewBox="0 0 ${mA} 190" role="img" aria-label="How many requests took each amount of time"><line x1="52" x2="${mA-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=pD.map((e,t)=>t).filter(e=>t.some(t=>(t.hist[e]??0)>0)),n=Math.max(1,Math.ceil(t.length/120)),i=[];for(let e=0;e<t.length;e+=n)i.push(t.slice(e,e+n));let a=Math.min(260,24+14*r.length),s=(mA-52-12)/i.length,o=(a-10-24)/r.length,l=1,u=i.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(my.length-1,Math.floor(e/l*my.length));return`<rect x="${(52+t*s).toFixed(1)}" y="${(a-24-(n+1)*o).toFixed(1)}" width="${(s+.3).toFixed(1)}" height="${(o+.3).toFixed(1)}" fill="${my[u]}"><title>${mb(mS(i[t][0].elapsedS))} \xb7 ${mb(pZ(r[n]))}: ${mb(mw(e))}</title></rect>`}).join("")).join(""),d=r.map((e,t)=>t%Math.ceil(r.length/6)?"":`<text x="${46}" y="${(a-24-t*o-o/2+3).toFixed(1)}" class="t" text-anchor="end">${mb(pZ(e))}</text>`).join("");return`<svg viewBox="0 0 ${mA} ${a}" role="img" aria-label="Response times each second; darker means more requests">${c}${d}</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 mj([{label:"Fastest",value:e.min,color:mo,text:m$(e.min)},{label:n.p50,value:e.median,color:mp.p50,text:m$(e.median)},{label:n.p90,value:e.p90,color:mp.p90,text:m$(e.p90)},{label:n.p95,value:e.p95,color:mp.p95,text:m$(e.p95)},{label:n.p99,value:e.p99,color:mp.p99,text:m$(e.p99)},{label:n.max,value:e.max,color:ms,text:m$(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="${mb(e.label)} ${mb(m$(e.value))}"></span>`).join("")}</div>${mj(r.map(e=>({...e,text:`${m$(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=mN(Math.max(...r.map(e=>e.x))),i=mN(Math.max(...r.map(e=>e.y))),a=e=>52+e/n*(mA-52-12),s=e=>186-e/i*176,o=r.map(e=>`<circle cx="${a(e.x).toFixed(1)}" cy="${s(e.y).toFixed(1)}" r="4" fill="#2a78d6" fill-opacity=".75" stroke="#fff" stroke-width="1.5"><title>${mb(mS(e.t))}: ${t?`${mx(e.x)} rps`:`${e.x} users`} → ${mb(m$(e.y))}</title></circle>`).join(""),l=[0,.5,1].map(e=>`<line x1="52" x2="${mA-12}" y1="${s(i*e)}" y2="${s(i*e)}" class="g"/><text x="${46}" y="${s(i*e)+3.5}" class="t" text-anchor="end">${mb(m$(i*e))}</text><text x="${a(n*e)}" y="204" class="t" text-anchor="middle">${mb(t?mx(n*e):String(Math.round(n*e)))}</text>`).join("");return`<svg viewBox="0 0 ${mA} 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=mE(t,"apdex",u);return`<div class="kpis one"><div class="kpi"><div class="kv" style="color:${mO(e.tone)}">${mb(e.text)}</div><div class="kh">${mb(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> ${mb(e.name)}${e.actual?` <span class="note">measured ${mb(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>${mb(e.name)}</code> <span class="note">${mb(mk(e.passes/Math.max(1,e.passes+e.fails)))} \xb7 ${mb(mw(e.fails))} failed of ${mb(mw(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>${mb(e)}</code></td><td>${mb("0"===e?"No answer (timeout or connection error)":n<300?"Success":n<400?"Redirect":n<500?"Client error":"Server error")}</td><td>${mb(mw(t))}</td><td>${mb(mk(t/r))}</td></tr>`}).join("")}</tbody></table>`}case"config":var d;let f,p;return f=(d=t).definition,p=[["Request",`${f.method} ${f.url}`],["Sign-in type","none"===f.auth.mode?"none":f.auth.mode],["Load style",`${mz[f.load.executor]??f.load.executor}`],["Load over time",mT(d)],["Started",new Date(d.startedAt).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"medium"})],["Length",mS(mI(d))],["Data received / sent",`${m_(d.summary.data.bytesIn)} / ${m_(d.summary.data.bytesOut)}`]],f.data?.before&&p.push(["Runs first",`${f.data.before.label} → ${f.data.before.values.map(e=>`{{${e}}}`).join(", ")}`]),f.data?.testData&&p.push(["Test data",`${f.data.testData.fileName} \xb7 ${mw(f.data.testData.rows)} rows`]),`<table class="kv-tbl">${p.map(([e,t])=>`<tr><th>${mb(e)}</th><td>${mb(t)}</td></tr>`).join("")}</table>`}}(r,e,t),d=i.bare?"w head":"w";return`<section class="${d}">${i.bare?`<h2>${mb(o)}</h2>`:`<h3>${mb(o)}${u?` <small>${mb(u)}</small>`:""}</h3>`}${c}</section>`},p=(function(e){let t=[],r=-1;for(let n of v(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)}))})})(i.widgets).map(e=>`<div class="band">${e.map(e=>`<div class="lane" style="--x:${e.x+1};--w:${e.w}">${e.widgets.map(d).join("")}</div>`).join("")}</div>`).join("\n");mA=640;let m=e.buckets.map(e=>`<tr><td>${mb(mS(e.elapsedS))}</td><td>${e.vus}</td><td>${mb(mx(e.rps))}</td><td>${mb(m$(e.p50Ms))}</td><td>${mb(m$(e.p95Ms))}</td><td>${mb(m$(e.p99Ms))}</td><td>${mb(mk(e.failedRate))}</td><td>${e.http2xx}</td><td>${e.http4xx}</td><td>${e.http5xx}</td><td>${e.http0}</td></tr>`).join("");return`<!DOCTYPE html>
616
706
  <html lang="en">
617
707
  <head>
618
708
  <meta charset="utf-8">
619
709
  <meta name="viewport" content="width=device-width, initial-scale=1">
620
- <title>${my(e.testName)} — APITestCenter</title>
710
+ <title>${mb(e.testName)} — APITestCenter</title>
621
711
  <style>
622
712
  :root { color-scheme: light; }
623
713
  * { box-sizing: border-box; }
624
- body { margin: 0; background: #f4f6f9; color: ${ma}; font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
714
+ body { margin: 0; background: #f4f6f9; color: ${ms}; font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
625
715
  code, .kv, .tbl td, .series td { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
626
- header.top { background: ${ml}; border-bottom: 1px solid ${mo}; padding: 20px 28px; }
627
- header.top .brand { font-size: 12px; color: ${ms}; }
716
+ header.top { background: ${mu}; border-bottom: 1px solid ${ml}; padding: 20px 28px; }
717
+ header.top .brand { font-size: 12px; color: ${mo}; }
628
718
  header.top h1 { margin: 2px 0 4px; font-size: 22px; letter-spacing: -.01em; }
629
- header.top .meta { color: ${ms}; font-size: 13px; word-break: break-all; }
719
+ header.top .meta { color: ${mo}; font-size: 13px; word-break: break-all; }
630
720
  main { max-width: 1240px; margin: 0 auto; padding: 20px 20px 56px; }
631
721
  .verdict { border-radius: 10px; padding: 12px 14px; font-size: 15px; }
632
- .verdict.pass { background: #e6f4ea; border: 1px solid #a8dab5; } .verdict.pass b { color: ${mu}; }
633
- .verdict.warn { background: #fef3e0; border: 1px solid #f5cf8b; } .verdict.warn b { color: ${mc}; }
634
- .verdict.fail { background: #fdecea; border: 1px solid #f3b0aa; } .verdict.fail b { color: ${md}; }
635
- .debrief { background: ${ml}; border: 1px solid ${mo}; border-radius: 12px; padding: 16px 20px; margin: 16px 0; }
722
+ .verdict.pass { background: #e6f4ea; border: 1px solid #a8dab5; } .verdict.pass b { color: ${mc}; }
723
+ .verdict.warn { background: #fef3e0; border: 1px solid #f5cf8b; } .verdict.warn b { color: ${md}; }
724
+ .verdict.fail { background: #fdecea; border: 1px solid #f3b0aa; } .verdict.fail b { color: ${mf}; }
725
+ .debrief { background: ${mu}; border: 1px solid ${ml}; border-radius: 12px; padding: 16px 20px; margin: 16px 0; }
636
726
  .debrief h2 { margin: 0 0 8px; font-size: 17px; }
637
727
  .debrief p { margin: 6px 0; } .debrief ol { margin: 6px 0 0; padding-left: 20px; } .debrief li { margin: 3px 0; }
638
728
  .grid { display: flex; flex-direction: column; gap: 12px; }
639
729
  .band { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: start; }
640
730
  .lane { grid-column: var(--x) / span var(--w); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
641
- .w { background: ${ml}; border: 1px solid ${mo}; border-radius: 12px; padding: 12px 14px; min-width: 0; break-inside: avoid; }
731
+ .w { background: ${mu}; border: 1px solid ${ml}; border-radius: 12px; padding: 12px 14px; min-width: 0; break-inside: avoid; }
642
732
  .w.head { background: none; border: 0; padding: 14px 2px 0; }
643
- .w.head h2 { margin: 0; padding-bottom: 4px; border-bottom: 1px solid ${mo}; font-size: 18px; }
644
- .w h3 { margin: 0 0 8px; font-size: 14px; } .w h3 small { color: ${ms}; font-weight: 400; font-size: 12px; margin-left: 4px; }
645
- .w h4 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: ${ms}; }
733
+ .w.head h2 { margin: 0; padding-bottom: 4px; border-bottom: 1px solid ${ml}; font-size: 18px; }
734
+ .w h3 { margin: 0 0 8px; font-size: 14px; } .w h3 small { color: ${mo}; font-weight: 400; font-size: 12px; margin-left: 4px; }
735
+ .w h4 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: ${mo}; }
646
736
  svg { width: 100%; height: auto; display: block; }
647
- svg .g { stroke: ${mo}; stroke-width: 1; } svg .t { fill: ${ms}; font: 11px ui-monospace, Consolas, monospace; }
648
- .legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: ${ms}; margin-top: 4px; }
737
+ svg .g { stroke: ${ml}; stroke-width: 1; } svg .t { fill: ${mo}; font: 11px ui-monospace, Consolas, monospace; }
738
+ .legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: ${mo}; margin-top: 4px; }
649
739
  .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
650
740
  .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
651
741
  .kpis.one { grid-template-columns: 1fr; }
652
742
  .kpi { background: #eef1f6; border-radius: 10px; padding: 10px 12px; }
653
- .kl { font-size: 12px; color: ${ms}; font-weight: 600; } .kt { font-size: 11px; color: #7a8596; }
743
+ .kl { font-size: 12px; color: ${mo}; font-weight: 600; } .kt { font-size: 11px; color: #7a8596; }
654
744
  .kv { font-size: 24px; font-weight: 600; margin-top: 2px; } .kpis.one .kv { font-size: 34px; }
655
- .kh, .chg, .note { font-size: 12px; color: ${ms}; } .chg { margin-top: 2px; }
745
+ .kh, .chg, .note { font-size: 12px; color: ${mo}; } .chg { margin-top: 2px; }
656
746
  .aspects, .list { list-style: none; padding: 0; margin: 10px 0 0; } .aspects li, .list li { margin: 5px 0; font-size: 13px; }
657
- b.pass { color: ${mu}; } b.warn { color: ${mc}; } b.fail { color: ${md}; }
747
+ b.pass { color: ${mc}; } b.warn { color: ${md}; } b.fail { color: ${mf}; }
658
748
  table { border-collapse: collapse; width: 100%; }
659
- .bars th { text-align: left; font-weight: 400; color: ${ms}; font-size: 12px; padding: 3px 10px 3px 0; white-space: nowrap; width: 1%; }
749
+ .bars th { text-align: left; font-weight: 400; color: ${mo}; font-size: 12px; padding: 3px 10px 3px 0; white-space: nowrap; width: 1%; }
660
750
  .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%; }
661
751
  .bar { display: block; height: 10px; border-radius: 3px; }
662
752
  .stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 2px 0 10px; gap: 2px; } .stack span { display: block; height: 100%; }
663
- .tbl th, .tbl td, .series th, .series td, .kv-tbl th, .kv-tbl td { text-align: left; padding: 6px 8px; border-top: 1px solid ${mo}; font-size: 12px; }
664
- .tbl th, .series th { color: ${ms}; font-weight: 600; border-top: 0; }
665
- .kv-tbl th { color: ${ms}; font-weight: 400; width: 30%; white-space: nowrap; vertical-align: top; } .kv-tbl td { word-break: break-all; }
666
- .empty { color: ${ms}; font-size: 13px; }
667
- details.appendix { margin-top: 20px; background: ${ml}; border: 1px solid ${mo}; border-radius: 12px; padding: 12px 16px; }
753
+ .tbl th, .tbl td, .series th, .series td, .kv-tbl th, .kv-tbl td { text-align: left; padding: 6px 8px; border-top: 1px solid ${ml}; font-size: 12px; }
754
+ .tbl th, .series th { color: ${mo}; font-weight: 600; border-top: 0; }
755
+ .kv-tbl th { color: ${mo}; font-weight: 400; width: 30%; white-space: nowrap; vertical-align: top; } .kv-tbl td { word-break: break-all; }
756
+ .empty { color: ${mo}; font-size: 13px; }
757
+ details.appendix { margin-top: 20px; background: ${mu}; border: 1px solid ${ml}; border-radius: 12px; padding: 12px 16px; }
668
758
  details.appendix summary { cursor: pointer; font-weight: 600; }
669
759
  .series-wrap { max-height: 420px; overflow: auto; margin-top: 10px; }
670
- footer { color: ${ms}; font-size: 12px; margin-top: 24px; }
760
+ footer { color: ${mo}; font-size: 12px; margin-top: 24px; }
671
761
  @media (max-width: 900px) { .lane { grid-column: 1 / -1; } }
672
762
  @media print { body { background: #fff; } .series-wrap { max-height: none; } details.appendix { display: none; } .w, .debrief { box-shadow: none; } }
673
763
  </style>
@@ -675,21 +765,21 @@ ${t.map(e=>`${e.label}: ${null==e.values[n]?"—":r(e.values[n])}`).join("\n")}<
675
765
  <body>
676
766
  <header class="top">
677
767
  <div class="brand">APITestCenter \xb7 Load test report</div>
678
- <h1>${my(e.testName)}</h1>
679
- <div class="meta">${my(e.definition.method)} ${my(e.definition.url)} \xb7 ${my(new Date(e.startedAt).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"short"}))} \xb7 ${my(m_(mS(e)))} \xb7 ${my(e.status)} \xb7 sign-in ${my(e.definition.auth.mode)}</div>
768
+ <h1>${mb(e.testName)}</h1>
769
+ <div class="meta">${mb(e.definition.method)} ${mb(e.definition.url)} \xb7 ${mb(new Date(e.startedAt).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"short"}))} \xb7 ${mb(mS(mI(e)))} \xb7 ${mb(e.status)} \xb7 sign-in ${mb(e.definition.auth.mode)}</div>
680
770
  </header>
681
771
  <main>
682
- <div class="verdict ${c}"><b>${"pass"===c?"✓ PASS":"warn"===c?"! WARNING":"✕ FAIL"}</b> ${my(o.headline)}</div>
772
+ <div class="verdict ${c}"><b>${"pass"===c?"✓ PASS":"warn"===c?"! WARNING":"✕ FAIL"}</b> ${mb(o.headline)}</div>
683
773
  <section class="debrief">
684
774
  <h2>What happened in this run</h2>
685
775
  ${u.findings.map(e=>`<p>${e}</p>`).join("\n ")}
686
- ${u.next.length?`<h2 style="margin-top:14px">Suggested next steps</h2><ol>${u.next.map(e=>`<li>${my(e)}</li>`).join("")}</ol>`:""}
687
- <p class="note">Written from the measured numbers by fixed rules. ${my(o.disclaimer)}</p>
776
+ ${u.next.length?`<h2 style="margin-top:14px">Suggested next steps</h2><ol>${u.next.map(e=>`<li>${mb(e)}</li>`).join("")}</ol>`:""}
777
+ <p class="note">Written from the measured numbers by fixed rules. ${mb(o.disclaimer)}</p>
688
778
  </section>
689
- ${function(e,t){if(!t||t.id===e.id)return"";let r=mt(t,e),n="worse"===r.level?"fail":"better"===r.level?"pass":"same"===r.level?"same":"warn",i=(e,t)=>null==t?"—":"rps"===e?`${m$(t)}/s`:"errorRate"===e||"checksRate"===e?mx(t):mb(t),a=r.metrics.map(e=>`<tr><th>${my(e.label)} <span class="sub">${my(e.tech)}</span></th><td>${my(i(e.key,e.before))}</td><td>${my(i(e.key,e.after))}</td><td>${(e=>{if("n/a"===e.direction)return`<span class="sub">${my(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?mu:md};font-weight:600">${t?"↑":"↓"} ${my(r)} \xb7 ${e.direction}</span>`})(e)}</td></tr>`).join("");return` <section class="debrief">
779
+ ${function(e,t){if(!t||t.id===e.id)return"";let r=mr(t,e),n="worse"===r.level?"fail":"better"===r.level?"pass":"same"===r.level?"same":"warn",i=(e,t)=>null==t?"—":"rps"===e?`${mx(t)}/s`:"errorRate"===e||"checksRate"===e?mk(t):m$(t),a=r.metrics.map(e=>`<tr><th>${mb(e.label)} <span class="sub">${mb(e.tech)}</span></th><td>${mb(i(e.key,e.before))}</td><td>${mb(i(e.key,e.after))}</td><td>${(e=>{if("n/a"===e.direction)return`<span class="sub">${mb(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?mc:mf};font-weight:600">${t?"↑":"↓"} ${mb(r)} \xb7 ${e.direction}</span>`})(e)}</td></tr>`).join("");return` <section class="debrief">
690
780
  <h2>Before / after</h2>
691
- <p class="sub">This run compared with “${my(t.testName)}” (${my(new Date(t.startedAt).toLocaleString("en-GB"))}).</p>
692
- <div class="verdict ${n}" style="margin:10px 0">${my(r.headline)}</div>
781
+ <p class="sub">This run compared with “${mb(t.testName)}” (${mb(new Date(t.startedAt).toLocaleString("en-GB"))}).</p>
782
+ <div class="verdict ${n}" style="margin:10px 0">${mb(r.headline)}</div>
693
783
  <table class="kv-tbl"><tr><th>Measure</th><th>Before</th><th>After</th><th>Change</th></tr>${a}</table>
694
784
  <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>
695
785
  </section>`}(e,t.before??null)}
@@ -700,7 +790,7 @@ ${p}
700
790
  <summary>Every second of the run (${e.buckets.length} rows)</summary>
701
791
  <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>${m}</tbody></table></div>
702
792
  </details>
703
- <footer>Report view: ${my(i.name)} \xb7 made ${my(r)} with APITestCenter (apitestcenter.com). Secrets are never included; sign-in is shown as a type only.</footer>
793
+ <footer>Report view: ${mb(i.name)} \xb7 made ${mb(r)} with APITestCenter (apitestcenter.com). Secrets are never included; sign-in is shown as a type only.</footer>
704
794
  </main>
705
795
  </body>
706
796
  </html>