@preventive/triage 1.0.0-alpha.61 → 1.0.0-alpha.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/out/activity.js +3 -3
  2. package/out/brotli-fallback.js +1 -1
  3. package/out/chunk-4ISO5F7Y.js +1 -1
  4. package/out/{chunk-W6VOKW2N.js → chunk-65PLAG3I.js} +2 -2
  5. package/out/{chunk-JJK5OZG2.js → chunk-7GJNLCXF.js} +6 -6
  6. package/out/{chunk-OFZYEWBH.js → chunk-BZP3CT2V.js} +16 -16
  7. package/out/{chunk-QCOGVL37.js → chunk-DCBXCBLL.js} +2 -2
  8. package/out/chunk-E3LFSUDJ.js +1 -1
  9. package/out/chunk-EQ5EQXV5.js +1 -0
  10. package/out/{chunk-BRO77PQY.js → chunk-F3UI65ZI.js} +2 -2
  11. package/out/chunk-FAG6E5RC.js +3 -0
  12. package/out/chunk-HAZKDK4M.js +1 -1
  13. package/out/chunk-IZ6MYRYB.js +1 -1
  14. package/out/{chunk-B3FNMHOE.js → chunk-K2QJLP3E.js} +1 -1
  15. package/out/chunk-NXATZJQ2.js +1 -1
  16. package/out/{chunk-BNH52UHC.js → chunk-OBNHCORJ.js} +2 -2
  17. package/out/{chunk-GRGIZOTP.js → chunk-OGNTXZYM.js} +1 -1
  18. package/out/chunk-QRKFPLA4.js +2 -2
  19. package/out/{chunk-ZQNEWVGG.js → chunk-QVKFY4FA.js} +1 -1
  20. package/out/chunk-TOXMUOIW.js +2 -2
  21. package/out/chunk-WMFDQS2L.js +2 -2
  22. package/out/chunk-Y5ZHFNBD.js +1 -1
  23. package/out/client-managed-import.js +1 -1
  24. package/out/client-managed.js +6 -6
  25. package/out/client-sync.js +3 -3
  26. package/out/compare.js +4 -4
  27. package/out/dialogs.js +11 -11
  28. package/out/graph.js +5 -5
  29. package/out/index.html +5 -5
  30. package/out/prism.js +2 -2
  31. package/out/scan.js +2 -2
  32. package/out/terminal.js +146 -144
  33. package/out/view.js +5 -5
  34. package/package.json +15 -15
  35. package/risk/files/runs-code.js +2 -2
  36. package/server-e2e/static.ts +1 -1
  37. package/server-managed/bundle-build.ts +8 -4
  38. package/server-managed/http.ts +2 -2
  39. package/server-managed/type-only.ts +21 -1
  40. package/strip-types-loader.js +13 -10
  41. package/out/chunk-OIERSXON.js +0 -1
  42. package/out/chunk-W3QFV4SP.js +0 -3
