apitestcenter 0.18.1 → 0.18.2
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.
- package/dist/THIRD-PARTY-NOTICES-UI.txt +11 -11
- package/dist/THIRD-PARTY-NOTICES.txt +6 -6
- package/dist/cli.mjs +600 -593
- package/dist/ui/404/index.html +1 -1
- package/dist/ui/404.html +1 -1
- package/dist/ui/__next.__PAGE__.txt +32 -21
- package/dist/ui/__next._full.txt +29 -18
- package/dist/ui/__next._tree.txt +5 -4
- package/dist/ui/_next/static/chunks/0-zga2d528cxt.js +50 -0
- package/dist/ui/_next/static/chunks/03ligbvtk7nsc.js +123 -0
- package/dist/ui/_next/static/chunks/03y58w9gmwqc-.js +50 -0
- package/dist/ui/_next/static/chunks/08rlo-0gnct9m.js +50 -0
- package/dist/ui/_next/static/chunks/0bgmfb8f3pd8e.js +1 -0
- package/dist/ui/_next/static/chunks/0g9k0swrer6i5.js +1 -0
- package/dist/ui/_next/static/chunks/0q8iq_7i4ohjr.js +50 -0
- package/dist/ui/_next/static/chunks/1-t79a3q7gmjn.js +31 -0
- package/dist/ui/_next/static/chunks/12whdxhkvkd-y.js +1 -0
- package/dist/ui/_next/static/chunks/14dtemzsvcfmn.js +50 -0
- package/dist/ui/_next/static/chunks/1mm60-ywpri7b.js +2 -0
- package/dist/ui/_next/static/chunks/20j4wusnbtqa2.js +4 -0
- package/dist/ui/_next/static/chunks/243c1-49gb3pr.js +1 -0
- package/dist/ui/_next/static/chunks/2c1b5jqwxl4ra.js +906 -0
- package/dist/ui/_next/static/chunks/2sb9zma7ae-_f.js +27 -0
- package/dist/ui/_next/static/chunks/{109szqnizl8c5.css → 2sjog4to0fmbb.css} +3 -3
- package/dist/ui/_next/static/chunks/2su0ql-zu4q0_.js +3 -0
- package/dist/ui/_next/static/chunks/3-rdixjnndtyk.js +51 -0
- package/dist/ui/_next/static/chunks/32_tmz8ibsdo3.js +22 -0
- package/dist/ui/_next/static/chunks/3wtqdtu331_vc.js +50 -0
- package/dist/ui/_next/static/chunks/3wzu1zkfqdmn6.js +2 -0
- package/dist/ui/_next/static/chunks/turbopack-3-ry682tkyiqk.js +1 -0
- package/dist/ui/_not-found/__next._full.txt +25 -17
- package/dist/ui/_not-found/__next._not-found.__PAGE__.txt +28 -20
- package/dist/ui/_not-found/__next._tree.txt +4 -2
- package/dist/ui/_not-found/index.html +1 -1
- package/dist/ui/_not-found/index.txt +25 -17
- package/dist/ui/compare/__next._full.txt +32 -20
- package/dist/ui/compare/__next._tree.txt +6 -4
- package/dist/ui/compare/__next.compare.__PAGE__.txt +36 -24
- package/dist/ui/compare/index.html +1 -1
- package/dist/ui/compare/index.txt +32 -20
- package/dist/ui/connections/__next._full.txt +30 -20
- package/dist/ui/connections/__next._tree.txt +6 -4
- package/dist/ui/connections/__next.connections.__PAGE__.txt +34 -24
- package/dist/ui/connections/index.html +2 -2
- package/dist/ui/connections/index.txt +30 -20
- package/dist/ui/history/__next._full.txt +35 -23
- package/dist/ui/history/__next._tree.txt +6 -4
- package/dist/ui/history/__next.history.__PAGE__.txt +39 -27
- package/dist/ui/history/index.html +1 -1
- package/dist/ui/history/index.txt +35 -23
- package/dist/ui/home/__next._full.txt +32 -20
- package/dist/ui/home/__next._tree.txt +6 -4
- package/dist/ui/home/__next.home.__PAGE__.txt +36 -24
- package/dist/ui/home/index.html +1 -1
- package/dist/ui/home/index.txt +32 -20
- package/dist/ui/index.html +1 -1
- package/dist/ui/index.txt +29 -18
- package/dist/ui/preview/__next._full.txt +33 -23
- package/dist/ui/preview/__next._tree.txt +6 -4
- package/dist/ui/preview/__next.preview.__PAGE__.txt +37 -27
- package/dist/ui/preview/index.html +1 -1
- package/dist/ui/preview/index.txt +33 -23
- package/dist/ui/suite/__next._full.txt +29 -20
- package/dist/ui/suite/__next._tree.txt +6 -4
- package/dist/ui/suite/__next.suite.__PAGE__.txt +33 -24
- package/dist/ui/suite/index.html +1 -1
- package/dist/ui/suite/index.txt +29 -20
- package/dist/ui/tests/__next._full.txt +28 -20
- package/dist/ui/tests/__next._tree.txt +6 -4
- package/dist/ui/tests/__next.tests.__PAGE__.txt +32 -24
- package/dist/ui/tests/index.html +1 -1
- package/dist/ui/tests/index.txt +28 -20
- package/package.json +1 -1
- package/dist/ui/_next/static/chunks/01sqehfan_2j_.js +0 -1
- package/dist/ui/_next/static/chunks/036rg3itpc5ge.js +0 -50
- package/dist/ui/_next/static/chunks/0e8f1i6w6dqos.js +0 -50
- package/dist/ui/_next/static/chunks/0hvubzjy33qo9.js +0 -2
- package/dist/ui/_next/static/chunks/0ktc3lx37s0t5.js +0 -4
- package/dist/ui/_next/static/chunks/0wrod6xlhsv0m.js +0 -3
- package/dist/ui/_next/static/chunks/1-d6f0jo8p7jc.js +0 -913
- package/dist/ui/_next/static/chunks/15pu58j0qz9i8.js +0 -31
- package/dist/ui/_next/static/chunks/1af6jzcoirzrb.js +0 -27
- package/dist/ui/_next/static/chunks/1apjslkz52j1a.js +0 -22
- package/dist/ui/_next/static/chunks/1pz4ugabfd0qn.js +0 -1
- package/dist/ui/_next/static/chunks/1t823xy7gguwx.js +0 -1
- package/dist/ui/_next/static/chunks/23_x0u07xh89v.js +0 -123
- package/dist/ui/_next/static/chunks/2aifruy-vhchn.js +0 -50
- package/dist/ui/_next/static/chunks/2t65s4y0z2a60.js +0 -50
- package/dist/ui/_next/static/chunks/33kvaxr7qvnue.js +0 -50
- package/dist/ui/_next/static/chunks/366zannfx6qet.js +0 -1
- package/dist/ui/_next/static/chunks/36wzwezwmtzq7.js +0 -51
- package/dist/ui/_next/static/chunks/3n2xlaj16gyb-.js +0 -2
- package/dist/ui/_next/static/chunks/3vso5wrs90xx-.js +0 -50
- package/dist/ui/_next/static/chunks/turbopack-2qka98q_-4ca1.js +0 -1
- /package/dist/ui/_next/static/{-I9ZGWDULRW2FcJsZc5oY → 8uBf4sRL82dkVbEC6zib9}/_buildManifest.js +0 -0
- /package/dist/ui/_next/static/{-I9ZGWDULRW2FcJsZc5oY → 8uBf4sRL82dkVbEC6zib9}/_clientMiddlewareManifest.js +0 -0
- /package/dist/ui/_next/static/{-I9ZGWDULRW2FcJsZc5oY → 8uBf4sRL82dkVbEC6zib9}/_ssgManifest.js +0 -0
- /package/dist/ui/_next/static/media/{8a480f0b521d4e75-s.1qq4vpdcun5oj.woff2 → 07935285219a259d-s.1qq4vpdcun5oj.woff2} +0 -0
- /package/dist/ui/_next/static/media/{797e433ab948586e-s.p.0r6juujl39pe6.woff2 → 07a39a8a4660cc7c-s.p.0r6juujl39pe6.woff2} +0 -0
- /package/dist/ui/_next/static/media/{bbc41e54d2fcbd21-s.1rgnod-3esatf.woff2 → 2a04751c893bf294-s.1rgnod-3esatf.woff2} +0 -0
- /package/dist/ui/_next/static/media/{6306c77e7c8268e4-s.2dbetqa9o8jxf.woff2 → 2bb852295097cd96-s.2dbetqa9o8jxf.woff2} +0 -0
- /package/dist/ui/_next/static/media/{fef07dbb0973bf53-s.3p2_lha1f2xer.woff2 → 4f6667dd39116621-s.3p2_lha1f2xer.woff2} +0 -0
- /package/dist/ui/_next/static/media/{caa3a2e1cccd8315-s.p.0wgildi0cnwt9.woff2 → 605ce01b664af129-s.p.0wgildi0cnwt9.woff2} +0 -0
- /package/dist/ui/_next/static/media/{4fa387ec64143e14-s.2tuy5pz7dlieh.woff2 → 6e342921ee4dcd9d-s.2tuy5pz7dlieh.woff2} +0 -0
- /package/dist/ui/_next/static/media/{7178b3e590c64307-s.21jp631_3pja2.woff2 → 77814b00d5ca94a4-s.21jp631_3pja2.woff2} +0 -0
- /package/dist/ui/_next/static/media/{7d817b4c03b0c5f1-s.1uyisp29ctx0d.woff2 → 9eb5a876700c0028-s.1uyisp29ctx0d.woff2} +0 -0
- /package/dist/ui/_next/static/media/{5ce348bf30bf5439-s.31988l_ccedte.woff2 → b0c6b664fd57c2c6-s.31988l_ccedte.woff2} +0 -0
- /package/dist/ui/_next/static/media/{53b9e256198e5412-s.390ncx5urfkfu.woff2 → f58031ded4338640-s.390ncx5urfkfu.woff2} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63343,44794,54792,88871,36620,73436,12580,55680,e=>{var t=e.i(72587);e.i(24856);var s=e.i(59100),n=e.i(30340),a=e.i(71189),r=e.i(87283),l=e.i(55218),i=e.i(22543),o=e.i(31753),c=e.i(28867);e.i(42674);var d=e.i(5305);function u({label:e,value:s,min:n,max:a,onChange:r,hint:l}){return(0,t.jsxs)("label",{className:"block",children:[(0,t.jsxs)("span",{className:"mb-1 flex items-center gap-1 text-xs text-mute",children:[e,l?(0,t.jsx)(i.f,{label:`About ${e}`,text:l}):null]}),(0,t.jsx)("input",{type:"number",min:n,max:a,value:s,onChange:e=>r(x(e.target.value,n,a)),className:"input font-mono"})]})}function m({stages:e,unit:s,rate:n,onChange:l}){let i=(t,s)=>l(e.map((e,n)=>n===t?{...e,...s}:e));return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("p",{className:"text-xs text-mute",children:"Each stage moves linearly to its target over its duration. Hold steady by repeating the same target."}),(0,t.jsxs)("div",{className:"overflow-hidden rounded-md border border-line",children:[(0,t.jsxs)("div",{className:"grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2rem] bg-panel-2 text-xs text-mute",children:[(0,t.jsx)("span",{className:"px-2 py-1.5",children:"#"}),(0,t.jsx)("span",{className:"border-l border-line px-2 py-1.5",children:"Duration"}),(0,t.jsxs)("span",{className:"border-l border-line px-2 py-1.5",children:["Target (",s,")"]}),(0,t.jsx)("span",{})]}),e.map((s,a)=>{let o=(0,d.R)(s.duration,!1);return(0,t.jsxs)("div",{className:"grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2rem] border-t border-line",children:[(0,t.jsx)("span",{className:"px-2 py-1.5 font-mono text-xs text-mute",children:a+1}),(0,t.jsx)("input",{"aria-label":`Stage ${a+1} duration`,"aria-invalid":!!o||void 0,title:o,value:s.duration,onChange:e=>i(a,{duration:e.target.value}),className:`min-w-0 border-l border-line bg-transparent px-2 py-1.5 font-mono text-[13px] outline-none focus:bg-panel-2 ${o?"text-bad":"text-ink"}`}),(0,t.jsx)("input",{"aria-label":`Stage ${a+1} target`,type:"number",min:0,max:n?1e5:500,value:s.target,onChange:e=>i(a,{target:x(e.target.value,0,n?1e5:500)}),className:"min-w-0 border-l border-line bg-transparent px-2 py-1.5 font-mono text-[13px] text-ink outline-none focus:bg-panel-2"}),(0,t.jsx)("button",{type:"button","aria-label":`Remove stage ${a+1}`,disabled:e.length<=1,onClick:()=>l(e.filter((e,t)=>t!==a)),className:"grid place-items-center text-mute hover:text-bad disabled:opacity-30",children:(0,t.jsx)(r.X,{size:13})})]},a)})]}),(0,t.jsxs)("button",{type:"button",disabled:e.length>=20,onClick:()=>l([...e,{duration:"30s",target:e[e.length-1]?.target??1}]),className:"inline-flex items-center gap-1 text-xs text-accent hover:underline disabled:opacity-40",children:[(0,t.jsx)(a.f,{size:12,"aria-hidden":!0})," Add stage"]})]})}function x(e,t,s){let n=Math.round(Number(e));return Number.isFinite(n)?Math.min(s,Math.max(t,n)):t}function h(e){let t="rate"===e.mode;if(e.stages&&e.stages.length){let t=[[0,0]],n=0;for(let a of e.stages)n+=(0,s.L)(a.duration),t.push([n,a.target]);return{points:t,totalMs:n,peak:Math.max(0,...e.stages.map(e=>e.target))}}let n=t?e.rps??20:e.vus,a=(0,s.L)(e.rampUp),r=(0,s.L)(e.duration),l=(0,s.L)(e.rampDown);return{points:[[0,a>0?0:n],[a,n],[a+r,n],[a+r+l,l>0?0:n]],totalMs:a+r+l,peak:n}}function p(e){let{totalMs:t,peak:s}=h(e),n="rate"===e.mode?"req/s":1===s?"VU":"VUs";return`${e.stages?.length?"peak ":""}${s.toLocaleString()} ${n} \xb7 ${f(t)}`}function f(e){let t=Math.round(e/1e3);if(t<60)return`${t}s`;let s=Math.floor(t/60);return s<60?t%60?`${s}m ${t%60}s`:`${s}m`:`${Math.floor(s/60)}h ${s%60}m`}function b({load:e}){let{points:s,totalMs:n,peak:a}=h(e),r=s.map(([e,t])=>`${e/Math.max(n,1)*300},${56-t/Math.max(a,1)*50}`).join(" "),l=`0,56 ${r} 300,56`;return(0,t.jsxs)("figure",{className:"rounded-md border border-line bg-panel-2 px-3 py-2",children:[(0,t.jsxs)("figcaption",{className:"mb-1 flex justify-between text-xs text-mute",children:[(0,t.jsx)("span",{children:"Planned load"}),(0,t.jsx)("span",{className:"font-mono text-ink",children:p(e)})]}),(0,t.jsxs)("svg",{viewBox:"0 0 300 56",preserveAspectRatio:"none",className:"h-14 w-full",role:"img","aria-label":`Load profile: ${p(e)}`,children:[(0,t.jsx)("polygon",{points:l,fill:"var(--series-1)",fillOpacity:.15}),(0,t.jsx)("polyline",{points:r,fill:"none",stroke:"var(--series-1)",strokeWidth:2,vectorEffect:"non-scaling-stroke"})]}),(0,t.jsxs)("div",{className:"mt-1 flex justify-between font-mono text-[11px] text-mute",children:[(0,t.jsx)("span",{children:"0s"}),(0,t.jsx)("span",{children:"rate"===e.mode?"requests per second":"simulated users"}),(0,t.jsx)("span",{children:f(n)})]})]})}e.s(["B",0,function({load:e,onChange:a}){var r;let x,[h,p]=(0,l.useState)(!1),f=t=>a({...e,...t,preset:"custom"}),g="rate"===e.mode,v=!!(e.stages&&e.stages.length);return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Test type"}),(0,t.jsx)(c.f,{label:"Test type",value:e.preset,onChange:t=>a((0,d.V)(e,t)),options:[...n.R.map(e=>({value:e.id,label:e.label})),{value:"custom",label:"Custom"}]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-mute",children:(r=e.preset,(x=n.R.find(e=>e.id===r))?`${x.question} ${x.hint}`:"Your own numbers — change users, duration or stages below.")})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"mb-1 flex items-center gap-1 text-xs text-mute",children:["Drive load by",(0,t.jsx)(i.f,{label:"About users vs rate",text:"Simulated users (VUs): N clients each send, wait for the answer, and send again — a slow API gets fewer requests. Requests per second: k6 holds the rate whatever the API does — the honest way to test capacity."})]}),(0,t.jsx)(c.f,{label:"Drive load by",value:e.mode??"users",onChange:e=>f({mode:e}),options:[{value:"users",label:"Simulated users"},{value:"rate",label:"Requests per second"}]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"mb-1 block text-xs text-mute",children:"Shape"}),(0,t.jsx)(c.f,{label:"Load shape",value:v?"stages":"simple",onChange:function(t){if("simple"===t)return f({stages:null});let n=g?e.rps??20:e.vus,a=[];(0,s.L)(e.rampUp)>0&&a.push({duration:e.rampUp,target:n}),a.push({duration:e.duration,target:n}),(0,s.L)(e.rampDown)>0&&a.push({duration:e.rampDown,target:0}),f({stages:a})},options:[{value:"simple",label:"Ramp · hold · down"},{value:"stages",label:"Step by step"}]})]})]}),v?(0,t.jsx)(m,{stages:e.stages,unit:g?"req/s":"VUs",rate:g,onChange:e=>f({stages:e})}):(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[g?(0,t.jsx)(u,{label:"Requests / second",value:e.rps??20,min:1,max:1e5,onChange:e=>f({rps:e})}):(0,t.jsx)(u,{label:"Simulated users",hint:"Concurrent clients running from this computer. 50+ will load both the API and this machine.",value:e.vus,min:1,max:500,onChange:e=>f({vus:e})}),(0,t.jsx)(o.S,{label:"Hold for",mono:!0,value:e.duration,error:(0,d.R)(e.duration,!1),onChange:e=>f({duration:e})}),(0,t.jsx)(o.S,{label:"Ramp up",mono:!0,value:e.rampUp,error:(0,d.R)(e.rampUp),onChange:e=>f({rampUp:e})}),(0,t.jsx)(o.S,{label:"Ramp down",mono:!0,value:e.rampDown,error:(0,d.R)(e.rampDown),onChange:e=>f({rampDown:e})})]}),g?(0,t.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:(0,t.jsx)(u,{label:"Max simulated users",hint:"k6 starts more VUs when responses slow down, up to this ceiling. If it runs out, requests are dropped and the report says how many.",value:e.maxVus??100,min:1,max:2e3,onChange:e=>f({maxVus:e})})}):null,(0,t.jsx)(b,{load:e}),(0,t.jsx)("button",{type:"button",className:"text-xs text-accent hover:underline",onClick:()=>p(e=>!e),"aria-expanded":h,children:h?"Hide pacing options":"Pacing options"}),h?(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[g?(0,t.jsx)("p",{className:"text-xs text-mute sm:col-span-2",children:"Think time does not apply when holding a request rate — k6 paces the requests itself."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u,{label:"Think time (ms)",value:e.thinkTimeMs,min:0,max:6e5,onChange:e=>f({thinkTimeMs:e})}),(0,t.jsx)(u,{label:"Random extra (ms)",value:e.thinkJitterMs,min:0,max:6e5,onChange:e=>f({thinkJitterMs:e})})]}),(0,t.jsx)(o.S,{label:"Graceful stop",mono:!0,value:e.gracefulStop,error:(0,d.R)(e.gracefulStop),onChange:e=>f({gracefulStop:e}),hint:"Time in-flight requests get to finish."})]}):null]})},"A",0,p],63343);var g=e.i(1675),v=e.i(458),j=e.i(84575),y=e.i(80707),N=e.i(70746);let w=null,k=null,C=new Set;function $(){return k??=fetch("/engine/local-servers",{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>(e&&(w=e.servers),w)).catch(()=>w).finally(()=>{k=null,C.forEach(e=>e())}),C.forEach(e=>e()),k}var S=e.i(6278);let q=/^\{\{\s*([A-Za-z_][\w.-]*)\s*\}\}/,E=/^(https?):\/\/(localhost|127\.0\.0\.1)(?::(\d{1,5}))?(?=[/?#]|$)/i,M="\0none",z="\0local-other",T="apitestcenter-local-ports",R={GET:"text-ok",POST:"text-warn",PUT:"text-accent",PATCH:"text-accent",DELETE:"text-bad",HEAD:"text-mute",OPTIONS:"text-mute"};function D(){try{let e=JSON.parse(localStorage.getItem(T)??"[]");return(Array.isArray(e)?e.filter(e=>Number.isInteger(e)&&e>0&&e<65536):[]).slice(0,5)}catch{return[]}}function L(e){try{localStorage.setItem(T,JSON.stringify([e,...D().filter(t=>t!==e)].slice(0,5)))}catch{}}let O=(0,l.forwardRef)(function({draft:e,onChange:s,onImported:n,actions:a},i){let{vars:o,environments:c,activeEnv:u}=(0,S.U)(),m=(0,N.k)(),x=(0,l.useRef)(null);(0,l.useImperativeHandle)(i,()=>x.current);let[h,p]=(0,l.useState)([]),[f,b]=(0,l.useState)(null),[T,O]=(0,l.useState)(!1),A=(0,l.useRef)(null);(0,l.useEffect)(()=>p(D()),[]),(0,l.useEffect)(()=>{f&&A.current?.focus()},[f]);let P=e.url,U=q.exec(P)?.[1],F=Object.entries(o).filter(([e,t])=>/^https?:\/\//i.test(t.trim())&&("practiceApi"!==e||U===e)),I=m.filter(e=>!F.some(([t])=>t===e.variable)).map(e=>[e.variable,e.baseUrl,e.name]),B=[...F,...I.map(([e,t])=>[e,t])],W=(()=>{if(T)return null;let e=q.exec(P);if(e&&B.some(([t])=>t===e[1]))return{prefix:e[0],text:`{{${e[1]}}}`,value:e[1]};let t=E.exec(P);if(t){let e=t[1].toLowerCase(),s=t[3]??("https"===e?"443":"80");return{prefix:t[0],text:`${t[2]}${t[3]?`:${t[3]}`:""}`,value:`local:${e}:${s}`}}return null})(),_=P.startsWith("/"),V=_||""===P||null!=W,H=function(e){let[,t]=(0,l.useState)(0);(0,l.useEffect)(()=>{let e=()=>t(e=>e+1);return C.add(e),()=>void C.delete(e)},[]),(0,l.useEffect)(()=>{e&&null==w&&!k&&$()},[e]);let s=(0,l.useCallback)(()=>void $(),[]);return{servers:w??[],checked:null!=w,checking:null!=k,refresh:s}}(V),K=W?P.slice(W.prefix.length):P,X=e=>{let t=""===K||K.startsWith("/")||K.startsWith("?")?K:`/${K}`;return`${e}${t||(e.startsWith("{{")?"":"/")}`},J=t=>{let n=/^(https?:\/\/|\{\{)/i.test(t.trim())||""===K&&""!==t&&!/^[/?#]/.test(t);/^https?:\/\//i.test(t.trim())&&O(!0),s((0,d.e)(e,W&&!n?`${W.prefix}${t}`:t))},Z=(0,j.m)(x,J),G=H.servers,Y=[...G.map(e=>({value:`local:${e.scheme}:${e.port}`,label:`localhost:${e.port}`,hint:[e.name,e.scheme,e.selfSigned?"self-signed":""].filter(Boolean).join(" · "),text:`localhost ${e.port} ${e.name??""}`,className:"font-mono",group:"local",inline:!0})),...h.filter(e=>!G.some(t=>t.port===e)).map(e=>({value:`local:http:${e}`,label:`localhost:${e}`,hint:H.checked?"used before · not running now":"used before",text:`localhost ${e}`,className:"font-mono text-mute",group:"local",inline:!0}))];W?.value.startsWith("local:")&&!Y.some(e=>e.value===W.value)&&Y.unshift({value:W.value,label:W.text,hint:"in this request",text:W.text,className:"font-mono",group:"local",inline:!0});let Q=null!=W&&!W.value.startsWith("local:"),ee=[...I.length?[{id:"connections",label:"Connections",text:"connections",defaultOpen:!0}]:[],...F.length?[{id:"env",label:u?.name??"Variables",text:u?.name??"variables",defaultOpen:Q||null==W,action:c.length>1?{label:"switch",title:"Choose another environment",onClick:()=>setTimeout(()=>document.querySelector('button[role="combobox"][aria-label="Environment"]')?.click(),0)}:void 0}]:[],{id:"local",label:"Localhost",text:"localhost",hint:H.checking&&!H.checked?"checking…":`${G.length||"none"} running${H.checking?" · checking…":""}`,defaultOpen:!B.length&&null==W,action:{label:(0,t.jsx)(v.f,{size:12,"aria-hidden":!0,className:H.checking?"animate-spin":""}),title:"Check again for running servers",onClick:H.refresh,keepOpen:!0}}],et=W?"text-accent":_?"text-warn":"text-mute";return(0,t.jsxs)("div",{className:"flex flex-wrap items-stretch gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-[1_1_28rem] overflow-hidden rounded-lg border border-line bg-panel-2 focus-within:border-accent",children:[(0,t.jsx)(y.f,{label:"Method",value:e.method,onChange:t=>s({...e,method:t}),options:d.C.map(e=>({value:e,label:e,className:`font-mono font-medium ${R[e]}`})),minWidth:140,className:`shrink-0 border-r border-line px-3 font-mono text-sm font-medium outline-none focus-visible:bg-panel ${R[e.method]}`}),f?(0,t.jsxs)("form",{className:"flex shrink-0 items-center gap-1 border-r border-line px-2 font-mono text-xs",onSubmit:t=>{t.preventDefault(),(()=>{if(!f)return;let t=Number(f.port);!Number.isInteger(t)||t<1||t>65535||(L(t),p(D()),s((0,d.e)(e,X(`${f.scheme}://localhost:${t}`))),b(null))})()},onKeyDown:e=>"Escape"===e.key&&b(null),children:[(0,t.jsx)("button",{type:"button",title:"Switch between http and https",onClick:()=>b({...f,scheme:"http"===f.scheme?"https":"http"}),className:"rounded px-1 text-accent hover:bg-panel",children:f.scheme}),(0,t.jsx)("span",{className:"text-mute",children:"://localhost:"}),(0,t.jsx)("input",{ref:A,value:f.port,onChange:e=>b({...f,port:e.target.value.replace(/\D/g,"").slice(0,5)}),inputMode:"numeric",placeholder:"8080","aria-label":"Port",className:"w-14 rounded border border-line bg-panel px-1.5 py-0.5 text-ink outline-none focus:border-accent"}),(0,t.jsx)("button",{type:"submit","aria-label":"Use this port",className:"rounded p-0.5 text-accent hover:bg-panel",children:(0,t.jsx)(g.f,{size:14})}),(0,t.jsx)("button",{type:"button","aria-label":"Cancel",onClick:()=>b(null),className:"rounded p-0.5 text-mute hover:text-ink",children:(0,t.jsx)(r.X,{size:14})})]}):V?(0,t.jsx)(y.f,{label:"Base URL",value:W?.value??M,onChange:t=>{if(t===z)return b({scheme:"http",port:""});if(t===M)return s((0,d.e)(e,K));if(t.startsWith("local:")){let[,n,a]=t.split(":"),r=Number(a);return L(r),p(D()),s((0,d.e)(e,X(`${n}://localhost:${r}`)))}s((0,d.e)(e,X(`{{${t}}}`)))},onOpen:H.refresh,minWidth:320,buttonContent:W?.text??"Base URL",groups:ee,options:[...I.map(([e,t,s])=>({value:e,label:`{{${e}}}`,hint:`${s} \xb7 ${t}`,text:`${e} ${s}`,className:"font-mono text-accent",group:"connections"})),...F.map(([e,t])=>({value:e,label:`{{${e}}}`,hint:t,text:e,className:"font-mono text-accent",group:"env"})),...Y,{value:z,label:"Another port…",text:"another port",group:"local"},{value:M,label:"No base URL — type the whole address",text:"no"}],className:`shrink-0 border-r border-line px-2.5 font-mono text-xs outline-none focus-visible:bg-panel ${et}`}):null,(0,t.jsx)("label",{className:"sr-only",htmlFor:"request-url",children:"Request URL"}),(0,t.jsx)("input",{...Z.handlers,ref:x,id:"request-url",value:K,spellCheck:!1,autoComplete:"off",onChange:e=>J(e.target.value),onKeyDown:e=>void Z.onKeyDown(e),onBlur:()=>{O(!1),Z.handlers.onBlur()},onPaste:t=>{let a=(0,d.X)(e,t.clipboardData.getData("text"));a&&(t.preventDefault(),s(a.draft),a.note&&n?.(a.note))},placeholder:W?"/path — after the base URL":"Paste a URL or a curl command, or type a /path",className:"min-w-0 flex-1 bg-transparent px-3 py-2.5 font-mono text-sm text-ink outline-none placeholder:text-mute"})]}),Z.popup,(0,t.jsx)("div",{className:"flex shrink-0 gap-2",children:a})]})});e.s(["f",0,O],44794);var A=e.i(99522);let P=(0,A.f)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);e.s(["f",0,P],54792);let U=(0,A.f)("wrap-text",[["path",{d:"m16 16-2 2 2 2",key:"kkc6pm"}],["path",{d:"M3 12h15a3 3 0 1 1 0 6h-4",key:"1cl7v7"}],["path",{d:"M3 18h7",key:"sq21v6"}],["path",{d:"M3 6h18",key:"d0wm0j"}]]);e.s(["f",0,U],88871);var F=e.i(75606),I=e.i(89932);let B=(0,A.f)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["f",0,B],36620);let W=(0,A.f)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["f",0,W],73436);var _=e.i(42967),V=e.i(56396);let H="apitestcenter-code-target";e.s(["B",0,function({cookies:e}){let[s,n]=(0,l.useState)(!1);return(0,t.jsxs)("div",{className:"space-y-2 overflow-auto",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Set by this answer",e.length>1?" and the redirects on the way":"",". With the cookie jar on, they go with the next requests to the same site."]}),(0,t.jsxs)("button",{type:"button",onClick:()=>n(e=>!e),"aria-pressed":s,className:"inline-flex shrink-0 items-center gap-1 rounded-md border border-line px-2 py-1 text-xs text-mute hover:text-ink",children:[s?(0,t.jsx)(W,{size:12,"aria-hidden":!0}):(0,t.jsx)(B,{size:12,"aria-hidden":!0}),s?"Hide values":"Show values"]})]}),(0,t.jsx)("div",{className:"overflow-auto rounded-md border border-line",children:(0,t.jsxs)("table",{className:"w-full text-left text-[13px]",children:[(0,t.jsx)("thead",{className:"bg-panel-2 text-xs text-mute",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"px-3 py-1.5 font-normal",children:"Name"}),(0,t.jsx)("th",{className:"px-3 py-1.5 font-normal",children:"Value"}),(0,t.jsx)("th",{className:"px-3 py-1.5 font-normal",children:"Domain · path"}),(0,t.jsx)("th",{className:"px-3 py-1.5 font-normal",children:"Expires"}),(0,t.jsx)("th",{className:"px-3 py-1.5 font-normal",children:"Flags"})]})}),(0,t.jsx)("tbody",{children:e.map((e,n)=>{var a;return(0,t.jsxs)("tr",{className:"border-t border-line align-top",children:[(0,t.jsx)("td",{className:"px-3 py-1.5 font-mono text-ink",children:e.name}),(0,t.jsx)("td",{className:`max-w-[16rem] px-3 py-1.5 font-mono break-all ${s?"text-ink":"text-mute italic"}`,children:s?e.value||"(empty)":F.Z}),(0,t.jsxs)("td",{className:"px-3 py-1.5 font-mono text-xs text-mute",children:[e.domain??"this host"," · ",e.path??"/"]}),(0,t.jsx)("td",{className:"px-3 py-1.5 text-xs text-mute",children:void 0!==e.maxAge?e.maxAge<=0?"deleted":`in ${(a=e.maxAge)<120?`${a} s`:a<7200?`${Math.round(a/60)} min`:a<172800?`${Math.round(a/3600)} h`:`${Math.round(a/86400)} days`}`:e.expires?new Date(e.expires).toLocaleString():"when the app closes"}),(0,t.jsx)("td",{className:"px-3 py-1.5 text-xs text-mute",children:[e.httpOnly?"HttpOnly":"",e.secure?"Secure":"",e.sameSite?`SameSite=${e.sameSite}`:""].filter(Boolean).join(" · ")||"—"})]},n)})})]})})]})},"x",0,function({sent:e}){let s=(0,V.d)(),[n,a]=(0,l.useState)(!1),[r,i]=(0,l.useState)("curl");(0,l.useEffect)(()=>i(function(){try{let e=localStorage.getItem(H);if(F.X.some(t=>t.id===e))return e}catch{}return"curl"}()),[]);let o=(0,l.useMemo)(()=>n?e:(0,F.A)(e),[e,n]),c=(0,l.useMemo)(()=>(0,F.T)(r,o),[r,o]),d=(0,l.useMemo)(()=>JSON.stringify((0,F.A)(e))!==JSON.stringify(e),[e]),u=(e,t)=>{navigator.clipboard.writeText(e),s(`${t} copied`,"success")};return(0,t.jsxs)("div",{className:"space-y-4 overflow-auto",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("p",{className:"min-w-0 flex-1 font-mono text-[13px] break-all text-ink",children:[(0,t.jsx)("span",{className:"mr-2 font-medium text-accent",children:o.method}),o.url]}),d?(0,t.jsxs)("button",{type:"button",onClick:()=>a(e=>!e),"aria-pressed":n,className:"inline-flex shrink-0 items-center gap-1 rounded-md border border-line px-2 py-1 text-xs text-mute hover:text-ink",children:[n?(0,t.jsx)(W,{size:12,"aria-hidden":!0}):(0,t.jsx)(B,{size:12,"aria-hidden":!0}),n?"Hide secrets":"Show secrets"]}):null]}),e.authNote||e.redirects?.length?(0,t.jsxs)("div",{className:"space-y-1 text-xs text-mute",children:[e.authNote?(0,t.jsxs)("p",{className:"flex items-start gap-1.5",children:[(0,t.jsx)(_.f,{size:12,className:"mt-0.5 shrink-0","aria-hidden":!0}),e.authNote,"."]}):null,e.redirects?.length?(0,t.jsxs)("div",{children:["Then followed ",1===e.redirects.length?"a redirect":`${e.redirects.length} redirects`,":",(0,t.jsx)("ul",{className:"mt-0.5 space-y-0.5 font-mono",children:e.redirects.map((e,s)=>(0,t.jsxs)("li",{className:"break-all",children:["→ ",e]},s))})]}):null]}):null,(0,t.jsxs)("section",{"aria-label":"Headers sent",children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center justify-between",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-mute",children:"Headers"}),(0,t.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 text-xs text-mute hover:text-ink",onClick:()=>u(o.headers.map(([e,t])=>`${e}: ${t}`).join("\n"),"Headers"),children:[(0,t.jsx)(I.f,{size:12})," Copy"]})]}),(0,t.jsx)("div",{className:"overflow-auto rounded-md border border-line",children:(0,t.jsx)("table",{className:"w-full text-left text-[13px]",children:(0,t.jsx)("tbody",{children:o.headers.map(([e,s],n)=>(0,t.jsxs)("tr",{className:"border-t border-line first:border-t-0",children:[(0,t.jsx)("th",{scope:"row",className:"w-2/5 bg-panel-2 px-3 py-1.5 align-top font-mono font-normal text-mute",children:e}),(0,t.jsx)("td",{className:`px-3 py-1.5 font-mono break-all ${s.includes(F.Z)?"text-mute italic":"text-ink"}`,children:s})]},n))})})})]}),(0,t.jsxs)("section",{"aria-label":"Body sent",children:[(0,t.jsx)("h3",{className:"mb-1.5 text-xs font-medium text-mute",children:"Body"}),void 0===e.body?(0,t.jsx)("p",{className:"text-xs text-mute",children:"No body."}):(0,t.jsxs)("pre",{className:"max-h-64 overflow-auto rounded-md border border-line bg-panel-2 p-3 font-mono text-[13px] leading-5 break-words whitespace-pre-wrap text-ink",children:[o.body,e.bodyTruncated?(0,t.jsxs)("span",{className:"text-warn",children:["\n","… the first 20 MB shown"]}):null]})]}),(0,t.jsxs)("section",{"aria-label":"Code",children:[(0,t.jsxs)("div",{className:"mb-1.5 flex flex-wrap items-center gap-2",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-mute",children:"Code"}),(0,t.jsx)(y.f,{label:"Language",value:r,onChange:e=>{i(e);try{localStorage.setItem(H,e)}catch{}},options:F.X.map(e=>({value:e.id,label:e.label})),minWidth:180,className:"rounded-md border border-line bg-panel-2 px-2 py-1 text-xs text-ink outline-none focus-visible:border-accent"}),(0,t.jsxs)("button",{type:"button",className:"ml-auto inline-flex items-center gap-1 text-xs text-mute hover:text-ink",onClick:()=>u(c,"Code"),children:[(0,t.jsx)(I.f,{size:12})," Copy"]})]}),(0,t.jsx)("pre",{"aria-label":`${F.X.find(e=>e.id===r)?.label} code`,className:"max-h-96 overflow-auto rounded-md border border-line bg-panel-2 p-3 font-mono text-[12.5px] leading-5 whitespace-pre text-ink",children:c}),(0,t.jsxs)("p",{className:"mt-1.5 text-xs text-mute",children:[n||!d?"":`Secrets show as ${F.Z} — choose Show secrets to put the real values in. `,"curl"===r&&e.body&&/[^\x00-\x7f]/.test(e.body)?"On Windows, curl.exe can garble non-English letters in the command line — use the PowerShell code there, or save the body to a file and send it with --data-binary @file. ":"",e.authNote&&/signed|challenge|three requests/.test(e.authNote)?"A signature or challenge answer is only good for this one request; sent again later, the server may refuse it.":e.authNote?.startsWith("OAuth 2.0")?"The token expires; the code works until it does.":""]})]})]})}],12580);let K=(0,A.f)("arrow-down-left",[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]]);e.s(["f",0,K],55680)},60566,97716,68228,65638,46679,e=>{var t=e.i(72587),s=e.i(95486),n=e.i(60961),a=e.i(54792),r=e.i(89932),l=e.i(75117),i=e.i(88293),o=e.i(88871),c=e.i(55218),d=e.i(28867),u=e.i(13318),m=e.i(56396),x=e.i(15060),h=e.i(12580),p=e.i(55680),f=e.i(20738),b=e.i(42967),g=e.i(50962),v=e.i(42709),j=e.i(10281);let y={async connect(e){let t=await fetch("/engine/realtime/ws",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),s=await t.json();if(!t.ok||!s.id)throw Error(s.error??`Could not connect (${t.status})`);return{id:s.id}},close:e=>fetch(`/engine/realtime/${e}/close`,{method:"POST"}).catch(()=>void 0)};function N({id:e,onClosed:s}){let n=(0,m.d)(),[a,l]=(0,c.useState)([]),[o,d]=(0,c.useState)(null),[u,x]=(0,c.useState)(!1),[h,w]=(0,c.useState)(""),[k,C]=(0,c.useState)(""),[$,S]=(0,c.useState)(!0),q=(0,c.useRef)(null),E=(0,c.useRef)(0),M=(0,c.useRef)(s);M.current=s,(0,c.useEffect)(()=>{l([]),d(null),x(!1),E.current=0;let t=!0,s=0,n=async()=>{try{let s=await fetch(`/engine/realtime/${e}?since=${E.current}`,{cache:"no-store"});if(404===s.status)return void x(!0);let n=await s.json();if(!t)return;if(E.current=n.next,n.events.length&&l(e=>[...e,...n.events].slice(-2e3)),d({kind:n.kind,url:n.url,status:n.status,dropped:n.dropped}),"closed"===n.status)return void M.current?.()}catch{}t&&(s=window.setTimeout(()=>void n(),350))};return n(),()=>{t=!1,window.clearTimeout(s)}},[e]),(0,c.useEffect)(()=>{$&&q.current?.lastElementChild?.scrollIntoView({block:"nearest"})},[a,$]);let z=(0,c.useMemo)(()=>k?a.filter(e=>e.text.toLowerCase().includes(k.toLowerCase())||(e.event??"").toLowerCase().includes(k.toLowerCase())):a,[a,k]),T=(0,c.useMemo)(()=>({in:a.filter(e=>"in"===e.dir).length,out:a.filter(e=>"out"===e.dir).length}),[a]),R=o?.status==="open",D=o?.kind==="ws",L=async()=>{if(!h.trim()||!R)return;let t=await fetch(`/engine/realtime/${e}/send`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:h})});t.ok||n((await t.json().catch(()=>({}))).error??"Could not send","error")};return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5",children:[(0,t.jsx)("span",{className:`rounded-md border px-2 py-0.5 font-mono text-sm ${u?"border-line text-mute":R?"border-ok/40 bg-ok/10 text-ok":o?.status==="connecting"?"border-accent/40 text-accent":"border-line text-mute"}`,children:u?"Gone":R?D?"Connected":"Receiving":o?.status==="connecting"?"Connecting…":"Closed"}),(0,t.jsxs)("span",{className:"text-xs text-mute",children:[D?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-ink",children:T.in})," received · ",(0,t.jsx)("span",{className:"text-ink",children:T.out})," sent"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-ink",children:T.in})," events"]}),o?.dropped?` \xb7 first ${o.dropped} no longer kept`:""]}),(0,t.jsxs)("label",{className:"ml-auto flex items-center gap-1 rounded-md border border-line bg-panel px-1.5",children:[(0,t.jsx)(i.f,{size:12,className:"text-mute","aria-hidden":!0}),(0,t.jsx)("input",{value:k,onChange:e=>C(e.target.value),"aria-label":"Filter messages",placeholder:"Filter",className:"w-28 bg-transparent py-1 text-xs text-ink outline-none"})]}),(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-mute",children:[(0,t.jsx)("input",{type:"checkbox",checked:$,onChange:e=>S(e.target.checked),className:"accent-[var(--accent)]"}),"Follow"]}),R?(0,t.jsxs)("button",{type:"button",onClick:()=>void y.close(e),className:"inline-flex items-center gap-1 rounded-md border border-line px-2 py-1 text-xs text-mute hover:text-ink",children:[(0,t.jsx)(j.f,{size:12,"aria-hidden":!0})," ",D?"Disconnect":"Stop"]}):null]}),o?.url?(0,t.jsx)("p",{className:"font-mono text-xs break-all text-mute",children:o.url}):null,(0,t.jsxs)("ol",{ref:q,"aria-label":D?"Messages":"Events","aria-live":"polite",className:"min-h-[14rem] flex-1 space-y-1 overflow-auto rounded-md border border-line bg-panel-2 p-2",children:[0===z.length?(0,t.jsx)("li",{className:"p-2 text-xs text-mute",children:k?"Nothing matches the filter.":D?"No messages yet.":"No events yet."}):null,z.map((e,s)=>{let a;return(0,t.jsxs)("li",{className:`group flex gap-2 rounded px-1.5 py-1 text-[12.5px] ${"error"===e.dir?"bg-bad/10":"out"===e.dir?"bg-accent/5":""}`,children:[(0,t.jsx)("span",{className:"w-14 shrink-0 pt-0.5 text-right font-mono text-[11px] text-mute tabular",children:(a=e.at/1e3)<60?`${a.toFixed(2)} s`:`${Math.floor(a/60)}:${String(Math.floor(a%60)).padStart(2,"0")}`}),(0,t.jsx)("span",{className:"shrink-0 pt-0.5","aria-label":"in"===e.dir?"received":"out"===e.dir?"sent":e.dir,children:"in"===e.dir?(0,t.jsx)(p.f,{size:13,className:"text-ok"}):"out"===e.dir?(0,t.jsx)(f.f,{size:13,className:"text-accent"}):"error"===e.dir?(0,t.jsx)(v.f,{size:13,className:"text-bad"}):(0,t.jsx)(b.f,{size:13,className:"text-mute"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[e.event||e.id?(0,t.jsxs)("span",{className:"mr-2 font-mono text-[11px] text-mute",children:[e.event?`event: ${e.event}`:"",e.id?` id: ${e.id}`:""]}):null,(0,t.jsx)("span",{className:`block font-mono break-words whitespace-pre-wrap ${"info"===e.dir?"text-mute":"error"===e.dir?"text-bad":"text-ink"}`,children:"in"===e.dir||"out"===e.dir?function(e){let t=e.trim();if(!(t.startsWith("{")||t.startsWith("[")))return e;try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}}(e.text):e.text})]}),"in"===e.dir||"out"===e.dir?(0,t.jsx)("button",{type:"button","aria-label":"Copy message",onClick:()=>{navigator.clipboard.writeText(e.text),n("Message copied","success")},className:"shrink-0 self-start rounded p-0.5 text-mute opacity-0 group-hover:opacity-100 hover:text-ink focus:opacity-100",children:(0,t.jsx)(r.f,{size:12})}):null]},s)})]}),D?(0,t.jsxs)("form",{className:"flex items-end gap-2",onSubmit:e=>{e.preventDefault(),L()},children:[(0,t.jsxs)("label",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"sr-only",children:"Message to send"}),(0,t.jsx)("textarea",{value:h,onChange:e=>w(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),L())},rows:Math.min(8,Math.max(2,h.split("\n").length)),disabled:!R,placeholder:R?'{ "type": "subscribe", "channel": "orders" } — Ctrl+Enter sends':"Connect to send messages",spellCheck:!1,className:"w-full resize-y rounded-md border border-line bg-panel-2 px-3 py-2 font-mono text-[13px] text-ink outline-none focus:border-accent disabled:opacity-50"})]}),(0,t.jsxs)("button",{type:"submit",disabled:!R||!h.trim(),className:"btn btn-primary py-2",children:[(0,t.jsx)(g.f,{size:14})," Send"]})]}):null]})}e.s(["d",0,N,"D",0,y],97716);var w=e.i(19656),k=e.i(61230);let C="apitestcenter-show-big-answers",$={200:"OK",201:"Created",202:"Accepted",204:"No Content",301:"Moved Permanently",302:"Found",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",408:"Request Timeout",409:"Conflict",415:"Unsupported Media Type",422:"Unprocessable Content",429:"Too Many Requests",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"};function S(e){return e>=200&&e<300?"text-ok border-ok/40 bg-ok/10":e>=300&&e<400?"text-accent border-accent/40 bg-accent/10":e>=400&&e<500?"text-warn border-warn/40 bg-warn/10":"text-bad border-bad/40 bg-bad/10"}function q({logs:e}){return(0,t.jsx)("ol",{"aria-label":"Script console",className:"overflow-auto rounded-md border border-line bg-panel-2 p-2 font-mono text-[12.5px] leading-5",children:e.map((e,s)=>(0,t.jsxs)("li",{className:"flex gap-2 border-t border-line/50 px-1 py-0.5 first:border-t-0",children:[(0,t.jsx)("span",{className:"w-24 shrink-0 whitespace-nowrap text-mute",children:"pre"===e.phase?"pre-request":"tests"}),(0,t.jsx)("span",{className:"min-w-0 break-words whitespace-pre-wrap text-ink",children:e.text})]},s))})}function E({label:e,value:s}){return(0,t.jsxs)("span",{className:"text-xs text-mute",children:[e," ",(0,t.jsx)("span",{className:"font-mono text-sm text-ink",children:s})]})}function M({message:e,onWaitLonger:s}){let n,a,r,{title:l,tip:i}=(n=e.toLowerCase(),(a=/^No answer within (\S+)/.exec(e))?{title:`No answer in ${a[1]}`,tip:"The server is reachable but slow: it didn't answer within this request's timeout. Wait longer and send again, or change what new requests wait in Settings → Requests."}:n.includes("econnrefused")?{title:"Connection refused",tip:"Nothing is listening on that host and port. Is the server running, and is the port right?"}:n.includes("enotfound")||n.includes("eai_again")?{title:"Host not found",tip:"DNS could not resolve the host name. Check the spelling, or connect to the VPN for internal hosts."}:n.includes("timeout")||n.includes("etimedout")||n.includes("und_err_headers_timeout")?{title:"Timed out",tip:"The server did not answer in time. Raise Timeout under Settings, or check that the host is reachable."}:n.includes("certificate")||n.includes("self-signed")||n.includes("unable to verify")||n.includes("cert_")?{title:"TLS certificate rejected",tip:"The certificate is not trusted. For a lab certificate, turn on 'Skip TLS certificate check' under Settings."}:n.includes("econnreset")||n.includes("socket hang up")?{title:"Connection reset",tip:"The server closed the connection mid-request. Check the server logs, or a proxy or firewall in between."}:n.includes("engine")?{title:"Engine problem",tip:"The local engine did not answer. Make sure pnpm dev is running."}:{title:"Request failed",tip:"See the details below."}),o=/^No answer within (\S+)/.exec(e)?.[1],c=o&&s?(r=e=>{let t=/^(\d+)(ms|s|m)$/.exec(e.trim());return t?Number(t[1])*("ms"===t[2]?1:"s"===t[2]?1e3:6e4):0},["2m","5m","10m","30m"].filter(e=>r(e)>r(o)).slice(0,2)):[];return(0,t.jsxs)("div",{role:"alert",className:"mt-3 rounded-md border border-bad/40 bg-bad/10 px-3 py-2.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-bad",children:l}),(0,t.jsx)("p",{className:"mt-1 text-sm text-ink",children:i}),c.length?(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:c.map((e,n)=>(0,t.jsxs)("button",{type:"button",className:`btn ${0===n?"btn-primary":"btn-secondary"} py-1 text-xs`,onClick:()=>s(e),children:["Wait up to ",e," and send again"]},e))}):null,(0,t.jsx)("p",{className:"mt-2 font-mono text-xs break-all text-mute",children:e})]})}function z({headers:e}){let s=(0,m.d)(),n=Object.entries(e).sort(([e],[t])=>e.localeCompare(t));return 0===n.length?(0,t.jsx)("p",{className:"text-sm text-mute",children:"No headers."}):(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 text-xs text-mute hover:text-ink",onClick:()=>{navigator.clipboard.writeText(n.map(([e,t])=>`${e}: ${t}`).join("\n")),s("Headers copied","success")},children:[(0,t.jsx)(r.f,{size:12})," Copy all"]})}),(0,t.jsx)("div",{className:"overflow-auto rounded-md border border-line",children:(0,t.jsx)("table",{className:"w-full text-left text-[13px]",children:(0,t.jsx)("tbody",{children:n.map(([e,s])=>(0,t.jsxs)("tr",{className:"border-t border-line first:border-t-0",children:[(0,t.jsx)("th",{scope:"row",className:"w-2/5 bg-panel-2 px-3 py-1.5 align-top font-mono font-normal text-mute",children:e}),(0,t.jsx)("td",{className:`px-3 py-1.5 font-mono break-all ${"[redacted]"===s?"text-mute italic":"text-ink"}`,children:s})]},e))})})}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"Cookie and authorization headers are hidden here — see Cookies, and Request sent."})]})}function T({body:e,contentType:n,truncated:u,url:h,base64:p}){let f=(0,m.d)(),b=function(e,t){let s=t.toLowerCase();if(s.startsWith("image/"))return"image";if(s.includes("json"))return"json";if(s.includes("html"))return"html";if(s.includes("xml"))return"xml";let n=e.trim();if(n.startsWith("{")||n.startsWith("["))try{return JSON.parse(n),"json"}catch{}return/^<!doctype html|^<html/i.test(n)?"html":n.startsWith("<")?"xml":"text"}(e,n),g="image"===b&&p?`data:${n.split(";")[0]};base64,${p}`:null,v=u||e.length>=2e5,[j,y]=(0,c.useState)("pretty"),[N,k]=(0,c.useState)(!0),[$,S]=(0,c.useState)(""),[q,E]=(0,c.useState)(0),[M,z]=(0,c.useState)(!1),A=(0,c.useRef)(null),P=(0,c.useRef)(null),[U,F]=(0,c.useState)(!1);(0,c.useEffect)(()=>{try{F("1"===localStorage.getItem(C))}catch{}},[e]),(0,c.useEffect)(()=>{y("image"===b?"preview":"pretty"),S(""),E(0)},[e,b]);let I=(0,c.useMemo)(()=>e?"raw"===j?e:function(e,t){if("json"!==t)return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}(e,b):"",[e,j,b]),B=(0,c.useMemo)(()=>(function(e,t){if(!t)return 0;let s=e.toLowerCase(),n=t.toLowerCase(),a=0;for(let e=s.indexOf(n);e>=0&&a<1e4;e=s.indexOf(n,e+n.length))a++;return a})(I,$),[I,$]);function W(e){0!==B&&E(t=>(t+e+B)%B)}(0,c.useEffect)(()=>{let e=P.current?.querySelector("mark.current");e?.scrollIntoView({block:"center"})},[q,$,j]);let _=g?[{value:"preview",label:"Preview"},{value:"raw",label:"Raw"}]:[{value:"pretty",label:"Pretty"},{value:"raw",label:"Raw"},..."html"===b?[{value:"preview",label:"Preview"}]:[]];return e?e.length>2097152&&!U?(0,t.jsxs)("div",{role:"region","aria-label":"A big answer",className:"flex flex-1 flex-col items-center justify-center gap-3 rounded-md border border-line bg-panel-2 px-6 py-10 text-center",children:[(0,t.jsxs)("p",{className:"text-sm text-ink",children:["This answer is ",(0,w.L)(e.length),u?" (cut at 20 MB)":"","."]}),(0,t.jsx)("p",{className:"max-w-sm text-xs text-mute",children:"Showing it can take the app a few seconds. Checks and Save values already used all of it."}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-center gap-2",children:[(0,t.jsx)("button",{type:"button",className:"btn btn-primary py-1.5 text-sm",onClick:()=>F(!0),children:"Show it"}),(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:()=>{y("raw"),F(!0)},children:"As plain text"}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:()=>(0,x.N)(L(h,b),e,O(b)),children:[(0,t.jsx)(l.f,{size:14}),"Save to file"]})]}),(0,t.jsx)("button",{type:"button",className:"text-xs text-mute hover:text-ink",onClick:()=>{try{localStorage.setItem(C,"1")}catch{}F(!0)},children:"Always show big answers"})]}):(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-md border border-line bg-panel-2",onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&"f"===e.key.toLowerCase()&&(e.preventDefault(),z(!0),window.setTimeout(()=>A.current?.focus(),0))},children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-line px-2 py-1.5",children:[(0,t.jsx)(d.f,{label:"Body view",value:j,onChange:y,options:_}),(0,t.jsx)("span",{className:"rounded border border-line px-1.5 py-0.5 font-mono text-xs text-mute uppercase",children:b}),u?(0,t.jsx)("span",{className:"text-xs text-warn",children:"Over 20 MB: the first 20 MB shown"}):null,(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[M?(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-md border border-line bg-panel px-1.5",children:[(0,t.jsx)(i.f,{size:12,className:"text-mute"}),(0,t.jsx)("input",{ref:A,value:$,"aria-label":"Find in body",placeholder:"Find",onChange:e=>{S(e.target.value),E(0)},onKeyDown:e=>{"Enter"===e.key&&W(e.shiftKey?-1:1),"Escape"===e.key&&(S(""),z(!1))},className:"w-28 bg-transparent py-1 text-xs text-ink outline-none"}),(0,t.jsx)("span",{className:"font-mono text-xs text-mute tabular",children:$?`${B?q+1:0}/${B}`:""}),(0,t.jsx)(R,{label:"Previous match",onClick:()=>W(-1),children:(0,t.jsx)(a.f,{size:12})}),(0,t.jsx)(R,{label:"Next match",onClick:()=>W(1),children:(0,t.jsx)(s.f,{size:12})})]}):(0,t.jsx)(R,{label:"Find in body (Ctrl+F)",onClick:()=>{z(!0),window.setTimeout(()=>A.current?.focus(),0)},children:(0,t.jsx)(i.f,{size:14})}),(0,t.jsx)(R,{label:N?"Turn off line wrap":"Wrap long lines",pressed:N,onClick:()=>k(e=>!e),children:(0,t.jsx)(o.f,{size:14})}),(0,t.jsx)(R,{label:"Copy body",onClick:()=>{navigator.clipboard.writeText(I),f("Body copied","success")},children:(0,t.jsx)(r.f,{size:14})}),(0,t.jsx)(R,{label:"Download body",onClick:()=>g&&p?(0,x.h)(L(h,b,n),new Blob([Uint8Array.from(atob(p),e=>e.charCodeAt(0))],{type:n.split(";")[0]})):(0,x.N)(L(h,b),I,O(b)),children:(0,t.jsx)(l.f,{size:14})})]})]}),"preview"===j&&g?(0,t.jsx)("div",{className:"flex min-h-[12rem] flex-1 items-center justify-center overflow-auto p-3",children:(0,t.jsx)("img",{src:g,alt:"Response image",className:"max-h-[32rem] max-w-full object-contain"})}):"preview"===j?(0,t.jsx)("iframe",{title:"HTML preview",sandbox:"",srcDoc:e,className:"min-h-[24rem] w-full flex-1 bg-white"}):(0,t.jsx)("pre",{ref:P,tabIndex:0,"aria-label":"Response body",className:`min-h-[12rem] flex-1 overflow-auto p-3 font-mono text-[13px] leading-5 text-ink ${N?"break-words whitespace-pre-wrap":"whitespace-pre"}`,children:$?function(e,s,n){let a=[],r=e.toLowerCase(),l=s.toLowerCase(),i=0,o=0;for(let s=r.indexOf(l);s>=0&&o<1e4;s=r.indexOf(l,s+l.length))a.push(e.slice(i,s)),a.push((0,t.jsx)("mark",{className:`find-hit${o===n?" current":""}`,children:e.slice(s,s+l.length)},s)),i=s+l.length,o++;return a.push(e.slice(i)),a}(I,$,q):"pretty"!==j||"json"!==b||v?I:function(e){let s=[],n=0;for(let a of e.matchAll(D)){let r=a.index??0;s.push(e.slice(n,r)),a[1]?(s.push((0,t.jsx)("span",{className:a[2]?"tok-key":"tok-str",children:a[1]},r)),a[2]&&s.push(a[2])):a[3]?s.push((0,t.jsx)("span",{className:"tok-lit",children:a[3]},r)):s.push((0,t.jsx)("span",{className:"tok-num",children:a[4]},r)),n=r+a[0].length}return s.push(e.slice(n)),s}(I)})]}):(0,t.jsx)("p",{className:"text-sm text-mute",children:"Empty body."})}function R({label:e,onClick:s,children:n,pressed:a}){return(0,t.jsx)("button",{type:"button","aria-label":e,title:e,"aria-pressed":a,onClick:s,className:`rounded p-1 hover:bg-panel hover:text-ink ${a?"text-accent":"text-mute"}`,children:n})}let D=/("(?:\\u[a-fA-F0-9]{4}|\\[^u]|[^\\"])*")(\s*:)?|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g;function L(e,t,s=""){let n="response";try{n=new URL(e).pathname.split("/").filter(Boolean).pop()||"response"}catch{}let a="json"===t?"json":"html"===t?"html":"xml"===t?"xml":"image"===t?/svg/.test(s)?"svg":s.split("/")[1]?.split(/[;+]/)[0]?.replace("jpeg","jpg")||"img":"txt";return`${n.replace(/[^\w.-]+/g,"_")}.${a}`}function O(e){return"json"===e?"application/json":"html"===e?"text/html":"xml"===e?"application/xml":"text/plain"}function A({url:e}){let s=(0,m.d)(),[a,l]=(0,c.useState)(!1),i=(0,k.f)(e);return(0,t.jsxs)("div",{role:"group","aria-label":"The address that answered",className:"mt-2 flex items-start gap-1 font-mono text-xs text-mute",children:[(0,t.jsx)("button",{type:"button",onClick:()=>l(e=>!e),"aria-expanded":a,"aria-label":a?"Show the address on one line":"Show the whole address",className:"mt-px shrink-0 rounded text-mute hover:text-ink",children:(0,t.jsx)(n.f,{size:13,"aria-hidden":!0,className:`transition-transform ${a?"rotate-90":""}`})}),(0,t.jsx)("span",{onClick:()=>l(!0),className:`min-w-0 flex-1 ${a?"break-all whitespace-pre-wrap":"cursor-pointer truncate"}`,children:i}),(0,t.jsx)("button",{type:"button",title:"Copy the URL","aria-label":"Copy the URL",onClick:()=>void navigator.clipboard.writeText(i).then(()=>s("Copied the URL","success"),()=>s("Could not copy","error")),className:"shrink-0 rounded p-0.5 text-mute hover:text-ink",children:(0,t.jsx)(r.f,{size:12,"aria-hidden":!0})})]})}e.s(["p",0,function({result:e,onSaveExample:s,extra:n,onWaitLonger:a}){var r;let l,[i,o]=(0,c.useState)("body"),d=e.logs??[],m=e.cookies??[],x=("console"!==i||d.length)&&("cookies"!==i||m.length)&&("request"!==i||e.sent)&&("checks"!==i||(e.checks??[]).length)?i:"body",p=e.checks??[],f=p.filter(e=>e.ok).length,b=Object.keys(e.headers).length,g=(l=Object.keys(r=e.headers).find(e=>"content-type"===e.toLowerCase()))?r[l]??"":"",v=(0,c.useMemo)(()=>new TextEncoder().encode(e.body).length,[e.body]),j=!e.status;return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[(0,t.jsx)("span",{className:`rounded-md border px-2 py-0.5 font-mono text-sm font-medium ${S(e.status)}`,children:j?"Error":`${e.status} ${$[e.status]??""}`.trim()}),(0,t.jsx)(E,{label:"Time",value:`${e.durationMs} ms`}),j?null:(0,t.jsx)(E,{label:"Size",value:`${(0,w.L)(v)}${e.truncated?"+":""}`}),g?(0,t.jsx)(E,{label:"Type",value:g.split(";")[0]??g}):null,p.length?(0,t.jsxs)("button",{type:"button",onClick:()=>o("checks"),className:`rounded-md border px-2 py-0.5 text-xs ${f===p.length?"border-ok/40 text-ok":"border-bad/40 text-bad"}`,children:[f===p.length?"✓":"✕"," ",f,"/",p.length," checks"]}):null,n?(0,t.jsx)("span",{className:s&&!j?"":"ml-auto",children:n}):null,s&&!j?(0,t.jsx)("button",{type:"button",onClick:s,title:"Use this answer as what the mock server answers for this request",className:"ml-auto rounded-md border border-line px-2 py-0.5 text-xs text-mute hover:border-accent hover:text-ink",children:"Save as example"}):null]}),(0,t.jsx)(A,{url:e.url}),e.setup||e.dataRow?(0,t.jsxs)("p",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-mute",children:[e.setup?(0,t.jsxs)("span",{className:e.setup.ok?"":"text-bad",children:["Ran first: ",(0,t.jsx)("span",{className:"text-ink",children:e.setup.label}),e.setup.status?` \xb7 ${e.setup.status} \xb7 ${e.setup.durationMs} ms`:"",e.setup.values.map(e=>(0,t.jsxs)("span",{className:`ml-2 font-mono ${e.found?"text-ok":"text-bad"}`,title:e.found?`From ${e.from}: ${e.preview}`:`Not found: ${e.from}`,children:[e.found?"✓":"✕"," ",`{{${e.name}}}`]},e.name))]}):null,e.dataRow?(0,t.jsxs)("span",{children:["Test data: row ",e.dataRow.row," of ",e.dataRow.of.toLocaleString()]}):null]}):null,e.error?(0,t.jsx)(M,{message:e.error,onWaitLonger:a}):null,j&&e.sent?(0,t.jsxs)("details",{className:"mt-3 text-sm",children:[(0,t.jsx)("summary",{className:"cursor-pointer text-xs text-mute hover:text-ink",children:"What was sent"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(h.x,{sent:e.sent})})]}):null,j?null:(0,t.jsxs)("div",{className:"mt-3 flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)(u.i,{id:"response",label:"Response",value:x,onChange:o,items:[{id:"body",label:"Body"},{id:"headers",label:"Headers",badge:b||void 0},...m.length?[{id:"cookies",label:"Cookies",badge:m.length}]:[],...p.length?[{id:"checks",label:"Checks",badge:(0,t.jsxs)("span",{className:f===p.length?"text-ok":"text-bad",children:[f,"/",p.length]})}]:[],...e.sent?[{id:"request",label:"Request sent"}]:[],...d.length?[{id:"console",label:"Console",badge:d.length}]:[]]}),(0,t.jsx)("div",{...(0,u.q)("response",x),className:"flex min-h-0 flex-1 flex-col pt-3",children:"body"===x?e.streamId?(0,t.jsx)(N,{id:e.streamId}):(0,t.jsx)(T,{body:e.body,contentType:g,truncated:e.truncated,url:e.url,base64:e.bodyBase64}):"cookies"===x?(0,t.jsx)(h.B,{cookies:m}):"console"===x?(0,t.jsx)(q,{logs:d}):"request"===x&&e.sent?(0,t.jsx)(h.x,{sent:e.sent}):"checks"===x?(0,t.jsx)("ul",{className:"space-y-1.5",children:p.map((e,s)=>(0,t.jsxs)("li",{className:`flex items-center gap-2 rounded-md border px-3 py-2 text-sm ${e.ok?"border-ok/30 bg-ok/5":"border-bad/40 bg-bad/10"}`,children:[(0,t.jsx)("span",{className:e.ok?"text-ok":"text-bad","aria-hidden":!0,children:e.ok?"✓":"✕"}),(0,t.jsxs)("span",{className:"min-w-0",children:[(0,t.jsx)("span",{className:"block font-mono text-[13px] text-ink",children:e.name}),!e.ok&&e.detail?(0,t.jsx)("span",{className:"block text-xs text-mute",children:e.detail}):null]}),(0,t.jsx)("span",{className:`ml-auto shrink-0 text-xs ${e.ok?"text-ok":"text-bad"}`,children:e.ok?"pass":"fail"})]},s))}):(0,t.jsx)(z,{headers:e.headers})})]})]})},"Z",0,S],60566),e.i(24856);var P=e.i(99112),U=e.i(78451),F=e.i(1675),I=e.i(36620),B=e.i(73436),W=e.i(99522);let _=(0,W.f)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),V=(0,W.f)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var H=e.i(71189),K=e.i(43514),X=e.i(96659),J=e.i(87283),Z=e.i(39170),G=e.i(17847),Y=e.i(37837),Q=e.i(80707);e.i(42674);var ee=e.i(5305),et=e.i(65238),es=e.i(48181),en=e.i(6278);let ea=()=>globalThis.crypto?.randomUUID?.()??`env-${Date.now().toString(36)}`;function er({onClose:e,startNew:s=!1}){let n=(0,m.d)(),a=(0,Z.L)(),{environments:l,activeEnv:i,setActiveEnv:o,saveEnvironments:d,index:u}=(0,en.U)(),[x,h]=(0,c.useState)(()=>structuredClone(l)),[p,f]=(0,c.useState)(i?.id??l[0]?.id??null),[b,g]=(0,c.useState)(!1),v=(0,c.useRef)(null),j=x.find(e=>e.id===p)??null,y=JSON.stringify(x)!==JSON.stringify(l);(0,c.useEffect)(()=>{let e=document.activeElement;return s&&w(),v.current?.querySelector("input,button")?.focus(),()=>e?.focus()},[]);let N=(e,t)=>h(s=>s.map(s=>s.id===e?{...s,...t}:s));function w(e){let t=e?{id:ea(),name:`${e.name} copy`,variables:structuredClone(e.variables)}:{id:ea(),name:x.length?`Environment ${x.length+1}`:"DEV",variables:[{key:"baseUrl",value:"",secret:!1}]};h(e=>[...e,t]),f(t.id)}async function k(){(!y||await a({title:"Discard changes to environments?",confirmLabel:"Discard",tone:"danger"}))&&e()}async function C(){g(!0);try{await d(x),i&&!x.some(e=>e.id===i.id)&&o(null),n("Environments saved","success"),e()}catch(e){n(e instanceof Error?e.message:"Could not save environments","error")}finally{g(!1)}}return(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&&void k(),children:(0,t.jsxs)("div",{ref:v,role:"dialog","aria-modal":"true","aria-label":"Environments",onKeyDown:e=>"Escape"===e.key&&void k(),className:"flex max-h-[85vh] w-full max-w-4xl flex-col overflow-hidden rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-center justify-between border-b border-line px-5 py-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-base font-medium text-ink",children:"Environments"}),(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Use ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"{{name}}"})," in the URL, params, headers, body, or auth. Saved to environments.json in your app-data folder."]})]}),(0,t.jsx)("button",{type:"button","aria-label":"Close",className:"rounded p-1 text-mute hover:text-ink",onClick:()=>void k(),children:(0,t.jsx)(J.X,{size:16})})]}),(0,t.jsxs)("div",{className:"grid min-h-0 flex-1 md:grid-cols-[14rem_minmax(0,1fr)]",children:[(0,t.jsxs)("nav",{"aria-label":"Environment list",className:"space-y-1 overflow-auto border-line p-3 md:border-r",children:[x.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>f(e.id),"aria-current":e.id===p?"true":void 0,className:`block w-full truncate rounded-md px-2 py-1.5 text-left text-sm ${e.id===p?"bg-accent-dim text-ink":"text-mute hover:bg-panel-2 hover:text-ink"}`,children:[e.name,(0,t.jsx)("span",{className:"ml-1 text-xs text-mute",children:e.variables.length})]},e.id)),(0,t.jsxs)("button",{type:"button",onClick:()=>w(),className:"mt-2 inline-flex items-center gap-1 text-xs text-accent hover:underline",children:[(0,t.jsx)(H.f,{size:12,"aria-hidden":!0})," New environment"]})]}),(0,t.jsxs)("section",{className:"min-h-0 space-y-4 overflow-auto p-4",children:[j?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("label",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"sr-only",children:"Environment name"}),(0,t.jsx)("input",{value:j.name,onChange:e=>N(j.id,{name:e.target.value}),className:"input text-base font-medium"})]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-xs",onClick:()=>w(j),children:[(0,t.jsx)(r.f,{size:13})," Duplicate"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-danger py-1.5 text-xs",onClick:()=>{h(e=>e.filter(e=>e.id!==j.id)),f(x.find(e=>e.id!==j.id)?.id??null)},children:[(0,t.jsx)(X.f,{size:13})," Delete"]})]}),(0,t.jsxs)("label",{className:"flex items-start gap-2 text-sm text-ink",children:[(0,t.jsx)("input",{type:"checkbox",className:"mt-1 accent-[var(--accent)]",checked:!!j.production,onChange:e=>N(j.id,{production:e.target.checked||void 0})}),(0,t.jsxs)("span",{children:["This is production",(0,t.jsx)("span",{className:"block text-xs text-mute",children:"The top of the window turns red while it's in use, and the app asks before a request that changes data, or a performance test."})]})]}),(0,t.jsx)(ei,{vars:j.variables,onPatch:(e,t)=>j&&N(j.id,{variables:j.variables.map((s,n)=>n===e?{...s,...t}:s)}),onChange:e=>N(j.id,{variables:e})}),(0,t.jsxs)("p",{className:"flex items-start gap-1.5 text-xs text-mute",children:[(0,t.jsx)(V,{size:12,className:"mt-0.5 shrink-0","aria-hidden":!0}),u?.secretsPersistent?"Secret values are encrypted on this computer and never written to environments.json.":"Secret values are never written to disk. In this browser setup they are kept by the engine until it restarts; the desktop app encrypts them."]})]}):(0,t.jsxs)("div",{className:"py-12 text-center text-sm text-mute",children:["No environments yet. Create one for each place you test — DEV, UAT, PROD.",(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsxs)("button",{type:"button",className:"btn btn-primary text-sm",onClick:()=>w(),children:[(0,t.jsx)(H.f,{size:14})," New environment"]})})]}),(0,t.jsx)(el,{onCopied:e=>n(`Copied ${e}`,"success")})]})]}),(0,t.jsxs)("footer",{className:"flex justify-end gap-2 border-t border-line px-5 py-3",children:[(0,t.jsx)("button",{type:"button",className:"btn btn-secondary text-sm",onClick:()=>void k(),children:"Cancel"}),(0,t.jsx)("button",{type:"button",className:"btn btn-primary text-sm",disabled:!y||b,onClick:()=>void C(),children:"Save environments"})]})]})})}function el({onCopied:e}){return(0,t.jsxs)("details",{className:"rounded-md border border-line bg-panel-2/40 px-3 py-2 text-sm",children:[(0,t.jsxs)("summary",{className:"cursor-pointer text-xs font-medium text-ink",children:["Built-in values ",(0,t.jsx)("span",{className:"font-normal text-mute",children:"— made anew for every request, in performance tests too"})]}),(0,t.jsx)("ul",{className:"mt-2 space-y-1",children:P.Z.map(s=>(0,t.jsxs)("li",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsxs)("button",{type:"button",title:"Copy",onClick:()=>void navigator.clipboard?.writeText(s.example).then(()=>e(s.example)),className:"inline-flex shrink-0 items-center gap-1 rounded border border-line px-1.5 py-0.5 font-mono text-accent hover:border-accent",children:[s.example,(0,t.jsx)(r.f,{size:11,"aria-hidden":!0})]}),(0,t.jsx)("span",{className:"text-mute",children:s.description})]},s.name))}),(0,t.jsxs)("p",{className:"mt-2 text-xs text-mute",children:["In a JSON body put them in quotes, like ",(0,t.jsx)("code",{className:"font-mono text-ink",children:'"id": "{{$uuid}}"'}),"."]})]})}function ei({vars:e,onPatch:s,onChange:n}){let[a,r]=(0,c.useState)(new Set),l=new Set(e.map(e=>e.key.trim()).filter((e,t,s)=>e&&s.indexOf(e)!==t));return(0,t.jsxs)("div",{className:"overflow-hidden rounded-md border border-line",children:[(0,t.jsxs)("div",{className:"grid grid-cols-[minmax(0,2fr)_minmax(0,3fr)_5.5rem_2rem] bg-panel-2 text-xs text-mute",children:[(0,t.jsx)("span",{className:"px-2.5 py-1.5",children:"Variable"}),(0,t.jsx)("span",{className:"border-l border-line px-2.5 py-1.5",children:"Value"}),(0,t.jsx)("span",{className:"border-l border-line px-2.5 py-1.5",children:"Secret"}),(0,t.jsx)("span",{})]}),e.map((i,o)=>{let c=i.key&&!/^[A-Za-z_][\w.-]*$/.test(i.key)||l.has(i.key.trim());return(0,t.jsxs)("div",{className:"grid grid-cols-[minmax(0,2fr)_minmax(0,3fr)_5.5rem_2rem] border-t border-line",children:[(0,t.jsx)("input",{"aria-label":`Variable ${o+1} name`,"aria-invalid":c||void 0,title:c?"Letters, digits, _ . - ; must start with a letter or _ ; must be unique":void 0,value:i.key,onChange:e=>s(o,{key:e.target.value}),placeholder:"baseUrl",className:`min-w-0 bg-transparent px-2.5 py-1.5 font-mono text-[13px] outline-none focus:bg-panel-2 ${c?"text-bad":"text-ink"}`}),(0,t.jsxs)("span",{className:"relative flex min-w-0 border-l border-line",children:[(0,t.jsx)("input",{"aria-label":`Variable ${o+1} value`,type:i.secret&&!a.has(o)?"password":"text",autoComplete:"off",value:i.value,onChange:e=>s(o,{value:e.target.value}),className:"min-w-0 flex-1 bg-transparent px-2.5 py-1.5 font-mono text-[13px] text-ink outline-none focus:bg-panel-2"}),i.secret?(0,t.jsx)("button",{type:"button","aria-label":a.has(o)?"Hide value":"Show value",onClick:()=>r(e=>{let t=new Set(e);return t.has(o)?t.delete(o):t.add(o),t}),className:"px-2 text-mute hover:text-ink",children:a.has(o)?(0,t.jsx)(B.f,{size:13}):(0,t.jsx)(I.f,{size:13})}):null]}),(0,t.jsxs)("label",{className:"flex items-center gap-1.5 border-l border-line px-2.5 text-xs text-mute",children:[(0,t.jsx)("input",{type:"checkbox",checked:i.secret,onChange:e=>s(o,{secret:e.target.checked}),className:"accent-[var(--accent)]"}),"secret"]}),(0,t.jsx)("button",{type:"button","aria-label":`Remove ${i.key||`variable ${o+1}`}`,onClick:()=>n(e.filter((e,t)=>t!==o)),className:"grid place-items-center text-mute hover:text-bad",children:(0,t.jsx)(J.X,{size:13})})]},o)}),(0,t.jsxs)("button",{type:"button",onClick:()=>n([...e,{key:"",value:"",secret:!1}]),className:"flex w-full items-center gap-1 border-t border-line px-2.5 py-1.5 text-xs text-accent hover:bg-panel-2",children:[(0,t.jsx)(H.f,{size:12,"aria-hidden":!0})," Add variable"]})]})}e.s(["f",0,function({drafts:e,collections:n=[],compact:a=!1}){let{environments:r,activeEnv:l,setActiveEnv:i,vars:o,savedValues:d,clearSavedValues:u}=(0,en.U)(),m=Object.keys(d),[x,h]=(0,c.useState)(!1),[p,f]=(0,c.useState)(!1),b=(0,c.useRef)(null),g=(0,c.useMemo)(()=>{let t=new Set;for(let s of e){let e=new Set((0,ee.h)(s)),n=[s.url,s.bodyText,s.token,s.username,s.password,s.apiValue,...s.params.map(e=>e.value),...s.headers.map(e=>e.value)].join(" ");(0,U.n)(n).forEach(s=>!e.has(s)&&t.add(s))}return[...t]},[e]),j=(0,et.K)(n),y=g.filter(e=>!(e in o)&&!j.has(e));if([...r.map(e=>({value:e.id,label:e.name,hint:`${e.variables.length} variable${1===e.variables.length?"":"s"}`}))],a){let e=es.q[(0,es.v)(l)];return(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs",children:[y.length?(0,t.jsxs)("span",{role:"status",className:"inline-flex items-center gap-1 rounded px-1.5 py-1 text-warn",title:`${y.map(e=>`{{${e}}}`).join(", ")} not defined${l?` in ${l.name}`:" — pick an environment"}`,children:[(0,t.jsx)(v.f,{size:12,"aria-hidden":!0}),(0,t.jsx)("span",{className:"max-w-40 truncate",children:y.map(e=>`{{${e}}}`).join(", ")})]}):null,m.length?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-1 text-mute",title:m.map(e=>`{{${e}}} — saved from “${d[e].from}”`).join("\n"),children:[(0,t.jsxs)("span",{className:"font-mono text-accent",children:[m.length," saved"]}),(0,t.jsx)("button",{type:"button",onClick:u,"aria-label":"Clear the values saved from answers",className:"rounded p-0.5 hover:text-ink",children:(0,t.jsx)(J.X,{size:11,"aria-hidden":!0})})]}):null,(0,t.jsxs)("button",{ref:b,type:"button",role:"combobox","aria-label":"Environment","aria-haspopup":"listbox","aria-expanded":p,onClick:()=>f(e=>!e),className:"inline-flex max-w-52 items-center gap-1.5 rounded-md border border-line bg-panel-2 px-2 py-1 text-xs text-ink hover:border-mute",children:[(0,t.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{background:l?e??"var(--ok)":"var(--line)"},"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:l?.name??"No environment"}),(0,t.jsx)(s.f,{size:12,className:"shrink-0 text-mute","aria-hidden":!0})]}),(0,t.jsx)(Y.f,{anchor:b,open:p,onClose:()=>f(!1),label:"Environments",width:260,children:(0,t.jsxs)("div",{className:"-m-2",children:[(0,t.jsx)(G.U,{children:"Environment"}),(0,t.jsx)("ul",{role:"listbox","aria-label":"Environment",children:[{id:"",name:"No environment",count:-1,production:!1},...r.map(e=>({id:e.id,name:e.name,count:e.variables.length,production:e.production}))].map(e=>{let s=(l?.id??"")===e.id,n=e.id?es.q[(0,es.v)(e)]??"var(--ok)":"var(--line)";return(0,t.jsx)("li",{role:"option","aria-selected":s,children:(0,t.jsxs)("button",{type:"button",onClick:()=>{i(e.id||null),f(!1)},className:"flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-left text-sm text-ink hover:bg-panel-2",children:[(0,t.jsx)("span",{className:"flex w-4 justify-center","aria-hidden":!0,children:(0,t.jsx)("span",{className:"h-2 w-2 rounded-full",style:{background:n}})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 truncate",children:[e.name,(0,t.jsx)("span",{className:"block text-[11px] text-mute",children:e.count<0?"Only built-in variables":`${e.count} variable${1===e.count?"":"s"}`})]}),s?(0,t.jsx)(F.f,{size:14,className:"shrink-0 text-accent","aria-hidden":!0}):null]})},e.id||"none")})}),(0,t.jsx)(G.Z,{}),(0,t.jsx)(G.d,{icon:H.f,label:"New environment…",onSelect:()=>{f(!1),h("new")}}),(0,t.jsx)(G.d,{icon:K.f,label:"Manage environments…",onSelect:()=>{f(!1),h("manage")}})]})}),(0,t.jsx)("button",{type:"button",onClick:()=>h("manage"),"aria-label":"Manage environments",title:"Manage environments",className:"rounded p-1.5 text-mute hover:bg-panel-2 hover:text-ink",children:(0,t.jsx)(_,{size:14,"aria-hidden":!0})}),x?(0,t.jsx)(er,{startNew:"new"===x,onClose:()=>h(!1)}):null]})}return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-mute",children:["Environment",(0,t.jsx)(Q.f,{label:"Environment",value:l?.id??"",onChange:e=>i(e||null),minWidth:200,options:[{value:"",label:"None",hint:"Only built-in variables"},...r.map(e=>({value:e.id,label:e.name,hint:`${e.variables.length} variable${1===e.variables.length?"":"s"}`}))],className:"rounded-md border border-line bg-panel-2 px-2 py-1 text-xs text-ink hover:border-mute focus-visible:border-accent focus-visible:outline-none"})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>h("manage"),className:"inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-mute hover:text-ink",children:[(0,t.jsx)(K.f,{size:12,"aria-hidden":!0})," Manage"]}),g.length>0?y.length?(0,t.jsxs)("span",{className:"text-warn",role:"status",children:[y.map(e=>`{{${e}}}`).join(", ")," not defined",l?` in ${l.name}`:" — pick an environment"]}):(0,t.jsxs)("span",{className:"text-mute",children:["Uses ",g.map(e=>`{{${e}}}`).join(", ")]}):null,m.length?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-mute",title:m.map(e=>`{{${e}}} — saved from “${d[e].from}”`).join("\n"),children:["Saved from answers: ",(0,t.jsx)("span",{className:"font-mono text-accent",children:m.map(e=>`{{${e}}}`).join(", ")}),(0,t.jsx)("button",{type:"button",onClick:u,className:"text-mute underline-offset-2 hover:text-ink hover:underline",children:"Clear"})]}):null,x?(0,t.jsx)(er,{onClose:()=>h(!1)}):null]})},"L",0,ei],68228);var eo=e.i(80190);let ec=(0,W.f)("file-plus-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 15h6",key:"4e2qda"}],["path",{d:"M6 12v6",key:"1u72j0"}]]);var ed=e.i(47677),eu=e.i(17819);let em=(0,W.f)("folder-input",[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]]);var ex=e.i(44085),eh=e.i(91694);let ep=(0,W.f)("import",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]);var ef=e.i(19286),eb=e.i(81538),eg=e.i(13163),ev=e.i(3792),ej=e.i(67290),ey=e.i(75998),eN=e.i(70989),ew=e.i(67217),ek=e.i(74749),eC=e.i(97942),e$=e.i(91549),eS=e.i(41997),eq=e.i(27813),eE=e.i(36e3),eM=e.i(55925),ez=e.i(1359),eT=e.i(22079),eR=e.i(69159),eD=e.i(23227),eL=e.i(24448);function eO({value:e,parents:s,folder:n,onChange:a}){let r,l=(0,eD.l)(),i=[...s].reverse().find(e=>e.settings.contract);return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-xs text-mute",children:"Each answer inside is checked against this OpenAPI description, on Send and in collection runs: is the operation in it, is the status documented, does the body match the documented schema. That's a contract test."}),(0,t.jsxs)("label",{className:"block space-y-1",children:[(0,t.jsx)("span",{className:"text-sm text-ink",children:"API description"}),(0,t.jsxs)("select",{className:"input",value:e??"",onChange:e=>a(e.target.value||void 0),children:[(0,t.jsx)("option",{value:"",children:i?`From ${i.path}: ${r=i.settings.contract,l?.find(e=>e.id===r)?.name??"a description that was removed"}`:"None"}),l?.map(e=>(0,t.jsxs)("option",{value:e.id,children:[e.name,e.error?" (doesn't read)":` — ${e.operations} operations`]},e.id))]})]}),l&&!l.length?(0,t.jsx)("p",{className:"text-xs text-mute",children:"There are none in this project yet."}):null,e??i?.settings.contract?(0,t.jsx)(eR._,{id:e??i?.settings.contract,folder:n}):null,(0,t.jsx)("button",{type:"button",className:"text-xs text-accent hover:underline",onClick:()=>(0,eT.A)(e??i?.settings.contract),children:l&&!l.length?"Add an API description…":"API descriptions — add one, and see which operations have a request"})]})}function eA({path:e,onClose:s}){let n=(0,m.d)(),{refresh:a}=(0,en.U)(),[r,l]=(0,c.useState)(null),[i,o]=(0,c.useState)([]),[d,x]=(0,c.useState)([]),[h,p]=(0,c.useState)("auth"),[f,b]=(0,c.useState)(!1);async function g(){if(r&&!f){b(!0);try{await et.X.save(e,{...r,headers:r.headers.filter(e=>e.key.trim()),variables:r.variables.filter(e=>e.key.trim())}),await a(),n(`Saved the settings of ${e}`,"success"),s()}catch(e){n(e instanceof Error?e.message:"Could not save","error")}finally{b(!1)}}}(0,c.useEffect)(()=>{let t=!0;return Promise.all([et.X.get(e),et.X.chain((0,U.L)(e))]).then(([e,s])=>{t&&(l(e.settings),o(e.secretsMissing??[]),x(s))}).catch(e=>{t&&(n(e instanceof Error?e.message:"Could not open the folder","error"),l((0,U.I)()))}),()=>{t=!1}},[e,n]);let v=[...d].reverse().find(e=>"inherit"!==e.settings.auth.authMode),j=r?{headers:r.headers.filter(e=>e.key.trim()&&!1!==e.enabled).length,variables:r.variables.length}:{headers:0,variables:0};return(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&&s(),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"folder-settings-title",onKeyDown:e=>"Escape"===e.key&&s(),className:"flex max-h-[85vh] w-full max-w-2xl flex-col overflow-hidden rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("h2",{id:"folder-settings-title",className:"truncate text-base font-medium text-ink",children:["Folder settings · ",e]}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"Every request inside — and inside its subfolders — uses these. A request's own value wins."})]}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1",children:[(0,t.jsx)(eL.U,{topic:"sending-requests#folders-sign-in-once"}),(0,t.jsx)("button",{type:"button","aria-label":"Close",className:"rounded p-1 text-mute hover:text-ink",onClick:s,children:(0,t.jsx)(J.X,{size:16})})]})]}),r?(0,t.jsxs)("div",{className:"min-h-0 flex-1 overflow-auto px-5 py-4",children:[(0,t.jsx)(u.i,{id:"folder-settings",label:"Folder settings",value:h,onChange:p,items:[{id:"auth",label:"Auth"},{id:"headers",label:"Headers",badge:j.headers||void 0},{id:"variables",label:"Variables",badge:j.variables||void 0},{id:"scripts",label:"Scripts",badge:+!!r.preScript.trim()+ +!!r.postScript.trim()||void 0},{id:"contract",label:"API description",badge:r.contract?1:void 0},{id:"docs",label:"Docs",badge:r.description?.trim()?"✓":void 0}]}),(0,t.jsxs)("div",{...(0,u.q)("folder-settings",h),className:"pt-4",children:["auth"===h?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Requests set to ",(0,t.jsx)("span",{className:"text-ink",children:"Auth → From folder"})," (the default for new requests) use this — sign in once here instead of in every request."]}),(0,t.jsx)(eS.d,{value:r.auth,onChange:e=>l({...r,auth:{...r.auth,...e}}),inheritLabel:"From parent",defaults:Object.fromEntries([...d.flatMap(e=>e.settings.variables),...r.variables].map(e=>[e.key,e.value])),inheritNote:v&&"none"!==v.settings.auth.authMode?(0,t.jsxs)(t.Fragment,{children:["Passes on the ",(0,t.jsx)("span",{className:"text-ink",children:(0,eS.S)(v.settings.auth.authMode)})," of"," ",(0,t.jsx)("span",{className:"text-ink",children:v.path}),"."]}):(0,t.jsx)(t.Fragment,{children:"No folder above sets auth, so this folder passes none down."}),secretNote:"Use {{token}} to take it from the environment, or type it — it's kept encrypted on this computer, never in the folder's file."}),i.some(e=>!e.startsWith("var:"))?(0,t.jsxs)("p",{className:"text-xs text-warn",children:["The saved ",i.filter(e=>!e.startsWith("var:")).join(", ")," isn't available on this computer — enter it again."]}):null]}):null,"headers"===h?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eE.f,{rows:r.headers,onChange:e=>l({...r,headers:e}),keyPlaceholder:"Header",valuePlaceholder:"Value",noun:"header"}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"Sent with every request inside. An inner folder's or a request's header with the same name replaces it."})]}):null,"scripts"===h?(0,t.jsx)(eM.f,{draft:r,onChange:l,forFolder:!0}):null,"docs"===h?(0,t.jsx)(ez.f,{value:r.description??"",onChange:e=>l({...r,description:e}),forFolder:!0}):null,"contract"===h?(0,t.jsx)(eO,{value:r.contract,parents:d,folder:e,onChange:e=>l({...r,contract:e})}):null,"variables"===h?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(ei,{vars:r.variables,onPatch:(e,t)=>l({...r,variables:r.variables.map((s,n)=>n===e?{...s,...t}:s)}),onChange:e=>l({...r,variables:e})}),(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Defaults for ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"{{name}}"})," in the requests inside. The chosen environment wins when it has the same name — so a folder can say"," ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"basePath = /v2"})," and the environment picks the server."]}),i.some(e=>e.startsWith("var:"))?(0,t.jsxs)("p",{className:"text-xs text-warn",children:["Secret values not available on this computer: ",i.filter(e=>e.startsWith("var:")).map(e=>e.slice(4)).join(", ")," — enter them again."]}):null]}):null]})]}):(0,t.jsx)("div",{className:"grid place-items-center p-10 text-mute",children:(0,t.jsx)(eq.f,{className:"animate-spin",size:18,"aria-label":"Loading"})}),(0,t.jsxs)("footer",{className:"flex justify-end gap-2 border-t border-line px-5 py-3",children:[(0,t.jsx)("button",{type:"button",className:"btn btn-secondary",onClick:s,disabled:f,children:"Cancel"}),(0,t.jsxs)("button",{type:"button",className:"btn btn-primary",onClick:()=>void g(),disabled:!r||f,children:[f?(0,t.jsx)(eq.f,{size:14,className:"animate-spin"}):null,"Save folder settings"]})]})]})})}var eP=e.i(14168),eU=e.i(2603);let eF={GET:"text-ok",POST:"text-warn",PUT:"text-accent",PATCH:"text-accent",DELETE:"text-bad"},eI="atc:request-moved",eB="application/x-atc-requests";function eW({activeId:e,onOpen:a,allowDelete:l=!0,newFolder:o,onNewFolderDone:d}){let u=(0,m.d)(),x=(0,Z.L)(),{index:h,refresh:p}=(0,en.U)(),[f,b]=(0,c.useState)({});(0,c.useEffect)(()=>{fetch("/engine/responses",{cache:"no-store"}).then(e=>e.json()).then(e=>b(e.requests??{})).catch(()=>void 0)},[h]);let[g,v]=(0,c.useState)(""),[j,y]=(0,c.useState)(new Set),[N,k]=(0,c.useState)(null),[C,$]=(0,c.useState)(null),[S,q]=(0,c.useState)(null),[E,M]=(0,c.useState)(new Set),z=(0,c.useRef)(null),[T,R]=(0,c.useState)(null),[D,L]=(0,c.useState)(null),[O,A]=(0,c.useState)(null),P=h?.requests??[],F=h?.folders??[],I=g.trim().toLowerCase(),B=(0,c.useMemo)(()=>I?P.filter(e=>`${e.name} ${e.collection} ${e.url} ${e.method}`.toLowerCase().includes(I)):P,[P,I]),W=(0,c.useMemo)(()=>(function(e,t,s){let n={path:"",name:"",folders:[],requests:[],summary:null},a=new Map([["",n]]),r=e=>{let t=a.get(e);if(t)return t;let s={path:e,name:(0,U.g)(e),folders:[],requests:[],summary:null};return a.set(e,s),r((0,U.L)(e)).folders.push(s),s};if(s)for(let e of t)r(e.path);for(let t of e)r(t.collection).requests.push(t);for(let e of t){let t=a.get(e.path);t&&(t.summary=e)}let l=e=>{e.folders.sort((e,t)=>e.name.localeCompare(t.name)),e.folders.forEach(l)};return l(n),n})(B,F,!I),[B,F,I]);async function _(e){try{let t=await en.v.get(e);a(t),t.secretsMissing?.length&&u(`Re-enter the ${t.secretsMissing.join(", ")} — secrets are kept only until the engine restarts in this setup`,"info")}catch(e){u(e instanceof Error?e.message:"Could not open the request","error")}}async function V(e,t){let s=0;try{for(let n of e){let e=await en.v.get(n),a=t.name?.trim()||e.name,r=t.collection??e.collection;if(a===e.name&&r===e.collection)continue;let l=await en.v.update(n,{name:a,collection:r,request:e.request});window.dispatchEvent(new CustomEvent(eI,{detail:{id:n,name:l.name,collection:l.collection}})),s++}await p(),void 0!==t.collection&&s&&u(`Moved ${s} request${1===s?"":"s"} to ${t.collection||"the top level"}`,"success")}catch(e){u(e instanceof Error?e.message:"Could not do that","error")}}async function H(e){for(let t of e)await en.v.remove(t).catch(()=>void 0);M(new Set),await p(),u(`${e.length} request${1===e.length?"":"s"} moved to Trash — restore them from Trash in the sidebar`,"success")}(0,c.useEffect)(()=>{o&&k({kind:"new",parent:""})},[o]);let K=e=>l?{onDragOver:t=>{t.dataTransfer.types.includes(eB)&&(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect="move",A(e))},onDragLeave:t=>{t.currentTarget.contains(t.relatedTarget)||A(t=>t===e?null:t)},onDrop:t=>{t.preventDefault(),t.stopPropagation(),A(null);try{let s=JSON.parse(t.dataTransfer.getData(eB));Array.isArray(s)&&s.length&&(M(new Set),V(s,{collection:e}))}catch{}}}:{};async function G(e){try{let t=await en.v.create({name:"New request",collection:e,request:(0,ee.t)()});y(t=>{let s=new Set(t);return s.delete(e),s}),await p(),await _(t.id),R(t.id)}catch(e){u(e instanceof Error?e.message:"Could not make the request","error")}}async function Y(e){try{let t=await en.v.get(e.id);await en.v.create({name:`${e.name} copy`.slice(0,200),collection:e.collection,request:t.request}),await p(),u(`Duplicated “${e.name}”`,"success")}catch(e){u(e instanceof Error?e.message:"Could not duplicate it","error")}}async function Q(e){try{await en.v.remove(e.id),await p(),u(`“${e.name}” moved to Trash — restore it from Trash in the sidebar`,"success")}catch(e){u(e instanceof Error?e.message:"Could not delete it","error")}}async function es(e){if(k(null),d?.(),!N)return;let t=e.trim();if(t)try{if("new"===N.kind){let e=(0,U.y)(N.parent?`${N.parent}/${t}`:t);await et.X.save(e,(0,U.I)()),y(e=>{let t=new Set(e);return t.delete(N.parent),t})}else{let e=(0,U.y)(t.includes("/")?t:(0,U.L)(N.path)?`${(0,U.L)(N.path)}/${t}`:t);e!==N.path&&await et.X.move(N.path,e)}await p()}catch(e){u(e instanceof Error?e.message:"Could not do that","error")}}async function ea(e){if(await x({title:`Delete the folder “${e}”?`,body:"Its settings and empty subfolders are removed. A folder that still has requests can't be deleted — move or delete them first.",confirmLabel:"Delete folder",tone:"danger"}))try{await et.X.remove(e),await p()}catch(e){u(e instanceof Error?e.message:"Could not delete the folder","error")}}let er=s=>(0,t.jsx)("ul",{children:s.map(s=>{let n=s.id===e,a=E.has(s.id);return T===s.id?(0,t.jsx)("li",{className:"py-0.5 pl-1",children:(0,t.jsx)("input",{autoFocus:!0,defaultValue:s.name,"aria-label":`New name for ${s.name}`,className:"input py-1 text-[13px]",onFocus:e=>e.target.select(),onKeyDown:e=>{"Enter"===e.key&&e.target.blur(),"Escape"===e.key&&R(null)},onBlur:e=>{R(null),V([s.id],{name:e.target.value})}})},s.id):(0,t.jsxs)("li",{draggable:l,onDragStart:e=>{let t=a?[...E]:[s.id];e.dataTransfer.setData(eB,JSON.stringify(t)),e.dataTransfer.effectAllowed="move"},onContextMenu:e=>{l&&(e.preventDefault(),q(`r:${s.id}`))},className:`group flex items-center rounded-md ${n?"bg-accent-dim shadow-[inset_2px_0_0_var(--accent)]":a?"bg-panel-2 ring-1 ring-accent/50 ring-inset":"hover:bg-panel-2"}`,children:[(0,t.jsxs)("button",{type:"button",onClick:e=>(function(e,t){if(l&&(e.ctrlKey||e.metaKey)){M(e=>{let s=new Set(e);return s.has(t.id)?s.delete(t.id):s.add(t.id),s}),z.current=t.id;return}if(l&&e.shiftKey&&z.current){let e=function e(t){return!j.has(t.path)||I||""===t.path?[...t.folders.flatMap(e),...t.requests.map(e=>e.id)]:[]}(W),[s,n]=[e.indexOf(z.current),e.indexOf(t.id)].sort((e,t)=>e-t);if(s>=0)return M(new Set(e.slice(s,n+1)))}M(new Set),z.current=t.id,_(t.id)})(e,s),onKeyDown:e=>{l&&("F2"===e.key?(e.preventDefault(),R(s.id)):"Delete"===e.key?(e.preventDefault(),a&&E.size>1?H([...E]):Q(s)):(e.ctrlKey||e.metaKey)&&"d"===e.key.toLowerCase()&&(e.preventDefault(),Y(s)))},"aria-current":n?"true":void 0,"aria-pressed":l&&E.size?a:void 0,title:f[s.id]?`${s.url}
|
|
2
|
+
Earlier answers kept: ${(0,w.L)(f[s.id])}`:s.url,className:"tree-row flex min-w-0 flex-1 items-center gap-2 py-1 pr-1 pl-2 text-left",children:[(0,t.jsx)("span",{className:`w-10 shrink-0 font-mono text-[10.5px] font-semibold tracking-wide ${eF[s.method]??"text-mute"}`,children:"DELETE"===s.method?"DEL":s.method}),(0,t.jsx)("span",{className:`min-w-0 truncate text-[13px] ${n?"text-ink":"text-ink/90"}`,children:s.name})]}),l?(0,t.jsx)(eH,{label:`Actions for ${s.name}`,open:S===`r:${s.id}`,onOpenChange:e=>q(e?`r:${s.id}`:null),items:[{icon:eo.f,label:"Open",hint:"Enter",run:()=>void _(s.id)},{icon:eg.f,label:"Rename",hint:"F2",run:()=>R(s.id)},{icon:r.f,label:"Duplicate",hint:"Ctrl+D",run:()=>void Y(s)},{icon:em,label:"Move to…",run:()=>L([s.id])},"separator",{icon:eh.f,label:"Version history",run:()=>(0,eC.g)(s.id)},{icon:ed.f,label:"Export…",run:()=>(0,e$.q)({kind:"request",id:s.id,name:s.name,collection:s.collection})},"separator",{icon:X.f,label:"Move to Trash",hint:"Del",run:()=>void Q(s),danger:!0}]}):null]},s.id)})}),el=e=>{var a;let r=j.has(e.path)&&!I,i=(a=e.summary)?[a.auth?(0,eS.S)(a.auth):"",a.headers?`${a.headers} header${1===a.headers?"":"s"}`:"",a.variables?`${a.variables} variable${1===a.variables?"":"s"}`:""].filter(Boolean).join(" · "):"";return(0,t.jsxs)("div",{className:"mb-0.5",children:[N?.kind==="rename"&&N.path===e.path?(0,t.jsx)(e_,{initial:e.path,label:`New name for ${e.path}`,onDone:e=>void es(e),hint:"Use / to move it into another folder"}):(0,t.jsxs)("div",{...K(e.path),className:`group/folder flex items-center rounded-md ${O===e.path?"bg-accent-dim ring-1 ring-accent ring-inset":"hover:bg-panel-2"}`,onContextMenu:t=>{l&&(t.preventDefault(),q(`f:${e.path}`))},children:[(0,t.jsxs)("button",{type:"button","aria-expanded":!r,onClick:()=>{let t;return t=e.path,y(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},title:i?`Passes down: ${i}`:e.path,className:"tree-row flex min-w-0 flex-1 items-center gap-1.5 py-1 pr-1 pl-1 text-left text-[13px] font-medium text-ink",children:[r?(0,t.jsx)(n.f,{size:13,"aria-hidden":!0,className:"shrink-0 text-mute"}):(0,t.jsx)(s.f,{size:13,"aria-hidden":!0,className:"shrink-0 text-mute"}),(0,t.jsx)(eu.f,{size:14,"aria-hidden":!0,className:"shrink-0 text-mute"}),(0,t.jsx)("span",{className:"truncate",children:e.name}),e.summary?.auth?(0,t.jsx)(ef.f,{size:11,className:"shrink-0 text-accent","aria-label":`signs in with ${(0,eS.S)(e.summary.auth)}`}):null,(0,t.jsx)("span",{className:"ml-auto shrink-0 rounded-full bg-panel-2 px-1.5 text-[11px] font-normal text-mute group-hover/folder:bg-panel",children:function e(t){return t.requests.length+t.folders.reduce((t,s)=>t+e(s),0)}(e)})]}),l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ey.default,{href:(0,eP.W)(e.path),title:`Run all requests in ${e.path}`,"aria-label":`Run all requests in ${e.path}`,className:"ml-0.5 rounded p-1 text-mute opacity-0 group-hover/folder:opacity-100 hover:text-accent focus:opacity-100",children:(0,t.jsx)(ev.f,{size:12})}),(0,t.jsx)(eK,{path:e.path,onNewRequest:()=>void G(e.path),open:S===`f:${e.path}`,onOpenChange:t=>q(t?`f:${e.path}`:null),onSettings:()=>$(e.path),onNewInside:()=>k({kind:"new",parent:e.path}),onRename:()=>k({kind:"rename",path:e.path}),onDelete:()=>void ea(e.path)})]}):null]}),r?null:(0,t.jsxs)("div",{className:"ml-[0.9rem] border-l border-line pl-1",children:[N?.kind==="new"&&N.parent===e.path?(0,t.jsx)(e_,{initial:"",label:`New folder in ${e.path}`,onDone:e=>void es(e)}):null,e.folders.map(el),er(e.requests)]})]},e.path)};return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("label",{className:"relative mb-2 block",children:[(0,t.jsx)("span",{className:"sr-only",children:"Search saved requests"}),(0,t.jsx)(i.f,{size:13,className:"pointer-events-none absolute top-1/2 left-2 -translate-y-1/2 text-mute","aria-hidden":!0}),(0,t.jsx)("input",{value:g,onChange:e=>v(e.target.value),placeholder:"Search requests",className:"input h-8 rounded-lg pl-7 text-xs"})]}),E.size?(0,t.jsxs)("div",{role:"toolbar","aria-label":"Selected requests",className:"mb-2 flex items-center gap-1 rounded-lg border border-accent/40 bg-accent-dim/40 px-2 py-1.5 text-xs",children:[(0,t.jsxs)("span",{className:"flex-1 text-ink",children:[E.size," selected"]}),(0,t.jsx)("button",{type:"button",title:"Move to…","aria-label":"Move the selected requests",className:"rounded p-1 text-mute hover:text-ink",onClick:()=>L([...E]),children:(0,t.jsx)(em,{size:14,"aria-hidden":!0})}),(0,t.jsx)("button",{type:"button",title:"Export…","aria-label":"Export the selected requests",className:"rounded p-1 text-mute hover:text-ink",onClick:()=>(0,e$.q)({kind:"requests",ids:[...E]}),children:(0,t.jsx)(ed.f,{size:14,"aria-hidden":!0})}),(0,t.jsx)("button",{type:"button",title:"Move to Trash","aria-label":"Move the selected requests to Trash",className:"rounded p-1 text-mute hover:text-bad",onClick:()=>void H([...E]),children:(0,t.jsx)(X.f,{size:14,"aria-hidden":!0})}),(0,t.jsx)("button",{type:"button",title:"Clear the selection","aria-label":"Clear the selection",className:"rounded p-1 text-mute hover:text-ink",onClick:()=>M(new Set),children:(0,t.jsx)(J.X,{size:14,"aria-hidden":!0})})]}):null,(0,t.jsxs)("div",{...K(""),className:`min-h-0 flex-1 overflow-auto rounded-md ${""===O?"bg-accent-dim/30 ring-1 ring-accent/60 ring-inset":""}`,children:[N?.kind==="new"&&""===N.parent?(0,t.jsx)(e_,{initial:"",label:"New folder",onDone:e=>void es(e),hint:"Use / for a folder inside another: Orders/Admin"}):null,0===P.length&&0===F.length?(0,t.jsxs)("div",{className:"space-y-2 px-1 py-4 text-xs text-mute",children:[(0,t.jsx)("p",{children:"No saved requests yet. Press Save (Ctrl+S) to keep the current one."}),(0,t.jsxs)("p",{children:["Coming from Postman or Swagger?"," ",(0,t.jsx)("button",{type:"button",onClick:()=>(0,ew.F)(),className:"text-accent hover:underline",children:"Import your requests"})]})]}):I&&0===B.length?(0,t.jsx)("p",{className:"px-1 py-4 text-xs text-mute",children:"Nothing matches."}):(0,t.jsxs)(t.Fragment,{children:[W.folders.map(el),er(W.requests)]})]}),C?(0,t.jsx)(eA,{path:C,onClose:()=>$(null)}):null,D?(0,t.jsx)(eV,{count:D.length,folders:[...new Set([...F.map(e=>e.path),...P.map(e=>e.collection)].filter(Boolean))].sort(),onPick:e=>{L(null),M(new Set),V(D,{collection:e})},onClose:()=>L(null)}):null]})}function e_({initial:e,label:s,onDone:n,hint:a}){let[r,l]=(0,c.useState)(e),i=(0,c.useRef)(null),o=(0,c.useRef)(!1);(0,c.useEffect)(()=>i.current?.select(),[]);let d=e=>{o.current||(o.current=!0,n(e))};return(0,t.jsxs)("div",{className:"px-1 py-1",children:[(0,t.jsx)("input",{ref:i,value:r,"aria-label":s,placeholder:"Folder name",onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"===e.key&&d(r),"Escape"===e.key&&d("")},onBlur:()=>d(r),className:"input py-1 text-xs"}),a?(0,t.jsx)("p",{className:"mt-0.5 text-[11px] text-mute",children:a}):null]})}function eV({count:e,folders:s,onPick:n,onClose:a}){let[r,l]=(0,c.useState)("");(0,c.useEffect)(()=>{let e=e=>"Escape"===e.key&&a();return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[a]);let i=s.filter(e=>e.toLowerCase().includes(r.trim().toLowerCase()));return(0,t.jsx)("div",{className:"fixed inset-0 z-[66] flex items-center-safe justify-center bg-black/50 p-4 sm:p-16",role:"presentation",onMouseDown:e=>e.target===e.currentTarget&&a(),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"move-title",className:"flex max-h-[70vh] w-full max-w-md flex-col rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-center gap-2 border-b border-line px-4 py-3",children:[(0,t.jsx)(em,{size:15,className:"text-accent","aria-hidden":!0}),(0,t.jsxs)("h2",{id:"move-title",className:"flex-1 text-sm font-medium text-ink",children:["Move ",e," request",1===e?"":"s"," to…"]}),(0,t.jsx)("button",{type:"button",onClick:a,"aria-label":"Close",className:"rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(J.X,{size:15})})]}),(0,t.jsx)("div",{className:"border-b border-line p-3",children:(0,t.jsx)("input",{autoFocus:!0,value:r,onChange:e=>l(e.target.value),placeholder:"Find a folder","aria-label":"Find a folder",className:"input h-8 text-xs"})}),(0,t.jsxs)("ul",{className:"min-h-0 flex-1 overflow-y-auto p-2",children:[(0,t.jsx)("li",{children:(0,t.jsx)("button",{type:"button",onClick:()=>n(""),className:"w-full rounded-md px-3 py-2 text-left text-sm text-mute hover:bg-panel-2 hover:text-ink",children:"Top level — no folder"})}),i.map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",onClick:()=>n(e),className:"flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm text-ink hover:bg-panel-2",children:[(0,t.jsx)(eu.f,{size:14,className:"shrink-0 text-mute","aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:e})]})},e))]})]})})}function eH({label:e,open:s,onOpenChange:n,items:a}){let r=(0,c.useRef)(null);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{ref:r,type:"button","aria-label":e,"aria-haspopup":"menu","aria-expanded":s,onClick:()=>n(!s),className:`mr-1 rounded p-1 text-mute hover:text-ink focus:opacity-100 ${s?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,t.jsx)(eb.f,{size:13})}),(0,t.jsx)(Y.f,{anchor:r,open:s,onClose:()=>n(!1),label:e,width:220,role:"menu",children:(0,t.jsx)("div",{className:"-m-2",children:a.map((e,s)=>"separator"===e?(0,t.jsx)(G.Z,{},s):(0,t.jsx)(G.d,{icon:e.icon,label:e.label,hint:e.hint,danger:e.danger,onSelect:()=>{n(!1),e.run()}},e.label))})})]})}function eK({path:e,open:s,onOpenChange:n,onNewRequest:a,onSettings:r,onNewInside:l,onRename:i,onDelete:o}){let d=(0,c.useRef)(null),u=(0,eN.useRouter)(),m=e=>()=>{n(!1),e()};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{ref:d,type:"button","aria-label":`Actions for ${e}`,"aria-haspopup":"menu","aria-expanded":s,onClick:()=>n(!s),className:`rounded p-1 text-mute hover:text-ink focus:opacity-100 ${s?"opacity-100":"opacity-0 group-hover/folder:opacity-100"}`,children:(0,t.jsx)(eb.f,{size:13})}),(0,t.jsx)(Y.f,{anchor:d,open:s,onClose:()=>n(!1),label:`Actions for ${e}`,width:240,role:"menu",children:(0,t.jsxs)("div",{className:"-m-2",children:[(0,t.jsx)(G.d,{icon:ec,label:"New request here",onSelect:m(a)}),(0,t.jsx)(G.d,{icon:ex.f,label:"New folder inside",onSelect:m(l)}),(0,t.jsx)(G.Z,{}),(0,t.jsx)(G.d,{icon:ev.f,label:"Run this folder",onSelect:m(()=>u.push((0,eP.W)(e)))}),(0,t.jsx)(G.d,{icon:ej.f,label:"Mock server for this folder",onSelect:m(()=>(0,ek.o)(e))}),(0,t.jsx)(G.d,{icon:K.f,label:"Folder settings",onSelect:m(r)}),(0,t.jsx)(G.Z,{}),(0,t.jsx)(G.d,{icon:eg.f,label:"Rename or move",onSelect:m(i)}),(0,t.jsx)(G.d,{icon:ed.f,label:"Export…",onSelect:m(()=>(0,e$.q)({kind:"folder",path:e}))}),(0,t.jsx)(G.Z,{}),(0,t.jsx)(G.d,{icon:X.f,label:"Delete folder",danger:!0,onSelect:m(o)})]})})]})}async function eX(e,t,s,n){let a,r,l=t.before;if(!l)return e;try{a=await en.v.get(l.requestId)}catch{throw Error(`Run first: “${l.requestName}” is no longer saved — pick another request on the Run first tab`)}if(a.secretsMissing?.length)throw Error(`Run first: the saved ${a.secretsMissing.join(", ")} of “${a.name}” is not available — open it and enter it again`);try{let e=await (0,et.c)({...(0,ee.i)(a.request),before:null,testData:null},a.collection,s);r=(0,ee.x)(e.draft,e.vars,n)}catch(e){throw Error(`Run first “${a.name}”: ${e instanceof Error?e.message:"invalid request"}`)}try{return{...e,setup:(0,ee.d)({...l,requestName:a.name},r)}}catch(e){throw Error(e instanceof Error&&e.message.startsWith("Run first")?e.message:`Run first “${a.name}”: ${e instanceof Error?e.message:"invalid request"}`)}}e.s(["C",0,eI,"M",0,function({onOpen:e}){let[s,n]=(0,c.useState)(!1),a=(0,c.useRef)(null);return(0,c.useEffect)(()=>{if(!s)return;let e=e=>!a.current?.contains(e.target)&&n(!1),t=e=>"Escape"===e.key&&n(!1);return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[s]),(0,t.jsxs)("div",{ref:a,className:"relative",children:[(0,t.jsxs)("button",{type:"button","aria-expanded":s,onClick:()=>n(e=>!e),className:"inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-xs text-mute hover:text-ink",children:[(0,t.jsx)(eu.f,{size:12,"aria-hidden":!0})," Load saved request"]}),s?(0,t.jsx)("div",{className:"absolute left-0 z-40 mt-1 flex h-80 w-80 flex-col rounded-md border border-line bg-panel p-2 shadow-xl",children:(0,t.jsx)(eW,{allowDelete:!1,onOpen:t=>{e(t),n(!1)}})}):null]})},"N",0,function({activeId:e,onOpen:s,onNew:n}){let[a,r]=(0,c.useState)(!1),l=(0,eU.P)();return(0,t.jsxs)("aside",{"aria-label":"Saved requests",className:"flex min-h-0 flex-col border-line bg-panel/40 px-2.5 py-3 lg:border-r",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center justify-between pl-1",children:[(0,t.jsxs)("h2",{className:"text-[13px] font-semibold whitespace-nowrap text-ink",children:["Saved requests ",(0,t.jsxs)("span",{className:"text-[11px] font-normal text-mute",title:"Show or hide this panel",children:["(",l,"+B)"]})]}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center",children:[(0,t.jsx)("button",{type:"button",onClick:n,title:"New request","aria-label":"New request",className:"rounded p-1 text-mute hover:bg-panel-2 hover:text-ink",children:(0,t.jsx)(ec,{size:14})}),(0,t.jsx)("button",{type:"button",onClick:()=>r(!0),title:"New folder","aria-label":"New folder",className:"rounded p-1 text-mute hover:bg-panel-2 hover:text-ink",children:(0,t.jsx)(ex.f,{size:14})}),(0,t.jsx)("button",{type:"button",onClick:()=>(0,ew.F)(),title:"Import requests — Postman, Insomnia, Bruno, OpenAPI, .http, Hurl, HAR","aria-label":"Import requests",className:"rounded p-1 text-mute hover:bg-panel-2 hover:text-ink",children:(0,t.jsx)(ep,{size:14})})]})]}),(0,t.jsx)(eW,{activeId:e,onOpen:s,newFolder:a,onNewFolderDone:()=>r(!1)})]})},"Z",0,function({initial:e,onSave:s,onCancel:n}){let{index:a}=(0,en.U)(),[r,l]=(0,c.useState)(e.name),[i,o]=(0,c.useState)(e.collection),d=(0,c.useRef)(null),u=[...new Set([...(a?.folders??[]).map(e=>e.path),...(a?.requests??[]).map(e=>e.collection)].filter(Boolean))].sort();return(0,c.useEffect)(()=>d.current?.select(),[]),(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),r.trim()&&s(r.trim(),i.trim())},onKeyDown:e=>"Escape"===e.key&&n(),className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-mute",children:["Collection",(0,t.jsx)("input",{value:i,onChange:e=>o(e.target.value),list:"atc-collections",placeholder:"none — or Orders/Admin",title:"A folder; use / for a folder inside another",className:"input w-48 py-1 text-xs","aria-label":"Collection"}),(0,t.jsx)("datalist",{id:"atc-collections",children:u.map(e=>(0,t.jsx)("option",{value:e},e))})]}),(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-mute",children:[(0,t.jsx)("span",{"aria-hidden":!0,children:"/"}),"Name",(0,t.jsx)("input",{ref:d,value:r,onChange:e=>l(e.target.value),className:"input w-52 py-1 text-xs","aria-label":"Request name"})]}),(0,t.jsx)("button",{type:"submit",className:"btn btn-primary py-1 text-xs",children:"Save request"}),(0,t.jsx)("button",{type:"button",className:"rounded p-1 text-mute hover:text-ink","aria-label":"Cancel",onClick:n,children:(0,t.jsx)(J.X,{size:14})})]})}],65638),e.s(["f",0,eX],46679)},10281,e=>{let t=(0,e.i(99522).f)("unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);e.s(["f",0,t],10281)}])})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{let e;var t,r=globalThis.TURBOPACK;if(void 0===r)r=[];else if(!Array.isArray(r))return;var n=function(){if(null!=self.TURBOPACK_ASSET_SUFFIX)return self.TURBOPACK_ASSET_SUFFIX;let e=document?.currentScript?.getAttribute?.("src")??"",t=e.indexOf("?");return t>=0?e.slice(t):""}(),o=((t=o||{})[t.Runtime=0]="Runtime",t[t.Parent=1]="Parent",t[t.Update=2]="Update",t);let l=new WeakMap;function i(e,t){this.m=e,this.e=t}let u=i.prototype,s=Object.prototype.hasOwnProperty,f="u">typeof Symbol&&Symbol.toStringTag;function c(e,t,r){s.call(e,t)||Object.defineProperty(e,t,r)}function a(e,t){let r=e.get(t);return void 0===r&&(r=p(t),e.set(t,r)),r}function p(e){return{exports:{},error:void 0,id:e,namespaceObject:void 0}}function d(e,t,r){c(e,"__esModule",{value:!0}),f&&c(e,f,{value:"Module"});let n=0;for(;n<t.length;){let r=t[n++],o=t[n++];if("number"==typeof o)if(0===o)c(e,r,{value:t[n++],enumerable:!0,writable:!1});else throw Error(`unexpected tag: ${o}`);else"function"==typeof t[n]?c(e,r,{get:o,set:t[n++],enumerable:!0}):c(e,r,{get:o,enumerable:!0})}r||Object.seal(e)}function h(e,t,r){let n,o;null!=t?o=(n=a(this.c,t)).exports:(n=this.m,o=this.e),n.namespaceObject=o,d(o,e,r)}function m(e,t,r,n){let o=Reflect.getOwnPropertyDescriptor(r,n);if(o){if("value"in o)return void e.push(t,0,o.value);if(o.get)return void e.push(t,o.get)}e.push(t,()=>r[n])}function y(e,t){(null!=t?a(this.c,t):this.m).exports=e}u.s=h,u.S=function(e,t){let r=[],n=0;for(;n<e.length;){let t=e[n++],o=n;for(;n<e.length&&0!==e[n];)n++;let l=n;n++;let i="string"==typeof t||"number"==typeof t?w.call(this,t):t;if(l-o==1){let t=e[o].split(",");for(let e=0;e<t.length;e+=2)m(r,t[e],i,t[e+1])}else for(let t=o;t<l;t+=2)m(r,e[t],i,e[t+1])}h.call(this,r,t)},u.j=function(e,t){let r,n;null!=t?n=(r=a(this.c,t)).exports:(r=this.m,n=this.e);let o=function(e,t){let r=l.get(e);if(!r){l.set(e,r=[]);let n=e=>{if("default"!==e){for(let t of r)if(s.call(t,e))return t}};e.exports=e.namespaceObject=new Proxy(t,{get(e,t){if(s.call(e,t)||"default"===t||"__esModule"===t)return Reflect.get(e,t);let r=n(t);return r&&Reflect.get(r,t)},set:()=>!1,defineProperty:()=>!1,deleteProperty:()=>!1,has:(e,t)=>!!Reflect.has(e,t)||"default"!==t&&"__esModule"!==t&&void 0!==n(t),ownKeys(e){let t=Reflect.ownKeys(e);for(let e of r)for(let r of Reflect.ownKeys(e))"default"===r||t.includes(r)||t.push(r);return t},getOwnPropertyDescriptor(e,t){let r=Reflect.getOwnPropertyDescriptor(e,t);if(r||"default"===t||"__esModule"===t)return r;let o=n(t);if(o)return{enumerable:!0,configurable:!0,get:()=>Reflect.get(o,t)}}})}return r}(r,n);"object"==typeof e&&null!==e&&o.push(e)},u.v=y,u.n=function(e,t){let r;(r=null!=t?a(this.c,t):this.m).exports=r.namespaceObject=e};let g=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,b=[null,g({}),g([]),g(g)];function O(e,t,r){let n=[],o=-1;for(let t=e;("object"==typeof t||"function"==typeof t)&&!b.includes(t);t=g(t))for(let r of Object.getOwnPropertyNames(t))n.push(r,function(e,t){return()=>e[t]}(e,r)),-1===o&&"default"===r&&(o=n.length-1);return r&&o>=0||(o>=0?n.splice(o,1,0,e):n.push("default",0,e)),d(t,n),t}function w(e){let t=B(e,this.m);if(t.namespaceObject)return t.namespaceObject;let r=t.exports;return t.namespaceObject=O(r,"function"==typeof r?function(...e){return r.apply(this,e)}:Object.create(null),r&&r.__esModule)}function v(e){let t=e.indexOf("#");-1!==t&&(e=e.substring(0,t));let r=e.indexOf("?");return -1!==r&&(e=e.substring(0,r)),e}u.i=w,u.A=function(e){return this.r(e)(w.bind(this))},u.t="function"==typeof require?require:function(){throw Error("Unexpected use of runtime require")},u.r=function(e){return B(e,this.m).exports},u.f=function(e){function t(t){if(t=v(t),s.call(e,t))return e[t].module();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r}return t.keys=()=>Object.keys(e),t.resolve=t=>{if(t=v(t),s.call(e,t))return e[t].id();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r},t.import=async e=>await t(e),t};let R=function(e){let t=new URL(e,"x:/"),r={};for(let e in t)r[e]=t[e];for(let t in r.href=e,r.pathname=e.replace(/[?#].*/,""),r.origin=r.protocol="",r.toString=r.toJSON=(...t)=>e,r)Object.defineProperty(this,t,{enumerable:!0,configurable:!0,value:r[t]})};function U(e,t){throw Error(`Invariant: ${t(e)}`)}R.prototype=URL.prototype,u.U=R,u.z=function(e){throw Error("dynamic usage of require is not supported")},u.g=globalThis;let _=i.prototype,k="string"==typeof TURBOPACK_CHUNK_BASE_PATH?TURBOPACK_CHUNK_BASE_PATH:"/_next/",P=new Map;u.M=P;let $=new Map,C=new Map,A=new Map;async function j(e,t,r){let n;if("string"==typeof r)return function(e,t,r){return M(e,t,r)}(e,t,x(r));let o=r.included||[],l=o.map(e=>!!P.has(e)||$.get(e));if(l.length>0&&l.every(e=>e))return void await Promise.all(l);for(let l of(n=M(e,t,x(r.path)),o))$.has(l)||$.set(l,n);await n}_.l=function(e){return j(o.Parent,this.m.id,e)};let E=Promise.resolve(void 0),S=new WeakMap;function M(t,r,n){let l=e.loadChunkCached(t,n),i=S.get(l);if(void 0===i){let e=S.set.bind(S,l,E);i=l.then(e).catch(e=>{let l;switch(t){case o.Runtime:l=`as a runtime dependency of chunk ${r}`;break;case o.Parent:l=`from module ${r}`;break;case o.Update:l="from an HMR update";break;default:U(t,e=>`Unknown source type: ${e}`)}let i=Error(`Failed to load chunk ${n} ${l}${e?`: ${e}`:""}`,e?{cause:e}:void 0);throw i.name="ChunkLoadError",i}),S.set(l,i)}return i}_.L=function(e){var t,r;return t=o.Parent,r=this.m.id,M(t,r,e)};_.R=function(e){let t=this.r(e);return t?.default??t},_.P=function(e){return`/ROOT/${e??""}`},_.F=function(e,t){return`file:///${encodeURIComponent(t??"ROOT")}/${e.split("/").map(encodeURIComponent).join("/")}`},_.q=function(e,t){y.call(this,`${e}${n}`,t)};let T=/[^A-Za-z0-9\-_.!~*'()/]/;function x(e,t=k){let r=T.test(e)?e.split("/").map(encodeURIComponent).join("/"):e;return`${t}${r}${n}`}function K(e,t){let r,n=e.indexOf("?");if(-1!==n)r=n;else{let t=e.indexOf("#");r=-1!==t?t:e.length}return r>=t.length&&e.startsWith(t,r-t.length)}_.b=k,_.X=n,_.h=x;function N(e){return K(e,".css")}let L=new Map;u.c=L;let B=(e,t)=>{let r=L.get(e);if(r){if(r.error)throw r.error;return r}return I(e,o.Parent,t.id)};function I(e,t,r){let n=P.get(e);if("function"!=typeof n)throw Error(function(e,t,r){let n;switch(t){case 0:n=`as a runtime entry of chunk ${r}`;break;case 1:n=`because it was required from module ${r}`;break;case 2:n="because of an HMR update";break;default:U(t,e=>`Unknown source type: ${e}`)}return`Module ${e} was instantiated ${n}, but the module factory is not available.`}(e,t,r));let o=p(e),l=o.exports;L.set(e,o);let u=new i(o,l);try{n(u,o,l)}catch(e){throw o.error=e,e}return o.namespaceObject&&o.exports!==o.namespaceObject&&O(o.exports,o.namespaceObject),o}function H(t){let r;if(!Array.isArray(t))return e.registerChunk(void 0,t);let n=function(e){if("string"==typeof e)return e;if(e)return{src:e.getAttribute("src")};if("u">typeof TURBOPACK_NEXT_CHUNK_URLS)return{src:TURBOPACK_NEXT_CHUNK_URLS.pop()};throw Error("chunk path empty but not in a worker")}(t[0]);return 2===t.length?r=t[1]:(r=void 0,!function e(t,r,n,o){let l=r,i=t[l];for(Array.isArray(i)&&(e(i,0,n,o),l++);l<t.length;){let e,r=l+1;for(;r<t.length&&"function"!=typeof t[r];)r++;if(r===t.length)throw Error("malformed chunk format, expected a factory function");let i=t[r];for(let o=l;o<r;o++){let r=t[o],l=n.get(r);if(l){e=l;break}}let u=e??i,s=!1;for(let e=l;e<r;e++){let r=t[e];n.has(r)||(s||(u===i&&Object.defineProperty(i,"name",{value:"module evaluation"}),s=!0),n.set(r,u),o?.(r))}l=r+1}}(t,1,P)),e.registerChunk(n,r)}let q=new Map;function D(e){let t=q.get(e);if(!t){let r,n;t={resolved:!1,loadingStarted:!1,retryAttempts:0,promise:new Promise((e,t)=>{r=e,n=t}),resolve:()=>{t.resolved=!0,r()},reject:n},q.set(e,t)}return t}function F(e,t,r,n,o){!(null==n||n instanceof DOMException&&"NetworkError"===n.name)||r.retryAttempts>=1||q.get(t)!==r?(q.get(t)===r&&q.delete(t),r.reject(n)):(r.retryAttempts++,setTimeout(()=>{r.resolved||q.get(t)!==r||(o?o():(r.loadingStarted=!1,W(e,t)))},200+Math.floor(401*Math.random())))}function W(e,t){let r=D(t);if(r.loadingStarted)return r.promise;if(e===o.Runtime)return r.loadingStarted=!0,N(t)&&r.resolve(),r.promise;if("function"==typeof importScripts)if(N(t));else if(K(t,".js")){self.TURBOPACK_NEXT_CHUNK_URLS.push(t);try{importScripts(t)}catch(n){F(e,t,r,n)}}else throw Error(`can't infer type of chunk from URL ${t} in worker`);else{let n=decodeURI(t);if(N(t))if(document.querySelectorAll(`link[rel=stylesheet][href="${t}"],link[rel=stylesheet][href^="${t}?"],link[rel=stylesheet][href="${n}"],link[rel=stylesheet][href^="${n}?"]`).length>0)r.resolve();else{let n=()=>{let o=document.createElement("link");return o.rel="stylesheet",o.crossOrigin=null,o.href=t,o.onerror=()=>{let l=document.createComment("");o.replaceWith(l),F(e,t,r,void 0,()=>l.replaceWith(n()))},o.onload=()=>{r.resolve()},o};document.head.appendChild(n())}else if(K(t,".js")){let o=document.querySelectorAll(`script[src="${t}"],script[src^="${t}?"],script[src="${n}"],script[src^="${n}?"]`);if(o.length>0)for(let n of Array.from(o))n.addEventListener("error",()=>{n.remove(),F(e,t,r)},{once:!0});else{let n=document.createElement("script");n.crossOrigin=null,n.src=t,n.onerror=()=>{n.remove(),F(e,t,r)},document.head.appendChild(n)}}else throw Error(`can't infer type of chunk from URL ${t}`)}return r.loadingStarted=!0,r.promise}e={async registerChunk(e,t){let r;if(null!=e&&(r=function(e){if("string"==typeof e)return e;let t=decodeURIComponent(e.src.replace(/[?#].*$/,""));return t.startsWith(k)?t.slice(k.length):t}(e),D("string"==typeof e?x(e):e.src).resolve()),null!=t){for(let e of t.otherChunks)D(x("string"==typeof e?e:e.path));if(await Promise.all(t.otherChunks.map(e=>{var t;return t=r,j(o.Runtime,t,e)})),t.runtimeModuleIds.length>0)for(let e of t.runtimeModuleIds)!function(e,t){let r=L.get(t);if(r){if(r.error)throw r.error;return}I(t,o.Runtime,e)}(r,e)}},loadChunkCached:(e,t)=>W(e,t)},globalThis.TURBOPACK={push:H},r.forEach(H)})();
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
|
-
2:
|
|
3
|
-
3:
|
|
4
|
-
4:
|
|
5
|
-
5:
|
|
6
|
-
6:I[
|
|
7
|
-
7:"$
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
2:"/_next/static/chunks/0g9k0swrer6i5.js"
|
|
3
|
+
3:"/_next/static/chunks/0bgmfb8f3pd8e.js"
|
|
4
|
+
4:"/_next/static/chunks/2sb9zma7ae-_f.js"
|
|
5
|
+
5:"/_next/static/chunks/2c1b5jqwxl4ra.js"
|
|
6
|
+
6:I[87329,["$2","$3","$4","$5"],"Providers"]
|
|
7
|
+
7:I[60459,["$2","$3","$4","$5"],"AppShell"]
|
|
8
|
+
8:I[80474,["$2","$3","$4","$5"],"default"]
|
|
9
|
+
9:I[2236,["$2","$3","$4","$5"],"default"]
|
|
10
|
+
d:I[88987,["$2","$3","$4","$5"],"OutletBoundary"]
|
|
11
|
+
e:"$Sreact.suspense"
|
|
12
|
+
10:"ViewportBoundary"
|
|
13
|
+
11:I[88987,["$2","$3","$4","$5"],"$10"]
|
|
14
|
+
13:"MetadataBoundary"
|
|
15
|
+
14:I[88987,["$2","$3","$4","$5"],"$13"]
|
|
16
|
+
16:I[50965,["$2","$3","$4","$5"],"default",1]
|
|
17
|
+
:HL["/_next/static/chunks/2sjog4to0fmbb.css","style"]
|
|
18
|
+
b:X
|
|
19
|
+
c:[["children",{"s":"__PAGE__","h":512,"d":{"r":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:t:t:d:r:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:t:t:d:r:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:t:t:d:r:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:t:t:d:r:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$Ld",null,{"children":["$","$e",null,{"name":"Next.MetadataOutlet","children":"$@f"}]}]]}],"p":false,"v":null}}]]
|
|
20
|
+
a:[["children",{"s":"/_not-found","h":512,"d":{"r":["$","$1","c",{"children":[null,["$","$L8",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L9",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],"p":false,"v":"$b"},"c":"$Qc"}]]
|
|
21
|
+
0:{"P":null,"c":["","_not-found",""],"q":"","i":false,"t":{"t":{"s":"","h":528,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/2sjog4to0fmbb.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0g9k0swrer6i5.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/0bgmfb8f3pd8e.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/_next/static/chunks/2sb9zma7ae-_f.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/_next/static/chunks/2c1b5jqwxl4ra.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","className":"h-full HSxXEW_variable _2UZmra_variable","suppressHydrationWarning":true,"children":["$","body",null,{"className":"h-full font-sans antialiased","children":["$","$L6",null,{"children":["$","$L7",null,{"children":["$","$L8",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L9",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]]}],"p":false,"v":null},"c":"$Qa"},"h":{"r":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L11",null,{"children":"$L12"}],["$","$L14",null,{"children":[["$","div",null,{"hidden":true,"children":["$","$e",null,{"name":"Next.Metadata","children":"$L15"}]}],null]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"p":false,"v":null}},"m":"$undefined","G":["$16",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/2sjog4to0fmbb.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"r":"$undefined","s":"$undefined","a":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"8uBf4sRL82dkVbEC6zib9"}
|
|
22
|
+
b:C
|
|
23
|
+
12:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
|
|
24
|
+
17:I[64052,["$2","$3","$4","$5"],"IconMark"]
|
|
25
|
+
f:null
|
|
26
|
+
15:[["$","title","0",{"children":"APITestCenter"}],["$","meta","1",{"name":"description","content":"Test APIs and performance test them, on your own computer."}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.0pwkek30ie1za.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/icon.png?icon.3k806k9hro987.png","sizes":"512x512","type":"image/png"}],["$","$L17","4",{}]]
|
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
|
-
2:
|
|
3
|
-
3:"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
10:I[
|
|
11
|
-
:
|
|
12
|
-
|
|
2
|
+
2:"/_next/static/chunks/0g9k0swrer6i5.js"
|
|
3
|
+
3:"/_next/static/chunks/0bgmfb8f3pd8e.js"
|
|
4
|
+
4:"/_next/static/chunks/2sb9zma7ae-_f.js"
|
|
5
|
+
5:"/_next/static/chunks/2c1b5jqwxl4ra.js"
|
|
6
|
+
6:I[87329,["$2","$3","$4","$5"],"Providers"]
|
|
7
|
+
7:I[60459,["$2","$3","$4","$5"],"AppShell"]
|
|
8
|
+
8:I[80474,["$2","$3","$4","$5"],"default"]
|
|
9
|
+
9:I[2236,["$2","$3","$4","$5"],"default"]
|
|
10
|
+
10:I[88987,["$2","$3","$4","$5"],"OutletBoundary"]
|
|
11
|
+
11:"$Sreact.suspense"
|
|
12
|
+
14:"ViewportBoundary"
|
|
13
|
+
15:I[88987,["$2","$3","$4","$5"],"$14"]
|
|
14
|
+
16:"MetadataBoundary"
|
|
15
|
+
17:I[88987,["$2","$3","$4","$5"],"$16"]
|
|
16
|
+
18:I[64052,["$2","$3","$4","$5"],"IconMark"]
|
|
17
|
+
:HL["/_next/static/chunks/2sjog4to0fmbb.css","style"]
|
|
18
|
+
b:X
|
|
13
19
|
e:X
|
|
14
20
|
e:C
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
f:[["children",{"s":"__PAGE__","h":160,"d":{"r":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:t:t:d:r:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:t:t:d:r:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:t:t:d:r:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:t:t:d:r:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L10",null,{"children":["$","$11",null,{"name":"Next.MetadataOutlet","children":"$@12"}]}]]}],"p":"$@13","v":null,"s":"$b"}}]]
|
|
22
|
+
c:[["children",{"s":"/_not-found","h":96,"d":{"r":["$","$1","c",{"children":[null,["$","$L8",null,{"parallelRouterKey":"children","template":["$","$L9",null,{}]}]]}],"p":"$@d","v":"$e","s":"$b"},"c":"$Qf"}]]
|
|
23
|
+
0:{"t":{"t":{"s":"","h":80,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/2sjog4to0fmbb.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/0g9k0swrer6i5.js","async":true}],["$","script","script-1",{"src":"/_next/static/chunks/0bgmfb8f3pd8e.js","async":true}],["$","script","script-2",{"src":"/_next/static/chunks/2sb9zma7ae-_f.js","async":true}],["$","script","script-3",{"src":"/_next/static/chunks/2c1b5jqwxl4ra.js","async":true}]],["$","html",null,{"lang":"en","className":"h-full HSxXEW_variable _2UZmra_variable","suppressHydrationWarning":true,"children":["$","body",null,{"className":"h-full font-sans antialiased","children":["$","$L6",null,{"children":["$","$L7",null,{"children":["$","$L8",null,{"parallelRouterKey":"children","template":["$","$L9",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]]}],"p":"$@a","v":null,"s":"$b"},"c":"$Qc"},"h":{"r":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L15",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","$L17",null,{"children":[["$","div",null,{"hidden":true,"children":["$","$11",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"APITestCenter"}],["$","meta","1",{"name":"description","content":"Test APIs and performance test them, on your own computer."}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.0pwkek30ie1za.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"/icon.png?icon.3k806k9hro987.png","sizes":"512x512","type":"image/png"}],["$","$L18","4",{}]]}]}],null]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"p":"$@19","v":null,"s":"$b"}},"a":"$@1a","u":"$@1b","b":"8uBf4sRL82dkVbEC6zib9"}
|
|
24
|
+
12:null
|
|
25
|
+
b:300
|
|
26
|
+
1b:true
|
|
27
|
+
b:C
|
|
28
|
+
1a:0
|
|
22
29
|
d:"$undefined"
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
a:"$undefined"
|
|
31
|
+
19:"$undefined"
|
|
32
|
+
13:"$undefined"
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
:HL["/_next/static/chunks/
|
|
2
|
-
|
|
1
|
+
:HL["/_next/static/chunks/2sjog4to0fmbb.css","style"]
|
|
2
|
+
2:[["children",{"s":"__PAGE__","h":160}]]
|
|
3
|
+
1:[["children",{"s":"/_not-found","h":96,"c":"$Q2"}]]
|
|
4
|
+
0:{"b":"8uBf4sRL82dkVbEC6zib9","t":{"t":{"s":"","h":80,"c":"$Q1"}}}
|