@jxsuite/compiler 0.28.0 → 0.28.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,373 +1,290 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as zJ}from"node:module";var eZ=Object.create;var{getPrototypeOf:ZJ,defineProperty:N6,getOwnPropertyNames:JJ}=Object;var XJ=Object.prototype.hasOwnProperty;function qJ(Z){return this[Z]}var WJ,QJ,F7=(Z,J,X)=>{var q=Z!=null&&typeof Z==="object";if(q){var W=J?WJ??=new WeakMap:QJ??=new WeakMap,Q=W.get(Z);if(Q)return Q}X=Z!=null?eZ(ZJ(Z)):{};let G=J||!Z||!Z.__esModule?N6(X,"default",{value:Z,enumerable:!0}):X;for(let z of JJ(Z))if(!XJ.call(G,z))N6(G,z,{get:qJ.bind(Z,z),enumerable:!0});if(q)W.set(Z,G);return G};var b=(Z,J)=>()=>(J||Z((J={exports:{}}).exports,J),J.exports);var GJ=(Z)=>Z;function YJ(Z,J){this[Z]=GJ.bind(null,J)}var T6=(Z,J)=>{for(var X in J)N6(Z,X,{get:J[X],enumerable:!0,configurable:!0,set:YJ.bind(J,X)})};var O=(Z,J)=>()=>(Z&&(J=Z(Z=0)),J);var m=zJ(import.meta.url);function G4(Z){return A7.has(Z)}function _0(Z,J,X,q){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return t0(Z,J,X,q);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return KJ(Z.$ref,J,X,q);if(Array.isArray(Z))return Z.map((W)=>_0(W,J,X,q));return Z}function KJ(Z,J,X,q){if(Z==="$reduce/acc")return q?.acc;if(Z.startsWith("$reduce/"))return q?.acc;if(Z.startsWith("event#/")){let W=Z.slice(7);return N4(X,W)}if(Z.startsWith("$map/")){let W=Z.split("/"),Q=W[1],G;if(Q==="item")G=q?.item??J.$map?.item??J["$map/item"];else if(Q==="index")G=q?.index??J.$map?.index??J["$map/index"];else G=J.$map?.[Q]??J["$map/"+Q];return W.length>2?N4(G,W.slice(2).join("/")):G}if(Z.startsWith("#/state/")){let W=Z.slice(8),Q=W.indexOf("/");if(Q<0)return J[W];return N4(J[W.slice(0,Q)],W.slice(Q+1))}if(Z.startsWith("parent#/"))return J[Z.slice(8)];if(Z.startsWith("window#/"))return N4(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return N4(globalThis.document,Z.slice(10));return J[Z]??null}function VJ(Z,J,X,q){if(Z.startsWith("$map/")){let W=Z.split("/"),Q=W[1],G;if(Q==="item")G=q?.item??J.$map?.item??J["$map/item"];else if(Q==="index")G=q?.index??J.$map?.index??J["$map/index"];else G=J.$map?.[Q]??J["$map/"+Q];if(W.length>2){let z=W.slice(2),Y=z.pop();return{obj:z.length>0?N4(G,z.join("/")):G,key:Y}}return{obj:J.$map??J,key:Q==="item"?"$map/item":"$map/index"}}if(Z.startsWith("#/state/")){let W=Z.slice(8);if(W.indexOf("/")<0)return{obj:J,key:W};let G=W.split("/"),z=G.pop(),Y=J;for(let U of G)Y=Y[U];return{obj:Y,key:z}}return{obj:J,key:Z}}function t0(Z,J,X,q){let{operator:W,target:Q,value:G,initial:z}=Z;if(!UJ.has(W))throw Error(`$expression: unknown operator "${W}"`);if(R6.has(W)&&!("value"in Z)){let Y=_0(Q,J,X,q);if(W==="!")return!Y;if(W==="-")return-Y}if(P6.has(W)){let Y=_0(Q,J,X,q),U=_0(G,J,X,q);switch(W){case"+":return Y+U;case"-":return Y-U;case"*":return Y*U;case"/":return Y/U;case"%":return Y%U;case"===":return Y===U;case"!==":return Y!==U;case"<":return Y<U;case"<=":return Y<=U;case">":return Y>U;case">=":return Y>=U;case"&&":return Y&&U;case"||":return Y||U}}if(L7.has(W)){let Y=_0(G,J,X,q),{obj:U,key:K}=VJ(Q.$ref,J,X,q);switch(W){case"=":U[K]=Y;break;case"+=":U[K]+=Y;break;case"-=":U[K]-=Y;break;case"*=":U[K]*=Y;break;case"/=":U[K]/=Y;break}return}if(I7.has(W)){let Y=_0(Q,J,X,q);switch(W){case"push":return Y.push(_0(G,J,X,q));case"unshift":return Y.unshift(_0(G,J,X,q));case"pop":return Y.pop();case"shift":return Y.shift();case"splice":{let U=_0(G,J,X,q);return Y.splice(...U)}}}if(j6.has(W)){let Y=_0(Q,J,X,q);if(W==="reduce"){let U=_0(z,J,X,q);return Y.reduce((K,V,H)=>{return t0(G,J,X,{acc:K,item:V,index:H})},U)}if(W==="map")return Y.map((U,K)=>{return t0(G,J,X,{...q,item:U,index:K})});if(W==="filter")return Y.filter((U,K)=>{return t0(G,J,X,{...q,item:U,index:K})})}return}function N0(Z,J){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return L0(Z,J);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return D7(Z.$ref,J);if(Array.isArray(Z))return Z.map((X)=>N0(X,J)).join(", ");return JSON.stringify(Z)}function D7(Z,J){let X=J.statePrefix??"state",q=J.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("event#/")){let W=Z.slice(7);return`${q}.${W.replace(/\//g,".")}`}if(Z.startsWith("$map/")){let W=Z.split("/"),Q=W[1];if(Q==="item")return W.length>2?`_item.${W.slice(2).join(".")}`:"_item";if(Q==="index")return"_index";return`_${Q}`}if(Z.startsWith("#/state/")){let W=Z.slice(8);return`${X}.${W.replace(/\//g,".")}`}if(Z.startsWith("parent#/"))return`${X}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replace(/\//g,".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replace(/\//g,".")}`;return`${X}.${Z}`}function M7(Z,J){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return D7(Z.$ref,J);return N0(Z,J)}function L0(Z,J={}){let{operator:X,target:q,value:W,initial:Q}=Z;if(R6.has(X)&&!("value"in Z)){let G=N0(q,J);if(X==="!")return`!(${G})`;if(X==="-")return`-(${G})`}if(P6.has(X)){let G=N0(q,J),z=N0(W,J);return`(${G} ${X} ${z})`}if(L7.has(X)){let G=M7(q,J),z=N0(W,J);return`${G} ${X} ${z}`}if(I7.has(X)){let G=M7(q,J);switch(X){case"push":return`${G}.push(${N0(W,J)})`;case"unshift":return`${G}.unshift(${N0(W,J)})`;case"pop":return`${G}.pop()`;case"shift":return`${G}.shift()`;case"splice":{let z=Array.isArray(W)?W.map((Y)=>N0(Y,J)).join(", "):N0(W,J);return`${G}.splice(${z})`}}}if(j6.has(X)){let G=N0(q,J),z=L0(W,J);if(X==="reduce"){let Y=N0(Q,J);return`${G}.reduce((_acc, _item, _index) => ${z}, ${Y})`}if(X==="map")return`${G}.map((_item, _index) => ${z})`;if(X==="filter")return`${G}.filter((_item, _index) => ${z})`}return"undefined"}function N4(Z,J){return J.split(/[./]/).reduce((X,q)=>X?.[q],Z)}var A7,R6,P6,L7,I7,j6,UJ;var _6=O(()=>{A7=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),R6=new Set(["!","-"]),P6=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),L7=new Set(["=","+=","-=","*=","/="]),I7=new Set(["push","pop","shift","unshift","splice"]),j6=new Set(["reduce","map","filter"]),UJ=new Set([...A7,...R6,...P6,...j6])});function BJ(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function I0(Z){return Z.replace(/[A-Z]/g,(J)=>`-${J.toLowerCase()}`)}function H0(Z){return Object.entries(Z).filter(([J,X])=>!BJ(J)&&(X===null||typeof X!=="object")).map(([J,X])=>`${I0(J)}: ${X}`).join("; ")}var Y4;var j1=O(()=>{_6();Y4=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"])});function P4(Z){for(let J of Object.keys(Z))if(!HJ.has(J))return!1;return!0}function v(Z){return typeof Z==="string"&&Z.includes("${")}function O6(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[J,X]of Object.entries(Z.state)){if(J==="$site"||J==="$page")continue;if(X&&typeof X==="object"&&!Array.isArray(X)&&X.timing==="compiler")continue;if(typeof X!=="object"||X===null||Array.isArray(X))return!0;if(X.$prototype)return!0;if("default"in X)return!0;if(P4(X))continue;return!0}if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;if(Array.isArray(Z.children)){if(Z.children.some((J)=>O6(J)))return!0}for(let[J,X]of Object.entries(Z)){if(Y4.has(J))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(v(X))return!0}if(Z.style&&typeof Z.style==="object"){for(let J of Object.values(Z.style))if(v(J))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let J of Object.values(Z.attributes))if(v(J))return!0}return!1}function N7(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;for(let[J,X]of Object.entries(Z)){if(Y4.has(J))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(v(X))return!0}if(Z.style&&typeof Z.style==="object"){for(let J of Object.values(Z.style))if(v(J))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let J of Object.values(Z.attributes))if(v(J))return!0}return!1}function j4(Z,J=null,X={},q={}){return{scope:Z?.state?_4(Z.state,J):J??Object.create(null),scopeDefs:X,media:q}}function _4(Z={},J=null){let X=Object.create(J??null);for(let[q,W]of Object.entries(Z)){if(typeof W!=="object"||W===null||Array.isArray(W)){z4(X,q,_1(W));continue}let Q=W;if("default"in Q){z4(X,q,_1(Q.default));continue}if(!Q.$prototype&&!("$expression"in Q)&&!P4(Q))z4(X,q,_1(Q))}for(let[q,W]of Object.entries(Z)){if(typeof W==="string"&&v(W)){C6(X,q,()=>G0(W,X));continue}if(!W||typeof W!=="object")continue;let Q=W;if("$expression"in Q){let G=Q.$expression;if(G4(G.operator))z4(X,q,(z,Y)=>t0(G,z,Y));else C6(X,q,()=>t0(G,X,null));continue}if(Q.$prototype==="Function"){if(Q.body){let G=Function("state",...Q.parameters??Q.arguments??[],Q.body);if(Q.body.includes("return"))C6(X,q,()=>G(X));else z4(X,q,G)}else if(!Q.body?.includes("return"))z4(X,q,()=>{});continue}if(Q.$prototype==="LocalStorage"||Q.$prototype==="SessionStorage")z4(X,q,_1(Q.default??null))}return X}function z4(Z,J,X){Object.defineProperty(Z,J,{value:X,enumerable:!0,configurable:!0,writable:!0})}function C6(Z,J,X){Object.defineProperty(Z,J,{enumerable:!0,configurable:!0,get:X})}function o(Z,J){if(c0(Z))return x6(Z.$ref,J);if(v(Z))return G0(Z,J);return Z}function c0(Z){return Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string"}function x6(Z,J){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let X=Z.split("/"),q=X[1],W=J.$map?.[q]??J["$map/"+q];return X.length>2?w7(W,X.slice(2).join("/")):W}if(Z.startsWith("#/state/")){let X=Z.slice(8),q=X.indexOf("/");if(q<0)return J[X];return w7(J[X.slice(0,q)],X.slice(q+1))}return J[Z]??null}function G0(Z,J){try{let X=Z.match(/^\$\{(.+)\}$/s);if(X)return Function("state","$map",`return (${X[1]})`)(J,J?.$map);return Function("state","$map",`return \`${Z}\``)(J,J?.$map)}catch{return null}}function w7(Z,J){if(!J)return Z;return J.split("/").reduce((X,q)=>X==null?void 0:X[q],Z)}function _1(Z){if(Z===null||typeof Z!=="object")return Z;return JSON.parse(JSON.stringify(Z))}function J1(Z,J){let X="",q=o(Z.id,J),W=o(Z.className,J),Q=o(Z.hidden,J),G=o(Z.tabIndex,J),z=o(Z.title,J),Y=o(Z.lang,J),U=o(Z.dir,J);if(q)X+=` id="${f(String(q))}"`;if(W)X+=` class="${f(String(W))}"`;if(Q)X+=" hidden";if(G!==void 0&&G!==null)X+=` tabindex="${f(String(G))}"`;if(z)X+=` title="${f(String(z))}"`;if(Y)X+=` lang="${f(String(Y))}"`;if(U)X+=` dir="${f(String(U))}"`;if(Z.style&&J){let K=Object.entries(Z.style).filter(([V,H])=>!V.startsWith(":")&&!V.startsWith(".")&&!V.startsWith("&")&&!V.startsWith("[")&&!V.startsWith("@")&&H!==null&&typeof H!=="object"&&typeof H==="string"&&v(H)).map(([V,H])=>{let $=o(H,J);return $==null?null:`${I0(V)}: ${$}`}).filter(Boolean).join("; ");if(K)X+=` style="${K}"`}if(Z.attributes)for(let[K,V]of Object.entries(Z.attributes)){let H=o(V,J);if(H!==null&&H!==void 0&&(typeof H==="string"||typeof H==="number"||typeof H==="boolean"))X+=` ${K}="${f(String(H))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)X+=' loading="lazy"';if(!Z.attributes?.decoding)X+=' decoding="async"'}if(Z.$static)X+=" data-jx-static";else if(Z.$prerendered)X+=" data-jx-prerendered";return X}function C4(Z,J={},X=null){let q=[];if(X&&typeof X==="object"){let Q=function(K,V){let H=H0(V);if(H)q.push(`${K} { ${H} }`);for(let[$,A]of Object.entries(V)){if(A===null||typeof A!=="object"||Array.isArray(A))continue;if($.startsWith("@")){let L=$.startsWith("@--")?`@media ${J[$.slice(1)]??$.slice(1)}`:$,w=H0(A);if(w)q.push(`${L} { ${K} { ${w} } }`);for(let[I,j]of Object.entries(A)){if(j===null||typeof j!=="object"||Array.isArray(j))continue;if(I.startsWith("@"))continue;let g=I.startsWith("&")?I.replace("&",K):I.startsWith(":")||I.startsWith(".")||I.startsWith("[")?`${K}${I}`:`${K} ${I}`,y=H0(j);if(y)q.push(`${L} { ${g} { ${y} } }`)}continue}let D=$.startsWith("&")?$.replace("&",K):$.startsWith(":")||$.startsWith(".")||$.startsWith("[")?`${K}${$}`:`${K} ${$}`;Q(D,A)}};for(let[K,V]of Object.entries(X))if(K.startsWith(":")||K.startsWith(".")||K.startsWith("["))Q(K,V);else if(V!==null&&typeof V==="object"&&!Array.isArray(V)&&!K.startsWith("@")&&!K.startsWith("--"))Q(K,V);else if(K.startsWith("@")){let H=K.startsWith("@--")?`@media ${J[K.slice(1)]??K.slice(1)}`:K.startsWith("@(")?`@media ${K.slice(1)}`:K;q.push(`${H} { body { ${H0(V)} } }`)}let G={},z={};for(let[K,V]of Object.entries(X)){if(K.startsWith(":")||K.startsWith(".")||K.startsWith("[")||K.startsWith("@"))continue;if(V!==null&&typeof V==="object"&&!Array.isArray(V))continue;if(K.startsWith("--"))G[K]=V;else z[K]=V}let Y=H0(G);if(Y)q.push(`:root { ${Y} }`);let U=H0(z);if(U)q.push(`body { ${U} }`)}if(X1(Z,q,J,"",{n:0}),q.length===0)return"";return`<style>
3
- ${q.join(`
2
+ import{createRequire as kq}from"node:module";var Tq=Object.create;var{getPrototypeOf:Rq,defineProperty:d1,getOwnPropertyNames:_q}=Object;var Pq=Object.prototype.hasOwnProperty;function jq(Z){return this[Z]}var Eq,Cq,B4=(Z,X,q)=>{var W=Z!=null&&typeof Z==="object";if(W){var Q=X?Eq??=new WeakMap:Cq??=new WeakMap,J=Q.get(Z);if(J)return J}q=Z!=null?Tq(Rq(Z)):{};let z=X||!Z||!Z.__esModule?d1(q,"default",{value:Z,enumerable:!0}):q;for(let Y of _q(Z))if(!Pq.call(z,Y))d1(z,Y,{get:jq.bind(Z,Y),enumerable:!0});if(W)Q.set(Z,z);return z};var E=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports);var Oq=(Z)=>Z;function xq(Z,X){this[Z]=Oq.bind(null,X)}var f4=(Z,X)=>{for(var q in X)d1(Z,q,{get:X[q],enumerable:!0,configurable:!0,set:xq.bind(X,q)})};var R=(Z,X)=>()=>(Z&&(X=Z(Z=0)),X);var q0=kq(import.meta.url);function c1(Z){let X=Z.$map;return X&&typeof X==="object"?X:void 0}function L6(Z){return p3.has(Z)}function C0(Z,X,q,W){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return Q6(Z,X,q,W);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return bq(Z.$ref,X,q,W);if(Array.isArray(Z))return Z.map((Q)=>C0(Q,X,q,W));return Z}function bq(Z,X,q,W){if(Z==="$reduce/acc")return W?.acc;if(Z.startsWith("$reduce/"))return W?.acc;if(Z.startsWith("event#/")){let Q=Z.slice(7);return S6(q,Q)}if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q,z,Y=c1(X);if(J==="item")z=W?.item??Y?.item??X["$map/item"];else if(J==="index")z=W?.index??Y?.index??X["$map/index"];else z=Y?.[J]??X[`$map/${J}`];return Q.length>2?S6(z,Q.slice(2).join("/")):z}if(Z.startsWith("#/state/")){let Q=Z.slice(8),J=Q.indexOf("/");if(J===-1)return X[Q];return S6(X[Q.slice(0,J)],Q.slice(J+1))}if(Z.startsWith("parent#/"))return X[Z.slice(8)];if(Z.startsWith("window#/"))return S6(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return S6(globalThis.document,Z.slice(10));return X[Z]??null}function vq(Z,X,q,W){if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q,z,Y=c1(X);if(J==="item")z=W?.item??Y?.item??X["$map/item"];else if(J==="index")z=W?.index??Y?.index??X["$map/index"];else z=Y?.[J]??X[`$map/${J}`];if(Q.length>2){let U=Q.slice(2),K=U.pop(),V=U.length>0?S6(z,U.join("/")):z;return{key:K,obj:V}}return{key:J==="item"?"$map/item":"$map/index",obj:c1(X)??X}}if(Z.startsWith("#/state/")){let Q=Z.slice(8);if(Q.indexOf("/")===-1)return{key:Q,obj:X};let z=Q.split("/"),Y=z.pop(),U=X;for(let K of z)U=U[K];return{key:Y,obj:U}}return{key:Z,obj:X}}function Q6(Z,X,q,W){let{operator:Q,target:J,value:z,initial:Y}=Z;if(!Sq.has(Q))throw Error(`$expression: unknown operator "${Q}"`);if(l1.has(Q)&&!("value"in Z)){let U=C0(J,X,q,W);if(Q==="!")return!U;if(Q==="-")return-U}if(p1.has(Q)){let U=C0(J,X,q,W),K=C0(z,X,q,W);switch(Q){case"+":return U+K;case"-":return U-K;case"*":return U*K;case"/":return U/K;case"%":return U%K;case"===":return U===K;case"!==":return U!==K;case"<":return U<K;case"<=":return U<=K;case">":return U>K;case">=":return U>=K;case"&&":return U&&K;case"||":return U||K;default:break}}if(n3.has(Q)){let U=C0(z,X,q,W),{obj:K,key:V}=vq(J.$ref,X,q,W);switch(Q){case"=":{K[V]=U;break}case"+=":{let B=K[V];K[V]=B+U;break}case"-=":{let B=K[V];K[V]=B-U;break}case"*=":{let B=K[V];K[V]=B*U;break}case"/=":{let B=K[V];K[V]=B/U;break}default:break}return}if(i3.has(Q)){let U=C0(J,X,q,W);switch(Q){case"push":return U.push(C0(z,X,q,W));case"unshift":return U.unshift(C0(z,X,q,W));case"pop":return U.pop();case"shift":return U.shift();case"splice":{let K=C0(z,X,q,W);return U.splice(...K)}default:break}}if(n1.has(Q)){let U=C0(J,X,q,W);if(Q==="reduce"){let K=C0(Y,X,q,W);for(let[V,B]of U.entries())K=Q6(z,X,q,{acc:K,index:V,item:B});return K}if(Q==="map")return U.map((K,V)=>Q6(z,X,q,{...W,index:V,item:K}));if(Q==="filter")return U.filter((K,V)=>Q6(z,X,q,{...W,index:V,item:K}))}return}function N0(Z,X){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return T0(Z,X);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return r3(Z.$ref,X);if(Array.isArray(Z))return Z.map((q)=>N0(q,X)).join(", ");return JSON.stringify(Z)}function r3(Z,X){let q=X.statePrefix??"state",W=X.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("event#/")){let Q=Z.slice(7);return`${W}.${Q.replaceAll("/",".")}`}if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q;if(J==="item")return Q.length>2?`_item.${Q.slice(2).join(".")}`:"_item";if(J==="index")return"_index";return`_${J}`}if(Z.startsWith("#/state/")){let Q=Z.slice(8);return`${q}.${Q.replaceAll("/",".")}`}if(Z.startsWith("parent#/"))return`${q}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replaceAll("/",".")}`;return`${q}.${Z}`}function l3(Z,X){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return r3(Z.$ref,X);return N0(Z,X)}function T0(Z,X={}){let{operator:q,target:W,value:Q,initial:J}=Z;if(l1.has(q)&&!("value"in Z)){let z=N0(W,X);if(q==="!")return`!(${z})`;if(q==="-")return`-(${z})`}if(p1.has(q)){let z=N0(W,X),Y=N0(Q,X);return`(${z} ${q} ${Y})`}if(n3.has(q)){let z=l3(W,X),Y=N0(Q,X);return`${z} ${q} ${Y}`}if(i3.has(q)){let z=l3(W,X);switch(q){case"push":return`${z}.push(${N0(Q,X)})`;case"unshift":return`${z}.unshift(${N0(Q,X)})`;case"pop":return`${z}.pop()`;case"shift":return`${z}.shift()`;case"splice":{let Y=Array.isArray(Q)?Q.map((U)=>N0(U,X)).join(", "):N0(Q,X);return`${z}.splice(${Y})`}default:break}}if(n1.has(q)){let z=N0(W,X),Y=T0(Q,X);if(q==="reduce"){let U=N0(J,X);return`${z}.reduce((_acc, _item, _index) => ${Y}, ${U})`}if(q==="map")return`${z}.map((_item, _index) => ${Y})`;if(q==="filter")return`${z}.filter((_item, _index) => ${Y})`}return"undefined"}function S6(Z,X){let q=Z;for(let W of X.split(/[./]/))q=q?.[W];return q}var p3,l1,p1,n3,i3,n1,Sq;var i1=R(()=>{p3=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),l1=new Set(["!","-"]),p1=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),n3=new Set(["=","+=","-=","*=","/="]),i3=new Set(["push","pop","shift","unshift","splice"]),n1=new Set(["reduce","map","filter"]),Sq=new Set([...p3,...l1,...p1,...n1])});function M0(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function L0(Z){return M0(Z)&&typeof Z.$ref==="string"}function i0(Z){return M0(Z)&&Z.$prototype==="Function"}function O0(Z){return M0(Z)&&M0(Z.$expression)}function I6(Z){return M0(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function r1(Z){return M0(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function a3(Z){return M0(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function J6(Z){if(!M0(Z))return!1;for(let X of Object.keys(Z))if(!s3.has(X))return!1;return!0}function w6(Z){return M0(Z)&&Z.$prototype==="Array"}function o3(Z){return M0(Z)&&Z.$prototype==="Class"}function x(Z){return typeof Z==="string"&&Z.includes("${")}function z6(Z){if(!Z)return[];return Z.map((X)=>typeof X==="string"?X:X.name)}var s3;var S0=R(()=>{s3=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function yq(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function I0(Z){return Z.replaceAll(/[A-Z]/g,(X)=>`-${X.toLowerCase()}`)}function B0(Z){return Object.entries(Z).filter(([X,q])=>!yq(X)&&(q===null||typeof q!=="object")).map(([X,q])=>`${I0(X)}: ${q}`).join("; ")}var D6;var u4=R(()=>{i1();S0();D6=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"])});function o1(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[X,q]of Object.entries(Z.state)){if(X==="$site"||X==="$page")continue;if(q&&typeof q==="object"&&!Array.isArray(q)&&q.timing==="compiler")continue;if(typeof q!=="object"||q===null||Array.isArray(q))return!0;if(q.$prototype)return!0;if("default"in q)return!0;if(J6(q))continue;return!0}if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;if(Array.isArray(Z.children)&&Z.children.some((X)=>o1(X)))return!0;for(let[X,q]of Object.entries(Z)){if(D6.has(X))continue;if(q!==null&&typeof q==="object"&&typeof q.$ref==="string")return!0;if(x(q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(x(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(x(X))return!0}return!1}function e3(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;for(let[X,q]of Object.entries(Z)){if(D6.has(X))continue;if(q!==null&&typeof q==="object"&&typeof q.$ref==="string")return!0;if(x(q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(x(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(x(X))return!0}return!1}function h6(Z,X=null,q={},W={}){let Q=Z?.state?m6(Z.state,X):X??Object.create(null);return{media:W,scope:Q,scopeDefs:q}}function m6(Z={},X=null){let q=Object.create(X??null);for(let[W,Q]of Object.entries(Z)){if(typeof Q!=="object"||Q===null||Array.isArray(Q)){N6(q,W,d4(Q));continue}let J=Q;if("default"in J){N6(q,W,d4(J.default));continue}if(!J.$prototype&&!("$expression"in J)&&!J6(J))N6(q,W,d4(J))}for(let[W,Q]of Object.entries(Z)){if(typeof Q==="string"&&x(Q)){a1(q,W,()=>Y0(Q,q));continue}if(!Q||typeof Q!=="object")continue;if(O0(Q)){let J=Q.$expression;if(L6(J.operator))N6(q,W,(z,Y)=>Q6(J,z,Y));else a1(q,W,()=>Q6(J,q,null));continue}if(i0(Q)){if(Q.body){let J=Q.parameters?z6(Q.parameters):Q.arguments??[],z=Function("state",...J,Q.body);if(Q.body.includes("return"))a1(q,W,()=>z(q));else N6(q,W,z)}else N6(q,W,()=>{});continue}if(I6(Q)&&(Q.$prototype==="LocalStorage"||Q.$prototype==="SessionStorage"))N6(q,W,d4(Q.default??null))}return q}function N6(Z,X,q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,value:q,writable:!0})}function a1(Z,X,q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,get:q})}function p(Z,X){if(b0(Z))return t1(Z.$ref,X);if(x(Z))return Y0(Z,X);return Z}function b0(Z){return L0(Z)}function t1(Z,X){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let q=Z.split("/"),[,W]=q,Q=X.$map?.[W]??X[`$map/${W}`];return q.length>2?t3(Q,q.slice(2).join("/")):Q}if(Z.startsWith("#/state/")){let q=Z.slice(8),W=q.indexOf("/");if(W===-1)return X[q];return t3(X[q.slice(0,W)],q.slice(W+1))}return X[Z]??null}function Y0(Z,X){try{let q=Z.match(/^\$\{(.+)\}$/s);if(q)return Function("state","$map",`return (${q[1]})`)(X,X?.$map);return Function("state","$map",`return \`${Z}\``)(X,X?.$map)}catch{return null}}function t3(Z,X){if(!X)return Z;let q=Z;for(let W of X.split("/"))q=q==null?void 0:q[W];return q}function d4(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function v6(Z,X){let q="",W=p(Z.id,X),Q=p(Z.className,X),J=p(Z.hidden,X),z=p(Z.tabIndex,X),Y=p(Z.title,X),U=p(Z.lang,X),K=p(Z.dir,X);if(W)q+=` id="${y(String(W))}"`;if(Q)q+=` class="${y(String(Q))}"`;if(J)q+=" hidden";if(z!==void 0&&z!==null)q+=` tabindex="${y(String(z))}"`;if(Y)q+=` title="${y(String(Y))}"`;if(U)q+=` lang="${y(String(U))}"`;if(K)q+=` dir="${y(String(K))}"`;if(Z.style&&X){let V=Object.entries(Z.style).filter(([B,H])=>!B.startsWith(":")&&!B.startsWith(".")&&!B.startsWith("&")&&!B.startsWith("[")&&!B.startsWith("@")&&H!==null&&typeof H!=="object"&&typeof H==="string"&&x(H)).map(([B,H])=>{let $=p(H,X);return $==null?null:`${I0(B)}: ${$}`}).filter(Boolean).join("; ");if(V)q+=` style="${V}"`}if(Z.attributes)for(let[V,B]of Object.entries(Z.attributes)){let H=p(B,X);if(H!==null&&H!==void 0&&(typeof H==="string"||typeof H==="number"||typeof H==="boolean"))q+=` ${V}="${y(String(H))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)q+=' loading="lazy"';if(!Z.attributes?.decoding)q+=' decoding="async"'}if(Z.$static)q+=" data-jx-static";else if(Z.$prerendered)q+=" data-jx-prerendered";return q}function f6(Z,X={},q=null){let W=[];if(q&&typeof q==="object"){let J=(V,B)=>{let H=B0(B);if(H)W.push(`${V} { ${H} }`);for(let[$,F]of Object.entries(B)){if(F===null||typeof F!=="object"||Array.isArray(F))continue;if($.startsWith("@")){let A=$.startsWith("@--")?`@media ${X[$.slice(1)]??$.slice(1)}`:$,I=B0(F);if(I)W.push(`${A} { ${V} { ${I} } }`);for(let[M,_]of Object.entries(F)){if(_===null||typeof _!=="object"||Array.isArray(_))continue;if(M.startsWith("@"))continue;let k=M.startsWith("&")?M.replace("&",V):M.startsWith(":")||M.startsWith(".")||M.startsWith("[")?`${V}${M}`:`${V} ${M}`,b=B0(_);if(b)W.push(`${A} { ${k} { ${b} } }`)}continue}let L=$.startsWith("&")?$.replace("&",V):$.startsWith(":")||$.startsWith(".")||$.startsWith("[")?`${V}${$}`:`${V} ${$}`;J(L,F)}};for(let[V,B]of Object.entries(q))if(V.startsWith(":")||V.startsWith(".")||V.startsWith("["))J(V,B);else if(B!==null&&typeof B==="object"&&!Array.isArray(B)&&!V.startsWith("@")&&!V.startsWith("--"))J(V,B);else if(V.startsWith("@")){let H=V.startsWith("@--")?`@media ${X[V.slice(1)]??V.slice(1)}`:V.startsWith("@(")?`@media ${V.slice(1)}`:V;W.push(`${H} { body { ${B0(B)} } }`)}let z={},Y={};for(let[V,B]of Object.entries(q)){if(V.startsWith(":")||V.startsWith(".")||V.startsWith("[")||V.startsWith("@"))continue;if(B!==null&&typeof B==="object"&&!Array.isArray(B))continue;if(V.startsWith("--"))z[V]=B;else Y[V]=B}let U=B0(z);if(U)W.push(`:root { ${U} }`);let K=B0(Y);if(K)W.push(`body { ${K} }`)}if(G6(Z,W,X,"",{n:0}),W.length===0)return"";return`<style>
3
+ ${W.join(`
4
4
  `)}
5
- </style>`}function T7(Z,J,X,q){let W=H0(J);if(W)X.push(`${Z} { ${W} }`);for(let[Q,G]of Object.entries(J)){if(G===null||typeof G!=="object"||Array.isArray(G))continue;if(Q.startsWith("@")){let Y=Q.startsWith("@--")?`@media ${q[Q.slice(1)]??Q.slice(1)}`:Q.startsWith("@(")?`@media ${Q.slice(1)}`:Q,U=H0(G);if(U)X.push(`${Y} { ${Z} { ${U} } }`);for(let[K,V]of Object.entries(G)){if(V===null||typeof V!=="object"||Array.isArray(V))continue;if(K.startsWith("@"))continue;let H=K.startsWith("&")?K.replace("&",Z):K.startsWith(":")||K.startsWith(".")||K.startsWith("[")?`${Z}${K}`:`${Z} ${K}`,$=H0(V);if($)X.push(`${Y} { ${H} { ${$} } }`)}continue}let z=Q.startsWith("&")?Q.replace("&",Z):Q.startsWith(":")||Q.startsWith(".")||Q.startsWith("[")?`${Z}${Q}`:`${Z} ${Q}`;T7(z,G,X,q)}}function X1(Z,J,X,q="",W={n:0},Q="jx"){if(!Z||typeof Z!=="object")return;if(Z.style){if(!Z.id&&!Z.className)Z.className=`${Q}-${W.n++}`}let G=Z.id?`#${Z.id}`:Z.className?`.${Z.className.split(" ")[0]}`:Z.tagName??"*";if(Z.style){let z=[];for(let[Y,U]of Object.entries(Z.style)){if(Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("&")||Y.startsWith("[")||Y.startsWith("@"))continue;if(U===null||typeof U==="object")continue;if(typeof U==="string"&&v(U))continue;z.push(` ${I0(Y)}: ${U};`)}if(z.length>0)J.push(`${G} {
6
- ${z.join(`
5
+ </style>`}function Z8(Z,X,q,W){let Q=B0(X);if(Q)q.push(`${Z} { ${Q} }`);for(let[J,z]of Object.entries(X)){if(z===null||typeof z!=="object"||Array.isArray(z))continue;if(J.startsWith("@")){let U=J.startsWith("@--")?`@media ${W[J.slice(1)]??J.slice(1)}`:J.startsWith("@(")?`@media ${J.slice(1)}`:J,K=B0(z);if(K)q.push(`${U} { ${Z} { ${K} } }`);for(let[V,B]of Object.entries(z)){if(B===null||typeof B!=="object"||Array.isArray(B))continue;if(V.startsWith("@"))continue;let H=V.startsWith("&")?V.replace("&",Z):V.startsWith(":")||V.startsWith(".")||V.startsWith("[")?`${Z}${V}`:`${Z} ${V}`,$=B0(B);if($)q.push(`${U} { ${H} { ${$} } }`)}continue}let Y=J.startsWith("&")?J.replace("&",Z):J.startsWith(":")||J.startsWith(".")||J.startsWith("[")?`${Z}${J}`:`${Z} ${J}`;Z8(Y,z,q,W)}}function G6(Z,X,q,W="",Q,J="jx"){let z=Q??{n:0};if(!Z||typeof Z!=="object")return;if(Z.style&&!Z.id&&!Z.className)Z.className=`${J}-${z.n}`,z.n+=1;let Y=Z.id?`#${Z.id}`:Z.className?`.${Z.className.split(" ")[0]}`:Z.tagName??"*";if(Z.style){let U=[];for(let[K,V]of Object.entries(Z.style)){if(K.startsWith(":")||K.startsWith(".")||K.startsWith("&")||K.startsWith("[")||K.startsWith("@"))continue;if(V===null||typeof V==="object")continue;if(typeof V==="string"&&x(V))continue;U.push(` ${I0(K)}: ${V};`)}if(U.length>0)X.push(`${Y} {
6
+ ${U.join(`
7
7
  `)}
8
- }`);for(let[Y,U]of Object.entries(Z.style)){if(U===null||typeof U!=="object"||Array.isArray(U))continue;if(Y.startsWith("@")){let K=Y.startsWith("@--")?`@media ${X[Y.slice(1)]??Y.slice(1)}`:Y.startsWith("@(")?`@media ${Y.slice(1)}`:Y,V=H0(U);if(V)J.push(`${K} { ${G} { ${V} } }`);for(let[H,$]of Object.entries(U)){if($===null||typeof $!=="object"||Array.isArray($))continue;if(H.startsWith("@"))continue;let A=H.startsWith("&")?H.replace("&",G):H.startsWith(":")||H.startsWith(".")||H.startsWith("[")?`${G}${H}`:`${G} ${H}`;J.push(`${K} { ${A} { ${H0($)} } }`)}}else{let K=Y.startsWith("&")?Y.replace("&",G):Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("[")?`${G}${Y}`:`${G} ${Y}`;T7(K,U,J,X)}}}if(Array.isArray(Z.children))Z.children.forEach((z)=>{X1(z,J,X,G,W,Q)})}function f(Z){return String(Z).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function C1(Z){return Z.split("-").map((J)=>J.charAt(0).toUpperCase()+J.slice(1)).join("")}function E1(Z){let J=new Map;return R7(Z,J),[...J.values()]}function R7(Z,J){if(!Z||typeof Z!=="object")return;if(Z.state)for(let[X,q]of Object.entries(Z.state)){let W=q;if(W&&typeof W==="object"&&W.timing==="server"&&W.$src&&W.$export&&!W.$prototype)J.set(W.$export,{key:X,exportName:W.$export,src:W.$src})}if(Array.isArray(Z.children))Z.children.forEach((X)=>R7(X,J))}function Z1(Z,J,X=null){if(typeof Z==="string"){if(v(Z)&&J){let G=G0(Z,J);return G!=null?f(String(G)):f(Z)}return f(Z)}if(typeof Z==="number"||typeof Z==="boolean")return f(String(Z));if(Array.isArray(Z))return Z.map((G)=>Z1(G,J,X)).join(`
9
- `);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";let q=Z.tagName??"div";if(q==="slot"&&X!=null)return X;let W=J1(Z,J);if($J.has(q))return`<${q}${W}>`;let Q="";if(Z.textContent!==void 0){let G=o(Z.textContent,J);Q=G!=null?f(String(G)):""}else if(Z.innerHTML){let G=o(Z.innerHTML,J);Q=G!=null?String(G):Z.innerHTML}else if(Array.isArray(Z.children))Q=Z.children.map((G)=>Z1(G,J,X)).join(`
10
- `);return`<${q}${W}>${Q}</${q}>`}function P7(Z,J=null,X=null){let q=Z.state??{};if(J){q={...q};for(let[Q,G]of Object.entries(J))if(Q in q){let z=q[Q];if(z&&typeof z==="object"&&!Array.isArray(z)&&"default"in z)q[Q]={...z,default:G};else q[Q]=G}else q[Q]=G}let W=_4(q,null);if(!Array.isArray(Z.children))return"";return Z.children.map((Q)=>Z1(Q,W,X)).join(`
11
- `)}function k6(Z){return E6(Z)}function E6(Z){if(!Z||typeof Z!=="object")return!0;if(Array.isArray(Z))return Z.every(E6);if(Z.$prototype)return!1;if(Z.$ref)return!1;if(Z.state)for(let J of Object.values(Z.state)){if(!J||typeof J!=="object")continue;let X=J;if(X.$prototype)return!1;if(X.$ref)return!1}for(let J of Object.keys(Z))if(J.startsWith("on")&&J!=="observedAttributes")return!1;if(Array.isArray(Z.children)){if(!Z.children.every(E6))return!1}else if(Z.children&&typeof Z.children==="object"){if(Z.children.$prototype)return!1}return!0}function j7(Z,J,X=null,q={}){let W=[];if(J&&typeof J==="object"){let Q=[];for(let[G,z]of Object.entries(J)){if(G.startsWith(":")||G.startsWith(".")||G.startsWith("&")||G.startsWith("[")||G.startsWith("@"))continue;if(z===null||typeof z==="object")continue;if(typeof z==="string"&&v(z))continue;Q.push(` ${I0(G)}: ${z};`)}if(Q.length>0)W.push(`${Z} {
12
- ${Q.join(`
8
+ }`);for(let[K,V]of Object.entries(Z.style)){if(V===null||typeof V!=="object"||Array.isArray(V))continue;if(K.startsWith("@")){let B=K.startsWith("@--")?`@media ${q[K.slice(1)]??K.slice(1)}`:K.startsWith("@(")?`@media ${K.slice(1)}`:K,H=B0(V);if(H)X.push(`${B} { ${Y} { ${H} } }`);for(let[$,F]of Object.entries(V)){if(F===null||typeof F!=="object"||Array.isArray(F))continue;if($.startsWith("@"))continue;let L=$.startsWith("&")?$.replace("&",Y):$.startsWith(":")||$.startsWith(".")||$.startsWith("[")?`${Y}${$}`:`${Y} ${$}`;X.push(`${B} { ${L} { ${B0(F)} } }`)}}else{let B=K.startsWith("&")?K.replace("&",Y):K.startsWith(":")||K.startsWith(".")||K.startsWith("[")?`${Y}${K}`:`${Y} ${K}`;Z8(B,V,X,q)}}}if(Array.isArray(Z.children))for(let U of Z.children)G6(U,X,q,Y,z,J);if(Z.cases&&typeof Z.cases==="object")for(let U of Object.values(Z.cases))G6(U,X,q,Y,z,J)}function y(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function c4(Z){return Z.split("-").map((X)=>X.charAt(0).toUpperCase()+X.slice(1)).join("")}function l4(Z){let X=new Map;return X8(Z,X),[...X.values()]}function X8(Z,X){if(!Z||typeof Z!=="object")return;if(Z.state){for(let[q,W]of Object.entries(Z.state))if(r1(W))X.set(W.$export,{exportName:W.$export,key:q,src:W.$src})}if(Array.isArray(Z.children))for(let q of Z.children)X8(q,X)}function b6(Z,X,q=null){if(typeof Z==="string"){if(x(Z)&&X){let z=Y0(Z,X);return z!=null?y(String(z)):y(Z)}return y(Z)}if(typeof Z==="number"||typeof Z==="boolean")return y(String(Z));if(Array.isArray(Z))return Z.map((z)=>b6(z,X,q)).join(`
9
+ `);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";if(Z.$switch){let z=Z.tagName??"div",Y=v6(Z,X),U=p(Z.$switch,X),K=U==null?void 0:Z.cases?.[String(U)],V=K!==void 0&&!b0(K)?b6(K,X,q):"";return`<${z}${Y}>${V}</${z}>`}let W=Z.tagName??"div";if(W==="slot"&&q!=null)return q;let Q=v6(Z,X);if(gq.has(W))return`<${W}${Q}>`;let J="";if(Z.textContent!==void 0){let z=p(Z.textContent,X);J=z!=null?y(String(z)):""}else if(Z.innerHTML){let z=p(Z.innerHTML,X);J=z!=null?String(z):Z.innerHTML}else if(Array.isArray(Z.children))J=Z.children.map((z)=>b6(z,X,q)).join(`
10
+ `);return`<${W}${Q}>${J}</${W}>`}function q8(Z,X=null,q=null){let W=Z.state??{};if(X){W={...W};for(let[J,z]of Object.entries(X))if(J in W){let Y=W[J];W[J]=Y&&typeof Y==="object"&&!Array.isArray(Y)&&"default"in Y?{...Y,default:z}:z}else W[J]=z}let Q=m6(W,null);if(!Array.isArray(Z.children))return"";return Z.children.map((J)=>b6(J,Q,q)).join(`
11
+ `)}function e1(Z){return s1(Z)}function s1(Z){if(!Z||typeof Z!=="object")return!0;if(Array.isArray(Z))return Z.every((X)=>s1(X));if(Z.$prototype)return!1;if(Z.$ref)return!1;if(Z.state)for(let X of Object.values(Z.state)){if(!X||typeof X!=="object")continue;let q=X;if(q.$prototype)return!1;if(q.$ref)return!1}for(let X of Object.keys(Z))if(X.startsWith("on")&&X!=="observedAttributes")return!1;if(Array.isArray(Z.children))return Z.children.every((X)=>s1(X));if(Z.children&&typeof Z.children==="object"&&Z.children.$prototype)return!1;return!0}function W8(Z,X,q=null,W={}){let Q=[];if(X&&typeof X==="object"){let J=[];for(let[z,Y]of Object.entries(X)){if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")||z.startsWith("@"))continue;if(Y===null||typeof Y==="object")continue;if(typeof Y==="string"&&x(Y))continue;J.push(` ${I0(z)}: ${Y};`)}if(J.length>0)Q.push(`${Z} {
12
+ ${J.join(`
13
13
  `)}
14
- }`);for(let[G,z]of Object.entries(J))if(G.startsWith("@")){let Y=G.startsWith("@--")?`@media ${q[G.slice(1)]??G.slice(1)}`:G.startsWith("@(")?`@media ${G.slice(1)}`:G;W.push(`${Y} { ${Z} { ${H0(z)} } }`)}else if(G.startsWith(":")||G.startsWith(".")||G.startsWith("&")||G.startsWith("[")){let Y=G.startsWith("&")?G.replace("&",Z):`${Z}${G}`;W.push(`${Y} { ${H0(z)} }`)}}if(X&&Array.isArray(X.children)){let Q={n:0};for(let G of X.children)X1(G,W,q,"",Q,Z)}return W.length>0?W.join(`
15
- `)+`
16
- `:""}var T4="https://esm.sh/@vue/reactivity@3.5.32",R4="https://esm.sh/lit-html@3.3.0",HJ,$J;var U4=O(()=>{j1();_6();HJ=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"]);$J=new Set(["input","br","hr","img","meta","link","area","col","source"])});function p0(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var FJ,q1=()=>FJ;var _7=O(()=>{FJ=/^win/.test(globalThis.process?globalThis.process.platform:"")});function e(Z,J){let X=new URL(p0(Z),"https://aaa.nonexistanturl.com"),q=new URL(p0(J),X),W=J.match(/(\s*)$/)?.[1]||"";if(q.hostname==="aaa.nonexistanturl.com"){let{pathname:G,search:z,hash:Y}=q;return G+z+decodeURIComponent(Y)+W}let Q=q.toString()+W;if(Q.includes("#")){let[G,z]=Q.split("#",2);return G+"#"+decodeURIComponent(z||"")}return Q}function K4(){if(typeof window<"u"&&window.location&&window.location.href){let Z=window.location.href;if(!Z||!Z.startsWith("http"))try{return new URL(Z),Z}catch{return"/"}return Z}if(typeof process<"u"&&process.cwd){let Z=process.cwd(),J=Z.slice(-1);if(J==="/"||J==="\\")return Z;else return Z+"/"}return"/"}function C7(Z){let J=AJ.exec(Z||"");if(J)return J[1].toLowerCase();return}function E7(Z){let J=Z.lastIndexOf(".");if(J>=0)return NJ(Z.substring(J).toLowerCase());return""}function NJ(Z){let J=Z.indexOf("?");if(J>=0)Z=Z.substring(0,J);return Z}function O0(Z){if(!Z)return"#";let J=Z.indexOf("#");if(J>=0)return Z.substring(J);return"#"}function s(Z){if(!Z)return"";let J=Z.indexOf("#");if(J>=0)Z=Z.substring(0,J);return Z}function O7(Z){let J=C7(Z);if(J==="http"||J==="https")return!0;else if(J===void 0)return typeof window<"u";else return!1}function b6(Z){if(!Z||typeof Z!=="string")return!0;let J=Z.trim().toLowerCase();if(!J)return!0;if(J.startsWith("javascript:")||J.startsWith("vbscript:")||J.startsWith("data:"))return!0;if(J.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;let X=["localhost","127.0.0.1","::1","10.","172.16.","172.17.","172.18.","172.19.","172.20.","172.21.","172.22.","172.23.","172.24.","172.25.","172.26.","172.27.","172.28.","172.29.","172.30.","172.31.","192.168.","169.254.",".local",".internal",".intranet",".corp",".home",".lan"];try{let q=new URL(J.startsWith("//")?"http:"+J:J),W=q.hostname.toLowerCase();for(let G of X)if(W===G||W.startsWith(G)||W.endsWith(G))return!0;if(TJ(W))return!0;let Q=q.port;if(Q&&RJ(parseInt(Q)))return!0}catch{if(J.startsWith("/")&&!J.startsWith("//"))return!1;for(let q of X)if(J.includes(q))return!0}return!1}function TJ(Z){let J=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,X=Z.match(J);if(!X)return!1;let[,q,W,Q,G]=X.map(Number);if(q>255||W>255||Q>255||G>255)return!1;return q===10||q===127||q===172&&W>=16&&W<=31||q===192&&W===168||q===169&&W===254}function RJ(Z){return[22,23,25,53,135,139,445,993,995,1433,1521,3306,3389,5432,5900,6379,8080,8443,9200,27017].includes(Z)}function O1(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let J=C7(Z);return J===void 0||J==="file"}function x7(Z){if(q1()){let J=K4(),X=Z.toUpperCase(),W=p0(J).toUpperCase(),Q=X.includes(W),G=X.includes(W),z=DJ.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(Q||G||z)&&!J.startsWith("http"))Z=((U,K)=>{if(U.endsWith("/")||U.endsWith("\\"))return U+K;else return U+"/"+K})(J,Z);Z=p0(Z)}Z=encodeURI(Z);for(let J of wJ)Z=Z.replace(J[0],J[1]);return Z}function O4(Z,J){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let q=0;q<S6.length;q+=2)Z=Z.replace(S6[q],S6[q+1]);let X=Z.toLowerCase().startsWith("file://");if(X){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),q1()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(J)Z="file:///"+Z;else X=!1,Z=q1()?Z:"/"+Z}if(q1()&&!X){if(Z=Z.replace(MJ,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function x1(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((J)=>{return J.replace(LJ,"/").replace(IJ,"~")})}var MJ,AJ,LJ,IJ,DJ,wJ,S6,E4=(Z)=>new URL(Z);var $0=O(()=>{_7();MJ=/\//g,AJ=/^(\w{2,}):\/\//i,LJ=/~1/g,IJ=/~0/g,DJ=/^[a-zA-Z]:[\\/]/,wJ=[[/\?/g,"%3F"],[/#/g,"%23"]],S6=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"]});function k7(){let Z={},J=this;for(let X of CJ(J))if(typeof X==="string"){let q=J[X],W=typeof q;if(!PJ.includes(W))Z[X]=q}return Z}function CJ(Z,J=[]){let X=[];while(Z&&Z!==_J)X=X.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let q=new Set(X);for(let W of J.concat(jJ))q.delete(W);return q}function k0(Z){return Z instanceof T0||Z instanceof x4}function y6(Z){if(Z.path===null)Z.path=[];return Z}var PJ,jJ,_J,T0,x4,R0,k1,C0,S1,b1,v6,k4;var P0=O(()=>{$0();PJ=["function","symbol","undefined"],jJ=["constructor","prototype","__proto__"],_J=Object.getPrototypeOf({});T0=class T0 extends Error{name;message;source;path;code;constructor(Z,J){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=Z,this.source=J,this.path=null}toJSON=k7.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};x4=class x4 extends Error{files;constructor(Z){super();this.files=Z,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${O4(Z.$refs._root$Ref.path)}'`}toJSON=k7.bind(this);static getParserErrors(Z){let J=[];for(let X of Object.values(Z.$refs._$refs))if(X.errors)J.push(...X.errors);return J}get errors(){return x4.getParserErrors(this.files)}};R0=class R0 extends T0{code="EPARSER";name="ParserError";constructor(Z,J){super(`Error parsing ${J}: ${Z}`,J)}};k1=class k1 extends T0{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};C0=class C0 extends T0{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(Z,J){super(Z.message||`Error reading file "${J}"`,J);if("code"in Z)this.ioErrorCode=String(Z.code)}};S1=class S1 extends T0{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};b1=class b1 extends T0{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,J,X,q,W){super(`Missing $ref pointer "${O0(J)}". Token "${Z}" does not exist.`,s(J));this.targetToken=Z,this.targetRef=X,this.targetFound=q,this.parentPath=W}};v6=class v6 extends T0{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};k4=class k4 extends T0{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,J){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,s(J))}}});function Y0(Z,J){let X=EJ(J);return X?e(Z,X):Z}function v1(Z){if(!Z||typeof Z!=="object"||ArrayBuffer.isView(Z))return!1;let J=Z.$schema;if(typeof J==="string"&&(J.includes("draft/2019-09/")||J.includes("draft/2020-12/")||J.includes("oas/3.1/")))return!0;let X=Z.openapi;return typeof X==="string"&&/^3\.1(?:\.|$)/.test(X)}function y1(Z,J,X,q,W=!1){if(!W)return;let Q=new Set,G=(z,Y)=>{if(!z||typeof z!=="object"||ArrayBuffer.isView(z)||Q.has(z))return;Q.add(z);let U=Y0(Y,z);if(U!==Y)Z._addAlias(U,z,q,W);for(let K of Object.keys(z))G(z[K],U)};G(X,J)}function EJ(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var V4=O(()=>{$0()});class B4{$ref;path;originalPath;scopeBase;value;circular;indirections;constructor(Z,J,X){this.$ref=Z,this.path=J,this.originalPath=X||J,this.scopeBase=Z.path||s(J),this.value=void 0,this.circular=!1,this.indirections=0}resolve(Z,J,X){let q=B4.parse(this.path,this.originalPath),W=[];if(this.value=b7(Z),this.$ref.dynamicIdScope&&!v7(this.$ref))this.scopeBase=Y0(this.scopeBase,this.value);for(let G=0;G<q.length;G++){let z=this.circular,Y=i.isExtended$Ref(this.value);if(g1(this,J,X))this.path=B4.join(this.path,q.slice(G));else if(!z&&this.circular&&Y)this.circular=!1;let U=q[G];if(this.value[U]===void 0||this.value[U]===null&&G===q.length-1){let K=!1;for(let D=q.length-1;D>G;D--){let L=q.slice(G,D+1).join("/");if(this.value[L]!==void 0){this.value=this.value[L],G=D,K=!0;break}}if(K)continue;if(U in this.value&&this.value[U]===null){this.value=h1;continue}this.value=null;let V=this.$ref.path||"",H=this.path.replace(V,""),$=B4.join("",W),A=X?.replace(V,"");throw new b1(U,decodeURI(this.originalPath),H,$,A)}else this.value=this.value[U];if(W.push(U),this.$ref.dynamicIdScope)this.scopeBase=Y0(this.scopeBase,this.value)}let Q=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(!this.value||this.value.$ref&&e(Q,this.value.$ref)!==X)g1(this,J,X);return this}set(Z,J,X){let q=B4.parse(this.path),W;if(q.length===0)return this.value=J,J;if(this.value=b7(Z),this.$ref.dynamicIdScope&&!v7(this.$ref))this.scopeBase=Y0(this.scopeBase,this.value);for(let Q=0;Q<q.length-1;Q++){if(g1(this,X),W=q[Q],this.value&&this.value[W]!==void 0)this.value=this.value[W];else this.value=S7(this,W,{});if(this.$ref.dynamicIdScope)this.scopeBase=Y0(this.scopeBase,this.value)}return g1(this,X),W=q[q.length-1],S7(this,W,J),Z}static parse(Z,J){let X=O0(Z).substring(1);if(!X)return[];let q=X.split("/");for(let W=0;W<q.length;W++)q[W]=q[W].replace(kJ,"/").replace(SJ,"~");if(q[0]!=="")throw new k4(X,J===void 0?Z:J);return q.slice(1)}static join(Z,J){if(Z.indexOf("#")===-1)Z+="#";J=Array.isArray(J)?J:[J];for(let X=0;X<J.length;X++){let q=J[X];Z+="/"+q.replace(xJ,"~0").replace(OJ,"~1")}return Z}}function g1(Z,J,X){if(i.isAllowed$Ref(Z.value,J)){let q=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,W=e(q,Z.value.$ref);if(W===Z.path&&!bJ(X))Z.circular=!0;else{let Q=Z.$ref.$refs._resolve(W,Z.path,J);if(Q===null)return!1;if(Z.indirections+=Q.indirections+1,i.isExtended$Ref(Z.value))return Z.value=i.dereference(Z.value,Q.value,J),!1;else Z.$ref=Q.$ref,Z.path=Q.path,Z.value=Q.value,Z.scopeBase=Z.$ref.path;return!0}}return}function S7(Z,J,X){if(Z.value&&typeof Z.value==="object")if(J==="-"&&Array.isArray(Z.value))Z.value.push(X);else Z.value[J]=X;else throw new T0(`Error assigning $ref pointer "${Z.path}".
17
- Cannot set "${J}" of a non-object.`);return X}function b7(Z){if(k0(Z))throw Z;return Z}function bJ(Z){return typeof Z=="string"&&B4.parse(Z).length==0}function v7(Z){return Boolean(Z.path&&Z.path in Z.$refs._aliases)}var h1,OJ,xJ,kJ,SJ,F0;var W1=O(()=>{S4();$0();P0();V4();h1=Symbol("null"),OJ=/\//g,xJ=/~/g,kJ=/~1/g,SJ=/~0/g;F0=B4});class Q1{path;value;$refs;pathType;dynamicIdScope=!1;errors=[];constructor(Z){this.$refs=Z}addError(Z){if(this.errors===void 0)this.errors=[];let J=this.errors.map(({footprint:X})=>X);if("errors"in Z&&Array.isArray(Z.errors))this.errors.push(...Z.errors.map(y6).filter(({footprint:X})=>!J.includes(X)));else if(!("footprint"in Z)||!J.includes(Z.footprint))this.errors.push(y6(Z))}exists(Z,J){try{return this.resolve(Z,J),!0}catch{return!1}}get(Z,J){return this.resolve(Z,J)?.value}resolve(Z,J,X,q){let W=new F0(this,Z,X);try{let Q=W.resolve(this.value,J,q);if(Q.value===h1)Q.value=null;return Q}catch(Q){if(!J||!J.continueOnError||!k0(Q))throw Q;if(Q.path===null)Q.path=x1(O0(q));if(Q instanceof k4)Q.source=decodeURI(s(q));return this.addError(Q),null}}set(Z,J){let X=new F0(this,Z);if(this.value=X.set(this.value,J),this.value===h1)this.value=null}static is$Ref(Z){return Boolean(Z)&&typeof Z==="object"&&Z!==null&&"$ref"in Z&&typeof Z.$ref==="string"&&Z.$ref.length>0}static isExternal$Ref(Z){return Q1.is$Ref(Z)&&Z.$ref[0]!=="#"}static isAllowed$Ref(Z,J){if(this.is$Ref(Z)){if(Z.$ref.substring(0,2)==="#/"||Z.$ref==="#")return!0;else if(Z.$ref[0]!=="#"&&(!J||J.resolve?.external))return!0}return}static isExtended$Ref(Z){return Q1.is$Ref(Z)&&Object.keys(Z).length>1}static dereference(Z,J,X){if(J&&typeof J==="object"&&Q1.isExtended$Ref(Z)){let q={};for(let Q of Object.keys(Z))if(Q!=="$ref")q[Q]=Z[Q];let W=X?.dereference?.mergeKeys??!0;for(let Q of Object.keys(J)){let G=Q;if(!(G in q))q[G]=J[G];else if(W&&typeof q[G]==="object"&&q[G]!==null&&typeof J[G]==="object"&&J[G]!==null)q[G]=y7(J[G],q[G])}return q}else return J}}function y7(Z,J){if(typeof Z!=="object"||Z===null)return J;if(typeof J!=="object"||J===null)return J;let X=Array.isArray(Z)?[...Z]:{...Z};for(let q of Object.keys(J))if(Array.isArray(J[q]))X[q]=[...J[q]];else if(typeof J[q]==="object"&&J[q]!==null)X[q]=y7(Z[q],J[q]);else X[q]=J[q];return X}var i;var S4=O(()=>{W1();P0();$0();i=Q1});class G1{circular;paths(...Z){return g7(this._$refs,Z.flat()).map((X)=>{return p0(X.decoded)})}values(...Z){let J=this._$refs;return g7(J,Z.flat()).reduce((q,W)=>{return q[p0(W.decoded)]=J[W.encoded].value,q},{})}exists(Z,J){try{return this._resolve(Z,"",J),!0}catch{return!1}}get(Z,J){return this._resolve(Z,"",J).value}set(Z,J){let X=e(this._root$Ref.path,Z),q=this._getRef(X);if(!q)throw Error(`Error resolving $ref pointer "${Z}".
18
- "${s(X)}" not found.`);q.set(X,J)}_get$Ref(Z){return Z=e(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let J=s(Z),X=new i(this);return X.path=J,this._$refs[J]=X,this._root$Ref=this._root$Ref||X,X}_addAlias(Z,J,X,q=!1){let W=s(Z);if(!W||this._$refs[W]||this._aliases[W])return this._$refs[W]||this._aliases[W];let Q=new i(this);return Q.path=W,Q.pathType=X,Q.value=J,Q.dynamicIdScope=q,this._aliases[W]=Q,Q}_resolve(Z,J,X){let q=e(this._root$Ref.path,Z),W=this._getRef(q);if(!W)throw Error(`Error resolving $ref pointer "${Z}".
19
- "${s(q)}" not found.`);return W.resolve(q,X,Z,J)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef(Z){let J=s(Z);return this._$refs[J]||this._aliases[J]}}function g7(Z,J){let X=Object.keys(Z);if(J=Array.isArray(J[0])?J[0]:Array.prototype.slice.call(J),J.length>0&&J[0])X=X.filter((q)=>{return J.includes(Z[q].pathType)});return X.map((q)=>{return{encoded:q,decoded:Z[q].pathType==="file"?O4(q,!0):q}})}var h7=O(()=>{S4();$0()});function g6(Z){return Object.keys(Z||{}).filter((J)=>{return typeof Z[J]==="object"}).map((J)=>{return Z[J].name=J,Z[J]})}function h6(Z,J,X,q,W){return Z.filter((Q)=>{return!!m7(Q,J,X,q,W)})}function m6(Z){for(let J of Z)J.order=J.order||Number.MAX_SAFE_INTEGER;return Z.sort((J,X)=>{return J.order-X.order})}async function f6(Z,J,X,q){let W,Q,G=0;return new Promise((z,Y)=>{U();function U(){if(W=Z[G++],!W)return Y(Q);try{let $=m7(W,J,X,K,q);if($&&typeof $.then==="function")$.then(V,H);else if($!==void 0)V($);else if(G===Z.length)throw Error("No promise has been returned or callback has been called.")}catch($){H($)}}function K($,A){if($)H($);else V(A)}function V($){z({plugin:W,result:$})}function H($){Q={plugin:W,error:$},U()}})}function m7(Z,J,X,q,W){let Q=Z[J];if(typeof Q==="function")return Q.apply(Z,[X,q,W]);if(!q){if(Q instanceof RegExp)return Q.test(X.url);else if(typeof Q==="string")return Q===X.extension;else if(Array.isArray(Q))return Q.indexOf(X.extension)!==-1}return Q}async function vJ(Z,J,X){let q=typeof Z==="string"?Z:Z.url,W=typeof Z==="string"?void 0:Z.baseUrl,Q=typeof Z==="string"?void 0:Z.reference,G=q.indexOf("#"),z="";if(G>=0)z=q.substring(G),q=q.substring(0,G);if(Q){let K=Q.indexOf("#");if(K>=0)Q=Q.substring(0,K)}let Y=J._add(q),U={url:q,hash:z,extension:E7(q),...Q!==void 0?{reference:Q}:{},...W!==void 0?{baseUrl:W}:{}};try{let K=await yJ(U,X,J);Y.pathType=K.plugin.name,U.data=K.result;let V=await gJ(U,X,J);return Y.value=V.result,Y.dynamicIdScope=v1(Y.value),y1(J,Y.path,Y.value,Y.pathType,Y.dynamicIdScope),V.result}catch(K){if(k0(K))Y.value=K;throw K}}async function yJ(Z,J,X){let q=g6(J.resolve);q=h6(q,"canRead",Z,void 0,X),m6(q);try{return await f6(q,"read",Z,X)}catch(W){if(!W&&J.continueOnError)throw new S1(Z.url);else if(!W||!("error"in W))throw SyntaxError(`Unable to resolve $ref pointer "${Z.url}"`,{cause:W});else if(W.error instanceof C0)throw W.error;else throw new C0(W,Z.url)}}async function gJ(Z,J,X){let q=g6(J.parse),W=h6(q,"canParse",Z),Q=W.length>0?W:q;m6(Q);try{let G=await f6(Q,"parse",Z,X);if(!G.plugin.allowEmpty&&hJ(G.result))throw SyntaxError(`Error parsing "${Z.url}" as ${G.plugin.name}.
20
- Parsed value is empty`);else return G}catch(G){if(!G&&J.continueOnError)throw new k1(Z.url);else if(G&&G.message&&G.message.startsWith("Error parsing"))throw G;else if(!G||!("error"in G))throw SyntaxError(`Unable to parse ${Z.url}`,{cause:G});else if(G.error instanceof R0)throw G.error;else throw new R0(G.error.message,Z.url)}}function hJ(Z){return Z===void 0||typeof Z==="object"&&Object.keys(Z).length===0||typeof Z==="string"&&Z.trim().length===0||Buffer.isBuffer(Z)&&Z.length===0}var m1;var u6=O(()=>{$0();V4();P0();m1=vJ});var f7;var u7=O(()=>{P0();f7={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(Z){let J=Z.data;if(Buffer.isBuffer(J))J=J.toString();if(typeof J==="string")if(J.trim().length===0)return;else try{return JSON.parse(J)}catch(X){if(this.allowBOM)try{let q=J.indexOf("{");return J=J.slice(q),JSON.parse(J)}catch(q){throw new R0(q.message,Z.url)}throw new R0(X.message,Z.url)}else return J}}});function q3(Z){return typeof Z>"u"||Z===null}function mJ(Z){return typeof Z==="object"&&Z!==null}function fJ(Z){if(Array.isArray(Z))return Z;else if(q3(Z))return[];return[Z]}function uJ(Z,J){var X,q,W,Q;if(J){Q=Object.keys(J);for(X=0,q=Q.length;X<q;X+=1)W=Q[X],Z[W]=J[W]}return Z}function dJ(Z,J){var X="",q;for(q=0;q<J;q+=1)X+=Z;return X}function cJ(Z){return Z===0&&Number.NEGATIVE_INFINITY===1/Z}function W3(Z,J){var X="",q=Z.reason||"(unknown reason)";if(!Z.mark)return q;if(Z.mark.name)X+='in "'+Z.mark.name+'" ';if(X+="("+(Z.mark.line+1)+":"+(Z.mark.column+1)+")",!J&&Z.mark.snippet)X+=`
14
+ }`);for(let[z,Y]of Object.entries(X))if(z.startsWith("@")){let U=z.startsWith("@--")?`@media ${W[z.slice(1)]??z.slice(1)}`:z.startsWith("@(")?`@media ${z.slice(1)}`:z;Q.push(`${U} { ${Z} { ${B0(Y)} } }`)}else if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")){let U=z.startsWith("&")?z.replace("&",Z):`${Z}${z}`;Q.push(`${U} { ${B0(Y)} }`)}}if(q&&Array.isArray(q.children)){let J={n:0};for(let z of q.children)G6(z,Q,W,"",J,Z)}return Q.length>0?`${Q.join(`
15
+ `)}
16
+ `:""}var y6="https://esm.sh/@vue/reactivity@3.5.32",g6="https://esm.sh/lit-html@3.3.0",gq;var T6=R(()=>{u4();i1();S0();S0();gq=new Set(["input","br","hr","img","meta","link","area","col","source"])});function a0(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var hq,H4=()=>hq;var Q8=R(()=>{hq=/^win/.test(globalThis.process?globalThis.process.platform:"")});function r(Z,X){let q=new URL(a0(Z),"https://aaa.nonexistanturl.com"),W=new URL(a0(X),q),Q=X.match(/(\s*)$/)?.[1]||"";if(W.hostname==="aaa.nonexistanturl.com"){let{pathname:z,search:Y,hash:U}=W;return z+Y+decodeURIComponent(U)+Q}let J=W.toString()+Q;if(J.includes("#")){let[z,Y]=J.split("#",2);return z+"#"+decodeURIComponent(Y||"")}return J}function R6(){if(typeof window<"u"&&window.location&&window.location.href){let Z=window.location.href;if(!Z||!Z.startsWith("http"))try{return new URL(Z),Z}catch{return"/"}return Z}if(typeof process<"u"&&process.cwd){let Z=process.cwd(),X=Z.slice(-1);if(X==="/"||X==="\\")return Z;else return Z+"/"}return"/"}function J8(Z){let X=fq.exec(Z||"");if(X)return X[1].toLowerCase();return}function z8(Z){let X=Z.lastIndexOf(".");if(X>=0)return pq(Z.substring(X).toLowerCase());return""}function pq(Z){let X=Z.indexOf("?");if(X>=0)Z=Z.substring(0,X);return Z}function v0(Z){if(!Z)return"#";let X=Z.indexOf("#");if(X>=0)return Z.substring(X);return"#"}function n(Z){if(!Z)return"";let X=Z.indexOf("#");if(X>=0)Z=Z.substring(0,X);return Z}function G8(Z){let X=J8(Z);if(X==="http"||X==="https")return!0;else if(X===void 0)return typeof window<"u";else return!1}function X5(Z){if(!Z||typeof Z!=="string")return!0;let X=Z.trim().toLowerCase();if(!X)return!0;if(X.startsWith("javascript:")||X.startsWith("vbscript:")||X.startsWith("data:"))return!0;if(X.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;let q=["localhost","127.0.0.1","::1","10.","172.16.","172.17.","172.18.","172.19.","172.20.","172.21.","172.22.","172.23.","172.24.","172.25.","172.26.","172.27.","172.28.","172.29.","172.30.","172.31.","192.168.","169.254.",".local",".internal",".intranet",".corp",".home",".lan"];try{let W=new URL(X.startsWith("//")?"http:"+X:X),Q=W.hostname.toLowerCase();for(let z of q)if(Q===z||Q.startsWith(z)||Q.endsWith(z))return!0;if(nq(Q))return!0;let J=W.port;if(J&&iq(parseInt(J)))return!0}catch{if(X.startsWith("/")&&!X.startsWith("//"))return!1;for(let W of q)if(X.includes(W))return!0}return!1}function nq(Z){let X=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,q=Z.match(X);if(!q)return!1;let[,W,Q,J,z]=q.map(Number);if(W>255||Q>255||J>255||z>255)return!1;return W===10||W===127||W===172&&Q>=16&&Q<=31||W===192&&Q===168||W===169&&Q===254}function iq(Z){return[22,23,25,53,135,139,445,993,995,1433,1521,3306,3389,5432,5900,6379,8080,8443,9200,27017].includes(Z)}function p4(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let X=J8(Z);return X===void 0||X==="file"}function Y8(Z){if(H4()){let X=R6(),q=Z.toUpperCase(),Q=a0(X).toUpperCase(),J=q.includes(Q),z=q.includes(Q),Y=cq.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(J||z||Y)&&!X.startsWith("http"))Z=((K,V)=>{if(K.endsWith("/")||K.endsWith("\\"))return K+V;else return K+"/"+V})(X,Z);Z=a0(Z)}Z=encodeURI(Z);for(let X of lq)Z=Z.replace(X[0],X[1]);return Z}function d6(Z,X){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let W=0;W<Z5.length;W+=2)Z=Z.replace(Z5[W],Z5[W+1]);let q=Z.toLowerCase().startsWith("file://");if(q){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),H4()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(X)Z="file:///"+Z;else q=!1,Z=H4()?Z:"/"+Z}if(H4()&&!q){if(Z=Z.replace(mq,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function n4(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((X)=>{return X.replace(uq,"/").replace(dq,"~")})}var mq,fq,uq,dq,cq,lq,Z5,u6=(Z)=>new URL(Z);var H0=R(()=>{Q8();mq=/\//g,fq=/^(\w{2,}):\/\//i,uq=/~1/g,dq=/~0/g,cq=/^[a-zA-Z]:[\\/]/,lq=[[/\?/g,"%3F"],[/#/g,"%23"]],Z5=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"]});function U8(){let Z={},X=this;for(let q of oq(X))if(typeof q==="string"){let W=X[q],Q=typeof W;if(!rq.includes(Q))Z[q]=W}return Z}function oq(Z,X=[]){let q=[];while(Z&&Z!==sq)q=q.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let W=new Set(q);for(let Q of X.concat(aq))W.delete(Q);return W}function g0(Z){return Z instanceof R0||Z instanceof c6}function W5(Z){if(Z.path===null)Z.path=[];return Z}var rq,aq,sq,R0,c6,_0,i4,x0,r4,a4,q5,l6;var P0=R(()=>{H0();rq=["function","symbol","undefined"],aq=["constructor","prototype","__proto__"],sq=Object.getPrototypeOf({});R0=class R0 extends Error{name;message;source;path;code;constructor(Z,X){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=Z,this.source=X,this.path=null}toJSON=U8.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};c6=class c6 extends Error{files;constructor(Z){super();this.files=Z,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${d6(Z.$refs._root$Ref.path)}'`}toJSON=U8.bind(this);static getParserErrors(Z){let X=[];for(let q of Object.values(Z.$refs._$refs))if(q.errors)X.push(...q.errors);return X}get errors(){return c6.getParserErrors(this.files)}};_0=class _0 extends R0{code="EPARSER";name="ParserError";constructor(Z,X){super(`Error parsing ${X}: ${Z}`,X)}};i4=class i4 extends R0{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};x0=class x0 extends R0{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(Z,X){super(Z.message||`Error reading file "${X}"`,X);if("code"in Z)this.ioErrorCode=String(Z.code)}};r4=class r4 extends R0{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};a4=class a4 extends R0{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,X,q,W,Q){super(`Missing $ref pointer "${v0(X)}". Token "${Z}" does not exist.`,n(X));this.targetToken=Z,this.targetRef=q,this.targetFound=W,this.parentPath=Q}};q5=class q5 extends R0{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};l6=class l6 extends R0{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,X){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,n(X))}}});function U0(Z,X){let q=tq(X);return q?r(Z,q):Z}function s4(Z){if(!Z||typeof Z!=="object"||ArrayBuffer.isView(Z))return!1;let X=Z.$schema;if(typeof X==="string"&&(X.includes("draft/2019-09/")||X.includes("draft/2020-12/")||X.includes("oas/3.1/")))return!0;let q=Z.openapi;return typeof q==="string"&&/^3\.1(?:\.|$)/.test(q)}function o4(Z,X,q,W,Q=!1){if(!Q)return;let J=new Set,z=(Y,U)=>{if(!Y||typeof Y!=="object"||ArrayBuffer.isView(Y)||J.has(Y))return;J.add(Y);let K=U0(U,Y);if(K!==U)Z._addAlias(K,Y,W,Q);for(let V of Object.keys(Y))z(Y[V],K)};z(q,X)}function tq(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var _6=R(()=>{H0()});class P6{$ref;path;originalPath;scopeBase;value;circular;indirections;constructor(Z,X,q){this.$ref=Z,this.path=X,this.originalPath=q||X,this.scopeBase=Z.path||n(X),this.value=void 0,this.circular=!1,this.indirections=0}resolve(Z,X,q){let W=P6.parse(this.path,this.originalPath),Q=[];if(this.value=V8(Z),this.$ref.dynamicIdScope&&!B8(this.$ref))this.scopeBase=U0(this.scopeBase,this.value);for(let z=0;z<W.length;z++){let Y=this.circular,U=d.isExtended$Ref(this.value);if(t4(this,X,q))this.path=P6.join(this.path,W.slice(z));else if(!Y&&this.circular&&U)this.circular=!1;let K=W[z];if(this.value[K]===void 0||this.value[K]===null&&z===W.length-1){let V=!1;for(let L=W.length-1;L>z;L--){let A=W.slice(z,L+1).join("/");if(this.value[A]!==void 0){this.value=this.value[A],z=L,V=!0;break}}if(V)continue;if(K in this.value&&this.value[K]===null){this.value=e4;continue}this.value=null;let B=this.$ref.path||"",H=this.path.replace(B,""),$=P6.join("",Q),F=q?.replace(B,"");throw new a4(K,decodeURI(this.originalPath),H,$,F)}else this.value=this.value[K];if(Q.push(K),this.$ref.dynamicIdScope)this.scopeBase=U0(this.scopeBase,this.value)}let J=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(!this.value||this.value.$ref&&r(J,this.value.$ref)!==q)t4(this,X,q);return this}set(Z,X,q){let W=P6.parse(this.path),Q;if(W.length===0)return this.value=X,X;if(this.value=V8(Z),this.$ref.dynamicIdScope&&!B8(this.$ref))this.scopeBase=U0(this.scopeBase,this.value);for(let J=0;J<W.length-1;J++){if(t4(this,q),Q=W[J],this.value&&this.value[Q]!==void 0)this.value=this.value[Q];else this.value=K8(this,Q,{});if(this.$ref.dynamicIdScope)this.scopeBase=U0(this.scopeBase,this.value)}return t4(this,q),Q=W[W.length-1],K8(this,Q,X),Z}static parse(Z,X){let q=v0(Z).substring(1);if(!q)return[];let W=q.split("/");for(let Q=0;Q<W.length;Q++)W[Q]=W[Q].replace(XW,"/").replace(qW,"~");if(W[0]!=="")throw new l6(q,X===void 0?Z:X);return W.slice(1)}static join(Z,X){if(Z.indexOf("#")===-1)Z+="#";X=Array.isArray(X)?X:[X];for(let q=0;q<X.length;q++){let W=X[q];Z+="/"+W.replace(ZW,"~0").replace(eq,"~1")}return Z}}function t4(Z,X,q){if(d.isAllowed$Ref(Z.value,X)){let W=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,Q=r(W,Z.value.$ref);if(Q===Z.path&&!WW(q))Z.circular=!0;else{let J=Z.$ref.$refs._resolve(Q,Z.path,X);if(J===null)return!1;if(Z.indirections+=J.indirections+1,d.isExtended$Ref(Z.value))return Z.value=d.dereference(Z.value,J.value,X),!1;else Z.$ref=J.$ref,Z.path=J.path,Z.value=J.value,Z.scopeBase=Z.$ref.path;return!0}}return}function K8(Z,X,q){if(Z.value&&typeof Z.value==="object")if(X==="-"&&Array.isArray(Z.value))Z.value.push(q);else Z.value[X]=q;else throw new R0(`Error assigning $ref pointer "${Z.path}".
17
+ Cannot set "${X}" of a non-object.`);return q}function V8(Z){if(g0(Z))throw Z;return Z}function WW(Z){return typeof Z=="string"&&P6.parse(Z).length==0}function B8(Z){return Boolean(Z.path&&Z.path in Z.$refs._aliases)}var e4,eq,ZW,XW,qW,$0;var $4=R(()=>{p6();H0();P0();_6();e4=Symbol("null"),eq=/\//g,ZW=/~/g,XW=/~1/g,qW=/~0/g;$0=P6});class F4{path;value;$refs;pathType;dynamicIdScope=!1;errors=[];constructor(Z){this.$refs=Z}addError(Z){if(this.errors===void 0)this.errors=[];let X=this.errors.map(({footprint:q})=>q);if("errors"in Z&&Array.isArray(Z.errors))this.errors.push(...Z.errors.map(W5).filter(({footprint:q})=>!X.includes(q)));else if(!("footprint"in Z)||!X.includes(Z.footprint))this.errors.push(W5(Z))}exists(Z,X){try{return this.resolve(Z,X),!0}catch{return!1}}get(Z,X){return this.resolve(Z,X)?.value}resolve(Z,X,q,W){let Q=new $0(this,Z,q);try{let J=Q.resolve(this.value,X,W);if(J.value===e4)J.value=null;return J}catch(J){if(!X||!X.continueOnError||!g0(J))throw J;if(J.path===null)J.path=n4(v0(W));if(J instanceof l6)J.source=decodeURI(n(W));return this.addError(J),null}}set(Z,X){let q=new $0(this,Z);if(this.value=q.set(this.value,X),this.value===e4)this.value=null}static is$Ref(Z){return Boolean(Z)&&typeof Z==="object"&&Z!==null&&"$ref"in Z&&typeof Z.$ref==="string"&&Z.$ref.length>0}static isExternal$Ref(Z){return F4.is$Ref(Z)&&Z.$ref[0]!=="#"}static isAllowed$Ref(Z,X){if(this.is$Ref(Z)){if(Z.$ref.substring(0,2)==="#/"||Z.$ref==="#")return!0;else if(Z.$ref[0]!=="#"&&(!X||X.resolve?.external))return!0}return}static isExtended$Ref(Z){return F4.is$Ref(Z)&&Object.keys(Z).length>1}static dereference(Z,X,q){if(X&&typeof X==="object"&&F4.isExtended$Ref(Z)){let W={};for(let J of Object.keys(Z))if(J!=="$ref")W[J]=Z[J];let Q=q?.dereference?.mergeKeys??!0;for(let J of Object.keys(X)){let z=J;if(!(z in W))W[z]=X[z];else if(Q&&typeof W[z]==="object"&&W[z]!==null&&typeof X[z]==="object"&&X[z]!==null)W[z]=H8(X[z],W[z])}return W}else return X}}function H8(Z,X){if(typeof Z!=="object"||Z===null)return X;if(typeof X!=="object"||X===null)return X;let q=Array.isArray(Z)?[...Z]:{...Z};for(let W of Object.keys(X))if(Array.isArray(X[W]))q[W]=[...X[W]];else if(typeof X[W]==="object"&&X[W]!==null)q[W]=H8(Z[W],X[W]);else q[W]=X[W];return q}var d;var p6=R(()=>{$4();P0();H0();d=F4});class A4{circular;paths(...Z){return $8(this._$refs,Z.flat()).map((q)=>{return a0(q.decoded)})}values(...Z){let X=this._$refs;return $8(X,Z.flat()).reduce((W,Q)=>{return W[a0(Q.decoded)]=X[Q.encoded].value,W},{})}exists(Z,X){try{return this._resolve(Z,"",X),!0}catch{return!1}}get(Z,X){return this._resolve(Z,"",X).value}set(Z,X){let q=r(this._root$Ref.path,Z),W=this._getRef(q);if(!W)throw Error(`Error resolving $ref pointer "${Z}".
18
+ "${n(q)}" not found.`);W.set(q,X)}_get$Ref(Z){return Z=r(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let X=n(Z),q=new d(this);return q.path=X,this._$refs[X]=q,this._root$Ref=this._root$Ref||q,q}_addAlias(Z,X,q,W=!1){let Q=n(Z);if(!Q||this._$refs[Q]||this._aliases[Q])return this._$refs[Q]||this._aliases[Q];let J=new d(this);return J.path=Q,J.pathType=q,J.value=X,J.dynamicIdScope=W,this._aliases[Q]=J,J}_resolve(Z,X,q){let W=r(this._root$Ref.path,Z),Q=this._getRef(W);if(!Q)throw Error(`Error resolving $ref pointer "${Z}".
19
+ "${n(W)}" not found.`);return Q.resolve(W,q,Z,X)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef(Z){let X=n(Z);return this._$refs[X]||this._aliases[X]}}function $8(Z,X){let q=Object.keys(Z);if(X=Array.isArray(X[0])?X[0]:Array.prototype.slice.call(X),X.length>0&&X[0])q=q.filter((W)=>{return X.includes(Z[W].pathType)});return q.map((W)=>{return{encoded:W,decoded:Z[W].pathType==="file"?d6(W,!0):W}})}var F8=R(()=>{p6();H0()});function Q5(Z){return Object.keys(Z||{}).filter((X)=>{return typeof Z[X]==="object"}).map((X)=>{return Z[X].name=X,Z[X]})}function J5(Z,X,q,W,Q){return Z.filter((J)=>{return!!A8(J,X,q,W,Q)})}function z5(Z){for(let X of Z)X.order=X.order||Number.MAX_SAFE_INTEGER;return Z.sort((X,q)=>{return X.order-q.order})}async function G5(Z,X,q,W){let Q,J,z=0;return new Promise((Y,U)=>{K();function K(){if(Q=Z[z++],!Q)return U(J);try{let $=A8(Q,X,q,V,W);if($&&typeof $.then==="function")$.then(B,H);else if($!==void 0)B($);else if(z===Z.length)throw Error("No promise has been returned or callback has been called.")}catch($){H($)}}function V($,F){if($)H($);else B(F)}function B($){Y({plugin:Q,result:$})}function H($){J={plugin:Q,error:$},K()}})}function A8(Z,X,q,W,Q){let J=Z[X];if(typeof J==="function")return J.apply(Z,[q,W,Q]);if(!W){if(J instanceof RegExp)return J.test(q.url);else if(typeof J==="string")return J===q.extension;else if(Array.isArray(J))return J.indexOf(q.extension)!==-1}return J}async function QW(Z,X,q){let W=typeof Z==="string"?Z:Z.url,Q=typeof Z==="string"?void 0:Z.baseUrl,J=typeof Z==="string"?void 0:Z.reference,z=W.indexOf("#"),Y="";if(z>=0)Y=W.substring(z),W=W.substring(0,z);if(J){let V=J.indexOf("#");if(V>=0)J=J.substring(0,V)}let U=X._add(W),K={url:W,hash:Y,extension:z8(W),...J!==void 0?{reference:J}:{},...Q!==void 0?{baseUrl:Q}:{}};try{let V=await JW(K,q,X);U.pathType=V.plugin.name,K.data=V.result;let B=await zW(K,q,X);return U.value=B.result,U.dynamicIdScope=s4(U.value),o4(X,U.path,U.value,U.pathType,U.dynamicIdScope),B.result}catch(V){if(g0(V))U.value=V;throw V}}async function JW(Z,X,q){let W=Q5(X.resolve);W=J5(W,"canRead",Z,void 0,q),z5(W);try{return await G5(W,"read",Z,q)}catch(Q){if(!Q&&X.continueOnError)throw new r4(Z.url);else if(!Q||!("error"in Q))throw SyntaxError(`Unable to resolve $ref pointer "${Z.url}"`,{cause:Q});else if(Q.error instanceof x0)throw Q.error;else throw new x0(Q,Z.url)}}async function zW(Z,X,q){let W=Q5(X.parse),Q=J5(W,"canParse",Z),J=Q.length>0?Q:W;z5(J);try{let z=await G5(J,"parse",Z,q);if(!z.plugin.allowEmpty&&GW(z.result))throw SyntaxError(`Error parsing "${Z.url}" as ${z.plugin.name}.
20
+ Parsed value is empty`);else return z}catch(z){if(!z&&X.continueOnError)throw new i4(Z.url);else if(z&&z.message&&z.message.startsWith("Error parsing"))throw z;else if(!z||!("error"in z))throw SyntaxError(`Unable to parse ${Z.url}`,{cause:z});else if(z.error instanceof _0)throw z.error;else throw new _0(z.error.message,Z.url)}}function GW(Z){return Z===void 0||typeof Z==="object"&&Object.keys(Z).length===0||typeof Z==="string"&&Z.trim().length===0||Buffer.isBuffer(Z)&&Z.length===0}var Z1;var Y5=R(()=>{H0();_6();P0();Z1=QW});var M8;var L8=R(()=>{P0();M8={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(Z){let X=Z.data;if(Buffer.isBuffer(X))X=X.toString();if(typeof X==="string")if(X.trim().length===0)return;else try{return JSON.parse(X)}catch(q){if(this.allowBOM)try{let W=X.indexOf("{");return X=X.slice(W),JSON.parse(X)}catch(W){throw new _0(W.message,Z.url)}throw new _0(q.message,Z.url)}else return X}}});function b8(Z){return typeof Z>"u"||Z===null}function YW(Z){return typeof Z==="object"&&Z!==null}function UW(Z){if(Array.isArray(Z))return Z;else if(b8(Z))return[];return[Z]}function KW(Z,X){var q,W,Q,J;if(X){J=Object.keys(X);for(q=0,W=J.length;q<W;q+=1)Q=J[q],Z[Q]=X[Q]}return Z}function VW(Z,X){var q="",W;for(W=0;W<X;W+=1)q+=Z;return q}function BW(Z){return Z===0&&Number.NEGATIVE_INFINITY===1/Z}function v8(Z,X){var q="",W=Z.reason||"(unknown reason)";if(!Z.mark)return W;if(Z.mark.name)q+='in "'+Z.mark.name+'" ';if(q+="("+(Z.mark.line+1)+":"+(Z.mark.column+1)+")",!X&&Z.mark.snippet)q+=`
21
21
 
22
- `+Z.mark.snippet;return q+" "+X}function z1(Z,J){if(Error.call(this),this.name="YAMLException",this.reason=Z,this.mark=J,this.message=W3(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}function d6(Z,J,X,q,W){var Q="",G="",z=Math.floor(W/2)-1;if(q-J>z)Q=" ... ",J=q-z+Q.length;if(X-q>z)G=" ...",X=q+z-G.length;return{str:Q+Z.slice(J,X).replace(/\t/g,"→")+G,pos:q-J+Q.length}}function c6(Z,J){return Z0.repeat(" ",J-Z.length)+Z}function sJ(Z,J){if(J=Object.create(J||null),!Z.buffer)return null;if(!J.maxLength)J.maxLength=79;if(typeof J.indent!=="number")J.indent=1;if(typeof J.linesBefore!=="number")J.linesBefore=3;if(typeof J.linesAfter!=="number")J.linesAfter=2;var X=/\r?\n|\r|\0/g,q=[0],W=[],Q,G=-1;while(Q=X.exec(Z.buffer))if(W.push(Q.index),q.push(Q.index+Q[0].length),Z.position<=Q.index&&G<0)G=q.length-2;if(G<0)G=q.length-1;var z="",Y,U,K=Math.min(Z.line+J.linesAfter,W.length).toString().length,V=J.maxLength-(J.indent+K+3);for(Y=1;Y<=J.linesBefore;Y++){if(G-Y<0)break;U=d6(Z.buffer,q[G-Y],W[G-Y],Z.position-(q[G]-q[G-Y]),V),z=Z0.repeat(" ",J.indent)+c6((Z.line-Y+1).toString(),K)+" | "+U.str+`
23
- `+z}U=d6(Z.buffer,q[G],W[G],Z.position,V),z+=Z0.repeat(" ",J.indent)+c6((Z.line+1).toString(),K)+" | "+U.str+`
24
- `,z+=Z0.repeat("-",J.indent+K+3+U.pos)+`^
25
- `;for(Y=1;Y<=J.linesAfter;Y++){if(G+Y>=W.length)break;U=d6(Z.buffer,q[G+Y],W[G+Y],Z.position-(q[G]-q[G+Y]),V),z+=Z0.repeat(" ",J.indent)+c6((Z.line+Y+1).toString(),K)+" | "+U.str+`
26
- `}return z.replace(/\n$/,"")}function ZX(Z){var J={};if(Z!==null)Object.keys(Z).forEach(function(X){Z[X].forEach(function(q){J[String(q)]=X})});return J}function JX(Z,J){if(J=J||{},Object.keys(J).forEach(function(X){if(tJ.indexOf(X)===-1)throw new z0('Unknown option "'+X+'" is met in definition of "'+Z+'" YAML type.')}),this.options=J,this.tag=Z,this.kind=J.kind||null,this.resolve=J.resolve||function(){return!0},this.construct=J.construct||function(X){return X},this.instanceOf=J.instanceOf||null,this.predicate=J.predicate||null,this.represent=J.represent||null,this.representName=J.representName||null,this.defaultStyle=J.defaultStyle||null,this.multi=J.multi||!1,this.styleAliases=ZX(J.styleAliases||null),eJ.indexOf(this.kind)===-1)throw new z0('Unknown kind "'+this.kind+'" is specified for "'+Z+'" YAML type.')}function d7(Z,J){var X=[];return Z[J].forEach(function(q){var W=X.length;X.forEach(function(Q,G){if(Q.tag===q.tag&&Q.kind===q.kind&&Q.multi===q.multi)W=G}),X[W]=q}),X}function XX(){var Z={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},J,X;function q(W){if(W.multi)Z.multi[W.kind].push(W),Z.multi.fallback.push(W);else Z[W.kind][W.tag]=Z.fallback[W.tag]=W}for(J=0,X=arguments.length;J<X;J+=1)arguments[J].forEach(q);return Z}function p6(Z){return this.extend(Z)}function qX(Z){if(Z===null)return!0;var J=Z.length;return J===1&&Z==="~"||J===4&&(Z==="null"||Z==="Null"||Z==="NULL")}function WX(){return null}function QX(Z){return Z===null}function GX(Z){if(Z===null)return!1;var J=Z.length;return J===4&&(Z==="true"||Z==="True"||Z==="TRUE")||J===5&&(Z==="false"||Z==="False"||Z==="FALSE")}function YX(Z){return Z==="true"||Z==="True"||Z==="TRUE"}function zX(Z){return Object.prototype.toString.call(Z)==="[object Boolean]"}function UX(Z){return 48<=Z&&Z<=57||65<=Z&&Z<=70||97<=Z&&Z<=102}function KX(Z){return 48<=Z&&Z<=55}function VX(Z){return 48<=Z&&Z<=57}function BX(Z){if(Z===null)return!1;var J=Z.length,X=0,q=!1,W;if(!J)return!1;if(W=Z[X],W==="-"||W==="+")W=Z[++X];if(W==="0"){if(X+1===J)return!0;if(W=Z[++X],W==="b"){X++;for(;X<J;X++){if(W=Z[X],W==="_")continue;if(W!=="0"&&W!=="1")return!1;q=!0}return q&&W!=="_"}if(W==="x"){X++;for(;X<J;X++){if(W=Z[X],W==="_")continue;if(!UX(Z.charCodeAt(X)))return!1;q=!0}return q&&W!=="_"}if(W==="o"){X++;for(;X<J;X++){if(W=Z[X],W==="_")continue;if(!KX(Z.charCodeAt(X)))return!1;q=!0}return q&&W!=="_"}}if(W==="_")return!1;for(;X<J;X++){if(W=Z[X],W==="_")continue;if(!VX(Z.charCodeAt(X)))return!1;q=!0}if(!q||W==="_")return!1;return!0}function HX(Z){var J=Z,X=1,q;if(J.indexOf("_")!==-1)J=J.replace(/_/g,"");if(q=J[0],q==="-"||q==="+"){if(q==="-")X=-1;J=J.slice(1),q=J[0]}if(J==="0")return 0;if(q==="0"){if(J[1]==="b")return X*parseInt(J.slice(2),2);if(J[1]==="x")return X*parseInt(J.slice(2),16);if(J[1]==="o")return X*parseInt(J.slice(2),8)}return X*parseInt(J,10)}function $X(Z){return Object.prototype.toString.call(Z)==="[object Number]"&&(Z%1===0&&!Z0.isNegativeZero(Z))}function MX(Z){if(Z===null)return!1;if(!FX.test(Z)||Z[Z.length-1]==="_")return!1;return!0}function AX(Z){var J,X;if(J=Z.replace(/_/g,"").toLowerCase(),X=J[0]==="-"?-1:1,"+-".indexOf(J[0])>=0)J=J.slice(1);if(J===".inf")return X===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(J===".nan")return NaN;return X*parseFloat(J,10)}function IX(Z,J){var X;if(isNaN(Z))switch(J){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===Z)switch(J){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===Z)switch(J){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Z0.isNegativeZero(Z))return"-0.0";return X=Z.toString(10),LX.test(X)?X.replace("e",".e"):X}function DX(Z){return Object.prototype.toString.call(Z)==="[object Number]"&&(Z%1!==0||Z0.isNegativeZero(Z))}function wX(Z){if(Z===null)return!1;if(M3.exec(Z)!==null)return!0;if(A3.exec(Z)!==null)return!0;return!1}function NX(Z){var J,X,q,W,Q,G,z,Y=0,U=null,K,V,H;if(J=M3.exec(Z),J===null)J=A3.exec(Z);if(J===null)throw Error("Date resolve error");if(X=+J[1],q=+J[2]-1,W=+J[3],!J[4])return new Date(Date.UTC(X,q,W));if(Q=+J[4],G=+J[5],z=+J[6],J[7]){Y=J[7].slice(0,3);while(Y.length<3)Y+="0";Y=+Y}if(J[9]){if(K=+J[10],V=+(J[11]||0),U=(K*60+V)*60000,J[9]==="-")U=-U}if(H=new Date(Date.UTC(X,q,W,Q,G,z,Y)),U)H.setTime(H.getTime()-U);return H}function TX(Z){return Z.toISOString()}function RX(Z){return Z==="<<"||Z===null}function PX(Z){if(Z===null)return!1;var J,X,q=0,W=Z.length,Q=s6;for(X=0;X<W;X++){if(J=Q.indexOf(Z.charAt(X)),J>64)continue;if(J<0)return!1;q+=6}return q%8===0}function jX(Z){var J,X,q=Z.replace(/[\r\n=]/g,""),W=q.length,Q=s6,G=0,z=[];for(J=0;J<W;J++){if(J%4===0&&J)z.push(G>>16&255),z.push(G>>8&255),z.push(G&255);G=G<<6|Q.indexOf(q.charAt(J))}if(X=W%4*6,X===0)z.push(G>>16&255),z.push(G>>8&255),z.push(G&255);else if(X===18)z.push(G>>10&255),z.push(G>>2&255);else if(X===12)z.push(G>>4&255);return new Uint8Array(z)}function _X(Z){var J="",X=0,q,W,Q=Z.length,G=s6;for(q=0;q<Q;q++){if(q%3===0&&q)J+=G[X>>18&63],J+=G[X>>12&63],J+=G[X>>6&63],J+=G[X&63];X=(X<<8)+Z[q]}if(W=Q%3,W===0)J+=G[X>>18&63],J+=G[X>>12&63],J+=G[X>>6&63],J+=G[X&63];else if(W===2)J+=G[X>>10&63],J+=G[X>>4&63],J+=G[X<<2&63],J+=G[64];else if(W===1)J+=G[X>>2&63],J+=G[X<<4&63],J+=G[64],J+=G[64];return J}function CX(Z){return Object.prototype.toString.call(Z)==="[object Uint8Array]"}function xX(Z){if(Z===null)return!0;var J=[],X,q,W,Q,G,z=Z;for(X=0,q=z.length;X<q;X+=1){if(W=z[X],G=!1,OX.call(W)!=="[object Object]")return!1;for(Q in W)if(EX.call(W,Q))if(!G)G=!0;else return!1;if(!G)return!1;if(J.indexOf(Q)===-1)J.push(Q);else return!1}return!0}function kX(Z){return Z!==null?Z:[]}function bX(Z){if(Z===null)return!0;var J,X,q,W,Q,G=Z;Q=Array(G.length);for(J=0,X=G.length;J<X;J+=1){if(q=G[J],SX.call(q)!=="[object Object]")return!1;if(W=Object.keys(q),W.length!==1)return!1;Q[J]=[W[0],q[W[0]]]}return!0}function vX(Z){if(Z===null)return[];var J,X,q,W,Q,G=Z;Q=Array(G.length);for(J=0,X=G.length;J<X;J+=1)q=G[J],W=Object.keys(q),Q[J]=[W[0],q[W[0]]];return Q}function gX(Z){if(Z===null)return!0;var J,X=Z;for(J in X)if(yX.call(X,J)){if(X[J]!==null)return!1}return!0}function hX(Z){return Z!==null?Z:{}}function l7(Z){return Object.prototype.toString.call(Z)}function S0(Z){return Z===10||Z===13}function H4(Z){return Z===9||Z===32}function M0(Z){return Z===9||Z===32||Z===10||Z===13}function v4(Z){return Z===44||Z===91||Z===93||Z===123||Z===125}function cX(Z){var J;if(48<=Z&&Z<=57)return Z-48;if(J=Z|32,97<=J&&J<=102)return J-97+10;return-1}function lX(Z){if(Z===120)return 2;if(Z===117)return 4;if(Z===85)return 8;return 0}function pX(Z){if(48<=Z&&Z<=57)return Z-48;return-1}function p7(Z){return Z===48?"\x00":Z===97?"\x07":Z===98?"\b":Z===116?"\t":Z===9?"\t":Z===110?`
27
- `:Z===118?"\v":Z===102?"\f":Z===114?"\r":Z===101?"\x1B":Z===32?" ":Z===34?'"':Z===47?"/":Z===92?"\\":Z===78?"…":Z===95?" ":Z===76?"\u2028":Z===80?"\u2029":""}function nX(Z){if(Z<=65535)return String.fromCharCode(Z);return String.fromCharCode((Z-65536>>10)+55296,(Z-65536&1023)+56320)}function C3(Z,J,X){if(J==="__proto__")Object.defineProperty(Z,J,{configurable:!0,enumerable:!0,writable:!0,value:X});else Z[J]=X}function rX(Z,J){this.input=Z,this.filename=J.filename||null,this.schema=J.schema||o6,this.onWarning=J.onWarning||null,this.legacy=J.legacy||!1,this.json=J.json||!1,this.listener=J.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=Z.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function x3(Z,J){var X={name:Z.filename,buffer:Z.input.slice(0,-1),position:Z.position,line:Z.line,column:Z.position-Z.lineStart};return X.snippet=oJ(X),new z0(J,X)}function C(Z,J){throw x3(Z,J)}function d1(Z,J){if(Z.onWarning)Z.onWarning.call(null,x3(Z,J))}function Z4(Z,J,X,q){var W,Q,G,z;if(J<X){if(z=Z.input.slice(J,X),q){for(W=0,Q=z.length;W<Q;W+=1)if(G=z.charCodeAt(W),!(G===9||32<=G&&G<=1114111))C(Z,"expected valid JSON character")}else if(fX.test(z))C(Z,"the stream contains non-printable characters");Z.result+=z}}function r7(Z,J,X,q){var W,Q,G,z;if(!Z0.isObject(X))C(Z,"cannot merge mappings; the provided source object is unacceptable");W=Object.keys(X);for(G=0,z=W.length;G<z;G+=1)if(Q=W[G],!J4.call(J,Q))C3(J,Q,X[Q]),q[Q]=!0}function y4(Z,J,X,q,W,Q,G,z,Y){var U,K;if(Array.isArray(W)){W=Array.prototype.slice.call(W);for(U=0,K=W.length;U<K;U+=1){if(Array.isArray(W[U]))C(Z,"nested arrays are not supported inside keys");if(typeof W==="object"&&l7(W[U])==="[object Object]")W[U]="[object Object]"}}if(typeof W==="object"&&l7(W)==="[object Object]")W="[object Object]";if(W=String(W),J===null)J={};if(q==="tag:yaml.org,2002:merge")if(Array.isArray(Q))for(U=0,K=Q.length;U<K;U+=1)r7(Z,J,Q[U],X);else r7(Z,J,Q,X);else{if(!Z.json&&!J4.call(X,W)&&J4.call(J,W))Z.line=G||Z.line,Z.lineStart=z||Z.lineStart,Z.position=Y||Z.position,C(Z,"duplicated mapping key");C3(J,W,Q),delete X[W]}return J}function t6(Z){var J=Z.input.charCodeAt(Z.position);if(J===10)Z.position++;else if(J===13){if(Z.position++,Z.input.charCodeAt(Z.position)===10)Z.position++}else C(Z,"a line break is expected");Z.line+=1,Z.lineStart=Z.position,Z.firstTabInLine=-1}function t(Z,J,X){var q=0,W=Z.input.charCodeAt(Z.position);while(W!==0){while(H4(W)){if(W===9&&Z.firstTabInLine===-1)Z.firstTabInLine=Z.position;W=Z.input.charCodeAt(++Z.position)}if(J&&W===35)do W=Z.input.charCodeAt(++Z.position);while(W!==10&&W!==13&&W!==0);if(S0(W)){t6(Z),W=Z.input.charCodeAt(Z.position),q++,Z.lineIndent=0;while(W===32)Z.lineIndent++,W=Z.input.charCodeAt(++Z.position)}else break}if(X!==-1&&q!==0&&Z.lineIndent<X)d1(Z,"deficient indentation");return q}function p1(Z){var J=Z.position,X;if(X=Z.input.charCodeAt(J),(X===45||X===46)&&X===Z.input.charCodeAt(J+1)&&X===Z.input.charCodeAt(J+2)){if(J+=3,X=Z.input.charCodeAt(J),X===0||M0(X))return!0}return!1}function e6(Z,J){if(J===1)Z.result+=" ";else if(J>1)Z.result+=Z0.repeat(`
28
- `,J-1)}function iX(Z,J,X){var q,W,Q,G,z,Y,U,K,V=Z.kind,H=Z.result,$;if($=Z.input.charCodeAt(Z.position),M0($)||v4($)||$===35||$===38||$===42||$===33||$===124||$===62||$===39||$===34||$===37||$===64||$===96)return!1;if($===63||$===45){if(W=Z.input.charCodeAt(Z.position+1),M0(W)||X&&v4(W))return!1}Z.kind="scalar",Z.result="",Q=G=Z.position,z=!1;while($!==0){if($===58){if(W=Z.input.charCodeAt(Z.position+1),M0(W)||X&&v4(W))break}else if($===35){if(q=Z.input.charCodeAt(Z.position-1),M0(q))break}else if(Z.position===Z.lineStart&&p1(Z)||X&&v4($))break;else if(S0($))if(Y=Z.line,U=Z.lineStart,K=Z.lineIndent,t(Z,!1,-1),Z.lineIndent>=J){z=!0,$=Z.input.charCodeAt(Z.position);continue}else{Z.position=G,Z.line=Y,Z.lineStart=U,Z.lineIndent=K;break}if(z)Z4(Z,Q,G,!1),e6(Z,Z.line-Y),Q=G=Z.position,z=!1;if(!H4($))G=Z.position+1;$=Z.input.charCodeAt(++Z.position)}if(Z4(Z,Q,G,!1),Z.result)return!0;return Z.kind=V,Z.result=H,!1}function aX(Z,J){var X,q,W;if(X=Z.input.charCodeAt(Z.position),X!==39)return!1;Z.kind="scalar",Z.result="",Z.position++,q=W=Z.position;while((X=Z.input.charCodeAt(Z.position))!==0)if(X===39)if(Z4(Z,q,Z.position,!0),X=Z.input.charCodeAt(++Z.position),X===39)q=Z.position,Z.position++,W=Z.position;else return!0;else if(S0(X))Z4(Z,q,W,!0),e6(Z,t(Z,!1,J)),q=W=Z.position;else if(Z.position===Z.lineStart&&p1(Z))C(Z,"unexpected end of the document within a single quoted scalar");else Z.position++,W=Z.position;C(Z,"unexpected end of the stream within a single quoted scalar")}function sX(Z,J){var X,q,W,Q,G,z;if(z=Z.input.charCodeAt(Z.position),z!==34)return!1;Z.kind="scalar",Z.result="",Z.position++,X=q=Z.position;while((z=Z.input.charCodeAt(Z.position))!==0)if(z===34)return Z4(Z,X,Z.position,!0),Z.position++,!0;else if(z===92){if(Z4(Z,X,Z.position,!0),z=Z.input.charCodeAt(++Z.position),S0(z))t(Z,!1,J);else if(z<256&&E3[z])Z.result+=O3[z],Z.position++;else if((G=lX(z))>0){W=G,Q=0;for(;W>0;W--)if(z=Z.input.charCodeAt(++Z.position),(G=cX(z))>=0)Q=(Q<<4)+G;else C(Z,"expected hexadecimal character");Z.result+=nX(Q),Z.position++}else C(Z,"unknown escape sequence");X=q=Z.position}else if(S0(z))Z4(Z,X,q,!0),e6(Z,t(Z,!1,J)),X=q=Z.position;else if(Z.position===Z.lineStart&&p1(Z))C(Z,"unexpected end of the document within a double quoted scalar");else Z.position++,q=Z.position;C(Z,"unexpected end of the stream within a double quoted scalar")}function oX(Z,J){var X=!0,q,W,Q,G=Z.tag,z,Y=Z.anchor,U,K,V,H,$,A=Object.create(null),D,L,w,I;if(I=Z.input.charCodeAt(Z.position),I===91)K=93,$=!1,z=[];else if(I===123)K=125,$=!0,z={};else return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=z;I=Z.input.charCodeAt(++Z.position);while(I!==0){if(t(Z,!0,J),I=Z.input.charCodeAt(Z.position),I===K)return Z.position++,Z.tag=G,Z.anchor=Y,Z.kind=$?"mapping":"sequence",Z.result=z,!0;else if(!X)C(Z,"missed comma between flow collection entries");else if(I===44)C(Z,"expected the node content, but found ','");if(L=D=w=null,V=H=!1,I===63){if(U=Z.input.charCodeAt(Z.position+1),M0(U))V=H=!0,Z.position++,t(Z,!0,J)}if(q=Z.line,W=Z.lineStart,Q=Z.position,g4(Z,J,f1,!1,!0),L=Z.tag,D=Z.result,t(Z,!0,J),I=Z.input.charCodeAt(Z.position),(H||Z.line===q)&&I===58)V=!0,I=Z.input.charCodeAt(++Z.position),t(Z,!0,J),g4(Z,J,f1,!1,!0),w=Z.result;if($)y4(Z,z,A,L,D,w,q,W,Q);else if(V)z.push(y4(Z,null,A,L,D,w,q,W,Q));else z.push(D);if(t(Z,!0,J),I=Z.input.charCodeAt(Z.position),I===44)X=!0,I=Z.input.charCodeAt(++Z.position);else X=!1}C(Z,"unexpected end of the stream within a flow collection")}function tX(Z,J){var X,q,W=l6,Q=!1,G=!1,z=J,Y=0,U=!1,K,V;if(V=Z.input.charCodeAt(Z.position),V===124)q=!1;else if(V===62)q=!0;else return!1;Z.kind="scalar",Z.result="";while(V!==0)if(V=Z.input.charCodeAt(++Z.position),V===43||V===45)if(l6===W)W=V===43?c7:mX;else C(Z,"repeat of a chomping mode identifier");else if((K=pX(V))>=0)if(K===0)C(Z,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!G)z=J+K-1,G=!0;else C(Z,"repeat of an indentation width identifier");else break;if(H4(V)){do V=Z.input.charCodeAt(++Z.position);while(H4(V));if(V===35)do V=Z.input.charCodeAt(++Z.position);while(!S0(V)&&V!==0)}while(V!==0){t6(Z),Z.lineIndent=0,V=Z.input.charCodeAt(Z.position);while((!G||Z.lineIndent<z)&&V===32)Z.lineIndent++,V=Z.input.charCodeAt(++Z.position);if(!G&&Z.lineIndent>z)z=Z.lineIndent;if(S0(V)){Y++;continue}if(Z.lineIndent<z){if(W===c7)Z.result+=Z0.repeat(`
29
- `,Q?1+Y:Y);else if(W===l6){if(Q)Z.result+=`
30
- `}break}if(q)if(H4(V))U=!0,Z.result+=Z0.repeat(`
31
- `,Q?1+Y:Y);else if(U)U=!1,Z.result+=Z0.repeat(`
32
- `,Y+1);else if(Y===0){if(Q)Z.result+=" "}else Z.result+=Z0.repeat(`
33
- `,Y);else Z.result+=Z0.repeat(`
34
- `,Q?1+Y:Y);Q=!0,G=!0,Y=0,X=Z.position;while(!S0(V)&&V!==0)V=Z.input.charCodeAt(++Z.position);Z4(Z,X,Z.position,!1)}return!0}function i7(Z,J){var X,q=Z.tag,W=Z.anchor,Q=[],G,z=!1,Y;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Q;Y=Z.input.charCodeAt(Z.position);while(Y!==0){if(Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,C(Z,"tab characters must not be used in indentation");if(Y!==45)break;if(G=Z.input.charCodeAt(Z.position+1),!M0(G))break;if(z=!0,Z.position++,t(Z,!0,-1)){if(Z.lineIndent<=J){Q.push(null),Y=Z.input.charCodeAt(Z.position);continue}}if(X=Z.line,g4(Z,J,P3,!1,!0),Q.push(Z.result),t(Z,!0,-1),Y=Z.input.charCodeAt(Z.position),(Z.line===X||Z.lineIndent>J)&&Y!==0)C(Z,"bad indentation of a sequence entry");else if(Z.lineIndent<J)break}if(z)return Z.tag=q,Z.anchor=W,Z.kind="sequence",Z.result=Q,!0;return!1}function eX(Z,J,X){var q,W,Q,G,z,Y,U=Z.tag,K=Z.anchor,V={},H=Object.create(null),$=null,A=null,D=null,L=!1,w=!1,I;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=V;I=Z.input.charCodeAt(Z.position);while(I!==0){if(!L&&Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,C(Z,"tab characters must not be used in indentation");if(q=Z.input.charCodeAt(Z.position+1),Q=Z.line,(I===63||I===58)&&M0(q)){if(I===63){if(L)y4(Z,V,H,$,A,null,G,z,Y),$=A=D=null;w=!0,L=!0,W=!0}else if(L)L=!1,W=!0;else C(Z,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");Z.position+=1,I=q}else{if(G=Z.line,z=Z.lineStart,Y=Z.position,!g4(Z,X,R3,!1,!0))break;if(Z.line===Q){I=Z.input.charCodeAt(Z.position);while(H4(I))I=Z.input.charCodeAt(++Z.position);if(I===58){if(I=Z.input.charCodeAt(++Z.position),!M0(I))C(Z,"a whitespace character is expected after the key-value separator within a block mapping");if(L)y4(Z,V,H,$,A,null,G,z,Y),$=A=D=null;w=!0,L=!1,W=!1,$=Z.tag,A=Z.result}else if(w)C(Z,"can not read an implicit mapping pair; a colon is missed");else return Z.tag=U,Z.anchor=K,!0}else if(w)C(Z,"can not read a block mapping entry; a multiline key may not be an implicit key");else return Z.tag=U,Z.anchor=K,!0}if(Z.line===Q||Z.lineIndent>J){if(L)G=Z.line,z=Z.lineStart,Y=Z.position;if(g4(Z,J,u1,!0,W))if(L)A=Z.result;else D=Z.result;if(!L)y4(Z,V,H,$,A,D,G,z,Y),$=A=D=null;t(Z,!0,-1),I=Z.input.charCodeAt(Z.position)}if((Z.line===Q||Z.lineIndent>J)&&I!==0)C(Z,"bad indentation of a mapping entry");else if(Z.lineIndent<J)break}if(L)y4(Z,V,H,$,A,null,G,z,Y);if(w)Z.tag=U,Z.anchor=K,Z.kind="mapping",Z.result=V;return w}function Zq(Z){var J,X=!1,q=!1,W,Q,G;if(G=Z.input.charCodeAt(Z.position),G!==33)return!1;if(Z.tag!==null)C(Z,"duplication of a tag property");if(G=Z.input.charCodeAt(++Z.position),G===60)X=!0,G=Z.input.charCodeAt(++Z.position);else if(G===33)q=!0,W="!!",G=Z.input.charCodeAt(++Z.position);else W="!";if(J=Z.position,X){do G=Z.input.charCodeAt(++Z.position);while(G!==0&&G!==62);if(Z.position<Z.length)Q=Z.input.slice(J,Z.position),G=Z.input.charCodeAt(++Z.position);else C(Z,"unexpected end of the stream within a verbatim tag")}else{while(G!==0&&!M0(G)){if(G===33)if(!q){if(W=Z.input.slice(J-1,Z.position+1),!j3.test(W))C(Z,"named tag handle cannot contain such characters");q=!0,J=Z.position+1}else C(Z,"tag suffix cannot contain exclamation marks");G=Z.input.charCodeAt(++Z.position)}if(Q=Z.input.slice(J,Z.position),dX.test(Q))C(Z,"tag suffix cannot contain flow indicator characters")}if(Q&&!_3.test(Q))C(Z,"tag name cannot contain such characters: "+Q);try{Q=decodeURIComponent(Q)}catch(z){C(Z,"tag name is malformed: "+Q)}if(X)Z.tag=Q;else if(J4.call(Z.tagMap,W))Z.tag=Z.tagMap[W]+Q;else if(W==="!")Z.tag="!"+Q;else if(W==="!!")Z.tag="tag:yaml.org,2002:"+Q;else C(Z,'undeclared tag handle "'+W+'"');return!0}function Jq(Z){var J,X;if(X=Z.input.charCodeAt(Z.position),X!==38)return!1;if(Z.anchor!==null)C(Z,"duplication of an anchor property");X=Z.input.charCodeAt(++Z.position),J=Z.position;while(X!==0&&!M0(X)&&!v4(X))X=Z.input.charCodeAt(++Z.position);if(Z.position===J)C(Z,"name of an anchor node must contain at least one character");return Z.anchor=Z.input.slice(J,Z.position),!0}function Xq(Z){var J,X,q;if(q=Z.input.charCodeAt(Z.position),q!==42)return!1;q=Z.input.charCodeAt(++Z.position),J=Z.position;while(q!==0&&!M0(q)&&!v4(q))q=Z.input.charCodeAt(++Z.position);if(Z.position===J)C(Z,"name of an alias node must contain at least one character");if(X=Z.input.slice(J,Z.position),!J4.call(Z.anchorMap,X))C(Z,'unidentified alias "'+X+'"');return Z.result=Z.anchorMap[X],t(Z,!0,-1),!0}function g4(Z,J,X,q,W){var Q,G,z,Y=1,U=!1,K=!1,V,H,$,A,D,L;if(Z.listener!==null)Z.listener("open",Z);if(Z.tag=null,Z.anchor=null,Z.kind=null,Z.result=null,Q=G=z=u1===X||P3===X,q){if(t(Z,!0,-1)){if(U=!0,Z.lineIndent>J)Y=1;else if(Z.lineIndent===J)Y=0;else if(Z.lineIndent<J)Y=-1}}if(Y===1)while(Zq(Z)||Jq(Z))if(t(Z,!0,-1)){if(U=!0,z=Q,Z.lineIndent>J)Y=1;else if(Z.lineIndent===J)Y=0;else if(Z.lineIndent<J)Y=-1}else z=!1;if(z)z=U||W;if(Y===1||u1===X){if(f1===X||R3===X)D=J;else D=J+1;if(L=Z.position-Z.lineStart,Y===1)if(z&&(i7(Z,L)||eX(Z,L,D))||oX(Z,D))K=!0;else{if(G&&tX(Z,D)||aX(Z,D)||sX(Z,D))K=!0;else if(Xq(Z)){if(K=!0,Z.tag!==null||Z.anchor!==null)C(Z,"alias node should not have any properties")}else if(iX(Z,D,f1===X)){if(K=!0,Z.tag===null)Z.tag="?"}if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}else if(Y===0)K=z&&i7(Z,L)}if(Z.tag===null){if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}else if(Z.tag==="?"){if(Z.result!==null&&Z.kind!=="scalar")C(Z,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+Z.kind+'"');for(V=0,H=Z.implicitTypes.length;V<H;V+=1)if(A=Z.implicitTypes[V],A.resolve(Z.result)){if(Z.result=A.construct(Z.result),Z.tag=A.tag,Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result;break}}else if(Z.tag!=="!"){if(J4.call(Z.typeMap[Z.kind||"fallback"],Z.tag))A=Z.typeMap[Z.kind||"fallback"][Z.tag];else{A=null,$=Z.typeMap.multi[Z.kind||"fallback"];for(V=0,H=$.length;V<H;V+=1)if(Z.tag.slice(0,$[V].tag.length)===$[V].tag){A=$[V];break}}if(!A)C(Z,"unknown tag !<"+Z.tag+">");if(Z.result!==null&&A.kind!==Z.kind)C(Z,"unacceptable node kind for !<"+Z.tag+'> tag; it should be "'+A.kind+'", not "'+Z.kind+'"');if(!A.resolve(Z.result,Z.tag))C(Z,"cannot resolve a node with !<"+Z.tag+"> explicit tag");else if(Z.result=A.construct(Z.result,Z.tag),Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}if(Z.listener!==null)Z.listener("close",Z);return Z.tag!==null||Z.anchor!==null||K}function qq(Z){var J=Z.position,X,q,W,Q=!1,G;Z.version=null,Z.checkLineBreaks=Z.legacy,Z.tagMap=Object.create(null),Z.anchorMap=Object.create(null);while((G=Z.input.charCodeAt(Z.position))!==0){if(t(Z,!0,-1),G=Z.input.charCodeAt(Z.position),Z.lineIndent>0||G!==37)break;Q=!0,G=Z.input.charCodeAt(++Z.position),X=Z.position;while(G!==0&&!M0(G))G=Z.input.charCodeAt(++Z.position);if(q=Z.input.slice(X,Z.position),W=[],q.length<1)C(Z,"directive name must not be less than one character in length");while(G!==0){while(H4(G))G=Z.input.charCodeAt(++Z.position);if(G===35){do G=Z.input.charCodeAt(++Z.position);while(G!==0&&!S0(G));break}if(S0(G))break;X=Z.position;while(G!==0&&!M0(G))G=Z.input.charCodeAt(++Z.position);W.push(Z.input.slice(X,Z.position))}if(G!==0)t6(Z);if(J4.call(n7,q))n7[q](Z,q,W);else d1(Z,'unknown document directive "'+q+'"')}if(t(Z,!0,-1),Z.lineIndent===0&&Z.input.charCodeAt(Z.position)===45&&Z.input.charCodeAt(Z.position+1)===45&&Z.input.charCodeAt(Z.position+2)===45)Z.position+=3,t(Z,!0,-1);else if(Q)C(Z,"directives end mark is expected");if(g4(Z,Z.lineIndent-1,u1,!1,!0),t(Z,!0,-1),Z.checkLineBreaks&&uX.test(Z.input.slice(J,Z.position)))d1(Z,"non-ASCII line breaks are interpreted as content");if(Z.documents.push(Z.result),Z.position===Z.lineStart&&p1(Z)){if(Z.input.charCodeAt(Z.position)===46)Z.position+=3,t(Z,!0,-1);return}if(Z.position<Z.length-1)C(Z,"end of the stream or a document separator is expected");else return}function k3(Z,J){if(Z=String(Z),J=J||{},Z.length!==0){if(Z.charCodeAt(Z.length-1)!==10&&Z.charCodeAt(Z.length-1)!==13)Z+=`
35
- `;if(Z.charCodeAt(0)===65279)Z=Z.slice(1)}var X=new rX(Z,J),q=Z.indexOf("\x00");if(q!==-1)X.position=q,C(X,"null byte is not allowed in input");X.input+="\x00";while(X.input.charCodeAt(X.position)===32)X.lineIndent+=1,X.position+=1;while(X.position<X.length-1)qq(X);return X.documents}function Wq(Z,J,X){if(J!==null&&typeof J==="object"&&typeof X>"u")X=J,J=null;var q=k3(Z,X);if(typeof J!=="function")return q;for(var W=0,Q=q.length;W<Q;W+=1)J(q[W])}function Qq(Z,J){var X=k3(Z,J);if(X.length===0)return;else if(X.length===1)return X[0];throw new z0("expected a single document in the stream, but found more")}function jq(Z,J){var X,q,W,Q,G,z,Y;if(J===null)return{};X={},q=Object.keys(J);for(W=0,Q=q.length;W<Q;W+=1){if(G=q[W],z=String(J[G]),G.slice(0,2)==="!!")G="tag:yaml.org,2002:"+G.slice(2);if(Y=Z.compiledTypeMap.fallback[G],Y&&v3.call(Y.styleAliases,z))z=Y.styleAliases[z];X[G]=z}return X}function _q(Z){var J,X,q;if(J=Z.toString(16).toUpperCase(),Z<=255)X="x",q=2;else if(Z<=65535)X="u",q=4;else if(Z<=4294967295)X="U",q=8;else throw new z0("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+X+Z0.repeat("0",q-J.length)+J}function Eq(Z){this.schema=Z.schema||o6,this.indent=Math.max(1,Z.indent||2),this.noArrayIndent=Z.noArrayIndent||!1,this.skipInvalid=Z.skipInvalid||!1,this.flowLevel=Z0.isNothing(Z.flowLevel)?-1:Z.flowLevel,this.styleMap=jq(this.schema,Z.styles||null),this.sortKeys=Z.sortKeys||!1,this.lineWidth=Z.lineWidth||80,this.noRefs=Z.noRefs||!1,this.noCompatMode=Z.noCompatMode||!1,this.condenseFlow=Z.condenseFlow||!1,this.quotingType=Z.quotingType==='"'?K1:Cq,this.forceQuotes=Z.forceQuotes||!1,this.replacer=typeof Z.replacer==="function"?Z.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function a7(Z,J){var X=Z0.repeat(" ",J),q=0,W=-1,Q="",G,z=Z.length;while(q<z){if(W=Z.indexOf(`
36
- `,q),W===-1)G=Z.slice(q),q=z;else G=Z.slice(q,W+1),q=W+1;if(G.length&&G!==`
37
- `)Q+=X;Q+=G}return Q}function r6(Z,J){return`
38
- `+Z0.repeat(" ",Z.indent*J)}function Oq(Z,J){var X,q,W;for(X=0,q=Z.implicitTypes.length;X<q;X+=1)if(W=Z.implicitTypes[X],W.resolve(J))return!0;return!1}function l1(Z){return Z===Kq||Z===zq}function V1(Z){return 32<=Z&&Z<=126||161<=Z&&Z<=55295&&Z!==8232&&Z!==8233||57344<=Z&&Z<=65533&&Z!==Z5||65536<=Z&&Z<=1114111}function s7(Z){return V1(Z)&&Z!==Z5&&Z!==Uq&&Z!==U1}function o7(Z,J,X){var q=s7(Z),W=q&&!l1(Z);return(X?q:q&&Z!==y3&&Z!==g3&&Z!==h3&&Z!==m3&&Z!==f3)&&Z!==n6&&!(J===c1&&!W)||s7(J)&&!l1(J)&&Z===n6||J===c1&&W}function xq(Z){return V1(Z)&&Z!==Z5&&!l1(Z)&&Z!==Aq&&Z!==Dq&&Z!==c1&&Z!==y3&&Z!==g3&&Z!==h3&&Z!==m3&&Z!==f3&&Z!==n6&&Z!==$q&&Z!==Mq&&Z!==Vq&&Z!==Tq&&Z!==Lq&&Z!==Iq&&Z!==Fq&&Z!==Bq&&Z!==Hq&&Z!==wq&&Z!==Nq}function kq(Z){return!l1(Z)&&Z!==c1}function Y1(Z,J){var X=Z.charCodeAt(J),q;if(X>=55296&&X<=56319&&J+1<Z.length){if(q=Z.charCodeAt(J+1),q>=56320&&q<=57343)return(X-55296)*1024+q-56320+65536}return X}function u3(Z){var J=/^\n* /;return J.test(Z)}function Sq(Z,J,X,q,W,Q,G,z){var Y,U=0,K=null,V=!1,H=!1,$=q!==-1,A=-1,D=xq(Y1(Z,0))&&kq(Y1(Z,Z.length-1));if(J||G)for(Y=0;Y<Z.length;U>=65536?Y+=2:Y++){if(U=Y1(Z,Y),!V1(U))return b4;D=D&&o7(U,K,z),K=U}else{for(Y=0;Y<Z.length;U>=65536?Y+=2:Y++){if(U=Y1(Z,Y),U===U1){if(V=!0,$)H=H||Y-A-1>q&&Z[A+1]!==" ",A=Y}else if(!V1(U))return b4;D=D&&o7(U,K,z),K=U}H=H||$&&(Y-A-1>q&&Z[A+1]!==" ")}if(!V&&!H){if(D&&!G&&!W(Z))return d3;return Q===K1?b4:i6}if(X>9&&u3(Z))return b4;if(!G)return H?l3:c3;return Q===K1?b4:i6}function bq(Z,J,X,q,W){Z.dump=function(){if(J.length===0)return Z.quotingType===K1?'""':"''";if(!Z.noCompatMode){if(Rq.indexOf(J)!==-1||Pq.test(J))return Z.quotingType===K1?'"'+J+'"':"'"+J+"'"}var Q=Z.indent*Math.max(1,X),G=Z.lineWidth===-1?-1:Math.max(Math.min(Z.lineWidth,40),Z.lineWidth-Q),z=q||Z.flowLevel>-1&&X>=Z.flowLevel;function Y(U){return Oq(Z,U)}switch(Sq(J,z,Z.indent,G,Y,Z.quotingType,Z.forceQuotes&&!q,W)){case d3:return J;case i6:return"'"+J.replace(/'/g,"''")+"'";case c3:return"|"+t7(J,Z.indent)+e7(a7(J,Q));case l3:return">"+t7(J,Z.indent)+e7(a7(vq(J,G),Q));case b4:return'"'+yq(J)+'"';default:throw new z0("impossible error: invalid scalar style")}}()}function t7(Z,J){var X=u3(Z)?String(J):"",q=Z[Z.length-1]===`
39
- `,W=q&&(Z[Z.length-2]===`
22
+ `+Z.mark.snippet;return W+" "+q}function L4(Z,X){if(Error.call(this),this.name="YAMLException",this.reason=Z,this.mark=X,this.message=v8(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}function U5(Z,X,q,W,Q){var J="",z="",Y=Math.floor(Q/2)-1;if(W-X>Y)J=" ... ",X=W-Y+J.length;if(q-W>Y)z=" ...",q=W+Y-z.length;return{str:J+Z.slice(X,q).replace(/\t/g,"→")+z,pos:W-X+J.length}}function K5(Z,X){return a.repeat(" ",X-Z.length)+Z}function IW(Z,X){if(X=Object.create(X||null),!Z.buffer)return null;if(!X.maxLength)X.maxLength=79;if(typeof X.indent!=="number")X.indent=1;if(typeof X.linesBefore!=="number")X.linesBefore=3;if(typeof X.linesAfter!=="number")X.linesAfter=2;var q=/\r?\n|\r|\0/g,W=[0],Q=[],J,z=-1;while(J=q.exec(Z.buffer))if(Q.push(J.index),W.push(J.index+J[0].length),Z.position<=J.index&&z<0)z=W.length-2;if(z<0)z=W.length-1;var Y="",U,K,V=Math.min(Z.line+X.linesAfter,Q.length).toString().length,B=X.maxLength-(X.indent+V+3);for(U=1;U<=X.linesBefore;U++){if(z-U<0)break;K=U5(Z.buffer,W[z-U],Q[z-U],Z.position-(W[z]-W[z-U]),B),Y=a.repeat(" ",X.indent)+K5((Z.line-U+1).toString(),V)+" | "+K.str+`
23
+ `+Y}K=U5(Z.buffer,W[z],Q[z],Z.position,B),Y+=a.repeat(" ",X.indent)+K5((Z.line+1).toString(),V)+" | "+K.str+`
24
+ `,Y+=a.repeat("-",X.indent+V+3+K.pos)+`^
25
+ `;for(U=1;U<=X.linesAfter;U++){if(z+U>=Q.length)break;K=U5(Z.buffer,W[z+U],Q[z+U],Z.position-(W[z]-W[z+U]),B),Y+=a.repeat(" ",X.indent)+K5((Z.line+U+1).toString(),V)+" | "+K.str+`
26
+ `}return Y.replace(/\n$/,"")}function TW(Z){var X={};if(Z!==null)Object.keys(Z).forEach(function(q){Z[q].forEach(function(W){X[String(W)]=q})});return X}function RW(Z,X){if(X=X||{},Object.keys(X).forEach(function(q){if(DW.indexOf(q)===-1)throw new K0('Unknown option "'+q+'" is met in definition of "'+Z+'" YAML type.')}),this.options=X,this.tag=Z,this.kind=X.kind||null,this.resolve=X.resolve||function(){return!0},this.construct=X.construct||function(q){return q},this.instanceOf=X.instanceOf||null,this.predicate=X.predicate||null,this.represent=X.represent||null,this.representName=X.representName||null,this.defaultStyle=X.defaultStyle||null,this.multi=X.multi||!1,this.styleAliases=TW(X.styleAliases||null),NW.indexOf(this.kind)===-1)throw new K0('Unknown kind "'+this.kind+'" is specified for "'+Z+'" YAML type.')}function I8(Z,X){var q=[];return Z[X].forEach(function(W){var Q=q.length;q.forEach(function(J,z){if(J.tag===W.tag&&J.kind===W.kind&&J.multi===W.multi)Q=z}),q[Q]=W}),q}function _W(){var Z={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},X,q;function W(Q){if(Q.multi)Z.multi[Q.kind].push(Q),Z.multi.fallback.push(Q);else Z[Q.kind][Q.tag]=Z.fallback[Q.tag]=Q}for(X=0,q=arguments.length;X<q;X+=1)arguments[X].forEach(W);return Z}function B5(Z){return this.extend(Z)}function PW(Z){if(Z===null)return!0;var X=Z.length;return X===1&&Z==="~"||X===4&&(Z==="null"||Z==="Null"||Z==="NULL")}function jW(){return null}function EW(Z){return Z===null}function CW(Z){if(Z===null)return!1;var X=Z.length;return X===4&&(Z==="true"||Z==="True"||Z==="TRUE")||X===5&&(Z==="false"||Z==="False"||Z==="FALSE")}function OW(Z){return Z==="true"||Z==="True"||Z==="TRUE"}function xW(Z){return Object.prototype.toString.call(Z)==="[object Boolean]"}function kW(Z){return 48<=Z&&Z<=57||65<=Z&&Z<=70||97<=Z&&Z<=102}function SW(Z){return 48<=Z&&Z<=55}function bW(Z){return 48<=Z&&Z<=57}function vW(Z){if(Z===null)return!1;var X=Z.length,q=0,W=!1,Q;if(!X)return!1;if(Q=Z[q],Q==="-"||Q==="+")Q=Z[++q];if(Q==="0"){if(q+1===X)return!0;if(Q=Z[++q],Q==="b"){q++;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(Q!=="0"&&Q!=="1")return!1;W=!0}return W&&Q!=="_"}if(Q==="x"){q++;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(!kW(Z.charCodeAt(q)))return!1;W=!0}return W&&Q!=="_"}if(Q==="o"){q++;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(!SW(Z.charCodeAt(q)))return!1;W=!0}return W&&Q!=="_"}}if(Q==="_")return!1;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(!bW(Z.charCodeAt(q)))return!1;W=!0}if(!W||Q==="_")return!1;return!0}function yW(Z){var X=Z,q=1,W;if(X.indexOf("_")!==-1)X=X.replace(/_/g,"");if(W=X[0],W==="-"||W==="+"){if(W==="-")q=-1;X=X.slice(1),W=X[0]}if(X==="0")return 0;if(W==="0"){if(X[1]==="b")return q*parseInt(X.slice(2),2);if(X[1]==="x")return q*parseInt(X.slice(2),16);if(X[1]==="o")return q*parseInt(X.slice(2),8)}return q*parseInt(X,10)}function gW(Z){return Object.prototype.toString.call(Z)==="[object Number]"&&(Z%1===0&&!a.isNegativeZero(Z))}function mW(Z){if(Z===null)return!1;if(!hW.test(Z)||Z[Z.length-1]==="_")return!1;return!0}function fW(Z){var X,q;if(X=Z.replace(/_/g,"").toLowerCase(),q=X[0]==="-"?-1:1,"+-".indexOf(X[0])>=0)X=X.slice(1);if(X===".inf")return q===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(X===".nan")return NaN;return q*parseFloat(X,10)}function dW(Z,X){var q;if(isNaN(Z))switch(X){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===Z)switch(X){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===Z)switch(X){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(a.isNegativeZero(Z))return"-0.0";return q=Z.toString(10),uW.test(q)?q.replace("e",".e"):q}function cW(Z){return Object.prototype.toString.call(Z)==="[object Number]"&&(Z%1!==0||a.isNegativeZero(Z))}function lW(Z){if(Z===null)return!1;if(i8.exec(Z)!==null)return!0;if(r8.exec(Z)!==null)return!0;return!1}function pW(Z){var X,q,W,Q,J,z,Y,U=0,K=null,V,B,H;if(X=i8.exec(Z),X===null)X=r8.exec(Z);if(X===null)throw Error("Date resolve error");if(q=+X[1],W=+X[2]-1,Q=+X[3],!X[4])return new Date(Date.UTC(q,W,Q));if(J=+X[4],z=+X[5],Y=+X[6],X[7]){U=X[7].slice(0,3);while(U.length<3)U+="0";U=+U}if(X[9]){if(V=+X[10],B=+(X[11]||0),K=(V*60+B)*60000,X[9]==="-")K=-K}if(H=new Date(Date.UTC(q,W,Q,J,z,Y,U)),K)H.setTime(H.getTime()-K);return H}function nW(Z){return Z.toISOString()}function iW(Z){return Z==="<<"||Z===null}function rW(Z){if(Z===null)return!1;var X,q,W=0,Q=Z.length,J=M5;for(q=0;q<Q;q++){if(X=J.indexOf(Z.charAt(q)),X>64)continue;if(X<0)return!1;W+=6}return W%8===0}function aW(Z){var X,q,W=Z.replace(/[\r\n=]/g,""),Q=W.length,J=M5,z=0,Y=[];for(X=0;X<Q;X++){if(X%4===0&&X)Y.push(z>>16&255),Y.push(z>>8&255),Y.push(z&255);z=z<<6|J.indexOf(W.charAt(X))}if(q=Q%4*6,q===0)Y.push(z>>16&255),Y.push(z>>8&255),Y.push(z&255);else if(q===18)Y.push(z>>10&255),Y.push(z>>2&255);else if(q===12)Y.push(z>>4&255);return new Uint8Array(Y)}function sW(Z){var X="",q=0,W,Q,J=Z.length,z=M5;for(W=0;W<J;W++){if(W%3===0&&W)X+=z[q>>18&63],X+=z[q>>12&63],X+=z[q>>6&63],X+=z[q&63];q=(q<<8)+Z[W]}if(Q=J%3,Q===0)X+=z[q>>18&63],X+=z[q>>12&63],X+=z[q>>6&63],X+=z[q&63];else if(Q===2)X+=z[q>>10&63],X+=z[q>>4&63],X+=z[q<<2&63],X+=z[64];else if(Q===1)X+=z[q>>2&63],X+=z[q<<4&63],X+=z[64],X+=z[64];return X}function oW(Z){return Object.prototype.toString.call(Z)==="[object Uint8Array]"}function ZQ(Z){if(Z===null)return!0;var X=[],q,W,Q,J,z,Y=Z;for(q=0,W=Y.length;q<W;q+=1){if(Q=Y[q],z=!1,eW.call(Q)!=="[object Object]")return!1;for(J in Q)if(tW.call(Q,J))if(!z)z=!0;else return!1;if(!z)return!1;if(X.indexOf(J)===-1)X.push(J);else return!1}return!0}function XQ(Z){return Z!==null?Z:[]}function WQ(Z){if(Z===null)return!0;var X,q,W,Q,J,z=Z;J=Array(z.length);for(X=0,q=z.length;X<q;X+=1){if(W=z[X],qQ.call(W)!=="[object Object]")return!1;if(Q=Object.keys(W),Q.length!==1)return!1;J[X]=[Q[0],W[Q[0]]]}return!0}function QQ(Z){if(Z===null)return[];var X,q,W,Q,J,z=Z;J=Array(z.length);for(X=0,q=z.length;X<q;X+=1)W=z[X],Q=Object.keys(W),J[X]=[Q[0],W[Q[0]]];return J}function zQ(Z){if(Z===null)return!0;var X,q=Z;for(X in q)if(JQ.call(q,X)){if(q[X]!==null)return!1}return!0}function GQ(Z){return Z!==null?Z:{}}function D8(Z){return Object.prototype.toString.call(Z)}function h0(Z){return Z===10||Z===13}function j6(Z){return Z===9||Z===32}function F0(Z){return Z===9||Z===32||Z===10||Z===13}function i6(Z){return Z===44||Z===91||Z===93||Z===123||Z===125}function BQ(Z){var X;if(48<=Z&&Z<=57)return Z-48;if(X=Z|32,97<=X&&X<=102)return X-97+10;return-1}function HQ(Z){if(Z===120)return 2;if(Z===117)return 4;if(Z===85)return 8;return 0}function $Q(Z){if(48<=Z&&Z<=57)return Z-48;return-1}function N8(Z){return Z===48?"\x00":Z===97?"\x07":Z===98?"\b":Z===116?"\t":Z===9?"\t":Z===110?`
27
+ `:Z===118?"\v":Z===102?"\f":Z===114?"\r":Z===101?"\x1B":Z===32?" ":Z===34?'"':Z===47?"/":Z===92?"\\":Z===78?"…":Z===95?" ":Z===76?"\u2028":Z===80?"\u2029":""}function FQ(Z){if(Z<=65535)return String.fromCharCode(Z);return String.fromCharCode((Z-65536>>10)+55296,(Z-65536&1023)+56320)}function J9(Z,X,q){if(X==="__proto__")Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,writable:!0,value:q});else Z[X]=q}function AQ(Z,X){this.input=Z,this.filename=X.filename||null,this.schema=X.schema||L5,this.onWarning=X.onWarning||null,this.legacy=X.legacy||!1,this.json=X.json||!1,this.listener=X.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=Z.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Y9(Z,X){var q={name:Z.filename,buffer:Z.input.slice(0,-1),position:Z.position,line:Z.line,column:Z.position-Z.lineStart};return q.snippet=wW(q),new K0(X,q)}function P(Z,X){throw Y9(Z,X)}function W1(Z,X){if(Z.onWarning)Z.onWarning.call(null,Y9(Z,X))}function U6(Z,X,q,W){var Q,J,z,Y;if(X<q){if(Y=Z.input.slice(X,q),W){for(Q=0,J=Y.length;Q<J;Q+=1)if(z=Y.charCodeAt(Q),!(z===9||32<=z&&z<=1114111))P(Z,"expected valid JSON character")}else if(UQ.test(Y))P(Z,"the stream contains non-printable characters");Z.result+=Y}}function R8(Z,X,q,W){var Q,J,z,Y;if(!a.isObject(q))P(Z,"cannot merge mappings; the provided source object is unacceptable");Q=Object.keys(q);for(z=0,Y=Q.length;z<Y;z+=1)if(J=Q[z],!K6.call(X,J))J9(X,J,q[J]),W[J]=!0}function r6(Z,X,q,W,Q,J,z,Y,U){var K,V;if(Array.isArray(Q)){Q=Array.prototype.slice.call(Q);for(K=0,V=Q.length;K<V;K+=1){if(Array.isArray(Q[K]))P(Z,"nested arrays are not supported inside keys");if(typeof Q==="object"&&D8(Q[K])==="[object Object]")Q[K]="[object Object]"}}if(typeof Q==="object"&&D8(Q)==="[object Object]")Q="[object Object]";if(Q=String(Q),X===null)X={};if(W==="tag:yaml.org,2002:merge")if(Array.isArray(J))for(K=0,V=J.length;K<V;K+=1)R8(Z,X,J[K],q);else R8(Z,X,J,q);else{if(!Z.json&&!K6.call(q,Q)&&K6.call(X,Q))Z.line=z||Z.line,Z.lineStart=Y||Z.lineStart,Z.position=U||Z.position,P(Z,"duplicated mapping key");J9(X,Q,J),delete q[Q]}return X}function I5(Z){var X=Z.input.charCodeAt(Z.position);if(X===10)Z.position++;else if(X===13){if(Z.position++,Z.input.charCodeAt(Z.position)===10)Z.position++}else P(Z,"a line break is expected");Z.line+=1,Z.lineStart=Z.position,Z.firstTabInLine=-1}function i(Z,X,q){var W=0,Q=Z.input.charCodeAt(Z.position);while(Q!==0){while(j6(Q)){if(Q===9&&Z.firstTabInLine===-1)Z.firstTabInLine=Z.position;Q=Z.input.charCodeAt(++Z.position)}if(X&&Q===35)do Q=Z.input.charCodeAt(++Z.position);while(Q!==10&&Q!==13&&Q!==0);if(h0(Q)){I5(Z),Q=Z.input.charCodeAt(Z.position),W++,Z.lineIndent=0;while(Q===32)Z.lineIndent++,Q=Z.input.charCodeAt(++Z.position)}else break}if(q!==-1&&W!==0&&Z.lineIndent<q)W1(Z,"deficient indentation");return W}function z1(Z){var X=Z.position,q;if(q=Z.input.charCodeAt(X),(q===45||q===46)&&q===Z.input.charCodeAt(X+1)&&q===Z.input.charCodeAt(X+2)){if(X+=3,q=Z.input.charCodeAt(X),q===0||F0(q))return!0}return!1}function w5(Z,X){if(X===1)Z.result+=" ";else if(X>1)Z.result+=a.repeat(`
28
+ `,X-1)}function MQ(Z,X,q){var W,Q,J,z,Y,U,K,V,B=Z.kind,H=Z.result,$;if($=Z.input.charCodeAt(Z.position),F0($)||i6($)||$===35||$===38||$===42||$===33||$===124||$===62||$===39||$===34||$===37||$===64||$===96)return!1;if($===63||$===45){if(Q=Z.input.charCodeAt(Z.position+1),F0(Q)||q&&i6(Q))return!1}Z.kind="scalar",Z.result="",J=z=Z.position,Y=!1;while($!==0){if($===58){if(Q=Z.input.charCodeAt(Z.position+1),F0(Q)||q&&i6(Q))break}else if($===35){if(W=Z.input.charCodeAt(Z.position-1),F0(W))break}else if(Z.position===Z.lineStart&&z1(Z)||q&&i6($))break;else if(h0($))if(U=Z.line,K=Z.lineStart,V=Z.lineIndent,i(Z,!1,-1),Z.lineIndent>=X){Y=!0,$=Z.input.charCodeAt(Z.position);continue}else{Z.position=z,Z.line=U,Z.lineStart=K,Z.lineIndent=V;break}if(Y)U6(Z,J,z,!1),w5(Z,Z.line-U),J=z=Z.position,Y=!1;if(!j6($))z=Z.position+1;$=Z.input.charCodeAt(++Z.position)}if(U6(Z,J,z,!1),Z.result)return!0;return Z.kind=B,Z.result=H,!1}function LQ(Z,X){var q,W,Q;if(q=Z.input.charCodeAt(Z.position),q!==39)return!1;Z.kind="scalar",Z.result="",Z.position++,W=Q=Z.position;while((q=Z.input.charCodeAt(Z.position))!==0)if(q===39)if(U6(Z,W,Z.position,!0),q=Z.input.charCodeAt(++Z.position),q===39)W=Z.position,Z.position++,Q=Z.position;else return!0;else if(h0(q))U6(Z,W,Q,!0),w5(Z,i(Z,!1,X)),W=Q=Z.position;else if(Z.position===Z.lineStart&&z1(Z))P(Z,"unexpected end of the document within a single quoted scalar");else Z.position++,Q=Z.position;P(Z,"unexpected end of the stream within a single quoted scalar")}function IQ(Z,X){var q,W,Q,J,z,Y;if(Y=Z.input.charCodeAt(Z.position),Y!==34)return!1;Z.kind="scalar",Z.result="",Z.position++,q=W=Z.position;while((Y=Z.input.charCodeAt(Z.position))!==0)if(Y===34)return U6(Z,q,Z.position,!0),Z.position++,!0;else if(Y===92){if(U6(Z,q,Z.position,!0),Y=Z.input.charCodeAt(++Z.position),h0(Y))i(Z,!1,X);else if(Y<256&&z9[Y])Z.result+=G9[Y],Z.position++;else if((z=HQ(Y))>0){Q=z,J=0;for(;Q>0;Q--)if(Y=Z.input.charCodeAt(++Z.position),(z=BQ(Y))>=0)J=(J<<4)+z;else P(Z,"expected hexadecimal character");Z.result+=FQ(J),Z.position++}else P(Z,"unknown escape sequence");q=W=Z.position}else if(h0(Y))U6(Z,q,W,!0),w5(Z,i(Z,!1,X)),q=W=Z.position;else if(Z.position===Z.lineStart&&z1(Z))P(Z,"unexpected end of the document within a double quoted scalar");else Z.position++,W=Z.position;P(Z,"unexpected end of the stream within a double quoted scalar")}function wQ(Z,X){var q=!0,W,Q,J,z=Z.tag,Y,U=Z.anchor,K,V,B,H,$,F=Object.create(null),L,A,I,M;if(M=Z.input.charCodeAt(Z.position),M===91)V=93,$=!1,Y=[];else if(M===123)V=125,$=!0,Y={};else return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Y;M=Z.input.charCodeAt(++Z.position);while(M!==0){if(i(Z,!0,X),M=Z.input.charCodeAt(Z.position),M===V)return Z.position++,Z.tag=z,Z.anchor=U,Z.kind=$?"mapping":"sequence",Z.result=Y,!0;else if(!q)P(Z,"missed comma between flow collection entries");else if(M===44)P(Z,"expected the node content, but found ','");if(A=L=I=null,B=H=!1,M===63){if(K=Z.input.charCodeAt(Z.position+1),F0(K))B=H=!0,Z.position++,i(Z,!0,X)}if(W=Z.line,Q=Z.lineStart,J=Z.position,a6(Z,X,X1,!1,!0),A=Z.tag,L=Z.result,i(Z,!0,X),M=Z.input.charCodeAt(Z.position),(H||Z.line===W)&&M===58)B=!0,M=Z.input.charCodeAt(++Z.position),i(Z,!0,X),a6(Z,X,X1,!1,!0),I=Z.result;if($)r6(Z,Y,F,A,L,I,W,Q,J);else if(B)Y.push(r6(Z,null,F,A,L,I,W,Q,J));else Y.push(L);if(i(Z,!0,X),M=Z.input.charCodeAt(Z.position),M===44)q=!0,M=Z.input.charCodeAt(++Z.position);else q=!1}P(Z,"unexpected end of the stream within a flow collection")}function DQ(Z,X){var q,W,Q=V5,J=!1,z=!1,Y=X,U=0,K=!1,V,B;if(B=Z.input.charCodeAt(Z.position),B===124)W=!1;else if(B===62)W=!0;else return!1;Z.kind="scalar",Z.result="";while(B!==0)if(B=Z.input.charCodeAt(++Z.position),B===43||B===45)if(V5===Q)Q=B===43?w8:YQ;else P(Z,"repeat of a chomping mode identifier");else if((V=$Q(B))>=0)if(V===0)P(Z,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!z)Y=X+V-1,z=!0;else P(Z,"repeat of an indentation width identifier");else break;if(j6(B)){do B=Z.input.charCodeAt(++Z.position);while(j6(B));if(B===35)do B=Z.input.charCodeAt(++Z.position);while(!h0(B)&&B!==0)}while(B!==0){I5(Z),Z.lineIndent=0,B=Z.input.charCodeAt(Z.position);while((!z||Z.lineIndent<Y)&&B===32)Z.lineIndent++,B=Z.input.charCodeAt(++Z.position);if(!z&&Z.lineIndent>Y)Y=Z.lineIndent;if(h0(B)){U++;continue}if(Z.lineIndent<Y){if(Q===w8)Z.result+=a.repeat(`
29
+ `,J?1+U:U);else if(Q===V5){if(J)Z.result+=`
30
+ `}break}if(W)if(j6(B))K=!0,Z.result+=a.repeat(`
31
+ `,J?1+U:U);else if(K)K=!1,Z.result+=a.repeat(`
32
+ `,U+1);else if(U===0){if(J)Z.result+=" "}else Z.result+=a.repeat(`
33
+ `,U);else Z.result+=a.repeat(`
34
+ `,J?1+U:U);J=!0,z=!0,U=0,q=Z.position;while(!h0(B)&&B!==0)B=Z.input.charCodeAt(++Z.position);U6(Z,q,Z.position,!1)}return!0}function _8(Z,X){var q,W=Z.tag,Q=Z.anchor,J=[],z,Y=!1,U;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=J;U=Z.input.charCodeAt(Z.position);while(U!==0){if(Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,P(Z,"tab characters must not be used in indentation");if(U!==45)break;if(z=Z.input.charCodeAt(Z.position+1),!F0(z))break;if(Y=!0,Z.position++,i(Z,!0,-1)){if(Z.lineIndent<=X){J.push(null),U=Z.input.charCodeAt(Z.position);continue}}if(q=Z.line,a6(Z,X,q9,!1,!0),J.push(Z.result),i(Z,!0,-1),U=Z.input.charCodeAt(Z.position),(Z.line===q||Z.lineIndent>X)&&U!==0)P(Z,"bad indentation of a sequence entry");else if(Z.lineIndent<X)break}if(Y)return Z.tag=W,Z.anchor=Q,Z.kind="sequence",Z.result=J,!0;return!1}function NQ(Z,X,q){var W,Q,J,z,Y,U,K=Z.tag,V=Z.anchor,B={},H=Object.create(null),$=null,F=null,L=null,A=!1,I=!1,M;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=B;M=Z.input.charCodeAt(Z.position);while(M!==0){if(!A&&Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,P(Z,"tab characters must not be used in indentation");if(W=Z.input.charCodeAt(Z.position+1),J=Z.line,(M===63||M===58)&&F0(W)){if(M===63){if(A)r6(Z,B,H,$,F,null,z,Y,U),$=F=L=null;I=!0,A=!0,Q=!0}else if(A)A=!1,Q=!0;else P(Z,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");Z.position+=1,M=W}else{if(z=Z.line,Y=Z.lineStart,U=Z.position,!a6(Z,q,X9,!1,!0))break;if(Z.line===J){M=Z.input.charCodeAt(Z.position);while(j6(M))M=Z.input.charCodeAt(++Z.position);if(M===58){if(M=Z.input.charCodeAt(++Z.position),!F0(M))P(Z,"a whitespace character is expected after the key-value separator within a block mapping");if(A)r6(Z,B,H,$,F,null,z,Y,U),$=F=L=null;I=!0,A=!1,Q=!1,$=Z.tag,F=Z.result}else if(I)P(Z,"can not read an implicit mapping pair; a colon is missed");else return Z.tag=K,Z.anchor=V,!0}else if(I)P(Z,"can not read a block mapping entry; a multiline key may not be an implicit key");else return Z.tag=K,Z.anchor=V,!0}if(Z.line===J||Z.lineIndent>X){if(A)z=Z.line,Y=Z.lineStart,U=Z.position;if(a6(Z,X,q1,!0,Q))if(A)F=Z.result;else L=Z.result;if(!A)r6(Z,B,H,$,F,L,z,Y,U),$=F=L=null;i(Z,!0,-1),M=Z.input.charCodeAt(Z.position)}if((Z.line===J||Z.lineIndent>X)&&M!==0)P(Z,"bad indentation of a mapping entry");else if(Z.lineIndent<X)break}if(A)r6(Z,B,H,$,F,null,z,Y,U);if(I)Z.tag=K,Z.anchor=V,Z.kind="mapping",Z.result=B;return I}function TQ(Z){var X,q=!1,W=!1,Q,J,z;if(z=Z.input.charCodeAt(Z.position),z!==33)return!1;if(Z.tag!==null)P(Z,"duplication of a tag property");if(z=Z.input.charCodeAt(++Z.position),z===60)q=!0,z=Z.input.charCodeAt(++Z.position);else if(z===33)W=!0,Q="!!",z=Z.input.charCodeAt(++Z.position);else Q="!";if(X=Z.position,q){do z=Z.input.charCodeAt(++Z.position);while(z!==0&&z!==62);if(Z.position<Z.length)J=Z.input.slice(X,Z.position),z=Z.input.charCodeAt(++Z.position);else P(Z,"unexpected end of the stream within a verbatim tag")}else{while(z!==0&&!F0(z)){if(z===33)if(!W){if(Q=Z.input.slice(X-1,Z.position+1),!W9.test(Q))P(Z,"named tag handle cannot contain such characters");W=!0,X=Z.position+1}else P(Z,"tag suffix cannot contain exclamation marks");z=Z.input.charCodeAt(++Z.position)}if(J=Z.input.slice(X,Z.position),VQ.test(J))P(Z,"tag suffix cannot contain flow indicator characters")}if(J&&!Q9.test(J))P(Z,"tag name cannot contain such characters: "+J);try{J=decodeURIComponent(J)}catch(Y){P(Z,"tag name is malformed: "+J)}if(q)Z.tag=J;else if(K6.call(Z.tagMap,Q))Z.tag=Z.tagMap[Q]+J;else if(Q==="!")Z.tag="!"+J;else if(Q==="!!")Z.tag="tag:yaml.org,2002:"+J;else P(Z,'undeclared tag handle "'+Q+'"');return!0}function RQ(Z){var X,q;if(q=Z.input.charCodeAt(Z.position),q!==38)return!1;if(Z.anchor!==null)P(Z,"duplication of an anchor property");q=Z.input.charCodeAt(++Z.position),X=Z.position;while(q!==0&&!F0(q)&&!i6(q))q=Z.input.charCodeAt(++Z.position);if(Z.position===X)P(Z,"name of an anchor node must contain at least one character");return Z.anchor=Z.input.slice(X,Z.position),!0}function _Q(Z){var X,q,W;if(W=Z.input.charCodeAt(Z.position),W!==42)return!1;W=Z.input.charCodeAt(++Z.position),X=Z.position;while(W!==0&&!F0(W)&&!i6(W))W=Z.input.charCodeAt(++Z.position);if(Z.position===X)P(Z,"name of an alias node must contain at least one character");if(q=Z.input.slice(X,Z.position),!K6.call(Z.anchorMap,q))P(Z,'unidentified alias "'+q+'"');return Z.result=Z.anchorMap[q],i(Z,!0,-1),!0}function a6(Z,X,q,W,Q){var J,z,Y,U=1,K=!1,V=!1,B,H,$,F,L,A;if(Z.listener!==null)Z.listener("open",Z);if(Z.tag=null,Z.anchor=null,Z.kind=null,Z.result=null,J=z=Y=q1===q||q9===q,W){if(i(Z,!0,-1)){if(K=!0,Z.lineIndent>X)U=1;else if(Z.lineIndent===X)U=0;else if(Z.lineIndent<X)U=-1}}if(U===1)while(TQ(Z)||RQ(Z))if(i(Z,!0,-1)){if(K=!0,Y=J,Z.lineIndent>X)U=1;else if(Z.lineIndent===X)U=0;else if(Z.lineIndent<X)U=-1}else Y=!1;if(Y)Y=K||Q;if(U===1||q1===q){if(X1===q||X9===q)L=X;else L=X+1;if(A=Z.position-Z.lineStart,U===1)if(Y&&(_8(Z,A)||NQ(Z,A,L))||wQ(Z,L))V=!0;else{if(z&&DQ(Z,L)||LQ(Z,L)||IQ(Z,L))V=!0;else if(_Q(Z)){if(V=!0,Z.tag!==null||Z.anchor!==null)P(Z,"alias node should not have any properties")}else if(MQ(Z,L,X1===q)){if(V=!0,Z.tag===null)Z.tag="?"}if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}else if(U===0)V=Y&&_8(Z,A)}if(Z.tag===null){if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}else if(Z.tag==="?"){if(Z.result!==null&&Z.kind!=="scalar")P(Z,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+Z.kind+'"');for(B=0,H=Z.implicitTypes.length;B<H;B+=1)if(F=Z.implicitTypes[B],F.resolve(Z.result)){if(Z.result=F.construct(Z.result),Z.tag=F.tag,Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result;break}}else if(Z.tag!=="!"){if(K6.call(Z.typeMap[Z.kind||"fallback"],Z.tag))F=Z.typeMap[Z.kind||"fallback"][Z.tag];else{F=null,$=Z.typeMap.multi[Z.kind||"fallback"];for(B=0,H=$.length;B<H;B+=1)if(Z.tag.slice(0,$[B].tag.length)===$[B].tag){F=$[B];break}}if(!F)P(Z,"unknown tag !<"+Z.tag+">");if(Z.result!==null&&F.kind!==Z.kind)P(Z,"unacceptable node kind for !<"+Z.tag+'> tag; it should be "'+F.kind+'", not "'+Z.kind+'"');if(!F.resolve(Z.result,Z.tag))P(Z,"cannot resolve a node with !<"+Z.tag+"> explicit tag");else if(Z.result=F.construct(Z.result,Z.tag),Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}if(Z.listener!==null)Z.listener("close",Z);return Z.tag!==null||Z.anchor!==null||V}function PQ(Z){var X=Z.position,q,W,Q,J=!1,z;Z.version=null,Z.checkLineBreaks=Z.legacy,Z.tagMap=Object.create(null),Z.anchorMap=Object.create(null);while((z=Z.input.charCodeAt(Z.position))!==0){if(i(Z,!0,-1),z=Z.input.charCodeAt(Z.position),Z.lineIndent>0||z!==37)break;J=!0,z=Z.input.charCodeAt(++Z.position),q=Z.position;while(z!==0&&!F0(z))z=Z.input.charCodeAt(++Z.position);if(W=Z.input.slice(q,Z.position),Q=[],W.length<1)P(Z,"directive name must not be less than one character in length");while(z!==0){while(j6(z))z=Z.input.charCodeAt(++Z.position);if(z===35){do z=Z.input.charCodeAt(++Z.position);while(z!==0&&!h0(z));break}if(h0(z))break;q=Z.position;while(z!==0&&!F0(z))z=Z.input.charCodeAt(++Z.position);Q.push(Z.input.slice(q,Z.position))}if(z!==0)I5(Z);if(K6.call(T8,W))T8[W](Z,W,Q);else W1(Z,'unknown document directive "'+W+'"')}if(i(Z,!0,-1),Z.lineIndent===0&&Z.input.charCodeAt(Z.position)===45&&Z.input.charCodeAt(Z.position+1)===45&&Z.input.charCodeAt(Z.position+2)===45)Z.position+=3,i(Z,!0,-1);else if(J)P(Z,"directives end mark is expected");if(a6(Z,Z.lineIndent-1,q1,!1,!0),i(Z,!0,-1),Z.checkLineBreaks&&KQ.test(Z.input.slice(X,Z.position)))W1(Z,"non-ASCII line breaks are interpreted as content");if(Z.documents.push(Z.result),Z.position===Z.lineStart&&z1(Z)){if(Z.input.charCodeAt(Z.position)===46)Z.position+=3,i(Z,!0,-1);return}if(Z.position<Z.length-1)P(Z,"end of the stream or a document separator is expected");else return}function U9(Z,X){if(Z=String(Z),X=X||{},Z.length!==0){if(Z.charCodeAt(Z.length-1)!==10&&Z.charCodeAt(Z.length-1)!==13)Z+=`
35
+ `;if(Z.charCodeAt(0)===65279)Z=Z.slice(1)}var q=new AQ(Z,X),W=Z.indexOf("\x00");if(W!==-1)q.position=W,P(q,"null byte is not allowed in input");q.input+="\x00";while(q.input.charCodeAt(q.position)===32)q.lineIndent+=1,q.position+=1;while(q.position<q.length-1)PQ(q);return q.documents}function jQ(Z,X,q){if(X!==null&&typeof X==="object"&&typeof q>"u")q=X,X=null;var W=U9(Z,q);if(typeof X!=="function")return W;for(var Q=0,J=W.length;Q<J;Q+=1)X(W[Q])}function EQ(Z,X){var q=U9(Z,X);if(q.length===0)return;else if(q.length===1)return q[0];throw new K0("expected a single document in the stream, but found more")}function aQ(Z,X){var q,W,Q,J,z,Y,U;if(X===null)return{};q={},W=Object.keys(X);for(Q=0,J=W.length;Q<J;Q+=1){if(z=W[Q],Y=String(X[z]),z.slice(0,2)==="!!")z="tag:yaml.org,2002:"+z.slice(2);if(U=Z.compiledTypeMap.fallback[z],U&&B9.call(U.styleAliases,Y))Y=U.styleAliases[Y];q[z]=Y}return q}function sQ(Z){var X,q,W;if(X=Z.toString(16).toUpperCase(),Z<=255)q="x",W=2;else if(Z<=65535)q="u",W=4;else if(Z<=4294967295)q="U",W=8;else throw new K0("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+q+a.repeat("0",W-X.length)+X}function tQ(Z){this.schema=Z.schema||L5,this.indent=Math.max(1,Z.indent||2),this.noArrayIndent=Z.noArrayIndent||!1,this.skipInvalid=Z.skipInvalid||!1,this.flowLevel=a.isNothing(Z.flowLevel)?-1:Z.flowLevel,this.styleMap=aQ(this.schema,Z.styles||null),this.sortKeys=Z.sortKeys||!1,this.lineWidth=Z.lineWidth||80,this.noRefs=Z.noRefs||!1,this.noCompatMode=Z.noCompatMode||!1,this.condenseFlow=Z.condenseFlow||!1,this.quotingType=Z.quotingType==='"'?w4:oQ,this.forceQuotes=Z.forceQuotes||!1,this.replacer=typeof Z.replacer==="function"?Z.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function P8(Z,X){var q=a.repeat(" ",X),W=0,Q=-1,J="",z,Y=Z.length;while(W<Y){if(Q=Z.indexOf(`
36
+ `,W),Q===-1)z=Z.slice(W),W=Y;else z=Z.slice(W,Q+1),W=Q+1;if(z.length&&z!==`
37
+ `)J+=q;J+=z}return J}function $5(Z,X){return`
38
+ `+a.repeat(" ",Z.indent*X)}function eQ(Z,X){var q,W,Q;for(q=0,W=Z.implicitTypes.length;q<W;q+=1)if(Q=Z.implicitTypes[q],Q.resolve(X))return!0;return!1}function J1(Z){return Z===SQ||Z===xQ}function D4(Z){return 32<=Z&&Z<=126||161<=Z&&Z<=55295&&Z!==8232&&Z!==8233||57344<=Z&&Z<=65533&&Z!==D5||65536<=Z&&Z<=1114111}function j8(Z){return D4(Z)&&Z!==D5&&Z!==kQ&&Z!==I4}function E8(Z,X,q){var W=j8(Z),Q=W&&!J1(Z);return(q?W:W&&Z!==H9&&Z!==$9&&Z!==F9&&Z!==A9&&Z!==M9)&&Z!==H5&&!(X===Q1&&!Q)||j8(X)&&!J1(X)&&Z===H5||X===Q1&&Q}function ZJ(Z){return D4(Z)&&Z!==D5&&!J1(Z)&&Z!==fQ&&Z!==cQ&&Z!==Q1&&Z!==H9&&Z!==$9&&Z!==F9&&Z!==A9&&Z!==M9&&Z!==H5&&Z!==gQ&&Z!==mQ&&Z!==bQ&&Z!==nQ&&Z!==uQ&&Z!==dQ&&Z!==hQ&&Z!==vQ&&Z!==yQ&&Z!==lQ&&Z!==pQ}function XJ(Z){return!J1(Z)&&Z!==Q1}function M4(Z,X){var q=Z.charCodeAt(X),W;if(q>=55296&&q<=56319&&X+1<Z.length){if(W=Z.charCodeAt(X+1),W>=56320&&W<=57343)return(q-55296)*1024+W-56320+65536}return q}function L9(Z){var X=/^\n* /;return X.test(Z)}function qJ(Z,X,q,W,Q,J,z,Y){var U,K=0,V=null,B=!1,H=!1,$=W!==-1,F=-1,L=ZJ(M4(Z,0))&&XJ(M4(Z,Z.length-1));if(X||z)for(U=0;U<Z.length;K>=65536?U+=2:U++){if(K=M4(Z,U),!D4(K))return n6;L=L&&E8(K,V,Y),V=K}else{for(U=0;U<Z.length;K>=65536?U+=2:U++){if(K=M4(Z,U),K===I4){if(B=!0,$)H=H||U-F-1>W&&Z[F+1]!==" ",F=U}else if(!D4(K))return n6;L=L&&E8(K,V,Y),V=K}H=H||$&&(U-F-1>W&&Z[F+1]!==" ")}if(!B&&!H){if(L&&!z&&!Q(Z))return I9;return J===w4?n6:F5}if(q>9&&L9(Z))return n6;if(!z)return H?D9:w9;return J===w4?n6:F5}function WJ(Z,X,q,W,Q){Z.dump=function(){if(X.length===0)return Z.quotingType===w4?'""':"''";if(!Z.noCompatMode){if(iQ.indexOf(X)!==-1||rQ.test(X))return Z.quotingType===w4?'"'+X+'"':"'"+X+"'"}var J=Z.indent*Math.max(1,q),z=Z.lineWidth===-1?-1:Math.max(Math.min(Z.lineWidth,40),Z.lineWidth-J),Y=W||Z.flowLevel>-1&&q>=Z.flowLevel;function U(K){return eQ(Z,K)}switch(qJ(X,Y,Z.indent,z,U,Z.quotingType,Z.forceQuotes&&!W,Q)){case I9:return X;case F5:return"'"+X.replace(/'/g,"''")+"'";case w9:return"|"+C8(X,Z.indent)+O8(P8(X,J));case D9:return">"+C8(X,Z.indent)+O8(P8(QJ(X,z),J));case n6:return'"'+JJ(X)+'"';default:throw new K0("impossible error: invalid scalar style")}}()}function C8(Z,X){var q=L9(Z)?String(X):"",W=Z[Z.length-1]===`
39
+ `,Q=W&&(Z[Z.length-2]===`
40
40
  `||Z===`
41
- `),Q=W?"+":q?"":"-";return X+Q+`
42
- `}function e7(Z){return Z[Z.length-1]===`
43
- `?Z.slice(0,-1):Z}function vq(Z,J){var X=/(\n+)([^\n]*)/g,q=function(){var U=Z.indexOf(`
44
- `);return U=U!==-1?U:Z.length,X.lastIndex=U,Z3(Z.slice(0,U),J)}(),W=Z[0]===`
45
- `||Z[0]===" ",Q,G;while(G=X.exec(Z)){var z=G[1],Y=G[2];Q=Y[0]===" ",q+=z+(!W&&!Q&&Y!==""?`
46
- `:"")+Z3(Y,J),W=Q}return q}function Z3(Z,J){if(Z===""||Z[0]===" ")return Z;var X=/ [^ ]/g,q,W=0,Q,G=0,z=0,Y="";while(q=X.exec(Z)){if(z=q.index,z-W>J)Q=G>W?G:z,Y+=`
47
- `+Z.slice(W,Q),W=Q+1;G=z}if(Y+=`
48
- `,Z.length-W>J&&G>W)Y+=Z.slice(W,G)+`
49
- `+Z.slice(G+1);else Y+=Z.slice(W);return Y.slice(1)}function yq(Z){var J="",X=0,q;for(var W=0;W<Z.length;X>=65536?W+=2:W++)if(X=Y1(Z,W),q=W0[X],!q&&V1(X)){if(J+=Z[W],X>=65536)J+=Z[W+1]}else J+=q||_q(X);return J}function gq(Z,J,X){var q="",W=Z.tag,Q,G,z;for(Q=0,G=X.length;Q<G;Q+=1){if(z=X[Q],Z.replacer)z=Z.replacer.call(X,String(Q),z);if(n0(Z,J,z,!1,!1)||typeof z>"u"&&n0(Z,J,null,!1,!1)){if(q!=="")q+=","+(!Z.condenseFlow?" ":"");q+=Z.dump}}Z.tag=W,Z.dump="["+q+"]"}function J3(Z,J,X,q){var W="",Q=Z.tag,G,z,Y;for(G=0,z=X.length;G<z;G+=1){if(Y=X[G],Z.replacer)Y=Z.replacer.call(X,String(G),Y);if(n0(Z,J+1,Y,!0,!0,!1,!0)||typeof Y>"u"&&n0(Z,J+1,null,!0,!0,!1,!0)){if(!q||W!=="")W+=r6(Z,J);if(Z.dump&&U1===Z.dump.charCodeAt(0))W+="-";else W+="- ";W+=Z.dump}}Z.tag=Q,Z.dump=W||"[]"}function hq(Z,J,X){var q="",W=Z.tag,Q=Object.keys(X),G,z,Y,U,K;for(G=0,z=Q.length;G<z;G+=1){if(K="",q!=="")K+=", ";if(Z.condenseFlow)K+='"';if(Y=Q[G],U=X[Y],Z.replacer)U=Z.replacer.call(X,Y,U);if(!n0(Z,J,Y,!1,!1))continue;if(Z.dump.length>1024)K+="? ";if(K+=Z.dump+(Z.condenseFlow?'"':"")+":"+(Z.condenseFlow?"":" "),!n0(Z,J,U,!1,!1))continue;K+=Z.dump,q+=K}Z.tag=W,Z.dump="{"+q+"}"}function mq(Z,J,X,q){var W="",Q=Z.tag,G=Object.keys(X),z,Y,U,K,V,H;if(Z.sortKeys===!0)G.sort();else if(typeof Z.sortKeys==="function")G.sort(Z.sortKeys);else if(Z.sortKeys)throw new z0("sortKeys must be a boolean or a function");for(z=0,Y=G.length;z<Y;z+=1){if(H="",!q||W!=="")H+=r6(Z,J);if(U=G[z],K=X[U],Z.replacer)K=Z.replacer.call(X,U,K);if(!n0(Z,J+1,U,!0,!0,!0))continue;if(V=Z.tag!==null&&Z.tag!=="?"||Z.dump&&Z.dump.length>1024,V)if(Z.dump&&U1===Z.dump.charCodeAt(0))H+="?";else H+="? ";if(H+=Z.dump,V)H+=r6(Z,J);if(!n0(Z,J+1,K,!0,V))continue;if(Z.dump&&U1===Z.dump.charCodeAt(0))H+=":";else H+=": ";H+=Z.dump,W+=H}Z.tag=Q,Z.dump=W||"{}"}function X3(Z,J,X){var q,W,Q,G,z,Y;W=X?Z.explicitTypes:Z.implicitTypes;for(Q=0,G=W.length;Q<G;Q+=1)if(z=W[Q],(z.instanceOf||z.predicate)&&(!z.instanceOf||typeof J==="object"&&J instanceof z.instanceOf)&&(!z.predicate||z.predicate(J))){if(X)if(z.multi&&z.representName)Z.tag=z.representName(J);else Z.tag=z.tag;else Z.tag="?";if(z.represent){if(Y=Z.styleMap[z.tag]||z.defaultStyle,b3.call(z.represent)==="[object Function]")q=z.represent(J,Y);else if(v3.call(z.represent,Y))q=z.represent[Y](J,Y);else throw new z0("!<"+z.tag+'> tag resolver accepts not "'+Y+'" style');Z.dump=q}return!0}return!1}function n0(Z,J,X,q,W,Q,G){if(Z.tag=null,Z.dump=X,!X3(Z,X,!1))X3(Z,X,!0);var z=b3.call(Z.dump),Y=q,U;if(q)q=Z.flowLevel<0||Z.flowLevel>J;var K=z==="[object Object]"||z==="[object Array]",V,H;if(K)V=Z.duplicates.indexOf(X),H=V!==-1;if(Z.tag!==null&&Z.tag!=="?"||H||Z.indent!==2&&J>0)W=!1;if(H&&Z.usedDuplicates[V])Z.dump="*ref_"+V;else{if(K&&H&&!Z.usedDuplicates[V])Z.usedDuplicates[V]=!0;if(z==="[object Object]"){if(q&&Object.keys(Z.dump).length!==0){if(mq(Z,J,Z.dump,W),H)Z.dump="&ref_"+V+Z.dump}else if(hq(Z,J,Z.dump),H)Z.dump="&ref_"+V+" "+Z.dump}else if(z==="[object Array]"){if(q&&Z.dump.length!==0){if(Z.noArrayIndent&&!G&&J>0)J3(Z,J-1,Z.dump,W);else J3(Z,J,Z.dump,W);if(H)Z.dump="&ref_"+V+Z.dump}else if(gq(Z,J,Z.dump),H)Z.dump="&ref_"+V+" "+Z.dump}else if(z==="[object String]"){if(Z.tag!=="?")bq(Z,Z.dump,J,Q,Y)}else if(z==="[object Undefined]")return!1;else{if(Z.skipInvalid)return!1;throw new z0("unacceptable kind of an object to dump "+z)}if(Z.tag!==null&&Z.tag!=="?"){if(U=encodeURI(Z.tag[0]==="!"?Z.tag.slice(1):Z.tag).replace(/!/g,"%21"),Z.tag[0]==="!")U="!"+U;else if(U.slice(0,18)==="tag:yaml.org,2002:")U="!!"+U.slice(18);else U="!<"+U+">";Z.dump=U+" "+Z.dump}}return!0}function fq(Z,J){var X=[],q=[],W,Q;a6(Z,X,q);for(W=0,Q=q.length;W<Q;W+=1)J.duplicates.push(X[q[W]]);J.usedDuplicates=Array(Q)}function a6(Z,J,X){var q,W,Q;if(Z!==null&&typeof Z==="object")if(W=J.indexOf(Z),W!==-1){if(X.indexOf(W)===-1)X.push(W)}else if(J.push(Z),Array.isArray(Z))for(W=0,Q=Z.length;W<Q;W+=1)a6(Z[W],J,X);else{q=Object.keys(Z);for(W=0,Q=q.length;W<Q;W+=1)a6(Z[q[W]],J,X)}}function uq(Z,J){J=J||{};var X=new Eq(J);if(!X.noRefs)fq(Z,X);var q=Z;if(X.replacer)q=X.replacer.call({"":q},"",q);if(n0(X,0,q,!0,!0))return X.dump+`
50
- `;return""}function J5(Z,J){return function(){throw Error("Function yaml."+Z+" is removed in js-yaml 4. Use yaml."+J+" instead, which is now safe by default.")}}var lJ,pJ,nJ,rJ,iJ,aJ,Z0,z0,oJ,tJ,eJ,q0,Q3,G3,Y3,z3,U3,K3,V3,B3,FX,LX,H3,$3,F3,M3,A3,L3,I3,s6=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
51
- \r`,D3,EX,OX,w3,SX,N3,yX,T3,o6,J4,f1=1,R3=2,P3=3,u1=4,l6=1,mX=2,c7=3,fX,uX,dX,j3,_3,E3,O3,e0,n7,Gq,Yq,S3,b3,v3,Z5=65279,zq=9,U1=10,Uq=13,Kq=32,Vq=33,Bq=34,n6=35,Hq=37,$q=38,Fq=39,Mq=42,y3=44,Aq=45,c1=58,Lq=61,Iq=62,Dq=63,wq=64,g3=91,h3=93,Nq=96,m3=123,Tq=124,f3=125,W0,Rq,Pq,Cq=1,K1=2,d3=1,i6=2,c3=3,l3=4,b4=5,dq,cq,lq,pq,nq,X5,rq,iq,aq,sq,oq,tq,eq,ZW,JW,XW,q5;var W5=O(()=>{/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */lJ=q3,pJ=mJ,nJ=fJ,rJ=dJ,iJ=cJ,aJ=uJ,Z0={isNothing:lJ,isObject:pJ,toArray:nJ,repeat:rJ,isNegativeZero:iJ,extend:aJ};z1.prototype=Object.create(Error.prototype);z1.prototype.constructor=z1;z1.prototype.toString=function(J){return this.name+": "+W3(this,J)};z0=z1;oJ=sJ,tJ=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],eJ=["scalar","sequence","mapping"];q0=JX;p6.prototype.extend=function(J){var X=[],q=[];if(J instanceof q0)q.push(J);else if(Array.isArray(J))q=q.concat(J);else if(J&&(Array.isArray(J.implicit)||Array.isArray(J.explicit))){if(J.implicit)X=X.concat(J.implicit);if(J.explicit)q=q.concat(J.explicit)}else throw new z0("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");X.forEach(function(Q){if(!(Q instanceof q0))throw new z0("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(Q.loadKind&&Q.loadKind!=="scalar")throw new z0("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(Q.multi)throw new z0("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),q.forEach(function(Q){if(!(Q instanceof q0))throw new z0("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var W=Object.create(p6.prototype);return W.implicit=(this.implicit||[]).concat(X),W.explicit=(this.explicit||[]).concat(q),W.compiledImplicit=d7(W,"implicit"),W.compiledExplicit=d7(W,"explicit"),W.compiledTypeMap=XX(W.compiledImplicit,W.compiledExplicit),W};Q3=p6,G3=new q0("tag:yaml.org,2002:str",{kind:"scalar",construct:function(Z){return Z!==null?Z:""}}),Y3=new q0("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(Z){return Z!==null?Z:[]}}),z3=new q0("tag:yaml.org,2002:map",{kind:"mapping",construct:function(Z){return Z!==null?Z:{}}}),U3=new Q3({explicit:[G3,Y3,z3]});K3=new q0("tag:yaml.org,2002:null",{kind:"scalar",resolve:qX,construct:WX,predicate:QX,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});V3=new q0("tag:yaml.org,2002:bool",{kind:"scalar",resolve:GX,construct:YX,predicate:zX,represent:{lowercase:function(Z){return Z?"true":"false"},uppercase:function(Z){return Z?"TRUE":"FALSE"},camelcase:function(Z){return Z?"True":"False"}},defaultStyle:"lowercase"});B3=new q0("tag:yaml.org,2002:int",{kind:"scalar",resolve:BX,construct:HX,predicate:$X,represent:{binary:function(Z){return Z>=0?"0b"+Z.toString(2):"-0b"+Z.toString(2).slice(1)},octal:function(Z){return Z>=0?"0o"+Z.toString(8):"-0o"+Z.toString(8).slice(1)},decimal:function(Z){return Z.toString(10)},hexadecimal:function(Z){return Z>=0?"0x"+Z.toString(16).toUpperCase():"-0x"+Z.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),FX=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");LX=/^[-+]?[0-9]+e/;H3=new q0("tag:yaml.org,2002:float",{kind:"scalar",resolve:MX,construct:AX,predicate:DX,represent:IX,defaultStyle:"lowercase"}),$3=U3.extend({implicit:[K3,V3,B3,H3]}),F3=$3,M3=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),A3=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");L3=new q0("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:wX,construct:NX,instanceOf:Date,represent:TX});I3=new q0("tag:yaml.org,2002:merge",{kind:"scalar",resolve:RX});D3=new q0("tag:yaml.org,2002:binary",{kind:"scalar",resolve:PX,construct:jX,predicate:CX,represent:_X}),EX=Object.prototype.hasOwnProperty,OX=Object.prototype.toString;w3=new q0("tag:yaml.org,2002:omap",{kind:"sequence",resolve:xX,construct:kX}),SX=Object.prototype.toString;N3=new q0("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:bX,construct:vX}),yX=Object.prototype.hasOwnProperty;T3=new q0("tag:yaml.org,2002:set",{kind:"mapping",resolve:gX,construct:hX}),o6=F3.extend({implicit:[L3,I3],explicit:[D3,w3,N3,T3]}),J4=Object.prototype.hasOwnProperty,fX=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,uX=/[\x85\u2028\u2029]/,dX=/[,\[\]\{\}]/,j3=/^(?:!|!!|![a-z\-]+!)$/i,_3=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;E3=Array(256),O3=Array(256);for(e0=0;e0<256;e0++)E3[e0]=p7(e0)?1:0,O3[e0]=p7(e0);n7={YAML:function(J,X,q){var W,Q,G;if(J.version!==null)C(J,"duplication of %YAML directive");if(q.length!==1)C(J,"YAML directive accepts exactly one argument");if(W=/^([0-9]+)\.([0-9]+)$/.exec(q[0]),W===null)C(J,"ill-formed argument of the YAML directive");if(Q=parseInt(W[1],10),G=parseInt(W[2],10),Q!==1)C(J,"unacceptable YAML version of the document");if(J.version=q[0],J.checkLineBreaks=G<2,G!==1&&G!==2)d1(J,"unsupported YAML version of the document")},TAG:function(J,X,q){var W,Q;if(q.length!==2)C(J,"TAG directive accepts exactly two arguments");if(W=q[0],Q=q[1],!j3.test(W))C(J,"ill-formed tag handle (first argument) of the TAG directive");if(J4.call(J.tagMap,W))C(J,'there is a previously declared suffix for "'+W+'" tag handle');if(!_3.test(Q))C(J,"ill-formed tag prefix (second argument) of the TAG directive");try{Q=decodeURIComponent(Q)}catch(G){C(J,"tag prefix is malformed: "+Q)}J.tagMap[W]=Q}};Gq=Wq,Yq=Qq,S3={loadAll:Gq,load:Yq},b3=Object.prototype.toString,v3=Object.prototype.hasOwnProperty,W0={};W0[0]="\\0";W0[7]="\\a";W0[8]="\\b";W0[9]="\\t";W0[10]="\\n";W0[11]="\\v";W0[12]="\\f";W0[13]="\\r";W0[27]="\\e";W0[34]="\\\"";W0[92]="\\\\";W0[133]="\\N";W0[160]="\\_";W0[8232]="\\L";W0[8233]="\\P";Rq=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Pq=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;dq=uq,cq={dump:dq};lq=q0,pq=Q3,nq=U3,X5=$3,rq=F3,iq=o6,aq=S3.load,sq=S3.loadAll,oq=cq.dump,tq=z0,eq={binary:D3,float:H3,map:z3,null:K3,pairs:N3,set:T3,timestamp:L3,bool:V3,int:B3,merge:I3,omap:w3,seq:Y3,str:G3},ZW=J5("safeLoad","load"),JW=J5("safeLoadAll","loadAll"),XW=J5("safeDump","dump"),q5={Type:lq,Schema:pq,FAILSAFE_SCHEMA:nq,JSON_SCHEMA:X5,CORE_SCHEMA:rq,DEFAULT_SCHEMA:iq,load:aq,loadAll:sq,dump:oq,YAMLException:tq,types:eq,safeLoad:ZW,safeLoadAll:JW,safeDump:XW}});var p3;var n3=O(()=>{P0();W5();W5();p3={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(Z){let J=Z.data;if(Buffer.isBuffer(J))J=J.toString();if(typeof J==="string")try{return q5.load(J,{schema:X5})}catch{try{return q5.load(J)}catch(X){throw new R0(X?.message||"Parser Error",Z.url)}}else return J}}});var qW,r3;var i3=O(()=>{P0();qW=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,r3={order:300,allowEmpty:!0,encoding:"utf8",canParse(Z){return(typeof Z.data==="string"||Buffer.isBuffer(Z.data))&&qW.test(Z.url)},parse(Z){if(typeof Z.data==="string")return Z.data;else if(Buffer.isBuffer(Z.data))return Z.data.toString(this.encoding);else throw new R0("data is not text",Z.url)}}});var WW,a3;var s3=O(()=>{WW=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,a3={order:400,allowEmpty:!0,canParse(Z){return Buffer.isBuffer(Z.data)&&WW.test(Z.url)},parse(Z){if(Buffer.isBuffer(Z.data))return Z.data;else return Buffer.from(Z.data)}}});var Q5;var G5=O(()=>{$0();P0();Q5={order:100,canRead(Z){return O1(Z.url)},async read(Z){let J,X=await import("fs");try{J=O4(Z.url)}catch(q){let W=q;throw W.message=`Malformed URI: ${Z.url}: ${W.message}`,new C0(W,Z.url)}if(J.endsWith("/")||J.endsWith("\\"))J=J.slice(0,-1);try{return await X.promises.readFile(J)}catch(q){let W=q;throw W.message=`Error opening file ${J}: ${W.message}`,new C0(W,J)}}}});async function o3(Z,J,X){Z=E4(Z);let q=X||[];q.push(Z.href);try{let W=await QW(Z,J);if(W.status>=400){let Q=Error(`HTTP ERROR ${W.status}`);throw Q.status=W.status,Q}else if(W.status>=300)if(!Number.isNaN(J.redirects)&&q.length>J.redirects){let Q=Error(`Error downloading ${q[0]}.
41
+ `),J=Q?"+":W?"":"-";return q+J+`
42
+ `}function O8(Z){return Z[Z.length-1]===`
43
+ `?Z.slice(0,-1):Z}function QJ(Z,X){var q=/(\n+)([^\n]*)/g,W=function(){var K=Z.indexOf(`
44
+ `);return K=K!==-1?K:Z.length,q.lastIndex=K,x8(Z.slice(0,K),X)}(),Q=Z[0]===`
45
+ `||Z[0]===" ",J,z;while(z=q.exec(Z)){var Y=z[1],U=z[2];J=U[0]===" ",W+=Y+(!Q&&!J&&U!==""?`
46
+ `:"")+x8(U,X),Q=J}return W}function x8(Z,X){if(Z===""||Z[0]===" ")return Z;var q=/ [^ ]/g,W,Q=0,J,z=0,Y=0,U="";while(W=q.exec(Z)){if(Y=W.index,Y-Q>X)J=z>Q?z:Y,U+=`
47
+ `+Z.slice(Q,J),Q=J+1;z=Y}if(U+=`
48
+ `,Z.length-Q>X&&z>Q)U+=Z.slice(Q,z)+`
49
+ `+Z.slice(z+1);else U+=Z.slice(Q);return U.slice(1)}function JJ(Z){var X="",q=0,W;for(var Q=0;Q<Z.length;q>=65536?Q+=2:Q++)if(q=M4(Z,Q),W=z0[q],!W&&D4(q)){if(X+=Z[Q],q>=65536)X+=Z[Q+1]}else X+=W||sQ(q);return X}function zJ(Z,X,q){var W="",Q=Z.tag,J,z,Y;for(J=0,z=q.length;J<z;J+=1){if(Y=q[J],Z.replacer)Y=Z.replacer.call(q,String(J),Y);if(s0(Z,X,Y,!1,!1)||typeof Y>"u"&&s0(Z,X,null,!1,!1)){if(W!=="")W+=","+(!Z.condenseFlow?" ":"");W+=Z.dump}}Z.tag=Q,Z.dump="["+W+"]"}function k8(Z,X,q,W){var Q="",J=Z.tag,z,Y,U;for(z=0,Y=q.length;z<Y;z+=1){if(U=q[z],Z.replacer)U=Z.replacer.call(q,String(z),U);if(s0(Z,X+1,U,!0,!0,!1,!0)||typeof U>"u"&&s0(Z,X+1,null,!0,!0,!1,!0)){if(!W||Q!=="")Q+=$5(Z,X);if(Z.dump&&I4===Z.dump.charCodeAt(0))Q+="-";else Q+="- ";Q+=Z.dump}}Z.tag=J,Z.dump=Q||"[]"}function GJ(Z,X,q){var W="",Q=Z.tag,J=Object.keys(q),z,Y,U,K,V;for(z=0,Y=J.length;z<Y;z+=1){if(V="",W!=="")V+=", ";if(Z.condenseFlow)V+='"';if(U=J[z],K=q[U],Z.replacer)K=Z.replacer.call(q,U,K);if(!s0(Z,X,U,!1,!1))continue;if(Z.dump.length>1024)V+="? ";if(V+=Z.dump+(Z.condenseFlow?'"':"")+":"+(Z.condenseFlow?"":" "),!s0(Z,X,K,!1,!1))continue;V+=Z.dump,W+=V}Z.tag=Q,Z.dump="{"+W+"}"}function YJ(Z,X,q,W){var Q="",J=Z.tag,z=Object.keys(q),Y,U,K,V,B,H;if(Z.sortKeys===!0)z.sort();else if(typeof Z.sortKeys==="function")z.sort(Z.sortKeys);else if(Z.sortKeys)throw new K0("sortKeys must be a boolean or a function");for(Y=0,U=z.length;Y<U;Y+=1){if(H="",!W||Q!=="")H+=$5(Z,X);if(K=z[Y],V=q[K],Z.replacer)V=Z.replacer.call(q,K,V);if(!s0(Z,X+1,K,!0,!0,!0))continue;if(B=Z.tag!==null&&Z.tag!=="?"||Z.dump&&Z.dump.length>1024,B)if(Z.dump&&I4===Z.dump.charCodeAt(0))H+="?";else H+="? ";if(H+=Z.dump,B)H+=$5(Z,X);if(!s0(Z,X+1,V,!0,B))continue;if(Z.dump&&I4===Z.dump.charCodeAt(0))H+=":";else H+=": ";H+=Z.dump,Q+=H}Z.tag=J,Z.dump=Q||"{}"}function S8(Z,X,q){var W,Q,J,z,Y,U;Q=q?Z.explicitTypes:Z.implicitTypes;for(J=0,z=Q.length;J<z;J+=1)if(Y=Q[J],(Y.instanceOf||Y.predicate)&&(!Y.instanceOf||typeof X==="object"&&X instanceof Y.instanceOf)&&(!Y.predicate||Y.predicate(X))){if(q)if(Y.multi&&Y.representName)Z.tag=Y.representName(X);else Z.tag=Y.tag;else Z.tag="?";if(Y.represent){if(U=Z.styleMap[Y.tag]||Y.defaultStyle,V9.call(Y.represent)==="[object Function]")W=Y.represent(X,U);else if(B9.call(Y.represent,U))W=Y.represent[U](X,U);else throw new K0("!<"+Y.tag+'> tag resolver accepts not "'+U+'" style');Z.dump=W}return!0}return!1}function s0(Z,X,q,W,Q,J,z){if(Z.tag=null,Z.dump=q,!S8(Z,q,!1))S8(Z,q,!0);var Y=V9.call(Z.dump),U=W,K;if(W)W=Z.flowLevel<0||Z.flowLevel>X;var V=Y==="[object Object]"||Y==="[object Array]",B,H;if(V)B=Z.duplicates.indexOf(q),H=B!==-1;if(Z.tag!==null&&Z.tag!=="?"||H||Z.indent!==2&&X>0)Q=!1;if(H&&Z.usedDuplicates[B])Z.dump="*ref_"+B;else{if(V&&H&&!Z.usedDuplicates[B])Z.usedDuplicates[B]=!0;if(Y==="[object Object]"){if(W&&Object.keys(Z.dump).length!==0){if(YJ(Z,X,Z.dump,Q),H)Z.dump="&ref_"+B+Z.dump}else if(GJ(Z,X,Z.dump),H)Z.dump="&ref_"+B+" "+Z.dump}else if(Y==="[object Array]"){if(W&&Z.dump.length!==0){if(Z.noArrayIndent&&!z&&X>0)k8(Z,X-1,Z.dump,Q);else k8(Z,X,Z.dump,Q);if(H)Z.dump="&ref_"+B+Z.dump}else if(zJ(Z,X,Z.dump),H)Z.dump="&ref_"+B+" "+Z.dump}else if(Y==="[object String]"){if(Z.tag!=="?")WJ(Z,Z.dump,X,J,U)}else if(Y==="[object Undefined]")return!1;else{if(Z.skipInvalid)return!1;throw new K0("unacceptable kind of an object to dump "+Y)}if(Z.tag!==null&&Z.tag!=="?"){if(K=encodeURI(Z.tag[0]==="!"?Z.tag.slice(1):Z.tag).replace(/!/g,"%21"),Z.tag[0]==="!")K="!"+K;else if(K.slice(0,18)==="tag:yaml.org,2002:")K="!!"+K.slice(18);else K="!<"+K+">";Z.dump=K+" "+Z.dump}}return!0}function UJ(Z,X){var q=[],W=[],Q,J;A5(Z,q,W);for(Q=0,J=W.length;Q<J;Q+=1)X.duplicates.push(q[W[Q]]);X.usedDuplicates=Array(J)}function A5(Z,X,q){var W,Q,J;if(Z!==null&&typeof Z==="object")if(Q=X.indexOf(Z),Q!==-1){if(q.indexOf(Q)===-1)q.push(Q)}else if(X.push(Z),Array.isArray(Z))for(Q=0,J=Z.length;Q<J;Q+=1)A5(Z[Q],X,q);else{W=Object.keys(Z);for(Q=0,J=W.length;Q<J;Q+=1)A5(Z[W[Q]],X,q)}}function KJ(Z,X){X=X||{};var q=new tQ(X);if(!q.noRefs)UJ(Z,q);var W=Z;if(q.replacer)W=q.replacer.call({"":W},"",W);if(s0(q,0,W,!0,!0))return q.dump+`
50
+ `;return""}function N5(Z,X){return function(){throw Error("Function yaml."+Z+" is removed in js-yaml 4. Use yaml."+X+" instead, which is now safe by default.")}}var HW,$W,FW,AW,MW,LW,a,K0,wW,DW,NW,W0,y8,g8,h8,m8,f8,u8,d8,c8,hW,uW,l8,p8,n8,i8,r8,a8,s8,M5=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
51
+ \r`,o8,tW,eW,t8,qQ,e8,JQ,Z9,L5,K6,X1=1,X9=2,q9=3,q1=4,V5=1,YQ=2,w8=3,UQ,KQ,VQ,W9,Q9,z9,G9,Y6,T8,CQ,OQ,K9,V9,B9,D5=65279,xQ=9,I4=10,kQ=13,SQ=32,bQ=33,vQ=34,H5=35,yQ=37,gQ=38,hQ=39,mQ=42,H9=44,fQ=45,Q1=58,uQ=61,dQ=62,cQ=63,lQ=64,$9=91,F9=93,pQ=96,A9=123,nQ=124,M9=125,z0,iQ,rQ,oQ=1,w4=2,I9=1,F5=2,w9=3,D9=4,n6=5,VJ,BJ,HJ,$J,FJ,T5,AJ,MJ,LJ,IJ,wJ,DJ,NJ,TJ,RJ,_J,R5;var _5=R(()=>{/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */HW=b8,$W=YW,FW=UW,AW=VW,MW=BW,LW=KW,a={isNothing:HW,isObject:$W,toArray:FW,repeat:AW,isNegativeZero:MW,extend:LW};L4.prototype=Object.create(Error.prototype);L4.prototype.constructor=L4;L4.prototype.toString=function(X){return this.name+": "+v8(this,X)};K0=L4;wW=IW,DW=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],NW=["scalar","sequence","mapping"];W0=RW;B5.prototype.extend=function(X){var q=[],W=[];if(X instanceof W0)W.push(X);else if(Array.isArray(X))W=W.concat(X);else if(X&&(Array.isArray(X.implicit)||Array.isArray(X.explicit))){if(X.implicit)q=q.concat(X.implicit);if(X.explicit)W=W.concat(X.explicit)}else throw new K0("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");q.forEach(function(J){if(!(J instanceof W0))throw new K0("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(J.loadKind&&J.loadKind!=="scalar")throw new K0("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(J.multi)throw new K0("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),W.forEach(function(J){if(!(J instanceof W0))throw new K0("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var Q=Object.create(B5.prototype);return Q.implicit=(this.implicit||[]).concat(q),Q.explicit=(this.explicit||[]).concat(W),Q.compiledImplicit=I8(Q,"implicit"),Q.compiledExplicit=I8(Q,"explicit"),Q.compiledTypeMap=_W(Q.compiledImplicit,Q.compiledExplicit),Q};y8=B5,g8=new W0("tag:yaml.org,2002:str",{kind:"scalar",construct:function(Z){return Z!==null?Z:""}}),h8=new W0("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(Z){return Z!==null?Z:[]}}),m8=new W0("tag:yaml.org,2002:map",{kind:"mapping",construct:function(Z){return Z!==null?Z:{}}}),f8=new y8({explicit:[g8,h8,m8]});u8=new W0("tag:yaml.org,2002:null",{kind:"scalar",resolve:PW,construct:jW,predicate:EW,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});d8=new W0("tag:yaml.org,2002:bool",{kind:"scalar",resolve:CW,construct:OW,predicate:xW,represent:{lowercase:function(Z){return Z?"true":"false"},uppercase:function(Z){return Z?"TRUE":"FALSE"},camelcase:function(Z){return Z?"True":"False"}},defaultStyle:"lowercase"});c8=new W0("tag:yaml.org,2002:int",{kind:"scalar",resolve:vW,construct:yW,predicate:gW,represent:{binary:function(Z){return Z>=0?"0b"+Z.toString(2):"-0b"+Z.toString(2).slice(1)},octal:function(Z){return Z>=0?"0o"+Z.toString(8):"-0o"+Z.toString(8).slice(1)},decimal:function(Z){return Z.toString(10)},hexadecimal:function(Z){return Z>=0?"0x"+Z.toString(16).toUpperCase():"-0x"+Z.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),hW=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");uW=/^[-+]?[0-9]+e/;l8=new W0("tag:yaml.org,2002:float",{kind:"scalar",resolve:mW,construct:fW,predicate:cW,represent:dW,defaultStyle:"lowercase"}),p8=f8.extend({implicit:[u8,d8,c8,l8]}),n8=p8,i8=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r8=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");a8=new W0("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:lW,construct:pW,instanceOf:Date,represent:nW});s8=new W0("tag:yaml.org,2002:merge",{kind:"scalar",resolve:iW});o8=new W0("tag:yaml.org,2002:binary",{kind:"scalar",resolve:rW,construct:aW,predicate:oW,represent:sW}),tW=Object.prototype.hasOwnProperty,eW=Object.prototype.toString;t8=new W0("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ZQ,construct:XQ}),qQ=Object.prototype.toString;e8=new W0("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:WQ,construct:QQ}),JQ=Object.prototype.hasOwnProperty;Z9=new W0("tag:yaml.org,2002:set",{kind:"mapping",resolve:zQ,construct:GQ}),L5=n8.extend({implicit:[a8,s8],explicit:[o8,t8,e8,Z9]}),K6=Object.prototype.hasOwnProperty,UQ=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,KQ=/[\x85\u2028\u2029]/,VQ=/[,\[\]\{\}]/,W9=/^(?:!|!!|![a-z\-]+!)$/i,Q9=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;z9=Array(256),G9=Array(256);for(Y6=0;Y6<256;Y6++)z9[Y6]=N8(Y6)?1:0,G9[Y6]=N8(Y6);T8={YAML:function(X,q,W){var Q,J,z;if(X.version!==null)P(X,"duplication of %YAML directive");if(W.length!==1)P(X,"YAML directive accepts exactly one argument");if(Q=/^([0-9]+)\.([0-9]+)$/.exec(W[0]),Q===null)P(X,"ill-formed argument of the YAML directive");if(J=parseInt(Q[1],10),z=parseInt(Q[2],10),J!==1)P(X,"unacceptable YAML version of the document");if(X.version=W[0],X.checkLineBreaks=z<2,z!==1&&z!==2)W1(X,"unsupported YAML version of the document")},TAG:function(X,q,W){var Q,J;if(W.length!==2)P(X,"TAG directive accepts exactly two arguments");if(Q=W[0],J=W[1],!W9.test(Q))P(X,"ill-formed tag handle (first argument) of the TAG directive");if(K6.call(X.tagMap,Q))P(X,'there is a previously declared suffix for "'+Q+'" tag handle');if(!Q9.test(J))P(X,"ill-formed tag prefix (second argument) of the TAG directive");try{J=decodeURIComponent(J)}catch(z){P(X,"tag prefix is malformed: "+J)}X.tagMap[Q]=J}};CQ=jQ,OQ=EQ,K9={loadAll:CQ,load:OQ},V9=Object.prototype.toString,B9=Object.prototype.hasOwnProperty,z0={};z0[0]="\\0";z0[7]="\\a";z0[8]="\\b";z0[9]="\\t";z0[10]="\\n";z0[11]="\\v";z0[12]="\\f";z0[13]="\\r";z0[27]="\\e";z0[34]="\\\"";z0[92]="\\\\";z0[133]="\\N";z0[160]="\\_";z0[8232]="\\L";z0[8233]="\\P";iQ=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],rQ=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;VJ=KJ,BJ={dump:VJ};HJ=W0,$J=y8,FJ=f8,T5=p8,AJ=n8,MJ=L5,LJ=K9.load,IJ=K9.loadAll,wJ=BJ.dump,DJ=K0,NJ={binary:o8,float:l8,map:m8,null:u8,pairs:e8,set:Z9,timestamp:a8,bool:d8,int:c8,merge:s8,omap:t8,seq:h8,str:g8},TJ=N5("safeLoad","load"),RJ=N5("safeLoadAll","loadAll"),_J=N5("safeDump","dump"),R5={Type:HJ,Schema:$J,FAILSAFE_SCHEMA:FJ,JSON_SCHEMA:T5,CORE_SCHEMA:AJ,DEFAULT_SCHEMA:MJ,load:LJ,loadAll:IJ,dump:wJ,YAMLException:DJ,types:NJ,safeLoad:TJ,safeLoadAll:RJ,safeDump:_J}});var N9;var T9=R(()=>{P0();_5();_5();N9={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(Z){let X=Z.data;if(Buffer.isBuffer(X))X=X.toString();if(typeof X==="string")try{return R5.load(X,{schema:T5})}catch{try{return R5.load(X)}catch(q){throw new _0(q?.message||"Parser Error",Z.url)}}else return X}}});var PJ,R9;var _9=R(()=>{P0();PJ=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,R9={order:300,allowEmpty:!0,encoding:"utf8",canParse(Z){return(typeof Z.data==="string"||Buffer.isBuffer(Z.data))&&PJ.test(Z.url)},parse(Z){if(typeof Z.data==="string")return Z.data;else if(Buffer.isBuffer(Z.data))return Z.data.toString(this.encoding);else throw new _0("data is not text",Z.url)}}});var jJ,P9;var j9=R(()=>{jJ=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,P9={order:400,allowEmpty:!0,canParse(Z){return Buffer.isBuffer(Z.data)&&jJ.test(Z.url)},parse(Z){if(Buffer.isBuffer(Z.data))return Z.data;else return Buffer.from(Z.data)}}});var P5;var j5=R(()=>{H0();P0();P5={order:100,canRead(Z){return p4(Z.url)},async read(Z){let X,q=await import("fs");try{X=d6(Z.url)}catch(W){let Q=W;throw Q.message=`Malformed URI: ${Z.url}: ${Q.message}`,new x0(Q,Z.url)}if(X.endsWith("/")||X.endsWith("\\"))X=X.slice(0,-1);try{return await q.promises.readFile(X)}catch(W){let Q=W;throw Q.message=`Error opening file ${X}: ${Q.message}`,new x0(Q,X)}}}});async function E9(Z,X,q){Z=u6(Z);let W=q||[];W.push(Z.href);try{let Q=await EJ(Z,X);if(Q.status>=400){let J=Error(`HTTP ERROR ${Q.status}`);throw J.status=Q.status,J}else if(Q.status>=300)if(!Number.isNaN(X.redirects)&&W.length>X.redirects){let J=Error(`Error downloading ${W[0]}.
52
52
  Too many redirects:
53
- ${q.join(`
54
- `)}`);throw Q.status=W.status,new C0(Q)}else if(!("location"in W.headers)||!W.headers.location){let Q=Error(`HTTP ${W.status} redirect with no location header`);throw Q.status=W.status,Q}else{let Q=e(Z.href,W.headers.location);return o3(Q,J,q)}else{if(W.body){let Q=await W.arrayBuffer();return Buffer.from(Q)}return Buffer.alloc(0)}}catch(W){let Q=W;throw Q.message=`Error downloading ${Z.href}: ${Q.message}`,new C0(Q,Z.href)}}async function QW(Z,J){let X,q;if(J.timeout&&typeof AbortController<"u")X=new AbortController,q=setTimeout(()=>X.abort(),J.timeout);let W=await fetch(Z,{method:"GET",headers:J.headers||{},credentials:J.withCredentials?"include":"same-origin",signal:X?X.signal:null});if(q)clearTimeout(q);return W}var Y5;var z5=O(()=>{$0();P0();Y5={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return O7(Z.url)&&(!this.safeUrlResolver||!b6(Z.url))},read(Z){let J=E4(Z.url);if(typeof window<"u"&&!J.protocol)J.protocol=E4(location.href).protocol;return o3(J,this)}}});function J9(Z,J){if(t3(J)){let X=Object.keys(J).filter((q)=>!["__proto__","constructor","prototype"].includes(q));for(let q=0;q<X.length;q++){let W=X[q],Q=J[W],G=Z[W];if(t3(Q))Z[W]=J9(G||{},Q);else if(Q!==void 0)Z[W]=Q}}return Z}function t3(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var e3=()=>{return{parse:{json:{...f7},yaml:{...p3},text:{...r3},binary:{...a3}},resolve:{file:{...Q5},http:{...Y5},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},Z9=(Z)=>{let J=e3();if(Z)J9(J,Z);return J};var U5=O(()=>{u7();n3();i3();s3();G5();z5()});function GW(Z){let J,X,q,W,Q=Array.prototype.slice.call(Z);if(typeof Q[Q.length-1]==="function")W=Q.pop();if(typeof Q[0]==="string")if(J=Q[0],typeof Q[2]==="object")X=Q[1],q=Q[2];else X=void 0,q=Q[1];else J="",X=Q[0],q=Q[1];try{q=Z9(q)}catch(G){console.error(`JSON Schema Ref Parser: Error normalizing options: ${G}`)}if(!q.mutateInputSchema&&typeof X==="object")X=JSON.parse(JSON.stringify(X));return{path:J,schema:X,options:q,callback:W}}var B1;var X9=O(()=>{U5();B1=GW});function YW(Z,J){if(!J.resolve?.external)return Promise.resolve();try{let X=Z.$refs._root$Ref.dynamicIdScope?Y0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,q=K5(Z.schema,Z.$refs._root$Ref.path+"#",X,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,J);return Promise.all(q)}catch(X){return Promise.reject(X)}}function K5(Z,J,X,q,W,Q,G,z){G||=new Set;let Y=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!G.has(Z)){G.add(Z);let U=X;if(i.isExternal$Ref(Z))Y.push(zW(Z,J,U,q,W,Q));let K=Object.keys(Z);for(let V of K){let H=F0.join(J,V),$=Z[V],A=q&&$&&typeof $==="object"&&!ArrayBuffer.isView($)?Y0(U,$):U;Y=Y.concat(K5($,H,A,q,W,Q,G,z))}}return Y}async function zW(Z,J,X,q,W,Q){let z=Q.dereference?.externalReferenceResolution==="root"?K4():q?X:J,Y=e(z,Z.$ref),U=s(Y),K=W._get$Ref(U);if(K)return Promise.resolve(K.value);try{let V=Z.$ref,H={url:Y,baseUrl:z};if(typeof V==="string")H.reference=V;let $=await m1(H,W,Q),A=W._get$Ref(U),D=K5($,U+"#",U,A?.dynamicIdScope??!1,W,Q,new Set,!0);return Promise.all(D)}catch(V){if(!Q?.continueOnError||!k0(V))throw V;if(W._$refs[U])V.source=decodeURI(s(J)),V.path=x1(O0(J));return[]}}var q9;var W9=O(()=>{S4();W1();u6();$0();P0();V4();q9=YW});function UW(Z,J){let X=Z.$refs._root$Ref.dynamicIdScope?Y0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,q=[];V5(Z,"schema",Z.$refs._root$Ref.path+"#",X,Z.$refs._root$Ref.dynamicIdScope,"#",0,q,Z.$refs,J);let W=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(KW(q,J,W),(J.bundle||{}).optimizeInternalRefs!==!1)HW(q,Z.schema)}function V5(Z,J,X,q,W,Q,G,z,Y,U){let K=J===null?Z:Z[J],V=U.bundle||{},H=V.excludedPathMatcher||(()=>!1);if(K&&typeof K==="object"&&!ArrayBuffer.isView(K)&&!H(Q)){let $=q;if(i.isAllowed$Ref(K))Q9(Z,J,X,$,W,Q,G,z,Y,U);else{let A=Object.keys(K).sort((D,L)=>{if(D==="definitions"||D==="$defs")return-1;else if(L==="definitions"||L==="$defs")return 1;else return D.length-L.length});for(let D of A){let L=F0.join(X,D),w=F0.join(Q,D),I=K[D],j=W&&I&&typeof I==="object"&&!ArrayBuffer.isView(I)?Y0($,I):$;if(i.isAllowed$Ref(I))Q9(K,D,L,j,W,w,G,z,Y,U);else V5(K,D,L,j,W,w,G,z,Y,U);if(I&&typeof I==="object"&&!Array.isArray(I)){if("$ref"in I)V?.onBundle?.(I.$ref,K[D],K,D)}}}}}function Q9(Z,J,X,q,W,Q,G,z,Y,U){let K=J===null?Z:Z[J],V=e(W?q:X,K.$ref),H=Y._resolve(V,Q,U);if(H===null)return;let A=F0.parse(Q).length,D=s(H.path),L=O0(H.path),w=D!==Y._root$Ref.path&&!Y._aliases[D],I=i.isExtended$Ref(K);G+=H.indirections;let j=VW(z,Z,J);if(j)if(A<j.depth||G<j.indirections)BW(z,j);else return;if(z.push({$ref:K,parent:Z,key:J,pathFromRoot:Q,depth:A,file:D,hash:L,value:H.value,circular:H.circular,extended:I,external:w,indirections:G}),!j||w)V5(H.value,null,H.path,H.$ref.path,H.$ref.dynamicIdScope,Q,G+1,z,Y,U)}function KW(Z,J,X){Z.sort((G,z)=>{if(G.file!==z.file)return G.file<z.file?-1:1;else if(G.hash!==z.hash)return G.hash<z.hash?-1:1;else if(G.circular!==z.circular)return G.circular?-1:1;else if(G.extended!==z.extended)return G.extended?1:-1;else if(G.indirections!==z.indirections)return G.indirections-z.indirections;else if(G.depth!==z.depth)return G.depth-z.depth;else{let Y=Math.max(G.pathFromRoot.lastIndexOf("/definitions"),G.pathFromRoot.lastIndexOf("/$defs")),U=Math.max(z.pathFromRoot.lastIndexOf("/definitions"),z.pathFromRoot.lastIndexOf("/$defs"));if(Y!==U)return U-Y;else return G.pathFromRoot.length-z.pathFromRoot.length}});let q,W,Q;for(let G of Z){let z=J.bundle||{};if(!G.external){if(z.optimizeInternalRefs!==!1)G.$ref.$ref=G.hash}else if(G.file===q&&G.hash===W)if(X&&G9(Z,G))G.$ref.$ref=X+Q;else G.$ref.$ref=Q;else if(G.file===q&&G.hash.indexOf(W+"/")===0){let Y=F0.join(Q,F0.parse(G.hash.replace(W,"#")));if(X&&G9(Z,G))G.$ref.$ref=X+Y;else G.$ref.$ref=Y}else if(q=G.file,W=G.hash,Q=G.pathFromRoot,G.$ref=G.parent[G.key]=i.dereference(G.$ref,G.value,J),G.circular)G.$ref.$ref=G.pathFromRoot}}function VW(Z,J,X){for(let q of Z)if(q&&q.parent===J&&q.key===X)return q;return}function BW(Z,J){let X=Z.indexOf(J);Z.splice(X,1)}function HW(Z,J){for(let X of Z){if(!X.$ref||typeof X.$ref!=="object"||!("$ref"in X.$ref))continue;let q=X.$ref.$ref;if(typeof q!=="string"||!q.startsWith("#/"))continue;let W=$W(J,q);if(W!==q)X.$ref.$ref=W}}function $W(Z,J){if(!J.startsWith("#/"))return J;let X=J.slice(2).split("/"),q=Z,W=[];for(let G of X){if(q===null||q===void 0||typeof q!=="object")return J;if("$ref"in q&&typeof q.$ref==="string"&&q.$ref.startsWith("#/")){let U=q.$ref.slice(2).split("/");if(W.length=0,W.push(...U),q=FW(Z,q.$ref),q===null||q===void 0||typeof q!=="object")return J}let z=G.replace(/~1/g,"/").replace(/~0/g,"~"),Y=Array.isArray(q)?parseInt(z):z;q=q[Y],W.push(G)}return"#/"+W.join("/")}function FW(Z,J){if(!J.startsWith("#/"))return;let X=J.slice(2).split("/"),q=Z;for(let W of X){if(q===null||q===void 0||typeof q!=="object")return;let Q=W.replace(/~1/g,"/").replace(/~0/g,"~"),G=Array.isArray(q)?parseInt(Q):Q;q=q[G]}return q}function G9(Z,J){for(let X of Z){if(X.pathFromRoot==="#"||X.pathFromRoot==="#/")continue;if(J.pathFromRoot.startsWith(X.pathFromRoot+"/")){if(X.value&&typeof X.value==="object"&&"$id"in X.value)return!0}}return!1}var Y9;var z9=O(()=>{S4();W1();$0();V4();Y9=UW});function MW(Z,J){let X=Date.now(),q=Z.$refs._root$Ref.dynamicIdScope?Y0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=B5(Z.schema,Z.$refs._root$Ref.path,q,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,J,X,0);Z.$refs.circular=W.circular,Z.schema=W.value}function B5(Z,J,X,q,W,Q,G,z,Y,U,K,V){let H,$={value:Z,circular:!1};K9(K,U);let A=U.dereference||{},D=A.maxDepth??500;if(V>D)throw RangeError(`Maximum dereference depth (${D}) exceeded at ${W}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let L=A.excludedPathMatcher||(()=>!1);if(A?.circular==="ignore"||!G.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!L(W)){Q.add(Z),G.add(Z);let w=X;if(i.isAllowed$Ref(Z,U))H=U9(Z,J,w,q,W,Q,G,z,Y,U,K,V),$.circular=H.circular,$.value=H.value;else for(let I of Object.keys(Z)){K9(K,U);let j=F0.join(J,I),g=F0.join(W,I);if(L(g))continue;let y=Z[I],E=q&&y&&typeof y==="object"&&!ArrayBuffer.isView(y)?Y0(w,y):w,h;if(i.isAllowed$Ref(y,U)){if(H=U9(y,j,E,q,g,Q,G,z,Y,U,K,V),h=H.circular,Z[I]!==H.value){let N=new Map;if(A?.preservedProperties){if(typeof Z[I]==="object"&&!Array.isArray(Z[I]))A?.preservedProperties.forEach((S)=>{if(S in Z[I])N.set(S,Z[I][S])})}let k=H.value;if(A?.cloneReferences&&!h&&k&&typeof k==="object")k=structuredClone(k);if(Z[I]=k,A?.preservedProperties){if(N.size&&typeof Z[I]==="object"&&!Array.isArray(Z[I]))N.forEach((S,u)=>{Z[I][u]=S})}A?.onDereference?.(y.$ref,Z[I],Z,I)}}else if(!Q.has(y)){if(H=B5(y,j,E,q,g,Q,G,z,Y,U,K,V+1),h=H.circular,Z[I]!==H.value)Z[I]=H.value}else h=n1(j,Y,U);$.circular=$.circular||h}Q.delete(Z)}}return $}function U9(Z,J,X,q,W,Q,G,z,Y,U,K,V){let A=i.isExternal$Ref(Z)&&U?.dereference?.externalReferenceResolution==="root"?K4():q?X:J,D=e(A,Z.$ref),L=z.get(D);if(L){if(!L.circular){let E=Object.keys(Z);if(E.length>1){let h={};for(let N of E)if(N!=="$ref"&&!(N in L.value))h[N]=Z[N];return{circular:L.circular,value:Object.assign({},L.value,h)}}return L}if(typeof L.value==="object"&&"$ref"in L.value&&"$ref"in Z){if(L.value.$ref===Z.$ref)return n1(J,Y,U),L}else return n1(J,Y,U),L}let w=Y._resolve(D,J,U);if(w===null)return{circular:!1,value:null};let I=w.circular,j=I||Q.has(w.value);if(j)n1(J,Y,U);let g=i.dereference(Z,w.value,U);if(!j){let E=B5(g,w.path,w.$ref.path,w.$ref.dynamicIdScope,W,Q,G,z,Y,U,K,V+1);j=E.circular,g=E.value}if(j&&!I&&U.dereference?.circular==="ignore")g=Z;if(I)g.$ref=W;let y={circular:j,value:g};if(Object.keys(Z).length===1)z.set(D,y);return y}function K9(Z,J){if(J&&J.timeoutMs){if(Date.now()-Z>J.timeoutMs)throw new v6(J.timeoutMs)}}function n1(Z,J,X){if(J.circular=!0,X?.dereference?.onCircular?.(Z),!X.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var V9;var B9=O(()=>{S4();W1();$0();V4();P0();V9=MW});function AW(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(J){setTimeout(J,0)}}var H5;var H9=O(()=>{H5=AW()});function D0(Z,J){if(Z){J.then(function(X){H5(function(){Z(null,X)})},function(X){H5(function(){Z(X)})});return}else return J}var $9=O(()=>{H9()});class b0{schema=null;$refs=new G1;async parse(){let Z=B1(arguments),J;if(!Z.path&&!Z.schema){let q=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return D0(Z.callback,Promise.reject(q))}this.schema=null,this.$refs=new G1;let X="http";if(O1(Z.path))Z.path=x7(Z.path),X="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let q=E4(Z.schema.$id),W=q.port??(q.protocol==="https:"?443:80);Z.path=`${q.protocol}//${q.hostname}:${W}`}if(Z.path=e(K4(),Z.path),Z.schema&&typeof Z.schema==="object"){let q=this.$refs._add(Z.path);q.value=Z.schema,q.pathType=X,q.dynamicIdScope=v1(q.value),y1(this.$refs,q.path,q.value,q.pathType,q.dynamicIdScope),J=Promise.resolve(Z.schema)}else J=m1(Z.path,this.$refs,Z.options);try{let q=await J;if(q!==null&&typeof q==="object"&&!Buffer.isBuffer(q))return this.schema=q,D0(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,D0(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||q}" is not a valid JSON Schema`)}catch(q){if(!Z.options.continueOnError||!k0(q))return D0(Z.callback,Promise.reject(q));if(this.$refs._$refs[s(Z.path)])this.$refs._$refs[s(Z.path)].addError(q);return D0(Z.callback,Promise.resolve(null))}}static parse(){let Z=new b0;return Z.parse.apply(Z,arguments)}async resolve(){let Z=B1(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await q9(this,Z.options),$5(this),D0(Z.callback,Promise.resolve(this.$refs))}catch(J){return D0(Z.callback,Promise.reject(J))}}static resolve(){let Z=new b0;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new b0;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=B1(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),Y9(this,Z.options),$5(this),D0(Z.callback,Promise.resolve(this.schema))}catch(J){return D0(Z.callback,Promise.reject(J))}}static dereference(){let Z=new b0;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=B1(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),V9(this,Z.options),$5(this),D0(Z.callback,Promise.resolve(this.schema))}catch(J){return D0(Z.callback,Promise.reject(J))}}}function $5(Z){if(x4.getParserErrors(Z).length>0)throw new x4(Z)}var F9,nV,rV,iV,aV;var M9=O(()=>{h7();u6();X9();W9();z9();B9();$0();G5();z5();P0();$9();V4();U5();$0();F9=b0;nV=b0.parse,rV=b0.resolve,iV=b0.bundle,aV=b0.dereference});function F5(Z){let J=Z.binding??"IMAGES",q=[...Z.formats??[]].filter((W)=>(W in A9)).sort((W,Q)=>Number(Q==="avif")-Number(W==="avif")).map((W)=>[A9[W],Z.quality?.[W]??80]);return`const JX_IMG_WIDTHS = new Set(${JSON.stringify(Z.widths??[])})
55
- const JX_IMG_FORMATS = ${JSON.stringify(q)} // [mime, quality] in preference order
56
- const JX_IMG_BINDING = ${JSON.stringify(J)}
57
- const JX_IMG_REMOTE_DOMAINS = new Set(${JSON.stringify(Z.remoteDomains??[])})
58
-
59
- async function jxHandleImage(request, env, waitUntil) {
60
- const url = new URL(request.url)
61
- const src = url.searchParams.get('src') ?? ''
62
- const w = Number(url.searchParams.get('w') ?? '')
63
-
64
- // Same-origin asset paths, or https sources from allowlisted remote domains —
65
- // never act as an open proxy.
66
- let remoteSrc = null
67
- if (src.startsWith('https://')) {
68
- try {
69
- const remote = new URL(src)
70
- if (JX_IMG_REMOTE_DOMAINS.has(remote.hostname)) remoteSrc = remote
71
- } catch {}
72
- if (!remoteSrc) return new Response('Invalid src', { status: 400 })
73
- } else if (!src.startsWith('/') || src.startsWith('//') || src.includes('..') ||
74
- src.includes(':') || src.includes('\\\\') || src.includes('?') || src.includes('#')) {
75
- return new Response('Invalid src', { status: 400 })
76
- }
77
- if (!JX_IMG_WIDTHS.has(w)) return new Response('Invalid width', { status: 400 })
78
-
79
- const accept = request.headers.get('accept') ?? ''
80
- let target = null
81
- for (const [mime, quality] of JX_IMG_FORMATS) {
82
- if (accept.includes(mime)) { target = { mime, quality }; break }
83
- }
84
-
85
- const v = url.searchParams.get('v') ?? ''
86
- const cacheKey = new Request(url.origin + '/_jx/image?src=' + encodeURIComponent(src) +
87
- '&w=' + w + '&f=' + (target ? target.mime : 'orig') + '&v=' + encodeURIComponent(v))
88
- const cache = caches.default
89
- const hit = await cache.match(cacheKey)
90
- if (hit) {
91
- const out = new Response(hit.body, hit)
92
- out.headers.set('Vary', 'Accept')
93
- return out
94
- }
95
-
96
- const fetchSource = () =>
97
- remoteSrc
98
- ? fetch(remoteSrc.href, { redirect: 'follow' })
99
- : env.ASSETS.fetch(new Request(new URL(src, url.origin)))
100
-
101
- const asset = await fetchSource()
102
- if (!asset.ok || !asset.body) return new Response('Not found', { status: 404 })
103
-
104
- let response
105
- if (target && env[JX_IMG_BINDING]) {
106
- try {
107
- const result = await env[JX_IMG_BINDING]
108
- .input(asset.body)
109
- .transform({ width: w, fit: 'scale-down' })
110
- .output({ format: target.mime, quality: target.quality })
111
- response = result.response()
112
- } catch (e) {
113
- // Transform failed — serve the original source untouched.
114
- const retry = await fetchSource()
115
- response = new Response(retry.body, retry)
116
- }
117
- } else {
118
- response = new Response(asset.body, asset)
119
- }
120
-
121
- response = new Response(response.body, response)
122
- response.headers.set('Cache-Control', 'public, max-age=31536000, immutable')
123
- if (waitUntil) waitUntil(cache.put(cacheKey, response.clone()))
124
- response.headers.set('Vary', 'Accept')
125
- return response
126
- }`}function L9(){return`
127
- app.get('/_jx/image', (c) => jxHandleImage(c.req.raw, c.env, (p) => c.executionCtx?.waitUntil?.(p)))`}function I9(Z){return`// Generated by @jxsuite/compiler — do not edit manually
128
- ${F5(Z)}
129
-
130
- export async function onRequestGet(context) {
131
- return jxHandleImage(context.request, context.env, (p) => context.waitUntil(p))
132
- }
133
- `}var A9;var M5=O(()=>{A9={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png"}});async function r1(Z,J={}){let{baseUrl:X="/_jx/server"}=J,q=await F9.dereference(Z),W=E1(q);if(W.length===0)return null;let Q=W.map(({exportName:z,src:Y})=>`import { ${z} } from '${Y}'`).join(`
134
- `),G=W.map(({exportName:z})=>D9(z,X)).join(`
53
+ ${W.join(`
54
+ `)}`);throw J.status=Q.status,new x0(J)}else if(!("location"in Q.headers)||!Q.headers.location){let J=Error(`HTTP ${Q.status} redirect with no location header`);throw J.status=Q.status,J}else{let J=r(Z.href,Q.headers.location);return E9(J,X,W)}else{if(Q.body){let J=await Q.arrayBuffer();return Buffer.from(J)}return Buffer.alloc(0)}}catch(Q){let J=Q;throw J.message=`Error downloading ${Z.href}: ${J.message}`,new x0(J,Z.href)}}async function EJ(Z,X){let q,W;if(X.timeout&&typeof AbortController<"u")q=new AbortController,W=setTimeout(()=>q.abort(),X.timeout);let Q=await fetch(Z,{method:"GET",headers:X.headers||{},credentials:X.withCredentials?"include":"same-origin",signal:q?q.signal:null});if(W)clearTimeout(W);return Q}var E5;var C5=R(()=>{H0();P0();E5={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return G8(Z.url)&&(!this.safeUrlResolver||!X5(Z.url))},read(Z){let X=u6(Z.url);if(typeof window<"u"&&!X.protocol)X.protocol=u6(location.href).protocol;return E9(X,this)}}});function k9(Z,X){if(C9(X)){let q=Object.keys(X).filter((W)=>!["__proto__","constructor","prototype"].includes(W));for(let W=0;W<q.length;W++){let Q=q[W],J=X[Q],z=Z[Q];if(C9(J))Z[Q]=k9(z||{},J);else if(J!==void 0)Z[Q]=J}}return Z}function C9(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var O9=()=>{return{parse:{json:{...M8},yaml:{...N9},text:{...R9},binary:{...P9}},resolve:{file:{...P5},http:{...E5},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},x9=(Z)=>{let X=O9();if(Z)k9(X,Z);return X};var O5=R(()=>{L8();T9();_9();j9();j5();C5()});function CJ(Z){let X,q,W,Q,J=Array.prototype.slice.call(Z);if(typeof J[J.length-1]==="function")Q=J.pop();if(typeof J[0]==="string")if(X=J[0],typeof J[2]==="object")q=J[1],W=J[2];else q=void 0,W=J[1];else X="",q=J[0],W=J[1];try{W=x9(W)}catch(z){console.error(`JSON Schema Ref Parser: Error normalizing options: ${z}`)}if(!W.mutateInputSchema&&typeof q==="object")q=JSON.parse(JSON.stringify(q));return{path:X,schema:q,options:W,callback:Q}}var N4;var S9=R(()=>{O5();N4=CJ});function OJ(Z,X){if(!X.resolve?.external)return Promise.resolve();try{let q=Z.$refs._root$Ref.dynamicIdScope?U0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=x5(Z.schema,Z.$refs._root$Ref.path+"#",q,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,X);return Promise.all(W)}catch(q){return Promise.reject(q)}}function x5(Z,X,q,W,Q,J,z,Y){z||=new Set;let U=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!z.has(Z)){z.add(Z);let K=q;if(d.isExternal$Ref(Z))U.push(xJ(Z,X,K,W,Q,J));let V=Object.keys(Z);for(let B of V){let H=$0.join(X,B),$=Z[B],F=W&&$&&typeof $==="object"&&!ArrayBuffer.isView($)?U0(K,$):K;U=U.concat(x5($,H,F,W,Q,J,z,Y))}}return U}async function xJ(Z,X,q,W,Q,J){let Y=J.dereference?.externalReferenceResolution==="root"?R6():W?q:X,U=r(Y,Z.$ref),K=n(U),V=Q._get$Ref(K);if(V)return Promise.resolve(V.value);try{let B=Z.$ref,H={url:U,baseUrl:Y};if(typeof B==="string")H.reference=B;let $=await Z1(H,Q,J),F=Q._get$Ref(K),L=x5($,K+"#",K,F?.dynamicIdScope??!1,Q,J,new Set,!0);return Promise.all(L)}catch(B){if(!J?.continueOnError||!g0(B))throw B;if(Q._$refs[K])B.source=decodeURI(n(X)),B.path=n4(v0(X));return[]}}var b9;var v9=R(()=>{p6();$4();Y5();H0();P0();_6();b9=OJ});function kJ(Z,X){let q=Z.$refs._root$Ref.dynamicIdScope?U0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=[];k5(Z,"schema",Z.$refs._root$Ref.path+"#",q,Z.$refs._root$Ref.dynamicIdScope,"#",0,W,Z.$refs,X);let Q=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(SJ(W,X,Q),(X.bundle||{}).optimizeInternalRefs!==!1)yJ(W,Z.schema)}function k5(Z,X,q,W,Q,J,z,Y,U,K){let V=X===null?Z:Z[X],B=K.bundle||{},H=B.excludedPathMatcher||(()=>!1);if(V&&typeof V==="object"&&!ArrayBuffer.isView(V)&&!H(J)){let $=W;if(d.isAllowed$Ref(V))y9(Z,X,q,$,Q,J,z,Y,U,K);else{let F=Object.keys(V).sort((L,A)=>{if(L==="definitions"||L==="$defs")return-1;else if(A==="definitions"||A==="$defs")return 1;else return L.length-A.length});for(let L of F){let A=$0.join(q,L),I=$0.join(J,L),M=V[L],_=Q&&M&&typeof M==="object"&&!ArrayBuffer.isView(M)?U0($,M):$;if(d.isAllowed$Ref(M))y9(V,L,A,_,Q,I,z,Y,U,K);else k5(V,L,A,_,Q,I,z,Y,U,K);if(M&&typeof M==="object"&&!Array.isArray(M)){if("$ref"in M)B?.onBundle?.(M.$ref,V[L],V,L)}}}}}function y9(Z,X,q,W,Q,J,z,Y,U,K){let V=X===null?Z:Z[X],B=r(Q?W:q,V.$ref),H=U._resolve(B,J,K);if(H===null)return;let F=$0.parse(J).length,L=n(H.path),A=v0(H.path),I=L!==U._root$Ref.path&&!U._aliases[L],M=d.isExtended$Ref(V);z+=H.indirections;let _=bJ(Y,Z,X);if(_)if(F<_.depth||z<_.indirections)vJ(Y,_);else return;if(Y.push({$ref:V,parent:Z,key:X,pathFromRoot:J,depth:F,file:L,hash:A,value:H.value,circular:H.circular,extended:M,external:I,indirections:z}),!_||I)k5(H.value,null,H.path,H.$ref.path,H.$ref.dynamicIdScope,J,z+1,Y,U,K)}function SJ(Z,X,q){Z.sort((z,Y)=>{if(z.file!==Y.file)return z.file<Y.file?-1:1;else if(z.hash!==Y.hash)return z.hash<Y.hash?-1:1;else if(z.circular!==Y.circular)return z.circular?-1:1;else if(z.extended!==Y.extended)return z.extended?1:-1;else if(z.indirections!==Y.indirections)return z.indirections-Y.indirections;else if(z.depth!==Y.depth)return z.depth-Y.depth;else{let U=Math.max(z.pathFromRoot.lastIndexOf("/definitions"),z.pathFromRoot.lastIndexOf("/$defs")),K=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs"));if(U!==K)return K-U;else return z.pathFromRoot.length-Y.pathFromRoot.length}});let W,Q,J;for(let z of Z){let Y=X.bundle||{};if(!z.external){if(Y.optimizeInternalRefs!==!1)z.$ref.$ref=z.hash}else if(z.file===W&&z.hash===Q)if(q&&g9(Z,z))z.$ref.$ref=q+J;else z.$ref.$ref=J;else if(z.file===W&&z.hash.indexOf(Q+"/")===0){let U=$0.join(J,$0.parse(z.hash.replace(Q,"#")));if(q&&g9(Z,z))z.$ref.$ref=q+U;else z.$ref.$ref=U}else if(W=z.file,Q=z.hash,J=z.pathFromRoot,z.$ref=z.parent[z.key]=d.dereference(z.$ref,z.value,X),z.circular)z.$ref.$ref=z.pathFromRoot}}function bJ(Z,X,q){for(let W of Z)if(W&&W.parent===X&&W.key===q)return W;return}function vJ(Z,X){let q=Z.indexOf(X);Z.splice(q,1)}function yJ(Z,X){for(let q of Z){if(!q.$ref||typeof q.$ref!=="object"||!("$ref"in q.$ref))continue;let W=q.$ref.$ref;if(typeof W!=="string"||!W.startsWith("#/"))continue;let Q=gJ(X,W);if(Q!==W)q.$ref.$ref=Q}}function gJ(Z,X){if(!X.startsWith("#/"))return X;let q=X.slice(2).split("/"),W=Z,Q=[];for(let z of q){if(W===null||W===void 0||typeof W!=="object")return X;if("$ref"in W&&typeof W.$ref==="string"&&W.$ref.startsWith("#/")){let K=W.$ref.slice(2).split("/");if(Q.length=0,Q.push(...K),W=hJ(Z,W.$ref),W===null||W===void 0||typeof W!=="object")return X}let Y=z.replace(/~1/g,"/").replace(/~0/g,"~"),U=Array.isArray(W)?parseInt(Y):Y;W=W[U],Q.push(z)}return"#/"+Q.join("/")}function hJ(Z,X){if(!X.startsWith("#/"))return;let q=X.slice(2).split("/"),W=Z;for(let Q of q){if(W===null||W===void 0||typeof W!=="object")return;let J=Q.replace(/~1/g,"/").replace(/~0/g,"~"),z=Array.isArray(W)?parseInt(J):J;W=W[z]}return W}function g9(Z,X){for(let q of Z){if(q.pathFromRoot==="#"||q.pathFromRoot==="#/")continue;if(X.pathFromRoot.startsWith(q.pathFromRoot+"/")){if(q.value&&typeof q.value==="object"&&"$id"in q.value)return!0}}return!1}var h9;var m9=R(()=>{p6();$4();H0();_6();h9=kJ});function mJ(Z,X){let q=Date.now(),W=Z.$refs._root$Ref.dynamicIdScope?U0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=S5(Z.schema,Z.$refs._root$Ref.path,W,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,X,q,0);Z.$refs.circular=Q.circular,Z.schema=Q.value}function S5(Z,X,q,W,Q,J,z,Y,U,K,V,B){let H,$={value:Z,circular:!1};u9(V,K);let F=K.dereference||{},L=F.maxDepth??500;if(B>L)throw RangeError(`Maximum dereference depth (${L}) exceeded at ${Q}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let A=F.excludedPathMatcher||(()=>!1);if(F?.circular==="ignore"||!z.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!A(Q)){J.add(Z),z.add(Z);let I=q;if(d.isAllowed$Ref(Z,K))H=f9(Z,X,I,W,Q,J,z,Y,U,K,V,B),$.circular=H.circular,$.value=H.value;else for(let M of Object.keys(Z)){u9(V,K);let _=$0.join(X,M),k=$0.join(Q,M);if(A(k))continue;let b=Z[M],C=W&&b&&typeof b==="object"&&!ArrayBuffer.isView(b)?U0(I,b):I,T;if(d.isAllowed$Ref(b,K)){if(H=f9(b,_,C,W,k,J,z,Y,U,K,V,B),T=H.circular,Z[M]!==H.value){let j=new Map;if(F?.preservedProperties){if(typeof Z[M]==="object"&&!Array.isArray(Z[M]))F?.preservedProperties.forEach((g)=>{if(g in Z[M])j.set(g,Z[M][g])})}let S=H.value;if(F?.cloneReferences&&!T&&S&&typeof S==="object")S=structuredClone(S);if(Z[M]=S,F?.preservedProperties){if(j.size&&typeof Z[M]==="object"&&!Array.isArray(Z[M]))j.forEach((g,f)=>{Z[M][f]=g})}F?.onDereference?.(b.$ref,Z[M],Z,M)}}else if(!J.has(b)){if(H=S5(b,_,C,W,k,J,z,Y,U,K,V,B+1),T=H.circular,Z[M]!==H.value)Z[M]=H.value}else T=G1(_,U,K);$.circular=$.circular||T}J.delete(Z)}}return $}function f9(Z,X,q,W,Q,J,z,Y,U,K,V,B){let F=d.isExternal$Ref(Z)&&K?.dereference?.externalReferenceResolution==="root"?R6():W?q:X,L=r(F,Z.$ref),A=Y.get(L);if(A){if(!A.circular){let C=Object.keys(Z);if(C.length>1){let T={};for(let j of C)if(j!=="$ref"&&!(j in A.value))T[j]=Z[j];return{circular:A.circular,value:Object.assign({},A.value,T)}}return A}if(typeof A.value==="object"&&"$ref"in A.value&&"$ref"in Z){if(A.value.$ref===Z.$ref)return G1(X,U,K),A}else return G1(X,U,K),A}let I=U._resolve(L,X,K);if(I===null)return{circular:!1,value:null};let M=I.circular,_=M||J.has(I.value);if(_)G1(X,U,K);let k=d.dereference(Z,I.value,K);if(!_){let C=S5(k,I.path,I.$ref.path,I.$ref.dynamicIdScope,Q,J,z,Y,U,K,V,B+1);_=C.circular,k=C.value}if(_&&!M&&K.dereference?.circular==="ignore")k=Z;if(M)k.$ref=Q;let b={circular:_,value:k};if(Object.keys(Z).length===1)Y.set(L,b);return b}function u9(Z,X){if(X&&X.timeoutMs){if(Date.now()-Z>X.timeoutMs)throw new q5(X.timeoutMs)}}function G1(Z,X,q){if(X.circular=!0,q?.dereference?.onCircular?.(Z),!q.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var d9;var c9=R(()=>{p6();$4();H0();_6();P0();d9=mJ});function fJ(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(X){setTimeout(X,0)}}var b5;var l9=R(()=>{b5=fJ()});function w0(Z,X){if(Z){X.then(function(q){b5(function(){Z(null,q)})},function(q){b5(function(){Z(q)})});return}else return X}var p9=R(()=>{l9()});class o0{schema=null;$refs=new A4;async parse(){let Z=N4(arguments),X;if(!Z.path&&!Z.schema){let W=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return w0(Z.callback,Promise.reject(W))}this.schema=null,this.$refs=new A4;let q="http";if(p4(Z.path))Z.path=Y8(Z.path),q="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let W=u6(Z.schema.$id),Q=W.port??(W.protocol==="https:"?443:80);Z.path=`${W.protocol}//${W.hostname}:${Q}`}if(Z.path=r(R6(),Z.path),Z.schema&&typeof Z.schema==="object"){let W=this.$refs._add(Z.path);W.value=Z.schema,W.pathType=q,W.dynamicIdScope=s4(W.value),o4(this.$refs,W.path,W.value,W.pathType,W.dynamicIdScope),X=Promise.resolve(Z.schema)}else X=Z1(Z.path,this.$refs,Z.options);try{let W=await X;if(W!==null&&typeof W==="object"&&!Buffer.isBuffer(W))return this.schema=W,w0(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,w0(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||W}" is not a valid JSON Schema`)}catch(W){if(!Z.options.continueOnError||!g0(W))return w0(Z.callback,Promise.reject(W));if(this.$refs._$refs[n(Z.path)])this.$refs._$refs[n(Z.path)].addError(W);return w0(Z.callback,Promise.resolve(null))}}static parse(){let Z=new o0;return Z.parse.apply(Z,arguments)}async resolve(){let Z=N4(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await b9(this,Z.options),v5(this),w0(Z.callback,Promise.resolve(this.$refs))}catch(X){return w0(Z.callback,Promise.reject(X))}}static resolve(){let Z=new o0;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new o0;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=N4(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),h9(this,Z.options),v5(this),w0(Z.callback,Promise.resolve(this.schema))}catch(X){return w0(Z.callback,Promise.reject(X))}}static dereference(){let Z=new o0;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=N4(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),d9(this,Z.options),v5(this),w0(Z.callback,Promise.resolve(this.schema))}catch(X){return w0(Z.callback,Promise.reject(X))}}}function v5(Z){if(c6.getParserErrors(Z).length>0)throw new c6(Z)}var VF,BF,HF,n9;var i9=R(()=>{F8();Y5();S9();v9();m9();c9();H0();j5();C5();P0();p9();_6();O5();H0();VF=o0.parse,BF=o0.resolve,HF=o0.bundle,n9=o0.dereference});async function Y1(Z,X={}){let{baseUrl:q="/_jx/server"}=X,W=await n9(Z),Q=l4(W);if(Q.length===0)return null;let J=Q.map(({exportName:Y,src:U})=>`import { ${Y} } from '${U}'`).join(`
55
+ `),z=Q.map(({exportName:Y})=>r9(Y,q)).join(`
135
56
  `);return`// Generated by @jxsuite/compiler — do not edit manually
136
57
  // Deploy as a Cloudflare Worker, Node server, or Bun process.
137
58
  // Requires: npm install hono
138
59
 
139
60
  import { Hono } from 'hono'
140
- ${Q}
61
+ ${J}
141
62
 
142
63
  const app = new Hono()
143
- ${G}
64
+ ${z}
144
65
 
145
66
  export default app
146
- `}function A5(Z,J={}){let{baseUrl:X="/_jx/server",adapter:q=null,images:W=null}=J;if(Z.length===0&&!q)return null;let Q=Z.map(({exportName:K,src:V})=>`import { ${K} } from '${V}'`).join(`
147
- `),G=Z.map(({exportName:K})=>D9(K,X)).join(`
148
- `),z=W?`
149
- ${F5(W)}
150
- `:"",Y=W?L9():"";return`// Generated by @jxsuite/compiler — do not edit manually
67
+ `}function y5(Z,X={}){let{baseUrl:q="/_jx/server",adapter:W=null}=X;if(Z.length===0&&!W)return null;let Q=Z.map(({exportName:Y,src:U})=>`import { ${Y} } from '${U}'`).join(`
68
+ `),J=Z.map(({exportName:Y})=>r9(Y,q)).join(`
69
+ `);return`// Generated by @jxsuite/compiler — do not edit manually
151
70
  import { Hono } from 'hono'
152
71
  ${Q}
153
- ${z}
72
+
154
73
  const app = new Hono()
155
- ${G}${Y}
156
- ${q==="cloudflare-workers"?`
74
+ ${J}
75
+ ${W==="cloudflare-workers"||W==="cloudflare-pages"?`
157
76
  app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
158
77
  `:`
159
78
  `}
160
79
  export default app
161
- `}function D9(Z,J){return`
162
- app.post('${J}/${Z}', async (c) => {
80
+ `}function r9(Z,X){return`
81
+ app.post('${X}/${Z}', async (c) => {
163
82
  const args = await c.req.json().catch(() => ({}))
164
83
  try {
165
84
  return c.json(await ${Z}(args, c.env))
166
85
  } catch (e) {
167
86
  return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
168
87
  }
169
- })`}function L5(Z,J={}){let{baseUrl:X="/_jx/server"}=J,q=new Map;for(let{exportName:W,src:Q}of Z){let G=Q.startsWith("./")?Q:`./${Q}`,z=`functions${X}/${W}.js`,Y=z.split("/").length-1,U="../".repeat(Y)+G.replace(/^\.\//,""),K=`// Generated by @jxsuite/compiler — do not edit manually
170
- import { ${W} } from '${U}'
171
-
172
- export async function onRequestPost(context) {
173
- const args = await context.request.json().catch(() => ({}))
174
- try {
175
- const result = await ${W}(args, context.env)
176
- return Response.json(result)
177
- } catch (e) {
178
- return Response.json({ ok: false, error: e?.message ?? 'Server error' }, { status: 500 })
179
- }
180
- }
181
- `;q.set(z,K)}return q}var w9=O(()=>{M9();U4();M5()});class R9{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;capabilities;#Z;#J=null;constructor(Z,J,X,q){this.name=Z,this.classPath=J,this.classDef=X,this.#Z=q;let W=X.format;this.extensions=(W.extensions??[]).map((Q)=>Q.toLowerCase()),this.mediaType=W.mediaType??null,this.documentKinds=W.documentKinds??[],this.exportTarget=W.exportTarget===!0,this.remote=W.remote===!0,this.studio=X.$studio??null,this.capabilities=IW(X)}implementation(){if(!this.#J){let Z=this.classDef.$implementation;if(!Z)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#J=this.#Z.importModule(this.#Z.resolvePath(this.classPath,Z))}return this.#J}async call(Z,...J){let X=this.capabilities[Z];if(!X)throw Error(`Format class "${this.name}" does not declare a "${Z}" capability`);let q=await this.implementation(),W=this.classDef.title??this.name,Q=q[W]??q.default?.[W]??q.default,G=Q?.[X.identifier];if(typeof G!=="function")throw Error(`Format class "${this.name}": implementation export "${W}" has no static "${X.identifier}" method`);return await G.call(Q,...J)}}class P9{#Z;constructor(Z){this.#Z=Z;for(let J of T9){let X=new Map;for(let q of Z){if(!q.capabilities[J])continue;for(let W of q.extensions){let Q=X.get(W);if(Q)throw Error(`Format conflict: "${Q.name}" and "${q.name}" both claim "${W}" with the "${J}" capability`);X.set(W,q)}}}}get entries(){return this.#Z}byExtension(Z,J){let X=N9(Z);return this.#Z.find((q)=>q.extensions.includes(X)&&(!J||q.capabilities[J]))}byName(Z){return this.#Z.find((J)=>J.name===Z)}withCapability(Z){return this.#Z.filter((J)=>J.capabilities[Z])}documentExtensions(Z){let J=new Set;for(let X of this.#Z){if(Z&&!X.documentKinds.includes(Z))continue;for(let q of X.extensions)J.add(q)}return J.delete(".json"),[...J]}has(Z){let J=N9(Z);return this.#Z.some((X)=>X.extensions.includes(J))}}async function j9(Z,J,X){let q=[];for(let[W,Q]of Object.entries(Z??{})){if(typeof Q!=="string"||!Q.endsWith(".class.json"))continue;let G=X?J.resolvePath(X,Q):Q,z;try{z=await J.loadJson(G)}catch{continue}if(!z||typeof z!=="object")continue;if(!z.format||!Array.isArray(z.format.extensions))continue;q.push(new R9(W,G,z,J))}return new P9(q)}function IW(Z){let J={},X=Z.$defs?.methods??{};for(let[q,W]of Object.entries(X)){let Q=W.role;if(!Q||!T9.includes(Q))continue;J[Q]={identifier:W.identifier??q,timing:W.timing??LW}}return J}function N9(Z){let J=Z.toLowerCase();return J.startsWith(".")?J:`.${J}`}var T9,LW;var _9=O(()=>{T9=["parse","serialize","discover","load"],LW=["compiler","server"]});var w5={};T6(w5,{unknownFormatError:()=>D5,importImplementation:()=>a1,createNodeFormatIO:()=>C9,buildProjectFormatRegistry:()=>H1});import{readFileSync as DW}from"node:fs";import{dirname as wW,resolve as I5,isAbsolute as NW,sep as i1}from"node:path";import{pathToFileURL as TW}from"node:url";import{createRequire as RW}from"node:module";async function a1(Z){let J=[Z],X=`${i1}src${i1}`,q=`${i1}dist${i1}`;if(Z.includes(X))J.push(Z.replace(X,q));if(Z.endsWith(".js"))J.push(Z.slice(0,-3)+".ts");let W;for(let Q of J)try{return await import(TW(Q).href)}catch(G){W=G}throw W}function C9(Z){return{loadJson:async(J)=>JSON.parse(DW(J,"utf-8")),importModule:(J)=>a1(J),resolvePath:(J,X)=>{if(X.startsWith("./")||X.startsWith("../"))return I5(wW(J),X);if(NW(X))return X;return RW(I5(Z,"package.json")).resolve(X)}}}async function H1(Z,J){return j9(J?.imports,C9(Z),I5(Z,"project.json"))}function D5(Z,J){return Error(`No format class imported for "${J}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`)}var h4=O(()=>{_9()});async function o1(Z,J={}){let{resolveElementPath:X,$media:q,formats:W}=J,Q=[],G=new Set;async function z(Y,U){let K,V;if(typeof Y==="string"){let{readFileSync:j}=await import("node:fs"),{resolve:g}=await import("node:path");if(V=U?g(U,Y):g(Y),G.has(V))return;if(G.add(V),V.endsWith(".json"))K=JSON.parse(j(V,"utf8"));else{let{extname:y}=await import("node:path"),E=y(V).toLowerCase(),N=W?.byExtension?.(E,"parse");if(!N){let{unknownFormatError:k}=await Promise.resolve().then(() => (h4(),w5));throw k(V,E)}K=await N.call("parse",j(V,"utf8"))}}else{if(K=Y,V=null,G.has(K.tagName))return;G.add(K.tagName)}let H=K.tagName;if(!H||!H.includes("-"))throw Error(`compileElement: tagName "${H}" must contain a hyphen`);let{dirname:$}=await import("node:path"),A=V?$(V):null,D=[];if(Array.isArray(K.$elements))for(let j of K.$elements){let g=j.$ref??j;if(typeof g!=="string")continue;if(A)await z(g,A);let y;if(X)y=X(g,A);else y=g.replace(/\.json$/,".js");D.push(y)}let L=C1(H);if(q)K.$media={...q,...K.$media};let w=$1(K,L,D),I=V?V.replace(/\.json$/,".js"):`${H}.js`;Q.push({path:I,content:w,tagName:H})}return await z(Z,J.basePath??null),{files:Q}}async function PW(Z,J={}){let{title:X="Jx App",reactivitySrc:q="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:W="https://esm.sh/lit-html@3.3.0"}=J,Q=await o1(Z,J),G=Q.files[Q.files.length-1],{basename:z}=await import("node:path"),Y=z(G.path);return{html:`<!DOCTYPE html>
88
+ })`}var a9=R(()=>{i9();T6()});function t0(Z){return Z instanceof Error?Z.message:String(Z)}function g5(Z,X,q){let W;try{W=JSON.parse(Z)}catch(Q){throw Error(`Failed to parse ${q} at ${X}: ${t0(Q)}`,{cause:Q})}if(!M0(W))throw Error(`Invalid ${q} at ${X}: expected a JSON object`);return W}function V6(Z,X){return g5(Z,X,"Jx document")}function s9(Z,X){return g5(Z,X,"project config")}function o9(Z,X){return g5(Z,X,"class definition")}var e0=R(()=>{S0()});class Z7{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;capabilities;#Z;#X=null;constructor(Z,X,q,W){this.name=Z,this.classPath=X,this.classDef=q,this.#Z=W;let Q=q.format;this.extensions=(Q.extensions??[]).map((J)=>J.toLowerCase()),this.mediaType=Q.mediaType??null,this.documentKinds=Q.documentKinds??[],this.exportTarget=Q.exportTarget===!0,this.remote=Q.remote===!0,this.studio=q.$studio??null,this.capabilities=dJ(q)}implementation(){if(!this.#X){let Z=this.classDef.$implementation;if(!Z)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#X=this.#Z.importModule(this.#Z.resolvePath(this.classPath,Z))}return this.#X}async call(Z,...X){let q=this.capabilities[Z];if(!q)throw Error(`Format class "${this.name}" does not declare a "${Z}" capability`);let W=await this.implementation(),Q=this.classDef.title??this.name,J=W[Q]??W.default?.[Q]??W.default,z=J?.[q.identifier];if(typeof z!=="function")throw TypeError(`Format class "${this.name}": implementation export "${Q}" has no static "${q.identifier}" method`);return await z.call(J,...X)}}class X7{#Z;constructor(Z){this.#Z=Z;for(let X of e9){let q=new Map;for(let W of Z){if(!W.capabilities[X])continue;for(let Q of W.extensions){let J=q.get(Q);if(J)throw Error(`Format conflict: "${J.name}" and "${W.name}" both claim "${Q}" with the "${X}" capability`);q.set(Q,W)}}}}get entries(){return this.#Z}byExtension(Z,X){let q=t9(Z);return this.#Z.find((W)=>W.extensions.includes(q)&&(!X||W.capabilities[X]))}byName(Z){return this.#Z.find((X)=>X.name===Z)}withCapability(Z){return this.#Z.filter((X)=>X.capabilities[Z])}documentExtensions(Z){let X=new Set;for(let q of this.#Z){if(Z&&!q.documentKinds.includes(Z))continue;for(let W of q.extensions)X.add(W)}return X.delete(".json"),[...X]}has(Z){let X=t9(Z);return this.#Z.some((q)=>q.extensions.includes(X))}}async function q7(Z,X,q){let W=[];for(let[Q,J]of Object.entries(Z??{})){if(typeof J!=="string"||!J.endsWith(".class.json"))continue;let z,Y;try{z=q?X.resolvePath(q,J):J,Y=await X.loadJson(z)}catch{continue}if(!Y||typeof Y!=="object")continue;if(!Y.format||!Array.isArray(Y.format.extensions))continue;W.push(new Z7(Q,z,Y,X))}return new X7(W)}function dJ(Z){let X={},q=Z.$defs?.methods??{};for(let[W,Q]of Object.entries(q)){let J=Q.role;if(!J||!e9.includes(J))continue;X[J]={identifier:Q.identifier??W,timing:Q.timing??uJ}}return X}function t9(Z){let X=Z.toLowerCase();return X.startsWith(".")?X:`.${X}`}var e9,uJ;var W7=R(()=>{e9=["parse","serialize","discover","load"],uJ=["compiler","server"]});var f5={};f4(f5,{unknownFormatError:()=>m5,importImplementation:()=>K1,createNodeFormatIO:()=>J7,buildProjectFormatRegistry:()=>T4});import{readFileSync as cJ}from"node:fs";import{dirname as lJ,isAbsolute as pJ,resolve as h5,sep as U1}from"node:path";import{pathToFileURL as nJ}from"node:url";import{createRequire as Q7}from"node:module";async function K1(Z){let X=[Z],q=`${U1}src${U1}`,W=`${U1}dist${U1}`;if(Z.includes(q))X.push(Z.replace(q,W));if(Z.endsWith(".js"))X.push(`${Z.slice(0,-3)}.ts`);let Q;for(let J of X)try{return await import(nJ(J).href)}catch(z){Q=z}throw Q instanceof Error?Q:Error(String(Q))}function J7(Z){return{importModule:(X)=>K1(X),loadJson:async(X)=>JSON.parse(cJ(X,"utf8")),resolvePath:(X,q)=>{if(q.startsWith("./")||q.startsWith("../"))return h5(lJ(X),q);if(pJ(q))return q;let W=Q7(h5(Z,"package.json"));try{return W.resolve(q)}catch{return Q7(import.meta.url).resolve(q)}}}}async function T4(Z,X){return q7(X?.imports,J7(Z),h5(Z,"project.json"))}function m5(Z,X){return Error(`No format class imported for "${X}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`)}var s6=R(()=>{W7()});async function B1(Z,X={}){let{resolveElementPath:q,$media:W,formats:Q}=X,J=[],z=new Set;async function Y(U,K){let V,B;if(typeof U==="string"){let{readFileSync:_}=await import("node:fs"),{resolve:k}=await import("node:path");if(B=K?k(K,U):k(U),z.has(B))return;if(z.add(B),B.endsWith(".json"))V=V6(_(B,"utf8"),B);else{let{extname:b}=await import("node:path"),C=b(B).toLowerCase(),T=Q?.byExtension?.(C,"parse");if(!T){let{unknownFormatError:j}=await Promise.resolve().then(() => (s6(),f5));throw j(B,C)}V=await T.call("parse",_(B,"utf8"))}}else{if(V=U,B=null,V.tagName&&z.has(V.tagName))return;if(V.tagName)z.add(V.tagName)}let{tagName:H}=V;if(!H||!H.includes("-"))throw Error(`compileElement: tagName "${H}" must contain a hyphen`);let{dirname:$}=await import("node:path"),F=B?$(B):null,L=[];if(Array.isArray(V.$elements))for(let _ of V.$elements){let k=L0(_)?_.$ref:_;if(typeof k!=="string")continue;if(F)await Y(k,F);let b=q?q(k,F):k.replace(/\.json$/,".js");L.push(b)}let A=c4(H);if(W)V.$media={...W,...V.$media};let I=R4(V,A,L),M=B?B.replace(/\.json$/,".js"):`${H}.js`;J.push({content:I,path:M,tagName:H})}return await Y(Z,X.basePath??null),{files:J}}async function iJ(Z,X={}){let{title:q="Jx App",reactivitySrc:W="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:Q="https://esm.sh/lit-html@3.3.0"}=X,J=await B1(Z,X),z=J.files.at(-1);if(!z)throw Error("compileElementPage: no element modules were produced");let{basename:Y}=await import("node:path"),U=Y(z.path),K=`<!DOCTYPE html>
182
89
  <html lang="en">
183
90
  <head>
184
91
  <meta charset="utf-8">
185
92
  <meta name="viewport" content="width=device-width, initial-scale=1">
186
- <title>${f(X)}</title>
93
+ <title>${y(q)}</title>
187
94
  <script type="importmap">
188
95
  {
189
96
  "imports": {
190
- "@vue/reactivity": "${q}",
191
- "lit-html": "${W}"
97
+ "@vue/reactivity": "${W}",
98
+ "lit-html": "${Q}"
192
99
  }
193
100
  }
194
101
  </script>
195
102
  </head>
196
103
  <body>
197
- <${G.tagName}></${G.tagName}>
198
- <script type="module" src="./${Y}"></script>
104
+ <${z.tagName}></${z.tagName}>
105
+ <script type="module" src="./${U}"></script>
199
106
  </body>
200
- </html>`,files:Q.files}}function jW(Z){if(Z===null||typeof Z!=="object"||Array.isArray(Z))return JSON.stringify(Z);if("default"in Z)return JSON.stringify(Z.default);if(P4(Z))return;if(Z.$prototype==="LocalStorage"||Z.$prototype==="SessionStorage")return JSON.stringify(Z.default??null);if(Z.$prototype==="Request")return"null";return JSON.stringify(Z)}function $1(Z,J,X){let q=[];if(q.push("// Generated by @jxsuite/compiler — do not edit manually"),Z.$id)q.push(`// Source: ${Z.$id}`);for(let V of X)q.push(`import '${V}';`);let W=new Map,Q=Z.state??{};for(let[V,H]of Object.entries(Q)){let $=H;if($&&typeof $==="object"&&!Array.isArray($)&&$.$prototype==="Function"&&$.$src){let A=$.$src;if(!W.has(A))W.set(A,[]);W.get(A).push(V)}}for(let[V,H]of W)q.push(`import { ${H.join(", ")} } from '${V}';`);q.push("import { reactive, computed, effect } from '@vue/reactivity';"),q.push("import { render, html } from 'lit-html';"),q.push(""),q.push(`class ${J} extends HTMLElement {`),q.push(" #dispose = null;"),q.push(""),q.push(" constructor() {"),q.push(" super();");let G=[],z=[],Y=[];for(let[V,H]of Object.entries(Q)){let $=H;if($&&typeof $==="object"&&!Array.isArray($)&&"$expression"in $){let A=$.$expression;if(G4(A.operator))Y.push([V,$]);else z.push([V,$])}else if($&&typeof $==="object"&&!Array.isArray($)&&$.$prototype==="Function")if(typeof $.body==="string"&&$.body.includes("return"))z.push([V,$]);else Y.push([V,$]);else{let A=jW($);if(A!==void 0)G.push([V,A])}}q.push(" this.state = reactive({");for(let[V,H]of G)q.push(` ${V}: ${H},`);q.push(" });");for(let[V,H]of Y)if(q.push(""),"$expression"in H){let $=L0(H.$expression,{statePrefix:"s",eventParam:"e"});q.push(` this.state.${V} = (s, e) => { ${$}; };`)}else if(H.$src){let A=(H.parameters??H.arguments??["state"]).join(", ");q.push(` this.state.${V} = (${A}) => ${V}(${A});`)}else{let A=(H.parameters??H.arguments??["state"]).join(", ");q.push(` this.state.${V} = (${A}) => {`),q.push(` ${H.body}`),q.push(" };")}for(let[V,H]of z)if(q.push(""),"$expression"in H){let $=L0(H.$expression,{statePrefix:"this.state",eventParam:"e"});q.push(` this.state.${V} = computed(() => ${$});`)}else if(H.$src)q.push(` this.state.${V} = computed(() => ${V}(this.state));`);else{q.push(` this.state.${V} = computed(() => {`);let $=H.body.replace(/state\./g,"this.state.");q.push(` ${$}`),q.push(" });")}q.push(" }"),q.push("");let U=[];if(Array.isArray(Z.children)){let V={n:0};for(let H of Z.children)X1(H,U,Z.$media??{},"",V,Z.tagName)}if(q.push(" template() {"),q.push(" const s = this.state;"),q.push(" return html`"),q.push(T5(Z.children,Z.style," ")),q.push(" `;"),q.push(" }"),q.push(""),q.push(" connectedCallback() {"),q.push(" const _pa = this.getAttribute('data-jx-props');"),q.push(" if (_pa) {"),q.push(" try {"),q.push(" const _p = JSON.parse(_pa);"),q.push(" for (const [k, v] of Object.entries(_p)) {"),q.push(" if (k in this.state) this.state[k] = v;"),q.push(" }"),q.push(" } catch {}"),q.push(" this.removeAttribute('data-jx-props');"),q.push(" }"),q.push(" for (const key of Object.keys(this.state)) {"),q.push(" if (this.hasOwnProperty(key) && this[key] !== undefined) {"),q.push(" this.state[key] = this[key];"),q.push(" }"),q.push(" }"),Z.style&&typeof Z.style==="object"){let V=[];for(let[H,$]of Object.entries(Z.style)){if(H.startsWith(":")||H.startsWith(".")||H.startsWith("&")||H.startsWith("[")||H.startsWith("@"))continue;if($===null||typeof $==="object")continue;let A=I0(H);if(typeof $==="string"&&$.includes("${"))V.push([A,$])}if(V.length>0){q.push(" effect(() => {");for(let[H,$]of V){let A=$.replace(/\$\{([^}]+)\}/g,(D,L)=>"${"+L.replace(/state\./g,"this.state.")+"}");q.push(` this.style['${H}'] = \`${A}\`;`)}q.push(" });")}}let K=O9(Z.children);if(K)q.push(" const _slotted = Array.from(this.childNodes).filter(n => n.nodeType === 1 || (n.nodeType === 3 && n.textContent.trim()));");if(q.push(" if (this.hasAttribute('data-jx-prerendered')) {"),q.push(" this.removeAttribute('data-jx-prerendered');"),q.push(" }"),q.push(" this.innerHTML = '';"),q.push(" this.#dispose = effect(() => render(this.template(), this));"),K)q.push(" const _slot = this.querySelector('slot');"),q.push(" if (_slot && _slotted.length > 0) {"),q.push(" for (const n of _slotted) _slot.before(n);"),q.push(" _slot.remove();"),q.push(" }");return q.push(" }"),q.push(""),q.push(" disconnectedCallback() {"),q.push(" if (this.#dispose) { this.#dispose(); this.#dispose = null; }"),q.push(" }"),q.push("}"),q.push(""),q.push(`customElements.define('${Z.tagName}', ${J});`),q.push(""),q.join(`
201
- `)}function T5(Z,J,X){if(!Z)return"";if(Z.$prototype==="Array")return CW(Z,X);if(!Array.isArray(Z))return"";return Z.map((q)=>_W(q,X)).join(`
202
- `)}function _W(Z,J){if(typeof Z==="string"){if(Z.includes("${"))return`${J}${N5(Z)}`;return`${J}${f(Z)}`}if(typeof Z==="number"||typeof Z==="boolean")return`${J}${f(String(Z))}`;if(!Z||typeof Z!=="object")return"";let X=Z.tagName??"div",q=[];if(Z.attributes)for(let[Y,U]of Object.entries(Z.attributes))if(typeof U==="string"&&U.includes("${"))q.push(`${Y}="${s1(U)}"`);else q.push(`${Y}="${U}"`);if(Z.id)q.push(`id="${Z.id}"`);if(Z.className)q.push(`class="${Z.className}"`);for(let[Y,U]of Object.entries(Z)){if(Y4.has(Y)||Y.startsWith("$")||Y.startsWith("on")||Y==="tagName"||Y==="id"||Y==="className"||Y==="style"||Y==="children"||Y==="textContent"||Y==="innerHTML"||Y==="attributes")continue;if(U&&typeof U==="object"&&U.$ref)q.push(`.${Y}="\${${$4(U.$ref)}}"`);else if(typeof U==="string"&&U.includes("${"))q.push(`.${Y}="${s1(U)}"`)}if(Z.$props)for(let[Y,U]of Object.entries(Z.$props))if(U&&typeof U==="object"&&U.$ref)q.push(`.${Y}="\${${$4(U.$ref)}}"`);else q.push(`.${Y}="\${${JSON.stringify(U)}}"`);for(let[Y,U]of Object.entries(Z)){if(!Y.startsWith("on")||Y==="observedAttributes")continue;let K=Y.slice(2).toLowerCase();if(U&&typeof U==="object"&&U.$ref)q.push(`@${K}="\${(e) => ${$4(U.$ref)}(s, e)}"`);else if(U&&typeof U==="object"&&"$expression"in U){let V=L0(U.$expression,{statePrefix:"s",eventParam:"e"});q.push(`@${K}="\${(e) => { ${V}; }}"`)}else if(U&&typeof U==="object"&&U.$prototype==="Function")q.push(`@${K}="\${(e) => { ${OW(U)} }}"`)}let W=E9(Z.style);if(W)q.push(`style="${W}"`);let Q=q.length>0?`
203
- `+J+" "+q.join(`
204
- `+J+" "):"";if(new Set(["input","br","hr","img","meta","link"]).has(X))return`${J}<${X}${Q}
205
- ${J}>`;let z="";if(Z.textContent!==void 0)z=N5(Z.textContent);else if(Z.innerHTML!==void 0)z=Z.innerHTML;else if(Z.children)z=`
206
- `+T5(Z.children,Z.style,J+" ")+`
207
- `+J;return`${J}<${X}${Q}
208
- ${J}>${z}</${X}>`}function CW(Z,J){let X=Z.items?.$ref?$4(Z.items.$ref):"ITEMS",q=Z.map;if(!q)return"";let W=q.tagName??"div",Q=[];if(q.$props)for(let[U,K]of Object.entries(q.$props))if(K&&typeof K==="object"&&K.$ref)Q.push(`.${U}="\${${EW(K.$ref)}}"`);else Q.push(`.${U}="\${${JSON.stringify(K)}}"`);let G=E9(q.style);if(G)Q.push(`style="${G}"`);for(let[U,K]of Object.entries(q)){if(!U.startsWith("on"))continue;let V=U.slice(2).toLowerCase();if(K&&typeof K==="object"&&K.$ref)Q.push(`@${V}="\${(e) => ${$4(K.$ref)}(s, e)}"`);else if(K&&typeof K==="object"&&"$expression"in K){let H=L0(K.$expression,{statePrefix:"s",eventParam:"e"});Q.push(`@${V}="\${(e) => { ${H}; }}"`)}}let z=Q.length>0?`
209
- `+J+" "+Q.join(`
210
- `+J+" "):"",Y="";if(q.textContent!==void 0)Y=N5(q.textContent);else if(q.children)Y=`
211
- `+T5(q.children,null,J+" ")+`
212
- `+J+" ";return`${J}\${${X}.map((item, index) => html\`
213
- ${J} <${W}${z}
214
- ${J} >${Y}</${W}>
215
- ${J}\`)}`}function $4(Z){if(Z.startsWith("#/state/"))return"s."+Z.slice(8).replace(/\//g,".");if(Z.startsWith("$map/"))return Z.slice(5).replace(/\//g,".");return"s."+Z}function EW(Z){if(Z.startsWith("$map/"))return Z.slice(5).replace(/\//g,".");return $4(Z)}function s1(Z){return Z.replace(/state\./g,"s.")}function N5(Z){if(Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string")return`\${${$4(Z.$ref)}}`;if(typeof Z==="string"&&Z.includes("${"))return s1(Z);return String(Z)}function OW(Z){return(Z.body??"").replace(/(?<!this\.)state\./g,"s.").replace(/(?<!this\.)state(?!\.)/g,"s")}function E9(Z){if(!Z||typeof Z!=="object")return"";let J=[];for(let[X,q]of Object.entries(Z)){if(X.startsWith(":")||X.startsWith(".")||X.startsWith("&")||X.startsWith("[")||X.startsWith("@"))continue;if(q===null||typeof q==="object")continue;if(typeof q==="string"&&q.includes("${")){let W=I0(X);J.push(`${W}: ${s1(q)}`)}}return J.join("; ")}function O9(Z){if(!Array.isArray(Z))return!1;for(let J of Z){if(!J||typeof J!=="object")continue;if(J.tagName==="slot")return!0;if(O9(J.children))return!0}return!1}var t1=O(()=>{j1();U4()});function x9(Z,J){let{title:X,reactivitySrc:q,litHtmlSrc:W}=J,Q=j4(Z,null,Z.state??{},Z.$media??{}),G=C4(Z,Z.$media??{},J.projectStyle??null),z=[],Y=k9(Z,!1,Z,Q,z),U=[],K="",V="";if(z.length>0){for(let $ of z){let A=$1($.def,$.className,[]);U.push({path:`_islands/${$.tagName}.js`,content:A,tagName:$.tagName})}K=`<script type="importmap">
107
+ </html>`;return{files:J.files,html:K}}function rJ(Z){if(Z===null||typeof Z!=="object"||Array.isArray(Z))return JSON.stringify(Z);if("default"in Z)return JSON.stringify(Z.default);if(J6(Z))return;if(Z.$prototype==="LocalStorage"||Z.$prototype==="SessionStorage")return JSON.stringify(Z.default??null);if(Z.$prototype==="Request")return"null";return JSON.stringify(Z)}function R4(Z,X,q){let W=["// Generated by @jxsuite/compiler — do not edit manually"];if(Z.$id)W.push(`// Source: ${Z.$id}`);for(let B of q)W.push(`import '${B}';`);let Q=new Map,J=Z.state??{};for(let[B,H]of Object.entries(J)){let $=H;if($&&typeof $==="object"&&!Array.isArray($)&&$.$prototype==="Function"&&$.$src){let F=$.$src;if(!Q.has(F))Q.set(F,[]);Q.get(F).push(B)}}for(let[B,H]of Q)W.push(`import { ${H.join(", ")} } from '${B}';`);W.push("import { reactive, computed, effect } from '@vue/reactivity';"),W.push("import { render, html } from 'lit-html';"),W.push(""),W.push(`class ${X} extends HTMLElement {`),W.push(" #dispose = null;"),W.push(""),W.push(" constructor() {"),W.push(" super();");let z=[],Y=[],U=[];for(let[B,H]of Object.entries(J)){let $=H;if(O0($)){let F=$.$expression;if(L6(F.operator))U.push([B,$]);else Y.push([B,$])}else if(i0($))if(typeof $.body==="string"&&$.body.includes("return"))Y.push([B,$]);else U.push([B,$]);else{let F=rJ($);if(F!==void 0)z.push([B,F])}}W.push(" this.state = reactive({");for(let[B,H]of z)W.push(` ${B}: ${H},`);W.push(" });");for(let[B,H]of U)if(W.push(""),O0(H)){let $=T0(H.$expression,{eventParam:"e",statePrefix:"s"});W.push(` this.state.${B} = (s, e) => { ${$}; };`)}else{let F=(H.parameters?z6(H.parameters):H.arguments??["state"]).join(", ");if(H.$src)W.push(` this.state.${B} = (${F}) => ${B}(${F});`);else W.push(` this.state.${B} = (${F}) => {`),W.push(` ${H.body??""}`),W.push(" };")}for(let[B,H]of Y)if(W.push(""),O0(H)){let $=T0(H.$expression,{eventParam:"e",statePrefix:"this.state"});W.push(` this.state.${B} = computed(() => ${$});`)}else if(H.$src)W.push(` this.state.${B} = computed(() => ${B}(this.state));`);else{W.push(` this.state.${B} = computed(() => {`);let $=(H.body??"").replaceAll("state.","this.state.");W.push(` ${$}`),W.push(" });")}W.push(" }"),W.push("");let K=[];if(Array.isArray(Z.children)){let B={n:0};for(let H of Z.children)G6(H,K,Z.$media??{},"",B,Z.tagName)}if(W.push(" template() {"),W.push(" const s = this.state;"),W.push(" return html`"),W.push(d5(Z.children,Z.style," ")),W.push(" `;"),W.push(" }"),W.push(""),W.push(" connectedCallback() {"),W.push(" const _pa = this.getAttribute('data-jx-props');"),W.push(" if (_pa) {"),W.push(" try {"),W.push(" const _p = JSON.parse(_pa);"),W.push(" for (const [k, v] of Object.entries(_p)) {"),W.push(" if (k in this.state) this.state[k] = v;"),W.push(" }"),W.push(" } catch {}"),W.push(" this.removeAttribute('data-jx-props');"),W.push(" }"),W.push(" for (const key of Object.keys(this.state)) {"),W.push(" if (this.hasOwnProperty(key) && this[key] !== undefined) {"),W.push(" this.state[key] = this[key];"),W.push(" }"),W.push(" }"),Z.style&&typeof Z.style==="object"){let B=[];for(let[H,$]of Object.entries(Z.style)){if(H.startsWith(":")||H.startsWith(".")||H.startsWith("&")||H.startsWith("[")||H.startsWith("@"))continue;if($===null||typeof $==="object")continue;let F=I0(H);if(typeof $==="string"&&$.includes("${"))B.push([F,$])}if(B.length>0){W.push(" effect(() => {");for(let[H,$]of B){let F=$.replaceAll(/\$\{([^}]+)\}/g,(L,A)=>`\${${A.replaceAll("state.","this.state.")}}`);W.push(` this.style['${H}'] = \`${F}\`;`)}W.push(" });")}}let V=Y7(Z.children);if(V)W.push(" const _slotted = Array.from(this.childNodes).filter(n => n.nodeType === 1 || (n.nodeType === 3 && n.textContent.trim()));");if(W.push(" if (this.hasAttribute('data-jx-prerendered')) {"),W.push(" this.removeAttribute('data-jx-prerendered');"),W.push(" }"),W.push(" this.innerHTML = '';"),W.push(" this.#dispose = effect(() => render(this.template(), this));"),V)W.push(" const _slot = this.querySelector('slot');"),W.push(" if (_slot && _slotted.length > 0) {"),W.push(" for (const n of _slotted) _slot.before(n);"),W.push(" _slot.remove();"),W.push(" }");return W.push(" }"),W.push(""),W.push(" disconnectedCallback() {"),W.push(" if (this.#dispose) { this.#dispose(); this.#dispose = null; }"),W.push(" }"),W.push("}"),W.push(""),W.push(`customElements.define('${Z.tagName}', ${X});`),W.push(""),W.join(`
108
+ `)}function d5(Z,X,q){if(!Z)return"";if(w6(Z))return aJ(Z,q);if(!Array.isArray(Z))return"";return Z.map((W)=>z7(W,q)).join(`
109
+ `)}function z7(Z,X){if(typeof Z==="string"){if(Z.includes("${"))return`${X}${u5(Z)}`;return`${X}${y(Z)}`}if(typeof Z==="number"||typeof Z==="boolean")return`${X}${y(String(Z))}`;if(!Z||typeof Z!=="object")return"";let q=Z.tagName??"div",W=[];if(Z.attributes)for(let[U,K]of Object.entries(Z.attributes))if(K&&typeof K==="object"&&L0(K))W.push(`${U}="\${${Z6(K.$ref)}}"`);else if(typeof K==="string"&&K.includes("${"))W.push(`${U}="${V1(K)}"`);else W.push(`${U}="${K}"`);if(Z.id)W.push(`id="${Z.id}"`);if(Z.className)W.push(`class="${Z.className}"`);for(let[U,K]of Object.entries(Z)){if(D6.has(U)||U.startsWith("$")||U.startsWith("on")||U==="tagName"||U==="id"||U==="className"||U==="style"||U==="children"||U==="textContent"||U==="innerHTML"||U==="attributes")continue;if(K&&typeof K==="object"&&K.$ref)W.push(`.${U}="\${${Z6(K.$ref)}}"`);else if(typeof K==="string"&&K.includes("${"))W.push(`.${U}="${V1(K)}"`)}if(Z.$props)for(let[U,K]of Object.entries(Z.$props))if(K&&typeof K==="object"&&K.$ref)W.push(`.${U}="\${${Z6(K.$ref)}}"`);else W.push(`.${U}="\${${JSON.stringify(K)}}"`);for(let[U,K]of Object.entries(Z)){if(!U.startsWith("on")||U==="observedAttributes")continue;let V=U.slice(2).toLowerCase();if(K&&typeof K==="object"&&K.$ref)W.push(`@${V}="\${(e) => ${Z6(K.$ref)}(s, e)}"`);else if(K&&typeof K==="object"&&"$expression"in K){let B=T0(K.$expression,{eventParam:"e",statePrefix:"s"});W.push(`@${V}="\${(e) => { ${B}; }}"`)}else if(i0(K))W.push(`@${V}="\${(e) => { ${oJ(K)} }}"`)}let Q=G7(Z.style);if(Q)W.push(`style="${Q}"`);let J=W.length>0?`
110
+ ${X} ${W.join(`
111
+ ${X} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(q))return`${X}<${q}${J}
112
+ ${X}>`;let Y="";if(Z.$switch){let U=L0(Z.$switch)?Z.$switch.$ref:Z.$switch,K=Z6(U),V=Z.cases??{},B=[];for(let[H,$]of Object.entries(V)){if(!$||L0($))continue;let F=z7($,`${X} `);B.push(` ${JSON.stringify(H)}: html\`
113
+ ${F}
114
+ \``)}Y=`\${{
115
+ ${B.join(`,
116
+ `)}
117
+ }[${K}]}`}else if(Z.textContent!==void 0)Y=u5(Z.textContent);else if(Z.innerHTML!==void 0)Y=Z.innerHTML;else if(Z.children)Y=`
118
+ ${d5(Z.children,Z.style,`${X} `)}
119
+ ${X}`;return`${X}<${q}${J}
120
+ ${X}>${Y}</${q}>`}function aJ(Z,X){let q=L0(Z.items)?Z6(Z.items.$ref):"ITEMS",W=Z.map;if(!W)return"";let Q=W.tagName??"div",J=[];if(W.$props)for(let[K,V]of Object.entries(W.$props))if(L0(V))J.push(`.${K}="\${${sJ(V.$ref)}}"`);else J.push(`.${K}="\${${JSON.stringify(V)}}"`);let z=G7(W.style);if(z)J.push(`style="${z}"`);for(let[K,V]of Object.entries(W)){if(!K.startsWith("on"))continue;let B=K.slice(2).toLowerCase();if(L0(V))J.push(`@${B}="\${(e) => ${Z6(V.$ref)}(s, e)}"`);else if(O0(V)){let H=T0(V.$expression,{eventParam:"e",statePrefix:"s"});J.push(`@${B}="\${(e) => { ${H}; }}"`)}}let Y=J.length>0?`
121
+ ${X} ${J.join(`
122
+ ${X} `)}`:"",U="";if(W.textContent!==void 0)U=u5(W.textContent);else if(W.children)U=`
123
+ ${d5(W.children,null,`${X} `)}
124
+ ${X} `;return`${X}\${${q}.map((item, index) => html\`
125
+ ${X} <${Q}${Y}
126
+ ${X} >${U}</${Q}>
127
+ ${X}\`)}`}function Z6(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return`s.${Z}`}function sJ(Z){if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return Z6(Z)}function V1(Z){return Z.replaceAll("state.","s.")}function u5(Z){if(Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string")return`\${${Z6(Z.$ref)}}`;if(typeof Z==="string"&&Z.includes("${"))return V1(Z);return String(Z)}function oJ(Z){return(Z.body??"").replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function G7(Z){if(!Z||typeof Z!=="object")return"";let X=[];for(let[q,W]of Object.entries(Z)){if(q.startsWith(":")||q.startsWith(".")||q.startsWith("&")||q.startsWith("[")||q.startsWith("@"))continue;if(W===null||typeof W==="object")continue;if(typeof W==="string"&&W.includes("${")){let Q=I0(q);X.push(`${Q}: ${V1(W)}`)}}return X.join("; ")}function Y7(Z){if(!Array.isArray(Z))return!1;for(let X of Z){if(!X||typeof X!=="object")continue;if(X.tagName==="slot")return!0;if(Y7(X.children))return!0}return!1}var H1=R(()=>{u4();T6();S0();e0()});function U7(Z,X){let{title:q="Jx App",reactivitySrc:W,litHtmlSrc:Q}=X,J=h6(Z,null,Z.state??{},Z.$media??{}),z=f6(Z,Z.$media??{},X.projectStyle??null),Y=[],U=K7(Z,!1,Z,J,Y),K=[],V="",B="";if(Y.length>0){for(let $ of Y){let F=R4($.def,$.className,[]);K.push({content:F,path:`_islands/${$.tagName}.js`,tagName:$.tagName})}V=`<script type="importmap">
216
128
  {
217
129
  "imports": {
218
- "@vue/reactivity": "${q}",
219
- "lit-html": "${W}"
130
+ "@vue/reactivity": "${W}",
131
+ "lit-html": "${Q}"
220
132
  }
221
133
  }
222
- </script>`,V=U.map(($)=>`<script type="module" src="./${$.path}"></script>`).join(`
223
- `)}return{html:`<!DOCTYPE html>
134
+ </script>`,B=K.map(($)=>`<script type="module" src="./${$.path}"></script>`).join(`
135
+ `)}let H=`<!DOCTYPE html>
224
136
  <html lang="en">
225
137
  <head>
226
138
  <meta charset="utf-8">
227
139
  <meta name="viewport" content="width=device-width, initial-scale=1">
228
- <title>${f(X)}</title>
229
- ${K}
230
- ${G}
140
+ <title>${y(q)}</title>
141
+ ${V}
142
+ ${z}
231
143
  </head>
232
144
  <body>
233
- ${Y}
234
- ${V}
145
+ ${U}
146
+ ${B}
235
147
  </body>
236
- </html>`,files:U}}function k9(Z,J,X,q,W){if(typeof Z==="string")return f(Z);if(typeof Z==="number"||typeof Z==="boolean")return f(String(Z));if(!Z||typeof Z!=="object")return"";let Q=j4(X,q.scope,X?.state??q.scopeDefs,X?.$media??q.media);if(J){let U=W.length,K=`jx-island-${U}`,V=`JxIsland${U}`,H={...X??Z,tagName:K};return W.push({def:H,tagName:K,className:V}),`<${K}></${K}>`}let G=Z.tagName??"div",z=J1(Z,Q.scope),Y=xW(Z,X,Q,W);return`<${G}${z}>${Y}</${G}>`}function xW(Z,J,X,q){let W=J??Z;if(W.textContent!==void 0){let Q=o(W.textContent,X.scope);return Q==null?"":f(String(Q))}if(W.innerHTML)return o(W.innerHTML,X.scope)??W.innerHTML;if(Array.isArray(W.children)){let Q=J?.children;return W.children.map((G,z)=>{let Y=G,U=N7(Y),K=Q?.[z]??G;return k9(Y,U,K,X,q)}).join(`
237
- `)}return""}var S9=O(()=>{U4();t1()});function b9(Z,J){let{title:X,reactivitySrc:q=T4,litHtmlSrc:W=R4,modulePath:Q="app.js"}=J,G=j4(Z,null,Z.state??{},Z.$media??{}),z=C4(Z,Z.$media??{},J.projectStyle??null),Y={t:0,s:0,h:0,m:0,sw:0,l:0,needsLit:!1},U=new Map,K=new Map,V=[],H=[],$=[],A=[],D=[],L=new Map,w=Z.state??{};for(let[E,h]of Object.entries(w)){if(h===null||typeof h!=="object"||Array.isArray(h)){if(typeof h==="string"&&v(h))H.push([E,"() => `"+h+"`"]);else V.push([E,h]);continue}let N=h;if("$expression"in N){let k=N.$expression;if(G4(k.operator)){let S=L0(k,{statePrefix:"state",eventParam:"e"});A.push([E,{args:["state","e"],body:S}])}else{let S=L0(k,{statePrefix:"state",eventParam:"e"});H.push([E,`() => ${S}`])}continue}if(N.$prototype==="Function"){let k=N.parameters??N.arguments;if(N.$src){if(!L.has(N.$src))L.set(N.$src,new Set);L.get(N.$src).add(E),H.push([E,"() => { return "+E+"(state); }"])}else if(N.body&&N.body.includes("return"))H.push([E,"() => { "+N.body+" }"]);else A.push([E,{args:k??["state"],body:N.body}]);continue}if(P4(N))continue;if("default"in N&&!N.$prototype){V.push([E,N.default]);continue}if(N.$prototype==="LocalStorage"||N.$prototype==="SessionStorage"){let k=N.$prototype==="LocalStorage"?"localStorage":"sessionStorage",S=N.key??E,u=N.default??null;V.push([E,null]),D.push(bW(E,k,S,u));continue}if(N.$prototype==="Request"){V.push([E,null]),D.push(SW(E,N));continue}if(N.$prototype==="Cookie"){V.push([E,null]),D.push(vW(E,N.name??E,N.default??null));continue}V.push([E,N])}let I=v9(Z,Z,G,U,K,Y);for(let[E,h]of U)if(!$.some(([N])=>N===E))$.push([E,h]);for(let[E,h]of K)if(!A.some(([N])=>N===E))A.push([E,h]);let j=kW(V,H,$,A,D,L,Y,q),g=[` "@vue/reactivity": "${q}"`,` "lit-html": "${W}"`];return{html:`<!DOCTYPE html>
148
+ </html>`;return{files:K,html:H}}function K7(Z,X,q,W,Q){if(typeof Z==="string")return y(Z);if(typeof Z==="number"||typeof Z==="boolean")return y(String(Z));if(!Z||typeof Z!=="object")return"";let J=h6(q,W.scope,q?.state??W.scopeDefs,q?.$media??W.media);if(X){let K=Q.length,V=`jx-island-${K}`,B=`JxIsland${K}`,H={...q??Z,tagName:V};return Q.push({className:B,def:H,tagName:V}),`<${V}></${V}>`}let z=Z.tagName??"div",Y=v6(Z,J.scope),U=tJ(Z,q,J,Q);return`<${z}${Y}>${U}</${z}>`}function tJ(Z,X,q,W){let Q=X??Z;if(Q.textContent!==void 0){let J=p(Q.textContent,q.scope);return J==null?"":y(String(J))}if(Q.innerHTML)return p(Q.innerHTML,q.scope)??Q.innerHTML;if(Array.isArray(Q.children)){let J=Array.isArray(X?.children)?X.children:void 0;return Q.children.map((z,Y)=>{let U=z,K=e3(U),V=J?.[Y]??z;return K7(U,K,V,q,W)}).join(`
149
+ `)}return""}var V7=R(()=>{T6();H1()});function B7(Z,X){let{title:q="Jx App",reactivitySrc:W=y6,litHtmlSrc:Q=g6,modulePath:J="app.js"}=X,z=h6(Z,null,Z.state??{},Z.$media??{}),Y=f6(Z,Z.$media??{},X.projectStyle??null),U={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},K=new Map,V=new Map,B=[],H=[],$=[],F=[],L=[],A=new Map,I=Z.state??{};for(let[C,T]of Object.entries(I)){if(T===null||typeof T!=="object"||Array.isArray(T)){if(typeof T==="string"&&x(T))H.push([C,`() => \`${T}\``]);else B.push([C,T]);continue}if(O0(T)){let j=T.$expression,S=T0(j,{eventParam:"e",statePrefix:"state"});if(L6(j.operator))F.push([C,{args:["state","e"],body:S}]);else H.push([C,`() => ${S}`]);continue}if(i0(T)){let j=T.parameters?z6(T.parameters):T.arguments;if(T.$src){if(!A.has(T.$src))A.set(T.$src,new Set);A.get(T.$src).add(C),H.push([C,`() => { return ${C}(state); }`])}else if(T.body&&T.body.includes("return"))H.push([C,`() => { ${T.body} }`]);else F.push([C,{args:j??["state"],body:T.body}]);continue}if(J6(T))continue;if(a3(T)){B.push([C,T.default]);continue}if(I6(T)){if(T.$prototype==="LocalStorage"||T.$prototype==="SessionStorage"){let j=T.$prototype==="LocalStorage"?"localStorage":"sessionStorage",S=T.key??C,g=T.default??null;B.push([C,null]),L.push(Xz(C,j,S,g));continue}if(T.$prototype==="Request"){B.push([C,null]),L.push(Zz(C,T));continue}if(T.$prototype==="Cookie"){B.push([C,null]),L.push(qz(C,T.name??C,T.default??null));continue}}B.push([C,T])}let M=H7(Z,Z,z,K,V,U);for(let[C,T]of K)if(!$.some(([j])=>j===C))$.push([C,T]);for(let[C,T]of V)if(!F.some(([j])=>j===C))F.push([C,T]);let _=eJ(B,H,$,F,L,A,U,W),k=[` "@vue/reactivity": "${W}"`,` "lit-html": "${Q}"`],b=`<!DOCTYPE html>
238
150
  <html lang="en">
239
151
  <head>
240
152
  <meta charset="utf-8">
241
153
  <meta name="viewport" content="width=device-width, initial-scale=1">
242
- <title>${f(X)}</title>
154
+ <title>${y(q)}</title>
243
155
  <script type="importmap">
244
156
  {
245
157
  "imports": {
246
- ${g.join(`,
158
+ ${k.join(`,
247
159
  `)}
248
160
  }
249
161
  }
250
162
  </script>
251
- ${z}
252
- <script type="module" src="./${Q}"></script>
163
+ ${Y}
164
+ <script type="module" src="./${J}"></script>
253
165
  </head>
254
166
  <body>
255
- ${I}
167
+ ${M}
256
168
  </body>
257
- </html>`,files:[{path:Q,content:j}]}}function v9(Z,J,X,q,W,Q){if(typeof Z==="string")return f(Z);if(typeof Z==="number"||typeof Z==="boolean")return f(String(Z));if(!Z||typeof Z!=="object")return"";let G=j4(J,X.scope,J?.state??X.scopeDefs,J?.$media??X.media),z=Z.tagName??"div",Y=[],U=!1;if(Z.textContent!==void 0){let L=J?.textContent??Z.textContent;if(c0(L)){let w=F4(L.$ref);Y.push(`:text-content="${w}"`),R5(q,w,L.$ref),U=!0}else if(v(L)){let w=`_t${Q.t++}`;Y.push(`:text-content="${w}"`),q.set(w,"() => `"+L+"`"),U=!0}}for(let[L,w]of Object.entries(Z)){if(!L.startsWith("on")||L==="observedAttributes")continue;let I=L.slice(2).toLowerCase();if(c0(w)){let j=F4(w.$ref);Y.push(`@${I}="${j}"`),U=!0}else if(w&&typeof w==="object"&&w.$prototype==="Function"){let j=w,g=`_h${Q.h++}`;Y.push(`@${I}="${g}"`),W.set(g,{args:j.parameters??j.arguments??["state","event"],body:j.body}),U=!0}else if(w&&typeof w==="object"&&"$expression"in w){let j=`_h${Q.h++}`;Y.push(`@${I}="${j}"`);let g=L0(w.$expression,{statePrefix:"state",eventParam:"e"});W.set(j,{args:["state","e"],body:g}),U=!0}}if(Z.style&&typeof Z.style==="object")for(let[L,w]of Object.entries(Z.style)){if(L.startsWith(":")||L.startsWith(".")||L.startsWith("&")||L.startsWith("[")||L.startsWith("@"))continue;if(w===null||typeof w==="object")continue;if(v(w)){let I=`_s${Q.s++}`;Y.push(`:style.${I0(L)}="${I}"`),q.set(I,"() => `"+w+"`"),U=!0}}if(Z.attributes&&typeof Z.attributes==="object"){for(let[L,w]of Object.entries(Z.attributes))if(c0(w)){let I=F4(w.$ref);Y.push(`:attr.${L}="${I}"`),R5(q,I,w.$ref),U=!0}else if(v(w)){let I=`_t${Q.t++}`;Y.push(`:attr.${L}="${I}"`),q.set(I,"() => `"+w+"`"),U=!0}}for(let[L,w]of Object.entries(Z)){if(Y4.has(L)||L.startsWith("on")||L.startsWith("$")||L==="tagName"||L==="id"||L==="className"||L==="style"||L==="children"||L==="textContent"||L==="innerHTML"||L==="attributes")continue;if(c0(w)){let I=F4(w.$ref);Y.push(`:${I0(L)}="${I}"`),R5(q,I,w.$ref),U=!0}else if(v(w)){let I=`_t${Q.t++}`;Y.push(`:${I0(L)}="${I}"`),q.set(I,"() => `"+w+"`"),U=!0}}let K=J1(Z,G.scope),V=U?" data-bind":"",H=Y.length>0?" "+Y.join(" "):"",$="",A=J??Z;if(A.textContent!==void 0&&!U){let L=o(A.textContent,G.scope);$=L==null?"":f(String(L))}else if(A.textContent!==void 0&&U){let L=o(A.textContent,G.scope);$=L==null?"":f(String(L))}else if(A.innerHTML)$=o(A.innerHTML,G.scope)??A.innerHTML;else if(A.children&&typeof A.children==="object"&&!Array.isArray(A.children)&&A.children.$prototype==="Array"){Q.needsLit=!0;let L=`_list${Q.l++}`,w=A.children,I;if(c0(w.items))I="state."+F4(w.items.$ref);else I=JSON.stringify(w.items);let j=y9(w.map);q.set(L,"() => ("+I+" ?? []).map((item, index) => html`"+j+"`)"),Y.push(`:render="${L}"`),U=!0;let g=" data-bind",y=" "+Y.join(" ");if(new Set(["input","br","hr","img","meta","link"]).has(z))return`<${z}${K}${g}${y}>`;return`<${z}${K}${g}${y}></${z}>`}else if(Array.isArray(A.children)){let L=J?.children;$=A.children.map((w,I)=>{let j=L?.[I]??w;return v9(w,j,G,q,W,Q)}).join(`
258
- `)}if(new Set(["input","br","hr","img","meta","link"]).has(z))return`<${z}${K}${V}${H}>`;return`<${z}${K}${V}${H}>${$}</${z}>`}function y9(Z){if(!Z)return"";let J=Z.tagName??"div",X="";if(Z.id)X+=' id="'+Z.id+'"';if(Z.className)X+=' class="'+m4(Z.className)+'"';if(Z.attributes&&typeof Z.attributes==="object")for(let[Q,G]of Object.entries(Z.attributes))if(typeof G==="string"&&v(G))X+=" "+Q+'="'+m4(G)+'"';else X+=" "+Q+'="'+f(String(G))+'"';if(Z.style&&typeof Z.style==="object"){let Q=[];for(let[G,z]of Object.entries(Z.style)){if(G.startsWith(":")||G.startsWith(".")||G.startsWith("&")||G.startsWith("[")||G.startsWith("@"))continue;if(z===null||typeof z==="object")continue;let Y=I0(G);if(v(String(z)))Q.push(Y+": "+m4(String(z)));else Q.push(Y+": "+z)}if(Q.length>0)X+=' style="'+Q.join("; ")+'"'}for(let[Q,G]of Object.entries(Z)){if(!Q.startsWith("on")||Q==="observedAttributes")continue;let z=Q.slice(2).toLowerCase();if(c0(G)){let Y=F4(G.$ref);X+=" @"+z+"=${(e) => { state.$map = { item, index }; on."+Y+"(e); }}"}else if(G&&typeof G==="object"&&G.$prototype==="Function"){let Y=m4(G.body);X+=" @"+z+"=${(e) => { "+Y+" }}"}else if(G&&typeof G==="object"&&"$expression"in G){let Y=L0(G.$expression,{statePrefix:"state",eventParam:"e"});X+=" @"+z+"=${(e) => { state.$map = { item, index }; "+Y+"; }}"}}if(Z.contentEditable)X+=' contenteditable="'+Z.contentEditable+'"';let q="";if(Z.textContent!==void 0){let Q=String(Z.textContent);if(v(Q))q=m4(Q);else if(c0(Z.textContent))q="${state."+F4(Z.textContent.$ref)+"}";else q=f(Q)}else if(Z.innerHTML)q=m4(String(Z.innerHTML));else if(Array.isArray(Z.children))q=`
259
- `+Z.children.map((Q)=>y9(Q)).join(`
260
- `)+`
261
- `;if(new Set(["input","br","hr","img","meta","link"]).has(J))return"<"+J+X+">";return"<"+J+X+">"+q+"</"+J+">"}function m4(Z){return Z.replace(/\$map\./g,"")}function kW(Z,J,X,q,W,Q,G,z){let Y=[],U=G.needsLit,K=J.length>0;Y.push("// Generated by @jxsuite/compiler — do not edit manually");let V=["reactive","effect"];if(K)V.push("computed");if(Y.push("import { "+V.join(", ")+" } from '@vue/reactivity';"),U)Y.push("import { html, render } from 'lit-html';");for(let[H,$]of Q)Y.push("import { "+[...$].join(", ")+" } from '"+H+"';");Y.push(""),Y.push("const state = reactive({");for(let[H,$]of Z)Y.push(" "+H+": "+JSON.stringify($)+",");if(Y.push("});"),Y.push(""),W.length>0){for(let H of W)Y.push(H);Y.push("")}if(J.length>0){for(let[H,$]of J)Y.push("state."+H+" = computed("+$+");");Y.push("")}if(X.length>0){Y.push("const bind = {");for(let[H,$]of X)Y.push(" "+H+": "+$+",");Y.push("};")}else Y.push("const bind = {};");if(Y.push(""),q.length>0){Y.push("const on = {");for(let[H,$]of q){let A=$.args??["state"],D=A.map((L)=>L==="state"?"state":"e").join(", ");Y.push(" "+H+": (e) => { const fn = ("+A.join(", ")+") => { "+$.body+" }; fn("+D+"); },")}Y.push("};")}else Y.push("const on = {};");if(Y.push(""),Y.push("function hydrate(root) {"),Y.push(" root.querySelectorAll('[data-bind]').forEach(el => {"),Y.push(" [...el.attributes].forEach(a => {"),Y.push(" if (a.name.startsWith(':')) {"),Y.push(" const parts = a.name.slice(1).split('.');"),Y.push(" const key = a.value;"),U)Y.push(" if (parts[0] === 'render') {"),Y.push(" effect(() => { render(bind[key](), el); });"),Y.push(" } else if (parts[0] === 'style' && parts.length > 1) {");else Y.push(" if (parts[0] === 'style' && parts.length > 1) {");return Y.push(" effect(() => { el.style[parts[1]] = bind[key](); });"),Y.push(" } else if (parts[0] === 'attr' && parts.length > 1) {"),Y.push(" effect(() => { el.setAttribute(parts[1], bind[key]()); });"),Y.push(" } else {"),Y.push(" const prop = parts[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());"),Y.push(" effect(() => { el[prop] = bind[key](); });"),Y.push(" }"),Y.push(" } else if (a.name.startsWith('@')) {"),Y.push(" el.addEventListener(a.name.slice(1), on[a.value]);"),Y.push(" }"),Y.push(" });"),Y.push(" });"),Y.push("}"),Y.push(""),Y.push("hydrate(document);"),Y.push(""),Y.join(`
262
- `)}function SW(Z,J){let X=J.url,q=J.method??"GET",W=v(X);if(J.manual)return"// "+Z+": manual Request — fetch triggered by user action";let Q=[];if(Q.push("// "+Z+": auto-fetch from "+(W?"(dynamic URL)":X)),Q.push("effect(() => {"),W)Q.push(" const url = `"+X+"`;"),Q.push(' if (!url || url === "undefined" || url.includes("undefined")) return;');else Q.push(" const url = "+JSON.stringify(X)+";");let G=[];if(q!=="GET")G.push("method: "+JSON.stringify(q));if(J.headers)G.push("headers: "+JSON.stringify(J.headers));if(J.body){let Y=typeof J.body==="object"?JSON.stringify(JSON.stringify(J.body)):JSON.stringify(J.body);G.push("body: "+Y)}let z=G.length>0?", { "+G.join(", ")+" }":"";return Q.push(" fetch(url"+z+")"),Q.push(" .then(r => r.ok ? r.json() : Promise.reject(r.statusText))"),Q.push(" .then(d => { state."+Z+" = d; })"),Q.push(" .catch(e => { state."+Z+" = { error: String(e) }; });"),Q.push("});"),Q.join(`
263
- `)}function bW(Z,J,X,q){let W=[];return W.push("// "+Z+": "+J+' (key: "'+X+'")'),W.push("try {"),W.push(" const _s = "+J+".getItem("+JSON.stringify(X)+");"),W.push(" state."+Z+" = _s !== null ? JSON.parse(_s) : "+JSON.stringify(q)+";"),W.push("} catch { state."+Z+" = "+JSON.stringify(q)+"; }"),W.push("effect(() => {"),W.push(" const v = state."+Z+";"),W.push(" try {"),W.push(" if (v === null) "+J+".removeItem("+JSON.stringify(X)+");"),W.push(" else "+J+".setItem("+JSON.stringify(X)+", JSON.stringify(v));"),W.push(" } catch {}"),W.push("});"),W.join(`
264
- `)}function vW(Z,J,X){let q=[];return q.push("// "+Z+': Cookie (name: "'+J+'")'),q.push("{"),q.push(' const _m = document.cookie.match(new RegExp("(?:^|; )'+J+'=([^;]*)"));'),q.push(" try { state."+Z+" = _m ? JSON.parse(decodeURIComponent(_m[1])) : "+JSON.stringify(X)+"; }"),q.push(" catch { state."+Z+" = _m ? _m[1] : "+JSON.stringify(X)+"; }"),q.push("}"),q.join(`
265
- `)}function F4(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replace(/\//g,"_");return Z.replace(/\//g,"_")}function R5(Z,J,X){if(Z.has(J))return;if(X.startsWith("#/state/")){let W=X.slice(8).split("/");Z.set(J,"() => state."+W.join("."))}else Z.set(J,"() => state."+X)}var g9=O(()=>{j1();U4()});var m9={};T6(m9,{compileClassJson:()=>yW});function yW(Z,J={}){let X=Z.title;if(!X)throw Error("compileClassJson: missing title (class name)");let q=gW(Z.extends),W=Z.$defs,Q=W?.fields??{},G=W?.constructor,z=W?.methods??{},Y=[];if(Y.push("// Generated by @jxsuite/compiler from .class.json — do not edit manually"),Z.$id)Y.push(`// Source: ${Z.$id}`);Y.push("");let U=q!=="Object"?` extends ${q}`:"";Y.push(`class ${X}${U} {`);for(let[K,V]of Object.entries(Q)){let H=V;if(H.scope!=="static")continue;let $=H.identifier??K,A=H.access==="private"?"#":"",D=H.initializer!==void 0?JSON.stringify(H.initializer):H.default!==void 0?JSON.stringify(H.default):"null";Y.push(` static ${A}${$} = ${D};`)}for(let[K,V]of Object.entries(Q)){let H=V;if(H.scope==="static")continue;if(H.access!=="private")continue;let $=H.identifier??K;Y.push(` #${$};`)}if(Object.keys(Q).length>0)Y.push("");if(Y.push(" constructor(config = {}) {"),G?.superCall||q!=="Object"){let K=G?.superCall?.arguments?G.superCall.arguments.join(", "):"";Y.push(` super(${K});`)}for(let[K,V]of Object.entries(Q)){let H=V;if(H.scope==="static")continue;let $=H.identifier??K,A=H.access==="private"?"#":"",D=H.initializer!==void 0?JSON.stringify(H.initializer):H.default!==void 0?JSON.stringify(H.default):"null";Y.push(` this.${A}${$} = config.${$} !== undefined ? config.${$} : ${D};`)}if(G?.body){let K=Array.isArray(G.body)?G.body:[G.body];for(let V of K)Y.push(` ${V}`)}Y.push(" }");for(let[K,V]of Object.entries(z)){let H=V,$=H.identifier??K,A=H.scope==="static",L=H.access==="private"?"#":"",w=A?"static ":"",I=H.returnType?.$ref?.includes("Promise")||mW(H)?"async ":"",j=h9(H.parameters??[]),g=hW(H.body);if(Y.push(""),H.role==="accessor"){if(H.getter)Y.push(` ${w}get ${L}${$}() {`),Y.push(` ${H.getter.body}`),Y.push(" }");if(H.setter){let y=h9(H.setter.parameters??[]);Y.push(` ${w}set ${L}${$}(${y}) {`),Y.push(` ${H.setter.body}`),Y.push(" }")}}else{Y.push(` ${w}${I}${L}${$}(${j}) {`);for(let y of g)Y.push(` ${y}`);Y.push(" }")}}return Y.push("}"),Y.push(""),Y.push(`export { ${X} };`),Y.push(`export default ${X};`),Y.push(""),Y.join(`
266
- `)}function gW(Z){if(!Z)return"Object";if(typeof Z==="string")return Z;let J=Z;if(J.$ref){let q=J.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return q?q[1]:"Object"}return"Object"}function h9(Z){return Z.map((J)=>{let X=J;if(X.$ref)return X.$ref.split("/").pop();return X.identifier??X.name??"arg"}).join(", ")}function hW(Z){if(!Z)return[""];if(Array.isArray(Z))return Z;return[Z]}function mW(Z){return(Array.isArray(Z.body)?Z.body.join(`
267
- `):Z.body??"").includes("await ")}import{readFileSync as fW}from"node:fs";async function P5(Z,J={}){let{title:X="Jx App",reactivitySrc:q=T4,litHtmlSrc:W=R4,projectStyle:Q=null}=J,G;if(typeof Z==="string"){let z=fW(Z,"utf8");if(Z.endsWith(".json"))G=JSON.parse(z);else{let{extname:Y}=await import("node:path"),U=Y(Z).toLowerCase(),V=J.formats?.byExtension?.(U,"parse");if(!V){let{unknownFormatError:H}=await Promise.resolve().then(() => (h4(),w5));throw H(Z,U)}G=await V.call("parse",z)}}else G=Z;if(G.$prototype==="Class"){let{compileClassJson:z}=await Promise.resolve().then(() => m9),Y=z(G,J);return{html:"",files:[{path:typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${G.title}.js`,content:Y}]}}if(!O6(G))return x9(G,{title:X,reactivitySrc:q,litHtmlSrc:W,projectStyle:Q});if(G.tagName&&G.tagName.includes("-")){let z=G.tagName,Y=C1(z),U=$1(G,Y,[]),K={path:`${z}.js`,content:U,tagName:z},V=C4(G,G.$media??{});return{html:`<!DOCTYPE html>
169
+ </html>`;return{files:[{content:_,path:J}],html:b}}function H7(Z,X,q,W,Q,J){if(typeof Z==="string")return y(Z);if(typeof Z==="number"||typeof Z==="boolean")return y(String(Z));if(!Z||typeof Z!=="object")return"";let z=h6(X,q.scope,X?.state??q.scopeDefs,X?.$media??q.media),Y=Z.tagName??"div",U=[],K=!1;if(Z.textContent!==void 0){let A=X?.textContent??Z.textContent;if(b0(A)){let I=E6(A.$ref);U.push(`:text-content="${I}"`),c5(W,I,A.$ref),K=!0}else if(x(A)){let I=`_t${J.t}`;J.t+=1,U.push(`:text-content="${I}"`),W.set(I,`() => \`${A}\``),K=!0}}for(let[A,I]of Object.entries(Z)){if(!A.startsWith("on")||A==="observedAttributes")continue;let M=A.slice(2).toLowerCase();if(b0(I)){let _=E6(I.$ref);U.push(`@${M}="${_}"`),K=!0}else if(i0(I)){let _=`_h${J.h}`;J.h+=1,U.push(`@${M}="${_}"`),Q.set(_,{args:I.parameters?z6(I.parameters):I.arguments??["state","event"],body:I.body}),K=!0}else if(O0(I)){let _=`_h${J.h}`;J.h+=1,U.push(`@${M}="${_}"`);let k=T0(I.$expression,{eventParam:"e",statePrefix:"state"});Q.set(_,{args:["state","e"],body:k}),K=!0}}if(Z.style&&typeof Z.style==="object")for(let[A,I]of Object.entries(Z.style)){if(A.startsWith(":")||A.startsWith(".")||A.startsWith("&")||A.startsWith("[")||A.startsWith("@"))continue;if(I===null||typeof I==="object")continue;if(x(I)){let M=`_s${J.s}`;J.s+=1,U.push(`:style.${I0(A)}="${M}"`),W.set(M,`() => \`${I}\``),K=!0}}if(Z.attributes&&typeof Z.attributes==="object"){for(let[A,I]of Object.entries(Z.attributes))if(b0(I)){let M=E6(I.$ref);U.push(`:attr.${A}="${M}"`),c5(W,M,I.$ref),K=!0}else if(x(I)){let M=`_t${J.t}`;J.t+=1,U.push(`:attr.${A}="${M}"`),W.set(M,`() => \`${I}\``),K=!0}}for(let[A,I]of Object.entries(Z)){if(D6.has(A)||A.startsWith("on")||A.startsWith("$")||A==="tagName"||A==="id"||A==="className"||A==="style"||A==="children"||A==="textContent"||A==="innerHTML"||A==="attributes")continue;if(b0(I)){let M=E6(I.$ref);U.push(`:${I0(A)}="${M}"`),c5(W,M,I.$ref),K=!0}else if(x(I)){let M=`_t${J.t}`;J.t+=1,U.push(`:${I0(A)}="${M}"`),W.set(M,`() => \`${I}\``),K=!0}}let V=v6(Z,z.scope),B=K?" data-bind":"",H=U.length>0?` ${U.join(" ")}`:"",$="",F=X??Z;if(F.textContent!==void 0&&!K){let A=p(F.textContent,z.scope);$=A==null?"":y(String(A))}else if(F.textContent!==void 0&&K){let A=p(F.textContent,z.scope);$=A==null?"":y(String(A))}else if(F.innerHTML)$=p(F.innerHTML,z.scope)??F.innerHTML;else if(w6(F.children)){J.needsLit=!0;let A=`_list${J.l}`;J.l+=1;let I=F.children,M;if(b0(I.items))M=`state.${E6(I.items.$ref)}`;else M=JSON.stringify(I.items);let _=$7(I.map);W.set(A,`() => (${M} ?? []).map((item, index) => html\`${_}\`)`),U.push(`:render="${A}"`),K=!0;let k=" data-bind",b=` ${U.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${V}${k}${b}>`;return`<${Y}${V}${k}${b}></${Y}>`}else if(Array.isArray(F.children)){let A=Array.isArray(X?.children)?X.children:void 0;$=F.children.map((I,M)=>{let _=A?.[M]??I;return H7(I,_,z,W,Q,J)}).join(`
170
+ `)}if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${V}${B}${H}>`;return`<${Y}${V}${B}${H}>${$}</${Y}>`}function $7(Z){if(!Z)return"";let X=Z.tagName??"div",q="";if(Z.id)q+=` id="${Z.id}"`;if(Z.className)q+=` class="${o6(Z.className)}"`;if(Z.attributes&&typeof Z.attributes==="object")for(let[J,z]of Object.entries(Z.attributes))q+=typeof z==="string"&&x(z)?` ${J}="${o6(z)}"`:` ${J}="${y(String(z))}"`;if(Z.style&&typeof Z.style==="object"){let J=[];for(let[z,Y]of Object.entries(Z.style)){if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")||z.startsWith("@"))continue;if(Y===null||typeof Y==="object")continue;let U=I0(z);if(x(String(Y)))J.push(`${U}: ${o6(String(Y))}`);else J.push(`${U}: ${Y}`)}if(J.length>0)q+=` style="${J.join("; ")}"`}for(let[J,z]of Object.entries(Z)){if(!J.startsWith("on")||J==="observedAttributes")continue;let Y=J.slice(2).toLowerCase();if(b0(z)){let U=E6(z.$ref);q+=` @${Y}=\${(e) => { state.$map = { item, index }; on.${U}(e); }}`}else if(z&&typeof z==="object"&&z.$prototype==="Function"){let U=o6(z.body);q+=` @${Y}=\${(e) => { ${U} }}`}else if(z&&typeof z==="object"&&"$expression"in z){let U=T0(z.$expression,{eventParam:"e",statePrefix:"state"});q+=` @${Y}=\${(e) => { state.$map = { item, index }; ${U}; }}`}}if(Z.contentEditable)q+=` contenteditable="${Z.contentEditable}"`;let W="";if(Z.textContent!==void 0){let J=String(Z.textContent);if(x(J))W=o6(J);else if(b0(Z.textContent))W=`\${state.${E6(Z.textContent.$ref)}}`;else W=y(J)}else if(Z.innerHTML)W=o6(String(Z.innerHTML));else if(Array.isArray(Z.children))W=`
171
+ ${Z.children.map((J)=>$7(J)).join(`
172
+ `)}
173
+ `;if(new Set(["input","br","hr","img","meta","link"]).has(X))return`<${X}${q}>`;return`<${X}${q}>${W}</${X}>`}function o6(Z){return Z.replaceAll("$map.","")}function eJ(Z,X,q,W,Q,J,z,Y){let U=[],{needsLit:K}=z,V=X.length>0;U.push("// Generated by @jxsuite/compiler — do not edit manually");let B=["reactive","effect"];if(V)B.push("computed");if(U.push(`import { ${B.join(", ")} } from '@vue/reactivity';`),K)U.push("import { html, render } from 'lit-html';");for(let[H,$]of J)U.push(`import { ${[...$].join(", ")} } from '${H}';`);U.push(""),U.push("const state = reactive({");for(let[H,$]of Z)U.push(` ${H}: ${JSON.stringify($)},`);if(U.push("});"),U.push(""),Q.length>0){for(let H of Q)U.push(H);U.push("")}if(X.length>0){for(let[H,$]of X)U.push(`state.${H} = computed(${$});`);U.push("")}if(q.length>0){U.push("const bind = {");for(let[H,$]of q)U.push(` ${H}: ${$},`);U.push("};")}else U.push("const bind = {};");if(U.push(""),W.length>0){U.push("const on = {");for(let[H,$]of W){let F=$.args??["state"],L=F.map((A)=>A==="state"?"state":"e").join(", ");U.push(` ${H}: (e) => { const fn = (${F.join(", ")}) => { ${$.body} }; fn(${L}); },`)}U.push("};")}else U.push("const on = {};");if(U.push(""),U.push("function hydrate(root) {"),U.push(" root.querySelectorAll('[data-bind]').forEach(el => {"),U.push(" [...el.attributes].forEach(a => {"),U.push(" if (a.name.startsWith(':')) {"),U.push(" const parts = a.name.slice(1).split('.');"),U.push(" const key = a.value;"),K)U.push(" if (parts[0] === 'render') {"),U.push(" effect(() => { render(bind[key](), el); });"),U.push(" } else if (parts[0] === 'style' && parts.length > 1) {");else U.push(" if (parts[0] === 'style' && parts.length > 1) {");return U.push(" effect(() => { el.style[parts[1]] = bind[key](); });"),U.push(" } else if (parts[0] === 'attr' && parts.length > 1) {"),U.push(" effect(() => { el.setAttribute(parts[1], bind[key]()); });"),U.push(" } else {"),U.push(" const prop = parts[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());"),U.push(" effect(() => { el[prop] = bind[key](); });"),U.push(" }"),U.push(" } else if (a.name.startsWith('@')) {"),U.push(" el.addEventListener(a.name.slice(1), on[a.value]);"),U.push(" }"),U.push(" });"),U.push(" });"),U.push("}"),U.push(""),U.push("hydrate(document);"),U.push(""),U.join(`
174
+ `)}function Zz(Z,X){let{url:q}=X,W=X.method??"GET",Q=x(q);if(X.manual)return`// ${Z}: manual Request — fetch triggered by user action`;let J=[`// ${Z}: auto-fetch from ${Q?"(dynamic URL)":q}`,"effect(() => {"];if(Q)J.push(` const url = \`${q}\`;`),J.push(' if (!url || url === "undefined" || url.includes("undefined")) return;');else J.push(` const url = ${JSON.stringify(q)};`);let z=[];if(W!=="GET")z.push(`method: ${JSON.stringify(W)}`);if(X.headers)z.push(`headers: ${JSON.stringify(X.headers)}`);if(X.body){let U=typeof X.body==="object"?JSON.stringify(JSON.stringify(X.body)):JSON.stringify(X.body);z.push(`body: ${U}`)}let Y=z.length>0?`, { ${z.join(", ")} }`:"";return J.push(` fetch(url${Y})`),J.push(" .then(r => r.ok ? r.json() : Promise.reject(r.statusText))"),J.push(` .then(d => { state.${Z} = d; })`),J.push(` .catch(e => { state.${Z} = { error: String(e) }; });`),J.push("});"),J.join(`
175
+ `)}function Xz(Z,X,q,W){return[`// ${Z}: ${X} (key: "${q}")`,"try {",` const _s = ${X}.getItem(${JSON.stringify(q)});`,` state.${Z} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(W)};`,`} catch { state.${Z} = ${JSON.stringify(W)}; }`,"effect(() => {",` const v = state.${Z};`," try {",` if (v === null) ${X}.removeItem(${JSON.stringify(q)});`,` else ${X}.setItem(${JSON.stringify(q)}, JSON.stringify(v));`," } catch {}","});"].join(`
176
+ `)}function qz(Z,X,q){return[`// ${Z}: Cookie (name: "${X}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${X}=([^;]*)"));`,` try { state.${Z} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(q)}; }`,` catch { state.${Z} = _m ? _m[1] : ${JSON.stringify(q)}; }`,"}"].join(`
177
+ `)}function E6(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replaceAll("/","_");return Z.replaceAll("/","_")}function c5(Z,X,q){if(Z.has(X))return;if(q.startsWith("#/state/")){let Q=q.slice(8).split("/");Z.set(X,`() => state.${Q.join(".")}`)}else Z.set(X,`() => state.${q}`)}var F7=R(()=>{u4();T6();S0()});var M7={};f4(M7,{compileClassJson:()=>Wz});function Wz(Z,X={}){let q=Z.title;if(!q)throw Error("compileClassJson: missing title (class name)");let W=Qz(Z.extends),Q=Z.$defs,J=Q?.fields??{},z=Q?.constructor,Y=typeof z==="object"?z:void 0,U=Q?.methods??{},K=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if(Z.$id)K.push(`// Source: ${Z.$id}`);K.push("");let V=W!=="Object"?` extends ${W}`:"";K.push(`class ${q}${V} {`);for(let[B,H]of Object.entries(J)){if(H.scope!=="static")continue;let $=H.identifier??B,F=H.access==="private"?"#":"",L=H.initializer!==void 0?JSON.stringify(H.initializer):H.default!==void 0?JSON.stringify(H.default):"null";K.push(` static ${F}${$} = ${L};`)}for(let[B,H]of Object.entries(J)){if(H.scope==="static")continue;if(H.access!=="private")continue;let $=H.identifier??B;K.push(` #${$};`)}if(Object.keys(J).length>0)K.push("");if(K.push(" constructor(config = {}) {"),Y?.superCall||W!=="Object"){let B=Y?.superCall?.arguments?Y.superCall.arguments.join(", "):"";K.push(` super(${B});`)}for(let[B,H]of Object.entries(J)){if(H.scope==="static")continue;let $=H.identifier??B,F=H.access==="private"?"#":"",L=H.initializer!==void 0?JSON.stringify(H.initializer):H.default!==void 0?JSON.stringify(H.default):"null";K.push(` this.${F}${$} = config.${$} !== undefined ? config.${$} : ${L};`)}if(Y?.body){let B=Array.isArray(Y.body)?Y.body:[Y.body];for(let H of B)K.push(` ${H}`)}K.push(" }");for(let[B,H]of Object.entries(U)){let $=H.identifier??B,F=H.scope==="static",A=H.access==="private"?"#":"",I=F?"static ":"",M=H.returnType?.$ref?.includes("Promise")||zz(H)?"async ":"",_=A7(H.parameters??[]),k=Jz(H.body);if(K.push(""),H.role==="accessor"){if(H.getter)K.push(` ${I}get ${A}${$}() {`),K.push(` ${H.getter.body}`),K.push(" }");if(H.setter){let b=A7(H.setter.parameters??[]);K.push(` ${I}set ${A}${$}(${b}) {`),K.push(` ${H.setter.body}`),K.push(" }")}}else{K.push(` ${I}${M}${A}${$}(${_}) {`);for(let b of k)K.push(` ${b}`);K.push(" }")}}return K.push("}"),K.push(""),K.push(`export { ${q} };`),K.push(`export default ${q};`),K.push(""),K.join(`
178
+ `)}function Qz(Z){if(!Z)return"Object";if(typeof Z==="string")return Z;if(Z.$ref){let X=Z.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return X?X[1]:"Object"}return"Object"}function A7(Z){return Z.map((X)=>{if(X.$ref)return X.$ref.split("/").pop();let q=X.identifier??X.name;return typeof q==="string"?q:"arg"}).join(", ")}function Jz(Z){if(!Z)return[""];return Array.isArray(Z)?Z:[Z]}function zz(Z){return(Array.isArray(Z.body)?Z.body.join(`
179
+ `):Z.body??"").includes("await ")}import{readFileSync as Gz}from"node:fs";async function l5(Z,X={}){let{title:q="Jx App",reactivitySrc:W=y6,litHtmlSrc:Q=g6,projectStyle:J=null}=X,z;if(typeof Z==="string"){let Y=Gz(Z,"utf8");if(Z.endsWith(".json"))z=V6(Y,Z);else{let{extname:U}=await import("node:path"),K=U(Z).toLowerCase(),V=X.formats?.byExtension?.(K,"parse");if(!V){let{unknownFormatError:B}=await Promise.resolve().then(() => (s6(),f5));throw B(Z,K)}z=await V.call("parse",Y)}}else z=Z;if(o3(z)){let{compileClassJson:Y}=await Promise.resolve().then(() => M7),U=Y(z,X),K=typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${z.title}.js`;return{files:[{content:U,path:K}],html:""}}if(!o1(z))return U7(z,{litHtmlSrc:Q,projectStyle:J,reactivitySrc:W,title:q});if(z.tagName&&z.tagName.includes("-")){let{tagName:Y}=z,U=c4(Y),V={content:R4(z,U,[]),path:`${Y}.js`,tagName:Y},B=f6(z,z.$media??{}),H=`<!DOCTYPE html>
268
180
  <html lang="en">
269
181
  <head>
270
182
  <meta charset="utf-8">
271
183
  <meta name="viewport" content="width=device-width, initial-scale=1">
272
- <title>${f(X)}</title>
184
+ <title>${y(q)}</title>
273
185
  <script type="importmap">
274
186
  {
275
187
  "imports": {
276
- "@vue/reactivity": "${q}",
277
- "lit-html": "${W}"
188
+ "@vue/reactivity": "${W}",
189
+ "lit-html": "${Q}"
278
190
  }
279
191
  }
280
192
  </script>
281
- ${V}
193
+ ${B}
282
194
  </head>
283
195
  <body>
284
- <${z}></${z}>
285
- <script type="module" src="./${z}.js"></script>
196
+ <${Y}></${Y}>
197
+ <script type="module" src="./${Y}.js"></script>
286
198
  </body>
287
- </html>`,files:[K]}}return b9(G,{title:X,reactivitySrc:q,litHtmlSrc:W,projectStyle:Q})}async function TB(Z,J){let[X,q]=await Promise.all([P5(Z),r1(Z)]),{writeFileSync:W,mkdirSync:Q}=await import("node:fs"),{dirname:G,join:z}=await import("node:path");if(J){W(J,X.html,"utf8"),console.error(`Written to ${J}`);let Y=G(J);for(let U of X.files){let K=z(Y,U.path);Q(G(K),{recursive:!0}),W(K,U.content,"utf8"),console.error(`Written to ${K}`)}}else process.stdout.write(X.html);if(q&&J){let Y=J.replace(/(\.[^.]+)?$/,"-server.js");W(Y,q,"utf8"),console.error(`Server handler written to ${Y}`)}}var f9=O(()=>{U4();w9();t1();S9();g9()});import{readFileSync as uW,existsSync as dW}from"node:fs";import{resolve as u9}from"node:path";function d9(Z){let J=u9(Z,"project.json");if(!dW(J))throw Error(`project.json not found in ${Z}`);let X;try{X=JSON.parse(uW(J,"utf8"))}catch(z){throw Error(`Invalid JSON in ${J}: ${z.message}`)}if(typeof X!=="object"||X===null||Array.isArray(X))throw Error(`project.json must be a JSON object, got ${typeof X}`);let q={...e1,...X,defaults:{...e1.defaults,...X.defaults},images:{...e1.images,...X.images},build:{...e1.build,...X.build}};if(X.$head)q.$head=X.$head;if(X.$media)q.$media=X.$media;if(X.style)q.style=X.style;if(X.state)q.state=X.state;if(X.redirects)q.redirects=X.redirects;if(X.imports)q.imports=X.imports;if(X.contentTypes)q.contentTypes=X.contentTypes;let W=["cloudflare-workers","cloudflare-pages","node","bun"];if(q.build.adapter&&!W.includes(q.build.adapter))throw Error(`Unknown build adapter "${q.build.adapter}" in project.json. Valid adapters: ${W.join(", ")}`);let Q=["build","cloudflare"];if(!Q.includes(q.images.service))throw Error(`Unknown images.service "${q.images.service}" in project.json. Valid services: ${Q.join(", ")}`);let G=["cloudflare-workers","cloudflare-pages"];if(q.images.service==="cloudflare"&&!G.includes(q.build.adapter))console.warn(`images.service "cloudflare" requires a Cloudflare adapter (${G.join(", ")}) — falling back to "build"`),q.images.service="build";return{config:q,configPath:J,projectRoot:u9(Z)}}var e1;var c9=O(()=>{e1={name:"Jx Site",url:"",defaults:{layout:null,lang:"en",charset:"utf-8"},$head:[],imports:{},$media:{},style:{},state:{},contentTypes:{},redirects:{},images:{optimize:!0,widths:[320,640,960,1280,1920],formats:["webp","avif"],quality:{webp:80,avif:65,jpeg:80,png:80},sizes:"(max-width: 768px) 100vw, 50vw",lazyLoad:!0,service:"build",binding:"IMAGES"},build:{outDir:"./dist",format:"directory",trailingSlash:"always",provider:null}}});import{readdirSync as cW,readFileSync as l9}from"node:fs";import{resolve as lW,relative as pW,extname as j5,join as nW}from"node:path";async function F1(Z,J){let X=l9(Z,"utf8");if(Z.endsWith(".json"))return JSON.parse(X);let q=j5(Z).toLowerCase(),W=J?.byExtension(q,"parse");if(!W)throw Error(`No format class imported for "${q}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`);return await W.call("parse",X)}async function p9(Z,J){let X=[],q=new Set([".json",...J?.documentExtensions("page")??[]]);return await n9(Z,Z,X,q,J),X.sort((W,Q)=>{if(W.isDynamic!==Q.isDynamic)return W.isDynamic?1:-1;if(W.isCatchAll!==Q.isCatchAll)return W.isCatchAll?1:-1;return W.urlPattern.localeCompare(Q.urlPattern)}),X}async function n9(Z,J,X,q,W){let Q=cW(Z,{withFileTypes:!0});for(let G of Q){let z=nW(Z,G.name);if(G.isDirectory()){if(G.name.startsWith("_"))continue;await n9(z,J,X,q,W);continue}let Y=j5(G.name).toLowerCase();if(!q.has(Y))continue;if(G.name.startsWith("_"))continue;let U=pW(J,z),K=await rW(U,z,W);if(K)X.push(K)}}async function rW(Z,J,X){let q=j5(Z),W=q?Z.slice(0,-q.length):Z;if(W=W.split("\\").join("/"),W.endsWith("/index"))W=W.slice(0,-6)||"/";else if(W==="index")W="/";if(!W.startsWith("/"))W="/"+W;let Q=[],G=!1,z=!1,Y=W.replace(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(K,V,H)=>{if(V)return z=!0,G=!0,Q.push(V),"*";return G=!0,Q.push(H),`:${H}`}),U=null;try{let K=await F1(J,X);if(typeof K.$layout==="string")U=K.$layout}catch{}return{urlPattern:Y,sourcePath:J,relativePath:Z,isDynamic:G,isCatchAll:z,params:Q,$layout:U}}async function r9(Z,J,X=new Map,q){let W=[];for(let Q of Z){if(!Q.isDynamic){W.push(Q);continue}let G;try{G=await F1(Q.sourcePath,q)}catch{W.push(Q);continue}if(!G.$paths){console.warn(`Warning: dynamic route ${Q.urlPattern} has no $paths — skipping`);continue}let z=iW(G.$paths,J,X);for(let Y of z){let U=Q.urlPattern;for(let[K,V]of Object.entries(Y))U=U.replace(`:${K}`,V),U=U.replace("*",V);W.push({...Q,urlPattern:U,isDynamic:!1,isCatchAll:!1,params:[],_pathParams:Y})}}return W}function iW(Z,J,X){if(Array.isArray(Z))return Z;if(Z.contentType){let q=X.get(Z.contentType);if(!q||q.length===0)return console.warn(`Warning: $paths references content type "${Z.contentType}" but it has no entries`),[];let W=Z.param??"slug",Q=Z.field??"id";return q.map((G)=>({[W]:Q==="id"?G.id:G.data[Q]??G.id})).filter((G)=>G[W])}if(Array.isArray(Z.values)){let q=Z.param??"value";return Z.values.map((W)=>({[q]:W}))}if(Z.$ref){let q=lW(J,Z.$ref),W;try{W=JSON.parse(l9(q,"utf8"))}catch(z){let Y=z;return console.warn(`Warning: $paths.$ref could not load "${Z.$ref}": ${Y.message}`),[]}if(!Array.isArray(W))return console.warn(`Warning: $paths.$ref "${Z.$ref}" must be a JSON array`),[];let Q=Z.param??"id",G=Z.field??"id";return W.map((z)=>({[Q]:z[G]??z.id??String(z)}))}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var i9=()=>{};import{readFileSync as aW,existsSync as sW}from"node:fs";import{resolve as oW}from"node:path";function _5(Z,J,X){let q=Z.$layout??J.defaults?.layout??null;if(!q)return Z;let W=oW(X,q);if(!sW(W))throw Error(`Layout not found: ${q} (resolved to ${W})`);let Q;try{Q=JSON.parse(aW(W,"utf8"))}catch(U){throw Error(`Invalid layout JSON at ${W}: ${U.message}`)}if(Q.$layout)Q=_5(Q,J,X);let G=Z.children??[],z=typeof G==="string"?[G]:Array.isArray(G)?G:[],Y=eW(Q);if(tW(Y,z),Z.state)Y.state={...Y.state,...Z.state};if(Z.$media)Y.$media={...Y.$media,...Z.$media};if(Z.style)Y.style={...Y.style,...Z.style};if(Z.attributes)Y.attributes={...Y.attributes,...Z.attributes};if(Z.$head)Y._pageHead=Z.$head;if(Z.title)Y._pageTitle=Z.title;return delete Y.$layout,Y}function tW(Z,J){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let X=new Map,q=[];for(let W of J)if(W&&typeof W==="object"&&W.attributes?.slot){let Q=W.attributes.slot;if(!X.has(Q))X.set(Q,[]);X.get(Q).push(W)}else q.push(W);a9(Z,X,q)}function a9(Z,J,X){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let q=[];for(let W of Z.children)if(W&&typeof W==="object"&&W.tagName==="slot"){let Q=W.attributes?.name;if(Q&&J.has(Q))q.push(...J.get(Q)),J.delete(Q);else if(!Q&&X.length>0)q.push(...X);else if(Array.isArray(W.children))q.push(...W.children)}else a9(W,J,X),q.push(W);Z.children=q}function eW(Z){return JSON.parse(JSON.stringify(Z))}var s9=()=>{};function o9(Z=[],J=[],X=[],q={}){let W=[{tagName:"meta",attributes:{charset:q.charset??"utf-8"}},{tagName:"meta",attributes:{name:"viewport",content:"width=device-width, initial-scale=1"}}],Q=new Map;for(let z of[...W,...Z,...J,...X]){let Y=ZQ(z);Q.set(Y,z)}let G=q.title??q.siteName??"Jx Site";if(Q.set("title",{tagName:"title",children:[G]}),q.pageUrl&&q.siteUrl){let z=new URL(q.pageUrl,q.siteUrl).href;Q.set("link:canonical",{tagName:"link",attributes:{rel:"canonical",href:z}})}return Array.from(Q.values())}function ZQ(Z){if(!Z||typeof Z!=="object")return String(Z);let J=Z.tagName??"unknown",X=Z.attributes??{};if(J==="title")return"title";if(X.charset)return"meta:charset";if(J==="meta"&&X.name)return`meta:${X.name}`;if(J==="meta"&&X.property)return`meta:${X.property}`;if(J==="link"&&X.rel)return`link:${X.rel}:${X.href??""}`;if(J==="script"&&X.src)return`script:${X.src}`;if(J==="style"){let q=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`style:${JQ(q)}`}return`${J}:${JSON.stringify(Z)}`}function JQ(Z){let J=0;for(let X=0;X<Z.length;X++)J=(J<<5)-J+Z.charCodeAt(X)|0;return J.toString(36)}function t9(Z){return Z.map((J)=>XQ(J)).join(`
288
- `)}function XQ(Z){if(typeof Z==="string")return Z;if(!Z||typeof Z!=="object")return"";let J=Z.tagName,X=Z.attributes??{},q=Object.entries(X).map(([z,Y])=>Y===!0?z:`${z}="${qQ(Y)}"`).join(" "),W=q?`<${J} ${q}>`:`<${J}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(J))return W;let G=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`${W}${G}</${J}>`}function qQ(Z){return String(Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}import{resolve as WQ,dirname as QQ,relative as GQ}from"node:path";function e9(Z,J,X,q=new Map,W=null){if(!Z.state)Z.state={};if(Z.state.$site={name:J.name??"Jx Site",url:J.url??"",...J.state},Z.state.$page={url:X.urlPattern,title:Z.title??Z._pageTitle??J.name??"",params:X._pathParams??{}},J.state){for(let[Q,G]of Object.entries(J.state))if(Q!=="$site"&&Q!=="$page"&&!(Q in Z.state))Z.state[Q]=G}if(J.$media)Z.$media={...J.$media,...Z.$media};if(J.imports&&Object.keys(J.imports).length>0){if(!Z.imports)Z.imports={};for(let[Q,G]of Object.entries(J.imports))if(!(Q in Z.imports)){let z=G;if(W&&X.sourcePath&&(z.startsWith("./")||z.startsWith("../"))){let Y=WQ(W,z);Z.imports[Q]="./"+GQ(QQ(X.sourcePath),Y)}else Z.imports[Q]=z}}if(J.$elements?.length)if(!Z.$elements?.length)Z.$elements=[...J.$elements];else{let Q=new Set,G=[];for(let z of[...J.$elements,...Z.$elements]){let Y=typeof z==="string"?z:z?.$ref;if(Y&&!Q.has(Y))Q.add(Y),G.push(z)}Z.$elements=G}return Z}var Z2=()=>{};import{readFileSync as YQ,readdirSync as zQ,existsSync as UQ}from"node:fs";import{resolve as E5,basename as J2,extname as X2}from"node:path";function KQ(Z){let J=JSON.parse(YQ(Z,"utf-8"));if(Array.isArray(J))return J.map((q,W)=>({id:q.id??J2(Z,".json")+"-"+W,data:q,body:null}));let X=J;return[{id:X.id??J2(Z,".json"),data:X,body:null}]}function VQ(Z){if(X2(Z))return UQ(Z)?[Z]:[];try{return zQ(Z,{recursive:!0}).filter((J)=>String(J).endsWith(".json")).map((J)=>E5(Z,String(J)))}catch{return[]}}function O5(Z,J){let X=E5(Z,"content");return{config:{contentTypes:J?.contentTypes??{}},contentDir:X}}async function q2(Z,J,X){let q=O5(Z,J);if(!q)return new Map;let{config:W}=q,Q=new Map;if(Object.keys(W.contentTypes).length===0)return Q;let G=X??await H1(Z,J);for(let[z,Y]of Object.entries(W.contentTypes)){let U=await BQ(z,Y,Z,G);Q.set(z,U)}return Q}async function BQ(Z,J,X,q){let W=J.source;if(!W)return[];let Q=J.schema,G=J.$elements?.length?{allowedNames:J.$elements.filter(($)=>typeof $==="string"||typeof $==="object"&&$?.$ref).map(($)=>typeof $==="string"?$:$.$ref)}:void 0,z=J.format,Y;if(z&&z!=="json"){if(Y=q.byName(z),!Y)throw Error(`Content type "${Z}": format "${z}" is not an imported format class. Add it to project.json imports, e.g. "${z}": "@jxsuite/parser/${z}.class.json".`)}if(W.startsWith("http://")||W.startsWith("https://")){if(!Y)throw Error(`Content type "${Z}": remote sources require an explicit "format" naming an imported format class with "remote": true (e.g. "Csv").`);if(!Y.remote)throw Error(`Content type "${Z}": format "${Y.name}" does not support remote sources (its format block lacks "remote": true).`);try{let $=await Y.call("load",W,{schema:Q,directiveOptions:G});if(Q)C5($,Q,Z);return $}catch($){return console.warn(`Content type "${Z}": ${$.message}`),[]}}let U=E5(X,W).split("\\").join("/"),K=X2(W).toLowerCase();if(z==="json"||!Y&&K===".json"){let $=VQ(U),A=[];for(let D of $)A.push(...KQ(D));if(Q)C5(A,Q,Z);return A}if(!Y&&K)Y=q.byExtension(K,"load");if(!Y)throw D5(W,K||`content type "${Z}" (directory sources need an explicit "format")`);let V=Y.capabilities.discover?await Y.call("discover",W,{baseDir:X}):[U],H=[];for(let $ of V)H.push(...await Y.call("load",$,{schema:Q,directiveOptions:G}));if(Q)C5(H,Q,Z);return H}function C5(Z,J,X){let q=J.required??[],W=J.properties??{};for(let Q of Z){for(let G of q)if(!(G in Q.data)||Q.data[G]==null)console.warn(`Content validation: "${X}/${Q.id}" missing required field "${G}"`);for(let[G,z]of Object.entries(W)){let Y=Q.data[G];if(Y==null)continue;if(z.type==="string"&&typeof Y!=="string")console.warn(`Content validation: "${X}/${Q.id}" field "${G}" expected string, got ${typeof Y}`);else if(z.type==="number"&&typeof Y!=="number")console.warn(`Content validation: "${X}/${Q.id}" field "${G}" expected number, got ${typeof Y}`);else if(z.type==="boolean"&&typeof Y!=="boolean")console.warn(`Content validation: "${X}/${Q.id}" field "${G}" expected boolean, got ${typeof Y}`);else if(z.type==="array"&&!Array.isArray(Y))console.warn(`Content validation: "${X}/${Q.id}" field "${G}" expected array, got ${typeof Y}`)}}}function W2(Z,J){for(let[X,q]of Object.entries(J.contentTypes)){let W=q.schema;if(!W?.properties)continue;let Q=Z.get(X);if(!Q)continue;for(let[G,z]of Object.entries(W.properties)){if(!z.$ref?.startsWith("#/contentTypes/"))continue;let Y=z.$ref.replace("#/contentTypes/",""),U=Z.get(Y);if(!U)continue;for(let K of Q){let V=K.data[G];if(typeof V==="string"){let H=U.find(($)=>$.id===V);if(H)K.data[G]=H}}}}}var Q2=O(()=>{h4()});import{readFileSync as HQ}from"node:fs";import{dirname as x5,resolve as Z6}from"node:path";import{createRequire as $Q}from"node:module";async function G2(Z,J,X,q={}){let W=Z.imports??{},Q=Z.state;if(!Q)return;for(let[G,z]of Object.entries(Q)){if(!z||typeof z!=="object"||!z.$prototype)continue;if(FQ.has(z.$prototype))continue;if(z.timing&&z.timing!=="compiler")continue;if(!z.$src){let Y=W[z.$prototype];if(!Y)continue;z.$src=Y}try{let Y=await AQ(z,J,X,Q,q);if(z.timing&&Y&&typeof Y==="object"&&!Array.isArray(Y))Y.timing=z.timing;Q[G]=Y}catch(Y){console.warn(`prototype-resolver: failed to resolve "${G}" ($prototype: "${z.$prototype}"):`,Y.message)}}}async function AQ(Z,J,X,q,W){let Q=Z.$src,G;if(Q.startsWith("./")||Q.startsWith("../"))G=J.sourcePath?Z6(x5(J.sourcePath),Q):Z6(X,Q);else G=$Q(Z6(X,"package.json")).resolve(Q);let z=HQ(G,"utf-8"),Y=JSON.parse(z);if(!Y.$implementation)throw Error(`${Q} has no $implementation field`);let U=Z6(x5(G),Y.$implementation),K=await a1(U),V=Z.$export??Y.title??Z.$prototype,H=K[V]??K.default?.[V];if(!H)throw Error(`Module ${Y.$implementation} does not export "${V}"`);let $={};for(let[D,L]of Object.entries(Z))if(!MQ.has(D))$[D]=L;if($.src&&!$.basePath&&J.sourcePath)$.basePath=x5(J.sourcePath);$._project={config:W.config??null,contentTypes:W.contentTypes??null,root:X},$._document={route:J,state:q};let A=new H($);if(typeof A.resolve==="function")return await A.resolve();return A}var FQ,MQ;var Y2=O(()=>{h4();FQ=new Set(["Function","LocalStorage","SessionStorage","Array"]),MQ=new Set(["$prototype","$src","$export","timing","default","description"])});var v0=b((sB,U2)=>{/*!
199
+ </html>`;return{files:[V],html:H}}return B7(z,{litHtmlSrc:Q,projectStyle:J,reactivitySrc:W,title:q})}async function nF(Z,X){let[q,W]=await Promise.all([l5(Z),Y1(Z)]),{writeFileSync:Q,mkdirSync:J}=await import("node:fs"),{dirname:z,join:Y}=await import("node:path");if(X){Q(X,q.html,"utf8"),console.error(`Written to ${X}`);let U=z(X);for(let K of q.files){let V=Y(U,K.path);J(z(V),{recursive:!0}),Q(V,K.content,"utf8"),console.error(`Written to ${V}`)}}else process.stdout.write(q.html);if(W&&X){let U=X.replace(/(\.[^.]+)?$/,"-server.js");Q(U,W,"utf8"),console.error(`Server handler written to ${U}`)}}var L7=R(()=>{T6();a9();H1();V7();F7();S0();e0()});import{existsSync as Yz,readFileSync as Uz}from"node:fs";import{resolve as I7}from"node:path";function w7(Z){let X=I7(Z,"project.json");if(!Yz(X))throw Error(`project.json not found in ${Z}`);let q;try{q=s9(Uz(X,"utf8"),X)}catch(z){throw Error(`Invalid project.json: ${t0(z)}`,{cause:z})}let W={...$1,...q,build:{...$1.build,...q.build},defaults:{...$1.defaults,...q.defaults},images:{...$1.images,...q.images}};if(q.$head)W.$head=q.$head;if(q.$media)W.$media=q.$media;if(q.style)W.style=q.style;if(q.state)W.state=q.state;if(q.redirects)W.redirects=q.redirects;if(q.imports)W.imports=q.imports;if(q.contentTypes)W.contentTypes=q.contentTypes;let Q=["cloudflare-workers","cloudflare-pages","node","bun"];if(W.build.adapter&&!Q.includes(W.build.adapter))throw Error(`Unknown build adapter "${W.build.adapter}" in project.json. Valid adapters: ${Q.join(", ")}`);let J=["build","cloudflare"];if(!J.includes(W.images.service))throw Error(`Unknown images.service "${W.images.service}" in project.json. Valid services: ${J.join(", ")}`);return{config:W,configPath:X,projectRoot:I7(Z)}}var $1;var D7=R(()=>{e0();$1={$head:[],$media:{},build:{format:"directory",outDir:"./dist",provider:null,trailingSlash:"always"},contentTypes:{},defaults:{charset:"utf8",lang:"en",layout:null},images:{formats:["webp","avif"],lazyLoad:!0,optimize:!0,quality:{avif:65,jpeg:80,png:80,webp:80},service:"build",sizes:"(max-width: 768px) 100vw, 50vw",widths:[320,640,960,1280,1920]},imports:{},name:"Jx Site",redirects:{},state:{},style:{},url:""}});import{readFileSync as N7,readdirSync as Kz}from"node:fs";import{extname as p5,join as Vz,relative as Bz,resolve as Hz}from"node:path";async function _4(Z,X){let q=N7(Z,"utf8");if(Z.endsWith(".json"))return V6(q,Z);let W=p5(Z).toLowerCase(),Q=X?.byExtension(W,"parse");if(!Q)throw Error(`No format class imported for "${W}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`);return await Q.call("parse",q)}async function T7(Z,X){let q=[],W=new Set([".json",...X?.documentExtensions("page")??[]]);return await R7(Z,Z,q,W,X),q.sort((Q,J)=>{if(Q.isDynamic!==J.isDynamic)return Q.isDynamic?1:-1;if(Q.isCatchAll!==J.isCatchAll)return Q.isCatchAll?1:-1;return Q.urlPattern.localeCompare(J.urlPattern)}),q}async function R7(Z,X,q,W,Q){let J=Kz(Z,{withFileTypes:!0});for(let z of J){let Y=Vz(Z,z.name);if(z.isDirectory()){if(z.name.startsWith("_"))continue;await R7(Y,X,q,W,Q);continue}let U=p5(z.name).toLowerCase();if(!W.has(U))continue;if(z.name.startsWith("_"))continue;let K=Bz(X,Y),V=await $z(K,Y,Q);if(V)q.push(V)}}async function $z(Z,X,q){let W=p5(Z),Q=W?Z.slice(0,-W.length):Z;if(Q=Q.split("\\").join("/"),Q.endsWith("/index"))Q=Q.slice(0,-6)||"/";else if(Q==="index")Q="/";if(!Q.startsWith("/"))Q=`/${Q}`;let J=[],z=!1,Y=!1,U=Q.replaceAll(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(V,B,H)=>{if(B)return Y=!0,z=!0,J.push(B),"*";return z=!0,J.push(H),`:${H}`}),K=null;try{let B=(await _4(X,q)).$layout;if(typeof B==="string")K=B}catch{}return{$layout:K,isCatchAll:Y,isDynamic:z,params:J,relativePath:Z,sourcePath:X,urlPattern:U}}async function _7(Z,X,q=new Map,W){let Q=[];for(let J of Z){if(!J.isDynamic){Q.push(J);continue}let z;try{z=await _4(J.sourcePath,W)}catch{Q.push(J);continue}if(!z.$paths){console.warn(`Warning: dynamic route ${J.urlPattern} has no $paths — skipping`);continue}let Y=Fz(z.$paths,X,q);for(let U of Y){let K=J.urlPattern,V={};for(let[B,H]of Object.entries(U))V[B]=String(H),K=K.replace(`:${B}`,V[B]),K=K.replace("*",V[B]);Q.push({...J,_pathParams:V,isCatchAll:!1,isDynamic:!1,params:[],urlPattern:K})}}return Q}function Fz(Z,X,q){if(Array.isArray(Z))return Z;if("contentType"in Z&&Z.contentType){let W=q.get(Z.contentType);if(!W||W.length===0)return console.warn(`Warning: $paths references content type "${Z.contentType}" but it has no entries`),[];let Q=Z.param??"slug",J=Z.field??"id";return W.map((z)=>({[Q]:J==="id"?z.id:z.data[J]??z.id})).filter((z)=>z[Q])}if("values"in Z&&Array.isArray(Z.values)){let W=Z.param??"value";return Z.values.map((Q)=>({[W]:Q}))}if("$ref"in Z&&Z.$ref){let W=Hz(X,Z.$ref),Q;try{Q=JSON.parse(N7(W,"utf8"))}catch(Y){let U=Y;return console.warn(`Warning: $paths.$ref could not load "${Z.$ref}": ${U.message}`),[]}if(!Array.isArray(Q))return console.warn(`Warning: $paths.$ref "${Z.$ref}" must be a JSON array`),[];let J=Z.param??"id",z=Z.field??"id";return Q.map((Y)=>({[J]:Y[z]??Y.id??String(Y)}))}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var P7=R(()=>{e0()});import{existsSync as Az,readFileSync as Mz}from"node:fs";import{resolve as Lz}from"node:path";function n5(Z,X,q){let W=Z.$layout??X.defaults?.layout??null;if(!W)return Z;let Q=Lz(q,W);if(!Az(Q))throw Error(`Layout not found: ${W} (resolved to ${Q})`);let J;try{J=V6(Mz(Q,"utf8"),Q)}catch(K){throw Error(`Invalid layout JSON at ${Q}: ${K.message}`,{cause:K})}if(J.$layout)J=n5(J,X,q);let z=Z.children??[],Y=typeof z==="string"?[z]:Array.isArray(z)?z:[],U=wz(J);if(Iz(U,Y),Z.state)U.state={...U.state,...Z.state};if(Z.$media)U.$media={...U.$media,...Z.$media};if(Z.style)U.style={...U.style,...Z.style};if(Z.attributes)U.attributes={...U.attributes,...Z.attributes};if(Z.$head)U._pageHead=Z.$head;if(Z.title)U._pageTitle=Z.title;return delete U.$layout,U}function Iz(Z,X){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let q=new Map,W=[];for(let Q of X)if(Q&&typeof Q==="object"&&Q.attributes?.slot){let J=Q.attributes.slot;if(!q.has(J))q.set(J,[]);q.get(J).push(Q)}else W.push(Q);j7(Z,q,W)}function j7(Z,X,q){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let W=[];for(let Q of Z.children)if(Q&&typeof Q==="object"&&Q.tagName==="slot"){let J=Q.attributes?.name;if(J&&X.has(J))W.push(...X.get(J)),X.delete(J);else if(!J&&q.length>0)W.push(...q);else if(Array.isArray(Q.children))W.push(...Q.children)}else j7(Q,X,q),W.push(Q);Z.children=W}function wz(Z){return structuredClone(Z)}var E7=R(()=>{e0()});function C7(Z=[],X=[],q=[],W={}){let Q=[{attributes:{charset:W.charset??"utf8"},tagName:"meta"},{attributes:{content:"width=device-width, initial-scale=1",name:"viewport"},tagName:"meta"}],J=new Map;for(let Y of[...Q,...Z,...X,...q]){let U=Dz(Y);J.set(U,Y)}let z=W.title??W.siteName??"Jx Site";if(J.set("title",{children:[z],tagName:"title"}),W.pageUrl&&W.siteUrl){let Y=new URL(W.pageUrl,W.siteUrl).href;J.set("link:canonical",{attributes:{href:Y,rel:"canonical"},tagName:"link"})}return[...J.values()]}function Dz(Z){if(!Z||typeof Z!=="object")return String(Z);let X=Z.tagName??"unknown",q=Z.attributes??{};if(X==="title")return"title";if(q.charset)return"meta:charset";if(X==="meta"&&q.name)return`meta:${q.name}`;if(X==="meta"&&q.property)return`meta:${q.property}`;if(X==="link"&&q.rel)return`link:${q.rel}:${q.href??""}`;if(X==="script"&&q.src)return`script:${q.src}`;if(X==="style"){let W=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`style:${Nz(W)}`}return`${X}:${JSON.stringify(Z)}`}function Nz(Z){let X=0;for(let q=0;q<Z.length;q++)X=Math.trunc((X<<5)-X+(Z.codePointAt(q)??0));return X.toString(36)}function O7(Z){return Z.map((X)=>Tz(X)).join(`
200
+ `)}function Tz(Z){if(typeof Z==="string")return Z;if(!Z||typeof Z!=="object")return"";let X=Z.tagName,q=Z.attributes??{},W=Object.entries(q).map(([Y,U])=>U===!0?Y:`${Y}="${Rz(U)}"`).join(" "),Q=W?`<${X} ${W}>`:`<${X}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(X))return Q;let z=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`${Q}${z}</${X}>`}function Rz(Z){return String(Z).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}import{dirname as _z,relative as Pz,resolve as jz}from"node:path";function x7(Z,X,q,W=new Map,Q=null){if(!Z.state)Z.state={};if(Z.state.$site={name:X.name??"Jx Site",url:X.url??"",...X.state},Z.state.$page={params:q._pathParams??{},title:Z.title??Z._pageTitle??X.name??"",url:q.urlPattern},X.state){for(let[J,z]of Object.entries(X.state))if(J!=="$site"&&J!=="$page"&&!(J in Z.state))Z.state[J]=z}if(X.$media)Z.$media={...X.$media,...Z.$media};if(X.imports&&Object.keys(X.imports).length>0){if(!Z.imports)Z.imports={};for(let[J,z]of Object.entries(X.imports))if(!(J in Z.imports)){let Y=z;if(Q&&q.sourcePath&&(Y.startsWith("./")||Y.startsWith("../"))){let U=jz(Q,Y);Z.imports[J]=`./${Pz(_z(q.sourcePath),U)}`}else Z.imports[J]=Y}}if(X.$elements?.length)if(!Z.$elements?.length)Z.$elements=[...X.$elements];else{let J=new Set,z=[];for(let Y of[...X.$elements,...Z.$elements]){let U=typeof Y==="string"?Y:Y?.$ref;if(U&&!J.has(U))J.add(U),z.push(Y)}Z.$elements=z}return Z}var k7=()=>{};import{existsSync as Ez,readFileSync as Cz,readdirSync as Oz}from"node:fs";import{basename as S7,extname as b7,resolve as r5}from"node:path";function xz(Z){let X=JSON.parse(Cz(Z,"utf8"));if(Array.isArray(X))return X.map((W,Q)=>({body:null,data:W,id:W.id??`${S7(Z,".json")}-${Q}`}));let q=X;return[{body:null,data:q,id:q.id??S7(Z,".json")}]}function kz(Z){if(b7(Z))return Ez(Z)?[Z]:[];try{return Oz(Z,{recursive:!0}).filter((X)=>String(X).endsWith(".json")).map((X)=>r5(Z,String(X)))}catch{return[]}}function a5(Z,X){let q=r5(Z,"content");return{config:{contentTypes:X?.contentTypes??{}},contentDir:q}}async function v7(Z,X,q){let W=a5(Z,X);if(!W)return new Map;let{config:Q}=W,J=new Map;if(Object.keys(Q.contentTypes).length===0)return J;let z=q??await T4(Z,X);for(let[Y,U]of Object.entries(Q.contentTypes)){let K=await Sz(Y,U,Z,z);J.set(Y,K)}return J}async function Sz(Z,X,q,W){let{source:Q}=X;if(!Q)return[];let{schema:J}=X,z=X.$elements?.length?{allowedNames:X.$elements.filter(($)=>typeof $==="string"||typeof $==="object"&&$?.$ref).map(($)=>typeof $==="string"?$:$.$ref)}:void 0,Y=X.format,U;if(Y&&Y!=="json"){if(U=W.byName(Y),!U)throw Error(`Content type "${Z}": format "${Y}" is not an imported format class. Add it to project.json imports, e.g. "${Y}": "@jxsuite/parser/${Y}.class.json".`)}if(Q.startsWith("http://")||Q.startsWith("https://")){if(!U)throw Error(`Content type "${Z}": remote sources require an explicit "format" naming an imported format class with "remote": true (e.g. "Csv").`);if(!U.remote)throw Error(`Content type "${Z}": format "${U.name}" does not support remote sources (its format block lacks "remote": true).`);try{let $=await U.call("load",Q,{directiveOptions:z,schema:J});if(J)i5($,J,Z);return $}catch($){return console.warn(`Content type "${Z}": ${t0($)}`),[]}}let K=r5(q,Q).split("\\").join("/"),V=b7(Q).toLowerCase();if(Y==="json"||!U&&V===".json"){let $=kz(K),F=[];for(let L of $)F.push(...xz(L));if(J)i5(F,J,Z);return F}if(!U&&V)U=W.byExtension(V,"load");if(!U)throw m5(Q,V||`content type "${Z}" (directory sources need an explicit "format")`);let B=U.capabilities.discover?await U.call("discover",Q,{baseDir:q}):[K],H=[];for(let $ of B)H.push(...await U.call("load",$,{directiveOptions:z,schema:J}));if(J)i5(H,J,Z);return H}function i5(Z,X,q){let W=X.required??[],Q=X.properties??{};for(let J of Z){for(let z of W)if(!(z in J.data)||J.data[z]==null)console.warn(`Content validation: "${q}/${J.id}" missing required field "${z}"`);for(let[z,Y]of Object.entries(Q)){let U=J.data[z];if(U==null)continue;if(Y.type==="string"&&typeof U!=="string")console.warn(`Content validation: "${q}/${J.id}" field "${z}" expected string, got ${typeof U}`);else if(Y.type==="number"&&typeof U!=="number")console.warn(`Content validation: "${q}/${J.id}" field "${z}" expected number, got ${typeof U}`);else if(Y.type==="boolean"&&typeof U!=="boolean")console.warn(`Content validation: "${q}/${J.id}" field "${z}" expected boolean, got ${typeof U}`);else if(Y.type==="array"&&!Array.isArray(U))console.warn(`Content validation: "${q}/${J.id}" field "${z}" expected array, got ${typeof U}`)}}}function y7(Z,X){for(let[q,W]of Object.entries(X.contentTypes)){let{schema:Q}=W;if(!Q?.properties)continue;let J=Z.get(q);if(!J)continue;for(let[z,Y]of Object.entries(Q.properties)){if(!Y.$ref?.startsWith("#/contentTypes/"))continue;let U=Y.$ref.replace("#/contentTypes/",""),K=Z.get(U);if(!K)continue;for(let V of J){let B=V.data[z];if(typeof B==="string"){let H=K.find(($)=>$.id===B);if(H)V.data[z]=H}}}}}var g7=R(()=>{e0();s6()});import{readFileSync as bz}from"node:fs";import{dirname as s5,resolve as F1}from"node:path";import{createRequire as vz}from"node:module";async function h7(Z,X,q,W={}){let Q=Z.imports??{},{state:J}=Z;if(!J)return;for(let[z,Y]of Object.entries(J)){if(!I6(Y))continue;if(yz.has(Y.$prototype))continue;if(Y.timing&&Y.timing!=="compiler")continue;if(!Y.$src){let U=Q[Y.$prototype];if(!U)continue;Y.$src=U}try{let U=await hz(Y,X,q,J,W);if(Y.timing&&U&&typeof U==="object"&&!Array.isArray(U))U.timing=Y.timing;J[z]=U}catch(U){console.warn(`prototype-resolver: failed to resolve "${z}" ($prototype: "${Y.$prototype}"):`,t0(U))}}}async function hz(Z,X,q,W,Q){let J=Z.$src;if(!J)throw Error(`$prototype "${Z.$prototype}" has no $src to resolve`);let z;if(J.startsWith("./")||J.startsWith("../"))z=X.sourcePath?F1(s5(X.sourcePath),J):F1(q,J);else z=vz(F1(q,"package.json")).resolve(J);let Y=bz(z,"utf8"),U=o9(Y,z);if(!U.$implementation)throw Error(`${J} has no $implementation field`);let K=F1(s5(z),U.$implementation),V=await K1(K),B=Z.$export??U.title??Z.$prototype,H=V[B]??V.default?.[B];if(!H)throw Error(`Module ${U.$implementation} does not export "${B}"`);let $={};for(let[L,A]of Object.entries(Z))if(!gz.has(L))$[L]=A;if($.src&&!$.basePath&&X.sourcePath)$.basePath=s5(X.sourcePath);$._project={config:Q.config??null,contentTypes:Q.contentTypes??null,root:q},$._document={route:X,state:W};let F=new H($);if(typeof F.resolve==="function")return await F.resolve();return F}var yz,gz;var m7=R(()=>{s6();S0();e0();yz=new Set(["Function","LocalStorage","SessionStorage","Array"]),gz=new Set(["$prototype","$src","$export","timing","default","description"])});var f7=(Z)=>typeof Z<"u"&&Z!==null,mz=(Z)=>typeof Z==="object",fz=(Z)=>Object.prototype.toString.call(Z)==="[object Object]",uz=(Z)=>typeof Z==="function",dz=(Z)=>typeof Z==="boolean",cz=(Z)=>Z instanceof Buffer,lz=(Z)=>{if(f7(Z))switch(Z.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},pz=(Z)=>Z instanceof ArrayBuffer,nz=(Z)=>typeof Z==="string"&&Z.length>0,iz=(Z)=>typeof Z==="number"&&!Number.isNaN(Z),rz=(Z)=>Number.isInteger(Z),az=(Z,X,q)=>Z>=X&&Z<=q,sz=(Z,X)=>X.includes(Z),oz=(Z,X,q)=>Error(`Expected ${X} for ${Z} but received ${q} of type ${typeof q}`),tz=(Z,X)=>{return X.message=Z.message,X},G;var m0=R(()=>{/*!
289
201
  Copyright 2013 Lovell Fuller and others.
290
202
  SPDX-License-Identifier: Apache-2.0
291
- */var z2=(Z)=>typeof Z<"u"&&Z!==null,LQ=(Z)=>typeof Z==="object",IQ=(Z)=>Object.prototype.toString.call(Z)==="[object Object]",DQ=(Z)=>typeof Z==="function",wQ=(Z)=>typeof Z==="boolean",NQ=(Z)=>Z instanceof Buffer,TQ=(Z)=>{if(z2(Z))switch(Z.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},RQ=(Z)=>Z instanceof ArrayBuffer,PQ=(Z)=>typeof Z==="string"&&Z.length>0,jQ=(Z)=>typeof Z==="number"&&!Number.isNaN(Z),_Q=(Z)=>Number.isInteger(Z),CQ=(Z,J,X)=>Z>=J&&Z<=X,EQ=(Z,J)=>J.includes(Z),OQ=(Z,J,X)=>Error(`Expected ${J} for ${Z} but received ${X} of type ${typeof X}`),xQ=(Z,J)=>{return J.message=Z.message,J};U2.exports={defined:z2,object:LQ,plainObject:IQ,fn:DQ,bool:wQ,buffer:NQ,typedArray:TQ,arrayBuffer:RQ,string:PQ,number:jQ,integer:_Q,inRange:CQ,inArray:EQ,invalidParameterError:OQ,nativeError:xQ}});var B2=b((oB,V2)=>{var K2=()=>process.platform==="linux",J6=null,kQ=()=>{if(!J6)if(K2()&&process.report){let Z=process.report.excludeNetwork;process.report.excludeNetwork=!0,J6=process.report.getReport(),process.report.excludeNetwork=Z}else J6={};return J6};V2.exports={isLinux:K2,getReport:kQ}});var $2=b((tB,H2)=>{var f4=m("fs"),SQ=(Z)=>{let J=f4.openSync(Z,"r"),X=Buffer.alloc(2048),q=f4.readSync(J,X,0,2048,0);return f4.close(J,()=>{}),X.subarray(0,q)},bQ=(Z)=>new Promise((J,X)=>{f4.open(Z,"r",(q,W)=>{if(q)X(q);else{let Q=Buffer.alloc(2048);f4.read(W,Q,0,2048,0,(G,z)=>{J(Q.subarray(0,z)),f4.close(W,()=>{})})}})});H2.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:SQ,readFile:bQ}});var M2=b((eB,F2)=>{var vQ=(Z)=>{if(Z.length<64)return null;if(Z.readUInt32BE(0)!==2135247942)return null;if(Z.readUInt8(4)!==2)return null;if(Z.readUInt8(5)!==1)return null;let J=Z.readUInt32LE(32),X=Z.readUInt16LE(54),q=Z.readUInt16LE(56);for(let W=0;W<q;W++){let Q=J+W*X;if(Z.readUInt32LE(Q)===3){let z=Z.readUInt32LE(Q+8),Y=Z.readUInt32LE(Q+32);return Z.subarray(z,z+Y).toString().replace(/\0.*$/g,"")}}return null};F2.exports={interpreterPath:vQ}});var q6=b((ZH,S2)=>{var L2=m("child_process"),{isLinux:u4,getReport:I2}=B2(),{LDD_PATH:X6,SELF_PATH:D2,readFile:k5,readFileSync:S5}=$2(),{interpreterPath:w2}=M2(),y0,g0,h0,X4="",N2=()=>{if(!X4)return new Promise((Z)=>{L2.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(J,X)=>{X4=J?" ":X,Z(X4)})});return X4},T2=()=>{if(!X4)try{X4=L2.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(Z){X4=" "}return X4},r0="glibc",R2=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,M4="musl",yQ=(Z)=>Z.includes("libc.musl-")||Z.includes("ld-musl-"),P2=()=>{let Z=I2();if(Z.header&&Z.header.glibcVersionRuntime)return r0;if(Array.isArray(Z.sharedObjects)){if(Z.sharedObjects.some(yQ))return M4}return null},j2=(Z)=>{let[J,X]=Z.split(/[\r\n]+/);if(J&&J.includes(r0))return r0;if(X&&X.includes(M4))return M4;return null},_2=(Z)=>{if(Z){if(Z.includes("/ld-musl-"))return M4;else if(Z.includes("/ld-linux-"))return r0}return null},C2=(Z)=>{if(Z=Z.toString(),Z.includes("musl"))return M4;if(Z.includes("GNU C Library"))return r0;return null},gQ=async()=>{if(g0!==void 0)return g0;g0=null;try{let Z=await k5(X6);g0=C2(Z)}catch(Z){}return g0},hQ=()=>{if(g0!==void 0)return g0;g0=null;try{let Z=S5(X6);g0=C2(Z)}catch(Z){}return g0},mQ=async()=>{if(y0!==void 0)return y0;y0=null;try{let Z=await k5(D2),J=w2(Z);y0=_2(J)}catch(Z){}return y0},fQ=()=>{if(y0!==void 0)return y0;y0=null;try{let Z=S5(D2),J=w2(Z);y0=_2(J)}catch(Z){}return y0},E2=async()=>{let Z=null;if(u4()){if(Z=await mQ(),!Z){if(Z=await gQ(),!Z)Z=P2();if(!Z){let J=await N2();Z=j2(J)}}}return Z},O2=()=>{let Z=null;if(u4()){if(Z=fQ(),!Z){if(Z=hQ(),!Z)Z=P2();if(!Z){let J=T2();Z=j2(J)}}}return Z},uQ=async()=>u4()&&await E2()!==r0,dQ=()=>u4()&&O2()!==r0,cQ=async()=>{if(h0!==void 0)return h0;h0=null;try{let J=(await k5(X6)).match(R2);if(J)h0=J[1]}catch(Z){}return h0},lQ=()=>{if(h0!==void 0)return h0;h0=null;try{let J=S5(X6).match(R2);if(J)h0=J[1]}catch(Z){}return h0},x2=()=>{let Z=I2();if(Z.header&&Z.header.glibcVersionRuntime)return Z.header.glibcVersionRuntime;return null},A2=(Z)=>Z.trim().split(/\s+/)[1],k2=(Z)=>{let[J,X,q]=Z.split(/[\r\n]+/);if(J&&J.includes(r0))return A2(J);if(X&&q&&X.includes(M4))return A2(q);return null},pQ=async()=>{let Z=null;if(u4()){if(Z=await cQ(),!Z)Z=x2();if(!Z){let J=await N2();Z=k2(J)}}return Z},nQ=()=>{let Z=null;if(u4()){if(Z=lQ(),!Z)Z=x2();if(!Z){let J=T2();Z=k2(J)}}return Z};S2.exports={GLIBC:r0,MUSL:M4,family:E2,familySync:O2,isNonGlibcLinux:uQ,isNonGlibcLinuxSync:dQ,version:pQ,versionSync:nQ}});var M1=b((JH,b2)=>{var rQ=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...Z)=>console.error("SEMVER",...Z):()=>{};b2.exports=rQ});var W6=b((XH,v2)=>{var iQ=Number.MAX_SAFE_INTEGER||9007199254740991,aQ=["major","premajor","minor","preminor","patch","prepatch","prerelease"];v2.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:iQ,RELEASE_TYPES:aQ,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var A1=b((m0,y2)=>{var{MAX_SAFE_COMPONENT_LENGTH:b5,MAX_SAFE_BUILD_LENGTH:sQ,MAX_LENGTH:oQ}=W6(),tQ=M1();m0=y2.exports={};var eQ=m0.re=[],ZG=m0.safeRe=[],R=m0.src=[],JG=m0.safeSrc=[],P=m0.t={},XG=0,v5="[a-zA-Z0-9-]",qG=[["\\s",1],["\\d",oQ],[v5,sQ]],WG=(Z)=>{for(let[J,X]of qG)Z=Z.split(`${J}*`).join(`${J}{0,${X}}`).split(`${J}+`).join(`${J}{1,${X}}`);return Z},x=(Z,J,X)=>{let q=WG(J),W=XG++;tQ(Z,W,J),P[Z]=W,R[W]=J,JG[W]=q,eQ[W]=new RegExp(J,X?"g":void 0),ZG[W]=new RegExp(q,X?"g":void 0)};x("NUMERICIDENTIFIER","0|[1-9]\\d*");x("NUMERICIDENTIFIERLOOSE","\\d+");x("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${v5}*`);x("MAINVERSION",`(${R[P.NUMERICIDENTIFIER]})\\.(${R[P.NUMERICIDENTIFIER]})\\.(${R[P.NUMERICIDENTIFIER]})`);x("MAINVERSIONLOOSE",`(${R[P.NUMERICIDENTIFIERLOOSE]})\\.(${R[P.NUMERICIDENTIFIERLOOSE]})\\.(${R[P.NUMERICIDENTIFIERLOOSE]})`);x("PRERELEASEIDENTIFIER",`(?:${R[P.NONNUMERICIDENTIFIER]}|${R[P.NUMERICIDENTIFIER]})`);x("PRERELEASEIDENTIFIERLOOSE",`(?:${R[P.NONNUMERICIDENTIFIER]}|${R[P.NUMERICIDENTIFIERLOOSE]})`);x("PRERELEASE",`(?:-(${R[P.PRERELEASEIDENTIFIER]}(?:\\.${R[P.PRERELEASEIDENTIFIER]})*))`);x("PRERELEASELOOSE",`(?:-?(${R[P.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${R[P.PRERELEASEIDENTIFIERLOOSE]})*))`);x("BUILDIDENTIFIER",`${v5}+`);x("BUILD",`(?:\\+(${R[P.BUILDIDENTIFIER]}(?:\\.${R[P.BUILDIDENTIFIER]})*))`);x("FULLPLAIN",`v?${R[P.MAINVERSION]}${R[P.PRERELEASE]}?${R[P.BUILD]}?`);x("FULL",`^${R[P.FULLPLAIN]}$`);x("LOOSEPLAIN",`[v=\\s]*${R[P.MAINVERSIONLOOSE]}${R[P.PRERELEASELOOSE]}?${R[P.BUILD]}?`);x("LOOSE",`^${R[P.LOOSEPLAIN]}$`);x("GTLT","((?:<|>)?=?)");x("XRANGEIDENTIFIERLOOSE",`${R[P.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);x("XRANGEIDENTIFIER",`${R[P.NUMERICIDENTIFIER]}|x|X|\\*`);x("XRANGEPLAIN",`[v=\\s]*(${R[P.XRANGEIDENTIFIER]})(?:\\.(${R[P.XRANGEIDENTIFIER]})(?:\\.(${R[P.XRANGEIDENTIFIER]})(?:${R[P.PRERELEASE]})?${R[P.BUILD]}?)?)?`);x("XRANGEPLAINLOOSE",`[v=\\s]*(${R[P.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[P.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[P.XRANGEIDENTIFIERLOOSE]})(?:${R[P.PRERELEASELOOSE]})?${R[P.BUILD]}?)?)?`);x("XRANGE",`^${R[P.GTLT]}\\s*${R[P.XRANGEPLAIN]}$`);x("XRANGELOOSE",`^${R[P.GTLT]}\\s*${R[P.XRANGEPLAINLOOSE]}$`);x("COERCEPLAIN",`(^|[^\\d])(\\d{1,${b5}})(?:\\.(\\d{1,${b5}}))?(?:\\.(\\d{1,${b5}}))?`);x("COERCE",`${R[P.COERCEPLAIN]}(?:$|[^\\d])`);x("COERCEFULL",R[P.COERCEPLAIN]+`(?:${R[P.PRERELEASE]})?(?:${R[P.BUILD]})?(?:$|[^\\d])`);x("COERCERTL",R[P.COERCE],!0);x("COERCERTLFULL",R[P.COERCEFULL],!0);x("LONETILDE","(?:~>?)");x("TILDETRIM",`(\\s*)${R[P.LONETILDE]}\\s+`,!0);m0.tildeTrimReplace="$1~";x("TILDE",`^${R[P.LONETILDE]}${R[P.XRANGEPLAIN]}$`);x("TILDELOOSE",`^${R[P.LONETILDE]}${R[P.XRANGEPLAINLOOSE]}$`);x("LONECARET","(?:\\^)");x("CARETTRIM",`(\\s*)${R[P.LONECARET]}\\s+`,!0);m0.caretTrimReplace="$1^";x("CARET",`^${R[P.LONECARET]}${R[P.XRANGEPLAIN]}$`);x("CARETLOOSE",`^${R[P.LONECARET]}${R[P.XRANGEPLAINLOOSE]}$`);x("COMPARATORLOOSE",`^${R[P.GTLT]}\\s*(${R[P.LOOSEPLAIN]})$|^$`);x("COMPARATOR",`^${R[P.GTLT]}\\s*(${R[P.FULLPLAIN]})$|^$`);x("COMPARATORTRIM",`(\\s*)${R[P.GTLT]}\\s*(${R[P.LOOSEPLAIN]}|${R[P.XRANGEPLAIN]})`,!0);m0.comparatorTrimReplace="$1$2$3";x("HYPHENRANGE",`^\\s*(${R[P.XRANGEPLAIN]})\\s+-\\s+(${R[P.XRANGEPLAIN]})\\s*$`);x("HYPHENRANGELOOSE",`^\\s*(${R[P.XRANGEPLAINLOOSE]})\\s+-\\s+(${R[P.XRANGEPLAINLOOSE]})\\s*$`);x("STAR","(<|>)?=?\\s*\\*");x("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");x("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Q6=b((qH,g2)=>{var QG=Object.freeze({loose:!0}),GG=Object.freeze({}),YG=(Z)=>{if(!Z)return GG;if(typeof Z!=="object")return QG;return Z};g2.exports=YG});var u2=b((WH,f2)=>{var h2=/^[0-9]+$/,m2=(Z,J)=>{if(typeof Z==="number"&&typeof J==="number")return Z===J?0:Z<J?-1:1;let X=h2.test(Z),q=h2.test(J);if(X&&q)Z=+Z,J=+J;return Z===J?0:X&&!q?-1:q&&!X?1:Z<J?-1:1},zG=(Z,J)=>m2(J,Z);f2.exports={compareIdentifiers:m2,rcompareIdentifiers:zG}});var d4=b((QH,c2)=>{var G6=M1(),{MAX_LENGTH:d2,MAX_SAFE_INTEGER:Y6}=W6(),{safeRe:z6,t:U6}=A1(),UG=Q6(),{compareIdentifiers:y5}=u2();class E0{constructor(Z,J){if(J=UG(J),Z instanceof E0)if(Z.loose===!!J.loose&&Z.includePrerelease===!!J.includePrerelease)return Z;else Z=Z.version;else if(typeof Z!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof Z}".`);if(Z.length>d2)throw TypeError(`version is longer than ${d2} characters`);G6("SemVer",Z,J),this.options=J,this.loose=!!J.loose,this.includePrerelease=!!J.includePrerelease;let X=Z.trim().match(J.loose?z6[U6.LOOSE]:z6[U6.FULL]);if(!X)throw TypeError(`Invalid Version: ${Z}`);if(this.raw=Z,this.major=+X[1],this.minor=+X[2],this.patch=+X[3],this.major>Y6||this.major<0)throw TypeError("Invalid major version");if(this.minor>Y6||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Y6||this.patch<0)throw TypeError("Invalid patch version");if(!X[4])this.prerelease=[];else this.prerelease=X[4].split(".").map((q)=>{if(/^[0-9]+$/.test(q)){let W=+q;if(W>=0&&W<Y6)return W}return q});this.build=X[5]?X[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(Z){if(G6("SemVer.compare",this.version,this.options,Z),!(Z instanceof E0)){if(typeof Z==="string"&&Z===this.version)return 0;Z=new E0(Z,this.options)}if(Z.version===this.version)return 0;return this.compareMain(Z)||this.comparePre(Z)}compareMain(Z){if(!(Z instanceof E0))Z=new E0(Z,this.options);if(this.major<Z.major)return-1;if(this.major>Z.major)return 1;if(this.minor<Z.minor)return-1;if(this.minor>Z.minor)return 1;if(this.patch<Z.patch)return-1;if(this.patch>Z.patch)return 1;return 0}comparePre(Z){if(!(Z instanceof E0))Z=new E0(Z,this.options);if(this.prerelease.length&&!Z.prerelease.length)return-1;else if(!this.prerelease.length&&Z.prerelease.length)return 1;else if(!this.prerelease.length&&!Z.prerelease.length)return 0;let J=0;do{let X=this.prerelease[J],q=Z.prerelease[J];if(G6("prerelease compare",J,X,q),X===void 0&&q===void 0)return 0;else if(q===void 0)return 1;else if(X===void 0)return-1;else if(X===q)continue;else return y5(X,q)}while(++J)}compareBuild(Z){if(!(Z instanceof E0))Z=new E0(Z,this.options);let J=0;do{let X=this.build[J],q=Z.build[J];if(G6("build compare",J,X,q),X===void 0&&q===void 0)return 0;else if(q===void 0)return 1;else if(X===void 0)return-1;else if(X===q)continue;else return y5(X,q)}while(++J)}inc(Z,J,X){if(Z.startsWith("pre")){if(!J&&X===!1)throw Error("invalid increment argument: identifier is empty");if(J){let q=`-${J}`.match(this.options.loose?z6[U6.PRERELEASELOOSE]:z6[U6.PRERELEASE]);if(!q||q[1]!==J)throw Error(`invalid identifier: ${J}`)}}switch(Z){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",J,X);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",J,X);break;case"prepatch":this.prerelease.length=0,this.inc("patch",J,X),this.inc("pre",J,X);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",J,X);this.inc("pre",J,X);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let q=Number(X)?1:0;if(this.prerelease.length===0)this.prerelease=[q];else{let W=this.prerelease.length;while(--W>=0)if(typeof this.prerelease[W]==="number")this.prerelease[W]++,W=-2;if(W===-1){if(J===this.prerelease.join(".")&&X===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(q)}}if(J){let W=[J,q];if(X===!1)W=[J];if(y5(this.prerelease[0],J)===0){if(isNaN(this.prerelease[1]))this.prerelease=W}else this.prerelease=W}break}default:throw Error(`invalid increment argument: ${Z}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}c2.exports=E0});var n2=b((GH,p2)=>{var l2=d4(),KG=(Z,J,X=!1)=>{if(Z instanceof l2)return Z;try{return new l2(Z,J)}catch(q){if(!X)return null;throw q}};p2.exports=KG});var i2=b((YH,r2)=>{var VG=d4(),BG=n2(),{safeRe:K6,t:V6}=A1(),HG=(Z,J)=>{if(Z instanceof VG)return Z;if(typeof Z==="number")Z=String(Z);if(typeof Z!=="string")return null;J=J||{};let X=null;if(!J.rtl)X=Z.match(J.includePrerelease?K6[V6.COERCEFULL]:K6[V6.COERCE]);else{let Y=J.includePrerelease?K6[V6.COERCERTLFULL]:K6[V6.COERCERTL],U;while((U=Y.exec(Z))&&(!X||X.index+X[0].length!==Z.length)){if(!X||U.index+U[0].length!==X.index+X[0].length)X=U;Y.lastIndex=U.index+U[1].length+U[2].length}Y.lastIndex=-1}if(X===null)return null;let q=X[2],W=X[3]||"0",Q=X[4]||"0",G=J.includePrerelease&&X[5]?`-${X[5]}`:"",z=J.includePrerelease&&X[6]?`+${X[6]}`:"";return BG(`${q}.${W}.${Q}${G}${z}`,J)};r2.exports=HG});var A4=b((zH,s2)=>{var a2=d4(),$G=(Z,J,X)=>new a2(Z,X).compare(new a2(J,X));s2.exports=$G});var g5=b((UH,o2)=>{var FG=A4(),MG=(Z,J,X)=>FG(Z,J,X)>=0;o2.exports=MG});var Z8=b((KH,e2)=>{class t2{constructor(){this.max=1000,this.map=new Map}get(Z){let J=this.map.get(Z);if(J===void 0)return;else return this.map.delete(Z),this.map.set(Z,J),J}delete(Z){return this.map.delete(Z)}set(Z,J){if(!this.delete(Z)&&J!==void 0){if(this.map.size>=this.max){let q=this.map.keys().next().value;this.delete(q)}this.map.set(Z,J)}return this}}e2.exports=t2});var X8=b((VH,J8)=>{var AG=A4(),LG=(Z,J,X)=>AG(Z,J,X)===0;J8.exports=LG});var W8=b((BH,q8)=>{var IG=A4(),DG=(Z,J,X)=>IG(Z,J,X)!==0;q8.exports=DG});var G8=b((HH,Q8)=>{var wG=A4(),NG=(Z,J,X)=>wG(Z,J,X)>0;Q8.exports=NG});var z8=b(($H,Y8)=>{var TG=A4(),RG=(Z,J,X)=>TG(Z,J,X)<0;Y8.exports=RG});var K8=b((FH,U8)=>{var PG=A4(),jG=(Z,J,X)=>PG(Z,J,X)<=0;U8.exports=jG});var B8=b((MH,V8)=>{var _G=X8(),CG=W8(),EG=G8(),OG=g5(),xG=z8(),kG=K8(),SG=(Z,J,X,q)=>{switch(J){case"===":if(typeof Z==="object")Z=Z.version;if(typeof X==="object")X=X.version;return Z===X;case"!==":if(typeof Z==="object")Z=Z.version;if(typeof X==="object")X=X.version;return Z!==X;case"":case"=":case"==":return _G(Z,X,q);case"!=":return CG(Z,X,q);case">":return EG(Z,X,q);case">=":return OG(Z,X,q);case"<":return xG(Z,X,q);case"<=":return kG(Z,X,q);default:throw TypeError(`Invalid operator: ${J}`)}};V8.exports=SG});var I8=b((AH,L8)=>{var L1=Symbol("SemVer ANY");class B6{static get ANY(){return L1}constructor(Z,J){if(J=H8(J),Z instanceof B6)if(Z.loose===!!J.loose)return Z;else Z=Z.value;if(Z=Z.trim().split(/\s+/).join(" "),m5("comparator",Z,J),this.options=J,this.loose=!!J.loose,this.parse(Z),this.semver===L1)this.value="";else this.value=this.operator+this.semver.version;m5("comp",this)}parse(Z){let J=this.options.loose?$8[F8.COMPARATORLOOSE]:$8[F8.COMPARATOR],X=Z.match(J);if(!X)throw TypeError(`Invalid comparator: ${Z}`);if(this.operator=X[1]!==void 0?X[1]:"",this.operator==="=")this.operator="";if(!X[2])this.semver=L1;else this.semver=new M8(X[2],this.options.loose)}toString(){return this.value}test(Z){if(m5("Comparator.test",Z,this.options.loose),this.semver===L1||Z===L1)return!0;if(typeof Z==="string")try{Z=new M8(Z,this.options)}catch(J){return!1}return h5(Z,this.operator,this.semver,this.options)}intersects(Z,J){if(!(Z instanceof B6))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new A8(Z.value,J).test(this.value)}else if(Z.operator===""){if(Z.value==="")return!0;return new A8(this.value,J).test(Z.semver)}if(J=H8(J),J.includePrerelease&&(this.value==="<0.0.0-0"||Z.value==="<0.0.0-0"))return!1;if(!J.includePrerelease&&(this.value.startsWith("<0.0.0")||Z.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&Z.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&Z.operator.startsWith("<"))return!0;if(this.semver.version===Z.semver.version&&this.operator.includes("=")&&Z.operator.includes("="))return!0;if(h5(this.semver,"<",Z.semver,J)&&this.operator.startsWith(">")&&Z.operator.startsWith("<"))return!0;if(h5(this.semver,">",Z.semver,J)&&this.operator.startsWith("<")&&Z.operator.startsWith(">"))return!0;return!1}}L8.exports=B6;var H8=Q6(),{safeRe:$8,t:F8}=A1(),h5=B8(),m5=M1(),M8=d4(),A8=f5()});var f5=b((LH,T8)=>{var bG=/\s+/g;class I1{constructor(Z,J){if(J=yG(J),Z instanceof I1)if(Z.loose===!!J.loose&&Z.includePrerelease===!!J.includePrerelease)return Z;else return new I1(Z.raw,J);if(Z instanceof u5)return this.raw=Z.value,this.set=[[Z]],this.formatted=void 0,this;if(this.options=J,this.loose=!!J.loose,this.includePrerelease=!!J.includePrerelease,this.raw=Z.trim().replace(bG," "),this.set=this.raw.split("||").map((X)=>this.parseRange(X.trim())).filter((X)=>X.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let X=this.set[0];if(this.set=this.set.filter((q)=>!w8(q[0])),this.set.length===0)this.set=[X];else if(this.set.length>1){for(let q of this.set)if(q.length===1&&cG(q[0])){this.set=[q];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let Z=0;Z<this.set.length;Z++){if(Z>0)this.formatted+="||";let J=this.set[Z];for(let X=0;X<J.length;X++){if(X>0)this.formatted+=" ";this.formatted+=J[X].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(Z){let X=((this.options.includePrerelease&&uG)|(this.options.loose&&dG))+":"+Z,q=D8.get(X);if(q)return q;let W=this.options.loose,Q=W?U0[Q0.HYPHENRANGELOOSE]:U0[Q0.HYPHENRANGE];Z=Z.replace(Q,eG(this.options.includePrerelease)),p("hyphen replace",Z),Z=Z.replace(U0[Q0.COMPARATORTRIM],hG),p("comparator trim",Z),Z=Z.replace(U0[Q0.TILDETRIM],mG),p("tilde trim",Z),Z=Z.replace(U0[Q0.CARETTRIM],fG),p("caret trim",Z);let G=Z.split(" ").map((K)=>lG(K,this.options)).join(" ").split(/\s+/).map((K)=>tG(K,this.options));if(W)G=G.filter((K)=>{return p("loose invalid filter",K,this.options),!!K.match(U0[Q0.COMPARATORLOOSE])});p("range list",G);let z=new Map,Y=G.map((K)=>new u5(K,this.options));for(let K of Y){if(w8(K))return[K];z.set(K.value,K)}if(z.size>1&&z.has(""))z.delete("");let U=[...z.values()];return D8.set(X,U),U}intersects(Z,J){if(!(Z instanceof I1))throw TypeError("a Range is required");return this.set.some((X)=>{return N8(X,J)&&Z.set.some((q)=>{return N8(q,J)&&X.every((W)=>{return q.every((Q)=>{return W.intersects(Q,J)})})})})}test(Z){if(!Z)return!1;if(typeof Z==="string")try{Z=new gG(Z,this.options)}catch(J){return!1}for(let J=0;J<this.set.length;J++)if(ZY(this.set[J],Z,this.options))return!0;return!1}}T8.exports=I1;var vG=Z8(),D8=new vG,yG=Q6(),u5=I8(),p=M1(),gG=d4(),{safeRe:U0,t:Q0,comparatorTrimReplace:hG,tildeTrimReplace:mG,caretTrimReplace:fG}=A1(),{FLAG_INCLUDE_PRERELEASE:uG,FLAG_LOOSE:dG}=W6(),w8=(Z)=>Z.value==="<0.0.0-0",cG=(Z)=>Z.value==="",N8=(Z,J)=>{let X=!0,q=Z.slice(),W=q.pop();while(X&&q.length)X=q.every((Q)=>{return W.intersects(Q,J)}),W=q.pop();return X},lG=(Z,J)=>{return Z=Z.replace(U0[Q0.BUILD],""),p("comp",Z,J),Z=rG(Z,J),p("caret",Z),Z=pG(Z,J),p("tildes",Z),Z=aG(Z,J),p("xrange",Z),Z=oG(Z,J),p("stars",Z),Z},K0=(Z)=>!Z||Z.toLowerCase()==="x"||Z==="*",pG=(Z,J)=>{return Z.trim().split(/\s+/).map((X)=>nG(X,J)).join(" ")},nG=(Z,J)=>{let X=J.loose?U0[Q0.TILDELOOSE]:U0[Q0.TILDE];return Z.replace(X,(q,W,Q,G,z)=>{p("tilde",Z,q,W,Q,G,z);let Y;if(K0(W))Y="";else if(K0(Q))Y=`>=${W}.0.0 <${+W+1}.0.0-0`;else if(K0(G))Y=`>=${W}.${Q}.0 <${W}.${+Q+1}.0-0`;else if(z)p("replaceTilde pr",z),Y=`>=${W}.${Q}.${G}-${z} <${W}.${+Q+1}.0-0`;else Y=`>=${W}.${Q}.${G} <${W}.${+Q+1}.0-0`;return p("tilde return",Y),Y})},rG=(Z,J)=>{return Z.trim().split(/\s+/).map((X)=>iG(X,J)).join(" ")},iG=(Z,J)=>{p("caret",Z,J);let X=J.loose?U0[Q0.CARETLOOSE]:U0[Q0.CARET],q=J.includePrerelease?"-0":"";return Z.replace(X,(W,Q,G,z,Y)=>{p("caret",Z,W,Q,G,z,Y);let U;if(K0(Q))U="";else if(K0(G))U=`>=${Q}.0.0${q} <${+Q+1}.0.0-0`;else if(K0(z))if(Q==="0")U=`>=${Q}.${G}.0${q} <${Q}.${+G+1}.0-0`;else U=`>=${Q}.${G}.0${q} <${+Q+1}.0.0-0`;else if(Y)if(p("replaceCaret pr",Y),Q==="0")if(G==="0")U=`>=${Q}.${G}.${z}-${Y} <${Q}.${G}.${+z+1}-0`;else U=`>=${Q}.${G}.${z}-${Y} <${Q}.${+G+1}.0-0`;else U=`>=${Q}.${G}.${z}-${Y} <${+Q+1}.0.0-0`;else if(p("no pr"),Q==="0")if(G==="0")U=`>=${Q}.${G}.${z}${q} <${Q}.${G}.${+z+1}-0`;else U=`>=${Q}.${G}.${z}${q} <${Q}.${+G+1}.0-0`;else U=`>=${Q}.${G}.${z} <${+Q+1}.0.0-0`;return p("caret return",U),U})},aG=(Z,J)=>{return p("replaceXRanges",Z,J),Z.split(/\s+/).map((X)=>sG(X,J)).join(" ")},sG=(Z,J)=>{Z=Z.trim();let X=J.loose?U0[Q0.XRANGELOOSE]:U0[Q0.XRANGE];return Z.replace(X,(q,W,Q,G,z,Y)=>{p("xRange",Z,q,W,Q,G,z,Y);let U=K0(Q),K=U||K0(G),V=K||K0(z),H=V;if(W==="="&&H)W="";if(Y=J.includePrerelease?"-0":"",U)if(W===">"||W==="<")q="<0.0.0-0";else q="*";else if(W&&H){if(K)G=0;if(z=0,W===">")if(W=">=",K)Q=+Q+1,G=0,z=0;else G=+G+1,z=0;else if(W==="<=")if(W="<",K)Q=+Q+1;else G=+G+1;if(W==="<")Y="-0";q=`${W+Q}.${G}.${z}${Y}`}else if(K)q=`>=${Q}.0.0${Y} <${+Q+1}.0.0-0`;else if(V)q=`>=${Q}.${G}.0${Y} <${Q}.${+G+1}.0-0`;return p("xRange return",q),q})},oG=(Z,J)=>{return p("replaceStars",Z,J),Z.trim().replace(U0[Q0.STAR],"")},tG=(Z,J)=>{return p("replaceGTE0",Z,J),Z.trim().replace(U0[J.includePrerelease?Q0.GTE0PRE:Q0.GTE0],"")},eG=(Z)=>(J,X,q,W,Q,G,z,Y,U,K,V,H)=>{if(K0(q))X="";else if(K0(W))X=`>=${q}.0.0${Z?"-0":""}`;else if(K0(Q))X=`>=${q}.${W}.0${Z?"-0":""}`;else if(G)X=`>=${X}`;else X=`>=${X}${Z?"-0":""}`;if(K0(U))Y="";else if(K0(K))Y=`<${+U+1}.0.0-0`;else if(K0(V))Y=`<${U}.${+K+1}.0-0`;else if(H)Y=`<=${U}.${K}.${V}-${H}`;else if(Z)Y=`<${U}.${K}.${+V+1}-0`;else Y=`<=${Y}`;return`${X} ${Y}`.trim()},ZY=(Z,J,X)=>{for(let q=0;q<Z.length;q++)if(!Z[q].test(J))return!1;if(J.prerelease.length&&!X.includePrerelease){for(let q=0;q<Z.length;q++){if(p(Z[q].semver),Z[q].semver===u5.ANY)continue;if(Z[q].semver.prerelease.length>0){let W=Z[q].semver;if(W.major===J.major&&W.minor===J.minor&&W.patch===J.patch)return!0}}return!1}return!0}});var P8=b((IH,R8)=>{var JY=f5(),XY=(Z,J,X)=>{try{J=new JY(J,X)}catch(q){return!1}return J.test(Z)};R8.exports=XY});var d5=b((DH,qY)=>{qY.exports={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.34.5",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix Bünemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","Jérémy Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kotěšovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouciño <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugué <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>"],scripts:{build:"node install/build.js",install:"node install/check.js || npm run build",clean:"rm -rf src/build/ .nyc_output/ coverage/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-types":"tsd --files ./test/types/sharp.test-d.ts","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",main:"lib/index.js",types:"lib/index.d.ts",files:["install","lib","src/*.{cc,h,gyp}"],repository:{type:"git",url:"git://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.0.0","detect-libc":"^2.1.2",semver:"^7.7.3"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.34.5","@img/sharp-darwin-x64":"0.34.5","@img/sharp-libvips-darwin-arm64":"1.2.4","@img/sharp-libvips-darwin-x64":"1.2.4","@img/sharp-libvips-linux-arm":"1.2.4","@img/sharp-libvips-linux-arm64":"1.2.4","@img/sharp-libvips-linux-ppc64":"1.2.4","@img/sharp-libvips-linux-riscv64":"1.2.4","@img/sharp-libvips-linux-s390x":"1.2.4","@img/sharp-libvips-linux-x64":"1.2.4","@img/sharp-libvips-linuxmusl-arm64":"1.2.4","@img/sharp-libvips-linuxmusl-x64":"1.2.4","@img/sharp-linux-arm":"0.34.5","@img/sharp-linux-arm64":"0.34.5","@img/sharp-linux-ppc64":"0.34.5","@img/sharp-linux-riscv64":"0.34.5","@img/sharp-linux-s390x":"0.34.5","@img/sharp-linux-x64":"0.34.5","@img/sharp-linuxmusl-arm64":"0.34.5","@img/sharp-linuxmusl-x64":"0.34.5","@img/sharp-wasm32":"0.34.5","@img/sharp-win32-arm64":"0.34.5","@img/sharp-win32-ia32":"0.34.5","@img/sharp-win32-x64":"0.34.5"},devDependencies:{"@biomejs/biome":"^2.3.4","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.7.0","@img/sharp-libvips-dev":"1.2.4","@img/sharp-libvips-dev-wasm32":"1.2.4","@img/sharp-libvips-win32-arm64":"1.2.4","@img/sharp-libvips-win32-ia32":"1.2.4","@img/sharp-libvips-win32-x64":"1.2.4","@types/node":"*",emnapi:"^1.7.0","exif-reader":"^2.0.2","extract-zip":"^2.0.1",icc:"^3.0.0","jsdoc-to-markdown":"^9.1.3","node-addon-api":"^8.5.0","node-gyp":"^11.5.0","tar-fs":"^3.1.1",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:"^18.17.0 || ^20.3.0 || >=21.0.0"},config:{libvips:">=8.17.3"},funding:{url:"https://opencollective.com/libvips"}}});var l5=b((wH,v8)=>{/*!
203
+ */G={defined:f7,object:mz,plainObject:fz,fn:uz,bool:dz,buffer:cz,typedArray:lz,arrayBuffer:pz,string:nz,number:iz,integer:rz,inRange:az,inArray:sz,invalidParameterError:oz,nativeError:tz}});var c7=E((PA,d7)=>{var u7=()=>process.platform==="linux",A1=null,ez=()=>{if(!A1)if(u7()&&process.report){let Z=process.report.excludeNetwork;process.report.excludeNetwork=!0,A1=process.report.getReport(),process.report.excludeNetwork=Z}else A1={};return A1};d7.exports={isLinux:u7,getReport:ez}});var p7=E((jA,l7)=>{var t6=q0("fs"),ZG=(Z)=>{let X=t6.openSync(Z,"r"),q=Buffer.alloc(2048),W=t6.readSync(X,q,0,2048,0);return t6.close(X,()=>{}),q.subarray(0,W)},XG=(Z)=>new Promise((X,q)=>{t6.open(Z,"r",(W,Q)=>{if(W)q(W);else{let J=Buffer.alloc(2048);t6.read(Q,J,0,2048,0,(z,Y)=>{X(J.subarray(0,Y)),t6.close(Q,()=>{})})}})});l7.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:ZG,readFile:XG}});var i7=E((EA,n7)=>{var qG=(Z)=>{if(Z.length<64)return null;if(Z.readUInt32BE(0)!==2135247942)return null;if(Z.readUInt8(4)!==2)return null;if(Z.readUInt8(5)!==1)return null;let X=Z.readUInt32LE(32),q=Z.readUInt16LE(54),W=Z.readUInt16LE(56);for(let Q=0;Q<W;Q++){let J=X+Q*q;if(Z.readUInt32LE(J)===3){let Y=Z.readUInt32LE(J+8),U=Z.readUInt32LE(J+32);return Z.subarray(Y,Y+U).toString().replace(/\0.*$/g,"")}}return null};n7.exports={interpreterPath:qG}});var L1=E((CA,KZ)=>{var a7=q0("child_process"),{isLinux:e6,getReport:s7}=c7(),{LDD_PATH:M1,SELF_PATH:o7,readFile:o5,readFileSync:t5}=p7(),{interpreterPath:t7}=i7(),f0,u0,d0,B6="",e7=()=>{if(!B6)return new Promise((Z)=>{a7.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(X,q)=>{B6=X?" ":q,Z(B6)})});return B6},ZZ=()=>{if(!B6)try{B6=a7.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(Z){B6=" "}return B6},X6="glibc",XZ=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,C6="musl",WG=(Z)=>Z.includes("libc.musl-")||Z.includes("ld-musl-"),qZ=()=>{let Z=s7();if(Z.header&&Z.header.glibcVersionRuntime)return X6;if(Array.isArray(Z.sharedObjects)){if(Z.sharedObjects.some(WG))return C6}return null},WZ=(Z)=>{let[X,q]=Z.split(/[\r\n]+/);if(X&&X.includes(X6))return X6;if(q&&q.includes(C6))return C6;return null},QZ=(Z)=>{if(Z){if(Z.includes("/ld-musl-"))return C6;else if(Z.includes("/ld-linux-"))return X6}return null},JZ=(Z)=>{if(Z=Z.toString(),Z.includes("musl"))return C6;if(Z.includes("GNU C Library"))return X6;return null},QG=async()=>{if(u0!==void 0)return u0;u0=null;try{let Z=await o5(M1);u0=JZ(Z)}catch(Z){}return u0},JG=()=>{if(u0!==void 0)return u0;u0=null;try{let Z=t5(M1);u0=JZ(Z)}catch(Z){}return u0},zG=async()=>{if(f0!==void 0)return f0;f0=null;try{let Z=await o5(o7),X=t7(Z);f0=QZ(X)}catch(Z){}return f0},GG=()=>{if(f0!==void 0)return f0;f0=null;try{let Z=t5(o7),X=t7(Z);f0=QZ(X)}catch(Z){}return f0},zZ=async()=>{let Z=null;if(e6()){if(Z=await zG(),!Z){if(Z=await QG(),!Z)Z=qZ();if(!Z){let X=await e7();Z=WZ(X)}}}return Z},GZ=()=>{let Z=null;if(e6()){if(Z=GG(),!Z){if(Z=JG(),!Z)Z=qZ();if(!Z){let X=ZZ();Z=WZ(X)}}}return Z},YG=async()=>e6()&&await zZ()!==X6,UG=()=>e6()&&GZ()!==X6,KG=async()=>{if(d0!==void 0)return d0;d0=null;try{let X=(await o5(M1)).match(XZ);if(X)d0=X[1]}catch(Z){}return d0},VG=()=>{if(d0!==void 0)return d0;d0=null;try{let X=t5(M1).match(XZ);if(X)d0=X[1]}catch(Z){}return d0},YZ=()=>{let Z=s7();if(Z.header&&Z.header.glibcVersionRuntime)return Z.header.glibcVersionRuntime;return null},r7=(Z)=>Z.trim().split(/\s+/)[1],UZ=(Z)=>{let[X,q,W]=Z.split(/[\r\n]+/);if(X&&X.includes(X6))return r7(X);if(q&&W&&q.includes(C6))return r7(W);return null},BG=async()=>{let Z=null;if(e6()){if(Z=await KG(),!Z)Z=YZ();if(!Z){let X=await e7();Z=UZ(X)}}return Z},HG=()=>{let Z=null;if(e6()){if(Z=VG(),!Z)Z=YZ();if(!Z){let X=ZZ();Z=UZ(X)}}return Z};KZ.exports={GLIBC:X6,MUSL:C6,family:zZ,familySync:GZ,isNonGlibcLinux:YG,isNonGlibcLinuxSync:UG,version:BG,versionSync:HG}});var Z4=E((OA,VZ)=>{var $G=Number.MAX_SAFE_INTEGER||9007199254740991,FG=["major","premajor","minor","preminor","patch","prepatch","prerelease"];VZ.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:$G,RELEASE_TYPES:FG,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var P4=E((xA,BZ)=>{var AG=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...Z)=>console.error("SEMVER",...Z):()=>{};BZ.exports=AG});var X4=E((c0,HZ)=>{var{MAX_SAFE_COMPONENT_LENGTH:e5,MAX_SAFE_BUILD_LENGTH:MG,MAX_LENGTH:LG}=Z4(),IG=P4();c0=HZ.exports={};var wG=c0.re=[],DG=c0.safeRe=[],D=c0.src=[],NG=c0.safeSrc=[],N=c0.t={},TG=0,Z3="[a-zA-Z0-9-]",RG=[["\\s",1],["\\d",LG],[Z3,MG]],_G=(Z)=>{for(let[X,q]of RG)Z=Z.split(`${X}*`).join(`${X}{0,${q}}`).split(`${X}+`).join(`${X}{1,${q}}`);return Z},O=(Z,X,q)=>{let W=_G(X),Q=TG++;IG(Z,Q,X),N[Z]=Q,D[Q]=X,NG[Q]=W,wG[Q]=new RegExp(X,q?"g":void 0),DG[Q]=new RegExp(W,q?"g":void 0)};O("NUMERICIDENTIFIER","0|[1-9]\\d*");O("NUMERICIDENTIFIERLOOSE","\\d+");O("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Z3}*`);O("MAINVERSION",`(${D[N.NUMERICIDENTIFIER]})\\.(${D[N.NUMERICIDENTIFIER]})\\.(${D[N.NUMERICIDENTIFIER]})`);O("MAINVERSIONLOOSE",`(${D[N.NUMERICIDENTIFIERLOOSE]})\\.(${D[N.NUMERICIDENTIFIERLOOSE]})\\.(${D[N.NUMERICIDENTIFIERLOOSE]})`);O("PRERELEASEIDENTIFIER",`(?:${D[N.NONNUMERICIDENTIFIER]}|${D[N.NUMERICIDENTIFIER]})`);O("PRERELEASEIDENTIFIERLOOSE",`(?:${D[N.NONNUMERICIDENTIFIER]}|${D[N.NUMERICIDENTIFIERLOOSE]})`);O("PRERELEASE",`(?:-(${D[N.PRERELEASEIDENTIFIER]}(?:\\.${D[N.PRERELEASEIDENTIFIER]})*))`);O("PRERELEASELOOSE",`(?:-?(${D[N.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${D[N.PRERELEASEIDENTIFIERLOOSE]})*))`);O("BUILDIDENTIFIER",`${Z3}+`);O("BUILD",`(?:\\+(${D[N.BUILDIDENTIFIER]}(?:\\.${D[N.BUILDIDENTIFIER]})*))`);O("FULLPLAIN",`v?${D[N.MAINVERSION]}${D[N.PRERELEASE]}?${D[N.BUILD]}?`);O("FULL",`^${D[N.FULLPLAIN]}$`);O("LOOSEPLAIN",`[v=\\s]*${D[N.MAINVERSIONLOOSE]}${D[N.PRERELEASELOOSE]}?${D[N.BUILD]}?`);O("LOOSE",`^${D[N.LOOSEPLAIN]}$`);O("GTLT","((?:<|>)?=?)");O("XRANGEIDENTIFIERLOOSE",`${D[N.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);O("XRANGEIDENTIFIER",`${D[N.NUMERICIDENTIFIER]}|x|X|\\*`);O("XRANGEPLAIN",`[v=\\s]*(${D[N.XRANGEIDENTIFIER]})(?:\\.(${D[N.XRANGEIDENTIFIER]})(?:\\.(${D[N.XRANGEIDENTIFIER]})(?:${D[N.PRERELEASE]})?${D[N.BUILD]}?)?)?`);O("XRANGEPLAINLOOSE",`[v=\\s]*(${D[N.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[N.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[N.XRANGEIDENTIFIERLOOSE]})(?:${D[N.PRERELEASELOOSE]})?${D[N.BUILD]}?)?)?`);O("XRANGE",`^${D[N.GTLT]}\\s*${D[N.XRANGEPLAIN]}$`);O("XRANGELOOSE",`^${D[N.GTLT]}\\s*${D[N.XRANGEPLAINLOOSE]}$`);O("COERCEPLAIN",`(^|[^\\d])(\\d{1,${e5}})(?:\\.(\\d{1,${e5}}))?(?:\\.(\\d{1,${e5}}))?`);O("COERCE",`${D[N.COERCEPLAIN]}(?:$|[^\\d])`);O("COERCEFULL",D[N.COERCEPLAIN]+`(?:${D[N.PRERELEASE]})?(?:${D[N.BUILD]})?(?:$|[^\\d])`);O("COERCERTL",D[N.COERCE],!0);O("COERCERTLFULL",D[N.COERCEFULL],!0);O("LONETILDE","(?:~>?)");O("TILDETRIM",`(\\s*)${D[N.LONETILDE]}\\s+`,!0);c0.tildeTrimReplace="$1~";O("TILDE",`^${D[N.LONETILDE]}${D[N.XRANGEPLAIN]}$`);O("TILDELOOSE",`^${D[N.LONETILDE]}${D[N.XRANGEPLAINLOOSE]}$`);O("LONECARET","(?:\\^)");O("CARETTRIM",`(\\s*)${D[N.LONECARET]}\\s+`,!0);c0.caretTrimReplace="$1^";O("CARET",`^${D[N.LONECARET]}${D[N.XRANGEPLAIN]}$`);O("CARETLOOSE",`^${D[N.LONECARET]}${D[N.XRANGEPLAINLOOSE]}$`);O("COMPARATORLOOSE",`^${D[N.GTLT]}\\s*(${D[N.LOOSEPLAIN]})$|^$`);O("COMPARATOR",`^${D[N.GTLT]}\\s*(${D[N.FULLPLAIN]})$|^$`);O("COMPARATORTRIM",`(\\s*)${D[N.GTLT]}\\s*(${D[N.LOOSEPLAIN]}|${D[N.XRANGEPLAIN]})`,!0);c0.comparatorTrimReplace="$1$2$3";O("HYPHENRANGE",`^\\s*(${D[N.XRANGEPLAIN]})\\s+-\\s+(${D[N.XRANGEPLAIN]})\\s*$`);O("HYPHENRANGELOOSE",`^\\s*(${D[N.XRANGEPLAINLOOSE]})\\s+-\\s+(${D[N.XRANGEPLAINLOOSE]})\\s*$`);O("STAR","(<|>)?=?\\s*\\*");O("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");O("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var I1=E((kA,$Z)=>{var PG=Object.freeze({loose:!0}),jG=Object.freeze({}),EG=(Z)=>{if(!Z)return jG;if(typeof Z!=="object")return PG;return Z};$Z.exports=EG});var X3=E((SA,MZ)=>{var FZ=/^[0-9]+$/,AZ=(Z,X)=>{if(typeof Z==="number"&&typeof X==="number")return Z===X?0:Z<X?-1:1;let q=FZ.test(Z),W=FZ.test(X);if(q&&W)Z=+Z,X=+X;return Z===X?0:q&&!W?-1:W&&!q?1:Z<X?-1:1},CG=(Z,X)=>AZ(X,Z);MZ.exports={compareIdentifiers:AZ,rcompareIdentifiers:CG}});var Q0=E((bA,IZ)=>{var w1=P4(),{MAX_LENGTH:LZ,MAX_SAFE_INTEGER:D1}=Z4(),{safeRe:N1,t:T1}=X4(),OG=I1(),{compareIdentifiers:q3}=X3(),xG=(Z,X)=>{let q=X.split(".");if(q.length>Z.length)return!1;for(let W=0;W<q.length;W++)if(q3(Z[W],q[W])!==0)return!1;return!0};class k0{constructor(Z,X){if(X=OG(X),Z instanceof k0)if(Z.loose===!!X.loose&&Z.includePrerelease===!!X.includePrerelease)return Z;else Z=Z.version;else if(typeof Z!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof Z}".`);if(Z.length>LZ)throw TypeError(`version is longer than ${LZ} characters`);w1("SemVer",Z,X),this.options=X,this.loose=!!X.loose,this.includePrerelease=!!X.includePrerelease;let q=Z.trim().match(X.loose?N1[T1.LOOSE]:N1[T1.FULL]);if(!q)throw TypeError(`Invalid Version: ${Z}`);if(this.raw=Z,this.major=+q[1],this.minor=+q[2],this.patch=+q[3],this.major>D1||this.major<0)throw TypeError("Invalid major version");if(this.minor>D1||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>D1||this.patch<0)throw TypeError("Invalid patch version");if(!q[4])this.prerelease=[];else this.prerelease=q[4].split(".").map((W)=>{if(/^[0-9]+$/.test(W)){let Q=+W;if(Q>=0&&Q<D1)return Q}return W});this.build=q[5]?q[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(Z){if(w1("SemVer.compare",this.version,this.options,Z),!(Z instanceof k0)){if(typeof Z==="string"&&Z===this.version)return 0;Z=new k0(Z,this.options)}if(Z.version===this.version)return 0;return this.compareMain(Z)||this.comparePre(Z)}compareMain(Z){if(!(Z instanceof k0))Z=new k0(Z,this.options);if(this.major<Z.major)return-1;if(this.major>Z.major)return 1;if(this.minor<Z.minor)return-1;if(this.minor>Z.minor)return 1;if(this.patch<Z.patch)return-1;if(this.patch>Z.patch)return 1;return 0}comparePre(Z){if(!(Z instanceof k0))Z=new k0(Z,this.options);if(this.prerelease.length&&!Z.prerelease.length)return-1;else if(!this.prerelease.length&&Z.prerelease.length)return 1;else if(!this.prerelease.length&&!Z.prerelease.length)return 0;let X=0;do{let q=this.prerelease[X],W=Z.prerelease[X];if(w1("prerelease compare",X,q,W),q===void 0&&W===void 0)return 0;else if(W===void 0)return 1;else if(q===void 0)return-1;else if(q===W)continue;else return q3(q,W)}while(++X)}compareBuild(Z){if(!(Z instanceof k0))Z=new k0(Z,this.options);let X=0;do{let q=this.build[X],W=Z.build[X];if(w1("build compare",X,q,W),q===void 0&&W===void 0)return 0;else if(W===void 0)return 1;else if(q===void 0)return-1;else if(q===W)continue;else return q3(q,W)}while(++X)}inc(Z,X,q){if(Z.startsWith("pre")){if(!X&&q===!1)throw Error("invalid increment argument: identifier is empty");if(X){let W=`-${X}`.match(this.options.loose?N1[T1.PRERELEASELOOSE]:N1[T1.PRERELEASE]);if(!W||W[1]!==X)throw Error(`invalid identifier: ${X}`)}}switch(Z){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",X,q);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",X,q);break;case"prepatch":this.prerelease.length=0,this.inc("patch",X,q),this.inc("pre",X,q);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",X,q);this.inc("pre",X,q);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let W=Number(q)?1:0;if(this.prerelease.length===0)this.prerelease=[W];else{let Q=this.prerelease.length;while(--Q>=0)if(typeof this.prerelease[Q]==="number")this.prerelease[Q]++,Q=-2;if(Q===-1){if(X===this.prerelease.join(".")&&q===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(W)}}if(X){let Q=[X,W];if(q===!1)Q=[X];if(xG(this.prerelease,X)){let J=this.prerelease[X.split(".").length];if(isNaN(J))this.prerelease=Q}else this.prerelease=Q}break}default:throw Error(`invalid increment argument: ${Z}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}IZ.exports=k0});var H6=E((vA,DZ)=>{var wZ=Q0(),kG=(Z,X,q=!1)=>{if(Z instanceof wZ)return Z;try{return new wZ(Z,X)}catch(W){if(!q)return null;throw W}};DZ.exports=kG});var TZ=E((yA,NZ)=>{var SG=H6(),bG=(Z,X)=>{let q=SG(Z,X);return q?q.version:null};NZ.exports=bG});var _Z=E((gA,RZ)=>{var vG=H6(),yG=(Z,X)=>{let q=vG(Z.trim().replace(/^[=v]+/,""),X);return q?q.version:null};RZ.exports=yG});var EZ=E((hA,jZ)=>{var PZ=Q0(),gG=(Z,X,q,W,Q)=>{if(typeof q==="string")Q=W,W=q,q=void 0;try{return new PZ(Z instanceof PZ?Z.version:Z,q).inc(X,W,Q).version}catch(J){return null}};jZ.exports=gG});var xZ=E((mA,OZ)=>{var CZ=H6(),hG=(Z,X)=>{let q=CZ(Z,null,!0),W=CZ(X,null,!0),Q=q.compare(W);if(Q===0)return null;let J=Q>0,z=J?q:W,Y=J?W:q,U=!!z.prerelease.length;if(!!Y.prerelease.length&&!U){if(!Y.patch&&!Y.minor)return"major";if(Y.compareMain(z)===0){if(Y.minor&&!Y.patch)return"minor";return"patch"}}let V=U?"pre":"";if(q.major!==W.major)return V+"major";if(q.minor!==W.minor)return V+"minor";if(q.patch!==W.patch)return V+"patch";return"prerelease"};OZ.exports=hG});var SZ=E((fA,kZ)=>{var mG=Q0(),fG=(Z,X)=>new mG(Z,X).major;kZ.exports=fG});var vZ=E((uA,bZ)=>{var uG=Q0(),dG=(Z,X)=>new uG(Z,X).minor;bZ.exports=dG});var gZ=E((dA,yZ)=>{var cG=Q0(),lG=(Z,X)=>new cG(Z,X).patch;yZ.exports=lG});var mZ=E((cA,hZ)=>{var pG=H6(),nG=(Z,X)=>{let q=pG(Z,X);return q&&q.prerelease.length?q.prerelease:null};hZ.exports=nG});var j0=E((lA,uZ)=>{var fZ=Q0(),iG=(Z,X,q)=>new fZ(Z,q).compare(new fZ(X,q));uZ.exports=iG});var cZ=E((pA,dZ)=>{var rG=j0(),aG=(Z,X,q)=>rG(X,Z,q);dZ.exports=aG});var pZ=E((nA,lZ)=>{var sG=j0(),oG=(Z,X)=>sG(Z,X,!0);lZ.exports=oG});var R1=E((iA,iZ)=>{var nZ=Q0(),tG=(Z,X,q)=>{let W=new nZ(Z,q),Q=new nZ(X,q);return W.compare(Q)||W.compareBuild(Q)};iZ.exports=tG});var aZ=E((rA,rZ)=>{var eG=R1(),ZY=(Z,X)=>Z.sort((q,W)=>eG(q,W,X));rZ.exports=ZY});var oZ=E((aA,sZ)=>{var XY=R1(),qY=(Z,X)=>Z.sort((q,W)=>XY(W,q,X));sZ.exports=qY});var j4=E((sA,tZ)=>{var WY=j0(),QY=(Z,X,q)=>WY(Z,X,q)>0;tZ.exports=QY});var _1=E((oA,eZ)=>{var JY=j0(),zY=(Z,X,q)=>JY(Z,X,q)<0;eZ.exports=zY});var W3=E((tA,Z2)=>{var GY=j0(),YY=(Z,X,q)=>GY(Z,X,q)===0;Z2.exports=YY});var Q3=E((eA,X2)=>{var UY=j0(),KY=(Z,X,q)=>UY(Z,X,q)!==0;X2.exports=KY});var P1=E((ZM,q2)=>{var VY=j0(),BY=(Z,X,q)=>VY(Z,X,q)>=0;q2.exports=BY});var j1=E((XM,W2)=>{var HY=j0(),$Y=(Z,X,q)=>HY(Z,X,q)<=0;W2.exports=$Y});var J3=E((qM,Q2)=>{var FY=W3(),AY=Q3(),MY=j4(),LY=P1(),IY=_1(),wY=j1(),DY=(Z,X,q,W)=>{switch(X){case"===":if(typeof Z==="object")Z=Z.version;if(typeof q==="object")q=q.version;return Z===q;case"!==":if(typeof Z==="object")Z=Z.version;if(typeof q==="object")q=q.version;return Z!==q;case"":case"=":case"==":return FY(Z,q,W);case"!=":return AY(Z,q,W);case">":return MY(Z,q,W);case">=":return LY(Z,q,W);case"<":return IY(Z,q,W);case"<=":return wY(Z,q,W);default:throw TypeError(`Invalid operator: ${X}`)}};Q2.exports=DY});var z2=E((WM,J2)=>{var NY=Q0(),TY=H6(),{safeRe:E1,t:C1}=X4(),RY=(Z,X)=>{if(Z instanceof NY)return Z;if(typeof Z==="number")Z=String(Z);if(typeof Z!=="string")return null;X=X||{};let q=null;if(!X.rtl)q=Z.match(X.includePrerelease?E1[C1.COERCEFULL]:E1[C1.COERCE]);else{let U=X.includePrerelease?E1[C1.COERCERTLFULL]:E1[C1.COERCERTL],K;while((K=U.exec(Z))&&(!q||q.index+q[0].length!==Z.length)){if(!q||K.index+K[0].length!==q.index+q[0].length)q=K;U.lastIndex=K.index+K[1].length+K[2].length}U.lastIndex=-1}if(q===null)return null;let W=q[2],Q=q[3]||"0",J=q[4]||"0",z=X.includePrerelease&&q[5]?`-${q[5]}`:"",Y=X.includePrerelease&&q[6]?`+${q[6]}`:"";return TY(`${W}.${Q}.${J}${z}${Y}`,X)};J2.exports=RY});var Y2=E((QM,G2)=>{var _Y=H6(),PY=Z4(),jY=Q0(),EY=(Z,X,q)=>{if(!PY.RELEASE_TYPES.includes(X))return null;let W=CY(Z,q);return W&&OY(W,X)},CY=(Z,X)=>{let q=Z instanceof jY?Z.version:Z;return _Y(q,X)},OY=(Z,X)=>{if(xY(X))return Z.version;switch(Z.prerelease=[],X){case"major":Z.minor=0,Z.patch=0;break;case"minor":Z.patch=0;break}return Z.format()},xY=(Z)=>{return Z.startsWith("pre")};G2.exports=EY});var V2=E((JM,K2)=>{class U2{constructor(){this.max=1000,this.map=new Map}get(Z){let X=this.map.get(Z);if(X===void 0)return;else return this.map.delete(Z),this.map.set(Z,X),X}delete(Z){return this.map.delete(Z)}set(Z,X){if(!this.delete(Z)&&X!==void 0){if(this.map.size>=this.max){let W=this.map.keys().next().value;this.delete(W)}this.map.set(Z,X)}return this}}K2.exports=U2});var E0=E((zM,F2)=>{var kY=/\s+/g;class E4{constructor(Z,X){if(X=bY(X),Z instanceof E4)if(Z.loose===!!X.loose&&Z.includePrerelease===!!X.includePrerelease)return Z;else return new E4(Z.raw,X);if(Z instanceof z3)return this.raw=Z.value,this.set=[[Z]],this.formatted=void 0,this;if(this.options=X,this.loose=!!X.loose,this.includePrerelease=!!X.includePrerelease,this.raw=Z.trim().replace(kY," "),this.set=this.raw.split("||").map((q)=>this.parseRange(q.trim())).filter((q)=>q.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let q=this.set[0];if(this.set=this.set.filter((W)=>!H2(W[0])),this.set.length===0)this.set=[q];else if(this.set.length>1){for(let W of this.set)if(W.length===1&&cY(W[0])){this.set=[W];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let Z=0;Z<this.set.length;Z++){if(Z>0)this.formatted+="||";let X=this.set[Z];for(let q=0;q<X.length;q++){if(q>0)this.formatted+=" ";this.formatted+=X[q].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(Z){Z=Z.replace(dY,"");let q=((this.options.includePrerelease&&fY)|(this.options.loose&&uY))+":"+Z,W=B2.get(q);if(W)return W;let Q=this.options.loose,J=Q?V0[J0.HYPHENRANGELOOSE]:V0[J0.HYPHENRANGE];Z=Z.replace(J,ZU(this.options.includePrerelease)),m("hyphen replace",Z),Z=Z.replace(V0[J0.COMPARATORTRIM],gY),m("comparator trim",Z),Z=Z.replace(V0[J0.TILDETRIM],hY),m("tilde trim",Z),Z=Z.replace(V0[J0.CARETTRIM],mY),m("caret trim",Z);let z=Z.split(" ").map((V)=>lY(V,this.options)).join(" ").split(/\s+/).map((V)=>eY(V,this.options));if(Q)z=z.filter((V)=>{return m("loose invalid filter",V,this.options),!!V.match(V0[J0.COMPARATORLOOSE])});m("range list",z);let Y=new Map,U=z.map((V)=>new z3(V,this.options));for(let V of U){if(H2(V))return[V];Y.set(V.value,V)}if(Y.size>1&&Y.has(""))Y.delete("");let K=[...Y.values()];return B2.set(q,K),K}intersects(Z,X){if(!(Z instanceof E4))throw TypeError("a Range is required");return this.set.some((q)=>{return $2(q,X)&&Z.set.some((W)=>{return $2(W,X)&&q.every((Q)=>{return W.every((J)=>{return Q.intersects(J,X)})})})})}test(Z){if(!Z)return!1;if(typeof Z==="string")try{Z=new vY(Z,this.options)}catch(X){return!1}for(let X=0;X<this.set.length;X++)if(XU(this.set[X],Z,this.options))return!0;return!1}}F2.exports=E4;var SY=V2(),B2=new SY,bY=I1(),z3=C4(),m=P4(),vY=Q0(),{safeRe:V0,src:yY,t:J0,comparatorTrimReplace:gY,tildeTrimReplace:hY,caretTrimReplace:mY}=X4(),{FLAG_INCLUDE_PRERELEASE:fY,FLAG_LOOSE:uY}=Z4(),dY=new RegExp(yY[J0.BUILD],"g"),H2=(Z)=>Z.value==="<0.0.0-0",cY=(Z)=>Z.value==="",$2=(Z,X)=>{let q=!0,W=Z.slice(),Q=W.pop();while(q&&W.length)q=W.every((J)=>{return Q.intersects(J,X)}),Q=W.pop();return q},lY=(Z,X)=>{return Z=Z.replace(V0[J0.BUILD],""),m("comp",Z,X),Z=rY(Z,X),m("caret",Z),Z=nY(Z,X),m("tildes",Z),Z=sY(Z,X),m("xrange",Z),Z=tY(Z,X),m("stars",Z),Z},s=(Z)=>!Z||Z.toLowerCase()==="x"||Z==="*",pY=(Z,X,q)=>s(Z)&&!s(X)||s(X)&&q&&!s(q),nY=(Z,X)=>{return Z.trim().split(/\s+/).map((q)=>iY(q,X)).join(" ")},iY=(Z,X)=>{let q=X.loose?V0[J0.TILDELOOSE]:V0[J0.TILDE];return Z.replace(q,(W,Q,J,z,Y)=>{m("tilde",Z,W,Q,J,z,Y);let U;if(s(Q))U="";else if(s(J))U=`>=${Q}.0.0 <${+Q+1}.0.0-0`;else if(s(z))U=`>=${Q}.${J}.0 <${Q}.${+J+1}.0-0`;else if(Y)m("replaceTilde pr",Y),U=`>=${Q}.${J}.${z}-${Y} <${Q}.${+J+1}.0-0`;else U=`>=${Q}.${J}.${z} <${Q}.${+J+1}.0-0`;return m("tilde return",U),U})},rY=(Z,X)=>{return Z.trim().split(/\s+/).map((q)=>aY(q,X)).join(" ")},aY=(Z,X)=>{m("caret",Z,X);let q=X.loose?V0[J0.CARETLOOSE]:V0[J0.CARET],W=X.includePrerelease?"-0":"";return Z.replace(q,(Q,J,z,Y,U)=>{m("caret",Z,Q,J,z,Y,U);let K;if(s(J))K="";else if(s(z))K=`>=${J}.0.0${W} <${+J+1}.0.0-0`;else if(s(Y))if(J==="0")K=`>=${J}.${z}.0${W} <${J}.${+z+1}.0-0`;else K=`>=${J}.${z}.0${W} <${+J+1}.0.0-0`;else if(U)if(m("replaceCaret pr",U),J==="0")if(z==="0")K=`>=${J}.${z}.${Y}-${U} <${J}.${z}.${+Y+1}-0`;else K=`>=${J}.${z}.${Y}-${U} <${J}.${+z+1}.0-0`;else K=`>=${J}.${z}.${Y}-${U} <${+J+1}.0.0-0`;else if(m("no pr"),J==="0")if(z==="0")K=`>=${J}.${z}.${Y} <${J}.${z}.${+Y+1}-0`;else K=`>=${J}.${z}.${Y} <${J}.${+z+1}.0-0`;else K=`>=${J}.${z}.${Y} <${+J+1}.0.0-0`;return m("caret return",K),K})},sY=(Z,X)=>{return m("replaceXRanges",Z,X),Z.split(/\s+/).map((q)=>oY(q,X)).join(" ")},oY=(Z,X)=>{Z=Z.trim();let q=X.loose?V0[J0.XRANGELOOSE]:V0[J0.XRANGE];return Z.replace(q,(W,Q,J,z,Y,U)=>{if(m("xRange",Z,W,Q,J,z,Y,U),pY(J,z,Y))return Z;let K=s(J),V=K||s(z),B=V||s(Y),H=B;if(Q==="="&&H)Q="";if(U=X.includePrerelease?"-0":"",K)if(Q===">"||Q==="<")W="<0.0.0-0";else W="*";else if(Q&&H){if(V)z=0;if(Y=0,Q===">")if(Q=">=",V)J=+J+1,z=0,Y=0;else z=+z+1,Y=0;else if(Q==="<=")if(Q="<",V)J=+J+1;else z=+z+1;if(Q==="<")U="-0";W=`${Q+J}.${z}.${Y}${U}`}else if(V)W=`>=${J}.0.0${U} <${+J+1}.0.0-0`;else if(B)W=`>=${J}.${z}.0${U} <${J}.${+z+1}.0-0`;return m("xRange return",W),W})},tY=(Z,X)=>{return m("replaceStars",Z,X),Z.trim().replace(V0[J0.STAR],"")},eY=(Z,X)=>{return m("replaceGTE0",Z,X),Z.trim().replace(V0[X.includePrerelease?J0.GTE0PRE:J0.GTE0],"")},ZU=(Z)=>(X,q,W,Q,J,z,Y,U,K,V,B,H)=>{if(s(W))q="";else if(s(Q))q=`>=${W}.0.0${Z?"-0":""}`;else if(s(J))q=`>=${W}.${Q}.0${Z?"-0":""}`;else if(z)q=`>=${q}`;else q=`>=${q}${Z?"-0":""}`;if(s(K))U="";else if(s(V))U=`<${+K+1}.0.0-0`;else if(s(B))U=`<${K}.${+V+1}.0-0`;else if(H)U=`<=${K}.${V}.${B}-${H}`;else if(Z)U=`<${K}.${V}.${+B+1}-0`;else U=`<=${U}`;return`${q} ${U}`.trim()},XU=(Z,X,q)=>{for(let W=0;W<Z.length;W++)if(!Z[W].test(X))return!1;if(X.prerelease.length&&!q.includePrerelease){for(let W=0;W<Z.length;W++){if(m(Z[W].semver),Z[W].semver===z3.ANY)continue;if(Z[W].semver.prerelease.length>0){let Q=Z[W].semver;if(Q.major===X.major&&Q.minor===X.minor&&Q.patch===X.patch)return!0}}return!1}return!0}});var C4=E((GM,D2)=>{var O4=Symbol("SemVer ANY");class O1{static get ANY(){return O4}constructor(Z,X){if(X=A2(X),Z instanceof O1)if(Z.loose===!!X.loose)return Z;else Z=Z.value;if(Z=Z.trim().split(/\s+/).join(" "),Y3("comparator",Z,X),this.options=X,this.loose=!!X.loose,this.parse(Z),this.semver===O4)this.value="";else this.value=this.operator+this.semver.version;Y3("comp",this)}parse(Z){let X=this.options.loose?M2[L2.COMPARATORLOOSE]:M2[L2.COMPARATOR],q=Z.match(X);if(!q)throw TypeError(`Invalid comparator: ${Z}`);if(this.operator=q[1]!==void 0?q[1]:"",this.operator==="=")this.operator="";if(!q[2])this.semver=O4;else this.semver=new I2(q[2],this.options.loose)}toString(){return this.value}test(Z){if(Y3("Comparator.test",Z,this.options.loose),this.semver===O4||Z===O4)return!0;if(typeof Z==="string")try{Z=new I2(Z,this.options)}catch(X){return!1}return G3(Z,this.operator,this.semver,this.options)}intersects(Z,X){if(!(Z instanceof O1))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new w2(Z.value,X).test(this.value)}else if(Z.operator===""){if(Z.value==="")return!0;return new w2(this.value,X).test(Z.semver)}if(X=A2(X),X.includePrerelease&&(this.value==="<0.0.0-0"||Z.value==="<0.0.0-0"))return!1;if(!X.includePrerelease&&(this.value.startsWith("<0.0.0")||Z.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&Z.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&Z.operator.startsWith("<"))return!0;if(this.semver.version===Z.semver.version&&this.operator.includes("=")&&Z.operator.includes("="))return!0;if(G3(this.semver,"<",Z.semver,X)&&this.operator.startsWith(">")&&Z.operator.startsWith("<"))return!0;if(G3(this.semver,">",Z.semver,X)&&this.operator.startsWith("<")&&Z.operator.startsWith(">"))return!0;return!1}}D2.exports=O1;var A2=I1(),{safeRe:M2,t:L2}=X4(),G3=J3(),Y3=P4(),I2=Q0(),w2=E0()});var x4=E((YM,N2)=>{var qU=E0(),WU=(Z,X,q)=>{try{X=new qU(X,q)}catch(W){return!1}return X.test(Z)};N2.exports=WU});var R2=E((UM,T2)=>{var QU=E0(),JU=(Z,X)=>new QU(Z,X).set.map((q)=>q.map((W)=>W.value).join(" ").trim().split(" "));T2.exports=JU});var P2=E((KM,_2)=>{var zU=Q0(),GU=E0(),YU=(Z,X,q)=>{let W=null,Q=null,J=null;try{J=new GU(X,q)}catch(z){return null}return Z.forEach((z)=>{if(J.test(z)){if(!W||Q.compare(z)===-1)W=z,Q=new zU(W,q)}}),W};_2.exports=YU});var E2=E((VM,j2)=>{var UU=Q0(),KU=E0(),VU=(Z,X,q)=>{let W=null,Q=null,J=null;try{J=new KU(X,q)}catch(z){return null}return Z.forEach((z)=>{if(J.test(z)){if(!W||Q.compare(z)===1)W=z,Q=new UU(W,q)}}),W};j2.exports=VU});var x2=E((BM,O2)=>{var U3=Q0(),BU=E0(),C2=j4(),HU=(Z,X)=>{Z=new BU(Z,X);let q=new U3("0.0.0");if(Z.test(q))return q;if(q=new U3("0.0.0-0"),Z.test(q))return q;q=null;for(let W=0;W<Z.set.length;++W){let Q=Z.set[W],J=null;if(Q.forEach((z)=>{let Y=new U3(z.semver.version);switch(z.operator){case">":if(Y.prerelease.length===0)Y.patch++;else Y.prerelease.push(0);Y.raw=Y.format();case"":case">=":if(!J||C2(Y,J))J=Y;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${z.operator}`)}}),J&&(!q||C2(q,J)))q=J}if(q&&Z.test(q))return q;return null};O2.exports=HU});var S2=E((HM,k2)=>{var $U=E0(),FU=(Z,X)=>{try{return new $U(Z,X).range||"*"}catch(q){return null}};k2.exports=FU});var x1=E(($M,g2)=>{var AU=Q0(),y2=C4(),{ANY:MU}=y2,LU=E0(),IU=x4(),b2=j4(),v2=_1(),wU=j1(),DU=P1(),NU=(Z,X,q,W)=>{Z=new AU(Z,W),X=new LU(X,W);let Q,J,z,Y,U;switch(q){case">":Q=b2,J=wU,z=v2,Y=">",U=">=";break;case"<":Q=v2,J=DU,z=b2,Y="<",U="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(IU(Z,X,W))return!1;for(let K=0;K<X.set.length;++K){let V=X.set[K],B=null,H=null;if(V.forEach(($)=>{if($.semver===MU)$=new y2(">=0.0.0");if(B=B||$,H=H||$,Q($.semver,B.semver,W))B=$;else if(z($.semver,H.semver,W))H=$}),B.operator===Y||B.operator===U)return!1;if((!H.operator||H.operator===Y)&&J(Z,H.semver))return!1;else if(H.operator===U&&z(Z,H.semver))return!1}return!0};g2.exports=NU});var m2=E((FM,h2)=>{var TU=x1(),RU=(Z,X,q)=>TU(Z,X,">",q);h2.exports=RU});var u2=E((AM,f2)=>{var _U=x1(),PU=(Z,X,q)=>_U(Z,X,"<",q);f2.exports=PU});var l2=E((MM,c2)=>{var d2=E0(),jU=(Z,X,q)=>{return Z=new d2(Z,q),X=new d2(X,q),Z.intersects(X,q)};c2.exports=jU});var n2=E((LM,p2)=>{var EU=x4(),CU=j0();p2.exports=(Z,X,q)=>{let W=[],Q=null,J=null,z=Z.sort((V,B)=>CU(V,B,q));for(let V of z)if(EU(V,X,q)){if(J=V,!Q)Q=V}else{if(J)W.push([Q,J]);J=null,Q=null}if(Q)W.push([Q,null]);let Y=[];for(let[V,B]of W)if(V===B)Y.push(V);else if(!B&&V===z[0])Y.push("*");else if(!B)Y.push(`>=${V}`);else if(V===z[0])Y.push(`<=${B}`);else Y.push(`${V} - ${B}`);let U=Y.join(" || "),K=typeof X.raw==="string"?X.raw:String(X);return U.length<K.length?U:X}});var t2=E((IM,o2)=>{var i2=E0(),B3=C4(),{ANY:K3}=B3,V3=x4(),H3=j0(),OU=(Z,X,q={})=>{if(Z===X)return!0;Z=new i2(Z,q),X=new i2(X,q);let W=!1;Z:for(let Q of Z.set){for(let J of X.set){let z=kU(Q,J,q);if(W=W||z!==null,z)continue Z}if(W)return!1}return!0},xU=[new B3(">=0.0.0-0")],r2=[new B3(">=0.0.0")],kU=(Z,X,q)=>{if(Z===X)return!0;if(Z.length===1&&Z[0].semver===K3)if(X.length===1&&X[0].semver===K3)return!0;else if(q.includePrerelease)Z=xU;else Z=r2;if(X.length===1&&X[0].semver===K3)if(q.includePrerelease)return!0;else X=r2;let W=new Set,Q,J;for(let $ of Z)if($.operator===">"||$.operator===">=")Q=a2(Q,$,q);else if($.operator==="<"||$.operator==="<=")J=s2(J,$,q);else W.add($.semver);if(W.size>1)return null;let z;if(Q&&J){if(z=H3(Q.semver,J.semver,q),z>0)return null;else if(z===0&&(Q.operator!==">="||J.operator!=="<="))return null}for(let $ of W){if(Q&&!V3($,String(Q),q))return null;if(J&&!V3($,String(J),q))return null;for(let F of X)if(!V3($,String(F),q))return!1;return!0}let Y,U,K,V,B=J&&!q.includePrerelease&&J.semver.prerelease.length?J.semver:!1,H=Q&&!q.includePrerelease&&Q.semver.prerelease.length?Q.semver:!1;if(B&&B.prerelease.length===1&&J.operator==="<"&&B.prerelease[0]===0)B=!1;for(let $ of X){if(V=V||$.operator===">"||$.operator===">=",K=K||$.operator==="<"||$.operator==="<=",Q){if(H){if($.semver.prerelease&&$.semver.prerelease.length&&$.semver.major===H.major&&$.semver.minor===H.minor&&$.semver.patch===H.patch)H=!1}if($.operator===">"||$.operator===">="){if(Y=a2(Q,$,q),Y===$&&Y!==Q)return!1}else if(Q.operator===">="&&!$.test(Q.semver))return!1}if(J){if(B){if($.semver.prerelease&&$.semver.prerelease.length&&$.semver.major===B.major&&$.semver.minor===B.minor&&$.semver.patch===B.patch)B=!1}if($.operator==="<"||$.operator==="<="){if(U=s2(J,$,q),U===$&&U!==J)return!1}else if(J.operator==="<="&&!$.test(J.semver))return!1}if(!$.operator&&(J||Q)&&z!==0)return!1}if(Q&&K&&!J&&z!==0)return!1;if(J&&V&&!Q&&z!==0)return!1;if(H||B)return!1;return!0},a2=(Z,X,q)=>{if(!Z)return X;let W=H3(Z.semver,X.semver,q);return W>0?Z:W<0?X:X.operator===">"&&Z.operator===">="?X:Z},s2=(Z,X,q)=>{if(!Z)return X;let W=H3(Z.semver,X.semver,q);return W<0?Z:W>0?X:X.operator==="<"&&Z.operator==="<="?X:Z};o2.exports=OU});var qX=E((wM,XX)=>{var $3=X4(),e2=Z4(),SU=Q0(),ZX=X3(),bU=H6(),vU=TZ(),yU=_Z(),gU=EZ(),hU=xZ(),mU=SZ(),fU=vZ(),uU=gZ(),dU=mZ(),cU=j0(),lU=cZ(),pU=pZ(),nU=R1(),iU=aZ(),rU=oZ(),aU=j4(),sU=_1(),oU=W3(),tU=Q3(),eU=P1(),ZK=j1(),XK=J3(),qK=z2(),WK=Y2(),QK=C4(),JK=E0(),zK=x4(),GK=R2(),YK=P2(),UK=E2(),KK=x2(),VK=S2(),BK=x1(),HK=m2(),$K=u2(),FK=l2(),AK=n2(),MK=t2();XX.exports={parse:bU,valid:vU,clean:yU,inc:gU,diff:hU,major:mU,minor:fU,patch:uU,prerelease:dU,compare:cU,rcompare:lU,compareLoose:pU,compareBuild:nU,sort:iU,rsort:rU,gt:aU,lt:sU,eq:oU,neq:tU,gte:eU,lte:ZK,cmp:XK,coerce:qK,truncate:WK,Comparator:QK,Range:JK,satisfies:zK,toComparators:GK,maxSatisfying:YK,minSatisfying:UK,minVersion:KK,validRange:VK,outside:BK,gtr:HK,ltr:$K,intersects:FK,simplifyRange:AK,subset:MK,SemVer:SU,re:$3.re,src:$3.src,tokens:$3.t,SEMVER_SPEC_VERSION:e2.SEMVER_SPEC_VERSION,RELEASE_TYPES:e2.RELEASE_TYPES,compareIdentifiers:ZX.compareIdentifiers,rcompareIdentifiers:ZX.rcompareIdentifiers}});var q6;var k1=R(()=>{q6={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.0",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix Bünemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","Jérémy Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kotěšovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouciño <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugué <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>","Dmytro Tiapukhin <cool.gegeg@gmail.com>","Florian Lefebvre <contact@florian-lefebvre.dev>"],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-types":"tsd --files ./test/types/sharp.test-d.ts","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./lib/index.d.ts",exports:{".":{import:"./dist/index.mjs",require:"./dist/index.cjs"}},repository:{type:"git",url:"git://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.4"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.0","@img/sharp-darwin-x64":"0.35.0","@img/sharp-freebsd-wasm32":"0.35.0","@img/sharp-libvips-darwin-arm64":"1.3.0","@img/sharp-libvips-darwin-x64":"1.3.0","@img/sharp-libvips-linux-arm":"1.3.0","@img/sharp-libvips-linux-arm64":"1.3.0","@img/sharp-libvips-linux-ppc64":"1.3.0","@img/sharp-libvips-linux-riscv64":"1.3.0","@img/sharp-libvips-linux-s390x":"1.3.0","@img/sharp-libvips-linux-x64":"1.3.0","@img/sharp-libvips-linuxmusl-arm64":"1.3.0","@img/sharp-libvips-linuxmusl-x64":"1.3.0","@img/sharp-linux-arm":"0.35.0","@img/sharp-linux-arm64":"0.35.0","@img/sharp-linux-ppc64":"0.35.0","@img/sharp-linux-riscv64":"0.35.0","@img/sharp-linux-s390x":"0.35.0","@img/sharp-linux-x64":"0.35.0","@img/sharp-linuxmusl-arm64":"0.35.0","@img/sharp-linuxmusl-x64":"0.35.0","@img/sharp-webcontainers-wasm32":"0.35.0","@img/sharp-win32-arm64":"0.35.0","@img/sharp-win32-ia32":"0.35.0","@img/sharp-win32-x64":"0.35.0"},devDependencies:{"@biomejs/biome":"^2.4.16","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.0","@img/sharp-libvips-dev":"1.3.0","@img/sharp-libvips-dev-wasm32":"1.3.0","@img/sharp-libvips-win32-arm64":"1.3.0","@img/sharp-libvips-win32-ia32":"1.3.0","@img/sharp-libvips-win32-x64":"1.3.0","@types/node":"*",emnapi:"^1.11.0","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.8.0","node-gyp":"^12.4.0","tar-fs":"^3.1.2",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.3"},funding:{url:"https://opencollective.com/libvips"}}});import{spawnSync as k4}from"node:child_process";import{createHash as IK}from"node:crypto";var S4,A3,wK,QX,DK,M3,NK=(Z)=>{if(Z instanceof Error)console.error(`sharp: Installation error: ${Z.message}`);else console.log(`sharp: ${Z}`)},JX=()=>A3.default.isNonGlibcLinuxSync()?A3.default.familySync():"",TK=()=>`${process.platform}${JX()}-${process.arch}`,q4=()=>{if(zX())return"wasm32";let{npm_config_arch:Z,npm_config_platform:X,npm_config_libc:q}=process.env,W=typeof q==="string"?q:JX();return`${X||process.platform}${W}-${Z||process.arch}`},RK=()=>{try{return q0(`@img/sharp-libvips-dev-${q4()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},_K=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},PK=()=>{try{return q0(`@img/sharp-libvips-dev-${q4()}/lib`)}catch{try{return q0(`@img/sharp-libvips-${q4()}/lib`)}catch{}}return""},jK=()=>{if(process.release?.name==="node"&&process.versions){if(!S4.default.satisfies(process.versions.node,q6.engines.node))return{found:process.versions.node,expected:q6.engines.node}}},zX=()=>{let{CC:Z}=process.env;return Boolean(Z?.endsWith("/emcc"))},EK=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(k4("sysctl sysctl.proc_translated",M3).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},WX=(Z)=>IK("sha512").update(Z).digest("hex"),CK=()=>{try{let Z=WX(`imgsharp-libvips-${q4()}`),X=S4.default.coerce(q6.optionalDependencies[`@img/sharp-libvips-${q4()}`],{includePrerelease:!0}).version;return WX(`${Z}npm:${X}`).slice(0,10)}catch{}return""},OK=()=>k4(`node-gyp rebuild --directory=src ${zX()?"--nodedir=emscripten":""}`,{...M3,stdio:"inherit"}).status,GX=()=>{if(process.platform!=="win32")return(k4("pkg-config --modversion vips-cpp",{...M3,env:{...process.env,PKG_CONFIG_PATH:YX()}}).stdout||"").trim();else return""},xK=()=>{try{let Z=(k4("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(Z)return`${Z}/lib/pkgconfig`}catch(Z){}return},kK=()=>{try{let Z=(k4("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(Z)return Z}catch(Z){}return},YX=()=>{if(process.platform!=="win32")return[xK(),kK(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},F3=(Z,X,q)=>{if(q)q(`Detected ${X}, skipping search for globally-installed libvips`);return Z},SK=(Z)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return F3(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",Z);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return F3(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",Z);if(EK())return F3(!1,"Rosetta",Z);let X=GX();return!!X&&S4.default.gte(X,QX)},S1;var L3=R(()=>{k1();S4=B4(qX(),1),A3=B4(L1(),1);/*!
292
204
  Copyright 2013 Lovell Fuller and others.
293
205
  SPDX-License-Identifier: Apache-2.0
294
- */var{spawnSync:H6}=m("node:child_process"),{createHash:WY}=m("node:crypto"),E8=i2(),QY=g5(),GY=P8(),j8=q6(),{config:YY,engines:_8,optionalDependencies:zY}=d5(),UY=process.env.npm_package_config_libvips||YY.libvips,O8=E8(UY).version,KY=["darwin-arm64","darwin-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],$6={encoding:"utf8",shell:!0},VY=(Z)=>{if(Z instanceof Error)console.error(`sharp: Installation error: ${Z.message}`);else console.log(`sharp: ${Z}`)},x8=()=>j8.isNonGlibcLinuxSync()?j8.familySync():"",BY=()=>`${process.platform}${x8()}-${process.arch}`,c4=()=>{if(k8())return"wasm32";let{npm_config_arch:Z,npm_config_platform:J,npm_config_libc:X}=process.env,q=typeof X==="string"?X:x8();return`${J||process.platform}${q}-${Z||process.arch}`},HY=()=>{try{return m(`@img/sharp-libvips-dev-${c4()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},$Y=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},FY=()=>{try{return m(`@img/sharp-libvips-dev-${c4()}/lib`)}catch{try{return m(`@img/sharp-libvips-${c4()}/lib`)}catch{}}return""},MY=()=>{if(process.release?.name==="node"&&process.versions){if(!GY(process.versions.node,_8.node))return{found:process.versions.node,expected:_8.node}}},k8=()=>{let{CC:Z}=process.env;return Boolean(Z?.endsWith("/emcc"))},AY=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(H6("sysctl sysctl.proc_translated",$6).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},C8=(Z)=>WY("sha512").update(Z).digest("hex"),LY=()=>{try{let Z=C8(`imgsharp-libvips-${c4()}`),J=E8(zY[`@img/sharp-libvips-${c4()}`],{includePrerelease:!0}).version;return C8(`${Z}npm:${J}`).slice(0,10)}catch{}return""},IY=()=>H6(`node-gyp rebuild --directory=src ${k8()?"--nodedir=emscripten":""}`,{...$6,stdio:"inherit"}).status,S8=()=>{if(process.platform!=="win32")return(H6("pkg-config --modversion vips-cpp",{...$6,env:{...process.env,PKG_CONFIG_PATH:b8()}}).stdout||"").trim();else return""},b8=()=>{if(process.platform!=="win32")return[(H6('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2',$6).stdout||"").trim(),process.env.PKG_CONFIG_PATH,"/usr/local/lib/pkgconfig","/usr/lib/pkgconfig","/usr/local/libdata/pkgconfig","/usr/libdata/pkgconfig"].filter(Boolean).join(":");else return""},c5=(Z,J,X)=>{if(X)X(`Detected ${J}, skipping search for globally-installed libvips`);return Z},DY=(Z)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return c5(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",Z);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return c5(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",Z);if(AY())return c5(!1,"Rosetta",Z);let J=S8();return!!J&&QY(J,O8)};v8.exports={minimumLibvipsVersion:O8,prebuiltPlatforms:KY,buildPlatformArch:c4,buildSharpLibvipsIncludeDir:HY,buildSharpLibvipsCPlusPlusDir:$Y,buildSharpLibvipsLibDir:FY,isUnsupportedNodeRuntime:MY,runtimePlatformArch:BY,log:VY,yarnLocator:LY,spawnRebuild:IY,globalLibvipsVersion:S8,pkgConfigPath:b8,useGlobalLibvips:DY}});var w1=b((TH,g8)=>{/*!
206
+ */wK=process.env.npm_package_config_libvips||q6.config.libvips,QX=S4.default.coerce(wK).version,DK=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],M3={encoding:"utf8",shell:!0},S1={minimumLibvipsVersion:QX,prebuiltPlatforms:DK,buildPlatformArch:q4,buildSharpLibvipsIncludeDir:RK,buildSharpLibvipsCPlusPlusDir:_K,buildSharpLibvipsLibDir:PK,isUnsupportedNodeRuntime:jK,runtimePlatformArch:TK,log:NK,yarnLocator:CK,spawnRebuild:OK,globalLibvipsVersion:GX,pkgConfigPath:YX,useGlobalLibvips:SK}});import{createRequire as bK}from"node:module";var b1,o,KX,vK,UX,yK,gK,$6,u,O6,v;var b4=R(()=>{L3();k1();b1=B4(L1(),1);/*!
295
207
  Copyright 2013 Lovell Fuller and others.
296
208
  SPDX-License-Identifier: Apache-2.0
297
- */var{familySync:wY,versionSync:NY}=q6(),{runtimePlatformArch:TY,isUnsupportedNodeRuntime:y8,prebuiltPlatforms:RY,minimumLibvipsVersion:PY}=l5(),L4=TY(),jY=[`../src/build/Release/sharp-${L4}.node`,"../src/build/Release/sharp-wasm32.node",`@img/sharp-${L4}/sharp.node`,"@img/sharp-wasm32/sharp.node"],p5,l4,D1=[];for(p5 of jY)try{l4=m(p5);break}catch(Z){D1.push(Z)}if(l4&&p5.startsWith("@img/sharp-linux-x64")&&!l4._isUsingX64V2()){let Z=Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");Z.code="Unsupported CPU",D1.push(Z),l4=null}if(l4)g8.exports=l4;else{let[Z,J,X]=["linux","darwin","win32"].map((Q)=>L4.startsWith(Q)),q=[`Could not load the "sharp" module using the ${L4} runtime`];D1.forEach((Q)=>{if(Q.code!=="MODULE_NOT_FOUND")q.push(`${Q.code}: ${Q.message}`)});let W=D1.map((Q)=>Q.message).join(" ");if(q.push("Possible solutions:"),y8()){let{found:Q,expected:G}=y8();q.push("- Please upgrade Node.js:",` Found ${Q}`,` Requires ${G}`)}else if(RY.includes(L4)){let[Q,G]=L4.split("-"),z=Q.endsWith("musl")?" --libc=musl":"";q.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${Q.replace("musl","")}${z} --cpu=${G} sharp`)}else q.push(`- Manually install libvips >= ${PY}`,"- Add experimental WebAssembly-based dependencies:"," npm install --cpu=wasm32 sharp"," npm install @img/sharp-wasm32");if(Z&&/(symbol not found|CXXABI_)/i.test(W))try{let{config:Q}=m(`@img/sharp-libvips-${L4}/package`),G=`${wY()} ${NY()}`,z=`${Q.musl?"musl":"glibc"} ${Q.musl||Q.glibc}`;q.push("- Update your OS:",` Found ${G}`,` Requires ${z}`)}catch(Q){}if(Z&&/\/snap\/core[0-9]{2}/.test(W))q.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(J&&/Incompatible library version/.test(W))q.push("- Update Homebrew:"," brew update && brew upgrade vips");if(D1.some((Q)=>Q.code==="ERR_DLOPEN_DISABLED"))q.push("- Run Node.js without using the --no-addons flag");if(X&&/The specified procedure could not be found/.test(W))q.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw q.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(q.join(`
298
- `))}});var m8=b((PH,h8)=>{/*!
209
+ */o=bK(import.meta.url),{version:KX}=q6,{runtimePlatformArch:vK,isUnsupportedNodeRuntime:UX,prebuiltPlatforms:yK,minimumLibvipsVersion:gK}=S1,$6=vK(),O6=[];try{u=o(`../src/build/Release/sharp-${$6}-${KX}.node`)}catch(Z){O6.push(Z)}if(!u)try{u=o(`../src/build/Release/sharp-wasm32-${KX}.node`)}catch(Z){O6.push(Z)}if(!u)try{switch($6){case"darwin-arm64":u=o("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":u=o("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":u=o("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":u=o("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":u=o("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":u=o("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":u=o("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":u=o("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":u=o("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":u=o("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":u=o("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":u=o("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":u=o("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":u=o("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":u=o("@img/sharp-webcontainers-wasm32/sharp.node");break;default:u=o("@img/sharp-wasm32/sharp.node");break}if(["linux-x64","linuxmusl-x64"].includes($6)&&!u._isUsingX64V2()){let Z=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");Z.code="Unsupported CPU",O6.push(Z),u=null}}catch(Z){O6.push(Z)}if(!u){let[Z,X,q]=["linux","darwin","win32"].map((J)=>$6.startsWith(J)),W=[`Could not load the "sharp" module using the ${$6} runtime`];O6.forEach((J)=>{if(!J.code.endsWith("MODULE_NOT_FOUND"))W.push(`${J.code}: ${J.message}`)});let Q=O6.map((J)=>J.message).join(" ");if(W.push("Possible solutions:"),UX()){let{found:J,expected:z}=UX();W.push("- Please upgrade Node.js:",` Found ${J}`,` Requires ${z}`)}else if(yK.includes($6)){let[J,z]=$6.split("-"),Y=J.endsWith("musl")?" --libc=musl":"";W.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${J.replace("musl","")}${Y} --cpu=${z} sharp`)}else W.push(`- Manually install libvips >= ${gK}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(Z&&/(symbol not found|CXXABI_)/i.test(Q))try{let{config:J}=o(`@img/sharp-libvips-${$6}/package`),z=`${b1.familySync()} ${b1.versionSync()}`,Y=`${J.musl?"musl":"glibc"} ${J.musl||J.glibc}`;W.push("- Update your OS:",` Found ${z}`,` Requires ${Y}`)}catch(J){}if(Z&&/\/snap\/core[0-9]{2}/.test(Q))W.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(X&&/Incompatible library version/.test(Q))W.push("- Update Homebrew:"," brew update && brew upgrade vips");if(O6.some((J)=>J.code==="ERR_DLOPEN_DISABLED"))W.push("- Run Node.js without using the --no-addons flag");if(q&&/The specified procedure could not be found/.test(Q))W.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw W.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(W.join(`
210
+ `))}v=u});import hK from"node:util";import I3 from"node:stream";function uK(){let Z=this.constructor.call(),{debuglog:X,queueListener:q,...W}=this.options;if(Z.options=structuredClone(W),Z.options.debuglog=X,Z.options.queueListener=q,this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z.options.input.buffer=this.options.input.buffer,Z.emit("finish")});return Z}var mK,fK=(Z)=>{x6.queue.emit("change",Z)},x6=function(Z,X){if(arguments.length===1&&!G.defined(Z))throw Error("Invalid input");if(!(this instanceof x6))return new x6(Z,X);return I3.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:(q)=>{this.emit("warning",q),mK(q)},queueListener:fK},this.options.input=this._createInputDescriptor(Z,X,{allowStream:!0}),this},l0;var VX=R(()=>{m0();b4();/*!
299
211
  Copyright 2013 Lovell Fuller and others.
300
212
  SPDX-License-Identifier: Apache-2.0
301
- */var _Y=m("node:util"),n5=m("node:stream"),CY=v0();w1();var EY=_Y.debuglog("sharp"),OY=(Z)=>{I4.queue.emit("change",Z)},I4=function(Z,J){if(arguments.length===1&&!CY.defined(Z))throw Error("Invalid input");if(!(this instanceof I4))return new I4(Z,J);return n5.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:8,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:(X)=>{this.emit("warning",X),EY(X)},queueListener:OY},this.options.input=this._createInputDescriptor(Z,J,{allowStream:!0}),this};Object.setPrototypeOf(I4.prototype,n5.Duplex.prototype);Object.setPrototypeOf(I4,n5.Duplex);function xY(){let Z=this.constructor.call(),{debuglog:J,queueListener:X,...q}=this.options;if(Z.options=structuredClone(q),Z.options.debuglog=J,Z.options.queueListener=X,this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z.options.input.buffer=this.options.input.buffer,Z.emit("finish")});return Z}Object.assign(I4.prototype,{clone:xY});h8.exports=I4});var d8=b((jH,u8)=>{/*!
213
+ */mK=hK.debuglog("sharp");Object.setPrototypeOf(x6.prototype,I3.Duplex.prototype);Object.setPrototypeOf(x6,I3.Duplex);Object.assign(x6.prototype,{clone:uK});l0=x6});function BX(Z){let X=cK.filter((q)=>G.defined(Z[q])).map((q)=>[q,Z[q]]);return X.length?Object.fromEntries(X):void 0}function lK(Z,X,q){let W={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(G.string(Z))W.file=Z;else if(G.buffer(Z)){if(Z.length===0)throw Error("Input Buffer is empty");W.buffer=Z}else if(G.arrayBuffer(Z)){if(Z.byteLength===0)throw Error("Input bit Array is empty");W.buffer=Buffer.from(Z,0,Z.byteLength)}else if(G.typedArray(Z)){if(Z.length===0)throw Error("Input Bit Array is empty");W.buffer=Buffer.from(Z.buffer,Z.byteOffset,Z.byteLength)}else if(G.plainObject(Z)&&!G.defined(X)){if(X=Z,BX(X))W.buffer=[]}else if(!G.defined(Z)&&!G.defined(X)&&G.object(q)&&q.allowStream)W.buffer=[];else if(Array.isArray(Z))if(Z.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=Z.map((Q)=>this._createInputDescriptor(Q));else throw Error("Recursive join is unsupported");else throw Error("Expected at least two images to join");else throw Error(`Unsupported input '${Z}' of type ${typeof Z}${G.defined(X)?` when also providing options of type ${typeof X}`:""}`);if(G.object(X)){if(G.defined(X.failOn))if(G.string(X.failOn)&&G.inArray(X.failOn,["none","truncated","error","warning"]))W.failOn=X.failOn;else throw G.invalidParameterError("failOn","one of: none, truncated, error, warning",X.failOn);if(G.defined(X.autoOrient))if(G.bool(X.autoOrient))W.autoOrient=X.autoOrient;else throw G.invalidParameterError("autoOrient","boolean",X.autoOrient);if(G.defined(X.density))if(G.number(X.density)&&G.inRange(X.density,1,1e5))W.density=X.density;else throw G.invalidParameterError("density","number between 1 and 100000",X.density);if(G.defined(X.ignoreIcc))if(G.bool(X.ignoreIcc))W.ignoreIcc=X.ignoreIcc;else throw G.invalidParameterError("ignoreIcc","boolean",X.ignoreIcc);if(G.defined(X.limitInputPixels))if(G.bool(X.limitInputPixels))W.limitInputPixels=X.limitInputPixels?268402689:0;else if(G.integer(X.limitInputPixels)&&G.inRange(X.limitInputPixels,0,Number.MAX_SAFE_INTEGER))W.limitInputPixels=X.limitInputPixels;else throw G.invalidParameterError("limitInputPixels","positive integer",X.limitInputPixels);if(G.defined(X.limitInputChannels))if(G.bool(X.limitInputChannels))W.limitInputChannels=X.limitInputChannels?5:0;else if(G.integer(X.limitInputChannels)&&G.inRange(X.limitInputChannels,0,Number.MAX_SAFE_INTEGER))W.limitInputChannels=X.limitInputChannels;else throw G.invalidParameterError("limitInputChannels","positive integer",X.limitInputChannels);if(G.defined(X.unlimited))if(G.bool(X.unlimited))W.unlimited=X.unlimited;else throw G.invalidParameterError("unlimited","boolean",X.unlimited);if(G.defined(X.sequentialRead))if(G.bool(X.sequentialRead))W.sequentialRead=X.sequentialRead;else throw G.invalidParameterError("sequentialRead","boolean",X.sequentialRead);if(G.defined(X.raw)){if(G.object(X.raw)&&G.integer(X.raw.width)&&X.raw.width>0&&G.integer(X.raw.height)&&X.raw.height>0&&G.integer(X.raw.channels)&&G.inRange(X.raw.channels,1,4))switch(W.rawWidth=X.raw.width,W.rawHeight=X.raw.height,W.rawChannels=X.raw.channels,Z.constructor){case Uint8Array:case Uint8ClampedArray:W.rawDepth="uchar";break;case Int8Array:W.rawDepth="char";break;case Uint16Array:W.rawDepth="ushort";break;case Int16Array:W.rawDepth="short";break;case Uint32Array:W.rawDepth="uint";break;case Int32Array:W.rawDepth="int";break;case Float32Array:W.rawDepth="float";break;case Float64Array:W.rawDepth="double";break;default:W.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(W.rawPremultiplied=!1,G.defined(X.raw.premultiplied))if(G.bool(X.raw.premultiplied))W.rawPremultiplied=X.raw.premultiplied;else throw G.invalidParameterError("raw.premultiplied","boolean",X.raw.premultiplied);if(W.rawPageHeight=0,G.defined(X.raw.pageHeight))if(G.integer(X.raw.pageHeight)&&X.raw.pageHeight>0&&X.raw.pageHeight<=X.raw.height){if(X.raw.height%X.raw.pageHeight!==0)throw Error(`Expected raw.height ${X.raw.height} to be a multiple of raw.pageHeight ${X.raw.pageHeight}`);W.rawPageHeight=X.raw.pageHeight}else throw G.invalidParameterError("raw.pageHeight","positive integer",X.raw.pageHeight)}if(G.defined(X.animated))if(G.bool(X.animated))W.pages=X.animated?-1:1;else throw G.invalidParameterError("animated","boolean",X.animated);if(G.defined(X.pages))if(G.integer(X.pages)&&G.inRange(X.pages,-1,1e5))W.pages=X.pages;else throw G.invalidParameterError("pages","integer between -1 and 100000",X.pages);if(G.defined(X.page))if(G.integer(X.page)&&G.inRange(X.page,0,1e5))W.page=X.page;else throw G.invalidParameterError("page","integer between 0 and 100000",X.page);if(G.object(X.openSlide)&&G.defined(X.openSlide.level))if(G.integer(X.openSlide.level)&&G.inRange(X.openSlide.level,0,256))W.openSlideLevel=X.openSlide.level;else throw G.invalidParameterError("openSlide.level","integer between 0 and 256",X.openSlide.level);else if(G.defined(X.level))if(G.integer(X.level)&&G.inRange(X.level,0,256))W.openSlideLevel=X.level;else throw G.invalidParameterError("level","integer between 0 and 256",X.level);if(G.object(X.tiff)&&G.defined(X.tiff.subifd))if(G.integer(X.tiff.subifd)&&G.inRange(X.tiff.subifd,-1,1e5))W.tiffSubifd=X.tiff.subifd;else throw G.invalidParameterError("tiff.subifd","integer between -1 and 100000",X.tiff.subifd);else if(G.defined(X.subifd))if(G.integer(X.subifd)&&G.inRange(X.subifd,-1,1e5))W.tiffSubifd=X.subifd;else throw G.invalidParameterError("subifd","integer between -1 and 100000",X.subifd);if(G.object(X.svg)){if(G.defined(X.svg.stylesheet))if(G.string(X.svg.stylesheet))W.svgStylesheet=X.svg.stylesheet;else throw G.invalidParameterError("svg.stylesheet","string",X.svg.stylesheet);if(G.defined(X.svg.highBitdepth))if(G.bool(X.svg.highBitdepth))W.svgHighBitdepth=X.svg.highBitdepth;else throw G.invalidParameterError("svg.highBitdepth","boolean",X.svg.highBitdepth)}if(G.object(X.pdf)&&G.defined(X.pdf.background))W.pdfBackground=this._getBackgroundColourOption(X.pdf.background);else if(G.defined(X.pdfBackground))W.pdfBackground=this._getBackgroundColourOption(X.pdfBackground);if(G.object(X.jp2)&&G.defined(X.jp2.oneshot))if(G.bool(X.jp2.oneshot))W.jp2Oneshot=X.jp2.oneshot;else throw G.invalidParameterError("jp2.oneshot","boolean",X.jp2.oneshot);if(G.defined(X.create))if(G.object(X.create)&&G.integer(X.create.width)&&X.create.width>0&&G.integer(X.create.height)&&X.create.height>0&&G.integer(X.create.channels)){if(W.createWidth=X.create.width,W.createHeight=X.create.height,W.createChannels=X.create.channels,W.createPageHeight=0,G.defined(X.create.pageHeight))if(G.integer(X.create.pageHeight)&&X.create.pageHeight>0&&X.create.pageHeight<=X.create.height){if(X.create.height%X.create.pageHeight!==0)throw Error(`Expected create.height ${X.create.height} to be a multiple of create.pageHeight ${X.create.pageHeight}`);W.createPageHeight=X.create.pageHeight}else throw G.invalidParameterError("create.pageHeight","positive integer",X.create.pageHeight);if(G.defined(X.create.noise)){if(!G.object(X.create.noise))throw Error("Expected noise to be an object");if(X.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(W.createNoiseType=X.create.noise.type,!G.inRange(X.create.channels,1,4))throw G.invalidParameterError("create.channels","number between 1 and 4",X.create.channels);if(W.createNoiseMean=128,G.defined(X.create.noise.mean))if(G.number(X.create.noise.mean)&&G.inRange(X.create.noise.mean,0,1e4))W.createNoiseMean=X.create.noise.mean;else throw G.invalidParameterError("create.noise.mean","number between 0 and 10000",X.create.noise.mean);if(W.createNoiseSigma=30,G.defined(X.create.noise.sigma))if(G.number(X.create.noise.sigma)&&G.inRange(X.create.noise.sigma,0,1e4))W.createNoiseSigma=X.create.noise.sigma;else throw G.invalidParameterError("create.noise.sigma","number between 0 and 10000",X.create.noise.sigma)}else if(G.defined(X.create.background)){if(!G.inRange(X.create.channels,3,4))throw G.invalidParameterError("create.channels","number between 3 and 4",X.create.channels);W.createBackground=this._getBackgroundColourOption(X.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete W.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(G.defined(X.text))if(G.object(X.text)&&G.string(X.text.text)){if(W.textValue=X.text.text,G.defined(X.text.height)&&G.defined(X.text.dpi))throw Error("Expected only one of dpi or height");if(G.defined(X.text.font))if(G.string(X.text.font))W.textFont=X.text.font;else throw G.invalidParameterError("text.font","string",X.text.font);if(G.defined(X.text.fontfile))if(G.string(X.text.fontfile))W.textFontfile=X.text.fontfile;else throw G.invalidParameterError("text.fontfile","string",X.text.fontfile);if(G.defined(X.text.width))if(G.integer(X.text.width)&&X.text.width>0)W.textWidth=X.text.width;else throw G.invalidParameterError("text.width","positive integer",X.text.width);if(G.defined(X.text.height))if(G.integer(X.text.height)&&X.text.height>0)W.textHeight=X.text.height;else throw G.invalidParameterError("text.height","positive integer",X.text.height);if(G.defined(X.text.align))if(G.string(X.text.align)&&G.string(this.constructor.align[X.text.align]))W.textAlign=this.constructor.align[X.text.align];else throw G.invalidParameterError("text.align","valid alignment",X.text.align);if(G.defined(X.text.justify))if(G.bool(X.text.justify))W.textJustify=X.text.justify;else throw G.invalidParameterError("text.justify","boolean",X.text.justify);if(G.defined(X.text.dpi))if(G.integer(X.text.dpi)&&G.inRange(X.text.dpi,1,1e6))W.textDpi=X.text.dpi;else throw G.invalidParameterError("text.dpi","integer between 1 and 1000000",X.text.dpi);if(G.defined(X.text.rgba))if(G.bool(X.text.rgba))W.textRgba=X.text.rgba;else throw G.invalidParameterError("text.rgba","bool",X.text.rgba);if(G.defined(X.text.spacing))if(G.integer(X.text.spacing)&&G.inRange(X.text.spacing,-1e6,1e6))W.textSpacing=X.text.spacing;else throw G.invalidParameterError("text.spacing","integer between -1000000 and 1000000",X.text.spacing);if(G.defined(X.text.wrap))if(G.string(X.text.wrap)&&G.inArray(X.text.wrap,["word","char","word-char","none"]))W.textWrap=X.text.wrap;else throw G.invalidParameterError("text.wrap","one of: word, char, word-char, none",X.text.wrap);delete W.buffer}else throw Error("Expected a valid string to create an image with text.");if(G.defined(X.join))if(G.defined(this.options.join)){if(G.defined(X.join.animated))if(G.bool(X.join.animated))W.joinAnimated=X.join.animated;else throw G.invalidParameterError("join.animated","boolean",X.join.animated);if(G.defined(X.join.across))if(G.integer(X.join.across)&&G.inRange(X.join.across,1,1e6))W.joinAcross=X.join.across;else throw G.invalidParameterError("join.across","integer between 1 and 100000",X.join.across);if(G.defined(X.join.shim))if(G.integer(X.join.shim)&&G.inRange(X.join.shim,0,1e6))W.joinShim=X.join.shim;else throw G.invalidParameterError("join.shim","integer between 0 and 100000",X.join.shim);if(G.defined(X.join.background))W.joinBackground=this._getBackgroundColourOption(X.join.background);if(G.defined(X.join.halign))if(G.string(X.join.halign)&&G.string(this.constructor.align[X.join.halign]))W.joinHalign=this.constructor.align[X.join.halign];else throw G.invalidParameterError("join.halign","valid alignment",X.join.halign);if(G.defined(X.join.valign))if(G.string(X.join.valign)&&G.string(this.constructor.align[X.join.valign]))W.joinValign=this.constructor.align[X.join.valign];else throw G.invalidParameterError("join.valign","valid alignment",X.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(G.defined(X))throw Error(`Invalid input options ${X}`);return W}function pK(Z,X,q){if(Array.isArray(this.options.input.buffer))if(G.buffer(Z)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push(Z),q()}else q(Error("Non-Buffer data on Writable Stream"));else q(Error("Unexpected data on Writable Stream"))}function nK(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function iK(){return Array.isArray(this.options.input.buffer)}function rK(Z){let X=Error();if(G.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),v.metadata(this.options,(q,W)=>{if(q)Z(G.nativeError(q,X));else Z(null,W)})});else v.metadata(this.options,(q,W)=>{if(q)Z(G.nativeError(q,X));else Z(null,W)});return this}else if(this._isStreamInput())return new Promise((q,W)=>{let Q=()=>{this._flattenBufferIn(),v.metadata(this.options,(J,z)=>{if(J)W(G.nativeError(J,X));else q(z)})};if(this.writableFinished)Q();else this.once("finish",Q)});else return new Promise((q,W)=>{v.metadata(this.options,(Q,J)=>{if(Q)W(G.nativeError(Q,X));else q(J)})})}function aK(Z){let X=Error();if(G.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),v.stats(this.options,(q,W)=>{if(q)Z(G.nativeError(q,X));else Z(null,W)})});else v.stats(this.options,(q,W)=>{if(q)Z(G.nativeError(q,X));else Z(null,W)});return this}else if(this._isStreamInput())return new Promise((q,W)=>{this.on("finish",function(){this._flattenBufferIn(),v.stats(this.options,(Q,J)=>{if(Q)W(G.nativeError(Q,X));else q(J)})})});else return new Promise((q,W)=>{v.stats(this.options,(Q,J)=>{if(Q)W(G.nativeError(Q,X));else q(J)})})}var dK,cK,HX=(Z)=>{Object.assign(Z.prototype,{_inputOptionsFromObject:BX,_createInputDescriptor:lK,_write:pK,_flattenBufferIn:nK,_isStreamInput:iK,metadata:rK,stats:aK}),Z.align=dK};var $X=R(()=>{m0();b4();/*!
302
214
  Copyright 2013 Lovell Fuller and others.
303
215
  SPDX-License-Identifier: Apache-2.0
304
- */var F=v0(),q4=w1(),kY={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},SY=["failOn","limitInputPixels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","failOnError","openSlideLevel","pdfBackground","tiffSubifd"];function f8(Z){let J=SY.filter((X)=>F.defined(Z[X])).map((X)=>[X,Z[X]]);return J.length?Object.fromEntries(J):void 0}function bY(Z,J,X){let q={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(F.string(Z))q.file=Z;else if(F.buffer(Z)){if(Z.length===0)throw Error("Input Buffer is empty");q.buffer=Z}else if(F.arrayBuffer(Z)){if(Z.byteLength===0)throw Error("Input bit Array is empty");q.buffer=Buffer.from(Z,0,Z.byteLength)}else if(F.typedArray(Z)){if(Z.length===0)throw Error("Input Bit Array is empty");q.buffer=Buffer.from(Z.buffer,Z.byteOffset,Z.byteLength)}else if(F.plainObject(Z)&&!F.defined(J)){if(J=Z,f8(J))q.buffer=[]}else if(!F.defined(Z)&&!F.defined(J)&&F.object(X)&&X.allowStream)q.buffer=[];else if(Array.isArray(Z))if(Z.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=Z.map((W)=>this._createInputDescriptor(W));else throw Error("Recursive join is unsupported");else throw Error("Expected at least two images to join");else throw Error(`Unsupported input '${Z}' of type ${typeof Z}${F.defined(J)?` when also providing options of type ${typeof J}`:""}`);if(F.object(J)){if(F.defined(J.failOnError))if(F.bool(J.failOnError))q.failOn=J.failOnError?"warning":"none";else throw F.invalidParameterError("failOnError","boolean",J.failOnError);if(F.defined(J.failOn))if(F.string(J.failOn)&&F.inArray(J.failOn,["none","truncated","error","warning"]))q.failOn=J.failOn;else throw F.invalidParameterError("failOn","one of: none, truncated, error, warning",J.failOn);if(F.defined(J.autoOrient))if(F.bool(J.autoOrient))q.autoOrient=J.autoOrient;else throw F.invalidParameterError("autoOrient","boolean",J.autoOrient);if(F.defined(J.density))if(F.inRange(J.density,1,1e5))q.density=J.density;else throw F.invalidParameterError("density","number between 1 and 100000",J.density);if(F.defined(J.ignoreIcc))if(F.bool(J.ignoreIcc))q.ignoreIcc=J.ignoreIcc;else throw F.invalidParameterError("ignoreIcc","boolean",J.ignoreIcc);if(F.defined(J.limitInputPixels))if(F.bool(J.limitInputPixels))q.limitInputPixels=J.limitInputPixels?268402689:0;else if(F.integer(J.limitInputPixels)&&F.inRange(J.limitInputPixels,0,Number.MAX_SAFE_INTEGER))q.limitInputPixels=J.limitInputPixels;else throw F.invalidParameterError("limitInputPixels","positive integer",J.limitInputPixels);if(F.defined(J.unlimited))if(F.bool(J.unlimited))q.unlimited=J.unlimited;else throw F.invalidParameterError("unlimited","boolean",J.unlimited);if(F.defined(J.sequentialRead))if(F.bool(J.sequentialRead))q.sequentialRead=J.sequentialRead;else throw F.invalidParameterError("sequentialRead","boolean",J.sequentialRead);if(F.defined(J.raw)){if(F.object(J.raw)&&F.integer(J.raw.width)&&J.raw.width>0&&F.integer(J.raw.height)&&J.raw.height>0&&F.integer(J.raw.channels)&&F.inRange(J.raw.channels,1,4))switch(q.rawWidth=J.raw.width,q.rawHeight=J.raw.height,q.rawChannels=J.raw.channels,Z.constructor){case Uint8Array:case Uint8ClampedArray:q.rawDepth="uchar";break;case Int8Array:q.rawDepth="char";break;case Uint16Array:q.rawDepth="ushort";break;case Int16Array:q.rawDepth="short";break;case Uint32Array:q.rawDepth="uint";break;case Int32Array:q.rawDepth="int";break;case Float32Array:q.rawDepth="float";break;case Float64Array:q.rawDepth="double";break;default:q.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(q.rawPremultiplied=!1,F.defined(J.raw.premultiplied))if(F.bool(J.raw.premultiplied))q.rawPremultiplied=J.raw.premultiplied;else throw F.invalidParameterError("raw.premultiplied","boolean",J.raw.premultiplied);if(q.rawPageHeight=0,F.defined(J.raw.pageHeight))if(F.integer(J.raw.pageHeight)&&J.raw.pageHeight>0&&J.raw.pageHeight<=J.raw.height){if(J.raw.height%J.raw.pageHeight!==0)throw Error(`Expected raw.height ${J.raw.height} to be a multiple of raw.pageHeight ${J.raw.pageHeight}`);q.rawPageHeight=J.raw.pageHeight}else throw F.invalidParameterError("raw.pageHeight","positive integer",J.raw.pageHeight)}if(F.defined(J.animated))if(F.bool(J.animated))q.pages=J.animated?-1:1;else throw F.invalidParameterError("animated","boolean",J.animated);if(F.defined(J.pages))if(F.integer(J.pages)&&F.inRange(J.pages,-1,1e5))q.pages=J.pages;else throw F.invalidParameterError("pages","integer between -1 and 100000",J.pages);if(F.defined(J.page))if(F.integer(J.page)&&F.inRange(J.page,0,1e5))q.page=J.page;else throw F.invalidParameterError("page","integer between 0 and 100000",J.page);if(F.object(J.openSlide)&&F.defined(J.openSlide.level))if(F.integer(J.openSlide.level)&&F.inRange(J.openSlide.level,0,256))q.openSlideLevel=J.openSlide.level;else throw F.invalidParameterError("openSlide.level","integer between 0 and 256",J.openSlide.level);else if(F.defined(J.level))if(F.integer(J.level)&&F.inRange(J.level,0,256))q.openSlideLevel=J.level;else throw F.invalidParameterError("level","integer between 0 and 256",J.level);if(F.object(J.tiff)&&F.defined(J.tiff.subifd))if(F.integer(J.tiff.subifd)&&F.inRange(J.tiff.subifd,-1,1e5))q.tiffSubifd=J.tiff.subifd;else throw F.invalidParameterError("tiff.subifd","integer between -1 and 100000",J.tiff.subifd);else if(F.defined(J.subifd))if(F.integer(J.subifd)&&F.inRange(J.subifd,-1,1e5))q.tiffSubifd=J.subifd;else throw F.invalidParameterError("subifd","integer between -1 and 100000",J.subifd);if(F.object(J.svg)){if(F.defined(J.svg.stylesheet))if(F.string(J.svg.stylesheet))q.svgStylesheet=J.svg.stylesheet;else throw F.invalidParameterError("svg.stylesheet","string",J.svg.stylesheet);if(F.defined(J.svg.highBitdepth))if(F.bool(J.svg.highBitdepth))q.svgHighBitdepth=J.svg.highBitdepth;else throw F.invalidParameterError("svg.highBitdepth","boolean",J.svg.highBitdepth)}if(F.object(J.pdf)&&F.defined(J.pdf.background))q.pdfBackground=this._getBackgroundColourOption(J.pdf.background);else if(F.defined(J.pdfBackground))q.pdfBackground=this._getBackgroundColourOption(J.pdfBackground);if(F.object(J.jp2)&&F.defined(J.jp2.oneshot))if(F.bool(J.jp2.oneshot))q.jp2Oneshot=J.jp2.oneshot;else throw F.invalidParameterError("jp2.oneshot","boolean",J.jp2.oneshot);if(F.defined(J.create))if(F.object(J.create)&&F.integer(J.create.width)&&J.create.width>0&&F.integer(J.create.height)&&J.create.height>0&&F.integer(J.create.channels)){if(q.createWidth=J.create.width,q.createHeight=J.create.height,q.createChannels=J.create.channels,q.createPageHeight=0,F.defined(J.create.pageHeight))if(F.integer(J.create.pageHeight)&&J.create.pageHeight>0&&J.create.pageHeight<=J.create.height){if(J.create.height%J.create.pageHeight!==0)throw Error(`Expected create.height ${J.create.height} to be a multiple of create.pageHeight ${J.create.pageHeight}`);q.createPageHeight=J.create.pageHeight}else throw F.invalidParameterError("create.pageHeight","positive integer",J.create.pageHeight);if(F.defined(J.create.noise)){if(!F.object(J.create.noise))throw Error("Expected noise to be an object");if(J.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(q.createNoiseType=J.create.noise.type,!F.inRange(J.create.channels,1,4))throw F.invalidParameterError("create.channels","number between 1 and 4",J.create.channels);if(q.createNoiseMean=128,F.defined(J.create.noise.mean))if(F.number(J.create.noise.mean)&&F.inRange(J.create.noise.mean,0,1e4))q.createNoiseMean=J.create.noise.mean;else throw F.invalidParameterError("create.noise.mean","number between 0 and 10000",J.create.noise.mean);if(q.createNoiseSigma=30,F.defined(J.create.noise.sigma))if(F.number(J.create.noise.sigma)&&F.inRange(J.create.noise.sigma,0,1e4))q.createNoiseSigma=J.create.noise.sigma;else throw F.invalidParameterError("create.noise.sigma","number between 0 and 10000",J.create.noise.sigma)}else if(F.defined(J.create.background)){if(!F.inRange(J.create.channels,3,4))throw F.invalidParameterError("create.channels","number between 3 and 4",J.create.channels);q.createBackground=this._getBackgroundColourOption(J.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete q.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(F.defined(J.text))if(F.object(J.text)&&F.string(J.text.text)){if(q.textValue=J.text.text,F.defined(J.text.height)&&F.defined(J.text.dpi))throw Error("Expected only one of dpi or height");if(F.defined(J.text.font))if(F.string(J.text.font))q.textFont=J.text.font;else throw F.invalidParameterError("text.font","string",J.text.font);if(F.defined(J.text.fontfile))if(F.string(J.text.fontfile))q.textFontfile=J.text.fontfile;else throw F.invalidParameterError("text.fontfile","string",J.text.fontfile);if(F.defined(J.text.width))if(F.integer(J.text.width)&&J.text.width>0)q.textWidth=J.text.width;else throw F.invalidParameterError("text.width","positive integer",J.text.width);if(F.defined(J.text.height))if(F.integer(J.text.height)&&J.text.height>0)q.textHeight=J.text.height;else throw F.invalidParameterError("text.height","positive integer",J.text.height);if(F.defined(J.text.align))if(F.string(J.text.align)&&F.string(this.constructor.align[J.text.align]))q.textAlign=this.constructor.align[J.text.align];else throw F.invalidParameterError("text.align","valid alignment",J.text.align);if(F.defined(J.text.justify))if(F.bool(J.text.justify))q.textJustify=J.text.justify;else throw F.invalidParameterError("text.justify","boolean",J.text.justify);if(F.defined(J.text.dpi))if(F.integer(J.text.dpi)&&F.inRange(J.text.dpi,1,1e6))q.textDpi=J.text.dpi;else throw F.invalidParameterError("text.dpi","integer between 1 and 1000000",J.text.dpi);if(F.defined(J.text.rgba))if(F.bool(J.text.rgba))q.textRgba=J.text.rgba;else throw F.invalidParameterError("text.rgba","bool",J.text.rgba);if(F.defined(J.text.spacing))if(F.integer(J.text.spacing)&&F.inRange(J.text.spacing,-1e6,1e6))q.textSpacing=J.text.spacing;else throw F.invalidParameterError("text.spacing","integer between -1000000 and 1000000",J.text.spacing);if(F.defined(J.text.wrap))if(F.string(J.text.wrap)&&F.inArray(J.text.wrap,["word","char","word-char","none"]))q.textWrap=J.text.wrap;else throw F.invalidParameterError("text.wrap","one of: word, char, word-char, none",J.text.wrap);delete q.buffer}else throw Error("Expected a valid string to create an image with text.");if(F.defined(J.join))if(F.defined(this.options.join)){if(F.defined(J.join.animated))if(F.bool(J.join.animated))q.joinAnimated=J.join.animated;else throw F.invalidParameterError("join.animated","boolean",J.join.animated);if(F.defined(J.join.across))if(F.integer(J.join.across)&&F.inRange(J.join.across,1,1e6))q.joinAcross=J.join.across;else throw F.invalidParameterError("join.across","integer between 1 and 100000",J.join.across);if(F.defined(J.join.shim))if(F.integer(J.join.shim)&&F.inRange(J.join.shim,0,1e6))q.joinShim=J.join.shim;else throw F.invalidParameterError("join.shim","integer between 0 and 100000",J.join.shim);if(F.defined(J.join.background))q.joinBackground=this._getBackgroundColourOption(J.join.background);if(F.defined(J.join.halign))if(F.string(J.join.halign)&&F.string(this.constructor.align[J.join.halign]))q.joinHalign=this.constructor.align[J.join.halign];else throw F.invalidParameterError("join.halign","valid alignment",J.join.halign);if(F.defined(J.join.valign))if(F.string(J.join.valign)&&F.string(this.constructor.align[J.join.valign]))q.joinValign=this.constructor.align[J.join.valign];else throw F.invalidParameterError("join.valign","valid alignment",J.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(F.defined(J))throw Error(`Invalid input options ${J}`);return q}function vY(Z,J,X){if(Array.isArray(this.options.input.buffer))if(F.buffer(Z)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push(Z),X()}else X(Error("Non-Buffer data on Writable Stream"));else X(Error("Unexpected data on Writable Stream"))}function yY(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function gY(){return Array.isArray(this.options.input.buffer)}function hY(Z){let J=Error();if(F.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),q4.metadata(this.options,(X,q)=>{if(X)Z(F.nativeError(X,J));else Z(null,q)})});else q4.metadata(this.options,(X,q)=>{if(X)Z(F.nativeError(X,J));else Z(null,q)});return this}else if(this._isStreamInput())return new Promise((X,q)=>{let W=()=>{this._flattenBufferIn(),q4.metadata(this.options,(Q,G)=>{if(Q)q(F.nativeError(Q,J));else X(G)})};if(this.writableFinished)W();else this.once("finish",W)});else return new Promise((X,q)=>{q4.metadata(this.options,(W,Q)=>{if(W)q(F.nativeError(W,J));else X(Q)})})}function mY(Z){let J=Error();if(F.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),q4.stats(this.options,(X,q)=>{if(X)Z(F.nativeError(X,J));else Z(null,q)})});else q4.stats(this.options,(X,q)=>{if(X)Z(F.nativeError(X,J));else Z(null,q)});return this}else if(this._isStreamInput())return new Promise((X,q)=>{this.on("finish",function(){this._flattenBufferIn(),q4.stats(this.options,(W,Q)=>{if(W)q(F.nativeError(W,J));else X(Q)})})});else return new Promise((X,q)=>{q4.stats(this.options,(W,Q)=>{if(W)q(F.nativeError(W,J));else X(Q)})})}u8.exports=(Z)=>{Object.assign(Z.prototype,{_inputOptionsFromObject:f8,_createInputDescriptor:bY,_write:vY,_flattenBufferIn:yY,_isStreamInput:gY,metadata:hY,stats:mY}),Z.align=kY}});var i8=b((_H,r8)=>{/*!
216
+ */dK={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},cK=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function D3(Z){return Z.angle%360!==0||Z.rotationAngle!==0}function v1(Z){return Z.width!==-1||Z.height!==-1}function tK(Z,X,q){if(v1(this.options))this.options.debuglog("ignoring previous resize options");if(this.options.widthPost!==-1)this.options.debuglog("operation order will be: extract, resize, extract");if(G.defined(Z))if(G.object(Z)&&!G.defined(q))q=Z;else if(G.integer(Z)&&Z>0)this.options.width=Z;else throw G.invalidParameterError("width","positive integer",Z);else this.options.width=-1;if(G.defined(X))if(G.integer(X)&&X>0)this.options.height=X;else throw G.invalidParameterError("height","positive integer",X);else this.options.height=-1;if(G.object(q)){if(G.defined(q.width))if(G.integer(q.width)&&q.width>0)this.options.width=q.width;else throw G.invalidParameterError("width","positive integer",q.width);if(G.defined(q.height))if(G.integer(q.height)&&q.height>0)this.options.height=q.height;else throw G.invalidParameterError("height","positive integer",q.height);if(G.defined(q.fit)){let W=oK[q.fit];if(G.string(W))this.options.canvas=W;else throw G.invalidParameterError("fit","valid fit",q.fit)}if(G.defined(q.position)){let W=G.integer(q.position)?q.position:LX[q.position]||MX[q.position]||AX[q.position];if(G.integer(W)&&(G.inRange(W,0,8)||G.inRange(W,16,17)))this.options.position=W;else throw G.invalidParameterError("position","valid position/gravity/strategy",q.position)}if(this._setBackgroundColourOption("resizeBackground",q.background),G.defined(q.kernel))if(G.string(w3[q.kernel]))this.options.kernel=w3[q.kernel];else throw G.invalidParameterError("kernel","valid kernel name",q.kernel);if(G.defined(q.withoutEnlargement))this._setBooleanOption("withoutEnlargement",q.withoutEnlargement);if(G.defined(q.withoutReduction))this._setBooleanOption("withoutReduction",q.withoutReduction);if(G.defined(q.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",q.fastShrinkOnLoad)}if(D3(this.options)&&v1(this.options))this.options.rotateBefore=!0;return this}function eK(Z){if(G.integer(Z)&&Z>0)this.options.extendTop=Z,this.options.extendBottom=Z,this.options.extendLeft=Z,this.options.extendRight=Z;else if(G.object(Z)){if(G.defined(Z.top))if(G.integer(Z.top)&&Z.top>=0)this.options.extendTop=Z.top;else throw G.invalidParameterError("top","positive integer",Z.top);if(G.defined(Z.bottom))if(G.integer(Z.bottom)&&Z.bottom>=0)this.options.extendBottom=Z.bottom;else throw G.invalidParameterError("bottom","positive integer",Z.bottom);if(G.defined(Z.left))if(G.integer(Z.left)&&Z.left>=0)this.options.extendLeft=Z.left;else throw G.invalidParameterError("left","positive integer",Z.left);if(G.defined(Z.right))if(G.integer(Z.right)&&Z.right>=0)this.options.extendRight=Z.right;else throw G.invalidParameterError("right","positive integer",Z.right);if(this._setBackgroundColourOption("extendBackground",Z.background),G.defined(Z.extendWith))if(G.string(FX[Z.extendWith]))this.options.extendWith=FX[Z.extendWith];else throw G.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",Z.extendWith)}else throw G.invalidParameterError("extend","integer or object",Z);return this}function ZV(Z){let X=v1(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${X}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(q){let W=Z[q];if(G.integer(W)&&W>=0)this.options[q+(q==="left"||q==="top"?"Offset":"")+X]=W;else throw G.invalidParameterError(q,"integer",W)},this),D3(this.options)&&!v1(this.options)){if(this.options.widthPre===-1||this.options.widthPost===-1)this.options.rotateBefore=!0}if(this.options.input.autoOrient)this.options.orientBefore=!0;return this}function XV(Z){if(this.options.trimThreshold=10,G.defined(Z))if(G.object(Z)){if(G.defined(Z.background))this._setBackgroundColourOption("trimBackground",Z.background);if(G.defined(Z.threshold))if(G.number(Z.threshold)&&Z.threshold>=0)this.options.trimThreshold=Z.threshold;else throw G.invalidParameterError("threshold","positive number",Z.threshold);if(G.defined(Z.lineArt))this._setBooleanOption("trimLineArt",Z.lineArt);if(G.defined(Z.margin))if(G.integer(Z.margin)&&Z.margin>=0)this.options.trimMargin=Z.margin;else throw G.invalidParameterError("margin","positive integer",Z.margin)}else throw G.invalidParameterError("trim","object",Z);if(D3(this.options))this.options.rotateBefore=!0;return this}var AX,MX,FX,LX,w3,sK,oK,IX=(Z)=>{Object.assign(Z.prototype,{resize:tK,extend:eK,extract:ZV,trim:XV}),Z.gravity=AX,Z.strategy=LX,Z.kernel=w3,Z.fit=sK,Z.position=MX};var wX=R(()=>{m0();/*!
305
217
  Copyright 2013 Lovell Fuller and others.
306
218
  SPDX-License-Identifier: Apache-2.0
307
- */var _=v0(),l8={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},p8={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},c8={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},n8={entropy:16,attention:17},r5={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},fY={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},uY={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};function i5(Z){return Z.angle%360!==0||Z.rotationAngle!==0}function F6(Z){return Z.width!==-1||Z.height!==-1}function dY(Z,J,X){if(F6(this.options))this.options.debuglog("ignoring previous resize options");if(this.options.widthPost!==-1)this.options.debuglog("operation order will be: extract, resize, extract");if(_.defined(Z))if(_.object(Z)&&!_.defined(X))X=Z;else if(_.integer(Z)&&Z>0)this.options.width=Z;else throw _.invalidParameterError("width","positive integer",Z);else this.options.width=-1;if(_.defined(J))if(_.integer(J)&&J>0)this.options.height=J;else throw _.invalidParameterError("height","positive integer",J);else this.options.height=-1;if(_.object(X)){if(_.defined(X.width))if(_.integer(X.width)&&X.width>0)this.options.width=X.width;else throw _.invalidParameterError("width","positive integer",X.width);if(_.defined(X.height))if(_.integer(X.height)&&X.height>0)this.options.height=X.height;else throw _.invalidParameterError("height","positive integer",X.height);if(_.defined(X.fit)){let q=uY[X.fit];if(_.string(q))this.options.canvas=q;else throw _.invalidParameterError("fit","valid fit",X.fit)}if(_.defined(X.position)){let q=_.integer(X.position)?X.position:n8[X.position]||p8[X.position]||l8[X.position];if(_.integer(q)&&(_.inRange(q,0,8)||_.inRange(q,16,17)))this.options.position=q;else throw _.invalidParameterError("position","valid position/gravity/strategy",X.position)}if(this._setBackgroundColourOption("resizeBackground",X.background),_.defined(X.kernel))if(_.string(r5[X.kernel]))this.options.kernel=r5[X.kernel];else throw _.invalidParameterError("kernel","valid kernel name",X.kernel);if(_.defined(X.withoutEnlargement))this._setBooleanOption("withoutEnlargement",X.withoutEnlargement);if(_.defined(X.withoutReduction))this._setBooleanOption("withoutReduction",X.withoutReduction);if(_.defined(X.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",X.fastShrinkOnLoad)}if(i5(this.options)&&F6(this.options))this.options.rotateBefore=!0;return this}function cY(Z){if(_.integer(Z)&&Z>0)this.options.extendTop=Z,this.options.extendBottom=Z,this.options.extendLeft=Z,this.options.extendRight=Z;else if(_.object(Z)){if(_.defined(Z.top))if(_.integer(Z.top)&&Z.top>=0)this.options.extendTop=Z.top;else throw _.invalidParameterError("top","positive integer",Z.top);if(_.defined(Z.bottom))if(_.integer(Z.bottom)&&Z.bottom>=0)this.options.extendBottom=Z.bottom;else throw _.invalidParameterError("bottom","positive integer",Z.bottom);if(_.defined(Z.left))if(_.integer(Z.left)&&Z.left>=0)this.options.extendLeft=Z.left;else throw _.invalidParameterError("left","positive integer",Z.left);if(_.defined(Z.right))if(_.integer(Z.right)&&Z.right>=0)this.options.extendRight=Z.right;else throw _.invalidParameterError("right","positive integer",Z.right);if(this._setBackgroundColourOption("extendBackground",Z.background),_.defined(Z.extendWith))if(_.string(c8[Z.extendWith]))this.options.extendWith=c8[Z.extendWith];else throw _.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",Z.extendWith)}else throw _.invalidParameterError("extend","integer or object",Z);return this}function lY(Z){let J=F6(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${J}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(X){let q=Z[X];if(_.integer(q)&&q>=0)this.options[X+(X==="left"||X==="top"?"Offset":"")+J]=q;else throw _.invalidParameterError(X,"integer",q)},this),i5(this.options)&&!F6(this.options)){if(this.options.widthPre===-1||this.options.widthPost===-1)this.options.rotateBefore=!0}if(this.options.input.autoOrient)this.options.orientBefore=!0;return this}function pY(Z){if(this.options.trimThreshold=10,_.defined(Z))if(_.object(Z)){if(_.defined(Z.background))this._setBackgroundColourOption("trimBackground",Z.background);if(_.defined(Z.threshold))if(_.number(Z.threshold)&&Z.threshold>=0)this.options.trimThreshold=Z.threshold;else throw _.invalidParameterError("threshold","positive number",Z.threshold);if(_.defined(Z.lineArt))this._setBooleanOption("trimLineArt",Z.lineArt)}else throw _.invalidParameterError("trim","object",Z);if(i5(this.options))this.options.rotateBefore=!0;return this}r8.exports=(Z)=>{Object.assign(Z.prototype,{resize:dY,extend:cY,extract:lY,trim:pY}),Z.gravity=l8,Z.strategy=n8,Z.kernel=r5,Z.fit=fY,Z.position=p8}});var s8=b((CH,a8)=>{/*!
219
+ */AX={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},MX={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},FX={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},LX={entropy:16,attention:17},w3={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},sK={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},oK={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function qV(Z){if(!Array.isArray(Z))throw G.invalidParameterError("images to composite","array",Z);return this.options.composite=Z.map((X)=>{if(!G.object(X))throw G.invalidParameterError("image to composite","object",X);let q=this._inputOptionsFromObject(X),W={input:this._createInputDescriptor(X.input,q,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(G.defined(X.blend))if(G.string(N3[X.blend]))W.blend=N3[X.blend];else throw G.invalidParameterError("blend","valid blend name",X.blend);if(G.defined(X.tile))if(G.bool(X.tile))W.tile=X.tile;else throw G.invalidParameterError("tile","boolean",X.tile);if(G.defined(X.left))if(G.integer(X.left))W.left=X.left;else throw G.invalidParameterError("left","integer",X.left);if(G.defined(X.top))if(G.integer(X.top))W.top=X.top;else throw G.invalidParameterError("top","integer",X.top);if(G.defined(X.top)!==G.defined(X.left))throw Error("Expected both left and top to be set");else W.hasOffset=G.integer(X.top)&&G.integer(X.left);if(G.defined(X.gravity))if(G.integer(X.gravity)&&G.inRange(X.gravity,0,8))W.gravity=X.gravity;else if(G.string(X.gravity)&&G.integer(this.constructor.gravity[X.gravity]))W.gravity=this.constructor.gravity[X.gravity];else throw G.invalidParameterError("gravity","valid gravity",X.gravity);if(G.defined(X.premultiplied))if(G.bool(X.premultiplied))W.premultiplied=X.premultiplied;else throw G.invalidParameterError("premultiplied","boolean",X.premultiplied);return W}),this}var N3,DX=(Z)=>{Z.prototype.composite=qV,Z.blend=N3};var NX=R(()=>{m0();/*!
308
220
  Copyright 2013 Lovell Fuller and others.
309
221
  SPDX-License-Identifier: Apache-2.0
310
- */var d=v0(),a5={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"};function nY(Z){if(!Array.isArray(Z))throw d.invalidParameterError("images to composite","array",Z);return this.options.composite=Z.map((J)=>{if(!d.object(J))throw d.invalidParameterError("image to composite","object",J);let X=this._inputOptionsFromObject(J),q={input:this._createInputDescriptor(J.input,X,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(d.defined(J.blend))if(d.string(a5[J.blend]))q.blend=a5[J.blend];else throw d.invalidParameterError("blend","valid blend name",J.blend);if(d.defined(J.tile))if(d.bool(J.tile))q.tile=J.tile;else throw d.invalidParameterError("tile","boolean",J.tile);if(d.defined(J.left))if(d.integer(J.left))q.left=J.left;else throw d.invalidParameterError("left","integer",J.left);if(d.defined(J.top))if(d.integer(J.top))q.top=J.top;else throw d.invalidParameterError("top","integer",J.top);if(d.defined(J.top)!==d.defined(J.left))throw Error("Expected both left and top to be set");else q.hasOffset=d.integer(J.top)&&d.integer(J.left);if(d.defined(J.gravity))if(d.integer(J.gravity)&&d.inRange(J.gravity,0,8))q.gravity=J.gravity;else if(d.string(J.gravity)&&d.integer(this.constructor.gravity[J.gravity]))q.gravity=this.constructor.gravity[J.gravity];else throw d.invalidParameterError("gravity","valid gravity",J.gravity);if(d.defined(J.premultiplied))if(d.bool(J.premultiplied))q.premultiplied=J.premultiplied;else throw d.invalidParameterError("premultiplied","boolean",J.premultiplied);return q}),this}a8.exports=(Z)=>{Z.prototype.composite=nY,Z.blend=a5}});var JZ=b((EH,ZZ)=>{/*!
222
+ */N3={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"}});function WV(Z,X){if(!G.defined(Z))return this.autoOrient();if(this.options.angle||this.options.rotationAngle)this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0;if(G.integer(Z)&&!(Z%90))this.options.angle=Z;else if(G.number(Z)){if(this.options.rotationAngle=Z,G.object(X)&&X.background)this._setBackgroundColourOption("rotationBackground",X.background)}else throw G.invalidParameterError("angle","numeric",Z);return this}function QV(){return this.options.input.autoOrient=!0,this}function JV(Z){return this.options.flip=G.bool(Z)?Z:!0,this}function zV(Z){return this.options.flop=G.bool(Z)?Z:!0,this}function GV(Z,X){let q=Array.isArray(Z)?[].concat(...Z):[];if(q.length===4&&q.every(G.number))this.options.affineMatrix=q;else throw G.invalidParameterError("matrix","1x4 or 2x2 array",Z);if(G.defined(X))if(G.object(X)){if(this._setBackgroundColourOption("affineBackground",X.background),G.defined(X.idx))if(G.number(X.idx))this.options.affineIdx=X.idx;else throw G.invalidParameterError("options.idx","number",X.idx);if(G.defined(X.idy))if(G.number(X.idy))this.options.affineIdy=X.idy;else throw G.invalidParameterError("options.idy","number",X.idy);if(G.defined(X.odx))if(G.number(X.odx))this.options.affineOdx=X.odx;else throw G.invalidParameterError("options.odx","number",X.odx);if(G.defined(X.ody))if(G.number(X.ody))this.options.affineOdy=X.ody;else throw G.invalidParameterError("options.ody","number",X.ody);if(G.defined(X.interpolator))if(G.inArray(X.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=X.interpolator;else throw G.invalidParameterError("options.interpolator","valid interpolator name",X.interpolator)}else throw G.invalidParameterError("options","object",X);return this}function YV(Z){if(G.plainObject(Z)){if(G.number(Z.sigma)&&G.inRange(Z.sigma,0.000001,10))this.options.sharpenSigma=Z.sigma;else throw G.invalidParameterError("options.sigma","number between 0.000001 and 10",Z.sigma);if(G.defined(Z.m1))if(G.number(Z.m1)&&G.inRange(Z.m1,0,1e6))this.options.sharpenM1=Z.m1;else throw G.invalidParameterError("options.m1","number between 0 and 1000000",Z.m1);if(G.defined(Z.m2))if(G.number(Z.m2)&&G.inRange(Z.m2,0,1e6))this.options.sharpenM2=Z.m2;else throw G.invalidParameterError("options.m2","number between 0 and 1000000",Z.m2);if(G.defined(Z.x1))if(G.number(Z.x1)&&G.inRange(Z.x1,0,1e6))this.options.sharpenX1=Z.x1;else throw G.invalidParameterError("options.x1","number between 0 and 1000000",Z.x1);if(G.defined(Z.y2))if(G.number(Z.y2)&&G.inRange(Z.y2,0,1e6))this.options.sharpenY2=Z.y2;else throw G.invalidParameterError("options.y2","number between 0 and 1000000",Z.y2);if(G.defined(Z.y3))if(G.number(Z.y3)&&G.inRange(Z.y3,0,1e6))this.options.sharpenY3=Z.y3;else throw G.invalidParameterError("options.y3","number between 0 and 1000000",Z.y3)}else this.options.sharpenSigma=-1;return this}function UV(Z){if(!G.defined(Z))this.options.medianSize=3;else if(G.integer(Z)&&G.inRange(Z,1,1000))this.options.medianSize=Z;else throw G.invalidParameterError("size","integer between 1 and 1000",Z);return this}function KV(Z){let X;if(G.number(Z))X=Z;else if(G.plainObject(Z)){if(!G.number(Z.sigma))throw G.invalidParameterError("options.sigma","number between 0.3 and 1000",X);if(X=Z.sigma,"precision"in Z)if(G.string(TX[Z.precision]))this.options.precision=TX[Z.precision];else throw G.invalidParameterError("precision","one of: integer, float, approximate",Z.precision);if("minAmplitude"in Z)if(G.number(Z.minAmplitude)&&G.inRange(Z.minAmplitude,0.001,1))this.options.minAmpl=Z.minAmplitude;else throw G.invalidParameterError("minAmplitude","number between 0.001 and 1",Z.minAmplitude)}if(!G.defined(Z))this.options.blurSigma=-1;else if(G.bool(Z))this.options.blurSigma=Z?-1:0;else if(G.number(X)&&G.inRange(X,0.3,1000))this.options.blurSigma=X;else throw G.invalidParameterError("sigma","number between 0.3 and 1000",X);return this}function RX(Z){if(!G.defined(Z))this.options.dilateWidth=1;else if(G.integer(Z)&&Z>0)this.options.dilateWidth=Z;else throw G.invalidParameterError("dilate","positive integer",RX);return this}function _X(Z){if(!G.defined(Z))this.options.erodeWidth=1;else if(G.integer(Z)&&Z>0)this.options.erodeWidth=Z;else throw G.invalidParameterError("erode","positive integer",_X);return this}function VV(Z){if(this.options.flatten=G.bool(Z)?Z:!0,G.object(Z))this._setBackgroundColourOption("flattenBackground",Z.background);return this}function BV(){return this.options.unflatten=!0,this}function HV(Z,X){if(!G.defined(Z))this.options.gamma=2.2;else if(G.number(Z)&&G.inRange(Z,1,3))this.options.gamma=Z;else throw G.invalidParameterError("gamma","number between 1.0 and 3.0",Z);if(!G.defined(X))this.options.gammaOut=this.options.gamma;else if(G.number(X)&&G.inRange(X,1,3))this.options.gammaOut=X;else throw G.invalidParameterError("gammaOut","number between 1.0 and 3.0",X);return this}function $V(Z){if(this.options.negate=G.bool(Z)?Z:!0,G.plainObject(Z)&&"alpha"in Z)if(!G.bool(Z.alpha))throw G.invalidParameterError("alpha","should be boolean value",Z.alpha);else this.options.negateAlpha=Z.alpha;return this}function FV(Z){if(G.plainObject(Z)){if(G.defined(Z.lower))if(G.number(Z.lower)&&G.inRange(Z.lower,0,99))this.options.normaliseLower=Z.lower;else throw G.invalidParameterError("lower","number between 0 and 99",Z.lower);if(G.defined(Z.upper))if(G.number(Z.upper)&&G.inRange(Z.upper,1,100))this.options.normaliseUpper=Z.upper;else throw G.invalidParameterError("upper","number between 1 and 100",Z.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw G.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function AV(Z){return this.normalise(Z)}function MV(Z){if(G.plainObject(Z)){if(G.integer(Z.width)&&Z.width>0)this.options.claheWidth=Z.width;else throw G.invalidParameterError("width","integer greater than zero",Z.width);if(G.integer(Z.height)&&Z.height>0)this.options.claheHeight=Z.height;else throw G.invalidParameterError("height","integer greater than zero",Z.height);if(G.defined(Z.maxSlope))if(G.integer(Z.maxSlope)&&G.inRange(Z.maxSlope,0,100))this.options.claheMaxSlope=Z.maxSlope;else throw G.invalidParameterError("maxSlope","integer between 0 and 100",Z.maxSlope)}else throw G.invalidParameterError("options","plain object",Z);return this}function LV(Z){if(!G.object(Z)||!Array.isArray(Z.kernel)||!G.integer(Z.width)||!G.integer(Z.height)||!G.inRange(Z.width,3,1001)||!G.inRange(Z.height,3,1001)||Z.height*Z.width!==Z.kernel.length)throw Error("Invalid convolution kernel");if(!G.integer(Z.scale))Z.scale=Z.kernel.reduce((X,q)=>X+q,0);if(Z.scale<1)Z.scale=1;if(!G.integer(Z.offset))Z.offset=0;return this.options.convKernel=Z,this}function IV(Z,X){if(!G.defined(Z))this.options.threshold=128;else if(G.bool(Z))this.options.threshold=Z?128:0;else if(G.integer(Z)&&G.inRange(Z,0,255))this.options.threshold=Z;else throw G.invalidParameterError("threshold","integer between 0 and 255",Z);if(!G.object(X)||X.greyscale===!0||X.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function wV(Z,X,q){if(this.options.boolean=this._createInputDescriptor(Z,q),G.string(X)&&G.inArray(X,["and","or","eor"]))this.options.booleanOp=X;else throw G.invalidParameterError("operator","one of: and, or, eor",X);return this}function DV(Z,X){if(!G.defined(Z)&&G.number(X))Z=1;else if(G.number(Z)&&!G.defined(X))X=0;if(!G.defined(Z))this.options.linearA=[];else if(G.number(Z))this.options.linearA=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every(G.number))this.options.linearA=Z;else throw G.invalidParameterError("a","number or array of numbers",Z);if(!G.defined(X))this.options.linearB=[];else if(G.number(X))this.options.linearB=[X];else if(Array.isArray(X)&&X.length&&X.every(G.number))this.options.linearB=X;else throw G.invalidParameterError("b","number or array of numbers",X);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function NV(Z){if(!Array.isArray(Z))throw G.invalidParameterError("inputMatrix","array",Z);if(Z.length!==3&&Z.length!==4)throw G.invalidParameterError("inputMatrix","3x3 or 4x4 array",Z.length);let X=Z.flat().map(Number);if(X.length!==9&&X.length!==16)throw G.invalidParameterError("inputMatrix","cardinality of 9 or 16",X.length);return this.options.recombMatrix=X,this}function TV(Z){if(!G.plainObject(Z))throw G.invalidParameterError("options","plain object",Z);if("brightness"in Z)if(G.number(Z.brightness)&&Z.brightness>=0)this.options.brightness=Z.brightness;else throw G.invalidParameterError("brightness","number above zero",Z.brightness);if("saturation"in Z)if(G.number(Z.saturation)&&Z.saturation>=0)this.options.saturation=Z.saturation;else throw G.invalidParameterError("saturation","number above zero",Z.saturation);if("hue"in Z)if(G.integer(Z.hue))this.options.hue=Z.hue%360;else throw G.invalidParameterError("hue","number",Z.hue);if("lightness"in Z)if(G.number(Z.lightness))this.options.lightness=Z.lightness;else throw G.invalidParameterError("lightness","number",Z.lightness);return this}var TX,PX=(Z)=>{Object.assign(Z.prototype,{autoOrient:QV,rotate:WV,flip:JV,flop:zV,affine:GV,sharpen:YV,erode:_X,dilate:RX,median:UV,blur:KV,flatten:VV,unflatten:BV,gamma:HV,negate:$V,normalise:FV,normalize:AV,clahe:MV,convolve:LV,threshold:IV,boolean:wV,linear:DV,recomb:NV,modulate:TV})};var jX=R(()=>{m0();/*!
311
223
  Copyright 2013 Lovell Fuller and others.
312
224
  SPDX-License-Identifier: Apache-2.0
313
- */var M=v0(),o8={integer:"integer",float:"float",approximate:"approximate"};function rY(Z,J){if(!M.defined(Z))return this.autoOrient();if(this.options.angle||this.options.rotationAngle)this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0;if(M.integer(Z)&&!(Z%90))this.options.angle=Z;else if(M.number(Z)){if(this.options.rotationAngle=Z,M.object(J)&&J.background)this._setBackgroundColourOption("rotationBackground",J.background)}else throw M.invalidParameterError("angle","numeric",Z);return this}function iY(){return this.options.input.autoOrient=!0,this}function aY(Z){return this.options.flip=M.bool(Z)?Z:!0,this}function sY(Z){return this.options.flop=M.bool(Z)?Z:!0,this}function oY(Z,J){let X=[].concat(...Z);if(X.length===4&&X.every(M.number))this.options.affineMatrix=X;else throw M.invalidParameterError("matrix","1x4 or 2x2 array",Z);if(M.defined(J))if(M.object(J)){if(this._setBackgroundColourOption("affineBackground",J.background),M.defined(J.idx))if(M.number(J.idx))this.options.affineIdx=J.idx;else throw M.invalidParameterError("options.idx","number",J.idx);if(M.defined(J.idy))if(M.number(J.idy))this.options.affineIdy=J.idy;else throw M.invalidParameterError("options.idy","number",J.idy);if(M.defined(J.odx))if(M.number(J.odx))this.options.affineOdx=J.odx;else throw M.invalidParameterError("options.odx","number",J.odx);if(M.defined(J.ody))if(M.number(J.ody))this.options.affineOdy=J.ody;else throw M.invalidParameterError("options.ody","number",J.ody);if(M.defined(J.interpolator))if(M.inArray(J.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=J.interpolator;else throw M.invalidParameterError("options.interpolator","valid interpolator name",J.interpolator)}else throw M.invalidParameterError("options","object",J);return this}function tY(Z,J,X){if(!M.defined(Z))this.options.sharpenSigma=-1;else if(M.bool(Z))this.options.sharpenSigma=Z?-1:0;else if(M.number(Z)&&M.inRange(Z,0.01,1e4)){if(this.options.sharpenSigma=Z,M.defined(J))if(M.number(J)&&M.inRange(J,0,1e4))this.options.sharpenM1=J;else throw M.invalidParameterError("flat","number between 0 and 10000",J);if(M.defined(X))if(M.number(X)&&M.inRange(X,0,1e4))this.options.sharpenM2=X;else throw M.invalidParameterError("jagged","number between 0 and 10000",X)}else if(M.plainObject(Z)){if(M.number(Z.sigma)&&M.inRange(Z.sigma,0.000001,10))this.options.sharpenSigma=Z.sigma;else throw M.invalidParameterError("options.sigma","number between 0.000001 and 10",Z.sigma);if(M.defined(Z.m1))if(M.number(Z.m1)&&M.inRange(Z.m1,0,1e6))this.options.sharpenM1=Z.m1;else throw M.invalidParameterError("options.m1","number between 0 and 1000000",Z.m1);if(M.defined(Z.m2))if(M.number(Z.m2)&&M.inRange(Z.m2,0,1e6))this.options.sharpenM2=Z.m2;else throw M.invalidParameterError("options.m2","number between 0 and 1000000",Z.m2);if(M.defined(Z.x1))if(M.number(Z.x1)&&M.inRange(Z.x1,0,1e6))this.options.sharpenX1=Z.x1;else throw M.invalidParameterError("options.x1","number between 0 and 1000000",Z.x1);if(M.defined(Z.y2))if(M.number(Z.y2)&&M.inRange(Z.y2,0,1e6))this.options.sharpenY2=Z.y2;else throw M.invalidParameterError("options.y2","number between 0 and 1000000",Z.y2);if(M.defined(Z.y3))if(M.number(Z.y3)&&M.inRange(Z.y3,0,1e6))this.options.sharpenY3=Z.y3;else throw M.invalidParameterError("options.y3","number between 0 and 1000000",Z.y3)}else throw M.invalidParameterError("sigma","number between 0.01 and 10000",Z);return this}function eY(Z){if(!M.defined(Z))this.options.medianSize=3;else if(M.integer(Z)&&M.inRange(Z,1,1000))this.options.medianSize=Z;else throw M.invalidParameterError("size","integer between 1 and 1000",Z);return this}function Zz(Z){let J;if(M.number(Z))J=Z;else if(M.plainObject(Z)){if(!M.number(Z.sigma))throw M.invalidParameterError("options.sigma","number between 0.3 and 1000",J);if(J=Z.sigma,"precision"in Z)if(M.string(o8[Z.precision]))this.options.precision=o8[Z.precision];else throw M.invalidParameterError("precision","one of: integer, float, approximate",Z.precision);if("minAmplitude"in Z)if(M.number(Z.minAmplitude)&&M.inRange(Z.minAmplitude,0.001,1))this.options.minAmpl=Z.minAmplitude;else throw M.invalidParameterError("minAmplitude","number between 0.001 and 1",Z.minAmplitude)}if(!M.defined(Z))this.options.blurSigma=-1;else if(M.bool(Z))this.options.blurSigma=Z?-1:0;else if(M.number(J)&&M.inRange(J,0.3,1000))this.options.blurSigma=J;else throw M.invalidParameterError("sigma","number between 0.3 and 1000",J);return this}function t8(Z){if(!M.defined(Z))this.options.dilateWidth=1;else if(M.integer(Z)&&Z>0)this.options.dilateWidth=Z;else throw M.invalidParameterError("dilate","positive integer",t8);return this}function e8(Z){if(!M.defined(Z))this.options.erodeWidth=1;else if(M.integer(Z)&&Z>0)this.options.erodeWidth=Z;else throw M.invalidParameterError("erode","positive integer",e8);return this}function Jz(Z){if(this.options.flatten=M.bool(Z)?Z:!0,M.object(Z))this._setBackgroundColourOption("flattenBackground",Z.background);return this}function Xz(){return this.options.unflatten=!0,this}function qz(Z,J){if(!M.defined(Z))this.options.gamma=2.2;else if(M.number(Z)&&M.inRange(Z,1,3))this.options.gamma=Z;else throw M.invalidParameterError("gamma","number between 1.0 and 3.0",Z);if(!M.defined(J))this.options.gammaOut=this.options.gamma;else if(M.number(J)&&M.inRange(J,1,3))this.options.gammaOut=J;else throw M.invalidParameterError("gammaOut","number between 1.0 and 3.0",J);return this}function Wz(Z){if(this.options.negate=M.bool(Z)?Z:!0,M.plainObject(Z)&&"alpha"in Z)if(!M.bool(Z.alpha))throw M.invalidParameterError("alpha","should be boolean value",Z.alpha);else this.options.negateAlpha=Z.alpha;return this}function Qz(Z){if(M.plainObject(Z)){if(M.defined(Z.lower))if(M.number(Z.lower)&&M.inRange(Z.lower,0,99))this.options.normaliseLower=Z.lower;else throw M.invalidParameterError("lower","number between 0 and 99",Z.lower);if(M.defined(Z.upper))if(M.number(Z.upper)&&M.inRange(Z.upper,1,100))this.options.normaliseUpper=Z.upper;else throw M.invalidParameterError("upper","number between 1 and 100",Z.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw M.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function Gz(Z){return this.normalise(Z)}function Yz(Z){if(M.plainObject(Z)){if(M.integer(Z.width)&&Z.width>0)this.options.claheWidth=Z.width;else throw M.invalidParameterError("width","integer greater than zero",Z.width);if(M.integer(Z.height)&&Z.height>0)this.options.claheHeight=Z.height;else throw M.invalidParameterError("height","integer greater than zero",Z.height);if(M.defined(Z.maxSlope))if(M.integer(Z.maxSlope)&&M.inRange(Z.maxSlope,0,100))this.options.claheMaxSlope=Z.maxSlope;else throw M.invalidParameterError("maxSlope","integer between 0 and 100",Z.maxSlope)}else throw M.invalidParameterError("options","plain object",Z);return this}function zz(Z){if(!M.object(Z)||!Array.isArray(Z.kernel)||!M.integer(Z.width)||!M.integer(Z.height)||!M.inRange(Z.width,3,1001)||!M.inRange(Z.height,3,1001)||Z.height*Z.width!==Z.kernel.length)throw Error("Invalid convolution kernel");if(!M.integer(Z.scale))Z.scale=Z.kernel.reduce((J,X)=>J+X,0);if(Z.scale<1)Z.scale=1;if(!M.integer(Z.offset))Z.offset=0;return this.options.convKernel=Z,this}function Uz(Z,J){if(!M.defined(Z))this.options.threshold=128;else if(M.bool(Z))this.options.threshold=Z?128:0;else if(M.integer(Z)&&M.inRange(Z,0,255))this.options.threshold=Z;else throw M.invalidParameterError("threshold","integer between 0 and 255",Z);if(!M.object(J)||J.greyscale===!0||J.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function Kz(Z,J,X){if(this.options.boolean=this._createInputDescriptor(Z,X),M.string(J)&&M.inArray(J,["and","or","eor"]))this.options.booleanOp=J;else throw M.invalidParameterError("operator","one of: and, or, eor",J);return this}function Vz(Z,J){if(!M.defined(Z)&&M.number(J))Z=1;else if(M.number(Z)&&!M.defined(J))J=0;if(!M.defined(Z))this.options.linearA=[];else if(M.number(Z))this.options.linearA=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every(M.number))this.options.linearA=Z;else throw M.invalidParameterError("a","number or array of numbers",Z);if(!M.defined(J))this.options.linearB=[];else if(M.number(J))this.options.linearB=[J];else if(Array.isArray(J)&&J.length&&J.every(M.number))this.options.linearB=J;else throw M.invalidParameterError("b","number or array of numbers",J);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function Bz(Z){if(!Array.isArray(Z))throw M.invalidParameterError("inputMatrix","array",Z);if(Z.length!==3&&Z.length!==4)throw M.invalidParameterError("inputMatrix","3x3 or 4x4 array",Z.length);let J=Z.flat().map(Number);if(J.length!==9&&J.length!==16)throw M.invalidParameterError("inputMatrix","cardinality of 9 or 16",J.length);return this.options.recombMatrix=J,this}function Hz(Z){if(!M.plainObject(Z))throw M.invalidParameterError("options","plain object",Z);if("brightness"in Z)if(M.number(Z.brightness)&&Z.brightness>=0)this.options.brightness=Z.brightness;else throw M.invalidParameterError("brightness","number above zero",Z.brightness);if("saturation"in Z)if(M.number(Z.saturation)&&Z.saturation>=0)this.options.saturation=Z.saturation;else throw M.invalidParameterError("saturation","number above zero",Z.saturation);if("hue"in Z)if(M.integer(Z.hue))this.options.hue=Z.hue%360;else throw M.invalidParameterError("hue","number",Z.hue);if("lightness"in Z)if(M.number(Z.lightness))this.options.lightness=Z.lightness;else throw M.invalidParameterError("lightness","number",Z.lightness);return this}ZZ.exports=(Z)=>{Object.assign(Z.prototype,{autoOrient:iY,rotate:rY,flip:aY,flop:sY,affine:oY,sharpen:tY,erode:e8,dilate:t8,median:eY,blur:Zz,flatten:Jz,unflatten:Xz,gamma:qz,negate:Wz,normalise:Qz,normalize:Gz,clahe:Yz,convolve:zz,threshold:Uz,boolean:Kz,linear:Vz,recomb:Bz,modulate:Hz})}});var YZ=b((OH,GZ)=>{var{defineProperty:Z7,getOwnPropertyDescriptor:$z,getOwnPropertyNames:Fz}=Object,Mz=Object.prototype.hasOwnProperty,Az=(Z,J)=>{for(var X in J)Z7(Z,X,{get:J[X],enumerable:!0})},Lz=(Z,J,X,q)=>{if(J&&typeof J==="object"||typeof J==="function"){for(let W of Fz(J))if(!Mz.call(Z,W)&&W!==X)Z7(Z,W,{get:()=>J[W],enumerable:!(q=$z(J,W))||q.enumerable})}return Z},Iz=(Z)=>Lz(Z7({},"__esModule",{value:!0}),Z),XZ={};Az(XZ,{default:()=>Sz});GZ.exports=Iz(XZ);var s5={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let Z in s5)Object.freeze(s5[Z]);var f0=Object.freeze(s5),qZ=Object.create(null);for(let Z in f0)if(Object.hasOwn(f0,Z))qZ[f0[Z]]=Z;var A0={to:{},get:{}};A0.get=function(Z){let J=Z.slice(0,3).toLowerCase(),X,q;switch(J){case"hsl":{X=A0.get.hsl(Z),q="hsl";break}case"hwb":{X=A0.get.hwb(Z),q="hwb";break}default:{X=A0.get.rgb(Z),q="rgb";break}}if(!X)return null;return{model:q,value:X}};A0.get.rgb=function(Z){if(!Z)return null;let J=/^#([a-f\d]{3,4})$/i,X=/^#([a-f\d]{6})([a-f\d]{2})?$/i,q=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,W=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,Q=/^(\w+)$/,G=[0,0,0,1],z,Y,U;if(z=Z.match(X)){U=z[2],z=z[1];for(Y=0;Y<3;Y++){let K=Y*2;G[Y]=Number.parseInt(z.slice(K,K+2),16)}if(U)G[3]=Number.parseInt(U,16)/255}else if(z=Z.match(J)){z=z[1],U=z[3];for(Y=0;Y<3;Y++)G[Y]=Number.parseInt(z[Y]+z[Y],16);if(U)G[3]=Number.parseInt(U+U,16)/255}else if(z=Z.match(q)){for(Y=0;Y<3;Y++)G[Y]=Number.parseFloat(z[Y+1]);if(z[4])G[3]=z[5]?Number.parseFloat(z[4])*0.01:Number.parseFloat(z[4])}else if(z=Z.match(W)){for(Y=0;Y<3;Y++)G[Y]=Math.round(Number.parseFloat(z[Y+1])*2.55);if(z[4])G[3]=z[5]?Number.parseFloat(z[4])*0.01:Number.parseFloat(z[4])}else if(z=Z.toLowerCase().match(Q)){if(z[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(f0,z[1]))return null;return G=f0[z[1]].slice(),G[3]=1,G}else return null;for(Y=0;Y<3;Y++)G[Y]=W4(G[Y],0,255);return G[3]=W4(G[3],0,1),G};A0.get.hsl=function(Z){if(!Z)return null;let J=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=Z.match(J);if(X){let q=Number.parseFloat(X[4]),W=(Number.parseFloat(X[1])%360+360)%360,Q=W4(Number.parseFloat(X[2]),0,100),G=W4(Number.parseFloat(X[3]),0,100),z=W4(Number.isNaN(q)?1:q,0,1);return[W,Q,G,z]}return null};A0.get.hwb=function(Z){if(!Z)return null;let J=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=Z.match(J);if(X){let q=Number.parseFloat(X[4]),W=(Number.parseFloat(X[1])%360+360)%360,Q=W4(Number.parseFloat(X[2]),0,100),G=W4(Number.parseFloat(X[3]),0,100),z=W4(Number.isNaN(q)?1:q,0,1);return[W,Q,G,z]}return null};A0.to.hex=function(...Z){return"#"+M6(Z[0])+M6(Z[1])+M6(Z[2])+(Z[3]<1?M6(Math.round(Z[3]*255)):"")};A0.to.rgb=function(...Z){return Z.length<4||Z[3]===1?"rgb("+Math.round(Z[0])+", "+Math.round(Z[1])+", "+Math.round(Z[2])+")":"rgba("+Math.round(Z[0])+", "+Math.round(Z[1])+", "+Math.round(Z[2])+", "+Z[3]+")"};A0.to.rgb.percent=function(...Z){let J=Math.round(Z[0]/255*100),X=Math.round(Z[1]/255*100),q=Math.round(Z[2]/255*100);return Z.length<4||Z[3]===1?"rgb("+J+"%, "+X+"%, "+q+"%)":"rgba("+J+"%, "+X+"%, "+q+"%, "+Z[3]+")"};A0.to.hsl=function(...Z){return Z.length<4||Z[3]===1?"hsl("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%)":"hsla("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%, "+Z[3]+")"};A0.to.hwb=function(...Z){let J="";if(Z.length>=4&&Z[3]!==1)J=", "+Z[3];return"hwb("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%"+J+")"};A0.to.keyword=function(...Z){return qZ[Z.slice(0,3)]};function W4(Z,J,X){return Math.min(Math.max(J,Z),X)}function M6(Z){let J=Math.round(Z).toString(16).toUpperCase();return J.length<2?"0"+J:J}var p4=A0,WZ={};for(let Z of Object.keys(f0))WZ[f0[Z]]=Z;var T={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},D4=T,i0=0.008856451679035631;function r4(Z){let J=Z>0.0031308?1.055*Z**0.4166666666666667-0.055:Z*12.92;return Math.min(Math.max(0,J),1)}function i4(Z){return Z>0.04045?((Z+0.055)/1.055)**2.4:Z/12.92}for(let Z of Object.keys(T)){if(!("channels"in T[Z]))throw Error("missing channels property: "+Z);if(!("labels"in T[Z]))throw Error("missing channel labels property: "+Z);if(T[Z].labels.length!==T[Z].channels)throw Error("channel and label counts mismatch: "+Z);let{channels:J,labels:X}=T[Z];delete T[Z].channels,delete T[Z].labels,Object.defineProperty(T[Z],"channels",{value:J}),Object.defineProperty(T[Z],"labels",{value:X})}T.rgb.hsl=function(Z){let J=Z[0]/255,X=Z[1]/255,q=Z[2]/255,W=Math.min(J,X,q),Q=Math.max(J,X,q),G=Q-W,z,Y;switch(Q){case W:{z=0;break}case J:{z=(X-q)/G;break}case X:{z=2+(q-J)/G;break}case q:{z=4+(J-X)/G;break}}if(z=Math.min(z*60,360),z<0)z+=360;let U=(W+Q)/2;if(Q===W)Y=0;else if(U<=0.5)Y=G/(Q+W);else Y=G/(2-Q-W);return[z,Y*100,U*100]};T.rgb.hsv=function(Z){let J,X,q,W,Q,G=Z[0]/255,z=Z[1]/255,Y=Z[2]/255,U=Math.max(G,z,Y),K=U-Math.min(G,z,Y),V=function(H){return(U-H)/6/K+0.5};if(K===0)W=0,Q=0;else{switch(Q=K/U,J=V(G),X=V(z),q=V(Y),U){case G:{W=q-X;break}case z:{W=0.3333333333333333+J-q;break}case Y:{W=0.6666666666666666+X-J;break}}if(W<0)W+=1;else if(W>1)W-=1}return[W*360,Q*100,U*100]};T.rgb.hwb=function(Z){let J=Z[0],X=Z[1],q=Z[2],W=T.rgb.hsl(Z)[0],Q=0.00392156862745098*Math.min(J,Math.min(X,q));return q=1-0.00392156862745098*Math.max(J,Math.max(X,q)),[W,Q*100,q*100]};T.rgb.oklab=function(Z){let J=i4(Z[0]/255),X=i4(Z[1]/255),q=i4(Z[2]/255),W=Math.cbrt(0.4122214708*J+0.5363325363*X+0.0514459929*q),Q=Math.cbrt(0.2119034982*J+0.6806995451*X+0.1073969566*q),G=Math.cbrt(0.0883024619*J+0.2817188376*X+0.6299787005*q),z=0.2104542553*W+0.793617785*Q-0.0040720468*G,Y=1.9779984951*W-2.428592205*Q+0.4505937099*G,U=0.0259040371*W+0.7827717662*Q-0.808675766*G;return[z*100,Y*100,U*100]};T.rgb.cmyk=function(Z){let J=Z[0]/255,X=Z[1]/255,q=Z[2]/255,W=Math.min(1-J,1-X,1-q),Q=(1-J-W)/(1-W)||0,G=(1-X-W)/(1-W)||0,z=(1-q-W)/(1-W)||0;return[Q*100,G*100,z*100,W*100]};function Dz(Z,J){return(Z[0]-J[0])**2+(Z[1]-J[1])**2+(Z[2]-J[2])**2}T.rgb.keyword=function(Z){let J=WZ[Z];if(J)return J;let X=Number.POSITIVE_INFINITY,q;for(let W of Object.keys(f0)){let Q=f0[W],G=Dz(Z,Q);if(G<X)X=G,q=W}return q};T.keyword.rgb=function(Z){return[...f0[Z]]};T.rgb.xyz=function(Z){let J=i4(Z[0]/255),X=i4(Z[1]/255),q=i4(Z[2]/255),W=J*0.4124564+X*0.3575761+q*0.1804375,Q=J*0.2126729+X*0.7151522+q*0.072175,G=J*0.0193339+X*0.119192+q*0.9503041;return[W*100,Q*100,G*100]};T.rgb.lab=function(Z){let J=T.rgb.xyz(Z),X=J[0],q=J[1],W=J[2];X/=95.047,q/=100,W/=108.883,X=X>i0?X**0.3333333333333333:7.787*X+0.13793103448275862,q=q>i0?q**0.3333333333333333:7.787*q+0.13793103448275862,W=W>i0?W**0.3333333333333333:7.787*W+0.13793103448275862;let Q=116*q-16,G=500*(X-q),z=200*(q-W);return[Q,G,z]};T.hsl.rgb=function(Z){let J=Z[0]/360,X=Z[1]/100,q=Z[2]/100,W,Q;if(X===0)return Q=q*255,[Q,Q,Q];let G=q<0.5?q*(1+X):q+X-q*X,z=2*q-G,Y=[0,0,0];for(let U=0;U<3;U++){if(W=J+0.3333333333333333*-(U-1),W<0)W++;if(W>1)W--;if(6*W<1)Q=z+(G-z)*6*W;else if(2*W<1)Q=G;else if(3*W<2)Q=z+(G-z)*(0.6666666666666666-W)*6;else Q=z;Y[U]=Q*255}return Y};T.hsl.hsv=function(Z){let J=Z[0],X=Z[1]/100,q=Z[2]/100,W=X,Q=Math.max(q,0.01);q*=2,X*=q<=1?q:2-q,W*=Q<=1?Q:2-Q;let G=(q+X)/2,z=q===0?2*W/(Q+W):2*X/(q+X);return[J,z*100,G*100]};T.hsv.rgb=function(Z){let J=Z[0]/60,X=Z[1]/100,q=Z[2]/100,W=Math.floor(J)%6,Q=J-Math.floor(J),G=255*q*(1-X),z=255*q*(1-X*Q),Y=255*q*(1-X*(1-Q));switch(q*=255,W){case 0:return[q,Y,G];case 1:return[z,q,G];case 2:return[G,q,Y];case 3:return[G,z,q];case 4:return[Y,G,q];case 5:return[q,G,z]}};T.hsv.hsl=function(Z){let J=Z[0],X=Z[1]/100,q=Z[2]/100,W=Math.max(q,0.01),Q,G;G=(2-X)*q;let z=(2-X)*W;return Q=X*W,Q/=z<=1?z:2-z,Q=Q||0,G/=2,[J,Q*100,G*100]};T.hwb.rgb=function(Z){let J=Z[0]/360,X=Z[1]/100,q=Z[2]/100,W=X+q,Q;if(W>1)X/=W,q/=W;let G=Math.floor(6*J),z=1-q;if(Q=6*J-G,(G&1)!==0)Q=1-Q;let Y=X+Q*(z-X),U,K,V;switch(G){default:case 6:case 0:{U=z,K=Y,V=X;break}case 1:{U=Y,K=z,V=X;break}case 2:{U=X,K=z,V=Y;break}case 3:{U=X,K=Y,V=z;break}case 4:{U=Y,K=X,V=z;break}case 5:{U=z,K=X,V=Y;break}}return[U*255,K*255,V*255]};T.cmyk.rgb=function(Z){let J=Z[0]/100,X=Z[1]/100,q=Z[2]/100,W=Z[3]/100,Q=1-Math.min(1,J*(1-W)+W),G=1-Math.min(1,X*(1-W)+W),z=1-Math.min(1,q*(1-W)+W);return[Q*255,G*255,z*255]};T.xyz.rgb=function(Z){let J=Z[0]/100,X=Z[1]/100,q=Z[2]/100,W,Q,G;return W=J*3.2404542+X*-1.5371385+q*-0.4985314,Q=J*-0.969266+X*1.8760108+q*0.041556,G=J*0.0556434+X*-0.2040259+q*1.0572252,W=r4(W),Q=r4(Q),G=r4(G),[W*255,Q*255,G*255]};T.xyz.lab=function(Z){let J=Z[0],X=Z[1],q=Z[2];J/=95.047,X/=100,q/=108.883,J=J>i0?J**0.3333333333333333:7.787*J+0.13793103448275862,X=X>i0?X**0.3333333333333333:7.787*X+0.13793103448275862,q=q>i0?q**0.3333333333333333:7.787*q+0.13793103448275862;let W=116*X-16,Q=500*(J-X),G=200*(X-q);return[W,Q,G]};T.xyz.oklab=function(Z){let J=Z[0]/100,X=Z[1]/100,q=Z[2]/100,W=Math.cbrt(0.8189330101*J+0.3618667424*X-0.1288597137*q),Q=Math.cbrt(0.0329845436*J+0.9293118715*X+0.0361456387*q),G=Math.cbrt(0.0482003018*J+0.2643662691*X+0.633851707*q),z=0.2104542553*W+0.793617785*Q-0.0040720468*G,Y=1.9779984951*W-2.428592205*Q+0.4505937099*G,U=0.0259040371*W+0.7827717662*Q-0.808675766*G;return[z*100,Y*100,U*100]};T.oklab.oklch=function(Z){return T.lab.lch(Z)};T.oklab.xyz=function(Z){let J=Z[0]/100,X=Z[1]/100,q=Z[2]/100,W=(0.999999998*J+0.396337792*X+0.215803758*q)**3,Q=(1.000000008*J-0.105561342*X-0.063854175*q)**3,G=(1.000000055*J-0.089484182*X-1.291485538*q)**3,z=1.227013851*W-0.55779998*Q+0.281256149*G,Y=-0.040580178*W+1.11225687*Q-0.071676679*G,U=-0.076381285*W-0.421481978*Q+1.58616322*G;return[z*100,Y*100,U*100]};T.oklab.rgb=function(Z){let J=Z[0]/100,X=Z[1]/100,q=Z[2]/100,W=(J+0.3963377774*X+0.2158037573*q)**3,Q=(J-0.1055613458*X-0.0638541728*q)**3,G=(J-0.0894841775*X-1.291485548*q)**3,z=r4(4.0767416621*W-3.3077115913*Q+0.2309699292*G),Y=r4(-1.2684380046*W+2.6097574011*Q-0.3413193965*G),U=r4(-0.0041960863*W-0.7034186147*Q+1.707614701*G);return[z*255,Y*255,U*255]};T.oklch.oklab=function(Z){return T.lch.lab(Z)};T.lab.xyz=function(Z){let J=Z[0],X=Z[1],q=Z[2],W,Q,G;Q=(J+16)/116,W=X/500+Q,G=Q-q/200;let z=Q**3,Y=W**3,U=G**3;return Q=z>i0?z:(Q-0.13793103448275862)/7.787,W=Y>i0?Y:(W-0.13793103448275862)/7.787,G=U>i0?U:(G-0.13793103448275862)/7.787,W*=95.047,Q*=100,G*=108.883,[W,Q,G]};T.lab.lch=function(Z){let J=Z[0],X=Z[1],q=Z[2],W;if(W=Math.atan2(q,X)*360/2/Math.PI,W<0)W+=360;let G=Math.sqrt(X*X+q*q);return[J,G,W]};T.lch.lab=function(Z){let J=Z[0],X=Z[1],W=Z[2]/360*2*Math.PI,Q=X*Math.cos(W),G=X*Math.sin(W);return[J,Q,G]};T.rgb.ansi16=function(Z,J=null){let[X,q,W]=Z,Q=J===null?T.rgb.hsv(Z)[2]:J;if(Q=Math.round(Q/50),Q===0)return 30;let G=30+(Math.round(W/255)<<2|Math.round(q/255)<<1|Math.round(X/255));if(Q===2)G+=60;return G};T.hsv.ansi16=function(Z){return T.rgb.ansi16(T.hsv.rgb(Z),Z[2])};T.rgb.ansi256=function(Z){let J=Z[0],X=Z[1],q=Z[2];if(J>>4===X>>4&&X>>4===q>>4){if(J<8)return 16;if(J>248)return 231;return Math.round((J-8)/247*24)+232}return 16+36*Math.round(J/255*5)+6*Math.round(X/255*5)+Math.round(q/255*5)};T.ansi16.rgb=function(Z){Z=Z[0];let J=Z%10;if(J===0||J===7){if(Z>50)J+=3.5;return J=J/10.5*255,[J,J,J]}let X=(Math.trunc(Z>50)+1)*0.5,q=(J&1)*X*255,W=(J>>1&1)*X*255,Q=(J>>2&1)*X*255;return[q,W,Q]};T.ansi256.rgb=function(Z){if(Z=Z[0],Z>=232){let Q=(Z-232)*10+8;return[Q,Q,Q]}Z-=16;let J,X=Math.floor(Z/36)/5*255,q=Math.floor((J=Z%36)/6)/5*255,W=J%6/5*255;return[X,q,W]};T.rgb.hex=function(Z){let X=(((Math.round(Z[0])&255)<<16)+((Math.round(Z[1])&255)<<8)+(Math.round(Z[2])&255)).toString(16).toUpperCase();return"000000".slice(X.length)+X};T.hex.rgb=function(Z){let J=Z.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!J)return[0,0,0];let X=J[0];if(J[0].length===3)X=[...X].map((z)=>z+z).join("");let q=Number.parseInt(X,16),W=q>>16&255,Q=q>>8&255,G=q&255;return[W,Q,G]};T.rgb.hcg=function(Z){let J=Z[0]/255,X=Z[1]/255,q=Z[2]/255,W=Math.max(Math.max(J,X),q),Q=Math.min(Math.min(J,X),q),G=W-Q,z,Y=G<1?Q/(1-G):0;if(G<=0)z=0;else if(W===J)z=(X-q)/G%6;else if(W===X)z=2+(q-J)/G;else z=4+(J-X)/G;return z/=6,z%=1,[z*360,G*100,Y*100]};T.hsl.hcg=function(Z){let J=Z[1]/100,X=Z[2]/100,q=X<0.5?2*J*X:2*J*(1-X),W=0;if(q<1)W=(X-0.5*q)/(1-q);return[Z[0],q*100,W*100]};T.hsv.hcg=function(Z){let J=Z[1]/100,X=Z[2]/100,q=J*X,W=0;if(q<1)W=(X-q)/(1-q);return[Z[0],q*100,W*100]};T.hcg.rgb=function(Z){let J=Z[0]/360,X=Z[1]/100,q=Z[2]/100;if(X===0)return[q*255,q*255,q*255];let W=[0,0,0],Q=J%1*6,G=Q%1,z=1-G,Y=0;switch(Math.floor(Q)){case 0:{W[0]=1,W[1]=G,W[2]=0;break}case 1:{W[0]=z,W[1]=1,W[2]=0;break}case 2:{W[0]=0,W[1]=1,W[2]=G;break}case 3:{W[0]=0,W[1]=z,W[2]=1;break}case 4:{W[0]=G,W[1]=0,W[2]=1;break}default:W[0]=1,W[1]=0,W[2]=z}return Y=(1-X)*q,[(X*W[0]+Y)*255,(X*W[1]+Y)*255,(X*W[2]+Y)*255]};T.hcg.hsv=function(Z){let J=Z[1]/100,X=Z[2]/100,q=J+X*(1-J),W=0;if(q>0)W=J/q;return[Z[0],W*100,q*100]};T.hcg.hsl=function(Z){let J=Z[1]/100,q=Z[2]/100*(1-J)+0.5*J,W=0;if(q>0&&q<0.5)W=J/(2*q);else if(q>=0.5&&q<1)W=J/(2*(1-q));return[Z[0],W*100,q*100]};T.hcg.hwb=function(Z){let J=Z[1]/100,X=Z[2]/100,q=J+X*(1-J);return[Z[0],(q-J)*100,(1-q)*100]};T.hwb.hcg=function(Z){let J=Z[1]/100,q=1-Z[2]/100,W=q-J,Q=0;if(W<1)Q=(q-W)/(1-W);return[Z[0],W*100,Q*100]};T.apple.rgb=function(Z){return[Z[0]/65535*255,Z[1]/65535*255,Z[2]/65535*255]};T.rgb.apple=function(Z){return[Z[0]/255*65535,Z[1]/255*65535,Z[2]/255*65535]};T.gray.rgb=function(Z){return[Z[0]/100*255,Z[0]/100*255,Z[0]/100*255]};T.gray.hsl=function(Z){return[0,0,Z[0]]};T.gray.hsv=T.gray.hsl;T.gray.hwb=function(Z){return[0,100,Z[0]]};T.gray.cmyk=function(Z){return[0,0,0,Z[0]]};T.gray.lab=function(Z){return[Z[0],0,0]};T.gray.hex=function(Z){let J=Math.round(Z[0]/100*255)&255,q=((J<<16)+(J<<8)+J).toString(16).toUpperCase();return"000000".slice(q.length)+q};T.rgb.gray=function(Z){return[(Z[0]+Z[1]+Z[2])/3/255*100]};function wz(){let Z={},J=Object.keys(D4);for(let{length:X}=J,q=0;q<X;q++)Z[J[q]]={distance:-1,parent:null};return Z}function Nz(Z){let J=wz(),X=[Z];J[Z].distance=0;while(X.length>0){let q=X.pop(),W=Object.keys(D4[q]);for(let{length:Q}=W,G=0;G<Q;G++){let z=W[G],Y=J[z];if(Y.distance===-1)Y.distance=J[q].distance+1,Y.parent=q,X.unshift(z)}}return J}function Tz(Z,J){return function(X){return J(Z(X))}}function Rz(Z,J){let X=[J[Z].parent,Z],q=D4[J[Z].parent][Z],W=J[Z].parent;while(J[W].parent)X.unshift(J[W].parent),q=Tz(D4[J[W].parent][W],q),W=J[W].parent;return q.conversion=X,q}function Pz(Z){let J=Nz(Z),X={},q=Object.keys(J);for(let{length:W}=q,Q=0;Q<W;Q++){let G=q[Q];if(J[G].parent===null)continue;X[G]=Rz(G,J)}return X}var jz=Pz,n4={},_z=Object.keys(D4);function Cz(Z){let J=function(...X){let q=X[0];if(q===void 0||q===null)return q;if(q.length>1)X=q;return Z(X)};if("conversion"in Z)J.conversion=Z.conversion;return J}function Ez(Z){let J=function(...X){let q=X[0];if(q===void 0||q===null)return q;if(q.length>1)X=q;let W=Z(X);if(typeof W==="object")for(let{length:Q}=W,G=0;G<Q;G++)W[G]=Math.round(W[G]);return W};if("conversion"in Z)J.conversion=Z.conversion;return J}for(let Z of _z){n4[Z]={},Object.defineProperty(n4[Z],"channels",{value:D4[Z].channels}),Object.defineProperty(n4[Z],"labels",{value:D4[Z].labels});let J=jz(Z),X=Object.keys(J);for(let q of X){let W=J[q];n4[Z][q]=Ez(W),n4[Z][q].raw=Cz(W)}}var w0=n4,QZ=["keyword","gray","hex"],o5={};for(let Z of Object.keys(w0))o5[[...w0[Z].labels].sort().join("")]=Z;var t5={};function X0(Z,J){if(!(this instanceof X0))return new X0(Z,J);if(J&&J in QZ)J=null;if(J&&!(J in w0))throw Error("Unknown model: "+J);let X,q;if(Z==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(Z instanceof X0)this.model=Z.model,this.color=[...Z.color],this.valpha=Z.valpha;else if(typeof Z==="string"){let W=p4.get(Z);if(W===null)throw Error("Unable to parse color from string: "+Z);this.model=W.model,q=w0[this.model].channels,this.color=W.value.slice(0,q),this.valpha=typeof W.value[q]==="number"?W.value[q]:1}else if(Z.length>0){this.model=J||"rgb",q=w0[this.model].channels;let W=Array.prototype.slice.call(Z,0,q);this.color=e5(W,q),this.valpha=typeof Z[q]==="number"?Z[q]:1}else if(typeof Z==="number")this.model="rgb",this.color=[Z>>16&255,Z>>8&255,Z&255],this.valpha=1;else{this.valpha=1;let W=Object.keys(Z);if("alpha"in Z)W.splice(W.indexOf("alpha"),1),this.valpha=typeof Z.alpha==="number"?Z.alpha:0;let Q=W.sort().join("");if(!(Q in o5))throw Error("Unable to parse color from object: "+JSON.stringify(Z));this.model=o5[Q];let{labels:G}=w0[this.model],z=[];for(X=0;X<G.length;X++)z.push(Z[G[X]]);this.color=e5(z)}if(t5[this.model]){q=w0[this.model].channels;for(X=0;X<q;X++){let W=t5[this.model][X];if(W)this.color[X]=W(this.color[X])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}X0.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(Z){let J=this.model in p4.to?this:this.rgb();J=J.round(typeof Z==="number"?Z:1);let X=J.valpha===1?J.color:[...J.color,this.valpha];return p4.to[J.model](...X)},percentString(Z){let J=this.rgb().round(typeof Z==="number"?Z:1),X=J.valpha===1?J.color:[...J.color,this.valpha];return p4.to.rgb.percent(...X)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let Z={},{channels:J}=w0[this.model],{labels:X}=w0[this.model];for(let q=0;q<J;q++)Z[X[q]]=this.color[q];if(this.valpha!==1)Z.alpha=this.valpha;return Z},unitArray(){let Z=this.rgb().color;if(Z[0]/=255,Z[1]/=255,Z[2]/=255,this.valpha!==1)Z.push(this.valpha);return Z},unitObject(){let Z=this.rgb().object();if(Z.r/=255,Z.g/=255,Z.b/=255,this.valpha!==1)Z.alpha=this.valpha;return Z},round(Z){return Z=Math.max(Z||0,0),new X0([...this.color.map(xz(Z)),this.valpha],this.model)},alpha(Z){if(Z!==void 0)return new X0([...this.color,Math.max(0,Math.min(1,Z))],this.model);return this.valpha},red:a("rgb",0,J0(255)),green:a("rgb",1,J0(255)),blue:a("rgb",2,J0(255)),hue:a(["hsl","hsv","hsl","hwb","hcg"],0,(Z)=>(Z%360+360)%360),saturationl:a("hsl",1,J0(100)),lightness:a("hsl",2,J0(100)),saturationv:a("hsv",1,J0(100)),value:a("hsv",2,J0(100)),chroma:a("hcg",1,J0(100)),gray:a("hcg",2,J0(100)),white:a("hwb",1,J0(100)),wblack:a("hwb",2,J0(100)),cyan:a("cmyk",0,J0(100)),magenta:a("cmyk",1,J0(100)),yellow:a("cmyk",2,J0(100)),black:a("cmyk",3,J0(100)),x:a("xyz",0,J0(95.047)),y:a("xyz",1,J0(100)),z:a("xyz",2,J0(108.833)),l:a("lab",0,J0(100)),a:a("lab",1),b:a("lab",2),keyword(Z){if(Z!==void 0)return new X0(Z);return w0[this.model].keyword(this.color)},hex(Z){if(Z!==void 0)return new X0(Z);return p4.to.hex(...this.rgb().round().color)},hexa(Z){if(Z!==void 0)return new X0(Z);let J=this.rgb().round().color,X=Math.round(this.valpha*255).toString(16).toUpperCase();if(X.length===1)X="0"+X;return p4.to.hex(...J)+X},rgbNumber(){let Z=this.rgb().color;return(Z[0]&255)<<16|(Z[1]&255)<<8|Z[2]&255},luminosity(){let Z=this.rgb().color,J=[];for(let[X,q]of Z.entries()){let W=q/255;J[X]=W<=0.04045?W/12.92:((W+0.055)/1.055)**2.4}return 0.2126*J[0]+0.7152*J[1]+0.0722*J[2]},contrast(Z){let J=this.luminosity(),X=Z.luminosity();if(J>X)return(J+0.05)/(X+0.05);return(X+0.05)/(J+0.05)},level(Z){let J=this.contrast(Z);if(J>=7)return"AAA";return J>=4.5?"AA":""},isDark(){let Z=this.rgb().color;return(Z[0]*2126+Z[1]*7152+Z[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let Z=this.rgb();for(let J=0;J<3;J++)Z.color[J]=255-Z.color[J];return Z},lighten(Z){let J=this.hsl();return J.color[2]+=J.color[2]*Z,J},darken(Z){let J=this.hsl();return J.color[2]-=J.color[2]*Z,J},saturate(Z){let J=this.hsl();return J.color[1]+=J.color[1]*Z,J},desaturate(Z){let J=this.hsl();return J.color[1]-=J.color[1]*Z,J},whiten(Z){let J=this.hwb();return J.color[1]+=J.color[1]*Z,J},blacken(Z){let J=this.hwb();return J.color[2]+=J.color[2]*Z,J},grayscale(){let Z=this.rgb().color,J=Z[0]*0.3+Z[1]*0.59+Z[2]*0.11;return X0.rgb(J,J,J)},fade(Z){return this.alpha(this.valpha-this.valpha*Z)},opaquer(Z){return this.alpha(this.valpha+this.valpha*Z)},rotate(Z){let J=this.hsl(),X=J.color[0];return X=(X+Z)%360,X=X<0?360+X:X,J.color[0]=X,J},mix(Z,J){if(!Z||!Z.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof Z);let X=Z.rgb(),q=this.rgb(),W=J===void 0?0.5:J,Q=2*W-1,G=X.alpha()-q.alpha(),z=((Q*G===-1?Q:(Q+G)/(1+Q*G))+1)/2,Y=1-z;return X0.rgb(z*X.red()+Y*q.red(),z*X.green()+Y*q.green(),z*X.blue()+Y*q.blue(),X.alpha()*W+q.alpha()*(1-W))}};for(let Z of Object.keys(w0)){if(QZ.includes(Z))continue;let{channels:J}=w0[Z];X0.prototype[Z]=function(...X){if(this.model===Z)return new X0(this);if(X.length>0)return new X0(X,Z);return new X0([...kz(w0[this.model][Z].raw(this.color)),this.valpha],Z)},X0[Z]=function(...X){let q=X[0];if(typeof q==="number")q=e5(X,J);return new X0(q,Z)}}function Oz(Z,J){return Number(Z.toFixed(J))}function xz(Z){return function(J){return Oz(J,Z)}}function a(Z,J,X){Z=Array.isArray(Z)?Z:[Z];for(let q of Z)(t5[q]||=[])[J]=X;return Z=Z[0],function(q){let W;if(q!==void 0){if(X)q=X(q);return W=this[Z](),W.color[J]=q,W}if(W=this[Z]().color[J],X)W=X(W);return W}}function J0(Z){return function(J){return Math.max(0,Math.min(Z,J))}}function kz(Z){return Array.isArray(Z)?Z:[Z]}function e5(Z,J){for(let X=0;X<J;X++)if(typeof Z[X]!=="number")Z[X]=0;return Z}var Sz=X0});var UZ=b((xH,zZ)=>{zZ.exports=YZ().default});var HZ=b((kH,BZ)=>{/*!
225
+ */TX={integer:"integer",float:"float",approximate:"approximate"}});var SX=E((pM,kX)=>{var{defineProperty:j3,getOwnPropertyDescriptor:RV,getOwnPropertyNames:_V}=Object,PV=Object.prototype.hasOwnProperty,jV=(Z,X)=>{for(var q in X)j3(Z,q,{get:X[q],enumerable:!0})},EV=(Z,X,q,W)=>{if(X&&typeof X==="object"||typeof X==="function"){for(let Q of _V(X))if(!PV.call(Z,Q)&&Q!==q)j3(Z,Q,{get:()=>X[Q],enumerable:!(W=RV(X,Q))||W.enumerable})}return Z},CV=(Z)=>EV(j3({},"__esModule",{value:!0}),Z),EX={};jV(EX,{default:()=>cV});kX.exports=CV(EX);var T3={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let Z in T3)Object.freeze(T3[Z]);var p0=Object.freeze(T3),CX=Object.create(null);for(let Z in p0)if(Object.hasOwn(p0,Z))CX[p0[Z]]=Z;var A0={to:{},get:{}};A0.get=function(Z){let X=Z.slice(0,3).toLowerCase(),q,W;switch(X){case"hsl":{q=A0.get.hsl(Z),W="hsl";break}case"hwb":{q=A0.get.hwb(Z),W="hwb";break}default:{q=A0.get.rgb(Z),W="rgb";break}}if(!q)return null;return{model:W,value:q}};A0.get.rgb=function(Z){if(!Z)return null;let X=/^#([a-f\d]{3,4})$/i,q=/^#([a-f\d]{6})([a-f\d]{2})?$/i,W=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,Q=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,J=/^(\w+)$/,z=[0,0,0,1],Y,U,K;if(Y=Z.match(q)){K=Y[2],Y=Y[1];for(U=0;U<3;U++){let V=U*2;z[U]=Number.parseInt(Y.slice(V,V+2),16)}if(K)z[3]=Number.parseInt(K,16)/255}else if(Y=Z.match(X)){Y=Y[1],K=Y[3];for(U=0;U<3;U++)z[U]=Number.parseInt(Y[U]+Y[U],16);if(K)z[3]=Number.parseInt(K+K,16)/255}else if(Y=Z.match(W)){for(U=0;U<3;U++)z[U]=Number.parseFloat(Y[U+1]);if(Y[4])z[3]=Y[5]?Number.parseFloat(Y[4])*0.01:Number.parseFloat(Y[4])}else if(Y=Z.match(Q)){for(U=0;U<3;U++)z[U]=Math.round(Number.parseFloat(Y[U+1])*2.55);if(Y[4])z[3]=Y[5]?Number.parseFloat(Y[4])*0.01:Number.parseFloat(Y[4])}else if(Y=Z.toLowerCase().match(J)){if(Y[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(p0,Y[1]))return null;return z=p0[Y[1]].slice(),z[3]=1,z}else return null;for(U=0;U<3;U++)z[U]=F6(z[U],0,255);return z[3]=F6(z[3],0,1),z};A0.get.hsl=function(Z){if(!Z)return null;let X=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,q=Z.match(X);if(q){let W=Number.parseFloat(q[4]),Q=(Number.parseFloat(q[1])%360+360)%360,J=F6(Number.parseFloat(q[2]),0,100),z=F6(Number.parseFloat(q[3]),0,100),Y=F6(Number.isNaN(W)?1:W,0,1);return[Q,J,z,Y]}return null};A0.get.hwb=function(Z){if(!Z)return null;let X=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,q=Z.match(X);if(q){let W=Number.parseFloat(q[4]),Q=(Number.parseFloat(q[1])%360+360)%360,J=F6(Number.parseFloat(q[2]),0,100),z=F6(Number.parseFloat(q[3]),0,100),Y=F6(Number.isNaN(W)?1:W,0,1);return[Q,J,z,Y]}return null};A0.to.hex=function(...Z){return"#"+y1(Z[0])+y1(Z[1])+y1(Z[2])+(Z[3]<1?y1(Math.round(Z[3]*255)):"")};A0.to.rgb=function(...Z){return Z.length<4||Z[3]===1?"rgb("+Math.round(Z[0])+", "+Math.round(Z[1])+", "+Math.round(Z[2])+")":"rgba("+Math.round(Z[0])+", "+Math.round(Z[1])+", "+Math.round(Z[2])+", "+Z[3]+")"};A0.to.rgb.percent=function(...Z){let X=Math.round(Z[0]/255*100),q=Math.round(Z[1]/255*100),W=Math.round(Z[2]/255*100);return Z.length<4||Z[3]===1?"rgb("+X+"%, "+q+"%, "+W+"%)":"rgba("+X+"%, "+q+"%, "+W+"%, "+Z[3]+")"};A0.to.hsl=function(...Z){return Z.length<4||Z[3]===1?"hsl("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%)":"hsla("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%, "+Z[3]+")"};A0.to.hwb=function(...Z){let X="";if(Z.length>=4&&Z[3]!==1)X=", "+Z[3];return"hwb("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%"+X+")"};A0.to.keyword=function(...Z){return CX[Z.slice(0,3)]};function F6(Z,X,q){return Math.min(Math.max(X,Z),q)}function y1(Z){let X=Math.round(Z).toString(16).toUpperCase();return X.length<2?"0"+X:X}var W4=A0,OX={};for(let Z of Object.keys(p0))OX[p0[Z]]=Z;var w={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},k6=w,W6=0.008856451679035631;function J4(Z){let X=Z>0.0031308?1.055*Z**0.4166666666666667-0.055:Z*12.92;return Math.min(Math.max(0,X),1)}function z4(Z){return Z>0.04045?((Z+0.055)/1.055)**2.4:Z/12.92}for(let Z of Object.keys(w)){if(!("channels"in w[Z]))throw Error("missing channels property: "+Z);if(!("labels"in w[Z]))throw Error("missing channel labels property: "+Z);if(w[Z].labels.length!==w[Z].channels)throw Error("channel and label counts mismatch: "+Z);let{channels:X,labels:q}=w[Z];delete w[Z].channels,delete w[Z].labels,Object.defineProperty(w[Z],"channels",{value:X}),Object.defineProperty(w[Z],"labels",{value:q})}w.rgb.hsl=function(Z){let X=Z[0]/255,q=Z[1]/255,W=Z[2]/255,Q=Math.min(X,q,W),J=Math.max(X,q,W),z=J-Q,Y,U;switch(J){case Q:{Y=0;break}case X:{Y=(q-W)/z;break}case q:{Y=2+(W-X)/z;break}case W:{Y=4+(X-q)/z;break}}if(Y=Math.min(Y*60,360),Y<0)Y+=360;let K=(Q+J)/2;if(J===Q)U=0;else if(K<=0.5)U=z/(J+Q);else U=z/(2-J-Q);return[Y,U*100,K*100]};w.rgb.hsv=function(Z){let X,q,W,Q,J,z=Z[0]/255,Y=Z[1]/255,U=Z[2]/255,K=Math.max(z,Y,U),V=K-Math.min(z,Y,U),B=function(H){return(K-H)/6/V+0.5};if(V===0)Q=0,J=0;else{switch(J=V/K,X=B(z),q=B(Y),W=B(U),K){case z:{Q=W-q;break}case Y:{Q=0.3333333333333333+X-W;break}case U:{Q=0.6666666666666666+q-X;break}}if(Q<0)Q+=1;else if(Q>1)Q-=1}return[Q*360,J*100,K*100]};w.rgb.hwb=function(Z){let X=Z[0],q=Z[1],W=Z[2],Q=w.rgb.hsl(Z)[0],J=0.00392156862745098*Math.min(X,Math.min(q,W));return W=1-0.00392156862745098*Math.max(X,Math.max(q,W)),[Q,J*100,W*100]};w.rgb.oklab=function(Z){let X=z4(Z[0]/255),q=z4(Z[1]/255),W=z4(Z[2]/255),Q=Math.cbrt(0.4122214708*X+0.5363325363*q+0.0514459929*W),J=Math.cbrt(0.2119034982*X+0.6806995451*q+0.1073969566*W),z=Math.cbrt(0.0883024619*X+0.2817188376*q+0.6299787005*W),Y=0.2104542553*Q+0.793617785*J-0.0040720468*z,U=1.9779984951*Q-2.428592205*J+0.4505937099*z,K=0.0259040371*Q+0.7827717662*J-0.808675766*z;return[Y*100,U*100,K*100]};w.rgb.cmyk=function(Z){let X=Z[0]/255,q=Z[1]/255,W=Z[2]/255,Q=Math.min(1-X,1-q,1-W),J=(1-X-Q)/(1-Q)||0,z=(1-q-Q)/(1-Q)||0,Y=(1-W-Q)/(1-Q)||0;return[J*100,z*100,Y*100,Q*100]};function OV(Z,X){return(Z[0]-X[0])**2+(Z[1]-X[1])**2+(Z[2]-X[2])**2}w.rgb.keyword=function(Z){let X=OX[Z];if(X)return X;let q=Number.POSITIVE_INFINITY,W;for(let Q of Object.keys(p0)){let J=p0[Q],z=OV(Z,J);if(z<q)q=z,W=Q}return W};w.keyword.rgb=function(Z){return[...p0[Z]]};w.rgb.xyz=function(Z){let X=z4(Z[0]/255),q=z4(Z[1]/255),W=z4(Z[2]/255),Q=X*0.4124564+q*0.3575761+W*0.1804375,J=X*0.2126729+q*0.7151522+W*0.072175,z=X*0.0193339+q*0.119192+W*0.9503041;return[Q*100,J*100,z*100]};w.rgb.lab=function(Z){let X=w.rgb.xyz(Z),q=X[0],W=X[1],Q=X[2];q/=95.047,W/=100,Q/=108.883,q=q>W6?q**0.3333333333333333:7.787*q+0.13793103448275862,W=W>W6?W**0.3333333333333333:7.787*W+0.13793103448275862,Q=Q>W6?Q**0.3333333333333333:7.787*Q+0.13793103448275862;let J=116*W-16,z=500*(q-W),Y=200*(W-Q);return[J,z,Y]};w.hsl.rgb=function(Z){let X=Z[0]/360,q=Z[1]/100,W=Z[2]/100,Q,J;if(q===0)return J=W*255,[J,J,J];let z=W<0.5?W*(1+q):W+q-W*q,Y=2*W-z,U=[0,0,0];for(let K=0;K<3;K++){if(Q=X+0.3333333333333333*-(K-1),Q<0)Q++;if(Q>1)Q--;if(6*Q<1)J=Y+(z-Y)*6*Q;else if(2*Q<1)J=z;else if(3*Q<2)J=Y+(z-Y)*(0.6666666666666666-Q)*6;else J=Y;U[K]=J*255}return U};w.hsl.hsv=function(Z){let X=Z[0],q=Z[1]/100,W=Z[2]/100,Q=q,J=Math.max(W,0.01);W*=2,q*=W<=1?W:2-W,Q*=J<=1?J:2-J;let z=(W+q)/2,Y=W===0?2*Q/(J+Q):2*q/(W+q);return[X,Y*100,z*100]};w.hsv.rgb=function(Z){let X=Z[0]/60,q=Z[1]/100,W=Z[2]/100,Q=Math.floor(X)%6,J=X-Math.floor(X),z=255*W*(1-q),Y=255*W*(1-q*J),U=255*W*(1-q*(1-J));switch(W*=255,Q){case 0:return[W,U,z];case 1:return[Y,W,z];case 2:return[z,W,U];case 3:return[z,Y,W];case 4:return[U,z,W];case 5:return[W,z,Y]}};w.hsv.hsl=function(Z){let X=Z[0],q=Z[1]/100,W=Z[2]/100,Q=Math.max(W,0.01),J,z;z=(2-q)*W;let Y=(2-q)*Q;return J=q*Q,J/=Y<=1?Y:2-Y,J=J||0,z/=2,[X,J*100,z*100]};w.hwb.rgb=function(Z){let X=Z[0]/360,q=Z[1]/100,W=Z[2]/100,Q=q+W,J;if(Q>1)q/=Q,W/=Q;let z=Math.floor(6*X),Y=1-W;if(J=6*X-z,(z&1)!==0)J=1-J;let U=q+J*(Y-q),K,V,B;switch(z){default:case 6:case 0:{K=Y,V=U,B=q;break}case 1:{K=U,V=Y,B=q;break}case 2:{K=q,V=Y,B=U;break}case 3:{K=q,V=U,B=Y;break}case 4:{K=U,V=q,B=Y;break}case 5:{K=Y,V=q,B=U;break}}return[K*255,V*255,B*255]};w.cmyk.rgb=function(Z){let X=Z[0]/100,q=Z[1]/100,W=Z[2]/100,Q=Z[3]/100,J=1-Math.min(1,X*(1-Q)+Q),z=1-Math.min(1,q*(1-Q)+Q),Y=1-Math.min(1,W*(1-Q)+Q);return[J*255,z*255,Y*255]};w.xyz.rgb=function(Z){let X=Z[0]/100,q=Z[1]/100,W=Z[2]/100,Q,J,z;return Q=X*3.2404542+q*-1.5371385+W*-0.4985314,J=X*-0.969266+q*1.8760108+W*0.041556,z=X*0.0556434+q*-0.2040259+W*1.0572252,Q=J4(Q),J=J4(J),z=J4(z),[Q*255,J*255,z*255]};w.xyz.lab=function(Z){let X=Z[0],q=Z[1],W=Z[2];X/=95.047,q/=100,W/=108.883,X=X>W6?X**0.3333333333333333:7.787*X+0.13793103448275862,q=q>W6?q**0.3333333333333333:7.787*q+0.13793103448275862,W=W>W6?W**0.3333333333333333:7.787*W+0.13793103448275862;let Q=116*q-16,J=500*(X-q),z=200*(q-W);return[Q,J,z]};w.xyz.oklab=function(Z){let X=Z[0]/100,q=Z[1]/100,W=Z[2]/100,Q=Math.cbrt(0.8189330101*X+0.3618667424*q-0.1288597137*W),J=Math.cbrt(0.0329845436*X+0.9293118715*q+0.0361456387*W),z=Math.cbrt(0.0482003018*X+0.2643662691*q+0.633851707*W),Y=0.2104542553*Q+0.793617785*J-0.0040720468*z,U=1.9779984951*Q-2.428592205*J+0.4505937099*z,K=0.0259040371*Q+0.7827717662*J-0.808675766*z;return[Y*100,U*100,K*100]};w.oklab.oklch=function(Z){return w.lab.lch(Z)};w.oklab.xyz=function(Z){let X=Z[0]/100,q=Z[1]/100,W=Z[2]/100,Q=(0.999999998*X+0.396337792*q+0.215803758*W)**3,J=(1.000000008*X-0.105561342*q-0.063854175*W)**3,z=(1.000000055*X-0.089484182*q-1.291485538*W)**3,Y=1.227013851*Q-0.55779998*J+0.281256149*z,U=-0.040580178*Q+1.11225687*J-0.071676679*z,K=-0.076381285*Q-0.421481978*J+1.58616322*z;return[Y*100,U*100,K*100]};w.oklab.rgb=function(Z){let X=Z[0]/100,q=Z[1]/100,W=Z[2]/100,Q=(X+0.3963377774*q+0.2158037573*W)**3,J=(X-0.1055613458*q-0.0638541728*W)**3,z=(X-0.0894841775*q-1.291485548*W)**3,Y=J4(4.0767416621*Q-3.3077115913*J+0.2309699292*z),U=J4(-1.2684380046*Q+2.6097574011*J-0.3413193965*z),K=J4(-0.0041960863*Q-0.7034186147*J+1.707614701*z);return[Y*255,U*255,K*255]};w.oklch.oklab=function(Z){return w.lch.lab(Z)};w.lab.xyz=function(Z){let X=Z[0],q=Z[1],W=Z[2],Q,J,z;J=(X+16)/116,Q=q/500+J,z=J-W/200;let Y=J**3,U=Q**3,K=z**3;return J=Y>W6?Y:(J-0.13793103448275862)/7.787,Q=U>W6?U:(Q-0.13793103448275862)/7.787,z=K>W6?K:(z-0.13793103448275862)/7.787,Q*=95.047,J*=100,z*=108.883,[Q,J,z]};w.lab.lch=function(Z){let X=Z[0],q=Z[1],W=Z[2],Q;if(Q=Math.atan2(W,q)*360/2/Math.PI,Q<0)Q+=360;let z=Math.sqrt(q*q+W*W);return[X,z,Q]};w.lch.lab=function(Z){let X=Z[0],q=Z[1],Q=Z[2]/360*2*Math.PI,J=q*Math.cos(Q),z=q*Math.sin(Q);return[X,J,z]};w.rgb.ansi16=function(Z,X=null){let[q,W,Q]=Z,J=X===null?w.rgb.hsv(Z)[2]:X;if(J=Math.round(J/50),J===0)return 30;let z=30+(Math.round(Q/255)<<2|Math.round(W/255)<<1|Math.round(q/255));if(J===2)z+=60;return z};w.hsv.ansi16=function(Z){return w.rgb.ansi16(w.hsv.rgb(Z),Z[2])};w.rgb.ansi256=function(Z){let X=Z[0],q=Z[1],W=Z[2];if(X>>4===q>>4&&q>>4===W>>4){if(X<8)return 16;if(X>248)return 231;return Math.round((X-8)/247*24)+232}return 16+36*Math.round(X/255*5)+6*Math.round(q/255*5)+Math.round(W/255*5)};w.ansi16.rgb=function(Z){Z=Z[0];let X=Z%10;if(X===0||X===7){if(Z>50)X+=3.5;return X=X/10.5*255,[X,X,X]}let q=(Math.trunc(Z>50)+1)*0.5,W=(X&1)*q*255,Q=(X>>1&1)*q*255,J=(X>>2&1)*q*255;return[W,Q,J]};w.ansi256.rgb=function(Z){if(Z=Z[0],Z>=232){let J=(Z-232)*10+8;return[J,J,J]}Z-=16;let X,q=Math.floor(Z/36)/5*255,W=Math.floor((X=Z%36)/6)/5*255,Q=X%6/5*255;return[q,W,Q]};w.rgb.hex=function(Z){let q=(((Math.round(Z[0])&255)<<16)+((Math.round(Z[1])&255)<<8)+(Math.round(Z[2])&255)).toString(16).toUpperCase();return"000000".slice(q.length)+q};w.hex.rgb=function(Z){let X=Z.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!X)return[0,0,0];let q=X[0];if(X[0].length===3)q=[...q].map((Y)=>Y+Y).join("");let W=Number.parseInt(q,16),Q=W>>16&255,J=W>>8&255,z=W&255;return[Q,J,z]};w.rgb.hcg=function(Z){let X=Z[0]/255,q=Z[1]/255,W=Z[2]/255,Q=Math.max(Math.max(X,q),W),J=Math.min(Math.min(X,q),W),z=Q-J,Y,U=z<1?J/(1-z):0;if(z<=0)Y=0;else if(Q===X)Y=(q-W)/z%6;else if(Q===q)Y=2+(W-X)/z;else Y=4+(X-q)/z;return Y/=6,Y%=1,[Y*360,z*100,U*100]};w.hsl.hcg=function(Z){let X=Z[1]/100,q=Z[2]/100,W=q<0.5?2*X*q:2*X*(1-q),Q=0;if(W<1)Q=(q-0.5*W)/(1-W);return[Z[0],W*100,Q*100]};w.hsv.hcg=function(Z){let X=Z[1]/100,q=Z[2]/100,W=X*q,Q=0;if(W<1)Q=(q-W)/(1-W);return[Z[0],W*100,Q*100]};w.hcg.rgb=function(Z){let X=Z[0]/360,q=Z[1]/100,W=Z[2]/100;if(q===0)return[W*255,W*255,W*255];let Q=[0,0,0],J=X%1*6,z=J%1,Y=1-z,U=0;switch(Math.floor(J)){case 0:{Q[0]=1,Q[1]=z,Q[2]=0;break}case 1:{Q[0]=Y,Q[1]=1,Q[2]=0;break}case 2:{Q[0]=0,Q[1]=1,Q[2]=z;break}case 3:{Q[0]=0,Q[1]=Y,Q[2]=1;break}case 4:{Q[0]=z,Q[1]=0,Q[2]=1;break}default:Q[0]=1,Q[1]=0,Q[2]=Y}return U=(1-q)*W,[(q*Q[0]+U)*255,(q*Q[1]+U)*255,(q*Q[2]+U)*255]};w.hcg.hsv=function(Z){let X=Z[1]/100,q=Z[2]/100,W=X+q*(1-X),Q=0;if(W>0)Q=X/W;return[Z[0],Q*100,W*100]};w.hcg.hsl=function(Z){let X=Z[1]/100,W=Z[2]/100*(1-X)+0.5*X,Q=0;if(W>0&&W<0.5)Q=X/(2*W);else if(W>=0.5&&W<1)Q=X/(2*(1-W));return[Z[0],Q*100,W*100]};w.hcg.hwb=function(Z){let X=Z[1]/100,q=Z[2]/100,W=X+q*(1-X);return[Z[0],(W-X)*100,(1-W)*100]};w.hwb.hcg=function(Z){let X=Z[1]/100,W=1-Z[2]/100,Q=W-X,J=0;if(Q<1)J=(W-Q)/(1-Q);return[Z[0],Q*100,J*100]};w.apple.rgb=function(Z){return[Z[0]/65535*255,Z[1]/65535*255,Z[2]/65535*255]};w.rgb.apple=function(Z){return[Z[0]/255*65535,Z[1]/255*65535,Z[2]/255*65535]};w.gray.rgb=function(Z){return[Z[0]/100*255,Z[0]/100*255,Z[0]/100*255]};w.gray.hsl=function(Z){return[0,0,Z[0]]};w.gray.hsv=w.gray.hsl;w.gray.hwb=function(Z){return[0,100,Z[0]]};w.gray.cmyk=function(Z){return[0,0,0,Z[0]]};w.gray.lab=function(Z){return[Z[0],0,0]};w.gray.hex=function(Z){let X=Math.round(Z[0]/100*255)&255,W=((X<<16)+(X<<8)+X).toString(16).toUpperCase();return"000000".slice(W.length)+W};w.rgb.gray=function(Z){return[(Z[0]+Z[1]+Z[2])/3/255*100]};function xV(){let Z={},X=Object.keys(k6);for(let{length:q}=X,W=0;W<q;W++)Z[X[W]]={distance:-1,parent:null};return Z}function kV(Z){let X=xV(),q=[Z];X[Z].distance=0;while(q.length>0){let W=q.pop(),Q=Object.keys(k6[W]);for(let{length:J}=Q,z=0;z<J;z++){let Y=Q[z],U=X[Y];if(U.distance===-1)U.distance=X[W].distance+1,U.parent=W,q.unshift(Y)}}return X}function SV(Z,X){return function(q){return X(Z(q))}}function bV(Z,X){let q=[X[Z].parent,Z],W=k6[X[Z].parent][Z],Q=X[Z].parent;while(X[Q].parent)q.unshift(X[Q].parent),W=SV(k6[X[Q].parent][Q],W),Q=X[Q].parent;return W.conversion=q,W}function vV(Z){let X=kV(Z),q={},W=Object.keys(X);for(let{length:Q}=W,J=0;J<Q;J++){let z=W[J];if(X[z].parent===null)continue;q[z]=bV(z,X)}return q}var yV=vV,Q4={},gV=Object.keys(k6);function hV(Z){let X=function(...q){let W=q[0];if(W===void 0||W===null)return W;if(W.length>1)q=W;return Z(q)};if("conversion"in Z)X.conversion=Z.conversion;return X}function mV(Z){let X=function(...q){let W=q[0];if(W===void 0||W===null)return W;if(W.length>1)q=W;let Q=Z(q);if(typeof Q==="object")for(let{length:J}=Q,z=0;z<J;z++)Q[z]=Math.round(Q[z]);return Q};if("conversion"in Z)X.conversion=Z.conversion;return X}for(let Z of gV){Q4[Z]={},Object.defineProperty(Q4[Z],"channels",{value:k6[Z].channels}),Object.defineProperty(Q4[Z],"labels",{value:k6[Z].labels});let X=yV(Z),q=Object.keys(X);for(let W of q){let Q=X[W];Q4[Z][W]=mV(Q),Q4[Z][W].raw=hV(Q)}}var D0=Q4,xX=["keyword","gray","hex"],R3={};for(let Z of Object.keys(D0))R3[[...D0[Z].labels].sort().join("")]=Z;var _3={};function Z0(Z,X){if(!(this instanceof Z0))return new Z0(Z,X);if(X&&X in xX)X=null;if(X&&!(X in D0))throw Error("Unknown model: "+X);let q,W;if(Z==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(Z instanceof Z0)this.model=Z.model,this.color=[...Z.color],this.valpha=Z.valpha;else if(typeof Z==="string"){let Q=W4.get(Z);if(Q===null)throw Error("Unable to parse color from string: "+Z);this.model=Q.model,W=D0[this.model].channels,this.color=Q.value.slice(0,W),this.valpha=typeof Q.value[W]==="number"?Q.value[W]:1}else if(Z.length>0){this.model=X||"rgb",W=D0[this.model].channels;let Q=Array.prototype.slice.call(Z,0,W);this.color=P3(Q,W),this.valpha=typeof Z[W]==="number"?Z[W]:1}else if(typeof Z==="number")this.model="rgb",this.color=[Z>>16&255,Z>>8&255,Z&255],this.valpha=1;else{this.valpha=1;let Q=Object.keys(Z);if("alpha"in Z)Q.splice(Q.indexOf("alpha"),1),this.valpha=typeof Z.alpha==="number"?Z.alpha:0;let J=Q.sort().join("");if(!(J in R3))throw Error("Unable to parse color from object: "+JSON.stringify(Z));this.model=R3[J];let{labels:z}=D0[this.model],Y=[];for(q=0;q<z.length;q++)Y.push(Z[z[q]]);this.color=P3(Y)}if(_3[this.model]){W=D0[this.model].channels;for(q=0;q<W;q++){let Q=_3[this.model][q];if(Q)this.color[q]=Q(this.color[q])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}Z0.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(Z){let X=this.model in W4.to?this:this.rgb();X=X.round(typeof Z==="number"?Z:1);let q=X.valpha===1?X.color:[...X.color,this.valpha];return W4.to[X.model](...q)},percentString(Z){let X=this.rgb().round(typeof Z==="number"?Z:1),q=X.valpha===1?X.color:[...X.color,this.valpha];return W4.to.rgb.percent(...q)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let Z={},{channels:X}=D0[this.model],{labels:q}=D0[this.model];for(let W=0;W<X;W++)Z[q[W]]=this.color[W];if(this.valpha!==1)Z.alpha=this.valpha;return Z},unitArray(){let Z=this.rgb().color;if(Z[0]/=255,Z[1]/=255,Z[2]/=255,this.valpha!==1)Z.push(this.valpha);return Z},unitObject(){let Z=this.rgb().object();if(Z.r/=255,Z.g/=255,Z.b/=255,this.valpha!==1)Z.alpha=this.valpha;return Z},round(Z){return Z=Math.max(Z||0,0),new Z0([...this.color.map(uV(Z)),this.valpha],this.model)},alpha(Z){if(Z!==void 0)return new Z0([...this.color,Math.max(0,Math.min(1,Z))],this.model);return this.valpha},red:c("rgb",0,t(255)),green:c("rgb",1,t(255)),blue:c("rgb",2,t(255)),hue:c(["hsl","hsv","hsl","hwb","hcg"],0,(Z)=>(Z%360+360)%360),saturationl:c("hsl",1,t(100)),lightness:c("hsl",2,t(100)),saturationv:c("hsv",1,t(100)),value:c("hsv",2,t(100)),chroma:c("hcg",1,t(100)),gray:c("hcg",2,t(100)),white:c("hwb",1,t(100)),wblack:c("hwb",2,t(100)),cyan:c("cmyk",0,t(100)),magenta:c("cmyk",1,t(100)),yellow:c("cmyk",2,t(100)),black:c("cmyk",3,t(100)),x:c("xyz",0,t(95.047)),y:c("xyz",1,t(100)),z:c("xyz",2,t(108.833)),l:c("lab",0,t(100)),a:c("lab",1),b:c("lab",2),keyword(Z){if(Z!==void 0)return new Z0(Z);return D0[this.model].keyword(this.color)},hex(Z){if(Z!==void 0)return new Z0(Z);return W4.to.hex(...this.rgb().round().color)},hexa(Z){if(Z!==void 0)return new Z0(Z);let X=this.rgb().round().color,q=Math.round(this.valpha*255).toString(16).toUpperCase();if(q.length===1)q="0"+q;return W4.to.hex(...X)+q},rgbNumber(){let Z=this.rgb().color;return(Z[0]&255)<<16|(Z[1]&255)<<8|Z[2]&255},luminosity(){let Z=this.rgb().color,X=[];for(let[q,W]of Z.entries()){let Q=W/255;X[q]=Q<=0.04045?Q/12.92:((Q+0.055)/1.055)**2.4}return 0.2126*X[0]+0.7152*X[1]+0.0722*X[2]},contrast(Z){let X=this.luminosity(),q=Z.luminosity();if(X>q)return(X+0.05)/(q+0.05);return(q+0.05)/(X+0.05)},level(Z){let X=this.contrast(Z);if(X>=7)return"AAA";return X>=4.5?"AA":""},isDark(){let Z=this.rgb().color;return(Z[0]*2126+Z[1]*7152+Z[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let Z=this.rgb();for(let X=0;X<3;X++)Z.color[X]=255-Z.color[X];return Z},lighten(Z){let X=this.hsl();return X.color[2]+=X.color[2]*Z,X},darken(Z){let X=this.hsl();return X.color[2]-=X.color[2]*Z,X},saturate(Z){let X=this.hsl();return X.color[1]+=X.color[1]*Z,X},desaturate(Z){let X=this.hsl();return X.color[1]-=X.color[1]*Z,X},whiten(Z){let X=this.hwb();return X.color[1]+=X.color[1]*Z,X},blacken(Z){let X=this.hwb();return X.color[2]+=X.color[2]*Z,X},grayscale(){let Z=this.rgb().color,X=Z[0]*0.3+Z[1]*0.59+Z[2]*0.11;return Z0.rgb(X,X,X)},fade(Z){return this.alpha(this.valpha-this.valpha*Z)},opaquer(Z){return this.alpha(this.valpha+this.valpha*Z)},rotate(Z){let X=this.hsl(),q=X.color[0];return q=(q+Z)%360,q=q<0?360+q:q,X.color[0]=q,X},mix(Z,X){if(!Z||!Z.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof Z);let q=Z.rgb(),W=this.rgb(),Q=X===void 0?0.5:X,J=2*Q-1,z=q.alpha()-W.alpha(),Y=((J*z===-1?J:(J+z)/(1+J*z))+1)/2,U=1-Y;return Z0.rgb(Y*q.red()+U*W.red(),Y*q.green()+U*W.green(),Y*q.blue()+U*W.blue(),q.alpha()*Q+W.alpha()*(1-Q))}};for(let Z of Object.keys(D0)){if(xX.includes(Z))continue;let{channels:X}=D0[Z];Z0.prototype[Z]=function(...q){if(this.model===Z)return new Z0(this);if(q.length>0)return new Z0(q,Z);return new Z0([...dV(D0[this.model][Z].raw(this.color)),this.valpha],Z)},Z0[Z]=function(...q){let W=q[0];if(typeof W==="number")W=P3(q,X);return new Z0(W,Z)}}function fV(Z,X){return Number(Z.toFixed(X))}function uV(Z){return function(X){return fV(X,Z)}}function c(Z,X,q){Z=Array.isArray(Z)?Z:[Z];for(let W of Z)(_3[W]||=[])[X]=q;return Z=Z[0],function(W){let Q;if(W!==void 0){if(q)W=q(W);return Q=this[Z](),Q.color[X]=W,Q}if(Q=this[Z]().color[X],q)Q=q(Q);return Q}}function t(Z){return function(X){return Math.max(0,Math.min(Z,X))}}function dV(Z){return Array.isArray(Z)?Z:[Z]}function P3(Z,X){for(let q=0;q<X;q++)if(typeof Z[q]!=="number")Z[q]=0;return Z}var cV=Z0});var vX=E((nM,bX)=>{bX.exports=SX().default});function lV(Z){return this._setBackgroundColourOption("tint",Z),this}function pV(Z){return this.options.greyscale=G.bool(Z)?Z:!0,this}function nV(Z){return this.greyscale(Z)}function iV(Z){if(!G.string(Z))throw G.invalidParameterError("colourspace","string",Z);return this.options.colourspacePipeline=Z,this}function rV(Z){return this.pipelineColourspace(Z)}function aV(Z){if(!G.string(Z))throw G.invalidParameterError("colourspace","string",Z);return this.options.colourspace=Z,this}function sV(Z){return this.toColourspace(Z)}function hX(Z){if(G.object(Z)||G.string(Z)&&Z.length>=3&&Z.length<=200){let X=gX.default(Z);return[X.red(),X.green(),X.blue(),Math.round(X.alpha()*255)]}else throw G.invalidParameterError("background","object or string",Z)}function oV(Z,X){if(G.defined(X))this.options[Z]=hX(X)}var gX,yX,mX=(Z)=>{Object.assign(Z.prototype,{tint:lV,greyscale:pV,grayscale:nV,pipelineColourspace:iV,pipelineColorspace:rV,toColourspace:aV,toColorspace:sV,_getBackgroundColourOption:hX,_setBackgroundColourOption:oV}),Z.colourspace=yX,Z.colorspace=yX};var fX=R(()=>{m0();gX=B4(vX(),1);/*!
314
226
  Copyright 2013 Lovell Fuller and others.
315
227
  SPDX-License-Identifier: Apache-2.0
316
- */var bz=UZ(),a0=v0(),KZ={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};function vz(Z){return this._setBackgroundColourOption("tint",Z),this}function yz(Z){return this.options.greyscale=a0.bool(Z)?Z:!0,this}function gz(Z){return this.greyscale(Z)}function hz(Z){if(!a0.string(Z))throw a0.invalidParameterError("colourspace","string",Z);return this.options.colourspacePipeline=Z,this}function mz(Z){return this.pipelineColourspace(Z)}function fz(Z){if(!a0.string(Z))throw a0.invalidParameterError("colourspace","string",Z);return this.options.colourspace=Z,this}function uz(Z){return this.toColourspace(Z)}function VZ(Z){if(a0.object(Z)||a0.string(Z)&&Z.length>=3&&Z.length<=200){let J=bz(Z);return[J.red(),J.green(),J.blue(),Math.round(J.alpha()*255)]}else throw a0.invalidParameterError("background","object or string",Z)}function dz(Z,J){if(a0.defined(J))this.options[Z]=VZ(J)}BZ.exports=(Z)=>{Object.assign(Z.prototype,{tint:vz,greyscale:yz,grayscale:gz,pipelineColourspace:hz,pipelineColorspace:mz,toColourspace:fz,toColorspace:uz,_getBackgroundColourOption:VZ,_setBackgroundColourOption:dz}),Z.colourspace=KZ,Z.colorspace=KZ}});var FZ=b((SH,$Z)=>{/*!
228
+ */yX={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function eV(){return this.options.removeAlpha=!0,this}function ZB(Z){if(G.defined(Z))if(G.number(Z)&&G.inRange(Z,0,1))this.options.ensureAlpha=Z;else throw G.invalidParameterError("alpha","number between 0 and 1",Z);else this.options.ensureAlpha=1;return this}function XB(Z){let X={red:0,green:1,blue:2,alpha:3};if(Object.keys(X).includes(Z))Z=X[Z];if(G.integer(Z)&&G.inRange(Z,0,4))this.options.extractChannel=Z;else throw G.invalidParameterError("channel","integer or one of: red, green, blue, alpha",Z);return this}function qB(Z,X){if(Array.isArray(Z))Z.forEach(function(q){this.options.joinChannelIn.push(this._createInputDescriptor(q,X))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(Z,X));return this}function WB(Z){if(G.string(Z)&&G.inArray(Z,["and","or","eor"]))this.options.bandBoolOp=Z;else throw G.invalidParameterError("boolOp","one of: and, or, eor",Z);return this}var tV,uX=(Z)=>{Object.assign(Z.prototype,{removeAlpha:eV,ensureAlpha:ZB,extractChannel:XB,joinChannel:qB,bandbool:WB}),Z.bool=tV};var dX=R(()=>{m0();/*!
317
229
  Copyright 2013 Lovell Fuller and others.
318
230
  SPDX-License-Identifier: Apache-2.0
319
- */var u0=v0(),cz={and:"and",or:"or",eor:"eor"};function lz(){return this.options.removeAlpha=!0,this}function pz(Z){if(u0.defined(Z))if(u0.number(Z)&&u0.inRange(Z,0,1))this.options.ensureAlpha=Z;else throw u0.invalidParameterError("alpha","number between 0 and 1",Z);else this.options.ensureAlpha=1;return this}function nz(Z){let J={red:0,green:1,blue:2,alpha:3};if(Object.keys(J).includes(Z))Z=J[Z];if(u0.integer(Z)&&u0.inRange(Z,0,4))this.options.extractChannel=Z;else throw u0.invalidParameterError("channel","integer or one of: red, green, blue, alpha",Z);return this}function rz(Z,J){if(Array.isArray(Z))Z.forEach(function(X){this.options.joinChannelIn.push(this._createInputDescriptor(X,J))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(Z,J));return this}function iz(Z){if(u0.string(Z)&&u0.inArray(Z,["and","or","eor"]))this.options.bandBoolOp=Z;else throw u0.invalidParameterError("boolOp","one of: and, or, eor",Z);return this}$Z.exports=(Z)=>{Object.assign(Z.prototype,{removeAlpha:lz,ensureAlpha:pz,extractChannel:nz,joinChannel:rz,bandbool:iz}),Z.bool=cz}});var DZ=b((bH,IZ)=>{/*!
231
+ */tV={and:"and",or:"or",eor:"eor"}});import E3 from"node:path";function JB(Z,X){let q;if(!G.string(Z))q=Error("Missing output file path");else if(G.string(this.options.input.file)&&E3.resolve(this.options.input.file)===E3.resolve(Z))q=Error("Cannot use same file for input and output");else if(QB.test(E3.extname(Z))&&!this.constructor.format.jp2.output.file)q=lX();if(q)if(G.fn(X))X(q);else return Promise.reject(q);else{this.options.fileOut=Z;let W=Error();return this._pipeline(X,W)}return this}function zB(Z,X){if(G.object(Z))this._setBooleanOption("resolveWithObject",Z.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let q=Error();return this._pipeline(G.fn(Z)?Z:X,q)}function GB(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let Z=Error();return this._pipeline(null,Z)}function YB(Z){if(G.number(Z)&&Z>0)this.options.withMetadataDensity=Z;else throw G.invalidParameterError("density","positive number",Z);return this.keepExif()}function UB(){return this.options.keepMetadata|=1,this}function KB(Z){if(G.object(Z))for(let[X,q]of Object.entries(Z))if(G.object(q))for(let[W,Q]of Object.entries(q))if(G.string(Q))this.options.withExif[`exif-${X.toLowerCase()}-${W}`]=Q;else throw G.invalidParameterError(`${X}.${W}`,"string",Q);else throw G.invalidParameterError(X,"object",q);else throw G.invalidParameterError("exif","object",Z);return this.options.withExifMerge=!1,this.keepExif()}function VB(Z){return this.withExif(Z),this.options.withExifMerge=!0,this}function BB(){return this.options.keepMetadata|=8,this}function HB(Z,X){if(G.string(Z))this.options.withIccProfile=Z;else throw G.invalidParameterError("icc","string",Z);if(this.keepIccProfile(),G.object(X)){if(G.defined(X.attach))if(G.bool(X.attach)){if(!X.attach)this.options.keepMetadata&=-9}else throw G.invalidParameterError("attach","boolean",X.attach)}return this}function $B(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function FB(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function AB(){return this.options.keepMetadata|=2,this}function MB(Z){if(G.string(Z)&&Z.length>0)this.options.withXmp=Z,this.options.keepMetadata|=2;else throw G.invalidParameterError("xmp","non-empty string",Z);return this}function LB(){return this.options.keepMetadata|=31,this}function IB(Z){if(this.keepMetadata(),this.withIccProfile("srgb"),G.object(Z)){if(G.defined(Z.orientation))if(G.integer(Z.orientation)&&G.inRange(Z.orientation,1,8))this.options.withMetadataOrientation=Z.orientation;else throw G.invalidParameterError("orientation","integer between 1 and 8",Z.orientation);if(G.defined(Z.density))if(G.number(Z.density)&&Z.density>0)this.options.withMetadataDensity=Z.density;else throw G.invalidParameterError("density","positive number",Z.density);if(G.defined(Z.icc))this.withIccProfile(Z.icc);if(G.defined(Z.exif))this.withExifMerge(Z.exif)}return this}function wB(Z,X){let q=cX.get((G.object(Z)&&G.string(Z.id)?Z.id:Z).toLowerCase());if(!q)throw G.invalidParameterError("format",`one of: ${[...cX.keys()].join(", ")}`,Z);return this[q](X)}function DB(Z){if(G.object(Z)){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.jpegQuality=Z.quality;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(G.defined(Z.progressive))this._setBooleanOption("jpegProgressive",Z.progressive);if(G.defined(Z.chromaSubsampling))if(G.string(Z.chromaSubsampling)&&G.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=Z.chromaSubsampling;else throw G.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);let X=G.bool(Z.optimizeCoding)?Z.optimizeCoding:Z.optimiseCoding;if(G.defined(X))this._setBooleanOption("jpegOptimiseCoding",X);if(G.defined(Z.mozjpeg))if(G.bool(Z.mozjpeg)){if(Z.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw G.invalidParameterError("mozjpeg","boolean",Z.mozjpeg);let q=G.bool(Z.trellisQuantization)?Z.trellisQuantization:Z.trellisQuantisation;if(G.defined(q))this._setBooleanOption("jpegTrellisQuantisation",q);if(G.defined(Z.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",Z.overshootDeringing);let W=G.bool(Z.optimizeScans)?Z.optimizeScans:Z.optimiseScans;if(G.defined(W)){if(this._setBooleanOption("jpegOptimiseScans",W),W)this.options.jpegProgressive=!0}let Q=G.number(Z.quantizationTable)?Z.quantizationTable:Z.quantisationTable;if(G.defined(Q))if(G.integer(Q)&&G.inRange(Q,0,8))this.options.jpegQuantisationTable=Q;else throw G.invalidParameterError("quantisationTable","integer between 0 and 8",Q)}return this._updateFormatOut("jpeg",Z)}function NB(Z){if(G.object(Z)){if(G.defined(Z.progressive))this._setBooleanOption("pngProgressive",Z.progressive);if(G.defined(Z.compressionLevel))if(G.integer(Z.compressionLevel)&&G.inRange(Z.compressionLevel,0,9))this.options.pngCompressionLevel=Z.compressionLevel;else throw G.invalidParameterError("compressionLevel","integer between 0 and 9",Z.compressionLevel);if(G.defined(Z.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",Z.adaptiveFiltering);let X=Z.colours||Z.colors;if(G.defined(X))if(G.integer(X)&&G.inRange(X,2,256))this.options.pngBitdepth=pX(X);else throw G.invalidParameterError("colours","integer between 2 and 256",X);if(G.defined(Z.palette))this._setBooleanOption("pngPalette",Z.palette);else if([Z.quality,Z.effort,Z.colours,Z.colors,Z.dither].some(G.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,0,100))this.options.pngQuality=Z.quality;else throw G.invalidParameterError("quality","integer between 0 and 100",Z.quality);if(G.defined(Z.effort))if(G.integer(Z.effort)&&G.inRange(Z.effort,1,10))this.options.pngEffort=Z.effort;else throw G.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(G.defined(Z.dither))if(G.number(Z.dither)&&G.inRange(Z.dither,0,1))this.options.pngDither=Z.dither;else throw G.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither)}}return this._updateFormatOut("png",Z)}function TB(Z){if(G.object(Z)){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.webpQuality=Z.quality;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(G.defined(Z.alphaQuality))if(G.integer(Z.alphaQuality)&&G.inRange(Z.alphaQuality,0,100))this.options.webpAlphaQuality=Z.alphaQuality;else throw G.invalidParameterError("alphaQuality","integer between 0 and 100",Z.alphaQuality);if(G.defined(Z.lossless))this._setBooleanOption("webpLossless",Z.lossless);if(G.defined(Z.nearLossless))this._setBooleanOption("webpNearLossless",Z.nearLossless);if(G.defined(Z.smartSubsample))this._setBooleanOption("webpSmartSubsample",Z.smartSubsample);if(G.defined(Z.smartDeblock))this._setBooleanOption("webpSmartDeblock",Z.smartDeblock);if(G.defined(Z.preset))if(G.string(Z.preset)&&G.inArray(Z.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=Z.preset;else throw G.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",Z.preset);if(G.defined(Z.effort))if(G.integer(Z.effort)&&G.inRange(Z.effort,0,6))this.options.webpEffort=Z.effort;else throw G.invalidParameterError("effort","integer between 0 and 6",Z.effort);if(G.defined(Z.minSize))this._setBooleanOption("webpMinSize",Z.minSize);if(G.defined(Z.mixed))this._setBooleanOption("webpMixed",Z.mixed);if(G.defined(Z.exact))this._setBooleanOption("webpExact",Z.exact)}return C3(Z,this.options),this._updateFormatOut("webp",Z)}function RB(Z){if(G.object(Z)){if(G.defined(Z.reuse))this._setBooleanOption("gifReuse",Z.reuse);if(G.defined(Z.progressive))this._setBooleanOption("gifProgressive",Z.progressive);let X=Z.colours||Z.colors;if(G.defined(X))if(G.integer(X)&&G.inRange(X,2,256))this.options.gifBitdepth=pX(X);else throw G.invalidParameterError("colours","integer between 2 and 256",X);if(G.defined(Z.effort))if(G.number(Z.effort)&&G.inRange(Z.effort,1,10))this.options.gifEffort=Z.effort;else throw G.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(G.defined(Z.dither))if(G.number(Z.dither)&&G.inRange(Z.dither,0,1))this.options.gifDither=Z.dither;else throw G.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither);if(G.defined(Z.interFrameMaxError))if(G.number(Z.interFrameMaxError)&&G.inRange(Z.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=Z.interFrameMaxError;else throw G.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",Z.interFrameMaxError);if(G.defined(Z.interPaletteMaxError))if(G.number(Z.interPaletteMaxError)&&G.inRange(Z.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=Z.interPaletteMaxError;else throw G.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",Z.interPaletteMaxError);if(G.defined(Z.keepDuplicateFrames))if(G.bool(Z.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",Z.keepDuplicateFrames);else throw G.invalidParameterError("keepDuplicateFrames","boolean",Z.keepDuplicateFrames)}return C3(Z,this.options),this._updateFormatOut("gif",Z)}function _B(Z){if(!this.constructor.format.jp2.output.buffer)throw lX();if(G.object(Z)){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.jp2Quality=Z.quality;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(G.defined(Z.lossless))if(G.bool(Z.lossless))this.options.jp2Lossless=Z.lossless;else throw G.invalidParameterError("lossless","boolean",Z.lossless);if(G.defined(Z.tileWidth))if(G.integer(Z.tileWidth)&&G.inRange(Z.tileWidth,1,32768))this.options.jp2TileWidth=Z.tileWidth;else throw G.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if(G.defined(Z.tileHeight))if(G.integer(Z.tileHeight)&&G.inRange(Z.tileHeight,1,32768))this.options.jp2TileHeight=Z.tileHeight;else throw G.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if(G.defined(Z.chromaSubsampling))if(G.string(Z.chromaSubsampling)&&G.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=Z.chromaSubsampling;else throw G.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling)}return this._updateFormatOut("jp2",Z)}function C3(Z,X){if(G.object(Z)&&G.defined(Z.loop))if(G.integer(Z.loop)&&G.inRange(Z.loop,0,65535))X.loop=Z.loop;else throw G.invalidParameterError("loop","integer between 0 and 65535",Z.loop);if(G.object(Z)&&G.defined(Z.delay))if(G.integer(Z.delay)&&G.inRange(Z.delay,0,65535))X.delay=[Z.delay];else if(Array.isArray(Z.delay)&&Z.delay.every(G.integer)&&Z.delay.every((q)=>G.inRange(q,0,65535)))X.delay=Z.delay;else throw G.invalidParameterError("delay","integer or an array of integers between 0 and 65535",Z.delay)}function PB(Z){if(G.object(Z)){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.tiffQuality=Z.quality;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(G.defined(Z.bitdepth))if(G.integer(Z.bitdepth)&&G.inArray(Z.bitdepth,[1,2,4]))this.options.tiffBitdepth=Z.bitdepth;else throw G.invalidParameterError("bitdepth","1, 2 or 4",Z.bitdepth);if(G.defined(Z.tile))this._setBooleanOption("tiffTile",Z.tile);if(G.defined(Z.tileWidth))if(G.integer(Z.tileWidth)&&Z.tileWidth>0)this.options.tiffTileWidth=Z.tileWidth;else throw G.invalidParameterError("tileWidth","integer greater than zero",Z.tileWidth);if(G.defined(Z.tileHeight))if(G.integer(Z.tileHeight)&&Z.tileHeight>0)this.options.tiffTileHeight=Z.tileHeight;else throw G.invalidParameterError("tileHeight","integer greater than zero",Z.tileHeight);if(G.defined(Z.miniswhite))this._setBooleanOption("tiffMiniswhite",Z.miniswhite);if(G.defined(Z.pyramid))this._setBooleanOption("tiffPyramid",Z.pyramid);if(G.defined(Z.xres))if(G.number(Z.xres)&&Z.xres>0)this.options.tiffXres=Z.xres;else throw G.invalidParameterError("xres","number greater than zero",Z.xres);if(G.defined(Z.yres))if(G.number(Z.yres)&&Z.yres>0)this.options.tiffYres=Z.yres;else throw G.invalidParameterError("yres","number greater than zero",Z.yres);if(G.defined(Z.compression))if(G.string(Z.compression)&&G.inArray(Z.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=Z.compression;else throw G.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",Z.compression);if(G.defined(Z.bigtiff))this._setBooleanOption("tiffBigtiff",Z.bigtiff);if(G.defined(Z.predictor))if(G.string(Z.predictor)&&G.inArray(Z.predictor,["none","horizontal","float"]))this.options.tiffPredictor=Z.predictor;else throw G.invalidParameterError("predictor","one of: none, horizontal, float",Z.predictor);if(G.defined(Z.resolutionUnit))if(G.string(Z.resolutionUnit)&&G.inArray(Z.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=Z.resolutionUnit;else throw G.invalidParameterError("resolutionUnit","one of: inch, cm",Z.resolutionUnit)}return this._updateFormatOut("tiff",Z)}function jB(Z){return this.heif({...Z,compression:"av1"})}function EB(Z){if(G.object(Z)){if(G.string(Z.compression)&&G.inArray(Z.compression,["av1","hevc"]))this.options.heifCompression=Z.compression;else throw G.invalidParameterError("compression","one of: av1, hevc",Z.compression);if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.heifQuality=Z.quality;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(G.defined(Z.lossless))if(G.bool(Z.lossless))this.options.heifLossless=Z.lossless;else throw G.invalidParameterError("lossless","boolean",Z.lossless);if(G.defined(Z.effort))if(G.integer(Z.effort)&&G.inRange(Z.effort,0,9))this.options.heifEffort=Z.effort;else throw G.invalidParameterError("effort","integer between 0 and 9",Z.effort);if(G.defined(Z.chromaSubsampling))if(G.string(Z.chromaSubsampling)&&G.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=Z.chromaSubsampling;else throw G.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);if(G.defined(Z.bitdepth))if(G.integer(Z.bitdepth)&&G.inArray(Z.bitdepth,[8,10,12]))this.options.heifBitdepth=Z.bitdepth;else throw G.invalidParameterError("bitdepth","8, 10 or 12",Z.bitdepth);if(G.defined(Z.tune))if(G.string(Z.tune)&&G.inArray(Z.tune,["auto","iq","psnr","ssim"]))if(this.options.heifLossless&&Z.tune==="iq")this.options.heifTune="ssim";else this.options.heifTune=Z.tune;else throw G.invalidParameterError("tune","one of: auto, iq, psnr, ssim",Z.tune)}else throw G.invalidParameterError("options","Object",Z);return this._updateFormatOut("heif",Z)}function CB(Z){if(G.object(Z)){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.jxlDistance=Z.quality>=30?0.1+(100-Z.quality)*0.09:0.017666666666666667*Z.quality*Z.quality-1.15*Z.quality+25;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);else if(G.defined(Z.distance))if(G.number(Z.distance)&&G.inRange(Z.distance,0,15))this.options.jxlDistance=Z.distance;else throw G.invalidParameterError("distance","number between 0.0 and 15.0",Z.distance);if(G.defined(Z.decodingTier))if(G.integer(Z.decodingTier)&&G.inRange(Z.decodingTier,0,4))this.options.jxlDecodingTier=Z.decodingTier;else throw G.invalidParameterError("decodingTier","integer between 0 and 4",Z.decodingTier);if(G.defined(Z.lossless))if(G.bool(Z.lossless))this.options.jxlLossless=Z.lossless;else throw G.invalidParameterError("lossless","boolean",Z.lossless);if(G.defined(Z.effort))if(G.integer(Z.effort)&&G.inRange(Z.effort,1,9))this.options.jxlEffort=Z.effort;else throw G.invalidParameterError("effort","integer between 1 and 9",Z.effort)}return C3(Z,this.options),this._updateFormatOut("jxl",Z)}function OB(Z){if(G.object(Z)){if(G.defined(Z.depth))if(G.string(Z.depth)&&G.inArray(Z.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=Z.depth;else throw G.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",Z.depth)}return this._updateFormatOut("raw")}function xB(Z){if(G.object(Z)){if(G.defined(Z.size))if(G.integer(Z.size)&&G.inRange(Z.size,1,8192))this.options.tileSize=Z.size;else throw G.invalidParameterError("size","integer between 1 and 8192",Z.size);if(G.defined(Z.overlap))if(G.integer(Z.overlap)&&G.inRange(Z.overlap,0,8192)){if(Z.overlap>this.options.tileSize)throw G.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,Z.overlap);this.options.tileOverlap=Z.overlap}else throw G.invalidParameterError("overlap","integer between 0 and 8192",Z.overlap);if(G.defined(Z.container))if(G.string(Z.container)&&G.inArray(Z.container,["fs","zip"]))this.options.tileContainer=Z.container;else throw G.invalidParameterError("container","one of: fs, zip",Z.container);if(G.defined(Z.layout))if(G.string(Z.layout)&&G.inArray(Z.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=Z.layout;else throw G.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",Z.layout);if(G.defined(Z.angle))if(G.integer(Z.angle)&&!(Z.angle%90))this.options.tileAngle=Z.angle;else throw G.invalidParameterError("angle","positive/negative multiple of 90",Z.angle);if(this._setBackgroundColourOption("tileBackground",Z.background),G.defined(Z.depth))if(G.string(Z.depth)&&G.inArray(Z.depth,["onepixel","onetile","one"]))this.options.tileDepth=Z.depth;else throw G.invalidParameterError("depth","one of: onepixel, onetile, one",Z.depth);if(G.defined(Z.skipBlanks))if(G.integer(Z.skipBlanks)&&G.inRange(Z.skipBlanks,-1,65535))this.options.tileSkipBlanks=Z.skipBlanks;else throw G.invalidParameterError("skipBlanks","integer between -1 and 255/65535",Z.skipBlanks);else if(G.defined(Z.layout)&&Z.layout==="google")this.options.tileSkipBlanks=5;let X=G.bool(Z.center)?Z.center:Z.centre;if(G.defined(X))this._setBooleanOption("tileCentre",X);if(G.defined(Z.id))if(G.string(Z.id))this.options.tileId=Z.id;else throw G.invalidParameterError("id","string",Z.id);if(G.defined(Z.basename))if(G.string(Z.basename))this.options.tileBasename=Z.basename;else throw G.invalidParameterError("basename","string",Z.basename)}if(G.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw G.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function kB(Z){if(!G.plainObject(Z))throw G.invalidParameterError("options","object",Z);if(G.integer(Z.seconds)&&G.inRange(Z.seconds,0,3600))this.options.timeoutSeconds=Z.seconds;else throw G.invalidParameterError("seconds","integer between 0 and 3600",Z.seconds);return this}function SB(Z,X){if(!(G.object(X)&&X.force===!1))this.options.formatOut=Z;return this}function bB(Z,X){if(G.bool(X))this.options[Z]=X;else throw G.invalidParameterError(Z,"boolean",X)}function vB(){if(!this.options.streamOut){this.options.streamOut=!0;let Z=Error();this._pipeline(void 0,Z)}}function yB(Z,X){if(typeof Z==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),v.pipeline(this.options,(q,W,Q)=>{if(q)Z(G.nativeError(q,X));else Z(null,W,Q)})});else v.pipeline(this.options,(q,W,Q)=>{if(q)Z(G.nativeError(q,X));else Z(null,W,Q)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),v.pipeline(this.options,(q,W,Q)=>{if(q)this.emit("error",G.nativeError(q,X));else this.emit("info",Q),this.push(W);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else v.pipeline(this.options,(q,W,Q)=>{if(q)this.emit("error",G.nativeError(q,X));else this.emit("info",Q),this.push(W);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((q,W)=>{this.once("finish",()=>{this._flattenBufferIn(),v.pipeline(this.options,(Q,J,z)=>{if(Q)W(G.nativeError(Q,X));else if(this.options.resolveWithObject)q({data:J,info:z});else q(J)})})});else return new Promise((q,W)=>{v.pipeline(this.options,(Q,J,z)=>{if(Q)W(G.nativeError(Q,X));else if(this.options.resolveWithObject)q({data:J,info:z});else q(J)})})}var cX,QB,lX=()=>Error("JP2 output requires libvips with support for OpenJPEG"),pX=(Z)=>1<<31-Math.clz32(Math.ceil(Math.log2(Z))),nX=(Z)=>{Object.assign(Z.prototype,{toFile:JB,toBuffer:zB,toUint8Array:GB,withDensity:YB,keepExif:UB,withExif:KB,withExifMerge:VB,keepIccProfile:BB,withIccProfile:HB,keepGainMap:$B,withGainMap:FB,keepXmp:AB,withXmp:MB,keepMetadata:LB,withMetadata:IB,toFormat:wB,jpeg:DB,jp2:_B,png:NB,webp:TB,tiff:PB,avif:jB,heif:EB,jxl:CB,gif:RB,raw:OB,tile:xB,timeout:kB,_updateFormatOut:SB,_setBooleanOption:bB,_read:vB,_pipeline:yB})};var iX=R(()=>{m0();b4();/*!
320
232
  Copyright 2013 Lovell Fuller and others.
321
233
  SPDX-License-Identifier: Apache-2.0
322
- */var J7=m("node:path"),B=v0(),a4=w1(),MZ=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),az=/\.(jp[2x]|j2[kc])$/i,AZ=()=>Error("JP2 output requires libvips with support for OpenJPEG"),LZ=(Z)=>1<<31-Math.clz32(Math.ceil(Math.log2(Z)));function sz(Z,J){let X;if(!B.string(Z))X=Error("Missing output file path");else if(B.string(this.options.input.file)&&J7.resolve(this.options.input.file)===J7.resolve(Z))X=Error("Cannot use same file for input and output");else if(az.test(J7.extname(Z))&&!this.constructor.format.jp2k.output.file)X=AZ();if(X)if(B.fn(J))J(X);else return Promise.reject(X);else{this.options.fileOut=Z;let q=Error();return this._pipeline(J,q)}return this}function oz(Z,J){if(B.object(Z))this._setBooleanOption("resolveWithObject",Z.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let X=Error();return this._pipeline(B.fn(Z)?Z:J,X)}function tz(){return this.options.keepMetadata|=1,this}function ez(Z){if(B.object(Z))for(let[J,X]of Object.entries(Z))if(B.object(X))for(let[q,W]of Object.entries(X))if(B.string(W))this.options.withExif[`exif-${J.toLowerCase()}-${q}`]=W;else throw B.invalidParameterError(`${J}.${q}`,"string",W);else throw B.invalidParameterError(J,"object",X);else throw B.invalidParameterError("exif","object",Z);return this.options.withExifMerge=!1,this.keepExif()}function ZU(Z){return this.withExif(Z),this.options.withExifMerge=!0,this}function JU(){return this.options.keepMetadata|=8,this}function XU(Z,J){if(B.string(Z))this.options.withIccProfile=Z;else throw B.invalidParameterError("icc","string",Z);if(this.keepIccProfile(),B.object(J)){if(B.defined(J.attach))if(B.bool(J.attach)){if(!J.attach)this.options.keepMetadata&=-9}else throw B.invalidParameterError("attach","boolean",J.attach)}return this}function qU(){return this.options.keepMetadata|=2,this}function WU(Z){if(B.string(Z)&&Z.length>0)this.options.withXmp=Z,this.options.keepMetadata|=2;else throw B.invalidParameterError("xmp","non-empty string",Z);return this}function QU(){return this.options.keepMetadata=31,this}function GU(Z){if(this.keepMetadata(),this.withIccProfile("srgb"),B.object(Z)){if(B.defined(Z.orientation))if(B.integer(Z.orientation)&&B.inRange(Z.orientation,1,8))this.options.withMetadataOrientation=Z.orientation;else throw B.invalidParameterError("orientation","integer between 1 and 8",Z.orientation);if(B.defined(Z.density))if(B.number(Z.density)&&Z.density>0)this.options.withMetadataDensity=Z.density;else throw B.invalidParameterError("density","positive number",Z.density);if(B.defined(Z.icc))this.withIccProfile(Z.icc);if(B.defined(Z.exif))this.withExifMerge(Z.exif)}return this}function YU(Z,J){let X=MZ.get((B.object(Z)&&B.string(Z.id)?Z.id:Z).toLowerCase());if(!X)throw B.invalidParameterError("format",`one of: ${[...MZ.keys()].join(", ")}`,Z);return this[X](J)}function zU(Z){if(B.object(Z)){if(B.defined(Z.quality))if(B.integer(Z.quality)&&B.inRange(Z.quality,1,100))this.options.jpegQuality=Z.quality;else throw B.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(B.defined(Z.progressive))this._setBooleanOption("jpegProgressive",Z.progressive);if(B.defined(Z.chromaSubsampling))if(B.string(Z.chromaSubsampling)&&B.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=Z.chromaSubsampling;else throw B.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);let J=B.bool(Z.optimizeCoding)?Z.optimizeCoding:Z.optimiseCoding;if(B.defined(J))this._setBooleanOption("jpegOptimiseCoding",J);if(B.defined(Z.mozjpeg))if(B.bool(Z.mozjpeg)){if(Z.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw B.invalidParameterError("mozjpeg","boolean",Z.mozjpeg);let X=B.bool(Z.trellisQuantization)?Z.trellisQuantization:Z.trellisQuantisation;if(B.defined(X))this._setBooleanOption("jpegTrellisQuantisation",X);if(B.defined(Z.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",Z.overshootDeringing);let q=B.bool(Z.optimizeScans)?Z.optimizeScans:Z.optimiseScans;if(B.defined(q)){if(this._setBooleanOption("jpegOptimiseScans",q),q)this.options.jpegProgressive=!0}let W=B.number(Z.quantizationTable)?Z.quantizationTable:Z.quantisationTable;if(B.defined(W))if(B.integer(W)&&B.inRange(W,0,8))this.options.jpegQuantisationTable=W;else throw B.invalidParameterError("quantisationTable","integer between 0 and 8",W)}return this._updateFormatOut("jpeg",Z)}function UU(Z){if(B.object(Z)){if(B.defined(Z.progressive))this._setBooleanOption("pngProgressive",Z.progressive);if(B.defined(Z.compressionLevel))if(B.integer(Z.compressionLevel)&&B.inRange(Z.compressionLevel,0,9))this.options.pngCompressionLevel=Z.compressionLevel;else throw B.invalidParameterError("compressionLevel","integer between 0 and 9",Z.compressionLevel);if(B.defined(Z.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",Z.adaptiveFiltering);let J=Z.colours||Z.colors;if(B.defined(J))if(B.integer(J)&&B.inRange(J,2,256))this.options.pngBitdepth=LZ(J);else throw B.invalidParameterError("colours","integer between 2 and 256",J);if(B.defined(Z.palette))this._setBooleanOption("pngPalette",Z.palette);else if([Z.quality,Z.effort,Z.colours,Z.colors,Z.dither].some(B.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(B.defined(Z.quality))if(B.integer(Z.quality)&&B.inRange(Z.quality,0,100))this.options.pngQuality=Z.quality;else throw B.invalidParameterError("quality","integer between 0 and 100",Z.quality);if(B.defined(Z.effort))if(B.integer(Z.effort)&&B.inRange(Z.effort,1,10))this.options.pngEffort=Z.effort;else throw B.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(B.defined(Z.dither))if(B.number(Z.dither)&&B.inRange(Z.dither,0,1))this.options.pngDither=Z.dither;else throw B.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither)}}return this._updateFormatOut("png",Z)}function KU(Z){if(B.object(Z)){if(B.defined(Z.quality))if(B.integer(Z.quality)&&B.inRange(Z.quality,1,100))this.options.webpQuality=Z.quality;else throw B.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(B.defined(Z.alphaQuality))if(B.integer(Z.alphaQuality)&&B.inRange(Z.alphaQuality,0,100))this.options.webpAlphaQuality=Z.alphaQuality;else throw B.invalidParameterError("alphaQuality","integer between 0 and 100",Z.alphaQuality);if(B.defined(Z.lossless))this._setBooleanOption("webpLossless",Z.lossless);if(B.defined(Z.nearLossless))this._setBooleanOption("webpNearLossless",Z.nearLossless);if(B.defined(Z.smartSubsample))this._setBooleanOption("webpSmartSubsample",Z.smartSubsample);if(B.defined(Z.smartDeblock))this._setBooleanOption("webpSmartDeblock",Z.smartDeblock);if(B.defined(Z.preset))if(B.string(Z.preset)&&B.inArray(Z.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=Z.preset;else throw B.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",Z.preset);if(B.defined(Z.effort))if(B.integer(Z.effort)&&B.inRange(Z.effort,0,6))this.options.webpEffort=Z.effort;else throw B.invalidParameterError("effort","integer between 0 and 6",Z.effort);if(B.defined(Z.minSize))this._setBooleanOption("webpMinSize",Z.minSize);if(B.defined(Z.mixed))this._setBooleanOption("webpMixed",Z.mixed)}return X7(Z,this.options),this._updateFormatOut("webp",Z)}function VU(Z){if(B.object(Z)){if(B.defined(Z.reuse))this._setBooleanOption("gifReuse",Z.reuse);if(B.defined(Z.progressive))this._setBooleanOption("gifProgressive",Z.progressive);let J=Z.colours||Z.colors;if(B.defined(J))if(B.integer(J)&&B.inRange(J,2,256))this.options.gifBitdepth=LZ(J);else throw B.invalidParameterError("colours","integer between 2 and 256",J);if(B.defined(Z.effort))if(B.number(Z.effort)&&B.inRange(Z.effort,1,10))this.options.gifEffort=Z.effort;else throw B.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(B.defined(Z.dither))if(B.number(Z.dither)&&B.inRange(Z.dither,0,1))this.options.gifDither=Z.dither;else throw B.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither);if(B.defined(Z.interFrameMaxError))if(B.number(Z.interFrameMaxError)&&B.inRange(Z.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=Z.interFrameMaxError;else throw B.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",Z.interFrameMaxError);if(B.defined(Z.interPaletteMaxError))if(B.number(Z.interPaletteMaxError)&&B.inRange(Z.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=Z.interPaletteMaxError;else throw B.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",Z.interPaletteMaxError);if(B.defined(Z.keepDuplicateFrames))if(B.bool(Z.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",Z.keepDuplicateFrames);else throw B.invalidParameterError("keepDuplicateFrames","boolean",Z.keepDuplicateFrames)}return X7(Z,this.options),this._updateFormatOut("gif",Z)}function BU(Z){if(!this.constructor.format.jp2k.output.buffer)throw AZ();if(B.object(Z)){if(B.defined(Z.quality))if(B.integer(Z.quality)&&B.inRange(Z.quality,1,100))this.options.jp2Quality=Z.quality;else throw B.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(B.defined(Z.lossless))if(B.bool(Z.lossless))this.options.jp2Lossless=Z.lossless;else throw B.invalidParameterError("lossless","boolean",Z.lossless);if(B.defined(Z.tileWidth))if(B.integer(Z.tileWidth)&&B.inRange(Z.tileWidth,1,32768))this.options.jp2TileWidth=Z.tileWidth;else throw B.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if(B.defined(Z.tileHeight))if(B.integer(Z.tileHeight)&&B.inRange(Z.tileHeight,1,32768))this.options.jp2TileHeight=Z.tileHeight;else throw B.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if(B.defined(Z.chromaSubsampling))if(B.string(Z.chromaSubsampling)&&B.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=Z.chromaSubsampling;else throw B.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling)}return this._updateFormatOut("jp2",Z)}function X7(Z,J){if(B.object(Z)&&B.defined(Z.loop))if(B.integer(Z.loop)&&B.inRange(Z.loop,0,65535))J.loop=Z.loop;else throw B.invalidParameterError("loop","integer between 0 and 65535",Z.loop);if(B.object(Z)&&B.defined(Z.delay))if(B.integer(Z.delay)&&B.inRange(Z.delay,0,65535))J.delay=[Z.delay];else if(Array.isArray(Z.delay)&&Z.delay.every(B.integer)&&Z.delay.every((X)=>B.inRange(X,0,65535)))J.delay=Z.delay;else throw B.invalidParameterError("delay","integer or an array of integers between 0 and 65535",Z.delay)}function HU(Z){if(B.object(Z)){if(B.defined(Z.quality))if(B.integer(Z.quality)&&B.inRange(Z.quality,1,100))this.options.tiffQuality=Z.quality;else throw B.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(B.defined(Z.bitdepth))if(B.integer(Z.bitdepth)&&B.inArray(Z.bitdepth,[1,2,4,8]))this.options.tiffBitdepth=Z.bitdepth;else throw B.invalidParameterError("bitdepth","1, 2, 4 or 8",Z.bitdepth);if(B.defined(Z.tile))this._setBooleanOption("tiffTile",Z.tile);if(B.defined(Z.tileWidth))if(B.integer(Z.tileWidth)&&Z.tileWidth>0)this.options.tiffTileWidth=Z.tileWidth;else throw B.invalidParameterError("tileWidth","integer greater than zero",Z.tileWidth);if(B.defined(Z.tileHeight))if(B.integer(Z.tileHeight)&&Z.tileHeight>0)this.options.tiffTileHeight=Z.tileHeight;else throw B.invalidParameterError("tileHeight","integer greater than zero",Z.tileHeight);if(B.defined(Z.miniswhite))this._setBooleanOption("tiffMiniswhite",Z.miniswhite);if(B.defined(Z.pyramid))this._setBooleanOption("tiffPyramid",Z.pyramid);if(B.defined(Z.xres))if(B.number(Z.xres)&&Z.xres>0)this.options.tiffXres=Z.xres;else throw B.invalidParameterError("xres","number greater than zero",Z.xres);if(B.defined(Z.yres))if(B.number(Z.yres)&&Z.yres>0)this.options.tiffYres=Z.yres;else throw B.invalidParameterError("yres","number greater than zero",Z.yres);if(B.defined(Z.compression))if(B.string(Z.compression)&&B.inArray(Z.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=Z.compression;else throw B.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",Z.compression);if(B.defined(Z.bigtiff))this._setBooleanOption("tiffBigtiff",Z.bigtiff);if(B.defined(Z.predictor))if(B.string(Z.predictor)&&B.inArray(Z.predictor,["none","horizontal","float"]))this.options.tiffPredictor=Z.predictor;else throw B.invalidParameterError("predictor","one of: none, horizontal, float",Z.predictor);if(B.defined(Z.resolutionUnit))if(B.string(Z.resolutionUnit)&&B.inArray(Z.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=Z.resolutionUnit;else throw B.invalidParameterError("resolutionUnit","one of: inch, cm",Z.resolutionUnit)}return this._updateFormatOut("tiff",Z)}function $U(Z){return this.heif({...Z,compression:"av1"})}function FU(Z){if(B.object(Z)){if(B.string(Z.compression)&&B.inArray(Z.compression,["av1","hevc"]))this.options.heifCompression=Z.compression;else throw B.invalidParameterError("compression","one of: av1, hevc",Z.compression);if(B.defined(Z.quality))if(B.integer(Z.quality)&&B.inRange(Z.quality,1,100))this.options.heifQuality=Z.quality;else throw B.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(B.defined(Z.lossless))if(B.bool(Z.lossless))this.options.heifLossless=Z.lossless;else throw B.invalidParameterError("lossless","boolean",Z.lossless);if(B.defined(Z.effort))if(B.integer(Z.effort)&&B.inRange(Z.effort,0,9))this.options.heifEffort=Z.effort;else throw B.invalidParameterError("effort","integer between 0 and 9",Z.effort);if(B.defined(Z.chromaSubsampling))if(B.string(Z.chromaSubsampling)&&B.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=Z.chromaSubsampling;else throw B.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);if(B.defined(Z.bitdepth))if(B.integer(Z.bitdepth)&&B.inArray(Z.bitdepth,[8,10,12])){if(Z.bitdepth!==8&&this.constructor.versions.heif)throw B.invalidParameterError("bitdepth when using prebuilt binaries",8,Z.bitdepth);this.options.heifBitdepth=Z.bitdepth}else throw B.invalidParameterError("bitdepth","8, 10 or 12",Z.bitdepth)}else throw B.invalidParameterError("options","Object",Z);return this._updateFormatOut("heif",Z)}function MU(Z){if(B.object(Z)){if(B.defined(Z.quality))if(B.integer(Z.quality)&&B.inRange(Z.quality,1,100))this.options.jxlDistance=Z.quality>=30?0.1+(100-Z.quality)*0.09:0.017666666666666667*Z.quality*Z.quality-1.15*Z.quality+25;else throw B.invalidParameterError("quality","integer between 1 and 100",Z.quality);else if(B.defined(Z.distance))if(B.number(Z.distance)&&B.inRange(Z.distance,0,15))this.options.jxlDistance=Z.distance;else throw B.invalidParameterError("distance","number between 0.0 and 15.0",Z.distance);if(B.defined(Z.decodingTier))if(B.integer(Z.decodingTier)&&B.inRange(Z.decodingTier,0,4))this.options.jxlDecodingTier=Z.decodingTier;else throw B.invalidParameterError("decodingTier","integer between 0 and 4",Z.decodingTier);if(B.defined(Z.lossless))if(B.bool(Z.lossless))this.options.jxlLossless=Z.lossless;else throw B.invalidParameterError("lossless","boolean",Z.lossless);if(B.defined(Z.effort))if(B.integer(Z.effort)&&B.inRange(Z.effort,1,9))this.options.jxlEffort=Z.effort;else throw B.invalidParameterError("effort","integer between 1 and 9",Z.effort)}return X7(Z,this.options),this._updateFormatOut("jxl",Z)}function AU(Z){if(B.object(Z)){if(B.defined(Z.depth))if(B.string(Z.depth)&&B.inArray(Z.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=Z.depth;else throw B.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",Z.depth)}return this._updateFormatOut("raw")}function LU(Z){if(B.object(Z)){if(B.defined(Z.size))if(B.integer(Z.size)&&B.inRange(Z.size,1,8192))this.options.tileSize=Z.size;else throw B.invalidParameterError("size","integer between 1 and 8192",Z.size);if(B.defined(Z.overlap))if(B.integer(Z.overlap)&&B.inRange(Z.overlap,0,8192)){if(Z.overlap>this.options.tileSize)throw B.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,Z.overlap);this.options.tileOverlap=Z.overlap}else throw B.invalidParameterError("overlap","integer between 0 and 8192",Z.overlap);if(B.defined(Z.container))if(B.string(Z.container)&&B.inArray(Z.container,["fs","zip"]))this.options.tileContainer=Z.container;else throw B.invalidParameterError("container","one of: fs, zip",Z.container);if(B.defined(Z.layout))if(B.string(Z.layout)&&B.inArray(Z.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=Z.layout;else throw B.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",Z.layout);if(B.defined(Z.angle))if(B.integer(Z.angle)&&!(Z.angle%90))this.options.tileAngle=Z.angle;else throw B.invalidParameterError("angle","positive/negative multiple of 90",Z.angle);if(this._setBackgroundColourOption("tileBackground",Z.background),B.defined(Z.depth))if(B.string(Z.depth)&&B.inArray(Z.depth,["onepixel","onetile","one"]))this.options.tileDepth=Z.depth;else throw B.invalidParameterError("depth","one of: onepixel, onetile, one",Z.depth);if(B.defined(Z.skipBlanks))if(B.integer(Z.skipBlanks)&&B.inRange(Z.skipBlanks,-1,65535))this.options.tileSkipBlanks=Z.skipBlanks;else throw B.invalidParameterError("skipBlanks","integer between -1 and 255/65535",Z.skipBlanks);else if(B.defined(Z.layout)&&Z.layout==="google")this.options.tileSkipBlanks=5;let J=B.bool(Z.center)?Z.center:Z.centre;if(B.defined(J))this._setBooleanOption("tileCentre",J);if(B.defined(Z.id))if(B.string(Z.id))this.options.tileId=Z.id;else throw B.invalidParameterError("id","string",Z.id);if(B.defined(Z.basename))if(B.string(Z.basename))this.options.tileBasename=Z.basename;else throw B.invalidParameterError("basename","string",Z.basename)}if(B.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw B.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function IU(Z){if(!B.plainObject(Z))throw B.invalidParameterError("options","object",Z);if(B.integer(Z.seconds)&&B.inRange(Z.seconds,0,3600))this.options.timeoutSeconds=Z.seconds;else throw B.invalidParameterError("seconds","integer between 0 and 3600",Z.seconds);return this}function DU(Z,J){if(!(B.object(J)&&J.force===!1))this.options.formatOut=Z;return this}function wU(Z,J){if(B.bool(J))this.options[Z]=J;else throw B.invalidParameterError(Z,"boolean",J)}function NU(){if(!this.options.streamOut){this.options.streamOut=!0;let Z=Error();this._pipeline(void 0,Z)}}function TU(Z,J){if(typeof Z==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),a4.pipeline(this.options,(X,q,W)=>{if(X)Z(B.nativeError(X,J));else Z(null,q,W)})});else a4.pipeline(this.options,(X,q,W)=>{if(X)Z(B.nativeError(X,J));else Z(null,q,W)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),a4.pipeline(this.options,(X,q,W)=>{if(X)this.emit("error",B.nativeError(X,J));else this.emit("info",W),this.push(q);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else a4.pipeline(this.options,(X,q,W)=>{if(X)this.emit("error",B.nativeError(X,J));else this.emit("info",W),this.push(q);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((X,q)=>{this.once("finish",()=>{this._flattenBufferIn(),a4.pipeline(this.options,(W,Q,G)=>{if(W)q(B.nativeError(W,J));else if(this.options.resolveWithObject)X({data:Q,info:G});else X(Q)})})});else return new Promise((X,q)=>{a4.pipeline(this.options,(W,Q,G)=>{if(W)q(B.nativeError(W,J));else if(this.options.resolveWithObject)X({data:Q,info:G});else X(Q)})})}IZ.exports=(Z)=>{Object.assign(Z.prototype,{toFile:sz,toBuffer:oz,keepExif:tz,withExif:ez,withExifMerge:ZU,keepIccProfile:JU,withIccProfile:XU,keepXmp:qU,withXmp:WU,keepMetadata:QU,withMetadata:GU,toFormat:YU,jpeg:zU,jp2:BU,png:UU,webp:KU,tiff:HU,avif:$U,heif:FU,jxl:MU,gif:VU,raw:AU,tile:LU,timeout:IU,_updateFormatOut:DU,_setBooleanOption:wU,_read:NU,_pipeline:TU})}});var RZ=b((vH,TZ)=>{/*!
234
+ */cX=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),QB=/\.(jp[2x]|j2[kc])$/i});import gB from"node:events";import{createRequire as hB}from"node:module";import{availableParallelism as mB}from"node:os";function aX(Z){if(G.bool(Z))if(Z)return v.cache(50,20,100);else return v.cache(0,0,0);else if(G.object(Z))return v.cache(Z.memory,Z.files,Z.items);else return v.cache()}function uB(Z){return v.concurrency(G.integer(Z)?Z:null)}function cB(){return v.counters()}function lB(Z){return v.simd(G.bool(Z)?Z:null)}function pB(Z){if(G.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(G.string))v.block(Z.operation,!0);else throw G.invalidParameterError("operation","Array<string>",Z.operation);else throw G.invalidParameterError("options","object",Z)}function nB(Z){if(G.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(G.string))v.block(Z.operation,!1);else throw G.invalidParameterError("operation","Array<string>",Z.operation);else throw G.invalidParameterError("options","object",Z)}var v4,O3,rX,x3,A6,fB,G4,dB,sX=(Z)=>{Z.cache=aX,Z.concurrency=uB,Z.counters=cB,Z.simd=lB,Z.format=A6,Z.interpolators=fB,Z.versions=G4,Z.queue=dB,Z.block=pB,Z.unblock=nB};var oX=R(()=>{m0();L3();b4();k1();v4=B4(L1(),1);/*!
323
235
  Copyright 2013 Lovell Fuller and others.
324
236
  SPDX-License-Identifier: Apache-2.0
325
- */var RU=m("node:events"),A6=q6(),j0=v0(),{runtimePlatformArch:PU}=l5(),V0=w1(),wZ=PU(),q7=V0.libvipsVersion(),Q4=V0.format();Q4.heif.output.alias=["avif","heic"];Q4.jpeg.output.alias=["jpe","jpg"];Q4.tiff.output.alias=["tif"];Q4.jp2k.output.alias=["j2c","j2k","jp2","jpx"];var jU={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},s4={vips:q7.semver};if(!q7.isGlobal)if(!q7.isWasm)try{s4=m(`@img/sharp-${wZ}/versions`)}catch(Z){try{s4=m(`@img/sharp-libvips-${wZ}/versions`)}catch(J){}}else try{s4=(()=>{throw new Error("Cannot require module "+"@img/sharp-wasm32/versions");})()}catch(Z){}s4.sharp=d5().version;if(s4.heif&&Q4.heif)Q4.heif.input.fileSuffix=[".avif"],Q4.heif.output.alias=["avif"];function NZ(Z){if(j0.bool(Z))if(Z)return V0.cache(50,20,100);else return V0.cache(0,0,0);else if(j0.object(Z))return V0.cache(Z.memory,Z.files,Z.items);else return V0.cache()}NZ(!0);function _U(Z){return V0.concurrency(j0.integer(Z)?Z:null)}if(A6.familySync()===A6.GLIBC&&!V0._isUsingJemalloc())V0.concurrency(1);else if(A6.familySync()===A6.MUSL&&V0.concurrency()===1024)V0.concurrency(m("node:os").availableParallelism());var CU=new RU.EventEmitter;function EU(){return V0.counters()}function OU(Z){return V0.simd(j0.bool(Z)?Z:null)}function xU(Z){if(j0.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(j0.string))V0.block(Z.operation,!0);else throw j0.invalidParameterError("operation","Array<string>",Z.operation);else throw j0.invalidParameterError("options","object",Z)}function kU(Z){if(j0.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(j0.string))V0.block(Z.operation,!1);else throw j0.invalidParameterError("operation","Array<string>",Z.operation);else throw j0.invalidParameterError("options","object",Z)}TZ.exports=(Z)=>{Z.cache=NZ,Z.concurrency=_U,Z.counters=EU,Z.simd=OU,Z.format=Q4,Z.interpolators=jU,Z.versions=s4,Z.queue=CU,Z.block=xU,Z.unblock=kU}});var W7=b((gH,PZ)=>{/*!
237
+ */O3=hB(import.meta.url),rX=S1.runtimePlatformArch(),x3=v.libvipsVersion(),A6=v.format();A6.heif.output.alias=["avif","heic"];A6.jpeg.output.alias=["jpe","jpg"];A6.tiff.output.alias=["tif"];A6.jp2.output.alias=["j2c","j2k","jp2","jpx"];fB={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},G4={vips:x3.semver};if(!x3.isGlobal)if(!x3.isWasm)try{G4=O3(`@img/sharp-${rX}/versions`)}catch(Z){try{G4=O3(`@img/sharp-libvips-${rX}/versions`)}catch(X){}}else try{G4=O3("@img/sharp-wasm32/versions")}catch(Z){}G4.sharp=q6.version;if(G4.heif&&A6.heif)A6.heif.input.fileSuffix=[".avif"],A6.heif.output.alias=["avif"];aX(!0);if(v4.default.familySync()===v4.default.GLIBC&&!v._isUsingJemalloc())v.concurrency(1);else if(v4.default.familySync()===v4.default.MUSL&&v.concurrency()===1024)v.concurrency(mB());dB=new gB.EventEmitter});var k3={};f4(k3,{default:()=>iB});var iB;var S3=R(()=>{VX();$X();wX();NX();jX();fX();dX();iX();oX();/*!
326
238
  Copyright 2013 Lovell Fuller and others.
327
239
  SPDX-License-Identifier: Apache-2.0
328
- */var s0=m8();d8()(s0);i8()(s0);s8()(s0);JZ()(s0);HZ()(s0);FZ()(s0);DZ()(s0);RZ()(s0);PZ.exports=s0});import{createHash as jZ}from"node:crypto";import{readFileSync as SU,mkdirSync as bU,existsSync as vU}from"node:fs";import{resolve as Q7,basename as yU,extname as gU}from"node:path";import{createRequire as hU}from"node:module";async function _Z(){if(o4)return o4;try{return o4=(await Promise.resolve().then(() => F7(W7(),1))).default,o4}catch{}try{return o4=hU(Q7(process.cwd(),"package.json"))("sharp"),o4}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${Z.message}`)}}async function G7(Z){let X=await(await _Z())(Z).metadata();return{width:X.width??0,height:X.height??0,format:X.format??"unknown"}}function N1(Z){let J=SU(Z);return jZ("md5").update(J).digest("hex").slice(0,8)}function Y7(Z){let J=JSON.stringify({widths:Z.widths,formats:Z.formats,quality:Z.quality});return jZ("md5").update(J).digest("hex").slice(0,8)}function fU(Z,J,X,q){return`${Z}-${J}-${X}.${q}`}async function CZ(Z,J,X){let q=await _Z(),W=await G7(Z),Q=N1(Z),G=yU(Z,gU(Z)),z=Q7(J,"_optimized");bU(z,{recursive:!0});let Y=[],U=X.widths.filter((H)=>H<=W.width);if(U.length===0||!U.includes(W.width))U.push(W.width);U.sort((H,$)=>H-$);let K=[];for(let H of U)for(let $ of X.formats){let A=fU(G,H,Q,$),D=`/${mU}/${A}`,L=Q7(z,A);if(Y.push({width:H,format:$,outputPath:D,absolutePath:L}),vU(L))continue;let w=X.quality[$]??80,I=q(Z).resize(H).toFormat($,{quality:w}).toFile(L).then(()=>{});K.push(I)}let V=4;for(let H=0;H<K.length;H+=V)await Promise.all(K.slice(H,H+V));return{original:{width:W.width,height:W.height,format:W.format},variants:Y,contentHash:Q}}function z7(Z,J){return Z.filter((X)=>X.format===J).map((X)=>`${X.outputPath} ${X.width}w`).join(", ")}var o4=null,mU="images/_optimized";var U7=()=>{};import{readFileSync as uU,writeFileSync as dU,mkdirSync as cU,existsSync as lU}from"node:fs";import{resolve as L6,basename as pU}from"node:path";import{execSync as nU}from"node:child_process";import{tmpdir as rU}from"node:os";function t4(Z){if(T1===void 0)try{let J=nU("npm config get cache",{encoding:"utf-8",stdio:["ignore","pipe","ignore"],cwd:rU()}).trim();T1=J&&J!=="undefined"?J:null}catch{T1=null}if(T1)return L6(T1,"jxsuite-images",pU(Z));return L6(Z,".cache/images")}function EZ(Z){let J=L6(t4(Z),"manifest.json");if(!lU(J))return{version:1,entries:{}};try{return JSON.parse(uU(J,"utf8"))}catch{return{version:1,entries:{}}}}function OZ(Z,J){let X=t4(Z);cU(X,{recursive:!0}),dU(L6(X,"manifest.json"),JSON.stringify(J,null,2),"utf8")}function xZ(Z,J){let X=Z.entries[J];if(!X)return null;return X.manifest}function kZ(Z,J,X,q){Z.entries[J]={source:X,manifest:q,timestamp:Date.now()}}var T1=void 0;var K7=O(()=>{U7()});import{existsSync as V7}from"node:fs";import{createHash as iU}from"node:crypto";import{resolve as SZ,extname as bZ,basename as aU}from"node:path";async function yZ(Z,J){let X=J.get(Z);if(!X){let q=await G7(Z);X={width:q.width,height:q.height,hash:N1(Z)},J.set(Z,X)}return X}function I6(Z,J,X,q){return J.filter((W)=>W<=X).sort((W,Q)=>W-Q).map((W)=>`/_jx/image?src=${encodeURIComponent(Z)}&w=${W}&v=${q} ${W}w`).join(", ")}async function gZ(Z,J,X,q,W){let Q=`${N1(Z)}:${Y7(X)}`,G=xZ(W,Q);if(G){if(G.variants.every((U)=>V7(U.absolutePath)))return G}if(!G)console.log(` Optimizing ${aU(Z)}...`);let z=await CZ(Z,t4(q),X);return kZ(W,Q,J,z),z}function hZ(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(sU.some((J)=>Z.startsWith(J)))return!0;if(vZ.has(bZ(Z).toLowerCase()))return!0;return!1}function mZ(Z,J){if(J.service!=="cloudflare")return!1;if(!J.remoteDomains?.length)return!1;if(typeof Z!=="string"||!Z.startsWith("https://"))return!1;if(Z.includes("${"))return!1;try{let X=new URL(Z);if(vZ.has(bZ(X.pathname).toLowerCase()))return!1;return J.remoteDomains.includes(X.hostname)}catch{return!1}}function fZ(Z){return iU("sha256").update(Z).digest("hex").slice(0,8)}function uZ(Z,J){if(Z.startsWith("/"))return SZ(J,"public",Z.slice(1));return SZ(J,Z)}async function dZ(Z,J,X,q,W){let Q=new Map;if(!J.optimize)return{imageRefs:Q};return await cZ(Z,J,X,q,W??new Map,Q),{imageRefs:Q}}async function cZ(Z,J,X,q,W,Q){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await oU(Z,J,X,q,W,Q);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await XK(Z.innerHTML,J,X,q,W,Q);if(Array.isArray(Z.children))for(let G of Z.children){if(typeof G==="string")continue;await cZ(G,J,X,q,W,Q)}}async function oU(Z,J,X,q,W,Q){if(!Z.attributes)Z.attributes={};let G=Z.attributes.src??Z.src,z=mZ(G,J);if(!z&&hZ(G))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let Y=z?null:uZ(G,X);if(Y&&!V7(Y))return;let U,K;if(z)U=I6(G,J.widths,1/0,fZ(G));else if(J.service==="cloudflare"){let V=await yZ(Y,W);U=I6(G,J.widths,V.width,V.hash),K=V}else{let V=Q.get(Y);if(!V)V=await gZ(Y,G,J,X,q),Q.set(Y,V);let H=J.formats.includes("avif")?"avif":J.formats[0];U=z7(V.variants,H),K=V.original}if(U)Z.attributes.srcset=U,Z.attributes.sizes=Z.attributes.sizes??J.sizes;if(!Z.attributes.width&&K?.width)Z.attributes.width=String(K.width);if(!Z.attributes.height&&K?.height)Z.attributes.height=String(K.height);if(J.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function XK(Z,J,X,q,W,Q){let G=[];for(let Y of Z.matchAll(tU)){let U=Y[0],K=Y[1];if(ZK.test(K))continue;if(JK.test(K))continue;let V=K.match(eU);if(!V)continue;let H=V[1].replaceAll("&amp;","&"),$=mZ(H,J);if(!$&&hZ(H))continue;let A=$?null:uZ(H,X);if(A&&!V7(A))continue;let D,L;if($)D=I6(H,J.widths,1/0,fZ(H));else if(J.service==="cloudflare"){let I=await yZ(A,W);D=I6(H,J.widths,I.width,I.hash),L=I}else{let I=Q.get(A);if(!I)I=await gZ(A,H,J,X,q),Q.set(A,I);let j=J.formats.includes("avif")?"avif":J.formats[0];D=z7(I.variants,j),L=I.original}if(!D)continue;let w=` srcset="${D}" sizes="${J.sizes}"`;if(!/\bwidth=/.test(K)&&L?.width)w+=` width="${L.width}"`;if(!/\bheight=/.test(K)&&L?.height)w+=` height="${L.height}"`;if(J.lazyLoad&&!/\bloading="eager"/.test(K)){if(!/\bloading=/.test(K))w+=' loading="lazy"';if(!/\bdecoding=/.test(K))w+=' decoding="async"'}G.push({match:U,replacement:`<img${K}${w}>`})}let z=Z;for(let{match:Y,replacement:U}of G)z=z.replace(Y,U);return z}var vZ,sU,tU,eU,ZK,JK;var lZ=O(()=>{U7();K7();vZ=new Set([".svg",".gif"]),sU=["http://","https://","data:","//"];tU=/<img\b([^>]*)>/gi,eU=/\bsrc="([^"]*)"/,ZK=/\bsrcset="/,JK=/\bdata-no-optimize\b/});var aZ={};T6(aZ,{buildSite:()=>QK});import{writeFileSync as d0,copyFileSync as pZ,mkdirSync as o0,existsSync as w4,rmSync as qK,cpSync as B7,readdirSync as WK}from"node:fs";import{resolve as n,dirname as e4,join as w6}from"node:path";async function QK(Z,J={}){let{clean:X=!0,verbose:q=!1}=J,W=[],Q=q?console.log.bind(console):()=>{};Q("Loading project.json...");let{config:G}=d9(Z),z=n(Z,G.build.outDir),Y=n(Z,"pages"),U=n(Z,"public"),K=G.build.trailingSlash??"always",V=await H1(Z,G);if(V.entries.length>0)Q(` Registered ${V.entries.length} format(s): ${V.entries.map((N)=>N.name).join(", ")}`);if(X&&w4(z))qK(z,{recursive:!0,force:!0});if(o0(z,{recursive:!0}),!w4(Y))throw Error(`pages/ directory not found in ${Z}`);Q("Discovering pages...");let H=await p9(Y,V);Q(` Found ${H.length} page(s)`),Q("Loading content types...");let $=await q2(Z,G,V);if($.size>0){Q(` Loaded ${$.size} content type(s): ${[...$.keys()].join(", ")}`);let N=O5(Z,G);if(N)W2($,N.config)}let A=await r9(H,Z,$,V);Q(` ${A.length} route(s) after expansion`);let D=0,L=n(Z,"components"),w=[],I=new Map,j=new Map;if(w4(L)){Q("Compiling components...");let N=[".json",...V.documentExtensions("component")],k=WK(L).filter((u)=>N.some((l)=>u.endsWith(l))),S=n(z,"components");o0(S,{recursive:!0});for(let u of k)try{let l=n(L,u),r=await o1(l,{$media:G.$media,formats:V});for(let B0 of r.files){let tZ=B0.path.includes("/")?B0.path.split("/").pop():B0.path;if(d0(n(S,tZ),B0.content,"utf8"),B0.tagName)w.push(B0.tagName);D++}let c=await F1(l,V);if(c.tagName){j.set(c.tagName,c);let B0=j7(c.tagName,c.style,c,G.$media??{});if(B0)I.set(c.tagName,B0),d0(n(S,`${c.tagName}.css`),B0,"utf8"),D++}}catch(l){let r=l;W.push(`Error compiling component ${u}: ${r.message}`),console.error(`Error compiling component ${u}: ${r.message}`)}Q(` Compiled ${w.length} component(s): ${w.join(", ")}`)}let g=[];if(G.build.adapter)for(let[,N]of j){let k=E1(N);for(let S of k){let u="./components/"+S.src.replace(/^\.\//,"");g.push({exportName:S.exportName,src:u})}}let y=G.images.optimize&&G.images.service==="cloudflare",E=G.images.optimize&&!y?EZ(Z):null,h=y?new Map:null;if(y)console.log('images.service is "cloudflare" — ensure your wrangler config declares the Images binding '+`("images": { "binding": "${G.images.binding??"IMAGES"}" })`+(G.build.adapter==="cloudflare-workers"?' and an assets binding ("assets": { "binding": "ASSETS" }).':"."));for(let N of A)try{Q(` Compiling ${N.urlPattern} ...`);let k=await GK(N,G,Z,$,E,j,h,V),S=new Set;for(let[l,r]of j)if(k6(r))S.add(l);if(w.length>0)k.html=UK(k.html,w,I,S);let u=iZ(N.urlPattern,z,K);o0(e4(u),{recursive:!0}),d0(u,k.html,"utf8"),D++;for(let l of V.withCapability("serialize")){if(!l.exportTarget)continue;try{let r=await l.call("serialize",k.doc,{mode:"export",componentDefs:j,evaluateTemplate:(c,B0)=>{if(!v(c))return;return G0(c,B0)??c},buildScope:(c)=>_4(c,null)});if(r){let c=u.replace(/\.html$/,l.extensions[0]);d0(c,r,"utf8"),D++}}catch(r){let c=r;W.push(`Error exporting ${l.name} for ${N.urlPattern}: ${c.message}`)}}for(let l of k.files){let r=n(e4(u),l.path);o0(e4(r),{recursive:!0}),d0(r,l.content,"utf8"),D++}if(k.serverHandler){let l=n(e4(u),"_server.js");d0(l,k.serverHandler,"utf8"),D++}}catch(k){let S=k,u=`Error compiling ${N.urlPattern}: ${S.message}`;W.push(u),console.error(u)}if(E&&G.images.optimize){OZ(Z,E);let N=n(t4(Z),"_optimized");if(w4(N)){let S=n(z,"images/_optimized");o0(S,{recursive:!0}),B7(N,S,{recursive:!0})}let k=Object.keys(E.entries).length;if(k>0)Q(` Optimized ${k} image(s)`)}if(G.build.adapter){let N=G.build.adapter;Q("Generating site-wide server worker...");let k=new Map;for(let S of g)if(!k.has(S.exportName))k.set(S.exportName,S);if(N==="cloudflare-pages"){let S=L5([...k.values()]);if(y)S.set("functions/_jx/image.js",I9(G.images));for(let[l,r]of S){let c=n(z,l);o0(n(c,".."),{recursive:!0}),d0(c,r,"utf8"),D++}let u=n(z,"components");o0(u,{recursive:!0});for(let{src:l}of k.values()){let r=n(Z,l.replace(/^\.\//,"")),c=n(u,l.replace(/^\.\/components\//,""));if(w4(r))pZ(r,c)}if(S.size>0)Q(` Generated ${S.size} Pages function(s) in dist/functions/`)}else{let S=A5([...k.values()],{adapter:N,images:y&&N==="cloudflare-workers"?G.images:null});if(S){let u=n(z,"worker.js");d0(u,S,"utf8"),D++,Q(` Generated dist/worker.js (${k.size} server function(s))`);let l=n(z,"components");for(let{src:r}of k.values()){let c=n(Z,r.replace(/^\.\//,"")),B0=n(l,r.replace(/^\.\/components\//,""));if(w4(c))pZ(c,B0)}}}}if(G.redirects&&Object.keys(G.redirects).length>0){Q("Generating redirects...");let N=BK(G.redirects,z);D+=N}if(w4(U))Q("Copying public/ assets..."),B7(U,z,{recursive:!0});if(G.copy){Q("Copying mapped files...");for(let[N,k]of Object.entries(G.copy)){let S=n(Z,N),u=n(z,k);o0(e4(u),{recursive:!0}),B7(S,u)}}if(Q(`
329
- Build complete: ${A.length} routes, ${D} files`),W.length>0)Q(` ${W.length} error(s)`);return{routes:A.length,files:D,errors:W}}async function GK(Z,J,X,q=new Map,W=null,Q=new Map,G=null,z){let Y=await F1(Z.sourcePath,z),U=_5(Y,J,X),K=Y.$head??U._pageHead??[],V=U.$head??[],H=Y.title??U._pageTitle??null;delete U._pageHead,delete U._pageTitle,e9(U,J,Z,q,X),await G2(U,Z,X,{config:J,contentTypes:q});let $=_4(U.state??{}),A=H??J.name??"Jx Site";if(typeof A==="string"&&v(A))A=G0(A,$)??A;let D=nZ(K,$),L=nZ(V,$);if(R1(U,$),$7(U,Q),U.state)for(let[E,h]of Object.entries(U.state)){if(E==="$site"||E==="$page")continue;if(h&&typeof h==="object"&&!Array.isArray(h)&&h.timing==="compiler")delete U.state[E];else if(Array.isArray(h))delete U.state[E]}let w=YK(J.$head??[]),I=o9(w,L,D,{title:A,charset:J.defaults?.charset??"utf-8",...J.name!=null&&{siteName:J.name},...J.url!=null&&{siteUrl:J.url},pageUrl:Z.urlPattern});if(J.$media)U.$media={...J.$media,...U.$media};if(J.images?.optimize&&(W||G))await dZ(U,J.images,X,W,G??void 0);let j=await P5(U,{title:A,lang:J.defaults?.lang??"en",projectStyle:J.style??null});j.html=VK(j.html,I,J.defaults?.lang??"en");let g=(U.$elements??[]).filter((E)=>typeof E==="string"&&!E.startsWith("./")&&!E.startsWith("../"));if(g.length>0)j.html=KK(j.html,g);let y=null;if(!J.build?.adapter)try{let E=await r1(Z.sourcePath);if(E)y=E}catch{}return{html:j.html,files:j.files,serverHandler:y,doc:U}}function nZ(Z,J){return Z.map((X)=>{if(!X||typeof X!=="object")return X;let q={...X};if(q.attributes){q.attributes={...q.attributes};for(let[W,Q]of Object.entries(q.attributes))if(typeof Q==="string"&&v(Q))q.attributes[W]=G0(Q,J)??Q}if(typeof q.textContent==="string"&&v(q.textContent))q.textContent=G0(q.textContent,J)??q.textContent;return q})}function YK(Z){return Z.map((J)=>{if(!J||typeof J!=="object"||!J.attributes)return J;let X={...J,attributes:{...J.attributes}};for(let q of["href","src"]){let W=X.attributes[q];if(typeof W==="string"&&zK(W))X.attributes[q]=`/node_modules/${W}`}return X})}function zK(Z){return!Z.startsWith("/")&&!Z.startsWith("./")&&!Z.startsWith("../")&&!Z.startsWith("http")&&!Z.startsWith("data:")}function rZ(Z,J){if(!Z||typeof Z!=="object")return Z;let X={};for(let[q,W]of Object.entries(Z))if(q==="children"&&Array.isArray(W))X.children=W.map((Q)=>{if(typeof Q==="string")return Q;return rZ(Q,J)});else if(q==="style"&&W&&typeof W==="object"){let Q={...W};for(let[G,z]of Object.entries(Q))if(typeof z==="string"&&v(z))Q[G]=D6(z,J)??z;X.style=Q}else if(q==="attributes"&&W&&typeof W==="object"){let Q={...W};for(let[G,z]of Object.entries(Q))if(typeof z==="string"&&v(z))Q[G]=D6(z,J)??z;X.attributes=Q}else if(q==="$props"&&W&&typeof W==="object"){let Q={...W};for(let[G,z]of Object.entries(Q))if(typeof z==="string"&&v(z)){let Y=D6(z,J);Q[G]=Y!==null?Y??null:z}X.$props=Q}else if(typeof W==="string"&&v(W))X[q]=D6(W,J)??W;else X[q]=W;return X}function D6(Z,J){try{let X=J.$map?.item,q=J.$map?.index,W=Z.match(/^\$\{(.+)\}$/s);if(W)return Function("state","$map","item","index",`return (${W[1]})`)(J,J.$map,X,q);return Function("state","$map","item","index",`return \`${Z}\``)(J,J.$map,X,q)}catch{return null}}function R1(Z,J){if(!Z||typeof Z!=="object")return;if(typeof Z.innerHTML==="string"&&v(Z.innerHTML)){let q=G0(Z.innerHTML,J);if(q!=null)Z.innerHTML=String(q).replaceAll("${","&#36;{")}if(typeof Z.textContent==="string"&&v(Z.textContent))Z.textContent=G0(Z.textContent,J)??Z.textContent;if(Z.style&&typeof Z.style==="object"){for(let[q,W]of Object.entries(Z.style))if(typeof W==="string"&&v(W))Z.style[q]=G0(W,J)??W}if(Z.attributes&&typeof Z.attributes==="object"){for(let[q,W]of Object.entries(Z.attributes))if(typeof W==="string"&&v(W))Z.attributes[q]=G0(W,J)??W}if(Z.$props&&typeof Z.$props==="object"){for(let[q,W]of Object.entries(Z.$props))if(typeof W==="string"&&v(W))Z.$props[q]=G0(W,J)??W}let X=Z.children;if(X&&typeof X==="object"&&!Array.isArray(X)&&X.$prototype==="Array"){let q=X,W=q.items,Q=null;if(W&&typeof W==="object"&&W.$ref){let G=W.$ref;Q=x6(G,J)}else if(Array.isArray(W))Q=W;if(Array.isArray(Q)&&q.map){Z.children=Q.map((G,z)=>{let Y=Object.create(J);Y.$map={item:G,index:z},Y["$map/item"]=G,Y["$map/index"]=z;let U=rZ(q.map,Y);return R1(U,Y),U});return}}if(typeof X==="string"&&v(X)){let q=G0(X,J);if(Array.isArray(q)){let W=q;Z.children=W;for(let Q of W)R1(Q,J)}}else if(Array.isArray(Z.children)){let q=0;while(q<Z.children.length){let W=Z.children[q];if(typeof W==="string"&&v(W)){let Q=G0(W,J);if(Array.isArray(Q)){let G=Q;Z.children.splice(q,1,...G);for(let z of G)R1(z,J);q+=G.length;continue}}R1(W,J),q++}}}function $7(Z,J){if(!Z||typeof Z!=="object")return;if(Array.isArray(Z)){Z.forEach((q)=>$7(q,J));return}if(Array.isArray(Z.children))for(let q of Z.children)$7(q,J);let X=J.get(Z.tagName);if(X){let q=Array.isArray(Z.children)&&Z.children.length>0?Z.children.map((G)=>Z1(G,{},null)).join(`
330
- `):null,W=P7(X,Z.$props||null,q),Q=k6(X);if(Z.innerHTML=W,delete Z.children,X.style&&Z.$props){let G={...X.state};for(let[U,K]of Object.entries(Z.$props))if(U in G)G[U]=K;else G[U]=K;let z=_4(G,null),Y={};for(let[U,K]of Object.entries(X.style))if(typeof K==="string"&&v(K)){let V=o(K,z);if(V!=null)Y[U]=V}if(Object.keys(Y).length>0)Z.style={...Z.style,...Y}}if(delete Z.$props,Q)Z.$static=!0;else Z.$prerendered=!0}}function UK(Z,J,X=new Map,q=new Set){let W=J.filter((V)=>Z.includes(`<${V}`));if(W.length===0)return Z;let Q=W.filter((V)=>X.has(V)).map((V)=>`<link rel="stylesheet" href="/components/${V}.css">`).join(`
331
- `);if(Q)Z=Z.replace("</head>",` ${Q}
332
- </head>`);let G=W.filter((V)=>!q.has(V));if(G.length===0)return Z;let z=`<script type="importmap">
240
+ */HX(l0);IX(l0);DX(l0);PX(l0);mX(l0);uX(l0);nX(l0);sX(l0);iB=l0});import{createHash as tX}from"node:crypto";import{existsSync as rB,mkdirSync as aB,readFileSync as sB}from"node:fs";import{basename as oB,extname as tB,resolve as b3}from"node:path";import{createRequire as eB}from"node:module";async function eX(){if(Y4)return Y4;try{return Y4=(await Promise.resolve().then(() => (S3(),k3))).default,Y4}catch{}try{return Y4=eB(b3(process.cwd(),"package.json"))("sharp"),Y4}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${t0(Z)}`,{cause:Z})}}async function v3(Z){let q=await(await eX())(Z).metadata();return{format:q.format??"unknown",height:q.height??0,width:q.width??0}}function y4(Z){let X=sB(Z);return tX("md5").update(X).digest("hex").slice(0,8)}function y3(Z){let X=JSON.stringify({formats:Z.formats,quality:Z.quality,widths:Z.widths});return tX("md5").update(X).digest("hex").slice(0,8)}function XH(Z,X,q,W){return`${Z}-${X}-${q}.${W}`}async function Zq(Z,X,q){let W=await eX(),Q=await v3(Z),J=y4(Z),z=oB(Z,tB(Z)),Y=b3(X,"_optimized");aB(Y,{recursive:!0});let U=[],K=q.widths.filter((H)=>H<=Q.width);if(K.length===0||!K.includes(Q.width))K.push(Q.width);K.sort((H,$)=>H-$);let V=[];for(let H of K)for(let $ of q.formats){let F=XH(z,H,J,$),L=`/${ZH}/${F}`,A=b3(Y,F);if(U.push({absolutePath:A,format:$,outputPath:L,width:H}),rB(A))continue;let I=q.quality[$]??80,M=W(Z).resize(H).toFormat($,{quality:I}).toFile(A).then(()=>{});V.push(M)}let B=4;for(let H=0;H<V.length;H+=B)await Promise.all(V.slice(H,H+B));return{contentHash:J,original:{format:Q.format,height:Q.height,width:Q.width},variants:U}}function g3(Z,X){return Z.filter((q)=>q.format===X).map((q)=>`${q.outputPath} ${q.width}w`).join(", ")}var Y4=null,ZH="images/_optimized";var h3=R(()=>{e0()});import{existsSync as qH,mkdirSync as WH,readFileSync as QH,writeFileSync as JH}from"node:fs";import{basename as zH,resolve as g1}from"node:path";import{execSync as GH}from"node:child_process";import{tmpdir as YH}from"node:os";function U4(Z){if(g4===void 0)try{let X=GH("npm config get cache",{cwd:YH(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();g4=X&&X!=="undefined"?X:null}catch{g4=null}if(g4)return g1(g4,"jxsuite-images",zH(Z));return g1(Z,".cache/images")}function Xq(Z){let X=g1(U4(Z),"manifest.json");if(!qH(X))return{entries:{},version:1};try{return JSON.parse(QH(X,"utf8"))}catch{return{entries:{},version:1}}}function qq(Z,X){let q=U4(Z);WH(q,{recursive:!0}),JH(g1(q,"manifest.json"),JSON.stringify(X,null,2),"utf8")}function Wq(Z,X){let q=Z.entries[X];if(!q)return null;return q.manifest}function Qq(Z,X,q,W){Z.entries[X]={manifest:W,source:q,timestamp:Date.now()}}var g4;var m3=R(()=>{h3()});import{existsSync as f3}from"node:fs";import{basename as UH,extname as Gq,resolve as Jq}from"node:path";async function Uq(Z,X){let q=X.get(Z);if(!q){let W=y4(Z);try{let Q=await v3(Z);q={width:Q.width,height:Q.height,hash:W}}catch(Q){if(!zq)zq=!0,console.warn(`Could not read image dimensions (${Q.message}) — `+"emitting srcsets without width/height attributes.");q={width:null,height:null,hash:W}}X.set(Z,q)}return q}function h1(Z,X,q,W){let Q=X.quality?.webp??80,J=Z.startsWith("/")?"":"/",z=W?`?v=${W}`:"";return X.widths.filter((Y)=>Y<=q).toSorted((Y,U)=>Y-U).map((Y)=>`/cdn-cgi/image/width=${Y},quality=${Q},fit=scale-down,format=auto${J}${Z}${z} ${Y}w`).join(", ")}async function Kq(Z,X,q,W,Q){let J=`${y4(Z)}:${y3(q)}`,z=Wq(Q,J);if(z){if(z.variants.every((K)=>f3(K.absolutePath)))return z}if(!z)console.log(` Optimizing ${UH(Z)}...`);let Y=await Zq(Z,U4(W),q);return Qq(Q,J,X,Y),Y}function Vq(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(KH.some((X)=>Z.startsWith(X)))return!0;if(Yq.has(Gq(Z).toLowerCase()))return!0;return!1}function Bq(Z,X){if(X.service!=="cloudflare")return!1;if(!X.remoteDomains?.length)return!1;if(typeof Z!=="string"||!Z.startsWith("https://"))return!1;if(Z.includes("${"))return!1;try{let q=new URL(Z);if(Yq.has(Gq(q.pathname).toLowerCase()))return!1;return X.remoteDomains.includes(q.hostname)}catch{return!1}}function Hq(Z,X){if(Z.startsWith("/"))return Jq(X,"public",Z.slice(1));return Jq(X,Z)}async function $q(Z,X,q,W,Q){let J=new Map;if(!X.optimize)return{imageRefs:J};return await Fq(Z,X,q,W,Q??new Map,J),{imageRefs:J}}async function Fq(Z,X,q,W,Q,J){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await VH(Z,X,q,W,Q,J);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await AH(Z.innerHTML,X,q,W,Q,J);if(Array.isArray(Z.children))for(let z of Z.children){if(typeof z==="string")continue;await Fq(z,X,q,W,Q,J)}}async function VH(Z,X,q,W,Q,J){if(!Z.attributes)Z.attributes={};let z=Z.attributes.src??Z.src;if(typeof z!=="string")return;let Y=Bq(z,X);if(!Y&&Vq(z))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let U,K;if(Y)U=h1(z,X,1/0,null);else{let V=Hq(z,q);if(!f3(V))return;if(X.service==="cloudflare"){let B=await Uq(V,Q);if(U=h1(z,X,B.width??1/0,B.hash),B.width!=null&&B.height!=null)K={width:B.width,height:B.height}}else{let B=J.get(V);if(!B)B=await Kq(V,z,X,q,W),J.set(V,B);let H=X.formats.includes("avif")?"avif":X.formats[0];U=g3(B.variants,H),{original:K}=B}}if(U)Z.attributes.srcset=U,Z.attributes.sizes??=X.sizes;if(!Z.attributes.width&&K?.width)Z.attributes.width=String(K.width);if(!Z.attributes.height&&K?.height)Z.attributes.height=String(K.height);if(X.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function AH(Z,X,q,W,Q,J){let z=[];for(let U of Z.matchAll(BH)){let[K]=U,[,V]=U;if($H.test(V))continue;if(FH.test(V))continue;let B=V.match(HH);if(!B)continue;let H=B[1].replaceAll("&amp;","&"),$=Bq(H,X);if(!$&&Vq(H))continue;let F=$?null:Hq(H,q);if(F&&!f3(F))continue;let L,A;if($)L=h1(H,X,1/0,null);else if(X.service==="cloudflare"){let M=await Uq(F,Q);if(L=h1(H,X,M.width??1/0,M.hash),M.width!=null&&M.height!=null)A={width:M.width,height:M.height}}else{let M=J.get(F);if(!M)M=await Kq(F,H,X,q,W),J.set(F,M);let _=X.formats.includes("avif")?"avif":X.formats[0];L=g3(M.variants,_),{original:A}=M}if(!L)continue;let I=` srcset="${L}" sizes="${X.sizes}"`;if(!/\bwidth=/.test(V)&&A?.width)I+=` width="${A.width}"`;if(!/\bheight=/.test(V)&&A?.height)I+=` height="${A.height}"`;if(X.lazyLoad&&!/\bloading="eager"/.test(V)){if(!/\bloading=/.test(V))I+=' loading="lazy"';if(!/\bdecoding=/.test(V))I+=' decoding="async"'}z.push({match:K,replacement:`<img${V}${I}>`})}let Y=Z;for(let{match:U,replacement:K}of z)Y=Y.replace(U,K);return Y}var Yq,KH,zq=!1,BH,HH,$H,FH;var Aq=R(()=>{h3();m3();Yq=new Set([".svg",".gif"]),KH=["http://","https://","data:","//"];BH=/<img\b([^>]*)>/gi,HH=/\bsrc="([^"]*)"/,$H=/\bsrcset="/,FH=/\bdata-no-optimize\b/});var wq={};f4(wq,{buildSite:()=>wH});import{copyFileSync as MH,cpSync as u3,existsSync as K4,mkdirSync as M6,readdirSync as LH,rmSync as IH,writeFileSync as n0}from"node:fs";import{dirname as V4,join as f1,resolve as e}from"node:path";async function wH(Z,X={}){let{clean:q=!0,verbose:W=!1}=X,Q=[],J=W?console.log.bind(console):()=>{};J("Loading project.json...");let{config:z}=w7(Z),Y=e(Z,z.build.outDir),U=e(Z,"pages"),K=e(Z,"public"),V=z.build.trailingSlash??"always",B=await T4(Z,z);if(B.entries.length>0)J(` Registered ${B.entries.length} format(s): ${B.entries.map((j)=>j.name).join(", ")}`);if(q&&K4(Y))IH(Y,{force:!0,recursive:!0});if(M6(Y,{recursive:!0}),!K4(U))throw Error(`pages/ directory not found in ${Z}`);J("Discovering pages...");let H=await T7(U,B);J(` Found ${H.length} page(s)`),J("Loading content types...");let $=await v7(Z,z,B);if($.size>0){J(` Loaded ${$.size} content type(s): ${[...$.keys()].join(", ")}`);let j=a5(Z,z);if(j)y7($,j.config)}let F=await _7(H,Z,$,B);J(` ${F.length} route(s) after expansion`);let L=0,A=e(Z,"components"),I=[],M=new Map,_=new Map;if(K4(A)){J("Compiling components...");let j=[".json",...B.documentExtensions("component")],S=LH(A).filter((f)=>j.some((h)=>f.endsWith(h))),g=e(Y,"components");M6(g,{recursive:!0});for(let f of S)try{let h=e(A,f),X0=await B1(h,{...z.$media?{$media:z.$media}:{},formats:B});for(let G0 of X0.files){let u1=G0.path.includes("/")?G0.path.split("/").pop():G0.path;if(n0(e(g,u1),G0.content,"utf8"),G0.tagName)I.push(G0.tagName);L+=1}let l=await _4(h,B);if(l.tagName){_.set(l.tagName,l);let G0=W8(l.tagName,l.style,l,z.$media??{});if(G0)M.set(l.tagName,G0),n0(e(g,`${l.tagName}.css`),G0,"utf8"),L+=1}}catch(h){let X0=h;Q.push(`Error compiling component ${f}: ${X0.message}`),console.error(`Error compiling component ${f}: ${X0.message}`)}J(` Compiled ${I.length} component(s): ${I.join(", ")}`)}let k=[];if(z.build.adapter)for(let[,j]of _){let S=l4(j);for(let g of S){let f=`./components/${g.src.replace(/^\.\//,"")}`;k.push({exportName:g.exportName,src:f})}}let b=z.images.optimize&&z.images.service==="cloudflare",C=z.images.optimize&&!b?Xq(Z):null,T=b?new Map:null;if(b)console.log('images.service is "cloudflare" — srcsets use /cdn-cgi/image transform URLs. '+"Ensure Image Transformations are enabled for your zone (Cloudflare dashboard → "+"Images → Transformations); these URLs do not work on *.pages.dev / *.workers.dev previews.");for(let j of F)try{J(` Compiling ${j.urlPattern} ...`);let S=await DH(j,z,Z,$,C,_,T,B),g=new Set;for(let[h,X0]of _)if(e1(X0))g.add(h);if(I.length>0)S.html=RH(S.html,I,M,g);let f=Iq(j.urlPattern,Y,V);M6(V4(f),{recursive:!0}),n0(f,S.html,"utf8"),L+=1;for(let h of B.withCapability("serialize")){if(!h.exportTarget)continue;try{let X0=await h.call("serialize",S.doc,{buildScope:(l)=>m6(l,null),componentDefs:_,evaluateTemplate:(l,G0)=>{if(!x(l))return;return Y0(l,G0)??l},mode:"export"});if(X0){let l=f.replace(/\.html$/,h.extensions[0]);n0(l,X0,"utf8"),L+=1}}catch(X0){let l=X0;Q.push(`Error exporting ${h.name} for ${j.urlPattern}: ${l.message}`)}}for(let h of S.files){let X0=e(V4(f),h.path);M6(V4(X0),{recursive:!0}),n0(X0,h.content,"utf8"),L+=1}if(S.serverHandler){let h=e(V4(f),"_server.js");n0(h,S.serverHandler,"utf8"),L+=1}}catch(S){let g=S,f=`Error compiling ${j.urlPattern}: ${g.message}`;Q.push(f),console.error(f)}if(C&&z.images.optimize){qq(Z,C);let j=e(U4(Z),"_optimized");if(K4(j)){let g=e(Y,"images/_optimized");M6(g,{recursive:!0}),u3(j,g,{recursive:!0})}let S=Object.keys(C.entries).length;if(S>0)J(` Optimized ${S} image(s)`)}if(z.build.adapter){let{adapter:j}=z.build;J("Generating site-wide server worker...");let S=new Map;for(let h of k)if(!S.has(h.exportName))S.set(h.exportName,h);let f=j==="cloudflare-pages"&&S.size===0?null:y5([...S.values()],{adapter:j});if(f){let h=j==="cloudflare-pages"?"_worker.js":"worker.js";if(n0(e(Y,h),f,"utf8"),L+=1,J(` Generated dist/${h} (${S.size} server function(s))`),j==="cloudflare-pages")n0(e(Y,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
241
+ `,"utf8"),L+=1;let X0=e(Y,"components");M6(X0,{recursive:!0});for(let{src:l}of S.values()){let G0=e(Z,l.replace(/^\.\//,"")),u1=e(X0,l.replace(/^\.\/components\//,""));if(K4(G0))MH(G0,u1)}}}if(z.redirects&&Object.keys(z.redirects).length>0){J("Generating redirects...");let j=jH(z.redirects,Y);L+=j}if(K4(K))J("Copying public/ assets..."),u3(K,Y,{recursive:!0});if(z.copy){J("Copying mapped files...");for(let[j,S]of Object.entries(z.copy)){let g=e(Z,j),f=e(Y,S);M6(V4(f),{recursive:!0}),u3(g,f)}}if(J(`
242
+ Build complete: ${F.length} routes, ${L} files`),Q.length>0)J(` ${Q.length} error(s)`);return{errors:Q,files:L,routes:F.length}}async function DH(Z,X,q,W=new Map,Q=null,J=new Map,z=null,Y){let U=await _4(Z.sourcePath,Y),K=n5(U,X,q),V=U.$head??K._pageHead??[],B=K.$head??[],H=U.title??K._pageTitle??null;delete K._pageHead,delete K._pageTitle,x7(K,X,Z,W,q),await h7(K,Z,q,{config:X,contentTypes:W});let $=m6(K.state??{}),F=H??X.name??"Jx Site";if(typeof F==="string"&&x(F))F=Y0(F,$)??F;let L=Mq(V,$),A=Mq(B,$);h4(K,$);let I={counter:{n:0},media:{...X.$media,...K.$media},rules:[]};if(c3(K,J,I),K.state)for(let[T,j]of Object.entries(K.state)){if(T==="$site"||T==="$page")continue;if(j&&typeof j==="object"&&!Array.isArray(j)&&j.timing==="compiler")delete K.state[T];else if(Array.isArray(j))delete K.state[T]}let M=NH(X.$head??[]),_=C7(M,A,L,{title:F,charset:X.defaults?.charset??"utf8",...X.name!=null&&{siteName:X.name},...X.url!=null&&{siteUrl:X.url},pageUrl:Z.urlPattern});if(X.$media)K.$media={...X.$media,...K.$media};if(X.images?.optimize&&(Q||z))await $q(K,X.images,q,Q,z??void 0);let k=await l5(K,{lang:X.defaults?.lang??"en",projectStyle:X.style??null,title:F});if(I.rules.length>0)k.html=k.html.replace("</head>",`<style>
243
+ ${I.rules.join(`
244
+ `)}
245
+ </style>
246
+ </head>`);k.html=PH(k.html,_,X.defaults?.lang??"en");let b=(K.$elements??[]).filter((T)=>typeof T==="string"&&!T.startsWith("./")&&!T.startsWith("../"));if(b.length>0)k.html=_H(k.html,b);let C=null;if(!X.build?.adapter)try{let T=await Y1(Z.sourcePath);if(T)C=T}catch{}return{doc:K,files:k.files,html:k.html,serverHandler:C}}function Mq(Z,X){return Z.map((q)=>{if(!q||typeof q!=="object")return q;let W={...q};if(W.attributes){W.attributes={...W.attributes};for(let[Q,J]of Object.entries(W.attributes))if(typeof J==="string"&&x(J))W.attributes[Q]=Y0(J,X)??J}if(typeof W.textContent==="string"&&x(W.textContent))W.textContent=Y0(W.textContent,X)??W.textContent;return W})}function NH(Z){return Z.map((X)=>{if(!X||typeof X!=="object"||!X.attributes)return X;let q={...X,attributes:{...X.attributes}};for(let W of["href","src"]){let Q=q.attributes[W];if(typeof Q==="string"&&TH(Q))q.attributes[W]=`/node_modules/${Q}`}return q})}function TH(Z){return!Z.startsWith("/")&&!Z.startsWith("./")&&!Z.startsWith("../")&&!Z.startsWith("http")&&!Z.startsWith("data:")}function Lq(Z,X){if(!Z||typeof Z!=="object")return Z;let q={};for(let[W,Q]of Object.entries(Z))if(W==="children"&&Array.isArray(Q))q.children=Q.map((J)=>{if(typeof J==="string")return J;return Lq(J,X)});else if(W==="style"&&Q&&typeof Q==="object"){let J={...Q};for(let[z,Y]of Object.entries(J))if(x(Y))J[z]=m1(Y,X)??Y;q.style=J}else if(W==="attributes"&&Q&&typeof Q==="object"){let J={...Q};for(let[z,Y]of Object.entries(J))if(x(Y))J[z]=m1(Y,X)??Y;q.attributes=J}else if(W==="$props"&&Q&&typeof Q==="object"){let J={...Q};for(let[z,Y]of Object.entries(J))if(x(Y)){let U=m1(Y,X);J[z]=U!==null?U??null:Y}q.$props=J}else if(typeof Q==="string"&&x(Q))q[W]=m1(Q,X)??Q;else q[W]=Q;return q}function m1(Z,X){try{let q=X.$map?.item,W=X.$map?.index,Q=Z.match(/^\$\{(.+)\}$/s);if(Q)return Function("state","$map","item","index",`return (${Q[1]})`)(X,X.$map,q,W);return Function("state","$map","item","index",`return \`${Z}\``)(X,X.$map,q,W)}catch{return null}}function h4(Z,X){if(!Z||typeof Z!=="object")return;if(typeof Z.innerHTML==="string"&&x(Z.innerHTML)){let W=Y0(Z.innerHTML,X);if(W!=null)Z.innerHTML=String(W).replaceAll("${","&#36;{")}if(typeof Z.textContent==="string"&&x(Z.textContent))Z.textContent=Y0(Z.textContent,X)??Z.textContent;if(Z.style&&typeof Z.style==="object"){for(let[W,Q]of Object.entries(Z.style))if(typeof Q==="string"&&x(Q))Z.style[W]=Y0(Q,X)??Q}if(Z.attributes&&typeof Z.attributes==="object"){for(let[W,Q]of Object.entries(Z.attributes))if(typeof Q==="string"&&x(Q))Z.attributes[W]=Y0(Q,X)??Q}if(Z.$props&&typeof Z.$props==="object"){for(let[W,Q]of Object.entries(Z.$props))if(typeof Q==="string"&&x(Q))Z.$props[W]=Y0(Q,X)??Q}let q=Z.children;if(w6(q)){let W=q.items,Q=null;if(L0(W))Q=t1(W.$ref,X);else if(Array.isArray(W))Q=W;let J=q.map;if(Array.isArray(Q)&&J){Z.children=Q.map((z,Y)=>{let U=Object.create(X);U.$map={index:Y,item:z},U["$map/item"]=z,U["$map/index"]=Y;let K=Lq(J,U);return h4(K,U),K});return}}if(typeof q==="string"&&x(q)){let W=Y0(q,X);if(Array.isArray(W)){let Q=W;Z.children=Q;for(let J of Q)h4(J,X)}}else if(Array.isArray(Z.children)){let W=0;while(W<Z.children.length){let Q=Z.children[W];if(typeof Q==="string"&&x(Q)){let J=Y0(Q,X);if(Array.isArray(J)){let z=J;Z.children.splice(W,1,...z);for(let Y of z)h4(Y,X);W+=z.length;continue}}h4(Q,X),W+=1}}}function c3(Z,X,q){if(!Z||typeof Z!=="object")return;if(Array.isArray(Z)){for(let Q of Z)c3(Q,X,q);return}if(Array.isArray(Z.children))for(let Q of Z.children)c3(Q,X,q);let W=X.get(Z.tagName);if(W){let Q=Array.isArray(Z.children)&&Z.children.length>0?Z.children.map((Y)=>{if(q&&Y&&typeof Y==="object")G6(Y,q.rules,q.media,"",q.counter,"jxs");return b6(Y,{},null)}).join(`
247
+ `):null,J=q8(W,Z.$props||null,Q),z=e1(W);if(Z.innerHTML=J,delete Z.children,W.style&&Z.$props){let Y={...W.state};for(let[V,B]of Object.entries(Z.$props))Y[V]=V in Y?B:B;let U=m6(Y,null),K={};for(let[V,B]of Object.entries(W.style))if(typeof B==="string"&&x(B)){let H=p(B,U);if(H!=null)K[V]=H}if(Object.keys(K).length>0)Z.style={...Z.style,...K}}if(delete Z.$props,z)Z.$static=!0;else Z.$prerendered=!0}}function RH(Z,X,q=new Map,W=new Set){let Q=X.filter((H)=>Z.includes(`<${H}`));if(Q.length===0)return Z;let J=Q.filter((H)=>q.has(H)).map((H)=>`<link rel="stylesheet" href="/components/${H}.css">`).join(`
248
+ `),z=Z;if(J)z=z.replace("</head>",` ${J}
249
+ </head>`);let Y=Q.filter((H)=>!W.has(H));if(Y.length===0)return z;let U=`<script type="importmap">
333
250
  {
334
251
  "imports": {
335
- "@vue/reactivity": "${T4}",
336
- "lit-html": "${R4}"
252
+ "@vue/reactivity": "${y6}",
253
+ "lit-html": "${g6}"
337
254
  }
338
255
  }
339
- </script>`,Y=G.map((V)=>`<script type="module" src="/components/${V}.js"></script>`).join(`
340
- `),K=(Z.includes('<script type="importmap">')?"":`${z}
341
- `)+Y;return Z.replace("</body>",` ${K}
342
- </body>`)}function KK(Z,J){let X=J.map((q)=>`<script type="module" src="/node_modules/${q}"></script>`).join(`
343
- `);return Z.replace("</body>",` ${X}
344
- </body>`)}function VK(Z,J,X){let q=t9(J),W=/<head>([\s\S]*?)<\/head>/i,Q=Z.match(W),G="";if(Q){let z=Q[1].match(/<style>[\s\S]*?<\/style>/gi);if(z)G+=`
345
- `+z.join(`
346
- `);let Y=Q[1].match(/<script[\s\S]*?<\/script>/gi);if(Y)G+=`
347
- `+Y.join(`
348
- `)}if(W.test(Z))Z=Z.replace(W,`<head>
349
- ${q}${G}
350
- </head>`);return Z=Z.replace(/<html\s[^>]*>/i,(z)=>{if(/lang=/.test(z))return z.replace(/lang="[^"]*"/,`lang="${X}"`);return z.replace("<html",`<html lang="${X}"`)}),Z}function iZ(Z,J,X){if(Z==="/")return w6(J,"index.html");let q=Z.replace(/^\//,"");if(X==="always")return w6(J,q,"index.html");return w6(J,`${q}.html`)}function BK(Z,J){let X=0,q=[];for(let[W,Q]of Object.entries(Z)){let G=typeof Q==="object"?Q.destination:Q,z=typeof Q==="object"?Q.status??301:301;if(W.includes(":")||W.includes("*")){q.push(`${W} ${G} ${z}`);continue}let Y=iZ(W,J,"always"),U=`<!DOCTYPE html>
256
+ </script>`,K=Y.map((H)=>`<script type="module" src="/components/${H}.js"></script>`).join(`
257
+ `),B=(z.includes('<script type="importmap">')?"":`${U}
258
+ `)+K;return z.replace("</body>",` ${B}
259
+ </body>`)}function _H(Z,X){let q=X.map((W)=>`<script type="module" src="/node_modules/${W}"></script>`).join(`
260
+ `);return Z.replace("</body>",` ${q}
261
+ </body>`)}function PH(Z,X,q){let W=O7(X),Q=/<head>([\s\S]*?)<\/head>/i,J=Z.match(Q),z="";if(J){let U=J[1].match(/<style>[\s\S]*?<\/style>/gi);if(U)z+=`
262
+ ${U.join(`
263
+ `)}`;let K=J[1].match(/<script[\s\S]*?<\/script>/gi);if(K)z+=`
264
+ ${K.join(`
265
+ `)}`}let Y=Z;if(Q.test(Y))Y=Y.replace(Q,`<head>
266
+ ${W}${z}
267
+ </head>`);return Y=Y.replace(/<html\s[^>]*>/i,(U)=>{if(/lang=/.test(U))return U.replace(/lang="[^"]*"/,`lang="${q}"`);return U.replace("<html",`<html lang="${q}"`)}),Y}function Iq(Z,X,q){if(Z==="/")return f1(X,"index.html");let W=Z.replace(/^\//,"");if(q==="always")return f1(X,W,"index.html");return f1(X,`${W}.html`)}function jH(Z,X){let q=0,W=[];for(let[Q,J]of Object.entries(Z)){let z=typeof J==="object"?J.destination:J,Y=typeof J==="object"?J.status??301:301;if(Q.includes(":")||Q.includes("*")){W.push(`${Q} ${z} ${Y}`);continue}let U=Iq(Q,X,"always"),K=`<!DOCTYPE html>
351
268
  <html>
352
269
  <head>
353
270
  <meta charset="utf-8">
354
- <meta http-equiv="refresh" content="0;url=${H7(G)}">
355
- <link rel="canonical" href="${H7(G)}">
271
+ <meta http-equiv="refresh" content="0;url=${d3(z)}">
272
+ <link rel="canonical" href="${d3(z)}">
356
273
  <title>Redirecting...</title>
357
274
  </head>
358
275
  <body>
359
- <p>Redirecting to <a href="${H7(G)}">${HK(G)}</a>...</p>
276
+ <p>Redirecting to <a href="${d3(z)}">${EH(z)}</a>...</p>
360
277
  </body>
361
- </html>`;o0(e4(Y),{recursive:!0}),d0(Y,U,"utf8"),X++,q.push(`${W} ${G} ${z}`)}if(q.length>0)d0(w6(J,"_redirects"),q.join(`
362
- `)+`
363
- `,"utf8"),X++;return X}function HK(Z){return String(Z).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function H7(Z){return String(Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var sZ=O(()=>{c9();i9();h4();s9();Z2();f9();t1();U4();Q2();Y2();lZ();K7();M5()});import{resolve as $K}from"node:path";var oZ=process.argv.slice(2),P1=oZ[0];if(!P1||P1==="--help"||P1==="-h")console.log(`Usage: jx <command> [options]
278
+ </html>`;M6(V4(U),{recursive:!0}),n0(U,K,"utf8"),q+=1,W.push(`${Q} ${z} ${Y}`)}if(W.length>0)n0(f1(X,"_redirects"),`${W.join(`
279
+ `)}
280
+ `,"utf8"),q+=1;return q}function EH(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function d3(Z){return String(Z).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}var Dq=R(()=>{S0();D7();P7();s6();E7();k7();L7();H1();T6();g7();m7();Aq();m3()});import{resolve as CH}from"node:path";var Nq=process.argv.slice(2),[m4]=Nq;if(!m4||m4==="--help"||m4==="-h")console.log(`Usage: jx <command> [options]
364
281
 
365
282
  Commands:
366
283
  build [root] Build a Jx site to dist/
367
284
 
368
285
  Options:
369
286
  --verbose Print detailed build progress
370
- --no-clean Don't clean outDir before building`),process.exit(0);if(P1==="build"){let Z=oZ.slice(1),J=new Set(Z.filter((G)=>G.startsWith("--"))),X=Z.filter((G)=>!G.startsWith("--")),q=$K(X[0]??"."),W=J.has("--verbose"),Q=!J.has("--no-clean");console.log(`Building site from ${q}...`);try{let{buildSite:G}=await Promise.resolve().then(() => (sZ(),aZ)),z=await G(q,{verbose:W,clean:Q});if(z.errors.length>0){console.error(`
371
- Build completed with ${z.errors.length} error(s):`);for(let Y of z.errors)console.error(` - ${Y}`);process.exit(1)}console.log(`
372
- Done: ${z.routes} routes → ${z.files} files`)}catch(G){console.error(`Build failed: ${G.message}`),process.exit(1)}}else console.error(`Unknown command: ${P1}
287
+ --no-clean Don't clean outDir before building`),process.exit(0);if(m4==="build"){let Z=Nq.slice(1),X=new Set(Z.filter((z)=>z.startsWith("--"))),q=Z.find((z)=>!z.startsWith("--")),W=CH(q??"."),Q=X.has("--verbose"),J=!X.has("--no-clean");console.log(`Building site from ${W}...`);try{let{buildSite:z}=await Promise.resolve().then(() => (Dq(),wq)),Y=await z(W,{clean:J,verbose:Q});if(Y.errors.length>0){console.error(`
288
+ Build completed with ${Y.errors.length} error(s):`);for(let U of Y.errors)console.error(` - ${U}`);process.exit(1)}console.log(`
289
+ Done: ${Y.routes} routes → ${Y.files} files`)}catch(z){console.error(`Build failed: ${z.message}`),process.exit(1)}}else console.error(`Unknown command: ${m4}
373
290
  Run "jx --help" for usage.`),process.exit(1);