@@ -1,10 +1,10 @@
1
- import{a as e}from"./chunk-QRKFPLA4.js";import{b as t}from"./chunk-TUII34K2.js";var n=new Set([`module`,`commonjs`,`json`,`module-typescript`,`commonjs-typescript`]),r=new Set([`solidity`,`php`,`shell`,`rust`,`teal`]),i=new Set([`java`,`kotlin`,`gradle`,`objc`,`objcpp`,`swift`,`c`,`cpp`,`c-header`,`cpp-header`,`ruby`,`python`,`cmake`,`podspec`,`podfile`,`podfile-lock`,`gemfile`,`gemfile-lock`,`template`,`xml`,`env`,`fastlane`,`pbxproj`]),a=new Set([`generic-javascript`,`generic-typescript`]),o=new Set([`resource`,`resource:base64`]),s=new Set([`stat:file`,`stat:directory`]),c=new Set([...n,...r,...i,...a,...o,`patch`,`directory`,...s]),l=e=>s.has(e),u=e=>e===`directory`||e===`stat:directory`?`directory`:`file`,d=new Set([`module`,`commonjs`,`module-typescript`,`commonjs-typescript`]),f=(e,t)=>a.has(e)&&d.has(t);function p(e,t,n){if(e===t)return e;if(f(e,t))return t;if(f(t,e))return e;let r=l(e);if(r!==l(t)&&u(e)===u(t))return r?t:e;throw Error(`format conflict for '${n}' ('${t}' vs '${e}')`)}var m=(e,t)=>t===``?e:e===`.`?t:`${e}/${t}`,h=/^(?=[A-Za-z0-9-]{1,39}\/)[A-Za-z0-9](?:-?[A-Za-z0-9])*\/(?!\.\.?$)[\w.-]{1,100}$/u,ee=/^(?!\.\.?(?:\/|$))[\w.~@+-]+(?:\/(?!\.\.?(?:\/|$))[\w.~@+-]+)*$/u,te=/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/u,g={github:e=>typeof e==`string`&&h.test(e),directory:e=>typeof e==`string`&&e.length<=1024&&(e===``||ee.test(e)),commit:e=>typeof e==`string`&&te.test(e)},ne=(e,t)=>e?.toLowerCase()===t?.toLowerCase(),_=(e,t,n)=>{if(e===void 0)return;E(e)||C(!1,`${n} must be an object`);for(let r of Object.keys(e))Object.hasOwn(t,r)||C(!1,`unknown ${n} key '${r}'`);let r=Object.entries(t).map(([t,r])=>typeof r==`object`?[t,_(e[t],r,`${n}.${t}`)]:(e[t]!==void 0&&!r(e[t])&&C(!1,`invalid ${n}.${t}: ${JSON.stringify(e[t])}`),[t,e[t]])).filter(([,e])=>e!==void 0);return r.length===0?void 0:Object.freeze(D(r))},re=(e,t=`bundle repo`)=>_(e,g,t),v=(e,t)=>t??(M(e)?`npm`:void 0),ie=(e,t,n,r,i)=>(a,{ecosystem:o,[e]:s},c)=>{if(s===void 0)return;r(a,o)||C(!1,`${c}: '${a}' is no ${i} bucket, and carries no ${e}`);let l=_(s,t,`${c} module '${a}' ${e}`);return l?.[n]===void 0&&C(!1,`${c} module '${a}' ${e} has no ${n}`),l},ae=ie(`repo`,g,`github`,(e,t)=>v(e,t)!==void 0,`dependency's`),oe={sha1:/^sha1-[A-Za-z\d+/]{27}=$/u,sha256:/^sha256-[A-Za-z\d+/]{43}=$/u,sha512:/^sha512-[A-Za-z\d+/]{86}==$/u},se=/^(?:\.\.\/)*(?!\.\.?(?:\/|$))[^/\\\p{Cc}]+(?:\/(?!\.\.?(?:\/|$))[^/\\\p{Cc}]+)*$/u,ce={integrity:e=>typeof e==`string`&&oe.sha256.test(e),file:e=>typeof e==`string`&&e.length<=4096&&se.test(e)},le=(e,t)=>M(e)&&v(e,t)===`npm`,ue={npm:`sha512`,cargo:`sha256`,composer:`sha1`,soldeer:`sha256`},de=(e,{ecosystem:t,integrity:n},r)=>{if(n===void 0)return;let i=v(e,t);return(!Object.hasOwn(ue,i)||i===`npm`&&!M(e))&&C(!1,`${r}: '${e}' is no npm, cargo, composer or soldeer dependency's bucket, and carries no integrity`),(typeof n!=`string`||!oe[ue[i]].test(n))&&C(!1,`invalid ${r} module '${e}' integrity: ${JSON.stringify(n)}`),n},fe=ie(`patch`,ce,`integrity`,le,`npm dependency's`),pe=e=>typeof e==`string`&&/^[\w.+@/~'!()*-]+$/u.test(e),y={name:pe,version:pe},me=e=>typeof e==`string`&&e!==``&&!e.includes(`\\`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e!==`node_modules`),he=(e,t,n)=>typeof e==`string`&&me(n)&&e===`${t}/${n}`,ge={vendored:()=>!0,subpackages:(e,t,n)=>he(e.name,t,n)},_e=(e,t)=>{for(let n=t.lastIndexOf(`/`);n>0;n=t.lastIndexOf(`/`,n-1))if(Object.hasOwn(e,t.slice(0,n)))return t.slice(0,n)};function ve(e,t){if(e===void 0)return;let n=new Set(Object.keys(t).map(t=>_e(e,t)).filter(e=>e!==void 0));return n.size===0?void 0:Object.freeze(D(w(n).map(t=>[t,e[t]])))}var ye=(e,t,{name:n,ecosystem:r,files:i,[e]:a},o)=>{if(a===void 0)return;v(t,r)===void 0&&C(!1,`${o}: '${t}' is no dependency's bucket, and carries no ${e}`),E(a)||C(!1,`${o} module '${t}' ${e} must be an object`);let s=D(Object.entries(a).map(([r,i])=>{me(r)||C(!1,`${o} module '${t}' ${e}: invalid directory ${JSON.stringify(r)}`);let a=_(i,y,`${o} module '${t}' ${e} '${r}'`);return a?.name===void 0&&C(!1,`${o} module '${t}' ${e} '${r}' has no name`),ge[e](a,n,r)||C(!1,`${o} module '${t}' ${e} '${r}' is named '${a.name}', not '${n}/${r}'`),[r,a]})),c=ve(s,i),l=Object.keys(s).find(e=>!Object.hasOwn(c??{},e));return l!==void 0&&C(!1,`${o} module '${t}' ${e} '${l}' holds none of its files`),c},be={integrity:de,patch:fe,repo:ae},b=Object.keys(ge),x=[...Object.keys(be),...b],xe=[`ecosystem`,...x],S=e=>{let t={name:e.name,version:e.version};for(let n of xe)e[n]!==void 0&&(t[n]=e[n]);return t.files=e.files,t},Se={integrity:(e,t)=>e===t,patch:(e,t)=>e?.integrity===t?.integrity&&(e?.file===void 0||t?.file===void 0||e.file===t.file)},Ce=Object.keys(Se),we=(e,t,n)=>Se[e](t,n),Te=(e,t)=>e[t]??(t===`patch`&&e.integrity!==void 0?null:void 0),Ee=(e,t,n,r)=>{if(we(e,t[e],n[e]))return;let[i,a]=[t[e],n[e]].map(e=>JSON.stringify(e)??`none`);C(!1,`${r} ${e} mismatch (${i} vs ${a})`)},De=(e,t,n)=>{let[r,i]=[t[e],n[e]];if([r,i].every(e=>typeof e==`object`&&!!e))return Object.keys(i).some(e=>r[e]===void 0)?Object.freeze({...i,...r}):void 0};function Oe(e,t,n=`module`){let r;for(let i of Object.keys(be))if(Ce.includes(i)&&Te(e,i)!==void 0&&Te(t,i)!==void 0){Ee(i,e,t,n);let a=De(i,e,t);a&&((r??={})[i]=a)}else e[i]===void 0&&t[i]!==void 0&&((r??={})[i]=t[i]);for(let n of b)t[n]===void 0||Object.keys(t[n]).every(t=>Object.hasOwn(e[n]??{},t))||((r??={})[n]=Object.freeze(D([...Object.entries(t[n]),...Object.entries(e[n]??{})])));return r===void 0?e:S({...e,...r})}function ke(e,t,n,r,i){let a={};for(let[i,o]of Object.entries(be))a[i]=r.includes(i)?o(e,t,n):void 0;for(let o of b)a[o]=r.includes(o)?ye(o,e,{...t,[o]:i(o)},n):void 0;return a}function Ae(e,t,n,r=x){let{name:i,version:a,ecosystem:o}=e;C(o===void 0||typeof o==`string`),E(e.files)||C(!1,`${n}: module '${t}' files must be an object`);let s=D(Object.entries(e.files));return S({name:i,version:a??void 0,ecosystem:o,...ke(t,{...e,files:s},n,r,t=>e[t]),files:s})}function je(e,{scope:t=`full`}={}){let n=new Set;for(let[r,{files:i}]of e)if(t===`full`||M(r))for(let e of Object.keys(i))n.add(m(r,e));return n}function Me(e,{what:t,files:n,formats:r,scope:i}){if(e.includes(`\\`))return`holds a '\\'`;if(k(e))return`escapes the root`;if(i!==`full`&&!M(e))return`is outside node_modules, which a '${i}'-scope ${t} does not record`;if(!n.has(e))return`names no file the ${t} records`;let a=r.get(e);return a===`directory`?`is a directory capture, not a file`:l(a)?`is a payload-free '${a}' record, not a file`:null}function Ne(e,{what:t,files:n,formats:r,scope:i}){for(let a of e){let e=Me(a,{what:t,files:n,formats:r,scope:i});C(e===null,`${t}: executable entry '${a}' ${e}`)}}function Pe(e,t,n,r){C(Array.isArray(e),`${t} must be an array of file paths`);let i=new Set;for(let t of e)r(t),C(!i.has(t),`${n} '${t}' is listed twice`),i.add(t);return i}function Fe(e,{what:t,files:n,formats:r,scope:i=`full`}){if(e===void 0)return new Set;let a=`${t}: executable entry`,o=Pe(e,`${t}: executable`,a,e=>C(typeof e==`string`&&e!==``,`${a} must be a non-empty string`));return Ne(o,{what:t,files:n,formats:r,scope:i}),o}function Ie(e,{what:t,modules:n,formats:r,scope:i}){if(e.size!==0)return Ne(e,{what:t,files:je(n,{scope:i}),formats:r,scope:i}),O(e)}function C(e,t){if(!e)throw Error(t)}var Le=`stasis.lock.json`,Re=new Set([`node_modules`,`full`]),ze=(e,t)=>C(Re.has(e),`${t} scope must be node_modules or full, got ${JSON.stringify(e)}`),Be=e=>{let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();return t===Le||t.endsWith(`.${Le}`)},Ve=/(?:^|\/)(?:\.git(?:\/|$)|(?:\.npm-extension\.[cm]?[jt]s|\.?pnpmfile\.[cm]?[jt]s|\.npmrc|\.yarnrc(?:\.yml)?|\.?bunfig\.toml|\.pnp\.(?:c?js|loader\.mjs|data\.json))$)/iu,He=/(?:^|\/)node_modules\/(?:[^/]*\/)*(?:pnpm-workspace\.yaml|\.env\.[^/]*|[^/]*\.env)$/iu,Ue=e=>Be(e)||Ve.test(e)||He.test(e);function We(e,t){let n=0;for(;n<e.length&&e[n]===t[n];)n++;let r=e.length-n,i=t.length-n;if(r===0&&i===0)return 0;if(r<2)return i<2&&(e[n]??``)>(t[n]??``)?1:-1;if(i<2)return 1;if(e[n]===`*`)return-1;if(t[n]===`*`||e[n]===`node_modules`)return 1;if(t[n]===`node_modules`)return-1;let a=e.slice(n).join(`\0`),o=t.slice(n).join(`\0`);if(a<o)return-1;if(a>o)return 1;throw Error(`Unreachable`)}var w=(e,t=e=>e)=>Array.from(e,e=>({item:e,segments:t(e).split(`/`)})).toSorted((e,t)=>We(e.segments,t.segments)).map(({item:e})=>e),T=([e])=>e;function E(e){if(!e)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}var D=e=>Object.setPrototypeOf(Object.fromEntries(e),null),O=e=>w(e),Ge=(e,{sorted:t=!0}={})=>D((t?w(e,T):[...e]).map(([e,n])=>[e,n instanceof Map?Ge(n,{sorted:t}):n]));function Ke(e,t,n){let r=e.get(t);return r===void 0&&e.set(t,r=n()),r}var qe=(e,t)=>Ke(e,t,()=>new Map),Je=e=>new Map(Object.entries(e).map(([e,t])=>[e,E(t)?Je(t):t]));function k(e){if(e.startsWith(`/`))return!0;if(!e.includes(`..`))return!1;let t=0;for(let n of e.split(`/`))if(n!==`.`&&n!==``){if(n!==`..`)t++;else if(--t<0)return!0}return!1}var Ye=e=>e.includes(`\\`)||k(e),A=(e,t)=>C(!Ye(e),`${t}: path '${e}' escapes the root or holds a '\\'`),Xe=e=>typeof e==`string`&&e!==``&&!Ye(e),Ze=(e,t)=>C(Xe(e),`${t}: invalid entry ${JSON.stringify(e)}`),Qe=(e,t)=>Pe(e,`${t}: entries`,`${t}: entry`,e=>Ze(e,t));function $e(e,t){for(let n of e)Ze(n,t);return O(e)}function et(e,t){A(e,`formats`),C(c.has(t),`unknown format '${t}' for ${e}`)}function tt(e){C(E(e));let t=new Map;for(let[n,r]of Object.entries(e)){et(n,r);let e=n===``?`.`:n;C(!t.has(e),`duplicate format key '${e}'`),t.set(e,r)}return t}function nt(e,t,n){for(let[r,i]of e)l(i)&&t.has(r)&&C(!1,`${n}: '${r}' is a payload-free '${i}' record, yet carries content`)}function rt(e){for(let[t,n]of e)et(t,n);return Ge(e)}function it(e){for(let[,t]of e){C(t instanceof Map);for(let[e,n]of t){A(e,`imports`),C(n instanceof Map);for(let[,e]of n){if(typeof e==`string`){A(e,`imports`);continue}C(e instanceof Map&&e.size>0,`import target must be a file or a non-empty {platform: file} map`);for(let[t,n]of e)C(typeof t==`string`&&t.length>0&&!t.includes(`/`),`invalid platform key '${t}'`),C(typeof n==`string`),A(n,`imports`)}}}}function at(e){C(E(e));let t=Je(e);return it(t),t}function ot(e){return it(e),Ge(e)}function st(e,{skipEmpty:t=!1,metadata:n=!0,what:r}={}){let i=n===!0?x:n===!1?[]:n,a={modules:[],sources:[]};for(let[n,o]of e){if(t&&Object.keys(o.files).length===0)continue;let e=M(n);e&&C(o.name&&o.version&&o.files);let s=D(w(Object.entries(o.files),T));a[e?`modules`:`sources`].push([n,S({...o,...ke(n,{...o,files:s},r,i,e=>ve(o[e],s)),files:s})])}return{modules:D(w(a.modules,T)),sources:D(w(a.sources,T))}}function ct(e,t,n){let r=new Map;for(let i of e.config.scope===`full`?[`modules`,`sources`]:[`modules`]){if(i===`modules`&&e.modules===void 0)continue;C(E(e[i]),`${t}: ${i} must be an object`);let a=i===`modules`;for(let[o,s]of Object.entries(e[i]))C(M(o)===a),A(o,t),C(s?.name&&(s.version||!a)&&s.files),r.set(o,Ae(s,o,t,n))}return r}function lt({config:{scope:e},entries:t,modules:n,formats:r,imports:i,executable:a},o,s){let c=e===`full`,l=st(n,{...s,what:o});return{entries:c?$e(t,o):void 0,sources:c?l.sources:void 0,modules:l.modules,formats:r===null?void 0:rt(r),imports:i===null?void 0:ot(i),executable:Ie(a,{what:o,modules:n,formats:r??new Map,scope:e})}}function ut(e,t){return!(e instanceof Map)||!(t instanceof Map)?e===t:e.size===t.size&&e.entries().every(([e,n])=>t.get(e)===n)}var dt=e=>e instanceof Map?`{${[...e].map(([e,t])=>`${e}: ${t}`).join(`, `)}}`:e;function ft(e,t,n){let r=new Map;for(let i of[e,t])for(let[e,t]of i){let i=qe(r,e);for(let[e,r]of t){let t=qe(i,e);for(let[i,a]of r)t.has(i)?C(ut(t.get(i),a),`${n}: import '${i}' from '${e}' resolves differently ('${dt(t.get(i))}' vs '${dt(a)}')`):t.set(i,a instanceof Map?new Map(a):a)}}return r}function pt(e,t,n){let r=e.get(t);e.set(t,r===void 0?n:p(n,r,t))}function mt(e,t,n){let r=new Map;try{for(let n of[e,t])for(let[e,t]of n)pt(r,e,t)}catch(e){throw Error(`${n}: ${e.message}`,{cause:e})}return r}var ht=(e,t,n,r)=>e.size===0?new Set(t):new Set(t).union(e.difference(je(n,{scope:r}))),gt=/(?:^|\/)\.{0,2}(?:\/|$)/u;function j(e,t,n){let r=m(e,t);return(r!==`.`||t!==``)&&gt.test(r)&&C(!1,`${n}: non-canonical file key ${JSON.stringify(r)}`),r.includes(`\\`)&&C(!1,`${n}: file key '${r}' holds a '\\', which no path may`),r}function _t(e,t,n){let r=new Map;for(let[i,{files:a}]of e){typeof i!=`string`&&C(!1,`${t}: bucket dir ${String(i)} is not a string`),A(i,t);for(let e of Object.keys(a)){let a=j(i,e,t),o=r.get(a);o!==void 0&&n(a,o,i),r.set(a,i)}}return r}var vt=(e,t)=>n=>C(!1,`duplicate file key '${n}' across ${e} buckets -- module bucketing changed between writes (a workspace package without a version now owns its own bucket); regenerate the ${t}`);function yt(e,t,n,{held:r=!1}={}){let i=new Map;for(let a of[e,t])for(let[e,t]of a){let a=i.get(e);if(a===void 0){i.set(e,S({...t,files:Object.assign(Object.create(null),t.files)}));continue}C(a.name===t.name,`${n}: module '${e}' name mismatch ('${a.name}' vs '${t.name}')`),C(a.version===t.version,`${n}: module '${e}' version mismatch ('${a.version}' vs '${t.version}')`+(a.version==null==(t.version==null)?``:` -- an artifact from an older stasis may record a placeholder version for a workspace package without one; regenerate it (bundle=replace / lock=replace)`)),C(a.ecosystem===t.ecosystem,`${n}: module '${e}' ecosystem mismatch ('${a.ecosystem??`(none)`}' vs '${t.ecosystem??`(none)`}')`),i.set(e,Oe(a,t,`${n}: module '${e}'`));for(let i of Ce){if(a[i]===void 0==(t[i]===void 0)||r&&a[i]===void 0)continue;let[o,s]=a[i]===void 0?[t,a]:[a,t],c=Object.keys(s.files).find(e=>!Object.hasOwn(o.files,e));c!==void 0&&C(!1,`${n}: module '${e}' ${i} is recorded of one side's files, not of '${m(e,c)}' the other adds`)}for(let[r,i]of Object.entries(t.files))Object.hasOwn(a.files,r)?C(a.files[r]===i,`${n}: content mismatch for '${m(e,r)}'`):a.files[r]=i}return _t(i,n,(e,t,r)=>C(!1,`${n}: file '${e}' is bucketed under both '${t}' and '${r}' -- module bucketing changed between the artifacts (a workspace package without a version now owns its own bucket); regenerate the artifact (bundle=replace / lock=replace)`)),i}var M=e=>e===`node_modules`||e.startsWith(`node_modules/`)||e.endsWith(`/node_modules`)||e.includes(`/node_modules/`),bt=`node_modules/`;function xt(e){let t=e.length;for(;(t=e.lastIndexOf(bt,t-1))!==-1;)if(t===0||e[t-1]===`/`)return t;return-1}function St(e){let t=xt(e);if(t===-1)return null;let n=t+bt.length,r=e.slice(n).split(`/`),i=r[0].startsWith(`@`)?2:1,a=r.slice(0,i);if(r.length<=i||a.includes(``))return null;let o=a.join(`/`);return{dir:e.slice(0,n)+o,rel:r.slice(i).join(`/`),name:o}}var N=1,Ct=0,wt=vt(`bundle`,`artifact (bundle=replace)`),Tt=(e,t)=>{let n=_t(e,`bundle`,wt);for(let e of n.keys())C(!Ue(e),`bundle: ${e} is a file no bundle may carry`);return nt(t,n,`bundle`),n},Et=e=>St(e)??{dir:`.`,rel:e===`.`?``:e,name:null};function Dt(e){C(E(e),`bundle: sources must be an object`);let t=new Map;for(let[n,r]of Object.entries(e)){A(n,`bundle`);let{dir:e,rel:i,name:a}=Et(n);C(!k(e)&&!k(i));let{files:o}=Ke(t,e,()=>({name:a,version:null,files:Object.create(null)}));C(!Object.hasOwn(o,i),`bundle: duplicate file key '.' (v0 '' and '.')`),o[i]=r}return t}function Ot(){throw Error(`bundle: file contents are not retained by this contents-free Bundle`)}var kt=(e,{files:t,...n})=>{let r=Object.create(null);for(let[n,i]of Object.entries(t))typeof i!=`symbol`&&C(!1,`bundle: file '${m(e,n)}' is not a placeholder`),Object.defineProperty(r,n,{get:Ot,enumerable:!0});return{...n,files:Object.freeze(r)}},P=(e,t)=>{if(e===void 0&&t===void 0)return;let n=new Map;for(let r of[e,t])for(let[e,t]of Object.entries(r??{}))Array.isArray(t)&&n.set(e,new Set([...n.get(e)??[],...t]));return D([...n.keys()].toSorted().map(e=>[e,O(n.get(e))]))},At=(e,t)=>Object.hasOwn(g,e)&&g[e](t),jt=(e,t)=>e?.github===void 0||!ne(e.github,t?.github)?void 0:D(Object.keys(g).filter(n=>e[n]!==void 0&&(n===`github`||e[n]===t[n])).map(t=>[t,e[t]])),Mt=e=>{if(!E(e)||e.root!==!0||Object.hasOwn(e,`directory`))return e;let{root:t,...n}=e;return n},Nt={npm:y,composer:y,cargo:y},Pt=(e,t)=>D(Object.keys(Nt).map(n=>{let[r,i]=[e?.[n],t?.[n]];return[n,r?.name!==void 0&&r.name===i?.name?D(Object.entries(r).filter(([e,t])=>t===i[e])):void 0]})),F=class e{static VERSION=N;#e;get repo(){return this.#e}set repo(e){this.#e=re(e)}#t;get package(){return this.#t}set package(e){this.#t=_(e,Nt,`bundle package`)}constructor({config:e={scope:`full`},entries:t,modules:n,formats:r,imports:i,executable:a,reason:o,repo:s,package:c,version:l=N}={}){C([Ct,N].includes(l)),ze(e.scope,`bundle`),this.version=l,this.config=e,this.entries=t??new Set,this.modules=n??new Map,this.formats=r??new Map,this.imports=i??new Map,this.executable=a??new Set,this.reason=o,this.repo=s,this.package=c}get sources(){let e=new Map;for(let[t,{files:n}]of this.modules)for(let[r,i]of Object.entries(n))e.set(m(t,r),i);return e}static isResourceFormat(e){return o.has(e)||e===`directory`}get hasCode(){return this.modules.entries().some(([t,{files:n}])=>Object.keys(n).some(n=>!e.isResourceFormat(this.formats.get(m(t,n)))))}static parse(t){return e.fromJSON(JSON.parse(t))}static fileKeyAt(e){let[t,n,r,i]=e;if(typeof n==`string`){if(e.length===2&&t===`sources`){let e=Et(n);return j(e.dir,e.rel,`bundle`)}if(e.length===4&&(t===`sources`||t===`modules`)&&r===`files`&&typeof i==`string`)return j(n,i,`bundle`)}}static fromJSON(t,{contents:n=!0}={}){C(t.version===N||t.version===Ct),ze(t.config?.scope,`bundle`);let r=tt(t.formats),i=t.version===N;i&&t.config.scope!==`full`&&C(t.entries===void 0&&t.sources===void 0);let a=i?ct(t,`bundle`):Dt(t.sources),o=Tt(a,r),s=at(t.imports);if(!n)for(let[e,t]of a)a.set(e,kt(e,t));return new e({version:t.version,config:t.config,entries:i&&t.entries!==void 0?Qe(t.entries,`bundle`):new Set,modules:a,formats:r,imports:s,executable:i?Fe(t.executable,{what:`bundle`,files:o,formats:r,scope:t.config.scope}):new Set,reason:E(t.reason)?t.reason:void 0,repo:Mt(t.repo),package:t.package})}serialize(){return JSON.stringify(this.#n(),void 0,2)}serializedBytes(){let e=this.#n(),t=Object.keys(e.modules);if(t.length===0)return Buffer.from(JSON.stringify(e,void 0,2));let{modules:n,...r}=e,i=JSON.stringify(r,void 0,2);C(i.endsWith(`
1
+ import{a as e}from"./chunk-QRKFPLA4.js";import{b as t}from"./chunk-TUII34K2.js";var n=new Set([`module`,`commonjs`,`json`,`module-typescript`,`commonjs-typescript`]),r=new Set([`solidity`,`php`,`shell`,`rust`,`teal`]),i=new Set([`java`,`kotlin`,`gradle`,`objc`,`objcpp`,`swift`,`c`,`cpp`,`c-header`,`cpp-header`,`ruby`,`python`,`cmake`,`podspec`,`podfile`,`podfile-lock`,`gemfile`,`gemfile-lock`,`template`,`xml`,`env`,`fastlane`,`pbxproj`]),a=new Set([`generic-javascript`,`generic-typescript`]),o=new Set([`resource`,`resource:base64`]),s=new Set([`stat:file`,`stat:directory`]),c=new Set([...n,...r,...i,...a,...o,`patch`,`directory`,...s]),l=e=>s.has(e),u=e=>e===`directory`||e===`stat:directory`?`directory`:`file`,d=new Set([`module`,`commonjs`,`module-typescript`,`commonjs-typescript`]),f=(e,t)=>a.has(e)&&d.has(t);function p(e,t,n){if(e===t)return e;if(f(e,t))return t;if(f(t,e))return e;let r=l(e);if(r!==l(t)&&u(e)===u(t))return r?t:e;throw Error(`format conflict for '${n}' ('${t}' vs '${e}')`)}var m=(e,t)=>t===``?e:e===`.`?t:`${e}/${t}`,h=/^(?=[A-Za-z0-9-]{1,39}\/)[A-Za-z0-9](?:-?[A-Za-z0-9])*\/(?!\.\.?$)[\w.-]{1,100}$/u,ee=/^(?!\.\.?(?:\/|$))[\w.~@+-]+(?:\/(?!\.\.?(?:\/|$))[\w.~@+-]+)*$/u,te=/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/u,g={github:e=>typeof e==`string`&&h.test(e),directory:e=>typeof e==`string`&&e.length<=1024&&(e===``||ee.test(e)),commit:e=>typeof e==`string`&&te.test(e)},ne=(e,t)=>e?.toLowerCase()===t?.toLowerCase(),_=(e,t,n)=>{if(e===void 0)return;E(e)||C(!1,`${n} must be an object`);for(let r of Object.keys(e))Object.hasOwn(t,r)||C(!1,`unknown ${n} key '${r}'`);let r=Object.entries(t).map(([t,r])=>typeof r==`object`?[t,_(e[t],r,`${n}.${t}`)]:(e[t]!==void 0&&!r(e[t])&&C(!1,`invalid ${n}.${t}: ${JSON.stringify(e[t])}`),[t,e[t]])).filter(([,e])=>e!==void 0);return r.length===0?void 0:Object.freeze(D(r))},re=(e,t=`bundle repo`)=>_(e,g,t),v=(e,t)=>t??(M(e)?`npm`:void 0),ie=(e,t,n,r,i)=>(a,{ecosystem:o,[e]:s},c)=>{if(s===void 0)return;r(a,o)||C(!1,`${c}: '${a}' is no ${i} bucket, and carries no ${e}`);let l=_(s,t,`${c} module '${a}' ${e}`);return l?.[n]===void 0&&C(!1,`${c} module '${a}' ${e} has no ${n}`),l},ae=ie(`repo`,g,`github`,(e,t)=>v(e,t)!==void 0,`dependency's`),oe={sha1:/^sha1-[A-Za-z\d+/]{27}=$/u,sha256:/^sha256-[A-Za-z\d+/]{43}=$/u,sha512:/^sha512-[A-Za-z\d+/]{86}==$/u},se=/^(?:\.\.\/)*(?!\.\.?(?:\/|$))[^/\\\p{Cc}]+(?:\/(?!\.\.?(?:\/|$))[^/\\\p{Cc}]+)*$/u,ce={integrity:e=>typeof e==`string`&&oe.sha256.test(e),file:e=>typeof e==`string`&&e.length<=4096&&se.test(e)},le=(e,t)=>M(e)&&v(e,t)===`npm`,ue={npm:`sha512`,cargo:`sha256`,composer:`sha1`,soldeer:`sha256`},de=(e,{ecosystem:t,integrity:n},r)=>{if(n===void 0)return;let i=v(e,t);return(!Object.hasOwn(ue,i)||i===`npm`&&!M(e))&&C(!1,`${r}: '${e}' is no npm, cargo, composer or soldeer dependency's bucket, and carries no integrity`),typeof n==`string`&&oe[ue[i]].test(n)||C(!1,`invalid ${r} module '${e}' integrity: ${JSON.stringify(n)}`),n},fe=ie(`patch`,ce,`integrity`,le,`npm dependency's`),pe=e=>typeof e==`string`&&/^[\w.+@/~'!()*-]+$/u.test(e),y={name:pe,version:pe},me=e=>typeof e==`string`&&e!==``&&!e.includes(`\\`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e!==`node_modules`),he=(e,t,n)=>typeof e==`string`&&me(n)&&e===`${t}/${n}`,ge={vendored:()=>!0,subpackages:(e,t,n)=>he(e.name,t,n)},_e=(e,t)=>{for(let n=t.lastIndexOf(`/`);n>0;n=t.lastIndexOf(`/`,n-1))if(Object.hasOwn(e,t.slice(0,n)))return t.slice(0,n)};function ve(e,t){if(e===void 0)return;let n=new Set(Object.keys(t).map(t=>_e(e,t)).filter(e=>e!==void 0));return n.size===0?void 0:Object.freeze(D(w(n).map(t=>[t,e[t]])))}var ye=(e,t,{name:n,ecosystem:r,files:i,[e]:a},o)=>{if(a===void 0)return;v(t,r)===void 0&&C(!1,`${o}: '${t}' is no dependency's bucket, and carries no ${e}`),E(a)||C(!1,`${o} module '${t}' ${e} must be an object`);let s=D(Object.entries(a).map(([r,i])=>{me(r)||C(!1,`${o} module '${t}' ${e}: invalid directory ${JSON.stringify(r)}`);let a=_(i,y,`${o} module '${t}' ${e} '${r}'`);return a?.name===void 0&&C(!1,`${o} module '${t}' ${e} '${r}' has no name`),ge[e](a,n,r)||C(!1,`${o} module '${t}' ${e} '${r}' is named '${a.name}', not '${n}/${r}'`),[r,a]})),c=ve(s,i),l=Object.keys(s).find(e=>!Object.hasOwn(c??{},e));return l!==void 0&&C(!1,`${o} module '${t}' ${e} '${l}' holds none of its files`),c},be={integrity:de,patch:fe,repo:ae},b=Object.keys(ge),x=[...Object.keys(be),...b],xe=[`ecosystem`,...x],S=e=>{let t={name:e.name,version:e.version};for(let n of xe)e[n]!==void 0&&(t[n]=e[n]);return t.files=e.files,t},Se={integrity:(e,t)=>e===t,patch:(e,t)=>e?.integrity===t?.integrity&&(e?.file===void 0||t?.file===void 0||e.file===t.file)},Ce=Object.keys(Se),we=(e,t,n)=>Se[e](t,n),Te=(e,t)=>e[t]??(t===`patch`&&e.integrity!==void 0?null:void 0),Ee=(e,t,n,r)=>{if(we(e,t[e],n[e]))return;let[i,a]=[t[e],n[e]].map(e=>JSON.stringify(e)??`none`);C(!1,`${r} ${e} mismatch (${i} vs ${a})`)},De=(e,t,n)=>{let[r,i]=[t[e],n[e]];if([r,i].every(e=>typeof e==`object`&&!!e))return Object.keys(i).some(e=>r[e]===void 0)?Object.freeze({...i,...r}):void 0};function Oe(e,t,n=`module`){let r;for(let i of Object.keys(be))if(Ce.includes(i)&&Te(e,i)!==void 0&&Te(t,i)!==void 0){Ee(i,e,t,n);let a=De(i,e,t);a&&((r??={})[i]=a)}else e[i]===void 0&&t[i]!==void 0&&((r??={})[i]=t[i]);for(let n of b)t[n]===void 0||Object.keys(t[n]).every(t=>Object.hasOwn(e[n]??{},t))||((r??={})[n]=Object.freeze(D([...Object.entries(t[n]),...Object.entries(e[n]??{})])));return r===void 0?e:S({...e,...r})}function ke(e,t,n,r,i){let a={};for(let[i,o]of Object.entries(be))a[i]=r.includes(i)?o(e,t,n):void 0;for(let o of b)a[o]=r.includes(o)?ye(o,e,{...t,[o]:i(o)},n):void 0;return a}function Ae(e,t,n,r=x){let{name:i,version:a,ecosystem:o}=e;C(o===void 0||typeof o==`string`),E(e.files)||C(!1,`${n}: module '${t}' files must be an object`);let s=D(Object.entries(e.files));return S({name:i,version:a??void 0,ecosystem:o,...ke(t,{...e,files:s},n,r,t=>e[t]),files:s})}function je(e,{scope:t=`full`}={}){let n=new Set;for(let[r,{files:i}]of e)if(t===`full`||M(r))for(let e of Object.keys(i))n.add(m(r,e));return n}function Me(e,{what:t,files:n,formats:r,scope:i}){if(e.includes(`\\`))return`holds a '\\'`;if(k(e))return`escapes the root`;if(i!==`full`&&!M(e))return`is outside node_modules, which a '${i}'-scope ${t} does not record`;if(!n.has(e))return`names no file the ${t} records`;let a=r.get(e);return a===`directory`?`is a directory capture, not a file`:l(a)?`is a payload-free '${a}' record, not a file`:null}function Ne(e,{what:t,files:n,formats:r,scope:i}){for(let a of e){let e=Me(a,{what:t,files:n,formats:r,scope:i});C(e===null,`${t}: executable entry '${a}' ${e}`)}}function Pe(e,t,n,r){C(Array.isArray(e),`${t} must be an array of file paths`);let i=new Set;for(let t of e)r(t),C(!i.has(t),`${n} '${t}' is listed twice`),i.add(t);return i}function Fe(e,{what:t,files:n,formats:r,scope:i=`full`}){if(e===void 0)return new Set;let a=`${t}: executable entry`,o=Pe(e,`${t}: executable`,a,e=>C(typeof e==`string`&&e!==``,`${a} must be a non-empty string`));return Ne(o,{what:t,files:n,formats:r,scope:i}),o}function Ie(e,{what:t,modules:n,formats:r,scope:i}){if(e.size!==0)return Ne(e,{what:t,files:je(n,{scope:i}),formats:r,scope:i}),O(e)}function C(e,t){if(!e)throw Error(t)}var Le=`stasis.lock.json`,Re=new Set([`node_modules`,`full`]),ze=(e,t)=>C(Re.has(e),`${t} scope must be node_modules or full, got ${JSON.stringify(e)}`),Be=e=>{let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();return t===Le||t.endsWith(`.${Le}`)},Ve=/(?:^|\/)(?:\.git(?:\/|$)|(?:\.npm-extension\.[cm]?[jt]s|\.?pnpmfile\.[cm]?[jt]s|\.npmrc|\.yarnrc(?:\.yml)?|\.?bunfig\.toml|\.pnp\.(?:c?js|loader\.mjs|data\.json))$)/iu,He=/(?:^|\/)node_modules\/(?:[^/]*\/)*(?:pnpm-workspace\.yaml|\.env\.[^/]*|[^/]*\.env)$/iu,Ue=e=>Be(e)||Ve.test(e)||He.test(e);function We(e,t){let n=0;for(;n<e.length&&e[n]===t[n];)n++;let r=e.length-n,i=t.length-n;if(r===0&&i===0)return 0;if(r<2)return i<2&&(e[n]??``)>(t[n]??``)?1:-1;if(i<2)return 1;if(e[n]===`*`)return-1;if(t[n]===`*`||e[n]===`node_modules`)return 1;if(t[n]===`node_modules`)return-1;let a=e.slice(n).join(`\0`),o=t.slice(n).join(`\0`);if(a<o)return-1;if(a>o)return 1;throw Error(`Unreachable`)}var w=(e,t=e=>e)=>Array.from(e,e=>({item:e,segments:t(e).split(`/`)})).toSorted((e,t)=>We(e.segments,t.segments)).map(({item:e})=>e),T=([e])=>e;function E(e){if(!e)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}var D=e=>Object.setPrototypeOf(Object.fromEntries(e),null),O=e=>w(e),Ge=(e,{sorted:t=!0}={})=>D((t?w(e,T):[...e]).map(([e,n])=>[e,n instanceof Map?Ge(n,{sorted:t}):n]));function Ke(e,t,n){let r=e.get(t);return r===void 0&&e.set(t,r=n()),r}var qe=(e,t)=>Ke(e,t,()=>new Map),Je=e=>new Map(Object.entries(e).map(([e,t])=>[e,E(t)?Je(t):t]));function k(e){if(e.startsWith(`/`))return!0;if(!e.includes(`..`))return!1;let t=0;for(let n of e.split(`/`))if(n!==`.`&&n!==``){if(n!==`..`)t++;else if(--t<0)return!0}return!1}var Ye=e=>e.includes(`\\`)||k(e),A=(e,t)=>C(!Ye(e),`${t}: path '${e}' escapes the root or holds a '\\'`),Xe=e=>typeof e==`string`&&e!==``&&!Ye(e),Ze=(e,t)=>C(Xe(e),`${t}: invalid entry ${JSON.stringify(e)}`),Qe=(e,t)=>Pe(e,`${t}: entries`,`${t}: entry`,e=>Ze(e,t));function $e(e,t){for(let n of e)Ze(n,t);return O(e)}function et(e,t){A(e,`formats`),C(c.has(t),`unknown format '${t}' for ${e}`)}function tt(e){C(E(e));let t=new Map;for(let[n,r]of Object.entries(e)){et(n,r);let e=n===``?`.`:n;C(!t.has(e),`duplicate format key '${e}'`),t.set(e,r)}return t}function nt(e,t,n){for(let[r,i]of e)l(i)&&t.has(r)&&C(!1,`${n}: '${r}' is a payload-free '${i}' record, yet carries content`)}function rt(e){for(let[t,n]of e)et(t,n);return Ge(e)}function it(e){for(let[,t]of e){C(t instanceof Map);for(let[e,n]of t){A(e,`imports`),C(n instanceof Map);for(let[,e]of n)if(typeof e==`string`)A(e,`imports`);else{C(e instanceof Map&&e.size>0,`import target must be a file or a non-empty {platform: file} map`);for(let[t,n]of e)C(typeof t==`string`&&t.length>0&&!t.includes(`/`),`invalid platform key '${t}'`),C(typeof n==`string`),A(n,`imports`)}}}}function at(e){C(E(e));let t=Je(e);return it(t),t}function ot(e){return it(e),Ge(e)}function st(e,{skipEmpty:t=!1,metadata:n=!0,what:r}={}){let i=n===!0?x:n===!1?[]:n,a={modules:[],sources:[]};for(let[n,o]of e){if(t&&Object.keys(o.files).length===0)continue;let e=M(n);e&&C(o.name&&o.version&&o.files);let s=D(w(Object.entries(o.files),T));a[e?`modules`:`sources`].push([n,S({...o,...ke(n,{...o,files:s},r,i,e=>ve(o[e],s)),files:s})])}return{modules:D(w(a.modules,T)),sources:D(w(a.sources,T))}}function ct(e,t,n){let r=new Map;for(let i of e.config.scope===`full`?[`modules`,`sources`]:[`modules`]){if(i===`modules`&&e.modules===void 0)continue;C(E(e[i]),`${t}: ${i} must be an object`);let a=i===`modules`;for(let[o,s]of Object.entries(e[i]))C(M(o)===a),A(o,t),C(s?.name&&(s.version||!a)&&s.files),r.set(o,Ae(s,o,t,n))}return r}function lt({config:{scope:e},entries:t,modules:n,formats:r,imports:i,executable:a},o,s){let c=e===`full`,l=st(n,{...s,what:o});return{entries:c?$e(t,o):void 0,sources:c?l.sources:void 0,modules:l.modules,formats:r===null?void 0:rt(r),imports:i===null?void 0:ot(i),executable:Ie(a,{what:o,modules:n,formats:r??new Map,scope:e})}}function ut(e,t){return!(e instanceof Map)||!(t instanceof Map)?e===t:e.size===t.size&&e.entries().every(([e,n])=>t.get(e)===n)}var dt=e=>e instanceof Map?`{${[...e].map(([e,t])=>`${e}: ${t}`).join(`, `)}}`:e;function ft(e,t,n){let r=new Map;for(let i of[e,t])for(let[e,t]of i){let i=qe(r,e);for(let[e,r]of t){let t=qe(i,e);for(let[i,a]of r)t.has(i)?C(ut(t.get(i),a),`${n}: import '${i}' from '${e}' resolves differently ('${dt(t.get(i))}' vs '${dt(a)}')`):t.set(i,a instanceof Map?new Map(a):a)}}return r}function pt(e,t,n){let r=e.get(t);e.set(t,r===void 0?n:p(n,r,t))}function mt(e,t,n){let r=new Map;try{for(let n of[e,t])for(let[e,t]of n)pt(r,e,t)}catch(e){throw Error(`${n}: ${e.message}`,{cause:e})}return r}var ht=(e,t,n,r)=>e.size===0?new Set(t):new Set(t).union(e.difference(je(n,{scope:r}))),gt=/(?:^|\/)\.{0,2}(?:\/|$)/u;function j(e,t,n){let r=m(e,t);return(r!==`.`||t!==``)&&gt.test(r)&&C(!1,`${n}: non-canonical file key ${JSON.stringify(r)}`),r.includes(`\\`)&&C(!1,`${n}: file key '${r}' holds a '\\', which no path may`),r}function _t(e,t,n){let r=new Map;for(let[i,{files:a}]of e){typeof i!=`string`&&C(!1,`${t}: bucket dir ${String(i)} is not a string`),A(i,t);for(let e of Object.keys(a)){let a=j(i,e,t),o=r.get(a);o!==void 0&&n(a,o,i),r.set(a,i)}}return r}var vt=(e,t)=>n=>C(!1,`duplicate file key '${n}' across ${e} buckets -- module bucketing changed between writes (a workspace package without a version now owns its own bucket); regenerate the ${t}`);function yt(e,t,n,{held:r=!1}={}){let i=new Map;for(let a of[e,t])for(let[e,t]of a){let a=i.get(e);if(a===void 0)i.set(e,S({...t,files:Object.assign(Object.create(null),t.files)}));else{C(a.name===t.name,`${n}: module '${e}' name mismatch ('${a.name}' vs '${t.name}')`),C(a.version===t.version,`${n}: module '${e}' version mismatch ('${a.version}' vs '${t.version}')`+(a.version==null==(t.version==null)?``:` -- an artifact from an older stasis may record a placeholder version for a workspace package without one; regenerate it (bundle=replace / lock=replace)`)),C(a.ecosystem===t.ecosystem,`${n}: module '${e}' ecosystem mismatch ('${a.ecosystem??`(none)`}' vs '${t.ecosystem??`(none)`}')`),i.set(e,Oe(a,t,`${n}: module '${e}'`));for(let i of Ce){if(a[i]===void 0==(t[i]===void 0)||r&&a[i]===void 0)continue;let[o,s]=a[i]===void 0?[t,a]:[a,t],c=Object.keys(s.files).find(e=>!Object.hasOwn(o.files,e));c!==void 0&&C(!1,`${n}: module '${e}' ${i} is recorded of one side's files, not of '${m(e,c)}' the other adds`)}for(let[r,i]of Object.entries(t.files))Object.hasOwn(a.files,r)?C(a.files[r]===i,`${n}: content mismatch for '${m(e,r)}'`):a.files[r]=i}}return _t(i,n,(e,t,r)=>C(!1,`${n}: file '${e}' is bucketed under both '${t}' and '${r}' -- module bucketing changed between the artifacts (a workspace package without a version now owns its own bucket); regenerate the artifact (bundle=replace / lock=replace)`)),i}var M=e=>e===`node_modules`||e.startsWith(`node_modules/`)||e.endsWith(`/node_modules`)||e.includes(`/node_modules/`),bt=`node_modules/`;function xt(e){let t=e.length;for(;(t=e.lastIndexOf(bt,t-1))!==-1;)if(t===0||e[t-1]===`/`)return t;return-1}function St(e){let t=xt(e);if(t===-1)return null;let n=t+bt.length,r=e.slice(n).split(`/`),i=r[0].startsWith(`@`)?2:1,a=r.slice(0,i);if(r.length<=i||a.includes(``))return null;let o=a.join(`/`);return{dir:e.slice(0,n)+o,rel:r.slice(i).join(`/`),name:o}}var N=1,Ct=0,wt=vt(`bundle`,`artifact (bundle=replace)`),Tt=(e,t)=>{let n=_t(e,`bundle`,wt);for(let e of n.keys())C(!Ue(e),`bundle: ${e} is a file no bundle may carry`);return nt(t,n,`bundle`),n},Et=e=>St(e)??{dir:`.`,rel:e===`.`?``:e,name:null};function Dt(e){C(E(e),`bundle: sources must be an object`);let t=new Map;for(let[n,r]of Object.entries(e)){A(n,`bundle`);let{dir:e,rel:i,name:a}=Et(n);C(!k(e)&&!k(i));let{files:o}=Ke(t,e,()=>({name:a,version:null,files:Object.create(null)}));C(!Object.hasOwn(o,i),`bundle: duplicate file key '.' (v0 '' and '.')`),o[i]=r}return t}function Ot(){throw Error(`bundle: file contents are not retained by this contents-free Bundle`)}var kt=(e,{files:t,...n})=>{let r=Object.create(null);for(let[n,i]of Object.entries(t))typeof i!=`symbol`&&C(!1,`bundle: file '${m(e,n)}' is not a placeholder`),Object.defineProperty(r,n,{get:Ot,enumerable:!0});return{...n,files:Object.freeze(r)}},P=(e,t)=>{if(e===void 0&&t===void 0)return;let n=new Map;for(let r of[e,t])for(let[e,t]of Object.entries(r??{}))Array.isArray(t)&&n.set(e,new Set([...n.get(e)??[],...t]));return D([...n.keys()].toSorted().map(e=>[e,O(n.get(e))]))},At=(e,t)=>Object.hasOwn(g,e)&&g[e](t),jt=(e,t)=>e?.github===void 0||!ne(e.github,t?.github)?void 0:D(Object.keys(g).filter(n=>e[n]!==void 0&&(n===`github`||e[n]===t[n])).map(t=>[t,e[t]])),Mt=e=>{if(!E(e)||e.root!==!0||Object.hasOwn(e,`directory`))return e;let{root:t,...n}=e;return n},Nt={npm:y,composer:y,cargo:y},Pt=(e,t)=>D(Object.keys(Nt).map(n=>{let[r,i]=[e?.[n],t?.[n]];return[n,r?.name!==void 0&&r.name===i?.name?D(Object.entries(r).filter(([e,t])=>t===i[e])):void 0]})),F=class e{static VERSION=N;#e;get repo(){return this.#e}set repo(e){this.#e=re(e)}#t;get package(){return this.#t}set package(e){this.#t=_(e,Nt,`bundle package`)}constructor({config:e={scope:`full`},entries:t,modules:n,formats:r,imports:i,executable:a,reason:o,repo:s,package:c,version:l=N}={}){C([Ct,N].includes(l)),ze(e.scope,`bundle`),this.version=l,this.config=e,this.entries=t??new Set,this.modules=n??new Map,this.formats=r??new Map,this.imports=i??new Map,this.executable=a??new Set,this.reason=o,this.repo=s,this.package=c}get sources(){let e=new Map;for(let[t,{files:n}]of this.modules)for(let[r,i]of Object.entries(n))e.set(m(t,r),i);return e}static isResourceFormat(e){return o.has(e)||e===`directory`}get hasCode(){return this.modules.entries().some(([t,{files:n}])=>Object.keys(n).some(n=>!e.isResourceFormat(this.formats.get(m(t,n)))))}static parse(t){return e.fromJSON(JSON.parse(t))}static fileKeyAt(e){let[t,n,r,i]=e;if(typeof n==`string`){if(e.length===2&&t===`sources`){let e=Et(n);return j(e.dir,e.rel,`bundle`)}if(e.length===4&&(t===`sources`||t===`modules`)&&r===`files`&&typeof i==`string`)return j(n,i,`bundle`)}}static fromJSON(t,{contents:n=!0}={}){C(t.version===N||t.version===Ct),ze(t.config?.scope,`bundle`);let r=tt(t.formats),i=t.version===N;i&&t.config.scope!==`full`&&C(t.entries===void 0&&t.sources===void 0);let a=i?ct(t,`bundle`):Dt(t.sources),o=Tt(a,r),s=at(t.imports);if(!n)for(let[e,t]of a)a.set(e,kt(e,t));return new e({version:t.version,config:t.config,entries:i&&t.entries!==void 0?Qe(t.entries,`bundle`):new Set,modules:a,formats:r,imports:s,executable:i?Fe(t.executable,{what:`bundle`,files:o,formats:r,scope:t.config.scope}):new Set,reason:E(t.reason)?t.reason:void 0,repo:Mt(t.repo),package:t.package})}serialize(){return JSON.stringify(this.#n(),void 0,2)}serializedBytes(){let e=this.#n(),t=Object.keys(e.modules);if(t.length===0)return Buffer.from(JSON.stringify(e,void 0,2));let{modules:n,...r}=e,i=JSON.stringify(r,void 0,2);C(i.endsWith(`
2
2
  }`));let a=[],o=e=>a.push(Buffer.from(e));o(i.slice(0,-2)),o(`,
3
3
  "modules": {
4
4
  `);for(let[e,r]of t.entries())e>0&&o(`,
5
5
  `),o(JSON.stringify({indent:{[r]:n[r]}},void 0,2).slice(16,-6));return o(`
6
6
  }
7
- }`),Buffer.concat(a)}#n(){Tt(this.modules,this.formats);let{entries:e,sources:t,modules:n,formats:r,imports:i,executable:a}=lt(this,`bundle`,{skipEmpty:!0});return{version:N,config:this.config,repo:this.repo,package:this.package,entries:e,formats:r,imports:i,executable:a,reason:P(this.reason,void 0),sources:t,modules:n}}withReason(t,n=[...this.sources.keys()]){let{version:r,config:i,entries:a,modules:o,formats:s,imports:c,executable:l,repo:u,package:d}=this,f=P(this.reason,{[t]:n});return new e({version:r,config:i,entries:a,modules:o,formats:s,imports:c,executable:l,reason:f,repo:u,package:d})}merge(t){return C(this.config.scope===t.config.scope,`bundle merge: scope mismatch ('${this.config.scope}' vs '${t.config.scope}')`),new e({config:{scope:this.config.scope},entries:new Set([...this.entries,...t.entries]),modules:yt(this.modules,t.modules,`bundle merge`),formats:mt(this.formats,t.formats,`bundle merge`),imports:ft(this.imports,t.imports,`bundle merge`),executable:ht(this.executable,t.executable,t.modules,this.config.scope),reason:P(this.reason,t.reason),repo:jt(this.repo,t.repo),package:Pt(this.package,t.package)})}},Ft={__proto__:null,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`jsx`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsx:`tsx`,json:`json`,css:`css`,html:`markup`,htm:`markup`,xml:`markup`,svg:`markup`,yml:`yaml`,yaml:`yaml`,sh:`bash`,bash:`bash`,md:`markdown`,markdown:`markdown`,sol:`solidity`,php:`php`,phtml:`php`,rs:`rust`,rb:`ruby`,py:`python`,pyw:`python`,pyi:`python`,java:`java`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,"c++":`cpp`,hpp:`cpp`,hh:`cpp`,hxx:`cpp`,"h++":`cpp`,h:`cpp`,c:`c`,m:`objectivec`,mm:`objectivec`},It={__proto__:null,module:`javascript`,commonjs:`javascript`,"module-typescript":`typescript`,"commonjs-typescript":`typescript`,json:`json`,solidity:`solidity`,php:`php`,shell:`bash`,rust:`rust`,java:`java`,objc:`objectivec`,objcpp:`objectivec`,c:`c`,"c-header":`c`,cpp:`cpp`,"cpp-header":`cpp`,ruby:`ruby`,podspec:`ruby`,podfile:`ruby`,fastlane:`ruby`,"podfile-lock":`yaml`,xml:`markup`};function Lt(e){if(typeof e!=`string`)return!1;let t=e.length-1,n=0;for(;n<t&&/\s/u.test(e[n]);)n++;for(;t>n&&/\s/u.test(e[t]);)t--;return n<t&&e[n]===`{`&&e[t]===`}`}function Rt(e,t,n){if(typeof t==`string`&&It[t])return It[t];if(typeof e!=`string`)return null;let r=e.slice(e.lastIndexOf(`/`)+1),i=r.lastIndexOf(`.`);if(i<=0)return null;let a=r.slice(i+1).toLowerCase();return a===`map`?Lt(n)?`json`:null:Ft[a]??null}var zt=/^webpack(?:-internal)?:\/\/[^/]*\//u,Bt=/^[a-z][\d+.a-z-]*:/iu,Vt=/^file:/iu,Ht=/^(?:file|ftp|https?|wss?):/iu,Ut=/^(?:[a-z][\d+.a-z-]*:\/\/[^/]*\/?|\/\/[^/]+\/|[a-z]:\/|\/)?/iu,I=e=>Ut.exec(e)[0],L=e=>I(e).includes(`://`),R=e=>e.replace(L(e)?/[#?].*$/su:/\?.*$/su,``),Wt=e=>e.slice(e.lastIndexOf(`/`)+1),z=(e,t)=>URL.parse(e,t)?.href??null;function B(e){let t=I(e),n=t.includes(`://`)&&z(e);if(n)return n;let r=[];for(let n of e.slice(t.length).split(`/`))n===``||n===`.`||(n===`..`?r.length>0&&r.at(-1)!==`..`?r.pop():t||r.push(`..`):r.push(n));let i=/^[a-z]:\/$/iu.test(t)?t.toUpperCase():t.startsWith(`//`)?t.toLowerCase():t;return i?i.replace(/\/?$/u,`/`)+r.join(`/`):r.join(`/`)||`.`}function Gt(e,t){let n=I(t);return L(e)&&!n.includes(`:`)?z(t,e)??B(`${e}/../${t}`):B(n===`/`?I(e).replace(/\/?$/u,``)+t:n?t:`${e}/../${t}`)}function Kt(e){try{return decodeURIComponent(e)}catch{return e}}function V(e,t){let n=e.replaceAll(`\\`,`/`);if(zt.test(n))return B(n.replace(zt,``));let r=Ht.test(n)?z(n)??n:n,i=/^file:\/\/([^/#]*)([^#]*)/isu.exec(r);if(i){let[,e,t]=i;return B(Kt(e&&e.toLowerCase()!==`localhost`?`//${e}${t}`:t).replace(/^\/(?=[a-z]:\/)/iu,``))}if(Bt.test(r)&&!I(r).includes(`:`))return r;if(t===void 0)return B(r);if(Vt.test(t)&&!I(r))return V(z(r,t)??r);let a=V(t);return I(r)&&!L(a)?B(r):Gt(a,r)}var qt=/^(?:@[\dA-Za-z~-][\w.~-]*\/)?[\dA-Za-z~-][\w.~-]*$/u;function Jt(e){let t=e.split(`/`).slice(0,e.startsWith(`@`)?2:1).join(`/`);return qt.test(t)?t:null}var Yt=new Set([`.pnpm`,`.bun`,`.deno`]),Xt=/^\d+\.\d+\.\d+(?:-[\d.a-z-]+)?(?:\+[\d.a-z-]+)?$/iu;function Zt(e,t){let n=`${t.replace(`/`,`+`)}@`,r=e.startsWith(n)?e.slice(n.length).split(/[(_]/u)[0]:null;return Xt.test(r)?r:null}function Qt(e){let t=R(e).split(`/`),n=t.lastIndexOf(`node_modules`),r=n<0?null:Jt(t.slice(n+1).join(`/`));if(r===null)return null;let i=n+1+r.split(`/`).length;if(i>=t.length||t.slice(i).includes(``))return null;let a=t.slice(0,i).join(`/`);return{name:r,version:Yt.has(t[n-2])?Zt(t[n-1],r):null,root:a,path:e.slice(a.length+1)}}var $t=new Map([[`js`,`jsx`],[`mjs`,`jsx`],[`cjs`,`jsx`],[`jsx`,`jsx`],[`es`,`jsx`],[`es6`,`jsx`],[`ts`,`ts`],[`mts`,`ts`],[`cts`,`ts`],[`tsx`,`tsx`],[`json`,`json`]]);function en(e){let t=Wt(R(e));return/^[\w-]+$/u.test(t)?`jsx`:$t.get(/\.([\da-z]+)$/iu.exec(t)?.[1].toLowerCase())??null}var tn=[`.js`,`.mjs`,`.cjs`,`.jsx`,`.ts`,`.tsx`,`.mts`,`.cts`,`.json`],nn=[`.ios`,`.android`,`.web`];function rn(e){let t=e.map(e=>/\.[a-z]+(?=\.\w+$)/u.exec(Wt(R(e.path??``)))?.[0]),[[n,r],[,i]]=nn.map(e=>[e,t.filter(t=>t===e).length]).toSorted((e,t)=>t[1]-e[1]);return[...r===i?[]:[n],`.native`,``,`.browser`,`.node`]}var an=new Map([[`.js`,[`.ts`,`.tsx`]],[`.jsx`,[`.tsx`]],[`.mjs`,[`.mts`]],[`.cjs`,[`.cts`]]]),on=[`index`,`main`,`browser`,`node`],sn=[``,`src/`,`lib/`,`dist/`,`build/`],cn=new Set([`lib`,`dist`,`build`,`out`,`esm`,`cjs`]);function*ln(e,t){yield e;let n=/\.[^./]+$/u.exec(e)?.[0];for(let t of an.get(n)??[])yield e.slice(0,-n.length)+t;for(let n of e.endsWith(`/`)?[`${e}index`]:[e,`${e}/index`])for(let e of tn)for(let r of t)yield n+r+e;if(n)for(let r of t.filter(Boolean))yield e.slice(0,-n.length)+r+n}function*un(e){let t=e;for(;;){t.startsWith(`src/`)||(yield`src/${t}`),t!==e&&(yield t);let n=t.indexOf(`/`);if(n<0||!cn.has(t.slice(0,n)))return;t=t.slice(n+1)}}function dn(e){let t=new Map,n=new Map,r=new Map;for(let i of e)i.path!==null&&t.set(i.path,i),i.package&&(n.set(i.package.name,(n.get(i.package.name)??new Set).add(i.package.root)),(r.get(i.package.root)??r.set(i.package.root,[]).get(i.package.root)).push(i));return{byPath:t,roots:n,byRoot:r,platforms:rn(e),found:new Map}}function H(e,t){if(!e.found.has(t)){let n=R(t),r=ln(n,e.platforms).map(e=>e+t.slice(n.length));e.found.set(t,e.byPath.get(r.find(t=>e.byPath.has(t)))??null)}return e.found.get(t)}function fn(e,t,n){let r=e.roots.get(n);if(!r)return null;let i=t.path.split(`/`);for(let e=i.length-1;e>=0;e--){let t=[...i.slice(0,e),`node_modules`,n].join(`/`);if(r.has(t))return t}return r.size===1?[...r][0]:null}var pn=new Set(`assert.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.domain.events.fs.http.http2.https.inspector.module.net.os.path.perf_hooks.process.punycode.querystring.readline.repl.stream.string_decoder.sys.timers.tls.trace_events.tty.url.util.v8.vm.wasi.worker_threads.zlib._http_agent._http_client._http_common._http_incoming._http_outgoing._http_server._stream_duplex._stream_passthrough._stream_readable._stream_transform._stream_wrap._stream_writable._tls_common._tls_wrap.assert/strict.dns/promises.fs/promises.inspector/promises.path/posix.path/win32.readline/promises.stream/consumers.stream/promises.stream/web.timers/promises.util/types`.split(`.`));function mn(e){if(e.startsWith(`node:`)||pn.has(e))return{builtin:!0};let t=Jt(R(e));return t===null?{}:{package:t}}function hn(){let e=[],t=new Map,n=(n,r,i)=>{let a=t.get(n)??t.set(n,new Set).get(n);a.has(r)||(a.add(r),e.push(i))};return{edges:e,add:n,link:(e,t,r)=>{e&&t&&t!==e&&n(e,t,{from:e,to:t,kind:r})}}}function gn(e,t){for(let n of on)for(let r of sn){let i=H(e,`${t}/${r}${n}`);if(i)return i}let n=e.byRoot.get(t);return n?.length===1?n[0]:null}function _n(e,t,n,r){return/^\/[^?]/u.test(n)?H(e,t+n)??un(n.slice(1)).map(n=>H(e,`${t}/${n}`)).find(Boolean):H(e,t+n)??r(e,t)}function vn(e,t,n,r=gn){let i=/^(?:\.{1,2}|[a-z]:)?\\/iu.test(n)?n.replaceAll(`\\`,`/`):n,a=Ht.test(i);if(a||/^(?:\.{1,2}(?:\/|$)|\/|[a-z]:\/)/iu.test(i)||L(i)){let n=a?V(i):Gt(t.path,i),r=H(e,n);return r?{to:r}:{to:null,path:n}}if(Bt.test(i)&&e.byPath.has(i))return{to:e.byPath.get(i)};let o=Jt(R(n)),s=o===null?null:fn(e,t,o);if(s===null)return{to:null,...mn(n)};let c=_n(e,s,n.slice(o.length),r);return c?{to:c}:{to:null,package:o}}var U=class extends Error{name=`SourceMapError`},yn=new Uint8Array(128).fill(255);for(let[e,t]of[...`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/,;`].entries())yn[t.codePointAt(0)]=e;function bn(e){let t=new Int32Array(e.length*2);return t.set(e),t}function xn(e){let{starts:t,columns:n,sources:r,names:i}=e;for(let e=0;e+1<t.length;e++){let[a,o]=[t[e],t[e+1]],s=a+1;for(;s<o&&n[s-1]<=n[s];)s++;if(s>=o)continue;let c=Array.from(n.subarray(a,o),(e,t)=>[e,r[a+t],i[a+t]]).sort((e,t)=>e[0]-t[0]);for(let[e,[t,o,s]]of c.entries())[n[a+e],r[a+e],i[a+e]]=[t,o,s]}return e}function Sn(e){let t=[0],n=new Int32Array(1024),r=new Int32Array(1024),i=new Int32Array(1024),a=0;for(let{mappings:o,files:s,line:c,column:l,names:u,nameCount:d}of e){if(typeof o!=`string`)throw new U(`mappings is not a string`);for(;t.length<=c;)t.push(a);let e=[0,0,0,0,0],f=0,p=0,m=1,h=l;for(let c=0;c<=o.length;c++){let l=c<o.length?yn[o.codePointAt(c)]??255:64;if(l<32){if(p+=l*m,f===5)throw new U(`mappings: a segment of more than 5 fields at ${c}`);e[f++]+=p%2?(1-p)/2:p/2,p=0,m=1;continue}if(l<64){if(p+=(l-32)*m,m*=32,m>2**30)throw new U(`mappings: a value at ${c} runs past 32 bits`);continue}if(l===255)throw new U(`mappings: ${JSON.stringify(o[c])} at ${c} is not a base64 digit`);if(m!==1)throw new U(`mappings: the value before ${c} is cut off`);if(f>0){if(f===2||f===3)throw new U(`mappings: a segment of ${f} fields before ${c}`);let t=f===1?-1:s[e[1]];if(t===void 0)throw new U(`mappings: source ${e[1]} before ${c} is not in sources`);if(e[0]<0)throw new U(`mappings: a negative generated column before ${c}`);a===n.length&&([n,r,i]=[bn(n),bn(r),bn(i)]),n[a]=e[0]+h,r[a]=t,i[a++]=f===5&&e[4]>=0&&e[4]<d?u+e[4]:-1,f=0}l===65&&(t.push(a),e[0]=0,h=0)}}return t.push(a),xn({starts:Int32Array.from(t),columns:n.slice(0,a),sources:r.slice(0,a),names:i.slice(0,a)})}var Cn=new WeakMap,wn=e=>Cn.get(e),W=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function G(e,t){if(!e)throw new U(t)}function Tn(e,t){if(e===void 0)return[];G(Array.isArray(e),`${t} is not an array`);for(let n of e)G(typeof n==`string`||n===null,`${t} holds ${JSON.stringify(n)}`);return e}function En(e,t,n,r){let i=e.bySource.get(t);if(i!==void 0)return e.files[i].content??=n,e.files[i].ignored||=r,i;let a=t===null?null:V(t,e.mapPath);return e.files.push({source:t,path:a,package:a===null?null:Qt(a),content:n,ignored:r}),t!==null&&e.bySource.set(t,e.files.length-1),e.files.length-1}function Dn(e,t,n,r){G(e.version===3,`version ${JSON.stringify(e.version)} is not 3`),G(e.sourceRoot===void 0||typeof e.sourceRoot==`string`,`sourceRoot is not a string`);let i=Tn(e.sources,`sources`),a=Tn(e.sourcesContent,`sourcesContent`),o=e.ignoreList??e.x_google_ignoreList??[];G(Array.isArray(o)&&o.every(e=>Number.isInteger(e)&&e>=0&&e<i.length),`ignoreList is not a list of indices into sources`);let s=new Set(o),c=e.sourceRoot?e.sourceRoot.replace(/\/?$/u,`/`):``,l=i.map((e,n)=>En(t,e===null?null:c+e,a[n]??null,s.has(n))),u=Array.isArray(e.names)?e.names:[];t.parts.push({mappings:e.mappings,files:l,line:n,column:r,names:t.names.length,nameCount:u.length}),t.names.push(...u)}function On(e,t){G(e.version===3,`version ${JSON.stringify(e.version)} is not 3`),G(Array.isArray(e.sections),`sections is not an array`);for(let[n,r]of e.sections.entries()){let{offset:i,map:a}=W(r)?r:{};G(W(i)&&[i.line,i.column].every(e=>Number.isInteger(e)&&e>=0),`sections[${n}].offset is not a line and a column`),G(W(a)&&a.sections===void 0,`sections[${n}].map is not a plain source map`);let o=e.sections[n-1]?.offset;G(!o||o.line<i.line||o.line===i.line&&o.column<=i.column,`sections[${n}] starts before sections[${n-1}]`),Dn(a,t,i.line,i.column)}}function kn(e,t={}){if(!W(t))throw TypeError(`readSourceMap: options is not an object`);if(t.path!==void 0&&typeof t.path!=`string`)throw TypeError(`readSourceMap: options.path is not a string`);let n=e;if(typeof e==`string`||e instanceof Uint8Array)try{let t=typeof e==`string`?e:new TextDecoder(`utf-8`,{fatal:!0}).decode(e);n=JSON.parse(t.replace(/^\)\]\}'[^\n]*\n/u,``))}catch(e){throw new U(`not JSON: ${e.message}`,{cause:e})}G(W(n),`not a JSON object`);let r={files:[],bySource:new Map,mapPath:t.path,parts:[],names:[]};n.sections===void 0?Dn(n,r,0,0):On(n,r);let i={files:r.files};return Cn.set(i,{...Sn(r.parts),nameList:r.names}),i}var An=/\r\n?|[\n\u2028\u2029]/gu;function jn(e){let t=[0];for(let n of e.matchAll(An))t.push(n.index+n[0].length);return t}function Mn(e,t,n,r){let[i,a]=[t,n];for(;i<a;){let t=i+a>>1;e[t]<=r?i=t+1:a=t}return i-1}function K(e,t){let n=Mn(e,0,e.length,t);return[n,t-e[n]]}function Nn(e,[t,n]){if(t>=e.starts.length-1)return-1;let r=e.starts[t],i=Mn(e.columns,r,e.starts[t+1],n);return i<r?-1:i}function Pn(e,t,n,r){let i=wn(e),a=K(t,n),[o,s]=K(t,r),c=new Map,l=Nn(i,a);for(let e=a[0];e<=o&&e<i.starts.length-1;e++){let t=e===a[0]&&l>=0?l:i.starts[e];for(let n=t;n<i.starts[e+1];n++){let t=i.sources[n];if(e===o&&i.columns[n]>=s)break;t>=0&&c.set(t,(c.get(t)??0)+1)}}let[u]=[...c].reduce((e,t)=>t[1]>e[1]?t:e,[-1,0]);return u<0?null:e.files[u]}var q=/\s+/uy,Fn=`
7
+ }`),Buffer.concat(a)}#n(){Tt(this.modules,this.formats);let{entries:e,sources:t,modules:n,formats:r,imports:i,executable:a}=lt(this,`bundle`,{skipEmpty:!0});return{version:N,config:this.config,repo:this.repo,package:this.package,entries:e,formats:r,imports:i,executable:a,reason:P(this.reason,void 0),sources:t,modules:n}}withReason(t,n=[...this.sources.keys()]){let{version:r,config:i,entries:a,modules:o,formats:s,imports:c,executable:l,repo:u,package:d}=this,f=P(this.reason,{[t]:n});return new e({version:r,config:i,entries:a,modules:o,formats:s,imports:c,executable:l,reason:f,repo:u,package:d})}merge(t){return C(this.config.scope===t.config.scope,`bundle merge: scope mismatch ('${this.config.scope}' vs '${t.config.scope}')`),new e({config:{scope:this.config.scope},entries:new Set([...this.entries,...t.entries]),modules:yt(this.modules,t.modules,`bundle merge`),formats:mt(this.formats,t.formats,`bundle merge`),imports:ft(this.imports,t.imports,`bundle merge`),executable:ht(this.executable,t.executable,t.modules,this.config.scope),reason:P(this.reason,t.reason),repo:jt(this.repo,t.repo),package:Pt(this.package,t.package)})}},Ft={__proto__:null,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`jsx`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsx:`tsx`,json:`json`,css:`css`,html:`markup`,htm:`markup`,xml:`markup`,svg:`markup`,yml:`yaml`,yaml:`yaml`,sh:`bash`,bash:`bash`,md:`markdown`,markdown:`markdown`,sol:`solidity`,php:`php`,phtml:`php`,rs:`rust`,rb:`ruby`,py:`python`,pyw:`python`,pyi:`python`,java:`java`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,"c++":`cpp`,hpp:`cpp`,hh:`cpp`,hxx:`cpp`,"h++":`cpp`,h:`cpp`,c:`c`,m:`objectivec`,mm:`objectivec`},It={__proto__:null,module:`javascript`,commonjs:`javascript`,"module-typescript":`typescript`,"commonjs-typescript":`typescript`,json:`json`,solidity:`solidity`,php:`php`,shell:`bash`,rust:`rust`,java:`java`,objc:`objectivec`,objcpp:`objectivec`,c:`c`,"c-header":`c`,cpp:`cpp`,"cpp-header":`cpp`,ruby:`ruby`,podspec:`ruby`,podfile:`ruby`,fastlane:`ruby`,"podfile-lock":`yaml`,xml:`markup`};function Lt(e){if(typeof e!=`string`)return!1;let t=e.length-1,n=0;for(;n<t&&/\s/u.test(e[n]);)n++;for(;t>n&&/\s/u.test(e[t]);)t--;return n<t&&e[n]===`{`&&e[t]===`}`}function Rt(e,t,n){if(typeof t==`string`&&It[t])return It[t];if(typeof e!=`string`)return null;let r=e.slice(e.lastIndexOf(`/`)+1),i=r.lastIndexOf(`.`);if(i<=0)return null;let a=r.slice(i+1).toLowerCase();return a===`map`?Lt(n)?`json`:null:Ft[a]??null}var zt=/^webpack(?:-internal)?:\/\/[^/]*\//u,Bt=/^[a-z][\d+.a-z-]*:/iu,Vt=/^file:/iu,Ht=/^(?:file|ftp|https?|wss?):/iu,Ut=/^(?:[a-z][\d+.a-z-]*:\/\/[^/]*\/?|\/\/[^/]+\/|[a-z]:\/|\/)?/iu,I=e=>Ut.exec(e)[0],L=e=>I(e).includes(`://`),R=e=>e.replace(L(e)?/[#?].*$/su:/\?.*$/su,``),Wt=e=>e.slice(e.lastIndexOf(`/`)+1),z=(e,t)=>URL.parse(e,t)?.href??null;function B(e){let t=I(e),n=t.includes(`://`)&&z(e);if(n)return n;let r=[];for(let n of e.slice(t.length).split(`/`))n===``||n===`.`||(n===`..`?r.length>0&&r.at(-1)!==`..`?r.pop():t||r.push(`..`):r.push(n));let i=/^[a-z]:\/$/iu.test(t)?t.toUpperCase():t.startsWith(`//`)?t.toLowerCase():t;return i?i.replace(/\/?$/u,`/`)+r.join(`/`):r.join(`/`)||`.`}function Gt(e,t){let n=I(t);return L(e)&&!n.includes(`:`)?z(t,e)??B(`${e}/../${t}`):B(n===`/`?I(e).replace(/\/?$/u,``)+t:n?t:`${e}/../${t}`)}function Kt(e){try{return decodeURIComponent(e)}catch{return e}}function V(e,t){let n=e.replaceAll(`\\`,`/`);if(zt.test(n))return B(n.replace(zt,``));let r=Ht.test(n)?z(n)??n:n,i=/^file:\/\/([^/#]*)([^#]*)/isu.exec(r);if(i){let[,e,t]=i;return B(Kt(e&&e.toLowerCase()!==`localhost`?`//${e}${t}`:t).replace(/^\/(?=[a-z]:\/)/iu,``))}if(Bt.test(r)&&!I(r).includes(`:`))return r;if(t===void 0)return B(r);if(Vt.test(t)&&!I(r))return V(z(r,t)??r);let a=V(t);return I(r)&&!L(a)?B(r):Gt(a,r)}var qt=/^(?:@[\dA-Za-z~-][\w.~-]*\/)?[\dA-Za-z~-][\w.~-]*$/u;function Jt(e){let t=e.split(`/`).slice(0,e.startsWith(`@`)?2:1).join(`/`);return qt.test(t)?t:null}var Yt=new Set([`.pnpm`,`.bun`,`.deno`]),Xt=/^\d+\.\d+\.\d+(?:-[\d.a-z-]+)?(?:\+[\d.a-z-]+)?$/iu;function Zt(e,t){let n=`${t.replace(`/`,`+`)}@`,r=e.startsWith(n)?e.slice(n.length).split(/[(_]/u)[0]:null;return Xt.test(r)?r:null}function Qt(e){let t=R(e).split(`/`),n=t.lastIndexOf(`node_modules`),r=n<0?null:Jt(t.slice(n+1).join(`/`));if(r===null)return null;let i=n+1+r.split(`/`).length;if(i>=t.length||t.slice(i).includes(``))return null;let a=t.slice(0,i).join(`/`);return{name:r,version:Yt.has(t[n-2])?Zt(t[n-1],r):null,root:a,path:e.slice(a.length+1)}}var $t=new Map([[`js`,`jsx`],[`mjs`,`jsx`],[`cjs`,`jsx`],[`jsx`,`jsx`],[`es`,`jsx`],[`es6`,`jsx`],[`ts`,`ts`],[`mts`,`ts`],[`cts`,`ts`],[`tsx`,`tsx`],[`json`,`json`]]);function en(e){let t=Wt(R(e));return/^[\w-]+$/u.test(t)?`jsx`:$t.get(/\.([\da-z]+)$/iu.exec(t)?.[1].toLowerCase())??null}var tn=[`.js`,`.mjs`,`.cjs`,`.jsx`,`.ts`,`.tsx`,`.mts`,`.cts`,`.json`],nn=[`.ios`,`.android`,`.web`];function rn(e){let t=e.map(e=>/\.[a-z]+(?=\.\w+$)/u.exec(Wt(R(e.path??``)))?.[0]),[[n,r],[,i]]=nn.map(e=>[e,t.filter(t=>t===e).length]).toSorted((e,t)=>t[1]-e[1]);return[...r===i?[]:[n],`.native`,``,`.browser`,`.node`]}var an=new Map([[`.js`,[`.ts`,`.tsx`]],[`.jsx`,[`.tsx`]],[`.mjs`,[`.mts`]],[`.cjs`,[`.cts`]]]),on=[`index`,`main`,`browser`,`node`],sn=[``,`src/`,`lib/`,`dist/`,`build/`],cn=new Set([`lib`,`dist`,`build`,`out`,`esm`,`cjs`]);function*ln(e,t){yield e;let n=/\.[^./]+$/u.exec(e)?.[0];for(let t of an.get(n)??[])yield e.slice(0,-n.length)+t;for(let n of e.endsWith(`/`)?[`${e}index`]:[e,`${e}/index`])for(let e of tn)for(let r of t)yield n+r+e;if(n)for(let r of t.filter(Boolean))yield e.slice(0,-n.length)+r+n}function*un(e){let t=e;for(;;){t.startsWith(`src/`)||(yield`src/${t}`),t!==e&&(yield t);let n=t.indexOf(`/`);if(n<0||!cn.has(t.slice(0,n)))return;t=t.slice(n+1)}}function dn(e){let t=new Map,n=new Map,r=new Map;for(let i of e)i.path!==null&&t.set(i.path,i),i.package&&(n.set(i.package.name,(n.get(i.package.name)??new Set).add(i.package.root)),(r.get(i.package.root)??r.set(i.package.root,[]).get(i.package.root)).push(i));return{byPath:t,roots:n,byRoot:r,platforms:rn(e),found:new Map}}function H(e,t){if(!e.found.has(t)){let n=R(t),r=ln(n,e.platforms).map(e=>e+t.slice(n.length));e.found.set(t,e.byPath.get(r.find(t=>e.byPath.has(t)))??null)}return e.found.get(t)}function fn(e,t,n){let r=e.roots.get(n);if(!r)return null;let i=t.path.split(`/`);for(let e=i.length-1;e>=0;e--){let t=[...i.slice(0,e),`node_modules`,n].join(`/`);if(r.has(t))return t}return r.size===1?[...r][0]:null}var pn=new Set(`assert.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.domain.events.fs.http.http2.https.inspector.module.net.os.path.perf_hooks.process.punycode.querystring.readline.repl.stream.string_decoder.sys.timers.tls.trace_events.tty.url.util.v8.vm.wasi.worker_threads.zlib._http_agent._http_client._http_common._http_incoming._http_outgoing._http_server._stream_duplex._stream_passthrough._stream_readable._stream_transform._stream_wrap._stream_writable._tls_common._tls_wrap.assert/strict.dns/promises.fs/promises.inspector/promises.path/posix.path/win32.readline/promises.stream/consumers.stream/promises.stream/web.timers/promises.util/types`.split(`.`));function mn(e){if(e.startsWith(`node:`)||pn.has(e))return{builtin:!0};let t=Jt(R(e));return t===null?{}:{package:t}}function hn(){let e=[],t=new Map,n=(n,r,i)=>{let a=t.get(n)??t.set(n,new Set).get(n);a.has(r)||(a.add(r),e.push(i))};return{edges:e,add:n,link:(e,t,r)=>{e&&t&&t!==e&&n(e,t,{from:e,to:t,kind:r})}}}function gn(e,t){for(let n of on)for(let r of sn){let i=H(e,`${t}/${r}${n}`);if(i)return i}let n=e.byRoot.get(t);return n?.length===1?n[0]:null}function _n(e,t,n,r){return/^\/[^?]/u.test(n)?H(e,t+n)??un(n.slice(1)).map(n=>H(e,`${t}/${n}`)).find(Boolean):H(e,t+n)??r(e,t)}function vn(e,t,n,r=gn){let i=/^(?:\.{1,2}|[a-z]:)?\\/iu.test(n)?n.replaceAll(`\\`,`/`):n,a=Ht.test(i);if(a||/^(?:\.{1,2}(?:\/|$)|\/|[a-z]:\/)/iu.test(i)||L(i)){let n=a?V(i):Gt(t.path,i),r=H(e,n);return r?{to:r}:{to:null,path:n}}if(Bt.test(i)&&e.byPath.has(i))return{to:e.byPath.get(i)};let o=Jt(R(n)),s=o===null?null:fn(e,t,o);if(s===null)return{to:null,...mn(n)};let c=_n(e,s,n.slice(o.length),r);return c?{to:c}:{to:null,package:o}}var U=class extends Error{name=`SourceMapError`},yn=new Uint8Array(128).fill(255);for(let[e,t]of[...`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/,;`].entries())yn[t.codePointAt(0)]=e;function bn(e){let t=new Int32Array(e.length*2);return t.set(e),t}function xn(e){let{starts:t,columns:n,sources:r,names:i}=e;for(let e=0;e+1<t.length;e++){let[a,o]=[t[e],t[e+1]],s=a+1;for(;s<o&&n[s-1]<=n[s];)s++;if(s>=o)continue;let c=Array.from(n.subarray(a,o),(e,t)=>[e,r[a+t],i[a+t]]).sort((e,t)=>e[0]-t[0]);for(let[e,[t,o,s]]of c.entries())[n[a+e],r[a+e],i[a+e]]=[t,o,s]}return e}function Sn(e){let t=[0],n=new Int32Array(1024),r=new Int32Array(1024),i=new Int32Array(1024),a=0;for(let{mappings:o,files:s,line:c,column:l,names:u,nameCount:d}of e){if(typeof o!=`string`)throw new U(`mappings is not a string`);for(;t.length<=c;)t.push(a);let e=[0,0,0,0,0],f=0,p=0,m=1,h=l;for(let c=0;c<=o.length;c++){let l=c<o.length?yn[o.codePointAt(c)]??255:64;if(l<32){if(p+=l*m,f===5)throw new U(`mappings: a segment of more than 5 fields at ${c}`);e[f++]+=p%2?(1-p)/2:p/2,p=0,m=1}else if(l<64){if(p+=(l-32)*m,m*=32,m>2**30)throw new U(`mappings: a value at ${c} runs past 32 bits`)}else{if(l===255)throw new U(`mappings: ${JSON.stringify(o[c])} at ${c} is not a base64 digit`);if(m!==1)throw new U(`mappings: the value before ${c} is cut off`);if(f>0){if(f===2||f===3)throw new U(`mappings: a segment of ${f} fields before ${c}`);let t=f===1?-1:s[e[1]];if(t===void 0)throw new U(`mappings: source ${e[1]} before ${c} is not in sources`);if(e[0]<0)throw new U(`mappings: a negative generated column before ${c}`);a===n.length&&([n,r,i]=[bn(n),bn(r),bn(i)]),n[a]=e[0]+h,r[a]=t,i[a++]=f===5&&e[4]>=0&&e[4]<d?u+e[4]:-1,f=0}l===65&&(t.push(a),e[0]=0,h=0)}}}return t.push(a),xn({starts:Int32Array.from(t),columns:n.slice(0,a),sources:r.slice(0,a),names:i.slice(0,a)})}var Cn=new WeakMap,wn=e=>Cn.get(e),W=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function G(e,t){if(!e)throw new U(t)}function Tn(e,t){if(e===void 0)return[];G(Array.isArray(e),`${t} is not an array`);for(let n of e)G(typeof n==`string`||n===null,`${t} holds ${JSON.stringify(n)}`);return e}function En(e,t,n,r){let i=e.bySource.get(t);if(i!==void 0)return e.files[i].content??=n,e.files[i].ignored||=r,i;let a=t===null?null:V(t,e.mapPath);return e.files.push({source:t,path:a,package:a===null?null:Qt(a),content:n,ignored:r}),t!==null&&e.bySource.set(t,e.files.length-1),e.files.length-1}function Dn(e,t,n,r){G(e.version===3,`version ${JSON.stringify(e.version)} is not 3`),G(e.sourceRoot===void 0||typeof e.sourceRoot==`string`,`sourceRoot is not a string`);let i=Tn(e.sources,`sources`),a=Tn(e.sourcesContent,`sourcesContent`),o=e.ignoreList??e.x_google_ignoreList??[];G(Array.isArray(o)&&o.every(e=>Number.isInteger(e)&&e>=0&&e<i.length),`ignoreList is not a list of indices into sources`);let s=new Set(o),c=e.sourceRoot?e.sourceRoot.replace(/\/?$/u,`/`):``,l=i.map((e,n)=>En(t,e===null?null:c+e,a[n]??null,s.has(n))),u=Array.isArray(e.names)?e.names:[];t.parts.push({mappings:e.mappings,files:l,line:n,column:r,names:t.names.length,nameCount:u.length}),t.names.push(...u)}function On(e,t){G(e.version===3,`version ${JSON.stringify(e.version)} is not 3`),G(Array.isArray(e.sections),`sections is not an array`);for(let[n,r]of e.sections.entries()){let{offset:i,map:a}=W(r)?r:{};G(W(i)&&[i.line,i.column].every(e=>Number.isInteger(e)&&e>=0),`sections[${n}].offset is not a line and a column`),G(W(a)&&a.sections===void 0,`sections[${n}].map is not a plain source map`);let o=e.sections[n-1]?.offset;G(!o||o.line<i.line||o.line===i.line&&o.column<=i.column,`sections[${n}] starts before sections[${n-1}]`),Dn(a,t,i.line,i.column)}}function kn(e,t={}){if(!W(t))throw TypeError(`readSourceMap: options is not an object`);if(t.path!==void 0&&typeof t.path!=`string`)throw TypeError(`readSourceMap: options.path is not a string`);let n=e;if(typeof e==`string`||e instanceof Uint8Array)try{let t=typeof e==`string`?e:new TextDecoder(`utf-8`,{fatal:!0}).decode(e);n=JSON.parse(t.replace(/^\)\]\}'[^\n]*\n/u,``))}catch(e){throw new U(`not JSON: ${e.message}`,{cause:e})}G(W(n),`not a JSON object`);let r={files:[],bySource:new Map,mapPath:t.path,parts:[],names:[]};n.sections===void 0?Dn(n,r,0,0):On(n,r);let i={files:r.files};return Cn.set(i,{...Sn(r.parts),nameList:r.names}),i}var An=/\r\n?|[\n\u2028\u2029]/gu;function jn(e){let t=[0];for(let n of e.matchAll(An))t.push(n.index+n[0].length);return t}function Mn(e,t,n,r){let[i,a]=[t,n];for(;i<a;){let t=i+a>>1;e[t]<=r?i=t+1:a=t}return i-1}function K(e,t){let n=Mn(e,0,e.length,t);return[n,t-e[n]]}function Nn(e,[t,n]){if(t>=e.starts.length-1)return-1;let r=e.starts[t],i=Mn(e.columns,r,e.starts[t+1],n);return i<r?-1:i}function Pn(e,t,n,r){let i=wn(e),a=K(t,n),[o,s]=K(t,r),c=new Map,l=Nn(i,a);for(let e=a[0];e<=o&&e<i.starts.length-1;e++){let t=e===a[0]&&l>=0?l:i.starts[e];for(let n=t;n<i.starts[e+1];n++){let t=i.sources[n];if(e===o&&i.columns[n]>=s)break;t>=0&&c.set(t,(c.get(t)??0)+1)}}let[u]=[...c].reduce((e,t)=>t[1]>e[1]?t:e,[-1,0]);return u<0?null:e.files[u]}var q=/\s+/uy,Fn=`
8
8
  \r\u2028\u2029`,J=/[\n\r\u2028\u2029]/gu,In=/[\n\r\u2028\u2029]/u,Y=/[\w$\u0080-￿]+/uy,Ln=new Set([`return`,`typeof`,`instanceof`,`in`,`of`,`new`,`delete`,`void`,`throw`,`case`,`default`,`extends`,`do`,`else`,`yield`,`await`]),Rn=new Set([`if`,`while`,`for`,`with`]),zn=new Set([`break`,`continue`,`debugger`]),Bn=new Set([`(`,`[`,"${",`,`,`=`,`:`,`?`,`!`,`~`,`+`,`-`,`*`,`/`,`%`,`&`,`|`,`^`,`<`,`>`]);function Vn(e,t){return e?.type===`word`?t&&[`return`,`yield`].includes(e.value)?!1:Ln.has(e.value)&&![`do`,`else`].includes(e.value):Bn.has(e?.value)}function Hn(e){let t=e.at(-1);return t?.type===`word`&&(Rn.has(t.value)||t.value===`await`&&e.at(-2)?.value===`for`)}function Un(e){return e?e.type===`word`?Ln.has(e.value)||zn.has(e.value)||e.label===!0:e.value===`)`?e.control:e.value===`}`?!e.object:e.type===`punctuator`&&![`++`,`--`,`]`].includes(e.value):!0}var Wn=(e,t)=>e.startsWith(`\r
