@visulima/ono 2.0.0-alpha.18 → 2.0.0-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## @visulima/ono [2.0.0-alpha.19](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.18...@visulima/ono@2.0.0-alpha.19) (2026-05-06)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **ono:** collapse stringifiedBody to a single toString() call ([1847db9](https://github.com/visulima/visulima/commit/1847db944e78349f932bb6dc51e3247c5a71b01e))
6
+
7
+
8
+ ### Dependencies
9
+
10
+ * **@visulima/error:** upgraded to 6.0.0-alpha.16
11
+
1
12
  ## @visulima/ono [2.0.0-alpha.18](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.17...@visulima/ono@2.0.0-alpha.18) (2026-05-04)
2
13
 
3
14
 
@@ -1,4 +1,4 @@
1
- var ie=Object.defineProperty;var T=(e,r)=>ie(e,"name",{value:r,configurable:!0});import{a as G,s as P,n as X,e as W,d as de,g as le,c as ce}from"../../packem_shared/clipboard-jWc8JBuB.js";const q="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-braces%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M8%203H7a2%202%200%200%200-2%202v5a2%202%200%200%201-2%202%202%202%200%200%201%202%202v5c0%201.1.9%202%202%202h1%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2021h1a2%202%200%200%200%202-2v-5c0-1.1.9-2%202-2a2%202%200%200%201-2-2V5a2%202%200%200%200-2-2h-1%22%20%2F%3E%20%3C%2Fsvg%3E",I="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-cookie%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M12%202a10%2010%200%201%200%2010%2010%204%204%200%200%201-5-5%204%204%200%200%201-5-5%22%20%2F%3E%20%3Cpath%20d%3D%22M8.5%208.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2015.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2012v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M11%2017v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M7%2014v.01%22%20%2F%3E%20%3C%2Fsvg%3E",S="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-file-text%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M6%2022a2%202%200%200%201-2-2V4a2%202%200%200%201%202-2h8a2.4%202.4%200%200%201%201.704.706l3.588%203.588A2.4%202.4%200%200%201%2020%208v12a2%202%200%200%201-2%202z%22%20%2F%3E%20%3Cpath%20d%3D%22M14%202v5a1%201%200%200%200%201%201h5%22%20%2F%3E%20%3Cpath%20d%3D%22M10%209H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2013H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2017H8%22%20%2F%3E%20%3C%2Fsvg%3E",J="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-globe%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%20%2F%3E%20%3Cpath%20d%3D%22M12%202a14.5%2014.5%200%200%200%200%2020%2014.5%2014.5%200%200%200%200-20%22%20%2F%3E%20%3Cpath%20d%3D%22M2%2012h20%22%20%2F%3E%20%3C%2Fsvg%3E",R="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-user%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M19%2021v-2a4%204%200%200%200-4-4H9a4%204%200%200%200-4%204v2%22%20%2F%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%227%22%20r%3D%224%22%20%2F%3E%20%3C%2Fsvg%3E";var ve=Object.defineProperty,ue=T((e,r)=>ve(e,"name",{value:r,configurable:!0}),"s$2");const O=ue(({label:e="Copy",successText:r="Copied!",targetId:o})=>{const c=G(o),m=G(e),x=P(e),l=P(r);return{html:`
1
+ var ie=Object.defineProperty;var J=(e,r)=>ie(e,"name",{value:r,configurable:!0});import{a as G,s as P,n as X,e as W,d as de,g as le,c as ce}from"../../packem_shared/clipboard-DbMCKslu.js";const T="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-braces%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M8%203H7a2%202%200%200%200-2%202v5a2%202%200%200%201-2%202%202%202%200%200%201%202%202v5c0%201.1.9%202%202%202h1%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2021h1a2%202%200%200%200%202-2v-5c0-1.1.9-2%202-2a2%202%200%200%201-2-2V5a2%202%200%200%200-2-2h-1%22%20%2F%3E%20%3C%2Fsvg%3E",q="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-cookie%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M12%202a10%2010%200%201%200%2010%2010%204%204%200%200%201-5-5%204%204%200%200%201-5-5%22%20%2F%3E%20%3Cpath%20d%3D%22M8.5%208.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2015.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2012v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M11%2017v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M7%2014v.01%22%20%2F%3E%20%3C%2Fsvg%3E",O="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-file-text%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M6%2022a2%202%200%200%201-2-2V4a2%202%200%200%201%202-2h8a2.4%202.4%200%200%201%201.704.706l3.588%203.588A2.4%202.4%200%200%201%2020%208v12a2%202%200%200%201-2%202z%22%20%2F%3E%20%3Cpath%20d%3D%22M14%202v5a1%201%200%200%200%201%201h5%22%20%2F%3E%20%3Cpath%20d%3D%22M10%209H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2013H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2017H8%22%20%2F%3E%20%3C%2Fsvg%3E",I="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-globe%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%20%2F%3E%20%3Cpath%20d%3D%22M12%202a14.5%2014.5%200%200%200%200%2020%2014.5%2014.5%200%200%200%200-20%22%20%2F%3E%20%3Cpath%20d%3D%22M2%2012h20%22%20%2F%3E%20%3C%2Fsvg%3E",V="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-user%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M19%2021v-2a4%204%200%200%200-4-4H9a4%204%200%200%200-4%204v2%22%20%2F%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%227%22%20r%3D%224%22%20%2F%3E%20%3C%2Fsvg%3E";var ue=Object.defineProperty,ve=J((e,r)=>ue(e,"name",{value:r,configurable:!0}),"s$2");const S=ve(({label:e="Copy",successText:r="Copied!",targetId:o})=>{const c=G(o),m=G(e),x=P(e),l=P(r);return{html:`
2
2
  <button
3
3
  type="button"
4
4
  aria-label="${m}"
@@ -11,50 +11,50 @@ var ie=Object.defineProperty;var T=(e,r)=>ie(e,"name",{value:r,configurable:!0})
11
11
  <span class="ono-copy-success dui hidden size-4 text-[var(--ono-red-orange)]" style="-webkit-mask-image: url('${W}'); mask-image: url('${W}')"></span>
12
12
  <span class="sr-only">${x}</span>
13
13
  </button>
14
- `}},"copyButton");var pe=Object.defineProperty,j=T((e,r)=>pe(e,"name",{value:r,configurable:!0}),"s$1");const me=typeof globalThis<"u"&&"Request"in globalThis,Z=j((e,r)=>r in e,"hasProperty"),V=j((e,r)=>Z(e,r)&&typeof e[r]=="function","hasMethod"),ee=j((e,r)=>Z(e,r)&&typeof e[r]=="string","hasStringProperty"),xe=j(e=>me&&V(e,"clone"),"isNativeRequest"),be=j(e=>V(e,"on")&&ee(e,"method"),"isIncomingMessage");j(e=>!xe(e)&&!be(e)&&ee(e,"method"),"isExpressRequest");const L=j(e=>typeof e=="object"&&e!==null&&V(e,"forEach")&&V(e,"get"),"isHeadersObject");var ge=Object.defineProperty,a=T((e,r)=>ge(e,"name",{value:r,configurable:!0}),"s");const he=[/authorization/i,/cookie/i,/set-cookie/i,/x-api-key/i,/api-key/i,/x-auth/i,/token/i,/secret/i],H=a((e,r)=>{if(typeof e=="object"&&e!==null&&r in e)return e[r]},"safeGetProperty"),p=a((e,r)=>{const o=H(e,r);return typeof o=="function"?o:void 0},"safeGetMethod"),A=a((e,r)=>{const o=H(e,r);return typeof o=="string"?o:void 0},"safeGetString"),fe=a((e,r)=>r?.some(o=>o.toLowerCase()===e.toLowerCase())?!0:he.some(o=>o.test(e)),"isSensitiveHeader"),ye=a(e=>{if(!e)return[];if(L(e)){const r=p(e,"entries");if(r){const o=r();return Array.from(o,([c,m])=>[c,m])}}return Object.entries(e)},"normalizeHeadersToEntries"),$e=a((e,r)=>!r||r.length===0?!0:r.some(o=>o.toLowerCase()===e.toLowerCase()),"shouldIncludeHeader"),we=a((e,r)=>!e||!r?e:Array.isArray(e)?e.map(()=>r):r,"maskHeaderValue"),ke=a((e,r,o,c="[masked]")=>{const m=ye(e);if(m.length===0)return;const x={};return m.forEach(([l,n])=>{if(!$e(l,r)||n===void 0)return;const b=fe(l.toLowerCase(),o)?c:void 0;x[l]=we(n,b)}),x},"filterHeaders"),Y=a(e=>{try{return JSON.stringify(e,null,2)}catch{return String(e)}},"safeJsonStringify"),De=a(e=>{if(!e)return{};const r={};return e.split(";").map(o=>o.trim()).filter(Boolean).forEach(o=>{const c=o.indexOf("=");if(c===-1)return;const m=o.slice(0,c).trim(),x=o.slice(c+1).trim();r[m]=x}),r},"parseCookieString"),Ce=a(async(e,r)=>{try{const o=(A(e,"method")??"GET").toUpperCase();if(o==="GET"||o==="HEAD")return;const c=H(e,"headers"),m=L(c)?p(c,"get")?.("content-type")??"":String(c["content-type"]??""),x=p(e,"clone"),l=x?x():e;if(p(l,"json")&&m.includes("application/json"))try{const n=p(l,"json");return n?await n():void 0}catch{try{const n=p(l,"text");return n?await n()??"":void 0}catch{return}}if(p(l,"text"))try{const n=p(l,"text");return n?await n():void 0}catch{return}return p(e,"on")?await new Promise(n=>{try{let b="",B=!1;const D=p(e,"setEncoding");D&&D("utf8");const C=a(y=>{if(B)return;const M=typeof y=="string"?y:String(y);if(b.length+M.length>r){const k=Math.max(0,r-b.length);b+=M.slice(0,k),B=!0,h(),n(`${b}
15
- … [truncated]`);return}b+=M},"onData"),E=a(()=>{h(),n(b||void 0)},"onEnd"),N=a(()=>{h(),n(void 0)},"onError"),h=a(()=>{const y=p(e,"off");y?.("data",C),y?.("end",E),y?.("error",N)},"cleanup"),F=p(e,"on");F?.("data",C),F?.("end",E),F?.("error",N)}catch{n(void 0)}}):void 0}catch{return}},"readRequestBody"),Fe=a(async(e,r)=>{const o=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`,{headerAllowlist:c,headerDenylist:m,maskValue:x="[masked]"}=r,l=ke(H(e,"headers"),c,m,x),n=a(t=>{if(t!==void 0)return Array.isArray(t)?t.join(", "):t},"toSingle"),b=a(t=>`'${t.replaceAll("'",String.raw`'\''`)}'`,"shellQuote"),B=a(t=>{if(!t)return;const s=[];return Object.entries(t).forEach(([i,d])=>{const g=n(d)??"";s.push(`${i}=${g}`)}),s.length>0?s.join("; "):void 0},"buildCookieHeader");let D;const C=H(e,"headers");if(L(C)){const t=p(C,"get")?.("cookie");D=typeof t=="string"?t:void 0}else if(C!==void 0){const t=C;if(Array.isArray(t.cookie))D=t.cookie[0];else{const s=t.cookie;D=typeof s=="string"?s:void 0}}const E=De(D),N=Math.max(0,r.previewBytes??64e3),h=await Ce(e,N),F=a(()=>{const t=(A(e,"method")??"GET").toUpperCase(),s=A(e,"url")??"",i=[],d={};l&&Object.entries(l).forEach(([$,w])=>{const Q=n(w);Q!==void 0&&(d[$]=Q)});const g=B(E);g&&!d.cookie&&(d.Cookie=g),Object.entries(d).forEach(([$,w])=>{i.push(`-H ${b(`${$}: ${w}`)}`)});let u="";if(h!=null&&t!=="GET"){const $=typeof h=="string"?h:Y(h);u=`--data ${b($)}`}const v=["curl","-X",t];return i.length>0&&v.push("\\",` ${i.join(` \\
16
- `)}`),u&&v.push("\\",` ${u}`),v.push("\\",` ${b(s)}`),v.join(" ")},"buildCurl")(),y=(await de(["bash"])).codeToHtml(F,{lang:"bash",themes:{dark:"min-dark",light:"min-light"}}),M=le(y),k=a(t=>G(t),"attributeEscape"),f=a(t=>P(t),"escapeHtml"),U=a(t=>!t||Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty)</div>':`<div class="px-4 pb-4">${Object.entries(t).map(([s,i])=>{const d=Array.isArray(i)?i.join(", "):i;return`<div class="grid grid-cols-[200px_1fr] gap-3 items-start py-2 border-b border-[var(--ono-border)]">
17
- <div class="text-[11px] uppercase tracking-wide text-[var(--ono-text-muted)]">${f(s)}</div>
18
- <div class="text-sm break-words whitespace-pre-wrap text-[var(--ono-text)]">${f(d)}</div>
19
- </div>`}).join("")}</div>`,"renderKeyValueTable"),te=a(t=>`<span class="text-[var(--ono-red-orange)]">${typeof t=="string"?`"${f(t)}"`:String(t)}</span>`,"renderPrimitiveValue"),re=a(t=>`<span class="italic text-[var(--ono-text-muted)]">${t===null?"null":"undefined"}</span>`,"renderNullishValue"),oe=a((t,s)=>{if(Object.keys(t).length===0)return'<span class="italic text-[var(--ono-text-muted)]">(empty object)</span>';if(s>=3)return`<span class="italic text-[var(--ono-text-muted)]">{Object with ${String(Object.keys(t).length)} keys}</span>`;const i=Object.entries(t).slice(0,10).map(([g,u])=>{const v=z(u,s+1);return`
14
+ `}},"copyButton");var pe=Object.defineProperty,j=J((e,r)=>pe(e,"name",{value:r,configurable:!0}),"s$1");const me=typeof globalThis<"u"&&"Request"in globalThis,Z=j((e,r)=>r in e,"hasProperty"),R=j((e,r)=>Z(e,r)&&typeof e[r]=="function","hasMethod"),ee=j((e,r)=>Z(e,r)&&typeof e[r]=="string","hasStringProperty"),xe=j(e=>me&&R(e,"clone"),"isNativeRequest"),be=j(e=>R(e,"on")&&ee(e,"method"),"isIncomingMessage");j(e=>!xe(e)&&!be(e)&&ee(e,"method"),"isExpressRequest");const L=j(e=>typeof e=="object"&&e!==null&&R(e,"forEach")&&R(e,"get"),"isHeadersObject");var ge=Object.defineProperty,s=J((e,r)=>ge(e,"name",{value:r,configurable:!0}),"s");const he=[/authorization/i,/cookie/i,/set-cookie/i,/x-api-key/i,/api-key/i,/x-auth/i,/token/i,/secret/i],H=s((e,r)=>{if(typeof e=="object"&&e!==null&&r in e)return e[r]},"safeGetProperty"),p=s((e,r)=>{const o=H(e,r);return typeof o=="function"?o:void 0},"safeGetMethod"),A=s((e,r)=>{const o=H(e,r);return typeof o=="string"?o:void 0},"safeGetString"),fe=s((e,r)=>r?.some(o=>o.toLowerCase()===e.toLowerCase())?!0:he.some(o=>o.test(e)),"isSensitiveHeader"),ye=s(e=>{if(!e)return[];if(L(e)){const r=p(e,"entries");if(r){const o=r();return Array.from(o,([c,m])=>[c,m])}}return Object.entries(e)},"normalizeHeadersToEntries"),we=s((e,r)=>!r||r.length===0?!0:r.some(o=>o.toLowerCase()===e.toLowerCase()),"shouldIncludeHeader"),$e=s((e,r)=>!e||!r?e:Array.isArray(e)?e.map(()=>r):r,"maskHeaderValue"),ke=s((e,r,o,c="[masked]")=>{const m=ye(e);if(m.length===0)return;const x={};return m.forEach(([l,n])=>{if(!we(l,r)||n===void 0)return;const b=fe(l.toLowerCase(),o)?c:void 0;x[l]=$e(n,b)}),x},"filterHeaders"),Y=s(e=>{try{return JSON.stringify(e,null,2)}catch{return String(e)}},"safeJsonStringify"),De=s(e=>{if(!e)return{};const r={};return e.split(";").map(o=>o.trim()).filter(Boolean).forEach(o=>{const c=o.indexOf("=");if(c===-1)return;const m=o.slice(0,c).trim(),x=o.slice(c+1).trim();r[m]=x}),r},"parseCookieString"),Ce=s(async(e,r)=>{try{const o=(A(e,"method")??"GET").toUpperCase();if(o==="GET"||o==="HEAD")return;const c=H(e,"headers"),m=L(c)?p(c,"get")?.("content-type")??"":String(c["content-type"]??""),x=p(e,"clone"),l=x?x():e;if(p(l,"json")&&m.includes("application/json"))try{const n=p(l,"json");return n?await n():void 0}catch{try{const n=p(l,"text");return n?await n()??"":void 0}catch{return}}if(p(l,"text"))try{const n=p(l,"text");return n?await n():void 0}catch{return}return p(e,"on")?await new Promise(n=>{try{let b="",N=!1;const D=p(e,"setEncoding");D&&D("utf8");const C=s(w=>{if(N)return;const M=typeof w=="string"?w:String(w);if(b.length+M.length>r){const k=Math.max(0,r-b.length);b+=M.slice(0,k),N=!0,f(),n(`${b}
15
+ … [truncated]`);return}b+=M},"onData"),E=s(()=>{f(),n(b||void 0)},"onEnd"),B=s(()=>{f(),n(void 0)},"onError"),f=s(()=>{const w=p(e,"off");w?.("data",C),w?.("end",E),w?.("error",B)},"cleanup"),F=p(e,"on");F?.("data",C),F?.("end",E),F?.("error",B)}catch{n(void 0)}}):void 0}catch{return}},"readRequestBody"),Fe=s(async(e,r)=>{const o=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`,{headerAllowlist:c,headerDenylist:m,maskValue:x="[masked]"}=r,l=ke(H(e,"headers"),c,m,x),n=s(t=>{if(t!==void 0)return Array.isArray(t)?t.join(", "):t},"toSingle"),b=s(t=>`'${t.replaceAll("'",String.raw`'\''`)}'`,"shellQuote"),N=s(t=>{if(!t)return;const a=[];return Object.entries(t).forEach(([i,d])=>{const g=n(d)??"";a.push(`${i}=${g}`)}),a.length>0?a.join("; "):void 0},"buildCookieHeader");let D;const C=H(e,"headers");if(L(C)){const t=p(C,"get")?.("cookie");D=typeof t=="string"?t:void 0}else if(C!==void 0){const t=C;if(Array.isArray(t.cookie))[D]=t.cookie;else{const a=t.cookie;D=typeof a=="string"?a:void 0}}const E=De(D),B=Math.max(0,r.previewBytes??64e3),f=await Ce(e,B),F=s(()=>{const t=(A(e,"method")??"GET").toUpperCase(),a=A(e,"url")??"",i=[],d={};l&&Object.entries(l).forEach(([h,$])=>{const Q=n($);Q!==void 0&&(d[h]=Q)});const g=N(E);g&&!d.cookie&&(d.Cookie=g),Object.entries(d).forEach(([h,$])=>{i.push(`-H ${b(`${h}: ${$}`)}`)});let v="";if(f!=null&&t!=="GET"){const h=typeof f=="string"?f:Y(f);v=`--data ${b(h)}`}const u=["curl","-X",t];return i.length>0&&u.push("\\",` ${i.join(` \\
16
+ `)}`),v&&u.push("\\",` ${v}`),u.push("\\",` ${b(a)}`),u.join(" ")},"buildCurl")(),w=(await de(["bash"])).codeToHtml(F,{lang:"bash",themes:{dark:"min-dark",light:"min-light"}}),M=le(w),k=s(t=>G(t),"attributeEscape"),y=s(t=>P(t),"escapeHtml"),U=s(t=>!t||Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty)</div>':`<div class="px-4 pb-4">${Object.entries(t).map(([a,i])=>{const d=Array.isArray(i)?i.join(", "):i;return`<div class="grid grid-cols-[200px_1fr] gap-3 items-start py-2 border-b border-[var(--ono-border)]">
17
+ <div class="text-[11px] uppercase tracking-wide text-[var(--ono-text-muted)]">${y(a)}</div>
18
+ <div class="text-sm break-words whitespace-pre-wrap text-[var(--ono-text)]">${y(d)}</div>
19
+ </div>`}).join("")}</div>`,"renderKeyValueTable"),te=s(t=>`<span class="text-[var(--ono-red-orange)]">${typeof t=="string"?`"${y(t)}"`:String(t)}</span>`,"renderPrimitiveValue"),re=s(t=>`<span class="italic text-[var(--ono-text-muted)]">${t===null?"null":"undefined"}</span>`,"renderNullishValue"),oe=s((t,a)=>{if(Object.keys(t).length===0)return'<span class="italic text-[var(--ono-text-muted)]">(empty object)</span>';if(a>=3)return`<span class="italic text-[var(--ono-text-muted)]">{Object with ${String(Object.keys(t).length)} keys}</span>`;const i=Object.entries(t).slice(0,10).map(([g,v])=>{const u=z(v,a+1);return`
20
20
  <div class="ml-4 pl-3 py-1 border-l-2 border-[var(--ono-border)]">
21
- <span class="font-medium text-[var(--ono-text)]">${f(g)}:</span> ${v}
22
- </div>`}).join(""),d=Object.keys(t).length>10?`<div class="ml-4 italic text-[var(--ono-text-muted)]">... and ${String(Object.keys(t).length-10)} more keys</div>`:"";return`<div class="space-y-1">${i}${d}</div>`},"renderObjectValue"),z=a((t,s=0)=>{if(t==null)return re(t);if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return te(t);if(Array.isArray(t)){if(t.length===0)return'<span class="italic text-[var(--ono-text-muted)]">(empty array)</span>';if(s>=3)return`<span class="italic text-[var(--ono-text-muted)]">[Array with ${String(t.length)} items]</span>`;const i=t.slice(0,10).map((g,u)=>{const v=z(g,s+1);return`
21
+ <span class="font-medium text-[var(--ono-text)]">${y(g)}:</span> ${u}
22
+ </div>`}).join(""),d=Object.keys(t).length>10?`<div class="ml-4 italic text-[var(--ono-text-muted)]">... and ${String(Object.keys(t).length-10)} more keys</div>`:"";return`<div class="space-y-1">${i}${d}</div>`},"renderObjectValue"),z=s((t,a=0)=>{if(t==null)return re(t);if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return te(t);if(Array.isArray(t)){if(t.length===0)return'<span class="italic text-[var(--ono-text-muted)]">(empty array)</span>';if(a>=3)return`<span class="italic text-[var(--ono-text-muted)]">[Array with ${String(t.length)} items]</span>`;const d=t.slice(0,10).map((v,u)=>{const h=z(v,a+1);return`
23
23
  <div class="ml-4 pl-3 py-1 border-l-2 border-[var(--ono-border)]">
24
- <span class="text-xs text-[var(--ono-text-muted)]">[${String(u)}]:</span> ${v}
25
- </div>`}).join(""),d=t.length>10?`<div class="ml-4 text-sm italic text-[var(--ono-text-muted)]">... and ${String(t.length-10)} more items</div>`:"";return`<div class="space-y-1">${i}${d}</div>`}return typeof t=="object"?oe(t,s):`<span class="text-[var(--ono-text)]">${f(typeof t=="symbol"?t.toString():String(t))}</span>`},"renderValue"),_=a(t=>!t||Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty)</div>':`<div class="px-4 pb-4">${Object.entries(t).map(([s,i])=>{const d=z(i);return`<div class="grid grid-cols-[200px_1fr] gap-3 items-start py-2 border-b border-[var(--ono-border)]">
26
- <div class="text-[11px] uppercase tracking-wide text-[var(--ono-text-muted)]">${f(s)}</div>
24
+ <span class="text-xs text-[var(--ono-text-muted)]">[${String(u)}]:</span> ${h}
25
+ </div>`}).join(""),g=t.length>10?`<div class="ml-4 text-sm italic text-[var(--ono-text-muted)]">... and ${String(t.length-10)} more items</div>`:"";return`<div class="space-y-1">${d}${g}</div>`}if(typeof t=="object")return oe(t,a);const i=typeof t=="symbol"||typeof t=="bigint"||typeof t=="function"?t.toString():JSON.stringify(t);return`<span class="text-[var(--ono-text)]">${y(i)}</span>`},"renderValue"),_=s(t=>!t||Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty)</div>':`<div class="px-4 pb-4">${Object.entries(t).map(([a,i])=>{const d=z(i);return`<div class="grid grid-cols-[200px_1fr] gap-3 items-start py-2 border-b border-[var(--ono-border)]">
26
+ <div class="text-[11px] uppercase tracking-wide text-[var(--ono-text-muted)]">${y(a)}</div>
27
27
  <div class="text-sm break-words text-[var(--ono-text)]">${d}</div>
28
- </div>`}).join("")}</div>`,"renderObjectTable"),ae=a(t=>t==null?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(no body)</div>':typeof t=="string"?t.trim()===""?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty string)</div>':`<div class="px-4 pb-4">
29
- <div class="text-sm break-words whitespace-pre-wrap font-mono p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${f(t)}</div>
30
- </div>`:typeof t=="object"?Array.isArray(t)?t.length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty array)</div>':`<div class="px-4 pb-4">
28
+ </div>`}).join("")}</div>`,"renderObjectTable"),se=s(t=>{if(t==null)return'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(no body)</div>';if(typeof t=="string")return t.trim()===""?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty string)</div>':`<div class="px-4 pb-4">
29
+ <div class="text-sm break-words whitespace-pre-wrap font-mono p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${y(t)}</div>
30
+ </div>`;if(typeof t=="object")return Array.isArray(t)?t.length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty array)</div>':`<div class="px-4 pb-4">
31
31
  <div class="text-sm break-words p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${z(t)}</div>
32
32
  </div>`:Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty object)</div>':`<div class="px-4 pb-4">
33
33
  <div class="text-sm break-words p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${z(t)}</div>
34
- </div>`:`<div class="px-4 pb-4">
35
- <div class="text-sm break-words whitespace-pre-wrap font-mono p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${f(typeof t=="symbol"?t.toString():String(t))}</div>
36
- </div>`,"renderBodyContent"),K=a(t=>{if(!t)return{content:"",sidebar:""};const s=new Set(["request"]),i=Object.keys(t).filter(u=>!s.has(u));if(i.length===0)return{content:"",sidebar:""};let d="",g="";return i.forEach(u=>{const v=t[u];if(v&&typeof v=="object"&&(Array.isArray(v)||Object.keys(v).length>0)){const $=u.charAt(0).toUpperCase()+u.slice(1),w=`context-${u}`;d+=`
34
+ </div>`;const a=t.toString();return`<div class="px-4 pb-4">
35
+ <div class="text-sm break-words whitespace-pre-wrap font-mono p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${y(a)}</div>
36
+ </div>`},"renderBodyContent"),K=s(t=>{if(!t)return{content:"",sidebar:""};const a=new Set(["request"]),i=Object.keys(t).filter(v=>!a.has(v));if(i.length===0)return{content:"",sidebar:""};let d="",g="";return i.forEach(v=>{const u=t[v];if(u&&typeof u=="object"&&(Array.isArray(u)||Object.keys(u).length>0)){const h=v.charAt(0).toUpperCase()+v.slice(1),$=`context-${v}`;d+=`
37
37
  <div>
38
- <div class="text-[11px] uppercase tracking-wide mb-2 text-[var(--ono-text-muted)]">${$}</div>
38
+ <div class="text-[11px] uppercase tracking-wide mb-2 text-[var(--ono-text-muted)]">${h}</div>
39
39
  <ul class="space-y-1 text-sm">
40
40
  <li>
41
- <a href="#${w}" class="flex items-center gap-2 px-2 py-1 rounded text-[var(--ono-text)] hover:bg-[var(--ono-surface-muted)] ono-scrollspy-active:bg-[var(--ono-surface-muted)] ono-scrollspy-active:font-semibold">
42
- <span class="dui size-3" style="-webkit-mask-image:url('${S}'); mask-image:url('${S}')"></span>
43
- <span>${$}</span>
41
+ <a href="#${$}" class="flex items-center gap-2 px-2 py-1 rounded text-[var(--ono-text)] hover:bg-[var(--ono-surface-muted)] ono-scrollspy-active:bg-[var(--ono-surface-muted)] ono-scrollspy-active:font-semibold">
42
+ <span class="dui size-3" style="-webkit-mask-image:url('${O}'); mask-image:url('${O}')"></span>
43
+ <span>${h}</span>
44
44
  </a>
45
45
  </li>
46
46
  </ul>
47
47
  </div>`,g+=`
48
- <input type="hidden" id="clipboard-${w}-${o}" value="${k(JSON.stringify(v))}">
49
- <section id="${w}" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
48
+ <input type="hidden" id="clipboard-${$}-${o}" value="${k(JSON.stringify(u))}">
49
+ <section id="${$}" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
50
50
  <div class="px-4 py-2 flex items-center gap-2 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
51
- <h3 class="text-sm font-semibold text-[var(--ono-text)]">${$}</h3>
51
+ <h3 class="text-sm font-semibold text-[var(--ono-text)]">${h}</h3>
52
52
  <div class="grow"></div>
53
- <a href="#${w}" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
54
- ${O({label:"Copy JSON",targetId:`clipboard-${w}-${o}`}).html}
53
+ <a href="#${$}" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
54
+ ${S({label:"Copy JSON",targetId:`clipboard-${$}-${o}`}).html}
55
55
  </div>
56
- <div class="max-w-full overflow-auto mt-2">${_(v)}</div>
57
- </section>`}}),{content:g,sidebar:d}},"generateContextSections")(r.context),se=`
56
+ <div class="max-w-full overflow-auto mt-2">${_(u)}</div>
57
+ </section>`}}),{content:g,sidebar:d}},"generateContextSections")(r.context),ae=`
58
58
  <aside class="shrink-0 w-64 sticky top-4 self-start">
59
59
  <nav aria-label="Context sections" class="p-3 rounded-[var(--ono-radius-md)] shadow-[var(--ono-elevation-1)] space-y-4 overflow-auto bg-[var(--ono-surface)] border border-[var(--ono-border)] max-h-[calc(100dvh-2rem)]">
60
60
  <div>
@@ -62,31 +62,31 @@ var ie=Object.defineProperty;var T=(e,r)=>ie(e,"name",{value:r,configurable:!0})
62
62
  <ul class="space-y-1 text-sm">
63
63
  <li>
64
64
  <a href="#context-request" class="flex items-center gap-2 px-2 py-1 rounded text-[var(--ono-text)] hover:bg-[var(--ono-surface-muted)]">
65
- <span class="dui size-3" style="-webkit-mask-image:url('${J}'); mask-image:url('${J}')"></span>
65
+ <span class="dui size-3" style="-webkit-mask-image:url('${I}'); mask-image:url('${I}')"></span>
66
66
  <span>Overview</span>
67
67
  </a>
68
68
  </li>
69
69
  <li>
70
70
  <a href="#context-headers" class="flex items-center gap-2 px-2 py-1 rounded text-[var(--ono-text)] hover:bg-[var(--ono-surface-muted)]">
71
- <span class="dui size-3" style="-webkit-mask-image:url('${S}'); mask-image:url('${S}')"></span>
71
+ <span class="dui size-3" style="-webkit-mask-image:url('${O}'); mask-image:url('${O}')"></span>
72
72
  <span>Headers</span>
73
73
  </a>
74
74
  </li>
75
75
  <li>
76
76
  <a href="#context-body" class="flex items-center gap-2 px-2 py-1 rounded text-[var(--ono-text)] hover:bg-[var(--ono-surface-muted)]">
77
- <span class="dui size-3" style="-webkit-mask-image:url('${q}'); mask-image:url('${q}')"></span>
77
+ <span class="dui size-3" style="-webkit-mask-image:url('${T}'); mask-image:url('${T}')"></span>
78
78
  <span>Body</span>
79
79
  </a>
80
80
  </li>
81
81
  <li>
82
82
  <a href="#context-session" class="flex items-center gap-2 px-2 py-1 rounded text-[var(--ono-text)] hover:bg-[var(--ono-surface-muted)]">
83
- <span class="dui size-3" style="-webkit-mask-image:url('${R}'); mask-image:url('${R}')"></span>
83
+ <span class="dui size-3" style="-webkit-mask-image:url('${V}'); mask-image:url('${V}')"></span>
84
84
  <span>Session</span>
85
85
  </a>
86
86
  </li>
87
87
  <li>
88
88
  <a href="#context-cookies" class="flex items-center gap-2 px-2 py-1 rounded text-[var(--ono-text)] hover:bg-[var(--ono-surface-muted)]">
89
- <span class="dui size-3" style="-webkit-mask-image:url('${I}'); mask-image:url('${I}')"></span>
89
+ <span class="dui size-3" style="-webkit-mask-image:url('${q}'); mask-image:url('${q}')"></span>
90
90
  <span>Cookies</span>
91
91
  </a>
92
92
  </li>
@@ -98,12 +98,12 @@ var ie=Object.defineProperty;var T=(e,r)=>ie(e,"name",{value:r,configurable:!0})
98
98
  <input type="hidden" id="clipboard-curl-${o}" value="${k(F)}">
99
99
  <section id="context-request" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
100
100
  <div class="px-4 py-2 flex items-center gap-3 min-w-0 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
101
- <span class="dui size-4" style="-webkit-mask-image:url('${J}'); mask-image:url('${J}')"></span>
101
+ <span class="dui size-4" style="-webkit-mask-image:url('${I}'); mask-image:url('${I}')"></span>
102
102
  <h2 class="text-sm font-semibold text-[var(--ono-text)]">Request</h2>
103
- <a class="text-sm truncate text-[var(--ono-red-orange)]" href="${ce(A(e,"url")??"#")}">${f(A(e,"url")??"")}</a>
104
- <span class="inline-block text-[10px] px-2 py-0.5 rounded-full bg-[var(--ono-chip-bg)] text-[var(--ono-chip-text)]">${f(A(e,"method")??"GET")}</span>
103
+ <a class="text-sm truncate text-[var(--ono-red-orange)]" href="${ce(A(e,"url")??"#")}">${y(A(e,"url")??"")}</a>
104
+ <span class="inline-block text-[10px] px-2 py-0.5 rounded-full bg-[var(--ono-chip-bg)] text-[var(--ono-chip-text)]">${y(A(e,"method")??"GET")}</span>
105
105
  <div class="grow"></div>
106
- ${O({label:"Copy cURL",targetId:`clipboard-curl-${o}`}).html}
106
+ ${S({label:"Copy cURL",targetId:`clipboard-curl-${o}`}).html}
107
107
  </div>
108
108
  <div class="px-4 pb-4 overflow-auto mt-2">${M}</div>
109
109
  </section>
@@ -111,35 +111,35 @@ var ie=Object.defineProperty;var T=(e,r)=>ie(e,"name",{value:r,configurable:!0})
111
111
  <input type="hidden" id="clipboard-headers-${o}" value="${k(JSON.stringify(l??{}))}">
112
112
  <section id="context-headers" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
113
113
  <div class="px-4 py-2 flex items-center gap-2 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
114
- <span class="dui size-4" style="-webkit-mask-image:url('${S}'); mask-image:url('${S}')"></span>
114
+ <span class="dui size-4" style="-webkit-mask-image:url('${O}'); mask-image:url('${O}')"></span>
115
115
  <h3 class="text-sm font-semibold text-[var(--ono-text)]">Headers</h3>
116
116
  <div class="grow"></div>
117
117
  <a href="#context-headers" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
118
- ${O({label:"Copy JSON",targetId:`clipboard-headers-${o}`}).html}
118
+ ${S({label:"Copy JSON",targetId:`clipboard-headers-${o}`}).html}
119
119
  </div>
120
120
  <div class="max-w-full overflow-auto mt-2">${U(l)}</div>
121
121
  </section>
122
122
 
123
- <input type="hidden" id="clipboard-body-${o}" value="${k(Y(h??{}))}">
123
+ <input type="hidden" id="clipboard-body-${o}" value="${k(Y(f??{}))}">
124
124
  <section id="context-body" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
125
125
  <div class="px-4 py-2 flex items-center gap-2 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
126
- <span class="dui size-4" style="-webkit-mask-image:url('${q}'); mask-image:url('${q}')"></span>
126
+ <span class="dui size-4" style="-webkit-mask-image:url('${T}'); mask-image:url('${T}')"></span>
127
127
  <h3 class="text-sm font-semibold text-[var(--ono-text)]">Body</h3>
128
128
  <div class="grow"></div>
129
129
  <a href="#context-body" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
130
- ${O({label:"Copy JSON",targetId:`clipboard-body-${o}`}).html}
130
+ ${S({label:"Copy JSON",targetId:`clipboard-body-${o}`}).html}
131
131
  </div>
132
- <div class="max-w-full overflow-auto mt-2">${ae(h)}</div>
132
+ <div class="max-w-full overflow-auto mt-2">${se(f)}</div>
133
133
  </section>
134
134
 
135
135
  <input type="hidden" id="clipboard-session-${o}" value="${k(JSON.stringify(e.session??{}))}">
136
136
  <section id="context-session" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
137
137
  <div class="px-4 py-2 flex items-center gap-2 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
138
- <span class="dui size-4" style="-webkit-mask-image:url('${R}'); mask-image:url('${R}')"></span>
138
+ <span class="dui size-4" style="-webkit-mask-image:url('${V}'); mask-image:url('${V}')"></span>
139
139
  <h3 class="text-sm font-semibold text-[var(--ono-text)]">Session</h3>
140
140
  <div class="grow"></div>
141
141
  <a href="#context-session" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
142
- ${O({label:"Copy JSON",targetId:`clipboard-session-${o}`}).html}
142
+ ${S({label:"Copy JSON",targetId:`clipboard-session-${o}`}).html}
143
143
  </div>
144
144
  <div class="max-w-full overflow-auto mt-2">${_(e.session)}</div>
145
145
  </section>
@@ -147,17 +147,17 @@ var ie=Object.defineProperty;var T=(e,r)=>ie(e,"name",{value:r,configurable:!0})
147
147
  <input type="hidden" id="clipboard-cookies-${o}" value="${k(JSON.stringify(E))}">
148
148
  <section id="context-cookies" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
149
149
  <div class="px-4 py-2 flex items-center gap-2 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
150
- <span class="dui size-4" style="-webkit-mask-image:url('${I}'); mask-image:url('${I}')"></span>
150
+ <span class="dui size-4" style="-webkit-mask-image:url('${q}'); mask-image:url('${q}')"></span>
151
151
  <h3 class="text-sm font-semibold text-[var(--ono-text)]">Cookies</h3>
152
152
  <div class="grow"></div>
153
153
  <a href="#context-cookies" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
154
- ${O({label:"Copy JSON",targetId:`clipboard-cookies-${o}`}).html}
154
+ ${S({label:"Copy JSON",targetId:`clipboard-cookies-${o}`}).html}
155
155
  </div>
156
156
  <div class="max-w-full overflow-auto mt-2">${U(E)}
157
157
  </div>
158
158
  </section>${K.content}
159
159
  </div>`;return{code:{html:`
160
160
  <div class="w-full flex gap-4 relative">
161
- ${se}
161
+ ${ae}
162
162
  ${ne}
163
163
  </div>`,script:""},id:"context",name:"Context"}},"createRequestContext");export{Fe as default};
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var Ho=Object.defineProperty;var m=(t,e)=>Ho(t,"name",{value:e,configurable:!0});import{createRequire as Uo}from"node:module";import{parseStacktrace as eo}from"@visulima/error/stacktrace";import{renderError as Vo,getErrorCauses as Ko}from"@visulima/error/error";import{ruleBasedFinder as to,errorHintFinder as oo}from"@visulima/error/solution";import{s as S,a as E,b as Yo,d as Jo,c as er,n as At,e as Dt,f as tr}from"./packem_shared/clipboard-jWc8JBuB.js";import{sanitize as Qe}from"isomorphic-dompurify";import{n as or,g as rr}from"./packem_shared/process-BO_aZsiL.js";import{parseStacktrace as lt,codeFrame as ct}from"@visulima/error";import ro from"@visulima/error/solution/ai/prompt";const Go=Uo(import.meta.url),ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Be=m(t=>{if(typeof ie<"u"&&ie.versions&&ie.versions.node){const[e,o]=ie.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return ie.getBuiltinModule(t)}return Go(t)},"__cjs_getBuiltinModule"),{createRequire:Zo}=Be("node:module"),{readFile:Qo}=Be("node:fs/promises"),{fileURLToPath:Xo}=Be("node:url"),{createHash:nr}=Be("node:crypto");var ar=Object.defineProperty,P=m((t,e)=>ar(t,"name",{value:e,configurable:!0}),"E$2"),ir=Object.defineProperty,$=P((t,e)=>ir(t,"name",{value:e,configurable:!0}),"b");const sr=Zo(import.meta.url),Y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,dt=$(t=>{if(typeof Y<"u"&&Y.versions&&Y.versions.node){const[e,o]=Y.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return Y.getBuiltinModule(t)}return sr(t)},"__cjs_getBuiltinModule"),W=Y,{execFileSync:lr}=dt("node:child_process"),ce=dt("node:fs"),cr=dt("node:tty");var dr=Object.defineProperty,pt=$((t,e)=>dr(t,"name",{value:e,configurable:!0}),"s$3"),pr=Object.defineProperty,Le=pt((t,e)=>pr(t,"name",{value:e,configurable:!0}),"l");const ht=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],ut=[12288,12288,65281,65376,65504,65510],gt=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],mt=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],je=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var hr=Object.defineProperty,ur=Le((t,e)=>hr(t,"name",{value:e,configurable:!0}),"r$1");const ge=ur((t,e)=>{let o=0,r=Math.floor(t.length/2)-1;for(;o<=r;){const n=Math.floor((o+r)/2),a=n*2;if(e<t[a])r=n-1;else if(e>t[a+1])o=n+1;else return!0}return!1},"isInRange");var gr=Object.defineProperty,G=Le((t,e)=>gr(t,"name",{value:e,configurable:!0}),"r");const mr=ht[0],fr=ht.at(-1),wr=ut[0],br=ut.at(-1),vr=gt[0],xr=gt.at(-1),kr=mt[0],yr=mt.at(-1),$r=je[0],Er=je.at(-1),It=19968,[Sr,Cr]=ee(je);function ee(t){let e=t[0],o=t[1];for(let r=0;r<t.length;r+=2){const n=t[r],a=t[r+1];if(It>=n&&It<=a)return[n,a];a-n>o-e&&(e=n,o=a)}return[e,o]}m(ee,"_");P(ee,"G");$(ee,"b$3");pt(ee,"b");Le(ee,"N");G(ee,"findWideFastPathRange");const no=G(t=>t<mr||t>fr?!1:ge(ht,t),"isAmbiguous"),ao=G(t=>t<wr||t>br?!1:ge(ut,t),"isFullWidth"),Tr=G(t=>t<vr||t>xr?!1:ge(gt,t),"isHalfWidth"),Ar=G(t=>t<kr||t>yr?!1:ge(mt,t),"isNarrow"),io=G(t=>t>=Sr&&t<=Cr?!0:t<$r||t>Er?!1:ge(je,t),"isWide");function te(t){return no(t)?"ambiguous":ao(t)?"fullwidth":Tr(t)?"halfwidth":Ar(t)?"narrow":io(t)?"wide":"neutral"}m(te,"D$2");P(te,"U");$(te,"v$4");pt(te,"q");Le(te,"getCategory");G(te,"getCategory");var Dr=Object.defineProperty,Fe=$((t,e)=>Dr(t,"name",{value:e,configurable:!0}),"i$2"),Ir=Object.defineProperty,Me=Fe((t,e)=>Ir(t,"name",{value:e,configurable:!0}),"a"),zr=Object.defineProperty,ft=Me((t,e)=>zr(t,"name",{value:e,configurable:!0}),"e");function Z(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}m(Z,"j$2");P(Z,"M");$(Z,"s$2");Fe(Z,"s");Me(Z,"r");ft(Z,"validate");function V(t){return Z(t),te(t)}m(V,"F$1");P(V,"P");$(V,"r$3");Fe(V,"p");Me(V,"eastAsianWidthType");ft(V,"eastAsianWidthType");function me(t,{ambiguousAsWide:e=!1}={}){return Z(t),ao(t)||io(t)||e&&no(t)?2:1}m(me,"Q");P(me,"de");$(me,"o$2");Fe(me,"W");Me(me,"eastAsianWidth");ft(me,"eastAsianWidth");var Rr=Object.defineProperty,Br=$((t,e)=>Rr(t,"name",{value:e,configurable:!0}),"p$4"),Lr=Object.defineProperty,so=Br((t,e)=>Lr(t,"name",{value:e,configurable:!0}),"e"),jr=Object.defineProperty,Fr=so((t,e)=>jr(t,"name",{value:e,configurable:!0}),"E");const lo=String.raw,zt=lo`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Mr=Fr(()=>new RegExp(lo`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${zt}(?:\u200D${zt})*`,"gu"),"default");var _r=Object.defineProperty,Or=so((t,e)=>_r(t,"name",{value:e,configurable:!0}),"p");const oe=new Set(["\x1B","›"]),_e="\x07",co="[",wt="m",Te="]8;;",Pr=39,Nr=/[\u200B\uFEFF\u2060-\u2064]/g,qr=new RegExp(`(?:\\${co}(?<code>\\d+)m|\\${Te}(?<uri>.*)${_e})`),Wr=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),se=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,ke=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Ee=Mr();Or(t=>t.replace(Ee,""),"stripEmoji");var Hr=Object.defineProperty,Ur=$((t,e)=>Hr(t,"name",{value:e,configurable:!0}),"E$1"),Gr=Object.defineProperty,Zr=Ur((t,e)=>Gr(t,"name",{value:e,configurable:!0}),"A"),Vr=Object.defineProperty,Oe=Zr((t,e)=>Vr(t,"name",{value:e,configurable:!0}),"d");const Rt=new Map,ye=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Se=Oe(t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other","getCharType"),Kr=Oe((t,e)=>{const o=Math.floor(t/65536),r=t%65536;let n=Rt.get(o);if(n||(n=new Map,Rt.set(o,n)),n.has(r))return n.get(r);let a;if(Se(t)==="latin")a=e.width.regular;else if(Se(t)==="control")a=e.width.control;else if(Se(t)==="wide")a=e.width.wide;else switch(V(t)){case"ambiguous":{a=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{a=e.width.fullWidth;break}case"wide":{a=e.width.wide;break}default:a=e.width.regular}return n.set(r,a),a},"getCachedCharWidth"),Qr=Oe(t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,"isCombiningCharacter"),Xe=Oe((t,e={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const o={truncation:{countAnsiEscapeCodes:e.countAnsiEscapeCodes??!1,ellipsis:e.ellipsis??"",ellipsisWidth:e.ellipsisWidth??(e.ellipsis?Xe(e.ellipsis,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:e.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:e.ambiguousIsNarrow??!1,ansi:e.ansiWidth??0,control:e.controlWidth??0,emoji:e.emojiWidth??2,fullWidth:e.fullWidth??2,halfWidth:e.halfWidth??1,regular:e.regularWidth??1,tab:e.tabWidth??8,wide:e.wideWidth??2}},r=Math.max(0,o.truncation.limit-o.truncation.ellipsisWidth),{length:n}=t,a=n>1e4;let i=0,s=0,c=n,l=!1;const d=t.includes("\x1B")||t.includes("›");for(;i<n;){if(d&&(t[i]==="\x1B"||t[i]==="›")){if(t.startsWith("\x1B]8;;",i)){const w="\x1B]8;;\x07",y=w.length,D=t.indexOf("\x07",i+5);if(D!==-1){const L=t.indexOf(w,D+1);if(L!==-1){const ne=L+y,M=t.slice(D+1,L).replace(se,""),z=Xe(M,{ambiguousIsNarrow:o.width.ambiguousIsNarrow,ansiWidth:o.width.ansi,controlWidth:o.width.control,countAnsiEscapeCodes:!1,ellipsis:o.truncation.ellipsis,ellipsisWidth:o.truncation.ellipsisWidth,emojiWidth:o.width.emoji,fullWidth:o.width.fullWidth,halfWidth:o.width.halfWidth,limit:Math.max(0,r-s),regularWidth:o.width.regular,tabWidth:o.width.tab,wideWidth:o.width.wide}),ae=z.width;if(z.truncated)l=!0,c=Math.min(c,i);else if(s+ae>r&&(c=Math.min(c,i),l=!0,s+ae>o.truncation.limit))break;if(s+=ae,i=ne,l&&s>=o.truncation.limit)break;continue}}}if(se.lastIndex=i,se.test(t)){const w=se.lastIndex-i,y=o.truncation.countAnsiEscapeCodes?w:o.width.ansi;if(s+y>r&&(c=Math.min(c,i),s+y>o.truncation.limit)){l=!0;break}s+=y,i=se.lastIndex;continue}}const u=t.codePointAt(i);if(u===8203||u===65279||u>=8288&&u<=8292){i+=1;continue}if(u===9){if(s+o.width.tab>r&&(c=Math.min(c,i),s+o.width.tab>o.truncation.limit)){l=!0;break}s+=o.width.tab,i+=1;continue}if(ye.lastIndex=i,ye.test(t)){const w=(ye.lastIndex-i)*o.width.regular;if(s+w>r){const y=Math.floor((r-s)/o.width.regular);if(c=Math.min(c,i+y),s+w>o.truncation.limit){l=!0;break}}s+=w,i=ye.lastIndex;continue}if((u<=31||u>=127&&u<=159)&&(ke.lastIndex=i,ke.test(t))){const w=(ke.lastIndex-i)*o.width.control;if(s+w>r&&(c=Math.min(c,i+Math.floor((r-s)/o.width.control)),s+w>o.truncation.limit)){l=!0;break}s+=w,i=ke.lastIndex;continue}if(Ee.lastIndex=i,Ee.test(t)){if(s+o.width.emoji>r&&(c=Math.min(c,i),s+o.width.emoji>o.truncation.limit)){l=!0;break}s+=o.width.emoji,i=Ee.lastIndex;continue}const f=t.codePointAt(i)??0;if(Qr(f)){i+=f>65535?2:1;continue}let g;if(a)g=Kr(f,o);else switch(Se(f)){case"control":{g=o.width.control;break}case"latin":{g=o.width.regular;break}case"wide":{g=o.width.wide;break}case"zero":{g=0;break}default:switch(V(f)){case"ambiguous":{g=o.width.ambiguousIsNarrow?o.width.regular:o.width.wide;break}case"fullwidth":{g=o.width.fullWidth;break}case"wide":{g=o.width.wide;break}default:g=o.width.regular}}if(s+g>r&&(c=Math.min(c,i),s+g>o.truncation.limit)){l=!0;break}s+=g,i+=f>65535?2:1}let p=s,h=!1;return l&&o.truncation.limit>=o.truncation.ellipsisWidth&&(p=o.truncation.limit,h=!0),{ellipsed:h,index:l?c:n,truncated:l,width:p}},"getStringTruncatedWidth");var Xr=Object.defineProperty,Yr=$((t,e)=>Xr(t,"name",{value:e,configurable:!0}),"i"),Jr=Object.defineProperty,en=Yr((t,e)=>Jr(t,"name",{value:e,configurable:!0}),"e"),tn=Object.defineProperty,on=en((t,e)=>tn(t,"name",{value:e,configurable:!0}),"r");const x=on((t,e={})=>Xe(t,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var rn=Object.defineProperty,nn=$((t,e)=>rn(t,"name",{value:e,configurable:!0}),"p$2"),an=Object.defineProperty,sn=nn((t,e)=>an(t,"name",{value:e,configurable:!0}),"h"),ln=Object.defineProperty,bt=sn((t,e)=>ln(t,"name",{value:e,configurable:!0}),"n");const cn=bt((t,e)=>Math.floor((t-e)/2),"halfDiff"),dn=bt((t,e)=>t-e,"fullDiff"),Bt=bt((t,e={})=>{const o=e.align??"center";if(o==="left")return t;const r=e.split??`
1
+ var Ho=Object.defineProperty;var m=(t,e)=>Ho(t,"name",{value:e,configurable:!0});import{createRequire as Uo}from"node:module";import{parseStacktrace as eo}from"@visulima/error/stacktrace";import{renderError as Vo,getErrorCauses as Ko}from"@visulima/error/error";import{ruleBasedFinder as to,errorHintFinder as oo}from"@visulima/error/solution";import{s as S,a as E,b as Yo,d as Jo,c as er,n as At,e as Dt,f as tr}from"./packem_shared/clipboard-DbMCKslu.js";import{sanitize as Qe}from"isomorphic-dompurify";import{n as or,g as rr}from"./packem_shared/process-BO_aZsiL.js";import{parseStacktrace as lt,codeFrame as ct}from"@visulima/error";import ro from"@visulima/error/solution/ai/prompt";const Go=Uo(import.meta.url),ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Be=m(t=>{if(typeof ie<"u"&&ie.versions&&ie.versions.node){const[e,o]=ie.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return ie.getBuiltinModule(t)}return Go(t)},"__cjs_getBuiltinModule"),{createRequire:Zo}=Be("node:module"),{readFile:Qo}=Be("node:fs/promises"),{fileURLToPath:Xo}=Be("node:url"),{createHash:nr}=Be("node:crypto");var ar=Object.defineProperty,P=m((t,e)=>ar(t,"name",{value:e,configurable:!0}),"E$2"),ir=Object.defineProperty,$=P((t,e)=>ir(t,"name",{value:e,configurable:!0}),"b");const sr=Zo(import.meta.url),Y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,dt=$(t=>{if(typeof Y<"u"&&Y.versions&&Y.versions.node){const[e,o]=Y.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return Y.getBuiltinModule(t)}return sr(t)},"__cjs_getBuiltinModule"),W=Y,{execFileSync:lr}=dt("node:child_process"),ce=dt("node:fs"),cr=dt("node:tty");var dr=Object.defineProperty,pt=$((t,e)=>dr(t,"name",{value:e,configurable:!0}),"s$3"),pr=Object.defineProperty,Le=pt((t,e)=>pr(t,"name",{value:e,configurable:!0}),"l");const ht=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],ut=[12288,12288,65281,65376,65504,65510],gt=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],mt=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],je=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var hr=Object.defineProperty,ur=Le((t,e)=>hr(t,"name",{value:e,configurable:!0}),"r$1");const ge=ur((t,e)=>{let o=0,r=Math.floor(t.length/2)-1;for(;o<=r;){const n=Math.floor((o+r)/2),a=n*2;if(e<t[a])r=n-1;else if(e>t[a+1])o=n+1;else return!0}return!1},"isInRange");var gr=Object.defineProperty,G=Le((t,e)=>gr(t,"name",{value:e,configurable:!0}),"r");const mr=ht[0],fr=ht.at(-1),wr=ut[0],br=ut.at(-1),vr=gt[0],xr=gt.at(-1),kr=mt[0],yr=mt.at(-1),$r=je[0],Er=je.at(-1),It=19968,[Sr,Cr]=ee(je);function ee(t){let e=t[0],o=t[1];for(let r=0;r<t.length;r+=2){const n=t[r],a=t[r+1];if(It>=n&&It<=a)return[n,a];a-n>o-e&&(e=n,o=a)}return[e,o]}m(ee,"_");P(ee,"G");$(ee,"b$3");pt(ee,"b");Le(ee,"N");G(ee,"findWideFastPathRange");const no=G(t=>t<mr||t>fr?!1:ge(ht,t),"isAmbiguous"),ao=G(t=>t<wr||t>br?!1:ge(ut,t),"isFullWidth"),Tr=G(t=>t<vr||t>xr?!1:ge(gt,t),"isHalfWidth"),Ar=G(t=>t<kr||t>yr?!1:ge(mt,t),"isNarrow"),io=G(t=>t>=Sr&&t<=Cr?!0:t<$r||t>Er?!1:ge(je,t),"isWide");function te(t){return no(t)?"ambiguous":ao(t)?"fullwidth":Tr(t)?"halfwidth":Ar(t)?"narrow":io(t)?"wide":"neutral"}m(te,"D$2");P(te,"U");$(te,"v$4");pt(te,"q");Le(te,"getCategory");G(te,"getCategory");var Dr=Object.defineProperty,Fe=$((t,e)=>Dr(t,"name",{value:e,configurable:!0}),"i$2"),Ir=Object.defineProperty,Me=Fe((t,e)=>Ir(t,"name",{value:e,configurable:!0}),"a"),zr=Object.defineProperty,ft=Me((t,e)=>zr(t,"name",{value:e,configurable:!0}),"e");function Z(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}m(Z,"j$2");P(Z,"M");$(Z,"s$2");Fe(Z,"s");Me(Z,"r");ft(Z,"validate");function V(t){return Z(t),te(t)}m(V,"F$1");P(V,"P");$(V,"r$3");Fe(V,"p");Me(V,"eastAsianWidthType");ft(V,"eastAsianWidthType");function me(t,{ambiguousAsWide:e=!1}={}){return Z(t),ao(t)||io(t)||e&&no(t)?2:1}m(me,"Q");P(me,"de");$(me,"o$2");Fe(me,"W");Me(me,"eastAsianWidth");ft(me,"eastAsianWidth");var Rr=Object.defineProperty,Br=$((t,e)=>Rr(t,"name",{value:e,configurable:!0}),"p$4"),Lr=Object.defineProperty,so=Br((t,e)=>Lr(t,"name",{value:e,configurable:!0}),"e"),jr=Object.defineProperty,Fr=so((t,e)=>jr(t,"name",{value:e,configurable:!0}),"E");const lo=String.raw,zt=lo`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Mr=Fr(()=>new RegExp(lo`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${zt}(?:\u200D${zt})*`,"gu"),"default");var _r=Object.defineProperty,Or=so((t,e)=>_r(t,"name",{value:e,configurable:!0}),"p");const oe=new Set(["\x1B","›"]),_e="\x07",co="[",wt="m",Te="]8;;",Pr=39,Nr=/[\u200B\uFEFF\u2060-\u2064]/g,qr=new RegExp(`(?:\\${co}(?<code>\\d+)m|\\${Te}(?<uri>.*)${_e})`),Wr=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),se=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,ke=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Ee=Mr();Or(t=>t.replace(Ee,""),"stripEmoji");var Hr=Object.defineProperty,Ur=$((t,e)=>Hr(t,"name",{value:e,configurable:!0}),"E$1"),Gr=Object.defineProperty,Zr=Ur((t,e)=>Gr(t,"name",{value:e,configurable:!0}),"A"),Vr=Object.defineProperty,Oe=Zr((t,e)=>Vr(t,"name",{value:e,configurable:!0}),"d");const Rt=new Map,ye=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Se=Oe(t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other","getCharType"),Kr=Oe((t,e)=>{const o=Math.floor(t/65536),r=t%65536;let n=Rt.get(o);if(n||(n=new Map,Rt.set(o,n)),n.has(r))return n.get(r);let a;if(Se(t)==="latin")a=e.width.regular;else if(Se(t)==="control")a=e.width.control;else if(Se(t)==="wide")a=e.width.wide;else switch(V(t)){case"ambiguous":{a=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{a=e.width.fullWidth;break}case"wide":{a=e.width.wide;break}default:a=e.width.regular}return n.set(r,a),a},"getCachedCharWidth"),Qr=Oe(t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,"isCombiningCharacter"),Xe=Oe((t,e={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const o={truncation:{countAnsiEscapeCodes:e.countAnsiEscapeCodes??!1,ellipsis:e.ellipsis??"",ellipsisWidth:e.ellipsisWidth??(e.ellipsis?Xe(e.ellipsis,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:e.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:e.ambiguousIsNarrow??!1,ansi:e.ansiWidth??0,control:e.controlWidth??0,emoji:e.emojiWidth??2,fullWidth:e.fullWidth??2,halfWidth:e.halfWidth??1,regular:e.regularWidth??1,tab:e.tabWidth??8,wide:e.wideWidth??2}},r=Math.max(0,o.truncation.limit-o.truncation.ellipsisWidth),{length:n}=t,a=n>1e4;let i=0,s=0,c=n,l=!1;const d=t.includes("\x1B")||t.includes("›");for(;i<n;){if(d&&(t[i]==="\x1B"||t[i]==="›")){if(t.startsWith("\x1B]8;;",i)){const w="\x1B]8;;\x07",y=w.length,D=t.indexOf("\x07",i+5);if(D!==-1){const L=t.indexOf(w,D+1);if(L!==-1){const ne=L+y,M=t.slice(D+1,L).replace(se,""),z=Xe(M,{ambiguousIsNarrow:o.width.ambiguousIsNarrow,ansiWidth:o.width.ansi,controlWidth:o.width.control,countAnsiEscapeCodes:!1,ellipsis:o.truncation.ellipsis,ellipsisWidth:o.truncation.ellipsisWidth,emojiWidth:o.width.emoji,fullWidth:o.width.fullWidth,halfWidth:o.width.halfWidth,limit:Math.max(0,r-s),regularWidth:o.width.regular,tabWidth:o.width.tab,wideWidth:o.width.wide}),ae=z.width;if(z.truncated)l=!0,c=Math.min(c,i);else if(s+ae>r&&(c=Math.min(c,i),l=!0,s+ae>o.truncation.limit))break;if(s+=ae,i=ne,l&&s>=o.truncation.limit)break;continue}}}if(se.lastIndex=i,se.test(t)){const w=se.lastIndex-i,y=o.truncation.countAnsiEscapeCodes?w:o.width.ansi;if(s+y>r&&(c=Math.min(c,i),s+y>o.truncation.limit)){l=!0;break}s+=y,i=se.lastIndex;continue}}const u=t.codePointAt(i);if(u===8203||u===65279||u>=8288&&u<=8292){i+=1;continue}if(u===9){if(s+o.width.tab>r&&(c=Math.min(c,i),s+o.width.tab>o.truncation.limit)){l=!0;break}s+=o.width.tab,i+=1;continue}if(ye.lastIndex=i,ye.test(t)){const w=(ye.lastIndex-i)*o.width.regular;if(s+w>r){const y=Math.floor((r-s)/o.width.regular);if(c=Math.min(c,i+y),s+w>o.truncation.limit){l=!0;break}}s+=w,i=ye.lastIndex;continue}if((u<=31||u>=127&&u<=159)&&(ke.lastIndex=i,ke.test(t))){const w=(ke.lastIndex-i)*o.width.control;if(s+w>r&&(c=Math.min(c,i+Math.floor((r-s)/o.width.control)),s+w>o.truncation.limit)){l=!0;break}s+=w,i=ke.lastIndex;continue}if(Ee.lastIndex=i,Ee.test(t)){if(s+o.width.emoji>r&&(c=Math.min(c,i),s+o.width.emoji>o.truncation.limit)){l=!0;break}s+=o.width.emoji,i=Ee.lastIndex;continue}const f=t.codePointAt(i)??0;if(Qr(f)){i+=f>65535?2:1;continue}let g;if(a)g=Kr(f,o);else switch(Se(f)){case"control":{g=o.width.control;break}case"latin":{g=o.width.regular;break}case"wide":{g=o.width.wide;break}case"zero":{g=0;break}default:switch(V(f)){case"ambiguous":{g=o.width.ambiguousIsNarrow?o.width.regular:o.width.wide;break}case"fullwidth":{g=o.width.fullWidth;break}case"wide":{g=o.width.wide;break}default:g=o.width.regular}}if(s+g>r&&(c=Math.min(c,i),s+g>o.truncation.limit)){l=!0;break}s+=g,i+=f>65535?2:1}let p=s,h=!1;return l&&o.truncation.limit>=o.truncation.ellipsisWidth&&(p=o.truncation.limit,h=!0),{ellipsed:h,index:l?c:n,truncated:l,width:p}},"getStringTruncatedWidth");var Xr=Object.defineProperty,Yr=$((t,e)=>Xr(t,"name",{value:e,configurable:!0}),"i"),Jr=Object.defineProperty,en=Yr((t,e)=>Jr(t,"name",{value:e,configurable:!0}),"e"),tn=Object.defineProperty,on=en((t,e)=>tn(t,"name",{value:e,configurable:!0}),"r");const x=on((t,e={})=>Xe(t,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var rn=Object.defineProperty,nn=$((t,e)=>rn(t,"name",{value:e,configurable:!0}),"p$2"),an=Object.defineProperty,sn=nn((t,e)=>an(t,"name",{value:e,configurable:!0}),"h"),ln=Object.defineProperty,bt=sn((t,e)=>ln(t,"name",{value:e,configurable:!0}),"n");const cn=bt((t,e)=>Math.floor((t-e)/2),"halfDiff"),dn=bt((t,e)=>t-e,"fullDiff"),Bt=bt((t,e={})=>{const o=e.align??"center";if(o==="left")return t;const r=e.split??`
2
2
  `,n=e.pad??" ",a=o==="right"?dn:cn;let i=!1,s;Array.isArray(t)?s=t:(i=!0,s=t.split(r));let c,l=0;const d=s.map(p=>(c=x(p,e.stringWidthOptions),l=Math.max(c,l),{str:p,width:c})).map(p=>Array.from({length:a(l,p.width)+1}).join(n)+p.str);return i?d.join(r):d},"alignText");var pn=Object.defineProperty,po=$((t,e)=>pn(t,"name",{value:e,configurable:!0}),"b"),hn=Object.defineProperty,K=po((t,e)=>hn(t,"name",{value:e,configurable:!0}),"d"),un=Object.defineProperty,gn=K((t,e)=>un(t,"name",{value:e,configurable:!0}),"a");const mn=/\x1B\[(\d+)m/;class ho{static{m(this,"Mt")}static{P(this,"Fe")}static{$(this,"T")}static{po(this,"T")}static{K(this,"d")}static{gn(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(e){const o=mn.exec(e);if(!o)return;const r=Number.parseInt(o[1],10);switch(r){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(r>=30&&r<=37||r>=90&&r<=97)this.activeForeground=e;else if(r>=40&&r<=47||r>=100&&r<=107)this.activeBackground=e;else if([1,2,3,4,7,8,9].includes(r))this.activeFormatting.push(e);else if([22,23,24,27,28,29].includes(r)){const n={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[r];n&&(this.activeFormatting=this.activeFormatting.filter(a=>!a.includes(n)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const e=[];if(this.activeFormatting.length>0){const o={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(r=>{const n=o[r];n&&e.push(n)})}return this.activeForeground&&e.push("\x1B[39m"),this.activeBackground&&e.push("\x1B[49m"),e.join("")}}var fn=Object.defineProperty,uo=K((t,e)=>fn(t,"name",{value:e,configurable:!0}),"o");const go=uo((t,e)=>{if(!oe.has(t[e]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const o=!0,r=t.slice(e+1,e+1+Te.length).join("")===Te;return{isInsideEscape:o,isInsideLinkEscape:r}},"checkEscapeSequence"),wn=uo((t,e={})=>{const o=new ho;let r="",n=!1,a="",i="",s=!1;const c=[...t];for(let l=0;l<c.length;l++){const d=c[l];if(d&&oe.has(d)){if(r){const g=e.getWidth?.(r)??0,w={isEscapeSequence:!1,isGrapheme:!0,text:r,width:g};if(s&&(w.isHyperlink=!0,w.hyperlinkUrl=i),e.onSegment?.(w,o)===!1)return;r=""}n=!0,a=d;const u=go(c,l),{isInsideLinkEscape:f}=u;if(f){let g=l+1;for(i="";g<c.length;){const y=c[g];if(y===_e)break;i+=y,g+=1}i=i.slice(4);const w={hyperlinkUrl:i,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(e.onSegment?.(w,o)===!1)return;l=g,s=!0,n=!1,a="";continue}if(l+1<c.length&&c[l+1]==="\\"&&s){const g={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(e.onSegment?.(g,o)===!1)return;s=!1,i="",l+=1,n=!1,a="";continue}}if(n){if(a!==d&&(a+=d),d===wt){n=!1,o.processEscape(a);const u={isEscapeSequence:!0,isGrapheme:!1,text:a,width:0};if(e.onSegment?.(u,o)===!1)return;a=""}continue}r+=d;const p=e.getWidth?.(r)??0,h={isEscapeSequence:!1,isGrapheme:!0,text:r,width:p};if(s&&(h.isHyperlink=!0,h.hyperlinkUrl=i),e.onSegment?.(h,o)===!1)return;r=""}if(r){const l=e.getWidth?.(r)??0,d={isEscapeSequence:!1,isGrapheme:!0,text:r,width:l};s&&(d.isHyperlink=!0,d.hyperlinkUrl=i),e.onSegment?.(d,o)}if(a){const l={isEscapeSequence:!0,isGrapheme:!1,text:a,width:0};e.onSegment?.(l,o)}},"processAnsiString");var bn=Object.defineProperty,vn=K((t,e)=>bn(t,"name",{value:e,configurable:!0}),"t$1");const Lt=vn(t=>`${oe.values().next().value}${co}${String(t)}${wt}`,"wrapAnsiCode");var xn=Object.defineProperty,kn=K((t,e)=>xn(t,"name",{value:e,configurable:!0}),"s");const jt=kn(t=>`${oe.values().next().value}${Te}${t}${_e}`,"wrapAnsiHyperlink");var yn=Object.defineProperty,$n=K((t,e)=>yn(t,"name",{value:e,configurable:!0}),"l");const En=$n(t=>{if(t.length===0)return"";if(t.length===1)return t[0];let e="",o,r;const n=t.join(`