9
9
  `,t+1)?3:2,Gn=/\\(?:u\{([\da-f]+)\}|u([\da-f]{4})|x([\da-f]{2})|([0-3][0-7]{0,2}|[4-7][0-7]?)|(\r\n|[\n\r\u2028\u2029])|(.))/giu,Kn={b:`\b`,f:`\f`,n:`
10
10
  `,r:`\r`,t:` `,v:`\v`};function qn(e){return e.includes(`\\`)?e.replace(Gn,(e,t,n,r,i,a,o)=>{if(a!==void 0)return``;if(i!==void 0)return String.fromCodePoint(Number.parseInt(i,8));let s=Number.parseInt(t??n??r,16);return Number.isNaN(s)?Kn[o]??o:String.fromCodePoint(Math.min(s,1114111))}):e}function Jn(e,t){let n=e[t],r=t+1;for(;r<e.length&&e[r]!==n&&!Fn.includes(e[r]);)r+=e[r]===`\\`?Wn(e,r):1;return[e[r]===n?qn(e.slice(t+1,r)):null,r+1]}function Yn(e,t){let n=t+1,r=!1;for(;n<e.length&&!Fn.includes(e[n])&&(r||e[n]!==`/`);)e[n]===`\\`?n++:e[n]===`[`?r=!0:e[n]===`]`&&(r=!1),n++;return Y.lastIndex=n+1,Y.test(e)?Y.lastIndex:n+1}function Xn(e,t,n){for(let r=t;r<e.length;r++)if(e[r]===`\\`)r++;else{if(e[r]==="`")return r+1;if(e[r]===`$`&&e[r+1]===`{`)return n.push(`template`),r+2}return e.length}function Zn(e){let t=[],n=[],r=[],i=0,a=0;for(;i<e.length;){let o=t.length;if(q.lastIndex=i,q.test(e)&&(i=q.lastIndex),i>=e.length)break;let s=e[i],c=e[i+1];if(Y.lastIndex=i,s===`/`&&c===`/`)J.lastIndex=i+2,i=J.test(e)?J.lastIndex-1:e.length;else if(s===`/`&&c===`*`){let t=e.indexOf(`*/`,i+2);i=t<0?e.length:t+2}else if(s===`"`||s===`'`){let[n,r]=Jn(e,i);t.push({type:`string`,value:n}),i=r}else if(s==="`"||s===`}`&&n.at(-1)===`template`){s===`}`&&n.pop();let r=n.length,a=Xn(e,i+1,n),o=s==="`"&&n.length===r&&e[a-1]==="`";t.push({type:`string`,value:o?qn(e.slice(i+1,a-1)):null}),n.length>r&&t.push({type:`punctuator`,value:"${"}),i=a}else if(s===`/`&&Un(t.at(-1)))i=Yn(e,i),t.push({type:`regex`});else if(Y.test(e)){let n=zn.has(t.at(-1)?.value)&&!In.test(e.slice(a,i));t.push({type:`word`,value:e.slice(i,Y.lastIndex),...n&&{label:n}}),i=Y.lastIndex}else{s===`{`&&n.push(Vn(t.at(-1),In.test(e.slice(a,i)))?`object`:`block`);let o=s===`}`?n.pop():void 0;s===`(`&&r.push(Hn(t));let l=(s===`+`||s===`-`)&&c===s||s===`=`&&c===`>`?s+c:s;t.push({type:`punctuator`,value:l,...s===`)`&&{control:r.pop()===!0},...s===`}`&&{object:o===`object`}}),i+=l.length}t.length>o&&(a=i)}return t}var Qn=e=>e?.type===`string`&&e.value!==null,$n=new Set([`type`,`typeof`]),er=(e,t)=>e[t+1]?.type===`word`&&(e[t+1].value!==`as`||e[t+2]?.type!==`word`||e[t+2].value===`as`);function tr(e,t){let n=!1;for(let r=t+1;r<e.length&&e[r].value!==`}`;r++)if(!(r>t+1&&e[r-1].value!==`,`)){if(!$n.has(e[r].value)||!er(e,r))return!1;n=!0}return n}function nr(e,t){for(let n=t;n<e.length;n++){let{value:r}=e[n];if(r===`;`||n>t&&(r===`import`||r===`export`))return null;if(r===`from`&&Qn(e[n+1]))return e[n+1].value}return null}function rr(e,t){let[n,r,i]=[e[t].value,e[t+1],e[t+2]],a=n===`import`?`import`:`export-from`;if(n===`import`&&Qn(r))return{kind:a,specifier:r.value};if($n.has(r?.value)&&![`,`,`from`].includes(i?.value)||r?.value===`{`&&tr(e,t+1)||n===`export`&&![`{`,`*`].includes(r?.value)||n===`import`&&r?.type!==`word`&&![`{`,`*`].includes(r?.value))return null;let o=nr(e,t+1);return o===null?null:{kind:a,specifier:o}}function ir(e,t){let[n,r]=[e[t+2],e[t+3]];if(n?.value!==`)`)return Qn(n)&&[`)`,`,`].includes(r?.value)?n.value:null}function ar(e,t=new Set){let n=Zn(e),r=[];for(let[e,i]of n.entries()){if(i.type!==`word`||[`.`,`#`,`function`].includes(n[e-1]?.value)||n[e-1]?.value===`=`&&n[e-3]?.value===`type`&&n[e-4]?.value===`import`)continue;let a=n[e+1]?.value===`(`,o=a?ir(n,e):void 0;if((i.value===`require`||t.has(i.value))&&o!==void 0)r.push({kind:`require`,specifier:o,...i.value!==`require`&&{callee:i.value}});else if(i.value===`import`&&a)o!==void 0&&r.push({kind:`dynamic-import`,specifier:o});else if(i.value===`import`||i.value===`export`){let t=rr(n,e);t&&r.push(t)}}return r}var or=/^[\w$]*__d\(/gmu,sr=([e,t,n,...r])=>(typeof e==`number`||typeof e==`string`)&&(t===void 0||typeof t==`object`)&&(n===void 0||typeof n==`string`)&&r.length===0;function cr(e){let t=/\);?\s*$/u.exec(e)?.index,n=null,r=t===void 0?-1:e.lastIndexOf(`},`,t);for(;r>=0&&/[\d"]/u.test(e[r+2]);){let i;try{i=JSON.parse(`[${e.slice(r+2,t)}]`)}catch{break}if(!sr(i))break;n=i,r=r>0?e.lastIndexOf(`},`,r-1):-1}return n}function lr(e){let t=/^[^(]*\(\s*(?:function\s*[\w$]*\s*)?\(([^)]*)\)/u.exec(e)?.[1].split(`,`).slice(1,4).map(e=>e.trim().replaceAll(`$`,`\\$`));if(!t?.length)return[];let n=e.matchAll(RegExp(`(?<=[^\\w$.#]|\\.\\.\\.)(?:${t.join(`|`)})\\((\\d+|"(?:[^"\\\\]|\\\\.)*")[,)]`,`gu`));return[...new Set([...n].map(e=>JSON.parse(e[1])))]}function ur(e,t){if(Array.isArray(e))return e;let n=Object.entries(e??{}).filter(([e])=>/^\d+$/u.test(e)).map(([,e])=>e);return n.length>0?n:lr(t)}function dr(e,t){let n=new Map(t.files.map((e,t)=>[e,t])),r=e.flatMap((e,t)=>e.file?[{k:t,at:n.get(e.file)}]:[]);for(let n=0;n<(r[0]?.k??0);n++)e[n].file=t.files[r[0].at-r[0].k+n]??null;for(let[n,{k:i,at:a}]of r.entries()){let o=r[n+1];if(!(o&&o.at-a!==o.k-i))for(let n=i+1;n<(o?.k??e.length);n++)e[n].file=t.files[a+n-i]??null}}function fr(e,t){let n=[...e.matchAll(or)].map(e=>e.index);if(n.length===0)return null;let r=jn(e),i=t=>e.slice(r[t],r[t+1]),a=[];for(let[o,s]of n.entries()){let[c]=K(r,s),[l]=K(r,(n[o+1]??e.length)-1),u=cr(i(l));for(;!u&&l>c;)u=cr(i(--l));if(!u)throw Error(`bundleEdges: the Metro module at line ${c+1} ends in no define params`);let d=r[l+1]??e.length;a.push({id:u[0],file:Pn(t,r,s,d),dependencies:ur(u[1],e.slice(s,d))})}dr(a,t);let o=new Map(a.map(e=>[e.id,e])),{edges:s,link:c}=hn();for(let{file:e,dependencies:t}of a)for(let n of t)c(e,o.get(n)?.file,`dependency`);return s}var pr=e=>e.path!==null&&![`json`,null].includes(en(e.path)),mr=e=>e.path!==null&&en(e.path)===null;function hr(e){let t=/^_([A-Za-z]+)\d+$/u.exec(e)?.[1];if(t)return[t,`interopRequireDefault`];let n=/^_(interopRequire(?:Default|Wildcard)|jsx(?:Dev)?Runtime|callSuper)$/u.exec(e)?.[1];return n===`callSuper`?[`getPrototypeOf`,`possibleConstructorReturn`,`interopRequireDefault`]:n?[n]:[]}var gr={jsxRuntime:`react/jsx-runtime`,jsxDevRuntime:`react/jsx-dev-runtime`};function _r(e){let{sources:t,names:n,nameList:r}=wn(e),i=new Map,a=new Map,o=e.files.map(()=>new Set);for(let e=0;e<n.length;e++)n[e]<0||t[e]<0||(a.has(n[e])||a.set(n[e],hr(r[n[e]]).length>0),a.get(n[e])&&o[t[e]].add(r[n[e]]));for(let[t,n]of o.entries()){if(n.size===0)continue;let r=e.files[t],a=new Set(Array.from((r.content??``).matchAll(/(?:function|var|let|const)\s+(_[A-Za-z]+\d*)\b/gu),e=>e[1])),o=[...n].filter(e=>!a.has(e)&&!a.has(e.replace(/\d+$/u,``))).flatMap(hr);o.length>0&&i.set(r,o.map(e=>gr[e]??`@babel/runtime/helpers/${e}`))}return i}function vr(e,t){let n=new Map;for(let[r,i]of e){let e=n.get(r)??n.set(r,new Map).get(r);for(let n of i)e.set(n,vn(t,r,n,()=>null))}let r=new Set([...n.values()].flatMap(e=>[...e.values()].map(e=>e.to))),i=(e,n)=>t.byRoot.get(n).find(e=>!r.has(e))??t.byRoot.get(n)[0];return(e,r)=>{let a=n.get(e)?.get(r);return a?.to?a:vn(t,e,r,i)}}var yr=e=>/(?:^|\/)__prelude__$/u.test(e.source??``),br=e=>e?.package?.name===`metro-runtime`&&e.package.path===`src/polyfills/require.js`;function xr(e){if(!e.files.some(yr)&&!br(e.files[0]))return null;if(!e.files.some(e=>e.content!==null&&!yr(e)&&!br(e)))throw Error("bundleEdges: the Metro map carries no sourcesContent, which its edges are read from; pass the bundle as `code`");let t=dn(e.files),n=e.files[e.files.findIndex(mr)+1],r=e.files.find(e=>e.package?.name===`metro-runtime`&&e.package.path===`src/modules/asyncRequire.js`),i=new Map(e.files.filter(e=>e.content!==null&&pr(e)).map(e=>[e,ar(e.content)])),a=_r(e),o=vr([...[...i].map(([e,t])=>[e,t.flatMap(({specifier:e})=>e===null?[]:[e])]),...a],t),{edges:s,add:c,link:l}=hn();for(let t of e.files){mr(t)&&l(t,n,`dependency`);for(let{kind:e,specifier:n}of i.get(t)??[]){let i=n===null?{to:null}:o(t,n);i.to!==t&&c(t,`${e}\0${JSON.stringify(n)}`,{from:t,kind:e,specifier:n,...i}),e===`dynamic-import`&&l(t,r,`dependency`)}for(let e of a.get(t)??[])l(t,o(t,e).to,`dependency`)}return s}var Sr=(e,t)=>t==null?xr(e):fr(t,e);function Cr(e,t){let n=Sr(e,t);if(!n)throw Error(`bundleEdges: not a Metro ${t==null?`map`:`bundle`}; edges-lite.js reads only those, edges.js reads others`);return{edges:n}}function wr(e){let t=JSON.parse(e.replace(/^\)\]\}'[^\n]*\n/u,``)),n=kn(t),r=t.sections?t.sections.reduce((e,t)=>e+(t.map.names?.length??0),0):t.names?.length??null;return{json:{version:t.version,file:t.file,sourceRoot:t.sourceRoot},map:n,namesCount:r}}function Tr(e){if(e.map)return e.map.files.flatMap(e=>e.source===null?[]:[[e.source,e.content]]);let t=e.json?.sourcesContent??[];return(e.json?.sources??[]).map((e,n)=>[e,t[n]??null])}function Er(e,t){let n=new Map;for(let{from:r,to:i,specifier:a}of t(e).edges){if(r.source===null||i?.source==null||i.source===r.source)continue;let e=typeof a==`string`?[r.source,i.source,a]:[r.source,i.source];n.set(e.join(`\0`),e)}return[...n.values()]}function Dr(e){try{return Cr(e)}catch{return{edges:[]}}}var Or=Object.freeze([]);function X(e){return e?.edges?e.edges:e?.map?(e.edges=Er(e.map,Dr),e.edges):Or}var kr=new WeakMap,Ar=new WeakMap;function jr(e){let t=X(e);if(!kr.has(t)){let e=new Map;for(let[n,r]of t)e.has(n)||e.set(n,new Set),e.get(n).add(r);kr.set(t,e)}return kr.get(t)}function Mr(e){let t=X(e);if(!Ar.has(t)){let e=new Map;for(let[n,r,i]of t)i!==void 0&&(e.has(n)||e.set(n,new Map),e.get(n).set(i,r));Ar.set(t,e)}return Ar.get(t)}var Nr=new WeakMap,Pr=new WeakMap,Fr=new WeakMap,Ir=new WeakMap,Lr=new WeakMap,Rr=new WeakMap;function Z(e){if(e?.metadataOnly)return new Map;let t=e?.bundle??e?.json;if(t&&Nr.has(t))return Nr.get(t);let n=new Map;if(!e)return n;if(e.kind===`stasis`){if(!e.bundle)return n;let t=e.bundle.formats;for(let[r,i]of e.bundle.sources)typeof i==`string`&&(F.isResourceFormat(t?.get(r))||n.set(r,i))}else if(e.kind===`sourcemap`)for(let[t,r]of Tr(e))typeof r==`string`&&n.set(t,r);return t&&Nr.set(t,n),n}function zr(e){let t=1;for(let n=e.indexOf(`
@@ -1,9 +1,9 @@
1
- import{f as e,g as t,j as n,k as r,l as i,m as a}from"./chunk-PXK7EU4V.js";var o=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: ?(.*?))?\n?$/u,s=/^\*{15,}(?: (.*?))?\n?$/u,c=/^\*{3} (\d+)(?:,(\d+))? \*{4}\n?$/u,l=/^--- (\d+)(?:,(\d+))? ----\n?$/u,u=/^(\d+)(?:,(\d+))?([acd])(\d+)(?:,(\d+))?[ \t]*\r?\n?$/u,d=t,f=t?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):null,{isWellFormed:p}=String.prototype;function m(e,t,n){if(t||e.length===n.length)return n;if(p){if(p.call(e))return n;throw TypeError(i)}let r=0,a=n.length-3;for(;r<=a;){let t=n.indexOf(239,r);if(t===-1||t>a)break;if(r=t+1,n[t+1]===191&&n[t+2]===189){if(e===g(n))return n;throw TypeError(i)}}return n}function h(t,n=!1){if(typeof t!=`string`)throw TypeError(r);return t.length===0?new Uint8Array:m(t,n,e.encode(t))}function g(e,t=!1){return n(e),e.byteLength===0?``:t?d.decode(e):f.decode(e)}var _=(e,t=`uint8`)=>a(h(e,!1),t),v=(e,t=`uint8`)=>a(h(e,!0),t),y=e=>g(e,!1),b=e=>g(e,!0),x=/[ \t\n\v\f\r]+/gu,S=/(?<![ \t\n\v\f\r])[ \t\n\v\f\r]+$/u,C=e=>e.replace(/[A-Z]/gu,e=>e.toLowerCase());function w({ignoreCase:e=!1,whitespace:t=`none`}={}){let n=null;return t===`all`?n=e=>e.replace(x,``):t===`change`?n=e=>e.replace(S,``).replace(x,` `):t===`trailing`&&(n=e=>e.replace(S,``)),e?n?e=>C(n(e)):C:n}var T=e=>e.match(/[^\n]*\n|[^\n]+/gu)??[],E=class extends Error{constructor(e,t){super(t===void 0?e:`${e} at line ${t+1}`),this.name=`PatchError`,this.line=t}},D=(e,t)=>t===0?Number(e):Number(e)-1,O=e=>e?.startsWith(`\\`),k=e=>e.replace(/\n$/u,``);function ee(e){let t=T(e),n=[],r={old:null,new:null},i=!1;for(let e=0;e<t.length;){let a=t[e],c=A(a,i);if(i=!a.startsWith(`***************`)&&a.startsWith(`*** `),c){r=c.names??{...r,[c.slot]:c.name},e++;continue}let l=o.test(a)?`unified`:s.test(a)?`context`:u.test(a)?`normal`:null;if(l===null){e++;continue}let d=[],f=ae[l];for(let n=f(t,e);n!==null&&(d.push(n.hunk),e=n.next,!(e>=t.length||A(t[e],!1)));n=f(t,e));n.push({old:r.old,new:r.new,format:l,hunks:d,blocks:te(d)}),r={old:null,new:null}}return n}function A(e,t){let n=/^diff --git (\S+) (\S+)\n?$/u.exec(e);if(n)return{names:{old:n[1],new:n[2]}};if(c.test(e)||l.test(e))return null;let r=/^(\*\*\* |--- |\+\+\+ )(.*?)(?:\t.*)?\n?$/u.exec(e);return r?{slot:r[1]===`*** `||r[1]===`--- `&&!t?`old`:`new`,name:r[2]}:null}function te(e){let t=[];for(let n of e){let e=n.oldStart,r=n.newStart,i=null,a=()=>{i&&=(t.push(i),e=i.a1,r=i.b1,null)};for(let{tag:t,text:o}of n.lines){if(t===` `){a(),e++,r++;continue}t===`-`&&i?.insert.length&&a(),i??={a0:e,a1:e,b0:r,b1:r,remove:[],insert:[]},t===`-`?(i.a1++,i.remove.push(o)):(i.b1++,i.insert.push(o))}a()}return t}function ne(e,t){let n=o.exec(e[t]??``);if(!n)return null;let r=Number(n[2]??1),i=Number(n[4]??1),a={oldStart:D(n[1],r),newStart:D(n[3],i),label:n[5]||null,lines:[]},s=0,c=t+1,l=0;for(;l<r||s<i;c++){let t=e[c];if(t===void 0)throw new E(`the patch ends inside a hunk`,c);let n=t===`
2
- `?` `:t[0];if(n!==` `&&n!==`-`&&n!==`+`)throw new E(`a hunk line begins with ${JSON.stringify(n)}`,c);let o=t===`
3
- `?t:t.slice(1);if(O(e[c+1])&&(o=k(o),c++),n!==`+`&&l++,n!==`-`&&s++,l>r||s>i)throw new E(`a hunk has more lines than its header says`,c);a.lines.push({tag:n,text:o})}return{hunk:a,next:c}}function j(e,t){let n=u.exec(e[t]??``);if(!n)return null;let[,r,i,a,o,s]=n,c=a===`a`?0:Number(i??r)-Number(r)+1,l=a===`d`?0:Number(s??o)-Number(o)+1;if(c<0||l<0)throw new E(`a change command counts backwards`,t);let d={oldStart:a===`a`?Number(r):Number(r)-1,newStart:a===`d`?Number(o):Number(o)-1,label:null,lines:[]},f=t+1,p=(t,n,r)=>{for(let i=0;i<t;i++,f++){let t=e[f];if(t===void 0)throw new E(`the patch ends inside a hunk`,f);if(t[0]!==n)throw new E(`${JSON.stringify(n)} expected`,f);let i=t.slice(2);O(e[f+1])&&(i=k(i),f++),d.lines.push({tag:r,text:i})}};if(p(c,`<`,`-`),a===`c`){if(e[f]!==`---
4
- `)throw new E(`'---' expected`,f);f++}return p(l,`>`,`+`),{hunk:d,next:f}}function re(e,t){let n=s.exec(e[t]??``);if(!n)return null;let r=c.exec(e[t+1]??``);if(!r)throw new E(`'*** ' range expected`,t+1);let i=M(e,t+2,`-`),a=l.exec(e[i.next]??``);if(!a)throw new E(`'--- ' range expected`,i.next);let o=M(e,i.next+1,`+`),u=i.lines.length===0?o.lines.filter(e=>e.tag===` `):i.lines,d=o.lines.length===0?i.lines.filter(e=>e.tag===` `):o.lines;return{hunk:{oldStart:D(r[1],u.length),newStart:D(a[1],d.length),label:n[1]||null,lines:ie(u,d)},next:o.next}}function M(e,t,n){let r=[],i=t;for(;i<e.length;i++){let t=e[i];if(s.test(t)||c.test(t)||l.test(t))break;if(O(t)){if(r.length===0)throw new E(`a no-newline marker follows no line`,i);r.at(-1).text=k(r.at(-1).text);continue}let a=t===`
1
+ import{f as e,g as t,j as n,k as r,l as i,m as a}from"./chunk-PXK7EU4V.js";var o=t,s=t?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):null,{isWellFormed:c}=String.prototype;function l(e,t,n){if(t||e.length===n.length)return n;if(c){if(c.call(e))return n;throw TypeError(i)}let r=0,a=n.length-3;for(;r<=a;){let t=n.indexOf(239,r);if(t===-1||t>a)break;if(r=t+1,n[t+1]===191&&n[t+2]===189){if(e===d(n))return n;throw TypeError(i)}}return n}function u(t,n=!1){if(typeof t!=`string`)throw TypeError(r);return t.length===0?new Uint8Array:l(t,n,e.encode(t))}function d(e,t=!1){return n(e),e.byteLength===0?``:t?o.decode(e):s.decode(e)}var f=(e,t=`uint8`)=>a(u(e,!1),t),p=(e,t=`uint8`)=>a(u(e,!0),t),m=e=>d(e,!1),h=e=>d(e,!0),g=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: ?(.*?))?\n?$/u,_=/^\*{15,}(?: (.*?))?\n?$/u,v=/^\*{3} (\d+)(?:,(\d+))? \*{4}\n?$/u,y=/^--- (\d+)(?:,(\d+))? ----\n?$/u,b=/^(\d+)(?:,(\d+))?([acd])(\d+)(?:,(\d+))?[ \t]*\r?\n?$/u,x=/[ \t\n\v\f\r]+/gu,S=/(?<![ \t\n\v\f\r])[ \t\n\v\f\r]+$/u,C=e=>e.replace(/[A-Z]/gu,e=>e.toLowerCase());function w({ignoreCase:e=!1,whitespace:t=`none`}={}){let n=null;return t===`all`?n=e=>e.replace(x,``):t===`change`?n=e=>e.replace(S,``).replace(x,` `):t===`trailing`&&(n=e=>e.replace(S,``)),e?n?e=>C(n(e)):C:n}var T=e=>e.match(/[^\n]*\n|[^\n]+/gu)??[],E=class extends Error{constructor(e,t){super(t===void 0?e:`${e} at line ${t+1}`),this.name=`PatchError`,this.line=t}},D=(e,t)=>t===0?Number(e):Number(e)-1,O=e=>e?.startsWith(`\\`),k=e=>e.replace(/\n$/u,``);function ee(e){let t=T(e),n=[],r={old:null,new:null},i=!1;for(let e=0;e<t.length;){let a=t[e],o=A(a,i);if(i=!a.startsWith(`***************`)&&a.startsWith(`*** `),o){r=o.names??{...r,[o.slot]:o.name},e++;continue}let s=g.test(a)?`unified`:_.test(a)?`context`:b.test(a)?`normal`:null;if(s===null){e++;continue}let c=[],l=ae[s];for(let n=l(t,e);n!==null&&(c.push(n.hunk),e=n.next,!(e>=t.length||A(t[e],!1)));n=l(t,e));n.push({old:r.old,new:r.new,format:s,hunks:c,blocks:te(c)}),r={old:null,new:null}}return n}function A(e,t){let n=/^diff --git (\S+) (\S+)\n?$/u.exec(e);if(n)return{names:{old:n[1],new:n[2]}};if(v.test(e)||y.test(e))return null;let r=/^(\*\*\* |--- |\+\+\+ )(.*?)(?:\t.*)?\n?$/u.exec(e);return r?{slot:r[1]===`*** `||r[1]===`--- `&&!t?`old`:`new`,name:r[2]}:null}function te(e){let t=[];for(let n of e){let e=n.oldStart,r=n.newStart,i=null,a=()=>{i&&=(t.push(i),e=i.a1,r=i.b1,null)};for(let{tag:t,text:o}of n.lines)t===` `?(a(),e++,r++):(t===`-`&&i?.insert.length&&a(),i??={a0:e,a1:e,b0:r,b1:r,remove:[],insert:[]},t===`-`?(i.a1++,i.remove.push(o)):(i.b1++,i.insert.push(o)));a()}return t}function ne(e,t){let n=g.exec(e[t]??``);if(!n)return null;let r=Number(n[2]??1),i=Number(n[4]??1),a={oldStart:D(n[1],r),newStart:D(n[3],i),label:n[5]||null,lines:[]},o=0,s=t+1,c=0;for(;c<r||o<i;s++){let t=e[s];if(t===void 0)throw new E(`the patch ends inside a hunk`,s);let n=t===`
2
+ `?` `:t[0];if(n!==` `&&n!==`-`&&n!==`+`)throw new E(`a hunk line begins with ${JSON.stringify(n)}`,s);let l=t===`
3
+ `?t:t.slice(1);if(O(e[s+1])&&(l=k(l),s++),n!==`+`&&c++,n!==`-`&&o++,c>r||o>i)throw new E(`a hunk has more lines than its header says`,s);a.lines.push({tag:n,text:l})}return{hunk:a,next:s}}function j(e,t){let n=b.exec(e[t]??``);if(!n)return null;let[,r,i,a,o,s]=n,c=a===`a`?0:Number(i??r)-Number(r)+1,l=a===`d`?0:Number(s??o)-Number(o)+1;if(c<0||l<0)throw new E(`a change command counts backwards`,t);let u={oldStart:a===`a`?Number(r):Number(r)-1,newStart:a===`d`?Number(o):Number(o)-1,label:null,lines:[]},d=t+1,f=(t,n,r)=>{for(let i=0;i<t;i++,d++){let t=e[d];if(t===void 0)throw new E(`the patch ends inside a hunk`,d);if(t[0]!==n)throw new E(`${JSON.stringify(n)} expected`,d);let i=t.slice(2);O(e[d+1])&&(i=k(i),d++),u.lines.push({tag:r,text:i})}};if(f(c,`<`,`-`),a===`c`){if(e[d]!==`---
4
+ `)throw new E(`'---' expected`,d);d++}return f(l,`>`,`+`),{hunk:u,next:d}}function re(e,t){let n=_.exec(e[t]??``);if(!n)return null;let r=v.exec(e[t+1]??``);if(!r)throw new E(`'*** ' range expected`,t+1);let i=M(e,t+2,`-`),a=y.exec(e[i.next]??``);if(!a)throw new E(`'--- ' range expected`,i.next);let o=M(e,i.next+1,`+`),s=i.lines.length===0?o.lines.filter(e=>e.tag===` `):i.lines,c=o.lines.length===0?i.lines.filter(e=>e.tag===` `):o.lines;return{hunk:{oldStart:D(r[1],s.length),newStart:D(a[1],c.length),label:n[1]||null,lines:ie(s,c)},next:o.next}}function M(e,t,n){let r=[],i=t;for(;i<e.length;i++){let t=e[i];if(_.test(t)||v.test(t)||y.test(t))break;if(O(t)){if(r.length===0)throw new E(`a no-newline marker follows no line`,i);r.at(-1).text=k(r.at(-1).text);continue}let a=t===`
5
5
  `?` `:t[0];if(a!==` `&&a!==`!`&&a!==`-`&&a!==`+`)break;r.push({tag:a===` `?` `:n,text:t===`
6
- `?t:t.slice(2)})}return{lines:r,next:i}}function ie(e,t){let n=[],r=0,i=0;for(;r<e.length||i<t.length;){if(e[r]?.tag===` `&&t[i]?.tag===` `){n.push(e[r++]),i++;continue}for(;r<e.length&&e[r].tag!==` `;)n.push(e[r++]);for(;i<t.length&&t[i].tag!==` `;)n.push(t[i++]);e[r]?.tag===` `&&t[i]===void 0?n.push(e[r++]):t[i]?.tag===` `&&e[r]===void 0&&n.push(t[i++])}return n}var ae={unified:ne,context:re,normal:j},N=class extends Error{constructor(e){super(`the rendered diff does not say what the change set says (${e})`),this.name=`FormatError`}},oe={" ":`kept`,"-":`removed`,"+":`added`};function P(e,t,n,r){if(n.length===0&&r===``)return;let i;try{i=ee(r)}catch(e){throw new N(`it does not read back (${e.message})`)}if(i.length!==1)throw new N(`${i.length} files read back, not one`);let[{format:a,hunks:o,blocks:s}]=i;if(s.length!==n.length)throw new N(`${s.length} blocks read back, not ${n.length}`);for(let[e,t]of s.entries()){let r=n[e];if(t.a0!==r.a0||t.a1!==r.a1||t.b0!==r.b0||t.b1!==r.b1)throw new N(`block ${e+1} reads back somewhere else`)}for(let n of o){let r=a===`context`&&!n.lines.some(({tag:e})=>e===`-`),i=n.oldStart,o=n.newStart;for(let{tag:a,text:s}of n.lines){if(s!==(a===`+`||a===` `&&r?t[o]:e[i]))throw new N(`a ${oe[a]} line is not the line it stands for`);a!==`+`&&i++,a!==`-`&&o++}}}function se(e,t,n,r){let i=[];for(let a=0;a<e.length;){let o=a;for(;o+1<e.length&&e[o+1].a0-e[o].a1<=2*t;)o++;let s=e[a],c=e[o];i.push({blocks:e.slice(a,o+1),a0:Math.max(0,s.a0-t),a1:Math.min(n,c.a1+t),b0:Math.max(0,s.b0-t),b1:Math.min(r,c.b1+t)}),a=o+1}return i}var F=e=>(t,n,r,{context:i,label:a=null})=>{let o=``;for(let s of se(r,i,t.length,n.length))o+=e(t,n,s,a?a(s.a0):null);return P(t,n,r,o),o},ce=`
6
+ `?t:t.slice(2)})}return{lines:r,next:i}}function ie(e,t){let n=[],r=0,i=0;for(;r<e.length||i<t.length;)if(e[r]?.tag===` `&&t[i]?.tag===` `)n.push(e[r++]),i++;else{for(;r<e.length&&e[r].tag!==` `;)n.push(e[r++]);for(;i<t.length&&t[i].tag!==` `;)n.push(t[i++]);e[r]?.tag===` `&&t[i]===void 0?n.push(e[r++]):t[i]?.tag===` `&&e[r]===void 0&&n.push(t[i++])}return n}var ae={unified:ne,context:re,normal:j},N=class extends Error{constructor(e){super(`the rendered diff does not say what the change set says (${e})`),this.name=`FormatError`}},oe={" ":`kept`,"-":`removed`,"+":`added`};function P(e,t,n,r){if(n.length===0&&r===``)return;let i;try{i=ee(r)}catch(e){throw new N(`it does not read back (${e.message})`)}if(i.length!==1)throw new N(`${i.length} files read back, not one`);let[{format:a,hunks:o,blocks:s}]=i;if(s.length!==n.length)throw new N(`${s.length} blocks read back, not ${n.length}`);for(let[e,t]of s.entries()){let r=n[e];if(t.a0!==r.a0||t.a1!==r.a1||t.b0!==r.b0||t.b1!==r.b1)throw new N(`block ${e+1} reads back somewhere else`)}for(let n of o){let r=a===`context`&&!n.lines.some(({tag:e})=>e===`-`),i=n.oldStart,o=n.newStart;for(let{tag:a,text:s}of n.lines){if(s!==(a===`+`||a===` `&&r?t[o]:e[i]))throw new N(`a ${oe[a]} line is not the line it stands for`);a!==`+`&&i++,a!==`-`&&o++}}}function se(e,t,n,r){let i=[];for(let a=0;a<e.length;){let o=a;for(;o+1<e.length&&e[o+1].a0-e[o].a1<=2*t;)o++;let s=e[a],c=e[o];i.push({blocks:e.slice(a,o+1),a0:Math.max(0,s.a0-t),a1:Math.min(n,c.a1+t),b0:Math.max(0,s.b0-t),b1:Math.min(r,c.b1+t)}),a=o+1}return i}var F=e=>(t,n,r,{context:i,label:a=null})=>{let o=``;for(let s of se(r,i,t.length,n.length))o+=e(t,n,s,a?a(s.a0):null);return P(t,n,r,o),o},ce=`
7
7
  \
8
8
  `,I=(e,t)=>e+t+(t.endsWith(`
9
9
  `)?``:ce),L=(e,t)=>`${e}${t===null?``:` ${t}`}
@@ -12,4 +12,4 @@ import{f as e,g as t,j as n,k as r,l as i,m as a}from"./chunk-PXK7EU4V.js";var o
12
12
  `);for(let e=o;e<s;e++)r+=I(`> `,t[e])}return P(e,t,n,r),r}var ue=F((e,t,n,r)=>{let i=L(`@@ -${z(n.a0,n.a1)} +${z(n.b0,n.b1)} @@`,r),a=n.a0,o=n.b0;for(let{a0:r,a1:s,b1:c}of n.blocks){for(;a<r;a++,o++)i+=I(` `,e[a]);for(;a<s;a++)i+=I(`-`,e[a]);for(;o<c;o++)i+=I(`+`,t[o])}for(;a<n.a1;a++,o++)i+=I(` `,e[a]);return i}),de=F((e,t,{a0:n,a1:r,b0:i,b1:a,blocks:o},s)=>[L(`***************`,s),`*** ${R(n,r)} ****
13
13
  `,B(e,n,r,o.map(e=>[e.a0,e.a1,e.b0<e.b1]),`- `),`--- ${R(i,a)} ----
14
14
  `,B(t,i,a,o.map(e=>[e.b0,e.b1,e.a0<e.a1]),`+ `)].join(``));function B(e,t,n,r,i){if(!r.some(([e,t])=>e<t))return``;let a=``,o=t;for(let[t,n,s]of r){for(;o<t;o++)a+=I(` `,e[o]);for(;o<n;o++)a+=I(s?`! `:i,e[o])}for(;o<n;o++)a+=I(` `,e[o]);return a}function V(e){let t=[];for(let n=0;;){let r=n;for(;n<e.length&&e[n];)n++;if(t.push(n>r),n===e.length)return t;n++}}function H(e,t,n){let r=t.length,i=V(n),a=0,o=0,s=0,c=()=>{if(a===r||e[s]!==e[a])return!1;for(t[s++]=0,t[a++]=1,o++;a<r&&t[a];)a++;return!0},l=()=>{if(s===0||e[s-1]!==e[a-1])return!1;for(t[--s]=1,t[--a]=0,o--;s>0&&t[s-1];)s--;return!0};for(let e=0;e<r;e++){if(!t[e]){o++;continue}for(s=e,a=e;a<r&&t[a];a++);let n=-1;for(let e=-1;e!==a-s;){for(e=a-s;l(););for(n=i[o]?a:-1;c();)i[o]&&(n=a)}if(n!==-1)for(let e=a-n;e>0;e--)l();e=a-1}}function fe(e){let t=1;for(let n=e;n!==0;n>>=2)t<<=1;return Math.max(256,t)}function U(e,t,{ignoreCase:n=!1,whitespace:r=`none`,minimal:i=!1,discard:a=!0,slide:o=!0,horizon:s=1/0}={}){let c=w({ignoreCase:n,whitespace:r});if(c===null&&J(e,t))return[];let{A:l,B:u,classes:d}=he(e,t,c),f=new Uint8Array(l.length),p=new Uint8Array(u.length),m=pe(e,t,s),[h,g]=i||!a?[null,null]:me(l,u,d,m),_=K(m.lo,m.hiA,h,f),v=K(m.lo,m.hiB,g,p);if(ge(_.map(e=>l[e]),v.map(e=>u[e]),_,v,f,p,i),o){let{lo:e,hiA:t,hiB:n}=m;H(l.subarray(e,t),f.subarray(e,t),p.subarray(e,n)),H(u.subarray(e,n),p.subarray(e,n),f.subarray(e,t))}let y=ye(f,p);return Y(e,t,y,c),y}function pe(e,t,n){let r=Math.min(e.length,t.length),i=0;for(;i<r&&e[i]===t[i];)i++;let a=Math.max(0,i-n),o=0;for(;o<r-a&&e[e.length-1-o]===t[t.length-1-o];)o++;let s=Math.max(0,o-n);return{lo:a,hiA:e.length-s,hiB:t.length-s}}function me(e,t,n,{lo:r,hiA:i,hiB:a}){let o=new Int32Array(n),s=new Int32Array(n);for(let t=r;t<i;t++)o[e[t]]++;for(let e=r;e<a;e++)s[t[e]]++;return[W(e.subarray(r,i),s),W(t.subarray(r,a),o)]}function W(e,t){let n=e.length,r=new Uint8Array(n),i=5;for(let e=Math.floor(n/64)>>2;e>0;e>>=2)i*=2;for(let a=0;a<n;a++){let n=t[e[a]];n===0?r[a]=1:n>i&&(r[a]=2)}for(let e=0;e<n;e++){if(r[e]===2){r[e]=0;continue}if(r[e]===0)continue;let t=e,i=0;for(;t<n&&r[t]!==0;t++)r[t]===2&&i++;for(;t>e&&r[t-1]===2;)r[--t]=0,i--;let a=t-e;if(i*4>a){for(;t>e;)r[--t]===2&&(r[t]=0);continue}let o=1;for(let e=a>>4;e>0;e>>=2)o<<=1;o++;for(let t=0,n=0;n<a;n++)r[e+n]===2?o===++t?n-=t:o<t&&(r[e+n]=0):t=0;G(r,e,1,a),G(r,e+a-1,-1,a),e+=a-1}return r}function G(e,t,n,r){for(let i=0,a=0;a<r;a++){let r=t+a*n;if(a>=8&&e[r]===1||(e[r]===2?(i=0,e[r]=0):e[r]===0?i=0:i++,i===3))break}}function K(e,t,n,r){let i=[];for(let a=e;a<t;a++)n!==null&&n[a-e]!==0?r[a]=1:i.push(a);return Int32Array.from(i)}var q=e=>e?(t,n)=>e(t)===e(n):(e,t)=>e===t;function J(e,t,n=null){if(e.length!==t.length)return!1;let r=q(n);for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1;return!0}function he(e,t,n){let r=new Map,i=e=>{let t=n?n(e):e,i=r.get(t);return i===void 0&&(i=r.size,r.set(t,i)),i};return{A:Int32Array.from(e,i),B:Int32Array.from(t,i),classes:r.size}}function ge(e,t,n,r,i,a,o){let s=e.length+t.length+3,c={A:e,B:t,fd:new Int32Array(s),bd:new Int32Array(s),base:t.length+1,limit:fe(e.length+t.length)},l=[{xoff:0,xlim:e.length,yoff:0,ylim:t.length,minimal:o}];for(;l.length;){let{xoff:o,xlim:s,yoff:u,ylim:d,minimal:f}=l.pop();for(;o<s&&u<d&&e[o]===t[u];)o++,u++;for(;o<s&&u<d&&e[s-1]===t[d-1];)s--,d--;if(o===s){for(;u<d;u++)a[r[u]]=1;continue}if(u===d){for(;o<s;o++)i[n[o]]=1;continue}let{xmid:p,ymid:m,loMinimal:h,hiMinimal:g}=_e(c,o,s,u,d,f);l.push({xoff:p,xlim:s,yoff:m,ylim:d,minimal:g}),l.push({xoff:o,xlim:p,yoff:u,ylim:m,minimal:h})}}function _e(e,t,n,r,i,a){let{A:o,B:s,fd:c,bd:l,base:u,limit:d}=e,f=n-r,p=t-i,m=n-i,h=t-r,g=m,_=m,v=h,y=h,b=!!(h-m&1);c[u+h]=t,l[u+m]=n;for(let m=1;;m++){y>p?c[u+--y-1]=-1:++y,v<f?c[u+ ++v+1]=-1:--v;for(let e=v;e>=y;e-=2){let t=c[u+e+1],r=c[u+e-1],a=r<t?t:r+1,d=a-e;for(;a<n&&d<i&&o[a]===s[d];)a++,d++;if(c[u+e]=a,b&&_<=e&&e<=g&&l[u+e]<=a)return{xmid:a,ymid:d,loMinimal:!0,hiMinimal:!0}}_>p?l[u+--_-1]=2147483647:++_,g<f?l[u+ ++g+1]=2147483647:--g;for(let e=g;e>=_;e-=2){let n=l[u+e+1],i=l[u+e-1],a=i<n?i:n-1,d=a-e;for(;t<a&&r<d&&o[a-1]===s[d-1];)a--,d--;if(l[u+e]=a,!b&&y<=e&&e<=v&&a<=c[u+e])return{xmid:a,ymid:d,loMinimal:!0,hiMinimal:!0}}if(!a&&m>=d)return ve(e,{xoff:t,xlim:n,yoff:r,ylim:i,fmin:y,fmax:v,bmin:_,bmax:g})}}function ve(e,t){let{fd:n,bd:r,base:i}=e,{xoff:a,xlim:o,yoff:s,ylim:c,fmin:l,fmax:u,bmin:d,bmax:f}=t,p=0,m=-1;for(let e=u;e>=l;e-=2){let t=Math.min(n[i+e],o),r=t-e;c<r&&(t=c+e,r=c),m<t+r&&(m=t+r,p=t)}let h=0,g=2147483647;for(let e=f;e>=d;e-=2){let t=Math.max(a,r[i+e]),n=t-e;n<s&&(t=s+e,n=s),t+n<g&&(g=t+n,h=t)}return o+c-g<m-(a+s)?{xmid:p,ymid:m-p,loMinimal:!0,hiMinimal:!1}:{xmid:h,ymid:g-h,loMinimal:!1,hiMinimal:!0}}function ye(e,t){let n=[],r=t.length,i=e.length,a=0,o=0;for(;a<i||o<r;){if(a<i&&o<r&&!e[a]&&!t[o]){a++,o++;continue}let s=a,c=o;for(;a<i&&e[a];)a++;for(;o<r&&t[o];)o++;if(s===a&&c===o)throw new X(`a kept line has no counterpart`);n.push({a0:s,a1:a,b0:c,b1:o})}return n}function Y(e,t,n,r=null){let i=q(r),a=0,o=0;for(let{a0:r,a1:s,b0:c,b1:l}of n){if(r<a||c<o||s<r||l<c||s>e.length||l>t.length)throw new X(`a block is out of order or out of range`);if(r===s&&c===l)throw new X(`a block changes nothing`);if(r-a!==c-o)throw new X(`the kept lines before a block differ in count`);for(;a<r;a++,o++)if(!i(e[a],t[o]))throw new X(`kept line ${a+1} does not match`);a=s,o=l}if(e.length-a!==t.length-o)throw new X(`the kept lines after the last block differ in count`);for(;a<e.length;a++,o++)if(!i(e[a],t[o]))throw new X(`kept line ${a+1} does not match`)}var X=class extends Error{constructor(e){super(`the computed change set does not reconstruct the second file (${e})`),this.name=`DiffError`}},Z={unified:ue,context:de,normal:le};function Q(e){if(!Object.hasOwn(Z,e))throw RangeError(`a change set prints as unified, context or normal, not ${e}`);return Z[e]}function $(e,t){if(!(Number.isInteger(e)&&e>=0)&&e!==1/0)throw RangeError(`${t} is a number of lines, not ${e}`);return e}function be(e,t,n){if(e===t)return``;let r=w(n);return r===null||!J(T(e),T(t),r)?`Files differ
15
- `:``}function xe(e,t,{format:n=`unified`,context:r=3,label:i=null,horizon:a=0,...o}={}){if(n===`brief`)return be(e,t,o);let s=Q(n),c=T(e),l=T(t),u=n===`normal`?$(a,`horizon`):Math.max($(a,`horizon`),$(r,`context`));return s(c,l,U(c,l,{...o,horizon:u}),{context:r,label:i})}function Se(e,t,{horizon:n=3,...r}={}){let i=T(e),a=T(t);return U(i,a,{...r,horizon:$(n,`horizon`)}).map(({a0:e,a1:t,b0:n,b1:r})=>({a0:e,a1:t,b0:n,b1:r,remove:i.slice(e,t),insert:a.slice(n,r)}))}function Ce(e,t,n,{format:r=`unified`,context:i=3,label:a=null,...o}={}){let s=Q(r),c=T(e),l=T(t);return Y(c,l,n,w(o)),s(c,l,n,{context:i,label:a})}export{X as a,o as b,s as c,u as d,N as e,xe as f,Se as g,Ce as h,_ as i,v as j,y as k,b as l};
15
+ `:``}function xe(e,t,{format:n=`unified`,context:r=3,label:i=null,horizon:a=0,...o}={}){if(n===`brief`)return be(e,t,o);let s=Q(n),c=T(e),l=T(t),u=n===`normal`?$(a,`horizon`):Math.max($(a,`horizon`),$(r,`context`));return s(c,l,U(c,l,{...o,horizon:u}),{context:r,label:i})}function Se(e,t,{horizon:n=3,...r}={}){let i=T(e),a=T(t);return U(i,a,{...r,horizon:$(n,`horizon`)}).map(({a0:e,a1:t,b0:n,b1:r})=>({a0:e,a1:t,b0:n,b1:r,remove:i.slice(e,t),insert:a.slice(n,r)}))}function Ce(e,t,n,{format:r=`unified`,context:i=3,label:a=null,...o}={}){let s=Q(r),c=T(e),l=T(t);return Y(c,l,n,w(o)),s(c,l,n,{context:i,label:a})}export{f as a,p as b,m as c,h as d,X as e,g as f,_ as g,b as h,N as i,xe as j,Se as k,Ce as l};