3
3
  `),a=[...n];let i=0;for(const[s,c]of a.entries()){if(e+=c,oe.has(c)){const d=qr.exec(n.slice(i))?.groups??{};if(d.code!==void 0){const p=Number.parseFloat(d.code);o=p===Pr?void 0:p}else d.uri!==void 0&&(r=d.uri.length===0?void 0:d.uri)}const l=Wr.get(Number(o));a[s+1]===`
4
4
  `?(r&&(e+=jt("")),o&&l&&(e+=Lt(l))):c===`
@@ -0,0 +1 @@
1
+ var v=Object.defineProperty;var l=(t,e)=>v(t,"name",{value:e,configurable:!0});import{sanitize as u}from"isomorphic-dompurify";var y=Object.defineProperty,n=l((t,e)=>y(t,"name",{value:e,configurable:!0}),"r$1");const w=["http://","https://","/","./","../"],g="#",D={'"':"&quot;","&":"&amp;","'":"&#39;","<":"&lt;",">":"&gt;"},x=/^[\w+/-]+={0,2}$/,a=n(t=>{if(t==null)return"";if(typeof t=="string")return t.trim();if(typeof t=="object"||Array.isArray(t))try{return JSON.stringify(t).trim()}catch{return""}return String(t).trim()},"toString"),d=n(t=>t.replaceAll(/[&<>"']/g,e=>D[e]),"escapeHtml"),C=n(t=>{try{return u(a(t))}catch{return d(a(t))}},"sanitizeHtml"),H=n(t=>{const e=a(t);if(!e)return"";try{return u(e).replaceAll('"',"&quot;").replaceAll("'","&#39;")}catch{return d(e)}},"sanitizeAttribute"),A=n(t=>{const e=a(t);if(!e)return g;try{const i=u(e),s=i.toLowerCase();return w.some(o=>s.startsWith(o))?i:g}catch{return g}},"sanitizeUrlAttribute"),$=n(t=>{const e=a(t);if(!e)return"";try{return u(e,{ADD_ATTR:["class","style"]})}catch{return C(e)}},"sanitizeCodeHtml"),b=n(t=>{const e=a(t);if(e)return x.test(e)?e:void 0},"sanitizeCspNonce"),N=n((t={})=>{try{return{...t,cspNonce:b(t.cspNonce),openInEditorUrl:t.openInEditorUrl?A(t.openInEditorUrl):void 0}}catch{return{...t,cspNonce:void 0,openInEditorUrl:void 0}}},"sanitizeOptions");var j=Object.defineProperty,r=l((t,e)=>j(t,"name",{value:e,configurable:!0}),"t");const h={javascript:r(()=>import("@shikijs/langs/javascript"),"javascript"),typescript:r(()=>import("@shikijs/langs/typescript"),"typescript"),jsx:r(()=>import("@shikijs/langs/jsx"),"jsx"),tsx:r(()=>import("@shikijs/langs/tsx"),"tsx"),json:r(()=>import("@shikijs/langs/json"),"json"),jsonc:r(()=>import("@shikijs/langs/jsonc"),"jsonc"),xml:r(()=>import("@shikijs/langs/xml"),"xml"),sql:r(()=>import("@shikijs/langs/sql"),"sql"),markdown:r(()=>import("@shikijs/langs/markdown"),"markdown"),mdx:r(()=>import("@shikijs/langs/mdx"),"mdx"),html:r(()=>import("@shikijs/langs/html"),"html"),css:r(()=>import("@shikijs/langs/css"),"css"),scss:r(()=>import("@shikijs/langs/scss"),"scss"),less:r(()=>import("@shikijs/langs/less"),"less"),sass:r(()=>import("@shikijs/langs/sass"),"sass"),stylus:r(()=>import("@shikijs/langs/stylus"),"stylus"),styl:r(()=>import("@shikijs/langs/styl"),"styl"),svelte:r(()=>import("@shikijs/langs/svelte"),"svelte"),vue:r(()=>import("@shikijs/langs/vue"),"vue"),bash:r(()=>import("@shikijs/langs/bash"),"bash"),shell:r(()=>import("@shikijs/langs/shell"),"shell"),text:r(()=>Promise.resolve({name:"text",patterns:[],scopeName:"source.text",repository:{}}),"text")};r(async t=>{if(typeof t!="string"||!t)return;const e=h[t.toLowerCase()];if(e)return await e()},"getLanguageImport");var F=Object.defineProperty,c=l((t,e)=>F(t,"name",{value:e,configurable:!0}),"a$1");let p,m;const L=c(async()=>{const[t,e]=await Promise.all([import("shiki/core"),import("shiki/engine/javascript")]),{createHighlighterCore:i}=t,{createJavaScriptRegexEngine:s}=e,o=await i({themes:[import("../packem_chunks/min-dark.js"),import("../packem_chunks/min-light.js")],langs:[],engine:s()}),f=o;return m=c(()=>{try{o?.dispose?.()}catch{}p=void 0},"disposeFn"),f},"createSingletonHighlighter"),z=c(async(t,e)=>{if(e==="text")return;const i=e.toLowerCase();if(!(t.getLoadedLanguages?.()??t.getLanguages?.()??[]).includes(i)){const s=h[i];s&&await t.loadLanguage?.(await s())}},"ensureLanguageLoaded"),O=c(async(t=[])=>{p||(p=L());const e=await p,i=[];for(const s of t)if(typeof s=="string")i.push(s.toLowerCase());else{const o=s.name;o&&i.push(o.toLowerCase())}return await Promise.all(i.map(s=>z(e,s))),e},"getHighlighter");c(async()=>{try{m&&(m(),m=void 0)}catch{}},"disposeHighlighter");c((t=[])=>({name:"@shikijs/transformers:compact-line-options",line(e,i){const s=t.find(o=>o.line===i);return s?.classes&&this.addClassToHast(e,s.classes),e}}),"transformerCompactLineOptions");const P="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-check%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M20%206%209%2017l-5-5%22%20%2F%3E%20%3C%2Fsvg%3E",U="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-clipboard%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Crect%20width%3D%228%22%20height%3D%224%22%20x%3D%228%22%20y%3D%222%22%20rx%3D%221%22%20ry%3D%221%22%20%2F%3E%20%3Cpath%20d%3D%22M16%204h2a2%202%200%200%201%202%202v14a2%202%200%200%201-2%202H6a2%202%200%200%201-2-2V6a2%202%200%200%201%202-2h2%22%20%2F%3E%20%3C%2Fsvg%3E";export{H as a,b,A as c,O as d,P as e,N as f,$ as g,U as n,C as s};
@@ -1 +1 @@
1
- var Yt=Object.defineProperty;var T=(s,a)=>Yt(s,"name",{value:a,configurable:!0});import{createRequire as en}from"node:module";import rn from"launch-editor-middleware";import{a as be}from"../packem_shared/process-BO_aZsiL.js";const tn=en(import.meta.url),H=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,nn=T(s=>{if(typeof H<"u"&&H.versions&&H.versions.node){const[a,i]=H.versions.node.split(".").map(Number);if(a>22||a===22&&i>=3||a===20&&i>=16)return H.getBuiltinModule(s)}return tn(s)},"__cjs_getBuiltinModule"),{realpathSync:we}=nn("node:fs");var on=Object.defineProperty,sn=T((s,a)=>on(s,"name",{value:a,configurable:!0}),"$e"),an=Object.defineProperty,te=sn((s,a)=>an(s,"name",{value:a,configurable:!0}),"W"),ln=Object.defineProperty,c=te((s,a)=>ln(s,"name",{value:a,configurable:!0}),"u$1");let ve=c(()=>{var s=(()=>{var a=Object.defineProperty,i=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,d=Object.prototype.hasOwnProperty,g=c((e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},"ne"),x=c((e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of u(t))!d.call(e,r)&&r!==n&&a(e,r,{get:c(()=>t[r],"get"),enumerable:!(o=i(t,r))||o.enumerable});return e},"ae"),m=c(e=>x(a({},"__esModule",{value:!0}),e),"oe"),b={};g(b,{zeptomatch:c(()=>ye,"zeptomatch")});var v=c(e=>{const t=new Set,n=[e];for(let o=0;o<n.length;o++){const r=n[o];if(t.has(r))continue;t.add(r);const{children:l}=r;if(l?.length)for(let f=0,h=l.length;f<h;f++)n.push(l[f])}return Array.from(t)},"M"),O=c(e=>{let t="";const n=v(e);for(let o=0,r=n.length;o<r;o++){const l=n[o];if(!l.regex)continue;const f=l.regex.flags;if(t||(t=f),t!==f)throw new Error(`Inconsistent RegExp flags used: "${t}" and "${f}"`)}return t},"se"),_=c((e,t,n)=>{const o=n.get(e);if(o!==void 0)return o;const r=e.partial??t;let l="";if(e.regex&&(l+=r?"(?:$|":"",l+=e.regex.source),e.children?.length){const f=J(e.children.map(h=>_(h,t,n)).filter(Boolean));if(f?.length){const h=e.children.some(L=>!L.regex||!(L.partial??t)),y=f.length>1||r&&(!l.length||h);l+=y?r?"(?:$|":"(?:":"",l+=f.join("|"),l+=y?")":""}}return e.regex&&(l+=r?")":""),n.set(e,l),l},"O"),D=c((e,t)=>{const n=new Map,o=v(e);for(let r=o.length-1;r>=0;r--){const l=_(o[r],t,n);if(!(r>0))return l}return""},"ie"),J=c(e=>Array.from(new Set(e)),"ue"),I=c((e,t,n)=>I.compile(e,n).test(t),"R");I.compile=(e,t)=>{const n=t?.partial??!1,o=D(e,n),r=O(e);return new RegExp(`^(?:${o})$`,r)};var Ae=I,Ee=c((e,t)=>{const n=Ae.compile(e,t),o=`${n.source.slice(0,-1)}[\\\\/]?$`,r=n.flags;return new RegExp(o,r)},"le"),Re=Ee,ke=c(e=>{const t=e.map(o=>o.source).join("|")||"$^",n=e[0]?.flags;return new RegExp(t,n)},"ve"),Se=ke,ne=c(e=>Array.isArray(e),"j"),q=c(e=>typeof e=="function","_"),Ie=c(e=>e.length===0,"he"),Be=(()=>{const{toString:e}=Function.prototype,t=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return n=>(n.length===0||n.length===1)&&t.test(e.call(n))})(),We=c(e=>typeof e=="number","de"),Ce=c(e=>typeof e=="object"&&e!==null,"xe"),qe=c(e=>e instanceof RegExp,"me"),Ne=(()=>{const e=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return t=>e.test(t.source)})(),Le=(()=>{const e=/^[a-zA-Z0-9_-]+$/;return t=>e.test(t.source)&&!t.flags.includes("i")})(),re=c(e=>typeof e=="string","A"),z=c(e=>e===void 0,"f"),Ze=c(e=>{const t=new Map;return n=>{const o=t.get(n);if(o!==void 0)return o;const r=e(n);return t.set(n,r),r}},"ye"),oe=c((e,t,n={})=>{const o={cache:{},input:e,index:0,indexBacktrackMax:0,options:n,output:[]},r=A(t)(o),l=Math.max(o.index,o.indexBacktrackMax);if(r&&o.index===e.length)return o.output;throw new Error(`Failed to parse at index ${l}`)},"I"),p=c((e,t)=>ne(e)?He(e,t):re(e)?se(e,t):Fe(e,t),"i"),He=c((e,t)=>{const n={};for(const o of e){if(o.length!==1)throw new Error(`Invalid character: "${o}"`);const r=o.charCodeAt(0);n[r]=!0}return o=>{const r=o.input;let l=o.index,f=l;for(;f<r.length&&r.charCodeAt(f)in n;)f+=1;if(f>l){if(!z(t)&&!o.options.silent){const h=r.slice(l,f),y=q(t)?t(h,r,`${l}`):t;z(y)||o.output.push(y)}o.index=f}return!0}},"we"),Fe=c((e,t)=>{if(Le(e))return se(e.source,t);{const n=e.source,o=e.flags.replace(/y|$/,"y"),r=new RegExp(n,o);return Ne(e)&&q(t)&&!Be(t)?Te(r,t):Ue(r,t)}},"$e"),Te=c((e,t)=>n=>{const o=n.index,r=n.input;e.lastIndex=o;const l=e.exec(r);if(l){const f=e.lastIndex;if(!n.options.silent){const h=t(...l,r,`${o}`);z(h)||n.output.push(h)}return n.index=f,!0}else return!1},"Ee"),Ue=c((e,t)=>n=>{const o=n.index,r=n.input;if(e.lastIndex=o,e.test(r)){const l=e.lastIndex;if(!z(t)&&!n.options.silent){const f=q(t)?t(r.slice(o,l),r,`${o}`):t;z(f)||n.output.push(f)}return n.index=l,!0}else return!1},"Ce"),se=c((e,t)=>n=>{const o=n.index,r=n.input;if(r.startsWith(e,o)){if(!z(t)&&!n.options.silent){const l=q(t)?t(e,r,`${o}`):t;z(l)||n.output.push(l)}return n.index+=e.length,!0}else return!1},"F"),V=c((e,t,n,o)=>{const r=A(e),l=t>1;return Q(K(ie(f=>{let h=0;for(;h<n;){const y=f.index;if(!r(f)||(h+=1,f.index===y))break}return h>=t},l),o))},"k"),ae=c((e,t)=>V(e,0,1,t),"L"),F=c((e,t)=>V(e,0,1/0,t),"$"),Ge=c((e,t)=>V(e,1,1/0,t),"Re"),B=c((e,t)=>{const n=e.map(A);return Q(K(ie(o=>{for(let r=0,l=n.length;r<l;r++)if(!n[r](o))return!1;return!0}),t))},"x"),j=c((e,t)=>{const n=e.map(A);return Q(K(o=>{for(let r=0,l=n.length;r<l;r++)if(n[r](o))return!0;return!1},t))},"p"),ie=c((e,t=!0,n=!1)=>{const o=A(e);return t?r=>{const l=r.index,f=r.output.length,h=o(r);return!h&&!n&&(r.indexBacktrackMax=Math.max(r.indexBacktrackMax,r.index)),(!h||n)&&(r.index=l,r.output.length!==f&&(r.output.length=f)),h}:o},"q"),K=c((e,t)=>{const n=A(e);return t?o=>{if(o.options.silent)return n(o);const r=o.output.length;if(n(o)){const l=o.output.splice(r,1/0),f=t(l);return z(f)||o.output.push(f),!0}else return!1}:n},"B"),Q=(()=>{let e=0;return t=>{const n=A(t),o=e+=1;return r=>{var l;if(r.options.memoization===!1)return n(r);const f=r.index,h=(l=r.cache)[o]||(l[o]={indexMax:-1,queue:[]}),y=h.queue;if(f<=h.indexMax){const Z=h.store||(h.store=new Map);if(y.length){for(let C=0,Kt=y.length;C<Kt;C+=2){const Qt=y[C*2],Xt=y[C*2+1];Z.set(Qt,Xt)}y.length=0}const P=Z.get(f);if(P===!1)return!1;if(We(P))return r.index=P,!0;if(P)return r.index=P.index,P.output?.length&&r.output.push(...P.output),!0}const L=r.output.length,Vt=n(r);if(h.indexMax=Math.max(h.indexMax,f),Vt){const Z=r.index,P=r.output.length;if(P>L){const C=r.output.slice(L,P);y.push(f,{index:Z,output:C})}else y.push(f,Z);return!0}else return y.push(f,!1),!1}}})(),le=c(e=>{let t;return n=>(t||(t=A(e())),t(n))},"G"),A=Ze(e=>{if(q(e))return Ie(e)?le(e):e;if(re(e)||qe(e))return p(e);if(ne(e))return B(e);if(Ce(e))return j(Object.values(e));throw new Error("Invalid rule")}),R=c(e=>e,"d"),De=c(e=>typeof e=="string","ke"),Je=c(e=>{const t=new WeakMap,n=new WeakMap;return(o,r)=>{const l=r?.partial?n:t,f=l.get(o);if(f!==void 0)return f;const h=e(o,r);return l.set(o,h),h}},"Be"),Ve=c(e=>{const t={},n={};return(o,r)=>{const l=r?.partial?n:t;return l[o]??(l[o]=e(o,r))}},"Pe"),Ke=p(/\\./,R),Qe=p(/./,R),Xe=p(/\*\*\*+/,"*"),Ye=p(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),et=p(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),tt=F(j([Ke,Xe,Ye,et,Qe])),nt=tt,rt=c(e=>oe(e,nt,{memoization:!1}).join(""),"Ie"),ot=rt,ce="abcdefghijklmnopqrstuvwxyz",st=c(e=>{let t="";for(;e>0;){const n=(e-1)%26;t=ce[n]+t,e=Math.floor((e-1)/26)}return t},"Le"),ue=c(e=>{let t=0;for(let n=0,o=e.length;n<o;n++)t=t*26+ce.indexOf(e[n])+1;return t},"V"),X=c((e,t)=>{if(t<e)return X(t,e);const n=[];for(;e<=t;)n.push(e++);return n},"b"),at=c((e,t,n)=>X(e,t).map(o=>String(o).padStart(n,"0")),"qe"),fe=c((e,t)=>X(ue(e),ue(t)).map(st),"W"),$=c(e=>({partial:!1,regex:new RegExp(e,"s"),children:[]}),"c"),N=c(e=>({children:e}),"y"),W=(()=>{const e=c((t,n,o)=>{if(o.has(t))return;o.add(t);const{children:r}=t;if(!r.length)r.push(n);else for(let l=0,f=r.length;l<f;l++)e(r[l],n,o)},"e");return t=>{if(!t.length)return N([]);for(let n=t.length-1;n>=1;n--){const o=new Set,r=t[n-1],l=t[n];e(r,l,o)}return t[0]}})(),E=c(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),it=p(/\\./,$),lt=p(/[$.*+?^(){}[\]\|]/,e=>$(`\\${e}`)),ct=p(/[\\\/]/,E),ut=p(/[^$.*+?^(){}[\]\|\\\/]+/,$),ft=p(/^(?:!!)*!(.*)$/,(e,t)=>$(`(?!^${ye.compile(t).source}$).*?`)),pt=p(/^(!!)+/),dt=j([ft,pt]),ht=p(/\/(\*\*\/)+/,()=>N([W([E(),$(".+?"),E()]),E()])),gt=p(/^(\*\*\/)+/,()=>N([$("^"),W([$(".*?"),E()])])),xt=p(/\/(\*\*)$/,()=>N([W([E(),$(".*?")]),$("$")])),mt=p(/\*\*/,()=>$(".*?")),pe=j([ht,gt,xt,mt]),$t=p(/\*\/(?!\*\*\/|\*$)/,()=>W([$("[^\\\\/]*?"),E()])),yt=p(/\*/,()=>$("[^\\\\/]*")),de=j([$t,yt]),he=p("?",()=>$("[^\\\\/]")),wt=p("[",R),bt=p("]",R),vt=p(/[!^]/,"^\\\\/"),jt=p(/[a-z]-[a-z]|[0-9]-[0-9]/i,R),Pt=p(/\\./,R),Mt=p(/[$.*+?^(){}[\|]/,e=>`\\${e}`),Ot=p(/[\\\/]/,"\\\\/"),_t=p(/[^$.*+?^(){}[\]\|\\\/]+/,R),zt=j([Pt,Mt,Ot,jt,_t]),ge=B([wt,ae(vt),F(zt),bt],e=>$(e.join(""))),At=p("{","(?:"),Et=p("}",")"),Rt=p(/(\d+)\.\.(\d+)/,(e,t,n)=>at(+t,+n,Math.min(t.length,n.length)).join("|")),kt=p(/([a-z]+)\.\.([a-z]+)/,(e,t,n)=>fe(t,n).join("|")),St=p(/([A-Z]+)\.\.([A-Z]+)/,(e,t,n)=>fe(t.toLowerCase(),n.toLowerCase()).join("|").toUpperCase()),It=j([Rt,kt,St]),xe=B([At,It,Et],e=>$(e.join(""))),Bt=p("{"),Wt=p("}"),Ct=p(","),qt=p(/\\./,$),Nt=p(/[$.*+?^(){[\]\|]/,e=>$(`\\${e}`)),Lt=p(/[\\\/]/,E),Zt=p(/[^$.*+?^(){}[\]\|\\\/,]+/,$),Ht=le(()=>$e),Ft=p("",()=>$("(?:)")),Tt=Ge(j([pe,de,he,ge,xe,Ht,qt,Nt,Lt,Zt]),W),me=j([Tt,Ft]),$e=B([Bt,ae(B([me,F(B([Ct,me]))])),Wt],N),Ut=F(j([dt,pe,de,he,ge,xe,$e,it,lt,ct,ut]),W),Gt=Ut,Dt=c(e=>oe(e,Gt,{memoization:!1})[0],"kr"),Jt=Dt,Y=c((e,t,n)=>Y.compile(e,n).test(t),"N");Y.compile=(()=>{const e=Ve((n,o)=>Re(Jt(ot(n)),o)),t=Je((n,o)=>Se(n.map(r=>e(r,o))));return(n,o)=>De(n)?e(n,o):t(n,o)})();var ye=Y;return m(b)})();return s.default||s},"_lazyMatch"),ee;const cn=c((s,a)=>(ee||(ee=ve(),ve=null),ee(s,a)),"default");var un=Object.defineProperty,fn=te((s,a)=>un(s,"name",{value:a,configurable:!0}),"t$1");const pn=/^[A-Z]:\//i,S=fn((s="")=>s&&s.replaceAll("\\","/").replace(pn,a=>a.toUpperCase()),"normalizeWindowsPath");var dn=Object.defineProperty,w=te((s,a)=>dn(s,"name",{value:a,configurable:!0}),"r");const hn=/^[/\\]{2}/,gn=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,Oe=/^[A-Z]:$/i,je=/^\/([A-Z]:)?$/i,xn=/.(\.[^./]+)$/,mn=/^[/\\]|^[a-z]:[/\\]/i,$n=/\/$/,yn=w(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Pe="/",_e=w((s,a)=>{let i="",u=0,d=-1,g=0,x;for(let m=0;m<=s.length;++m){if(m<s.length)x=s[m];else{if(x==="/")break;x="/"}if(x==="/"){if(!(d===m-1||g===1))if(g===2){if(i.length<2||u!==2||!i.endsWith(".")||i.at(-2)!=="."){if(i.length>2){const b=i.lastIndexOf("/");b===-1?(i="",u=0):(i=i.slice(0,b),u=i.length-1-i.lastIndexOf("/")),d=m,g=0;continue}else if(i.length>0){i="",u=0,d=m,g=0;continue}}a&&(i+=i.length>0?"/..":"..",u=2)}else i.length>0?i+=`/${s.slice(d+1,m)}`:i=s.slice(d+1,m),u=m-d-1;d=m,g=0}else x==="."&&g!==-1?++g:g=-1}return i},"normalizeString"),k=w(s=>gn.test(s),"isAbsolute"),U=w(function(s){if(s.length===0)return".";s=S(s);const a=hn.exec(s),i=k(s),u=s.at(-1)==="/";return s=_e(s,!i),s.length===0?i?"/":u?"./":".":(u&&(s+="/"),Oe.test(s)&&(s+="/"),a?i?`//${s}`:`//./${s}`:i&&!k(s)?`/${s}`:s)},"normalize");w((...s)=>{let a="";for(const i of s)if(i)if(a.length>0){const u=a.at(-1)==="/",d=i[0]==="/";u&&d?a+=i.slice(1):a+=u||d?i:`/${i}`}else a+=i;return U(a)},"join");const G=w(function(...s){s=s.map(u=>S(u));let a="",i=!1;for(let u=s.length-1;u>=-1&&!i;u--){const d=u>=0?s[u]:yn();!d||d.length===0||(a=`${d}/${a}`,i=k(d))}return a=_e(a,!i),i&&!k(a)?`/${a}`:a.length>0?a:"."},"resolve");w(function(s){return S(s)},"toNamespacedPath");const wn=w(function(s){return xn.exec(S(s))?.[1]??""},"extname"),bn=w(function(s,a){const i=G(s).replace(je,"$1").split("/"),u=G(a).replace(je,"$1").split("/");if(u[0][1]===":"&&i[0][1]===":"&&i[0]!==u[0])return u.join("/");const d=[...i];for(const g of d){if(u[0]!==g)break;i.shift(),u.shift()}return[...i.map(()=>".."),...u].join("/")},"relative"),vn=w(s=>{const a=S(s).replace($n,"").split("/").slice(0,-1);return a.length===1&&Oe.test(a[0])&&(a[0]=`${a[0]}/`),a.join("/")||(k(s)?"/":".")},"dirname");w(function(s){const a=[s.root,s.dir,s.base??s.name+s.ext].filter(Boolean);return S(s.root?G(...a):a.join("/"))},"format");const jn=w((s,a)=>{const i=S(s).split("/").pop();return a&&i.endsWith(a)?i.slice(0,-a.length):i},"basename");w(function(s){const a=mn.exec(s)?.[0]?.replaceAll("\\","/")??"",i=jn(s),u=wn(i);return{base:i,dir:vn(s),ext:u,name:i.slice(0,i.length-u.length),root:a}},"parse");w((s,a)=>cn(a,U(s)),"matchesGlob");var Pn=Object.defineProperty,M=T((s,a)=>Pn(s,"name",{value:a,configurable:!0}),"a");const Me=M(s=>{if(typeof s.status=="function"){s.status(400).send("Failed to open editor");return}s.statusCode=400,s.end("Failed to open editor")},"respond400"),ze=M((s={})=>{const a=M(async u=>{if((u.method??"GET").toUpperCase()==="POST")return u.body&&typeof u.body=="object"?u.body:new Promise(g=>{try{let x="";const m=M(v=>{x+=String(v)},"onData"),b=M(()=>{try{g(x?JSON.parse(x):{})}catch{g({})}},"onEnd");u.on("data",m),u.on("end",b),u.on("error",()=>{g({})})}catch{g({})}});const d=new URL(u.url??"","http://localhost");return{column:Number(d.searchParams.get("column")??1),editor:d.searchParams.get("editor")??void 0,file:d.searchParams.get("file")??void 0,line:Number(d.searchParams.get("line")??1)}},"parseRequestBody"),i=M((u,d,g)=>{if(!u)return;const x=k(u)?u:G(d,u);if(!g)try{const m=we(d),b=we(x),v=U(m),O=U(b),_=be()==="win32"||be()==="darwin",D=_?v.toLowerCase():v,J=_?O.toLowerCase():O,I=bn(v,O);if(I.startsWith("..")||k(I)||_&&!J.startsWith(D))return}catch{const m=d.endsWith(Pe)?d:d+Pe;if(!x.startsWith(m))return}return x},"validateFilePath");return M(async function(u,d,g){try{const x=await a(u),m=s.projectRoot??process.cwd(),b=i(x.file,m,s.allowOutsideProject??!1);if(!b){Me(d);return}const v=rn(x.editor,m),O=new URLSearchParams({column:String(x.column??1),file:b,line:String(x.line??1)});if(x.editor&&O.set("editor",x.editor),u.url=`/?${O.toString()}`,typeof g=="function"){v(u,d,g);return}await new Promise(_=>{v(u,d,()=>{_()})})}catch{Me(d)}},"universalHandler")},"createOpenInEditorMiddleware"),An=M((s={})=>{const a=ze(s);return async(i,u)=>a(i,u)},"createNodeHttpHandler"),En=M((s={})=>ze(s),"createExpressHandler");export{En as createExpressHandler,An as createNodeHttpHandler,ze as createOpenInEditorMiddleware};
1
+ var Yt=Object.defineProperty;var T=(s,a)=>Yt(s,"name",{value:a,configurable:!0});import{createRequire as en}from"node:module";import rn from"launch-editor-middleware";import{a as be}from"../packem_shared/process-BO_aZsiL.js";const tn=en(import.meta.url),H=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,nn=T(s=>{if(typeof H<"u"&&H.versions&&H.versions.node){const[a,i]=H.versions.node.split(".").map(Number);if(a>22||a===22&&i>=3||a===20&&i>=16)return H.getBuiltinModule(s)}return tn(s)},"__cjs_getBuiltinModule"),{realpathSync:ye}=nn("node:fs");var on=Object.defineProperty,sn=T((s,a)=>on(s,"name",{value:a,configurable:!0}),"$e"),an=Object.defineProperty,te=sn((s,a)=>an(s,"name",{value:a,configurable:!0}),"W"),ln=Object.defineProperty,c=te((s,a)=>ln(s,"name",{value:a,configurable:!0}),"u$1");let ve=c(()=>{var s=(()=>{var a=Object.defineProperty,i=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,d=Object.prototype.hasOwnProperty,g=c((e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},"ne"),x=c((e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of u(t))!d.call(e,r)&&r!==n&&a(e,r,{get:c(()=>t[r],"get"),enumerable:!(o=i(t,r))||o.enumerable});return e},"ae"),m=c(e=>x(a({},"__esModule",{value:!0}),e),"oe"),b={};g(b,{zeptomatch:c(()=>we,"zeptomatch")});var v=c(e=>{const t=new Set,n=[e];for(let o=0;o<n.length;o++){const r=n[o];if(t.has(r))continue;t.add(r);const{children:l}=r;if(l?.length)for(let f=0,h=l.length;f<h;f++)n.push(l[f])}return Array.from(t)},"M"),O=c(e=>{let t="";const n=v(e);for(let o=0,r=n.length;o<r;o++){const l=n[o];if(!l.regex)continue;const f=l.regex.flags;if(t||(t=f),t!==f)throw new Error(`Inconsistent RegExp flags used: "${t}" and "${f}"`)}return t},"se"),E=c((e,t,n)=>{const o=n.get(e);if(o!==void 0)return o;const r=e.partial??t;let l="";if(e.regex&&(l+=r?"(?:$|":"",l+=e.regex.source),e.children?.length){const f=J(e.children.map(h=>E(h,t,n)).filter(Boolean));if(f?.length){const h=e.children.some(L=>!L.regex||!(L.partial??t)),w=f.length>1||r&&(!l.length||h);l+=w?r?"(?:$|":"(?:":"",l+=f.join("|"),l+=w?")":""}}return e.regex&&(l+=r?")":""),n.set(e,l),l},"O"),D=c((e,t)=>{const n=new Map,o=v(e);for(let r=o.length-1;r>=0;r--){const l=E(o[r],t,n);if(!(r>0))return l}return""},"ie"),J=c(e=>Array.from(new Set(e)),"ue"),I=c((e,t,n)=>I.compile(e,n).test(t),"R");I.compile=(e,t)=>{const n=t?.partial??!1,o=D(e,n),r=O(e);return new RegExp(`^(?:${o})$`,r)};var ze=I,Ae=c((e,t)=>{const n=ze.compile(e,t),o=`${n.source.slice(0,-1)}[\\\\/]?$`,r=n.flags;return new RegExp(o,r)},"le"),Re=Ae,ke=c(e=>{const t=e.map(o=>o.source).join("|")||"$^",n=e[0]?.flags;return new RegExp(t,n)},"ve"),Se=ke,ne=c(e=>Array.isArray(e),"j"),q=c(e=>typeof e=="function","_"),Ie=c(e=>e.length===0,"he"),Be=(()=>{const{toString:e}=Function.prototype,t=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return n=>(n.length===0||n.length===1)&&t.test(e.call(n))})(),We=c(e=>typeof e=="number","de"),Ce=c(e=>typeof e=="object"&&e!==null,"xe"),qe=c(e=>e instanceof RegExp,"me"),Ne=(()=>{const e=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return t=>e.test(t.source)})(),Le=(()=>{const e=/^[a-zA-Z0-9_-]+$/;return t=>e.test(t.source)&&!t.flags.includes("i")})(),re=c(e=>typeof e=="string","A"),_=c(e=>e===void 0,"f"),Ze=c(e=>{const t=new Map;return n=>{const o=t.get(n);if(o!==void 0)return o;const r=e(n);return t.set(n,r),r}},"ye"),oe=c((e,t,n={})=>{const o={cache:{},input:e,index:0,indexBacktrackMax:0,options:n,output:[]},r=z(t)(o),l=Math.max(o.index,o.indexBacktrackMax);if(r&&o.index===e.length)return o.output;throw new Error(`Failed to parse at index ${l}`)},"I"),p=c((e,t)=>ne(e)?He(e,t):re(e)?se(e,t):Fe(e,t),"i"),He=c((e,t)=>{const n={};for(const o of e){if(o.length!==1)throw new Error(`Invalid character: "${o}"`);const r=o.charCodeAt(0);n[r]=!0}return o=>{const r=o.input;let l=o.index,f=l;for(;f<r.length&&r.charCodeAt(f)in n;)f+=1;if(f>l){if(!_(t)&&!o.options.silent){const h=r.slice(l,f),w=q(t)?t(h,r,`${l}`):t;_(w)||o.output.push(w)}o.index=f}return!0}},"we"),Fe=c((e,t)=>{if(Le(e))return se(e.source,t);{const n=e.source,o=e.flags.replace(/y|$/,"y"),r=new RegExp(n,o);return Ne(e)&&q(t)&&!Be(t)?Te(r,t):Ue(r,t)}},"$e"),Te=c((e,t)=>n=>{const o=n.index,r=n.input;e.lastIndex=o;const l=e.exec(r);if(l){const f=e.lastIndex;if(!n.options.silent){const h=t(...l,r,`${o}`);_(h)||n.output.push(h)}return n.index=f,!0}else return!1},"Ee"),Ue=c((e,t)=>n=>{const o=n.index,r=n.input;if(e.lastIndex=o,e.test(r)){const l=e.lastIndex;if(!_(t)&&!n.options.silent){const f=q(t)?t(r.slice(o,l),r,`${o}`):t;_(f)||n.output.push(f)}return n.index=l,!0}else return!1},"Ce"),se=c((e,t)=>n=>{const o=n.index,r=n.input;if(r.startsWith(e,o)){if(!_(t)&&!n.options.silent){const l=q(t)?t(e,r,`${o}`):t;_(l)||n.output.push(l)}return n.index+=e.length,!0}else return!1},"F"),V=c((e,t,n,o)=>{const r=z(e),l=t>1;return Q(K(ie(f=>{let h=0;for(;h<n;){const w=f.index;if(!r(f)||(h+=1,f.index===w))break}return h>=t},l),o))},"k"),ae=c((e,t)=>V(e,0,1,t),"L"),F=c((e,t)=>V(e,0,1/0,t),"$"),Ge=c((e,t)=>V(e,1,1/0,t),"Re"),B=c((e,t)=>{const n=e.map(z);return Q(K(ie(o=>{for(let r=0,l=n.length;r<l;r++)if(!n[r](o))return!1;return!0}),t))},"x"),j=c((e,t)=>{const n=e.map(z);return Q(K(o=>{for(let r=0,l=n.length;r<l;r++)if(n[r](o))return!0;return!1},t))},"p"),ie=c((e,t=!0,n=!1)=>{const o=z(e);return t?r=>{const l=r.index,f=r.output.length,h=o(r);return!h&&!n&&(r.indexBacktrackMax=Math.max(r.indexBacktrackMax,r.index)),(!h||n)&&(r.index=l,r.output.length!==f&&(r.output.length=f)),h}:o},"q"),K=c((e,t)=>{const n=z(e);return t?o=>{if(o.options.silent)return n(o);const r=o.output.length;if(n(o)){const l=o.output.splice(r,1/0),f=t(l);return _(f)||o.output.push(f),!0}else return!1}:n},"B"),Q=(()=>{let e=0;return t=>{const n=z(t),o=e+=1;return r=>{var l;if(r.options.memoization===!1)return n(r);const f=r.index,h=(l=r.cache)[o]||(l[o]={indexMax:-1,queue:[]}),w=h.queue;if(f<=h.indexMax){const Z=h.store||(h.store=new Map);if(w.length){for(let C=0,Kt=w.length;C<Kt;C+=2){const Qt=w[C*2],Xt=w[C*2+1];Z.set(Qt,Xt)}w.length=0}const P=Z.get(f);if(P===!1)return!1;if(We(P))return r.index=P,!0;if(P)return r.index=P.index,P.output?.length&&r.output.push(...P.output),!0}const L=r.output.length,Vt=n(r);if(h.indexMax=Math.max(h.indexMax,f),Vt){const Z=r.index,P=r.output.length;if(P>L){const C=r.output.slice(L,P);w.push(f,{index:Z,output:C})}else w.push(f,Z);return!0}else return w.push(f,!1),!1}}})(),le=c(e=>{let t;return n=>(t||(t=z(e())),t(n))},"G"),z=Ze(e=>{if(q(e))return Ie(e)?le(e):e;if(re(e)||qe(e))return p(e);if(ne(e))return B(e);if(Ce(e))return j(Object.values(e));throw new Error("Invalid rule")}),R=c(e=>e,"d"),De=c(e=>typeof e=="string","ke"),Je=c(e=>{const t=new WeakMap,n=new WeakMap;return(o,r)=>{const l=r?.partial?n:t,f=l.get(o);if(f!==void 0)return f;const h=e(o,r);return l.set(o,h),h}},"Be"),Ve=c(e=>{const t={},n={};return(o,r)=>{const l=r?.partial?n:t;return l[o]??(l[o]=e(o,r))}},"Pe"),Ke=p(/\\./,R),Qe=p(/./,R),Xe=p(/\*\*\*+/,"*"),Ye=p(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),et=p(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),tt=F(j([Ke,Xe,Ye,et,Qe])),nt=tt,rt=c(e=>oe(e,nt,{memoization:!1}).join(""),"Ie"),ot=rt,ce="abcdefghijklmnopqrstuvwxyz",st=c(e=>{let t="";for(;e>0;){const n=(e-1)%26;t=ce[n]+t,e=Math.floor((e-1)/26)}return t},"Le"),ue=c(e=>{let t=0;for(let n=0,o=e.length;n<o;n++)t=t*26+ce.indexOf(e[n])+1;return t},"V"),X=c((e,t)=>{if(t<e)return X(t,e);const n=[];for(;e<=t;)n.push(e++);return n},"b"),at=c((e,t,n)=>X(e,t).map(o=>String(o).padStart(n,"0")),"qe"),fe=c((e,t)=>X(ue(e),ue(t)).map(st),"W"),$=c(e=>({partial:!1,regex:new RegExp(e,"s"),children:[]}),"c"),N=c(e=>({children:e}),"y"),W=(()=>{const e=c((t,n,o)=>{if(o.has(t))return;o.add(t);const{children:r}=t;if(!r.length)r.push(n);else for(let l=0,f=r.length;l<f;l++)e(r[l],n,o)},"e");return t=>{if(!t.length)return N([]);for(let n=t.length-1;n>=1;n--){const o=new Set,r=t[n-1],l=t[n];e(r,l,o)}return t[0]}})(),A=c(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),it=p(/\\./,$),lt=p(/[$.*+?^(){}[\]\|]/,e=>$(`\\${e}`)),ct=p(/[\\\/]/,A),ut=p(/[^$.*+?^(){}[\]\|\\\/]+/,$),ft=p(/^(?:!!)*!(.*)$/,(e,t)=>$(`(?!^${we.compile(t).source}$).*?`)),pt=p(/^(!!)+/),dt=j([ft,pt]),ht=p(/\/(\*\*\/)+/,()=>N([W([A(),$(".+?"),A()]),A()])),gt=p(/^(\*\*\/)+/,()=>N([$("^"),W([$(".*?"),A()])])),xt=p(/\/(\*\*)$/,()=>N([W([A(),$(".*?")]),$("$")])),mt=p(/\*\*/,()=>$(".*?")),pe=j([ht,gt,xt,mt]),$t=p(/\*\/(?!\*\*\/|\*$)/,()=>W([$("[^\\\\/]*?"),A()])),wt=p(/\*/,()=>$("[^\\\\/]*")),de=j([$t,wt]),he=p("?",()=>$("[^\\\\/]")),yt=p("[",R),bt=p("]",R),vt=p(/[!^]/,"^\\\\/"),jt=p(/[a-z]-[a-z]|[0-9]-[0-9]/i,R),Pt=p(/\\./,R),Mt=p(/[$.*+?^(){}[\|]/,e=>`\\${e}`),Ot=p(/[\\\/]/,"\\\\/"),Et=p(/[^$.*+?^(){}[\]\|\\\/]+/,R),_t=j([Pt,Mt,Ot,jt,Et]),ge=B([yt,ae(vt),F(_t),bt],e=>$(e.join(""))),zt=p("{","(?:"),At=p("}",")"),Rt=p(/(\d+)\.\.(\d+)/,(e,t,n)=>at(+t,+n,Math.min(t.length,n.length)).join("|")),kt=p(/([a-z]+)\.\.([a-z]+)/,(e,t,n)=>fe(t,n).join("|")),St=p(/([A-Z]+)\.\.([A-Z]+)/,(e,t,n)=>fe(t.toLowerCase(),n.toLowerCase()).join("|").toUpperCase()),It=j([Rt,kt,St]),xe=B([zt,It,At],e=>$(e.join(""))),Bt=p("{"),Wt=p("}"),Ct=p(","),qt=p(/\\./,$),Nt=p(/[$.*+?^(){[\]\|]/,e=>$(`\\${e}`)),Lt=p(/[\\\/]/,A),Zt=p(/[^$.*+?^(){}[\]\|\\\/,]+/,$),Ht=le(()=>$e),Ft=p("",()=>$("(?:)")),Tt=Ge(j([pe,de,he,ge,xe,Ht,qt,Nt,Lt,Zt]),W),me=j([Tt,Ft]),$e=B([Bt,ae(B([me,F(B([Ct,me]))])),Wt],N),Ut=F(j([dt,pe,de,he,ge,xe,$e,it,lt,ct,ut]),W),Gt=Ut,Dt=c(e=>oe(e,Gt,{memoization:!1})[0],"kr"),Jt=Dt,Y=c((e,t,n)=>Y.compile(e,n).test(t),"N");Y.compile=(()=>{const e=Ve((n,o)=>Re(Jt(ot(n)),o)),t=Je((n,o)=>Se(n.map(r=>e(r,o))));return(n,o)=>De(n)?e(n,o):t(n,o)})();var we=Y;return m(b)})();return s.default||s},"_lazyMatch"),ee;const cn=c((s,a)=>(ee||(ee=ve(),ve=null),ee(s,a)),"default");var un=Object.defineProperty,fn=te((s,a)=>un(s,"name",{value:a,configurable:!0}),"t$1");const pn=/^[A-Z]:\//i,S=fn((s="")=>s&&s.replaceAll("\\","/").replace(pn,a=>a.toUpperCase()),"normalizeWindowsPath");var dn=Object.defineProperty,y=te((s,a)=>dn(s,"name",{value:a,configurable:!0}),"r");const hn=/^[/\\]{2}/,gn=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,Oe=/^[A-Z]:$/i,je=/^\/([A-Z]:)?$/i,xn=/.(\.[^./]+)$/,mn=/^[/\\]|^[a-z]:[/\\]/i,$n=/\/$/,wn=y(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Pe="/",Ee=y((s,a)=>{let i="",u=0,d=-1,g=0,x;for(let m=0;m<=s.length;++m){if(m<s.length)x=s[m];else{if(x==="/")break;x="/"}if(x==="/"){if(!(d===m-1||g===1))if(g===2){if(i.length<2||u!==2||!i.endsWith(".")||i.at(-2)!=="."){if(i.length>2){const b=i.lastIndexOf("/");b===-1?(i="",u=0):(i=i.slice(0,b),u=i.length-1-i.lastIndexOf("/")),d=m,g=0;continue}else if(i.length>0){i="",u=0,d=m,g=0;continue}}a&&(i+=i.length>0?"/..":"..",u=2)}else i.length>0?i+=`/${s.slice(d+1,m)}`:i=s.slice(d+1,m),u=m-d-1;d=m,g=0}else x==="."&&g!==-1?++g:g=-1}return i},"normalizeString"),k=y(s=>gn.test(s),"isAbsolute"),U=y(function(s){if(s.length===0)return".";s=S(s);const a=hn.exec(s),i=k(s),u=s.at(-1)==="/";return s=Ee(s,!i),s.length===0?i?"/":u?"./":".":(u&&(s+="/"),Oe.test(s)&&(s+="/"),a?i?`//${s}`:`//./${s}`:i&&!k(s)?`/${s}`:s)},"normalize");y((...s)=>{let a="";for(const i of s)if(i)if(a.length>0){const u=a.at(-1)==="/",d=i[0]==="/";u&&d?a+=i.slice(1):a+=u||d?i:`/${i}`}else a+=i;return U(a)},"join");const G=y(function(...s){s=s.map(u=>S(u));let a="",i=!1;for(let u=s.length-1;u>=-1&&!i;u--){const d=u>=0?s[u]:wn();!d||d.length===0||(a=`${d}/${a}`,i=k(d))}return a=Ee(a,!i),i&&!k(a)?`/${a}`:a.length>0?a:"."},"resolve");y(function(s){return S(s)},"toNamespacedPath");const yn=y(function(s){return xn.exec(S(s))?.[1]??""},"extname"),bn=y(function(s,a){const i=G(s).replace(je,"$1").split("/"),u=G(a).replace(je,"$1").split("/");if(u[0][1]===":"&&i[0][1]===":"&&i[0]!==u[0])return u.join("/");const d=[...i];for(const g of d){if(u[0]!==g)break;i.shift(),u.shift()}return[...i.map(()=>".."),...u].join("/")},"relative"),vn=y(s=>{const a=S(s).replace($n,"").split("/").slice(0,-1);return a.length===1&&Oe.test(a[0])&&(a[0]=`${a[0]}/`),a.join("/")||(k(s)?"/":".")},"dirname");y(function(s){const a=[s.root,s.dir,s.base??s.name+s.ext].filter(Boolean);return S(s.root?G(...a):a.join("/"))},"format");const jn=y((s,a)=>{const i=S(s).split("/").pop();return a&&i.endsWith(a)?i.slice(0,-a.length):i},"basename");y(function(s){const a=mn.exec(s)?.[0]?.replaceAll("\\","/")??"",i=jn(s),u=yn(i);return{base:i,dir:vn(s),ext:u,name:i.slice(0,i.length-u.length),root:a}},"parse");y((s,a)=>cn(a,U(s)),"matchesGlob");var Pn=Object.defineProperty,M=T((s,a)=>Pn(s,"name",{value:a,configurable:!0}),"i");const Me=M(s=>{if(typeof s.status=="function"){s.status(400).send("Failed to open editor");return}s.statusCode=400,s.end("Failed to open editor")},"respond400"),_e=M((s={})=>{const a=M(async u=>{if((u.method??"GET").toUpperCase()==="POST")return u.body&&typeof u.body=="object"?u.body:new Promise(g=>{try{let x="";const m=M(v=>{x+=String(v)},"onData"),b=M(()=>{try{g(x?JSON.parse(x):{})}catch{g({})}},"onEnd");u.on("data",m),u.on("end",b),u.on("error",()=>{g({})})}catch{g({})}});const d=new URL(u.url??"","http://localhost");return{column:Number(d.searchParams.get("column")??1),editor:d.searchParams.get("editor")??void 0,file:d.searchParams.get("file")??void 0,line:Number(d.searchParams.get("line")??1)}},"parseRequestBody"),i=M((u,d,g)=>{if(!u)return;const x=k(u)?u:G(d,u);if(!g)try{const m=ye(d),b=ye(x),v=U(m),O=U(b),E=be()==="win32"||be()==="darwin",D=E?v.toLowerCase():v,J=E?O.toLowerCase():O,I=bn(v,O);if(I.startsWith("..")||k(I)||E&&!J.startsWith(D))return}catch{const m=d.endsWith(Pe)?d:d+Pe;if(!x.startsWith(m))return}return x},"validateFilePath");return M(async function(u,d,g){try{const x=await a(u),m=s.projectRoot??process.cwd(),b=i(x.file,m,s.allowOutsideProject??!1);if(!b){Me(d);return}const v=rn(x.editor,m),O=new URLSearchParams({column:String(x.column??1),file:b,line:String(x.line??1)});if(x.editor&&O.set("editor",x.editor),u.url=`/?${O.toString()}`,typeof g=="function"){v(u,d,g);return}await new Promise(E=>{v(u,d,()=>{E()})})}catch{Me(d)}},"universalHandler")},"createOpenInEditorMiddleware"),zn=M((s={})=>{const a=_e(s);return async(i,u)=>a(i,u)},"createNodeHttpHandler"),An=M((s={})=>_e(s),"createExpressHandler");export{An as createExpressHandler,zn as createNodeHttpHandler,_e as createOpenInEditorMiddleware};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/ono",
3
- "version": "2.0.0-alpha.18",
3
+ "version": "2.0.0-alpha.19",
4
4
  "description": "Ono is an error-parsing library that pretty prints JavaScript errors on a web page or the terminal.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -31,6 +31,11 @@
31
31
  "youch"
32
32
  ],
33
33
  "homepage": "https://visulima.com/packages/ono/",
34
+ "license": "MIT",
35
+ "author": {
36
+ "name": "Daniel Bannert",
37
+ "email": "d.bannert@anolilab.de"
38
+ },
34
39
  "repository": {
35
40
  "type": "git",
36
41
  "url": "https://github.com/visulima/visulima.git",
@@ -46,13 +51,14 @@
46
51
  "url": "https://anolilab.com/support"
47
52
  }
48
53
  ],
49
- "license": "MIT",
50
- "author": {
51
- "name": "Daniel Bannert",
52
- "email": "d.bannert@anolilab.de"
53
- },
54
- "sideEffects": true,
54
+ "files": [
55
+ "dist",
56
+ "README.md",
57
+ "CHANGELOG.md",
58
+ "LICENSE.md"
59
+ ],
55
60
  "type": "module",
61
+ "sideEffects": true,
56
62
  "exports": {
57
63
  ".": {
58
64
  "types": "./dist/index.d.ts",
@@ -68,12 +74,10 @@
68
74
  },
69
75
  "./package.json": "./package.json"
70
76
  },
71
- "files": [
72
- "dist",
73
- "README.md",
74
- "CHANGELOG.md",
75
- "LICENSE.md"
76
- ],
77
+ "publishConfig": {
78
+ "access": "public",
79
+ "provenance": true
80
+ },
77
81
  "scripts": {
78
82
  "build": "packem build --development",
79
83
  "build:prod": "packem build --production",
@@ -94,7 +98,7 @@
94
98
  },
95
99
  "dependencies": {
96
100
  "@shikijs/langs": "catalog:prod",
97
- "@visulima/error": "6.0.0-alpha.15",
101
+ "@visulima/error": "6.0.0-alpha.16",
98
102
  "isomorphic-dompurify": "catalog:prod",
99
103
  "launch-editor-middleware": "catalog:prod",
100
104
  "shiki": "catalog:syntax"
@@ -168,9 +172,5 @@
168
172
  },
169
173
  "engines": {
170
174
  "node": "^22.14.0 || >=24.10.0"
171
- },
172
- "publishConfig": {
173
- "access": "public",
174
- "provenance": true
175
175
  }
176
176
  }
@@ -1 +0,0 @@
1
- var f=Object.defineProperty;var l=(t,e)=>f(t,"name",{value:e,configurable:!0});import{sanitize as u}from"isomorphic-dompurify";var w=Object.defineProperty,n=l((t,e)=>w(t,"name",{value:e,configurable:!0}),"e$1");const D=["http://","https://","/","./","../"],g="#",y={'"':"&quot;","&":"&amp;","'":"&#39;","<":"&lt;",">":"&gt;"},x=/^[\w+/-]+={0,2}$/,a=n(t=>t==null?"":(typeof t=="string"?t:String(t)).trim(),"toString"),d=n(t=>t.replaceAll(/[&<>"']/g,e=>y[e]),"escapeHtml"),C=n(t=>{try{return u(a(t))}catch{return d(a(t))}},"sanitizeHtml"),H=n(t=>{const e=a(t);if(!e)return"";try{return u(e).replaceAll('"',"&quot;").replaceAll("'","&#39;")}catch{return d(e)}},"sanitizeAttribute"),b=n(t=>{const e=a(t);if(!e)return g;try{const i=u(e),r=i.toLowerCase();return D.some(o=>r.startsWith(o))?i:g}catch{return g}},"sanitizeUrlAttribute"),P=n(t=>{const e=a(t);if(!e)return"";try{return u(e,{ADD_ATTR:["class","style"]})}catch{return C(e)}},"sanitizeCodeHtml"),j=n(t=>{const e=a(t);if(e)return x.test(e)?e:void 0},"sanitizeCspNonce"),N=n((t={})=>{try{return{...t,cspNonce:j(t.cspNonce),openInEditorUrl:t.openInEditorUrl?b(t.openInEditorUrl):void 0}}catch{return{...t,cspNonce:void 0,openInEditorUrl:void 0}}},"sanitizeOptions");var A=Object.defineProperty,s=l((t,e)=>A(t,"name",{value:e,configurable:!0}),"t");const h={javascript:s(()=>import("@shikijs/langs/javascript"),"javascript"),typescript:s(()=>import("@shikijs/langs/typescript"),"typescript"),jsx:s(()=>import("@shikijs/langs/jsx"),"jsx"),tsx:s(()=>import("@shikijs/langs/tsx"),"tsx"),json:s(()=>import("@shikijs/langs/json"),"json"),jsonc:s(()=>import("@shikijs/langs/jsonc"),"jsonc"),xml:s(()=>import("@shikijs/langs/xml"),"xml"),sql:s(()=>import("@shikijs/langs/sql"),"sql"),markdown:s(()=>import("@shikijs/langs/markdown"),"markdown"),mdx:s(()=>import("@shikijs/langs/mdx"),"mdx"),html:s(()=>import("@shikijs/langs/html"),"html"),css:s(()=>import("@shikijs/langs/css"),"css"),scss:s(()=>import("@shikijs/langs/scss"),"scss"),less:s(()=>import("@shikijs/langs/less"),"less"),sass:s(()=>import("@shikijs/langs/sass"),"sass"),stylus:s(()=>import("@shikijs/langs/stylus"),"stylus"),styl:s(()=>import("@shikijs/langs/styl"),"styl"),svelte:s(()=>import("@shikijs/langs/svelte"),"svelte"),vue:s(()=>import("@shikijs/langs/vue"),"vue"),bash:s(()=>import("@shikijs/langs/bash"),"bash"),shell:s(()=>import("@shikijs/langs/shell"),"shell"),text:s(()=>Promise.resolve({name:"text",patterns:[],scopeName:"source.text",repository:{}}),"text")};s(async t=>{if(typeof t!="string"||!t)return;const e=h[t.toLowerCase()];if(e)return await e()},"getLanguageImport");var F=Object.defineProperty,c=l((t,e)=>F(t,"name",{value:e,configurable:!0}),"a$1");let p,m;const L=c(async()=>{const[t,e]=await Promise.all([import("shiki/core"),import("shiki/engine/javascript")]),{createHighlighterCore:i}=t,{createJavaScriptRegexEngine:r}=e,o=await i({themes:[import("../packem_chunks/min-dark.js"),import("../packem_chunks/min-light.js")],langs:[],engine:r()}),v=o;return m=c(()=>{try{o?.dispose?.()}catch{}p=void 0},"disposeFn"),v},"createSingletonHighlighter"),z=c(async(t,e)=>{if(e==="text")return;const i=e.toLowerCase();if(!(t.getLoadedLanguages?.()??t.getLanguages?.()??[]).includes(i)){const r=h[i];r&&await t.loadLanguage?.(await r())}},"ensureLanguageLoaded"),O=c(async(t=[])=>{p||(p=L());const e=await p,i=[];for(const r of t)if(typeof r=="string")i.push(r.toLowerCase());else{const o=r.name;o&&i.push(o.toLowerCase())}return await Promise.all(i.map(r=>z(e,r))),e},"getHighlighter");c(async()=>{try{m&&(m(),m=void 0)}catch{}},"disposeHighlighter");c((t=[])=>({name:"@shikijs/transformers:compact-line-options",line(e,i){const r=t.find(o=>o.line===i);return r?.classes&&this.addClassToHast(e,r.classes),e}}),"transformerCompactLineOptions");const U="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-check%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M20%206%209%2017l-5-5%22%20%2F%3E%20%3C%2Fsvg%3E",$="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-clipboard%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Crect%20width%3D%228%22%20height%3D%224%22%20x%3D%228%22%20y%3D%222%22%20rx%3D%221%22%20ry%3D%221%22%20%2F%3E%20%3Cpath%20d%3D%22M16%204h2a2%202%200%200%201%202%202v14a2%202%200%200%201-2%202H6a2%202%200%200%201-2-2V6a2%202%200%200%201%202-2h2%22%20%2F%3E%20%3C%2Fsvg%3E";export{H as a,j as b,b as c,O as d,U as e,N as f,P as g,$ as n,C as s};