@jxsuite/compiler 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,59 +1,60 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as zB}from"node:module";var tV=Object.create;var{getPrototypeOf:eV,defineProperty:l5,getOwnPropertyNames:ZB}=Object;var XB=Object.prototype.hasOwnProperty;function QB(Z){return this[Z]}var WB,JB,W1=(Z,X,Q)=>{var W=Z!=null&&typeof Z==="object";if(W){var J=X?WB??=new WeakMap:JB??=new WeakMap,G=J.get(Z);if(G)return G}Q=Z!=null?tV(eV(Z)):{};let Y=X||!Z||!Z.__esModule?l5(Q,"default",{value:Z,enumerable:!0}):Q;for(let z of ZB(Z))if(!XB.call(Y,z))l5(Y,z,{get:QB.bind(Z,z),enumerable:!0});if(W)J.set(Z,Y);return Y};var j=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports);var GB=(Z)=>Z;function YB(Z,X){this[Z]=GB.bind(null,X)}var x6=(Z,X)=>{for(var Q in X)l5(Z,Q,{get:X[Q],enumerable:!0,configurable:!0,set:YB.bind(X,Q)})};var c=(Z,X)=>()=>(Z&&(X=Z(Z=0)),X);var _0=zB(import.meta.url);function d5(Z){let X=Z.$map;return X&&typeof X==="object"?X:void 0}function $6(Z){return zQ.has(Z)}function D4(Z,X,Q,W){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return r4(Z,X,Q,W);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return qB(Z.$ref,X,Q,W);if(Array.isArray(Z))return Z.map((J)=>D4(J,X,Q,W));return Z}function qB(Z,X,Q,W){if(Z==="$reduce/acc")return W?.acc;if(Z.startsWith("$reduce/"))return W?.acc;if(Z.startsWith("event#/")){let J=Z.slice(7);return J1(Q,J)}if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,Y,z=d5(X);if(G==="item")Y=W?.item??z?.item??X["$map/item"];else if(G==="index")Y=W?.index??z?.index??X["$map/index"];else Y=z?.[G]??X[`$map/${G}`];return J.length>2?J1(Y,J.slice(2).join("/")):Y}if(Z.startsWith("#/state/")){let J=Z.slice(8),G=J.indexOf("/");if(G===-1)return X[J];return J1(X[J.slice(0,G)],J.slice(G+1))}if(Z.startsWith("parent#/"))return X[Z.slice(8)];if(Z.startsWith("window#/"))return J1(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return J1(globalThis.document,Z.slice(10));return X[Z]??null}function KB(Z,X,Q,W){if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,Y,z=d5(X);if(G==="item")Y=W?.item??z?.item??X["$map/item"];else if(G==="index")Y=W?.index??z?.index??X["$map/index"];else Y=z?.[G]??X[`$map/${G}`];if(J.length>2){let q=J.slice(2),K=q.pop(),V=q.length>0?J1(Y,q.join("/")):Y;return{key:K,obj:V}}return{key:G==="item"?"$map/item":"$map/index",obj:d5(X)??X}}if(Z.startsWith("#/state/")){let J=Z.slice(8);if(J.indexOf("/")===-1)return{key:J,obj:X};let Y=J.split("/"),z=Y.pop(),q=X;for(let K of Y)q=q[K];return{key:z,obj:q}}return{key:Z,obj:X}}function r4(Z,X,Q,W){let{operator:J,target:G,value:Y,initial:z}=Z;if(!$B.has(J))throw Error(`$expression: unknown operator "${J}"`);if(c5.has(J)&&!("value"in Z)){let q=D4(G,X,Q,W);if(J==="!")return!q;if(J==="-")return-q}if(p5.has(J)){let q=D4(G,X,Q,W),K=D4(Y,X,Q,W);switch(J){case"+":return q+K;case"-":return q-K;case"*":return q*K;case"/":return q/K;case"%":return q%K;case"===":return q===K;case"!==":return q!==K;case"<":return q<K;case"<=":return q<=K;case">":return q>K;case">=":return q>=K;case"&&":return q&&K;case"||":return q||K;default:break}}if($Q.has(J)){let q=D4(Y,X,Q,W),{obj:K,key:V}=KB(G.$ref,X,Q,W);switch(J){case"=":{K[V]=q;break}case"+=":{let B=K[V];K[V]=B+q;break}case"-=":{let B=K[V];K[V]=B-q;break}case"*=":{let B=K[V];K[V]=B*q;break}case"/=":{let B=K[V];K[V]=B/q;break}default:break}return}if(qQ.has(J)){let q=D4(G,X,Q,W);switch(J){case"push":return q.push(D4(Y,X,Q,W));case"unshift":return q.unshift(D4(Y,X,Q,W));case"pop":return q.pop();case"shift":return q.shift();case"splice":{let K=D4(Y,X,Q,W);return q.splice(...K)}default:break}}if(n5.has(J)){let q=D4(G,X,Q,W);if(J==="reduce"){let K=D4(z,X,Q,W);for(let[V,B]of q.entries())K=r4(Y,X,Q,{acc:K,index:V,item:B});return K}if(J==="map")return q.map((K,V)=>r4(Y,X,Q,{...W,index:V,item:K}));if(J==="filter")return q.filter((K,V)=>r4(Y,X,Q,{...W,index:V,item:K}))}return}function K4(Z,X){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return U4(Z,X);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return KQ(Z.$ref,X);if(Array.isArray(Z))return Z.map((Q)=>K4(Q,X)).join(", ");return JSON.stringify(Z)}function KQ(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 J=Z.slice(7);return`${W}.${J.replaceAll("/",".")}`}if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J;if(G==="item")return J.length>2?`_item.${J.slice(2).join(".")}`:"_item";if(G==="index")return"_index";return`_${G}`}if(Z.startsWith("#/state/")){let J=Z.slice(8);return`${Q}.${J.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 YQ(Z,X){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return KQ(Z.$ref,X);return K4(Z,X)}function U4(Z,X={}){let{operator:Q,target:W,value:J,initial:G}=Z;if(c5.has(Q)&&!("value"in Z)){let Y=K4(W,X);if(Q==="!")return`!(${Y})`;if(Q==="-")return`-(${Y})`}if(p5.has(Q)){let Y=K4(W,X),z=K4(J,X);return`(${Y} ${Q} ${z})`}if($Q.has(Q)){let Y=YQ(W,X),z=K4(J,X);return`${Y} ${Q} ${z}`}if(qQ.has(Q)){let Y=YQ(W,X);switch(Q){case"push":return`${Y}.push(${K4(J,X)})`;case"unshift":return`${Y}.unshift(${K4(J,X)})`;case"pop":return`${Y}.pop()`;case"shift":return`${Y}.shift()`;case"splice":{let z=Array.isArray(J)?J.map((q)=>K4(q,X)).join(", "):K4(J,X);return`${Y}.splice(${z})`}default:break}}if(n5.has(Q)){let Y=K4(W,X),z=U4(J,X);if(Q==="reduce"){let q=K4(G,X);return`${Y}.reduce((_acc, _item, _index) => ${z}, ${q})`}if(Q==="map")return`${Y}.map((_item, _index) => ${z})`;if(Q==="filter")return`${Y}.filter((_item, _index) => ${z})`}return"undefined"}function J1(Z,X){let Q=Z;for(let W of X.split(/[./]/))Q=Q?.[W];return Q}var zQ,c5,p5,$Q,qQ,n5,$B;var o9=c(()=>{zQ=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),c5=new Set(["!","-"]),p5=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),$Q=new Set(["=","+=","-=","*=","/="]),qQ=new Set(["push","pop","shift","unshift","splice"]),n5=new Set(["reduce","map","filter"]),$B=new Set([...zQ,...c5,...p5,...n5])});function W4(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function J4(Z){return W4(Z)&&typeof Z.$ref==="string"}function a4(Z){return W4(Z)&&Z.$prototype==="Function"}function T4(Z){return W4(Z)&&W4(Z.$expression)}function v6(Z){return W4(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function i5(Z){return W4(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function UQ(Z){return W4(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function q6(Z){if(!W4(Z))return!1;for(let X of Object.keys(Z))if(!VQ.has(X))return!1;return!0}function x0(Z){return W4(Z)&&Z.$prototype==="Array"}function r5(Z){if(x0(Z))return!0;return Array.isArray(Z)&&Z.some((X)=>x0(X))}function BQ(Z){return W4(Z)&&Z.$prototype==="Class"}function e(Z){return typeof Z==="string"&&Z.includes("${")}function K6(Z){if(!Z)return[];return Z.map((X)=>typeof X==="string"?X:X.name)}var VQ;var k4=c(()=>{VQ=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function HB(Z){if(!UB||!Z.includes("v"))return Z;return Z.replace(VB,(X,Q,W)=>`${Q}${BB[W.toLowerCase()]??`cq${W}`}`)}function FB(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function r0(Z){return Z.replaceAll(/[A-Z]/g,(X)=>`-${X.toLowerCase()}`)}function m0(Z){return Object.entries(Z).filter(([X,Q])=>!FB(X)&&(Q===null||typeof Q!=="object")).map(([X,Q])=>`${r0(X)}: ${HB(String(Q))}`).join("; ")}var UB=!1,VB,BB,U6;var i1=c(()=>{o9();k4();VB=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,BB={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};U6=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 e9(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(q6(Q))continue;return!0}if(Z.$switch)return!0;if(x0(Z)||r5(Z.children))return!0;if(Array.isArray(Z.children)&&Z.children.some((X)=>e9(X)))return!0;for(let[X,Q]of Object.entries(Z)){if(U6.has(X))continue;if(Q!==null&&typeof Q==="object"&&typeof Q.$ref==="string")return!0;if(e(Q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(e(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(e(X))return!0}return!1}function FQ(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(x0(Z)||r5(Z.children))return!0;for(let[X,Q]of Object.entries(Z)){if(U6.has(X))continue;if(Q!==null&&typeof Q==="object"&&typeof Q.$ref==="string")return!0;if(e(Q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(e(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(e(X))return!0}return!1}function q1(Z,X=null,Q={},W={}){let J=Z?.state?K1(Z.state,X):X??Object.create(null);return{media:W,scope:J,scopeDefs:Q}}function K1(Z={},X=null){let Q=Object.create(X??null);for(let[W,J]of Object.entries(Z)){if(typeof J!=="object"||J===null||Array.isArray(J)){y6(Q,W,t9(J));continue}let G=J;if("default"in G){y6(Q,W,t9(G.default));continue}if(!G.$prototype&&!("$expression"in G)&&!q6(G))y6(Q,W,t9(G))}for(let[W,J]of Object.entries(Z)){if(typeof J==="string"&&e(J)){a5(Q,W,()=>l0(J,Q));continue}if(!J||typeof J!=="object")continue;if(T4(J)){let G=J.$expression;if($6(G.operator))y6(Q,W,(Y,z)=>r4(G,Y,z));else a5(Q,W,()=>r4(G,Q,null));continue}if(a4(J)){if(J.body){let G=J.parameters?K6(J.parameters):J.arguments??[],Y=Function("state",...G,J.body);if(J.body.includes("return"))a5(Q,W,()=>Y(Q));else y6(Q,W,Y)}else y6(Q,W,()=>{});continue}if(v6(J)&&(J.$prototype==="LocalStorage"||J.$prototype==="SessionStorage"))y6(Q,W,t9(J.default??null))}return Q}function y6(Z,X,Q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,value:Q,writable:!0})}function a5(Z,X,Q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,get:Q})}function T0(Z,X){if(w4(Z))return o5(Z.$ref,X);if(e(Z))return l0(Z,X);return Z}function w4(Z){return J4(Z)}function o5(Z,X){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let Q=Z.split("/"),W=Q[1],J=X.$map?.[W]??X[`$map/${W}`];return Q.length>2?HQ(J,Q.slice(2).join("/")):J}if(Z.startsWith("#/state/")){let Q=Z.slice(8),W=Q.indexOf("/");if(W===-1)return X[Q];return HQ(X[Q.slice(0,W)],Q.slice(W+1))}return X[Z]??null}function l0(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 HQ(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 t9(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function Y1(Z,X){let Q="",W=T0(Z.id,X),J=T0(Z.className,X),G=T0(Z.hidden,X),Y=T0(Z.tabIndex,X),z=T0(Z.title,X),q=T0(Z.lang,X),K=T0(Z.dir,X);if(W)Q+=` id="${$0(String(W))}"`;if(J)Q+=` class="${$0(String(J))}"`;if(G)Q+=" hidden";if(Y!==void 0&&Y!==null)Q+=` tabindex="${$0(String(Y))}"`;if(z)Q+=` title="${$0(String(z))}"`;if(q)Q+=` lang="${$0(String(q))}"`;if(K)Q+=` dir="${$0(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"&&e(H)).map(([B,H])=>{let F=T0(H,X);return F==null?null:`${r0(B)}: ${F}`}).filter(Boolean).join("; ");if(V)Q+=` style="${V}"`}if(Z.attributes)for(let[V,B]of Object.entries(Z.attributes)){let H=T0(B,X);if(H!==null&&H!==void 0&&(typeof H==="string"||typeof H==="number"||typeof H==="boolean"))Q+=` ${V}="${$0(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 U1(Z,X={},Q=null){let W=[];if(Q&&typeof Q==="object"){let G=(V,B)=>{let H=m0(B);if(H)W.push(`${V} { ${H} }`);for(let[F,A]of Object.entries(B)){if(A===null||typeof A!=="object"||Array.isArray(A))continue;if(F.startsWith("@")){let I=F.startsWith("@--")?`@media ${X[F.slice(1)]??F.slice(1)}`:F,N=m0(A);if(N)W.push(`${I} { ${V} { ${N} } }`);for(let[T,S]of Object.entries(A)){if(S===null||typeof S!=="object"||Array.isArray(S))continue;if(T.startsWith("@"))continue;let v=T.startsWith("&")?T.replace("&",V):T.startsWith(":")||T.startsWith(".")||T.startsWith("[")?`${V}${T}`:`${V} ${T}`,x=m0(S);if(x)W.push(`${I} { ${v} { ${x} } }`)}continue}let M=F.startsWith("&")?F.replace("&",V):F.startsWith(":")||F.startsWith(".")||F.startsWith("[")?`${V}${F}`:`${V} ${F}`;G(M,A)}};for(let[V,B]of Object.entries(Q))if(V.startsWith(":")||V.startsWith(".")||V.startsWith("["))G(V,B);else if(B!==null&&typeof B==="object"&&!Array.isArray(B)&&!V.startsWith("@")&&!V.startsWith("--"))G(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 { ${m0(B)} } }`)}let Y={},z={};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("--"))Y[V]=B;else z[V]=B}let q=m0(Y);if(q)W.push(`:root { ${q} }`);let K=m0(z);if(K)W.push(`body { ${K} }`)}if(V6(Z,W,X,"",{n:0}),W.length===0)return"";return`<style>
3
- ${W.join(`
2
+ import{createRequire as bH}from"node:module";var jH=Object.create;var{getPrototypeOf:EH,defineProperty:t5,getOwnPropertyNames:OH}=Object;var RH=Object.prototype.hasOwnProperty;function PH(Z){return this[Z]}var CH,SH,$1=(Z,Q,W)=>{var X=Z!=null&&typeof Z==="object";if(X){var J=Q?CH??=new WeakMap:SH??=new WeakMap,G=J.get(Z);if(G)return G}W=Z!=null?jH(EH(Z)):{};let Y=Q||!Z||!Z.__esModule?t5(W,"default",{value:Z,enumerable:!0}):W;for(let z of OH(Z))if(!RH.call(Y,z))t5(Y,z,{get:PH.bind(Z,z),enumerable:!0});if(X)J.set(Z,Y);return Y};var j=(Z,Q)=>()=>(Q||Z((Q={exports:{}}).exports,Q),Q.exports);var kH=(Z)=>Z;function _H(Z,Q){this[Z]=kH.bind(null,Q)}var e4=(Z,Q)=>{for(var W in Q)t5(Z,W,{get:Q[W],enumerable:!0,configurable:!0,set:_H.bind(Q,W)})};var u=(Z,Q)=>()=>(Z&&(Q=Z(Z=0)),Q);var v0=bH(import.meta.url);function e5(Z){let Q=Z.$map;return Q&&typeof Q==="object"?Q:void 0}function EW(Z){return Z.startsWith("window#/")&&vH.has(Z.slice(8))}function B6(Z){return wW.has(Z)}function I0(Z,Q){if(!Z)return;let W=(Z.depth??0)+1;if(W>gH)return;return{depth:W,path:[...Z.path??[],...Array.isArray(Q)?Q:[Q]],report:Z.report}}function B0(Z,Q,W,X,J){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return z4(Z,Q,W,X,J);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z){let G=OW(Z.$ref,Q,W,X);return J?.report(J.path??[],G),G}if(Array.isArray(Z))return Z.map((G,Y)=>B0(G,Q,W,X,I0(J,Y)));return J?.report(J.path??[],Z),Z}function OW(Z,Q,W,X){if(Z==="$reduce/acc")return X?.acc;if(Z.startsWith("$reduce/"))return X?.acc;if(Z.startsWith("$args/")){let J=Z.slice(6).split("/"),G=X?.args?.[J[0]];return J.length>1?Z6(G,J.slice(1).join("/")):G}if(Z.startsWith("event#/")){let J=Z.slice(7);return Z6(W,J)}if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,Y,z=e5(Q);if(G==="item")Y=X?.item??z?.item??Q["$map/item"];else if(G==="index")Y=X?.index??z?.index??Q["$map/index"];else Y=z?.[G]??Q[`$map/${G}`];return J.length>2?Z6(Y,J.slice(2).join("/")):Y}if(Z.startsWith("#/state/")){let J=Z.slice(8),G=J.indexOf("/");if(G===-1)return Q[J];return Z6(Q[J.slice(0,G)],J.slice(G+1))}if(Z.startsWith("parent#/"))return Q[Z.slice(8)];if(Z.startsWith("window#/"))return Z6(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return Z6(globalThis.document,Z.slice(10));return Q[Z]??null}function fH(Z,Q,W,X){if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,Y,z=e5(Q);if(G==="item")Y=X?.item??z?.item??Q["$map/item"];else if(G==="index")Y=X?.index??z?.index??Q["$map/index"];else Y=z?.[G]??Q[`$map/${G}`];if(J.length>2){let q=J.slice(2),K=q.pop(),V=q.length>0?Z6(Y,q.join("/")):Y;return{key:K,obj:V}}return{key:G==="item"?"$map/item":"$map/index",obj:e5(Q)??Q}}if(Z.startsWith("#/state/")){let J=Z.slice(8);if(J.indexOf("/")===-1)return{key:J,obj:Q};let Y=J.split("/"),z=Y.pop(),q=Q;for(let K of Y)q=q[K];return{key:z,obj:q}}return{key:Z,obj:Q}}function z4(Z,Q,W,X,J){let G=hH(Z,Q,W,X,J);return J?.report(J.path??[],G),G}function hH(Z,Q,W,X,J){let{operator:G,target:Y,value:z,initial:q}=Z;if(!xH.has(G))throw Error(`$expression: unknown operator "${G}"`);if(ZZ.has(G)&&!("value"in Z)){let K=B0(Y,Q,W,X,I0(J,"target"));if(G==="!")return!K;if(G==="-")return-K}if(G==="call"){let K=Y?.$ref;if(typeof K!=="string")throw TypeError("$expression: call target must be a $ref pointer");let V=(X?.callDepth??0)+1;if(V>NW)throw Error(`$expression: call depth exceeded (${NW})`);let H=Array.isArray(z)?z.map((F,A)=>B0(F,Q,W,X,I0(J,["value",A]))):[];if(K.startsWith("window#/")){if(!EW(K))throw Error(`$expression: "${K}" is not a blessed pure global`);let F=K.slice(8),A=yH[F];if(A)return A(...H);let M=Z6(globalThis.window,F),I=F.lastIndexOf("/"),N=I===-1?globalThis.window:Z6(globalThis.window,F.slice(0,I));return M.apply(N,H)}let B=OW(K,Q,W,X);if(typeof B==="function")return B(...H);if(B&&typeof B==="object"&&"$expression"in B){let F=B,A={};for(let[M,I]of(F.parameters??[]).entries()){let N=typeof I==="string"?I:I?.name??"";if(!N)continue;A[N]=H[M]===void 0&&typeof I==="object"&&I!==null&&"default"in I?I.default:H[M]}return z4(F.$expression,Q,W,{args:A,callDepth:V})}throw TypeError(`$expression: call target "${K}" is not callable`)}if(XZ.has(G)){if(G==="?:"){let F=B0(Y,Q,W,X,I0(J,"target"));if(J){let A=B0(z,Q,W,X,I0(J,"value")),M=B0(q,Q,W,X,I0(J,"initial"));return F?A:M}return F?B0(z,Q,W,X):B0(q,Q,W,X)}let K=B0(Y,Q,W,X,I0(J,"target")),V=String(K),H=Z.cases??{},B=Object.hasOwn(H,V);if(J){let F;for(let[M,I]of Object.entries(H)){let N=B0(I,Q,W,X,I0(J,["cases",M]));if(M===V)F=N}let A=B0(Z.default,Q,W,X,I0(J,"default"));return B?F:A}return B?B0(H[V],Q,W,X):B0(Z.default,Q,W,X)}if(QZ.has(G)){let K=B0(Y,Q,W,X,I0(J,"target")),V=B0(z,Q,W,X,I0(J,"value"));switch(G){case"+":return K+V;case"-":return K-V;case"*":return K*V;case"/":return K/V;case"%":return K%V;case"===":return K===V;case"!==":return K!==V;case"<":return K<V;case"<=":return K<=V;case">":return K>V;case">=":return K>=V;case"&&":return K&&V;case"||":return K||V;case"??":return K??V;default:break}}if(TW.has(G)){let K=B0(z,Q,W,X,I0(J,"value")),{obj:V,key:H}=fH(Y.$ref,Q,W,X);switch(G){case"=":{V[H]=K;break}case"+=":{let B=V[H];V[H]=B+K;break}case"-=":{let B=V[H];V[H]=B-K;break}case"*=":{let B=V[H];V[H]=B*K;break}case"/=":{let B=V[H];V[H]=B/K;break}default:break}return}if(jW.has(G)){let K=B0(Y,Q,W,X,I0(J,"target"));switch(G){case"push":return K.push(B0(z,Q,W,X,I0(J,"value")));case"unshift":return K.unshift(B0(z,Q,W,X,I0(J,"value")));case"pop":return K.pop();case"shift":return K.shift();case"splice":{let V=B0(z,Q,W,X,I0(J,"value"));return K.splice(...V)}default:break}}if(JZ.has(G)){let K=B0(Y,Q,W,X,I0(J,"target")),V=z===void 0?[]:Array.isArray(z)?B0(z,Q,W,X,I0(J,"value")):[B0(z,Q,W,X,I0(J,"value"))],H=K?.[G];if(typeof H!=="function")return;return H.apply(K,V)}if(WZ.has(G)){let K=B0(Y,Q,W,X,I0(J,"target"));if(G==="reduce"){let V=B0(q,Q,W,X,I0(J,"initial"));for(let[H,B]of K.entries())V=z4(z,Q,W,{acc:V,index:H,item:B},H===0?I0(J,"value"):void 0);return V}if(G==="map")return K.map((V,H)=>z4(z,Q,W,{...X,index:H,item:V},H===0?I0(J,"value"):void 0));if(G==="filter")return K.filter((V,H)=>z4(z,Q,W,{...X,index:H,item:V},H===0?I0(J,"value"):void 0))}return}function D0(Z,Q){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return c0(Z,Q);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return GZ(Z.$ref,Q);if(Array.isArray(Z))return Z.map((W)=>D0(W,Q)).join(", ");return JSON.stringify(Z)}function uH(Z){return`_fx_${Z.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function GZ(Z,Q){let W=Q.statePrefix??"state",X=Q.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("$args/"))return`_args${Z.slice(6).split("/").map((G)=>`[${JSON.stringify(G)}]`).join("")}`;if(Z.startsWith("event#/")){let J=Z.slice(7);return`${X}.${J.replaceAll("/",".")}`}if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J;if(G==="item")return J.length>2?`_item.${J.slice(2).join(".")}`:"_item";if(G==="index")return"_index";return`_${G}`}if(Z.startsWith("#/state/")){let J=Z.slice(8);return`${W}.${J.replaceAll("/",".")}`}if(Z.startsWith("parent#/"))return`${W}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replaceAll("/",".")}`;return`${W}.${Z}`}function DW(Z,Q){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return GZ(Z.$ref,Q);return D0(Z,Q)}function mH(Z,Q){let W=(X)=>Q[X]??"undefined";switch(Z){case"Intl/formatNumber":return`new Intl.NumberFormat(${W(1)}, ${W(2)}).format(${W(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${W(1)}, ${W(2)}).format(new Date(${W(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${W(2)}, ${W(3)}).format(${W(0)}, ${W(1)})`;default:return null}}function c0(Z,Q={}){let{operator:W,target:X,value:J,initial:G}=Z;if(ZZ.has(W)&&!("value"in Z)){let Y=D0(X,Q);if(W==="!")return`!(${Y})`;if(W==="-")return`-(${Y})`}if(W==="call"){let Y=X?.$ref??"",z=Array.isArray(J)?J.map((q)=>D0(q,Q)):[];if(Y.startsWith("window#/")){if(!EW(Y))throw Error(`$expression: "${Y}" is not a blessed pure global`);let q=mH(Y.slice(8),z);if(q)return q;return`window.${Y.slice(8).replaceAll("/",".")}(${z.join(", ")})`}if(Y.startsWith("#/state/")){let q=Y.slice(8),K=Q.formulaParams?.[q];if(K){let V=K.map((H,B)=>`${JSON.stringify(H)}: ${z[B]??"undefined"}`).join(", ");return`${uH(q)}(${Q.statePrefix??"state"}, { ${V} })`}}return`${GZ(Y,Q)}(${z.join(", ")})`}if(XZ.has(W)){if(W==="?:"){let K=D0(X,Q),V=D0(J,Q),H=D0(G,Q);return`(${K} ? ${V} : ${H})`}let Y=D0(X,Q),z=Object.entries(Z.cases??{}).map(([K,V])=>`_d === ${JSON.stringify(K)} ? ${D0(V,Q)} : `).join(""),q="default"in Z?D0(Z.default,Q):"undefined";return`((_d) => ${z}${q})(String(${Y}))`}if(QZ.has(W)){let Y=D0(X,Q),z=D0(J,Q);return`(${Y} ${W} ${z})`}if(TW.has(W)){let Y=DW(X,Q),z=D0(J,Q);return`${Y} ${W} ${z}`}if(jW.has(W)){let Y=DW(X,Q);switch(W){case"push":return`${Y}.push(${D0(J,Q)})`;case"unshift":return`${Y}.unshift(${D0(J,Q)})`;case"pop":return`${Y}.pop()`;case"shift":return`${Y}.shift()`;case"splice":{let z=Array.isArray(J)?J.map((q)=>D0(q,Q)).join(", "):D0(J,Q);return`${Y}.splice(${z})`}default:break}}if(JZ.has(W)){let Y=D0(X,Q),z=J===void 0?"":Array.isArray(J)?J.map((q)=>D0(q,Q)).join(", "):D0(J,Q);return`(${Y})?.${W}?.(${z})`}if(WZ.has(W)){let Y=D0(X,Q),z=c0(J,Q);if(W==="reduce"){let q=D0(G,Q);return`${Y}.reduce((_acc, _item, _index) => ${z}, ${q})`}if(W==="map")return`${Y}.map((_item, _index) => ${z})`;if(W==="filter")return`${Y}.filter((_item, _index) => ${z})`}return"undefined"}function Z6(Z,Q){let W=Z;for(let X of Q.split(/[./]/))W=W?.[X];return W}function J8(Z,Q,W,X){return B0(Z,Q,W,X)}function G8(Z,Q={}){return D0(Z,Q)}var wW,ZZ,QZ,TW,jW,WZ,XZ,JZ,xH,vH,yH,NW=64,gH=64;var t1=u(()=>{wW=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),ZZ=new Set(["!","-"]),QZ=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),TW=new Set(["=","+=","-=","*=","/="]),jW=new Set(["push","pop","shift","unshift","splice"]),WZ=new Set(["reduce","map","filter"]),XZ=new Set(["?:","switch"]),JZ=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),xH=new Set([...wW,...ZZ,...QZ,...WZ,...XZ,...JZ,"call"]),vH=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint","Intl/formatNumber","Intl/formatDate","Intl/formatRelativeTime"]),yH={"Intl/formatDate":(Z,Q,W)=>new Intl.DateTimeFormat(Q,W).format(new Date(Z)),"Intl/formatNumber":(Z,Q,W)=>new Intl.NumberFormat(Q,W).format(Z),"Intl/formatRelativeTime":(Z,Q,W,X)=>new Intl.RelativeTimeFormat(W,X).format(Z,Q)}});function $4(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function q4(Z){return $4(Z)&&typeof Z.$ref==="string"}function x4(Z){return $4(Z)&&Z.$prototype==="Function"}function F4(Z){return $4(Z)&&$4(Z.$expression)}function u6(Z){return F4(Z)&&Array.isArray(Z.parameters)&&Z.parameters.length>0}function v4(Z){return x4(Z)&&Array.isArray(Z.body)}function m6(Z){return $4(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function YZ(Z){return $4(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function RW(Z){return $4(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function F6(Z){if(!$4(Z))return!1;for(let Q of Object.keys(Z))if(!PW.has(Q))return!1;return!0}function g0(Z){return $4(Z)&&Z.$prototype==="Array"}function zZ(Z){if(g0(Z))return!0;return Array.isArray(Z)&&Z.some((Q)=>g0(Q))}function CW(Z){return $4(Z)&&Z.$prototype==="Class"}function e(Z){return typeof Z==="string"&&Z.includes("${")}function L6(Z){if(!Z)return[];return Z.map((Q)=>typeof Q==="string"?Q:Q.name)}var PW;var y4=u(()=>{PW=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function SW(Z){if("operator"in Z)return"expression";if("if"in Z)return"if";if("$switch"in Z)return"switch";return"dispatch"}async function q1(Z,Q,W,X={}){let J=X.args?{args:X.args}:void 0;for(let G of Z)switch(SW(G)){case"expression":{let Y=z4(G,Q,W,J);if(Y&&typeof Y.then==="function")await Y;break}case"if":{let Y=G,z=J8(Y.if,Q,W,J)?Y.then:Y.else;if(Array.isArray(z))await q1(z,Q,W,X);break}case"switch":{let Y=G,z=String(J8(Y.$switch,Q,W,J)),q=Y.cases??{},K=Object.hasOwn(q,z)?q[z]:Y.default;if(Array.isArray(K))await q1(K,Q,W,X);break}case"dispatch":{let Y=G,z=X.target??W?.currentTarget;if(!z)break;let q={};if("detail"in Y)q.detail=J8(Y.detail,Q,W,J);if(Y.bubbles!==void 0)q.bubbles=Y.bubbles;if(Y.composed!==void 0)q.composed=Y.composed;z.dispatchEvent(new CustomEvent(Y.dispatchEvent,q));break}default:break}}function L4(Z,Q={}){let W=Q.indent??"",X=[];for(let J of Z)switch(SW(J)){case"expression":{X.push(`${W}${c0(J,Q)};`);break}case"if":{let G=J,Y=G8(G.if,Q),z={...Q,indent:`${W} `};if(X.push(`${W}if (${Y}) {`,L4(G.then??[],z)),G.else)X.push(`${W}} else {`,L4(G.else,z));X.push(`${W}}`);break}case"switch":{let G=J,Y=G8(G.$switch,Q),z={...Q,indent:`${W} `};X.push(`${W}switch (String(${Y})) {`);for(let[q,K]of Object.entries(G.cases??{}))X.push(`${W} case ${JSON.stringify(q)}: {`,L4(K,z),`${W} break;`,`${W} }`);if(G.default)X.push(`${W} default: {`,L4(G.default,z),`${W} }`);X.push(`${W}}`);break}case"dispatch":{let G=J,Y=Q.eventParam??"event",z=Q.dispatchTarget??`(${Y} && ${Y}.currentTarget)`,q=[];if("detail"in G)q.push(`detail: ${G8(G.detail,Q)}`);if(G.bubbles!==void 0)q.push(`bubbles: ${JSON.stringify(G.bubbles)}`);if(G.composed!==void 0)q.push(`composed: ${JSON.stringify(G.composed)}`);let K=q.length>0?`, { ${q.join(", ")} }`:"";X.push(`${W}${z}?.dispatchEvent(new CustomEvent(${JSON.stringify(G.dispatchEvent)}${K}));`);break}default:break}return X.join(`
3
+ `)}var Y8=u(()=>{t1()});function pH(Z){if(!lH||!Z.includes("v"))return Z;return Z.replace(dH,(Q,W,X)=>`${W}${cH[X.toLowerCase()]??`cq${X}`}`)}function iH(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function t0(Z){return Z.replaceAll(/[A-Z]/g,(Q)=>`-${Q.toLowerCase()}`)}function p0(Z){return Object.entries(Z).filter(([Q,W])=>!iH(Q)&&(W===null||typeof W!=="object")).map(([Q,W])=>`${t0(Q)}: ${pH(String(W))}`).join("; ")}var lH=!1,dH,cH,A6;var e1=u(()=>{t1();y4();Y8();dH=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,cH={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};A6=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 Z9(Z,Q){let W=[];for(let[X,J]of(Z.parameters??[]).entries()){let G=typeof J==="string"?J:J?.name??"";if(!G)continue;let z=typeof J==="object"&&J!==null&&"default"in J?`_a[${X}] === undefined ? ${JSON.stringify(J.default)} : _a[${X}]`:`_a[${X}]`;W.push(`${JSON.stringify(G)}: ${z}`)}return`(..._a) => { const _args = { ${W.join(", ")} }; return ${Q}; }`}function $8(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[Q,W]of Object.entries(Z.state)){if(Q==="$site"||Q==="$page")continue;if(W&&typeof W==="object"&&!Array.isArray(W)&&W.timing==="compiler")continue;if(typeof W!=="object"||W===null||Array.isArray(W))return!0;if(W.$prototype)return!0;if("default"in W)return!0;if(F6(W))continue;return!0}if(Z.$switch)return!0;if(g0(Z)||zZ(Z.children))return!0;if(Array.isArray(Z.children)&&Z.children.some((Q)=>$8(Q)))return!0;for(let[Q,W]of Object.entries(Z)){if(A6.has(Q))continue;if(W!==null&&typeof W==="object"&&typeof W.$ref==="string")return!0;if(e(W))return!0}if(Z.style&&typeof Z.style==="object"){for(let Q of Object.values(Z.style))if(e(Q))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let Q of Object.values(Z.attributes))if(e(Q))return!0}return!1}function _W(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(g0(Z)||zZ(Z.children))return!0;for(let[Q,W]of Object.entries(Z)){if(A6.has(Q))continue;if(W!==null&&typeof W==="object"&&typeof W.$ref==="string")return!0;if(e(W))return!0}if(Z.style&&typeof Z.style==="object"){for(let Q of Object.values(Z.style))if(e(Q))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let Q of Object.values(Z.attributes))if(e(Q))return!0}return!1}function B1(Z,Q=null,W={},X={}){let J=Z?.state?F1(Z.state,Q):Q??Object.create(null);return{media:X,scope:J,scopeDefs:W}}function F1(Z={},Q=null){let W=Object.create(Q??null);for(let[X,J]of Object.entries(Z)){if(typeof J!=="object"||J===null||Array.isArray(J)){Q6(W,X,z8(J));continue}let G=J;if("default"in G){Q6(W,X,z8(G.default));continue}if(!G.$prototype&&!("$expression"in G)&&!F6(G))Q6(W,X,z8(G))}for(let[X,J]of Object.entries(Z)){if(typeof J==="string"&&e(J)){$Z(W,X,()=>i0(J,W));continue}if(!J||typeof J!=="object")continue;if(F4(J)){let G=J.$expression;if(u6(J)){let Y=J.parameters;Q6(W,X,(...z)=>{let q={};for(let[K,V]of Y.entries()){let H=typeof V==="string"?V:V?.name??"";if(!H)continue;q[H]=z[K]===void 0&&typeof V==="object"&&V!==null&&"default"in V?V.default:z[K]}return z4(G,W,null,{args:q})})}else if(B6(G.operator))Q6(W,X,(Y,z)=>z4(G,Y,z));else $Z(W,X,()=>z4(G,W,null));continue}if(x4(J)){if(v4(J)){let{body:G}=J;Q6(W,X,(Y,z)=>{q1(G,Y??W,z??null)})}else if(typeof J.body==="string"){let G=J.parameters?L6(J.parameters):J.arguments??[],{body:Y}=J,z=Function("state",...G,Y);if(Y.includes("return"))$Z(W,X,()=>z(W));else Q6(W,X,z)}else Q6(W,X,()=>{});continue}if(m6(J)&&(J.$prototype==="LocalStorage"||J.$prototype==="SessionStorage"))Q6(W,X,z8(J.default??null))}return W}function Q6(Z,Q,W){Object.defineProperty(Z,Q,{configurable:!0,enumerable:!0,value:W,writable:!0})}function $Z(Z,Q,W){Object.defineProperty(Z,Q,{configurable:!0,enumerable:!0,get:W})}function E0(Z,Q){if(O4(Z))return KZ(Z.$ref,Q);if(e(Z))return i0(Z,Q);return Z}function O4(Z){return q4(Z)}function KZ(Z,Q){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let W=Z.split("/"),X=W[1],J=Q.$map?.[X]??Q[`$map/${X}`];return W.length>2?kW(J,W.slice(2).join("/")):J}if(Z.startsWith("#/state/")){let W=Z.slice(8),X=W.indexOf("/");if(X===-1)return Q[W];return kW(Q[W.slice(0,X)],W.slice(X+1))}return Q[Z]??null}function i0(Z,Q){try{let W=Z.match(/^\$\{(.+)\}$/s);if(W)return Function("state","$map",`return (${W[1]})`)(Q,Q?.$map);return Function("state","$map",`return \`${Z}\``)(Q,Q?.$map)}catch{return null}}function kW(Z,Q){if(!Q)return Z;let W=Z;for(let X of Q.split("/"))W=W==null?void 0:W[X];return W}function z8(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function U1(Z,Q){let W="",X=E0(Z.id,Q),J=E0(Z.className,Q),G=E0(Z.hidden,Q),Y=E0(Z.tabIndex,Q),z=E0(Z.title,Q),q=E0(Z.lang,Q),K=E0(Z.dir,Q);if(X)W+=` id="${q0(String(X))}"`;if(J)W+=` class="${q0(String(J))}"`;if(G)W+=" hidden";if(Y!==void 0&&Y!==null)W+=` tabindex="${q0(String(Y))}"`;if(z)W+=` title="${q0(String(z))}"`;if(q)W+=` lang="${q0(String(q))}"`;if(K)W+=` dir="${q0(String(K))}"`;if(Z.style&&Q){let V=Object.entries(Z.style).filter(([H,B])=>!H.startsWith(":")&&!H.startsWith(".")&&!H.startsWith("&")&&!H.startsWith("[")&&!H.startsWith("@")&&B!==null&&typeof B!=="object"&&typeof B==="string"&&e(B)).map(([H,B])=>{let F=E0(B,Q);return F==null?null:`${t0(H)}: ${F}`}).filter(Boolean).join("; ");if(V)W+=` style="${V}"`}if(Z.attributes)for(let[V,H]of Object.entries(Z.attributes)){let B=E0(H,Q);if(B!==null&&B!==void 0&&(typeof B==="string"||typeof B==="number"||typeof B==="boolean"))W+=` ${V}="${q0(String(B))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)W+=' loading="lazy"';if(!Z.attributes?.decoding)W+=' decoding="async"'}if(Z.$static)W+=" data-jx-static";else if(Z.$prerendered)W+=" data-jx-prerendered";return W}function L1(Z,Q={},W=null){let X=[];if(W&&typeof W==="object"){let G=(V,H)=>{let B=p0(H);if(B)X.push(`${V} { ${B} }`);for(let[F,A]of Object.entries(H)){if(A===null||typeof A!=="object"||Array.isArray(A))continue;if(F.startsWith("@")){let I=F.startsWith("@--")?`@media ${Q[F.slice(1)]??F.slice(1)}`:F,N=p0(A);if(N)X.push(`${I} { ${V} { ${N} } }`);for(let[D,P]of Object.entries(A)){if(P===null||typeof P!=="object"||Array.isArray(P))continue;if(D.startsWith("@"))continue;let v=D.startsWith("&")?D.replace("&",V):D.startsWith(":")||D.startsWith(".")||D.startsWith("[")?`${V}${D}`:`${V} ${D}`,x=p0(P);if(x)X.push(`${I} { ${v} { ${x} } }`)}continue}let M=F.startsWith("&")?F.replace("&",V):F.startsWith(":")||F.startsWith(".")||F.startsWith("[")?`${V}${F}`:`${V} ${F}`;G(M,A)}};for(let[V,H]of Object.entries(W))if(V.startsWith(":")||V.startsWith(".")||V.startsWith("["))G(V,H);else if(H!==null&&typeof H==="object"&&!Array.isArray(H)&&!V.startsWith("@")&&!V.startsWith("--"))G(V,H);else if(V.startsWith("@")){let B=V.startsWith("@--")?`@media ${Q[V.slice(1)]??V.slice(1)}`:V.startsWith("@(")?`@media ${V.slice(1)}`:V;X.push(`${B} { body { ${p0(H)} } }`)}let Y={},z={};for(let[V,H]of Object.entries(W)){if(V.startsWith(":")||V.startsWith(".")||V.startsWith("[")||V.startsWith("@"))continue;if(H!==null&&typeof H==="object"&&!Array.isArray(H))continue;if(V.startsWith("--"))Y[V]=H;else z[V]=H}let q=p0(Y);if(q)X.push(`:root { ${q} }`);let K=p0(z);if(K)X.push(`body { ${K} }`)}if(M6(Z,X,Q,"",{n:0}),X.length===0)return"";return`<style>
4
+ ${X.join(`
4
5
  `)}
5
- </style>`}function LQ(Z,X,Q,W){let J=m0(X);if(J)Q.push(`${Z} { ${J} }`);for(let[G,Y]of Object.entries(X)){if(Y===null||typeof Y!=="object"||Array.isArray(Y))continue;if(G.startsWith("@")){let q=G.startsWith("@--")?`@media ${W[G.slice(1)]??G.slice(1)}`:G.startsWith("@(")?`@media ${G.slice(1)}`:G,K=m0(Y);if(K)Q.push(`${q} { ${Z} { ${K} } }`);for(let[V,B]of Object.entries(Y)){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}`,F=m0(B);if(F)Q.push(`${q} { ${H} { ${F} } }`)}continue}let z=G.startsWith("&")?G.replace("&",Z):G.startsWith(":")||G.startsWith(".")||G.startsWith("[")?`${Z}${G}`:`${Z} ${G}`;LQ(z,Y,Q,W)}}function V6(Z,X,Q,W="",J,G="jx"){let Y=J??{n:0};if(!Z||typeof Z!=="object")return;if(Z.style&&!Z.id&&!Z.className)Z.className=`${G}-${Y.n}`,Y.n+=1;let z=Z.id?`#${Z.id}`:Z.className?`.${Z.className.split(" ")[0]}`:Z.tagName??"*";if(Z.style){let q=[];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"&&e(V))continue;q.push(` ${r0(K)}: ${V};`)}if(q.length>0)X.push(`${z} {
6
+ </style>`}function bW(Z,Q,W,X){let J=p0(Q);if(J)W.push(`${Z} { ${J} }`);for(let[G,Y]of Object.entries(Q)){if(Y===null||typeof Y!=="object"||Array.isArray(Y))continue;if(G.startsWith("@")){let q=G.startsWith("@--")?`@media ${X[G.slice(1)]??G.slice(1)}`:G.startsWith("@(")?`@media ${G.slice(1)}`:G,K=p0(Y);if(K)W.push(`${q} { ${Z} { ${K} } }`);for(let[V,H]of Object.entries(Y)){if(H===null||typeof H!=="object"||Array.isArray(H))continue;if(V.startsWith("@"))continue;let B=V.startsWith("&")?V.replace("&",Z):V.startsWith(":")||V.startsWith(".")||V.startsWith("[")?`${Z}${V}`:`${Z} ${V}`,F=p0(H);if(F)W.push(`${q} { ${B} { ${F} } }`)}continue}let z=G.startsWith("&")?G.replace("&",Z):G.startsWith(":")||G.startsWith(".")||G.startsWith("[")?`${Z}${G}`:`${Z} ${G}`;bW(z,Y,W,X)}}function M6(Z,Q,W,X="",J,G="jx"){let Y=J??{n:0};if(!Z||typeof Z!=="object")return;if(Z.style&&!Z.id&&!Z.className)Z.className=`${G}-${Y.n}`,Y.n+=1;let z=Z.id?`#${Z.id}`:Z.className?`.${Z.className.split(" ")[0]}`:Z.tagName??"*";if(Z.style){let q=[];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"&&e(V))continue;q.push(` ${t0(K)}: ${V};`)}if(q.length>0)Q.push(`${z} {
6
7
  ${q.join(`
7
8
  `)}
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=m0(V);if(H)X.push(`${B} { ${z} { ${H} } }`);for(let[F,A]of Object.entries(V)){if(A===null||typeof A!=="object"||Array.isArray(A))continue;if(F.startsWith("@"))continue;let M=F.startsWith("&")?F.replace("&",z):F.startsWith(":")||F.startsWith(".")||F.startsWith("[")?`${z}${F}`:`${z} ${F}`;X.push(`${B} { ${M} { ${m0(A)} } }`)}}else{let B=K.startsWith("&")?K.replace("&",z):K.startsWith(":")||K.startsWith(".")||K.startsWith("[")?`${z}${K}`:`${z} ${K}`;LQ(B,V,X,Q)}}}if(Array.isArray(Z.children))for(let q of Z.children)V6(q,X,Q,z,Y,G);if(Z.cases&&typeof Z.cases==="object")for(let q of Object.values(Z.cases))V6(q,X,Q,z,Y,G)}function $0(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Z8(Z){return Z.split("-").map((X)=>X.charAt(0).toUpperCase()+X.slice(1)).join("")}function X8(Z){let X=new Map;return AQ(Z,X),[...X.values()]}function AQ(Z,X){if(!Z||typeof Z!=="object")return;if(Z.state){for(let[Q,W]of Object.entries(Z.state))if(i5(W))X.set(W.$export,{exportName:W.$export,key:Q,src:W.$src})}if(Array.isArray(Z.children))for(let Q of Z.children)AQ(Q,X)}function G1(Z,X,Q=null){if(typeof Z==="string"){if(e(Z)&&X){let Y=l0(Z,X);return Y!=null?$0(String(Y)):$0(Z)}return $0(Z)}if(typeof Z==="number"||typeof Z==="boolean")return $0(String(Z));if(Array.isArray(Z))return Z.map((Y)=>G1(Y,X,Q)).join(`
9
- `);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";if(Z.$switch){let Y=Z.tagName??"div",z=Y1(Z,X),q=T0(Z.$switch,X),K=q==null?void 0:Z.cases?.[String(q)],V=K!==void 0&&!w4(K)?G1(K,X,Q):"";return`<${Y}${z}>${V}</${Y}>`}let W=Z.tagName??"div";if(W==="slot"&&Q!=null)return Q;let J=Y1(Z,X);if(t5.has(W))return`<${W}${J}>`;let G="";if(Z.textContent!==void 0){let Y=T0(Z.textContent,X);G=Y!=null?$0(String(Y)):""}else if(Z.innerHTML){let Y=T0(Z.innerHTML,X);G=Y!=null?String(Y):Z.innerHTML}else if(Array.isArray(Z.children))G=Z.children.map((Y)=>G1(Y,X,Q)).join(`
10
- `);return`<${W}${J}>${G}</${W}>`}function MQ(Z,X=null,Q=null){let W=Z.state??{};if(X){W={...W};for(let[G,Y]of Object.entries(X))if(G in W){let z=W[G];W[G]=z&&typeof z==="object"&&!Array.isArray(z)&&"default"in z?{...z,default:Y}:Y}else W[G]=Y}let J=K1(W,null);if(!Array.isArray(Z.children))return"";return Z.children.map((G)=>G1(G,J,Q)).join(`
11
- `)}function e5(Z){return s5(Z)}function s5(Z){if(!Z||typeof Z!=="object")return!0;if(Array.isArray(Z))return Z.every((X)=>s5(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)=>s5(X));if(Z.children&&typeof Z.children==="object"&&Z.children.$prototype)return!1;return!0}function IQ(Z,X,Q=null,W={}){let J=[];if(X&&typeof X==="object"){let G=[];for(let[Y,z]of Object.entries(X)){if(Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("&")||Y.startsWith("[")||Y.startsWith("@"))continue;if(z===null||typeof z==="object")continue;if(typeof z==="string"&&e(z))continue;G.push(` ${r0(Y)}: ${z};`)}if(G.length>0)J.push(`${Z} {
9
+ }`);for(let[K,V]of Object.entries(Z.style)){if(V===null||typeof V!=="object"||Array.isArray(V))continue;if(K.startsWith("@")){let H=K.startsWith("@--")?`@media ${W[K.slice(1)]??K.slice(1)}`:K.startsWith("@(")?`@media ${K.slice(1)}`:K,B=p0(V);if(B)Q.push(`${H} { ${z} { ${B} } }`);for(let[F,A]of Object.entries(V)){if(A===null||typeof A!=="object"||Array.isArray(A))continue;if(F.startsWith("@"))continue;let M=F.startsWith("&")?F.replace("&",z):F.startsWith(":")||F.startsWith(".")||F.startsWith("[")?`${z}${F}`:`${z} ${F}`;Q.push(`${H} { ${M} { ${p0(A)} } }`)}}else{let H=K.startsWith("&")?K.replace("&",z):K.startsWith(":")||K.startsWith(".")||K.startsWith("[")?`${z}${K}`:`${z} ${K}`;bW(H,V,Q,W)}}}if(Array.isArray(Z.children))for(let q of Z.children)M6(q,Q,W,z,Y,G);if(Z.cases&&typeof Z.cases==="object")for(let q of Object.values(Z.cases))M6(q,Q,W,z,Y,G)}function q0(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function q8(Z){return Z.split("-").map((Q)=>Q.charAt(0).toUpperCase()+Q.slice(1)).join("")}function K8(Z){let Q=new Map;return xW(Z,Q),[...Q.values()]}function xW(Z,Q){if(!Z||typeof Z!=="object")return;if(Z.state){for(let[W,X]of Object.entries(Z.state))if(YZ(X))Q.set(X.$export,{exportName:X.$export,key:W,src:X.$src})}if(Array.isArray(Z.children))for(let W of Z.children)xW(W,Q)}function K1(Z,Q,W=null){if(typeof Z==="string"){if(e(Z)&&Q){let Y=i0(Z,Q);return Y!=null?q0(String(Y)):q0(Z)}return q0(Z)}if(typeof Z==="number"||typeof Z==="boolean")return q0(String(Z));if(Array.isArray(Z))return Z.map((Y)=>K1(Y,Q,W)).join(`
10
+ `);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";if(Z.$switch){let Y=Z.tagName??"div",z=U1(Z,Q),q=E0(Z.$switch,Q),K=q==null?void 0:Z.cases?.[String(q)],V=K!==void 0&&!O4(K)?K1(K,Q,W):"";return`<${Y}${z}>${V}</${Y}>`}let X=Z.tagName??"div";if(X==="slot"&&W!=null)return W;let J=U1(Z,Q);if(UZ.has(X))return`<${X}${J}>`;let G="";if(Z.textContent!==void 0){let Y=E0(Z.textContent,Q);G=Y!=null?q0(String(Y)):""}else if(Z.innerHTML){let Y=E0(Z.innerHTML,Q);G=Y!=null?String(Y):Z.innerHTML}else if(Array.isArray(Z.children))G=Z.children.map((Y)=>K1(Y,Q,W)).join(`
11
+ `);return`<${X}${J}>${G}</${X}>`}function vW(Z,Q=null,W=null){let X=Z.state??{};if(Q){X={...X};for(let[G,Y]of Object.entries(Q))if(G in X){let z=X[G];X[G]=z&&typeof z==="object"&&!Array.isArray(z)&&"default"in z?{...z,default:Y}:Y}else X[G]=Y}let J=F1(X,null);if(!Array.isArray(Z.children))return"";return Z.children.map((G)=>K1(G,J,W)).join(`
12
+ `)}function VZ(Z){return qZ(Z)}function qZ(Z){if(!Z||typeof Z!=="object")return!0;if(Array.isArray(Z))return Z.every((Q)=>qZ(Q));if(Z.$prototype)return!1;if(Z.$ref)return!1;if(Z.state)for(let Q of Object.values(Z.state)){if(!Q||typeof Q!=="object")continue;let W=Q;if(W.$prototype)return!1;if(W.$ref)return!1}for(let Q of Object.keys(Z))if(Q.startsWith("on")&&Q!=="observedAttributes")return!1;if(Array.isArray(Z.children))return Z.children.every((Q)=>qZ(Q));if(Z.children&&typeof Z.children==="object"&&Z.children.$prototype)return!1;return!0}function yW(Z,Q,W=null,X={}){let J=[];if(Q&&typeof Q==="object"){let G=[];for(let[Y,z]of Object.entries(Q)){if(Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("&")||Y.startsWith("[")||Y.startsWith("@"))continue;if(z===null||typeof z==="object")continue;if(typeof z==="string"&&e(z))continue;G.push(` ${t0(Y)}: ${z};`)}if(G.length>0)J.push(`${Z} {
12
13
  ${G.join(`
13
14
  `)}
14
- }`);for(let[Y,z]of Object.entries(X))if(Y.startsWith("@")){let q=Y.startsWith("@--")?`@media ${W[Y.slice(1)]??Y.slice(1)}`:Y.startsWith("@(")?`@media ${Y.slice(1)}`:Y;J.push(`${q} { ${Z} { ${m0(z)} } }`)}else if(Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("&")||Y.startsWith("[")){let q=Y.startsWith("&")?Y.replace("&",Z):`${Z}${Y}`;J.push(`${q} { ${m0(z)} }`)}}if(Q&&Array.isArray(Q.children)){let G={n:0};for(let Y of Q.children)V6(Y,J,W,"",G,Z)}return J.length>0?`${J.join(`
15
+ }`);for(let[Y,z]of Object.entries(Q))if(Y.startsWith("@")){let q=Y.startsWith("@--")?`@media ${X[Y.slice(1)]??Y.slice(1)}`:Y.startsWith("@(")?`@media ${Y.slice(1)}`:Y;J.push(`${q} { ${Z} { ${p0(z)} } }`)}else if(Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("&")||Y.startsWith("[")){let q=Y.startsWith("&")?Y.replace("&",Z):`${Z}${Y}`;J.push(`${q} { ${p0(z)} }`)}}if(W&&Array.isArray(W.children)){let G={n:0};for(let Y of W.children)M6(Y,J,X,"",G,Z)}return J.length>0?`${J.join(`
15
16
  `)}
16
- `:""}var z1="https://esm.sh/@vue/reactivity@3.5.32",$1="https://esm.sh/lit-html@3.3.0",t5;var B6=c(()=>{i1();o9();k4();i1();o9();k4();t5=new Set(["input","br","hr","img","meta","link","area","col","source"])});function s4(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var LB,r1=()=>LB;var NQ=c(()=>{LB=/^win/.test(globalThis.process?globalThis.process.platform:"")});function w0(Z,X){let Q=new URL(s4(Z),"https://aaa.nonexistanturl.com"),W=new URL(s4(X),Q),J=X.match(/(\s*)$/)?.[1]||"";if(W.hostname==="aaa.nonexistanturl.com"){let{pathname:Y,search:z,hash:q}=W;return Y+z+decodeURIComponent(q)+J}let G=W.toString()+J;if(G.includes("#")){let[Y,z]=G.split("#",2);return Y+"#"+decodeURIComponent(z||"")}return G}function f6(){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 TQ(Z){let X=MB.exec(Z||"");if(X)return X[1].toLowerCase();return}function wQ(Z){let X=Z.lastIndexOf(".");if(X>=0)return jB(Z.substring(X).toLowerCase());return""}function jB(Z){let X=Z.indexOf("?");if(X>=0)Z=Z.substring(0,X);return Z}function b4(Z){if(!Z)return"#";let X=Z.indexOf("#");if(X>=0)return Z.substring(X);return"#"}function j0(Z){if(!Z)return"";let X=Z.indexOf("#");if(X>=0)Z=Z.substring(0,X);return Z}function jQ(Z){let X=TQ(Z);if(X==="http"||X==="https")return!0;else if(X===void 0)return typeof window<"u";else return!1}function Q8(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;try{let Q=new URL(X.startsWith("//")?"http:"+X:X);if(OQ(Q.hostname))return!0;let W=Q.port;if(W&&SB(parseInt(W)))return!0}catch{if(X.startsWith("/")&&!X.startsWith("//"))return!1;if(CB(X))return!0}return!1}function OQ(Z){let X=OB(Z);if(!X)return!0;if(X==="localhost"||wB.some((J)=>X.endsWith(J)))return!0;let Q=EQ(X);if(Q)return RQ(Q);let W=EB(X);if(W)return RB(W);return!1}function OB(Z){let X=Z.trim().toLowerCase();if(X.startsWith("[")&&X.endsWith("]"))X=X.slice(1,-1);while(X.endsWith("."))X=X.slice(0,-1);return X}function EQ(Z){let X=Z.split(".");if(X.length!==4)return;let Q=X.map((W)=>{if(!/^\d+$/.test(W))return Number.NaN;return Number(W)});if(Q.some((W)=>!Number.isInteger(W)||W<0||W>255))return;return Q}function RQ([Z,X,Q,W]){return Z===0||Z===10||Z===127||Z===100&&X>=64&&X<=127||Z===169&&X===254||Z===172&&X>=16&&X<=31||Z===192&&X===0&&Q===0||Z===192&&X===168||Z===198&&(X===18||X===19)||Z>=224||Z===255&&X===255&&Q===255&&W===255}function EB(Z){if(!Z.includes(":"))return;let X=Z,Q=X.lastIndexOf(":"),W=X.slice(Q+1);if(W.includes(".")){let q=EQ(W);if(!q)return;let K=q[0]*256+q[1],V=q[2]*256+q[3];X=`${X.slice(0,Q+1)}${K.toString(16)}:${V.toString(16)}`}let J=X.split("::");if(J.length>2)return;let G=DQ(J[0]),Y=J.length===2?DQ(J[1]):[];if(!G||!Y)return;if(J.length===1)return G.length===8?G:void 0;let z=8-G.length-Y.length;if(z<1)return;return[...G,...Array(z).fill(0),...Y]}function DQ(Z){if(!Z)return[];let X=Z.split(":").map((Q)=>{if(!/^[\da-f]{1,4}$/i.test(Q))return Number.NaN;return Number.parseInt(Q,16)});if(X.some((Q)=>!Number.isInteger(Q)||Q<0||Q>65535))return;return X}function RB(Z){if(Z.length!==8)return!1;let X=Z.every((z)=>z===0),Q=Z.slice(0,7).every((z)=>z===0)&&Z[7]===1,W=(Z[0]&65024)===64512,J=(Z[0]&65472)===65152,G=(Z[0]&65280)===65280;if(X||Q||W||J||G)return!0;let Y=PB(Z);return Y?RQ(Y):!1}function PB(Z){let X=Z.slice(0,5).every((J)=>J===0),Q=X&&Z[5]===0,W=X&&Z[5]===65535;if(!Q&&!W)return;return[Math.floor(Z[6]/256),Z[6]%256,Math.floor(Z[7]/256),Z[7]%256]}function CB(Z){return Z.split(/[\s/?#]+/).map((Q)=>Q.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((Q)=>OQ(Q))}function SB(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 W8(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let X=TQ(Z);return X===void 0||X==="file"}function PQ(Z){if(r1()){let X=f6(),Q=Z.toUpperCase(),J=s4(X).toUpperCase(),G=Q.includes(J),Y=Q.includes(J),z=DB.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(G||Y||z)&&!X.startsWith("http"))Z=((K,V)=>{if(K.endsWith("/")||K.endsWith("\\"))return K+V;else return K+"/"+V})(X,Z);Z=s4(Z)}Z=encodeURI(Z);for(let X of TB)Z=Z.replace(X[0],X[1]);return Z}function B1(Z,X){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let W=0;W<ZZ.length;W+=2)Z=Z.replace(ZZ[W],ZZ[W+1]);let Q=Z.toLowerCase().startsWith("file://");if(Q){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),r1()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(X)Z="file:///"+Z;else Q=!1,Z=r1()?Z:"/"+Z}if(r1()&&!Q){if(Z=Z.replace(AB,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function J8(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((X)=>{return X.replace(IB,"/").replace(NB,"~")})}var AB,MB,IB,NB,DB,TB,ZZ,wB,V1=(Z)=>new URL(Z);var a0=c(()=>{NQ();AB=/\//g,MB=/^(\w{2,}):\/\//i,IB=/~1/g,NB=/~0/g,DB=/^[a-zA-Z]:[\\/]/,TB=[[/\?/g,"%3F"],[/#/g,"%23"]],ZZ=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],wB=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function CQ(){let Z={},X=this;for(let Q of xB(X))if(typeof Q==="string"){let W=X[Q],J=typeof W;if(!kB.includes(J))Z[Q]=W}return Z}function xB(Z,X=[]){let Q=[];while(Z&&Z!==_B)Q=Q.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let W=new Set(Q);for(let J of X.concat(bB))W.delete(J);return W}function x4(Z){return Z instanceof G4||Z instanceof H1}function QZ(Z){if(Z.path===null)Z.path=[];return Z}var kB,bB,_B,G4,H1,V4,G8,j4,Y8,z8,XZ,F1;var B4=c(()=>{a0();kB=["function","symbol","undefined"],bB=["constructor","prototype","__proto__"],_B=Object.getPrototypeOf({});G4=class G4 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=CQ.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};H1=class H1 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 '${B1(Z.$refs._root$Ref.path)}'`}toJSON=CQ.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 H1.getParserErrors(this.files)}};V4=class V4 extends G4{code="EPARSER";name="ParserError";constructor(Z,X){super(`Error parsing ${X}: ${Z}`,X)}};G8=class G8 extends G4{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};j4=class j4 extends G4{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)}};Y8=class Y8 extends G4{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};z8=class z8 extends G4{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,X,Q,W,J){super(`Missing $ref pointer "${b4(X)}". Token "${Z}" does not exist.`,j0(X));this.targetToken=Z,this.targetRef=Q,this.targetFound=W,this.parentPath=J}};XZ=class XZ extends G4{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};F1=class F1 extends G4{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,X){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,j0(X))}}});function d0(Z,X){let Q=vB(X);return Q?w0(Z,Q):Z}function $8(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 q8(Z,X,Q,W,J=!1){if(!J)return;let G=new Set,Y=(z,q)=>{if(!z||typeof z!=="object"||ArrayBuffer.isView(z)||G.has(z))return;G.add(z);let K=d0(q,z);if(K!==q)Z._addAlias(K,z,W,J);for(let V of Object.keys(z))Y(z[V],K)};Y(Q,X)}function vB(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var h6=c(()=>{a0()});class u6{$ref;path;originalPath;scopeBase;value;circular;chainCircular;indirections;constructor(Z,X,Q){this.$ref=Z,this.path=X,this.originalPath=Q||X,this.scopeBase=Z.path||j0(X),this.value=void 0,this.circular=!1,this.chainCircular=!1,this.indirections=0}resolve(Z,X,Q,W=new Set,J=!0){let G=u6.parse(this.path,this.originalPath),Y=[];if(this.value=kQ(Z),this.$ref.dynamicIdScope&&!bQ(this.$ref))this.scopeBase=d0(this.scopeBase,this.value);for(let q=0;q<G.length;q++){let K=this.circular,V=this.chainCircular,B=I0.isExtended$Ref(this.value);if(K8(this,X,Q,W))this.path=u6.join(this.path,G.slice(q));else if(B)this.circular=K,this.chainCircular=V;let H=G[q];if(this.value[H]===void 0||this.value[H]===null&&q===G.length-1){let F=!1;for(let T=G.length-1;T>q;T--){let S=G.slice(q,T+1).join("/");if(this.value[S]!==void 0){this.value=this.value[S],q=T,F=!0;break}}if(F){this.chainCircular=V;continue}if(H in this.value&&this.value[H]===null){this.value=U8,this.chainCircular=V;continue}this.value=null;let A=this.$ref.path||"",M=this.path.replace(A,""),I=u6.join("",Y),N=Q?.replace(A,"");throw new z8(H,decodeURI(this.originalPath),M,I,N)}else this.value=this.value[H];if(this.chainCircular=V,Y.push(H),this.$ref.dynamicIdScope)this.scopeBase=d0(this.scopeBase,this.value)}let z=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(J){let q=this.value?.$ref?w0(z,this.value.$ref):void 0,K=typeof Q==="string"?w0(this.$ref.$refs._root$Ref.path,Q):Q;if(I0.isAllowed$Ref(this.value,X)&&q===K&&q!==this.path)this.chainCircular=!0;else if(!this.value||q)K8(this,X,Q,W)}return this}set(Z,X,Q){let W=u6.parse(this.path),J;if(W.length===0)return this.value=X,X;if(mB(this.path,W),this.value=kQ(Z),this.$ref.dynamicIdScope&&!bQ(this.$ref))this.scopeBase=d0(this.scopeBase,this.value);for(let G=0;G<W.length-1;G++){if(K8(this,Q),J=W[G],this.value&&this.value[J]!==void 0)this.value=this.value[J];else this.value=SQ(this,J,{});if(this.$ref.dynamicIdScope)this.scopeBase=d0(this.scopeBase,this.value)}return K8(this,Q),J=W[W.length-1],SQ(this,J,X),Z}static parse(Z,X){let Q=b4(Z).substring(1);if(!Q)return[];let W=Q.split("/");for(let J=0;J<W.length;J++)W[J]=W[J].replace(fB,"/").replace(hB,"~");if(W[0]!=="")throw new F1(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(gB,"~0").replace(yB,"~1")}return Z}}function K8(Z,X,Q,W=new Set){let J=!1,G=Q,Y=[];try{while(I0.isAllowed$Ref(Z.value,X)){let z=I0.isExtended$Ref(Z.value),q=Z.value,K=Z.path,V=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,B=w0(V,Z.value.$ref);if(B===Z.path&&!lB(G))return Z.circular=!0,Z.chainCircular=!0,J;let H=typeof G==="string"?w0(Z.$ref.$refs._root$Ref.path,G):G;if(B===H&&B!==Z.path)return Z.chainCircular=!0,J;if(W.has(B))return Z.chainCircular=!0,J;let F=X?.dereference?.maxDepth??500;if(W.size>=F)throw RangeError(`Maximum dereference depth (${F}) exceeded at ${Z.path}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);W.add(B),Y.push(B);let A=Z.$ref.$refs._resolve(B,K,X,W,z);if(A===null)return J;if(Z.indirections+=A.indirections+1,Z.chainCircular||=A.circular||A.chainCircular,z){if(Z.chainCircular)return J;return Z.value=I0.dereference(q,A.value,X),J}else Z.$ref=A.$ref,Z.path=A.path,Z.value=A.value,Z.scopeBase=A.scopeBase,G=K,J=!0}return J}finally{for(let z of Y)W.delete(z)}}function SQ(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 G4(`Error assigning $ref pointer "${Z.path}".
17
- Cannot set "${X}" of a non-object.`);return Q}function mB(Z,X){for(let Q of X)if(uB.has(Q))throw new G4(`Error assigning $ref pointer "${Z}".
18
- Unsafe JSON Pointer token "${Q}" cannot be used for assignment.`)}function kQ(Z){if(x4(Z))throw Z;return Z}function lB(Z){return typeof Z=="string"&&u6.parse(Z).length==0}function bQ(Z){return Boolean(Z.path&&Z.path in Z.$refs._aliases)}var U8,yB,gB,fB,hB,uB,s0;var a1=c(()=>{L1();a0();B4();h6();U8=Symbol("null"),yB=/\//g,gB=/~/g,fB=/~1/g,hB=/~0/g,uB=new Set(["__proto__","constructor","prototype"]);s0=u6});class s1{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(QZ).filter(({footprint:Q})=>!X.includes(Q)));else if(!("footprint"in Z)||!X.includes(Z.footprint))this.errors.push(QZ(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,J,G=!0){let Y=new s0(this,Z,Q);try{let z=Y.resolve(this.value,X,W,J,G);if(z.value===U8)z.value=null;return z}catch(z){if(!X||!X.continueOnError||!x4(z))throw z;if(z.path===null)z.path=J8(b4(W));if(z instanceof F1)z.source=decodeURI(j0(W));return this.addError(z),null}}set(Z,X){let Q=new s0(this,Z);if(this.value=Q.set(this.value,X),this.value===U8)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 s1.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 s1.is$Ref(Z)&&Object.keys(Z).length>1}static dereference(Z,X,Q){if(X&&typeof X==="object"&&s1.isExtended$Ref(Z)){let W={};for(let G of Object.keys(Z))if(G!=="$ref")W[G]=Z[G];let J=Q?.dereference?.mergeKeys??!0;for(let G of Object.keys(X)){let Y=G;if(!(Y in W))W[Y]=X[Y];else if(J&&typeof W[Y]==="object"&&W[Y]!==null&&typeof X[Y]==="object"&&X[Y]!==null)W[Y]=_Q(X[Y],W[Y])}return W}else return X}}function _Q(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]=_Q(Z[W],X[W]);else Q[W]=X[W];return Q}var I0;var L1=c(()=>{a1();B4();a0();I0=s1});class o1{circular;paths(...Z){return xQ(this._$refs,Z.flat()).map((Q)=>{return s4(Q.decoded)})}values(...Z){let X=this._$refs;return xQ(X,Z.flat()).reduce((W,J)=>{return W[s4(J.decoded)]=X[J.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=w0(this._root$Ref.path,Z),W=this._getRef(Q);if(!W)throw Error(`Error resolving $ref pointer "${Z}".
19
- "${j0(Q)}" not found.`);W.set(Q,X)}_get$Ref(Z){return Z=w0(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let X=j0(Z),Q=new I0(this);return Q.path=X,this._$refs[X]=Q,this._root$Ref=this._root$Ref||Q,Q}_addAlias(Z,X,Q,W=!1){let J=j0(Z);if(!J||this._$refs[J]||this._aliases[J])return this._$refs[J]||this._aliases[J];let G=new I0(this);return G.path=J,G.pathType=Q,G.value=X,G.dynamicIdScope=W,this._aliases[J]=G,G}_resolve(Z,X,Q,W,J=!0){let G=w0(this._root$Ref.path,Z),Y=this._getRef(G);if(!Y)throw Error(`Error resolving $ref pointer "${Z}".
20
- "${j0(G)}" not found.`);return Y.resolve(G,Q,Z,X,W,J)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef(Z){let X=j0(Z);return this._$refs[X]||this._aliases[X]}}function xQ(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"?B1(W,!0):W}})}var vQ=c(()=>{L1();a0()});function WZ(Z){return Object.keys(Z||{}).filter((X)=>{return typeof Z[X]==="object"}).map((X)=>{return Z[X].name=X,Z[X]})}function JZ(Z,X,Q,W,J){return Z.filter((G)=>{return!!yQ(G,X,Q,W,J)})}function GZ(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 YZ(Z,X,Q,W){let J,G,Y=0;return new Promise((z,q)=>{K();function K(){if(J=Z[Y++],!J)return q(G);try{let F=yQ(J,X,Q,V,W);if(F&&typeof F.then==="function")F.then(B,H);else if(F!==void 0)B(F);else if(Y===Z.length)throw Error("No promise has been returned or callback has been called.")}catch(F){H(F)}}function V(F,A){if(F)H(F);else B(A)}function B(F){z({plugin:J,result:F})}function H(F){G={plugin:J,error:F},K()}})}function yQ(Z,X,Q,W,J){let G=Z[X];if(typeof G==="function")return G.apply(Z,[Q,W,J]);if(!W){if(G instanceof RegExp)return G.test(Q.url);else if(typeof G==="string")return G===Q.extension;else if(Array.isArray(G))return G.indexOf(Q.extension)!==-1}return G}async function dB(Z,X,Q){let W=typeof Z==="string"?Z:Z.url,J=typeof Z==="string"?void 0:Z.baseUrl,G=typeof Z==="string"?void 0:Z.reference,Y=W.indexOf("#"),z="";if(Y>=0)z=W.substring(Y),W=W.substring(0,Y);if(G){let V=G.indexOf("#");if(V>=0)G=G.substring(0,V)}let q=X._add(W),K={url:W,hash:z,extension:wQ(W),...G!==void 0?{reference:G}:{},...J!==void 0?{baseUrl:J}:{}};try{let V=await cB(K,Q,X);q.pathType=V.plugin.name,K.data=V.result;let B=await pB(K,Q,X);return q.value=B.result,q.dynamicIdScope=$8(q.value),q8(X,q.path,q.value,q.pathType,q.dynamicIdScope),B.result}catch(V){if(x4(V))q.value=V;throw V}}async function cB(Z,X,Q){let W=WZ(X.resolve);W=JZ(W,"canRead",Z,void 0,Q),GZ(W);try{return await YZ(W,"read",Z,Q)}catch(J){if(!J&&X.continueOnError)throw new Y8(Z.url);else if(!J||!("error"in J))throw SyntaxError(`Unable to resolve $ref pointer "${Z.url}"`,{cause:J});else if(J.error instanceof j4)throw J.error;else throw new j4(J,Z.url)}}async function pB(Z,X,Q){let W=WZ(X.parse),J=JZ(W,"canParse",Z),G=J.length>0?J:W;GZ(G);try{let Y=await YZ(G,"parse",Z,Q);if(!Y.plugin.allowEmpty&&nB(Y.result))throw SyntaxError(`Error parsing "${Z.url}" as ${Y.plugin.name}.
21
- Parsed value is empty`);else return Y}catch(Y){if(!Y&&X.continueOnError)throw new G8(Z.url);else if(Y&&Y.message&&Y.message.startsWith("Error parsing"))throw Y;else if(!Y||!("error"in Y))throw SyntaxError(`Unable to parse ${Z.url}`,{cause:Y});else if(Y.error instanceof V4)throw Y.error;else throw new V4(Y.error.message,Z.url)}}function nB(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 V8;var zZ=c(()=>{a0();h6();B4();V8=dB});var gQ;var fQ=c(()=>{B4();gQ={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 V4(W.message,Z.url)}throw new V4(Q.message,Z.url)}else return X}}});function iB(Z){return Z&&Z.__esModule&&Object.prototype.hasOwnProperty.call(Z,"default")?Z.default:Z}function t1(){if(hQ)return H6;hQ=1;function Z(Y){return typeof Y>"u"||Y===null}function X(Y){return typeof Y==="object"&&Y!==null}function Q(Y){if(Array.isArray(Y))return Y;else if(Z(Y))return[];return[Y]}function W(Y,z){if(z){let q=Object.keys(z);for(let K=0,V=q.length;K<V;K+=1){let B=q[K];Y[B]=z[B]}}return Y}function J(Y,z){let q="";for(let K=0;K<z;K+=1)q+=Y;return q}function G(Y){return Y===0&&Number.NEGATIVE_INFINITY===1/Y}return H6.isNothing=Z,H6.isObject=X,H6.toArray=Q,H6.repeat=J,H6.isNegativeZero=G,H6.extend=W,H6}function e1(){if(uQ)return $Z;uQ=1;function Z(Q,W){let J="",G=Q.reason||"(unknown reason)";if(!Q.mark)return G;if(Q.mark.name)J+='in "'+Q.mark.name+'" ';if(J+="("+(Q.mark.line+1)+":"+(Q.mark.column+1)+")",!W&&Q.mark.snippet)J+=`
17
+ `:""}var V1="https://esm.sh/@vue/reactivity@3.5.32",H1="https://esm.sh/lit-html@3.3.0",UZ;var I6=u(()=>{e1();t1();Y8();y4();e1();t1();Y8();y4();UZ=new Set(["input","br","hr","img","meta","link","area","col","source"])});function W6(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var nH,Q9=()=>nH;var gW=u(()=>{nH=/^win/.test(globalThis.process?globalThis.process.platform:"")});function O0(Z,Q){let W=new URL(W6(Z),"https://aaa.nonexistanturl.com"),X=new URL(W6(Q),W),J=Q.match(/(\s*)$/)?.[1]||"";if(X.hostname==="aaa.nonexistanturl.com"){let{pathname:Y,search:z,hash:q}=X;return Y+z+decodeURIComponent(q)+J}let G=X.toString()+J;if(G.includes("#")){let[Y,z]=G.split("#",2);return Y+"#"+decodeURIComponent(z||"")}return G}function d6(){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(),Q=Z.slice(-1);if(Q==="/"||Q==="\\")return Z;else return Z+"/"}return"/"}function hW(Z){let Q=aH.exec(Z||"");if(Q)return Q[1].toLowerCase();return}function uW(Z){let Q=Z.lastIndexOf(".");if(Q>=0)return QB(Z.substring(Q).toLowerCase());return""}function QB(Z){let Q=Z.indexOf("?");if(Q>=0)Z=Z.substring(0,Q);return Z}function g4(Z){if(!Z)return"#";let Q=Z.indexOf("#");if(Q>=0)return Z.substring(Q);return"#"}function R0(Z){if(!Z)return"";let Q=Z.indexOf("#");if(Q>=0)Z=Z.substring(0,Q);return Z}function mW(Z){let Q=hW(Z);if(Q==="http"||Q==="https")return!0;else if(Q===void 0)return typeof window<"u";else return!1}function U8(Z){if(!Z||typeof Z!=="string")return!0;let Q=Z.trim().toLowerCase();if(!Q)return!0;if(Q.startsWith("javascript:")||Q.startsWith("vbscript:")||Q.startsWith("data:"))return!0;if(Q.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let W=new URL(Q.startsWith("//")?"http:"+Q:Q);if(lW(W.hostname))return!0;let X=W.port;if(X&&zB(parseInt(X)))return!0}catch{if(Q.startsWith("/")&&!Q.startsWith("//"))return!1;if(YB(Q))return!0}return!1}function lW(Z){let Q=WB(Z);if(!Q)return!0;if(Q==="localhost"||ZB.some((J)=>Q.endsWith(J)))return!0;let W=dW(Q);if(W)return cW(W);let X=XB(Q);if(X)return JB(X);return!1}function WB(Z){let Q=Z.trim().toLowerCase();if(Q.startsWith("[")&&Q.endsWith("]"))Q=Q.slice(1,-1);while(Q.endsWith("."))Q=Q.slice(0,-1);return Q}function dW(Z){let Q=Z.split(".");if(Q.length!==4)return;let W=Q.map((X)=>{if(!/^\d+$/.test(X))return Number.NaN;return Number(X)});if(W.some((X)=>!Number.isInteger(X)||X<0||X>255))return;return W}function cW([Z,Q,W,X]){return Z===0||Z===10||Z===127||Z===100&&Q>=64&&Q<=127||Z===169&&Q===254||Z===172&&Q>=16&&Q<=31||Z===192&&Q===0&&W===0||Z===192&&Q===168||Z===198&&(Q===18||Q===19)||Z>=224||Z===255&&Q===255&&W===255&&X===255}function XB(Z){if(!Z.includes(":"))return;let Q=Z,W=Q.lastIndexOf(":"),X=Q.slice(W+1);if(X.includes(".")){let q=dW(X);if(!q)return;let K=q[0]*256+q[1],V=q[2]*256+q[3];Q=`${Q.slice(0,W+1)}${K.toString(16)}:${V.toString(16)}`}let J=Q.split("::");if(J.length>2)return;let G=fW(J[0]),Y=J.length===2?fW(J[1]):[];if(!G||!Y)return;if(J.length===1)return G.length===8?G:void 0;let z=8-G.length-Y.length;if(z<1)return;return[...G,...Array(z).fill(0),...Y]}function fW(Z){if(!Z)return[];let Q=Z.split(":").map((W)=>{if(!/^[\da-f]{1,4}$/i.test(W))return Number.NaN;return Number.parseInt(W,16)});if(Q.some((W)=>!Number.isInteger(W)||W<0||W>65535))return;return Q}function JB(Z){if(Z.length!==8)return!1;let Q=Z.every((z)=>z===0),W=Z.slice(0,7).every((z)=>z===0)&&Z[7]===1,X=(Z[0]&65024)===64512,J=(Z[0]&65472)===65152,G=(Z[0]&65280)===65280;if(Q||W||X||J||G)return!0;let Y=GB(Z);return Y?cW(Y):!1}function GB(Z){let Q=Z.slice(0,5).every((J)=>J===0),W=Q&&Z[5]===0,X=Q&&Z[5]===65535;if(!W&&!X)return;return[Math.floor(Z[6]/256),Z[6]%256,Math.floor(Z[7]/256),Z[7]%256]}function YB(Z){return Z.split(/[\s/?#]+/).map((W)=>W.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((W)=>lW(W))}function zB(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 V8(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let Q=hW(Z);return Q===void 0||Q==="file"}function pW(Z){if(Q9()){let Q=d6(),W=Z.toUpperCase(),J=W6(Q).toUpperCase(),G=W.includes(J),Y=W.includes(J),z=tH.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(G||Y||z)&&!Q.startsWith("http"))Z=((K,V)=>{if(K.endsWith("/")||K.endsWith("\\"))return K+V;else return K+"/"+V})(Q,Z);Z=W6(Z)}Z=encodeURI(Z);for(let Q of eH)Z=Z.replace(Q[0],Q[1]);return Z}function M1(Z,Q){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let X=0;X<HZ.length;X+=2)Z=Z.replace(HZ[X],HZ[X+1]);let W=Z.toLowerCase().startsWith("file://");if(W){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),Q9()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(Q)Z="file:///"+Z;else W=!1,Z=Q9()?Z:"/"+Z}if(Q9()&&!W){if(Z=Z.replace(rH,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function H8(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((Q)=>{return Q.replace(sH,"/").replace(oH,"~")})}var rH,aH,sH,oH,tH,eH,HZ,ZB,A1=(Z)=>new URL(Z);var e0=u(()=>{gW();rH=/\//g,aH=/^(\w{2,}):\/\//i,sH=/~1/g,oH=/~0/g,tH=/^[a-zA-Z]:[\\/]/,eH=[[/\?/g,"%3F"],[/#/g,"%23"]],HZ=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],ZB=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function iW(){let Z={},Q=this;for(let W of UB(Q))if(typeof W==="string"){let X=Q[W],J=typeof X;if(!$B.includes(J))Z[W]=X}return Z}function UB(Z,Q=[]){let W=[];while(Z&&Z!==KB)W=W.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let X=new Set(W);for(let J of Q.concat(qB))X.delete(J);return X}function h4(Z){return Z instanceof K4||Z instanceof I1}function FZ(Z){if(Z.path===null)Z.path=[];return Z}var $B,qB,KB,K4,I1,A4,B8,R4,F8,L8,BZ,N1;var M4=u(()=>{e0();$B=["function","symbol","undefined"],qB=["constructor","prototype","__proto__"],KB=Object.getPrototypeOf({});K4=class K4 extends Error{name;message;source;path;code;constructor(Z,Q){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=Z,this.source=Q,this.path=null}toJSON=iW.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};I1=class I1 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 '${M1(Z.$refs._root$Ref.path)}'`}toJSON=iW.bind(this);static getParserErrors(Z){let Q=[];for(let W of Object.values(Z.$refs._$refs))if(W.errors)Q.push(...W.errors);return Q}get errors(){return I1.getParserErrors(this.files)}};A4=class A4 extends K4{code="EPARSER";name="ParserError";constructor(Z,Q){super(`Error parsing ${Q}: ${Z}`,Q)}};B8=class B8 extends K4{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};R4=class R4 extends K4{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(Z,Q){super(Z.message||`Error reading file "${Q}"`,Q);if("code"in Z)this.ioErrorCode=String(Z.code)}};F8=class F8 extends K4{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};L8=class L8 extends K4{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,Q,W,X,J){super(`Missing $ref pointer "${g4(Q)}". Token "${Z}" does not exist.`,R0(Q));this.targetToken=Z,this.targetRef=W,this.targetFound=X,this.parentPath=J}};BZ=class BZ extends K4{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};N1=class N1 extends K4{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,Q){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,R0(Q))}}});function n0(Z,Q){let W=VB(Q);return W?O0(Z,W):Z}function A8(Z){if(!Z||typeof Z!=="object"||ArrayBuffer.isView(Z))return!1;let Q=Z.$schema;if(typeof Q==="string"&&(Q.includes("draft/2019-09/")||Q.includes("draft/2020-12/")||Q.includes("oas/3.1/")))return!0;let W=Z.openapi;return typeof W==="string"&&/^3\.1(?:\.|$)/.test(W)}function M8(Z,Q,W,X,J=!1){if(!J)return;let G=new Set,Y=(z,q)=>{if(!z||typeof z!=="object"||ArrayBuffer.isView(z)||G.has(z))return;G.add(z);let K=n0(q,z);if(K!==q)Z._addAlias(K,z,X,J);for(let V of Object.keys(z))Y(z[V],K)};Y(W,Q)}function VB(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var c6=u(()=>{e0()});class p6{$ref;path;originalPath;scopeBase;value;circular;chainCircular;indirections;constructor(Z,Q,W){this.$ref=Z,this.path=Q,this.originalPath=W||Q,this.scopeBase=Z.path||R0(Q),this.value=void 0,this.circular=!1,this.chainCircular=!1,this.indirections=0}resolve(Z,Q,W,X=new Set,J=!0){let G=p6.parse(this.path,this.originalPath),Y=[];if(this.value=rW(Z),this.$ref.dynamicIdScope&&!aW(this.$ref))this.scopeBase=n0(this.scopeBase,this.value);for(let q=0;q<G.length;q++){let K=this.circular,V=this.chainCircular,H=w0.isExtended$Ref(this.value);if(I8(this,Q,W,X))this.path=p6.join(this.path,G.slice(q));else if(H)this.circular=K,this.chainCircular=V;let B=G[q];if(this.value[B]===void 0||this.value[B]===null&&q===G.length-1){let F=!1;for(let D=G.length-1;D>q;D--){let P=G.slice(q,D+1).join("/");if(this.value[P]!==void 0){this.value=this.value[P],q=D,F=!0;break}}if(F){this.chainCircular=V;continue}if(B in this.value&&this.value[B]===null){this.value=N8,this.chainCircular=V;continue}this.value=null;let A=this.$ref.path||"",M=this.path.replace(A,""),I=p6.join("",Y),N=W?.replace(A,"");throw new L8(B,decodeURI(this.originalPath),M,I,N)}else this.value=this.value[B];if(this.chainCircular=V,Y.push(B),this.$ref.dynamicIdScope)this.scopeBase=n0(this.scopeBase,this.value)}let z=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(J){let q=this.value?.$ref?O0(z,this.value.$ref):void 0,K=typeof W==="string"?O0(this.$ref.$refs._root$Ref.path,W):W;if(w0.isAllowed$Ref(this.value,Q)&&q===K&&q!==this.path)this.chainCircular=!0;else if(!this.value||q)I8(this,Q,W,X)}return this}set(Z,Q,W){let X=p6.parse(this.path),J;if(X.length===0)return this.value=Q,Q;if(MB(this.path,X),this.value=rW(Z),this.$ref.dynamicIdScope&&!aW(this.$ref))this.scopeBase=n0(this.scopeBase,this.value);for(let G=0;G<X.length-1;G++){if(I8(this,W),J=X[G],this.value&&this.value[J]!==void 0)this.value=this.value[J];else this.value=nW(this,J,{});if(this.$ref.dynamicIdScope)this.scopeBase=n0(this.scopeBase,this.value)}return I8(this,W),J=X[X.length-1],nW(this,J,Q),Z}static parse(Z,Q){let W=g4(Z).substring(1);if(!W)return[];let X=W.split("/");for(let J=0;J<X.length;J++)X[J]=X[J].replace(FB,"/").replace(LB,"~");if(X[0]!=="")throw new N1(W,Q===void 0?Z:Q);return X.slice(1)}static join(Z,Q){if(Z.indexOf("#")===-1)Z+="#";Q=Array.isArray(Q)?Q:[Q];for(let W=0;W<Q.length;W++){let X=Q[W];Z+="/"+X.replace(BB,"~0").replace(HB,"~1")}return Z}}function I8(Z,Q,W,X=new Set){let J=!1,G=W,Y=[];try{while(w0.isAllowed$Ref(Z.value,Q)){let z=w0.isExtended$Ref(Z.value),q=Z.value,K=Z.path,V=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,H=O0(V,Z.value.$ref);if(H===Z.path&&!IB(G))return Z.circular=!0,Z.chainCircular=!0,J;let B=typeof G==="string"?O0(Z.$ref.$refs._root$Ref.path,G):G;if(H===B&&H!==Z.path)return Z.chainCircular=!0,J;if(X.has(H))return Z.chainCircular=!0,J;let F=Q?.dereference?.maxDepth??500;if(X.size>=F)throw RangeError(`Maximum dereference depth (${F}) exceeded at ${Z.path}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);X.add(H),Y.push(H);let A=Z.$ref.$refs._resolve(H,K,Q,X,z);if(A===null)return J;if(Z.indirections+=A.indirections+1,Z.chainCircular||=A.circular||A.chainCircular,z){if(Z.chainCircular)return J;return Z.value=w0.dereference(q,A.value,Q),J}else Z.$ref=A.$ref,Z.path=A.path,Z.value=A.value,Z.scopeBase=A.scopeBase,G=K,J=!0}return J}finally{for(let z of Y)X.delete(z)}}function nW(Z,Q,W){if(Z.value&&typeof Z.value==="object")if(Q==="-"&&Array.isArray(Z.value))Z.value.push(W);else Z.value[Q]=W;else throw new K4(`Error assigning $ref pointer "${Z.path}".
18
+ Cannot set "${Q}" of a non-object.`);return W}function MB(Z,Q){for(let W of Q)if(AB.has(W))throw new K4(`Error assigning $ref pointer "${Z}".
19
+ Unsafe JSON Pointer token "${W}" cannot be used for assignment.`)}function rW(Z){if(h4(Z))throw Z;return Z}function IB(Z){return typeof Z=="string"&&p6.parse(Z).length==0}function aW(Z){return Boolean(Z.path&&Z.path in Z.$refs._aliases)}var N8,HB,BB,FB,LB,AB,Z4;var W9=u(()=>{D1();e0();M4();c6();N8=Symbol("null"),HB=/\//g,BB=/~/g,FB=/~1/g,LB=/~0/g,AB=new Set(["__proto__","constructor","prototype"]);Z4=p6});class X9{path;value;$refs;pathType;dynamicIdScope=!1;errors=[];constructor(Z){this.$refs=Z}addError(Z){if(this.errors===void 0)this.errors=[];let Q=this.errors.map(({footprint:W})=>W);if("errors"in Z&&Array.isArray(Z.errors))this.errors.push(...Z.errors.map(FZ).filter(({footprint:W})=>!Q.includes(W)));else if(!("footprint"in Z)||!Q.includes(Z.footprint))this.errors.push(FZ(Z))}exists(Z,Q){try{return this.resolve(Z,Q),!0}catch{return!1}}get(Z,Q){return this.resolve(Z,Q)?.value}resolve(Z,Q,W,X,J,G=!0){let Y=new Z4(this,Z,W);try{let z=Y.resolve(this.value,Q,X,J,G);if(z.value===N8)z.value=null;return z}catch(z){if(!Q||!Q.continueOnError||!h4(z))throw z;if(z.path===null)z.path=H8(g4(X));if(z instanceof N1)z.source=decodeURI(R0(X));return this.addError(z),null}}set(Z,Q){let W=new Z4(this,Z);if(this.value=W.set(this.value,Q),this.value===N8)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 X9.is$Ref(Z)&&Z.$ref[0]!=="#"}static isAllowed$Ref(Z,Q){if(this.is$Ref(Z)){if(Z.$ref.substring(0,2)==="#/"||Z.$ref==="#")return!0;else if(Z.$ref[0]!=="#"&&(!Q||Q.resolve?.external))return!0}return}static isExtended$Ref(Z){return X9.is$Ref(Z)&&Object.keys(Z).length>1}static dereference(Z,Q,W){if(Q&&typeof Q==="object"&&X9.isExtended$Ref(Z)){let X={};for(let G of Object.keys(Z))if(G!=="$ref")X[G]=Z[G];let J=W?.dereference?.mergeKeys??!0;for(let G of Object.keys(Q)){let Y=G;if(!(Y in X))X[Y]=Q[Y];else if(J&&typeof X[Y]==="object"&&X[Y]!==null&&typeof Q[Y]==="object"&&Q[Y]!==null)X[Y]=sW(Q[Y],X[Y])}return X}else return Q}}function sW(Z,Q){if(typeof Z!=="object"||Z===null)return Q;if(typeof Q!=="object"||Q===null)return Q;let W=Array.isArray(Z)?[...Z]:{...Z};for(let X of Object.keys(Q))if(Array.isArray(Q[X]))W[X]=[...Q[X]];else if(typeof Q[X]==="object"&&Q[X]!==null)W[X]=sW(Z[X],Q[X]);else W[X]=Q[X];return W}var w0;var D1=u(()=>{W9();M4();e0();w0=X9});class J9{circular;paths(...Z){return oW(this._$refs,Z.flat()).map((W)=>{return W6(W.decoded)})}values(...Z){let Q=this._$refs;return oW(Q,Z.flat()).reduce((X,J)=>{return X[W6(J.decoded)]=Q[J.encoded].value,X},{})}exists(Z,Q){try{return this._resolve(Z,"",Q),!0}catch{return!1}}get(Z,Q){return this._resolve(Z,"",Q).value}set(Z,Q){let W=O0(this._root$Ref.path,Z),X=this._getRef(W);if(!X)throw Error(`Error resolving $ref pointer "${Z}".
20
+ "${R0(W)}" not found.`);X.set(W,Q)}_get$Ref(Z){return Z=O0(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let Q=R0(Z),W=new w0(this);return W.path=Q,this._$refs[Q]=W,this._root$Ref=this._root$Ref||W,W}_addAlias(Z,Q,W,X=!1){let J=R0(Z);if(!J||this._$refs[J]||this._aliases[J])return this._$refs[J]||this._aliases[J];let G=new w0(this);return G.path=J,G.pathType=W,G.value=Q,G.dynamicIdScope=X,this._aliases[J]=G,G}_resolve(Z,Q,W,X,J=!0){let G=O0(this._root$Ref.path,Z),Y=this._getRef(G);if(!Y)throw Error(`Error resolving $ref pointer "${Z}".
21
+ "${R0(G)}" not found.`);return Y.resolve(G,W,Z,Q,X,J)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef(Z){let Q=R0(Z);return this._$refs[Q]||this._aliases[Q]}}function oW(Z,Q){let W=Object.keys(Z);if(Q=Array.isArray(Q[0])?Q[0]:Array.prototype.slice.call(Q),Q.length>0&&Q[0])W=W.filter((X)=>{return Q.includes(Z[X].pathType)});return W.map((X)=>{return{encoded:X,decoded:Z[X].pathType==="file"?M1(X,!0):X}})}var tW=u(()=>{D1();e0()});function LZ(Z){return Object.keys(Z||{}).filter((Q)=>{return typeof Z[Q]==="object"}).map((Q)=>{return Z[Q].name=Q,Z[Q]})}function AZ(Z,Q,W,X,J){return Z.filter((G)=>{return!!eW(G,Q,W,X,J)})}function MZ(Z){for(let Q of Z)Q.order=Q.order||Number.MAX_SAFE_INTEGER;return Z.sort((Q,W)=>{return Q.order-W.order})}async function IZ(Z,Q,W,X){let J,G,Y=0;return new Promise((z,q)=>{K();function K(){if(J=Z[Y++],!J)return q(G);try{let F=eW(J,Q,W,V,X);if(F&&typeof F.then==="function")F.then(H,B);else if(F!==void 0)H(F);else if(Y===Z.length)throw Error("No promise has been returned or callback has been called.")}catch(F){B(F)}}function V(F,A){if(F)B(F);else H(A)}function H(F){z({plugin:J,result:F})}function B(F){G={plugin:J,error:F},K()}})}function eW(Z,Q,W,X,J){let G=Z[Q];if(typeof G==="function")return G.apply(Z,[W,X,J]);if(!X){if(G instanceof RegExp)return G.test(W.url);else if(typeof G==="string")return G===W.extension;else if(Array.isArray(G))return G.indexOf(W.extension)!==-1}return G}async function NB(Z,Q,W){let X=typeof Z==="string"?Z:Z.url,J=typeof Z==="string"?void 0:Z.baseUrl,G=typeof Z==="string"?void 0:Z.reference,Y=X.indexOf("#"),z="";if(Y>=0)z=X.substring(Y),X=X.substring(0,Y);if(G){let V=G.indexOf("#");if(V>=0)G=G.substring(0,V)}let q=Q._add(X),K={url:X,hash:z,extension:uW(X),...G!==void 0?{reference:G}:{},...J!==void 0?{baseUrl:J}:{}};try{let V=await DB(K,W,Q);q.pathType=V.plugin.name,K.data=V.result;let H=await wB(K,W,Q);return q.value=H.result,q.dynamicIdScope=A8(q.value),M8(Q,q.path,q.value,q.pathType,q.dynamicIdScope),H.result}catch(V){if(h4(V))q.value=V;throw V}}async function DB(Z,Q,W){let X=LZ(Q.resolve);X=AZ(X,"canRead",Z,void 0,W),MZ(X);try{return await IZ(X,"read",Z,W)}catch(J){if(!J&&Q.continueOnError)throw new F8(Z.url);else if(!J||!("error"in J))throw SyntaxError(`Unable to resolve $ref pointer "${Z.url}"`,{cause:J});else if(J.error instanceof R4)throw J.error;else throw new R4(J,Z.url)}}async function wB(Z,Q,W){let X=LZ(Q.parse),J=AZ(X,"canParse",Z),G=J.length>0?J:X;MZ(G);try{let Y=await IZ(G,"parse",Z,W);if(!Y.plugin.allowEmpty&&TB(Y.result))throw SyntaxError(`Error parsing "${Z.url}" as ${Y.plugin.name}.
22
+ Parsed value is empty`);else return Y}catch(Y){if(!Y&&Q.continueOnError)throw new B8(Z.url);else if(Y&&Y.message&&Y.message.startsWith("Error parsing"))throw Y;else if(!Y||!("error"in Y))throw SyntaxError(`Unable to parse ${Z.url}`,{cause:Y});else if(Y.error instanceof A4)throw Y.error;else throw new A4(Y.error.message,Z.url)}}function TB(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 D8;var NZ=u(()=>{e0();c6();M4();D8=NB});var ZX;var QX=u(()=>{M4();ZX={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(Z){let Q=Z.data;if(Buffer.isBuffer(Q))Q=Q.toString();if(typeof Q==="string")if(Q.trim().length===0)return;else try{return JSON.parse(Q)}catch(W){if(this.allowBOM)try{let X=Q.indexOf("{");return Q=Q.slice(X),JSON.parse(Q)}catch(X){throw new A4(X.message,Z.url)}throw new A4(W.message,Z.url)}else return Q}}});function jB(Z){return Z&&Z.__esModule&&Object.prototype.hasOwnProperty.call(Z,"default")?Z.default:Z}function G9(){if(WX)return N6;WX=1;function Z(Y){return typeof Y>"u"||Y===null}function Q(Y){return typeof Y==="object"&&Y!==null}function W(Y){if(Array.isArray(Y))return Y;else if(Z(Y))return[];return[Y]}function X(Y,z){if(z){let q=Object.keys(z);for(let K=0,V=q.length;K<V;K+=1){let H=q[K];Y[H]=z[H]}}return Y}function J(Y,z){let q="";for(let K=0;K<z;K+=1)q+=Y;return q}function G(Y){return Y===0&&Number.NEGATIVE_INFINITY===1/Y}return N6.isNothing=Z,N6.isObject=Q,N6.toArray=W,N6.repeat=J,N6.isNegativeZero=G,N6.extend=X,N6}function Y9(){if(XX)return DZ;XX=1;function Z(W,X){let J="",G=W.reason||"(unknown reason)";if(!W.mark)return G;if(W.mark.name)J+='in "'+W.mark.name+'" ';if(J+="("+(W.mark.line+1)+":"+(W.mark.column+1)+")",!X&&W.mark.snippet)J+=`
22
23
 
23
- `+Q.mark.snippet;return G+" "+J}function X(Q,W){if(Error.call(this),this.name="YAMLException",this.reason=Q,this.mark=W,this.message=Z(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}return X.prototype=Object.create(Error.prototype),X.prototype.constructor=X,X.prototype.toString=function(W){return this.name+": "+Z(this,W)},$Z=X,$Z}function rB(){if(mQ)return qZ;mQ=1;let Z=t1();function X(J,G,Y,z,q){let K="",V="",B=Math.floor(q/2)-1;if(z-G>B)K=" ... ",G=z-B+K.length;if(Y-z>B)V=" ...",Y=z+B-V.length;return{str:K+J.slice(G,Y).replace(/\t/g,"→")+V,pos:z-G+K.length}}function Q(J,G){return Z.repeat(" ",G-J.length)+J}function W(J,G){if(G=Object.create(G||null),!J.buffer)return null;if(!G.maxLength)G.maxLength=79;if(typeof G.indent!=="number")G.indent=1;if(typeof G.linesBefore!=="number")G.linesBefore=3;if(typeof G.linesAfter!=="number")G.linesAfter=2;let Y=/\r?\n|\r|\0/g,z=[0],q=[],K,V=-1;while(K=Y.exec(J.buffer))if(q.push(K.index),z.push(K.index+K[0].length),J.position<=K.index&&V<0)V=z.length-2;if(V<0)V=z.length-1;let B="",H=Math.min(J.line+G.linesAfter,q.length).toString().length,F=G.maxLength-(G.indent+H+3);for(let M=1;M<=G.linesBefore;M++){if(V-M<0)break;let I=X(J.buffer,z[V-M],q[V-M],J.position-(z[V]-z[V-M]),F);B=Z.repeat(" ",G.indent)+Q((J.line-M+1).toString(),H)+" | "+I.str+`
24
- `+B}let A=X(J.buffer,z[V],q[V],J.position,F);B+=Z.repeat(" ",G.indent)+Q((J.line+1).toString(),H)+" | "+A.str+`
25
- `,B+=Z.repeat("-",G.indent+H+3+A.pos)+`^
26
- `;for(let M=1;M<=G.linesAfter;M++){if(V+M>=q.length)break;let I=X(J.buffer,z[V+M],q[V+M],J.position-(z[V]-z[V+M]),F);B+=Z.repeat(" ",G.indent)+Q((J.line+M+1).toString(),H)+" | "+I.str+`
27
- `}return B.replace(/\n$/,"")}return qZ=W,qZ}function c0(){if(lQ)return KZ;lQ=1;let Z=e1(),X=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Q=["scalar","sequence","mapping"];function W(G){let Y={};if(G!==null)Object.keys(G).forEach(function(z){G[z].forEach(function(q){Y[String(q)]=z})});return Y}function J(G,Y){if(Y=Y||{},Object.keys(Y).forEach(function(z){if(X.indexOf(z)===-1)throw new Z('Unknown option "'+z+'" is met in definition of "'+G+'" YAML type.')}),this.options=Y,this.tag=G,this.kind=Y.kind||null,this.resolve=Y.resolve||function(){return!0},this.construct=Y.construct||function(z){return z},this.instanceOf=Y.instanceOf||null,this.predicate=Y.predicate||null,this.represent=Y.represent||null,this.representName=Y.representName||null,this.defaultStyle=Y.defaultStyle||null,this.multi=Y.multi||!1,this.styleAliases=W(Y.styleAliases||null),Q.indexOf(this.kind)===-1)throw new Z('Unknown kind "'+this.kind+'" is specified for "'+G+'" YAML type.')}return KZ=J,KZ}function KW(){if(dQ)return UZ;dQ=1;let Z=e1(),X=c0();function Q(G,Y){let z=[];return G[Y].forEach(function(q){let K=z.length;z.forEach(function(V,B){if(V.tag===q.tag&&V.kind===q.kind&&V.multi===q.multi)K=B}),z[K]=q}),z}function W(){let G={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function Y(z){if(z.multi)G.multi[z.kind].push(z),G.multi.fallback.push(z);else G[z.kind][z.tag]=G.fallback[z.tag]=z}for(let z=0,q=arguments.length;z<q;z+=1)arguments[z].forEach(Y);return G}function J(G){return this.extend(G)}return J.prototype.extend=function(Y){let z=[],q=[];if(Y instanceof X)q.push(Y);else if(Array.isArray(Y))q=q.concat(Y);else if(Y&&(Array.isArray(Y.implicit)||Array.isArray(Y.explicit))){if(Y.implicit)z=z.concat(Y.implicit);if(Y.explicit)q=q.concat(Y.explicit)}else throw new Z("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");z.forEach(function(V){if(!(V instanceof X))throw new Z("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(V.loadKind&&V.loadKind!=="scalar")throw new Z("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(V.multi)throw new Z("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),q.forEach(function(V){if(!(V instanceof X))throw new Z("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let K=Object.create(J.prototype);return K.implicit=(this.implicit||[]).concat(z),K.explicit=(this.explicit||[]).concat(q),K.compiledImplicit=Q(K,"implicit"),K.compiledExplicit=Q(K,"explicit"),K.compiledTypeMap=W(K.compiledImplicit,K.compiledExplicit),K},UZ=J,UZ}function UW(){if(cQ)return VZ;return cQ=1,VZ=new(c0())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(X){return X!==null?X:""}}),VZ}function VW(){if(pQ)return BZ;return pQ=1,BZ=new(c0())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(X){return X!==null?X:[]}}),BZ}function BW(){if(nQ)return HZ;return nQ=1,HZ=new(c0())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(X){return X!==null?X:{}}}),HZ}function HW(){if(iQ)return FZ;return iQ=1,FZ=new(KW())({explicit:[UW(),VW(),BW()]}),FZ}function FW(){if(rQ)return LZ;rQ=1;let Z=c0();function X(J){if(J===null)return!0;let G=J.length;return G===1&&J==="~"||G===4&&(J==="null"||J==="Null"||J==="NULL")}function Q(){return null}function W(J){return J===null}return LZ=new Z("tag:yaml.org,2002:null",{kind:"scalar",resolve:X,construct:Q,predicate:W,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),LZ}function LW(){if(aQ)return AZ;aQ=1;let Z=c0();function X(J){if(J===null)return!1;let G=J.length;return G===4&&(J==="true"||J==="True"||J==="TRUE")||G===5&&(J==="false"||J==="False"||J==="FALSE")}function Q(J){return J==="true"||J==="True"||J==="TRUE"}function W(J){return Object.prototype.toString.call(J)==="[object Boolean]"}return AZ=new Z("tag:yaml.org,2002:bool",{kind:"scalar",resolve:X,construct:Q,predicate:W,represent:{lowercase:function(J){return J?"true":"false"},uppercase:function(J){return J?"TRUE":"FALSE"},camelcase:function(J){return J?"True":"False"}},defaultStyle:"lowercase"}),AZ}function AW(){if(sQ)return MZ;sQ=1;let Z=t1(),X=c0();function Q(K){return K>=48&&K<=57||K>=65&&K<=70||K>=97&&K<=102}function W(K){return K>=48&&K<=55}function J(K){return K>=48&&K<=57}function G(K){if(K===null)return!1;let V=K.length,B=0,H=!1;if(!V)return!1;let F=K[B];if(F==="-"||F==="+")F=K[++B];if(F==="0"){if(B+1===V)return!0;if(F=K[++B],F==="b"){B++;for(;B<V;B++){if(F=K[B],F!=="0"&&F!=="1")return!1;H=!0}return H&&isFinite(Y(K))}if(F==="x"){B++;for(;B<V;B++){if(!Q(K.charCodeAt(B)))return!1;H=!0}return H&&isFinite(Y(K))}if(F==="o"){B++;for(;B<V;B++){if(!W(K.charCodeAt(B)))return!1;H=!0}return H&&isFinite(Y(K))}}for(;B<V;B++){if(!J(K.charCodeAt(B)))return!1;H=!0}if(!H)return!1;return isFinite(Y(K))}function Y(K){let V=K,B=1,H=V[0];if(H==="-"||H==="+"){if(H==="-")B=-1;V=V.slice(1),H=V[0]}if(V==="0")return 0;if(H==="0"){if(V[1]==="b")return B*parseInt(V.slice(2),2);if(V[1]==="x")return B*parseInt(V.slice(2),16);if(V[1]==="o")return B*parseInt(V.slice(2),8)}return B*parseInt(V,10)}function z(K){return Y(K)}function q(K){return Object.prototype.toString.call(K)==="[object Number]"&&(K%1===0&&!Z.isNegativeZero(K))}return MZ=new X("tag:yaml.org,2002:int",{kind:"scalar",resolve:G,construct:z,predicate:q,represent:{binary:function(K){return K>=0?"0b"+K.toString(2):"-0b"+K.toString(2).slice(1)},octal:function(K){return K>=0?"0o"+K.toString(8):"-0o"+K.toString(8).slice(1)},decimal:function(K){return K.toString(10)},hexadecimal:function(K){return K>=0?"0x"+K.toString(16).toUpperCase():"-0x"+K.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),MZ}function MW(){if(oQ)return IZ;oQ=1;let Z=t1(),X=c0(),Q=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),W=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function J(K){if(K===null)return!1;if(!Q.test(K))return!1;if(isFinite(parseFloat(K,10)))return!0;return W.test(K)}function G(K){let V=K.toLowerCase(),B=V[0]==="-"?-1:1;if("+-".indexOf(V[0])>=0)V=V.slice(1);if(V===".inf")return B===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(V===".nan")return NaN;return B*parseFloat(V,10)}let Y=/^[-+]?[0-9]+e/;function z(K,V){if(isNaN(K))switch(V){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===K)switch(V){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===K)switch(V){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Z.isNegativeZero(K))return"-0.0";let B=K.toString(10);return Y.test(B)?B.replace("e",".e"):B}function q(K){return Object.prototype.toString.call(K)==="[object Number]"&&(K%1!==0||Z.isNegativeZero(K))}return IZ=new X("tag:yaml.org,2002:float",{kind:"scalar",resolve:J,construct:G,predicate:q,represent:z,defaultStyle:"lowercase"}),IZ}function IW(){if(tQ)return NZ;return tQ=1,NZ=HW().extend({implicit:[FW(),LW(),AW(),MW()]}),NZ}function NW(){if(eQ)return DZ;return eQ=1,DZ=IW(),DZ}function DW(){if(ZW)return TZ;ZW=1;let Z=c0(),X=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Q=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]))?))?$");function W(Y){if(Y===null)return!1;if(X.exec(Y)!==null)return!0;if(Q.exec(Y)!==null)return!0;return!1}function J(Y){let z=0,q=null,K=X.exec(Y);if(K===null)K=Q.exec(Y);if(K===null)throw Error("Date resolve error");let V=+K[1],B=+K[2]-1,H=+K[3];if(!K[4])return new Date(Date.UTC(V,B,H));let F=+K[4],A=+K[5],M=+K[6];if(K[7]){z=K[7].slice(0,3);while(z.length<3)z+="0";z=+z}if(K[9]){let N=+K[10],T=+(K[11]||0);if(q=(N*60+T)*60000,K[9]==="-")q=-q}let I=new Date(Date.UTC(V,B,H,F,A,M,z));if(q)I.setTime(I.getTime()-q);return I}function G(Y){return Y.toISOString()}return TZ=new Z("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:W,construct:J,instanceOf:Date,represent:G}),TZ}function TW(){if(XW)return wZ;XW=1;let Z=c0();function X(Q){return Q==="<<"||Q===null}return wZ=new Z("tag:yaml.org,2002:merge",{kind:"scalar",resolve:X}),wZ}function wW(){if(QW)return jZ;QW=1;let Z=c0(),X=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
28
- \r`;function Q(Y){if(Y===null)return!1;let z=0,q=Y.length,K=X;for(let V=0;V<q;V++){let B=K.indexOf(Y.charAt(V));if(B>64)continue;if(B<0)return!1;z+=6}return z%8===0}function W(Y){let z=Y.replace(/[\r\n=]/g,""),q=z.length,K=X,V=0,B=[];for(let F=0;F<q;F++){if(F%4===0&&F)B.push(V>>16&255),B.push(V>>8&255),B.push(V&255);V=V<<6|K.indexOf(z.charAt(F))}let H=q%4*6;if(H===0)B.push(V>>16&255),B.push(V>>8&255),B.push(V&255);else if(H===18)B.push(V>>10&255),B.push(V>>2&255);else if(H===12)B.push(V>>4&255);return new Uint8Array(B)}function J(Y){let z="",q=0,K=Y.length,V=X;for(let H=0;H<K;H++){if(H%3===0&&H)z+=V[q>>18&63],z+=V[q>>12&63],z+=V[q>>6&63],z+=V[q&63];q=(q<<8)+Y[H]}let B=K%3;if(B===0)z+=V[q>>18&63],z+=V[q>>12&63],z+=V[q>>6&63],z+=V[q&63];else if(B===2)z+=V[q>>10&63],z+=V[q>>4&63],z+=V[q<<2&63],z+=V[64];else if(B===1)z+=V[q>>2&63],z+=V[q<<4&63],z+=V[64],z+=V[64];return z}function G(Y){return Object.prototype.toString.call(Y)==="[object Uint8Array]"}return jZ=new Z("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Q,construct:W,predicate:G,represent:J}),jZ}function jW(){if(WW)return OZ;WW=1;let Z=c0(),X=Object.prototype.hasOwnProperty,Q=Object.prototype.toString;function W(G){if(G===null)return!0;let Y=[],z=G;for(let q=0,K=z.length;q<K;q+=1){let V=z[q],B=!1;if(Q.call(V)!=="[object Object]")return!1;let H;for(H in V)if(X.call(V,H))if(!B)B=!0;else return!1;if(!B)return!1;if(Y.indexOf(H)===-1)Y.push(H);else return!1}return!0}function J(G){return G!==null?G:[]}return OZ=new Z("tag:yaml.org,2002:omap",{kind:"sequence",resolve:W,construct:J}),OZ}function OW(){if(JW)return EZ;JW=1;let Z=c0(),X=Object.prototype.toString;function Q(J){if(J===null)return!0;let G=J,Y=Array(G.length);for(let z=0,q=G.length;z<q;z+=1){let K=G[z];if(X.call(K)!=="[object Object]")return!1;let V=Object.keys(K);if(V.length!==1)return!1;Y[z]=[V[0],K[V[0]]]}return!0}function W(J){if(J===null)return[];let G=J,Y=Array(G.length);for(let z=0,q=G.length;z<q;z+=1){let K=G[z],V=Object.keys(K);Y[z]=[V[0],K[V[0]]]}return Y}return EZ=new Z("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Q,construct:W}),EZ}function EW(){if(GW)return RZ;GW=1;let Z=c0(),X=Object.prototype.hasOwnProperty;function Q(J){if(J===null)return!0;let G=J;for(let Y in G)if(X.call(G,Y)){if(G[Y]!==null)return!1}return!0}function W(J){return J!==null?J:{}}return RZ=new Z("tag:yaml.org,2002:set",{kind:"mapping",resolve:Q,construct:W}),RZ}function SZ(){if(YW)return PZ;return YW=1,PZ=NW().extend({implicit:[DW(),TW()],explicit:[wW(),jW(),OW(),EW()]}),PZ}function aB(){if(zW)return B8;zW=1;let Z=t1(),X=e1(),Q=rB(),W=SZ(),J=Object.prototype.hasOwnProperty,G=1,Y=2,z=3,q=4,K=1,V=2,B=3,H=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,F=/[\x85\u2028\u2029]/,A=/[,\[\]{}]/,M=/^(?:!|!!|![0-9A-Za-z-]+!)$/,I=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function N(U){return Object.prototype.toString.call(U)}function T(U){return U===10||U===13}function S(U){return U===9||U===32}function v(U){return U===9||U===32||U===10||U===13}function x(U){return U===44||U===91||U===93||U===123||U===125}function p(U){if(U>=48&&U<=57)return U-48;let D=U|32;if(D>=97&&D<=102)return D-97+10;return-1}function f(U){if(U===120)return 2;if(U===117)return 4;if(U===85)return 8;return 0}function s(U){if(U>=48&&U<=57)return U-48;return-1}function K0(U){switch(U){case 48:return"\x00";case 97:return"\x07";case 98:return"\b";case 116:return"\t";case 9:return"\t";case 110:return`
29
- `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function E0(U){if(U<=65535)return String.fromCharCode(U);return String.fromCharCode((U-65536>>10)+55296,(U-65536&1023)+56320)}function f0(U,D,E){if(D==="__proto__")Object.defineProperty(U,D,{configurable:!0,enumerable:!0,writable:!0,value:E});else U[D]=E}let N4=Array(256),$4=Array(256);for(let U=0;U<256;U++)N4[U]=K0(U)?1:0,$4[U]=K0(U);function r(U,D){this.input=U,this.filename=D.filename||null,this.schema=D.schema||W,this.onWarning=D.onWarning||null,this.legacy=D.legacy||!1,this.json=D.json||!1,this.listener=D.listener||null,this.maxDepth=typeof D.maxDepth==="number"?D.maxDepth:100,this.maxTotalMergeKeys=typeof D.maxTotalMergeKeys==="number"?D.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=U.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function Q0(U,D){let E={name:U.filename,buffer:U.input.slice(0,-1),position:U.position,line:U.line,column:U.position-U.lineStart};return E.snippet=Q(E),new X(D,E)}function g(U,D){throw Q0(U,D)}function U0(U,D){if(U.onWarning)U.onWarning.call(null,Q0(U,D))}function R0(U,D,E){let C=U.anchorMapTransactions;if(C.length!==0){let O=C[C.length-1];if(!J.call(O,D))O[D]={existed:J.call(U.anchorMap,D),value:U.anchorMap[D]}}U.anchorMap[D]=E}function M0(U){U.anchorMapTransactions.push(Object.create(null))}function J0(U){let D=U.anchorMapTransactions.pop(),E=U.anchorMapTransactions;if(E.length===0)return;let C=E[E.length-1],O=Object.keys(D);for(let y=0,L=O.length;y<L;y+=1){let w=O[y];if(!J.call(C,w))C[w]=D[w]}}function H0(U){let D=U.anchorMapTransactions.pop(),E=Object.keys(D);for(let C=E.length-1;C>=0;C-=1){let O=D[E[C]];if(O.existed)U.anchorMap[E[C]]=O.value;else delete U.anchorMap[E[C]]}}function q4(U){return{position:U.position,line:U.line,lineStart:U.lineStart,lineIndent:U.lineIndent,firstTabInLine:U.firstTabInLine,tag:U.tag,anchor:U.anchor,kind:U.kind,result:U.result}}function d4(U,D){U.position=D.position,U.line=D.line,U.lineStart=D.lineStart,U.lineIndent=D.lineIndent,U.firstTabInLine=D.firstTabInLine,U.tag=D.tag,U.anchor=D.anchor,U.kind=D.kind,U.result=D.result}let Z1={YAML:function(D,E,C){if(D.version!==null)g(D,"duplication of %YAML directive");if(C.length!==1)g(D,"YAML directive accepts exactly one argument");let O=/^([0-9]+)\.([0-9]+)$/.exec(C[0]);if(O===null)g(D,"ill-formed argument of the YAML directive");let y=parseInt(O[1],10),L=parseInt(O[2],10);if(y!==1)g(D,"unacceptable YAML version of the document");if(D.version=C[0],D.checkLineBreaks=L<2,L!==1&&L!==2)U0(D,"unsupported YAML version of the document")},TAG:function(D,E,C){let O;if(C.length!==2)g(D,"TAG directive accepts exactly two arguments");let y=C[0];if(O=C[1],!M.test(y))g(D,"ill-formed tag handle (first argument) of the TAG directive");if(J.call(D.tagMap,y))g(D,'there is a previously declared suffix for "'+y+'" tag handle');if(!I.test(O))g(D,"ill-formed tag prefix (second argument) of the TAG directive");try{O=decodeURIComponent(O)}catch(L){g(D,"tag prefix is malformed: "+O)}D.tagMap[y]=O}};function Q4(U,D,E,C){if(D<E){let O=U.input.slice(D,E);if(C)for(let y=0,L=O.length;y<L;y+=1){let w=O.charCodeAt(y);if(!(w===9||w>=32&&w<=1114111))g(U,"expected valid JSON character")}else if(H.test(O))g(U,"the stream contains non-printable characters");U.result+=O}}function z6(U,D,E,C){if(!Z.isObject(E))g(U,"cannot merge mappings; the provided source object is unacceptable");let O=Object.keys(E);for(let y=0,L=O.length;y<L;y+=1){let w=O[y];if(U.maxTotalMergeKeys!==-1&&++U.totalMergeKeys>U.maxTotalMergeKeys)g(U,"merge keys exceeded maxTotalMergeKeys ("+U.maxTotalMergeKeys+")");if(!J.call(D,w))f0(D,w,E[w]),C[w]=!0}}function c4(U,D,E,C,O,y,L,w,b){if(Array.isArray(O)){O=Array.prototype.slice.call(O);for(let R=0,P=O.length;R<P;R+=1){if(Array.isArray(O[R]))g(U,"nested arrays are not supported inside keys");if(typeof O==="object"&&N(O[R])==="[object Object]")O[R]="[object Object]"}}if(typeof O==="object"&&N(O)==="[object Object]")O="[object Object]";if(O=String(O),D===null)D={};if(C==="tag:yaml.org,2002:merge")if(Array.isArray(y))for(let R=0,P=y.length;R<P;R+=1)z6(U,D,y[R],E);else z6(U,D,y,E);else{if(!U.json&&!J.call(E,O)&&J.call(D,O))U.line=L||U.line,U.lineStart=w||U.lineStart,U.position=b||U.position,g(U,"duplicated mapping key");f0(D,O,y),delete E[O]}return D}function X1(U){let D=U.input.charCodeAt(U.position);if(D===10)U.position++;else if(D===13){if(U.position++,U.input.charCodeAt(U.position)===10)U.position++}else g(U,"a line break is expected");U.line+=1,U.lineStart=U.position,U.firstTabInLine=-1}function N0(U,D,E){let C=0,O=U.input.charCodeAt(U.position);while(O!==0){while(S(O)){if(O===9&&U.firstTabInLine===-1)U.firstTabInLine=U.position;O=U.input.charCodeAt(++U.position)}if(D&&O===35)do O=U.input.charCodeAt(++U.position);while(O!==10&&O!==13&&O!==0);if(T(O)){X1(U),O=U.input.charCodeAt(U.position),C++,U.lineIndent=0;while(O===32)U.lineIndent++,O=U.input.charCodeAt(++U.position)}else break}if(E!==-1&&C!==0&&U.lineIndent<E)U0(U,"deficient indentation");return C}function Q1(U){let D=U.position,E=U.input.charCodeAt(D);if((E===45||E===46)&&E===U.input.charCodeAt(D+1)&&E===U.input.charCodeAt(D+2)){if(D+=3,E=U.input.charCodeAt(D),E===0||v(E))return!0}return!1}function p4(U,D){if(D===1)U.result+=" ";else if(D>1)U.result+=Z.repeat(`
30
- `,D-1)}function l9(U,D,E){let C,O,y,L,w,b,R=U.kind,P=U.result,_=U.input.charCodeAt(U.position);if(v(_)||x(_)||_===35||_===38||_===42||_===33||_===124||_===62||_===39||_===34||_===37||_===64||_===96)return!1;if(_===63||_===45){let k=U.input.charCodeAt(U.position+1);if(v(k)||E&&x(k))return!1}U.kind="scalar",U.result="",C=O=U.position,y=!1;while(_!==0){if(_===58){let k=U.input.charCodeAt(U.position+1);if(v(k)||E&&x(k))break}else if(_===35){let k=U.input.charCodeAt(U.position-1);if(v(k))break}else if(U.position===U.lineStart&&Q1(U)||E&&x(_))break;else if(T(_))if(L=U.line,w=U.lineStart,b=U.lineIndent,N0(U,!1,-1),U.lineIndent>=D){y=!0,_=U.input.charCodeAt(U.position);continue}else{U.position=O,U.line=L,U.lineStart=w,U.lineIndent=b;break}if(y)Q4(U,C,O,!1),p4(U,U.line-L),C=O=U.position,y=!1;if(!S(_))O=U.position+1;_=U.input.charCodeAt(++U.position)}if(Q4(U,C,O,!1),U.result)return!0;return U.kind=R,U.result=P,!1}function d9(U,D){let E,C,O=U.input.charCodeAt(U.position);if(O!==39)return!1;U.kind="scalar",U.result="",U.position++,E=C=U.position;while((O=U.input.charCodeAt(U.position))!==0)if(O===39)if(Q4(U,E,U.position,!0),O=U.input.charCodeAt(++U.position),O===39)E=U.position,U.position++,C=U.position;else return!0;else if(T(O))Q4(U,E,C,!0),p4(U,N0(U,!1,D)),E=C=U.position;else if(U.position===U.lineStart&&Q1(U))g(U,"unexpected end of the document within a single quoted scalar");else if(U.position++,!S(O))C=U.position;g(U,"unexpected end of the stream within a single quoted scalar")}function c1(U,D){let E,C,O,y=U.input.charCodeAt(U.position);if(y!==34)return!1;U.kind="scalar",U.result="",U.position++,E=C=U.position;while((y=U.input.charCodeAt(U.position))!==0)if(y===34)return Q4(U,E,U.position,!0),U.position++,!0;else if(y===92){if(Q4(U,E,U.position,!0),y=U.input.charCodeAt(++U.position),T(y))N0(U,!1,D);else if(y<256&&N4[y])U.result+=$4[y],U.position++;else if((O=f(y))>0){let L=O,w=0;for(;L>0;L--)if(y=U.input.charCodeAt(++U.position),(O=p(y))>=0)w=(w<<4)+O;else g(U,"expected hexadecimal character");U.result+=E0(w),U.position++}else g(U,"unknown escape sequence");E=C=U.position}else if(T(y))Q4(U,E,C,!0),p4(U,N0(U,!1,D)),E=C=U.position;else if(U.position===U.lineStart&&Q1(U))g(U,"unexpected end of the document within a double quoted scalar");else if(U.position++,!S(y))C=U.position;g(U,"unexpected end of the stream within a double quoted scalar")}function c9(U,D){let E=!0,C,O,y,L=U.tag,w,b=U.anchor,R,P,_,k,d=Object.create(null),h,i,a,G0=U.input.charCodeAt(U.position);if(G0===91)R=93,k=!1,w=[];else if(G0===123)R=125,k=!0,w={};else return!1;if(U.anchor!==null)R0(U,U.anchor,w);G0=U.input.charCodeAt(++U.position);while(G0!==0){if(N0(U,!0,D),G0=U.input.charCodeAt(U.position),G0===R)return U.position++,U.tag=L,U.anchor=b,U.kind=k?"mapping":"sequence",U.result=w,!0;else if(!E)g(U,"missed comma between flow collection entries");else if(G0===44)g(U,"expected the node content, but found ','");if(i=h=a=null,P=_=!1,G0===63){let F0=U.input.charCodeAt(U.position+1);if(v(F0))P=_=!0,U.position++,N0(U,!0,D)}if(C=U.line,O=U.lineStart,y=U.position,i4(U,D,G,!1,!0),i=U.tag,h=U.result,N0(U,!0,D),G0=U.input.charCodeAt(U.position),(_||U.line===C)&&G0===58)P=!0,G0=U.input.charCodeAt(++U.position),N0(U,!0,D),i4(U,D,G,!1,!0),a=U.result;if(k)c4(U,w,d,i,h,a,C,O,y);else if(P)w.push(c4(U,null,d,i,h,a,C,O,y));else w.push(h);if(N0(U,!0,D),G0=U.input.charCodeAt(U.position),G0===44)E=!0,G0=U.input.charCodeAt(++U.position);else E=!1}g(U,"unexpected end of the stream within a flow collection")}function p9(U,D){let E,C=K,O=!1,y=!1,L=D,w=0,b=!1,R,P=U.input.charCodeAt(U.position);if(P===124)E=!1;else if(P===62)E=!0;else return!1;U.kind="scalar",U.result="";while(P!==0)if(P=U.input.charCodeAt(++U.position),P===43||P===45)if(K===C)C=P===43?B:V;else g(U,"repeat of a chomping mode identifier");else if((R=s(P))>=0)if(R===0)g(U,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!y)L=D+R-1,y=!0;else g(U,"repeat of an indentation width identifier");else break;if(S(P)){do P=U.input.charCodeAt(++U.position);while(S(P));if(P===35)do P=U.input.charCodeAt(++U.position);while(!T(P)&&P!==0)}while(P!==0){X1(U),U.lineIndent=0,P=U.input.charCodeAt(U.position);while((!y||U.lineIndent<L)&&P===32)U.lineIndent++,P=U.input.charCodeAt(++U.position);if(!y&&U.lineIndent>L)L=U.lineIndent;if(T(P)){w++;continue}if(!y&&L===0)g(U,"missing indentation for block scalar");if(U.lineIndent<L){if(C===B)U.result+=Z.repeat(`
31
- `,O?1+w:w);else if(C===K){if(O)U.result+=`
32
- `}break}if(E)if(S(P))b=!0,U.result+=Z.repeat(`
33
- `,O?1+w:w);else if(b)b=!1,U.result+=Z.repeat(`
34
- `,w+1);else if(w===0){if(O)U.result+=" "}else U.result+=Z.repeat(`
35
- `,w);else U.result+=Z.repeat(`
36
- `,O?1+w:w);O=!0,y=!0,w=0;let _=U.position;while(!T(P)&&P!==0)P=U.input.charCodeAt(++U.position);Q4(U,_,U.position,!1)}return!0}function n4(U,D){let{tag:E,anchor:C}=U,O=[],y=!1;if(U.firstTabInLine!==-1)return!1;if(U.anchor!==null)R0(U,U.anchor,O);let L=U.input.charCodeAt(U.position);while(L!==0){if(U.firstTabInLine!==-1)U.position=U.firstTabInLine,g(U,"tab characters must not be used in indentation");if(L!==45)break;let w=U.input.charCodeAt(U.position+1);if(!v(w))break;if(y=!0,U.position++,N0(U,!0,-1)){if(U.lineIndent<=D){O.push(null),L=U.input.charCodeAt(U.position);continue}}let b=U.line;if(i4(U,D,z,!1,!0),O.push(U.result),N0(U,!0,-1),L=U.input.charCodeAt(U.position),(U.line===b||U.lineIndent>D)&&L!==0)g(U,"bad indentation of a sequence entry");else if(U.lineIndent<D)break}if(y)return U.tag=E,U.anchor=C,U.kind="sequence",U.result=O,!0;return!1}function n9(U,D,E){let C,O,y,L,w=U.tag,b=U.anchor,R={},P=Object.create(null),_=null,k=null,d=null,h=!1,i=!1;if(U.firstTabInLine!==-1)return!1;if(U.anchor!==null)R0(U,U.anchor,R);let a=U.input.charCodeAt(U.position);while(a!==0){if(!h&&U.firstTabInLine!==-1)U.position=U.firstTabInLine,g(U,"tab characters must not be used in indentation");let G0=U.input.charCodeAt(U.position+1),F0=U.line;if((a===63||a===58)&&v(G0)){if(a===63){if(h)c4(U,R,P,_,k,null,O,y,L),_=k=d=null;i=!0,h=!0,C=!0}else if(h)h=!1,C=!0;else g(U,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");U.position+=1,a=G0}else{if(O=U.line,y=U.lineStart,L=U.position,!i4(U,E,Y,!1,!0))break;if(U.line===F0){a=U.input.charCodeAt(U.position);while(S(a))a=U.input.charCodeAt(++U.position);if(a===58){if(a=U.input.charCodeAt(++U.position),!v(a))g(U,"a whitespace character is expected after the key-value separator within a block mapping");if(h)c4(U,R,P,_,k,null,O,y,L),_=k=d=null;i=!0,h=!1,C=!1,_=U.tag,k=U.result}else if(i)g(U,"can not read an implicit mapping pair; a colon is missed");else return U.tag=w,U.anchor=b,!0}else if(i)g(U,"can not read a block mapping entry; a multiline key may not be an implicit key");else return U.tag=w,U.anchor=b,!0}if(U.line===F0||U.lineIndent>D){if(h)O=U.line,y=U.lineStart,L=U.position;if(i4(U,D,q,!0,C))if(h)k=U.result;else d=U.result;if(!h)c4(U,R,P,_,k,d,O,y,L),_=k=d=null;N0(U,!0,-1),a=U.input.charCodeAt(U.position)}if((U.line===F0||U.lineIndent>D)&&a!==0)g(U,"bad indentation of a mapping entry");else if(U.lineIndent<D)break}if(h)c4(U,R,P,_,k,null,O,y,L);if(i)U.tag=w,U.anchor=b,U.kind="mapping",U.result=R;return i}function f5(U){let D=!1,E=!1,C,O,y=U.input.charCodeAt(U.position);if(y!==33)return!1;if(U.tag!==null)g(U,"duplication of a tag property");if(y=U.input.charCodeAt(++U.position),y===60)D=!0,y=U.input.charCodeAt(++U.position);else if(y===33)E=!0,C="!!",y=U.input.charCodeAt(++U.position);else C="!";let L=U.position;if(D){do y=U.input.charCodeAt(++U.position);while(y!==0&&y!==62);if(U.position<U.length)O=U.input.slice(L,U.position),y=U.input.charCodeAt(++U.position);else g(U,"unexpected end of the stream within a verbatim tag")}else{while(y!==0&&!v(y)){if(y===33)if(!E){if(C=U.input.slice(L-1,U.position+1),!M.test(C))g(U,"named tag handle cannot contain such characters");E=!0,L=U.position+1}else g(U,"tag suffix cannot contain exclamation marks");y=U.input.charCodeAt(++U.position)}if(O=U.input.slice(L,U.position),A.test(O))g(U,"tag suffix cannot contain flow indicator characters")}if(O&&!I.test(O))g(U,"tag name cannot contain such characters: "+O);try{O=decodeURIComponent(O)}catch(w){g(U,"tag name is malformed: "+O)}if(D)U.tag=O;else if(J.call(U.tagMap,C))U.tag=U.tagMap[C]+O;else if(C==="!")U.tag="!"+O;else if(C==="!!")U.tag="tag:yaml.org,2002:"+O;else g(U,'undeclared tag handle "'+C+'"');return!0}function i9(U){let D=U.input.charCodeAt(U.position);if(D!==38)return!1;if(U.anchor!==null)g(U,"duplication of an anchor property");D=U.input.charCodeAt(++U.position);let E=U.position;while(D!==0&&!v(D)&&!x(D))D=U.input.charCodeAt(++U.position);if(U.position===E)g(U,"name of an anchor node must contain at least one character");return U.anchor=U.input.slice(E,U.position),!0}function r9(U){let D=U.input.charCodeAt(U.position);if(D!==42)return!1;D=U.input.charCodeAt(++U.position);let E=U.position;while(D!==0&&!v(D)&&!x(D))D=U.input.charCodeAt(++U.position);if(U.position===E)g(U,"name of an alias node must contain at least one character");let C=U.input.slice(E,U.position);if(!J.call(U.anchorMap,C))g(U,'unidentified alias "'+C+'"');return U.result=U.anchorMap[C],N0(U,!0,-1),!0}function h5(U,D,E,C){let O=q4(U);if(M0(U),d4(U,D),U.tag=null,U.anchor=null,U.kind=null,U.result=null,n9(U,E,C)&&U.kind==="mapping")return J0(U),!0;return H0(U),d4(U,O),!1}function i4(U,D,E,C,O){let y,L,w=1,b=!1,R=!1,P=null,_,k,d;if(U.depth>=U.maxDepth)g(U,"nesting exceeded maxDepth ("+U.maxDepth+")");if(U.depth+=1,U.listener!==null)U.listener("open",U);U.tag=null,U.anchor=null,U.kind=null,U.result=null;let h=y=L=q===E||z===E;if(C){if(N0(U,!0,-1)){if(b=!0,U.lineIndent>D)w=1;else if(U.lineIndent===D)w=0;else if(U.lineIndent<D)w=-1}}if(w===1)while(!0){let i=U.input.charCodeAt(U.position),a=q4(U);if(b&&(i===33&&U.tag!==null||i===38&&U.anchor!==null))break;if(!f5(U)&&!i9(U))break;if(P===null)P=a;if(N0(U,!0,-1)){if(b=!0,L=h,U.lineIndent>D)w=1;else if(U.lineIndent===D)w=0;else if(U.lineIndent<D)w=-1}else L=!1}if(L)L=b||O;if(w===1||q===E){if(G===E||Y===E)k=D;else k=D+1;if(d=U.position-U.lineStart,w===1)if(L&&(n4(U,d)||n9(U,d,k))||c9(U,k))R=!0;else{let i=U.input.charCodeAt(U.position);if(P!==null&&h&&!L&&i!==124&&i!==62&&h5(U,P,P.position-P.lineStart,k))R=!0;else if(y&&p9(U,k)||d9(U,k)||c1(U,k))R=!0;else if(r9(U)){if(R=!0,U.tag!==null||U.anchor!==null)g(U,"alias node should not have any properties")}else if(l9(U,k,G===E)){if(R=!0,U.tag===null)U.tag="?"}if(U.anchor!==null)R0(U,U.anchor,U.result)}else if(w===0)R=L&&n4(U,d)}if(U.tag===null){if(U.anchor!==null)R0(U,U.anchor,U.result)}else if(U.tag==="?"){if(U.result!==null&&U.kind!=="scalar")g(U,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+U.kind+'"');for(let i=0,a=U.implicitTypes.length;i<a;i+=1)if(_=U.implicitTypes[i],_.resolve(U.result)){if(U.result=_.construct(U.result),U.tag=_.tag,U.anchor!==null)R0(U,U.anchor,U.result);break}}else if(U.tag!=="!"){if(J.call(U.typeMap[U.kind||"fallback"],U.tag))_=U.typeMap[U.kind||"fallback"][U.tag];else{_=null;let i=U.typeMap.multi[U.kind||"fallback"];for(let a=0,G0=i.length;a<G0;a+=1)if(U.tag.slice(0,i[a].tag.length)===i[a].tag){_=i[a];break}}if(!_)g(U,"unknown tag !<"+U.tag+">");if(U.result!==null&&_.kind!==U.kind)g(U,"unacceptable node kind for !<"+U.tag+'> tag; it should be "'+_.kind+'", not "'+U.kind+'"');if(!_.resolve(U.result,U.tag))g(U,"cannot resolve a node with !<"+U.tag+"> explicit tag");else if(U.result=_.construct(U.result,U.tag),U.anchor!==null)R0(U,U.anchor,U.result)}if(U.listener!==null)U.listener("close",U);return U.depth-=1,U.tag!==null||U.anchor!==null||R}function u5(U){let D=U.position,E=!1,C;U.version=null,U.checkLineBreaks=U.legacy,U.tagMap=Object.create(null),U.anchorMap=Object.create(null);while((C=U.input.charCodeAt(U.position))!==0){if(N0(U,!0,-1),C=U.input.charCodeAt(U.position),U.lineIndent>0||C!==37)break;E=!0,C=U.input.charCodeAt(++U.position);let O=U.position;while(C!==0&&!v(C))C=U.input.charCodeAt(++U.position);let y=U.input.slice(O,U.position),L=[];if(y.length<1)g(U,"directive name must not be less than one character in length");while(C!==0){while(S(C))C=U.input.charCodeAt(++U.position);if(C===35){do C=U.input.charCodeAt(++U.position);while(C!==0&&!T(C));break}if(T(C))break;O=U.position;while(C!==0&&!v(C))C=U.input.charCodeAt(++U.position);L.push(U.input.slice(O,U.position))}if(C!==0)X1(U);if(J.call(Z1,y))Z1[y](U,y,L);else U0(U,'unknown document directive "'+y+'"')}if(N0(U,!0,-1),U.lineIndent===0&&U.input.charCodeAt(U.position)===45&&U.input.charCodeAt(U.position+1)===45&&U.input.charCodeAt(U.position+2)===45)U.position+=3,N0(U,!0,-1);else if(E)g(U,"directives end mark is expected");if(i4(U,U.lineIndent-1,q,!1,!0),N0(U,!0,-1),U.checkLineBreaks&&F.test(U.input.slice(D,U.position)))U0(U,"non-ASCII line breaks are interpreted as content");if(U.documents.push(U.result),U.position===U.lineStart&&Q1(U)){if(U.input.charCodeAt(U.position)===46)U.position+=3,N0(U,!0,-1);return}if(U.position<U.length-1)g(U,"end of the stream or a document separator is expected")}function a9(U,D){if(U=String(U),D=D||{},U.length!==0){if(U.charCodeAt(U.length-1)!==10&&U.charCodeAt(U.length-1)!==13)U+=`
37
- `;if(U.charCodeAt(0)===65279)U=U.slice(1)}let E=new r(U,D),C=U.indexOf("\x00");if(C!==-1)E.position=C,g(E,"null byte is not allowed in input");E.input+="\x00";while(E.input.charCodeAt(E.position)===32)E.lineIndent+=1,E.position+=1;while(E.position<E.length-1)u5(E);return E.documents}function s9(U,D,E){if(D!==null&&typeof D==="object"&&typeof E>"u")E=D,D=null;let C=a9(U,E);if(typeof D!=="function")return C;for(let O=0,y=C.length;O<y;O+=1)D(C[O])}function m5(U,D){let E=a9(U,D);if(E.length===0)return;else if(E.length===1)return E[0];throw new X("expected a single document in the stream, but found more")}return B8.loadAll=s9,B8.load=m5,B8}function sB(){if($W)return CZ;$W=1;let Z=t1(),X=e1(),Q=SZ(),W=Object.prototype.toString,J=Object.prototype.hasOwnProperty,G=65279,Y=9,z=10,q=13,K=32,V=33,B=34,H=35,F=37,A=38,M=39,I=42,N=44,T=45,S=58,v=61,x=62,p=63,f=64,s=91,K0=93,E0=96,f0=123,N4=124,$4=125,r={};r[0]="\\0",r[7]="\\a",r[8]="\\b",r[9]="\\t",r[10]="\\n",r[11]="\\v",r[12]="\\f",r[13]="\\r",r[27]="\\e",r[34]="\\\"",r[92]="\\\\",r[133]="\\N",r[160]="\\_",r[8232]="\\L",r[8233]="\\P";let Q0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],g=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function U0(L,w){if(w===null)return{};let b={},R=Object.keys(w);for(let P=0,_=R.length;P<_;P+=1){let k=R[P],d=String(w[k]);if(k.slice(0,2)==="!!")k="tag:yaml.org,2002:"+k.slice(2);let h=L.compiledTypeMap.fallback[k];if(h&&J.call(h.styleAliases,d))d=h.styleAliases[d];b[k]=d}return b}function R0(L){let w,b,R=L.toString(16).toUpperCase();if(L<=255)w="x",b=2;else if(L<=65535)w="u",b=4;else if(L<=4294967295)w="U",b=8;else throw new X("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+w+Z.repeat("0",b-R.length)+R}let M0=1,J0=2;function H0(L){this.schema=L.schema||Q,this.indent=Math.max(1,L.indent||2),this.noArrayIndent=L.noArrayIndent||!1,this.skipInvalid=L.skipInvalid||!1,this.flowLevel=Z.isNothing(L.flowLevel)?-1:L.flowLevel,this.styleMap=U0(this.schema,L.styles||null),this.sortKeys=L.sortKeys||!1,this.lineWidth=L.lineWidth||80,this.noRefs=L.noRefs||!1,this.noCompatMode=L.noCompatMode||!1,this.condenseFlow=L.condenseFlow||!1,this.quotingType=L.quotingType==='"'?J0:M0,this.forceQuotes=L.forceQuotes||!1,this.replacer=typeof L.replacer==="function"?L.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function q4(L,w){let b=Z.repeat(" ",w),R=0,P="",_=L.length;while(R<_){let k,d=L.indexOf(`
38
- `,R);if(d===-1)k=L.slice(R),R=_;else k=L.slice(R,d+1),R=d+1;if(k.length&&k!==`
39
- `)P+=b;P+=k}return P}function d4(L,w){return`
40
- `+Z.repeat(" ",L.indent*w)}function Z1(L,w){for(let b=0,R=L.implicitTypes.length;b<R;b+=1)if(L.implicitTypes[b].resolve(w))return!0;return!1}function Q4(L){return L===K||L===Y}function z6(L){return L>=32&&L<=126||L>=161&&L<=55295&&L!==8232&&L!==8233||L>=57344&&L<=65533&&L!==G||L>=65536&&L<=1114111}function c4(L){return z6(L)&&L!==G&&L!==q&&L!==z}function X1(L,w,b){let R=c4(L),P=R&&!Q4(L);return(b?R:R&&L!==N&&L!==s&&L!==K0&&L!==f0&&L!==$4)&&L!==H&&!(w===S&&!P)||c4(w)&&!Q4(w)&&L===H||w===S&&P}function N0(L){return z6(L)&&L!==G&&!Q4(L)&&L!==T&&L!==p&&L!==S&&L!==N&&L!==s&&L!==K0&&L!==f0&&L!==$4&&L!==H&&L!==A&&L!==I&&L!==V&&L!==N4&&L!==v&&L!==x&&L!==M&&L!==B&&L!==F&&L!==f&&L!==E0}function Q1(L){return!Q4(L)&&L!==S}function p4(L,w){let b=L.charCodeAt(w),R;if(b>=55296&&b<=56319&&w+1<L.length){if(R=L.charCodeAt(w+1),R>=56320&&R<=57343)return(b-55296)*1024+R-56320+65536}return b}function l9(L){return/^\n* /.test(L)}let d9=1,c1=2,c9=3,p9=4,n4=5;function n9(L,w,b,R,P,_,k,d){let h,i=0,a=null,G0=!1,F0=!1,GQ=R!==-1,p1=-1,n1=N0(p4(L,0))&&Q1(p4(L,L.length-1));if(w||k)for(h=0;h<L.length;i>=65536?h+=2:h++){if(i=p4(L,h),!z6(i))return n4;n1=n1&&X1(i,a,d),a=i}else{for(h=0;h<L.length;i>=65536?h+=2:h++){if(i=p4(L,h),i===z){if(G0=!0,GQ)F0=F0||h-p1-1>R&&L[p1+1]!==" ",p1=h}else if(!z6(i))return n4;n1=n1&&X1(i,a,d),a=i}F0=F0||GQ&&(h-p1-1>R&&L[p1+1]!==" ")}if(!G0&&!F0){if(n1&&!k&&!P(L))return d9;return _===J0?n4:c1}if(b>9&&l9(L))return n4;if(!k)return F0?p9:c9;return _===J0?n4:c1}function f5(L,w,b,R,P){L.dump=function(){if(w.length===0)return L.quotingType===J0?'""':"''";if(!L.noCompatMode){if(Q0.indexOf(w)!==-1||g.test(w))return L.quotingType===J0?'"'+w+'"':"'"+w+"'"}let _=L.indent*Math.max(1,b),k=L.lineWidth===-1?-1:Math.max(Math.min(L.lineWidth,40),L.lineWidth-_),d=R||L.flowLevel>-1&&b>=L.flowLevel;function h(i){return Z1(L,i)}switch(n9(w,d,L.indent,k,h,L.quotingType,L.forceQuotes&&!R,P)){case d9:return w;case c1:return"'"+w.replace(/'/g,"''")+"'";case c9:return"|"+i9(w,L.indent)+r9(q4(w,_));case p9:return">"+i9(w,L.indent)+r9(q4(h5(w,k),_));case n4:return'"'+u5(w)+'"';default:throw new X("impossible error: invalid scalar style")}}()}function i9(L,w){let b=l9(L)?String(w):"",R=L[L.length-1]===`
41
- `,_=R&&(L[L.length-2]===`
24
+ `+W.mark.snippet;return G+" "+J}function Q(W,X){if(Error.call(this),this.name="YAMLException",this.reason=W,this.mark=X,this.message=Z(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}return Q.prototype=Object.create(Error.prototype),Q.prototype.constructor=Q,Q.prototype.toString=function(X){return this.name+": "+Z(this,X)},DZ=Q,DZ}function EB(){if(JX)return wZ;JX=1;let Z=G9();function Q(J,G,Y,z,q){let K="",V="",H=Math.floor(q/2)-1;if(z-G>H)K=" ... ",G=z-H+K.length;if(Y-z>H)V=" ...",Y=z+H-V.length;return{str:K+J.slice(G,Y).replace(/\t/g,"→")+V,pos:z-G+K.length}}function W(J,G){return Z.repeat(" ",G-J.length)+J}function X(J,G){if(G=Object.create(G||null),!J.buffer)return null;if(!G.maxLength)G.maxLength=79;if(typeof G.indent!=="number")G.indent=1;if(typeof G.linesBefore!=="number")G.linesBefore=3;if(typeof G.linesAfter!=="number")G.linesAfter=2;let Y=/\r?\n|\r|\0/g,z=[0],q=[],K,V=-1;while(K=Y.exec(J.buffer))if(q.push(K.index),z.push(K.index+K[0].length),J.position<=K.index&&V<0)V=z.length-2;if(V<0)V=z.length-1;let H="",B=Math.min(J.line+G.linesAfter,q.length).toString().length,F=G.maxLength-(G.indent+B+3);for(let M=1;M<=G.linesBefore;M++){if(V-M<0)break;let I=Q(J.buffer,z[V-M],q[V-M],J.position-(z[V]-z[V-M]),F);H=Z.repeat(" ",G.indent)+W((J.line-M+1).toString(),B)+" | "+I.str+`
25
+ `+H}let A=Q(J.buffer,z[V],q[V],J.position,F);H+=Z.repeat(" ",G.indent)+W((J.line+1).toString(),B)+" | "+A.str+`
26
+ `,H+=Z.repeat("-",G.indent+B+3+A.pos)+`^
27
+ `;for(let M=1;M<=G.linesAfter;M++){if(V+M>=q.length)break;let I=Q(J.buffer,z[V+M],q[V+M],J.position-(z[V]-z[V+M]),F);H+=Z.repeat(" ",G.indent)+W((J.line+M+1).toString(),B)+" | "+I.str+`
28
+ `}return H.replace(/\n$/,"")}return wZ=X,wZ}function r0(){if(GX)return TZ;GX=1;let Z=Y9(),Q=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],W=["scalar","sequence","mapping"];function X(G){let Y={};if(G!==null)Object.keys(G).forEach(function(z){G[z].forEach(function(q){Y[String(q)]=z})});return Y}function J(G,Y){if(Y=Y||{},Object.keys(Y).forEach(function(z){if(Q.indexOf(z)===-1)throw new Z('Unknown option "'+z+'" is met in definition of "'+G+'" YAML type.')}),this.options=Y,this.tag=G,this.kind=Y.kind||null,this.resolve=Y.resolve||function(){return!0},this.construct=Y.construct||function(z){return z},this.instanceOf=Y.instanceOf||null,this.predicate=Y.predicate||null,this.represent=Y.represent||null,this.representName=Y.representName||null,this.defaultStyle=Y.defaultStyle||null,this.multi=Y.multi||!1,this.styleAliases=X(Y.styleAliases||null),W.indexOf(this.kind)===-1)throw new Z('Unknown kind "'+this.kind+'" is specified for "'+G+'" YAML type.')}return TZ=J,TZ}function RX(){if(YX)return jZ;YX=1;let Z=Y9(),Q=r0();function W(G,Y){let z=[];return G[Y].forEach(function(q){let K=z.length;z.forEach(function(V,H){if(V.tag===q.tag&&V.kind===q.kind&&V.multi===q.multi)K=H}),z[K]=q}),z}function X(){let G={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function Y(z){if(z.multi)G.multi[z.kind].push(z),G.multi.fallback.push(z);else G[z.kind][z.tag]=G.fallback[z.tag]=z}for(let z=0,q=arguments.length;z<q;z+=1)arguments[z].forEach(Y);return G}function J(G){return this.extend(G)}return J.prototype.extend=function(Y){let z=[],q=[];if(Y instanceof Q)q.push(Y);else if(Array.isArray(Y))q=q.concat(Y);else if(Y&&(Array.isArray(Y.implicit)||Array.isArray(Y.explicit))){if(Y.implicit)z=z.concat(Y.implicit);if(Y.explicit)q=q.concat(Y.explicit)}else throw new Z("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");z.forEach(function(V){if(!(V instanceof Q))throw new Z("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(V.loadKind&&V.loadKind!=="scalar")throw new Z("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(V.multi)throw new Z("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),q.forEach(function(V){if(!(V instanceof Q))throw new Z("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let K=Object.create(J.prototype);return K.implicit=(this.implicit||[]).concat(z),K.explicit=(this.explicit||[]).concat(q),K.compiledImplicit=W(K,"implicit"),K.compiledExplicit=W(K,"explicit"),K.compiledTypeMap=X(K.compiledImplicit,K.compiledExplicit),K},jZ=J,jZ}function PX(){if(zX)return EZ;return zX=1,EZ=new(r0())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(Q){return Q!==null?Q:""}}),EZ}function CX(){if($X)return OZ;return $X=1,OZ=new(r0())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(Q){return Q!==null?Q:[]}}),OZ}function SX(){if(qX)return RZ;return qX=1,RZ=new(r0())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(Q){return Q!==null?Q:{}}}),RZ}function kX(){if(KX)return PZ;return KX=1,PZ=new(RX())({explicit:[PX(),CX(),SX()]}),PZ}function _X(){if(UX)return CZ;UX=1;let Z=r0();function Q(J){if(J===null)return!0;let G=J.length;return G===1&&J==="~"||G===4&&(J==="null"||J==="Null"||J==="NULL")}function W(){return null}function X(J){return J===null}return CZ=new Z("tag:yaml.org,2002:null",{kind:"scalar",resolve:Q,construct:W,predicate:X,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),CZ}function bX(){if(VX)return SZ;VX=1;let Z=r0();function Q(J){if(J===null)return!1;let G=J.length;return G===4&&(J==="true"||J==="True"||J==="TRUE")||G===5&&(J==="false"||J==="False"||J==="FALSE")}function W(J){return J==="true"||J==="True"||J==="TRUE"}function X(J){return Object.prototype.toString.call(J)==="[object Boolean]"}return SZ=new Z("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Q,construct:W,predicate:X,represent:{lowercase:function(J){return J?"true":"false"},uppercase:function(J){return J?"TRUE":"FALSE"},camelcase:function(J){return J?"True":"False"}},defaultStyle:"lowercase"}),SZ}function xX(){if(HX)return kZ;HX=1;let Z=G9(),Q=r0();function W(K){return K>=48&&K<=57||K>=65&&K<=70||K>=97&&K<=102}function X(K){return K>=48&&K<=55}function J(K){return K>=48&&K<=57}function G(K){if(K===null)return!1;let V=K.length,H=0,B=!1;if(!V)return!1;let F=K[H];if(F==="-"||F==="+")F=K[++H];if(F==="0"){if(H+1===V)return!0;if(F=K[++H],F==="b"){H++;for(;H<V;H++){if(F=K[H],F!=="0"&&F!=="1")return!1;B=!0}return B&&isFinite(Y(K))}if(F==="x"){H++;for(;H<V;H++){if(!W(K.charCodeAt(H)))return!1;B=!0}return B&&isFinite(Y(K))}if(F==="o"){H++;for(;H<V;H++){if(!X(K.charCodeAt(H)))return!1;B=!0}return B&&isFinite(Y(K))}}for(;H<V;H++){if(!J(K.charCodeAt(H)))return!1;B=!0}if(!B)return!1;return isFinite(Y(K))}function Y(K){let V=K,H=1,B=V[0];if(B==="-"||B==="+"){if(B==="-")H=-1;V=V.slice(1),B=V[0]}if(V==="0")return 0;if(B==="0"){if(V[1]==="b")return H*parseInt(V.slice(2),2);if(V[1]==="x")return H*parseInt(V.slice(2),16);if(V[1]==="o")return H*parseInt(V.slice(2),8)}return H*parseInt(V,10)}function z(K){return Y(K)}function q(K){return Object.prototype.toString.call(K)==="[object Number]"&&(K%1===0&&!Z.isNegativeZero(K))}return kZ=new Q("tag:yaml.org,2002:int",{kind:"scalar",resolve:G,construct:z,predicate:q,represent:{binary:function(K){return K>=0?"0b"+K.toString(2):"-0b"+K.toString(2).slice(1)},octal:function(K){return K>=0?"0o"+K.toString(8):"-0o"+K.toString(8).slice(1)},decimal:function(K){return K.toString(10)},hexadecimal:function(K){return K>=0?"0x"+K.toString(16).toUpperCase():"-0x"+K.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),kZ}function vX(){if(BX)return _Z;BX=1;let Z=G9(),Q=r0(),W=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),X=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function J(K){if(K===null)return!1;if(!W.test(K))return!1;if(isFinite(parseFloat(K,10)))return!0;return X.test(K)}function G(K){let V=K.toLowerCase(),H=V[0]==="-"?-1:1;if("+-".indexOf(V[0])>=0)V=V.slice(1);if(V===".inf")return H===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(V===".nan")return NaN;return H*parseFloat(V,10)}let Y=/^[-+]?[0-9]+e/;function z(K,V){if(isNaN(K))switch(V){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===K)switch(V){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===K)switch(V){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Z.isNegativeZero(K))return"-0.0";let H=K.toString(10);return Y.test(H)?H.replace("e",".e"):H}function q(K){return Object.prototype.toString.call(K)==="[object Number]"&&(K%1!==0||Z.isNegativeZero(K))}return _Z=new Q("tag:yaml.org,2002:float",{kind:"scalar",resolve:J,construct:G,predicate:q,represent:z,defaultStyle:"lowercase"}),_Z}function yX(){if(FX)return bZ;return FX=1,bZ=kX().extend({implicit:[_X(),bX(),xX(),vX()]}),bZ}function gX(){if(LX)return xZ;return LX=1,xZ=yX(),xZ}function fX(){if(AX)return vZ;AX=1;let Z=r0(),Q=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),W=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]))?))?$");function X(Y){if(Y===null)return!1;if(Q.exec(Y)!==null)return!0;if(W.exec(Y)!==null)return!0;return!1}function J(Y){let z=0,q=null,K=Q.exec(Y);if(K===null)K=W.exec(Y);if(K===null)throw Error("Date resolve error");let V=+K[1],H=+K[2]-1,B=+K[3];if(!K[4])return new Date(Date.UTC(V,H,B));let F=+K[4],A=+K[5],M=+K[6];if(K[7]){z=K[7].slice(0,3);while(z.length<3)z+="0";z=+z}if(K[9]){let N=+K[10],D=+(K[11]||0);if(q=(N*60+D)*60000,K[9]==="-")q=-q}let I=new Date(Date.UTC(V,H,B,F,A,M,z));if(q)I.setTime(I.getTime()-q);return I}function G(Y){return Y.toISOString()}return vZ=new Z("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:X,construct:J,instanceOf:Date,represent:G}),vZ}function hX(){if(MX)return yZ;MX=1;let Z=r0();function Q(W){return W==="<<"||W===null}return yZ=new Z("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Q}),yZ}function uX(){if(IX)return gZ;IX=1;let Z=r0(),Q=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
29
+ \r`;function W(Y){if(Y===null)return!1;let z=0,q=Y.length,K=Q;for(let V=0;V<q;V++){let H=K.indexOf(Y.charAt(V));if(H>64)continue;if(H<0)return!1;z+=6}return z%8===0}function X(Y){let z=Y.replace(/[\r\n=]/g,""),q=z.length,K=Q,V=0,H=[];for(let F=0;F<q;F++){if(F%4===0&&F)H.push(V>>16&255),H.push(V>>8&255),H.push(V&255);V=V<<6|K.indexOf(z.charAt(F))}let B=q%4*6;if(B===0)H.push(V>>16&255),H.push(V>>8&255),H.push(V&255);else if(B===18)H.push(V>>10&255),H.push(V>>2&255);else if(B===12)H.push(V>>4&255);return new Uint8Array(H)}function J(Y){let z="",q=0,K=Y.length,V=Q;for(let B=0;B<K;B++){if(B%3===0&&B)z+=V[q>>18&63],z+=V[q>>12&63],z+=V[q>>6&63],z+=V[q&63];q=(q<<8)+Y[B]}let H=K%3;if(H===0)z+=V[q>>18&63],z+=V[q>>12&63],z+=V[q>>6&63],z+=V[q&63];else if(H===2)z+=V[q>>10&63],z+=V[q>>4&63],z+=V[q<<2&63],z+=V[64];else if(H===1)z+=V[q>>2&63],z+=V[q<<4&63],z+=V[64],z+=V[64];return z}function G(Y){return Object.prototype.toString.call(Y)==="[object Uint8Array]"}return gZ=new Z("tag:yaml.org,2002:binary",{kind:"scalar",resolve:W,construct:X,predicate:G,represent:J}),gZ}function mX(){if(NX)return fZ;NX=1;let Z=r0(),Q=Object.prototype.hasOwnProperty,W=Object.prototype.toString;function X(G){if(G===null)return!0;let Y=[],z=G;for(let q=0,K=z.length;q<K;q+=1){let V=z[q],H=!1;if(W.call(V)!=="[object Object]")return!1;let B;for(B in V)if(Q.call(V,B))if(!H)H=!0;else return!1;if(!H)return!1;if(Y.indexOf(B)===-1)Y.push(B);else return!1}return!0}function J(G){return G!==null?G:[]}return fZ=new Z("tag:yaml.org,2002:omap",{kind:"sequence",resolve:X,construct:J}),fZ}function lX(){if(DX)return hZ;DX=1;let Z=r0(),Q=Object.prototype.toString;function W(J){if(J===null)return!0;let G=J,Y=Array(G.length);for(let z=0,q=G.length;z<q;z+=1){let K=G[z];if(Q.call(K)!=="[object Object]")return!1;let V=Object.keys(K);if(V.length!==1)return!1;Y[z]=[V[0],K[V[0]]]}return!0}function X(J){if(J===null)return[];let G=J,Y=Array(G.length);for(let z=0,q=G.length;z<q;z+=1){let K=G[z],V=Object.keys(K);Y[z]=[V[0],K[V[0]]]}return Y}return hZ=new Z("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:W,construct:X}),hZ}function dX(){if(wX)return uZ;wX=1;let Z=r0(),Q=Object.prototype.hasOwnProperty;function W(J){if(J===null)return!0;let G=J;for(let Y in G)if(Q.call(G,Y)){if(G[Y]!==null)return!1}return!0}function X(J){return J!==null?J:{}}return uZ=new Z("tag:yaml.org,2002:set",{kind:"mapping",resolve:W,construct:X}),uZ}function dZ(){if(TX)return mZ;return TX=1,mZ=gX().extend({implicit:[fX(),hX()],explicit:[uX(),mX(),lX(),dX()]}),mZ}function OB(){if(jX)return w8;jX=1;let Z=G9(),Q=Y9(),W=EB(),X=dZ(),J=Object.prototype.hasOwnProperty,G=1,Y=2,z=3,q=4,K=1,V=2,H=3,B=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,F=/[\x85\u2028\u2029]/,A=/[,\[\]{}]/,M=/^(?:!|!!|![0-9A-Za-z-]+!)$/,I=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function N(U){return Object.prototype.toString.call(U)}function D(U){return U===10||U===13}function P(U){return U===9||U===32}function v(U){return U===9||U===32||U===10||U===13}function x(U){return U===44||U===91||U===93||U===123||U===125}function p(U){if(U>=48&&U<=57)return U-48;let w=U|32;if(w>=97&&w<=102)return w-97+10;return-1}function f(U){if(U===120)return 2;if(U===117)return 4;if(U===85)return 8;return 0}function s(U){if(U>=48&&U<=57)return U-48;return-1}function J0(U){switch(U){case 48:return"\x00";case 97:return"\x07";case 98:return"\b";case 116:return"\t";case 9:return"\t";case 110:return`
30
+ `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function C0(U){if(U<=65535)return String.fromCharCode(U);return String.fromCharCode((U-65536>>10)+55296,(U-65536&1023)+56320)}function m0(U,w,O){if(w==="__proto__")Object.defineProperty(U,w,{configurable:!0,enumerable:!0,writable:!0,value:O});else U[w]=O}let E4=Array(256),H4=Array(256);for(let U=0;U<256;U++)E4[U]=J0(U)?1:0,H4[U]=J0(U);function r(U,w){this.input=U,this.filename=w.filename||null,this.schema=w.schema||X,this.onWarning=w.onWarning||null,this.legacy=w.legacy||!1,this.json=w.json||!1,this.listener=w.listener||null,this.maxDepth=typeof w.maxDepth==="number"?w.maxDepth:100,this.maxTotalMergeKeys=typeof w.maxTotalMergeKeys==="number"?w.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=U.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function Q0(U,w){let O={name:U.filename,buffer:U.input.slice(0,-1),position:U.position,line:U.line,column:U.position-U.lineStart};return O.snippet=W(O),new Q(w,O)}function g(U,w){throw Q0(U,w)}function U0(U,w){if(U.onWarning)U.onWarning.call(null,Q0(U,w))}function S0(U,w,O){let S=U.anchorMapTransactions;if(S.length!==0){let E=S[S.length-1];if(!J.call(E,w))E[w]={existed:J.call(U.anchorMap,w),value:U.anchorMap[w]}}U.anchorMap[w]=O}function N0(U){U.anchorMapTransactions.push(Object.create(null))}function G0(U){let w=U.anchorMapTransactions.pop(),O=U.anchorMapTransactions;if(O.length===0)return;let S=O[O.length-1],E=Object.keys(w);for(let y=0,L=E.length;y<L;y+=1){let T=E[y];if(!J.call(S,T))S[T]=w[T]}}function F0(U){let w=U.anchorMapTransactions.pop(),O=Object.keys(w);for(let S=O.length-1;S>=0;S-=1){let E=w[O[S]];if(E.existed)U.anchorMap[O[S]]=E.value;else delete U.anchorMap[O[S]]}}function B4(U){return{position:U.position,line:U.line,lineStart:U.lineStart,lineIndent:U.lineIndent,firstTabInLine:U.firstTabInLine,tag:U.tag,anchor:U.anchor,kind:U.kind,result:U.result}}function r4(U,w){U.position=w.position,U.line=w.line,U.lineStart=w.lineStart,U.lineIndent=w.lineIndent,U.firstTabInLine=w.firstTabInLine,U.tag=w.tag,U.anchor=w.anchor,U.kind=w.kind,U.result=w.result}let G1={YAML:function(w,O,S){if(w.version!==null)g(w,"duplication of %YAML directive");if(S.length!==1)g(w,"YAML directive accepts exactly one argument");let E=/^([0-9]+)\.([0-9]+)$/.exec(S[0]);if(E===null)g(w,"ill-formed argument of the YAML directive");let y=parseInt(E[1],10),L=parseInt(E[2],10);if(y!==1)g(w,"unacceptable YAML version of the document");if(w.version=S[0],w.checkLineBreaks=L<2,L!==1&&L!==2)U0(w,"unsupported YAML version of the document")},TAG:function(w,O,S){let E;if(S.length!==2)g(w,"TAG directive accepts exactly two arguments");let y=S[0];if(E=S[1],!M.test(y))g(w,"ill-formed tag handle (first argument) of the TAG directive");if(J.call(w.tagMap,y))g(w,'there is a previously declared suffix for "'+y+'" tag handle');if(!I.test(E))g(w,"ill-formed tag prefix (second argument) of the TAG directive");try{E=decodeURIComponent(E)}catch(L){g(w,"tag prefix is malformed: "+E)}w.tagMap[y]=E}};function Y4(U,w,O,S){if(w<O){let E=U.input.slice(w,O);if(S)for(let y=0,L=E.length;y<L;y+=1){let T=E.charCodeAt(y);if(!(T===9||T>=32&&T<=1114111))g(U,"expected valid JSON character")}else if(B.test(E))g(U,"the stream contains non-printable characters");U.result+=E}}function H6(U,w,O,S){if(!Z.isObject(O))g(U,"cannot merge mappings; the provided source object is unacceptable");let E=Object.keys(O);for(let y=0,L=E.length;y<L;y+=1){let T=E[y];if(U.maxTotalMergeKeys!==-1&&++U.totalMergeKeys>U.maxTotalMergeKeys)g(U,"merge keys exceeded maxTotalMergeKeys ("+U.maxTotalMergeKeys+")");if(!J.call(w,T))m0(w,T,O[T]),S[T]=!0}}function a4(U,w,O,S,E,y,L,T,_){if(Array.isArray(E)){E=Array.prototype.slice.call(E);for(let R=0,C=E.length;R<C;R+=1){if(Array.isArray(E[R]))g(U,"nested arrays are not supported inside keys");if(typeof E==="object"&&N(E[R])==="[object Object]")E[R]="[object Object]"}}if(typeof E==="object"&&N(E)==="[object Object]")E="[object Object]";if(E=String(E),w===null)w={};if(S==="tag:yaml.org,2002:merge")if(Array.isArray(y))for(let R=0,C=y.length;R<C;R+=1)H6(U,w,y[R],O);else H6(U,w,y,O);else{if(!U.json&&!J.call(O,E)&&J.call(w,E))U.line=L||U.line,U.lineStart=T||U.lineStart,U.position=_||U.position,g(U,"duplicated mapping key");m0(w,E,y),delete O[E]}return w}function Y1(U){let w=U.input.charCodeAt(U.position);if(w===10)U.position++;else if(w===13){if(U.position++,U.input.charCodeAt(U.position)===10)U.position++}else g(U,"a line break is expected");U.line+=1,U.lineStart=U.position,U.firstTabInLine=-1}function T0(U,w,O){let S=0,E=U.input.charCodeAt(U.position);while(E!==0){while(P(E)){if(E===9&&U.firstTabInLine===-1)U.firstTabInLine=U.position;E=U.input.charCodeAt(++U.position)}if(w&&E===35)do E=U.input.charCodeAt(++U.position);while(E!==10&&E!==13&&E!==0);if(D(E)){Y1(U),E=U.input.charCodeAt(U.position),S++,U.lineIndent=0;while(E===32)U.lineIndent++,E=U.input.charCodeAt(++U.position)}else break}if(O!==-1&&S!==0&&U.lineIndent<O)U0(U,"deficient indentation");return S}function z1(U){let w=U.position,O=U.input.charCodeAt(w);if((O===45||O===46)&&O===U.input.charCodeAt(w+1)&&O===U.input.charCodeAt(w+2)){if(w+=3,O=U.input.charCodeAt(w),O===0||v(O))return!0}return!1}function s4(U,w){if(w===1)U.result+=" ";else if(w>1)U.result+=Z.repeat(`
31
+ `,w-1)}function a9(U,w,O){let S,E,y,L,T,_,R=U.kind,C=U.result,b=U.input.charCodeAt(U.position);if(v(b)||x(b)||b===35||b===38||b===42||b===33||b===124||b===62||b===39||b===34||b===37||b===64||b===96)return!1;if(b===63||b===45){let k=U.input.charCodeAt(U.position+1);if(v(k)||O&&x(k))return!1}U.kind="scalar",U.result="",S=E=U.position,y=!1;while(b!==0){if(b===58){let k=U.input.charCodeAt(U.position+1);if(v(k)||O&&x(k))break}else if(b===35){let k=U.input.charCodeAt(U.position-1);if(v(k))break}else if(U.position===U.lineStart&&z1(U)||O&&x(b))break;else if(D(b))if(L=U.line,T=U.lineStart,_=U.lineIndent,T0(U,!1,-1),U.lineIndent>=w){y=!0,b=U.input.charCodeAt(U.position);continue}else{U.position=E,U.line=L,U.lineStart=T,U.lineIndent=_;break}if(y)Y4(U,S,E,!1),s4(U,U.line-L),S=E=U.position,y=!1;if(!P(b))E=U.position+1;b=U.input.charCodeAt(++U.position)}if(Y4(U,S,E,!1),U.result)return!0;return U.kind=R,U.result=C,!1}function s9(U,w){let O,S,E=U.input.charCodeAt(U.position);if(E!==39)return!1;U.kind="scalar",U.result="",U.position++,O=S=U.position;while((E=U.input.charCodeAt(U.position))!==0)if(E===39)if(Y4(U,O,U.position,!0),E=U.input.charCodeAt(++U.position),E===39)O=U.position,U.position++,S=U.position;else return!0;else if(D(E))Y4(U,O,S,!0),s4(U,T0(U,!1,w)),O=S=U.position;else if(U.position===U.lineStart&&z1(U))g(U,"unexpected end of the document within a single quoted scalar");else if(U.position++,!P(E))S=U.position;g(U,"unexpected end of the stream within a single quoted scalar")}function a1(U,w){let O,S,E,y=U.input.charCodeAt(U.position);if(y!==34)return!1;U.kind="scalar",U.result="",U.position++,O=S=U.position;while((y=U.input.charCodeAt(U.position))!==0)if(y===34)return Y4(U,O,U.position,!0),U.position++,!0;else if(y===92){if(Y4(U,O,U.position,!0),y=U.input.charCodeAt(++U.position),D(y))T0(U,!1,w);else if(y<256&&E4[y])U.result+=H4[y],U.position++;else if((E=f(y))>0){let L=E,T=0;for(;L>0;L--)if(y=U.input.charCodeAt(++U.position),(E=p(y))>=0)T=(T<<4)+E;else g(U,"expected hexadecimal character");U.result+=C0(T),U.position++}else g(U,"unknown escape sequence");O=S=U.position}else if(D(y))Y4(U,O,S,!0),s4(U,T0(U,!1,w)),O=S=U.position;else if(U.position===U.lineStart&&z1(U))g(U,"unexpected end of the document within a double quoted scalar");else if(U.position++,!P(y))S=U.position;g(U,"unexpected end of the stream within a double quoted scalar")}function o9(U,w){let O=!0,S,E,y,L=U.tag,T,_=U.anchor,R,C,b,k,c=Object.create(null),h,n,a,Y0=U.input.charCodeAt(U.position);if(Y0===91)R=93,k=!1,T=[];else if(Y0===123)R=125,k=!0,T={};else return!1;if(U.anchor!==null)S0(U,U.anchor,T);Y0=U.input.charCodeAt(++U.position);while(Y0!==0){if(T0(U,!0,w),Y0=U.input.charCodeAt(U.position),Y0===R)return U.position++,U.tag=L,U.anchor=_,U.kind=k?"mapping":"sequence",U.result=T,!0;else if(!O)g(U,"missed comma between flow collection entries");else if(Y0===44)g(U,"expected the node content, but found ','");if(n=h=a=null,C=b=!1,Y0===63){let L0=U.input.charCodeAt(U.position+1);if(v(L0))C=b=!0,U.position++,T0(U,!0,w)}if(S=U.line,E=U.lineStart,y=U.position,t4(U,w,G,!1,!0),n=U.tag,h=U.result,T0(U,!0,w),Y0=U.input.charCodeAt(U.position),(b||U.line===S)&&Y0===58)C=!0,Y0=U.input.charCodeAt(++U.position),T0(U,!0,w),t4(U,w,G,!1,!0),a=U.result;if(k)a4(U,T,c,n,h,a,S,E,y);else if(C)T.push(a4(U,null,c,n,h,a,S,E,y));else T.push(h);if(T0(U,!0,w),Y0=U.input.charCodeAt(U.position),Y0===44)O=!0,Y0=U.input.charCodeAt(++U.position);else O=!1}g(U,"unexpected end of the stream within a flow collection")}function t9(U,w){let O,S=K,E=!1,y=!1,L=w,T=0,_=!1,R,C=U.input.charCodeAt(U.position);if(C===124)O=!1;else if(C===62)O=!0;else return!1;U.kind="scalar",U.result="";while(C!==0)if(C=U.input.charCodeAt(++U.position),C===43||C===45)if(K===S)S=C===43?H:V;else g(U,"repeat of a chomping mode identifier");else if((R=s(C))>=0)if(R===0)g(U,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!y)L=w+R-1,y=!0;else g(U,"repeat of an indentation width identifier");else break;if(P(C)){do C=U.input.charCodeAt(++U.position);while(P(C));if(C===35)do C=U.input.charCodeAt(++U.position);while(!D(C)&&C!==0)}while(C!==0){Y1(U),U.lineIndent=0,C=U.input.charCodeAt(U.position);while((!y||U.lineIndent<L)&&C===32)U.lineIndent++,C=U.input.charCodeAt(++U.position);if(!y&&U.lineIndent>L)L=U.lineIndent;if(D(C)){T++;continue}if(!y&&L===0)g(U,"missing indentation for block scalar");if(U.lineIndent<L){if(S===H)U.result+=Z.repeat(`
32
+ `,E?1+T:T);else if(S===K){if(E)U.result+=`
33
+ `}break}if(O)if(P(C))_=!0,U.result+=Z.repeat(`
34
+ `,E?1+T:T);else if(_)_=!1,U.result+=Z.repeat(`
35
+ `,T+1);else if(T===0){if(E)U.result+=" "}else U.result+=Z.repeat(`
36
+ `,T);else U.result+=Z.repeat(`
37
+ `,E?1+T:T);E=!0,y=!0,T=0;let b=U.position;while(!D(C)&&C!==0)C=U.input.charCodeAt(++U.position);Y4(U,b,U.position,!1)}return!0}function o4(U,w){let{tag:O,anchor:S}=U,E=[],y=!1;if(U.firstTabInLine!==-1)return!1;if(U.anchor!==null)S0(U,U.anchor,E);let L=U.input.charCodeAt(U.position);while(L!==0){if(U.firstTabInLine!==-1)U.position=U.firstTabInLine,g(U,"tab characters must not be used in indentation");if(L!==45)break;let T=U.input.charCodeAt(U.position+1);if(!v(T))break;if(y=!0,U.position++,T0(U,!0,-1)){if(U.lineIndent<=w){E.push(null),L=U.input.charCodeAt(U.position);continue}}let _=U.line;if(t4(U,w,z,!1,!0),E.push(U.result),T0(U,!0,-1),L=U.input.charCodeAt(U.position),(U.line===_||U.lineIndent>w)&&L!==0)g(U,"bad indentation of a sequence entry");else if(U.lineIndent<w)break}if(y)return U.tag=O,U.anchor=S,U.kind="sequence",U.result=E,!0;return!1}function e9(U,w,O){let S,E,y,L,T=U.tag,_=U.anchor,R={},C=Object.create(null),b=null,k=null,c=null,h=!1,n=!1;if(U.firstTabInLine!==-1)return!1;if(U.anchor!==null)S0(U,U.anchor,R);let a=U.input.charCodeAt(U.position);while(a!==0){if(!h&&U.firstTabInLine!==-1)U.position=U.firstTabInLine,g(U,"tab characters must not be used in indentation");let Y0=U.input.charCodeAt(U.position+1),L0=U.line;if((a===63||a===58)&&v(Y0)){if(a===63){if(h)a4(U,R,C,b,k,null,E,y,L),b=k=c=null;n=!0,h=!0,S=!0}else if(h)h=!1,S=!0;else g(U,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");U.position+=1,a=Y0}else{if(E=U.line,y=U.lineStart,L=U.position,!t4(U,O,Y,!1,!0))break;if(U.line===L0){a=U.input.charCodeAt(U.position);while(P(a))a=U.input.charCodeAt(++U.position);if(a===58){if(a=U.input.charCodeAt(++U.position),!v(a))g(U,"a whitespace character is expected after the key-value separator within a block mapping");if(h)a4(U,R,C,b,k,null,E,y,L),b=k=c=null;n=!0,h=!1,S=!1,b=U.tag,k=U.result}else if(n)g(U,"can not read an implicit mapping pair; a colon is missed");else return U.tag=T,U.anchor=_,!0}else if(n)g(U,"can not read a block mapping entry; a multiline key may not be an implicit key");else return U.tag=T,U.anchor=_,!0}if(U.line===L0||U.lineIndent>w){if(h)E=U.line,y=U.lineStart,L=U.position;if(t4(U,w,q,!0,S))if(h)k=U.result;else c=U.result;if(!h)a4(U,R,C,b,k,c,E,y,L),b=k=c=null;T0(U,!0,-1),a=U.input.charCodeAt(U.position)}if((U.line===L0||U.lineIndent>w)&&a!==0)g(U,"bad indentation of a mapping entry");else if(U.lineIndent<w)break}if(h)a4(U,R,C,b,k,null,E,y,L);if(n)U.tag=T,U.anchor=_,U.kind="mapping",U.result=R;return n}function r5(U){let w=!1,O=!1,S,E,y=U.input.charCodeAt(U.position);if(y!==33)return!1;if(U.tag!==null)g(U,"duplication of a tag property");if(y=U.input.charCodeAt(++U.position),y===60)w=!0,y=U.input.charCodeAt(++U.position);else if(y===33)O=!0,S="!!",y=U.input.charCodeAt(++U.position);else S="!";let L=U.position;if(w){do y=U.input.charCodeAt(++U.position);while(y!==0&&y!==62);if(U.position<U.length)E=U.input.slice(L,U.position),y=U.input.charCodeAt(++U.position);else g(U,"unexpected end of the stream within a verbatim tag")}else{while(y!==0&&!v(y)){if(y===33)if(!O){if(S=U.input.slice(L-1,U.position+1),!M.test(S))g(U,"named tag handle cannot contain such characters");O=!0,L=U.position+1}else g(U,"tag suffix cannot contain exclamation marks");y=U.input.charCodeAt(++U.position)}if(E=U.input.slice(L,U.position),A.test(E))g(U,"tag suffix cannot contain flow indicator characters")}if(E&&!I.test(E))g(U,"tag name cannot contain such characters: "+E);try{E=decodeURIComponent(E)}catch(T){g(U,"tag name is malformed: "+E)}if(w)U.tag=E;else if(J.call(U.tagMap,S))U.tag=U.tagMap[S]+E;else if(S==="!")U.tag="!"+E;else if(S==="!!")U.tag="tag:yaml.org,2002:"+E;else g(U,'undeclared tag handle "'+S+'"');return!0}function Z8(U){let w=U.input.charCodeAt(U.position);if(w!==38)return!1;if(U.anchor!==null)g(U,"duplication of an anchor property");w=U.input.charCodeAt(++U.position);let O=U.position;while(w!==0&&!v(w)&&!x(w))w=U.input.charCodeAt(++U.position);if(U.position===O)g(U,"name of an anchor node must contain at least one character");return U.anchor=U.input.slice(O,U.position),!0}function Q8(U){let w=U.input.charCodeAt(U.position);if(w!==42)return!1;w=U.input.charCodeAt(++U.position);let O=U.position;while(w!==0&&!v(w)&&!x(w))w=U.input.charCodeAt(++U.position);if(U.position===O)g(U,"name of an alias node must contain at least one character");let S=U.input.slice(O,U.position);if(!J.call(U.anchorMap,S))g(U,'unidentified alias "'+S+'"');return U.result=U.anchorMap[S],T0(U,!0,-1),!0}function a5(U,w,O,S){let E=B4(U);if(N0(U),r4(U,w),U.tag=null,U.anchor=null,U.kind=null,U.result=null,e9(U,O,S)&&U.kind==="mapping")return G0(U),!0;return F0(U),r4(U,E),!1}function t4(U,w,O,S,E){let y,L,T=1,_=!1,R=!1,C=null,b,k,c;if(U.depth>=U.maxDepth)g(U,"nesting exceeded maxDepth ("+U.maxDepth+")");if(U.depth+=1,U.listener!==null)U.listener("open",U);U.tag=null,U.anchor=null,U.kind=null,U.result=null;let h=y=L=q===O||z===O;if(S){if(T0(U,!0,-1)){if(_=!0,U.lineIndent>w)T=1;else if(U.lineIndent===w)T=0;else if(U.lineIndent<w)T=-1}}if(T===1)while(!0){let n=U.input.charCodeAt(U.position),a=B4(U);if(_&&(n===33&&U.tag!==null||n===38&&U.anchor!==null))break;if(!r5(U)&&!Z8(U))break;if(C===null)C=a;if(T0(U,!0,-1)){if(_=!0,L=h,U.lineIndent>w)T=1;else if(U.lineIndent===w)T=0;else if(U.lineIndent<w)T=-1}else L=!1}if(L)L=_||E;if(T===1||q===O){if(G===O||Y===O)k=w;else k=w+1;if(c=U.position-U.lineStart,T===1)if(L&&(o4(U,c)||e9(U,c,k))||o9(U,k))R=!0;else{let n=U.input.charCodeAt(U.position);if(C!==null&&h&&!L&&n!==124&&n!==62&&a5(U,C,C.position-C.lineStart,k))R=!0;else if(y&&t9(U,k)||s9(U,k)||a1(U,k))R=!0;else if(Q8(U)){if(R=!0,U.tag!==null||U.anchor!==null)g(U,"alias node should not have any properties")}else if(a9(U,k,G===O)){if(R=!0,U.tag===null)U.tag="?"}if(U.anchor!==null)S0(U,U.anchor,U.result)}else if(T===0)R=L&&o4(U,c)}if(U.tag===null){if(U.anchor!==null)S0(U,U.anchor,U.result)}else if(U.tag==="?"){if(U.result!==null&&U.kind!=="scalar")g(U,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+U.kind+'"');for(let n=0,a=U.implicitTypes.length;n<a;n+=1)if(b=U.implicitTypes[n],b.resolve(U.result)){if(U.result=b.construct(U.result),U.tag=b.tag,U.anchor!==null)S0(U,U.anchor,U.result);break}}else if(U.tag!=="!"){if(J.call(U.typeMap[U.kind||"fallback"],U.tag))b=U.typeMap[U.kind||"fallback"][U.tag];else{b=null;let n=U.typeMap.multi[U.kind||"fallback"];for(let a=0,Y0=n.length;a<Y0;a+=1)if(U.tag.slice(0,n[a].tag.length)===n[a].tag){b=n[a];break}}if(!b)g(U,"unknown tag !<"+U.tag+">");if(U.result!==null&&b.kind!==U.kind)g(U,"unacceptable node kind for !<"+U.tag+'> tag; it should be "'+b.kind+'", not "'+U.kind+'"');if(!b.resolve(U.result,U.tag))g(U,"cannot resolve a node with !<"+U.tag+"> explicit tag");else if(U.result=b.construct(U.result,U.tag),U.anchor!==null)S0(U,U.anchor,U.result)}if(U.listener!==null)U.listener("close",U);return U.depth-=1,U.tag!==null||U.anchor!==null||R}function s5(U){let w=U.position,O=!1,S;U.version=null,U.checkLineBreaks=U.legacy,U.tagMap=Object.create(null),U.anchorMap=Object.create(null);while((S=U.input.charCodeAt(U.position))!==0){if(T0(U,!0,-1),S=U.input.charCodeAt(U.position),U.lineIndent>0||S!==37)break;O=!0,S=U.input.charCodeAt(++U.position);let E=U.position;while(S!==0&&!v(S))S=U.input.charCodeAt(++U.position);let y=U.input.slice(E,U.position),L=[];if(y.length<1)g(U,"directive name must not be less than one character in length");while(S!==0){while(P(S))S=U.input.charCodeAt(++U.position);if(S===35){do S=U.input.charCodeAt(++U.position);while(S!==0&&!D(S));break}if(D(S))break;E=U.position;while(S!==0&&!v(S))S=U.input.charCodeAt(++U.position);L.push(U.input.slice(E,U.position))}if(S!==0)Y1(U);if(J.call(G1,y))G1[y](U,y,L);else U0(U,'unknown document directive "'+y+'"')}if(T0(U,!0,-1),U.lineIndent===0&&U.input.charCodeAt(U.position)===45&&U.input.charCodeAt(U.position+1)===45&&U.input.charCodeAt(U.position+2)===45)U.position+=3,T0(U,!0,-1);else if(O)g(U,"directives end mark is expected");if(t4(U,U.lineIndent-1,q,!1,!0),T0(U,!0,-1),U.checkLineBreaks&&F.test(U.input.slice(w,U.position)))U0(U,"non-ASCII line breaks are interpreted as content");if(U.documents.push(U.result),U.position===U.lineStart&&z1(U)){if(U.input.charCodeAt(U.position)===46)U.position+=3,T0(U,!0,-1);return}if(U.position<U.length-1)g(U,"end of the stream or a document separator is expected")}function W8(U,w){if(U=String(U),w=w||{},U.length!==0){if(U.charCodeAt(U.length-1)!==10&&U.charCodeAt(U.length-1)!==13)U+=`
38
+ `;if(U.charCodeAt(0)===65279)U=U.slice(1)}let O=new r(U,w),S=U.indexOf("\x00");if(S!==-1)O.position=S,g(O,"null byte is not allowed in input");O.input+="\x00";while(O.input.charCodeAt(O.position)===32)O.lineIndent+=1,O.position+=1;while(O.position<O.length-1)s5(O);return O.documents}function X8(U,w,O){if(w!==null&&typeof w==="object"&&typeof O>"u")O=w,w=null;let S=W8(U,O);if(typeof w!=="function")return S;for(let E=0,y=S.length;E<y;E+=1)w(S[E])}function o5(U,w){let O=W8(U,w);if(O.length===0)return;else if(O.length===1)return O[0];throw new Q("expected a single document in the stream, but found more")}return w8.loadAll=X8,w8.load=o5,w8}function RB(){if(EX)return lZ;EX=1;let Z=G9(),Q=Y9(),W=dZ(),X=Object.prototype.toString,J=Object.prototype.hasOwnProperty,G=65279,Y=9,z=10,q=13,K=32,V=33,H=34,B=35,F=37,A=38,M=39,I=42,N=44,D=45,P=58,v=61,x=62,p=63,f=64,s=91,J0=93,C0=96,m0=123,E4=124,H4=125,r={};r[0]="\\0",r[7]="\\a",r[8]="\\b",r[9]="\\t",r[10]="\\n",r[11]="\\v",r[12]="\\f",r[13]="\\r",r[27]="\\e",r[34]="\\\"",r[92]="\\\\",r[133]="\\N",r[160]="\\_",r[8232]="\\L",r[8233]="\\P";let Q0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],g=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function U0(L,T){if(T===null)return{};let _={},R=Object.keys(T);for(let C=0,b=R.length;C<b;C+=1){let k=R[C],c=String(T[k]);if(k.slice(0,2)==="!!")k="tag:yaml.org,2002:"+k.slice(2);let h=L.compiledTypeMap.fallback[k];if(h&&J.call(h.styleAliases,c))c=h.styleAliases[c];_[k]=c}return _}function S0(L){let T,_,R=L.toString(16).toUpperCase();if(L<=255)T="x",_=2;else if(L<=65535)T="u",_=4;else if(L<=4294967295)T="U",_=8;else throw new Q("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+T+Z.repeat("0",_-R.length)+R}let N0=1,G0=2;function F0(L){this.schema=L.schema||W,this.indent=Math.max(1,L.indent||2),this.noArrayIndent=L.noArrayIndent||!1,this.skipInvalid=L.skipInvalid||!1,this.flowLevel=Z.isNothing(L.flowLevel)?-1:L.flowLevel,this.styleMap=U0(this.schema,L.styles||null),this.sortKeys=L.sortKeys||!1,this.lineWidth=L.lineWidth||80,this.noRefs=L.noRefs||!1,this.noCompatMode=L.noCompatMode||!1,this.condenseFlow=L.condenseFlow||!1,this.quotingType=L.quotingType==='"'?G0:N0,this.forceQuotes=L.forceQuotes||!1,this.replacer=typeof L.replacer==="function"?L.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function B4(L,T){let _=Z.repeat(" ",T),R=0,C="",b=L.length;while(R<b){let k,c=L.indexOf(`
39
+ `,R);if(c===-1)k=L.slice(R),R=b;else k=L.slice(R,c+1),R=c+1;if(k.length&&k!==`
40
+ `)C+=_;C+=k}return C}function r4(L,T){return`
41
+ `+Z.repeat(" ",L.indent*T)}function G1(L,T){for(let _=0,R=L.implicitTypes.length;_<R;_+=1)if(L.implicitTypes[_].resolve(T))return!0;return!1}function Y4(L){return L===K||L===Y}function H6(L){return L>=32&&L<=126||L>=161&&L<=55295&&L!==8232&&L!==8233||L>=57344&&L<=65533&&L!==G||L>=65536&&L<=1114111}function a4(L){return H6(L)&&L!==G&&L!==q&&L!==z}function Y1(L,T,_){let R=a4(L),C=R&&!Y4(L);return(_?R:R&&L!==N&&L!==s&&L!==J0&&L!==m0&&L!==H4)&&L!==B&&!(T===P&&!C)||a4(T)&&!Y4(T)&&L===B||T===P&&C}function T0(L){return H6(L)&&L!==G&&!Y4(L)&&L!==D&&L!==p&&L!==P&&L!==N&&L!==s&&L!==J0&&L!==m0&&L!==H4&&L!==B&&L!==A&&L!==I&&L!==V&&L!==E4&&L!==v&&L!==x&&L!==M&&L!==H&&L!==F&&L!==f&&L!==C0}function z1(L){return!Y4(L)&&L!==P}function s4(L,T){let _=L.charCodeAt(T),R;if(_>=55296&&_<=56319&&T+1<L.length){if(R=L.charCodeAt(T+1),R>=56320&&R<=57343)return(_-55296)*1024+R-56320+65536}return _}function a9(L){return/^\n* /.test(L)}let s9=1,a1=2,o9=3,t9=4,o4=5;function e9(L,T,_,R,C,b,k,c){let h,n=0,a=null,Y0=!1,L0=!1,IW=R!==-1,s1=-1,o1=T0(s4(L,0))&&z1(s4(L,L.length-1));if(T||k)for(h=0;h<L.length;n>=65536?h+=2:h++){if(n=s4(L,h),!H6(n))return o4;o1=o1&&Y1(n,a,c),a=n}else{for(h=0;h<L.length;n>=65536?h+=2:h++){if(n=s4(L,h),n===z){if(Y0=!0,IW)L0=L0||h-s1-1>R&&L[s1+1]!==" ",s1=h}else if(!H6(n))return o4;o1=o1&&Y1(n,a,c),a=n}L0=L0||IW&&(h-s1-1>R&&L[s1+1]!==" ")}if(!Y0&&!L0){if(o1&&!k&&!C(L))return s9;return b===G0?o4:a1}if(_>9&&a9(L))return o4;if(!k)return L0?t9:o9;return b===G0?o4:a1}function r5(L,T,_,R,C){L.dump=function(){if(T.length===0)return L.quotingType===G0?'""':"''";if(!L.noCompatMode){if(Q0.indexOf(T)!==-1||g.test(T))return L.quotingType===G0?'"'+T+'"':"'"+T+"'"}let b=L.indent*Math.max(1,_),k=L.lineWidth===-1?-1:Math.max(Math.min(L.lineWidth,40),L.lineWidth-b),c=R||L.flowLevel>-1&&_>=L.flowLevel;function h(n){return G1(L,n)}switch(e9(T,c,L.indent,k,h,L.quotingType,L.forceQuotes&&!R,C)){case s9:return T;case a1:return"'"+T.replace(/'/g,"''")+"'";case o9:return"|"+Z8(T,L.indent)+Q8(B4(T,b));case t9:return">"+Z8(T,L.indent)+Q8(B4(a5(T,k),b));case o4:return'"'+s5(T)+'"';default:throw new Q("impossible error: invalid scalar style")}}()}function Z8(L,T){let _=a9(L)?String(T):"",R=L[L.length-1]===`
42
+ `,b=R&&(L[L.length-2]===`
42
43
  `||L===`
43
- `)?"+":R?"":"-";return b+_+`
44
- `}function r9(L){return L[L.length-1]===`
45
- `?L.slice(0,-1):L}function h5(L,w){let b=/(\n+)([^\n]*)/g,R=function(){let d=L.indexOf(`
46
- `);return d=d!==-1?d:L.length,b.lastIndex=d,i4(L.slice(0,d),w)}(),P=L[0]===`
47
- `||L[0]===" ",_,k;while(k=b.exec(L)){let d=k[1],h=k[2];_=h[0]===" ",R+=d+(!P&&!_&&h!==""?`
48
- `:"")+i4(h,w),P=_}return R}function i4(L,w){if(L===""||L[0]===" ")return L;let b=/ [^ ]/g,R,P=0,_,k=0,d=0,h="";while(R=b.exec(L)){if(d=R.index,d-P>w)_=k>P?k:d,h+=`
49
- `+L.slice(P,_),P=_+1;k=d}if(h+=`
50
- `,L.length-P>w&&k>P)h+=L.slice(P,k)+`
51
- `+L.slice(k+1);else h+=L.slice(P);return h.slice(1)}function u5(L){let w="",b=0;for(let R=0;R<L.length;b>=65536?R+=2:R++){b=p4(L,R);let P=r[b];if(!P&&z6(b)){if(w+=L[R],b>=65536)w+=L[R+1]}else w+=P||R0(b)}return w}function a9(L,w,b){let R="",P=L.tag;for(let _=0,k=b.length;_<k;_+=1){let d=b[_];if(L.replacer)d=L.replacer.call(b,String(_),d);if(E(L,w,d,!1,!1)||typeof d>"u"&&E(L,w,null,!1,!1)){if(R!=="")R+=","+(!L.condenseFlow?" ":"");R+=L.dump}}L.tag=P,L.dump="["+R+"]"}function s9(L,w,b,R){let P="",_=L.tag;for(let k=0,d=b.length;k<d;k+=1){let h=b[k];if(L.replacer)h=L.replacer.call(b,String(k),h);if(E(L,w+1,h,!0,!0,!1,!0)||typeof h>"u"&&E(L,w+1,null,!0,!0,!1,!0)){if(!R||P!=="")P+=d4(L,w);if(L.dump&&z===L.dump.charCodeAt(0))P+="-";else P+="- ";P+=L.dump}}L.tag=_,L.dump=P||"[]"}function m5(L,w,b){let R="",P=L.tag,_=Object.keys(b);for(let k=0,d=_.length;k<d;k+=1){let h="";if(R!=="")h+=", ";if(L.condenseFlow)h+='"';let i=_[k],a=b[i];if(L.replacer)a=L.replacer.call(b,i,a);if(!E(L,w,i,!1,!1))continue;if(L.dump.length>1024)h+="? ";if(h+=L.dump+(L.condenseFlow?'"':"")+":"+(L.condenseFlow?"":" "),!E(L,w,a,!1,!1))continue;h+=L.dump,R+=h}L.tag=P,L.dump="{"+R+"}"}function U(L,w,b,R){let P="",_=L.tag,k=Object.keys(b);if(L.sortKeys===!0)k.sort();else if(typeof L.sortKeys==="function")k.sort(L.sortKeys);else if(L.sortKeys)throw new X("sortKeys must be a boolean or a function");for(let d=0,h=k.length;d<h;d+=1){let i="";if(!R||P!=="")i+=d4(L,w);let a=k[d],G0=b[a];if(L.replacer)G0=L.replacer.call(b,a,G0);if(!E(L,w+1,a,!0,!0,!0))continue;let F0=L.tag!==null&&L.tag!=="?"||L.dump&&L.dump.length>1024;if(F0)if(L.dump&&z===L.dump.charCodeAt(0))i+="?";else i+="? ";if(i+=L.dump,F0)i+=d4(L,w);if(!E(L,w+1,G0,!0,F0))continue;if(L.dump&&z===L.dump.charCodeAt(0))i+=":";else i+=": ";i+=L.dump,P+=i}L.tag=_,L.dump=P||"{}"}function D(L,w,b){let R=b?L.explicitTypes:L.implicitTypes;for(let P=0,_=R.length;P<_;P+=1){let k=R[P];if((k.instanceOf||k.predicate)&&(!k.instanceOf||typeof w==="object"&&w instanceof k.instanceOf)&&(!k.predicate||k.predicate(w))){if(b)if(k.multi&&k.representName)L.tag=k.representName(w);else L.tag=k.tag;else L.tag="?";if(k.represent){let d=L.styleMap[k.tag]||k.defaultStyle,h;if(W.call(k.represent)==="[object Function]")h=k.represent(w,d);else if(J.call(k.represent,d))h=k.represent[d](w,d);else throw new X("!<"+k.tag+'> tag resolver accepts not "'+d+'" style');L.dump=h}return!0}}return!1}function E(L,w,b,R,P,_,k){if(L.tag=null,L.dump=b,!D(L,b,!1))D(L,b,!0);let d=W.call(L.dump),h=R;if(R)R=L.flowLevel<0||L.flowLevel>w;let i=d==="[object Object]"||d==="[object Array]",a,G0;if(i)a=L.duplicates.indexOf(b),G0=a!==-1;if(L.tag!==null&&L.tag!=="?"||G0||L.indent!==2&&w>0)P=!1;if(G0&&L.usedDuplicates[a])L.dump="*ref_"+a;else{if(i&&G0&&!L.usedDuplicates[a])L.usedDuplicates[a]=!0;if(d==="[object Object]"){if(R&&Object.keys(L.dump).length!==0){if(U(L,w,L.dump,P),G0)L.dump="&ref_"+a+L.dump}else if(m5(L,w,L.dump),G0)L.dump="&ref_"+a+" "+L.dump}else if(d==="[object Array]"){if(R&&L.dump.length!==0){if(L.noArrayIndent&&!k&&w>0)s9(L,w-1,L.dump,P);else s9(L,w,L.dump,P);if(G0)L.dump="&ref_"+a+L.dump}else if(a9(L,w,L.dump),G0)L.dump="&ref_"+a+" "+L.dump}else if(d==="[object String]"){if(L.tag!=="?")f5(L,L.dump,w,_,h)}else if(d==="[object Undefined]")return!1;else{if(L.skipInvalid)return!1;throw new X("unacceptable kind of an object to dump "+d)}if(L.tag!==null&&L.tag!=="?"){let F0=encodeURI(L.tag[0]==="!"?L.tag.slice(1):L.tag).replace(/!/g,"%21");if(L.tag[0]==="!")F0="!"+F0;else if(F0.slice(0,18)==="tag:yaml.org,2002:")F0="!!"+F0.slice(18);else F0="!<"+F0+">";L.dump=F0+" "+L.dump}}return!0}function C(L,w){let b=[],R=[];O(L,b,R);let P=R.length;for(let _=0;_<P;_+=1)w.duplicates.push(b[R[_]]);w.usedDuplicates=Array(P)}function O(L,w,b){if(L!==null&&typeof L==="object"){let R=w.indexOf(L);if(R!==-1){if(b.indexOf(R)===-1)b.push(R)}else if(w.push(L),Array.isArray(L))for(let P=0,_=L.length;P<_;P+=1)O(L[P],w,b);else{let P=Object.keys(L);for(let _=0,k=P.length;_<k;_+=1)O(L[P[_]],w,b)}}}function y(L,w){w=w||{};let b=new H0(w);if(!b.noRefs)C(L,b);let R=L;if(b.replacer)R=b.replacer.call({"":R},"",R);if(E(b,0,R,!0,!0))return b.dump+`
52
- `;return""}return CZ.dump=y,CZ}function oB(){if(qW)return h0;qW=1;let Z=aB(),X=sB();function Q(W,J){return function(){throw Error("Function yaml."+W+" is removed in js-yaml 4. Use yaml."+J+" instead, which is now safe by default.")}}return h0.Type=c0(),h0.Schema=KW(),h0.FAILSAFE_SCHEMA=HW(),h0.JSON_SCHEMA=IW(),h0.CORE_SCHEMA=NW(),h0.DEFAULT_SCHEMA=SZ(),h0.load=Z.load,h0.loadAll=Z.loadAll,h0.dump=X.dump,h0.YAMLException=e1(),h0.types={binary:wW(),float:MW(),map:BW(),null:FW(),pairs:OW(),set:EW(),timestamp:DW(),bool:LW(),int:AW(),merge:TW(),omap:jW(),seq:VW(),str:UW()},h0.safeLoad=Q("safeLoad","load"),h0.safeLoadAll=Q("safeLoadAll","loadAll"),h0.safeDump=Q("safeDump","dump"),h0}var h0,B8,H6,hQ,$Z,uQ,qZ,mQ,KZ,lQ,UZ,dQ,VZ,cQ,BZ,pQ,HZ,nQ,FZ,iQ,LZ,rQ,AZ,aQ,MZ,sQ,IZ,oQ,NZ,tQ,DZ,eQ,TZ,ZW,wZ,XW,jZ,QW,OZ,WW,EZ,JW,RZ,GW,PZ,YW,zW,CZ,$W,qW,tB,H8,Pk,Ck,Sk,RW,kk,bk,_k,xk,vk,yk,gk,fk,hk,uk;var kZ=c(()=>{h0={},B8={},H6={};CZ={};tB=oB(),H8=iB(tB),{Type:Pk,Schema:Ck,FAILSAFE_SCHEMA:Sk,JSON_SCHEMA:RW,CORE_SCHEMA:kk,DEFAULT_SCHEMA:bk,load:_k,loadAll:xk,dump:vk,YAMLException:yk,types:gk,safeLoad:fk,safeLoadAll:hk,safeDump:uk}=H8});var PW;var CW=c(()=>{B4();kZ();kZ();PW={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 H8.load(X,{schema:RW})}catch{try{return H8.load(X)}catch(Q){throw new V4(Q?.message||"Parser Error",Z.url)}}else return X}}});var eB,SW;var kW=c(()=>{B4();eB=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,SW={order:300,allowEmpty:!0,encoding:"utf8",canParse(Z){return(typeof Z.data==="string"||Buffer.isBuffer(Z.data))&&eB.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 V4("data is not text",Z.url)}}});var ZH,bW;var _W=c(()=>{ZH=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,bW={order:400,allowEmpty:!0,canParse(Z){return Buffer.isBuffer(Z.data)&&ZH.test(Z.url)},parse(Z){if(Buffer.isBuffer(Z.data))return Z.data;else return Buffer.from(Z.data)}}});var bZ;var _Z=c(()=>{a0();B4();bZ={order:100,canRead(Z){return W8(Z.url)},async read(Z){let X,Q=await import("fs");try{X=B1(Z.url)}catch(W){let J=W;throw J.message=`Malformed URI: ${Z.url}: ${J.message}`,new j4(J,Z.url)}if(X.endsWith("/")||X.endsWith("\\"))X=X.slice(0,-1);try{return await Q.promises.readFile(X)}catch(W){let J=W;throw J.message=`Error opening file ${X}: ${J.message}`,new j4(J,X)}}}});async function xW(Z,X,Q){Z=V1(Z);let W=Q||[];W.push(Z.href);try{if(X.safeUrlResolver&&Q8(Z.href))throw Error(`Unsafe URL blocked by safeUrlResolver: ${Z.href}`);let J=await XH(Z,X);if(J.status>=400){let G=Error(`HTTP ERROR ${J.status}`);throw G.status=J.status,G}else if(J.status>=300)if(!Number.isNaN(X.redirects)&&W.length>X.redirects){let G=Error(`Error downloading ${W[0]}.
44
+ `)?"+":R?"":"-";return _+b+`
45
+ `}function Q8(L){return L[L.length-1]===`
46
+ `?L.slice(0,-1):L}function a5(L,T){let _=/(\n+)([^\n]*)/g,R=function(){let c=L.indexOf(`
47
+ `);return c=c!==-1?c:L.length,_.lastIndex=c,t4(L.slice(0,c),T)}(),C=L[0]===`
48
+ `||L[0]===" ",b,k;while(k=_.exec(L)){let c=k[1],h=k[2];b=h[0]===" ",R+=c+(!C&&!b&&h!==""?`
49
+ `:"")+t4(h,T),C=b}return R}function t4(L,T){if(L===""||L[0]===" ")return L;let _=/ [^ ]/g,R,C=0,b,k=0,c=0,h="";while(R=_.exec(L)){if(c=R.index,c-C>T)b=k>C?k:c,h+=`
50
+ `+L.slice(C,b),C=b+1;k=c}if(h+=`
51
+ `,L.length-C>T&&k>C)h+=L.slice(C,k)+`
52
+ `+L.slice(k+1);else h+=L.slice(C);return h.slice(1)}function s5(L){let T="",_=0;for(let R=0;R<L.length;_>=65536?R+=2:R++){_=s4(L,R);let C=r[_];if(!C&&H6(_)){if(T+=L[R],_>=65536)T+=L[R+1]}else T+=C||S0(_)}return T}function W8(L,T,_){let R="",C=L.tag;for(let b=0,k=_.length;b<k;b+=1){let c=_[b];if(L.replacer)c=L.replacer.call(_,String(b),c);if(O(L,T,c,!1,!1)||typeof c>"u"&&O(L,T,null,!1,!1)){if(R!=="")R+=","+(!L.condenseFlow?" ":"");R+=L.dump}}L.tag=C,L.dump="["+R+"]"}function X8(L,T,_,R){let C="",b=L.tag;for(let k=0,c=_.length;k<c;k+=1){let h=_[k];if(L.replacer)h=L.replacer.call(_,String(k),h);if(O(L,T+1,h,!0,!0,!1,!0)||typeof h>"u"&&O(L,T+1,null,!0,!0,!1,!0)){if(!R||C!=="")C+=r4(L,T);if(L.dump&&z===L.dump.charCodeAt(0))C+="-";else C+="- ";C+=L.dump}}L.tag=b,L.dump=C||"[]"}function o5(L,T,_){let R="",C=L.tag,b=Object.keys(_);for(let k=0,c=b.length;k<c;k+=1){let h="";if(R!=="")h+=", ";if(L.condenseFlow)h+='"';let n=b[k],a=_[n];if(L.replacer)a=L.replacer.call(_,n,a);if(!O(L,T,n,!1,!1))continue;if(L.dump.length>1024)h+="? ";if(h+=L.dump+(L.condenseFlow?'"':"")+":"+(L.condenseFlow?"":" "),!O(L,T,a,!1,!1))continue;h+=L.dump,R+=h}L.tag=C,L.dump="{"+R+"}"}function U(L,T,_,R){let C="",b=L.tag,k=Object.keys(_);if(L.sortKeys===!0)k.sort();else if(typeof L.sortKeys==="function")k.sort(L.sortKeys);else if(L.sortKeys)throw new Q("sortKeys must be a boolean or a function");for(let c=0,h=k.length;c<h;c+=1){let n="";if(!R||C!=="")n+=r4(L,T);let a=k[c],Y0=_[a];if(L.replacer)Y0=L.replacer.call(_,a,Y0);if(!O(L,T+1,a,!0,!0,!0))continue;let L0=L.tag!==null&&L.tag!=="?"||L.dump&&L.dump.length>1024;if(L0)if(L.dump&&z===L.dump.charCodeAt(0))n+="?";else n+="? ";if(n+=L.dump,L0)n+=r4(L,T);if(!O(L,T+1,Y0,!0,L0))continue;if(L.dump&&z===L.dump.charCodeAt(0))n+=":";else n+=": ";n+=L.dump,C+=n}L.tag=b,L.dump=C||"{}"}function w(L,T,_){let R=_?L.explicitTypes:L.implicitTypes;for(let C=0,b=R.length;C<b;C+=1){let k=R[C];if((k.instanceOf||k.predicate)&&(!k.instanceOf||typeof T==="object"&&T instanceof k.instanceOf)&&(!k.predicate||k.predicate(T))){if(_)if(k.multi&&k.representName)L.tag=k.representName(T);else L.tag=k.tag;else L.tag="?";if(k.represent){let c=L.styleMap[k.tag]||k.defaultStyle,h;if(X.call(k.represent)==="[object Function]")h=k.represent(T,c);else if(J.call(k.represent,c))h=k.represent[c](T,c);else throw new Q("!<"+k.tag+'> tag resolver accepts not "'+c+'" style');L.dump=h}return!0}}return!1}function O(L,T,_,R,C,b,k){if(L.tag=null,L.dump=_,!w(L,_,!1))w(L,_,!0);let c=X.call(L.dump),h=R;if(R)R=L.flowLevel<0||L.flowLevel>T;let n=c==="[object Object]"||c==="[object Array]",a,Y0;if(n)a=L.duplicates.indexOf(_),Y0=a!==-1;if(L.tag!==null&&L.tag!=="?"||Y0||L.indent!==2&&T>0)C=!1;if(Y0&&L.usedDuplicates[a])L.dump="*ref_"+a;else{if(n&&Y0&&!L.usedDuplicates[a])L.usedDuplicates[a]=!0;if(c==="[object Object]"){if(R&&Object.keys(L.dump).length!==0){if(U(L,T,L.dump,C),Y0)L.dump="&ref_"+a+L.dump}else if(o5(L,T,L.dump),Y0)L.dump="&ref_"+a+" "+L.dump}else if(c==="[object Array]"){if(R&&L.dump.length!==0){if(L.noArrayIndent&&!k&&T>0)X8(L,T-1,L.dump,C);else X8(L,T,L.dump,C);if(Y0)L.dump="&ref_"+a+L.dump}else if(W8(L,T,L.dump),Y0)L.dump="&ref_"+a+" "+L.dump}else if(c==="[object String]"){if(L.tag!=="?")r5(L,L.dump,T,b,h)}else if(c==="[object Undefined]")return!1;else{if(L.skipInvalid)return!1;throw new Q("unacceptable kind of an object to dump "+c)}if(L.tag!==null&&L.tag!=="?"){let L0=encodeURI(L.tag[0]==="!"?L.tag.slice(1):L.tag).replace(/!/g,"%21");if(L.tag[0]==="!")L0="!"+L0;else if(L0.slice(0,18)==="tag:yaml.org,2002:")L0="!!"+L0.slice(18);else L0="!<"+L0+">";L.dump=L0+" "+L.dump}}return!0}function S(L,T){let _=[],R=[];E(L,_,R);let C=R.length;for(let b=0;b<C;b+=1)T.duplicates.push(_[R[b]]);T.usedDuplicates=Array(C)}function E(L,T,_){if(L!==null&&typeof L==="object"){let R=T.indexOf(L);if(R!==-1){if(_.indexOf(R)===-1)_.push(R)}else if(T.push(L),Array.isArray(L))for(let C=0,b=L.length;C<b;C+=1)E(L[C],T,_);else{let C=Object.keys(L);for(let b=0,k=C.length;b<k;b+=1)E(L[C[b]],T,_)}}}function y(L,T){T=T||{};let _=new F0(T);if(!_.noRefs)S(L,_);let R=L;if(_.replacer)R=_.replacer.call({"":R},"",R);if(O(_,0,R,!0,!0))return _.dump+`
53
+ `;return""}return lZ.dump=y,lZ}function PB(){if(OX)return l0;OX=1;let Z=OB(),Q=RB();function W(X,J){return function(){throw Error("Function yaml."+X+" is removed in js-yaml 4. Use yaml."+J+" instead, which is now safe by default.")}}return l0.Type=r0(),l0.Schema=RX(),l0.FAILSAFE_SCHEMA=kX(),l0.JSON_SCHEMA=yX(),l0.CORE_SCHEMA=gX(),l0.DEFAULT_SCHEMA=dZ(),l0.load=Z.load,l0.loadAll=Z.loadAll,l0.dump=Q.dump,l0.YAMLException=Y9(),l0.types={binary:uX(),float:vX(),map:SX(),null:_X(),pairs:lX(),set:dX(),timestamp:fX(),bool:bX(),int:xX(),merge:hX(),omap:mX(),seq:CX(),str:PX()},l0.safeLoad=W("safeLoad","load"),l0.safeLoadAll=W("safeLoadAll","loadAll"),l0.safeDump=W("safeDump","dump"),l0}var l0,w8,N6,WX,DZ,XX,wZ,JX,TZ,GX,jZ,YX,EZ,zX,OZ,$X,RZ,qX,PZ,KX,CZ,UX,SZ,VX,kZ,HX,_Z,BX,bZ,FX,xZ,LX,vZ,AX,yZ,MX,gZ,IX,fZ,NX,hZ,DX,uZ,wX,mZ,TX,jX,lZ,EX,OX,CB,T8,w_,T_,j_,cX,E_,O_,R_,P_,C_,S_,k_,__,b_,x_;var cZ=u(()=>{l0={},w8={},N6={};lZ={};CB=PB(),T8=jB(CB),{Type:w_,Schema:T_,FAILSAFE_SCHEMA:j_,JSON_SCHEMA:cX,CORE_SCHEMA:E_,DEFAULT_SCHEMA:O_,load:R_,loadAll:P_,dump:C_,YAMLException:S_,types:k_,safeLoad:__,safeLoadAll:b_,safeDump:x_}=T8});var pX;var iX=u(()=>{M4();cZ();cZ();pX={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(Z){let Q=Z.data;if(Buffer.isBuffer(Q))Q=Q.toString();if(typeof Q==="string")try{return T8.load(Q,{schema:cX})}catch{try{return T8.load(Q)}catch(W){throw new A4(W?.message||"Parser Error",Z.url)}}else return Q}}});var SB,nX;var rX=u(()=>{M4();SB=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,nX={order:300,allowEmpty:!0,encoding:"utf8",canParse(Z){return(typeof Z.data==="string"||Buffer.isBuffer(Z.data))&&SB.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 A4("data is not text",Z.url)}}});var kB,aX;var sX=u(()=>{kB=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,aX={order:400,allowEmpty:!0,canParse(Z){return Buffer.isBuffer(Z.data)&&kB.test(Z.url)},parse(Z){if(Buffer.isBuffer(Z.data))return Z.data;else return Buffer.from(Z.data)}}});var pZ;var iZ=u(()=>{e0();M4();pZ={order:100,canRead(Z){return V8(Z.url)},async read(Z){let Q,W=await import("fs");try{Q=M1(Z.url)}catch(X){let J=X;throw J.message=`Malformed URI: ${Z.url}: ${J.message}`,new R4(J,Z.url)}if(Q.endsWith("/")||Q.endsWith("\\"))Q=Q.slice(0,-1);try{return await W.promises.readFile(Q)}catch(X){let J=X;throw J.message=`Error opening file ${Q}: ${J.message}`,new R4(J,Q)}}}});async function oX(Z,Q,W){Z=A1(Z);let X=W||[];X.push(Z.href);try{if(Q.safeUrlResolver&&U8(Z.href))throw Error(`Unsafe URL blocked by safeUrlResolver: ${Z.href}`);let J=await _B(Z,Q);if(J.status>=400){let G=Error(`HTTP ERROR ${J.status}`);throw G.status=J.status,G}else if(J.status>=300)if(!Number.isNaN(Q.redirects)&&X.length>Q.redirects){let G=Error(`Error downloading ${X[0]}.
53
54
  Too many redirects:
54
- ${W.join(`
55
- `)}`);throw G.status=J.status,new j4(G)}else{let G=QH(J,"location");if(!G){let z=Error(`HTTP ${J.status} redirect with no location header`);throw z.status=J.status,z}let Y=w0(Z.href,G);return xW(Y,X,W)}else{if(J.body){let G=await J.arrayBuffer();return Buffer.from(G)}return Buffer.alloc(0)}}catch(J){let G=J;throw G.message=`Error downloading ${Z.href}: ${G.message}`,new j4(G,Z.href)}}async function XH(Z,X){let Q,W;if(X.timeout&&typeof AbortController<"u")Q=new AbortController,W=setTimeout(()=>Q.abort(),X.timeout);let J=await fetch(Z,{method:"GET",headers:X.headers||{},credentials:X.withCredentials?"include":"same-origin",redirect:"manual",signal:Q?Q.signal:null});if(W)clearTimeout(W);return J}function QH(Z,X){return Z.headers.get(X)}var xZ;var vZ=c(()=>{a0();B4();xZ={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return jQ(Z.url)&&(!this.safeUrlResolver||!Q8(Z.url))},read(Z){let X=V1(Z.url);if(typeof window<"u"&&!X.protocol)X.protocol=V1(location.href).protocol;return xW(X,this)}}});function fW(Z,X){if(vW(X)){let Q=Object.keys(X).filter((W)=>!["__proto__","constructor","prototype"].includes(W));for(let W=0;W<Q.length;W++){let J=Q[W],G=X[J],Y=Z[J];if(vW(G))Z[J]=fW(Y||{},G);else if(G!==void 0)Z[J]=G}}return Z}function vW(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var yW=()=>{return{parse:{json:{...gQ},yaml:{...PW},text:{...SW},binary:{...bW}},resolve:{file:{...bZ},http:{...xZ},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},gW=(Z)=>{let X=yW();if(Z)fW(X,Z);return X};var yZ=c(()=>{fQ();CW();kW();_W();_Z();vZ()});function WH(Z){let X,Q,W,J,G=Array.prototype.slice.call(Z);if(typeof G[G.length-1]==="function")J=G.pop();if(typeof G[0]==="string")if(X=G[0],typeof G[2]==="object")Q=G[1],W=G[2];else Q=void 0,W=G[1];else X="",Q=G[0],W=G[1];try{W=gW(W)}catch(Y){console.error(`JSON Schema Ref Parser: Error normalizing options: ${Y}`)}if(!W.mutateInputSchema&&typeof Q==="object")Q=JSON.parse(JSON.stringify(Q));return{path:X,schema:Q,options:W,callback:J}}var Z9;var hW=c(()=>{yZ();Z9=WH});function JH(Z,X){if(!X.resolve?.external)return Promise.resolve();try{let Q=Z.$refs._root$Ref.dynamicIdScope?d0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=gZ(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 gZ(Z,X,Q,W,J,G,Y,z){Y||=new Set;let q=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!Y.has(Z)){Y.add(Z);let K=Q;if(I0.isExternal$Ref(Z))q.push(GH(Z,X,K,W,J,G));let V=Object.keys(Z);for(let B of V){let H=s0.join(X,B),F=Z[B],A=W&&F&&typeof F==="object"&&!ArrayBuffer.isView(F)?d0(K,F):K;q=q.concat(gZ(F,H,A,W,J,G,Y,z))}}return q}async function GH(Z,X,Q,W,J,G){let z=G.dereference?.externalReferenceResolution==="root"?f6():W?Q:X,q=w0(z,Z.$ref),K=j0(q),V=J._get$Ref(K);if(V)return Promise.resolve(V.value);try{let B=Z.$ref,H={url:q,baseUrl:z};if(typeof B==="string")H.reference=B;let F=await V8(H,J,G),A=J._get$Ref(K),M=gZ(F,K+"#",K,A?.dynamicIdScope??!1,J,G,new Set,!0);return Promise.all(M)}catch(B){if(!G?.continueOnError||!x4(B))throw B;if(J._$refs[K])B.source=decodeURI(j0(X)),B.path=J8(b4(X));return[]}}var uW;var mW=c(()=>{L1();a1();zZ();a0();B4();h6();uW=JH});function YH(Z,X){let Q=Z.$refs._root$Ref.dynamicIdScope?d0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=[];fZ(Z,"schema",Z.$refs._root$Ref.path+"#",Q,Z.$refs._root$Ref.dynamicIdScope,"#",0,W,Z.$refs,X);let J=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(zH(W,X,J),(X.bundle||{}).optimizeInternalRefs!==!1)KH(W,Z.schema)}function fZ(Z,X,Q,W,J,G,Y,z,q,K){let V=X===null?Z:Z[X],B=K.bundle||{},H=B.excludedPathMatcher||(()=>!1);if(V&&typeof V==="object"&&!ArrayBuffer.isView(V)&&!H(G)){let F=W;if(I0.isAllowed$Ref(V))lW(Z,X,Q,F,J,G,Y,z,q,K);else{let A=Object.keys(V).sort((M,I)=>{if(M==="definitions"||M==="$defs")return-1;else if(I==="definitions"||I==="$defs")return 1;else return M.length-I.length});for(let M of A){let I=s0.join(Q,M),N=s0.join(G,M),T=V[M],S=J&&T&&typeof T==="object"&&!ArrayBuffer.isView(T)?d0(F,T):F;if(I0.isAllowed$Ref(T))lW(V,M,I,S,J,N,Y,z,q,K);else fZ(V,M,I,S,J,N,Y,z,q,K);if(T&&typeof T==="object"&&!Array.isArray(T)){if("$ref"in T)B?.onBundle?.(T.$ref,V[M],V,M)}}}}}function lW(Z,X,Q,W,J,G,Y,z,q,K){let V=X===null?Z:Z[X],B=w0(J?W:Q,V.$ref),H=q._resolve(B,G,K);if(H===null)return;let A=s0.parse(G).length,M=j0(H.path),I=b4(H.path),N=M!==q._root$Ref.path&&!q._aliases[M],T=Boolean(q._aliases[M])&&H.$ref.value!==q._root$Ref.value,S=I0.isExtended$Ref(V);Y+=H.indirections;let v=$H(z,Z,X);if(v)if(A<v.depth||Y<v.indirections)qH(z,v);else return;if(z.push({$ref:V,parent:Z,key:X,pathFromRoot:G,depth:A,file:M,hash:I,value:H.value,circular:H.circular,extended:S,external:N,nestedResource:T,indirections:Y}),!v||N)fZ(H.value,null,H.path,H.$ref.path,H.$ref.dynamicIdScope,G,Y+1,z,q,K)}function zH(Z,X,Q){Z.sort((Y,z)=>{if(Y.file!==z.file)return Y.file<z.file?-1:1;else if(Y.hash!==z.hash)return Y.hash<z.hash?-1:1;else if(Y.circular!==z.circular)return Y.circular?-1:1;else if(Y.extended!==z.extended)return Y.extended?1:-1;else if(Y.indirections!==z.indirections)return Y.indirections-z.indirections;else if(Y.depth!==z.depth)return Y.depth-z.depth;else{let q=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs")),K=Math.max(z.pathFromRoot.lastIndexOf("/definitions"),z.pathFromRoot.lastIndexOf("/$defs"));if(q!==K)return K-q;else return Y.pathFromRoot.length-z.pathFromRoot.length}});let W,J,G;for(let Y of Z){let z=X.bundle||{};if(!Y.external){if(z.optimizeInternalRefs!==!1&&!Y.nestedResource)Y.$ref.$ref=Y.hash}else if(Y.file===W&&Y.hash===J)if(Q&&dW(Z,Y))Y.$ref.$ref=Q+G;else Y.$ref.$ref=G;else if(Y.file===W&&Y.hash.indexOf(J+"/")===0){let q=s0.join(G,s0.parse(Y.hash.replace(J,"#")));if(Q&&dW(Z,Y))Y.$ref.$ref=Q+q;else Y.$ref.$ref=q}else if(W=Y.file,J=Y.hash,G=Y.pathFromRoot,Y.$ref=Y.parent[Y.key]=I0.dereference(Y.$ref,Y.value,X),Y.circular)Y.$ref.$ref=Y.pathFromRoot}}function $H(Z,X,Q){for(let W of Z)if(W&&W.parent===X&&W.key===Q)return W;return}function qH(Z,X){let Q=Z.indexOf(X);Z.splice(Q,1)}function KH(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 J=UH(X,W);if(J!==W)Q.$ref.$ref=J}}function UH(Z,X){if(!X.startsWith("#/"))return X;let Q=X.slice(2).split("/"),W=Z,J=[];for(let Y 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(J.length=0,J.push(...K),W=VH(Z,W.$ref),W===null||W===void 0||typeof W!=="object")return X}let z=Y.replace(/~1/g,"/").replace(/~0/g,"~"),q=Array.isArray(W)?parseInt(z):z;W=W[q],J.push(Y)}return"#/"+J.join("/")}function VH(Z,X){if(!X.startsWith("#/"))return;let Q=X.slice(2).split("/"),W=Z;for(let J of Q){if(W===null||W===void 0||typeof W!=="object")return;let G=J.replace(/~1/g,"/").replace(/~0/g,"~"),Y=Array.isArray(W)?parseInt(G):G;W=W[Y]}return W}function dW(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 cW;var pW=c(()=>{L1();a1();a0();h6();cW=YH});function BH(Z,X){let Q=Date.now(),W=Z.$refs._root$Ref.dynamicIdScope?d0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,J=hZ(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=J.circular,Z.schema=J.value}function hZ(Z,X,Q,W,J,G,Y,z,q,K,V,B){let H,F={value:Z,circular:!1};iW(V,K);let A=K.dereference||{},M=A.maxDepth??500;if(B>M)throw RangeError(`Maximum dereference depth (${M}) exceeded at ${J}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let I=A.excludedPathMatcher||(()=>!1);if(A?.circular==="ignore"||!Y.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!I(J)){G.add(Z),Y.add(Z);let N=Q;if(I0.isAllowed$Ref(Z,K))H=nW(Z,X,N,W,J,G,Y,z,q,K,V,B),F.circular=H.circular,F.value=H.value;else for(let T of Object.keys(Z)){iW(V,K);let S=s0.join(X,T),v=s0.join(J,T);if(I(v))continue;let x=Z[T],p=W&&x&&typeof x==="object"&&!ArrayBuffer.isView(x)?d0(N,x):N,f;if(I0.isAllowed$Ref(x,K)){if(H=nW(x,S,p,W,v,G,Y,z,q,K,V,B),f=H.circular,Z[T]!==H.value){let s=new Map;if(A?.preservedProperties){if(typeof Z[T]==="object"&&!Array.isArray(Z[T]))A?.preservedProperties.forEach((E0)=>{if(E0 in Z[T])s.set(E0,Z[T][E0])})}let K0=H.value;if(A?.cloneReferences&&!f&&K0&&typeof K0==="object")K0=structuredClone(K0);if(Z[T]=K0,A?.preservedProperties){if(s.size&&typeof Z[T]==="object"&&!Array.isArray(Z[T]))s.forEach((E0,f0)=>{Z[T][f0]=E0})}A?.onDereference?.(x.$ref,Z[T],Z,T)}}else if(!G.has(x)){if(H=hZ(x,S,p,W,v,G,Y,z,q,K,V,B+1),f=H.circular,Z[T]!==H.value)Z[T]=H.value}else f=F8(S,q,K);F.circular=F.circular||f}G.delete(Z)}}return F}function nW(Z,X,Q,W,J,G,Y,z,q,K,V,B){let A=I0.isExternal$Ref(Z)&&K?.dereference?.externalReferenceResolution==="root"?f6():W?Q:X,M=w0(A,Z.$ref),I=z.get(M);if(I){if(!I.circular){let p=Object.keys(Z);if(p.length>1){let f={};for(let s of p)if(s!=="$ref"&&!(s in I.value))f[s]=Z[s];return{circular:I.circular,value:Object.assign({},I.value,f)}}return I}if(typeof I.value==="object"&&"$ref"in I.value&&"$ref"in Z){if(I.value.$ref===Z.$ref)return F8(X,q,K),I}else return F8(X,q,K),I}let N=q._resolve(M,X,K);if(N===null)return{circular:!1,value:null};let T=N.circular,S=T||N.chainCircular||G.has(N.value);if(S)F8(X,q,K);let v=I0.dereference(Z,N.value,K);if(!S){let p=hZ(v,N.path,N.$ref.path,N.$ref.dynamicIdScope,J,G,Y,z,q,K,V,B+1);S=p.circular,v=p.value}if(S&&!T&&K.dereference?.circular==="ignore")v=Z;if(T&&v!==Z)v.$ref=J;let x={circular:S,value:v};if(Object.keys(Z).length===1)z.set(M,x);return x}function iW(Z,X){if(X&&X.timeoutMs){if(Date.now()-Z>X.timeoutMs)throw new XZ(X.timeoutMs)}}function F8(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 rW;var aW=c(()=>{L1();a1();a0();h6();B4();rW=BH});function HH(){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 uZ;var sW=c(()=>{uZ=HH()});function Y4(Z,X){if(Z){X.then(function(Q){uZ(function(){Z(null,Q)})},function(Q){uZ(function(){Z(Q)})});return}else return X}var oW=c(()=>{sW()});class o4{schema=null;$refs=new o1;async parse(){let Z=Z9(arguments),X;if(!Z.path&&!Z.schema){let W=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return Y4(Z.callback,Promise.reject(W))}this.schema=null,this.$refs=new o1;let Q="http";if(W8(Z.path))Z.path=PQ(Z.path),Q="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let W=V1(Z.schema.$id),J=W.port??(W.protocol==="https:"?443:80);Z.path=`${W.protocol}//${W.hostname}:${J}`}if(Z.path=w0(f6(),Z.path),Z.schema&&typeof Z.schema==="object"){let W=this.$refs._add(Z.path);W.value=Z.schema,W.pathType=Q,W.dynamicIdScope=$8(W.value),q8(this.$refs,W.path,W.value,W.pathType,W.dynamicIdScope),X=Promise.resolve(Z.schema)}else X=V8(Z.path,this.$refs,Z.options);try{let W=await X;if(W!==null&&typeof W==="object"&&!Buffer.isBuffer(W))return this.schema=W,Y4(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,Y4(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||!x4(W))return Y4(Z.callback,Promise.reject(W));if(this.$refs._$refs[j0(Z.path)])this.$refs._$refs[j0(Z.path)].addError(W);return Y4(Z.callback,Promise.resolve(null))}}static parse(){let Z=new o4;return Z.parse.apply(Z,arguments)}async resolve(){let Z=Z9(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await uW(this,Z.options),mZ(this),Y4(Z.callback,Promise.resolve(this.$refs))}catch(X){return Y4(Z.callback,Promise.reject(X))}}static resolve(){let Z=new o4;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new o4;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=Z9(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),cW(this,Z.options),mZ(this),Y4(Z.callback,Promise.resolve(this.schema))}catch(X){return Y4(Z.callback,Promise.reject(X))}}static dereference(){let Z=new o4;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=Z9(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),rW(this,Z.options),mZ(this),Y4(Z.callback,Promise.resolve(this.schema))}catch(X){return Y4(Z.callback,Promise.reject(X))}}}function mZ(Z){if(H1.getParserErrors(Z).length>0)throw new H1(Z)}var hb,ub,mb,tW;var eW=c(()=>{vQ();zZ();hW();mW();pW();aW();a0();_Z();vZ();B4();oW();h6();yZ();a0();hb=o4.parse,ub=o4.resolve,mb=o4.bundle,tW=o4.dereference});async function X9(Z,X={}){let{baseUrl:Q="/_jx/server"}=X,W=await tW(Z),J=X8(W);if(J.length===0)return null;let G=J.map(({exportName:z,src:q})=>`import { ${z} } from '${q}'`).join(`
56
- `),Y=J.map(({exportName:z})=>ZJ(z,Q)).join(`
55
+ ${X.join(`
56
+ `)}`);throw G.status=J.status,new R4(G)}else{let G=bB(J,"location");if(!G){let z=Error(`HTTP ${J.status} redirect with no location header`);throw z.status=J.status,z}let Y=O0(Z.href,G);return oX(Y,Q,X)}else{if(J.body){let G=await J.arrayBuffer();return Buffer.from(G)}return Buffer.alloc(0)}}catch(J){let G=J;throw G.message=`Error downloading ${Z.href}: ${G.message}`,new R4(G,Z.href)}}async function _B(Z,Q){let W,X;if(Q.timeout&&typeof AbortController<"u")W=new AbortController,X=setTimeout(()=>W.abort(),Q.timeout);let J=await fetch(Z,{method:"GET",headers:Q.headers||{},credentials:Q.withCredentials?"include":"same-origin",redirect:"manual",signal:W?W.signal:null});if(X)clearTimeout(X);return J}function bB(Z,Q){return Z.headers.get(Q)}var nZ;var rZ=u(()=>{e0();M4();nZ={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return mW(Z.url)&&(!this.safeUrlResolver||!U8(Z.url))},read(Z){let Q=A1(Z.url);if(typeof window<"u"&&!Q.protocol)Q.protocol=A1(location.href).protocol;return oX(Q,this)}}});function QJ(Z,Q){if(tX(Q)){let W=Object.keys(Q).filter((X)=>!["__proto__","constructor","prototype"].includes(X));for(let X=0;X<W.length;X++){let J=W[X],G=Q[J],Y=Z[J];if(tX(G))Z[J]=QJ(Y||{},G);else if(G!==void 0)Z[J]=G}}return Z}function tX(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var eX=()=>{return{parse:{json:{...ZX},yaml:{...pX},text:{...nX},binary:{...aX}},resolve:{file:{...pZ},http:{...nZ},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},ZJ=(Z)=>{let Q=eX();if(Z)QJ(Q,Z);return Q};var aZ=u(()=>{QX();iX();rX();sX();iZ();rZ()});function xB(Z){let Q,W,X,J,G=Array.prototype.slice.call(Z);if(typeof G[G.length-1]==="function")J=G.pop();if(typeof G[0]==="string")if(Q=G[0],typeof G[2]==="object")W=G[1],X=G[2];else W=void 0,X=G[1];else Q="",W=G[0],X=G[1];try{X=ZJ(X)}catch(Y){console.error(`JSON Schema Ref Parser: Error normalizing options: ${Y}`)}if(!X.mutateInputSchema&&typeof W==="object")W=JSON.parse(JSON.stringify(W));return{path:Q,schema:W,options:X,callback:J}}var z9;var WJ=u(()=>{aZ();z9=xB});function vB(Z,Q){if(!Q.resolve?.external)return Promise.resolve();try{let W=Z.$refs._root$Ref.dynamicIdScope?n0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,X=sZ(Z.schema,Z.$refs._root$Ref.path+"#",W,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,Q);return Promise.all(X)}catch(W){return Promise.reject(W)}}function sZ(Z,Q,W,X,J,G,Y,z){Y||=new Set;let q=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!Y.has(Z)){Y.add(Z);let K=W;if(w0.isExternal$Ref(Z))q.push(yB(Z,Q,K,X,J,G));let V=Object.keys(Z);for(let H of V){let B=Z4.join(Q,H),F=Z[H],A=X&&F&&typeof F==="object"&&!ArrayBuffer.isView(F)?n0(K,F):K;q=q.concat(sZ(F,B,A,X,J,G,Y,z))}}return q}async function yB(Z,Q,W,X,J,G){let z=G.dereference?.externalReferenceResolution==="root"?d6():X?W:Q,q=O0(z,Z.$ref),K=R0(q),V=J._get$Ref(K);if(V)return Promise.resolve(V.value);try{let H=Z.$ref,B={url:q,baseUrl:z};if(typeof H==="string")B.reference=H;let F=await D8(B,J,G),A=J._get$Ref(K),M=sZ(F,K+"#",K,A?.dynamicIdScope??!1,J,G,new Set,!0);return Promise.all(M)}catch(H){if(!G?.continueOnError||!h4(H))throw H;if(J._$refs[K])H.source=decodeURI(R0(Q)),H.path=H8(g4(Q));return[]}}var XJ;var JJ=u(()=>{D1();W9();NZ();e0();M4();c6();XJ=vB});function gB(Z,Q){let W=Z.$refs._root$Ref.dynamicIdScope?n0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,X=[];oZ(Z,"schema",Z.$refs._root$Ref.path+"#",W,Z.$refs._root$Ref.dynamicIdScope,"#",0,X,Z.$refs,Q);let J=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(fB(X,Q,J),(Q.bundle||{}).optimizeInternalRefs!==!1)mB(X,Z.schema)}function oZ(Z,Q,W,X,J,G,Y,z,q,K){let V=Q===null?Z:Z[Q],H=K.bundle||{},B=H.excludedPathMatcher||(()=>!1);if(V&&typeof V==="object"&&!ArrayBuffer.isView(V)&&!B(G)){let F=X;if(w0.isAllowed$Ref(V))GJ(Z,Q,W,F,J,G,Y,z,q,K);else{let A=Object.keys(V).sort((M,I)=>{if(M==="definitions"||M==="$defs")return-1;else if(I==="definitions"||I==="$defs")return 1;else return M.length-I.length});for(let M of A){let I=Z4.join(W,M),N=Z4.join(G,M),D=V[M],P=J&&D&&typeof D==="object"&&!ArrayBuffer.isView(D)?n0(F,D):F;if(w0.isAllowed$Ref(D))GJ(V,M,I,P,J,N,Y,z,q,K);else oZ(V,M,I,P,J,N,Y,z,q,K);if(D&&typeof D==="object"&&!Array.isArray(D)){if("$ref"in D)H?.onBundle?.(D.$ref,V[M],V,M)}}}}}function GJ(Z,Q,W,X,J,G,Y,z,q,K){let V=Q===null?Z:Z[Q],H=O0(J?X:W,V.$ref),B=q._resolve(H,G,K);if(B===null)return;let A=Z4.parse(G).length,M=R0(B.path),I=g4(B.path),N=M!==q._root$Ref.path&&!q._aliases[M],D=Boolean(q._aliases[M])&&B.$ref.value!==q._root$Ref.value,P=w0.isExtended$Ref(V);Y+=B.indirections;let v=hB(z,Z,Q);if(v)if(A<v.depth||Y<v.indirections)uB(z,v);else return;if(z.push({$ref:V,parent:Z,key:Q,pathFromRoot:G,depth:A,file:M,hash:I,value:B.value,circular:B.circular,extended:P,external:N,nestedResource:D,indirections:Y}),!v||N)oZ(B.value,null,B.path,B.$ref.path,B.$ref.dynamicIdScope,G,Y+1,z,q,K)}function fB(Z,Q,W){Z.sort((Y,z)=>{if(Y.file!==z.file)return Y.file<z.file?-1:1;else if(Y.hash!==z.hash)return Y.hash<z.hash?-1:1;else if(Y.circular!==z.circular)return Y.circular?-1:1;else if(Y.extended!==z.extended)return Y.extended?1:-1;else if(Y.indirections!==z.indirections)return Y.indirections-z.indirections;else if(Y.depth!==z.depth)return Y.depth-z.depth;else{let q=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs")),K=Math.max(z.pathFromRoot.lastIndexOf("/definitions"),z.pathFromRoot.lastIndexOf("/$defs"));if(q!==K)return K-q;else return Y.pathFromRoot.length-z.pathFromRoot.length}});let X,J,G;for(let Y of Z){let z=Q.bundle||{};if(!Y.external){if(z.optimizeInternalRefs!==!1&&!Y.nestedResource)Y.$ref.$ref=Y.hash}else if(Y.file===X&&Y.hash===J)if(W&&YJ(Z,Y))Y.$ref.$ref=W+G;else Y.$ref.$ref=G;else if(Y.file===X&&Y.hash.indexOf(J+"/")===0){let q=Z4.join(G,Z4.parse(Y.hash.replace(J,"#")));if(W&&YJ(Z,Y))Y.$ref.$ref=W+q;else Y.$ref.$ref=q}else if(X=Y.file,J=Y.hash,G=Y.pathFromRoot,Y.$ref=Y.parent[Y.key]=w0.dereference(Y.$ref,Y.value,Q),Y.circular)Y.$ref.$ref=Y.pathFromRoot}}function hB(Z,Q,W){for(let X of Z)if(X&&X.parent===Q&&X.key===W)return X;return}function uB(Z,Q){let W=Z.indexOf(Q);Z.splice(W,1)}function mB(Z,Q){for(let W of Z){if(!W.$ref||typeof W.$ref!=="object"||!("$ref"in W.$ref))continue;let X=W.$ref.$ref;if(typeof X!=="string"||!X.startsWith("#/"))continue;let J=lB(Q,X);if(J!==X)W.$ref.$ref=J}}function lB(Z,Q){if(!Q.startsWith("#/"))return Q;let W=Q.slice(2).split("/"),X=Z,J=[];for(let Y of W){if(X===null||X===void 0||typeof X!=="object")return Q;if("$ref"in X&&typeof X.$ref==="string"&&X.$ref.startsWith("#/")){let K=X.$ref.slice(2).split("/");if(J.length=0,J.push(...K),X=dB(Z,X.$ref),X===null||X===void 0||typeof X!=="object")return Q}let z=Y.replace(/~1/g,"/").replace(/~0/g,"~"),q=Array.isArray(X)?parseInt(z):z;X=X[q],J.push(Y)}return"#/"+J.join("/")}function dB(Z,Q){if(!Q.startsWith("#/"))return;let W=Q.slice(2).split("/"),X=Z;for(let J of W){if(X===null||X===void 0||typeof X!=="object")return;let G=J.replace(/~1/g,"/").replace(/~0/g,"~"),Y=Array.isArray(X)?parseInt(G):G;X=X[Y]}return X}function YJ(Z,Q){for(let W of Z){if(W.pathFromRoot==="#"||W.pathFromRoot==="#/")continue;if(Q.pathFromRoot.startsWith(W.pathFromRoot+"/")){if(W.value&&typeof W.value==="object"&&"$id"in W.value)return!0}}return!1}var zJ;var $J=u(()=>{D1();W9();e0();c6();zJ=gB});function cB(Z,Q){let W=Date.now(),X=Z.$refs._root$Ref.dynamicIdScope?n0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,J=tZ(Z.schema,Z.$refs._root$Ref.path,X,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,Q,W,0);Z.$refs.circular=J.circular,Z.schema=J.value}function tZ(Z,Q,W,X,J,G,Y,z,q,K,V,H){let B,F={value:Z,circular:!1};KJ(V,K);let A=K.dereference||{},M=A.maxDepth??500;if(H>M)throw RangeError(`Maximum dereference depth (${M}) exceeded at ${J}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let I=A.excludedPathMatcher||(()=>!1);if(A?.circular==="ignore"||!Y.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!I(J)){G.add(Z),Y.add(Z);let N=W;if(w0.isAllowed$Ref(Z,K))B=qJ(Z,Q,N,X,J,G,Y,z,q,K,V,H),F.circular=B.circular,F.value=B.value;else for(let D of Object.keys(Z)){KJ(V,K);let P=Z4.join(Q,D),v=Z4.join(J,D);if(I(v))continue;let x=Z[D],p=X&&x&&typeof x==="object"&&!ArrayBuffer.isView(x)?n0(N,x):N,f;if(w0.isAllowed$Ref(x,K)){if(B=qJ(x,P,p,X,v,G,Y,z,q,K,V,H),f=B.circular,Z[D]!==B.value){let s=new Map;if(A?.preservedProperties){if(typeof Z[D]==="object"&&!Array.isArray(Z[D]))A?.preservedProperties.forEach((C0)=>{if(C0 in Z[D])s.set(C0,Z[D][C0])})}let J0=B.value;if(A?.cloneReferences&&!f&&J0&&typeof J0==="object")J0=structuredClone(J0);if(Z[D]=J0,A?.preservedProperties){if(s.size&&typeof Z[D]==="object"&&!Array.isArray(Z[D]))s.forEach((C0,m0)=>{Z[D][m0]=C0})}A?.onDereference?.(x.$ref,Z[D],Z,D)}}else if(!G.has(x)){if(B=tZ(x,P,p,X,v,G,Y,z,q,K,V,H+1),f=B.circular,Z[D]!==B.value)Z[D]=B.value}else f=j8(P,q,K);F.circular=F.circular||f}G.delete(Z)}}return F}function qJ(Z,Q,W,X,J,G,Y,z,q,K,V,H){let A=w0.isExternal$Ref(Z)&&K?.dereference?.externalReferenceResolution==="root"?d6():X?W:Q,M=O0(A,Z.$ref),I=z.get(M);if(I){if(!I.circular){let p=Object.keys(Z);if(p.length>1){let f={};for(let s of p)if(s!=="$ref"&&!(s in I.value))f[s]=Z[s];return{circular:I.circular,value:Object.assign({},I.value,f)}}return I}if(typeof I.value==="object"&&"$ref"in I.value&&"$ref"in Z){if(I.value.$ref===Z.$ref)return j8(Q,q,K),I}else return j8(Q,q,K),I}let N=q._resolve(M,Q,K);if(N===null)return{circular:!1,value:null};let D=N.circular,P=D||N.chainCircular||G.has(N.value);if(P)j8(Q,q,K);let v=w0.dereference(Z,N.value,K);if(!P){let p=tZ(v,N.path,N.$ref.path,N.$ref.dynamicIdScope,J,G,Y,z,q,K,V,H+1);P=p.circular,v=p.value}if(P&&!D&&K.dereference?.circular==="ignore")v=Z;if(D&&v!==Z)v.$ref=J;let x={circular:P,value:v};if(Object.keys(Z).length===1)z.set(M,x);return x}function KJ(Z,Q){if(Q&&Q.timeoutMs){if(Date.now()-Z>Q.timeoutMs)throw new BZ(Q.timeoutMs)}}function j8(Z,Q,W){if(Q.circular=!0,W?.dereference?.onCircular?.(Z),!W.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var UJ;var VJ=u(()=>{D1();W9();e0();c6();M4();UJ=cB});function pB(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(Q){setTimeout(Q,0)}}var eZ;var HJ=u(()=>{eZ=pB()});function U4(Z,Q){if(Z){Q.then(function(W){eZ(function(){Z(null,W)})},function(W){eZ(function(){Z(W)})});return}else return Q}var BJ=u(()=>{HJ()});class X6{schema=null;$refs=new J9;async parse(){let Z=z9(arguments),Q;if(!Z.path&&!Z.schema){let X=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return U4(Z.callback,Promise.reject(X))}this.schema=null,this.$refs=new J9;let W="http";if(V8(Z.path))Z.path=pW(Z.path),W="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let X=A1(Z.schema.$id),J=X.port??(X.protocol==="https:"?443:80);Z.path=`${X.protocol}//${X.hostname}:${J}`}if(Z.path=O0(d6(),Z.path),Z.schema&&typeof Z.schema==="object"){let X=this.$refs._add(Z.path);X.value=Z.schema,X.pathType=W,X.dynamicIdScope=A8(X.value),M8(this.$refs,X.path,X.value,X.pathType,X.dynamicIdScope),Q=Promise.resolve(Z.schema)}else Q=D8(Z.path,this.$refs,Z.options);try{let X=await Q;if(X!==null&&typeof X==="object"&&!Buffer.isBuffer(X))return this.schema=X,U4(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,U4(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||X}" is not a valid JSON Schema`)}catch(X){if(!Z.options.continueOnError||!h4(X))return U4(Z.callback,Promise.reject(X));if(this.$refs._$refs[R0(Z.path)])this.$refs._$refs[R0(Z.path)].addError(X);return U4(Z.callback,Promise.resolve(null))}}static parse(){let Z=new X6;return Z.parse.apply(Z,arguments)}async resolve(){let Z=z9(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await XJ(this,Z.options),Z7(this),U4(Z.callback,Promise.resolve(this.$refs))}catch(Q){return U4(Z.callback,Promise.reject(Q))}}static resolve(){let Z=new X6;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new X6;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=z9(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),zJ(this,Z.options),Z7(this),U4(Z.callback,Promise.resolve(this.schema))}catch(Q){return U4(Z.callback,Promise.reject(Q))}}static dereference(){let Z=new X6;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=z9(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),UJ(this,Z.options),Z7(this),U4(Z.callback,Promise.resolve(this.schema))}catch(Q){return U4(Z.callback,Promise.reject(Q))}}}function Z7(Z){if(I1.getParserErrors(Z).length>0)throw new I1(Z)}var bb,xb,vb,FJ;var LJ=u(()=>{tW();NZ();WJ();JJ();$J();VJ();e0();iZ();rZ();M4();BJ();c6();aZ();e0();bb=X6.parse,xb=X6.resolve,vb=X6.bundle,FJ=X6.dereference});async function $9(Z,Q={}){let{baseUrl:W="/_jx/server"}=Q,X=await FJ(Z),J=K8(X);if(J.length===0)return null;let G=J.map(({exportName:z,src:q})=>`import { ${z} } from '${q}'`).join(`
57
+ `),Y=J.map(({exportName:z})=>AJ(z,W)).join(`
57
58
  `);return`// Generated by @jxsuite/compiler — do not edit manually
58
59
  // Deploy as a Cloudflare Worker, Node server, or Bun process.
59
60
  // Requires: npm install hono
@@ -65,9 +66,9 @@ const app = new Hono()
65
66
  ${Y}
66
67
 
67
68
  export default app
68
- `}function lZ(Z,X={}){let{baseUrl:Q="/_jx/server",adapter:W=null,mounts:J=[],connectors:G=[]}=X;if(Z.length===0&&J.length===0&&!W)return null;let Y=Z.map(({exportName:V,src:B})=>`import { ${V} } from '${B}'`).join(`
69
- `),z=FH(J,G),q=Z.map(({exportName:V})=>ZJ(V,Q)).join(`
70
- `),K=W==="cloudflare-workers"||W==="cloudflare-pages"?`
69
+ `}function Q7(Z,Q={}){let{baseUrl:W="/_jx/server",adapter:X=null,mounts:J=[],connectors:G=[]}=Q;if(Z.length===0&&J.length===0&&!X)return null;let Y=Z.map(({exportName:V,src:H})=>`import { ${V} } from '${H}'`).join(`
70
+ `),z=iB(J,G),q=Z.map(({exportName:V})=>AJ(V,W)).join(`
71
+ `),K=X==="cloudflare-workers"||X==="cloudflare-pages"?`
71
72
  app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
72
73
  `:`
73
74
  `;return`// Generated by @jxsuite/compiler — do not edit manually
@@ -78,28 +79,28 @@ const app = new Hono()
78
79
  ${z.routes}${q}
79
80
  ${K}
80
81
  export default app
81
- `}function FH(Z,X){if(Z.length===0)return{imports:"",routes:""};let Q=Z.toSorted((G,Y)=>G.order-Y.order),W=[];for(let G of Q)W.push(`import { ${G.className} } from '${G.module}'`);for(let G of X)W.push(`import { ${G.className} } from '${G.module}'`);let J=["// Extension server mounts (specs/extensions.md §11): one shared ctx, mounted in order.","const jxCtx = {}",`const jxConnectors = { ${X.map((G)=>`${JSON.stringify(G.provider)}: ${G.className}`).join(", ")} }`];for(let[G,Y]of Q.entries()){let z=JSON.stringify(Y.options);J.push(`const jxMount${G} = await ${Y.className}.mount({ ...${z}, connectors: jxConnectors }, jxCtx)`,`app.all('${Y.basePath}/*', (c) => jxMount${G}(c.req.raw, c.env))`,`app.all('${Y.basePath}', (c) => jxMount${G}(c.req.raw, c.env))`)}return{imports:`
82
- ${W.join(`
82
+ `}function iB(Z,Q){if(Z.length===0)return{imports:"",routes:""};let W=Z.toSorted((G,Y)=>G.order-Y.order),X=[];for(let G of W)X.push(`import { ${G.className} } from '${G.module}'`);for(let G of Q)X.push(`import { ${G.className} } from '${G.module}'`);let J=["// Extension server mounts (specs/extensions.md §11): one shared ctx, mounted in order.","const jxCtx = {}",`const jxConnectors = { ${Q.map((G)=>`${JSON.stringify(G.provider)}: ${G.className}`).join(", ")} }`];for(let[G,Y]of W.entries()){let z=JSON.stringify(Y.options);J.push(`const jxMount${G} = await ${Y.className}.mount({ ...${z}, connectors: jxConnectors }, jxCtx)`,`app.all('${Y.basePath}/*', (c) => jxMount${G}(c.req.raw, c.env))`,`app.all('${Y.basePath}', (c) => jxMount${G}(c.req.raw, c.env))`)}return{imports:`
83
+ ${X.join(`
83
84
  `)}`,routes:`${J.join(`
84
85
  `)}
85
- `}}function ZJ(Z,X){return`
86
- app.post('${X}/${Z}', async (c) => {
86
+ `}}function AJ(Z,Q){return`
87
+ app.post('${Q}/${Z}', async (c) => {
87
88
  const args = await c.req.json().catch(() => ({}))
88
89
  try {
89
90
  return c.json(await ${Z}(args, c.env))
90
91
  } catch (e) {
91
92
  return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
92
93
  }
93
- })`}var dZ=c(()=>{eW();B6()});function F6(Z){return Z instanceof Error?Z.message:String(Z)}function cZ(Z,X,Q){let W;try{W=JSON.parse(Z)}catch(J){throw Error(`Failed to parse ${Q} at ${X}: ${F6(J)}`,{cause:J})}if(!W4(W))throw Error(`Invalid ${Q} at ${X}: expected a JSON object`);return W}function L6(Z,X){return cZ(Z,X,"Jx document")}function XJ(Z,X){return cZ(Z,X,"project config")}function QJ(Z,X){return cZ(Z,X,"class definition")}var A6=c(()=>{k4()});class L8{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;project;server;connector;capabilities;#Z;#X=null;constructor(Z,X,Q,W){this.name=Z,this.classPath=X,this.classDef=Q,this.#Z=W;let{format:J}=Q;this.extensions=(J?.extensions??[]).map((G)=>G.toLowerCase()),this.mediaType=J?.mediaType??null,this.documentKinds=J?.documentKinds??[],this.exportTarget=J?.exportTarget===!0,this.remote=J?.remote===!0,this.studio=Q.$studio??null,this.project=Q.project??null,this.server=Q.server??null,this.connector=Q.connector??null,this.capabilities=AH(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(),J=this.classDef.title??this.name,G=W[J]??W.default?.[J]??W.default,Y=G?.[Q.identifier];if(typeof Y!=="function")throw TypeError(`Format class "${this.name}": implementation export "${J}" has no static "${Q.identifier}" method`);return await Y.call(G,...X)}}class A8{#Z;constructor(Z){this.#Z=Z;for(let X of JJ){let Q=new Map;for(let W of Z){if(!W.capabilities[X])continue;for(let J of W.extensions){let G=Q.get(J);if(G)throw Error(`Format conflict: "${G.name}" and "${W.name}" both claim "${J}" with the "${X}" capability`);Q.set(J,W)}}}}get entries(){return this.#Z}byExtension(Z,X){let Q=WJ(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=WJ(Z);return this.#Z.some((Q)=>Q.extensions.includes(X))}}function AH(Z){let X={},Q=Z.$defs?.methods??{};for(let[W,J]of Object.entries(Q)){let G=J.role;if(!G||!GJ.includes(G))continue;let Y={identifier:J.identifier??W,timing:J.timing??LH};if(typeof J.discriminator==="string")Y.discriminator=J.discriminator;X[G]=Y}return X}function WJ(Z){let X=Z.toLowerCase();return X.startsWith(".")?X:`.${X}`}var JJ,GJ,LH;var pZ=c(()=>{JJ=["parse","serialize","discover","load"],GJ=[...JJ,"projectData","resolvePaths","lower","mount","dialect","deploySchema","bindings","testConnection"],LH=["compiler","server"]});class YJ{#Z;#X;#Q;constructor(Z){this.#Z=Z,this.#X=Z.flatMap((J)=>J.classes);let X=new Map;for(let J of Z)for(let G of J.classes){let Y=X.get(G.name);if(Y&&Y!==J.specifier)throw Error(`Extension conflict: "${Y}" and "${J.specifier}" both provide a class named "${G.name}"`);X.set(G.name,J.specifier)}let Q=new Map;for(let J of this.#X){if(!J.project)continue;let G=Q.get(J.project.key);if(G)throw Error(`Extension conflict: "${G.name}" and "${J.name}" both claim the project section "${J.project.key}"`);Q.set(J.project.key,J)}let W=new Map;for(let J of this.#X){if(!J.server)continue;let{basePath:G}=J.server;if(!G.startsWith("/_jx/"))throw Error(`Extension "${J.name}": server basePath "${G}" must be under /_jx/`);let Y=W.get(G);if(Y)throw Error(`Extension conflict: "${Y.name}" and "${J.name}" both mount "${G}"`);W.set(G,J)}this.#Q=new A8(this.#X.filter((J)=>J.extensions.length>0))}get extensions(){return this.#Z}get classes(){return this.#X}get formats(){return this.#Q}byName(Z){return this.#X.find((X)=>X.name===Z)}projectContributions(){return this.#X.filter((Z)=>Z.project!==null)}byProjectKey(Z){return this.#X.find((X)=>X.project?.key===Z)}byPathsDiscriminator(Z){return this.#X.find((X)=>X.capabilities.resolvePaths?.discriminator===Z)}serverMounts(){return this.#X.filter((Z)=>Z.server!==null).toSorted((Z,X)=>(Z.server?.order??100)-(X.server?.order??100)||Z.name.localeCompare(X.name))}connectors(){return this.#X.filter((Z)=>Z.connector!==null)}schemaFragments(Z){return this.#Z.map((X)=>X.schemas[Z]).filter((X)=>typeof X==="string")}}async function zJ(Z,X,Q){let W=[];for(let J of Z??[])W.push(await MH(J,X,Q));return new YJ(W)}async function MH(Z,X,Q){let W;if(Z.startsWith("./")||Z.startsWith("../")){let z=X.resolvePath(Q,Z);W=X.resolvePath(`${z}/package.json`,`./${M8}`)}else try{W=X.resolvePath(Q,`${Z}/${M8}`)}catch(z){throw Error(`Extension "${Z}" is not resolvable: it must export ${M8} (is the package installed, and does its exports map include it?): ${nZ(z)}`,{cause:z})}let J;try{J=await X.loadJson(W)}catch(z){throw Error(`Extension "${Z}": cannot read manifest ${W}: ${nZ(z)}`,{cause:z})}if(!J||typeof J!=="object"||typeof J.name!=="string")throw Error(`Extension "${Z}": ${M8} must declare a "name"`);if(!Z.startsWith(".")&&J.name!==Z)throw Error(`Extension "${Z}": manifest name "${J.name}" does not match the specifier`);let G=[];for(let[z,q]of Object.entries(J.classes??{})){let K=X.resolvePath(W,q),V;try{V=await X.loadJson(K)}catch(B){throw Error(`Extension "${Z}": cannot read class "${z}" at ${K}: ${nZ(B)}`,{cause:B})}G.push(new L8(z,K,V,X))}let Y={};if(J.schemas?.project)Y.project=X.resolvePath(W,J.schemas.project);if(J.schemas?.document)Y.document=X.resolvePath(W,J.schemas.document);if(J.schemas?.fields)Y.fields=X.resolvePath(W,J.schemas.fields);return{specifier:Z,manifestPath:W,manifest:J,classes:G,schemas:Y}}function nZ(Z){return Z instanceof Error?Z.message:String(Z)}var M8="jx-extension.json";var $J=c(()=>{pZ();pZ()});var rZ={};x6(rZ,{unknownFormatError:()=>jH,importImplementation:()=>N8,createNodeFormatIO:()=>D8,buildProjectFormatRegistry:()=>TH,buildProjectExtensionRegistry:()=>M6,buildExtensionsPayload:()=>wH});import{readFileSync as KJ}from"node:fs";import{dirname as IH,isAbsolute as NH,resolve as iZ,sep as I8}from"node:path";import{pathToFileURL as DH}from"node:url";import{createRequire as qJ}from"node:module";async function N8(Z){let X=[Z],Q=`${I8}src${I8}`,W=`${I8}dist${I8}`;if(Z.includes(Q))X.push(Z.replace(Q,W));if(Z.endsWith(".js"))X.push(`${Z.slice(0,-3)}.ts`);let J;for(let G of X)try{return await import(DH(G).href)}catch(Y){J=Y}throw J instanceof Error?J:Error(String(J))}function D8(Z){return{importModule:(X)=>N8(X),loadJson:async(X)=>JSON.parse(KJ(X,"utf8")),resolvePath:(X,Q)=>{if(Q.startsWith("./")||Q.startsWith("../"))return iZ(IH(X),Q);if(NH(Q))return Q;let W=qJ(iZ(Z,"package.json"));try{return W.resolve(Q)}catch{return qJ(import.meta.url).resolve(Q)}}}}async function M6(Z,X){return zJ(X?.extensions,D8(Z),iZ(Z,"project.json"))}async function TH(Z,X){return(await M6(Z,X)).formats}function wH(Z){let X=[];for(let Q of Z.extensions){let W={};if(Q.schemas.project)try{W=JSON.parse(KJ(Q.schemas.project,"utf8")).properties??{}}catch{W={}}let J=[];for(let G of Q.classes){if(!G.project)continue;J.push({className:G.name,entrySchema:W[G.project.key]??null,project:G.project,studio:G.studio})}X.push({classes:Q.classes.map((G)=>{let Y=G.studio?.stateDefaults,z=G.project===null&&G.server===null&&G.connector===null&&G.extensions.length===0;return{name:G.name,path:G.classPath,...z?{state:!0}:{},...Y&&typeof Y==="object"?{stateDefaults:Y}:{}}}),contributions:J,name:Q.manifest.name,specifier:Q.specifier,...Q.manifest.title===void 0?{}:{title:Q.manifest.title},...Q.manifest.description===void 0?{}:{description:Q.manifest.description}})}return X}function jH(Z,X){return Error(`No format class registered for "${X}" (${Z}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`)}var I6=c(()=>{$J()});async function w8(Z,X={}){let{resolveElementPath:Q,$media:W,formats:J}=X,G=[],Y=new Set;async function z(q,K){let V,B;if(typeof q==="string"){let{readFileSync:S}=await import("node:fs"),{resolve:v}=await import("node:path");if(B=K?v(K,q):v(q),Y.has(B))return;if(Y.add(B),B.endsWith(".json"))V=L6(S(B,"utf8"),B);else{let{extname:x}=await import("node:path"),p=x(B).toLowerCase(),f=J?.byExtension?.(p,"parse");if(!f){let{unknownFormatError:s}=await Promise.resolve().then(() => (I6(),rZ));throw s(B,p)}V=await f.call("parse",S(B,"utf8"))}}else{if(V=q,B=null,V.tagName&&Y.has(V.tagName))return;if(V.tagName)Y.add(V.tagName)}let{tagName:H}=V;if(!H||!H.includes("-"))throw Error(`compileElement: tagName "${H}" must contain a hyphen`);let{dirname:F}=await import("node:path"),A=B?F(B):null,M=[];if(Array.isArray(V.$elements))for(let S of V.$elements){let v=J4(S)?S.$ref:S;if(typeof v!=="string")continue;if(A)await z(v,A);let x=Q?Q(v,A):v.replace(/\.json$/,".js");M.push(x)}let I=Z8(H);if(W)V.$media={...W,...V.$media};let N=Q9(V,I,M),T=B?B.replace(/\.json$/,".js"):`${H}.js`;G.push({content:N,path:T,tagName:H})}return await z(Z,X.basePath??null),{files:G}}async function OH(Z,X={}){let{title:Q="Jx App",reactivitySrc:W="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:J="https://esm.sh/lit-html@3.3.0"}=X,G=await w8(Z,X),Y=G.files.at(-1);if(!Y)throw Error("compileElementPage: no element modules were produced");let{basename:z}=await import("node:path"),q=z(Y.path),K=`<!DOCTYPE html>
94
+ })`}var W7=u(()=>{LJ();I6()});function D6(Z){return Z instanceof Error?Z.message:String(Z)}function X7(Z,Q,W){let X;try{X=JSON.parse(Z)}catch(J){throw Error(`Failed to parse ${W} at ${Q}: ${D6(J)}`,{cause:J})}if(!$4(X))throw Error(`Invalid ${W} at ${Q}: expected a JSON object`);return X}function w6(Z,Q){return X7(Z,Q,"Jx document")}function MJ(Z,Q){return X7(Z,Q,"project config")}function IJ(Z,Q){return X7(Z,Q,"class definition")}var T6=u(()=>{y4()});class E8{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;project;server;connector;capabilities;#Z;#Q=null;constructor(Z,Q,W,X){this.name=Z,this.classPath=Q,this.classDef=W,this.#Z=X;let{format:J}=W;this.extensions=(J?.extensions??[]).map((G)=>G.toLowerCase()),this.mediaType=J?.mediaType??null,this.documentKinds=J?.documentKinds??[],this.exportTarget=J?.exportTarget===!0,this.remote=J?.remote===!0,this.studio=W.$studio??null,this.project=W.project??null,this.server=W.server??null,this.connector=W.connector??null,this.capabilities=rB(W)}implementation(){if(!this.#Q){let Z=this.classDef.$implementation;if(!Z)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#Q=this.#Z.importModule(this.#Z.resolvePath(this.classPath,Z))}return this.#Q}async call(Z,...Q){let W=this.capabilities[Z];if(!W)throw Error(`Format class "${this.name}" does not declare a "${Z}" capability`);let X=await this.implementation(),J=this.classDef.title??this.name,G=X[J]??X.default?.[J]??X.default,Y=G?.[W.identifier];if(typeof Y!=="function")throw TypeError(`Format class "${this.name}": implementation export "${J}" has no static "${W.identifier}" method`);return await Y.call(G,...Q)}}class O8{#Z;constructor(Z){this.#Z=Z;for(let Q of DJ){let W=new Map;for(let X of Z){if(!X.capabilities[Q])continue;for(let J of X.extensions){let G=W.get(J);if(G)throw Error(`Format conflict: "${G.name}" and "${X.name}" both claim "${J}" with the "${Q}" capability`);W.set(J,X)}}}}get entries(){return this.#Z}byExtension(Z,Q){let W=NJ(Z);return this.#Z.find((X)=>X.extensions.includes(W)&&(!Q||X.capabilities[Q]))}byName(Z){return this.#Z.find((Q)=>Q.name===Z)}withCapability(Z){return this.#Z.filter((Q)=>Q.capabilities[Z])}documentExtensions(Z){let Q=new Set;for(let W of this.#Z){if(Z&&!W.documentKinds.includes(Z))continue;for(let X of W.extensions)Q.add(X)}return Q.delete(".json"),[...Q]}has(Z){let Q=NJ(Z);return this.#Z.some((W)=>W.extensions.includes(Q))}}function rB(Z){let Q={},W=Z.$defs?.methods??{};for(let[X,J]of Object.entries(W)){let G=J.role;if(!G||!wJ.includes(G))continue;let Y={identifier:J.identifier??X,timing:J.timing??nB};if(typeof J.discriminator==="string")Y.discriminator=J.discriminator;Q[G]=Y}return Q}function NJ(Z){let Q=Z.toLowerCase();return Q.startsWith(".")?Q:`.${Q}`}var DJ,wJ,nB;var J7=u(()=>{DJ=["parse","serialize","discover","load"],wJ=[...DJ,"projectData","resolvePaths","lower","mount","dialect","deploySchema","bindings","testConnection"],nB=["compiler","server"]});class TJ{#Z;#Q;#W;constructor(Z){this.#Z=Z,this.#Q=Z.flatMap((J)=>J.classes);let Q=new Map;for(let J of Z)for(let G of J.classes){let Y=Q.get(G.name);if(Y&&Y!==J.specifier)throw Error(`Extension conflict: "${Y}" and "${J.specifier}" both provide a class named "${G.name}"`);Q.set(G.name,J.specifier)}let W=new Map;for(let J of this.#Q){if(!J.project)continue;let G=W.get(J.project.key);if(G)throw Error(`Extension conflict: "${G.name}" and "${J.name}" both claim the project section "${J.project.key}"`);W.set(J.project.key,J)}let X=new Map;for(let J of this.#Q){if(!J.server)continue;let{basePath:G}=J.server;if(!G.startsWith("/_jx/"))throw Error(`Extension "${J.name}": server basePath "${G}" must be under /_jx/`);let Y=X.get(G);if(Y)throw Error(`Extension conflict: "${Y.name}" and "${J.name}" both mount "${G}"`);X.set(G,J)}this.#W=new O8(this.#Q.filter((J)=>J.extensions.length>0))}get extensions(){return this.#Z}get classes(){return this.#Q}get formats(){return this.#W}byName(Z){return this.#Q.find((Q)=>Q.name===Z)}projectContributions(){return this.#Q.filter((Z)=>Z.project!==null)}byProjectKey(Z){return this.#Q.find((Q)=>Q.project?.key===Z)}byPathsDiscriminator(Z){return this.#Q.find((Q)=>Q.capabilities.resolvePaths?.discriminator===Z)}serverMounts(){return this.#Q.filter((Z)=>Z.server!==null).toSorted((Z,Q)=>(Z.server?.order??100)-(Q.server?.order??100)||Z.name.localeCompare(Q.name))}connectors(){return this.#Q.filter((Z)=>Z.connector!==null)}schemaFragments(Z){return this.#Z.map((Q)=>Q.schemas[Z]).filter((Q)=>typeof Q==="string")}}async function jJ(Z,Q,W){let X=[];for(let J of Z??[])X.push(await aB(J,Q,W));return new TJ(X)}async function aB(Z,Q,W){let X;if(Z.startsWith("./")||Z.startsWith("../")){let z=Q.resolvePath(W,Z);X=Q.resolvePath(`${z}/package.json`,`./${R8}`)}else try{X=Q.resolvePath(W,`${Z}/${R8}`)}catch(z){throw Error(`Extension "${Z}" is not resolvable: it must export ${R8} (is the package installed, and does its exports map include it?): ${G7(z)}`,{cause:z})}let J;try{J=await Q.loadJson(X)}catch(z){throw Error(`Extension "${Z}": cannot read manifest ${X}: ${G7(z)}`,{cause:z})}if(!J||typeof J!=="object"||typeof J.name!=="string")throw Error(`Extension "${Z}": ${R8} must declare a "name"`);if(!Z.startsWith(".")&&J.name!==Z)throw Error(`Extension "${Z}": manifest name "${J.name}" does not match the specifier`);let G=[];for(let[z,q]of Object.entries(J.classes??{})){let K=Q.resolvePath(X,q),V;try{V=await Q.loadJson(K)}catch(H){throw Error(`Extension "${Z}": cannot read class "${z}" at ${K}: ${G7(H)}`,{cause:H})}G.push(new E8(z,K,V,Q))}let Y={};if(J.schemas?.project)Y.project=Q.resolvePath(X,J.schemas.project);if(J.schemas?.document)Y.document=Q.resolvePath(X,J.schemas.document);if(J.schemas?.fields)Y.fields=Q.resolvePath(X,J.schemas.fields);return{specifier:Z,manifestPath:X,manifest:J,classes:G,schemas:Y}}function G7(Z){return Z instanceof Error?Z.message:String(Z)}var R8="jx-extension.json";var EJ=u(()=>{J7();J7()});var z7={};e4(z7,{unknownFormatError:()=>QF,importImplementation:()=>C8,createNodeFormatIO:()=>S8,buildProjectFormatRegistry:()=>eB,buildProjectExtensionRegistry:()=>j6,buildExtensionsPayload:()=>ZF});import{readFileSync as RJ}from"node:fs";import{dirname as sB,isAbsolute as oB,resolve as Y7,sep as P8}from"node:path";import{pathToFileURL as tB}from"node:url";import{createRequire as OJ}from"node:module";async function C8(Z){let Q=[Z],W=`${P8}src${P8}`,X=`${P8}dist${P8}`;if(Z.includes(W))Q.push(Z.replace(W,X));if(Z.endsWith(".js"))Q.push(`${Z.slice(0,-3)}.ts`);let J;for(let G of Q)try{return await import(tB(G).href)}catch(Y){J=Y}throw J instanceof Error?J:Error(String(J))}function S8(Z){return{importModule:(Q)=>C8(Q),loadJson:async(Q)=>JSON.parse(RJ(Q,"utf8")),resolvePath:(Q,W)=>{if(W.startsWith("./")||W.startsWith("../"))return Y7(sB(Q),W);if(oB(W))return W;let X=OJ(Y7(Z,"package.json"));try{return X.resolve(W)}catch{return OJ(import.meta.url).resolve(W)}}}}async function j6(Z,Q){return jJ(Q?.extensions,S8(Z),Y7(Z,"project.json"))}async function eB(Z,Q){return(await j6(Z,Q)).formats}function ZF(Z){let Q=[];for(let W of Z.extensions){let X={};if(W.schemas.project)try{X=JSON.parse(RJ(W.schemas.project,"utf8")).properties??{}}catch{X={}}let J=[];for(let G of W.classes){if(!G.project)continue;J.push({className:G.name,entrySchema:X[G.project.key]??null,project:G.project,studio:G.studio})}Q.push({classes:W.classes.map((G)=>{let Y=G.studio?.stateDefaults,z=G.project===null&&G.server===null&&G.connector===null&&G.extensions.length===0;return{name:G.name,path:G.classPath,...z?{state:!0}:{},...Y&&typeof Y==="object"?{stateDefaults:Y}:{}}}),contributions:J,name:W.manifest.name,specifier:W.specifier,...W.manifest.title===void 0?{}:{title:W.manifest.title},...W.manifest.description===void 0?{}:{description:W.manifest.description}})}return Q}function QF(Z,Q){return Error(`No format class registered for "${Q}" (${Z}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`)}var E6=u(()=>{EJ()});async function _8(Z,Q={}){let{resolveElementPath:W,$media:X,formats:J}=Q,G=[],Y=new Set;async function z(q,K){let V,H;if(typeof q==="string"){let{readFileSync:P}=await import("node:fs"),{resolve:v}=await import("node:path");if(H=K?v(K,q):v(q),Y.has(H))return;if(Y.add(H),H.endsWith(".json"))V=w6(P(H,"utf8"),H);else{let{extname:x}=await import("node:path"),p=x(H).toLowerCase(),f=J?.byExtension?.(p,"parse");if(!f){let{unknownFormatError:s}=await Promise.resolve().then(() => (E6(),z7));throw s(H,p)}V=await f.call("parse",P(H,"utf8"))}}else{if(V=q,H=null,V.tagName&&Y.has(V.tagName))return;if(V.tagName)Y.add(V.tagName)}let{tagName:B}=V;if(!B||!B.includes("-"))throw Error(`compileElement: tagName "${B}" must contain a hyphen`);let{dirname:F}=await import("node:path"),A=H?F(H):null,M=[];if(Array.isArray(V.$elements))for(let P of V.$elements){let v=q4(P)?P.$ref:P;if(typeof v!=="string")continue;if(A)await z(v,A);let x=W?W(v,A):v.replace(/\.json$/,".js");M.push(x)}let I=q8(B);if(X)V.$media={...X,...V.$media};let N=q9(V,I,M),D=H?H.replace(/\.json$/,".js"):`${B}.js`;G.push({content:N,path:D,tagName:B})}return await z(Z,Q.basePath??null),{files:G}}async function WF(Z,Q={}){let{title:W="Jx App",reactivitySrc:X="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:J="https://esm.sh/lit-html@3.3.0"}=Q,G=await _8(Z,Q),Y=G.files.at(-1);if(!Y)throw Error("compileElementPage: no element modules were produced");let{basename:z}=await import("node:path"),q=z(Y.path),K=`<!DOCTYPE html>
94
95
  <html lang="en">
95
96
  <head>
96
97
  <meta charset="utf-8">
97
98
  <meta name="viewport" content="width=device-width, initial-scale=1">
98
- <title>${$0(Q)}</title>
99
+ <title>${q0(W)}</title>
99
100
  <script type="importmap">
100
101
  {
101
102
  "imports": {
102
- "@vue/reactivity": "${W}",
103
+ "@vue/reactivity": "${X}",
103
104
  "lit-html": "${J}"
104
105
  }
105
106
  }
@@ -109,54 +110,56 @@ app.post('${X}/${Z}', async (c) => {
109
110
  <${Y.tagName}></${Y.tagName}>
110
111
  <script type="module" src="./${q}"></script>
111
112
  </body>
112
- </html>`;return{files:G.files,html:K}}function EH(Z){if(Z===null||typeof Z!=="object"||Array.isArray(Z))return JSON.stringify(Z);if("default"in Z)return JSON.stringify(Z.default);if(q6(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 Q9(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 J=new Map,G=Z.state??{};for(let[B,H]of Object.entries(G)){let F=H;if(F&&typeof F==="object"&&!Array.isArray(F)&&F.$prototype==="Function"&&F.$src){let A=F.$src;if(!J.has(A))J.set(A,[]);J.get(A).push(B)}}for(let[B,H]of J)W.push(`import { ${H.join(", ")} } from '${B}';`);W.push("import { reactive, computed, effect } from '@vue/reactivity';","import { render, html } from 'lit-html';","",`class ${X} extends HTMLElement {`," #dispose = null;",""," constructor() {"," super();");let Y=[],z=[],q=[];for(let[B,H]of Object.entries(G)){let F=H;if(T4(F)){let A=F.$expression;if($6(A.operator))q.push([B,F]);else z.push([B,F])}else if(a4(F))if(typeof F.body==="string"&&F.body.includes("return"))z.push([B,F]);else q.push([B,F]);else{let A=EH(F);if(A!==void 0)Y.push([B,A])}}W.push(" this.state = reactive({");for(let[B,H]of Y)W.push(` ${B}: ${H},`);W.push(" });");for(let[B,H]of q)if(W.push(""),T4(H)){let F=U4(H.$expression,{eventParam:"e",statePrefix:"s"});W.push(` this.state.${B} = (s, e) => { ${F}; };`)}else{let A=(H.parameters?K6(H.parameters):H.arguments??["state"]).join(", ");if(H.$src)W.push(` this.state.${B} = (${A}) => ${B}(${A});`);else W.push(` this.state.${B} = (${A}) => {`,` ${H.body??""}`," };")}for(let[B,H]of z)if(W.push(""),T4(H)){let F=U4(H.$expression,{eventParam:"e",statePrefix:"this.state"});W.push(` this.state.${B} = computed(() => ${F});`)}else if(H.$src)W.push(` this.state.${B} = computed(() => ${B}(this.state));`);else{W.push(` this.state.${B} = computed(() => {`);let F=(H.body??"").replaceAll("state.","this.state.");W.push(` ${F}`," });")}W.push(" }","");let K=[];if(Array.isArray(Z.children)){let B={n:0};for(let H of Z.children)V6(H,K,Z.$media??{},"",B,Z.tagName)}if(W.push(" template() {"," const s = this.state;"," return html`",sZ(Z.children,Z.style," ")," `;"," }",""," connectedCallback() {"," const _pa = this.getAttribute('data-jx-props');"," if (_pa) {"," try {"," const _p = JSON.parse(_pa);"," for (const [k, v] of Object.entries(_p)) {"," if (k in this.state) this.state[k] = v;"," }"," } catch {}"," this.removeAttribute('data-jx-props');"," }"," for (const key of Object.keys(this.state)) {"," if (this.hasOwnProperty(key) && this[key] !== undefined) {"," this.state[key] = this[key];"," }"," }"),Z.style&&typeof Z.style==="object"){let B=[];for(let[H,F]of Object.entries(Z.style)){if(H.startsWith(":")||H.startsWith(".")||H.startsWith("&")||H.startsWith("[")||H.startsWith("@"))continue;if(F===null||typeof F==="object")continue;let A=r0(H);if(typeof F==="string"&&F.includes("${"))B.push([A,F])}if(B.length>0){W.push(" effect(() => {");for(let[H,F]of B){let A=F.replaceAll(/\$\{([^}]+)\}/g,(M,I)=>`\${${I.replaceAll("state.","this.state.")}}`);W.push(` this.style['${H}'] = \`${A}\`;`)}W.push(" });")}}let V=HJ(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')) {"," this.removeAttribute('data-jx-prerendered');"," }"," this.innerHTML = '';"," this.#dispose = effect(() => render(this.template(), this));"),V)W.push(" const _slot = this.querySelector('slot');"," if (_slot && _slotted.length > 0) {"," for (const n of _slotted) _slot.before(n);"," _slot.remove();"," }");return W.push(" }",""," disconnectedCallback() {"," if (this.#dispose) { this.#dispose(); this.#dispose = null; }"," }","}","",`customElements.define('${Z.tagName}', ${X});`,""),W.join(`
113
- `)}function sZ(Z,X,Q){if(!Z)return"";if(x0(Z))return UJ(Z,Q);if(!Array.isArray(Z))return"";return Z.map((W)=>x0(W)?UJ(W,Q):VJ(W,Q)).join(`
114
- `)}function VJ(Z,X){if(typeof Z==="string"){if(Z.includes("${"))return`${X}${aZ(Z)}`;return`${X}${$0(Z)}`}if(typeof Z==="number"||typeof Z==="boolean")return`${X}${$0(String(Z))}`;if(!Z||typeof Z!=="object")return"";let Q=Z.tagName??"div",W=[];if(Z.attributes)for(let[q,K]of Object.entries(Z.attributes))if(K&&typeof K==="object"&&J4(K))W.push(`${q}="\${${t4(K.$ref)}}"`);else if(typeof K==="string"&&K.includes("${"))W.push(`${q}="${T8(K)}"`);else W.push(`${q}="${K}"`);if(Z.id)W.push(`id="${Z.id}"`);if(Z.className)W.push(`class="${Z.className}"`);for(let[q,K]of Object.entries(Z)){if(U6.has(q)||q.startsWith("$")||q.startsWith("on")||q==="tagName"||q==="id"||q==="className"||q==="style"||q==="children"||q==="textContent"||q==="innerHTML"||q==="attributes")continue;if(K&&typeof K==="object"&&K.$ref)W.push(`.${q}="\${${t4(K.$ref)}}"`);else if(typeof K==="string"&&K.includes("${"))W.push(`.${q}="${T8(K)}"`)}if(Z.$props)for(let[q,K]of Object.entries(Z.$props))if(K&&typeof K==="object"&&K.$ref)W.push(`.${q}="\${${t4(K.$ref)}}"`);else W.push(`.${q}="\${${JSON.stringify(K)}}"`);for(let[q,K]of Object.entries(Z)){if(!q.startsWith("on")||q==="observedAttributes")continue;let V=q.slice(2).toLowerCase();if(K&&typeof K==="object"&&K.$ref)W.push(`@${V}="\${(e) => ${t4(K.$ref)}(s, e)}"`);else if(K&&typeof K==="object"&&"$expression"in K){let B=U4(K.$expression,{eventParam:"e",statePrefix:"s"});W.push(`@${V}="\${(e) => { ${B}; }}"`)}else if(a4(K))W.push(`@${V}="\${(e) => { ${PH(K)} }}"`)}let J=BJ(Z.style);if(J)W.push(`style="${J}"`);let G=W.length>0?`
115
- ${X} ${W.join(`
116
- ${X} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(Q))return`${X}<${Q}${G}
117
- ${X}>`;let z="";if(Z.$switch){let q=J4(Z.$switch)?Z.$switch.$ref:Z.$switch,K=t4(q),V=Z.cases??{},B=[];for(let[H,F]of Object.entries(V)){if(!F||J4(F))continue;let A=VJ(F,`${X} `);B.push(` ${JSON.stringify(H)}: html\`
113
+ </html>`;return{files:G.files,html:K}}function XF(Z){if(Z===null||typeof Z!=="object"||Array.isArray(Z))return JSON.stringify(Z);if("default"in Z)return JSON.stringify(Z.default);if(F6(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 q9(Z,Q,W){let X=["// Generated by @jxsuite/compiler — do not edit manually"];if(Z.$id)X.push(`// Source: ${Z.$id}`);for(let B of W)X.push(`import '${B}';`);let J=new Map,G=Z.state??{};for(let[B,F]of Object.entries(G)){let A=F;if(A&&typeof A==="object"&&!Array.isArray(A)&&A.$prototype==="Function"&&A.$src){let M=A.$src;if(!J.has(M))J.set(M,[]);J.get(M).push(B)}}for(let[B,F]of J)X.push(`import { ${F.join(", ")} } from '${B}';`);X.push("import { reactive, computed, effect } from '@vue/reactivity';","import { render, html } from 'lit-html';","",`class ${Q} extends HTMLElement {`," #dispose = null;",""," constructor() {"," super();");let Y=[],z=[],q=[],K=[];for(let[B,F]of Object.entries(G)){let A=F;if(F4(A)){let M=A.$expression;if(u6(A))K.push([B,A]);else if(B6(M.operator))q.push([B,A]);else z.push([B,A])}else if(x4(A))if(typeof A.body==="string"&&A.body.includes("return"))z.push([B,A]);else q.push([B,A]);else{let M=XF(A);if(M!==void 0)Y.push([B,M])}}X.push(" this.state = reactive({");for(let[B,F]of Y)X.push(` ${B}: ${F},`);X.push(" });");for(let[B,F]of q)if(X.push(""),F4(F)){let A=c0(F.$expression,{eventParam:"e",statePrefix:"s"});X.push(` this.state.${B} = (s, e) => { ${A}; };`)}else if(v4(F)){let A=L4(F.body,{dispatchTarget:"this",eventParam:"e",indent:" ",statePrefix:"this.state"});X.push(` this.state.${B} = (s, e) => {`,A," };")}else{let M=(F.parameters?L6(F.parameters):F.arguments??["state"]).join(", ");if(F.$src)X.push(` this.state.${B} = (${M}) => ${B}(${M});`);else X.push(` this.state.${B} = (${M}) => {`,` ${typeof F.body==="string"?F.body:""}`," };")}for(let[B,F]of K){X.push("");let A=c0(F.$expression,{eventParam:"e",statePrefix:"this.state"});X.push(` this.state.${B} = ${Z9(F,A)};`)}for(let[B,F]of z)if(X.push(""),F4(F)){let A=c0(F.$expression,{eventParam:"e",statePrefix:"this.state"});X.push(` this.state.${B} = computed(() => ${A});`)}else if(F.$src)X.push(` this.state.${B} = computed(() => ${B}(this.state));`);else{X.push(` this.state.${B} = computed(() => {`);let A=(typeof F.body==="string"?F.body:"").replaceAll("state.","this.state.");X.push(` ${A}`," });")}X.push(" }","");let V=[];if(Array.isArray(Z.children)){let B={n:0};for(let F of Z.children)M6(F,V,Z.$media??{},"",B,Z.tagName)}if(X.push(" template() {"," const s = this.state;"," return html`",q7(Z.children,Z.style," ")," `;"," }",""," connectedCallback() {"," const _pa = this.getAttribute('data-jx-props');"," if (_pa) {"," try {"," const _p = JSON.parse(_pa);"," for (const [k, v] of Object.entries(_p)) {"," if (k in this.state) this.state[k] = v;"," }"," } catch {}"," this.removeAttribute('data-jx-props');"," }"," for (const key of Object.keys(this.state)) {"," if (this.hasOwnProperty(key) && this[key] !== undefined) {"," this.state[key] = this[key];"," }"," }"),Z.style&&typeof Z.style==="object"){let B=[];for(let[F,A]of Object.entries(Z.style)){if(F.startsWith(":")||F.startsWith(".")||F.startsWith("&")||F.startsWith("[")||F.startsWith("@"))continue;if(A===null||typeof A==="object")continue;let M=t0(F);if(typeof A==="string"&&A.includes("${"))B.push([M,A])}if(B.length>0){X.push(" effect(() => {");for(let[F,A]of B){let M=A.replaceAll(/\$\{([^}]+)\}/g,(I,N)=>`\${${N.replaceAll("state.","this.state.")}}`);X.push(` this.style['${F}'] = \`${M}\`;`)}X.push(" });")}}let H=kJ(Z.children);if(H)X.push(" const _slotted = Array.from(this.childNodes).filter(n => n.nodeType === 1 || (n.nodeType === 3 && n.textContent.trim()));");if(X.push(" if (this.hasAttribute('data-jx-prerendered')) {"," this.removeAttribute('data-jx-prerendered');"," }"," this.innerHTML = '';"," this.#dispose = effect(() => render(this.template(), this));"),H)X.push(" const _slot = this.querySelector('slot');"," if (_slot && _slotted.length > 0) {"," for (const n of _slotted) _slot.before(n);"," _slot.remove();"," }");return X.push(" }",""," disconnectedCallback() {"," if (this.#dispose) { this.#dispose(); this.#dispose = null; }"," }","}","",`customElements.define('${Z.tagName}', ${Q});`,""),X.join(`
114
+ `)}function q7(Z,Q,W){if(!Z)return"";if(g0(Z))return PJ(Z,W);if(!Array.isArray(Z))return"";return Z.map((X)=>g0(X)?PJ(X,W):CJ(X,W)).join(`
115
+ `)}function CJ(Z,Q){if(typeof Z==="string"){if(Z.includes("${"))return`${Q}${$7(Z)}`;return`${Q}${q0(Z)}`}if(typeof Z==="number"||typeof Z==="boolean")return`${Q}${q0(String(Z))}`;if(!Z||typeof Z!=="object")return"";let W=Z.tagName??"div",X=[];if(Z.attributes)for(let[q,K]of Object.entries(Z.attributes))if(K&&typeof K==="object"&&q4(K))X.push(`${q}="\${${J6(K.$ref)}}"`);else if(typeof K==="string"&&K.includes("${"))X.push(`${q}="${k8(K)}"`);else X.push(`${q}="${K}"`);if(Z.id)X.push(`id="${Z.id}"`);if(Z.className)X.push(`class="${Z.className}"`);for(let[q,K]of Object.entries(Z)){if(A6.has(q)||q.startsWith("$")||q.startsWith("on")||q==="tagName"||q==="id"||q==="className"||q==="style"||q==="children"||q==="textContent"||q==="innerHTML"||q==="attributes")continue;if(K&&typeof K==="object"&&K.$ref)X.push(`.${q}="\${${J6(K.$ref)}}"`);else if(typeof K==="string"&&K.includes("${"))X.push(`.${q}="${k8(K)}"`)}if(Z.$props)for(let[q,K]of Object.entries(Z.$props))if(K&&typeof K==="object"&&K.$ref)X.push(`.${q}="\${${J6(K.$ref)}}"`);else X.push(`.${q}="\${${JSON.stringify(K)}}"`);for(let[q,K]of Object.entries(Z)){if(!q.startsWith("on")||q==="observedAttributes")continue;let V=q.slice(2).toLowerCase();if(K&&typeof K==="object"&&K.$ref)X.push(`@${V}="\${(e) => ${J6(K.$ref)}(s, e)}"`);else if(K&&typeof K==="object"&&"$expression"in K){let H=c0(K.$expression,{eventParam:"e",statePrefix:"s"});X.push(`@${V}="\${(e) => { ${H}; }}"`)}else if(x4(K))X.push(`@${V}="\${(e) => { ${GF(K)} }}"`)}let J=SJ(Z.style);if(J)X.push(`style="${J}"`);let G=X.length>0?`
116
+ ${Q} ${X.join(`
117
+ ${Q} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(W))return`${Q}<${W}${G}
118
+ ${Q}>`;let z="";if(Z.$switch){let q=q4(Z.$switch)?Z.$switch.$ref:Z.$switch,K=J6(q),V=Z.cases??{},H=[];for(let[B,F]of Object.entries(V)){if(!F||q4(F))continue;let A=CJ(F,`${Q} `);H.push(` ${JSON.stringify(B)}: html\`
118
119
  ${A}
119
120
  \``)}z=`\${{
120
- ${B.join(`,
121
+ ${H.join(`,
121
122
  `)}
122
- }[${K}]}`}else if(Z.textContent!==void 0)z=aZ(Z.textContent);else if(Z.innerHTML!==void 0)z=Z.innerHTML;else if(Z.children)z=`
123
- ${sZ(Z.children,Z.style,`${X} `)}
124
- ${X}`;return`${X}<${Q}${G}
125
- ${X}>${z}</${Q}>`}function UJ(Z,X){let Q=J4(Z.items)?t4(Z.items.$ref):"ITEMS",W=Z.map;if(!W)return"";let J=W.tagName??"div",G=[];if(W.$props)for(let[K,V]of Object.entries(W.$props))if(J4(V))G.push(`.${K}="\${${RH(V.$ref)}}"`);else G.push(`.${K}="\${${JSON.stringify(V)}}"`);let Y=BJ(W.style);if(Y)G.push(`style="${Y}"`);for(let[K,V]of Object.entries(W)){if(!K.startsWith("on"))continue;let B=K.slice(2).toLowerCase();if(J4(V))G.push(`@${B}="\${(e) => ${t4(V.$ref)}(s, e)}"`);else if(T4(V)){let H=U4(V.$expression,{eventParam:"e",statePrefix:"s"});G.push(`@${B}="\${(e) => { ${H}; }}"`)}}let z=G.length>0?`
126
- ${X} ${G.join(`
127
- ${X} `)}`:"",q="";if(W.textContent!==void 0)q=aZ(W.textContent);else if(W.children)q=`
128
- ${sZ(W.children,null,`${X} `)}
129
- ${X} `;return`${X}\${${Q}.map((item, index) => html\`
130
- ${X} <${J}${z}
131
- ${X} >${q}</${J}>
132
- ${X}\`)}`}function t4(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return`s.${Z}`}function RH(Z){if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return t4(Z)}function T8(Z){return Z.replaceAll("state.","s.")}function aZ(Z){if(Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string")return`\${${t4(Z.$ref)}}`;if(typeof Z==="string"&&Z.includes("${"))return T8(Z);return String(Z)}function PH(Z){return(Z.body??"").replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function BJ(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 J=r0(Q);X.push(`${J}: ${T8(W)}`)}}return X.join("; ")}function HJ(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(HJ(X.children))return!0}return!1}var W9=c(()=>{i1();B6();k4();A6()});function FJ(Z,X){let{title:Q="Jx App",reactivitySrc:W,litHtmlSrc:J}=X,G=q1(Z,null,Z.state??{},Z.$media??{}),Y=U1(Z,Z.$media??{},X.projectStyle??null),z=[],q=LJ(Z,!1,Z,G,z),K=[],V="",B="";if(z.length>0){for(let F of z){let A=Q9(F.def,F.className,[]);K.push({content:A,path:`_islands/${F.tagName}.js`,tagName:F.tagName})}V=`<script type="importmap">
123
+ }[${K}]}`}else if(Z.textContent!==void 0)z=$7(Z.textContent);else if(Z.innerHTML!==void 0)z=Z.innerHTML;else if(Z.children)z=`
124
+ ${q7(Z.children,Z.style,`${Q} `)}
125
+ ${Q}`;return`${Q}<${W}${G}
126
+ ${Q}>${z}</${W}>`}function PJ(Z,Q){let W=q4(Z.items)?J6(Z.items.$ref):"ITEMS",X=Z.map;if(!X)return"";let J=X.tagName??"div",G=[];if(X.$props)for(let[K,V]of Object.entries(X.$props))if(q4(V))G.push(`.${K}="\${${JF(V.$ref)}}"`);else G.push(`.${K}="\${${JSON.stringify(V)}}"`);let Y=SJ(X.style);if(Y)G.push(`style="${Y}"`);for(let[K,V]of Object.entries(X)){if(!K.startsWith("on"))continue;let H=K.slice(2).toLowerCase();if(q4(V))G.push(`@${H}="\${(e) => ${J6(V.$ref)}(s, e)}"`);else if(F4(V)){let B=c0(V.$expression,{eventParam:"e",statePrefix:"s"});G.push(`@${H}="\${(e) => { ${B}; }}"`)}}let z=G.length>0?`
127
+ ${Q} ${G.join(`
128
+ ${Q} `)}`:"",q="";if(X.textContent!==void 0)q=$7(X.textContent);else if(X.children)q=`
129
+ ${q7(X.children,null,`${Q} `)}
130
+ ${Q} `;return`${Q}\${${W}.map((item, index) => html\`
131
+ ${Q} <${J}${z}
132
+ ${Q} >${q}</${J}>
133
+ ${Q}\`)}`}function J6(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return`s.${Z}`}function JF(Z){if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return J6(Z)}function k8(Z){return Z.replaceAll("state.","s.")}function $7(Z){if(Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string")return`\${${J6(Z.$ref)}}`;if(typeof Z==="string"&&Z.includes("${"))return k8(Z);return String(Z)}function GF(Z){if(v4(Z))return L4(Z.body,{dispatchTarget:"e.currentTarget",eventParam:"e",statePrefix:"s"});return(typeof Z.body==="string"?Z.body:"").replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function SJ(Z){if(!Z||typeof Z!=="object")return"";let Q=[];for(let[W,X]of Object.entries(Z)){if(W.startsWith(":")||W.startsWith(".")||W.startsWith("&")||W.startsWith("[")||W.startsWith("@"))continue;if(X===null||typeof X==="object")continue;if(typeof X==="string"&&X.includes("${")){let J=t0(W);Q.push(`${J}: ${k8(X)}`)}}return Q.join("; ")}function kJ(Z){if(!Array.isArray(Z))return!1;for(let Q of Z){if(!Q||typeof Q!=="object")continue;if(Q.tagName==="slot")return!0;if(kJ(Q.children))return!0}return!1}var K9=u(()=>{e1();I6();y4();T6()});function _J(Z,Q){let{title:W="Jx App",reactivitySrc:X,litHtmlSrc:J}=Q,G=B1(Z,null,Z.state??{},Z.$media??{}),Y=L1(Z,Z.$media??{},Q.projectStyle??null),z=[],q=bJ(Z,!1,Z,G,z),K=[],V="",H="";if(z.length>0){for(let F of z){let A=q9(F.def,F.className,[]);K.push({content:A,path:`_islands/${F.tagName}.js`,tagName:F.tagName})}V=`<script type="importmap">
133
134
  {
134
135
  "imports": {
135
- "@vue/reactivity": "${W}",
136
+ "@vue/reactivity": "${X}",
136
137
  "lit-html": "${J}"
137
138
  }
138
139
  }
139
- </script>`,B=K.map((F)=>`<script type="module" src="./${F.path}"></script>`).join(`
140
- `)}let H=`<!DOCTYPE html>
140
+ </script>`,H=K.map((F)=>`<script type="module" src="./${F.path}"></script>`).join(`
141
+ `)}let B=`<!DOCTYPE html>
141
142
  <html lang="en">
142
143
  <head>
143
144
  <meta charset="utf-8">
144
145
  <meta name="viewport" content="width=device-width, initial-scale=1">
145
- <title>${$0(Q)}</title>
146
+ <title>${q0(W)}</title>
146
147
  ${V}
147
148
  ${Y}
148
149
  </head>
149
150
  <body>
150
151
  ${q}
151
- ${B}
152
+ ${H}
152
153
  </body>
153
- </html>`;return{files:K,html:H}}function LJ(Z,X,Q,W,J){if(typeof Z==="string")return $0(Z);if(typeof Z==="number"||typeof Z==="boolean")return $0(String(Z));if(!Z||typeof Z!=="object")return"";let G=q1(Q,W.scope,Q?.state??W.scopeDefs,Q?.$media??W.media);if(X){let K=J.length,V=`jx-island-${K}`,B=`JxIsland${K}`,H={...Q??Z,tagName:V};return J.push({className:B,def:H,tagName:V}),`<${V}></${V}>`}let Y=Z.tagName??"div",z=Y1(Z,G.scope);if(t5.has(Y))return`<${Y}${z}>`;let q=CH(Z,Q,G,J);return`<${Y}${z}>${q}</${Y}>`}function CH(Z,X,Q,W){let J=X??Z;if(J.textContent!==void 0){let G=T0(J.textContent,Q.scope);return G==null?"":$0(String(G))}if(J.innerHTML)return T0(J.innerHTML,Q.scope)??J.innerHTML;if(Array.isArray(J.children)){let G=Array.isArray(X?.children)?X.children:void 0;return J.children.map((Y,z)=>{let q=Y,K=FQ(q),V=G?.[z]??Y;return LJ(q,K,V,Q,W)}).join(`
154
- `)}return""}var AJ=c(()=>{B6();W9()});function tZ(Z,X){let{title:Q="Jx App",reactivitySrc:W=z1,litHtmlSrc:J=$1,modulePath:G="app.js"}=X,Y=q1(Z,null,Z.state??{},Z.$media??{}),z=U1(Z,Z.$media??{},X.projectStyle??null),q={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},K=new Map,V=new Map,B=[],H=[],F=[],A=[],M=[],I=new Map,N=Z.state??{};for(let[p,f]of Object.entries(N)){if(f===null||typeof f!=="object"||Array.isArray(f)){if(typeof f==="string"&&e(f))H.push([p,`() => \`${f}\``]);else B.push([p,f]);continue}if(T4(f)){let s=f.$expression,K0=U4(s,{eventParam:"e",statePrefix:"state"});if($6(s.operator))A.push([p,{args:["state","e"],body:K0}]);else H.push([p,`() => ${K0}`]);continue}if(a4(f)){let s=f.parameters?K6(f.parameters):f.arguments;if(f.$src){if(!I.has(f.$src))I.set(f.$src,new Set);I.get(f.$src).add(p),H.push([p,`() => { return ${p}(state); }`])}else if(f.body&&f.body.includes("return"))H.push([p,`() => { ${f.body} }`]);else A.push([p,{args:s??["state"],body:f.body}]);continue}if(q6(f))continue;if(UQ(f)){B.push([p,f.default]);continue}if(v6(f)){if(f.$prototype==="LocalStorage"||f.$prototype==="SessionStorage"){let s=f.$prototype==="LocalStorage"?"localStorage":"sessionStorage",K0=f.key??p,E0=f.default??null;B.push([p,null]),M.push(bH(p,s,K0,E0));continue}if(f.$prototype==="Request"){B.push([p,null]),M.push(kH(p,f));continue}if(f.$prototype==="Cookie"){B.push([p,null]),M.push(_H(p,f.name??p,f.default??null));continue}}B.push([p,f])}let T=MJ(Z,Z,Y,K,V,q);for(let[p,f]of K)if(!F.some(([s])=>s===p))F.push([p,f]);for(let[p,f]of V)if(!A.some(([s])=>s===p))A.push([p,f]);let S=SH(B,H,F,A,M,I,q,W),v=[` "@vue/reactivity": "${W}"`,` "lit-html": "${J}"`],x=`<!DOCTYPE html>
154
+ </html>`;return{files:K,html:B}}function bJ(Z,Q,W,X,J){if(typeof Z==="string")return q0(Z);if(typeof Z==="number"||typeof Z==="boolean")return q0(String(Z));if(!Z||typeof Z!=="object")return"";let G=B1(W,X.scope,W?.state??X.scopeDefs,W?.$media??X.media);if(Q){let K=J.length,V=`jx-island-${K}`,H=`JxIsland${K}`,B={...W??Z,tagName:V};return J.push({className:H,def:B,tagName:V}),`<${V}></${V}>`}let Y=Z.tagName??"div",z=U1(Z,G.scope);if(UZ.has(Y))return`<${Y}${z}>`;let q=YF(Z,W,G,J);return`<${Y}${z}>${q}</${Y}>`}function YF(Z,Q,W,X){let J=Q??Z;if(J.textContent!==void 0){let G=E0(J.textContent,W.scope);return G==null?"":q0(String(G))}if(J.innerHTML)return E0(J.innerHTML,W.scope)??J.innerHTML;if(Array.isArray(J.children)){let G=Array.isArray(Q?.children)?Q.children:void 0;return J.children.map((Y,z)=>{let q=Y,K=_W(q),V=G?.[z]??Y;return bJ(q,K,V,W,X)}).join(`
155
+ `)}return""}var xJ=u(()=>{I6();K9()});function U7(Z,Q){let{title:W="Jx App",reactivitySrc:X=V1,litHtmlSrc:J=H1,modulePath:G="app.js"}=Q,Y=B1(Z,null,Z.state??{},Z.$media??{}),z=L1(Z,Z.$media??{},Q.projectStyle??null),q={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},K=new Map,V=new Map,H=[],B=[],F=[],A=[],M=[],I=new Map,N=Z.state??{};for(let[p,f]of Object.entries(N)){if(f===null||typeof f!=="object"||Array.isArray(f)){if(typeof f==="string"&&e(f))B.push([p,`() => \`${f}\``]);else H.push([p,f]);continue}if(F4(f)){let s=f.$expression,J0=c0(s,{eventParam:"e",statePrefix:"state"});if(u6(f))M.push(`state[${JSON.stringify(p)}] = ${Z9(f,J0)};`);else if(B6(s.operator))A.push([p,{args:["state","e"],body:J0}]);else B.push([p,`() => ${J0}`]);continue}if(x4(f)){let s=f.parameters?L6(f.parameters):f.arguments;if(v4(f)){let J0=L4(f.body,{eventParam:"e",statePrefix:"state"});if(f.parameters&&f.parameters.length>0)M.push(`state[${JSON.stringify(p)}] = ${Z9(f,`(() => {
156
+ ${J0}
157
+ })()`)};`);else A.push([p,{args:["state","e"],body:J0}])}else if(f.$src){if(!I.has(f.$src))I.set(f.$src,new Set);I.get(f.$src).add(p),B.push([p,`() => { return ${p}(state); }`])}else if(typeof f.body==="string"&&f.body.includes("return"))B.push([p,`() => { ${f.body} }`]);else A.push([p,{args:s??["state"],body:f.body}]);continue}if(F6(f))continue;if(RW(f)){H.push([p,f.default]);continue}if(m6(f)){if(f.$prototype==="LocalStorage"||f.$prototype==="SessionStorage"){let s=f.$prototype==="LocalStorage"?"localStorage":"sessionStorage",J0=f.key??p,C0=f.default??null;H.push([p,null]),M.push(qF(p,s,J0,C0));continue}if(f.$prototype==="Request"){H.push([p,null]),M.push($F(p,f));continue}if(f.$prototype==="Cookie"){H.push([p,null]),M.push(KF(p,f.name??p,f.default??null));continue}}H.push([p,f])}let D=vJ(Z,Z,Y,K,V,q);for(let[p,f]of K)if(!F.some(([s])=>s===p))F.push([p,f]);for(let[p,f]of V)if(!A.some(([s])=>s===p))A.push([p,f]);let P=zF(H,B,F,A,M,I,q,X),v=[` "@vue/reactivity": "${X}"`,` "lit-html": "${J}"`],x=`<!DOCTYPE html>
155
158
  <html lang="en">
156
159
  <head>
157
160
  <meta charset="utf-8">
158
161
  <meta name="viewport" content="width=device-width, initial-scale=1">
159
- <title>${$0(Q)}</title>
162
+ <title>${q0(W)}</title>
160
163
  <script type="importmap">
161
164
  {
162
165
  "imports": {
@@ -169,153 +172,155 @@ ${v.join(`,
169
172
  <script type="module" src="./${G}"></script>
170
173
  </head>
171
174
  <body>
172
- ${T}
175
+ ${D}
173
176
  </body>
174
- </html>`;return{files:[{content:S,path:G}],html:x}}function MJ(Z,X,Q,W,J,G){if(typeof Z==="string")return $0(Z);if(typeof Z==="number"||typeof Z==="boolean")return $0(String(Z));if(!Z||typeof Z!=="object")return"";let Y=q1(X,Q.scope,X?.state??Q.scopeDefs,X?.$media??Q.media),z=Z.tagName??"div",q=[],K=!1;if(Z.textContent!==void 0){let I=X?.textContent??Z.textContent;if(w4(I)){let N=N6(I.$ref);q.push(`:text-content="${N}"`),oZ(W,N,I.$ref),K=!0}else if(e(I)){let N=`_t${G.t}`;G.t+=1,q.push(`:text-content="${N}"`),W.set(N,`() => \`${I}\``),K=!0}}for(let[I,N]of Object.entries(Z)){if(!I.startsWith("on")||I==="observedAttributes")continue;let T=I.slice(2).toLowerCase();if(w4(N)){let S=N6(N.$ref);q.push(`@${T}="${S}"`),K=!0}else if(a4(N)){let S=`_h${G.h}`;G.h+=1,q.push(`@${T}="${S}"`),J.set(S,{args:N.parameters?K6(N.parameters):N.arguments??["state","event"],body:N.body}),K=!0}else if(T4(N)){let S=`_h${G.h}`;G.h+=1,q.push(`@${T}="${S}"`);let v=U4(N.$expression,{eventParam:"e",statePrefix:"state"});J.set(S,{args:["state","e"],body:v}),K=!0}}if(Z.style&&typeof Z.style==="object")for(let[I,N]of Object.entries(Z.style)){if(I.startsWith(":")||I.startsWith(".")||I.startsWith("&")||I.startsWith("[")||I.startsWith("@"))continue;if(N===null||typeof N==="object")continue;if(e(N)){let T=`_s${G.s}`;G.s+=1,q.push(`:style.${r0(I)}="${T}"`),W.set(T,`() => \`${N}\``),K=!0}}if(Z.attributes&&typeof Z.attributes==="object"){for(let[I,N]of Object.entries(Z.attributes))if(w4(N)){let T=N6(N.$ref);q.push(`:attr.${I}="${T}"`),oZ(W,T,N.$ref),K=!0}else if(e(N)){let T=`_t${G.t}`;G.t+=1,q.push(`:attr.${I}="${T}"`),W.set(T,`() => \`${N}\``),K=!0}}for(let[I,N]of Object.entries(Z)){if(U6.has(I)||I.startsWith("on")||I.startsWith("$")||I==="tagName"||I==="id"||I==="className"||I==="style"||I==="children"||I==="textContent"||I==="innerHTML"||I==="attributes")continue;if(w4(N)){let T=N6(N.$ref);q.push(`:${r0(I)}="${T}"`),oZ(W,T,N.$ref),K=!0}else if(e(N)){let T=`_t${G.t}`;G.t+=1,q.push(`:${r0(I)}="${T}"`),W.set(T,`() => \`${N}\``),K=!0}}let V=Y1(Z,Y.scope),B=K?" data-bind":"",H=q.length>0?` ${q.join(" ")}`:"",F="",A=X??Z;if(A.textContent!==void 0&&!K){let I=T0(A.textContent,Y.scope);F=I==null?"":$0(String(I))}else if(A.textContent!==void 0&&K){let I=T0(A.textContent,Y.scope);F=I==null?"":$0(String(I))}else if(A.innerHTML)F=T0(A.innerHTML,Y.scope)??A.innerHTML;else if(x0(A.children)){G.needsLit=!0;let I=`_list${G.l}`;G.l+=1;let N=A.children,T;if(w4(N.items))T=`state.${N6(N.items.$ref)}`;else T=JSON.stringify(N.items);let S=eZ(N.map);W.set(I,`() => (${T} ?? []).map((item, index) => html\`${S}\`)`),q.push(`:render="${I}"`),K=!0;let v=" data-bind",x=` ${q.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(z))return`<${z}${V}${v}${x}>`;return`<${z}${V}${v}${x}></${z}>`}else if(Array.isArray(A.children)&&A.children.some((I)=>x0(I))){G.needsLit=!0;let I=`_children${G.l}`;G.l+=1;let N=A.children.map((S)=>IJ(S)).join(`
175
- `);W.set(I,`() => html\`
177
+ </html>`;return{files:[{content:P,path:G}],html:x}}function vJ(Z,Q,W,X,J,G){if(typeof Z==="string")return q0(Z);if(typeof Z==="number"||typeof Z==="boolean")return q0(String(Z));if(!Z||typeof Z!=="object")return"";let Y=B1(Q,W.scope,Q?.state??W.scopeDefs,Q?.$media??W.media),z=Z.tagName??"div",q=[],K=!1;if(Z.textContent!==void 0){let I=Q?.textContent??Z.textContent;if(O4(I)){let N=O6(I.$ref);q.push(`:text-content="${N}"`),K7(X,N,I.$ref),K=!0}else if(e(I)){let N=`_t${G.t}`;G.t+=1,q.push(`:text-content="${N}"`),X.set(N,`() => \`${I}\``),K=!0}}for(let[I,N]of Object.entries(Z)){if(!I.startsWith("on")||I==="observedAttributes")continue;let D=I.slice(2).toLowerCase();if(O4(N)){let P=O6(N.$ref);q.push(`@${D}="${P}"`),K=!0}else if(v4(N)){let P=`_h${G.h}`;G.h+=1,q.push(`@${D}="${P}"`),J.set(P,{args:["state","e"],body:L4(N.body,{eventParam:"e",statePrefix:"state"})}),K=!0}else if(x4(N)){let P=`_h${G.h}`;G.h+=1,q.push(`@${D}="${P}"`),J.set(P,{args:N.parameters?L6(N.parameters):N.arguments??["state","event"],body:N.body}),K=!0}else if(F4(N)){let P=`_h${G.h}`;G.h+=1,q.push(`@${D}="${P}"`);let v=c0(N.$expression,{eventParam:"e",statePrefix:"state"});J.set(P,{args:["state","e"],body:v}),K=!0}}if(Z.style&&typeof Z.style==="object")for(let[I,N]of Object.entries(Z.style)){if(I.startsWith(":")||I.startsWith(".")||I.startsWith("&")||I.startsWith("[")||I.startsWith("@"))continue;if(N===null||typeof N==="object")continue;if(e(N)){let D=`_s${G.s}`;G.s+=1,q.push(`:style.${t0(I)}="${D}"`),X.set(D,`() => \`${N}\``),K=!0}}if(Z.attributes&&typeof Z.attributes==="object"){for(let[I,N]of Object.entries(Z.attributes))if(O4(N)){let D=O6(N.$ref);q.push(`:attr.${I}="${D}"`),K7(X,D,N.$ref),K=!0}else if(e(N)){let D=`_t${G.t}`;G.t+=1,q.push(`:attr.${I}="${D}"`),X.set(D,`() => \`${N}\``),K=!0}}for(let[I,N]of Object.entries(Z)){if(A6.has(I)||I.startsWith("on")||I.startsWith("$")||I==="tagName"||I==="id"||I==="className"||I==="style"||I==="children"||I==="textContent"||I==="innerHTML"||I==="attributes")continue;if(O4(N)){let D=O6(N.$ref);q.push(`:${t0(I)}="${D}"`),K7(X,D,N.$ref),K=!0}else if(e(N)){let D=`_t${G.t}`;G.t+=1,q.push(`:${t0(I)}="${D}"`),X.set(D,`() => \`${N}\``),K=!0}}let V=U1(Z,Y.scope),H=K?" data-bind":"",B=q.length>0?` ${q.join(" ")}`:"",F="",A=Q??Z;if(A.textContent!==void 0&&!K){let I=E0(A.textContent,Y.scope);F=I==null?"":q0(String(I))}else if(A.textContent!==void 0&&K){let I=E0(A.textContent,Y.scope);F=I==null?"":q0(String(I))}else if(A.innerHTML)F=E0(A.innerHTML,Y.scope)??A.innerHTML;else if(g0(A.children)){G.needsLit=!0;let I=`_list${G.l}`;G.l+=1;let N=A.children,D;if(O4(N.items))D=`state.${O6(N.items.$ref)}`;else D=JSON.stringify(N.items);let P=V7(N.map);X.set(I,`() => (${D} ?? []).map((item, index) => html\`${P}\`)`),q.push(`:render="${I}"`),K=!0;let v=" data-bind",x=` ${q.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(z))return`<${z}${V}${v}${x}>`;return`<${z}${V}${v}${x}></${z}>`}else if(Array.isArray(A.children)&&A.children.some((I)=>g0(I))){G.needsLit=!0;let I=`_children${G.l}`;G.l+=1;let N=A.children.map((P)=>yJ(P)).join(`
178
+ `);X.set(I,`() => html\`
176
179
  ${N}
177
- \``),q.push(`:render="${I}"`),K=!0;let T=` ${q.join(" ")}`;return`<${z}${V} data-bind${T}></${z}>`}else if(Array.isArray(A.children)){let I=Array.isArray(X?.children)?X.children:void 0;F=A.children.map((N,T)=>{let S=I?.[T]??N;return MJ(N,S,Y,W,J,G)}).join(`
178
- `)}if(new Set(["input","br","hr","img","meta","link"]).has(z))return`<${z}${V}${B}${H}>`;return`<${z}${V}${B}${H}>${F}</${z}>`}function eZ(Z){if(!Z)return"";let X=Z.tagName??"div",Q="";if(Z.id)Q+=` id="${Z.id}"`;if(Z.className)Q+=` class="${m6(Z.className)}"`;if(Z.attributes&&typeof Z.attributes==="object")for(let[G,Y]of Object.entries(Z.attributes))Q+=typeof Y==="string"&&e(Y)?` ${G}="${m6(Y)}"`:` ${G}="${$0(String(Y))}"`;if(Z.style&&typeof Z.style==="object"){let G=[];for(let[Y,z]of Object.entries(Z.style)){if(Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("&")||Y.startsWith("[")||Y.startsWith("@"))continue;if(z===null||typeof z==="object")continue;let q=r0(Y);if(e(String(z)))G.push(`${q}: ${m6(String(z))}`);else G.push(`${q}: ${z}`)}if(G.length>0)Q+=` style="${G.join("; ")}"`}for(let[G,Y]of Object.entries(Z)){if(!G.startsWith("on")||G==="observedAttributes")continue;let z=G.slice(2).toLowerCase();if(w4(Y)){let q=N6(Y.$ref);Q+=` @${z}=\${(e) => { state.$map = { item, index }; on.${q}(e); }}`}else if(Y&&typeof Y==="object"&&Y.$prototype==="Function"){let q=m6(Y.body);Q+=` @${z}=\${(e) => { ${q} }}`}else if(Y&&typeof Y==="object"&&"$expression"in Y){let q=U4(Y.$expression,{eventParam:"e",statePrefix:"state"});Q+=` @${z}=\${(e) => { state.$map = { item, index }; ${q}; }}`}}if(Z.contentEditable)Q+=` contenteditable="${Z.contentEditable}"`;let W="";if(Z.textContent!==void 0){let G=String(Z.textContent);if(e(G))W=m6(G);else if(w4(Z.textContent))W=`\${state.${N6(Z.textContent.$ref)}}`;else W=$0(G)}else if(Z.innerHTML)W=m6(String(Z.innerHTML));else if(x0(Z.children))W=`
179
- ${NJ(Z.children)}
180
- `;else if(Array.isArray(Z.children))W=`
181
- ${Z.children.map((G)=>IJ(G)).join(`
180
+ \``),q.push(`:render="${I}"`),K=!0;let D=` ${q.join(" ")}`;return`<${z}${V} data-bind${D}></${z}>`}else if(Array.isArray(A.children)){let I=Array.isArray(Q?.children)?Q.children:void 0;F=A.children.map((N,D)=>{let P=I?.[D]??N;return vJ(N,P,Y,X,J,G)}).join(`
181
+ `)}if(new Set(["input","br","hr","img","meta","link"]).has(z))return`<${z}${V}${H}${B}>`;return`<${z}${V}${H}${B}>${F}</${z}>`}function V7(Z){if(!Z)return"";let Q=Z.tagName??"div",W="";if(Z.id)W+=` id="${Z.id}"`;if(Z.className)W+=` class="${i6(Z.className)}"`;if(Z.attributes&&typeof Z.attributes==="object")for(let[G,Y]of Object.entries(Z.attributes))W+=typeof Y==="string"&&e(Y)?` ${G}="${i6(Y)}"`:` ${G}="${q0(String(Y))}"`;if(Z.style&&typeof Z.style==="object"){let G=[];for(let[Y,z]of Object.entries(Z.style)){if(Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("&")||Y.startsWith("[")||Y.startsWith("@"))continue;if(z===null||typeof z==="object")continue;let q=t0(Y);if(e(String(z)))G.push(`${q}: ${i6(String(z))}`);else G.push(`${q}: ${z}`)}if(G.length>0)W+=` style="${G.join("; ")}"`}for(let[G,Y]of Object.entries(Z)){if(!G.startsWith("on")||G==="observedAttributes")continue;let z=G.slice(2).toLowerCase();if(O4(Y)){let q=O6(Y.$ref);W+=` @${z}=\${(e) => { state.$map = { item, index }; on.${q}(e); }}`}else if(v4(Y)){let q=L4(Y.body,{eventParam:"e",statePrefix:"state"});W+=` @${z}=\${(e) => { state.$map = { item, index }; ${q} }}`}else if(Y&&typeof Y==="object"&&Y.$prototype==="Function"){let q=i6(Y.body);W+=` @${z}=\${(e) => { ${q} }}`}else if(Y&&typeof Y==="object"&&"$expression"in Y){let q=c0(Y.$expression,{eventParam:"e",statePrefix:"state"});W+=` @${z}=\${(e) => { state.$map = { item, index }; ${q}; }}`}}if(Z.contentEditable)W+=` contenteditable="${Z.contentEditable}"`;let X="";if(Z.textContent!==void 0){let G=String(Z.textContent);if(e(G))X=i6(G);else if(O4(Z.textContent))X=`\${state.${O6(Z.textContent.$ref)}}`;else X=q0(G)}else if(Z.innerHTML)X=i6(String(Z.innerHTML));else if(g0(Z.children))X=`
182
+ ${gJ(Z.children)}
183
+ `;else if(Array.isArray(Z.children))X=`
184
+ ${Z.children.map((G)=>yJ(G)).join(`
182
185
  `)}
183
- `;if(new Set(["input","br","hr","img","meta","link"]).has(X))return`<${X}${Q}>`;return`<${X}${Q}>${W}</${X}>`}function IJ(Z){if(typeof Z==="string")return e(Z)?m6(Z):$0(Z);if(typeof Z==="number"||typeof Z==="boolean")return $0(String(Z));if(x0(Z))return NJ(Z);return eZ(Z)}function NJ(Z){let{items:X}=Z,Q=w4(X)?`state.${N6(X.$ref)}`:JSON.stringify(X??[]),W=eZ(Z.map);return`\${(${Q} ?? []).map((item, index) => html\`${W}\`)}`}function m6(Z){return Z.replaceAll("$map.","")}function SH(Z,X,Q,W,J,G,Y,z){let q=[],{needsLit:K}=Y,V=X.length>0;q.push("// Generated by @jxsuite/compiler — do not edit manually");let B=["reactive","effect"];if(V)B.push("computed");if(q.push(`import { ${B.join(", ")} } from '@vue/reactivity';`),K)q.push("import { html, render } from 'lit-html';");for(let[H,F]of G)q.push(`import { ${[...F].join(", ")} } from '${H}';`);q.push("","const state = reactive({");for(let[H,F]of Z)q.push(` ${H}: ${JSON.stringify(F)},`);if(q.push("});",""),J.length>0){for(let H of J)q.push(H);q.push("")}if(X.length>0){for(let[H,F]of X)q.push(`state.${H} = computed(${F});`);q.push("")}if(Q.length>0){q.push("const bind = {");for(let[H,F]of Q)q.push(` ${H}: ${F},`);q.push("};")}else q.push("const bind = {};");if(q.push(""),W.length>0){q.push("const on = {");for(let[H,F]of W){let A=F.args??["state"],M=A.map((I)=>I==="state"?"state":"e").join(", ");q.push(` ${H}: (e) => { const fn = (${A.join(", ")}) => { ${F.body} }; fn(${M}); },`)}q.push("};")}else q.push("const on = {};");if(q.push("","function hydrate(root) {"," root.querySelectorAll('[data-bind]').forEach(el => {"," [...el.attributes].forEach(a => {"," if (a.name.startsWith(':')) {"," const parts = a.name.slice(1).split('.');"," const key = a.value;"),K)q.push(" if (parts[0] === 'render') {"," effect(() => { render(bind[key](), el); });"," } else if (parts[0] === 'style' && parts.length > 1) {");else q.push(" if (parts[0] === 'style' && parts.length > 1) {");return q.push(" effect(() => { el.style[parts[1]] = bind[key](); });"," } else if (parts[0] === 'attr' && parts.length > 1) {"," effect(() => { el.setAttribute(parts[1], bind[key]()); });"," } else {"," const prop = parts[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());"," effect(() => { el[prop] = bind[key](); });"," }"," } else if (a.name.startsWith('@')) {"," el.addEventListener(a.name.slice(1), on[a.value]);"," }"," });"," });","}","","hydrate(document);",""),q.join(`
184
- `)}function kH(Z,X){let{url:Q}=X,W=X.method??"GET",J=e(Q);if(X.manual)return`// ${Z}: manual Request — fetch triggered by user action`;let G=[`// ${Z}: auto-fetch from ${J?"(dynamic URL)":Q}`,"effect(() => {"];if(J)G.push(` const url = \`${Q}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else G.push(` const url = ${JSON.stringify(Q)};`);let Y=[];if(W!=="GET")Y.push(`method: ${JSON.stringify(W)}`);if(X.headers)Y.push(`headers: ${JSON.stringify(X.headers)}`);if(X.body){let q=typeof X.body==="object"?JSON.stringify(JSON.stringify(X.body)):JSON.stringify(X.body);Y.push(`body: ${q}`)}let z=Y.length>0?`, { ${Y.join(", ")} }`:"";return G.push(` fetch(url${z})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { state.${Z} = d; })`,` .catch(e => { state.${Z} = { error: String(e) }; });`,"});"),G.join(`
185
- `)}function bH(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(`
186
- `)}function _H(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(`
187
- `)}function N6(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replaceAll("/","_");return Z.replaceAll("/","_")}function oZ(Z,X,Q){if(Z.has(X))return;if(Q.startsWith("#/state/")){let J=Q.slice(8).split("/");Z.set(X,`() => state.${J.join(".")}`)}else Z.set(X,`() => state.${Q}`)}var Z7=c(()=>{i1();B6();k4()});var TJ={};x6(TJ,{compileClassJson:()=>xH});function xH(Z,X={}){let Q=Z.title;if(!Q)throw Error("compileClassJson: missing title (class name)");let W=vH(Z.extends),J=Z.$defs,G=J?.fields??{},Y=J?.constructor,z=typeof Y==="object"?Y:void 0,q=J?.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(G)){if(H.scope!=="static")continue;let F=H.identifier??B,A=H.access==="private"?"#":"",M=H.initializer!==void 0?JSON.stringify(H.initializer):H.default!==void 0?JSON.stringify(H.default):"null";K.push(` static ${A}${F} = ${M};`)}for(let[B,H]of Object.entries(G)){if(H.scope==="static")continue;if(H.access!=="private")continue;let F=H.identifier??B;K.push(` #${F};`)}if(Object.keys(G).length>0)K.push("");if(K.push(" constructor(config = {}) {"),z?.superCall||W!=="Object"){let B=z?.superCall?.arguments?z.superCall.arguments.join(", "):"";K.push(` super(${B});`)}for(let[B,H]of Object.entries(G)){if(H.scope==="static")continue;let F=H.identifier??B,A=H.access==="private"?"#":"",M=H.initializer!==void 0?JSON.stringify(H.initializer):H.default!==void 0?JSON.stringify(H.default):"null";K.push(` this.${A}${F} = config.${F} !== undefined ? config.${F} : ${M};`)}if(z?.body){let B=Array.isArray(z.body)?z.body:[z.body];for(let H of B)K.push(` ${H}`)}K.push(" }");for(let[B,H]of Object.entries(q)){let F=H.identifier??B,A=H.scope==="static",I=H.access==="private"?"#":"",N=A?"static ":"",T=H.returnType?.$ref?.includes("Promise")||gH(H)?"async ":"",S=DJ(H.parameters??[]),v=yH(H.body);if(K.push(""),H.role==="accessor"){if(H.getter)K.push(` ${N}get ${I}${F}() {`,` ${H.getter.body}`," }");if(H.setter){let x=DJ(H.setter.parameters??[]);K.push(` ${N}set ${I}${F}(${x}) {`,` ${H.setter.body}`," }")}}else{K.push(` ${N}${T}${I}${F}(${S}) {`);for(let x of v)K.push(` ${x}`);K.push(" }")}}return K.push("}","",`export { ${Q} };`,`export default ${Q};`,""),K.join(`
188
- `)}function vH(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 DJ(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 yH(Z){if(!Z)return[""];return Array.isArray(Z)?Z:[Z]}function gH(Z){return(Array.isArray(Z.body)?Z.body.join(`
189
- `):Z.body??"").includes("await ")}import{readFileSync as fH}from"node:fs";async function X7(Z,X={}){let{title:Q="Jx App",reactivitySrc:W=z1,litHtmlSrc:J=$1,projectStyle:G=null}=X,Y;if(typeof Z==="string"){let z=fH(Z,"utf8");if(Z.endsWith(".json"))Y=L6(z,Z);else{let{extname:q}=await import("node:path"),K=q(Z).toLowerCase(),V=X.formats?.byExtension?.(K,"parse");if(!V){let{unknownFormatError:B}=await Promise.resolve().then(() => (I6(),rZ));throw B(Z,K)}Y=await V.call("parse",z)}}else Y=Z;if(BQ(Y)){let{compileClassJson:z}=await Promise.resolve().then(() => TJ),q=z(Y,X),K=typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${Y.title}.js`;return{files:[{content:q,path:K}],html:""}}if(!e9(Y))return FJ(Y,{litHtmlSrc:J,projectStyle:G,reactivitySrc:W,title:Q});if(Y.tagName&&Y.tagName.includes("-")){let{tagName:z}=Y,q=Z8(z),V={content:Q9(Y,q,[]),path:`${z}.js`,tagName:z},B=U1(Y,Y.$media??{}),H=`<!DOCTYPE html>
186
+ `;if(new Set(["input","br","hr","img","meta","link"]).has(Q))return`<${Q}${W}>`;return`<${Q}${W}>${X}</${Q}>`}function yJ(Z){if(typeof Z==="string")return e(Z)?i6(Z):q0(Z);if(typeof Z==="number"||typeof Z==="boolean")return q0(String(Z));if(g0(Z))return gJ(Z);return V7(Z)}function gJ(Z){let{items:Q}=Z,W=O4(Q)?`state.${O6(Q.$ref)}`:JSON.stringify(Q??[]),X=V7(Z.map);return`\${(${W} ?? []).map((item, index) => html\`${X}\`)}`}function i6(Z){return Z.replaceAll("$map.","")}function zF(Z,Q,W,X,J,G,Y,z){let q=[],{needsLit:K}=Y,V=Q.length>0;q.push("// Generated by @jxsuite/compiler — do not edit manually");let H=["reactive","effect"];if(V)H.push("computed");if(q.push(`import { ${H.join(", ")} } from '@vue/reactivity';`),K)q.push("import { html, render } from 'lit-html';");for(let[B,F]of G)q.push(`import { ${[...F].join(", ")} } from '${B}';`);q.push("","const state = reactive({");for(let[B,F]of Z)q.push(` ${B}: ${JSON.stringify(F)},`);if(q.push("});",""),J.length>0){for(let B of J)q.push(B);q.push("")}if(Q.length>0){for(let[B,F]of Q)q.push(`state.${B} = computed(${F});`);q.push("")}if(W.length>0){q.push("const bind = {");for(let[B,F]of W)q.push(` ${B}: ${F},`);q.push("};")}else q.push("const bind = {};");if(q.push(""),X.length>0){q.push("const on = {");for(let[B,F]of X){let A=F.args??["state"],M=A.map((I)=>I==="state"?"state":"e").join(", ");q.push(` ${B}: (e) => { const fn = (${A.join(", ")}) => { ${F.body} }; fn(${M}); },`)}q.push("};")}else q.push("const on = {};");if(q.push("","function hydrate(root) {"," root.querySelectorAll('[data-bind]').forEach(el => {"," [...el.attributes].forEach(a => {"," if (a.name.startsWith(':')) {"," const parts = a.name.slice(1).split('.');"," const key = a.value;"),K)q.push(" if (parts[0] === 'render') {"," effect(() => { render(bind[key](), el); });"," } else if (parts[0] === 'style' && parts.length > 1) {");else q.push(" if (parts[0] === 'style' && parts.length > 1) {");return q.push(" effect(() => { el.style[parts[1]] = bind[key](); });"," } else if (parts[0] === 'attr' && parts.length > 1) {"," effect(() => { el.setAttribute(parts[1], bind[key]()); });"," } else {"," const prop = parts[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());"," effect(() => { el[prop] = bind[key](); });"," }"," } else if (a.name.startsWith('@')) {"," el.addEventListener(a.name.slice(1), on[a.value]);"," }"," });"," });","}","","hydrate(document);",""),q.join(`
187
+ `)}function $F(Z,Q){let{url:W}=Q,X=Q.method??"GET",J=e(W);if(Q.manual)return`// ${Z}: manual Request — fetch triggered by user action`;let G=[`// ${Z}: auto-fetch from ${J?"(dynamic URL)":W}`,"effect(() => {"];if(J)G.push(` const url = \`${W}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else G.push(` const url = ${JSON.stringify(W)};`);let Y=[];if(X!=="GET")Y.push(`method: ${JSON.stringify(X)}`);if(Q.headers)Y.push(`headers: ${JSON.stringify(Q.headers)}`);if(Q.body){let q=typeof Q.body==="object"?JSON.stringify(JSON.stringify(Q.body)):JSON.stringify(Q.body);Y.push(`body: ${q}`)}let z=Y.length>0?`, { ${Y.join(", ")} }`:"";return G.push(` fetch(url${z})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { state.${Z} = d; })`,` .catch(e => { state.${Z} = { error: String(e) }; });`,"});"),G.join(`
188
+ `)}function qF(Z,Q,W,X){return[`// ${Z}: ${Q} (key: "${W}")`,"try {",` const _s = ${Q}.getItem(${JSON.stringify(W)});`,` state.${Z} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(X)};`,`} catch { state.${Z} = ${JSON.stringify(X)}; }`,"effect(() => {",` const v = state.${Z};`," try {",` if (v === null) ${Q}.removeItem(${JSON.stringify(W)});`,` else ${Q}.setItem(${JSON.stringify(W)}, JSON.stringify(v));`," } catch {}","});"].join(`
189
+ `)}function KF(Z,Q,W){return[`// ${Z}: Cookie (name: "${Q}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${Q}=([^;]*)"));`,` try { state.${Z} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(W)}; }`,` catch { state.${Z} = _m ? _m[1] : ${JSON.stringify(W)}; }`,"}"].join(`
190
+ `)}function O6(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replaceAll("/","_");return Z.replaceAll("/","_")}function K7(Z,Q,W){if(Z.has(Q))return;if(W.startsWith("#/state/")){let J=W.slice(8).split("/");Z.set(Q,`() => state.${J.join(".")}`)}else Z.set(Q,`() => state.${W}`)}var H7=u(()=>{e1();I6();y4()});var hJ={};e4(hJ,{compileClassJson:()=>UF});function UF(Z,Q={}){let W=Z.title;if(!W)throw Error("compileClassJson: missing title (class name)");let X=VF(Z.extends),J=Z.$defs,G=J?.fields??{},Y=J?.constructor,z=typeof Y==="object"?Y:void 0,q=J?.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=X!=="Object"?` extends ${X}`:"";K.push(`class ${W}${V} {`);for(let[H,B]of Object.entries(G)){if(B.scope!=="static")continue;let F=B.identifier??H,A=B.access==="private"?"#":"",M=B.initializer!==void 0?JSON.stringify(B.initializer):B.default!==void 0?JSON.stringify(B.default):"null";K.push(` static ${A}${F} = ${M};`)}for(let[H,B]of Object.entries(G)){if(B.scope==="static")continue;if(B.access!=="private")continue;let F=B.identifier??H;K.push(` #${F};`)}if(Object.keys(G).length>0)K.push("");if(K.push(" constructor(config = {}) {"),z?.superCall||X!=="Object"){let H=z?.superCall?.arguments?z.superCall.arguments.join(", "):"";K.push(` super(${H});`)}for(let[H,B]of Object.entries(G)){if(B.scope==="static")continue;let F=B.identifier??H,A=B.access==="private"?"#":"",M=B.initializer!==void 0?JSON.stringify(B.initializer):B.default!==void 0?JSON.stringify(B.default):"null";K.push(` this.${A}${F} = config.${F} !== undefined ? config.${F} : ${M};`)}if(z?.body){let H=Array.isArray(z.body)?z.body:[z.body];for(let B of H)K.push(` ${B}`)}K.push(" }");for(let[H,B]of Object.entries(q)){let F=B.identifier??H,A=B.scope==="static",I=B.access==="private"?"#":"",N=A?"static ":"",D=B.returnType?.$ref?.includes("Promise")||BF(B)?"async ":"",P=fJ(B.parameters??[]),v=HF(B.body);if(K.push(""),B.role==="accessor"){if(B.getter)K.push(` ${N}get ${I}${F}() {`,` ${B.getter.body}`," }");if(B.setter){let x=fJ(B.setter.parameters??[]);K.push(` ${N}set ${I}${F}(${x}) {`,` ${B.setter.body}`," }")}}else{K.push(` ${N}${D}${I}${F}(${P}) {`);for(let x of v)K.push(` ${x}`);K.push(" }")}}return K.push("}","",`export { ${W} };`,`export default ${W};`,""),K.join(`
191
+ `)}function VF(Z){if(!Z)return"Object";if(typeof Z==="string")return Z;if(Z.$ref){let Q=Z.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return Q?Q[1]:"Object"}return"Object"}function fJ(Z){return Z.map((Q)=>{if(Q.$ref)return Q.$ref.split("/").pop();let W=Q.identifier??Q.name;return typeof W==="string"?W:"arg"}).join(", ")}function HF(Z){if(!Z)return[""];return Array.isArray(Z)?Z:[Z]}function BF(Z){return(Array.isArray(Z.body)?Z.body.join(`
192
+ `):Z.body??"").includes("await ")}import{readFileSync as FF}from"node:fs";async function B7(Z,Q={}){let{title:W="Jx App",reactivitySrc:X=V1,litHtmlSrc:J=H1,projectStyle:G=null}=Q,Y;if(typeof Z==="string"){let z=FF(Z,"utf8");if(Z.endsWith(".json"))Y=w6(z,Z);else{let{extname:q}=await import("node:path"),K=q(Z).toLowerCase(),V=Q.formats?.byExtension?.(K,"parse");if(!V){let{unknownFormatError:H}=await Promise.resolve().then(() => (E6(),z7));throw H(Z,K)}Y=await V.call("parse",z)}}else Y=Z;if(CW(Y)){let{compileClassJson:z}=await Promise.resolve().then(() => hJ),q=z(Y,Q),K=typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${Y.title}.js`;return{files:[{content:q,path:K}],html:""}}if(!$8(Y))return _J(Y,{litHtmlSrc:J,projectStyle:G,reactivitySrc:X,title:W});if(Y.tagName&&Y.tagName.includes("-")){let{tagName:z}=Y,q=q8(z),V={content:q9(Y,q,[]),path:`${z}.js`,tagName:z},H=L1(Y,Y.$media??{}),B=`<!DOCTYPE html>
190
193
  <html lang="en">
191
194
  <head>
192
195
  <meta charset="utf-8">
193
196
  <meta name="viewport" content="width=device-width, initial-scale=1">
194
- <title>${$0(Q)}</title>
197
+ <title>${q0(W)}</title>
195
198
  <script type="importmap">
196
199
  {
197
200
  "imports": {
198
- "@vue/reactivity": "${W}",
201
+ "@vue/reactivity": "${X}",
199
202
  "lit-html": "${J}"
200
203
  }
201
204
  }
202
205
  </script>
203
- ${B}
206
+ ${H}
204
207
  </head>
205
208
  <body>
206
209
  <${z}></${z}>
207
210
  <script type="module" src="./${z}.js"></script>
208
211
  </body>
209
- </html>`;return{files:[V],html:H}}return tZ(Y,{litHtmlSrc:J,projectStyle:G,reactivitySrc:W,title:Q})}async function w_(Z,X){let[Q,W]=await Promise.all([X7(Z),X9(Z)]),{writeFileSync:J,mkdirSync:G}=await import("node:fs"),{dirname:Y,join:z}=await import("node:path");if(X){J(X,Q.html,"utf8"),console.error(`Written to ${X}`);let q=Y(X);for(let K of Q.files){let V=z(q,K.path);G(Y(V),{recursive:!0}),J(V,K.content,"utf8"),console.error(`Written to ${V}`)}}else process.stdout.write(Q.html);if(W&&X){let q=X.replace(/(\.[^.]+)?$/,"-server.js");J(q,W,"utf8"),console.error(`Server handler written to ${q}`)}}var wJ=c(()=>{B6();dZ();W9();AJ();Z7();k4();A6();B6();dZ();W9();Z7()});function jJ(Z,X){if(X.length===0)return{content:Z??"",patched:!1};let Q={};if(Z)try{Q=JSON.parse(Z)}catch{return{content:Z,patched:!1}}for(let W of X)OJ(Q,W);return{content:`${JSON.stringify(Q,null,"\t")}
210
- `,patched:!0}}function OJ(Z,X){for(let[Q,W]of Object.entries(X)){let J=Z[Q];if(Array.isArray(W)){Z[Q]=hH(Array.isArray(J)?J:[],W);continue}if(j8(W)){if(j8(J))OJ(J,W);else if(J===void 0)Z[Q]=structuredClone(W);continue}if(J===void 0)Z[Q]=W}}function hH(Z,X){let Q=[...Z];for(let W of X){if(!j8(W)||typeof W.binding!=="string"){if(!Q.some((Y)=>JSON.stringify(Y)===JSON.stringify(W)))Q.push(structuredClone(W));continue}let J=Q.findIndex((G)=>j8(G)&&G.binding===W.binding);if(J===-1)Q.push(structuredClone(W));else Q[J]={...Q[J],...W}}return Q}function j8(Z){return Z!==null&&typeof Z==="object"&&!Array.isArray(Z)}var EJ=()=>{};import{existsSync as uH,readFileSync as mH}from"node:fs";import{resolve as RJ}from"node:path";function A1(Z){let X=RJ(Z,"project.json");if(!uH(X))throw Error(`project.json not found in ${Z}`);let Q;try{Q=XJ(mH(X,"utf8"),X)}catch(Y){throw Error(`Invalid project.json: ${F6(Y)}`,{cause:Y})}let W={...O8,...Q,build:{...O8.build,...Q.build},defaults:{...O8.defaults,...Q.defaults},images:{...O8.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;let J=["cloudflare-workers","cloudflare-pages","node","bun"];if(W.build.adapter==="static")delete W.build.adapter;if(W.build.adapter&&!J.includes(W.build.adapter))throw Error(`Unknown build adapter "${W.build.adapter}" in project.json. Valid adapters: ${J.join(", ")}`);let G=["build","cloudflare"];if(!G.includes(W.images.service))throw Error(`Unknown images.service "${W.images.service}" in project.json. Valid services: ${G.join(", ")}`);return{config:W,configPath:X,projectRoot:RJ(Z)}}var O8;var E8=c(()=>{A6();O8={$head:[],$media:{},build:{format:"directory",outDir:"./dist",provider:null,trailingSlash:"always"},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:""}});var kJ={};x6(kJ,{readDevVars:()=>SJ,dbPush:()=>dH});import{existsSync as Q7,readFileSync as PJ,writeFileSync as lH}from"node:fs";import{resolve as CJ}from"node:path";async function dH(Z,X={}){let{dryRun:Q=!1,connection:W}=X,{config:J}=A1(Z),G=await M6(Z,J),Y=J.connections??{},z=J.data??{},q=Object.keys(Y).filter((A)=>!W||A===W);if(W&&q.length===0)throw Error(`Unknown connection "${W}" (no such connections entry in project.json)`);if(q.length===0)throw Error('project.json has no "connections" section — nothing to push. Declare a connection and '+'its tables in the "data" section first.');let K={...process.env,...SJ(Z),JX_PROJECT_ROOT:Z},V=[],B=[];for(let A of q){let M={...Y[A],$name:A},I=String(M.provider??""),N=cH(G.connectors(),I);if(!N)throw Error(`Connection "${A}" names provider "${I}", but no enabled extension provides it (enable the extension in project.json "extensions")`);let T={};for(let[v,x]of Object.entries(z))if(x.connection===A)T[v]=x;let S=await N.call("deploySchema",T,M,{dryRun:Q,env:K});if(V.push({applied:S.applied??!Q,connection:A,provider:I,statements:S.statements??[],tables:Object.keys(T),warnings:S.warnings??[]}),N.capabilities.bindings){let v=await N.call("bindings",M);if(v&&Object.keys(v).length>0)B.push(v)}}let H=CJ(Z,"wrangler.jsonc"),F=!1;if(!Q&&B.length>0&&Q7(H)){let A=PJ(H,"utf8"),{content:M,patched:I}=jJ(A,B);if(I&&M!==A)lH(H,M,"utf8"),F=!0}return{bindingsPatched:F,results:V,wranglerPath:Q7(H)?H:null}}function cH(Z,X){return Z.find((Q)=>Q.connector?.provider===X)}function SJ(Z){let X=CJ(Z,".dev.vars");if(!Q7(X))return{};let Q={};for(let W of PJ(X,"utf8").split(`
211
- `)){let J=W.trim();if(J===""||J.startsWith("#"))continue;let G=J.indexOf("=");if(G===-1)continue;let Y=J.slice(0,G).trim(),z=J.slice(G+1).trim();if(z.startsWith('"')&&z.endsWith('"')||z.startsWith("'")&&z.endsWith("'"))z=z.slice(1,-1);if(Y!=="")Q[Y]=z}return Q}var bJ=c(()=>{EJ();I6();E8()});import{readFileSync as _J,readdirSync as pH}from"node:fs";import{extname as W7,join as nH,relative as iH,resolve as rH}from"node:path";async function J9(Z,X){let Q=_J(Z,"utf8");if(Z.endsWith(".json"))return L6(Q,Z);let W=W7(Z).toLowerCase(),J=X?.byExtension(W,"parse");if(!J)throw Error(`No format class registered for "${W}" (${Z}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`);return await J.call("parse",Q)}async function xJ(Z,X){let Q=[],W=new Set([".json",...X?.documentExtensions("page")??[]]);return await vJ(Z,Z,Q,W,X),Q.sort((J,G)=>{if(J.isDynamic!==G.isDynamic)return J.isDynamic?1:-1;if(J.isCatchAll!==G.isCatchAll)return J.isCatchAll?1:-1;return J.urlPattern.localeCompare(G.urlPattern)}),Q}async function vJ(Z,X,Q,W,J){let G=pH(Z,{withFileTypes:!0});for(let Y of G){let z=nH(Z,Y.name);if(Y.isDirectory()){if(Y.name.startsWith("_"))continue;await vJ(z,X,Q,W,J);continue}let q=W7(Y.name).toLowerCase();if(!W.has(q))continue;if(Y.name.startsWith("_"))continue;let K=iH(X,z),V=await aH(K,z,J);if(V)Q.push(V)}}async function aH(Z,X,Q){let W=W7(Z),J=W?Z.slice(0,-W.length):Z;if(J=J.split("\\").join("/"),J.endsWith("/index"))J=J.slice(0,-6)||"/";else if(J==="index")J="/";if(!J.startsWith("/"))J=`/${J}`;let G=[],Y=!1,z=!1,q=J.replaceAll(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(V,B,H)=>{if(B)return z=!0,Y=!0,G.push(B),"*";return Y=!0,G.push(H),`:${H}`}),K=null;try{let B=(await J9(X,Q)).$layout;if(typeof B==="string")K=B}catch{}return{$layout:K,isCatchAll:z,isDynamic:Y,params:G,relativePath:Z,sourcePath:X,urlPattern:q}}async function yJ(Z,X,Q={},W,J){let G=[];for(let Y of Z){if(!Y.isDynamic){G.push(Y);continue}let z;try{z=await J9(Y.sourcePath,W?.formats)}catch{G.push(Y);continue}if(!z.$paths){console.warn(`Warning: dynamic route ${Y.urlPattern} has no $paths — skipping`);continue}let q=await sH(z.$paths,X,Q,W,J);for(let K of q){let V=Y.urlPattern,B={};for(let[H,F]of Object.entries(K))B[H]=String(F),V=V.replace(`:${H}`,B[H]),V=V.replace("*",B[H]);G.push({...Y,_pathParams:B,isCatchAll:!1,isDynamic:!1,params:[],urlPattern:V})}}return G}async function sH(Z,X,Q,W,J){if(Array.isArray(Z))return Z;if("values"in Z&&Array.isArray(Z.values)){let G=typeof Z.param==="string"?Z.param:"value";return Z.values.map((Y)=>({[G]:Y}))}if("$ref"in Z&&typeof Z.$ref==="string"&&Z.$ref){let G=Z.$ref,Y=rH(X,G),z;try{z=JSON.parse(_J(Y,"utf8"))}catch(V){return console.warn(`Warning: $paths.$ref could not load "${G}": ${V.message}`),[]}if(!Array.isArray(z))return console.warn(`Warning: $paths.$ref "${G}" must be a JSON array`),[];let q=typeof Z.param==="string"?Z.param:"id",K=typeof Z.field==="string"?Z.field:"id";return z.map((V)=>({[q]:V[K]??V.id??String(V)}))}for(let G of Object.keys(Z)){let Y=W?.byPathsDiscriminator(G);if(!Y?.project)continue;return await Y.call("resolvePaths",Z,{data:Q[Y.project.key],projectConfig:J,root:X})}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var gJ=c(()=>{A6()});async function fJ(Z,X,Q){let W={},J=D8(Z);for(let G of Q.projectContributions()){let Y=G.project?.key;if(!Y||!G.capabilities.projectData)continue;if(!X||!(Y in X))continue;W[Y]=await G.call("projectData",X[Y],{io:J,projectConfig:X,registry:Q,root:Z})}return W}var hJ=c(()=>{I6()});import{existsSync as oH,readFileSync as tH}from"node:fs";import{resolve as eH}from"node:path";function J7(Z,X,Q){let W=Z.$layout??X.defaults?.layout??null;if(!W)return Z;let J=eH(Q,W);if(!oH(J))throw Error(`Layout not found: ${W} (resolved to ${J})`);let G;try{G=L6(tH(J,"utf8"),J)}catch(K){throw Error(`Invalid layout JSON at ${J}: ${K.message}`,{cause:K})}if(G.$layout)G=J7(G,X,Q);let Y=Z.children??[],z=typeof Y==="string"?[Y]:Array.isArray(Y)?Y:[],q=XF(G);if(ZF(q,z),Z.state)q.state={...q.state,...Z.state};if(Z.$media)q.$media={...q.$media,...Z.$media};if(Z.style)q.style={...q.style,...Z.style};if(Z.attributes)q.attributes={...q.attributes,...Z.attributes};if(Z.$head)q._pageHead=Z.$head;if(Z.title)q._pageTitle=Z.title;return delete q.$layout,q}function ZF(Z,X){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let Q=new Map,W=[];for(let J of X)if(J&&typeof J==="object"&&J.attributes?.slot){let G=J.attributes.slot;if(!Q.has(G))Q.set(G,[]);Q.get(G).push(J)}else W.push(J);uJ(Z,Q,W)}function uJ(Z,X,Q){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let W=[];for(let J of Z.children)if(J&&typeof J==="object"&&J.tagName==="slot"){let G=J.attributes?.name;if(G&&X.has(G))W.push(...X.get(G)),X.delete(G);else if(!G&&Q.length>0)W.push(...Q);else if(Array.isArray(J.children))W.push(...J.children)}else uJ(J,X,Q),W.push(J);Z.children=W}function XF(Z){return structuredClone(Z)}var mJ=c(()=>{A6()});function lJ(Z=[],X=[],Q=[],W={}){let J=[{attributes:{charset:W.charset??"utf8"},tagName:"meta"},{attributes:{content:"width=device-width, initial-scale=1",name:"viewport"},tagName:"meta"}],G=new Map;for(let z of[...J,...Z,...X,...Q]){let q=QF(z);G.set(q,z)}let Y=W.title??W.siteName??"Jx Site";if(G.set("title",{children:[Y],tagName:"title"}),W.pageUrl&&W.siteUrl){let z=new URL(W.pageUrl,W.siteUrl).href;G.set("link:canonical",{attributes:{href:z,rel:"canonical"},tagName:"link"})}return[...G.values()]}function QF(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:${WF(W)}`}return`${X}:${JSON.stringify(Z)}`}function WF(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 dJ(Z){return Z.map((X)=>JF(X)).join(`
212
- `)}function JF(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(([z,q])=>q===!0?z:`${z}="${GF(q)}"`).join(" "),J=W?`<${X} ${W}>`:`<${X}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(X))return J;let Y=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`${J}${Y}</${X}>`}function GF(Z){return String(Z).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}import{dirname as YF,relative as zF,resolve as $F}from"node:path";function cJ(Z,X,Q,W=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,G]of Object.entries(X.state))if(J!=="$site"&&J!=="$page"&&!(J in Z.state))Z.state[J]=G}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,G]of Object.entries(X.imports))if(!(J in Z.imports)){let Y=G;if(W&&Q.sourcePath&&(Y.startsWith("./")||Y.startsWith("../"))){let z=$F(W,Y);Z.imports[J]=`./${zF(YF(Q.sourcePath),z)}`}else Z.imports[J]=Y}}if(X.$elements?.length)if(!Z.$elements?.length)Z.$elements=[...X.$elements];else{let J=new Set,G=[];for(let Y of[...X.$elements,...Z.$elements]){let z=typeof Y==="string"?Y:Y?.$ref;if(z&&!J.has(z))J.add(z),G.push(Y)}Z.$elements=G}return Z}var pJ=()=>{};import{readFileSync as qF}from"node:fs";import{dirname as G7,resolve as R8}from"node:path";import{createRequire as KF}from"node:module";async function nJ(Z,X,Q,W={}){let J=Z.imports??{},{state:G}=Z;if(!G)return;for(let[Y,z]of Object.entries(G)){if(!v6(z))continue;if(UF.has(z.$prototype))continue;if(z.timing&&z.timing!=="compiler"){let q=W.registry?.byName(z.$prototype);if(q?.capabilities.lower)try{let K=await q.call("lower",z,{projectConfig:W.config,root:Q,route:X});G[Y]=K}catch(K){console.warn(`prototype-resolver: failed to lower "${Y}" ($prototype: "${z.$prototype}"):`,F6(K))}continue}if(!z.$src){let q=J[z.$prototype]??BF(W,z.$prototype);if(!q)continue;z.$src=q}try{let q=await HF(z,X,Q,G,W);if(z.timing&&q&&typeof q==="object"&&!Array.isArray(q))q.timing=z.timing;G[Y]=q}catch(q){console.warn(`prototype-resolver: failed to resolve "${Y}" ($prototype: "${z.$prototype}"):`,F6(q))}}}function BF(Z,X){return Z.registry?.byName(X)?.classPath}async function HF(Z,X,Q,W,J){let G=Z.$src;if(!G)throw Error(`$prototype "${Z.$prototype}" has no $src to resolve`);let Y;if(G.startsWith("./")||G.startsWith("../"))Y=X.sourcePath?R8(G7(X.sourcePath),G):R8(Q,G);else Y=KF(R8(Q,"package.json")).resolve(G);let z=qF(Y,"utf8"),q=QJ(z,Y);if(!q.$implementation)throw Error(`${G} has no $implementation field`);let K=R8(G7(Y),q.$implementation),V=await N8(K),B=Z.$export??q.title??Z.$prototype,H=V[B]??V.default?.[B];if(!H)throw Error(`Module ${q.$implementation} does not export "${B}"`);let F={};for(let[M,I]of Object.entries(Z))if(!VF.has(M))F[M]=I;if(F.src&&!F.basePath&&X.sourcePath)F.basePath=G7(X.sourcePath);F._project={config:J.config??null,root:Q,...J.sections},F._document={route:X,state:W};let A=new H(F);if(typeof A.resolve==="function")return await A.resolve();return A}var UF,VF;var iJ=c(()=>{I6();k4();A6();UF=new Set(["Function","LocalStorage","SessionStorage","Array"]),VF=new Set(["$prototype","$src","$export","timing","default","description"])});var rJ=(Z)=>typeof Z<"u"&&Z!==null,FF=(Z)=>typeof Z==="object",LF=(Z)=>Object.prototype.toString.call(Z)==="[object Object]",AF=(Z)=>typeof Z==="function",MF=(Z)=>typeof Z==="boolean",IF=(Z)=>Z instanceof Buffer,NF=(Z)=>{if(rJ(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},DF=(Z)=>Z instanceof ArrayBuffer,TF=(Z)=>typeof Z==="string"&&Z.length>0,wF=(Z)=>typeof Z==="number"&&Number.isFinite(Z),jF=(Z)=>Number.isInteger(Z),OF=(Z,X,Q)=>Z>=X&&Z<=Q,EF=(Z,X)=>X.includes(Z),RF=(Z,X,Q)=>Error(`Expected ${X} for ${Z} but received ${Q} of type ${typeof Q}`),PF=(Z,X)=>{return X.message=Z.message,X},$;var v4=c(()=>{/*!
212
+ </html>`;return{files:[V],html:B}}return U7(Y,{litHtmlSrc:J,projectStyle:G,reactivitySrc:X,title:W})}async function Ax(Z,Q){let[W,X]=await Promise.all([B7(Z),$9(Z)]),{writeFileSync:J,mkdirSync:G}=await import("node:fs"),{dirname:Y,join:z}=await import("node:path");if(Q){J(Q,W.html,"utf8"),console.error(`Written to ${Q}`);let q=Y(Q);for(let K of W.files){let V=z(q,K.path);G(Y(V),{recursive:!0}),J(V,K.content,"utf8"),console.error(`Written to ${V}`)}}else process.stdout.write(W.html);if(X&&Q){let q=Q.replace(/(\.[^.]+)?$/,"-server.js");J(q,X,"utf8"),console.error(`Server handler written to ${q}`)}}var uJ=u(()=>{I6();W7();K9();xJ();H7();y4();T6();I6();W7();K9();H7()});function mJ(Z,Q){if(Q.length===0)return{content:Z??"",patched:!1};let W={};if(Z)try{W=JSON.parse(Z)}catch{return{content:Z,patched:!1}}for(let X of Q)lJ(W,X);return{content:`${JSON.stringify(W,null,"\t")}
213
+ `,patched:!0}}function lJ(Z,Q){for(let[W,X]of Object.entries(Q)){let J=Z[W];if(Array.isArray(X)){Z[W]=LF(Array.isArray(J)?J:[],X);continue}if(b8(X)){if(b8(J))lJ(J,X);else if(J===void 0)Z[W]=structuredClone(X);continue}if(J===void 0)Z[W]=X}}function LF(Z,Q){let W=[...Z];for(let X of Q){if(!b8(X)||typeof X.binding!=="string"){if(!W.some((Y)=>JSON.stringify(Y)===JSON.stringify(X)))W.push(structuredClone(X));continue}let J=W.findIndex((G)=>b8(G)&&G.binding===X.binding);if(J===-1)W.push(structuredClone(X));else W[J]={...W[J],...X}}return W}function b8(Z){return Z!==null&&typeof Z==="object"&&!Array.isArray(Z)}var dJ=()=>{};import{existsSync as AF,readFileSync as MF}from"node:fs";import{resolve as cJ}from"node:path";function w1(Z){let Q=cJ(Z,"project.json");if(!AF(Q))throw Error(`project.json not found in ${Z}`);let W;try{W=MJ(MF(Q,"utf8"),Q)}catch(Y){throw Error(`Invalid project.json: ${D6(Y)}`,{cause:Y})}let X={...x8,...W,build:{...x8.build,...W.build},defaults:{...x8.defaults,...W.defaults},images:{...x8.images,...W.images}};if(W.$head)X.$head=W.$head;if(W.$media)X.$media=W.$media;if(W.style)X.style=W.style;if(W.state)X.state=W.state;if(W.redirects)X.redirects=W.redirects;if(W.imports)X.imports=W.imports;let J=["cloudflare-workers","cloudflare-pages","node","bun"];if(X.build.adapter==="static")delete X.build.adapter;if(X.build.adapter&&!J.includes(X.build.adapter))throw Error(`Unknown build adapter "${X.build.adapter}" in project.json. Valid adapters: ${J.join(", ")}`);let G=["build","cloudflare"];if(!G.includes(X.images.service))throw Error(`Unknown images.service "${X.images.service}" in project.json. Valid services: ${G.join(", ")}`);return{config:X,configPath:Q,projectRoot:cJ(Z)}}var x8;var v8=u(()=>{T6();x8={$head:[],$media:{},build:{format:"directory",outDir:"./dist",provider:null,trailingSlash:"always"},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:""}});var rJ={};e4(rJ,{readDevVars:()=>nJ,dbPush:()=>NF});import{existsSync as F7,readFileSync as pJ,writeFileSync as IF}from"node:fs";import{resolve as iJ}from"node:path";async function NF(Z,Q={}){let{dryRun:W=!1,connection:X}=Q,{config:J}=w1(Z),G=await j6(Z,J),Y=J.connections??{},z=J.data??{},q=Object.keys(Y).filter((A)=>!X||A===X);if(X&&q.length===0)throw Error(`Unknown connection "${X}" (no such connections entry in project.json)`);if(q.length===0)throw Error('project.json has no "connections" section — nothing to push. Declare a connection and '+'its tables in the "data" section first.');let K={...process.env,...nJ(Z),JX_PROJECT_ROOT:Z},V=[],H=[];for(let A of q){let M={...Y[A],$name:A},I=String(M.provider??""),N=DF(G.connectors(),I);if(!N)throw Error(`Connection "${A}" names provider "${I}", but no enabled extension provides it (enable the extension in project.json "extensions")`);let D={};for(let[v,x]of Object.entries(z))if(x.connection===A)D[v]=x;let P=await N.call("deploySchema",D,M,{dryRun:W,env:K});if(V.push({applied:P.applied??!W,connection:A,provider:I,statements:P.statements??[],tables:Object.keys(D),warnings:P.warnings??[]}),N.capabilities.bindings){let v=await N.call("bindings",M);if(v&&Object.keys(v).length>0)H.push(v)}}let B=iJ(Z,"wrangler.jsonc"),F=!1;if(!W&&H.length>0&&F7(B)){let A=pJ(B,"utf8"),{content:M,patched:I}=mJ(A,H);if(I&&M!==A)IF(B,M,"utf8"),F=!0}return{bindingsPatched:F,results:V,wranglerPath:F7(B)?B:null}}function DF(Z,Q){return Z.find((W)=>W.connector?.provider===Q)}function nJ(Z){let Q=iJ(Z,".dev.vars");if(!F7(Q))return{};let W={};for(let X of pJ(Q,"utf8").split(`
214
+ `)){let J=X.trim();if(J===""||J.startsWith("#"))continue;let G=J.indexOf("=");if(G===-1)continue;let Y=J.slice(0,G).trim(),z=J.slice(G+1).trim();if(z.startsWith('"')&&z.endsWith('"')||z.startsWith("'")&&z.endsWith("'"))z=z.slice(1,-1);if(Y!=="")W[Y]=z}return W}var aJ=u(()=>{dJ();E6();v8()});import{readFileSync as sJ,readdirSync as wF}from"node:fs";import{extname as L7,join as TF,relative as jF,resolve as EF}from"node:path";async function U9(Z,Q){let W=sJ(Z,"utf8");if(Z.endsWith(".json"))return w6(W,Z);let X=L7(Z).toLowerCase(),J=Q?.byExtension(X,"parse");if(!J)throw Error(`No format class registered for "${X}" (${Z}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`);return await J.call("parse",W)}async function oJ(Z,Q){let W=[],X=new Set([".json",...Q?.documentExtensions("page")??[]]);return await tJ(Z,Z,W,X,Q),W.sort((J,G)=>{if(J.isDynamic!==G.isDynamic)return J.isDynamic?1:-1;if(J.isCatchAll!==G.isCatchAll)return J.isCatchAll?1:-1;return J.urlPattern.localeCompare(G.urlPattern)}),W}async function tJ(Z,Q,W,X,J){let G=wF(Z,{withFileTypes:!0});for(let Y of G){let z=TF(Z,Y.name);if(Y.isDirectory()){if(Y.name.startsWith("_"))continue;await tJ(z,Q,W,X,J);continue}let q=L7(Y.name).toLowerCase();if(!X.has(q))continue;if(Y.name.startsWith("_"))continue;let K=jF(Q,z),V=await OF(K,z,J);if(V)W.push(V)}}async function OF(Z,Q,W){let X=L7(Z),J=X?Z.slice(0,-X.length):Z;if(J=J.split("\\").join("/"),J.endsWith("/index"))J=J.slice(0,-6)||"/";else if(J==="index")J="/";if(!J.startsWith("/"))J=`/${J}`;let G=[],Y=!1,z=!1,q=J.replaceAll(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(V,H,B)=>{if(H)return z=!0,Y=!0,G.push(H),"*";return Y=!0,G.push(B),`:${B}`}),K=null;try{let H=(await U9(Q,W)).$layout;if(typeof H==="string")K=H}catch{}return{$layout:K,isCatchAll:z,isDynamic:Y,params:G,relativePath:Z,sourcePath:Q,urlPattern:q}}async function eJ(Z,Q,W={},X,J){let G=[];for(let Y of Z){if(!Y.isDynamic){G.push(Y);continue}let z;try{z=await U9(Y.sourcePath,X?.formats)}catch{G.push(Y);continue}if(!z.$paths){console.warn(`Warning: dynamic route ${Y.urlPattern} has no $paths — skipping`);continue}let q=await RF(z.$paths,Q,W,X,J);for(let K of q){let V=Y.urlPattern,H={};for(let[B,F]of Object.entries(K))H[B]=String(F),V=V.replace(`:${B}`,H[B]),V=V.replace("*",H[B]);G.push({...Y,_pathParams:H,isCatchAll:!1,isDynamic:!1,params:[],urlPattern:V})}}return G}async function RF(Z,Q,W,X,J){if(Array.isArray(Z))return Z;if("values"in Z&&Array.isArray(Z.values)){let G=typeof Z.param==="string"?Z.param:"value";return Z.values.map((Y)=>({[G]:Y}))}if("$ref"in Z&&typeof Z.$ref==="string"&&Z.$ref){let G=Z.$ref,Y=EF(Q,G),z;try{z=JSON.parse(sJ(Y,"utf8"))}catch(V){return console.warn(`Warning: $paths.$ref could not load "${G}": ${V.message}`),[]}if(!Array.isArray(z))return console.warn(`Warning: $paths.$ref "${G}" must be a JSON array`),[];let q=typeof Z.param==="string"?Z.param:"id",K=typeof Z.field==="string"?Z.field:"id";return z.map((V)=>({[q]:V[K]??V.id??String(V)}))}for(let G of Object.keys(Z)){let Y=X?.byPathsDiscriminator(G);if(!Y?.project)continue;return await Y.call("resolvePaths",Z,{data:W[Y.project.key],projectConfig:J,root:Q})}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var ZG=u(()=>{T6()});async function QG(Z,Q,W){let X={},J=S8(Z);for(let G of W.projectContributions()){let Y=G.project?.key;if(!Y||!G.capabilities.projectData)continue;if(!Q||!(Y in Q))continue;X[Y]=await G.call("projectData",Q[Y],{io:J,projectConfig:Q,registry:W,root:Z})}return X}var WG=u(()=>{E6()});import{existsSync as PF,readFileSync as CF}from"node:fs";import{resolve as SF}from"node:path";function A7(Z,Q,W){let X=Z.$layout??Q.defaults?.layout??null;if(!X)return Z;let J=SF(W,X);if(!PF(J))throw Error(`Layout not found: ${X} (resolved to ${J})`);let G;try{G=w6(CF(J,"utf8"),J)}catch(K){throw Error(`Invalid layout JSON at ${J}: ${K.message}`,{cause:K})}if(G.$layout)G=A7(G,Q,W);let Y=Z.children??[],z=typeof Y==="string"?[Y]:Array.isArray(Y)?Y:[],q=_F(G);if(kF(q,z),Z.state)q.state={...q.state,...Z.state};if(Z.$media)q.$media={...q.$media,...Z.$media};if(Z.style)q.style={...q.style,...Z.style};if(Z.attributes)q.attributes={...q.attributes,...Z.attributes};if(Z.$head)q._pageHead=Z.$head;if(Z.title)q._pageTitle=Z.title;return delete q.$layout,q}function kF(Z,Q){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let W=new Map,X=[];for(let J of Q)if(J&&typeof J==="object"&&J.attributes?.slot){let G=J.attributes.slot;if(!W.has(G))W.set(G,[]);W.get(G).push(J)}else X.push(J);XG(Z,W,X)}function XG(Z,Q,W){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let X=[];for(let J of Z.children)if(J&&typeof J==="object"&&J.tagName==="slot"){let G=J.attributes?.name;if(G&&Q.has(G))X.push(...Q.get(G)),Q.delete(G);else if(!G&&W.length>0)X.push(...W);else if(Array.isArray(J.children))X.push(...J.children)}else XG(J,Q,W),X.push(J);Z.children=X}function _F(Z){return structuredClone(Z)}var JG=u(()=>{T6()});function GG(Z=[],Q=[],W=[],X={}){let J=[{attributes:{charset:X.charset??"utf8"},tagName:"meta"},{attributes:{content:"width=device-width, initial-scale=1",name:"viewport"},tagName:"meta"}],G=new Map;for(let z of[...J,...Z,...Q,...W]){let q=bF(z);G.set(q,z)}let Y=X.title??X.siteName??"Jx Site";if(G.set("title",{children:[Y],tagName:"title"}),X.pageUrl&&X.siteUrl){let z=new URL(X.pageUrl,X.siteUrl).href;if(G.set("link:canonical",{attributes:{href:z,rel:"canonical"},tagName:"link"}),!G.has("meta:og:url"))G.set("meta:og:url",{attributes:{content:z,property:"og:url"},tagName:"meta"})}if(X.siteName&&!G.has("meta:og:site_name"))G.set("meta:og:site_name",{attributes:{content:X.siteName,property:"og:site_name"},tagName:"meta"});return[...G.values()]}function bF(Z){if(!Z||typeof Z!=="object")return String(Z);let Q=Z.tagName??"unknown",W=Z.attributes??{};if(Q==="title")return"title";if(W.charset)return"meta:charset";if(Q==="meta"&&W.name)return`meta:${W.name}`;if(Q==="meta"&&W.property)return`meta:${W.property}`;if(Q==="link"&&W.rel)return`link:${W.rel}:${W.href??""}`;if(Q==="script"&&W.src)return`script:${W.src}`;if(Q==="style"){let X=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`style:${xF(X)}`}return`${Q}:${JSON.stringify(Z)}`}function xF(Z){let Q=0;for(let W=0;W<Z.length;W++)Q=Math.trunc((Q<<5)-Q+(Z.codePointAt(W)??0));return Q.toString(36)}function YG(Z){return Z.map((Q)=>vF(Q)).join(`
215
+ `)}function vF(Z){if(typeof Z==="string")return Z;if(!Z||typeof Z!=="object")return"";let Q=Z.tagName,W=Z.attributes??{},X=Object.entries(W).map(([z,q])=>q===!0?z:`${z}="${yF(q)}"`).join(" "),J=X?`<${Q} ${X}>`:`<${Q}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(Q))return J;let Y=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`${J}${Y}</${Q}>`}function yF(Z){return String(Z).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}import{dirname as gF,relative as fF,resolve as hF}from"node:path";function zG(Z,Q,W,X=null){if(!Z.state)Z.state={};if(Z.state.$site={name:Q.name??"Jx Site",url:Q.url??"",...Q.state},Z.state.$page={params:W._pathParams??{},title:Z.title??Z._pageTitle??Q.name??"",url:W.urlPattern},Q.state){for(let[J,G]of Object.entries(Q.state))if(J!=="$site"&&J!=="$page"&&!(J in Z.state))Z.state[J]=G}if(Q.$media)Z.$media={...Q.$media,...Z.$media};if(Q.imports&&Object.keys(Q.imports).length>0){if(!Z.imports)Z.imports={};for(let[J,G]of Object.entries(Q.imports))if(!(J in Z.imports)){let Y=G;if(X&&W.sourcePath&&(Y.startsWith("./")||Y.startsWith("../"))){let z=hF(X,Y);Z.imports[J]=`./${fF(gF(W.sourcePath),z)}`}else Z.imports[J]=Y}}if(Q.$elements?.length)if(!Z.$elements?.length)Z.$elements=[...Q.$elements];else{let J=new Set,G=[];for(let Y of[...Q.$elements,...Z.$elements]){let z=typeof Y==="string"?Y:Y?.$ref;if(z&&!J.has(z))J.add(z),G.push(Y)}Z.$elements=G}return Z}var $G=()=>{};import{readFileSync as uF}from"node:fs";import{dirname as M7,resolve as y8}from"node:path";import{createRequire as mF}from"node:module";async function qG(Z,Q,W,X={}){let J=Z.imports??{},{state:G}=Z;if(!G)return;for(let[Y,z]of Object.entries(G)){if(!m6(z))continue;if(lF.has(z.$prototype))continue;if(z.timing&&z.timing!=="compiler"){let q=X.registry?.byName(z.$prototype);if(q?.capabilities.lower)try{let K=await q.call("lower",z,{projectConfig:X.config,root:W,route:Q});G[Y]=K}catch(K){console.warn(`prototype-resolver: failed to lower "${Y}" ($prototype: "${z.$prototype}"):`,D6(K))}continue}if(!z.$src){let q=J[z.$prototype]??cF(X,z.$prototype);if(!q)continue;z.$src=q}try{let q=await pF(z,Q,W,G,X);if(z.timing&&q&&typeof q==="object"&&!Array.isArray(q))q.timing=z.timing;G[Y]=q}catch(q){console.warn(`prototype-resolver: failed to resolve "${Y}" ($prototype: "${z.$prototype}"):`,D6(q))}}}function cF(Z,Q){return Z.registry?.byName(Q)?.classPath}async function pF(Z,Q,W,X,J){let G=Z.$src;if(!G)throw Error(`$prototype "${Z.$prototype}" has no $src to resolve`);let Y;if(G.startsWith("./")||G.startsWith("../"))Y=Q.sourcePath?y8(M7(Q.sourcePath),G):y8(W,G);else Y=mF(y8(W,"package.json")).resolve(G);let z=uF(Y,"utf8"),q=IJ(z,Y);if(!q.$implementation)throw Error(`${G} has no $implementation field`);let K=y8(M7(Y),q.$implementation),V=await C8(K),H=Z.$export??q.title??Z.$prototype,B=V[H]??V.default?.[H];if(!B)throw Error(`Module ${q.$implementation} does not export "${H}"`);let F={};for(let[M,I]of Object.entries(Z))if(!dF.has(M))F[M]=I;if(F.src&&!F.basePath&&Q.sourcePath)F.basePath=M7(Q.sourcePath);F._project={config:J.config??null,root:W,...J.sections},F._document={route:Q,state:X};let A=new B(F);if(typeof A.resolve==="function")return await A.resolve();return A}var lF,dF;var KG=u(()=>{E6();y4();T6();lF=new Set(["Function","LocalStorage","SessionStorage","Array"]),dF=new Set(["$prototype","$src","$export","timing","default","description"])});var UG=(Z)=>typeof Z<"u"&&Z!==null,iF=(Z)=>typeof Z==="object",nF=(Z)=>Object.prototype.toString.call(Z)==="[object Object]",rF=(Z)=>typeof Z==="function",aF=(Z)=>typeof Z==="boolean",sF=(Z)=>Z instanceof Buffer,oF=(Z)=>{if(UG(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},tF=(Z)=>Z instanceof ArrayBuffer,eF=(Z)=>typeof Z==="string"&&Z.length>0,ZL=(Z)=>typeof Z==="number"&&Number.isFinite(Z),QL=(Z)=>Number.isInteger(Z),WL=(Z,Q,W)=>Z>=Q&&Z<=W,XL=(Z,Q)=>Q.includes(Z),JL=(Z,Q,W)=>Error(`Expected ${Q} for ${Z} but received ${W} of type ${typeof W}`),GL=(Z,Q)=>{return Q.message=Z.message,Q},$;var u4=u(()=>{/*!
213
216
  Copyright 2013 Lovell Fuller and others.
214
217
  SPDX-License-Identifier: Apache-2.0
215
- */$={defined:rJ,object:FF,plainObject:LF,fn:AF,bool:MF,buffer:IF,typedArray:NF,arrayBuffer:DF,string:TF,number:wF,integer:jF,inRange:OF,inArray:EF,invalidParameterError:RF,nativeError:PF}});var oJ=j((Yx,sJ)=>{var aJ=()=>process.platform==="linux",P8=null,CF=()=>{if(!P8)if(aJ()&&process.report){let Z=process.report.excludeNetwork;process.report.excludeNetwork=!0,P8=process.report.getReport(),process.report.excludeNetwork=Z}else P8={};return P8};sJ.exports={isLinux:aJ,getReport:CF}});var eJ=j((zx,tJ)=>{var M1=_0("fs"),SF=(Z)=>{let X=M1.openSync(Z,"r"),Q=Buffer.alloc(2048),W=M1.readSync(X,Q,0,2048,0);return M1.close(X,()=>{}),Q.subarray(0,W)},kF=(Z)=>new Promise((X,Q)=>{M1.open(Z,"r",(W,J)=>{if(W)Q(W);else{let G=Buffer.alloc(2048);M1.read(J,G,0,2048,0,(Y,z)=>{X(G.subarray(0,z)),M1.close(J,()=>{})})}})});tJ.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:SF,readFile:kF}});var XG=j(($x,ZG)=>{var bF=(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 J=0;J<W;J++){let G=X+J*Q;if(Z.readUInt32LE(G)===3){let z=Z.readUInt32LE(G+8),q=Z.readUInt32LE(G+32);return Z.subarray(z,z+q).toString().replace(/\0.*$/g,"")}}return null};ZG.exports={interpreterPath:bF}});var S8=j((qx,MG)=>{var WG=_0("child_process"),{isLinux:I1,getReport:JG}=oJ(),{LDD_PATH:C8,SELF_PATH:GG,readFile:Y7,readFileSync:z7}=eJ(),{interpreterPath:YG}=XG(),y4,g4,f4,D6="",zG=()=>{if(!D6)return new Promise((Z)=>{WG.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(X,Q)=>{D6=X?" ":Q,Z(D6)})});return D6},$G=()=>{if(!D6)try{D6=WG.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(Z){D6=" "}return D6},e4="glibc",qG=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,l6="musl",_F=(Z)=>Z.includes("libc.musl-")||Z.includes("ld-musl-"),KG=()=>{let Z=JG();if(Z.header&&Z.header.glibcVersionRuntime)return e4;if(Array.isArray(Z.sharedObjects)){if(Z.sharedObjects.some(_F))return l6}return null},UG=(Z)=>{let[X,Q]=Z.split(/[\r\n]+/);if(X&&X.includes(e4))return e4;if(Q&&Q.includes(l6))return l6;return null},VG=(Z)=>{if(Z){if(Z.includes("/ld-musl-"))return l6;else if(Z.includes("/ld-linux-"))return e4}return null},BG=(Z)=>{if(Z=Z.toString(),Z.includes("musl"))return l6;if(Z.includes("GNU C Library"))return e4;return null},xF=async()=>{if(g4!==void 0)return g4;g4=null;try{let Z=await Y7(C8);g4=BG(Z)}catch(Z){}return g4},vF=()=>{if(g4!==void 0)return g4;g4=null;try{let Z=z7(C8);g4=BG(Z)}catch(Z){}return g4},yF=async()=>{if(y4!==void 0)return y4;y4=null;try{let Z=await Y7(GG),X=YG(Z);y4=VG(X)}catch(Z){}return y4},gF=()=>{if(y4!==void 0)return y4;y4=null;try{let Z=z7(GG),X=YG(Z);y4=VG(X)}catch(Z){}return y4},HG=async()=>{let Z=null;if(I1()){if(Z=await yF(),!Z){if(Z=await xF(),!Z)Z=KG();if(!Z){let X=await zG();Z=UG(X)}}}return Z},FG=()=>{let Z=null;if(I1()){if(Z=gF(),!Z){if(Z=vF(),!Z)Z=KG();if(!Z){let X=$G();Z=UG(X)}}}return Z},fF=async()=>I1()&&await HG()!==e4,hF=()=>I1()&&FG()!==e4,uF=async()=>{if(f4!==void 0)return f4;f4=null;try{let X=(await Y7(C8)).match(qG);if(X)f4=X[1]}catch(Z){}return f4},mF=()=>{if(f4!==void 0)return f4;f4=null;try{let X=z7(C8).match(qG);if(X)f4=X[1]}catch(Z){}return f4},LG=()=>{let Z=JG();if(Z.header&&Z.header.glibcVersionRuntime)return Z.header.glibcVersionRuntime;return null},QG=(Z)=>Z.trim().split(/\s+/)[1],AG=(Z)=>{let[X,Q,W]=Z.split(/[\r\n]+/);if(X&&X.includes(e4))return QG(X);if(Q&&W&&Q.includes(l6))return QG(W);return null},lF=async()=>{let Z=null;if(I1()){if(Z=await uF(),!Z)Z=LG();if(!Z){let X=await zG();Z=AG(X)}}return Z},dF=()=>{let Z=null;if(I1()){if(Z=mF(),!Z)Z=LG();if(!Z){let X=$G();Z=AG(X)}}return Z};MG.exports={GLIBC:e4,MUSL:l6,family:HG,familySync:FG,isNonGlibcLinux:fF,isNonGlibcLinuxSync:hF,version:lF,versionSync:dF}});var N1=j((Kx,IG)=>{var cF=Number.MAX_SAFE_INTEGER||9007199254740991,pF=["major","premajor","minor","preminor","patch","prepatch","prerelease"];IG.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:cF,RELEASE_TYPES:pF,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var G9=j((Ux,NG)=>{var nF=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...Z)=>console.error("SEMVER",...Z):()=>{};NG.exports=nF});var D1=j((h4,DG)=>{var{MAX_SAFE_COMPONENT_LENGTH:$7,MAX_SAFE_BUILD_LENGTH:iF,MAX_LENGTH:rF}=N1(),aF=G9();h4=DG.exports={};var sF=h4.re=[],oF=h4.safeRe=[],m=h4.src=[],tF=h4.safeSrc=[],l=h4.t={},eF=0,q7="[a-zA-Z0-9-]",ZL=[["\\s",1],["\\d",rF],[q7,iF]],XL=(Z)=>{for(let[X,Q]of ZL)Z=Z.split(`${X}*`).join(`${X}{0,${Q}}`).split(`${X}+`).join(`${X}{1,${Q}}`);return Z},t=(Z,X,Q)=>{let W=XL(X),J=eF++;aF(Z,J,X),l[Z]=J,m[J]=X,tF[J]=W,sF[J]=new RegExp(X,Q?"g":void 0),oF[J]=new RegExp(W,Q?"g":void 0)};t("NUMERICIDENTIFIER","0|[1-9]\\d*");t("NUMERICIDENTIFIERLOOSE","\\d+");t("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${q7}*`);t("MAINVERSION",`(${m[l.NUMERICIDENTIFIER]})\\.(${m[l.NUMERICIDENTIFIER]})\\.(${m[l.NUMERICIDENTIFIER]})`);t("MAINVERSIONLOOSE",`(${m[l.NUMERICIDENTIFIERLOOSE]})\\.(${m[l.NUMERICIDENTIFIERLOOSE]})\\.(${m[l.NUMERICIDENTIFIERLOOSE]})`);t("PRERELEASEIDENTIFIER",`(?:${m[l.NONNUMERICIDENTIFIER]}|${m[l.NUMERICIDENTIFIER]})`);t("PRERELEASEIDENTIFIERLOOSE",`(?:${m[l.NONNUMERICIDENTIFIER]}|${m[l.NUMERICIDENTIFIERLOOSE]})`);t("PRERELEASE",`(?:-(${m[l.PRERELEASEIDENTIFIER]}(?:\\.${m[l.PRERELEASEIDENTIFIER]})*))`);t("PRERELEASELOOSE",`(?:-?(${m[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${m[l.PRERELEASEIDENTIFIERLOOSE]})*))`);t("BUILDIDENTIFIER",`${q7}+`);t("BUILD",`(?:\\+(${m[l.BUILDIDENTIFIER]}(?:\\.${m[l.BUILDIDENTIFIER]})*))`);t("FULLPLAIN",`v?${m[l.MAINVERSION]}${m[l.PRERELEASE]}?${m[l.BUILD]}?`);t("FULL",`^${m[l.FULLPLAIN]}$`);t("LOOSEPLAIN",`[v=\\s]*${m[l.MAINVERSIONLOOSE]}${m[l.PRERELEASELOOSE]}?${m[l.BUILD]}?`);t("LOOSE",`^${m[l.LOOSEPLAIN]}$`);t("GTLT","((?:<|>)?=?)");t("XRANGEIDENTIFIERLOOSE",`${m[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);t("XRANGEIDENTIFIER",`${m[l.NUMERICIDENTIFIER]}|x|X|\\*`);t("XRANGEPLAIN",`[v=\\s]*(${m[l.XRANGEIDENTIFIER]})(?:\\.(${m[l.XRANGEIDENTIFIER]})(?:\\.(${m[l.XRANGEIDENTIFIER]})(?:${m[l.PRERELEASE]})?${m[l.BUILD]}?)?)?`);t("XRANGEPLAINLOOSE",`[v=\\s]*(${m[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[l.XRANGEIDENTIFIERLOOSE]})(?:${m[l.PRERELEASELOOSE]})?${m[l.BUILD]}?)?)?`);t("XRANGE",`^${m[l.GTLT]}\\s*${m[l.XRANGEPLAIN]}$`);t("XRANGELOOSE",`^${m[l.GTLT]}\\s*${m[l.XRANGEPLAINLOOSE]}$`);t("COERCEPLAIN",`(^|[^\\d])(\\d{1,${$7}})(?:\\.(\\d{1,${$7}}))?(?:\\.(\\d{1,${$7}}))?`);t("COERCE",`${m[l.COERCEPLAIN]}(?:$|[^\\d])`);t("COERCEFULL",m[l.COERCEPLAIN]+`(?:${m[l.PRERELEASE]})?(?:${m[l.BUILD]})?(?:$|[^\\d])`);t("COERCERTL",m[l.COERCE],!0);t("COERCERTLFULL",m[l.COERCEFULL],!0);t("LONETILDE","(?:~>?)");t("TILDETRIM",`(\\s*)${m[l.LONETILDE]}\\s+`,!0);h4.tildeTrimReplace="$1~";t("TILDE",`^${m[l.LONETILDE]}${m[l.XRANGEPLAIN]}$`);t("TILDELOOSE",`^${m[l.LONETILDE]}${m[l.XRANGEPLAINLOOSE]}$`);t("LONECARET","(?:\\^)");t("CARETTRIM",`(\\s*)${m[l.LONECARET]}\\s+`,!0);h4.caretTrimReplace="$1^";t("CARET",`^${m[l.LONECARET]}${m[l.XRANGEPLAIN]}$`);t("CARETLOOSE",`^${m[l.LONECARET]}${m[l.XRANGEPLAINLOOSE]}$`);t("COMPARATORLOOSE",`^${m[l.GTLT]}\\s*(${m[l.LOOSEPLAIN]})$|^$`);t("COMPARATOR",`^${m[l.GTLT]}\\s*(${m[l.FULLPLAIN]})$|^$`);t("COMPARATORTRIM",`(\\s*)${m[l.GTLT]}\\s*(${m[l.LOOSEPLAIN]}|${m[l.XRANGEPLAIN]})`,!0);h4.comparatorTrimReplace="$1$2$3";t("HYPHENRANGE",`^\\s*(${m[l.XRANGEPLAIN]})\\s+-\\s+(${m[l.XRANGEPLAIN]})\\s*$`);t("HYPHENRANGELOOSE",`^\\s*(${m[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${m[l.XRANGEPLAINLOOSE]})\\s*$`);t("STAR","(<|>)?=?\\s*\\*");t("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");t("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var k8=j((Vx,TG)=>{var QL=Object.freeze({loose:!0}),WL=Object.freeze({}),JL=(Z)=>{if(!Z)return WL;if(typeof Z!=="object")return QL;return Z};TG.exports=JL});var K7=j((Bx,OG)=>{var wG=/^[0-9]+$/,jG=(Z,X)=>{if(typeof Z==="number"&&typeof X==="number")return Z===X?0:Z<X?-1:1;let Q=wG.test(Z),W=wG.test(X);if(Q&&W)Z=+Z,X=+X;return Z===X?0:Q&&!W?-1:W&&!Q?1:Z<X?-1:1},GL=(Z,X)=>jG(X,Z);OG.exports={compareIdentifiers:jG,rcompareIdentifiers:GL}});var v0=j((Hx,RG)=>{var b8=G9(),{MAX_LENGTH:EG,MAX_SAFE_INTEGER:_8}=N1(),{safeRe:x8,t:v8}=D1(),YL=k8(),{compareIdentifiers:U7}=K7(),zL=(Z,X)=>{let Q=X.split(".");if(Q.length>Z.length)return!1;for(let W=0;W<Q.length;W++)if(U7(Z[W],Q[W])!==0)return!1;return!0};class O4{constructor(Z,X){if(X=YL(X),Z instanceof O4)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>EG)throw TypeError(`version is longer than ${EG} characters`);b8("SemVer",Z,X),this.options=X,this.loose=!!X.loose,this.includePrerelease=!!X.includePrerelease;let Q=Z.trim().match(X.loose?x8[v8.LOOSE]:x8[v8.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>_8||this.major<0)throw TypeError("Invalid major version");if(this.minor>_8||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>_8||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 J=+W;if(J>=0&&J<_8)return J}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(b8("SemVer.compare",this.version,this.options,Z),!(Z instanceof O4)){if(typeof Z==="string"&&Z===this.version)return 0;Z=new O4(Z,this.options)}if(Z.version===this.version)return 0;return this.compareMain(Z)||this.comparePre(Z)}compareMain(Z){if(!(Z instanceof O4))Z=new O4(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 O4))Z=new O4(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(b8("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 U7(Q,W)}while(++X)}compareBuild(Z){if(!(Z instanceof O4))Z=new O4(Z,this.options);let X=0;do{let Q=this.build[X],W=Z.build[X];if(b8("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 U7(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?x8[v8.PRERELEASELOOSE]:x8[v8.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 J=this.prerelease.length;while(--J>=0)if(typeof this.prerelease[J]==="number")this.prerelease[J]++,J=-2;if(J===-1){if(X===this.prerelease.join(".")&&Q===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(W)}}if(X){let J=[X,W];if(Q===!1)J=[X];if(zL(this.prerelease,X)){let G=this.prerelease[X.split(".").length];if(isNaN(G))this.prerelease=J}else this.prerelease=J}break}default:throw Error(`invalid increment argument: ${Z}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}RG.exports=O4});var T6=j((Fx,CG)=>{var PG=v0(),$L=(Z,X,Q=!1)=>{if(Z instanceof PG)return Z;try{return new PG(Z,X)}catch(W){if(!Q)return null;throw W}};CG.exports=$L});var kG=j((Lx,SG)=>{var qL=T6(),KL=(Z,X)=>{let Q=qL(Z,X);return Q?Q.version:null};SG.exports=KL});var _G=j((Ax,bG)=>{var UL=T6(),VL=(Z,X)=>{let Q=UL(Z.trim().replace(/^[=v]+/,""),X);return Q?Q.version:null};bG.exports=VL});var yG=j((Mx,vG)=>{var xG=v0(),BL=(Z,X,Q,W,J)=>{if(typeof Q==="string")J=W,W=Q,Q=void 0;try{return new xG(Z instanceof xG?Z.version:Z,Q).inc(X,W,J).version}catch(G){return null}};vG.exports=BL});var hG=j((Ix,fG)=>{var gG=T6(),HL=(Z,X)=>{let Q=gG(Z,null,!0),W=gG(X,null,!0),J=Q.compare(W);if(J===0)return null;let G=J>0,Y=G?Q:W,z=G?W:Q,q=!!Y.prerelease.length;if(!!z.prerelease.length&&!q){if(!z.patch&&!z.minor)return"major";if(z.compareMain(Y)===0){if(z.minor&&!z.patch)return"minor";return"patch"}}let V=q?"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"};fG.exports=HL});var mG=j((Nx,uG)=>{var FL=v0(),LL=(Z,X)=>new FL(Z,X).major;uG.exports=LL});var dG=j((Dx,lG)=>{var AL=v0(),ML=(Z,X)=>new AL(Z,X).minor;lG.exports=ML});var pG=j((Tx,cG)=>{var IL=v0(),NL=(Z,X)=>new IL(Z,X).patch;cG.exports=NL});var iG=j((wx,nG)=>{var DL=T6(),TL=(Z,X)=>{let Q=DL(Z,X);return Q&&Q.prerelease.length?Q.prerelease:null};nG.exports=TL});var H4=j((jx,aG)=>{var rG=v0(),wL=(Z,X,Q)=>new rG(Z,Q).compare(new rG(X,Q));aG.exports=wL});var oG=j((Ox,sG)=>{var jL=H4(),OL=(Z,X,Q)=>jL(X,Z,Q);sG.exports=OL});var eG=j((Ex,tG)=>{var EL=H4(),RL=(Z,X)=>EL(Z,X,!0);tG.exports=RL});var y8=j((Rx,XY)=>{var ZY=v0(),PL=(Z,X,Q)=>{let W=new ZY(Z,Q),J=new ZY(X,Q);return W.compare(J)||W.compareBuild(J)};XY.exports=PL});var WY=j((Px,QY)=>{var CL=y8(),SL=(Z,X)=>Z.sort((Q,W)=>CL(Q,W,X));QY.exports=SL});var GY=j((Cx,JY)=>{var kL=y8(),bL=(Z,X)=>Z.sort((Q,W)=>kL(W,Q,X));JY.exports=bL});var Y9=j((Sx,YY)=>{var _L=H4(),xL=(Z,X,Q)=>_L(Z,X,Q)>0;YY.exports=xL});var g8=j((kx,zY)=>{var vL=H4(),yL=(Z,X,Q)=>vL(Z,X,Q)<0;zY.exports=yL});var V7=j((bx,$Y)=>{var gL=H4(),fL=(Z,X,Q)=>gL(Z,X,Q)===0;$Y.exports=fL});var B7=j((_x,qY)=>{var hL=H4(),uL=(Z,X,Q)=>hL(Z,X,Q)!==0;qY.exports=uL});var f8=j((xx,KY)=>{var mL=H4(),lL=(Z,X,Q)=>mL(Z,X,Q)>=0;KY.exports=lL});var h8=j((vx,UY)=>{var dL=H4(),cL=(Z,X,Q)=>dL(Z,X,Q)<=0;UY.exports=cL});var H7=j((yx,VY)=>{var pL=V7(),nL=B7(),iL=Y9(),rL=f8(),aL=g8(),sL=h8(),oL=(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 pL(Z,Q,W);case"!=":return nL(Z,Q,W);case">":return iL(Z,Q,W);case">=":return rL(Z,Q,W);case"<":return aL(Z,Q,W);case"<=":return sL(Z,Q,W);default:throw TypeError(`Invalid operator: ${X}`)}};VY.exports=oL});var HY=j((gx,BY)=>{var tL=v0(),eL=T6(),{safeRe:u8,t:m8}=D1(),ZA=(Z,X)=>{if(Z instanceof tL)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?u8[m8.COERCEFULL]:u8[m8.COERCE]);else{let q=X.includePrerelease?u8[m8.COERCERTLFULL]:u8[m8.COERCERTL],K;while((K=q.exec(Z))&&(!Q||Q.index+Q[0].length!==Z.length)){if(!Q||K.index+K[0].length!==Q.index+Q[0].length)Q=K;q.lastIndex=K.index+K[1].length+K[2].length}q.lastIndex=-1}if(Q===null)return null;let W=Q[2],J=Q[3]||"0",G=Q[4]||"0",Y=X.includePrerelease&&Q[5]?`-${Q[5]}`:"",z=X.includePrerelease&&Q[6]?`+${Q[6]}`:"";return eL(`${W}.${J}.${G}${Y}${z}`,X)};BY.exports=ZA});var LY=j((fx,FY)=>{var XA=T6(),QA=N1(),WA=v0(),JA=(Z,X,Q)=>{if(!QA.RELEASE_TYPES.includes(X))return null;let W=GA(Z,Q);return W&&YA(W,X)},GA=(Z,X)=>{let Q=Z instanceof WA?Z.version:Z;return XA(Q,X)},YA=(Z,X)=>{if(zA(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()},zA=(Z)=>{return Z.startsWith("pre")};FY.exports=JA});var IY=j((hx,MY)=>{class AY{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}}MY.exports=AY});var F4=j((ux,wY)=>{var $A=/\s+/g;class z9{constructor(Z,X){if(X=KA(X),Z instanceof z9)if(Z.loose===!!X.loose&&Z.includePrerelease===!!X.includePrerelease)return Z;else return new z9(Z.raw,X);if(Z instanceof F7)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($A," "),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)=>!DY(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&&IA(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(MA,"");let Q=((this.options.includePrerelease&&LA)|(this.options.loose&&AA))+":"+Z,W=NY.get(Q);if(W)return W;let J=this.options.loose,G=J?p0[y0.HYPHENRANGELOOSE]:p0[y0.HYPHENRANGE];Z=Z.replace(G,SA(this.options.includePrerelease)),L0("hyphen replace",Z),Z=Z.replace(p0[y0.COMPARATORTRIM],BA),L0("comparator trim",Z),Z=Z.replace(p0[y0.TILDETRIM],HA),L0("tilde trim",Z),Z=Z.replace(p0[y0.CARETTRIM],FA),L0("caret trim",Z);let Y=Z.split(" ").map((V)=>NA(V,this.options)).join(" ").split(/\s+/).map((V)=>CA(V,this.options));if(J)Y=Y.filter((V)=>{return L0("loose invalid filter",V,this.options),!!V.match(p0[y0.COMPARATORLOOSE])});L0("range list",Y);let z=new Map,q=Y.map((V)=>new F7(V,this.options));for(let V of q){if(DY(V))return[V];z.set(V.value,V)}if(z.size>1&&z.has(""))z.delete("");let K=[...z.values()];return NY.set(Q,K),K}intersects(Z,X){if(!(Z instanceof z9))throw TypeError("a Range is required");return this.set.some((Q)=>{return TY(Q,X)&&Z.set.some((W)=>{return TY(W,X)&&Q.every((J)=>{return W.every((G)=>{return J.intersects(G,X)})})})})}test(Z){if(!Z)return!1;if(typeof Z==="string")try{Z=new UA(Z,this.options)}catch(X){return!1}for(let X=0;X<this.set.length;X++)if(kA(this.set[X],Z,this.options))return!0;return!1}}wY.exports=z9;var qA=IY(),NY=new qA,KA=k8(),F7=$9(),L0=G9(),UA=v0(),{safeRe:p0,src:VA,t:y0,comparatorTrimReplace:BA,tildeTrimReplace:HA,caretTrimReplace:FA}=D1(),{FLAG_INCLUDE_PRERELEASE:LA,FLAG_LOOSE:AA}=N1(),MA=new RegExp(VA[y0.BUILD],"g"),DY=(Z)=>Z.value==="<0.0.0-0",IA=(Z)=>Z.value==="",TY=(Z,X)=>{let Q=!0,W=Z.slice(),J=W.pop();while(Q&&W.length)Q=W.every((G)=>{return J.intersects(G,X)}),J=W.pop();return Q},NA=(Z,X)=>{return Z=Z.replace(p0[y0.BUILD],""),L0("comp",Z,X),Z=jA(Z,X),L0("caret",Z),Z=TA(Z,X),L0("tildes",Z),Z=EA(Z,X),L0("xrange",Z),Z=PA(Z,X),L0("stars",Z),Z},P0=(Z)=>!Z||Z.toLowerCase()==="x"||Z==="*",DA=(Z,X,Q)=>P0(Z)&&!P0(X)||P0(X)&&Q&&!P0(Q),TA=(Z,X)=>{return Z.trim().split(/\s+/).map((Q)=>wA(Q,X)).join(" ")},wA=(Z,X)=>{let Q=X.loose?p0[y0.TILDELOOSE]:p0[y0.TILDE],W=X.includePrerelease?"-0":"";return Z.replace(Q,(J,G,Y,z,q)=>{L0("tilde",Z,J,G,Y,z,q);let K;if(P0(G))K="";else if(P0(Y))K=`>=${G}.0.0${W} <${+G+1}.0.0-0`;else if(P0(z))K=`>=${G}.${Y}.0${W} <${G}.${+Y+1}.0-0`;else if(q)L0("replaceTilde pr",q),K=`>=${G}.${Y}.${z}-${q} <${G}.${+Y+1}.0-0`;else K=`>=${G}.${Y}.${z} <${G}.${+Y+1}.0-0`;return L0("tilde return",K),K})},jA=(Z,X)=>{return Z.trim().split(/\s+/).map((Q)=>OA(Q,X)).join(" ")},OA=(Z,X)=>{L0("caret",Z,X);let Q=X.loose?p0[y0.CARETLOOSE]:p0[y0.CARET],W=X.includePrerelease?"-0":"";return Z.replace(Q,(J,G,Y,z,q)=>{L0("caret",Z,J,G,Y,z,q);let K;if(P0(G))K="";else if(P0(Y))K=`>=${G}.0.0${W} <${+G+1}.0.0-0`;else if(P0(z))if(G==="0")K=`>=${G}.${Y}.0${W} <${G}.${+Y+1}.0-0`;else K=`>=${G}.${Y}.0${W} <${+G+1}.0.0-0`;else if(q)if(L0("replaceCaret pr",q),G==="0")if(Y==="0")K=`>=${G}.${Y}.${z}-${q} <${G}.${Y}.${+z+1}-0`;else K=`>=${G}.${Y}.${z}-${q} <${G}.${+Y+1}.0-0`;else K=`>=${G}.${Y}.${z}-${q} <${+G+1}.0.0-0`;else if(L0("no pr"),G==="0")if(Y==="0")K=`>=${G}.${Y}.${z} <${G}.${Y}.${+z+1}-0`;else K=`>=${G}.${Y}.${z} <${G}.${+Y+1}.0-0`;else K=`>=${G}.${Y}.${z} <${+G+1}.0.0-0`;return L0("caret return",K),K})},EA=(Z,X)=>{return L0("replaceXRanges",Z,X),Z.split(/\s+/).map((Q)=>RA(Q,X)).join(" ")},RA=(Z,X)=>{Z=Z.trim();let Q=X.loose?p0[y0.XRANGELOOSE]:p0[y0.XRANGE];return Z.replace(Q,(W,J,G,Y,z,q)=>{if(L0("xRange",Z,W,J,G,Y,z,q),DA(G,Y,z))return Z;let K=P0(G),V=K||P0(Y),B=V||P0(z),H=B;if(J==="="&&H)J="";if(q=X.includePrerelease?"-0":"",K)if(J===">"||J==="<")W="<0.0.0-0";else W="*";else if(J&&H){if(V)Y=0;if(z=0,J===">")if(J=">=",V)G=+G+1,Y=0,z=0;else Y=+Y+1,z=0;else if(J==="<=")if(J="<",V)G=+G+1;else Y=+Y+1;if(J==="<")q="-0";W=`${J+G}.${Y}.${z}${q}`}else if(V)W=`>=${G}.0.0${q} <${+G+1}.0.0-0`;else if(B)W=`>=${G}.${Y}.0${q} <${G}.${+Y+1}.0-0`;return L0("xRange return",W),W})},PA=(Z,X)=>{return L0("replaceStars",Z,X),Z.trim().replace(p0[y0.STAR],"")},CA=(Z,X)=>{return L0("replaceGTE0",Z,X),Z.trim().replace(p0[X.includePrerelease?y0.GTE0PRE:y0.GTE0],"")},SA=(Z)=>(X,Q,W,J,G,Y,z,q,K,V,B,H)=>{if(P0(W))Q="";else if(P0(J))Q=`>=${W}.0.0${Z?"-0":""}`;else if(P0(G))Q=`>=${W}.${J}.0${Z?"-0":""}`;else if(Y)Q=`>=${Q}`;else Q=`>=${Q}${Z?"-0":""}`;if(P0(K))q="";else if(P0(V))q=`<${+K+1}.0.0-0`;else if(P0(B))q=`<${K}.${+V+1}.0-0`;else if(H)q=`<=${K}.${V}.${B}-${H}`;else if(Z)q=`<${K}.${V}.${+B+1}-0`;else q=`<=${q}`;return`${Q} ${q}`.trim()},kA=(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(L0(Z[W].semver),Z[W].semver===F7.ANY)continue;if(Z[W].semver.prerelease.length>0){let J=Z[W].semver;if(J.major===X.major&&J.minor===X.minor&&J.patch===X.patch)return!0}}return!1}return!0}});var $9=j((mx,CY)=>{var q9=Symbol("SemVer ANY");class l8{static get ANY(){return q9}constructor(Z,X){if(X=jY(X),Z instanceof l8)if(Z.loose===!!X.loose)return Z;else Z=Z.value;if(Z=Z.trim().split(/\s+/).join(" "),A7("comparator",Z,X),this.options=X,this.loose=!!X.loose,this.parse(Z),this.semver===q9)this.value="";else this.value=this.operator+this.semver.version;A7("comp",this)}parse(Z){let X=this.options.loose?OY[EY.COMPARATORLOOSE]:OY[EY.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=q9;else this.semver=new RY(Q[2],this.options.loose)}toString(){return this.value}test(Z){if(A7("Comparator.test",Z,this.options.loose),this.semver===q9||Z===q9)return!0;if(typeof Z==="string")try{Z=new RY(Z,this.options)}catch(X){return!1}return L7(Z,this.operator,this.semver,this.options)}intersects(Z,X){if(!(Z instanceof l8))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new PY(Z.value,X).test(this.value)}else if(Z.operator===""){if(Z.value==="")return!0;return new PY(this.value,X).test(Z.semver)}if(X=jY(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(L7(this.semver,"<",Z.semver,X)&&this.operator.startsWith(">")&&Z.operator.startsWith("<"))return!0;if(L7(this.semver,">",Z.semver,X)&&this.operator.startsWith("<")&&Z.operator.startsWith(">"))return!0;return!1}}CY.exports=l8;var jY=k8(),{safeRe:OY,t:EY}=D1(),L7=H7(),A7=G9(),RY=v0(),PY=F4()});var K9=j((lx,SY)=>{var bA=F4(),_A=(Z,X,Q)=>{try{X=new bA(X,Q)}catch(W){return!1}return X.test(Z)};SY.exports=_A});var bY=j((dx,kY)=>{var xA=F4(),vA=(Z,X)=>new xA(Z,X).set.map((Q)=>Q.map((W)=>W.value).join(" ").trim().split(" "));kY.exports=vA});var xY=j((cx,_Y)=>{var yA=v0(),gA=F4(),fA=(Z,X,Q)=>{let W=null,J=null,G=null;try{G=new gA(X,Q)}catch(Y){return null}return Z.forEach((Y)=>{if(G.test(Y)){if(!W||J.compare(Y)===-1)W=Y,J=new yA(W,Q)}}),W};_Y.exports=fA});var yY=j((px,vY)=>{var hA=v0(),uA=F4(),mA=(Z,X,Q)=>{let W=null,J=null,G=null;try{G=new uA(X,Q)}catch(Y){return null}return Z.forEach((Y)=>{if(G.test(Y)){if(!W||J.compare(Y)===1)W=Y,J=new hA(W,Q)}}),W};vY.exports=mA});var hY=j((nx,fY)=>{var M7=v0(),lA=F4(),gY=Y9(),dA=(Z,X)=>{Z=new lA(Z,X);let Q=new M7("0.0.0");if(Z.test(Q))return Q;if(Q=new M7("0.0.0-0"),Z.test(Q))return Q;Q=null;for(let W=0;W<Z.set.length;++W){let J=Z.set[W],G=null;if(J.forEach((Y)=>{let z=new M7(Y.semver.version);switch(Y.operator){case">":if(z.prerelease.length===0)z.patch++;else z.prerelease.push(0);z.raw=z.format();case"":case">=":if(!G||gY(z,G))G=z;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${Y.operator}`)}}),G&&(!Q||gY(Q,G)))Q=G}if(Q&&Z.test(Q))return Q;return null};fY.exports=dA});var mY=j((ix,uY)=>{var cA=F4(),pA=(Z,X)=>{try{return new cA(Z,X).range||"*"}catch(Q){return null}};uY.exports=pA});var d8=j((rx,pY)=>{var nA=v0(),cY=$9(),{ANY:iA}=cY,rA=F4(),aA=K9(),lY=Y9(),dY=g8(),sA=h8(),oA=f8(),tA=(Z,X,Q,W)=>{Z=new nA(Z,W),X=new rA(X,W);let J,G,Y,z,q;switch(Q){case">":J=lY,G=sA,Y=dY,z=">",q=">=";break;case"<":J=dY,G=oA,Y=lY,z="<",q="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(aA(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((F)=>{if(F.semver===iA)F=new cY(">=0.0.0");if(B=B||F,H=H||F,J(F.semver,B.semver,W))B=F;else if(Y(F.semver,H.semver,W))H=F}),B.operator===z||B.operator===q)return!1;if((!H.operator||H.operator===z)&&G(Z,H.semver))return!1;else if(H.operator===q&&Y(Z,H.semver))return!1}return!0};pY.exports=tA});var iY=j((ax,nY)=>{var eA=d8(),ZM=(Z,X,Q)=>eA(Z,X,">",Q);nY.exports=ZM});var aY=j((sx,rY)=>{var XM=d8(),QM=(Z,X,Q)=>XM(Z,X,"<",Q);rY.exports=QM});var tY=j((ox,oY)=>{var sY=F4(),WM=(Z,X,Q)=>{return Z=new sY(Z,Q),X=new sY(X,Q),Z.intersects(X,Q)};oY.exports=WM});var Zz=j((tx,eY)=>{var JM=K9(),GM=H4();eY.exports=(Z,X,Q)=>{let W=[],J=null,G=null,Y=Z.sort((V,B)=>GM(V,B,Q));for(let V of Y)if(JM(V,X,Q)){if(G=V,!J)J=V}else{if(G)W.push([J,G]);G=null,J=null}if(J)W.push([J,null]);let z=[];for(let[V,B]of W)if(V===B)z.push(V);else if(!B&&V===Y[0])z.push("*");else if(!B)z.push(`>=${V}`);else if(V===Y[0])z.push(`<=${B}`);else z.push(`${V} - ${B}`);let q=z.join(" || "),K=typeof X.raw==="string"?X.raw:String(X);return q.length<K.length?q:X}});var Yz=j((ex,Gz)=>{var Xz=F4(),D7=$9(),{ANY:I7}=D7,N7=K9(),T7=H4(),YM=(Z,X,Q={})=>{if(Z===X)return!0;Z=new Xz(Z,Q),X=new Xz(X,Q);let W=!1;Z:for(let J of Z.set){for(let G of X.set){let Y=$M(J,G,Q);if(W=W||Y!==null,Y)continue Z}if(W)return!1}return!0},zM=[new D7(">=0.0.0-0")],Qz=[new D7(">=0.0.0")],$M=(Z,X,Q)=>{if(Z===X)return!0;if(Z.length===1&&Z[0].semver===I7)if(X.length===1&&X[0].semver===I7)return!0;else if(Q.includePrerelease)Z=zM;else Z=Qz;if(X.length===1&&X[0].semver===I7)if(Q.includePrerelease)return!0;else X=Qz;let W=new Set,J,G;for(let F of Z)if(F.operator===">"||F.operator===">=")J=Wz(J,F,Q);else if(F.operator==="<"||F.operator==="<=")G=Jz(G,F,Q);else W.add(F.semver);if(W.size>1)return null;let Y;if(J&&G){if(Y=T7(J.semver,G.semver,Q),Y>0)return null;else if(Y===0&&(J.operator!==">="||G.operator!=="<="))return null}for(let F of W){if(J&&!N7(F,String(J),Q))return null;if(G&&!N7(F,String(G),Q))return null;for(let A of X)if(!N7(F,String(A),Q))return!1;return!0}let z,q,K,V,B=G&&!Q.includePrerelease&&G.semver.prerelease.length?G.semver:!1,H=J&&!Q.includePrerelease&&J.semver.prerelease.length?J.semver:!1;if(B&&B.prerelease.length===1&&G.operator==="<"&&B.prerelease[0]===0)B=!1;for(let F of X){if(V=V||F.operator===">"||F.operator===">=",K=K||F.operator==="<"||F.operator==="<=",J){if(H){if(F.semver.prerelease&&F.semver.prerelease.length&&F.semver.major===H.major&&F.semver.minor===H.minor&&F.semver.patch===H.patch)H=!1}if(F.operator===">"||F.operator===">="){if(z=Wz(J,F,Q),z===F&&z!==J)return!1}else if(J.operator===">="&&!F.test(J.semver))return!1}if(G){if(B){if(F.semver.prerelease&&F.semver.prerelease.length&&F.semver.major===B.major&&F.semver.minor===B.minor&&F.semver.patch===B.patch)B=!1}if(F.operator==="<"||F.operator==="<="){if(q=Jz(G,F,Q),q===F&&q!==G)return!1}else if(G.operator==="<="&&!F.test(G.semver))return!1}if(!F.operator&&(G||J)&&Y!==0)return!1}if(J&&K&&!G&&Y!==0)return!1;if(G&&V&&!J&&Y!==0)return!1;if(H||B)return!1;return!0},Wz=(Z,X,Q)=>{if(!Z)return X;let W=T7(Z.semver,X.semver,Q);return W>0?Z:W<0?X:X.operator===">"&&Z.operator===">="?X:Z},Jz=(Z,X,Q)=>{if(!Z)return X;let W=T7(Z.semver,X.semver,Q);return W<0?Z:W>0?X:X.operator==="<"&&Z.operator==="<="?X:Z};Gz.exports=YM});var Kz=j((Zv,qz)=>{var w7=D1(),zz=N1(),qM=v0(),$z=K7(),KM=T6(),UM=kG(),VM=_G(),BM=yG(),HM=hG(),FM=mG(),LM=dG(),AM=pG(),MM=iG(),IM=H4(),NM=oG(),DM=eG(),TM=y8(),wM=WY(),jM=GY(),OM=Y9(),EM=g8(),RM=V7(),PM=B7(),CM=f8(),SM=h8(),kM=H7(),bM=HY(),_M=LY(),xM=$9(),vM=F4(),yM=K9(),gM=bY(),fM=xY(),hM=yY(),uM=hY(),mM=mY(),lM=d8(),dM=iY(),cM=aY(),pM=tY(),nM=Zz(),iM=Yz();qz.exports={parse:KM,valid:UM,clean:VM,inc:BM,diff:HM,major:FM,minor:LM,patch:AM,prerelease:MM,compare:IM,rcompare:NM,compareLoose:DM,compareBuild:TM,sort:wM,rsort:jM,gt:OM,lt:EM,eq:RM,neq:PM,gte:CM,lte:SM,cmp:kM,coerce:bM,truncate:_M,Comparator:xM,Range:vM,satisfies:yM,toComparators:gM,maxSatisfying:fM,minSatisfying:hM,minVersion:uM,validRange:mM,outside:lM,gtr:dM,ltr:cM,intersects:pM,simplifyRange:nM,subset:iM,SemVer:qM,re:w7.re,src:w7.src,tokens:w7.t,SEMVER_SPEC_VERSION:zz.SEMVER_SPEC_VERSION,RELEASE_TYPES:zz.RELEASE_TYPES,compareIdentifiers:$z.compareIdentifiers,rcompareIdentifiers:$z.rcompareIdentifiers}});var Z6;var c8=c(()=>{Z6={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.3",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 && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","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:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://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.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.3","@img/sharp-darwin-x64":"0.35.3","@img/sharp-freebsd-wasm32":"0.35.3","@img/sharp-libvips-darwin-arm64":"1.3.2","@img/sharp-libvips-darwin-x64":"1.3.2","@img/sharp-libvips-linux-arm":"1.3.2","@img/sharp-libvips-linux-arm64":"1.3.2","@img/sharp-libvips-linux-ppc64":"1.3.2","@img/sharp-libvips-linux-riscv64":"1.3.2","@img/sharp-libvips-linux-s390x":"1.3.2","@img/sharp-libvips-linux-x64":"1.3.2","@img/sharp-libvips-linuxmusl-arm64":"1.3.2","@img/sharp-libvips-linuxmusl-x64":"1.3.2","@img/sharp-linux-arm":"0.35.3","@img/sharp-linux-arm64":"0.35.3","@img/sharp-linux-ppc64":"0.35.3","@img/sharp-linux-riscv64":"0.35.3","@img/sharp-linux-s390x":"0.35.3","@img/sharp-linux-x64":"0.35.3","@img/sharp-linuxmusl-arm64":"0.35.3","@img/sharp-linuxmusl-x64":"0.35.3","@img/sharp-webcontainers-wasm32":"0.35.3","@img/sharp-win32-arm64":"0.35.3","@img/sharp-win32-ia32":"0.35.3","@img/sharp-win32-x64":"0.35.3"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.1","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.1","@img/sharp-libvips-dev":"1.3.2","@img/sharp-libvips-dev-wasm32":"1.3.2","@img/sharp-libvips-win32-arm64":"1.3.2","@img/sharp-libvips-win32-ia32":"1.3.2","@img/sharp-libvips-win32-x64":"1.3.2","@types/node":"*",emnapi:"^1.11.1","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.9.0","node-gyp":"^12.4.0",publint:"^0.3.21","tar-fs":"^3.1.3",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 U9}from"node:child_process";import{createHash as aM}from"node:crypto";var V9,O7,sM,Vz,oM,E7,tM=(Z)=>{if(Z instanceof Error)console.error(`sharp: Installation error: ${Z.message}`);else console.log(`sharp: ${Z}`)},Bz=()=>O7.default.isNonGlibcLinuxSync()?O7.default.familySync():"",eM=()=>`${process.platform}${Bz()}-${process.arch}`,T1=()=>{if(Hz())return"wasm32";let{npm_config_arch:Z,npm_config_platform:X,npm_config_libc:Q}=process.env,W=typeof Q==="string"?Q:Bz();return`${X||process.platform}${W}-${Z||process.arch}`},ZI=()=>{try{return _0(`@img/sharp-libvips-dev-${T1()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},XI=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},QI=()=>{try{return _0(`@img/sharp-libvips-dev-${T1()}/lib`)}catch{try{return _0(`@img/sharp-libvips-${T1()}/lib`)}catch{}}return""},WI=()=>{if(process.release?.name==="node"&&process.versions){if(!V9.default.satisfies(process.versions.node,Z6.engines.node))return{found:process.versions.node,expected:Z6.engines.node}}},Hz=()=>{let{CC:Z}=process.env;return Boolean(Z?.endsWith("/emcc"))},JI=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(U9("sysctl sysctl.proc_translated",E7).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},Uz=(Z)=>aM("sha512").update(Z).digest("hex"),GI=()=>{try{let Z=Uz(`imgsharp-libvips-${T1()}`),X=V9.default.coerce(Z6.optionalDependencies[`@img/sharp-libvips-${T1()}`],{includePrerelease:!0}).version;return Uz(`${Z}npm:${X}`).slice(0,10)}catch{}return""},YI=()=>U9(`node-gyp rebuild --directory=src ${Hz()?"--nodedir=emscripten":""}`,{...E7,stdio:"inherit"}).status,Fz=()=>{if(process.platform!=="win32")return(U9("pkg-config --modversion vips-cpp",{...E7,env:{...process.env,PKG_CONFIG_PATH:Lz()}}).stdout||"").trim();else return""},zI=()=>{try{let Z=(U9("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(Z)return`${Z}/lib/pkgconfig`}catch(Z){}return},$I=()=>{try{let Z=(U9("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(Z)return Z}catch(Z){}return},Lz=()=>{if(process.platform!=="win32")return[zI(),$I(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},j7=(Z,X,Q)=>{if(Q)Q(`Detected ${X}, skipping search for globally-installed libvips`);return Z},qI=(Z)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return j7(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",Z);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return j7(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",Z);if(JI())return j7(!1,"Rosetta",Z);let X=Fz();return!!X&&V9.default.gte(X,Vz)},p8;var R7=c(()=>{c8();V9=W1(Kz(),1),O7=W1(S8(),1);/*!
218
+ */$={defined:UG,object:iF,plainObject:nF,fn:rF,bool:aF,buffer:sF,typedArray:oF,arrayBuffer:tF,string:eF,number:ZL,integer:QL,inRange:WL,inArray:XL,invalidParameterError:JL,nativeError:GL}});var BG=j((Zv,HG)=>{var VG=()=>process.platform==="linux",g8=null,YL=()=>{if(!g8)if(VG()&&process.report){let Z=process.report.excludeNetwork;process.report.excludeNetwork=!0,g8=process.report.getReport(),process.report.excludeNetwork=Z}else g8={};return g8};HG.exports={isLinux:VG,getReport:YL}});var LG=j((Qv,FG)=>{var T1=v0("fs"),zL=(Z)=>{let Q=T1.openSync(Z,"r"),W=Buffer.alloc(2048),X=T1.readSync(Q,W,0,2048,0);return T1.close(Q,()=>{}),W.subarray(0,X)},$L=(Z)=>new Promise((Q,W)=>{T1.open(Z,"r",(X,J)=>{if(X)W(X);else{let G=Buffer.alloc(2048);T1.read(J,G,0,2048,0,(Y,z)=>{Q(G.subarray(0,z)),T1.close(J,()=>{})})}})});FG.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:zL,readFile:$L}});var MG=j((Wv,AG)=>{var qL=(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 Q=Z.readUInt32LE(32),W=Z.readUInt16LE(54),X=Z.readUInt16LE(56);for(let J=0;J<X;J++){let G=Q+J*W;if(Z.readUInt32LE(G)===3){let z=Z.readUInt32LE(G+8),q=Z.readUInt32LE(G+32);return Z.subarray(z,z+q).toString().replace(/\0.*$/g,"")}}return null};AG.exports={interpreterPath:qL}});var h8=j((Xv,vG)=>{var NG=v0("child_process"),{isLinux:j1,getReport:DG}=BG(),{LDD_PATH:f8,SELF_PATH:wG,readFile:I7,readFileSync:N7}=LG(),{interpreterPath:TG}=MG(),m4,l4,d4,R6="",jG=()=>{if(!R6)return new Promise((Z)=>{NG.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(Q,W)=>{R6=Q?" ":W,Z(R6)})});return R6},EG=()=>{if(!R6)try{R6=NG.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(Z){R6=" "}return R6},G6="glibc",OG=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,n6="musl",KL=(Z)=>Z.includes("libc.musl-")||Z.includes("ld-musl-"),RG=()=>{let Z=DG();if(Z.header&&Z.header.glibcVersionRuntime)return G6;if(Array.isArray(Z.sharedObjects)){if(Z.sharedObjects.some(KL))return n6}return null},PG=(Z)=>{let[Q,W]=Z.split(/[\r\n]+/);if(Q&&Q.includes(G6))return G6;if(W&&W.includes(n6))return n6;return null},CG=(Z)=>{if(Z){if(Z.includes("/ld-musl-"))return n6;else if(Z.includes("/ld-linux-"))return G6}return null},SG=(Z)=>{if(Z=Z.toString(),Z.includes("musl"))return n6;if(Z.includes("GNU C Library"))return G6;return null},UL=async()=>{if(l4!==void 0)return l4;l4=null;try{let Z=await I7(f8);l4=SG(Z)}catch(Z){}return l4},VL=()=>{if(l4!==void 0)return l4;l4=null;try{let Z=N7(f8);l4=SG(Z)}catch(Z){}return l4},HL=async()=>{if(m4!==void 0)return m4;m4=null;try{let Z=await I7(wG),Q=TG(Z);m4=CG(Q)}catch(Z){}return m4},BL=()=>{if(m4!==void 0)return m4;m4=null;try{let Z=N7(wG),Q=TG(Z);m4=CG(Q)}catch(Z){}return m4},kG=async()=>{let Z=null;if(j1()){if(Z=await HL(),!Z){if(Z=await UL(),!Z)Z=RG();if(!Z){let Q=await jG();Z=PG(Q)}}}return Z},_G=()=>{let Z=null;if(j1()){if(Z=BL(),!Z){if(Z=VL(),!Z)Z=RG();if(!Z){let Q=EG();Z=PG(Q)}}}return Z},FL=async()=>j1()&&await kG()!==G6,LL=()=>j1()&&_G()!==G6,AL=async()=>{if(d4!==void 0)return d4;d4=null;try{let Q=(await I7(f8)).match(OG);if(Q)d4=Q[1]}catch(Z){}return d4},ML=()=>{if(d4!==void 0)return d4;d4=null;try{let Q=N7(f8).match(OG);if(Q)d4=Q[1]}catch(Z){}return d4},bG=()=>{let Z=DG();if(Z.header&&Z.header.glibcVersionRuntime)return Z.header.glibcVersionRuntime;return null},IG=(Z)=>Z.trim().split(/\s+/)[1],xG=(Z)=>{let[Q,W,X]=Z.split(/[\r\n]+/);if(Q&&Q.includes(G6))return IG(Q);if(W&&X&&W.includes(n6))return IG(X);return null},IL=async()=>{let Z=null;if(j1()){if(Z=await AL(),!Z)Z=bG();if(!Z){let Q=await jG();Z=xG(Q)}}return Z},NL=()=>{let Z=null;if(j1()){if(Z=ML(),!Z)Z=bG();if(!Z){let Q=EG();Z=xG(Q)}}return Z};vG.exports={GLIBC:G6,MUSL:n6,family:kG,familySync:_G,isNonGlibcLinux:FL,isNonGlibcLinuxSync:LL,version:IL,versionSync:NL}});var E1=j((Jv,yG)=>{var DL=Number.MAX_SAFE_INTEGER||9007199254740991,wL=["major","premajor","minor","preminor","patch","prepatch","prerelease"];yG.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:DL,RELEASE_TYPES:wL,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var V9=j((Gv,gG)=>{var TL=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...Z)=>console.error("SEMVER",...Z):()=>{};gG.exports=TL});var O1=j((c4,fG)=>{var{MAX_SAFE_COMPONENT_LENGTH:D7,MAX_SAFE_BUILD_LENGTH:jL,MAX_LENGTH:EL}=E1(),OL=V9();c4=fG.exports={};var RL=c4.re=[],PL=c4.safeRe=[],l=c4.src=[],CL=c4.safeSrc=[],d=c4.t={},SL=0,w7="[a-zA-Z0-9-]",kL=[["\\s",1],["\\d",EL],[w7,jL]],_L=(Z)=>{for(let[Q,W]of kL)Z=Z.split(`${Q}*`).join(`${Q}{0,${W}}`).split(`${Q}+`).join(`${Q}{1,${W}}`);return Z},t=(Z,Q,W)=>{let X=_L(Q),J=SL++;OL(Z,J,Q),d[Z]=J,l[J]=Q,CL[J]=X,RL[J]=new RegExp(Q,W?"g":void 0),PL[J]=new RegExp(X,W?"g":void 0)};t("NUMERICIDENTIFIER","0|[1-9]\\d*");t("NUMERICIDENTIFIERLOOSE","\\d+");t("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${w7}*`);t("MAINVERSION",`(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})`);t("MAINVERSIONLOOSE",`(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})`);t("PRERELEASEIDENTIFIER",`(?:${l[d.NONNUMERICIDENTIFIER]}|${l[d.NUMERICIDENTIFIER]})`);t("PRERELEASEIDENTIFIERLOOSE",`(?:${l[d.NONNUMERICIDENTIFIER]}|${l[d.NUMERICIDENTIFIERLOOSE]})`);t("PRERELEASE",`(?:-(${l[d.PRERELEASEIDENTIFIER]}(?:\\.${l[d.PRERELEASEIDENTIFIER]})*))`);t("PRERELEASELOOSE",`(?:-?(${l[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[d.PRERELEASEIDENTIFIERLOOSE]})*))`);t("BUILDIDENTIFIER",`${w7}+`);t("BUILD",`(?:\\+(${l[d.BUILDIDENTIFIER]}(?:\\.${l[d.BUILDIDENTIFIER]})*))`);t("FULLPLAIN",`v?${l[d.MAINVERSION]}${l[d.PRERELEASE]}?${l[d.BUILD]}?`);t("FULL",`^${l[d.FULLPLAIN]}$`);t("LOOSEPLAIN",`[v=\\s]*${l[d.MAINVERSIONLOOSE]}${l[d.PRERELEASELOOSE]}?${l[d.BUILD]}?`);t("LOOSE",`^${l[d.LOOSEPLAIN]}$`);t("GTLT","((?:<|>)?=?)");t("XRANGEIDENTIFIERLOOSE",`${l[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);t("XRANGEIDENTIFIER",`${l[d.NUMERICIDENTIFIER]}|x|X|\\*`);t("XRANGEPLAIN",`[v=\\s]*(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:${l[d.PRERELEASE]})?${l[d.BUILD]}?)?)?`);t("XRANGEPLAINLOOSE",`[v=\\s]*(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:${l[d.PRERELEASELOOSE]})?${l[d.BUILD]}?)?)?`);t("XRANGE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAIN]}$`);t("XRANGELOOSE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAINLOOSE]}$`);t("COERCEPLAIN",`(^|[^\\d])(\\d{1,${D7}})(?:\\.(\\d{1,${D7}}))?(?:\\.(\\d{1,${D7}}))?`);t("COERCE",`${l[d.COERCEPLAIN]}(?:$|[^\\d])`);t("COERCEFULL",l[d.COERCEPLAIN]+`(?:${l[d.PRERELEASE]})?(?:${l[d.BUILD]})?(?:$|[^\\d])`);t("COERCERTL",l[d.COERCE],!0);t("COERCERTLFULL",l[d.COERCEFULL],!0);t("LONETILDE","(?:~>?)");t("TILDETRIM",`(\\s*)${l[d.LONETILDE]}\\s+`,!0);c4.tildeTrimReplace="$1~";t("TILDE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAIN]}$`);t("TILDELOOSE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAINLOOSE]}$`);t("LONECARET","(?:\\^)");t("CARETTRIM",`(\\s*)${l[d.LONECARET]}\\s+`,!0);c4.caretTrimReplace="$1^";t("CARET",`^${l[d.LONECARET]}${l[d.XRANGEPLAIN]}$`);t("CARETLOOSE",`^${l[d.LONECARET]}${l[d.XRANGEPLAINLOOSE]}$`);t("COMPARATORLOOSE",`^${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]})$|^$`);t("COMPARATOR",`^${l[d.GTLT]}\\s*(${l[d.FULLPLAIN]})$|^$`);t("COMPARATORTRIM",`(\\s*)${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]}|${l[d.XRANGEPLAIN]})`,!0);c4.comparatorTrimReplace="$1$2$3";t("HYPHENRANGE",`^\\s*(${l[d.XRANGEPLAIN]})\\s+-\\s+(${l[d.XRANGEPLAIN]})\\s*$`);t("HYPHENRANGELOOSE",`^\\s*(${l[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[d.XRANGEPLAINLOOSE]})\\s*$`);t("STAR","(<|>)?=?\\s*\\*");t("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");t("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var u8=j((Yv,hG)=>{var bL=Object.freeze({loose:!0}),xL=Object.freeze({}),vL=(Z)=>{if(!Z)return xL;if(typeof Z!=="object")return bL;return Z};hG.exports=vL});var T7=j((zv,lG)=>{var uG=/^[0-9]+$/,mG=(Z,Q)=>{if(typeof Z==="number"&&typeof Q==="number")return Z===Q?0:Z<Q?-1:1;let W=uG.test(Z),X=uG.test(Q);if(W&&X)Z=+Z,Q=+Q;return Z===Q?0:W&&!X?-1:X&&!W?1:Z<Q?-1:1},yL=(Z,Q)=>mG(Q,Z);lG.exports={compareIdentifiers:mG,rcompareIdentifiers:yL}});var f0=j(($v,cG)=>{var m8=V9(),{MAX_LENGTH:dG,MAX_SAFE_INTEGER:l8}=E1(),{safeRe:d8,t:c8}=O1(),gL=u8(),{compareIdentifiers:j7}=T7(),fL=(Z,Q)=>{let W=Q.split(".");if(W.length>Z.length)return!1;for(let X=0;X<W.length;X++)if(j7(Z[X],W[X])!==0)return!1;return!0};class P4{constructor(Z,Q){if(Q=gL(Q),Z instanceof P4)if(Z.loose===!!Q.loose&&Z.includePrerelease===!!Q.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>dG)throw TypeError(`version is longer than ${dG} characters`);m8("SemVer",Z,Q),this.options=Q,this.loose=!!Q.loose,this.includePrerelease=!!Q.includePrerelease;let W=Z.trim().match(Q.loose?d8[c8.LOOSE]:d8[c8.FULL]);if(!W)throw TypeError(`Invalid Version: ${Z}`);if(this.raw=Z,this.major=+W[1],this.minor=+W[2],this.patch=+W[3],this.major>l8||this.major<0)throw TypeError("Invalid major version");if(this.minor>l8||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>l8||this.patch<0)throw TypeError("Invalid patch version");if(!W[4])this.prerelease=[];else this.prerelease=W[4].split(".").map((X)=>{if(/^[0-9]+$/.test(X)){let J=+X;if(J>=0&&J<l8)return J}return X});this.build=W[5]?W[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(m8("SemVer.compare",this.version,this.options,Z),!(Z instanceof P4)){if(typeof Z==="string"&&Z===this.version)return 0;Z=new P4(Z,this.options)}if(Z.version===this.version)return 0;return this.compareMain(Z)||this.comparePre(Z)}compareMain(Z){if(!(Z instanceof P4))Z=new P4(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 P4))Z=new P4(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 Q=0;do{let W=this.prerelease[Q],X=Z.prerelease[Q];if(m8("prerelease compare",Q,W,X),W===void 0&&X===void 0)return 0;else if(X===void 0)return 1;else if(W===void 0)return-1;else if(W===X)continue;else return j7(W,X)}while(++Q)}compareBuild(Z){if(!(Z instanceof P4))Z=new P4(Z,this.options);let Q=0;do{let W=this.build[Q],X=Z.build[Q];if(m8("build compare",Q,W,X),W===void 0&&X===void 0)return 0;else if(X===void 0)return 1;else if(W===void 0)return-1;else if(W===X)continue;else return j7(W,X)}while(++Q)}inc(Z,Q,W){if(Z.startsWith("pre")){if(!Q&&W===!1)throw Error("invalid increment argument: identifier is empty");if(Q){let X=`-${Q}`.match(this.options.loose?d8[c8.PRERELEASELOOSE]:d8[c8.PRERELEASE]);if(!X||X[1]!==Q)throw Error(`invalid identifier: ${Q}`)}}switch(Z){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",Q,W);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",Q,W);break;case"prepatch":this.prerelease.length=0,this.inc("patch",Q,W),this.inc("pre",Q,W);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",Q,W);this.inc("pre",Q,W);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 X=Number(W)?1:0;if(this.prerelease.length===0)this.prerelease=[X];else{let J=this.prerelease.length;while(--J>=0)if(typeof this.prerelease[J]==="number")this.prerelease[J]++,J=-2;if(J===-1){if(Q===this.prerelease.join(".")&&W===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(X)}}if(Q){let J=[Q,X];if(W===!1)J=[Q];if(fL(this.prerelease,Q)){let G=this.prerelease[Q.split(".").length];if(isNaN(G))this.prerelease=J}else this.prerelease=J}break}default:throw Error(`invalid increment argument: ${Z}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}cG.exports=P4});var P6=j((qv,iG)=>{var pG=f0(),hL=(Z,Q,W=!1)=>{if(Z instanceof pG)return Z;try{return new pG(Z,Q)}catch(X){if(!W)return null;throw X}};iG.exports=hL});var rG=j((Kv,nG)=>{var uL=P6(),mL=(Z,Q)=>{let W=uL(Z,Q);return W?W.version:null};nG.exports=mL});var sG=j((Uv,aG)=>{var lL=P6(),dL=(Z,Q)=>{let W=lL(Z.trim().replace(/^[=v]+/,""),Q);return W?W.version:null};aG.exports=dL});var eG=j((Vv,tG)=>{var oG=f0(),cL=(Z,Q,W,X,J)=>{if(typeof W==="string")J=X,X=W,W=void 0;try{return new oG(Z instanceof oG?Z.version:Z,W).inc(Q,X,J).version}catch(G){return null}};tG.exports=cL});var WY=j((Hv,QY)=>{var ZY=P6(),pL=(Z,Q)=>{let W=ZY(Z,null,!0),X=ZY(Q,null,!0),J=W.compare(X);if(J===0)return null;let G=J>0,Y=G?W:X,z=G?X:W,q=!!Y.prerelease.length;if(!!z.prerelease.length&&!q){if(!z.patch&&!z.minor)return"major";if(z.compareMain(Y)===0){if(z.minor&&!z.patch)return"minor";return"patch"}}let V=q?"pre":"";if(W.major!==X.major)return V+"major";if(W.minor!==X.minor)return V+"minor";if(W.patch!==X.patch)return V+"patch";return"prerelease"};QY.exports=pL});var JY=j((Bv,XY)=>{var iL=f0(),nL=(Z,Q)=>new iL(Z,Q).major;XY.exports=nL});var YY=j((Fv,GY)=>{var rL=f0(),aL=(Z,Q)=>new rL(Z,Q).minor;GY.exports=aL});var $Y=j((Lv,zY)=>{var sL=f0(),oL=(Z,Q)=>new sL(Z,Q).patch;zY.exports=oL});var KY=j((Av,qY)=>{var tL=P6(),eL=(Z,Q)=>{let W=tL(Z,Q);return W&&W.prerelease.length?W.prerelease:null};qY.exports=eL});var I4=j((Mv,VY)=>{var UY=f0(),ZA=(Z,Q,W)=>new UY(Z,W).compare(new UY(Q,W));VY.exports=ZA});var BY=j((Iv,HY)=>{var QA=I4(),WA=(Z,Q,W)=>QA(Q,Z,W);HY.exports=WA});var LY=j((Nv,FY)=>{var XA=I4(),JA=(Z,Q)=>XA(Z,Q,!0);FY.exports=JA});var p8=j((Dv,MY)=>{var AY=f0(),GA=(Z,Q,W)=>{let X=new AY(Z,W),J=new AY(Q,W);return X.compare(J)||X.compareBuild(J)};MY.exports=GA});var NY=j((wv,IY)=>{var YA=p8(),zA=(Z,Q)=>Z.sort((W,X)=>YA(W,X,Q));IY.exports=zA});var wY=j((Tv,DY)=>{var $A=p8(),qA=(Z,Q)=>Z.sort((W,X)=>$A(X,W,Q));DY.exports=qA});var H9=j((jv,TY)=>{var KA=I4(),UA=(Z,Q,W)=>KA(Z,Q,W)>0;TY.exports=UA});var i8=j((Ev,jY)=>{var VA=I4(),HA=(Z,Q,W)=>VA(Z,Q,W)<0;jY.exports=HA});var E7=j((Ov,EY)=>{var BA=I4(),FA=(Z,Q,W)=>BA(Z,Q,W)===0;EY.exports=FA});var O7=j((Rv,OY)=>{var LA=I4(),AA=(Z,Q,W)=>LA(Z,Q,W)!==0;OY.exports=AA});var n8=j((Pv,RY)=>{var MA=I4(),IA=(Z,Q,W)=>MA(Z,Q,W)>=0;RY.exports=IA});var r8=j((Cv,PY)=>{var NA=I4(),DA=(Z,Q,W)=>NA(Z,Q,W)<=0;PY.exports=DA});var R7=j((Sv,CY)=>{var wA=E7(),TA=O7(),jA=H9(),EA=n8(),OA=i8(),RA=r8(),PA=(Z,Q,W,X)=>{switch(Q){case"===":if(typeof Z==="object")Z=Z.version;if(typeof W==="object")W=W.version;return Z===W;case"!==":if(typeof Z==="object")Z=Z.version;if(typeof W==="object")W=W.version;return Z!==W;case"":case"=":case"==":return wA(Z,W,X);case"!=":return TA(Z,W,X);case">":return jA(Z,W,X);case">=":return EA(Z,W,X);case"<":return OA(Z,W,X);case"<=":return RA(Z,W,X);default:throw TypeError(`Invalid operator: ${Q}`)}};CY.exports=PA});var kY=j((kv,SY)=>{var CA=f0(),SA=P6(),{safeRe:a8,t:s8}=O1(),kA=(Z,Q)=>{if(Z instanceof CA)return Z;if(typeof Z==="number")Z=String(Z);if(typeof Z!=="string")return null;Q=Q||{};let W=null;if(!Q.rtl)W=Z.match(Q.includePrerelease?a8[s8.COERCEFULL]:a8[s8.COERCE]);else{let q=Q.includePrerelease?a8[s8.COERCERTLFULL]:a8[s8.COERCERTL],K;while((K=q.exec(Z))&&(!W||W.index+W[0].length!==Z.length)){if(!W||K.index+K[0].length!==W.index+W[0].length)W=K;q.lastIndex=K.index+K[1].length+K[2].length}q.lastIndex=-1}if(W===null)return null;let X=W[2],J=W[3]||"0",G=W[4]||"0",Y=Q.includePrerelease&&W[5]?`-${W[5]}`:"",z=Q.includePrerelease&&W[6]?`+${W[6]}`:"";return SA(`${X}.${J}.${G}${Y}${z}`,Q)};SY.exports=kA});var bY=j((_v,_Y)=>{var _A=P6(),bA=E1(),xA=f0(),vA=(Z,Q,W)=>{if(!bA.RELEASE_TYPES.includes(Q))return null;let X=yA(Z,W);return X&&gA(X,Q)},yA=(Z,Q)=>{let W=Z instanceof xA?Z.version:Z;return _A(W,Q)},gA=(Z,Q)=>{if(fA(Q))return Z.version;switch(Z.prerelease=[],Q){case"major":Z.minor=0,Z.patch=0;break;case"minor":Z.patch=0;break}return Z.format()},fA=(Z)=>{return Z.startsWith("pre")};_Y.exports=vA});var yY=j((bv,vY)=>{class xY{constructor(){this.max=1000,this.map=new Map}get(Z){let Q=this.map.get(Z);if(Q===void 0)return;else return this.map.delete(Z),this.map.set(Z,Q),Q}delete(Z){return this.map.delete(Z)}set(Z,Q){if(!this.delete(Z)&&Q!==void 0){if(this.map.size>=this.max){let X=this.map.keys().next().value;this.delete(X)}this.map.set(Z,Q)}return this}}vY.exports=xY});var N4=j((xv,uY)=>{var hA=/\s+/g;class B9{constructor(Z,Q){if(Q=mA(Q),Z instanceof B9)if(Z.loose===!!Q.loose&&Z.includePrerelease===!!Q.includePrerelease)return Z;else return new B9(Z.raw,Q);if(Z instanceof P7)return this.raw=Z.value,this.set=[[Z]],this.formatted=void 0,this;if(this.options=Q,this.loose=!!Q.loose,this.includePrerelease=!!Q.includePrerelease,this.raw=Z.trim().replace(hA," "),this.set=this.raw.split("||").map((W)=>this.parseRange(W.trim())).filter((W)=>W.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let W=this.set[0];if(this.set=this.set.filter((X)=>!fY(X[0])),this.set.length===0)this.set=[W];else if(this.set.length>1){for(let X of this.set)if(X.length===1&&sA(X[0])){this.set=[X];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 Q=this.set[Z];for(let W=0;W<Q.length;W++){if(W>0)this.formatted+=" ";this.formatted+=Q[W].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(Z){Z=Z.replace(aA,"");let W=((this.options.includePrerelease&&nA)|(this.options.loose&&rA))+":"+Z,X=gY.get(W);if(X)return X;let J=this.options.loose,G=J?a0[h0.HYPHENRANGELOOSE]:a0[h0.HYPHENRANGE];Z=Z.replace(G,zM(this.options.includePrerelease)),A0("hyphen replace",Z),Z=Z.replace(a0[h0.COMPARATORTRIM],cA),A0("comparator trim",Z),Z=Z.replace(a0[h0.TILDETRIM],pA),A0("tilde trim",Z),Z=Z.replace(a0[h0.CARETTRIM],iA),A0("caret trim",Z);let Y=Z.split(" ").map((V)=>oA(V,this.options)).join(" ").split(/\s+/).map((V)=>YM(V,this.options));if(J)Y=Y.filter((V)=>{return A0("loose invalid filter",V,this.options),!!V.match(a0[h0.COMPARATORLOOSE])});A0("range list",Y);let z=new Map,q=Y.map((V)=>new P7(V,this.options));for(let V of q){if(fY(V))return[V];z.set(V.value,V)}if(z.size>1&&z.has(""))z.delete("");let K=[...z.values()];return gY.set(W,K),K}intersects(Z,Q){if(!(Z instanceof B9))throw TypeError("a Range is required");return this.set.some((W)=>{return hY(W,Q)&&Z.set.some((X)=>{return hY(X,Q)&&W.every((J)=>{return X.every((G)=>{return J.intersects(G,Q)})})})})}test(Z){if(!Z)return!1;if(typeof Z==="string")try{Z=new lA(Z,this.options)}catch(Q){return!1}for(let Q=0;Q<this.set.length;Q++)if($M(this.set[Q],Z,this.options))return!0;return!1}}uY.exports=B9;var uA=yY(),gY=new uA,mA=u8(),P7=F9(),A0=V9(),lA=f0(),{safeRe:a0,src:dA,t:h0,comparatorTrimReplace:cA,tildeTrimReplace:pA,caretTrimReplace:iA}=O1(),{FLAG_INCLUDE_PRERELEASE:nA,FLAG_LOOSE:rA}=E1(),aA=new RegExp(dA[h0.BUILD],"g"),fY=(Z)=>Z.value==="<0.0.0-0",sA=(Z)=>Z.value==="",hY=(Z,Q)=>{let W=!0,X=Z.slice(),J=X.pop();while(W&&X.length)W=X.every((G)=>{return J.intersects(G,Q)}),J=X.pop();return W},oA=(Z,Q)=>{return Z=Z.replace(a0[h0.BUILD],""),A0("comp",Z,Q),Z=QM(Z,Q),A0("caret",Z),Z=eA(Z,Q),A0("tildes",Z),Z=XM(Z,Q),A0("xrange",Z),Z=GM(Z,Q),A0("stars",Z),Z},k0=(Z)=>!Z||Z.toLowerCase()==="x"||Z==="*",tA=(Z,Q,W)=>k0(Z)&&!k0(Q)||k0(Q)&&W&&!k0(W),eA=(Z,Q)=>{return Z.trim().split(/\s+/).map((W)=>ZM(W,Q)).join(" ")},ZM=(Z,Q)=>{let W=Q.loose?a0[h0.TILDELOOSE]:a0[h0.TILDE],X=Q.includePrerelease?"-0":"";return Z.replace(W,(J,G,Y,z,q)=>{A0("tilde",Z,J,G,Y,z,q);let K;if(k0(G))K="";else if(k0(Y))K=`>=${G}.0.0${X} <${+G+1}.0.0-0`;else if(k0(z))K=`>=${G}.${Y}.0${X} <${G}.${+Y+1}.0-0`;else if(q)A0("replaceTilde pr",q),K=`>=${G}.${Y}.${z}-${q} <${G}.${+Y+1}.0-0`;else K=`>=${G}.${Y}.${z} <${G}.${+Y+1}.0-0`;return A0("tilde return",K),K})},QM=(Z,Q)=>{return Z.trim().split(/\s+/).map((W)=>WM(W,Q)).join(" ")},WM=(Z,Q)=>{A0("caret",Z,Q);let W=Q.loose?a0[h0.CARETLOOSE]:a0[h0.CARET],X=Q.includePrerelease?"-0":"";return Z.replace(W,(J,G,Y,z,q)=>{A0("caret",Z,J,G,Y,z,q);let K;if(k0(G))K="";else if(k0(Y))K=`>=${G}.0.0${X} <${+G+1}.0.0-0`;else if(k0(z))if(G==="0")K=`>=${G}.${Y}.0${X} <${G}.${+Y+1}.0-0`;else K=`>=${G}.${Y}.0${X} <${+G+1}.0.0-0`;else if(q)if(A0("replaceCaret pr",q),G==="0")if(Y==="0")K=`>=${G}.${Y}.${z}-${q} <${G}.${Y}.${+z+1}-0`;else K=`>=${G}.${Y}.${z}-${q} <${G}.${+Y+1}.0-0`;else K=`>=${G}.${Y}.${z}-${q} <${+G+1}.0.0-0`;else if(A0("no pr"),G==="0")if(Y==="0")K=`>=${G}.${Y}.${z} <${G}.${Y}.${+z+1}-0`;else K=`>=${G}.${Y}.${z} <${G}.${+Y+1}.0-0`;else K=`>=${G}.${Y}.${z} <${+G+1}.0.0-0`;return A0("caret return",K),K})},XM=(Z,Q)=>{return A0("replaceXRanges",Z,Q),Z.split(/\s+/).map((W)=>JM(W,Q)).join(" ")},JM=(Z,Q)=>{Z=Z.trim();let W=Q.loose?a0[h0.XRANGELOOSE]:a0[h0.XRANGE];return Z.replace(W,(X,J,G,Y,z,q)=>{if(A0("xRange",Z,X,J,G,Y,z,q),tA(G,Y,z))return Z;let K=k0(G),V=K||k0(Y),H=V||k0(z),B=H;if(J==="="&&B)J="";if(q=Q.includePrerelease?"-0":"",K)if(J===">"||J==="<")X="<0.0.0-0";else X="*";else if(J&&B){if(V)Y=0;if(z=0,J===">")if(J=">=",V)G=+G+1,Y=0,z=0;else Y=+Y+1,z=0;else if(J==="<=")if(J="<",V)G=+G+1;else Y=+Y+1;if(J==="<")q="-0";X=`${J+G}.${Y}.${z}${q}`}else if(V)X=`>=${G}.0.0${q} <${+G+1}.0.0-0`;else if(H)X=`>=${G}.${Y}.0${q} <${G}.${+Y+1}.0-0`;return A0("xRange return",X),X})},GM=(Z,Q)=>{return A0("replaceStars",Z,Q),Z.trim().replace(a0[h0.STAR],"")},YM=(Z,Q)=>{return A0("replaceGTE0",Z,Q),Z.trim().replace(a0[Q.includePrerelease?h0.GTE0PRE:h0.GTE0],"")},zM=(Z)=>(Q,W,X,J,G,Y,z,q,K,V,H,B)=>{if(k0(X))W="";else if(k0(J))W=`>=${X}.0.0${Z?"-0":""}`;else if(k0(G))W=`>=${X}.${J}.0${Z?"-0":""}`;else if(Y)W=`>=${W}`;else W=`>=${W}${Z?"-0":""}`;if(k0(K))q="";else if(k0(V))q=`<${+K+1}.0.0-0`;else if(k0(H))q=`<${K}.${+V+1}.0-0`;else if(B)q=`<=${K}.${V}.${H}-${B}`;else if(Z)q=`<${K}.${V}.${+H+1}-0`;else q=`<=${q}`;return`${W} ${q}`.trim()},$M=(Z,Q,W)=>{for(let X=0;X<Z.length;X++)if(!Z[X].test(Q))return!1;if(Q.prerelease.length&&!W.includePrerelease){for(let X=0;X<Z.length;X++){if(A0(Z[X].semver),Z[X].semver===P7.ANY)continue;if(Z[X].semver.prerelease.length>0){let J=Z[X].semver;if(J.major===Q.major&&J.minor===Q.minor&&J.patch===Q.patch)return!0}}return!1}return!0}});var F9=j((vv,iY)=>{var L9=Symbol("SemVer ANY");class o8{static get ANY(){return L9}constructor(Z,Q){if(Q=mY(Q),Z instanceof o8)if(Z.loose===!!Q.loose)return Z;else Z=Z.value;if(Z=Z.trim().split(/\s+/).join(" "),S7("comparator",Z,Q),this.options=Q,this.loose=!!Q.loose,this.parse(Z),this.semver===L9)this.value="";else this.value=this.operator+this.semver.version;S7("comp",this)}parse(Z){let Q=this.options.loose?lY[dY.COMPARATORLOOSE]:lY[dY.COMPARATOR],W=Z.match(Q);if(!W)throw TypeError(`Invalid comparator: ${Z}`);if(this.operator=W[1]!==void 0?W[1]:"",this.operator==="=")this.operator="";if(!W[2])this.semver=L9;else this.semver=new cY(W[2],this.options.loose)}toString(){return this.value}test(Z){if(S7("Comparator.test",Z,this.options.loose),this.semver===L9||Z===L9)return!0;if(typeof Z==="string")try{Z=new cY(Z,this.options)}catch(Q){return!1}return C7(Z,this.operator,this.semver,this.options)}intersects(Z,Q){if(!(Z instanceof o8))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new pY(Z.value,Q).test(this.value)}else if(Z.operator===""){if(Z.value==="")return!0;return new pY(this.value,Q).test(Z.semver)}if(Q=mY(Q),Q.includePrerelease&&(this.value==="<0.0.0-0"||Z.value==="<0.0.0-0"))return!1;if(!Q.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(C7(this.semver,"<",Z.semver,Q)&&this.operator.startsWith(">")&&Z.operator.startsWith("<"))return!0;if(C7(this.semver,">",Z.semver,Q)&&this.operator.startsWith("<")&&Z.operator.startsWith(">"))return!0;return!1}}iY.exports=o8;var mY=u8(),{safeRe:lY,t:dY}=O1(),C7=R7(),S7=V9(),cY=f0(),pY=N4()});var A9=j((yv,nY)=>{var qM=N4(),KM=(Z,Q,W)=>{try{Q=new qM(Q,W)}catch(X){return!1}return Q.test(Z)};nY.exports=KM});var aY=j((gv,rY)=>{var UM=N4(),VM=(Z,Q)=>new UM(Z,Q).set.map((W)=>W.map((X)=>X.value).join(" ").trim().split(" "));rY.exports=VM});var oY=j((fv,sY)=>{var HM=f0(),BM=N4(),FM=(Z,Q,W)=>{let X=null,J=null,G=null;try{G=new BM(Q,W)}catch(Y){return null}return Z.forEach((Y)=>{if(G.test(Y)){if(!X||J.compare(Y)===-1)X=Y,J=new HM(X,W)}}),X};sY.exports=FM});var eY=j((hv,tY)=>{var LM=f0(),AM=N4(),MM=(Z,Q,W)=>{let X=null,J=null,G=null;try{G=new AM(Q,W)}catch(Y){return null}return Z.forEach((Y)=>{if(G.test(Y)){if(!X||J.compare(Y)===1)X=Y,J=new LM(X,W)}}),X};tY.exports=MM});var Wz=j((uv,Qz)=>{var k7=f0(),IM=N4(),Zz=H9(),NM=(Z,Q)=>{Z=new IM(Z,Q);let W=new k7("0.0.0");if(Z.test(W))return W;if(W=new k7("0.0.0-0"),Z.test(W))return W;W=null;for(let X=0;X<Z.set.length;++X){let J=Z.set[X],G=null;if(J.forEach((Y)=>{let z=new k7(Y.semver.version);switch(Y.operator){case">":if(z.prerelease.length===0)z.patch++;else z.prerelease.push(0);z.raw=z.format();case"":case">=":if(!G||Zz(z,G))G=z;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${Y.operator}`)}}),G&&(!W||Zz(W,G)))W=G}if(W&&Z.test(W))return W;return null};Qz.exports=NM});var Jz=j((mv,Xz)=>{var DM=N4(),wM=(Z,Q)=>{try{return new DM(Z,Q).range||"*"}catch(W){return null}};Xz.exports=wM});var t8=j((lv,$z)=>{var TM=f0(),zz=F9(),{ANY:jM}=zz,EM=N4(),OM=A9(),Gz=H9(),Yz=i8(),RM=r8(),PM=n8(),CM=(Z,Q,W,X)=>{Z=new TM(Z,X),Q=new EM(Q,X);let J,G,Y,z,q;switch(W){case">":J=Gz,G=RM,Y=Yz,z=">",q=">=";break;case"<":J=Yz,G=PM,Y=Gz,z="<",q="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(OM(Z,Q,X))return!1;for(let K=0;K<Q.set.length;++K){let V=Q.set[K],H=null,B=null;if(V.forEach((F)=>{if(F.semver===jM)F=new zz(">=0.0.0");if(H=H||F,B=B||F,J(F.semver,H.semver,X))H=F;else if(Y(F.semver,B.semver,X))B=F}),H.operator===z||H.operator===q)return!1;if((!B.operator||B.operator===z)&&G(Z,B.semver))return!1;else if(B.operator===q&&Y(Z,B.semver))return!1}return!0};$z.exports=CM});var Kz=j((dv,qz)=>{var SM=t8(),kM=(Z,Q,W)=>SM(Z,Q,">",W);qz.exports=kM});var Vz=j((cv,Uz)=>{var _M=t8(),bM=(Z,Q,W)=>_M(Z,Q,"<",W);Uz.exports=bM});var Fz=j((pv,Bz)=>{var Hz=N4(),xM=(Z,Q,W)=>{return Z=new Hz(Z,W),Q=new Hz(Q,W),Z.intersects(Q,W)};Bz.exports=xM});var Az=j((iv,Lz)=>{var vM=A9(),yM=I4();Lz.exports=(Z,Q,W)=>{let X=[],J=null,G=null,Y=Z.sort((V,H)=>yM(V,H,W));for(let V of Y)if(vM(V,Q,W)){if(G=V,!J)J=V}else{if(G)X.push([J,G]);G=null,J=null}if(J)X.push([J,null]);let z=[];for(let[V,H]of X)if(V===H)z.push(V);else if(!H&&V===Y[0])z.push("*");else if(!H)z.push(`>=${V}`);else if(V===Y[0])z.push(`<=${H}`);else z.push(`${V} - ${H}`);let q=z.join(" || "),K=typeof Q.raw==="string"?Q.raw:String(Q);return q.length<K.length?q:Q}});var Tz=j((nv,wz)=>{var Mz=N4(),x7=F9(),{ANY:_7}=x7,b7=A9(),v7=I4(),gM=(Z,Q,W={})=>{if(Z===Q)return!0;Z=new Mz(Z,W),Q=new Mz(Q,W);let X=!1;Z:for(let J of Z.set){for(let G of Q.set){let Y=hM(J,G,W);if(X=X||Y!==null,Y)continue Z}if(X)return!1}return!0},fM=[new x7(">=0.0.0-0")],Iz=[new x7(">=0.0.0")],hM=(Z,Q,W)=>{if(Z===Q)return!0;if(Z.length===1&&Z[0].semver===_7)if(Q.length===1&&Q[0].semver===_7)return!0;else if(W.includePrerelease)Z=fM;else Z=Iz;if(Q.length===1&&Q[0].semver===_7)if(W.includePrerelease)return!0;else Q=Iz;let X=new Set,J,G;for(let F of Z)if(F.operator===">"||F.operator===">=")J=Nz(J,F,W);else if(F.operator==="<"||F.operator==="<=")G=Dz(G,F,W);else X.add(F.semver);if(X.size>1)return null;let Y;if(J&&G){if(Y=v7(J.semver,G.semver,W),Y>0)return null;else if(Y===0&&(J.operator!==">="||G.operator!=="<="))return null}for(let F of X){if(J&&!b7(F,String(J),W))return null;if(G&&!b7(F,String(G),W))return null;for(let A of Q)if(!b7(F,String(A),W))return!1;return!0}let z,q,K,V,H=G&&!W.includePrerelease&&G.semver.prerelease.length?G.semver:!1,B=J&&!W.includePrerelease&&J.semver.prerelease.length?J.semver:!1;if(H&&H.prerelease.length===1&&G.operator==="<"&&H.prerelease[0]===0)H=!1;for(let F of Q){if(V=V||F.operator===">"||F.operator===">=",K=K||F.operator==="<"||F.operator==="<=",J){if(B){if(F.semver.prerelease&&F.semver.prerelease.length&&F.semver.major===B.major&&F.semver.minor===B.minor&&F.semver.patch===B.patch)B=!1}if(F.operator===">"||F.operator===">="){if(z=Nz(J,F,W),z===F&&z!==J)return!1}else if(J.operator===">="&&!F.test(J.semver))return!1}if(G){if(H){if(F.semver.prerelease&&F.semver.prerelease.length&&F.semver.major===H.major&&F.semver.minor===H.minor&&F.semver.patch===H.patch)H=!1}if(F.operator==="<"||F.operator==="<="){if(q=Dz(G,F,W),q===F&&q!==G)return!1}else if(G.operator==="<="&&!F.test(G.semver))return!1}if(!F.operator&&(G||J)&&Y!==0)return!1}if(J&&K&&!G&&Y!==0)return!1;if(G&&V&&!J&&Y!==0)return!1;if(B||H)return!1;return!0},Nz=(Z,Q,W)=>{if(!Z)return Q;let X=v7(Z.semver,Q.semver,W);return X>0?Z:X<0?Q:Q.operator===">"&&Z.operator===">="?Q:Z},Dz=(Z,Q,W)=>{if(!Z)return Q;let X=v7(Z.semver,Q.semver,W);return X<0?Z:X>0?Q:Q.operator==="<"&&Z.operator==="<="?Q:Z};wz.exports=gM});var Rz=j((rv,Oz)=>{var y7=O1(),jz=E1(),uM=f0(),Ez=T7(),mM=P6(),lM=rG(),dM=sG(),cM=eG(),pM=WY(),iM=JY(),nM=YY(),rM=$Y(),aM=KY(),sM=I4(),oM=BY(),tM=LY(),eM=p8(),ZI=NY(),QI=wY(),WI=H9(),XI=i8(),JI=E7(),GI=O7(),YI=n8(),zI=r8(),$I=R7(),qI=kY(),KI=bY(),UI=F9(),VI=N4(),HI=A9(),BI=aY(),FI=oY(),LI=eY(),AI=Wz(),MI=Jz(),II=t8(),NI=Kz(),DI=Vz(),wI=Fz(),TI=Az(),jI=Tz();Oz.exports={parse:mM,valid:lM,clean:dM,inc:cM,diff:pM,major:iM,minor:nM,patch:rM,prerelease:aM,compare:sM,rcompare:oM,compareLoose:tM,compareBuild:eM,sort:ZI,rsort:QI,gt:WI,lt:XI,eq:JI,neq:GI,gte:YI,lte:zI,cmp:$I,coerce:qI,truncate:KI,Comparator:UI,Range:VI,satisfies:HI,toComparators:BI,maxSatisfying:FI,minSatisfying:LI,minVersion:AI,validRange:MI,outside:II,gtr:NI,ltr:DI,intersects:wI,simplifyRange:TI,subset:jI,SemVer:uM,re:y7.re,src:y7.src,tokens:y7.t,SEMVER_SPEC_VERSION:jz.SEMVER_SPEC_VERSION,RELEASE_TYPES:jz.RELEASE_TYPES,compareIdentifiers:Ez.compareIdentifiers,rcompareIdentifiers:Ez.rcompareIdentifiers}});var Y6;var e8=u(()=>{Y6={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.3",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 && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","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:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://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.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.3","@img/sharp-darwin-x64":"0.35.3","@img/sharp-freebsd-wasm32":"0.35.3","@img/sharp-libvips-darwin-arm64":"1.3.2","@img/sharp-libvips-darwin-x64":"1.3.2","@img/sharp-libvips-linux-arm":"1.3.2","@img/sharp-libvips-linux-arm64":"1.3.2","@img/sharp-libvips-linux-ppc64":"1.3.2","@img/sharp-libvips-linux-riscv64":"1.3.2","@img/sharp-libvips-linux-s390x":"1.3.2","@img/sharp-libvips-linux-x64":"1.3.2","@img/sharp-libvips-linuxmusl-arm64":"1.3.2","@img/sharp-libvips-linuxmusl-x64":"1.3.2","@img/sharp-linux-arm":"0.35.3","@img/sharp-linux-arm64":"0.35.3","@img/sharp-linux-ppc64":"0.35.3","@img/sharp-linux-riscv64":"0.35.3","@img/sharp-linux-s390x":"0.35.3","@img/sharp-linux-x64":"0.35.3","@img/sharp-linuxmusl-arm64":"0.35.3","@img/sharp-linuxmusl-x64":"0.35.3","@img/sharp-webcontainers-wasm32":"0.35.3","@img/sharp-win32-arm64":"0.35.3","@img/sharp-win32-ia32":"0.35.3","@img/sharp-win32-x64":"0.35.3"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.1","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.1","@img/sharp-libvips-dev":"1.3.2","@img/sharp-libvips-dev-wasm32":"1.3.2","@img/sharp-libvips-win32-arm64":"1.3.2","@img/sharp-libvips-win32-ia32":"1.3.2","@img/sharp-libvips-win32-x64":"1.3.2","@types/node":"*",emnapi:"^1.11.1","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.9.0","node-gyp":"^12.4.0",publint:"^0.3.21","tar-fs":"^3.1.3",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 M9}from"node:child_process";import{createHash as OI}from"node:crypto";var I9,f7,RI,Cz,PI,h7,CI=(Z)=>{if(Z instanceof Error)console.error(`sharp: Installation error: ${Z.message}`);else console.log(`sharp: ${Z}`)},Sz=()=>f7.default.isNonGlibcLinuxSync()?f7.default.familySync():"",SI=()=>`${process.platform}${Sz()}-${process.arch}`,R1=()=>{if(kz())return"wasm32";let{npm_config_arch:Z,npm_config_platform:Q,npm_config_libc:W}=process.env,X=typeof W==="string"?W:Sz();return`${Q||process.platform}${X}-${Z||process.arch}`},kI=()=>{try{return v0(`@img/sharp-libvips-dev-${R1()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},_I=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},bI=()=>{try{return v0(`@img/sharp-libvips-dev-${R1()}/lib`)}catch{try{return v0(`@img/sharp-libvips-${R1()}/lib`)}catch{}}return""},xI=()=>{if(process.release?.name==="node"&&process.versions){if(!I9.default.satisfies(process.versions.node,Y6.engines.node))return{found:process.versions.node,expected:Y6.engines.node}}},kz=()=>{let{CC:Z}=process.env;return Boolean(Z?.endsWith("/emcc"))},vI=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(M9("sysctl sysctl.proc_translated",h7).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},Pz=(Z)=>OI("sha512").update(Z).digest("hex"),yI=()=>{try{let Z=Pz(`imgsharp-libvips-${R1()}`),Q=I9.default.coerce(Y6.optionalDependencies[`@img/sharp-libvips-${R1()}`],{includePrerelease:!0}).version;return Pz(`${Z}npm:${Q}`).slice(0,10)}catch{}return""},gI=()=>M9(`node-gyp rebuild --directory=src ${kz()?"--nodedir=emscripten":""}`,{...h7,stdio:"inherit"}).status,_z=()=>{if(process.platform!=="win32")return(M9("pkg-config --modversion vips-cpp",{...h7,env:{...process.env,PKG_CONFIG_PATH:bz()}}).stdout||"").trim();else return""},fI=()=>{try{let Z=(M9("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(Z)return`${Z}/lib/pkgconfig`}catch(Z){}return},hI=()=>{try{let Z=(M9("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(Z)return Z}catch(Z){}return},bz=()=>{if(process.platform!=="win32")return[fI(),hI(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},g7=(Z,Q,W)=>{if(W)W(`Detected ${Q}, skipping search for globally-installed libvips`);return Z},uI=(Z)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return g7(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",Z);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return g7(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",Z);if(vI())return g7(!1,"Rosetta",Z);let Q=_z();return!!Q&&I9.default.gte(Q,Cz)},Z5;var u7=u(()=>{e8();I9=$1(Rz(),1),f7=$1(h8(),1);/*!
216
219
  Copyright 2013 Lovell Fuller and others.
217
220
  SPDX-License-Identifier: Apache-2.0
218
- */sM=process.env.npm_package_config_libvips||Z6.config.libvips,Vz=V9.default.coerce(sM).version,oM=["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"],E7={encoding:"utf8",shell:!0},p8={minimumLibvipsVersion:Vz,prebuiltPlatforms:oM,buildPlatformArch:T1,buildSharpLibvipsIncludeDir:ZI,buildSharpLibvipsCPlusPlusDir:XI,buildSharpLibvipsLibDir:QI,isUnsupportedNodeRuntime:WI,runtimePlatformArch:eM,log:tM,yarnLocator:GI,spawnRebuild:YI,globalLibvipsVersion:Fz,pkgConfigPath:Lz,useGlobalLibvips:qI}});import{createRequire as KI}from"node:module";var n8,C0,Mz,UI,Az,VI,BI,X6,V0,w6,q0;var B9=c(()=>{R7();c8();n8=W1(S8(),1);/*!
221
+ */RI=process.env.npm_package_config_libvips||Y6.config.libvips,Cz=I9.default.coerce(RI).version,PI=["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"],h7={encoding:"utf8",shell:!0},Z5={minimumLibvipsVersion:Cz,prebuiltPlatforms:PI,buildPlatformArch:R1,buildSharpLibvipsIncludeDir:kI,buildSharpLibvipsCPlusPlusDir:_I,buildSharpLibvipsLibDir:bI,isUnsupportedNodeRuntime:xI,runtimePlatformArch:SI,log:CI,yarnLocator:yI,spawnRebuild:gI,globalLibvipsVersion:_z,pkgConfigPath:bz,useGlobalLibvips:uI}});import{createRequire as mI}from"node:module";var Q5,_0,vz,lI,xz,dI,cI,z6,V0,C6,K0;var N9=u(()=>{u7();e8();Q5=$1(h8(),1);/*!
219
222
  Copyright 2013 Lovell Fuller and others.
220
223
  SPDX-License-Identifier: Apache-2.0
221
- */C0=KI(import.meta.url),{version:Mz}=Z6,{runtimePlatformArch:UI,isUnsupportedNodeRuntime:Az,prebuiltPlatforms:VI,minimumLibvipsVersion:BI}=p8,X6=UI(),w6=[];try{V0=C0(`../src/build/Release/sharp-${X6}-${Mz}.node`)}catch(Z){w6.push(Z)}if(!V0)try{V0=C0(`../src/build/Release/sharp-wasm32-${Mz}.node`)}catch(Z){w6.push(Z)}if(!V0)try{switch(X6){case"darwin-arm64":V0=C0("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":V0=C0("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":V0=C0("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":V0=C0("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":V0=C0("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":V0=C0("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":V0=C0("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":V0=C0("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":V0=C0("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":V0=C0("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":V0=C0("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":V0=C0("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":V0=C0("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":V0=C0("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":V0=C0("@img/sharp-webcontainers-wasm32/sharp.node");break}if(V0&&["linux-x64","linuxmusl-x64"].includes(X6)&&!V0._isUsingX64V2()){let Z=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");Z.code="Unsupported CPU",w6.push(Z),V0=null}if(V0&&process.versions.electron&&X6.startsWith("linux"))process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(Z){w6.push(Z)}if(!V0)try{V0=C0("@img/sharp-wasm32/sharp.node")}catch(Z){w6.push(Z)}if(!V0){let[Z,X,Q]=["linux","darwin","win32"].map((G)=>X6.startsWith(G)),W=[`Could not load the "sharp" module using the ${X6} runtime`];w6.forEach((G)=>{if(!G.code.endsWith("MODULE_NOT_FOUND"))W.push(`${G.code}: ${G.message}`)});let J=w6.map((G)=>G.message).join(" ");if(W.push("Possible solutions:"),Az()){let{found:G,expected:Y}=Az();W.push("- Please upgrade Node.js:",` Found ${G}`,` Requires ${Y}`)}else if(VI.includes(X6)){let[G,Y]=X6.split("-"),z=G.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=${G.replace("musl","")}${z} --cpu=${Y} sharp`)}else W.push(`- Manually install libvips >= ${BI}`," 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(J))try{let{config:G}=C0(`@img/sharp-libvips-${X6}/package`),Y=`${n8.familySync()} ${n8.versionSync()}`,z=`${G.musl?"musl":"glibc"} ${G.musl||G.glibc}`;W.push("- Update your OS:",` Found ${Y}`,` Requires ${z}`)}catch(G){}if(Z&&/\/snap\/core[0-9]{2}/.test(J))W.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(X&&/Incompatible library version/.test(J))W.push("- Update Homebrew:"," brew update && brew upgrade vips");if(w6.some((G)=>G.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(J))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(`
222
- `))}q0=V0});import HI from"node:util";import P7 from"node:stream";function AI(){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 FI,LI=(Z)=>{d6.queue.emit("change",Z)},d6=function(Z,X){if(arguments.length===1&&!$.defined(Z))throw Error("Invalid input");if(!(this instanceof d6))return new d6(Z,X);return P7.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),FI(Q)},queueListener:LI},this.options.input=this._createInputDescriptor(Z,X,{allowStream:!0}),this},u4;var Iz=c(()=>{v4();B9();/*!
224
+ */_0=mI(import.meta.url),{version:vz}=Y6,{runtimePlatformArch:lI,isUnsupportedNodeRuntime:xz,prebuiltPlatforms:dI,minimumLibvipsVersion:cI}=Z5,z6=lI(),C6=[];try{V0=_0(`../src/build/Release/sharp-${z6}-${vz}.node`)}catch(Z){C6.push(Z)}if(!V0)try{V0=_0(`../src/build/Release/sharp-wasm32-${vz}.node`)}catch(Z){C6.push(Z)}if(!V0)try{switch(z6){case"darwin-arm64":V0=_0("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":V0=_0("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":V0=_0("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":V0=_0("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":V0=_0("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":V0=_0("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":V0=_0("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":V0=_0("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":V0=_0("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":V0=_0("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":V0=_0("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":V0=_0("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":V0=_0("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":V0=_0("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":V0=_0("@img/sharp-webcontainers-wasm32/sharp.node");break}if(V0&&["linux-x64","linuxmusl-x64"].includes(z6)&&!V0._isUsingX64V2()){let Z=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");Z.code="Unsupported CPU",C6.push(Z),V0=null}if(V0&&process.versions.electron&&z6.startsWith("linux"))process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(Z){C6.push(Z)}if(!V0)try{V0=_0("@img/sharp-wasm32/sharp.node")}catch(Z){C6.push(Z)}if(!V0){let[Z,Q,W]=["linux","darwin","win32"].map((G)=>z6.startsWith(G)),X=[`Could not load the "sharp" module using the ${z6} runtime`];C6.forEach((G)=>{if(!G.code.endsWith("MODULE_NOT_FOUND"))X.push(`${G.code}: ${G.message}`)});let J=C6.map((G)=>G.message).join(" ");if(X.push("Possible solutions:"),xz()){let{found:G,expected:Y}=xz();X.push("- Please upgrade Node.js:",` Found ${G}`,` Requires ${Y}`)}else if(dI.includes(z6)){let[G,Y]=z6.split("-"),z=G.endsWith("musl")?" --libc=musl":"";X.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=${G.replace("musl","")}${z} --cpu=${Y} sharp`)}else X.push(`- Manually install libvips >= ${cI}`," 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(J))try{let{config:G}=_0(`@img/sharp-libvips-${z6}/package`),Y=`${Q5.familySync()} ${Q5.versionSync()}`,z=`${G.musl?"musl":"glibc"} ${G.musl||G.glibc}`;X.push("- Update your OS:",` Found ${Y}`,` Requires ${z}`)}catch(G){}if(Z&&/\/snap\/core[0-9]{2}/.test(J))X.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(Q&&/Incompatible library version/.test(J))X.push("- Update Homebrew:"," brew update && brew upgrade vips");if(C6.some((G)=>G.code==="ERR_DLOPEN_DISABLED"))X.push("- Run Node.js without using the --no-addons flag");if(W&&/The specified procedure could not be found/.test(J))X.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 X.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(X.join(`
225
+ `))}K0=V0});import pI from"node:util";import m7 from"node:stream";function rI(){let Z=this.constructor.call(),{debuglog:Q,queueListener:W,...X}=this.options;if(Z.options=structuredClone(X),Z.options.debuglog=Q,Z.options.queueListener=W,this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z.options.input.buffer=this.options.input.buffer,Z.emit("finish")});return Z}var iI,nI=(Z)=>{r6.queue.emit("change",Z)},r6=function(Z,Q){if(arguments.length===1&&!$.defined(Z))throw Error("Invalid input");if(!(this instanceof r6))return new r6(Z,Q);return m7.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:(W)=>{this.emit("warning",W),iI(W)},queueListener:nI},this.options.input=this._createInputDescriptor(Z,Q,{allowStream:!0}),this},p4;var yz=u(()=>{u4();N9();/*!
223
226
  Copyright 2013 Lovell Fuller and others.
224
227
  SPDX-License-Identifier: Apache-2.0
225
- */FI=HI.debuglog("sharp");Object.setPrototypeOf(d6.prototype,P7.Duplex.prototype);Object.setPrototypeOf(d6,P7.Duplex);Object.assign(d6.prototype,{clone:AI});u4=d6});function Nz(Z){let X=II.filter((Q)=>$.defined(Z[Q])).map((Q)=>[Q,Z[Q]]);return X.length?Object.fromEntries(X):void 0}function NI(Z,X,Q){let W={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if($.string(Z))W.file=Z;else if($.buffer(Z)){if(Z.length===0)throw Error("Input Buffer is empty");W.buffer=Z}else if($.arrayBuffer(Z)){if(Z.byteLength===0)throw Error("Input bit Array is empty");W.buffer=Buffer.from(Z,0,Z.byteLength)}else if($.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($.plainObject(Z)&&!$.defined(X)){if(X=Z,Nz(X))W.buffer=[]}else if(!$.defined(Z)&&!$.defined(X)&&$.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((J)=>this._createInputDescriptor(J));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}${$.defined(X)?` when also providing options of type ${typeof X}`:""}`);if($.object(X)){if($.defined(X.failOn))if($.string(X.failOn)&&$.inArray(X.failOn,["none","truncated","error","warning"]))W.failOn=X.failOn;else throw $.invalidParameterError("failOn","one of: none, truncated, error, warning",X.failOn);if($.defined(X.autoOrient))if($.bool(X.autoOrient))W.autoOrient=X.autoOrient;else throw $.invalidParameterError("autoOrient","boolean",X.autoOrient);if($.defined(X.density))if($.number(X.density)&&$.inRange(X.density,1,1e5))W.density=X.density;else throw $.invalidParameterError("density","number between 1 and 100000",X.density);if($.defined(X.ignoreIcc))if($.bool(X.ignoreIcc))W.ignoreIcc=X.ignoreIcc;else throw $.invalidParameterError("ignoreIcc","boolean",X.ignoreIcc);if($.defined(X.limitInputPixels))if($.bool(X.limitInputPixels))W.limitInputPixels=X.limitInputPixels?268402689:0;else if($.integer(X.limitInputPixels)&&$.inRange(X.limitInputPixels,0,Number.MAX_SAFE_INTEGER))W.limitInputPixels=X.limitInputPixels;else throw $.invalidParameterError("limitInputPixels","positive integer",X.limitInputPixels);if($.defined(X.limitInputChannels))if($.bool(X.limitInputChannels))W.limitInputChannels=X.limitInputChannels?5:0;else if($.integer(X.limitInputChannels)&&$.inRange(X.limitInputChannels,0,Number.MAX_SAFE_INTEGER))W.limitInputChannels=X.limitInputChannels;else throw $.invalidParameterError("limitInputChannels","positive integer",X.limitInputChannels);if($.defined(X.unlimited))if($.bool(X.unlimited))W.unlimited=X.unlimited;else throw $.invalidParameterError("unlimited","boolean",X.unlimited);if($.defined(X.sequentialRead))if($.bool(X.sequentialRead))W.sequentialRead=X.sequentialRead;else throw $.invalidParameterError("sequentialRead","boolean",X.sequentialRead);if($.defined(X.raw)){if($.object(X.raw)&&$.integer(X.raw.width)&&$.inRange(X.raw.width,1,1e8)&&$.integer(X.raw.height)&&$.inRange(X.raw.height,1,1e8)&&$.integer(X.raw.channels)&&$.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,$.defined(X.raw.premultiplied))if($.bool(X.raw.premultiplied))W.rawPremultiplied=X.raw.premultiplied;else throw $.invalidParameterError("raw.premultiplied","boolean",X.raw.premultiplied);if(W.rawPageHeight=0,$.defined(X.raw.pageHeight))if($.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 $.invalidParameterError("raw.pageHeight","positive integer",X.raw.pageHeight)}if($.defined(X.animated))if($.bool(X.animated))W.pages=X.animated?-1:1;else throw $.invalidParameterError("animated","boolean",X.animated);if($.defined(X.pages))if($.integer(X.pages)&&$.inRange(X.pages,-1,1e5))W.pages=X.pages;else throw $.invalidParameterError("pages","integer between -1 and 100000",X.pages);if($.defined(X.page))if($.integer(X.page)&&$.inRange(X.page,0,1e5))W.page=X.page;else throw $.invalidParameterError("page","integer between 0 and 100000",X.page);if($.object(X.openSlide)&&$.defined(X.openSlide.level))if($.integer(X.openSlide.level)&&$.inRange(X.openSlide.level,0,256))W.openSlideLevel=X.openSlide.level;else throw $.invalidParameterError("openSlide.level","integer between 0 and 256",X.openSlide.level);else if($.defined(X.level))if($.integer(X.level)&&$.inRange(X.level,0,256))W.openSlideLevel=X.level;else throw $.invalidParameterError("level","integer between 0 and 256",X.level);if($.object(X.tiff)&&$.defined(X.tiff.subifd))if($.integer(X.tiff.subifd)&&$.inRange(X.tiff.subifd,-1,1e5))W.tiffSubifd=X.tiff.subifd;else throw $.invalidParameterError("tiff.subifd","integer between -1 and 100000",X.tiff.subifd);else if($.defined(X.subifd))if($.integer(X.subifd)&&$.inRange(X.subifd,-1,1e5))W.tiffSubifd=X.subifd;else throw $.invalidParameterError("subifd","integer between -1 and 100000",X.subifd);if($.object(X.svg)){if($.defined(X.svg.stylesheet))if($.string(X.svg.stylesheet))W.svgStylesheet=X.svg.stylesheet;else throw $.invalidParameterError("svg.stylesheet","string",X.svg.stylesheet);if($.defined(X.svg.highBitdepth))if($.bool(X.svg.highBitdepth))W.svgHighBitdepth=X.svg.highBitdepth;else throw $.invalidParameterError("svg.highBitdepth","boolean",X.svg.highBitdepth)}if($.object(X.pdf)&&$.defined(X.pdf.background))W.pdfBackground=this._getBackgroundColourOption(X.pdf.background);else if($.defined(X.pdfBackground))W.pdfBackground=this._getBackgroundColourOption(X.pdfBackground);if($.object(X.jp2)&&$.defined(X.jp2.oneshot))if($.bool(X.jp2.oneshot))W.jp2Oneshot=X.jp2.oneshot;else throw $.invalidParameterError("jp2.oneshot","boolean",X.jp2.oneshot);if($.defined(X.create))if($.object(X.create)&&$.integer(X.create.width)&&$.inRange(X.create.width,1,1e8)&&$.integer(X.create.height)&&$.inRange(X.create.height,1,1e8)&&$.integer(X.create.channels)){if(W.createWidth=X.create.width,W.createHeight=X.create.height,W.createChannels=X.create.channels,W.createPageHeight=0,$.defined(X.create.pageHeight))if($.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 $.invalidParameterError("create.pageHeight","positive integer",X.create.pageHeight);if($.defined(X.create.noise)){if(!$.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,!$.inRange(X.create.channels,1,4))throw $.invalidParameterError("create.channels","number between 1 and 4",X.create.channels);if(W.createNoiseMean=128,$.defined(X.create.noise.mean))if($.number(X.create.noise.mean)&&$.inRange(X.create.noise.mean,0,1e4))W.createNoiseMean=X.create.noise.mean;else throw $.invalidParameterError("create.noise.mean","number between 0 and 10000",X.create.noise.mean);if(W.createNoiseSigma=30,$.defined(X.create.noise.sigma))if($.number(X.create.noise.sigma)&&$.inRange(X.create.noise.sigma,0,1e4))W.createNoiseSigma=X.create.noise.sigma;else throw $.invalidParameterError("create.noise.sigma","number between 0 and 10000",X.create.noise.sigma)}else if($.defined(X.create.background)){if(!$.inRange(X.create.channels,3,4))throw $.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($.defined(X.text))if($.object(X.text)&&$.string(X.text.text)){if(W.textValue=X.text.text,$.defined(X.text.height)&&$.defined(X.text.dpi))throw Error("Expected only one of dpi or height");if($.defined(X.text.font))if($.string(X.text.font))W.textFont=X.text.font;else throw $.invalidParameterError("text.font","string",X.text.font);if($.defined(X.text.fontfile))if($.string(X.text.fontfile))W.textFontfile=X.text.fontfile;else throw $.invalidParameterError("text.fontfile","string",X.text.fontfile);if($.defined(X.text.width))if($.integer(X.text.width)&&$.inRange(X.text.width,1,1e6))W.textWidth=X.text.width;else throw $.invalidParameterError("text.width","integer between 1 and 1000000",X.text.width);if($.defined(X.text.height))if($.integer(X.text.height)&&$.inRange(X.text.height,1,1e6))W.textHeight=X.text.height;else throw $.invalidParameterError("text.height","integer between 1 and 1000000",X.text.height);if($.defined(X.text.align))if($.string(X.text.align)&&$.string(this.constructor.align[X.text.align]))W.textAlign=this.constructor.align[X.text.align];else throw $.invalidParameterError("text.align","valid alignment",X.text.align);if($.defined(X.text.justify))if($.bool(X.text.justify))W.textJustify=X.text.justify;else throw $.invalidParameterError("text.justify","boolean",X.text.justify);if($.defined(X.text.dpi))if($.integer(X.text.dpi)&&$.inRange(X.text.dpi,1,1e6))W.textDpi=X.text.dpi;else throw $.invalidParameterError("text.dpi","integer between 1 and 1000000",X.text.dpi);if($.defined(X.text.rgba))if($.bool(X.text.rgba))W.textRgba=X.text.rgba;else throw $.invalidParameterError("text.rgba","bool",X.text.rgba);if($.defined(X.text.spacing))if($.integer(X.text.spacing)&&$.inRange(X.text.spacing,-1e6,1e6))W.textSpacing=X.text.spacing;else throw $.invalidParameterError("text.spacing","integer between -1000000 and 1000000",X.text.spacing);if($.defined(X.text.wrap))if($.string(X.text.wrap)&&$.inArray(X.text.wrap,["word","char","word-char","none"]))W.textWrap=X.text.wrap;else throw $.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($.defined(X.join))if($.defined(this.options.join)){if($.defined(X.join.animated))if($.bool(X.join.animated))W.joinAnimated=X.join.animated;else throw $.invalidParameterError("join.animated","boolean",X.join.animated);if($.defined(X.join.across))if($.integer(X.join.across)&&$.inRange(X.join.across,1,1e6))W.joinAcross=X.join.across;else throw $.invalidParameterError("join.across","integer between 1 and 100000",X.join.across);if($.defined(X.join.shim))if($.integer(X.join.shim)&&$.inRange(X.join.shim,0,1e6))W.joinShim=X.join.shim;else throw $.invalidParameterError("join.shim","integer between 0 and 100000",X.join.shim);if($.defined(X.join.background))W.joinBackground=this._getBackgroundColourOption(X.join.background);if($.defined(X.join.halign))if($.string(X.join.halign)&&$.string(this.constructor.align[X.join.halign]))W.joinHalign=this.constructor.align[X.join.halign];else throw $.invalidParameterError("join.halign","valid alignment",X.join.halign);if($.defined(X.join.valign))if($.string(X.join.valign)&&$.string(this.constructor.align[X.join.valign]))W.joinValign=this.constructor.align[X.join.valign];else throw $.invalidParameterError("join.valign","valid alignment",X.join.valign)}else throw Error("Expected input to be an array of images to join")}else if($.defined(X))throw Error(`Invalid input options ${X}`);return W}function DI(Z,X,Q){if(Array.isArray(this.options.input.buffer))if($.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 TI(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function wI(){return Array.isArray(this.options.input.buffer)}function jI(Z){let X=Error();if($.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),q0.metadata(this.options,(Q,W)=>{if(Q)Z($.nativeError(Q,X));else Z(null,W)})});else q0.metadata(this.options,(Q,W)=>{if(Q)Z($.nativeError(Q,X));else Z(null,W)});return this}else if(this._isStreamInput())return new Promise((Q,W)=>{let J=()=>{this._flattenBufferIn(),q0.metadata(this.options,(G,Y)=>{if(G)W($.nativeError(G,X));else Q(Y)})};if(this.writableFinished)J();else this.once("finish",J)});else return new Promise((Q,W)=>{q0.metadata(this.options,(J,G)=>{if(J)W($.nativeError(J,X));else Q(G)})})}function OI(Z){let X=Error();if($.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),q0.stats(this.options,(Q,W)=>{if(Q)Z($.nativeError(Q,X));else Z(null,W)})});else q0.stats(this.options,(Q,W)=>{if(Q)Z($.nativeError(Q,X));else Z(null,W)});return this}else if(this._isStreamInput())return new Promise((Q,W)=>{this.on("finish",function(){this._flattenBufferIn(),q0.stats(this.options,(J,G)=>{if(J)W($.nativeError(J,X));else Q(G)})})});else return new Promise((Q,W)=>{q0.stats(this.options,(J,G)=>{if(J)W($.nativeError(J,X));else Q(G)})})}var MI,II,Dz=(Z)=>{Object.assign(Z.prototype,{_inputOptionsFromObject:Nz,_createInputDescriptor:NI,_write:DI,_flattenBufferIn:TI,_isStreamInput:wI,metadata:jI,stats:OI}),Z.align=MI};var Tz=c(()=>{v4();B9();/*!
228
+ */iI=pI.debuglog("sharp");Object.setPrototypeOf(r6.prototype,m7.Duplex.prototype);Object.setPrototypeOf(r6,m7.Duplex);Object.assign(r6.prototype,{clone:rI});p4=r6});function gz(Z){let Q=sI.filter((W)=>$.defined(Z[W])).map((W)=>[W,Z[W]]);return Q.length?Object.fromEntries(Q):void 0}function oI(Z,Q,W){let X={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if($.string(Z))X.file=Z;else if($.buffer(Z)){if(Z.length===0)throw Error("Input Buffer is empty");X.buffer=Z}else if($.arrayBuffer(Z)){if(Z.byteLength===0)throw Error("Input bit Array is empty");X.buffer=Buffer.from(Z,0,Z.byteLength)}else if($.typedArray(Z)){if(Z.length===0)throw Error("Input Bit Array is empty");X.buffer=Buffer.from(Z.buffer,Z.byteOffset,Z.byteLength)}else if($.plainObject(Z)&&!$.defined(Q)){if(Q=Z,gz(Q))X.buffer=[]}else if(!$.defined(Z)&&!$.defined(Q)&&$.object(W)&&W.allowStream)X.buffer=[];else if(Array.isArray(Z))if(Z.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=Z.map((J)=>this._createInputDescriptor(J));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}${$.defined(Q)?` when also providing options of type ${typeof Q}`:""}`);if($.object(Q)){if($.defined(Q.failOn))if($.string(Q.failOn)&&$.inArray(Q.failOn,["none","truncated","error","warning"]))X.failOn=Q.failOn;else throw $.invalidParameterError("failOn","one of: none, truncated, error, warning",Q.failOn);if($.defined(Q.autoOrient))if($.bool(Q.autoOrient))X.autoOrient=Q.autoOrient;else throw $.invalidParameterError("autoOrient","boolean",Q.autoOrient);if($.defined(Q.density))if($.number(Q.density)&&$.inRange(Q.density,1,1e5))X.density=Q.density;else throw $.invalidParameterError("density","number between 1 and 100000",Q.density);if($.defined(Q.ignoreIcc))if($.bool(Q.ignoreIcc))X.ignoreIcc=Q.ignoreIcc;else throw $.invalidParameterError("ignoreIcc","boolean",Q.ignoreIcc);if($.defined(Q.limitInputPixels))if($.bool(Q.limitInputPixels))X.limitInputPixels=Q.limitInputPixels?268402689:0;else if($.integer(Q.limitInputPixels)&&$.inRange(Q.limitInputPixels,0,Number.MAX_SAFE_INTEGER))X.limitInputPixels=Q.limitInputPixels;else throw $.invalidParameterError("limitInputPixels","positive integer",Q.limitInputPixels);if($.defined(Q.limitInputChannels))if($.bool(Q.limitInputChannels))X.limitInputChannels=Q.limitInputChannels?5:0;else if($.integer(Q.limitInputChannels)&&$.inRange(Q.limitInputChannels,0,Number.MAX_SAFE_INTEGER))X.limitInputChannels=Q.limitInputChannels;else throw $.invalidParameterError("limitInputChannels","positive integer",Q.limitInputChannels);if($.defined(Q.unlimited))if($.bool(Q.unlimited))X.unlimited=Q.unlimited;else throw $.invalidParameterError("unlimited","boolean",Q.unlimited);if($.defined(Q.sequentialRead))if($.bool(Q.sequentialRead))X.sequentialRead=Q.sequentialRead;else throw $.invalidParameterError("sequentialRead","boolean",Q.sequentialRead);if($.defined(Q.raw)){if($.object(Q.raw)&&$.integer(Q.raw.width)&&$.inRange(Q.raw.width,1,1e8)&&$.integer(Q.raw.height)&&$.inRange(Q.raw.height,1,1e8)&&$.integer(Q.raw.channels)&&$.inRange(Q.raw.channels,1,4))switch(X.rawWidth=Q.raw.width,X.rawHeight=Q.raw.height,X.rawChannels=Q.raw.channels,Z.constructor){case Uint8Array:case Uint8ClampedArray:X.rawDepth="uchar";break;case Int8Array:X.rawDepth="char";break;case Uint16Array:X.rawDepth="ushort";break;case Int16Array:X.rawDepth="short";break;case Uint32Array:X.rawDepth="uint";break;case Int32Array:X.rawDepth="int";break;case Float32Array:X.rawDepth="float";break;case Float64Array:X.rawDepth="double";break;default:X.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(X.rawPremultiplied=!1,$.defined(Q.raw.premultiplied))if($.bool(Q.raw.premultiplied))X.rawPremultiplied=Q.raw.premultiplied;else throw $.invalidParameterError("raw.premultiplied","boolean",Q.raw.premultiplied);if(X.rawPageHeight=0,$.defined(Q.raw.pageHeight))if($.integer(Q.raw.pageHeight)&&Q.raw.pageHeight>0&&Q.raw.pageHeight<=Q.raw.height){if(Q.raw.height%Q.raw.pageHeight!==0)throw Error(`Expected raw.height ${Q.raw.height} to be a multiple of raw.pageHeight ${Q.raw.pageHeight}`);X.rawPageHeight=Q.raw.pageHeight}else throw $.invalidParameterError("raw.pageHeight","positive integer",Q.raw.pageHeight)}if($.defined(Q.animated))if($.bool(Q.animated))X.pages=Q.animated?-1:1;else throw $.invalidParameterError("animated","boolean",Q.animated);if($.defined(Q.pages))if($.integer(Q.pages)&&$.inRange(Q.pages,-1,1e5))X.pages=Q.pages;else throw $.invalidParameterError("pages","integer between -1 and 100000",Q.pages);if($.defined(Q.page))if($.integer(Q.page)&&$.inRange(Q.page,0,1e5))X.page=Q.page;else throw $.invalidParameterError("page","integer between 0 and 100000",Q.page);if($.object(Q.openSlide)&&$.defined(Q.openSlide.level))if($.integer(Q.openSlide.level)&&$.inRange(Q.openSlide.level,0,256))X.openSlideLevel=Q.openSlide.level;else throw $.invalidParameterError("openSlide.level","integer between 0 and 256",Q.openSlide.level);else if($.defined(Q.level))if($.integer(Q.level)&&$.inRange(Q.level,0,256))X.openSlideLevel=Q.level;else throw $.invalidParameterError("level","integer between 0 and 256",Q.level);if($.object(Q.tiff)&&$.defined(Q.tiff.subifd))if($.integer(Q.tiff.subifd)&&$.inRange(Q.tiff.subifd,-1,1e5))X.tiffSubifd=Q.tiff.subifd;else throw $.invalidParameterError("tiff.subifd","integer between -1 and 100000",Q.tiff.subifd);else if($.defined(Q.subifd))if($.integer(Q.subifd)&&$.inRange(Q.subifd,-1,1e5))X.tiffSubifd=Q.subifd;else throw $.invalidParameterError("subifd","integer between -1 and 100000",Q.subifd);if($.object(Q.svg)){if($.defined(Q.svg.stylesheet))if($.string(Q.svg.stylesheet))X.svgStylesheet=Q.svg.stylesheet;else throw $.invalidParameterError("svg.stylesheet","string",Q.svg.stylesheet);if($.defined(Q.svg.highBitdepth))if($.bool(Q.svg.highBitdepth))X.svgHighBitdepth=Q.svg.highBitdepth;else throw $.invalidParameterError("svg.highBitdepth","boolean",Q.svg.highBitdepth)}if($.object(Q.pdf)&&$.defined(Q.pdf.background))X.pdfBackground=this._getBackgroundColourOption(Q.pdf.background);else if($.defined(Q.pdfBackground))X.pdfBackground=this._getBackgroundColourOption(Q.pdfBackground);if($.object(Q.jp2)&&$.defined(Q.jp2.oneshot))if($.bool(Q.jp2.oneshot))X.jp2Oneshot=Q.jp2.oneshot;else throw $.invalidParameterError("jp2.oneshot","boolean",Q.jp2.oneshot);if($.defined(Q.create))if($.object(Q.create)&&$.integer(Q.create.width)&&$.inRange(Q.create.width,1,1e8)&&$.integer(Q.create.height)&&$.inRange(Q.create.height,1,1e8)&&$.integer(Q.create.channels)){if(X.createWidth=Q.create.width,X.createHeight=Q.create.height,X.createChannels=Q.create.channels,X.createPageHeight=0,$.defined(Q.create.pageHeight))if($.integer(Q.create.pageHeight)&&Q.create.pageHeight>0&&Q.create.pageHeight<=Q.create.height){if(Q.create.height%Q.create.pageHeight!==0)throw Error(`Expected create.height ${Q.create.height} to be a multiple of create.pageHeight ${Q.create.pageHeight}`);X.createPageHeight=Q.create.pageHeight}else throw $.invalidParameterError("create.pageHeight","positive integer",Q.create.pageHeight);if($.defined(Q.create.noise)){if(!$.object(Q.create.noise))throw Error("Expected noise to be an object");if(Q.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(X.createNoiseType=Q.create.noise.type,!$.inRange(Q.create.channels,1,4))throw $.invalidParameterError("create.channels","number between 1 and 4",Q.create.channels);if(X.createNoiseMean=128,$.defined(Q.create.noise.mean))if($.number(Q.create.noise.mean)&&$.inRange(Q.create.noise.mean,0,1e4))X.createNoiseMean=Q.create.noise.mean;else throw $.invalidParameterError("create.noise.mean","number between 0 and 10000",Q.create.noise.mean);if(X.createNoiseSigma=30,$.defined(Q.create.noise.sigma))if($.number(Q.create.noise.sigma)&&$.inRange(Q.create.noise.sigma,0,1e4))X.createNoiseSigma=Q.create.noise.sigma;else throw $.invalidParameterError("create.noise.sigma","number between 0 and 10000",Q.create.noise.sigma)}else if($.defined(Q.create.background)){if(!$.inRange(Q.create.channels,3,4))throw $.invalidParameterError("create.channels","number between 3 and 4",Q.create.channels);X.createBackground=this._getBackgroundColourOption(Q.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete X.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if($.defined(Q.text))if($.object(Q.text)&&$.string(Q.text.text)){if(X.textValue=Q.text.text,$.defined(Q.text.height)&&$.defined(Q.text.dpi))throw Error("Expected only one of dpi or height");if($.defined(Q.text.font))if($.string(Q.text.font))X.textFont=Q.text.font;else throw $.invalidParameterError("text.font","string",Q.text.font);if($.defined(Q.text.fontfile))if($.string(Q.text.fontfile))X.textFontfile=Q.text.fontfile;else throw $.invalidParameterError("text.fontfile","string",Q.text.fontfile);if($.defined(Q.text.width))if($.integer(Q.text.width)&&$.inRange(Q.text.width,1,1e6))X.textWidth=Q.text.width;else throw $.invalidParameterError("text.width","integer between 1 and 1000000",Q.text.width);if($.defined(Q.text.height))if($.integer(Q.text.height)&&$.inRange(Q.text.height,1,1e6))X.textHeight=Q.text.height;else throw $.invalidParameterError("text.height","integer between 1 and 1000000",Q.text.height);if($.defined(Q.text.align))if($.string(Q.text.align)&&$.string(this.constructor.align[Q.text.align]))X.textAlign=this.constructor.align[Q.text.align];else throw $.invalidParameterError("text.align","valid alignment",Q.text.align);if($.defined(Q.text.justify))if($.bool(Q.text.justify))X.textJustify=Q.text.justify;else throw $.invalidParameterError("text.justify","boolean",Q.text.justify);if($.defined(Q.text.dpi))if($.integer(Q.text.dpi)&&$.inRange(Q.text.dpi,1,1e6))X.textDpi=Q.text.dpi;else throw $.invalidParameterError("text.dpi","integer between 1 and 1000000",Q.text.dpi);if($.defined(Q.text.rgba))if($.bool(Q.text.rgba))X.textRgba=Q.text.rgba;else throw $.invalidParameterError("text.rgba","bool",Q.text.rgba);if($.defined(Q.text.spacing))if($.integer(Q.text.spacing)&&$.inRange(Q.text.spacing,-1e6,1e6))X.textSpacing=Q.text.spacing;else throw $.invalidParameterError("text.spacing","integer between -1000000 and 1000000",Q.text.spacing);if($.defined(Q.text.wrap))if($.string(Q.text.wrap)&&$.inArray(Q.text.wrap,["word","char","word-char","none"]))X.textWrap=Q.text.wrap;else throw $.invalidParameterError("text.wrap","one of: word, char, word-char, none",Q.text.wrap);delete X.buffer}else throw Error("Expected a valid string to create an image with text.");if($.defined(Q.join))if($.defined(this.options.join)){if($.defined(Q.join.animated))if($.bool(Q.join.animated))X.joinAnimated=Q.join.animated;else throw $.invalidParameterError("join.animated","boolean",Q.join.animated);if($.defined(Q.join.across))if($.integer(Q.join.across)&&$.inRange(Q.join.across,1,1e6))X.joinAcross=Q.join.across;else throw $.invalidParameterError("join.across","integer between 1 and 100000",Q.join.across);if($.defined(Q.join.shim))if($.integer(Q.join.shim)&&$.inRange(Q.join.shim,0,1e6))X.joinShim=Q.join.shim;else throw $.invalidParameterError("join.shim","integer between 0 and 100000",Q.join.shim);if($.defined(Q.join.background))X.joinBackground=this._getBackgroundColourOption(Q.join.background);if($.defined(Q.join.halign))if($.string(Q.join.halign)&&$.string(this.constructor.align[Q.join.halign]))X.joinHalign=this.constructor.align[Q.join.halign];else throw $.invalidParameterError("join.halign","valid alignment",Q.join.halign);if($.defined(Q.join.valign))if($.string(Q.join.valign)&&$.string(this.constructor.align[Q.join.valign]))X.joinValign=this.constructor.align[Q.join.valign];else throw $.invalidParameterError("join.valign","valid alignment",Q.join.valign)}else throw Error("Expected input to be an array of images to join")}else if($.defined(Q))throw Error(`Invalid input options ${Q}`);return X}function tI(Z,Q,W){if(Array.isArray(this.options.input.buffer))if($.buffer(Z)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push(Z),W()}else W(Error("Non-Buffer data on Writable Stream"));else W(Error("Unexpected data on Writable Stream"))}function eI(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function Z2(){return Array.isArray(this.options.input.buffer)}function Q2(Z){let Q=Error();if($.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),K0.metadata(this.options,(W,X)=>{if(W)Z($.nativeError(W,Q));else Z(null,X)})});else K0.metadata(this.options,(W,X)=>{if(W)Z($.nativeError(W,Q));else Z(null,X)});return this}else if(this._isStreamInput())return new Promise((W,X)=>{let J=()=>{this._flattenBufferIn(),K0.metadata(this.options,(G,Y)=>{if(G)X($.nativeError(G,Q));else W(Y)})};if(this.writableFinished)J();else this.once("finish",J)});else return new Promise((W,X)=>{K0.metadata(this.options,(J,G)=>{if(J)X($.nativeError(J,Q));else W(G)})})}function W2(Z){let Q=Error();if($.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),K0.stats(this.options,(W,X)=>{if(W)Z($.nativeError(W,Q));else Z(null,X)})});else K0.stats(this.options,(W,X)=>{if(W)Z($.nativeError(W,Q));else Z(null,X)});return this}else if(this._isStreamInput())return new Promise((W,X)=>{this.on("finish",function(){this._flattenBufferIn(),K0.stats(this.options,(J,G)=>{if(J)X($.nativeError(J,Q));else W(G)})})});else return new Promise((W,X)=>{K0.stats(this.options,(J,G)=>{if(J)X($.nativeError(J,Q));else W(G)})})}var aI,sI,fz=(Z)=>{Object.assign(Z.prototype,{_inputOptionsFromObject:gz,_createInputDescriptor:oI,_write:tI,_flattenBufferIn:eI,_isStreamInput:Z2,metadata:Q2,stats:W2}),Z.align=aI};var hz=u(()=>{u4();N9();/*!
226
229
  Copyright 2013 Lovell Fuller and others.
227
230
  SPDX-License-Identifier: Apache-2.0
228
- */MI={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},II=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function S7(Z){return Z.angle%360!==0||Z.rotationAngle!==0}function i8(Z){return Z.width!==-1||Z.height!==-1}function PI(Z,X,Q){if(i8(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(Q))Q=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(X))if($.integer(X)&&X>0)this.options.height=X;else throw $.invalidParameterError("height","positive integer",X);else this.options.height=-1;if($.object(Q)){if($.defined(Q.width))if($.integer(Q.width)&&Q.width>0)this.options.width=Q.width;else throw $.invalidParameterError("width","positive integer",Q.width);if($.defined(Q.height))if($.integer(Q.height)&&Q.height>0)this.options.height=Q.height;else throw $.invalidParameterError("height","positive integer",Q.height);if($.defined(Q.fit)){let W=RI[Q.fit];if($.string(W))this.options.canvas=W;else throw $.invalidParameterError("fit","valid fit",Q.fit)}if($.defined(Q.position)){let W=$.integer(Q.position)?Q.position:Ez[Q.position]||Oz[Q.position]||jz[Q.position];if($.integer(W)&&($.inRange(W,0,8)||$.inRange(W,16,17)))this.options.position=W;else throw $.invalidParameterError("position","valid position/gravity/strategy",Q.position)}if(this._setBackgroundColourOption("resizeBackground",Q.background),$.defined(Q.kernel))if($.string(C7[Q.kernel]))this.options.kernel=C7[Q.kernel];else throw $.invalidParameterError("kernel","valid kernel name",Q.kernel);if($.defined(Q.withoutEnlargement))this._setBooleanOption("withoutEnlargement",Q.withoutEnlargement);if($.defined(Q.withoutReduction))this._setBooleanOption("withoutReduction",Q.withoutReduction);if($.defined(Q.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",Q.fastShrinkOnLoad)}if(S7(this.options)&&i8(this.options))this.options.rotateBefore=!0;return this}function CI(Z){if($.integer(Z))if($.inRange(Z,1,1e4))this.options.extendTop=Z,this.options.extendBottom=Z,this.options.extendLeft=Z,this.options.extendRight=Z;else throw $.invalidParameterError("extend","integer between 1 and 10000",Z);else if($.object(Z)){if($.defined(Z.top))if($.integer(Z.top)&&$.inRange(Z.top,0,1e4))this.options.extendTop=Z.top;else throw $.invalidParameterError("top","integer between 0 and 10000",Z.top);if($.defined(Z.bottom))if($.integer(Z.bottom)&&$.inRange(Z.bottom,0,1e4))this.options.extendBottom=Z.bottom;else throw $.invalidParameterError("bottom","integer between 0 and 10000",Z.bottom);if($.defined(Z.left))if($.integer(Z.left)&&$.inRange(Z.left,0,1e4))this.options.extendLeft=Z.left;else throw $.invalidParameterError("left","integer between 0 and 10000",Z.left);if($.defined(Z.right))if($.integer(Z.right)&&$.inRange(Z.right,0,1e4))this.options.extendRight=Z.right;else throw $.invalidParameterError("right","integer between 0 and 10000",Z.right);if(this._setBackgroundColourOption("extendBackground",Z.background),$.defined(Z.extendWith))if($.string(wz[Z.extendWith]))this.options.extendWith=wz[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 SI(Z){let X=i8(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($.integer(W)&&$.inRange(W,0,1e8))this.options[Q+(Q==="left"||Q==="top"?"Offset":"")+X]=W;else throw $.invalidParameterError(Q,"integer between 0 and 100000000",W)},this),S7(this.options)&&!i8(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 kI(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);if($.defined(Z.margin))if($.integer(Z.margin)&&$.inRange(Z.margin,0,1e7))this.options.trimMargin=Z.margin;else throw $.invalidParameterError("margin","integer between 0 and 10000000",Z.margin)}else throw $.invalidParameterError("trim","object",Z);if(S7(this.options))this.options.rotateBefore=!0;return this}var jz,Oz,wz,Ez,C7,EI,RI,Rz=(Z)=>{Object.assign(Z.prototype,{resize:PI,extend:CI,extract:SI,trim:kI}),Z.gravity=jz,Z.strategy=Ez,Z.kernel=C7,Z.fit=EI,Z.position=Oz};var Pz=c(()=>{v4();/*!
231
+ */aI={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},sI=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function d7(Z){return Z.angle%360!==0||Z.rotationAngle!==0}function W5(Z){return Z.width!==-1||Z.height!==-1}function G2(Z,Q,W){if(W5(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(W))W=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(Q))if($.integer(Q)&&Q>0)this.options.height=Q;else throw $.invalidParameterError("height","positive integer",Q);else this.options.height=-1;if($.object(W)){if($.defined(W.width))if($.integer(W.width)&&W.width>0)this.options.width=W.width;else throw $.invalidParameterError("width","positive integer",W.width);if($.defined(W.height))if($.integer(W.height)&&W.height>0)this.options.height=W.height;else throw $.invalidParameterError("height","positive integer",W.height);if($.defined(W.fit)){let X=J2[W.fit];if($.string(X))this.options.canvas=X;else throw $.invalidParameterError("fit","valid fit",W.fit)}if($.defined(W.position)){let X=$.integer(W.position)?W.position:dz[W.position]||lz[W.position]||mz[W.position];if($.integer(X)&&($.inRange(X,0,8)||$.inRange(X,16,17)))this.options.position=X;else throw $.invalidParameterError("position","valid position/gravity/strategy",W.position)}if(this._setBackgroundColourOption("resizeBackground",W.background),$.defined(W.kernel))if($.string(l7[W.kernel]))this.options.kernel=l7[W.kernel];else throw $.invalidParameterError("kernel","valid kernel name",W.kernel);if($.defined(W.withoutEnlargement))this._setBooleanOption("withoutEnlargement",W.withoutEnlargement);if($.defined(W.withoutReduction))this._setBooleanOption("withoutReduction",W.withoutReduction);if($.defined(W.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",W.fastShrinkOnLoad)}if(d7(this.options)&&W5(this.options))this.options.rotateBefore=!0;return this}function Y2(Z){if($.integer(Z))if($.inRange(Z,1,1e4))this.options.extendTop=Z,this.options.extendBottom=Z,this.options.extendLeft=Z,this.options.extendRight=Z;else throw $.invalidParameterError("extend","integer between 1 and 10000",Z);else if($.object(Z)){if($.defined(Z.top))if($.integer(Z.top)&&$.inRange(Z.top,0,1e4))this.options.extendTop=Z.top;else throw $.invalidParameterError("top","integer between 0 and 10000",Z.top);if($.defined(Z.bottom))if($.integer(Z.bottom)&&$.inRange(Z.bottom,0,1e4))this.options.extendBottom=Z.bottom;else throw $.invalidParameterError("bottom","integer between 0 and 10000",Z.bottom);if($.defined(Z.left))if($.integer(Z.left)&&$.inRange(Z.left,0,1e4))this.options.extendLeft=Z.left;else throw $.invalidParameterError("left","integer between 0 and 10000",Z.left);if($.defined(Z.right))if($.integer(Z.right)&&$.inRange(Z.right,0,1e4))this.options.extendRight=Z.right;else throw $.invalidParameterError("right","integer between 0 and 10000",Z.right);if(this._setBackgroundColourOption("extendBackground",Z.background),$.defined(Z.extendWith))if($.string(uz[Z.extendWith]))this.options.extendWith=uz[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 z2(Z){let Q=W5(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${Q}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(W){let X=Z[W];if($.integer(X)&&$.inRange(X,0,1e8))this.options[W+(W==="left"||W==="top"?"Offset":"")+Q]=X;else throw $.invalidParameterError(W,"integer between 0 and 100000000",X)},this),d7(this.options)&&!W5(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 $2(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);if($.defined(Z.margin))if($.integer(Z.margin)&&$.inRange(Z.margin,0,1e7))this.options.trimMargin=Z.margin;else throw $.invalidParameterError("margin","integer between 0 and 10000000",Z.margin)}else throw $.invalidParameterError("trim","object",Z);if(d7(this.options))this.options.rotateBefore=!0;return this}var mz,lz,uz,dz,l7,X2,J2,cz=(Z)=>{Object.assign(Z.prototype,{resize:G2,extend:Y2,extract:z2,trim:$2}),Z.gravity=mz,Z.strategy=dz,Z.kernel=l7,Z.fit=X2,Z.position=lz};var pz=u(()=>{u4();/*!
229
232
  Copyright 2013 Lovell Fuller and others.
230
233
  SPDX-License-Identifier: Apache-2.0
231
- */jz={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},Oz={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},wz={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},Ez={entropy:16,attention:17},C7={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},EI={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},RI={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function bI(Z){if(!Array.isArray(Z))throw $.invalidParameterError("images to composite","array",Z);return this.options.composite=Z.map((X)=>{if(!$.object(X))throw $.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($.defined(X.blend))if($.string(k7[X.blend]))W.blend=k7[X.blend];else throw $.invalidParameterError("blend","valid blend name",X.blend);if($.defined(X.tile))if($.bool(X.tile))W.tile=X.tile;else throw $.invalidParameterError("tile","boolean",X.tile);if($.defined(X.left))if($.integer(X.left))W.left=X.left;else throw $.invalidParameterError("left","integer",X.left);if($.defined(X.top))if($.integer(X.top))W.top=X.top;else throw $.invalidParameterError("top","integer",X.top);if($.defined(X.top)!==$.defined(X.left))throw Error("Expected both left and top to be set");else W.hasOffset=$.integer(X.top)&&$.integer(X.left);if($.defined(X.gravity))if($.integer(X.gravity)&&$.inRange(X.gravity,0,8))W.gravity=X.gravity;else if($.string(X.gravity)&&$.integer(this.constructor.gravity[X.gravity]))W.gravity=this.constructor.gravity[X.gravity];else throw $.invalidParameterError("gravity","valid gravity",X.gravity);if($.defined(X.premultiplied))if($.bool(X.premultiplied))W.premultiplied=X.premultiplied;else throw $.invalidParameterError("premultiplied","boolean",X.premultiplied);return W}),this}var k7,Cz=(Z)=>{Z.prototype.composite=bI,Z.blend=k7};var Sz=c(()=>{v4();/*!
234
+ */mz={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},lz={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},uz={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},dz={entropy:16,attention:17},l7={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},X2={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},J2={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function q2(Z){if(!Array.isArray(Z))throw $.invalidParameterError("images to composite","array",Z);return this.options.composite=Z.map((Q)=>{if(!$.object(Q))throw $.invalidParameterError("image to composite","object",Q);let W=this._inputOptionsFromObject(Q),X={input:this._createInputDescriptor(Q.input,W,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if($.defined(Q.blend))if($.string(c7[Q.blend]))X.blend=c7[Q.blend];else throw $.invalidParameterError("blend","valid blend name",Q.blend);if($.defined(Q.tile))if($.bool(Q.tile))X.tile=Q.tile;else throw $.invalidParameterError("tile","boolean",Q.tile);if($.defined(Q.left))if($.integer(Q.left))X.left=Q.left;else throw $.invalidParameterError("left","integer",Q.left);if($.defined(Q.top))if($.integer(Q.top))X.top=Q.top;else throw $.invalidParameterError("top","integer",Q.top);if($.defined(Q.top)!==$.defined(Q.left))throw Error("Expected both left and top to be set");else X.hasOffset=$.integer(Q.top)&&$.integer(Q.left);if($.defined(Q.gravity))if($.integer(Q.gravity)&&$.inRange(Q.gravity,0,8))X.gravity=Q.gravity;else if($.string(Q.gravity)&&$.integer(this.constructor.gravity[Q.gravity]))X.gravity=this.constructor.gravity[Q.gravity];else throw $.invalidParameterError("gravity","valid gravity",Q.gravity);if($.defined(Q.premultiplied))if($.bool(Q.premultiplied))X.premultiplied=Q.premultiplied;else throw $.invalidParameterError("premultiplied","boolean",Q.premultiplied);return X}),this}var c7,iz=(Z)=>{Z.prototype.composite=q2,Z.blend=c7};var nz=u(()=>{u4();/*!
232
235
  Copyright 2013 Lovell Fuller and others.
233
236
  SPDX-License-Identifier: Apache-2.0
234
- */k7={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 _I(Z,X){if(!$.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($.integer(Z)&&!(Z%90))this.options.angle=Z;else if($.number(Z)){if(this.options.rotationAngle=Z,$.object(X)&&X.background)this._setBackgroundColourOption("rotationBackground",X.background)}else throw $.invalidParameterError("angle","numeric",Z);return this}function xI(){return this.options.input.autoOrient=!0,this}function vI(Z){return this.options.flip=$.bool(Z)?Z:!0,this}function yI(Z){return this.options.flop=$.bool(Z)?Z:!0,this}function gI(Z,X){let W=Array.isArray(Z)&&(Z.length===4&&Z.every($.number)||Z.length===2&&Z.every((J)=>Array.isArray(J)&&J.length===2))?Z.flat():[];if(W.length===4&&W.every($.number))this.options.affineMatrix=W;else throw $.invalidParameterError("matrix","1x4 or 2x2 array",Z);if($.defined(X))if($.object(X)){if(this._setBackgroundColourOption("affineBackground",X.background),$.defined(X.idx))if($.number(X.idx))this.options.affineIdx=X.idx;else throw $.invalidParameterError("options.idx","number",X.idx);if($.defined(X.idy))if($.number(X.idy))this.options.affineIdy=X.idy;else throw $.invalidParameterError("options.idy","number",X.idy);if($.defined(X.odx))if($.number(X.odx))this.options.affineOdx=X.odx;else throw $.invalidParameterError("options.odx","number",X.odx);if($.defined(X.ody))if($.number(X.ody))this.options.affineOdy=X.ody;else throw $.invalidParameterError("options.ody","number",X.ody);if($.defined(X.interpolator))if($.inArray(X.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=X.interpolator;else throw $.invalidParameterError("options.interpolator","valid interpolator name",X.interpolator)}else throw $.invalidParameterError("options","object",X);return this}function fI(Z){if($.plainObject(Z)){if($.number(Z.sigma)&&$.inRange(Z.sigma,0.000001,10))this.options.sharpenSigma=Z.sigma;else throw $.invalidParameterError("options.sigma","number between 0.000001 and 10",Z.sigma);if($.defined(Z.m1))if($.number(Z.m1)&&$.inRange(Z.m1,0,1e6))this.options.sharpenM1=Z.m1;else throw $.invalidParameterError("options.m1","number between 0 and 1000000",Z.m1);if($.defined(Z.m2))if($.number(Z.m2)&&$.inRange(Z.m2,0,1e6))this.options.sharpenM2=Z.m2;else throw $.invalidParameterError("options.m2","number between 0 and 1000000",Z.m2);if($.defined(Z.x1))if($.number(Z.x1)&&$.inRange(Z.x1,0,1e6))this.options.sharpenX1=Z.x1;else throw $.invalidParameterError("options.x1","number between 0 and 1000000",Z.x1);if($.defined(Z.y2))if($.number(Z.y2)&&$.inRange(Z.y2,0,1e6))this.options.sharpenY2=Z.y2;else throw $.invalidParameterError("options.y2","number between 0 and 1000000",Z.y2);if($.defined(Z.y3))if($.number(Z.y3)&&$.inRange(Z.y3,0,1e6))this.options.sharpenY3=Z.y3;else throw $.invalidParameterError("options.y3","number between 0 and 1000000",Z.y3)}else this.options.sharpenSigma=-1;return this}function hI(Z){if(!$.defined(Z))this.options.medianSize=3;else if($.integer(Z)&&$.inRange(Z,1,1000))this.options.medianSize=Z;else throw $.invalidParameterError("size","integer between 1 and 1000",Z);return this}function uI(Z){let X;if($.number(Z))X=Z;else if($.plainObject(Z)){if(!$.number(Z.sigma))throw $.invalidParameterError("options.sigma","number between 0.3 and 1000",X);if(X=Z.sigma,"precision"in Z)if($.string(kz[Z.precision]))this.options.precision=kz[Z.precision];else throw $.invalidParameterError("precision","one of: integer, float, approximate",Z.precision);if("minAmplitude"in Z)if($.number(Z.minAmplitude)&&$.inRange(Z.minAmplitude,0.001,1))this.options.minAmpl=Z.minAmplitude;else throw $.invalidParameterError("minAmplitude","number between 0.001 and 1",Z.minAmplitude)}if(!$.defined(Z))this.options.blurSigma=-1;else if($.bool(Z))this.options.blurSigma=Z?-1:0;else if($.number(X)&&$.inRange(X,0.3,1000))this.options.blurSigma=X;else throw $.invalidParameterError("sigma","number between 0.3 and 1000",X);return this}function mI(Z){if(!$.defined(Z))this.options.dilateWidth=1;else if($.integer(Z)&&$.inRange(Z,1,65536))this.options.dilateWidth=Z;else throw $.invalidParameterError("width","integer between 1 and 65536",Z);return this}function lI(Z){if(!$.defined(Z))this.options.erodeWidth=1;else if($.integer(Z)&&$.inRange(Z,1,65536))this.options.erodeWidth=Z;else throw $.invalidParameterError("width","integer between 1 and 65536",Z);return this}function dI(Z){if(this.options.flatten=$.bool(Z)?Z:!0,$.object(Z))this._setBackgroundColourOption("flattenBackground",Z.background);return this}function cI(){return this.options.unflatten=!0,this}function pI(Z,X){if(!$.defined(Z))this.options.gamma=2.2;else if($.number(Z)&&$.inRange(Z,1,3))this.options.gamma=Z;else throw $.invalidParameterError("gamma","number between 1.0 and 3.0",Z);if(!$.defined(X))this.options.gammaOut=this.options.gamma;else if($.number(X)&&$.inRange(X,1,3))this.options.gammaOut=X;else throw $.invalidParameterError("gammaOut","number between 1.0 and 3.0",X);return this}function nI(Z){if(this.options.negate=$.bool(Z)?Z:!0,$.plainObject(Z)&&"alpha"in Z)if(!$.bool(Z.alpha))throw $.invalidParameterError("alpha","should be boolean value",Z.alpha);else this.options.negateAlpha=Z.alpha;return this}function iI(Z){if($.plainObject(Z)){if($.defined(Z.lower))if($.number(Z.lower)&&$.inRange(Z.lower,0,99))this.options.normaliseLower=Z.lower;else throw $.invalidParameterError("lower","number between 0 and 99",Z.lower);if($.defined(Z.upper))if($.number(Z.upper)&&$.inRange(Z.upper,1,100))this.options.normaliseUpper=Z.upper;else throw $.invalidParameterError("upper","number between 1 and 100",Z.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw $.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function rI(Z){return this.normalise(Z)}function aI(Z){if($.plainObject(Z)){if($.integer(Z.width)&&$.inRange(Z.width,1,65536))this.options.claheWidth=Z.width;else throw $.invalidParameterError("width","integer between 1 and 65536",Z.width);if($.integer(Z.height)&&$.inRange(Z.height,1,65536))this.options.claheHeight=Z.height;else throw $.invalidParameterError("height","integer between 1 and 65536",Z.height);if($.defined(Z.maxSlope))if($.integer(Z.maxSlope)&&$.inRange(Z.maxSlope,0,100))this.options.claheMaxSlope=Z.maxSlope;else throw $.invalidParameterError("maxSlope","integer between 0 and 100",Z.maxSlope)}else throw $.invalidParameterError("options","plain object",Z);return this}function sI(Z){if(!$.object(Z)||!Array.isArray(Z.kernel)||!$.integer(Z.width)||!$.integer(Z.height)||!$.inRange(Z.width,3,1001)||!$.inRange(Z.height,3,1001)||Z.height*Z.width!==Z.kernel.length||!Z.kernel.every($.number))throw Error("Invalid convolution kernel");if(!$.integer(Z.scale))Z.scale=Z.kernel.reduce((X,Q)=>X+Q,0);if(Z.scale<1)Z.scale=1;if(!$.integer(Z.offset))Z.offset=0;return this.options.convKernel=Z,this}function oI(Z,X){if(!$.defined(Z))this.options.threshold=128;else if($.bool(Z))this.options.threshold=Z?128:0;else if($.integer(Z)&&$.inRange(Z,0,255))this.options.threshold=Z;else throw $.invalidParameterError("threshold","integer between 0 and 255",Z);if(!$.object(X)||X.greyscale===!0||X.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function tI(Z,X,Q){if(this.options.boolean=this._createInputDescriptor(Z,Q),$.string(X)&&$.inArray(X,["and","or","eor"]))this.options.booleanOp=X;else throw $.invalidParameterError("operator","one of: and, or, eor",X);return this}function eI(Z,X){if(!$.defined(Z)&&$.number(X))Z=1;else if($.number(Z)&&!$.defined(X))X=0;if(!$.defined(Z))this.options.linearA=[];else if($.number(Z))this.options.linearA=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every($.number))this.options.linearA=Z;else throw $.invalidParameterError("a","number or array of numbers",Z);if(!$.defined(X))this.options.linearB=[];else if($.number(X))this.options.linearB=[X];else if(Array.isArray(X)&&X.length&&X.every($.number))this.options.linearB=X;else throw $.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 Z2(Z){if(!Array.isArray(Z))throw $.invalidParameterError("inputMatrix","array",Z);let X=Z.length;if(X!==3&&X!==4)throw $.invalidParameterError("inputMatrix","3x3 or 4x4 array",X);if(!Z.every((W)=>Array.isArray(W)&&W.length===X))throw $.invalidParameterError("inputMatrix",`array of ${X} arrays of length ${X}`,Z);let Q=Z.flat();if(!Q.every($.number))throw $.invalidParameterError("inputMatrix","array of numbers",Q);return this.options.recombMatrix=Q,this}function X2(Z){if(!$.plainObject(Z))throw $.invalidParameterError("options","plain object",Z);if("brightness"in Z)if($.number(Z.brightness)&&Z.brightness>=0)this.options.brightness=Z.brightness;else throw $.invalidParameterError("brightness","number above zero",Z.brightness);if("saturation"in Z)if($.number(Z.saturation)&&Z.saturation>=0)this.options.saturation=Z.saturation;else throw $.invalidParameterError("saturation","number above zero",Z.saturation);if("hue"in Z)if($.integer(Z.hue))this.options.hue=Z.hue%360;else throw $.invalidParameterError("hue","number",Z.hue);if("lightness"in Z)if($.number(Z.lightness))this.options.lightness=Z.lightness;else throw $.invalidParameterError("lightness","number",Z.lightness);return this}var kz,bz=(Z)=>{Object.assign(Z.prototype,{autoOrient:xI,rotate:_I,flip:vI,flop:yI,affine:gI,sharpen:fI,erode:lI,dilate:mI,median:hI,blur:uI,flatten:dI,unflatten:cI,gamma:pI,negate:nI,normalise:iI,normalize:rI,clahe:aI,convolve:sI,threshold:oI,boolean:tI,linear:eI,recomb:Z2,modulate:X2})};var _z=c(()=>{v4();/*!
237
+ */c7={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 K2(Z,Q){if(!$.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($.integer(Z)&&!(Z%90))this.options.angle=Z;else if($.number(Z)){if(this.options.rotationAngle=Z,$.object(Q)&&Q.background)this._setBackgroundColourOption("rotationBackground",Q.background)}else throw $.invalidParameterError("angle","numeric",Z);return this}function U2(){return this.options.input.autoOrient=!0,this}function V2(Z){return this.options.flip=$.bool(Z)?Z:!0,this}function H2(Z){return this.options.flop=$.bool(Z)?Z:!0,this}function B2(Z,Q){let X=Array.isArray(Z)&&(Z.length===4&&Z.every($.number)||Z.length===2&&Z.every((J)=>Array.isArray(J)&&J.length===2))?Z.flat():[];if(X.length===4&&X.every($.number))this.options.affineMatrix=X;else throw $.invalidParameterError("matrix","1x4 or 2x2 array",Z);if($.defined(Q))if($.object(Q)){if(this._setBackgroundColourOption("affineBackground",Q.background),$.defined(Q.idx))if($.number(Q.idx))this.options.affineIdx=Q.idx;else throw $.invalidParameterError("options.idx","number",Q.idx);if($.defined(Q.idy))if($.number(Q.idy))this.options.affineIdy=Q.idy;else throw $.invalidParameterError("options.idy","number",Q.idy);if($.defined(Q.odx))if($.number(Q.odx))this.options.affineOdx=Q.odx;else throw $.invalidParameterError("options.odx","number",Q.odx);if($.defined(Q.ody))if($.number(Q.ody))this.options.affineOdy=Q.ody;else throw $.invalidParameterError("options.ody","number",Q.ody);if($.defined(Q.interpolator))if($.inArray(Q.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=Q.interpolator;else throw $.invalidParameterError("options.interpolator","valid interpolator name",Q.interpolator)}else throw $.invalidParameterError("options","object",Q);return this}function F2(Z){if($.plainObject(Z)){if($.number(Z.sigma)&&$.inRange(Z.sigma,0.000001,10))this.options.sharpenSigma=Z.sigma;else throw $.invalidParameterError("options.sigma","number between 0.000001 and 10",Z.sigma);if($.defined(Z.m1))if($.number(Z.m1)&&$.inRange(Z.m1,0,1e6))this.options.sharpenM1=Z.m1;else throw $.invalidParameterError("options.m1","number between 0 and 1000000",Z.m1);if($.defined(Z.m2))if($.number(Z.m2)&&$.inRange(Z.m2,0,1e6))this.options.sharpenM2=Z.m2;else throw $.invalidParameterError("options.m2","number between 0 and 1000000",Z.m2);if($.defined(Z.x1))if($.number(Z.x1)&&$.inRange(Z.x1,0,1e6))this.options.sharpenX1=Z.x1;else throw $.invalidParameterError("options.x1","number between 0 and 1000000",Z.x1);if($.defined(Z.y2))if($.number(Z.y2)&&$.inRange(Z.y2,0,1e6))this.options.sharpenY2=Z.y2;else throw $.invalidParameterError("options.y2","number between 0 and 1000000",Z.y2);if($.defined(Z.y3))if($.number(Z.y3)&&$.inRange(Z.y3,0,1e6))this.options.sharpenY3=Z.y3;else throw $.invalidParameterError("options.y3","number between 0 and 1000000",Z.y3)}else this.options.sharpenSigma=-1;return this}function L2(Z){if(!$.defined(Z))this.options.medianSize=3;else if($.integer(Z)&&$.inRange(Z,1,1000))this.options.medianSize=Z;else throw $.invalidParameterError("size","integer between 1 and 1000",Z);return this}function A2(Z){let Q;if($.number(Z))Q=Z;else if($.plainObject(Z)){if(!$.number(Z.sigma))throw $.invalidParameterError("options.sigma","number between 0.3 and 1000",Q);if(Q=Z.sigma,"precision"in Z)if($.string(rz[Z.precision]))this.options.precision=rz[Z.precision];else throw $.invalidParameterError("precision","one of: integer, float, approximate",Z.precision);if("minAmplitude"in Z)if($.number(Z.minAmplitude)&&$.inRange(Z.minAmplitude,0.001,1))this.options.minAmpl=Z.minAmplitude;else throw $.invalidParameterError("minAmplitude","number between 0.001 and 1",Z.minAmplitude)}if(!$.defined(Z))this.options.blurSigma=-1;else if($.bool(Z))this.options.blurSigma=Z?-1:0;else if($.number(Q)&&$.inRange(Q,0.3,1000))this.options.blurSigma=Q;else throw $.invalidParameterError("sigma","number between 0.3 and 1000",Q);return this}function M2(Z){if(!$.defined(Z))this.options.dilateWidth=1;else if($.integer(Z)&&$.inRange(Z,1,65536))this.options.dilateWidth=Z;else throw $.invalidParameterError("width","integer between 1 and 65536",Z);return this}function I2(Z){if(!$.defined(Z))this.options.erodeWidth=1;else if($.integer(Z)&&$.inRange(Z,1,65536))this.options.erodeWidth=Z;else throw $.invalidParameterError("width","integer between 1 and 65536",Z);return this}function N2(Z){if(this.options.flatten=$.bool(Z)?Z:!0,$.object(Z))this._setBackgroundColourOption("flattenBackground",Z.background);return this}function D2(){return this.options.unflatten=!0,this}function w2(Z,Q){if(!$.defined(Z))this.options.gamma=2.2;else if($.number(Z)&&$.inRange(Z,1,3))this.options.gamma=Z;else throw $.invalidParameterError("gamma","number between 1.0 and 3.0",Z);if(!$.defined(Q))this.options.gammaOut=this.options.gamma;else if($.number(Q)&&$.inRange(Q,1,3))this.options.gammaOut=Q;else throw $.invalidParameterError("gammaOut","number between 1.0 and 3.0",Q);return this}function T2(Z){if(this.options.negate=$.bool(Z)?Z:!0,$.plainObject(Z)&&"alpha"in Z)if(!$.bool(Z.alpha))throw $.invalidParameterError("alpha","should be boolean value",Z.alpha);else this.options.negateAlpha=Z.alpha;return this}function j2(Z){if($.plainObject(Z)){if($.defined(Z.lower))if($.number(Z.lower)&&$.inRange(Z.lower,0,99))this.options.normaliseLower=Z.lower;else throw $.invalidParameterError("lower","number between 0 and 99",Z.lower);if($.defined(Z.upper))if($.number(Z.upper)&&$.inRange(Z.upper,1,100))this.options.normaliseUpper=Z.upper;else throw $.invalidParameterError("upper","number between 1 and 100",Z.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw $.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function E2(Z){return this.normalise(Z)}function O2(Z){if($.plainObject(Z)){if($.integer(Z.width)&&$.inRange(Z.width,1,65536))this.options.claheWidth=Z.width;else throw $.invalidParameterError("width","integer between 1 and 65536",Z.width);if($.integer(Z.height)&&$.inRange(Z.height,1,65536))this.options.claheHeight=Z.height;else throw $.invalidParameterError("height","integer between 1 and 65536",Z.height);if($.defined(Z.maxSlope))if($.integer(Z.maxSlope)&&$.inRange(Z.maxSlope,0,100))this.options.claheMaxSlope=Z.maxSlope;else throw $.invalidParameterError("maxSlope","integer between 0 and 100",Z.maxSlope)}else throw $.invalidParameterError("options","plain object",Z);return this}function R2(Z){if(!$.object(Z)||!Array.isArray(Z.kernel)||!$.integer(Z.width)||!$.integer(Z.height)||!$.inRange(Z.width,3,1001)||!$.inRange(Z.height,3,1001)||Z.height*Z.width!==Z.kernel.length||!Z.kernel.every($.number))throw Error("Invalid convolution kernel");if(!$.integer(Z.scale))Z.scale=Z.kernel.reduce((Q,W)=>Q+W,0);if(Z.scale<1)Z.scale=1;if(!$.integer(Z.offset))Z.offset=0;return this.options.convKernel=Z,this}function P2(Z,Q){if(!$.defined(Z))this.options.threshold=128;else if($.bool(Z))this.options.threshold=Z?128:0;else if($.integer(Z)&&$.inRange(Z,0,255))this.options.threshold=Z;else throw $.invalidParameterError("threshold","integer between 0 and 255",Z);if(!$.object(Q)||Q.greyscale===!0||Q.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function C2(Z,Q,W){if(this.options.boolean=this._createInputDescriptor(Z,W),$.string(Q)&&$.inArray(Q,["and","or","eor"]))this.options.booleanOp=Q;else throw $.invalidParameterError("operator","one of: and, or, eor",Q);return this}function S2(Z,Q){if(!$.defined(Z)&&$.number(Q))Z=1;else if($.number(Z)&&!$.defined(Q))Q=0;if(!$.defined(Z))this.options.linearA=[];else if($.number(Z))this.options.linearA=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every($.number))this.options.linearA=Z;else throw $.invalidParameterError("a","number or array of numbers",Z);if(!$.defined(Q))this.options.linearB=[];else if($.number(Q))this.options.linearB=[Q];else if(Array.isArray(Q)&&Q.length&&Q.every($.number))this.options.linearB=Q;else throw $.invalidParameterError("b","number or array of numbers",Q);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 k2(Z){if(!Array.isArray(Z))throw $.invalidParameterError("inputMatrix","array",Z);let Q=Z.length;if(Q!==3&&Q!==4)throw $.invalidParameterError("inputMatrix","3x3 or 4x4 array",Q);if(!Z.every((X)=>Array.isArray(X)&&X.length===Q))throw $.invalidParameterError("inputMatrix",`array of ${Q} arrays of length ${Q}`,Z);let W=Z.flat();if(!W.every($.number))throw $.invalidParameterError("inputMatrix","array of numbers",W);return this.options.recombMatrix=W,this}function _2(Z){if(!$.plainObject(Z))throw $.invalidParameterError("options","plain object",Z);if("brightness"in Z)if($.number(Z.brightness)&&Z.brightness>=0)this.options.brightness=Z.brightness;else throw $.invalidParameterError("brightness","number above zero",Z.brightness);if("saturation"in Z)if($.number(Z.saturation)&&Z.saturation>=0)this.options.saturation=Z.saturation;else throw $.invalidParameterError("saturation","number above zero",Z.saturation);if("hue"in Z)if($.integer(Z.hue))this.options.hue=Z.hue%360;else throw $.invalidParameterError("hue","number",Z.hue);if("lightness"in Z)if($.number(Z.lightness))this.options.lightness=Z.lightness;else throw $.invalidParameterError("lightness","number",Z.lightness);return this}var rz,az=(Z)=>{Object.assign(Z.prototype,{autoOrient:U2,rotate:K2,flip:V2,flop:H2,affine:B2,sharpen:F2,erode:I2,dilate:M2,median:L2,blur:A2,flatten:N2,unflatten:D2,gamma:w2,negate:T2,normalise:j2,normalize:E2,clahe:O2,convolve:R2,threshold:P2,boolean:C2,linear:S2,recomb:k2,modulate:_2})};var sz=u(()=>{u4();/*!
235
238
  Copyright 2013 Lovell Fuller and others.
236
239
  SPDX-License-Identifier: Apache-2.0
237
- */kz={integer:"integer",float:"float",approximate:"approximate"}});var hz=j((Ov,fz)=>{var{defineProperty:y7,getOwnPropertyDescriptor:Q2,getOwnPropertyNames:W2}=Object,J2=Object.prototype.hasOwnProperty,G2=(Z,X)=>{for(var Q in X)y7(Z,Q,{get:X[Q],enumerable:!0})},Y2=(Z,X,Q,W)=>{if(X&&typeof X==="object"||typeof X==="function"){for(let J of W2(X))if(!J2.call(Z,J)&&J!==Q)y7(Z,J,{get:()=>X[J],enumerable:!(W=Q2(X,J))||W.enumerable})}return Z},z2=(Z)=>Y2(y7({},"__esModule",{value:!0}),Z),xz={};G2(xz,{default:()=>D2});fz.exports=z2(xz);var b7={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 b7)Object.freeze(b7[Z]);var m4=Object.freeze(b7),vz=Object.create(null);for(let Z in m4)if(Object.hasOwn(m4,Z))vz[m4[Z]]=Z;var o0={to:{},get:{}};o0.get=function(Z){let X=Z.slice(0,3).toLowerCase(),Q,W;switch(X){case"hsl":{Q=o0.get.hsl(Z),W="hsl";break}case"hwb":{Q=o0.get.hwb(Z),W="hwb";break}default:{Q=o0.get.rgb(Z),W="rgb";break}}if(!Q)return null;return{model:W,value:Q}};o0.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,J=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,G=/^(\w+)$/,Y=[0,0,0,1],z,q,K;if(z=Z.match(Q)){K=z[2],z=z[1];for(q=0;q<3;q++){let V=q*2;Y[q]=Number.parseInt(z.slice(V,V+2),16)}if(K)Y[3]=Number.parseInt(K,16)/255}else if(z=Z.match(X)){z=z[1],K=z[3];for(q=0;q<3;q++)Y[q]=Number.parseInt(z[q]+z[q],16);if(K)Y[3]=Number.parseInt(K+K,16)/255}else if(z=Z.match(W)){for(q=0;q<3;q++)Y[q]=Number.parseFloat(z[q+1]);if(z[4])Y[3]=z[5]?Number.parseFloat(z[4])*0.01:Number.parseFloat(z[4])}else if(z=Z.match(J)){for(q=0;q<3;q++)Y[q]=Math.round(Number.parseFloat(z[q+1])*2.55);if(z[4])Y[3]=z[5]?Number.parseFloat(z[4])*0.01:Number.parseFloat(z[4])}else if(z=Z.toLowerCase().match(G)){if(z[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(m4,z[1]))return null;return Y=m4[z[1]].slice(),Y[3]=1,Y}else return null;for(q=0;q<3;q++)Y[q]=j6(Y[q],0,255);return Y[3]=j6(Y[3],0,1),Y};o0.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]),J=(Number.parseFloat(Q[1])%360+360)%360,G=j6(Number.parseFloat(Q[2]),0,100),Y=j6(Number.parseFloat(Q[3]),0,100),z=j6(Number.isNaN(W)?1:W,0,1);return[J,G,Y,z]}return null};o0.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]),J=(Number.parseFloat(Q[1])%360+360)%360,G=j6(Number.parseFloat(Q[2]),0,100),Y=j6(Number.parseFloat(Q[3]),0,100),z=j6(Number.isNaN(W)?1:W,0,1);return[J,G,Y,z]}return null};o0.to.hex=function(...Z){return"#"+r8(Z[0])+r8(Z[1])+r8(Z[2])+(Z[3]<1?r8(Math.round(Z[3]*255)):"")};o0.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]+")"};o0.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]+")"};o0.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]+")"};o0.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+")"};o0.to.keyword=function(...Z){return vz[Z.slice(0,3)]};function j6(Z,X,Q){return Math.min(Math.max(X,Z),Q)}function r8(Z){let X=Math.round(Z).toString(16).toUpperCase();return X.length<2?"0"+X:X}var w1=o0,yz={};for(let Z of Object.keys(m4))yz[m4[Z]]=Z;var u={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"]}},c6=u,Q6=0.008856451679035631;function O1(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 E1(Z){return Z>0.04045?((Z+0.055)/1.055)**2.4:Z/12.92}for(let Z of Object.keys(u)){if(!("channels"in u[Z]))throw Error("missing channels property: "+Z);if(!("labels"in u[Z]))throw Error("missing channel labels property: "+Z);if(u[Z].labels.length!==u[Z].channels)throw Error("channel and label counts mismatch: "+Z);let{channels:X,labels:Q}=u[Z];delete u[Z].channels,delete u[Z].labels,Object.defineProperty(u[Z],"channels",{value:X}),Object.defineProperty(u[Z],"labels",{value:Q})}u.rgb.hsl=function(Z){let X=Z[0]/255,Q=Z[1]/255,W=Z[2]/255,J=Math.min(X,Q,W),G=Math.max(X,Q,W),Y=G-J,z,q;switch(G){case J:{z=0;break}case X:{z=(Q-W)/Y;break}case Q:{z=2+(W-X)/Y;break}case W:{z=4+(X-Q)/Y;break}}if(z=Math.min(z*60,360),z<0)z+=360;let K=(J+G)/2;if(G===J)q=0;else if(K<=0.5)q=Y/(G+J);else q=Y/(2-G-J);return[z,q*100,K*100]};u.rgb.hsv=function(Z){let X,Q,W,J,G,Y=Z[0]/255,z=Z[1]/255,q=Z[2]/255,K=Math.max(Y,z,q),V=K-Math.min(Y,z,q),B=function(H){return(K-H)/6/V+0.5};if(V===0)J=0,G=0;else{switch(G=V/K,X=B(Y),Q=B(z),W=B(q),K){case Y:{J=W-Q;break}case z:{J=0.3333333333333333+X-W;break}case q:{J=0.6666666666666666+Q-X;break}}if(J<0)J+=1;else if(J>1)J-=1}return[J*360,G*100,K*100]};u.rgb.hwb=function(Z){let X=Z[0],Q=Z[1],W=Z[2],J=u.rgb.hsl(Z)[0],G=0.00392156862745098*Math.min(X,Math.min(Q,W));return W=1-0.00392156862745098*Math.max(X,Math.max(Q,W)),[J,G*100,W*100]};u.rgb.oklab=function(Z){let X=E1(Z[0]/255),Q=E1(Z[1]/255),W=E1(Z[2]/255),J=Math.cbrt(0.4122214708*X+0.5363325363*Q+0.0514459929*W),G=Math.cbrt(0.2119034982*X+0.6806995451*Q+0.1073969566*W),Y=Math.cbrt(0.0883024619*X+0.2817188376*Q+0.6299787005*W),z=0.2104542553*J+0.793617785*G-0.0040720468*Y,q=1.9779984951*J-2.428592205*G+0.4505937099*Y,K=0.0259040371*J+0.7827717662*G-0.808675766*Y;return[z*100,q*100,K*100]};u.rgb.cmyk=function(Z){let X=Z[0]/255,Q=Z[1]/255,W=Z[2]/255,J=Math.min(1-X,1-Q,1-W),G=(1-X-J)/(1-J)||0,Y=(1-Q-J)/(1-J)||0,z=(1-W-J)/(1-J)||0;return[G*100,Y*100,z*100,J*100]};function $2(Z,X){return(Z[0]-X[0])**2+(Z[1]-X[1])**2+(Z[2]-X[2])**2}u.rgb.keyword=function(Z){let X=yz[Z];if(X)return X;let Q=Number.POSITIVE_INFINITY,W;for(let J of Object.keys(m4)){let G=m4[J],Y=$2(Z,G);if(Y<Q)Q=Y,W=J}return W};u.keyword.rgb=function(Z){return[...m4[Z]]};u.rgb.xyz=function(Z){let X=E1(Z[0]/255),Q=E1(Z[1]/255),W=E1(Z[2]/255),J=X*0.4124564+Q*0.3575761+W*0.1804375,G=X*0.2126729+Q*0.7151522+W*0.072175,Y=X*0.0193339+Q*0.119192+W*0.9503041;return[J*100,G*100,Y*100]};u.rgb.lab=function(Z){let X=u.rgb.xyz(Z),Q=X[0],W=X[1],J=X[2];Q/=95.047,W/=100,J/=108.883,Q=Q>Q6?Q**0.3333333333333333:7.787*Q+0.13793103448275862,W=W>Q6?W**0.3333333333333333:7.787*W+0.13793103448275862,J=J>Q6?J**0.3333333333333333:7.787*J+0.13793103448275862;let G=116*W-16,Y=500*(Q-W),z=200*(W-J);return[G,Y,z]};u.hsl.rgb=function(Z){let X=Z[0]/360,Q=Z[1]/100,W=Z[2]/100,J,G;if(Q===0)return G=W*255,[G,G,G];let Y=W<0.5?W*(1+Q):W+Q-W*Q,z=2*W-Y,q=[0,0,0];for(let K=0;K<3;K++){if(J=X+0.3333333333333333*-(K-1),J<0)J++;if(J>1)J--;if(6*J<1)G=z+(Y-z)*6*J;else if(2*J<1)G=Y;else if(3*J<2)G=z+(Y-z)*(0.6666666666666666-J)*6;else G=z;q[K]=G*255}return q};u.hsl.hsv=function(Z){let X=Z[0],Q=Z[1]/100,W=Z[2]/100,J=Q,G=Math.max(W,0.01);W*=2,Q*=W<=1?W:2-W,J*=G<=1?G:2-G;let Y=(W+Q)/2,z=W===0?2*J/(G+J):2*Q/(W+Q);return[X,z*100,Y*100]};u.hsv.rgb=function(Z){let X=Z[0]/60,Q=Z[1]/100,W=Z[2]/100,J=Math.floor(X)%6,G=X-Math.floor(X),Y=255*W*(1-Q),z=255*W*(1-Q*G),q=255*W*(1-Q*(1-G));switch(W*=255,J){case 0:return[W,q,Y];case 1:return[z,W,Y];case 2:return[Y,W,q];case 3:return[Y,z,W];case 4:return[q,Y,W];case 5:return[W,Y,z]}};u.hsv.hsl=function(Z){let X=Z[0],Q=Z[1]/100,W=Z[2]/100,J=Math.max(W,0.01),G,Y;Y=(2-Q)*W;let z=(2-Q)*J;return G=Q*J,G/=z<=1?z:2-z,G=G||0,Y/=2,[X,G*100,Y*100]};u.hwb.rgb=function(Z){let X=Z[0]/360,Q=Z[1]/100,W=Z[2]/100,J=Q+W,G;if(J>1)Q/=J,W/=J;let Y=Math.floor(6*X),z=1-W;if(G=6*X-Y,(Y&1)!==0)G=1-G;let q=Q+G*(z-Q),K,V,B;switch(Y){default:case 6:case 0:{K=z,V=q,B=Q;break}case 1:{K=q,V=z,B=Q;break}case 2:{K=Q,V=z,B=q;break}case 3:{K=Q,V=q,B=z;break}case 4:{K=q,V=Q,B=z;break}case 5:{K=z,V=Q,B=q;break}}return[K*255,V*255,B*255]};u.cmyk.rgb=function(Z){let X=Z[0]/100,Q=Z[1]/100,W=Z[2]/100,J=Z[3]/100,G=1-Math.min(1,X*(1-J)+J),Y=1-Math.min(1,Q*(1-J)+J),z=1-Math.min(1,W*(1-J)+J);return[G*255,Y*255,z*255]};u.xyz.rgb=function(Z){let X=Z[0]/100,Q=Z[1]/100,W=Z[2]/100,J,G,Y;return J=X*3.2404542+Q*-1.5371385+W*-0.4985314,G=X*-0.969266+Q*1.8760108+W*0.041556,Y=X*0.0556434+Q*-0.2040259+W*1.0572252,J=O1(J),G=O1(G),Y=O1(Y),[J*255,G*255,Y*255]};u.xyz.lab=function(Z){let X=Z[0],Q=Z[1],W=Z[2];X/=95.047,Q/=100,W/=108.883,X=X>Q6?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>Q6?Q**0.3333333333333333:7.787*Q+0.13793103448275862,W=W>Q6?W**0.3333333333333333:7.787*W+0.13793103448275862;let J=116*Q-16,G=500*(X-Q),Y=200*(Q-W);return[J,G,Y]};u.xyz.oklab=function(Z){let X=Z[0]/100,Q=Z[1]/100,W=Z[2]/100,J=Math.cbrt(0.8189330101*X+0.3618667424*Q-0.1288597137*W),G=Math.cbrt(0.0329845436*X+0.9293118715*Q+0.0361456387*W),Y=Math.cbrt(0.0482003018*X+0.2643662691*Q+0.633851707*W),z=0.2104542553*J+0.793617785*G-0.0040720468*Y,q=1.9779984951*J-2.428592205*G+0.4505937099*Y,K=0.0259040371*J+0.7827717662*G-0.808675766*Y;return[z*100,q*100,K*100]};u.oklab.oklch=function(Z){return u.lab.lch(Z)};u.oklab.xyz=function(Z){let X=Z[0]/100,Q=Z[1]/100,W=Z[2]/100,J=(0.999999998*X+0.396337792*Q+0.215803758*W)**3,G=(1.000000008*X-0.105561342*Q-0.063854175*W)**3,Y=(1.000000055*X-0.089484182*Q-1.291485538*W)**3,z=1.227013851*J-0.55779998*G+0.281256149*Y,q=-0.040580178*J+1.11225687*G-0.071676679*Y,K=-0.076381285*J-0.421481978*G+1.58616322*Y;return[z*100,q*100,K*100]};u.oklab.rgb=function(Z){let X=Z[0]/100,Q=Z[1]/100,W=Z[2]/100,J=(X+0.3963377774*Q+0.2158037573*W)**3,G=(X-0.1055613458*Q-0.0638541728*W)**3,Y=(X-0.0894841775*Q-1.291485548*W)**3,z=O1(4.0767416621*J-3.3077115913*G+0.2309699292*Y),q=O1(-1.2684380046*J+2.6097574011*G-0.3413193965*Y),K=O1(-0.0041960863*J-0.7034186147*G+1.707614701*Y);return[z*255,q*255,K*255]};u.oklch.oklab=function(Z){return u.lch.lab(Z)};u.lab.xyz=function(Z){let X=Z[0],Q=Z[1],W=Z[2],J,G,Y;G=(X+16)/116,J=Q/500+G,Y=G-W/200;let z=G**3,q=J**3,K=Y**3;return G=z>Q6?z:(G-0.13793103448275862)/7.787,J=q>Q6?q:(J-0.13793103448275862)/7.787,Y=K>Q6?K:(Y-0.13793103448275862)/7.787,J*=95.047,G*=100,Y*=108.883,[J,G,Y]};u.lab.lch=function(Z){let X=Z[0],Q=Z[1],W=Z[2],J;if(J=Math.atan2(W,Q)*360/2/Math.PI,J<0)J+=360;let Y=Math.sqrt(Q*Q+W*W);return[X,Y,J]};u.lch.lab=function(Z){let X=Z[0],Q=Z[1],J=Z[2]/360*2*Math.PI,G=Q*Math.cos(J),Y=Q*Math.sin(J);return[X,G,Y]};u.rgb.ansi16=function(Z,X=null){let[Q,W,J]=Z,G=X===null?u.rgb.hsv(Z)[2]:X;if(G=Math.round(G/50),G===0)return 30;let Y=30+(Math.round(J/255)<<2|Math.round(W/255)<<1|Math.round(Q/255));if(G===2)Y+=60;return Y};u.hsv.ansi16=function(Z){return u.rgb.ansi16(u.hsv.rgb(Z),Z[2])};u.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)};u.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,J=(X>>1&1)*Q*255,G=(X>>2&1)*Q*255;return[W,J,G]};u.ansi256.rgb=function(Z){if(Z=Z[0],Z>=232){let G=(Z-232)*10+8;return[G,G,G]}Z-=16;let X,Q=Math.floor(Z/36)/5*255,W=Math.floor((X=Z%36)/6)/5*255,J=X%6/5*255;return[Q,W,J]};u.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};u.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((z)=>z+z).join("");let W=Number.parseInt(Q,16),J=W>>16&255,G=W>>8&255,Y=W&255;return[J,G,Y]};u.rgb.hcg=function(Z){let X=Z[0]/255,Q=Z[1]/255,W=Z[2]/255,J=Math.max(Math.max(X,Q),W),G=Math.min(Math.min(X,Q),W),Y=J-G,z,q=Y<1?G/(1-Y):0;if(Y<=0)z=0;else if(J===X)z=(Q-W)/Y%6;else if(J===Q)z=2+(W-X)/Y;else z=4+(X-Q)/Y;return z/=6,z%=1,[z*360,Y*100,q*100]};u.hsl.hcg=function(Z){let X=Z[1]/100,Q=Z[2]/100,W=Q<0.5?2*X*Q:2*X*(1-Q),J=0;if(W<1)J=(Q-0.5*W)/(1-W);return[Z[0],W*100,J*100]};u.hsv.hcg=function(Z){let X=Z[1]/100,Q=Z[2]/100,W=X*Q,J=0;if(W<1)J=(Q-W)/(1-W);return[Z[0],W*100,J*100]};u.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 J=[0,0,0],G=X%1*6,Y=G%1,z=1-Y,q=0;switch(Math.floor(G)){case 0:{J[0]=1,J[1]=Y,J[2]=0;break}case 1:{J[0]=z,J[1]=1,J[2]=0;break}case 2:{J[0]=0,J[1]=1,J[2]=Y;break}case 3:{J[0]=0,J[1]=z,J[2]=1;break}case 4:{J[0]=Y,J[1]=0,J[2]=1;break}default:J[0]=1,J[1]=0,J[2]=z}return q=(1-Q)*W,[(Q*J[0]+q)*255,(Q*J[1]+q)*255,(Q*J[2]+q)*255]};u.hcg.hsv=function(Z){let X=Z[1]/100,Q=Z[2]/100,W=X+Q*(1-X),J=0;if(W>0)J=X/W;return[Z[0],J*100,W*100]};u.hcg.hsl=function(Z){let X=Z[1]/100,W=Z[2]/100*(1-X)+0.5*X,J=0;if(W>0&&W<0.5)J=X/(2*W);else if(W>=0.5&&W<1)J=X/(2*(1-W));return[Z[0],J*100,W*100]};u.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]};u.hwb.hcg=function(Z){let X=Z[1]/100,W=1-Z[2]/100,J=W-X,G=0;if(J<1)G=(W-J)/(1-J);return[Z[0],J*100,G*100]};u.apple.rgb=function(Z){return[Z[0]/65535*255,Z[1]/65535*255,Z[2]/65535*255]};u.rgb.apple=function(Z){return[Z[0]/255*65535,Z[1]/255*65535,Z[2]/255*65535]};u.gray.rgb=function(Z){return[Z[0]/100*255,Z[0]/100*255,Z[0]/100*255]};u.gray.hsl=function(Z){return[0,0,Z[0]]};u.gray.hsv=u.gray.hsl;u.gray.hwb=function(Z){return[0,100,Z[0]]};u.gray.cmyk=function(Z){return[0,0,0,Z[0]]};u.gray.lab=function(Z){return[Z[0],0,0]};u.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};u.rgb.gray=function(Z){return[(Z[0]+Z[1]+Z[2])/3/255*100]};function q2(){let Z={},X=Object.keys(c6);for(let{length:Q}=X,W=0;W<Q;W++)Z[X[W]]={distance:-1,parent:null};return Z}function K2(Z){let X=q2(),Q=[Z];X[Z].distance=0;while(Q.length>0){let W=Q.pop(),J=Object.keys(c6[W]);for(let{length:G}=J,Y=0;Y<G;Y++){let z=J[Y],q=X[z];if(q.distance===-1)q.distance=X[W].distance+1,q.parent=W,Q.unshift(z)}}return X}function U2(Z,X){return function(Q){return X(Z(Q))}}function V2(Z,X){let Q=[X[Z].parent,Z],W=c6[X[Z].parent][Z],J=X[Z].parent;while(X[J].parent)Q.unshift(X[J].parent),W=U2(c6[X[J].parent][J],W),J=X[J].parent;return W.conversion=Q,W}function B2(Z){let X=K2(Z),Q={},W=Object.keys(X);for(let{length:J}=W,G=0;G<J;G++){let Y=W[G];if(X[Y].parent===null)continue;Q[Y]=V2(Y,X)}return Q}var H2=B2,j1={},F2=Object.keys(c6);function L2(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 A2(Z){let X=function(...Q){let W=Q[0];if(W===void 0||W===null)return W;if(W.length>1)Q=W;let J=Z(Q);if(typeof J==="object")for(let{length:G}=J,Y=0;Y<G;Y++)J[Y]=Math.round(J[Y]);return J};if("conversion"in Z)X.conversion=Z.conversion;return X}for(let Z of F2){j1[Z]={},Object.defineProperty(j1[Z],"channels",{value:c6[Z].channels}),Object.defineProperty(j1[Z],"labels",{value:c6[Z].labels});let X=H2(Z),Q=Object.keys(X);for(let W of Q){let J=X[W];j1[Z][W]=A2(J),j1[Z][W].raw=L2(J)}}var z4=j1,gz=["keyword","gray","hex"],_7={};for(let Z of Object.keys(z4))_7[[...z4[Z].labels].sort().join("")]=Z;var x7={};function b0(Z,X){if(!(this instanceof b0))return new b0(Z,X);if(X&&X in gz)X=null;if(X&&!(X in z4))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 b0)this.model=Z.model,this.color=[...Z.color],this.valpha=Z.valpha;else if(typeof Z==="string"){let J=w1.get(Z);if(J===null)throw Error("Unable to parse color from string: "+Z);this.model=J.model,W=z4[this.model].channels,this.color=J.value.slice(0,W),this.valpha=typeof J.value[W]==="number"?J.value[W]:1}else if(Z.length>0){this.model=X||"rgb",W=z4[this.model].channels;let J=Array.prototype.slice.call(Z,0,W);this.color=v7(J,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 J=Object.keys(Z);if("alpha"in Z)J.splice(J.indexOf("alpha"),1),this.valpha=typeof Z.alpha==="number"?Z.alpha:0;let G=J.sort().join("");if(!(G in _7))throw Error("Unable to parse color from object: "+JSON.stringify(Z));this.model=_7[G];let{labels:Y}=z4[this.model],z=[];for(Q=0;Q<Y.length;Q++)z.push(Z[Y[Q]]);this.color=v7(z)}if(x7[this.model]){W=z4[this.model].channels;for(Q=0;Q<W;Q++){let J=x7[this.model][Q];if(J)this.color[Q]=J(this.color[Q])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}b0.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(Z){let X=this.model in w1.to?this:this.rgb();X=X.round(typeof Z==="number"?Z:1);let Q=X.valpha===1?X.color:[...X.color,this.valpha];return w1.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 w1.to.rgb.percent(...Q)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let Z={},{channels:X}=z4[this.model],{labels:Q}=z4[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 b0([...this.color.map(I2(Z)),this.valpha],this.model)},alpha(Z){if(Z!==void 0)return new b0([...this.color,Math.max(0,Math.min(1,Z))],this.model);return this.valpha},red:D0("rgb",0,S0(255)),green:D0("rgb",1,S0(255)),blue:D0("rgb",2,S0(255)),hue:D0(["hsl","hsv","hsl","hwb","hcg"],0,(Z)=>(Z%360+360)%360),saturationl:D0("hsl",1,S0(100)),lightness:D0("hsl",2,S0(100)),saturationv:D0("hsv",1,S0(100)),value:D0("hsv",2,S0(100)),chroma:D0("hcg",1,S0(100)),gray:D0("hcg",2,S0(100)),white:D0("hwb",1,S0(100)),wblack:D0("hwb",2,S0(100)),cyan:D0("cmyk",0,S0(100)),magenta:D0("cmyk",1,S0(100)),yellow:D0("cmyk",2,S0(100)),black:D0("cmyk",3,S0(100)),x:D0("xyz",0,S0(95.047)),y:D0("xyz",1,S0(100)),z:D0("xyz",2,S0(108.833)),l:D0("lab",0,S0(100)),a:D0("lab",1),b:D0("lab",2),keyword(Z){if(Z!==void 0)return new b0(Z);return z4[this.model].keyword(this.color)},hex(Z){if(Z!==void 0)return new b0(Z);return w1.to.hex(...this.rgb().round().color)},hexa(Z){if(Z!==void 0)return new b0(Z);let X=this.rgb().round().color,Q=Math.round(this.valpha*255).toString(16).toUpperCase();if(Q.length===1)Q="0"+Q;return w1.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 J=W/255;X[Q]=J<=0.04045?J/12.92:((J+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 b0.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(),J=X===void 0?0.5:X,G=2*J-1,Y=Q.alpha()-W.alpha(),z=((G*Y===-1?G:(G+Y)/(1+G*Y))+1)/2,q=1-z;return b0.rgb(z*Q.red()+q*W.red(),z*Q.green()+q*W.green(),z*Q.blue()+q*W.blue(),Q.alpha()*J+W.alpha()*(1-J))}};for(let Z of Object.keys(z4)){if(gz.includes(Z))continue;let{channels:X}=z4[Z];b0.prototype[Z]=function(...Q){if(this.model===Z)return new b0(this);if(Q.length>0)return new b0(Q,Z);return new b0([...N2(z4[this.model][Z].raw(this.color)),this.valpha],Z)},b0[Z]=function(...Q){let W=Q[0];if(typeof W==="number")W=v7(Q,X);return new b0(W,Z)}}function M2(Z,X){return Number(Z.toFixed(X))}function I2(Z){return function(X){return M2(X,Z)}}function D0(Z,X,Q){Z=Array.isArray(Z)?Z:[Z];for(let W of Z)(x7[W]||=[])[X]=Q;return Z=Z[0],function(W){let J;if(W!==void 0){if(Q)W=Q(W);return J=this[Z](),J.color[X]=W,J}if(J=this[Z]().color[X],Q)J=Q(J);return J}}function S0(Z){return function(X){return Math.max(0,Math.min(Z,X))}}function N2(Z){return Array.isArray(Z)?Z:[Z]}function v7(Z,X){for(let Q=0;Q<X;Q++)if(typeof Z[Q]!=="number")Z[Q]=0;return Z}var D2=b0});var mz=j((Ev,uz)=>{uz.exports=hz().default});function T2(Z){return this._setBackgroundColourOption("tint",Z),this}function w2(Z){return this.options.greyscale=$.bool(Z)?Z:!0,this}function j2(Z){return this.greyscale(Z)}function O2(Z){if(!$.string(Z))throw $.invalidParameterError("colourspace","string",Z);return this.options.colourspacePipeline=Z,this}function E2(Z){return this.pipelineColourspace(Z)}function R2(Z){if(!$.string(Z))throw $.invalidParameterError("colourspace","string",Z);return this.options.colourspace=Z,this}function P2(Z){return this.toColourspace(Z)}function cz(Z){if($.object(Z)||$.string(Z)&&Z.length>=3&&Z.length<=200){let X=dz.default(Z),Q=X.red(),W=X.green(),J=X.blue(),G=Math.round(X.alpha()*255);for(let[Y,z]of[["red",Q],["green",W],["blue",J],["alpha",G]])if(!$.number(z))throw $.invalidParameterError(`background.${Y}`,"number",z);return[Q,W,J,G]}else throw $.invalidParameterError("background","object or string",Z)}function C2(Z,X){if($.defined(X))this.options[Z]=cz(X)}var dz,lz,pz=(Z)=>{Object.assign(Z.prototype,{tint:T2,greyscale:w2,grayscale:j2,pipelineColourspace:O2,pipelineColorspace:E2,toColourspace:R2,toColorspace:P2,_getBackgroundColourOption:cz,_setBackgroundColourOption:C2}),Z.colourspace=lz,Z.colorspace=lz};var nz=c(()=>{v4();dz=W1(mz(),1);/*!
240
+ */rz={integer:"integer",float:"float",approximate:"approximate"}});var W$=j((Iy,Q$)=>{var{defineProperty:a7,getOwnPropertyDescriptor:b2,getOwnPropertyNames:x2}=Object,v2=Object.prototype.hasOwnProperty,y2=(Z,Q)=>{for(var W in Q)a7(Z,W,{get:Q[W],enumerable:!0})},g2=(Z,Q,W,X)=>{if(Q&&typeof Q==="object"||typeof Q==="function"){for(let J of x2(Q))if(!v2.call(Z,J)&&J!==W)a7(Z,J,{get:()=>Q[J],enumerable:!(X=b2(Q,J))||X.enumerable})}return Z},f2=(Z)=>g2(a7({},"__esModule",{value:!0}),Z),oz={};y2(oz,{default:()=>t2});Q$.exports=f2(oz);var p7={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 p7)Object.freeze(p7[Z]);var i4=Object.freeze(p7),tz=Object.create(null);for(let Z in i4)if(Object.hasOwn(i4,Z))tz[i4[Z]]=Z;var Q4={to:{},get:{}};Q4.get=function(Z){let Q=Z.slice(0,3).toLowerCase(),W,X;switch(Q){case"hsl":{W=Q4.get.hsl(Z),X="hsl";break}case"hwb":{W=Q4.get.hwb(Z),X="hwb";break}default:{W=Q4.get.rgb(Z),X="rgb";break}}if(!W)return null;return{model:X,value:W}};Q4.get.rgb=function(Z){if(!Z)return null;let Q=/^#([a-f\d]{3,4})$/i,W=/^#([a-f\d]{6})([a-f\d]{2})?$/i,X=/^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,J=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,G=/^(\w+)$/,Y=[0,0,0,1],z,q,K;if(z=Z.match(W)){K=z[2],z=z[1];for(q=0;q<3;q++){let V=q*2;Y[q]=Number.parseInt(z.slice(V,V+2),16)}if(K)Y[3]=Number.parseInt(K,16)/255}else if(z=Z.match(Q)){z=z[1],K=z[3];for(q=0;q<3;q++)Y[q]=Number.parseInt(z[q]+z[q],16);if(K)Y[3]=Number.parseInt(K+K,16)/255}else if(z=Z.match(X)){for(q=0;q<3;q++)Y[q]=Number.parseFloat(z[q+1]);if(z[4])Y[3]=z[5]?Number.parseFloat(z[4])*0.01:Number.parseFloat(z[4])}else if(z=Z.match(J)){for(q=0;q<3;q++)Y[q]=Math.round(Number.parseFloat(z[q+1])*2.55);if(z[4])Y[3]=z[5]?Number.parseFloat(z[4])*0.01:Number.parseFloat(z[4])}else if(z=Z.toLowerCase().match(G)){if(z[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(i4,z[1]))return null;return Y=i4[z[1]].slice(),Y[3]=1,Y}else return null;for(q=0;q<3;q++)Y[q]=S6(Y[q],0,255);return Y[3]=S6(Y[3],0,1),Y};Q4.get.hsl=function(Z){if(!Z)return null;let Q=/^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,W=Z.match(Q);if(W){let X=Number.parseFloat(W[4]),J=(Number.parseFloat(W[1])%360+360)%360,G=S6(Number.parseFloat(W[2]),0,100),Y=S6(Number.parseFloat(W[3]),0,100),z=S6(Number.isNaN(X)?1:X,0,1);return[J,G,Y,z]}return null};Q4.get.hwb=function(Z){if(!Z)return null;let Q=/^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,W=Z.match(Q);if(W){let X=Number.parseFloat(W[4]),J=(Number.parseFloat(W[1])%360+360)%360,G=S6(Number.parseFloat(W[2]),0,100),Y=S6(Number.parseFloat(W[3]),0,100),z=S6(Number.isNaN(X)?1:X,0,1);return[J,G,Y,z]}return null};Q4.to.hex=function(...Z){return"#"+X5(Z[0])+X5(Z[1])+X5(Z[2])+(Z[3]<1?X5(Math.round(Z[3]*255)):"")};Q4.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]+")"};Q4.to.rgb.percent=function(...Z){let Q=Math.round(Z[0]/255*100),W=Math.round(Z[1]/255*100),X=Math.round(Z[2]/255*100);return Z.length<4||Z[3]===1?"rgb("+Q+"%, "+W+"%, "+X+"%)":"rgba("+Q+"%, "+W+"%, "+X+"%, "+Z[3]+")"};Q4.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]+")"};Q4.to.hwb=function(...Z){let Q="";if(Z.length>=4&&Z[3]!==1)Q=", "+Z[3];return"hwb("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%"+Q+")"};Q4.to.keyword=function(...Z){return tz[Z.slice(0,3)]};function S6(Z,Q,W){return Math.min(Math.max(Q,Z),W)}function X5(Z){let Q=Math.round(Z).toString(16).toUpperCase();return Q.length<2?"0"+Q:Q}var P1=Q4,ez={};for(let Z of Object.keys(i4))ez[i4[Z]]=Z;var m={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"]}},a6=m,$6=0.008856451679035631;function S1(Z){let Q=Z>0.0031308?1.055*Z**0.4166666666666667-0.055:Z*12.92;return Math.min(Math.max(0,Q),1)}function k1(Z){return Z>0.04045?((Z+0.055)/1.055)**2.4:Z/12.92}for(let Z of Object.keys(m)){if(!("channels"in m[Z]))throw Error("missing channels property: "+Z);if(!("labels"in m[Z]))throw Error("missing channel labels property: "+Z);if(m[Z].labels.length!==m[Z].channels)throw Error("channel and label counts mismatch: "+Z);let{channels:Q,labels:W}=m[Z];delete m[Z].channels,delete m[Z].labels,Object.defineProperty(m[Z],"channels",{value:Q}),Object.defineProperty(m[Z],"labels",{value:W})}m.rgb.hsl=function(Z){let Q=Z[0]/255,W=Z[1]/255,X=Z[2]/255,J=Math.min(Q,W,X),G=Math.max(Q,W,X),Y=G-J,z,q;switch(G){case J:{z=0;break}case Q:{z=(W-X)/Y;break}case W:{z=2+(X-Q)/Y;break}case X:{z=4+(Q-W)/Y;break}}if(z=Math.min(z*60,360),z<0)z+=360;let K=(J+G)/2;if(G===J)q=0;else if(K<=0.5)q=Y/(G+J);else q=Y/(2-G-J);return[z,q*100,K*100]};m.rgb.hsv=function(Z){let Q,W,X,J,G,Y=Z[0]/255,z=Z[1]/255,q=Z[2]/255,K=Math.max(Y,z,q),V=K-Math.min(Y,z,q),H=function(B){return(K-B)/6/V+0.5};if(V===0)J=0,G=0;else{switch(G=V/K,Q=H(Y),W=H(z),X=H(q),K){case Y:{J=X-W;break}case z:{J=0.3333333333333333+Q-X;break}case q:{J=0.6666666666666666+W-Q;break}}if(J<0)J+=1;else if(J>1)J-=1}return[J*360,G*100,K*100]};m.rgb.hwb=function(Z){let Q=Z[0],W=Z[1],X=Z[2],J=m.rgb.hsl(Z)[0],G=0.00392156862745098*Math.min(Q,Math.min(W,X));return X=1-0.00392156862745098*Math.max(Q,Math.max(W,X)),[J,G*100,X*100]};m.rgb.oklab=function(Z){let Q=k1(Z[0]/255),W=k1(Z[1]/255),X=k1(Z[2]/255),J=Math.cbrt(0.4122214708*Q+0.5363325363*W+0.0514459929*X),G=Math.cbrt(0.2119034982*Q+0.6806995451*W+0.1073969566*X),Y=Math.cbrt(0.0883024619*Q+0.2817188376*W+0.6299787005*X),z=0.2104542553*J+0.793617785*G-0.0040720468*Y,q=1.9779984951*J-2.428592205*G+0.4505937099*Y,K=0.0259040371*J+0.7827717662*G-0.808675766*Y;return[z*100,q*100,K*100]};m.rgb.cmyk=function(Z){let Q=Z[0]/255,W=Z[1]/255,X=Z[2]/255,J=Math.min(1-Q,1-W,1-X),G=(1-Q-J)/(1-J)||0,Y=(1-W-J)/(1-J)||0,z=(1-X-J)/(1-J)||0;return[G*100,Y*100,z*100,J*100]};function h2(Z,Q){return(Z[0]-Q[0])**2+(Z[1]-Q[1])**2+(Z[2]-Q[2])**2}m.rgb.keyword=function(Z){let Q=ez[Z];if(Q)return Q;let W=Number.POSITIVE_INFINITY,X;for(let J of Object.keys(i4)){let G=i4[J],Y=h2(Z,G);if(Y<W)W=Y,X=J}return X};m.keyword.rgb=function(Z){return[...i4[Z]]};m.rgb.xyz=function(Z){let Q=k1(Z[0]/255),W=k1(Z[1]/255),X=k1(Z[2]/255),J=Q*0.4124564+W*0.3575761+X*0.1804375,G=Q*0.2126729+W*0.7151522+X*0.072175,Y=Q*0.0193339+W*0.119192+X*0.9503041;return[J*100,G*100,Y*100]};m.rgb.lab=function(Z){let Q=m.rgb.xyz(Z),W=Q[0],X=Q[1],J=Q[2];W/=95.047,X/=100,J/=108.883,W=W>$6?W**0.3333333333333333:7.787*W+0.13793103448275862,X=X>$6?X**0.3333333333333333:7.787*X+0.13793103448275862,J=J>$6?J**0.3333333333333333:7.787*J+0.13793103448275862;let G=116*X-16,Y=500*(W-X),z=200*(X-J);return[G,Y,z]};m.hsl.rgb=function(Z){let Q=Z[0]/360,W=Z[1]/100,X=Z[2]/100,J,G;if(W===0)return G=X*255,[G,G,G];let Y=X<0.5?X*(1+W):X+W-X*W,z=2*X-Y,q=[0,0,0];for(let K=0;K<3;K++){if(J=Q+0.3333333333333333*-(K-1),J<0)J++;if(J>1)J--;if(6*J<1)G=z+(Y-z)*6*J;else if(2*J<1)G=Y;else if(3*J<2)G=z+(Y-z)*(0.6666666666666666-J)*6;else G=z;q[K]=G*255}return q};m.hsl.hsv=function(Z){let Q=Z[0],W=Z[1]/100,X=Z[2]/100,J=W,G=Math.max(X,0.01);X*=2,W*=X<=1?X:2-X,J*=G<=1?G:2-G;let Y=(X+W)/2,z=X===0?2*J/(G+J):2*W/(X+W);return[Q,z*100,Y*100]};m.hsv.rgb=function(Z){let Q=Z[0]/60,W=Z[1]/100,X=Z[2]/100,J=Math.floor(Q)%6,G=Q-Math.floor(Q),Y=255*X*(1-W),z=255*X*(1-W*G),q=255*X*(1-W*(1-G));switch(X*=255,J){case 0:return[X,q,Y];case 1:return[z,X,Y];case 2:return[Y,X,q];case 3:return[Y,z,X];case 4:return[q,Y,X];case 5:return[X,Y,z]}};m.hsv.hsl=function(Z){let Q=Z[0],W=Z[1]/100,X=Z[2]/100,J=Math.max(X,0.01),G,Y;Y=(2-W)*X;let z=(2-W)*J;return G=W*J,G/=z<=1?z:2-z,G=G||0,Y/=2,[Q,G*100,Y*100]};m.hwb.rgb=function(Z){let Q=Z[0]/360,W=Z[1]/100,X=Z[2]/100,J=W+X,G;if(J>1)W/=J,X/=J;let Y=Math.floor(6*Q),z=1-X;if(G=6*Q-Y,(Y&1)!==0)G=1-G;let q=W+G*(z-W),K,V,H;switch(Y){default:case 6:case 0:{K=z,V=q,H=W;break}case 1:{K=q,V=z,H=W;break}case 2:{K=W,V=z,H=q;break}case 3:{K=W,V=q,H=z;break}case 4:{K=q,V=W,H=z;break}case 5:{K=z,V=W,H=q;break}}return[K*255,V*255,H*255]};m.cmyk.rgb=function(Z){let Q=Z[0]/100,W=Z[1]/100,X=Z[2]/100,J=Z[3]/100,G=1-Math.min(1,Q*(1-J)+J),Y=1-Math.min(1,W*(1-J)+J),z=1-Math.min(1,X*(1-J)+J);return[G*255,Y*255,z*255]};m.xyz.rgb=function(Z){let Q=Z[0]/100,W=Z[1]/100,X=Z[2]/100,J,G,Y;return J=Q*3.2404542+W*-1.5371385+X*-0.4985314,G=Q*-0.969266+W*1.8760108+X*0.041556,Y=Q*0.0556434+W*-0.2040259+X*1.0572252,J=S1(J),G=S1(G),Y=S1(Y),[J*255,G*255,Y*255]};m.xyz.lab=function(Z){let Q=Z[0],W=Z[1],X=Z[2];Q/=95.047,W/=100,X/=108.883,Q=Q>$6?Q**0.3333333333333333:7.787*Q+0.13793103448275862,W=W>$6?W**0.3333333333333333:7.787*W+0.13793103448275862,X=X>$6?X**0.3333333333333333:7.787*X+0.13793103448275862;let J=116*W-16,G=500*(Q-W),Y=200*(W-X);return[J,G,Y]};m.xyz.oklab=function(Z){let Q=Z[0]/100,W=Z[1]/100,X=Z[2]/100,J=Math.cbrt(0.8189330101*Q+0.3618667424*W-0.1288597137*X),G=Math.cbrt(0.0329845436*Q+0.9293118715*W+0.0361456387*X),Y=Math.cbrt(0.0482003018*Q+0.2643662691*W+0.633851707*X),z=0.2104542553*J+0.793617785*G-0.0040720468*Y,q=1.9779984951*J-2.428592205*G+0.4505937099*Y,K=0.0259040371*J+0.7827717662*G-0.808675766*Y;return[z*100,q*100,K*100]};m.oklab.oklch=function(Z){return m.lab.lch(Z)};m.oklab.xyz=function(Z){let Q=Z[0]/100,W=Z[1]/100,X=Z[2]/100,J=(0.999999998*Q+0.396337792*W+0.215803758*X)**3,G=(1.000000008*Q-0.105561342*W-0.063854175*X)**3,Y=(1.000000055*Q-0.089484182*W-1.291485538*X)**3,z=1.227013851*J-0.55779998*G+0.281256149*Y,q=-0.040580178*J+1.11225687*G-0.071676679*Y,K=-0.076381285*J-0.421481978*G+1.58616322*Y;return[z*100,q*100,K*100]};m.oklab.rgb=function(Z){let Q=Z[0]/100,W=Z[1]/100,X=Z[2]/100,J=(Q+0.3963377774*W+0.2158037573*X)**3,G=(Q-0.1055613458*W-0.0638541728*X)**3,Y=(Q-0.0894841775*W-1.291485548*X)**3,z=S1(4.0767416621*J-3.3077115913*G+0.2309699292*Y),q=S1(-1.2684380046*J+2.6097574011*G-0.3413193965*Y),K=S1(-0.0041960863*J-0.7034186147*G+1.707614701*Y);return[z*255,q*255,K*255]};m.oklch.oklab=function(Z){return m.lch.lab(Z)};m.lab.xyz=function(Z){let Q=Z[0],W=Z[1],X=Z[2],J,G,Y;G=(Q+16)/116,J=W/500+G,Y=G-X/200;let z=G**3,q=J**3,K=Y**3;return G=z>$6?z:(G-0.13793103448275862)/7.787,J=q>$6?q:(J-0.13793103448275862)/7.787,Y=K>$6?K:(Y-0.13793103448275862)/7.787,J*=95.047,G*=100,Y*=108.883,[J,G,Y]};m.lab.lch=function(Z){let Q=Z[0],W=Z[1],X=Z[2],J;if(J=Math.atan2(X,W)*360/2/Math.PI,J<0)J+=360;let Y=Math.sqrt(W*W+X*X);return[Q,Y,J]};m.lch.lab=function(Z){let Q=Z[0],W=Z[1],J=Z[2]/360*2*Math.PI,G=W*Math.cos(J),Y=W*Math.sin(J);return[Q,G,Y]};m.rgb.ansi16=function(Z,Q=null){let[W,X,J]=Z,G=Q===null?m.rgb.hsv(Z)[2]:Q;if(G=Math.round(G/50),G===0)return 30;let Y=30+(Math.round(J/255)<<2|Math.round(X/255)<<1|Math.round(W/255));if(G===2)Y+=60;return Y};m.hsv.ansi16=function(Z){return m.rgb.ansi16(m.hsv.rgb(Z),Z[2])};m.rgb.ansi256=function(Z){let Q=Z[0],W=Z[1],X=Z[2];if(Q>>4===W>>4&&W>>4===X>>4){if(Q<8)return 16;if(Q>248)return 231;return Math.round((Q-8)/247*24)+232}return 16+36*Math.round(Q/255*5)+6*Math.round(W/255*5)+Math.round(X/255*5)};m.ansi16.rgb=function(Z){Z=Z[0];let Q=Z%10;if(Q===0||Q===7){if(Z>50)Q+=3.5;return Q=Q/10.5*255,[Q,Q,Q]}let W=(Math.trunc(Z>50)+1)*0.5,X=(Q&1)*W*255,J=(Q>>1&1)*W*255,G=(Q>>2&1)*W*255;return[X,J,G]};m.ansi256.rgb=function(Z){if(Z=Z[0],Z>=232){let G=(Z-232)*10+8;return[G,G,G]}Z-=16;let Q,W=Math.floor(Z/36)/5*255,X=Math.floor((Q=Z%36)/6)/5*255,J=Q%6/5*255;return[W,X,J]};m.rgb.hex=function(Z){let W=(((Math.round(Z[0])&255)<<16)+((Math.round(Z[1])&255)<<8)+(Math.round(Z[2])&255)).toString(16).toUpperCase();return"000000".slice(W.length)+W};m.hex.rgb=function(Z){let Q=Z.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!Q)return[0,0,0];let W=Q[0];if(Q[0].length===3)W=[...W].map((z)=>z+z).join("");let X=Number.parseInt(W,16),J=X>>16&255,G=X>>8&255,Y=X&255;return[J,G,Y]};m.rgb.hcg=function(Z){let Q=Z[0]/255,W=Z[1]/255,X=Z[2]/255,J=Math.max(Math.max(Q,W),X),G=Math.min(Math.min(Q,W),X),Y=J-G,z,q=Y<1?G/(1-Y):0;if(Y<=0)z=0;else if(J===Q)z=(W-X)/Y%6;else if(J===W)z=2+(X-Q)/Y;else z=4+(Q-W)/Y;return z/=6,z%=1,[z*360,Y*100,q*100]};m.hsl.hcg=function(Z){let Q=Z[1]/100,W=Z[2]/100,X=W<0.5?2*Q*W:2*Q*(1-W),J=0;if(X<1)J=(W-0.5*X)/(1-X);return[Z[0],X*100,J*100]};m.hsv.hcg=function(Z){let Q=Z[1]/100,W=Z[2]/100,X=Q*W,J=0;if(X<1)J=(W-X)/(1-X);return[Z[0],X*100,J*100]};m.hcg.rgb=function(Z){let Q=Z[0]/360,W=Z[1]/100,X=Z[2]/100;if(W===0)return[X*255,X*255,X*255];let J=[0,0,0],G=Q%1*6,Y=G%1,z=1-Y,q=0;switch(Math.floor(G)){case 0:{J[0]=1,J[1]=Y,J[2]=0;break}case 1:{J[0]=z,J[1]=1,J[2]=0;break}case 2:{J[0]=0,J[1]=1,J[2]=Y;break}case 3:{J[0]=0,J[1]=z,J[2]=1;break}case 4:{J[0]=Y,J[1]=0,J[2]=1;break}default:J[0]=1,J[1]=0,J[2]=z}return q=(1-W)*X,[(W*J[0]+q)*255,(W*J[1]+q)*255,(W*J[2]+q)*255]};m.hcg.hsv=function(Z){let Q=Z[1]/100,W=Z[2]/100,X=Q+W*(1-Q),J=0;if(X>0)J=Q/X;return[Z[0],J*100,X*100]};m.hcg.hsl=function(Z){let Q=Z[1]/100,X=Z[2]/100*(1-Q)+0.5*Q,J=0;if(X>0&&X<0.5)J=Q/(2*X);else if(X>=0.5&&X<1)J=Q/(2*(1-X));return[Z[0],J*100,X*100]};m.hcg.hwb=function(Z){let Q=Z[1]/100,W=Z[2]/100,X=Q+W*(1-Q);return[Z[0],(X-Q)*100,(1-X)*100]};m.hwb.hcg=function(Z){let Q=Z[1]/100,X=1-Z[2]/100,J=X-Q,G=0;if(J<1)G=(X-J)/(1-J);return[Z[0],J*100,G*100]};m.apple.rgb=function(Z){return[Z[0]/65535*255,Z[1]/65535*255,Z[2]/65535*255]};m.rgb.apple=function(Z){return[Z[0]/255*65535,Z[1]/255*65535,Z[2]/255*65535]};m.gray.rgb=function(Z){return[Z[0]/100*255,Z[0]/100*255,Z[0]/100*255]};m.gray.hsl=function(Z){return[0,0,Z[0]]};m.gray.hsv=m.gray.hsl;m.gray.hwb=function(Z){return[0,100,Z[0]]};m.gray.cmyk=function(Z){return[0,0,0,Z[0]]};m.gray.lab=function(Z){return[Z[0],0,0]};m.gray.hex=function(Z){let Q=Math.round(Z[0]/100*255)&255,X=((Q<<16)+(Q<<8)+Q).toString(16).toUpperCase();return"000000".slice(X.length)+X};m.rgb.gray=function(Z){return[(Z[0]+Z[1]+Z[2])/3/255*100]};function u2(){let Z={},Q=Object.keys(a6);for(let{length:W}=Q,X=0;X<W;X++)Z[Q[X]]={distance:-1,parent:null};return Z}function m2(Z){let Q=u2(),W=[Z];Q[Z].distance=0;while(W.length>0){let X=W.pop(),J=Object.keys(a6[X]);for(let{length:G}=J,Y=0;Y<G;Y++){let z=J[Y],q=Q[z];if(q.distance===-1)q.distance=Q[X].distance+1,q.parent=X,W.unshift(z)}}return Q}function l2(Z,Q){return function(W){return Q(Z(W))}}function d2(Z,Q){let W=[Q[Z].parent,Z],X=a6[Q[Z].parent][Z],J=Q[Z].parent;while(Q[J].parent)W.unshift(Q[J].parent),X=l2(a6[Q[J].parent][J],X),J=Q[J].parent;return X.conversion=W,X}function c2(Z){let Q=m2(Z),W={},X=Object.keys(Q);for(let{length:J}=X,G=0;G<J;G++){let Y=X[G];if(Q[Y].parent===null)continue;W[Y]=d2(Y,Q)}return W}var p2=c2,C1={},i2=Object.keys(a6);function n2(Z){let Q=function(...W){let X=W[0];if(X===void 0||X===null)return X;if(X.length>1)W=X;return Z(W)};if("conversion"in Z)Q.conversion=Z.conversion;return Q}function r2(Z){let Q=function(...W){let X=W[0];if(X===void 0||X===null)return X;if(X.length>1)W=X;let J=Z(W);if(typeof J==="object")for(let{length:G}=J,Y=0;Y<G;Y++)J[Y]=Math.round(J[Y]);return J};if("conversion"in Z)Q.conversion=Z.conversion;return Q}for(let Z of i2){C1[Z]={},Object.defineProperty(C1[Z],"channels",{value:a6[Z].channels}),Object.defineProperty(C1[Z],"labels",{value:a6[Z].labels});let Q=p2(Z),W=Object.keys(Q);for(let X of W){let J=Q[X];C1[Z][X]=r2(J),C1[Z][X].raw=n2(J)}}var V4=C1,Z$=["keyword","gray","hex"],i7={};for(let Z of Object.keys(V4))i7[[...V4[Z].labels].sort().join("")]=Z;var n7={};function y0(Z,Q){if(!(this instanceof y0))return new y0(Z,Q);if(Q&&Q in Z$)Q=null;if(Q&&!(Q in V4))throw Error("Unknown model: "+Q);let W,X;if(Z==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(Z instanceof y0)this.model=Z.model,this.color=[...Z.color],this.valpha=Z.valpha;else if(typeof Z==="string"){let J=P1.get(Z);if(J===null)throw Error("Unable to parse color from string: "+Z);this.model=J.model,X=V4[this.model].channels,this.color=J.value.slice(0,X),this.valpha=typeof J.value[X]==="number"?J.value[X]:1}else if(Z.length>0){this.model=Q||"rgb",X=V4[this.model].channels;let J=Array.prototype.slice.call(Z,0,X);this.color=r7(J,X),this.valpha=typeof Z[X]==="number"?Z[X]: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 J=Object.keys(Z);if("alpha"in Z)J.splice(J.indexOf("alpha"),1),this.valpha=typeof Z.alpha==="number"?Z.alpha:0;let G=J.sort().join("");if(!(G in i7))throw Error("Unable to parse color from object: "+JSON.stringify(Z));this.model=i7[G];let{labels:Y}=V4[this.model],z=[];for(W=0;W<Y.length;W++)z.push(Z[Y[W]]);this.color=r7(z)}if(n7[this.model]){X=V4[this.model].channels;for(W=0;W<X;W++){let J=n7[this.model][W];if(J)this.color[W]=J(this.color[W])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}y0.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(Z){let Q=this.model in P1.to?this:this.rgb();Q=Q.round(typeof Z==="number"?Z:1);let W=Q.valpha===1?Q.color:[...Q.color,this.valpha];return P1.to[Q.model](...W)},percentString(Z){let Q=this.rgb().round(typeof Z==="number"?Z:1),W=Q.valpha===1?Q.color:[...Q.color,this.valpha];return P1.to.rgb.percent(...W)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let Z={},{channels:Q}=V4[this.model],{labels:W}=V4[this.model];for(let X=0;X<Q;X++)Z[W[X]]=this.color[X];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 y0([...this.color.map(s2(Z)),this.valpha],this.model)},alpha(Z){if(Z!==void 0)return new y0([...this.color,Math.max(0,Math.min(1,Z))],this.model);return this.valpha},red:j0("rgb",0,b0(255)),green:j0("rgb",1,b0(255)),blue:j0("rgb",2,b0(255)),hue:j0(["hsl","hsv","hsl","hwb","hcg"],0,(Z)=>(Z%360+360)%360),saturationl:j0("hsl",1,b0(100)),lightness:j0("hsl",2,b0(100)),saturationv:j0("hsv",1,b0(100)),value:j0("hsv",2,b0(100)),chroma:j0("hcg",1,b0(100)),gray:j0("hcg",2,b0(100)),white:j0("hwb",1,b0(100)),wblack:j0("hwb",2,b0(100)),cyan:j0("cmyk",0,b0(100)),magenta:j0("cmyk",1,b0(100)),yellow:j0("cmyk",2,b0(100)),black:j0("cmyk",3,b0(100)),x:j0("xyz",0,b0(95.047)),y:j0("xyz",1,b0(100)),z:j0("xyz",2,b0(108.833)),l:j0("lab",0,b0(100)),a:j0("lab",1),b:j0("lab",2),keyword(Z){if(Z!==void 0)return new y0(Z);return V4[this.model].keyword(this.color)},hex(Z){if(Z!==void 0)return new y0(Z);return P1.to.hex(...this.rgb().round().color)},hexa(Z){if(Z!==void 0)return new y0(Z);let Q=this.rgb().round().color,W=Math.round(this.valpha*255).toString(16).toUpperCase();if(W.length===1)W="0"+W;return P1.to.hex(...Q)+W},rgbNumber(){let Z=this.rgb().color;return(Z[0]&255)<<16|(Z[1]&255)<<8|Z[2]&255},luminosity(){let Z=this.rgb().color,Q=[];for(let[W,X]of Z.entries()){let J=X/255;Q[W]=J<=0.04045?J/12.92:((J+0.055)/1.055)**2.4}return 0.2126*Q[0]+0.7152*Q[1]+0.0722*Q[2]},contrast(Z){let Q=this.luminosity(),W=Z.luminosity();if(Q>W)return(Q+0.05)/(W+0.05);return(W+0.05)/(Q+0.05)},level(Z){let Q=this.contrast(Z);if(Q>=7)return"AAA";return Q>=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 Q=0;Q<3;Q++)Z.color[Q]=255-Z.color[Q];return Z},lighten(Z){let Q=this.hsl();return Q.color[2]+=Q.color[2]*Z,Q},darken(Z){let Q=this.hsl();return Q.color[2]-=Q.color[2]*Z,Q},saturate(Z){let Q=this.hsl();return Q.color[1]+=Q.color[1]*Z,Q},desaturate(Z){let Q=this.hsl();return Q.color[1]-=Q.color[1]*Z,Q},whiten(Z){let Q=this.hwb();return Q.color[1]+=Q.color[1]*Z,Q},blacken(Z){let Q=this.hwb();return Q.color[2]+=Q.color[2]*Z,Q},grayscale(){let Z=this.rgb().color,Q=Z[0]*0.3+Z[1]*0.59+Z[2]*0.11;return y0.rgb(Q,Q,Q)},fade(Z){return this.alpha(this.valpha-this.valpha*Z)},opaquer(Z){return this.alpha(this.valpha+this.valpha*Z)},rotate(Z){let Q=this.hsl(),W=Q.color[0];return W=(W+Z)%360,W=W<0?360+W:W,Q.color[0]=W,Q},mix(Z,Q){if(!Z||!Z.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof Z);let W=Z.rgb(),X=this.rgb(),J=Q===void 0?0.5:Q,G=2*J-1,Y=W.alpha()-X.alpha(),z=((G*Y===-1?G:(G+Y)/(1+G*Y))+1)/2,q=1-z;return y0.rgb(z*W.red()+q*X.red(),z*W.green()+q*X.green(),z*W.blue()+q*X.blue(),W.alpha()*J+X.alpha()*(1-J))}};for(let Z of Object.keys(V4)){if(Z$.includes(Z))continue;let{channels:Q}=V4[Z];y0.prototype[Z]=function(...W){if(this.model===Z)return new y0(this);if(W.length>0)return new y0(W,Z);return new y0([...o2(V4[this.model][Z].raw(this.color)),this.valpha],Z)},y0[Z]=function(...W){let X=W[0];if(typeof X==="number")X=r7(W,Q);return new y0(X,Z)}}function a2(Z,Q){return Number(Z.toFixed(Q))}function s2(Z){return function(Q){return a2(Q,Z)}}function j0(Z,Q,W){Z=Array.isArray(Z)?Z:[Z];for(let X of Z)(n7[X]||=[])[Q]=W;return Z=Z[0],function(X){let J;if(X!==void 0){if(W)X=W(X);return J=this[Z](),J.color[Q]=X,J}if(J=this[Z]().color[Q],W)J=W(J);return J}}function b0(Z){return function(Q){return Math.max(0,Math.min(Z,Q))}}function o2(Z){return Array.isArray(Z)?Z:[Z]}function r7(Z,Q){for(let W=0;W<Q;W++)if(typeof Z[W]!=="number")Z[W]=0;return Z}var t2=y0});var J$=j((Ny,X$)=>{X$.exports=W$().default});function e2(Z){return this._setBackgroundColourOption("tint",Z),this}function ZN(Z){return this.options.greyscale=$.bool(Z)?Z:!0,this}function QN(Z){return this.greyscale(Z)}function WN(Z){if(!$.string(Z))throw $.invalidParameterError("colourspace","string",Z);return this.options.colourspacePipeline=Z,this}function XN(Z){return this.pipelineColourspace(Z)}function JN(Z){if(!$.string(Z))throw $.invalidParameterError("colourspace","string",Z);return this.options.colourspace=Z,this}function GN(Z){return this.toColourspace(Z)}function z$(Z){if($.object(Z)||$.string(Z)&&Z.length>=3&&Z.length<=200){let Q=Y$.default(Z),W=Q.red(),X=Q.green(),J=Q.blue(),G=Math.round(Q.alpha()*255);for(let[Y,z]of[["red",W],["green",X],["blue",J],["alpha",G]])if(!$.number(z))throw $.invalidParameterError(`background.${Y}`,"number",z);return[W,X,J,G]}else throw $.invalidParameterError("background","object or string",Z)}function YN(Z,Q){if($.defined(Q))this.options[Z]=z$(Q)}var Y$,G$,$$=(Z)=>{Object.assign(Z.prototype,{tint:e2,greyscale:ZN,grayscale:QN,pipelineColourspace:WN,pipelineColorspace:XN,toColourspace:JN,toColorspace:GN,_getBackgroundColourOption:z$,_setBackgroundColourOption:YN}),Z.colourspace=G$,Z.colorspace=G$};var q$=u(()=>{u4();Y$=$1(J$(),1);/*!
238
241
  Copyright 2013 Lovell Fuller and others.
239
242
  SPDX-License-Identifier: Apache-2.0
240
- */lz={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function k2(){return this.options.removeAlpha=!0,this}function b2(Z){if($.defined(Z))if($.number(Z)&&$.inRange(Z,0,1))this.options.ensureAlpha=Z;else throw $.invalidParameterError("alpha","number between 0 and 1",Z);else this.options.ensureAlpha=1;return this}function _2(Z){let X={red:0,green:1,blue:2,alpha:3};if(Object.keys(X).includes(Z))Z=X[Z];if($.integer(Z)&&$.inRange(Z,0,4))this.options.extractChannel=Z;else throw $.invalidParameterError("channel","integer or one of: red, green, blue, alpha",Z);return this}function x2(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 v2(Z){if($.string(Z)&&$.inArray(Z,["and","or","eor"]))this.options.bandBoolOp=Z;else throw $.invalidParameterError("boolOp","one of: and, or, eor",Z);return this}var S2,iz=(Z)=>{Object.assign(Z.prototype,{removeAlpha:k2,ensureAlpha:b2,extractChannel:_2,joinChannel:x2,bandbool:v2}),Z.bool=S2};var rz=c(()=>{v4();/*!
243
+ */G$={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function $N(){return this.options.removeAlpha=!0,this}function qN(Z){if($.defined(Z))if($.number(Z)&&$.inRange(Z,0,1))this.options.ensureAlpha=Z;else throw $.invalidParameterError("alpha","number between 0 and 1",Z);else this.options.ensureAlpha=1;return this}function KN(Z){let Q={red:0,green:1,blue:2,alpha:3};if(Object.keys(Q).includes(Z))Z=Q[Z];if($.integer(Z)&&$.inRange(Z,0,4))this.options.extractChannel=Z;else throw $.invalidParameterError("channel","integer or one of: red, green, blue, alpha",Z);return this}function UN(Z,Q){if(Array.isArray(Z))Z.forEach(function(W){this.options.joinChannelIn.push(this._createInputDescriptor(W,Q))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(Z,Q));return this}function VN(Z){if($.string(Z)&&$.inArray(Z,["and","or","eor"]))this.options.bandBoolOp=Z;else throw $.invalidParameterError("boolOp","one of: and, or, eor",Z);return this}var zN,K$=(Z)=>{Object.assign(Z.prototype,{removeAlpha:$N,ensureAlpha:qN,extractChannel:KN,joinChannel:UN,bandbool:VN}),Z.bool=zN};var U$=u(()=>{u4();/*!
241
244
  Copyright 2013 Lovell Fuller and others.
242
245
  SPDX-License-Identifier: Apache-2.0
243
- */S2={and:"and",or:"or",eor:"eor"}});import g7 from"node:path";function g2(Z,X){let Q;if(!$.string(Z))Q=Error("Missing output file path");else if($.string(this.options.input.file)&&g7.resolve(this.options.input.file)===g7.resolve(Z))Q=Error("Cannot use same file for input and output");else if(y2.test(g7.extname(Z))&&!this.constructor.format.jp2.output.file)Q=sz();if(Q)if($.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 f2(Z,X){if($.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($.fn(Z)?Z:X,Q)}function h2(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let Z=Error();return this._pipeline(null,Z)}function u2(Z){if($.number(Z)&&Z>0)this.options.withMetadataDensity=Z;else throw $.invalidParameterError("density","positive number",Z);return this.keepExif()}function m2(){return this.options.keepMetadata|=1,this}function l2(Z){if($.object(Z))for(let[X,Q]of Object.entries(Z))if($.object(Q))for(let[W,J]of Object.entries(Q))if($.string(J))this.options.withExif[`exif-${X.toLowerCase()}-${W}`]=J;else throw $.invalidParameterError(`${X}.${W}`,"string",J);else throw $.invalidParameterError(X,"object",Q);else throw $.invalidParameterError("exif","object",Z);return this.options.withExifMerge=!1,this.keepExif()}function d2(Z){return this.withExif(Z),this.options.withExifMerge=!0,this}function c2(){return this.options.keepMetadata|=8,this}function p2(Z,X){if($.string(Z))this.options.withIccProfile=Z;else throw $.invalidParameterError("icc","string",Z);if(this.keepIccProfile(),$.object(X)){if($.defined(X.attach))if($.bool(X.attach)){if(!X.attach)this.options.keepMetadata&=-9}else throw $.invalidParameterError("attach","boolean",X.attach)}return this}function n2(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function i2(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function r2(){return this.options.keepMetadata|=2,this}function a2(Z){if($.string(Z)&&Z.length>0)this.options.withXmp=Z,this.options.keepMetadata|=2;else throw $.invalidParameterError("xmp","non-empty string",Z);return this}function s2(){return this.options.keepMetadata|=31,this}function o2(Z){if(this.keepMetadata(),this.withIccProfile("srgb"),$.object(Z)){if($.defined(Z.orientation))if($.integer(Z.orientation)&&$.inRange(Z.orientation,1,8))this.options.withMetadataOrientation=Z.orientation;else throw $.invalidParameterError("orientation","integer between 1 and 8",Z.orientation);if($.defined(Z.density))if($.number(Z.density)&&Z.density>0)this.options.withMetadataDensity=Z.density;else throw $.invalidParameterError("density","positive number",Z.density);if($.defined(Z.icc))this.withIccProfile(Z.icc);if($.defined(Z.exif))this.withExifMerge(Z.exif)}return this}function t2(Z,X){let Q=az.get(($.object(Z)&&$.string(Z.id)?Z.id:Z).toLowerCase());if(!Q)throw $.invalidParameterError("format",`one of: ${[...az.keys()].join(", ")}`,Z);return this[Q](X)}function e2(Z){if($.object(Z)){if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,1,100))this.options.jpegQuality=Z.quality;else throw $.invalidParameterError("quality","integer between 1 and 100",Z.quality);if($.defined(Z.progressive))this._setBooleanOption("jpegProgressive",Z.progressive);if($.defined(Z.chromaSubsampling))if($.string(Z.chromaSubsampling)&&$.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=Z.chromaSubsampling;else throw $.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);let X=$.bool(Z.optimizeCoding)?Z.optimizeCoding:Z.optimiseCoding;if($.defined(X))this._setBooleanOption("jpegOptimiseCoding",X);if($.defined(Z.mozjpeg))if($.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 $.invalidParameterError("mozjpeg","boolean",Z.mozjpeg);let Q=$.bool(Z.trellisQuantization)?Z.trellisQuantization:Z.trellisQuantisation;if($.defined(Q))this._setBooleanOption("jpegTrellisQuantisation",Q);if($.defined(Z.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",Z.overshootDeringing);let W=$.bool(Z.optimizeScans)?Z.optimizeScans:Z.optimiseScans;if($.defined(W)){if(this._setBooleanOption("jpegOptimiseScans",W),W)this.options.jpegProgressive=!0}let J=$.number(Z.quantizationTable)?Z.quantizationTable:Z.quantisationTable;if($.defined(J))if($.integer(J)&&$.inRange(J,0,8))this.options.jpegQuantisationTable=J;else throw $.invalidParameterError("quantisationTable","integer between 0 and 8",J)}return this._updateFormatOut("jpeg",Z)}function ZN(Z){if($.object(Z)){if($.defined(Z.progressive))this._setBooleanOption("pngProgressive",Z.progressive);if($.defined(Z.compressionLevel))if($.integer(Z.compressionLevel)&&$.inRange(Z.compressionLevel,0,9))this.options.pngCompressionLevel=Z.compressionLevel;else throw $.invalidParameterError("compressionLevel","integer between 0 and 9",Z.compressionLevel);if($.defined(Z.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",Z.adaptiveFiltering);let X=Z.colours||Z.colors;if($.defined(X))if($.integer(X)&&$.inRange(X,2,256))this.options.pngBitdepth=oz(X);else throw $.invalidParameterError("colours","integer between 2 and 256",X);if($.defined(Z.palette))this._setBooleanOption("pngPalette",Z.palette);else if([Z.quality,Z.effort,Z.colours,Z.colors,Z.dither].some($.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,0,100))this.options.pngQuality=Z.quality;else throw $.invalidParameterError("quality","integer between 0 and 100",Z.quality);if($.defined(Z.effort))if($.integer(Z.effort)&&$.inRange(Z.effort,1,10))this.options.pngEffort=Z.effort;else throw $.invalidParameterError("effort","integer between 1 and 10",Z.effort);if($.defined(Z.dither))if($.number(Z.dither)&&$.inRange(Z.dither,0,1))this.options.pngDither=Z.dither;else throw $.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither)}}return this._updateFormatOut("png",Z)}function XN(Z){if($.object(Z)){if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,1,100))this.options.webpQuality=Z.quality;else throw $.invalidParameterError("quality","integer between 1 and 100",Z.quality);if($.defined(Z.alphaQuality))if($.integer(Z.alphaQuality)&&$.inRange(Z.alphaQuality,0,100))this.options.webpAlphaQuality=Z.alphaQuality;else throw $.invalidParameterError("alphaQuality","integer between 0 and 100",Z.alphaQuality);if($.defined(Z.lossless))this._setBooleanOption("webpLossless",Z.lossless);if($.defined(Z.nearLossless))this._setBooleanOption("webpNearLossless",Z.nearLossless);if($.defined(Z.smartSubsample))this._setBooleanOption("webpSmartSubsample",Z.smartSubsample);if($.defined(Z.smartDeblock))this._setBooleanOption("webpSmartDeblock",Z.smartDeblock);if($.defined(Z.preset))if($.string(Z.preset)&&$.inArray(Z.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=Z.preset;else throw $.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",Z.preset);if($.defined(Z.effort))if($.integer(Z.effort)&&$.inRange(Z.effort,0,6))this.options.webpEffort=Z.effort;else throw $.invalidParameterError("effort","integer between 0 and 6",Z.effort);if($.defined(Z.minSize))this._setBooleanOption("webpMinSize",Z.minSize);if($.defined(Z.mixed))this._setBooleanOption("webpMixed",Z.mixed);if($.defined(Z.exact))this._setBooleanOption("webpExact",Z.exact)}return f7(Z,this.options),this._updateFormatOut("webp",Z)}function QN(Z){if($.object(Z)){if($.defined(Z.reuse))this._setBooleanOption("gifReuse",Z.reuse);if($.defined(Z.progressive))this._setBooleanOption("gifProgressive",Z.progressive);let X=Z.colours||Z.colors;if($.defined(X))if($.integer(X)&&$.inRange(X,2,256))this.options.gifBitdepth=oz(X);else throw $.invalidParameterError("colours","integer between 2 and 256",X);if($.defined(Z.effort))if($.integer(Z.effort)&&$.inRange(Z.effort,1,10))this.options.gifEffort=Z.effort;else throw $.invalidParameterError("effort","integer between 1 and 10",Z.effort);if($.defined(Z.dither))if($.number(Z.dither)&&$.inRange(Z.dither,0,1))this.options.gifDither=Z.dither;else throw $.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither);if($.defined(Z.interFrameMaxError))if($.number(Z.interFrameMaxError)&&$.inRange(Z.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=Z.interFrameMaxError;else throw $.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",Z.interFrameMaxError);if($.defined(Z.interPaletteMaxError))if($.number(Z.interPaletteMaxError)&&$.inRange(Z.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=Z.interPaletteMaxError;else throw $.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",Z.interPaletteMaxError);if($.defined(Z.keepDuplicateFrames))if($.bool(Z.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",Z.keepDuplicateFrames);else throw $.invalidParameterError("keepDuplicateFrames","boolean",Z.keepDuplicateFrames)}return f7(Z,this.options),this._updateFormatOut("gif",Z)}function WN(Z){if(!this.constructor.format.jp2.output.buffer)throw sz();if($.object(Z)){if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,1,100))this.options.jp2Quality=Z.quality;else throw $.invalidParameterError("quality","integer between 1 and 100",Z.quality);if($.defined(Z.lossless))if($.bool(Z.lossless))this.options.jp2Lossless=Z.lossless;else throw $.invalidParameterError("lossless","boolean",Z.lossless);if($.defined(Z.tileWidth))if($.integer(Z.tileWidth)&&$.inRange(Z.tileWidth,1,32768))this.options.jp2TileWidth=Z.tileWidth;else throw $.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if($.defined(Z.tileHeight))if($.integer(Z.tileHeight)&&$.inRange(Z.tileHeight,1,32768))this.options.jp2TileHeight=Z.tileHeight;else throw $.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if($.defined(Z.chromaSubsampling))if($.string(Z.chromaSubsampling)&&$.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=Z.chromaSubsampling;else throw $.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling)}return this._updateFormatOut("jp2",Z)}function f7(Z,X){if($.object(Z)&&$.defined(Z.loop))if($.integer(Z.loop)&&$.inRange(Z.loop,0,65535))X.loop=Z.loop;else throw $.invalidParameterError("loop","integer between 0 and 65535",Z.loop);if($.object(Z)&&$.defined(Z.delay))if($.integer(Z.delay)&&$.inRange(Z.delay,0,65535))X.delay=[Z.delay];else if(Array.isArray(Z.delay)&&Z.delay.every($.integer)&&Z.delay.every((Q)=>$.inRange(Q,0,65535)))X.delay=Z.delay;else throw $.invalidParameterError("delay","integer or an array of integers between 0 and 65535",Z.delay)}function JN(Z){if($.object(Z)){if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,1,100))this.options.tiffQuality=Z.quality;else throw $.invalidParameterError("quality","integer between 1 and 100",Z.quality);if($.defined(Z.bitdepth))if($.integer(Z.bitdepth)&&$.inArray(Z.bitdepth,[1,2,4]))this.options.tiffBitdepth=Z.bitdepth;else throw $.invalidParameterError("bitdepth","1, 2 or 4",Z.bitdepth);if($.defined(Z.tile))this._setBooleanOption("tiffTile",Z.tile);if($.defined(Z.tileWidth))if($.integer(Z.tileWidth)&&$.inRange(Z.tileWidth,1,32768))this.options.tiffTileWidth=Z.tileWidth;else throw $.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if($.defined(Z.tileHeight))if($.integer(Z.tileHeight)&&$.inRange(Z.tileHeight,1,32768))this.options.tiffTileHeight=Z.tileHeight;else throw $.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if($.defined(Z.miniswhite))this._setBooleanOption("tiffMiniswhite",Z.miniswhite);if($.defined(Z.pyramid))this._setBooleanOption("tiffPyramid",Z.pyramid);if($.defined(Z.xres))if($.number(Z.xres)&&$.inRange(Z.xres,0.001,1e6))this.options.tiffXres=Z.xres;else throw $.invalidParameterError("xres","number between 0.001 and 1000000",Z.xres);if($.defined(Z.yres))if($.number(Z.yres)&&$.inRange(Z.yres,0.001,1e6))this.options.tiffYres=Z.yres;else throw $.invalidParameterError("yres","number between 0.001 and 1000000",Z.yres);if($.defined(Z.compression))if($.string(Z.compression)&&$.inArray(Z.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=Z.compression;else throw $.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",Z.compression);if($.defined(Z.bigtiff))this._setBooleanOption("tiffBigtiff",Z.bigtiff);if($.defined(Z.predictor))if($.string(Z.predictor)&&$.inArray(Z.predictor,["none","horizontal","float"]))this.options.tiffPredictor=Z.predictor;else throw $.invalidParameterError("predictor","one of: none, horizontal, float",Z.predictor);if($.defined(Z.resolutionUnit))if($.string(Z.resolutionUnit)&&$.inArray(Z.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=Z.resolutionUnit;else throw $.invalidParameterError("resolutionUnit","one of: inch, cm",Z.resolutionUnit)}return this._updateFormatOut("tiff",Z)}function GN(Z){return this.heif({...Z,compression:"av1"})}function YN(Z){if($.object(Z)){if($.string(Z.compression)&&$.inArray(Z.compression,["av1","hevc"]))this.options.heifCompression=Z.compression;else throw $.invalidParameterError("compression","one of: av1, hevc",Z.compression);if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,1,100))this.options.heifQuality=Z.quality;else throw $.invalidParameterError("quality","integer between 1 and 100",Z.quality);if($.defined(Z.lossless))if($.bool(Z.lossless))this.options.heifLossless=Z.lossless;else throw $.invalidParameterError("lossless","boolean",Z.lossless);if($.defined(Z.effort))if($.integer(Z.effort)&&$.inRange(Z.effort,0,9))this.options.heifEffort=Z.effort;else throw $.invalidParameterError("effort","integer between 0 and 9",Z.effort);if($.defined(Z.chromaSubsampling))if($.string(Z.chromaSubsampling)&&$.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=Z.chromaSubsampling;else throw $.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);if($.defined(Z.bitdepth))if($.integer(Z.bitdepth)&&$.inArray(Z.bitdepth,[8,10,12]))this.options.heifBitdepth=Z.bitdepth;else throw $.invalidParameterError("bitdepth","8, 10 or 12",Z.bitdepth);if($.defined(Z.tune))if($.string(Z.tune)&&$.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 $.invalidParameterError("tune","one of: auto, iq, psnr, ssim",Z.tune)}else throw $.invalidParameterError("options","Object",Z);return this._updateFormatOut("heif",Z)}function zN(Z){if($.object(Z)){if($.defined(Z.quality))if($.integer(Z.quality)&&$.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 $.invalidParameterError("quality","integer between 1 and 100",Z.quality);else if($.defined(Z.distance))if($.number(Z.distance)&&$.inRange(Z.distance,0,15))this.options.jxlDistance=Z.distance;else throw $.invalidParameterError("distance","number between 0.0 and 15.0",Z.distance);if($.defined(Z.decodingTier))if($.integer(Z.decodingTier)&&$.inRange(Z.decodingTier,0,4))this.options.jxlDecodingTier=Z.decodingTier;else throw $.invalidParameterError("decodingTier","integer between 0 and 4",Z.decodingTier);if($.defined(Z.lossless))if($.bool(Z.lossless))this.options.jxlLossless=Z.lossless;else throw $.invalidParameterError("lossless","boolean",Z.lossless);if($.defined(Z.effort))if($.integer(Z.effort)&&$.inRange(Z.effort,1,9))this.options.jxlEffort=Z.effort;else throw $.invalidParameterError("effort","integer between 1 and 9",Z.effort)}return f7(Z,this.options),this._updateFormatOut("jxl",Z)}function $N(Z){if($.object(Z)){if($.defined(Z.depth))if($.string(Z.depth)&&$.inArray(Z.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=Z.depth;else throw $.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",Z.depth)}return this._updateFormatOut("raw")}function qN(Z){if($.object(Z)){if($.defined(Z.size))if($.integer(Z.size)&&$.inRange(Z.size,1,8192))this.options.tileSize=Z.size;else throw $.invalidParameterError("size","integer between 1 and 8192",Z.size);if($.defined(Z.overlap))if($.integer(Z.overlap)&&$.inRange(Z.overlap,0,8192)){if(Z.overlap>this.options.tileSize)throw $.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,Z.overlap);this.options.tileOverlap=Z.overlap}else throw $.invalidParameterError("overlap","integer between 0 and 8192",Z.overlap);if($.defined(Z.container))if($.string(Z.container)&&$.inArray(Z.container,["fs","zip"]))this.options.tileContainer=Z.container;else throw $.invalidParameterError("container","one of: fs, zip",Z.container);if($.defined(Z.layout))if($.string(Z.layout)&&$.inArray(Z.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=Z.layout;else throw $.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",Z.layout);if($.defined(Z.angle))if($.integer(Z.angle)&&!(Z.angle%90))this.options.tileAngle=Z.angle;else throw $.invalidParameterError("angle","positive/negative multiple of 90",Z.angle);if(this._setBackgroundColourOption("tileBackground",Z.background),$.defined(Z.depth))if($.string(Z.depth)&&$.inArray(Z.depth,["onepixel","onetile","one"]))this.options.tileDepth=Z.depth;else throw $.invalidParameterError("depth","one of: onepixel, onetile, one",Z.depth);if($.defined(Z.skipBlanks))if($.integer(Z.skipBlanks)&&$.inRange(Z.skipBlanks,-1,65535))this.options.tileSkipBlanks=Z.skipBlanks;else throw $.invalidParameterError("skipBlanks","integer between -1 and 255/65535",Z.skipBlanks);else if($.defined(Z.layout)&&Z.layout==="google")this.options.tileSkipBlanks=5;let X=$.bool(Z.center)?Z.center:Z.centre;if($.defined(X))this._setBooleanOption("tileCentre",X);if($.defined(Z.id))if($.string(Z.id))this.options.tileId=Z.id;else throw $.invalidParameterError("id","string",Z.id);if($.defined(Z.basename))if($.string(Z.basename))this.options.tileBasename=Z.basename;else throw $.invalidParameterError("basename","string",Z.basename)}if($.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw $.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function KN(Z){if(!$.plainObject(Z))throw $.invalidParameterError("options","object",Z);if($.integer(Z.seconds)&&$.inRange(Z.seconds,0,3600))this.options.timeoutSeconds=Z.seconds;else throw $.invalidParameterError("seconds","integer between 0 and 3600",Z.seconds);return this}function UN(Z,X){if(!($.object(X)&&X.force===!1))this.options.formatOut=Z;return this}function VN(Z,X){if($.bool(X))this.options[Z]=X;else throw $.invalidParameterError(Z,"boolean",X)}function BN(){if(!this.options.streamOut){this.options.streamOut=!0;let Z=Error();this._pipeline(void 0,Z)}}function HN(Z,X){if(typeof Z==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),q0.pipeline(this.options,(Q,W,J)=>{if(Q)Z($.nativeError(Q,X));else Z(null,W,J)})});else q0.pipeline(this.options,(Q,W,J)=>{if(Q)Z($.nativeError(Q,X));else Z(null,W,J)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),q0.pipeline(this.options,(Q,W,J)=>{if(Q)this.emit("error",$.nativeError(Q,X));else this.emit("info",J),this.push(W);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else q0.pipeline(this.options,(Q,W,J)=>{if(Q)this.emit("error",$.nativeError(Q,X));else this.emit("info",J),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(),q0.pipeline(this.options,(J,G,Y)=>{if(J)W($.nativeError(J,X));else if(this.options.resolveWithObject)Q({data:G,info:Y});else Q(G)})})});else return new Promise((Q,W)=>{q0.pipeline(this.options,(J,G,Y)=>{if(J)W($.nativeError(J,X));else if(this.options.resolveWithObject)Q({data:G,info:Y});else Q(G)})})}var az,y2,sz=()=>Error("JP2 output requires libvips with support for OpenJPEG"),oz=(Z)=>1<<31-Math.clz32(Math.ceil(Math.log2(Z))),tz=(Z)=>{Object.assign(Z.prototype,{toFile:g2,toBuffer:f2,toUint8Array:h2,withDensity:u2,keepExif:m2,withExif:l2,withExifMerge:d2,keepIccProfile:c2,withIccProfile:p2,keepGainMap:n2,withGainMap:i2,keepXmp:r2,withXmp:a2,keepMetadata:s2,withMetadata:o2,toFormat:t2,jpeg:e2,jp2:WN,png:ZN,webp:XN,tiff:JN,avif:GN,heif:YN,jxl:zN,gif:QN,raw:$N,tile:qN,timeout:KN,_updateFormatOut:UN,_setBooleanOption:VN,_read:BN,_pipeline:HN})};var ez=c(()=>{v4();B9();/*!
246
+ */zN={and:"and",or:"or",eor:"eor"}});import s7 from"node:path";function BN(Z,Q){let W;if(!$.string(Z))W=Error("Missing output file path");else if($.string(this.options.input.file)&&s7.resolve(this.options.input.file)===s7.resolve(Z))W=Error("Cannot use same file for input and output");else if(HN.test(s7.extname(Z))&&!this.constructor.format.jp2.output.file)W=H$();if(W)if($.fn(Q))Q(W);else return Promise.reject(W);else{this.options.fileOut=Z;let X=Error();return this._pipeline(Q,X)}return this}function FN(Z,Q){if($.object(Z))this._setBooleanOption("resolveWithObject",Z.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let W=Error();return this._pipeline($.fn(Z)?Z:Q,W)}function LN(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let Z=Error();return this._pipeline(null,Z)}function AN(Z){if($.number(Z)&&Z>0)this.options.withMetadataDensity=Z;else throw $.invalidParameterError("density","positive number",Z);return this.keepExif()}function MN(){return this.options.keepMetadata|=1,this}function IN(Z){if($.object(Z))for(let[Q,W]of Object.entries(Z))if($.object(W))for(let[X,J]of Object.entries(W))if($.string(J))this.options.withExif[`exif-${Q.toLowerCase()}-${X}`]=J;else throw $.invalidParameterError(`${Q}.${X}`,"string",J);else throw $.invalidParameterError(Q,"object",W);else throw $.invalidParameterError("exif","object",Z);return this.options.withExifMerge=!1,this.keepExif()}function NN(Z){return this.withExif(Z),this.options.withExifMerge=!0,this}function DN(){return this.options.keepMetadata|=8,this}function wN(Z,Q){if($.string(Z))this.options.withIccProfile=Z;else throw $.invalidParameterError("icc","string",Z);if(this.keepIccProfile(),$.object(Q)){if($.defined(Q.attach))if($.bool(Q.attach)){if(!Q.attach)this.options.keepMetadata&=-9}else throw $.invalidParameterError("attach","boolean",Q.attach)}return this}function TN(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function jN(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function EN(){return this.options.keepMetadata|=2,this}function ON(Z){if($.string(Z)&&Z.length>0)this.options.withXmp=Z,this.options.keepMetadata|=2;else throw $.invalidParameterError("xmp","non-empty string",Z);return this}function RN(){return this.options.keepMetadata|=31,this}function PN(Z){if(this.keepMetadata(),this.withIccProfile("srgb"),$.object(Z)){if($.defined(Z.orientation))if($.integer(Z.orientation)&&$.inRange(Z.orientation,1,8))this.options.withMetadataOrientation=Z.orientation;else throw $.invalidParameterError("orientation","integer between 1 and 8",Z.orientation);if($.defined(Z.density))if($.number(Z.density)&&Z.density>0)this.options.withMetadataDensity=Z.density;else throw $.invalidParameterError("density","positive number",Z.density);if($.defined(Z.icc))this.withIccProfile(Z.icc);if($.defined(Z.exif))this.withExifMerge(Z.exif)}return this}function CN(Z,Q){let W=V$.get(($.object(Z)&&$.string(Z.id)?Z.id:Z).toLowerCase());if(!W)throw $.invalidParameterError("format",`one of: ${[...V$.keys()].join(", ")}`,Z);return this[W](Q)}function SN(Z){if($.object(Z)){if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,1,100))this.options.jpegQuality=Z.quality;else throw $.invalidParameterError("quality","integer between 1 and 100",Z.quality);if($.defined(Z.progressive))this._setBooleanOption("jpegProgressive",Z.progressive);if($.defined(Z.chromaSubsampling))if($.string(Z.chromaSubsampling)&&$.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=Z.chromaSubsampling;else throw $.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);let Q=$.bool(Z.optimizeCoding)?Z.optimizeCoding:Z.optimiseCoding;if($.defined(Q))this._setBooleanOption("jpegOptimiseCoding",Q);if($.defined(Z.mozjpeg))if($.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 $.invalidParameterError("mozjpeg","boolean",Z.mozjpeg);let W=$.bool(Z.trellisQuantization)?Z.trellisQuantization:Z.trellisQuantisation;if($.defined(W))this._setBooleanOption("jpegTrellisQuantisation",W);if($.defined(Z.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",Z.overshootDeringing);let X=$.bool(Z.optimizeScans)?Z.optimizeScans:Z.optimiseScans;if($.defined(X)){if(this._setBooleanOption("jpegOptimiseScans",X),X)this.options.jpegProgressive=!0}let J=$.number(Z.quantizationTable)?Z.quantizationTable:Z.quantisationTable;if($.defined(J))if($.integer(J)&&$.inRange(J,0,8))this.options.jpegQuantisationTable=J;else throw $.invalidParameterError("quantisationTable","integer between 0 and 8",J)}return this._updateFormatOut("jpeg",Z)}function kN(Z){if($.object(Z)){if($.defined(Z.progressive))this._setBooleanOption("pngProgressive",Z.progressive);if($.defined(Z.compressionLevel))if($.integer(Z.compressionLevel)&&$.inRange(Z.compressionLevel,0,9))this.options.pngCompressionLevel=Z.compressionLevel;else throw $.invalidParameterError("compressionLevel","integer between 0 and 9",Z.compressionLevel);if($.defined(Z.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",Z.adaptiveFiltering);let Q=Z.colours||Z.colors;if($.defined(Q))if($.integer(Q)&&$.inRange(Q,2,256))this.options.pngBitdepth=B$(Q);else throw $.invalidParameterError("colours","integer between 2 and 256",Q);if($.defined(Z.palette))this._setBooleanOption("pngPalette",Z.palette);else if([Z.quality,Z.effort,Z.colours,Z.colors,Z.dither].some($.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,0,100))this.options.pngQuality=Z.quality;else throw $.invalidParameterError("quality","integer between 0 and 100",Z.quality);if($.defined(Z.effort))if($.integer(Z.effort)&&$.inRange(Z.effort,1,10))this.options.pngEffort=Z.effort;else throw $.invalidParameterError("effort","integer between 1 and 10",Z.effort);if($.defined(Z.dither))if($.number(Z.dither)&&$.inRange(Z.dither,0,1))this.options.pngDither=Z.dither;else throw $.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither)}}return this._updateFormatOut("png",Z)}function _N(Z){if($.object(Z)){if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,1,100))this.options.webpQuality=Z.quality;else throw $.invalidParameterError("quality","integer between 1 and 100",Z.quality);if($.defined(Z.alphaQuality))if($.integer(Z.alphaQuality)&&$.inRange(Z.alphaQuality,0,100))this.options.webpAlphaQuality=Z.alphaQuality;else throw $.invalidParameterError("alphaQuality","integer between 0 and 100",Z.alphaQuality);if($.defined(Z.lossless))this._setBooleanOption("webpLossless",Z.lossless);if($.defined(Z.nearLossless))this._setBooleanOption("webpNearLossless",Z.nearLossless);if($.defined(Z.smartSubsample))this._setBooleanOption("webpSmartSubsample",Z.smartSubsample);if($.defined(Z.smartDeblock))this._setBooleanOption("webpSmartDeblock",Z.smartDeblock);if($.defined(Z.preset))if($.string(Z.preset)&&$.inArray(Z.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=Z.preset;else throw $.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",Z.preset);if($.defined(Z.effort))if($.integer(Z.effort)&&$.inRange(Z.effort,0,6))this.options.webpEffort=Z.effort;else throw $.invalidParameterError("effort","integer between 0 and 6",Z.effort);if($.defined(Z.minSize))this._setBooleanOption("webpMinSize",Z.minSize);if($.defined(Z.mixed))this._setBooleanOption("webpMixed",Z.mixed);if($.defined(Z.exact))this._setBooleanOption("webpExact",Z.exact)}return o7(Z,this.options),this._updateFormatOut("webp",Z)}function bN(Z){if($.object(Z)){if($.defined(Z.reuse))this._setBooleanOption("gifReuse",Z.reuse);if($.defined(Z.progressive))this._setBooleanOption("gifProgressive",Z.progressive);let Q=Z.colours||Z.colors;if($.defined(Q))if($.integer(Q)&&$.inRange(Q,2,256))this.options.gifBitdepth=B$(Q);else throw $.invalidParameterError("colours","integer between 2 and 256",Q);if($.defined(Z.effort))if($.integer(Z.effort)&&$.inRange(Z.effort,1,10))this.options.gifEffort=Z.effort;else throw $.invalidParameterError("effort","integer between 1 and 10",Z.effort);if($.defined(Z.dither))if($.number(Z.dither)&&$.inRange(Z.dither,0,1))this.options.gifDither=Z.dither;else throw $.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither);if($.defined(Z.interFrameMaxError))if($.number(Z.interFrameMaxError)&&$.inRange(Z.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=Z.interFrameMaxError;else throw $.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",Z.interFrameMaxError);if($.defined(Z.interPaletteMaxError))if($.number(Z.interPaletteMaxError)&&$.inRange(Z.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=Z.interPaletteMaxError;else throw $.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",Z.interPaletteMaxError);if($.defined(Z.keepDuplicateFrames))if($.bool(Z.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",Z.keepDuplicateFrames);else throw $.invalidParameterError("keepDuplicateFrames","boolean",Z.keepDuplicateFrames)}return o7(Z,this.options),this._updateFormatOut("gif",Z)}function xN(Z){if(!this.constructor.format.jp2.output.buffer)throw H$();if($.object(Z)){if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,1,100))this.options.jp2Quality=Z.quality;else throw $.invalidParameterError("quality","integer between 1 and 100",Z.quality);if($.defined(Z.lossless))if($.bool(Z.lossless))this.options.jp2Lossless=Z.lossless;else throw $.invalidParameterError("lossless","boolean",Z.lossless);if($.defined(Z.tileWidth))if($.integer(Z.tileWidth)&&$.inRange(Z.tileWidth,1,32768))this.options.jp2TileWidth=Z.tileWidth;else throw $.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if($.defined(Z.tileHeight))if($.integer(Z.tileHeight)&&$.inRange(Z.tileHeight,1,32768))this.options.jp2TileHeight=Z.tileHeight;else throw $.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if($.defined(Z.chromaSubsampling))if($.string(Z.chromaSubsampling)&&$.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=Z.chromaSubsampling;else throw $.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling)}return this._updateFormatOut("jp2",Z)}function o7(Z,Q){if($.object(Z)&&$.defined(Z.loop))if($.integer(Z.loop)&&$.inRange(Z.loop,0,65535))Q.loop=Z.loop;else throw $.invalidParameterError("loop","integer between 0 and 65535",Z.loop);if($.object(Z)&&$.defined(Z.delay))if($.integer(Z.delay)&&$.inRange(Z.delay,0,65535))Q.delay=[Z.delay];else if(Array.isArray(Z.delay)&&Z.delay.every($.integer)&&Z.delay.every((W)=>$.inRange(W,0,65535)))Q.delay=Z.delay;else throw $.invalidParameterError("delay","integer or an array of integers between 0 and 65535",Z.delay)}function vN(Z){if($.object(Z)){if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,1,100))this.options.tiffQuality=Z.quality;else throw $.invalidParameterError("quality","integer between 1 and 100",Z.quality);if($.defined(Z.bitdepth))if($.integer(Z.bitdepth)&&$.inArray(Z.bitdepth,[1,2,4]))this.options.tiffBitdepth=Z.bitdepth;else throw $.invalidParameterError("bitdepth","1, 2 or 4",Z.bitdepth);if($.defined(Z.tile))this._setBooleanOption("tiffTile",Z.tile);if($.defined(Z.tileWidth))if($.integer(Z.tileWidth)&&$.inRange(Z.tileWidth,1,32768))this.options.tiffTileWidth=Z.tileWidth;else throw $.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if($.defined(Z.tileHeight))if($.integer(Z.tileHeight)&&$.inRange(Z.tileHeight,1,32768))this.options.tiffTileHeight=Z.tileHeight;else throw $.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if($.defined(Z.miniswhite))this._setBooleanOption("tiffMiniswhite",Z.miniswhite);if($.defined(Z.pyramid))this._setBooleanOption("tiffPyramid",Z.pyramid);if($.defined(Z.xres))if($.number(Z.xres)&&$.inRange(Z.xres,0.001,1e6))this.options.tiffXres=Z.xres;else throw $.invalidParameterError("xres","number between 0.001 and 1000000",Z.xres);if($.defined(Z.yres))if($.number(Z.yres)&&$.inRange(Z.yres,0.001,1e6))this.options.tiffYres=Z.yres;else throw $.invalidParameterError("yres","number between 0.001 and 1000000",Z.yres);if($.defined(Z.compression))if($.string(Z.compression)&&$.inArray(Z.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=Z.compression;else throw $.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",Z.compression);if($.defined(Z.bigtiff))this._setBooleanOption("tiffBigtiff",Z.bigtiff);if($.defined(Z.predictor))if($.string(Z.predictor)&&$.inArray(Z.predictor,["none","horizontal","float"]))this.options.tiffPredictor=Z.predictor;else throw $.invalidParameterError("predictor","one of: none, horizontal, float",Z.predictor);if($.defined(Z.resolutionUnit))if($.string(Z.resolutionUnit)&&$.inArray(Z.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=Z.resolutionUnit;else throw $.invalidParameterError("resolutionUnit","one of: inch, cm",Z.resolutionUnit)}return this._updateFormatOut("tiff",Z)}function yN(Z){return this.heif({...Z,compression:"av1"})}function gN(Z){if($.object(Z)){if($.string(Z.compression)&&$.inArray(Z.compression,["av1","hevc"]))this.options.heifCompression=Z.compression;else throw $.invalidParameterError("compression","one of: av1, hevc",Z.compression);if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,1,100))this.options.heifQuality=Z.quality;else throw $.invalidParameterError("quality","integer between 1 and 100",Z.quality);if($.defined(Z.lossless))if($.bool(Z.lossless))this.options.heifLossless=Z.lossless;else throw $.invalidParameterError("lossless","boolean",Z.lossless);if($.defined(Z.effort))if($.integer(Z.effort)&&$.inRange(Z.effort,0,9))this.options.heifEffort=Z.effort;else throw $.invalidParameterError("effort","integer between 0 and 9",Z.effort);if($.defined(Z.chromaSubsampling))if($.string(Z.chromaSubsampling)&&$.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=Z.chromaSubsampling;else throw $.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);if($.defined(Z.bitdepth))if($.integer(Z.bitdepth)&&$.inArray(Z.bitdepth,[8,10,12]))this.options.heifBitdepth=Z.bitdepth;else throw $.invalidParameterError("bitdepth","8, 10 or 12",Z.bitdepth);if($.defined(Z.tune))if($.string(Z.tune)&&$.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 $.invalidParameterError("tune","one of: auto, iq, psnr, ssim",Z.tune)}else throw $.invalidParameterError("options","Object",Z);return this._updateFormatOut("heif",Z)}function fN(Z){if($.object(Z)){if($.defined(Z.quality))if($.integer(Z.quality)&&$.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 $.invalidParameterError("quality","integer between 1 and 100",Z.quality);else if($.defined(Z.distance))if($.number(Z.distance)&&$.inRange(Z.distance,0,15))this.options.jxlDistance=Z.distance;else throw $.invalidParameterError("distance","number between 0.0 and 15.0",Z.distance);if($.defined(Z.decodingTier))if($.integer(Z.decodingTier)&&$.inRange(Z.decodingTier,0,4))this.options.jxlDecodingTier=Z.decodingTier;else throw $.invalidParameterError("decodingTier","integer between 0 and 4",Z.decodingTier);if($.defined(Z.lossless))if($.bool(Z.lossless))this.options.jxlLossless=Z.lossless;else throw $.invalidParameterError("lossless","boolean",Z.lossless);if($.defined(Z.effort))if($.integer(Z.effort)&&$.inRange(Z.effort,1,9))this.options.jxlEffort=Z.effort;else throw $.invalidParameterError("effort","integer between 1 and 9",Z.effort)}return o7(Z,this.options),this._updateFormatOut("jxl",Z)}function hN(Z){if($.object(Z)){if($.defined(Z.depth))if($.string(Z.depth)&&$.inArray(Z.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=Z.depth;else throw $.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",Z.depth)}return this._updateFormatOut("raw")}function uN(Z){if($.object(Z)){if($.defined(Z.size))if($.integer(Z.size)&&$.inRange(Z.size,1,8192))this.options.tileSize=Z.size;else throw $.invalidParameterError("size","integer between 1 and 8192",Z.size);if($.defined(Z.overlap))if($.integer(Z.overlap)&&$.inRange(Z.overlap,0,8192)){if(Z.overlap>this.options.tileSize)throw $.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,Z.overlap);this.options.tileOverlap=Z.overlap}else throw $.invalidParameterError("overlap","integer between 0 and 8192",Z.overlap);if($.defined(Z.container))if($.string(Z.container)&&$.inArray(Z.container,["fs","zip"]))this.options.tileContainer=Z.container;else throw $.invalidParameterError("container","one of: fs, zip",Z.container);if($.defined(Z.layout))if($.string(Z.layout)&&$.inArray(Z.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=Z.layout;else throw $.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",Z.layout);if($.defined(Z.angle))if($.integer(Z.angle)&&!(Z.angle%90))this.options.tileAngle=Z.angle;else throw $.invalidParameterError("angle","positive/negative multiple of 90",Z.angle);if(this._setBackgroundColourOption("tileBackground",Z.background),$.defined(Z.depth))if($.string(Z.depth)&&$.inArray(Z.depth,["onepixel","onetile","one"]))this.options.tileDepth=Z.depth;else throw $.invalidParameterError("depth","one of: onepixel, onetile, one",Z.depth);if($.defined(Z.skipBlanks))if($.integer(Z.skipBlanks)&&$.inRange(Z.skipBlanks,-1,65535))this.options.tileSkipBlanks=Z.skipBlanks;else throw $.invalidParameterError("skipBlanks","integer between -1 and 255/65535",Z.skipBlanks);else if($.defined(Z.layout)&&Z.layout==="google")this.options.tileSkipBlanks=5;let Q=$.bool(Z.center)?Z.center:Z.centre;if($.defined(Q))this._setBooleanOption("tileCentre",Q);if($.defined(Z.id))if($.string(Z.id))this.options.tileId=Z.id;else throw $.invalidParameterError("id","string",Z.id);if($.defined(Z.basename))if($.string(Z.basename))this.options.tileBasename=Z.basename;else throw $.invalidParameterError("basename","string",Z.basename)}if($.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw $.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function mN(Z){if(!$.plainObject(Z))throw $.invalidParameterError("options","object",Z);if($.integer(Z.seconds)&&$.inRange(Z.seconds,0,3600))this.options.timeoutSeconds=Z.seconds;else throw $.invalidParameterError("seconds","integer between 0 and 3600",Z.seconds);return this}function lN(Z,Q){if(!($.object(Q)&&Q.force===!1))this.options.formatOut=Z;return this}function dN(Z,Q){if($.bool(Q))this.options[Z]=Q;else throw $.invalidParameterError(Z,"boolean",Q)}function cN(){if(!this.options.streamOut){this.options.streamOut=!0;let Z=Error();this._pipeline(void 0,Z)}}function pN(Z,Q){if(typeof Z==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),K0.pipeline(this.options,(W,X,J)=>{if(W)Z($.nativeError(W,Q));else Z(null,X,J)})});else K0.pipeline(this.options,(W,X,J)=>{if(W)Z($.nativeError(W,Q));else Z(null,X,J)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),K0.pipeline(this.options,(W,X,J)=>{if(W)this.emit("error",$.nativeError(W,Q));else this.emit("info",J),this.push(X);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else K0.pipeline(this.options,(W,X,J)=>{if(W)this.emit("error",$.nativeError(W,Q));else this.emit("info",J),this.push(X);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((W,X)=>{this.once("finish",()=>{this._flattenBufferIn(),K0.pipeline(this.options,(J,G,Y)=>{if(J)X($.nativeError(J,Q));else if(this.options.resolveWithObject)W({data:G,info:Y});else W(G)})})});else return new Promise((W,X)=>{K0.pipeline(this.options,(J,G,Y)=>{if(J)X($.nativeError(J,Q));else if(this.options.resolveWithObject)W({data:G,info:Y});else W(G)})})}var V$,HN,H$=()=>Error("JP2 output requires libvips with support for OpenJPEG"),B$=(Z)=>1<<31-Math.clz32(Math.ceil(Math.log2(Z))),F$=(Z)=>{Object.assign(Z.prototype,{toFile:BN,toBuffer:FN,toUint8Array:LN,withDensity:AN,keepExif:MN,withExif:IN,withExifMerge:NN,keepIccProfile:DN,withIccProfile:wN,keepGainMap:TN,withGainMap:jN,keepXmp:EN,withXmp:ON,keepMetadata:RN,withMetadata:PN,toFormat:CN,jpeg:SN,jp2:xN,png:kN,webp:_N,tiff:vN,avif:yN,heif:gN,jxl:fN,gif:bN,raw:hN,tile:uN,timeout:mN,_updateFormatOut:lN,_setBooleanOption:dN,_read:cN,_pipeline:pN})};var L$=u(()=>{u4();N9();/*!
244
247
  Copyright 2013 Lovell Fuller and others.
245
248
  SPDX-License-Identifier: Apache-2.0
246
- */az=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"]]),y2=/\.(jp[2x]|j2[kc])$/i});import FN from"node:events";import{createRequire as LN}from"node:module";import{availableParallelism as AN}from"node:os";function X$(Z){if($.bool(Z))if(Z)return q0.cache(50,20,100);else return q0.cache(0,0,0);else if($.object(Z)){for(let X of["memory","files","items"]){let Q=Z[X];if($.defined(Q)&&!($.integer(Q)&&Q>=0))throw $.invalidParameterError(X,"a positive integer",Q)}return q0.cache(Z.memory,Z.files,Z.items)}else return q0.cache()}function IN(Z){return q0.concurrency($.integer(Z)?Z:null)}function DN(){return q0.counters()}function TN(Z){return q0.simd($.bool(Z)?Z:null)}function wN(Z){if($.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every($.string))q0.block(Z.operation,!0);else throw $.invalidParameterError("operation","Array<string>",Z.operation);else throw $.invalidParameterError("options","object",Z)}function jN(Z){if($.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every($.string))q0.block(Z.operation,!1);else throw $.invalidParameterError("operation","Array<string>",Z.operation);else throw $.invalidParameterError("options","object",Z)}var H9,h7,Z$,u7,O6,MN,R1,NN,Q$=(Z)=>{Z.cache=X$,Z.concurrency=IN,Z.counters=DN,Z.simd=TN,Z.format=O6,Z.interpolators=MN,Z.versions=R1,Z.queue=NN,Z.block=wN,Z.unblock=jN};var W$=c(()=>{v4();R7();B9();c8();H9=W1(S8(),1);/*!
249
+ */V$=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"]]),HN=/\.(jp[2x]|j2[kc])$/i});import iN from"node:events";import{createRequire as nN}from"node:module";import{availableParallelism as rN}from"node:os";function M$(Z){if($.bool(Z))if(Z)return K0.cache(50,20,100);else return K0.cache(0,0,0);else if($.object(Z)){for(let Q of["memory","files","items"]){let W=Z[Q];if($.defined(W)&&!($.integer(W)&&W>=0))throw $.invalidParameterError(Q,"a positive integer",W)}return K0.cache(Z.memory,Z.files,Z.items)}else return K0.cache()}function sN(Z){return K0.concurrency($.integer(Z)?Z:null)}function tN(){return K0.counters()}function eN(Z){return K0.simd($.bool(Z)?Z:null)}function ZD(Z){if($.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every($.string))K0.block(Z.operation,!0);else throw $.invalidParameterError("operation","Array<string>",Z.operation);else throw $.invalidParameterError("options","object",Z)}function QD(Z){if($.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every($.string))K0.block(Z.operation,!1);else throw $.invalidParameterError("operation","Array<string>",Z.operation);else throw $.invalidParameterError("options","object",Z)}var D9,t7,A$,e7,k6,aN,_1,oN,I$=(Z)=>{Z.cache=M$,Z.concurrency=sN,Z.counters=tN,Z.simd=eN,Z.format=k6,Z.interpolators=aN,Z.versions=_1,Z.queue=oN,Z.block=ZD,Z.unblock=QD};var N$=u(()=>{u4();u7();N9();e8();D9=$1(h8(),1);/*!
247
250
  Copyright 2013 Lovell Fuller and others.
248
251
  SPDX-License-Identifier: Apache-2.0
249
- */h7=LN(import.meta.url),Z$=p8.runtimePlatformArch(),u7=q0.libvipsVersion(),O6=q0.format();O6.heif.output.alias=["avif","heic"];O6.jpeg.output.alias=["jpe","jpg"];O6.tiff.output.alias=["tif"];O6.jp2.output.alias=["j2c","j2k","jp2","jpx"];MN={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},R1={vips:u7.semver};if(!u7.isGlobal)if(!u7.isWasm)try{R1=h7(`@img/sharp-${Z$}/versions`)}catch(Z){try{R1=h7(`@img/sharp-libvips-${Z$}/versions`)}catch(X){}}else try{R1=h7("@img/sharp-wasm32/versions")}catch(Z){}R1.sharp=Z6.version;if(R1.heif&&O6.heif)O6.heif.input.fileSuffix=[".avif"],O6.heif.output.alias=["avif"];X$(!0);if(!process.env.MALLOC_ARENA_MAX&&H9.default.familySync()===H9.default.GLIBC&&!q0._isUsingJemalloc())q0.concurrency(1);else if(H9.default.familySync()===H9.default.MUSL&&q0.concurrency()===1024)q0.concurrency(AN());NN=new FN.EventEmitter});var m7={};x6(m7,{default:()=>ON});var ON;var l7=c(()=>{Iz();Tz();Pz();Sz();_z();nz();rz();ez();W$();/*!
252
+ */t7=nN(import.meta.url),A$=Z5.runtimePlatformArch(),e7=K0.libvipsVersion(),k6=K0.format();k6.heif.output.alias=["avif","heic"];k6.jpeg.output.alias=["jpe","jpg"];k6.tiff.output.alias=["tif"];k6.jp2.output.alias=["j2c","j2k","jp2","jpx"];aN={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},_1={vips:e7.semver};if(!e7.isGlobal)if(!e7.isWasm)try{_1=t7(`@img/sharp-${A$}/versions`)}catch(Z){try{_1=t7(`@img/sharp-libvips-${A$}/versions`)}catch(Q){}}else try{_1=t7("@img/sharp-wasm32/versions")}catch(Z){}_1.sharp=Y6.version;if(_1.heif&&k6.heif)k6.heif.input.fileSuffix=[".avif"],k6.heif.output.alias=["avif"];M$(!0);if(!process.env.MALLOC_ARENA_MAX&&D9.default.familySync()===D9.default.GLIBC&&!K0._isUsingJemalloc())K0.concurrency(1);else if(D9.default.familySync()===D9.default.MUSL&&K0.concurrency()===1024)K0.concurrency(rN());oN=new iN.EventEmitter});var ZQ={};e4(ZQ,{default:()=>WD});var WD;var QQ=u(()=>{yz();hz();pz();nz();sz();q$();U$();L$();N$();/*!
250
253
  Copyright 2013 Lovell Fuller and others.
251
254
  SPDX-License-Identifier: Apache-2.0
252
- */Dz(u4);Rz(u4);Cz(u4);bz(u4);pz(u4);iz(u4);tz(u4);Q$(u4);ON=u4});import{createHash as J$}from"node:crypto";import{existsSync as EN,mkdirSync as RN,readFileSync as PN}from"node:fs";import{basename as CN,extname as SN,resolve as d7}from"node:path";import{createRequire as kN}from"node:module";async function G$(){if(P1)return P1;try{return P1=(await Promise.resolve().then(() => (l7(),m7))).default,P1}catch{}try{return P1=kN(d7(process.cwd(),"package.json"))("sharp"),P1}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${F6(Z)}`,{cause:Z})}}async function c7(Z){let Q=await(await G$())(Z).metadata();return{format:Q.format??"unknown",height:Q.height??0,width:Q.width??0}}function F9(Z){let X=PN(Z);return J$("md5").update(X).digest("hex").slice(0,8)}function p7(Z){let X=JSON.stringify({formats:Z.formats,quality:Z.quality,widths:Z.widths});return J$("md5").update(X).digest("hex").slice(0,8)}function _N(Z,X,Q,W){return`${Z}-${X}-${Q}.${W}`}async function Y$(Z,X,Q){let W=await G$(),J=await c7(Z),G=F9(Z),Y=CN(Z,SN(Z)),z=d7(X,"_optimized");RN(z,{recursive:!0});let q=[],K=Q.widths.filter((H)=>H<=J.width);if(K.length===0||!K.includes(J.width))K.push(J.width);K.sort((H,F)=>H-F);let V=[];for(let H of K)for(let F of Q.formats){let A=_N(Y,H,G,F),M=`/${bN}/${A}`,I=d7(z,A);if(q.push({absolutePath:I,format:F,outputPath:M,width:H}),EN(I))continue;let N=Q.quality[F]??80,T=W(Z).resize(H).toFormat(F,{quality:N}).toFile(I).then(()=>{});V.push(T)}let B=4;for(let H=0;H<V.length;H+=B)await Promise.all(V.slice(H,H+B));return{contentHash:G,original:{format:J.format,height:J.height,width:J.width},variants:q}}function n7(Z,X){return Z.filter((Q)=>Q.format===X).map((Q)=>`${Q.outputPath} ${Q.width}w`).join(", ")}var P1=null,bN="images/_optimized";var i7=c(()=>{A6()});import{existsSync as xN,mkdirSync as vN,readFileSync as yN,writeFileSync as gN}from"node:fs";import{basename as fN,resolve as a8}from"node:path";import{execSync as hN}from"node:child_process";import{tmpdir as uN}from"node:os";function C1(Z){if(L9===void 0)try{let X=hN("npm config get cache",{cwd:uN(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();L9=X&&X!=="undefined"?X:null}catch{L9=null}if(L9)return a8(L9,"jxsuite-images",fN(Z));return a8(Z,".cache/images")}function z$(Z){let X=a8(C1(Z),"manifest.json");if(!xN(X))return{entries:{},version:1};try{return JSON.parse(yN(X,"utf8"))}catch{return{entries:{},version:1}}}function $$(Z,X){let Q=C1(Z);vN(Q,{recursive:!0}),gN(a8(Q,"manifest.json"),JSON.stringify(X,null,2),"utf8")}function q$(Z,X){let Q=Z.entries[X];if(!Q)return null;return Q.manifest}function K$(Z,X,Q,W){Z.entries[X]={manifest:W,source:Q,timestamp:Date.now()}}var L9;var r7=c(()=>{i7()});import{existsSync as a7}from"node:fs";import{basename as mN,extname as B$,resolve as U$}from"node:path";async function F$(Z,X){let Q=X.get(Z);if(!Q){let W=F9(Z);try{let J=await c7(Z);Q={width:J.width,height:J.height,hash:W}}catch(J){if(!V$)V$=!0,console.warn(`Could not read image dimensions (${J.message}) — `+"emitting srcsets without width/height attributes.");Q={width:null,height:null,hash:W}}X.set(Z,Q)}return Q}function s8(Z,X,Q,W){let J=X.quality?.webp??80,G=Z.startsWith("/")?"":"/",Y=W?`?v=${W}`:"";return X.widths.filter((z)=>z<=Q).toSorted((z,q)=>z-q).map((z)=>`/cdn-cgi/image/width=${z},quality=${J},fit=scale-down,format=auto${G}${Z}${Y} ${z}w`).join(", ")}async function L$(Z,X,Q,W,J){let G=`${F9(Z)}:${p7(Q)}`,Y=q$(J,G);if(Y){if(Y.variants.every((K)=>a7(K.absolutePath)))return Y}if(!Y)console.log(` Optimizing ${mN(Z)}...`);let z=await Y$(Z,C1(W),Q);return K$(J,G,X,z),z}function A$(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(lN.some((X)=>Z.startsWith(X)))return!0;if(H$.has(B$(Z).toLowerCase()))return!0;return!1}function M$(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(H$.has(B$(Q.pathname).toLowerCase()))return!1;return X.remoteDomains.includes(Q.hostname)}catch{return!1}}function I$(Z,X){if(Z.startsWith("/"))return U$(X,"public",Z.slice(1));return U$(X,Z)}async function N$(Z,X,Q,W,J){let G=new Map;if(!X.optimize)return{imageRefs:G};return await D$(Z,X,Q,W,J??new Map,G),{imageRefs:G}}async function D$(Z,X,Q,W,J,G){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await dN(Z,X,Q,W,J,G);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await rN(Z.innerHTML,X,Q,W,J,G);if(Array.isArray(Z.children))for(let Y of Z.children){if(typeof Y==="string")continue;await D$(Y,X,Q,W,J,G)}}async function dN(Z,X,Q,W,J,G){if(!Z.attributes)Z.attributes={};let Y=Z.attributes.src??Z.src;if(typeof Y!=="string")return;let z=M$(Y,X);if(!z&&A$(Y))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let q;if(z)q=s8(Y,X,1/0,null);else{let K=I$(Y,Q);if(!a7(K))return;if(X.service==="cloudflare"){let V=await F$(K,J);q=s8(Y,X,V.width??1/0,V.hash)}else{let V=G.get(K);if(!V)V=await L$(K,Y,X,Q,W),G.set(K,V);let B=X.formats.includes("avif")?"avif":X.formats[0];q=n7(V.variants,B)}}if(q)Z.attributes.srcset=q,Z.attributes.sizes??=X.sizes;if(X.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function rN(Z,X,Q,W,J,G){let Y=[];for(let q of Z.matchAll(cN)){let K=q[0],V=q[1];if(nN.test(V))continue;if(iN.test(V))continue;let B=V.match(pN);if(!B)continue;let H=B[1].replaceAll("&amp;","&"),F=M$(H,X);if(!F&&A$(H))continue;let A=F?null:I$(H,Q);if(A&&!a7(A))continue;let M;if(F)M=s8(H,X,1/0,null);else if(X.service==="cloudflare"){let N=await F$(A,J);M=s8(H,X,N.width??1/0,N.hash)}else{let N=G.get(A);if(!N)N=await L$(A,H,X,Q,W),G.set(A,N);let T=X.formats.includes("avif")?"avif":X.formats[0];M=n7(N.variants,T)}if(!M)continue;let I=` srcset="${M}" sizes="${X.sizes}"`;if(X.lazyLoad&&!/\bloading="eager"/.test(V)){if(!/\bloading=/.test(V))I+=' loading="lazy"';if(!/\bdecoding=/.test(V))I+=' decoding="async"'}Y.push({match:K,replacement:`<img${V}${I}>`})}let z=Z;for(let{match:q,replacement:K}of Y)z=z.replace(q,K);return z}var H$,lN,V$=!1,cN,pN,nN,iN;var T$=c(()=>{i7();r7();H$=new Set([".svg",".gif"]),lN=["http://","https://","data:","//"];cN=/<img\b([^>]*)>/gi,pN=/\bsrc="([^"]*)"/,nN=/\bsrcset="/,iN=/\bdata-no-optimize\b/});var R$={};x6(R$,{buildSite:()=>XD});import{copyFileSync as aN,cpSync as s7,existsSync as p6,mkdirSync as E6,readFileSync as sN,readdirSync as oN,rmSync as tN,statSync as eN,writeFileSync as L4}from"node:fs";import{basename as ZD,dirname as S1,join as k1,resolve as k0}from"node:path";async function XD(Z,X={}){let{clean:Q=!0,verbose:W=!1}=X,J=[],G=W?console.log.bind(console):()=>{};G("Loading project.json...");let{config:Y}=A1(Z);if("contentTypes"in Y)throw Error('project.json declares "contentTypes", which is no longer supported. Run `bun scripts/migrate-project-extensions.ts <project>` to migrate to "extensions" + "content", then `jx schema`.');let z=k0(Z,Y.build.outDir),q=k0(Z,"pages"),K=k0(Z,"public"),V=Y.build.trailingSlash??"always",B=await M6(Z,Y),H=B.formats;if(H.entries.length>0)G(` Registered ${H.entries.length} format(s): ${H.entries.map((r)=>r.name).join(", ")}`);let F=B.serverMounts().filter((r)=>{if(!r.project)return!0;let Q0=Y[r.project.key];return Q0!==void 0&&typeof Q0==="object"&&Object.keys(Q0).length>0});if(F.length>0&&!Y.build.adapter){let r=F.map((Q0)=>Q0.project?`"${Q0.project.key}"`:`"${Q0.server.basePath}"`).join(", ");throw Error(`project.json declares dynamic section(s) ${r} served by extension mounts, but `+'build.adapter is "static". Dynamic tables need a server-capable adapter — set '+'build.adapter to "cloudflare-workers", "cloudflare-pages", "node", or "bun".')}if(Q&&p6(z))tN(z,{force:!0,recursive:!0});if(E6(z,{recursive:!0}),!p6(q))throw Error(`pages/ directory not found in ${Z}`);G("Discovering pages...");let A=await xJ(q,H);G(` Found ${A.length} page(s)`),G("Loading project sections...");let M=await fJ(Z,Y,B),I=Object.keys(M);if(I.length>0)G(` Loaded ${I.length} section(s): ${I.join(", ")}`);let N=await yJ(A,Z,M,B,Y);G(` ${N.length} route(s) after expansion`);let T=0,S=k0(Z,"components"),v=[],x=new Map,p=new Map;if(p6(S)){G("Compiling components...");let r=[".json",...H.documentExtensions("component")],Q0=oN(S).filter((U0)=>r.some((R0)=>U0.endsWith(R0))),g=k0(z,"components");E6(g,{recursive:!0});for(let U0 of Q0)try{let R0=k0(S,U0),M0=await w8(R0,{...Y.$media?{$media:Y.$media}:{},formats:H});for(let H0 of M0.files){let q4=ZD(H0.path);if(L4(k0(g,q4),H0.content,"utf8"),H0.tagName)v.push(H0.tagName);T+=1}let J0=await J9(R0,H);if(J0.tagName){p.set(J0.tagName,J0);let H0=IQ(J0.tagName,J0.style,J0,Y.$media??{});if(H0)x.set(J0.tagName,H0),L4(k0(g,`${J0.tagName}.css`),H0,"utf8"),T+=1}}catch(R0){let M0=R0;J.push(`Error compiling component ${U0}: ${M0.message}`),console.error(`Error compiling component ${U0}: ${M0.message}`)}G(` Compiled ${v.length} component(s): ${v.join(", ")}`)}let f=[];if(Y.build.adapter)for(let[,r]of p){let Q0=X8(r);for(let g of Q0){let U0=`./components/${g.src.replace(/^\.\//,"")}`;f.push({exportName:g.exportName,src:U0})}}let s=Y.images.optimize&&Y.images.service==="cloudflare",K0=Y.images.optimize&&!s?z$(Z):null,E0=s?new Map:null;if(s)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.");let f0=Y.url,N4=Boolean(f0)&&Y.build.sitemap!==!1,$4=[];for(let r of N)try{G(` Compiling ${r.urlPattern} ...`);let Q0=await QD(r,Y,Z,M,K0,p,E0,H,B),g=new Set;for(let[M0,J0]of p)if(e5(J0))g.add(M0);if(v.length>0)Q0.html=YD(Q0.html,v,x,g);let U0=E$(r.urlPattern,z,V);E6(S1(U0),{recursive:!0}),L4(U0,Q0.html,"utf8"),T+=1;let R0=!r.urlPattern.includes(":")&&!r.urlPattern.includes("*");if(N4&&!Q0.excludeFromSitemap&&R0)$4.push({lastmod:eN(r.sourcePath).mtime,loc:new URL(r.urlPattern,f0).href});for(let M0 of H.withCapability("serialize")){if(!M0.exportTarget)continue;try{let J0=await M0.call("serialize",Q0.doc,{buildScope:(H0)=>K1(H0,null),componentDefs:p,evaluateTemplate:(H0,q4)=>{if(!e(H0))return;return l0(H0,q4)??H0},mode:"export"});if(J0){let H0=U0.replace(/\.html$/,M0.extensions[0]);L4(H0,J0,"utf8"),T+=1}}catch(J0){let H0=J0;J.push(`Error exporting ${M0.name} for ${r.urlPattern}: ${H0.message}`)}}for(let M0 of Q0.files){let J0=k0(S1(U0),M0.path);E6(S1(J0),{recursive:!0}),L4(J0,M0.content,"utf8"),T+=1}if(Q0.serverHandler){let M0=k0(S1(U0),"_server.js");L4(M0,Q0.serverHandler,"utf8"),T+=1}}catch(Q0){let g=Q0,U0=`Error compiling ${r.urlPattern}: ${g.message}`;J.push(U0),console.error(U0)}if(K0&&Y.images.optimize){$$(Z,K0);let r=k0(C1(Z),"_optimized");if(p6(r)){let g=k0(z,"images/_optimized");E6(g,{recursive:!0}),s7(r,g,{recursive:!0})}let Q0=Object.keys(K0.entries).length;if(Q0>0)G(` Optimized ${Q0} image(s)`)}if(Y.build.adapter){let{adapter:r}=Y.build;G("Generating site-wide server worker...");let Q0=new Map;for(let J0 of f)if(!Q0.has(J0.exportName))Q0.set(J0.exportName,J0);let{mounts:g,connectors:U0}=WD(F,B,Y);if(g.length>0)G(` Mounting ${g.length} extension route(s): ${g.map((J0)=>J0.basePath).join(", ")}`);let M0=r==="cloudflare-pages"&&Q0.size===0&&g.length===0?null:lZ([...Q0.values()],{adapter:r,connectors:U0,mounts:g});if(M0){let J0=r==="cloudflare-pages"?"_worker.js":"worker.js";if(L4(k0(z,J0),M0,"utf8"),T+=1,G(` Generated dist/${J0} (${Q0.size} server function(s))`),r==="cloudflare-pages")L4(k0(z,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
253
- `,"utf8"),T+=1;let H0=k0(z,"components");E6(H0,{recursive:!0});for(let{src:q4}of Q0.values()){let d4=k0(Z,q4.replace(/^\.\//,"")),Z1=k0(H0,q4.replace(/^\.\/components\//,""));if(p6(d4))aN(d4,Z1)}}}if(Y.redirects&&Object.keys(Y.redirects).length>0){G("Generating redirects...");let r=qD(Y.redirects,z);T+=r}if(N4)G(`Generating sitemap (${$4.length} URL(s))...`),T+=VD($4,z);else if(!f0&&Y.build.sitemap!==!1)console.warn("sitemap.xml skipped — set `url` in project.json to enable sitemap generation.");if(p6(K))G("Copying public/ assets..."),s7(K,z,{recursive:!0});if(N4)T+=BD(z,f0);if(Y.copy){G("Copying mapped files...");for(let[r,Q0]of Object.entries(Y.copy)){let g=k0(Z,r),U0=k0(z,Q0);E6(S1(U0),{recursive:!0}),s7(g,U0)}}if(G(`
254
- Build complete: ${N.length} routes, ${T} files`),J.length>0)G(` ${J.length} error(s)`);return{errors:J,files:T,routes:N.length}}async function QD(Z,X,Q,W={},J=null,G=new Map,Y=null,z,q){let K=await J9(Z.sourcePath,z),V=J7(K,X,Q),B=K.$head??V._pageHead??[],H=V.$head??[],F=K.title??V._pageTitle??null;delete V._pageHead,delete V._pageTitle,cJ(V,X,Z,Q),await nJ(V,Z,Q,{config:X,sections:W,...q===void 0?{}:{registry:q}});let A=K1(V.state??{}),M=F??X.name??"Jx Site";if(typeof M==="string"&&e(M))M=l0(M,A)??M;let I=w$(B,A),N=w$(H,A);A9(V,A);let T={counter:{n:0},media:{...X.$media,...V.$media},rules:[]};if(t7(V,G,T),V.state)for(let[s,K0]of Object.entries(V.state)){if(s==="$site"||s==="$page")continue;if(K0&&typeof K0==="object"&&!Array.isArray(K0)&&K0.timing==="compiler")delete V.state[s];else if(Array.isArray(K0))delete V.state[s]}let S=JD(X.$head??[]),v=lJ(S,N,I,{title:M,charset:X.defaults?.charset??"utf8",...X.name!=null&&{siteName:X.name},...X.url!=null&&{siteUrl:X.url},pageUrl:Z.urlPattern});if(X.$media)V.$media={...X.$media,...V.$media};if(X.images?.optimize&&(J||Y))await N$(V,X.images,Q,J,Y??void 0);let x=await X7(V,{lang:X.defaults?.lang??"en",projectStyle:X.style??null,title:M});if(T.rules.length>0)x.html=x.html.replace("</head>",`<style>
255
- ${T.rules.join(`
255
+ */fz(p4);cz(p4);iz(p4);az(p4);$$(p4);K$(p4);F$(p4);I$(p4);WD=p4});import{createHash as D$}from"node:crypto";import{existsSync as XD,mkdirSync as JD,readFileSync as GD}from"node:fs";import{basename as YD,extname as zD,resolve as WQ}from"node:path";import{createRequire as $D}from"node:module";async function w$(){if(b1)return b1;try{return b1=(await Promise.resolve().then(() => (QQ(),ZQ))).default,b1}catch{}try{return b1=$D(WQ(process.cwd(),"package.json"))("sharp"),b1}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${D6(Z)}`,{cause:Z})}}async function XQ(Z){let W=await(await w$())(Z).metadata();return{format:W.format??"unknown",height:W.height??0,width:W.width??0}}function w9(Z){let Q=GD(Z);return D$("md5").update(Q).digest("hex").slice(0,8)}function JQ(Z){let Q=JSON.stringify({formats:Z.formats,quality:Z.quality,widths:Z.widths});return D$("md5").update(Q).digest("hex").slice(0,8)}function KD(Z,Q,W,X){return`${Z}-${Q}-${W}.${X}`}async function T$(Z,Q,W){let X=await w$(),J=await XQ(Z),G=w9(Z),Y=YD(Z,zD(Z)),z=WQ(Q,"_optimized");JD(z,{recursive:!0});let q=[],K=W.widths.filter((B)=>B<=J.width);if(K.length===0||!K.includes(J.width))K.push(J.width);K.sort((B,F)=>B-F);let V=[];for(let B of K)for(let F of W.formats){let A=KD(Y,B,G,F),M=`/${qD}/${A}`,I=WQ(z,A);if(q.push({absolutePath:I,format:F,outputPath:M,width:B}),XD(I))continue;let N=W.quality[F]??80,D=X(Z).resize(B).toFormat(F,{quality:N}).toFile(I).then(()=>{});V.push(D)}let H=4;for(let B=0;B<V.length;B+=H)await Promise.all(V.slice(B,B+H));return{contentHash:G,original:{format:J.format,height:J.height,width:J.width},variants:q}}function GQ(Z,Q){return Z.filter((W)=>W.format===Q).map((W)=>`${W.outputPath} ${W.width}w`).join(", ")}var b1=null,qD="images/_optimized";var YQ=u(()=>{T6()});import{existsSync as UD,mkdirSync as VD,readFileSync as HD,rmSync as BD,writeFileSync as FD}from"node:fs";import{basename as LD,resolve as J5}from"node:path";import{execSync as AD}from"node:child_process";import{tmpdir as MD}from"node:os";function x1(Z){if(T9===void 0)try{let Q=AD("npm config get cache",{cwd:MD(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();T9=Q&&Q!=="undefined"?Q:null}catch{T9=null}if(T9)return J5(T9,"jxsuite-images",LD(Z));return J5(Z,".cache/images")}function j$(Z){let Q=J5(x1(Z),"manifest.json");if(!UD(Q))return{entries:{},touched:new Set,version:1};try{let W=JSON.parse(HD(Q,"utf8"));return W.touched=new Set,W}catch{return{entries:{},touched:new Set,version:1}}}function E$(Z,Q,W={}){if(W.prune&&Q.touched)ID(Q,Q.touched);let X=x1(Z);VD(X,{recursive:!0}),FD(J5(X,"manifest.json"),JSON.stringify({entries:Q.entries,version:Q.version},null,2),"utf8")}function ID(Z,Q){let W=new Set;for(let[X,J]of Object.entries(Z.entries))if(Q.has(X))for(let G of J.manifest.variants??[])W.add(G.absolutePath);for(let[X,J]of Object.entries(Z.entries)){if(Q.has(X))continue;for(let G of J.manifest.variants??[])if(!W.has(G.absolutePath))BD(G.absolutePath,{force:!0});delete Z.entries[X]}}function O$(Z,Q){Z.touched?.add(Q);let W=Z.entries[Q];if(!W)return null;return W.manifest}function R$(Z,Q,W,X){Z.touched?.add(Q),Z.entries[Q]={manifest:X,source:W,timestamp:Date.now()}}var T9;var zQ=u(()=>{YQ()});import{existsSync as $Q}from"node:fs";import{basename as ND,extname as S$,resolve as P$}from"node:path";async function _$(Z,Q){let W=Q.get(Z);if(!W){let X=w9(Z);try{let J=await XQ(Z);W={width:J.width,height:J.height,hash:X}}catch(J){if(!C$)C$=!0,console.warn(`Could not read image dimensions (${J.message}) — `+"emitting srcsets without width/height attributes.");W={width:null,height:null,hash:X}}Q.set(Z,W)}return W}function G5(Z,Q,W,X){let J=Q.quality?.webp??80,G=Z.startsWith("/")?"":"/",Y=X?`?v=${X}`:"";return Q.widths.filter((z)=>z<=W).toSorted((z,q)=>z-q).map((z)=>`/cdn-cgi/image/width=${z},quality=${J},fit=scale-down,format=auto${G}${Z}${Y} ${z}w`).join(", ")}async function b$(Z,Q,W,X,J){let G=`${w9(Z)}:${JQ(W)}`,Y=O$(J,G);if(Y){if(Y.variants.every((K)=>$Q(K.absolutePath)))return Y}if(!Y)console.log(` Optimizing ${ND(Z)}...`);let z=await T$(Z,x1(X),W);return R$(J,G,Q,z),z}function x$(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(DD.some((Q)=>Z.startsWith(Q)))return!0;if(k$.has(S$(Z).toLowerCase()))return!0;return!1}function v$(Z,Q){if(Q.service!=="cloudflare")return!1;if(!Q.remoteDomains?.length)return!1;if(typeof Z!=="string"||!Z.startsWith("https://"))return!1;if(Z.includes("${"))return!1;try{let W=new URL(Z);if(k$.has(S$(W.pathname).toLowerCase()))return!1;return Q.remoteDomains.includes(W.hostname)}catch{return!1}}function y$(Z,Q){if(Z.startsWith("/"))return P$(Q,"public",Z.slice(1));return P$(Q,Z)}async function g$(Z,Q,W,X,J){let G=new Map;if(!Q.optimize)return{imageRefs:G};return await f$(Z,Q,W,X,J??new Map,G),{imageRefs:G}}async function f$(Z,Q,W,X,J,G){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await wD(Z,Q,W,X,J,G);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await RD(Z.innerHTML,Q,W,X,J,G);if(Array.isArray(Z.children))for(let Y of Z.children){if(typeof Y==="string")continue;await f$(Y,Q,W,X,J,G)}}async function wD(Z,Q,W,X,J,G){if(!Z.attributes)Z.attributes={};let Y=Z.attributes.src??Z.src;if(typeof Y!=="string")return;let z=v$(Y,Q);if(!z&&x$(Y))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let q,K=null;if(z)q=G5(Y,Q,1/0,null);else{let V=y$(Y,W);if(!$Q(V))return;if(Q.service==="cloudflare"){let H=await _$(V,J);q=G5(Y,Q,H.width??1/0,H.hash),K=H.width&&H.height?{height:H.height,width:H.width}:null}else{let H=G.get(V);if(!H)H=await b$(V,Y,Q,W,X),G.set(V,H);let B=Q.formats.includes("avif")?"avif":Q.formats[0];q=GQ(H.variants,B),K=H.original?.width&&H.original.height?{height:H.original.height,width:H.original.width}:null}}if(q)Z.attributes.srcset=q,Z.attributes.sizes??=Q.sizes;if(K&&Z.attributes.width===void 0&&Z.attributes.height===void 0)Z.attributes.width=String(K.width),Z.attributes.height=String(K.height);if(Q.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function RD(Z,Q,W,X,J,G){let Y=[];for(let q of Z.matchAll(TD)){let K=q[0],V=q[1];if(ED.test(V))continue;if(OD.test(V))continue;let H=V.match(jD);if(!H)continue;let B=H[1].replaceAll("&amp;","&"),F=v$(B,Q);if(!F&&x$(B))continue;let A=F?null:y$(B,W);if(A&&!$Q(A))continue;let M,I=null;if(F)M=G5(B,Q,1/0,null);else if(Q.service==="cloudflare"){let D=await _$(A,J);M=G5(B,Q,D.width??1/0,D.hash),I=D.width&&D.height?{height:D.height,width:D.width}:null}else{let D=G.get(A);if(!D)D=await b$(A,B,Q,W,X),G.set(A,D);let P=Q.formats.includes("avif")?"avif":Q.formats[0];M=GQ(D.variants,P),I=D.original?.width&&D.original.height?{height:D.original.height,width:D.original.width}:null}if(!M)continue;let N=` srcset="${M}" sizes="${Q.sizes}"`;if(I&&!/\bwidth=/.test(V)&&!/\bheight=/.test(V))N+=` width="${I.width}" height="${I.height}"`;if(Q.lazyLoad&&!/\bloading="eager"/.test(V)){if(!/\bloading=/.test(V))N+=' loading="lazy"';if(!/\bdecoding=/.test(V))N+=' decoding="async"'}Y.push({match:K,replacement:`<img${V}${N}>`})}let z=Z;for(let{match:q,replacement:K}of Y)z=z.replace(q,K);return z}var k$,DD,C$=!1,TD,jD,ED,OD;var h$=u(()=>{YQ();zQ();k$=new Set([".svg",".gif"]),DD=["http://","https://","data:","//"];TD=/<img\b([^>]*)>/gi,jD=/\bsrc="([^"]*)"/,ED=/\bsrcset="/,OD=/\bdata-no-optimize\b/});var c$={};e4(c$,{buildSite:()=>xD});import{copyFileSync as PD,cpSync as qQ,existsSync as s6,mkdirSync as _6,readFileSync as CD,readdirSync as SD,rmSync as kD,statSync as _D,writeFileSync as D4}from"node:fs";import{basename as bD,dirname as v1,join as y1,resolve as x0}from"node:path";async function xD(Z,Q={}){let{clean:W=!0,verbose:X=!1}=Q,J=[],G=X?console.log.bind(console):()=>{};G("Loading project.json...");let{config:Y}=w1(Z);if("contentTypes"in Y)throw Error('project.json declares "contentTypes", which is no longer supported. Run `bun scripts/migrate-project-extensions.ts <project>` to migrate to "extensions" + "content", then `jx schema`.');let z=x0(Z,Y.build.outDir),q=x0(Z,"pages"),K=x0(Z,"public"),V=Y.build.trailingSlash??"always",H=await j6(Z,Y),B=H.formats;if(B.entries.length>0)G(` Registered ${B.entries.length} format(s): ${B.entries.map((r)=>r.name).join(", ")}`);let F=H.serverMounts().filter((r)=>{if(!r.project)return!0;let Q0=Y[r.project.key];return Q0!==void 0&&typeof Q0==="object"&&Object.keys(Q0).length>0});if(F.length>0&&!Y.build.adapter){let r=F.map((Q0)=>Q0.project?`"${Q0.project.key}"`:`"${Q0.server.basePath}"`).join(", ");throw Error(`project.json declares dynamic section(s) ${r} served by extension mounts, but `+'build.adapter is "static". Dynamic tables need a server-capable adapter — set '+'build.adapter to "cloudflare-workers", "cloudflare-pages", "node", or "bun".')}if(W&&s6(z))kD(z,{force:!0,recursive:!0});if(_6(z,{recursive:!0}),!s6(q))throw Error(`pages/ directory not found in ${Z}`);G("Discovering pages...");let A=await oJ(q,B);G(` Found ${A.length} page(s)`),G("Loading project sections...");let M=await QG(Z,Y,H),I=Object.keys(M);if(I.length>0)G(` Loaded ${I.length} section(s): ${I.join(", ")}`);let N=await eJ(A,Z,M,H,Y);G(` ${N.length} route(s) after expansion`);let D=0,P=x0(Z,"components"),v=[],x=new Map,p=new Map;if(s6(P)){G("Compiling components...");let r=[".json",...B.documentExtensions("component")],Q0=SD(P).filter((U0)=>r.some((S0)=>U0.endsWith(S0))),g=x0(z,"components");_6(g,{recursive:!0});for(let U0 of Q0)try{let S0=x0(P,U0),N0=await _8(S0,{...Y.$media?{$media:Y.$media}:{},formats:B});for(let F0 of N0.files){let B4=bD(F0.path);if(D4(x0(g,B4),F0.content,"utf8"),F0.tagName)v.push(F0.tagName);D+=1}let G0=await U9(S0,B);if(G0.tagName){p.set(G0.tagName,G0);let F0=yW(G0.tagName,G0.style,G0,Y.$media??{});if(F0)x.set(G0.tagName,F0),D4(x0(g,`${G0.tagName}.css`),F0,"utf8"),D+=1}}catch(S0){let N0=S0;J.push(`Error compiling component ${U0}: ${N0.message}`),console.error(`Error compiling component ${U0}: ${N0.message}`)}G(` Compiled ${v.length} component(s): ${v.join(", ")}`)}let f=[];if(Y.build.adapter)for(let[,r]of p){let Q0=K8(r);for(let g of Q0){let U0=`./components/${g.src.replace(/^\.\//,"")}`;f.push({exportName:g.exportName,src:U0})}}let s=Y.images.optimize&&Y.images.service==="cloudflare",J0=Y.images.optimize&&!s?j$(Z):null,C0=s?new Map:null;if(s)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.");let m0=Y.url,E4=Boolean(m0)&&Y.build.sitemap!==!1,H4=[];for(let r of N)try{G(` Compiling ${r.urlPattern} ...`);let Q0=await vD(r,Y,Z,M,J0,p,C0,B,H),g=new Set;for(let[N0,G0]of p)if(VZ(G0))g.add(N0);if(v.length>0)Q0.html=hD(Q0.html,v,x,g);let U0=d$(r.urlPattern,z,V);_6(v1(U0),{recursive:!0}),D4(U0,Q0.html,"utf8"),D+=1;let S0=!r.urlPattern.includes(":")&&!r.urlPattern.includes("*");if(E4&&!Q0.excludeFromSitemap&&S0)H4.push({lastmod:_D(r.sourcePath).mtime,loc:new URL(r.urlPattern,m0).href});for(let N0 of B.withCapability("serialize")){if(!N0.exportTarget)continue;try{let G0=await N0.call("serialize",Q0.doc,{buildScope:(F0)=>F1(F0,null),componentDefs:p,evaluateTemplate:(F0,B4)=>{if(!e(F0))return;return i0(F0,B4)??F0},mode:"export"});if(G0){let F0=U0.replace(/\.html$/,N0.extensions[0]);D4(F0,G0,"utf8"),D+=1}}catch(G0){let F0=G0;J.push(`Error exporting ${N0.name} for ${r.urlPattern}: ${F0.message}`)}}for(let N0 of Q0.files){let G0=x0(v1(U0),N0.path);_6(v1(G0),{recursive:!0}),D4(G0,N0.content,"utf8"),D+=1}if(Q0.serverHandler){let N0=x0(v1(U0),"_server.js");D4(N0,Q0.serverHandler,"utf8"),D+=1}}catch(Q0){let g=Q0,U0=`Error compiling ${r.urlPattern}: ${g.message}`;J.push(U0),console.error(U0)}if(J0&&Y.images.optimize){E$(Z,J0,{prune:J.length===0});let r=x0(x1(Z),"_optimized");if(s6(r)){let g=x0(z,"images/_optimized");_6(g,{recursive:!0}),qQ(r,g,{recursive:!0})}let Q0=Object.keys(J0.entries).length;if(Q0>0)G(` Optimized ${Q0} image(s)`)}if(Y.build.adapter){let{adapter:r}=Y.build;G("Generating site-wide server worker...");let Q0=new Map;for(let G0 of f)if(!Q0.has(G0.exportName))Q0.set(G0.exportName,G0);let{mounts:g,connectors:U0}=yD(F,H,Y);if(g.length>0)G(` Mounting ${g.length} extension route(s): ${g.map((G0)=>G0.basePath).join(", ")}`);let N0=r==="cloudflare-pages"&&Q0.size===0&&g.length===0?null:Q7([...Q0.values()],{adapter:r,connectors:U0,mounts:g});if(N0){let G0=r==="cloudflare-pages"?"_worker.js":"worker.js";if(D4(x0(z,G0),N0,"utf8"),D+=1,G(` Generated dist/${G0} (${Q0.size} server function(s))`),r==="cloudflare-pages")D4(x0(z,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
256
+ `,"utf8"),D+=1;let F0=x0(z,"components");_6(F0,{recursive:!0});for(let{src:B4}of Q0.values()){let r4=x0(Z,B4.replace(/^\.\//,"")),G1=x0(F0,B4.replace(/^\.\/components\//,""));if(s6(r4))PD(r4,G1)}}}if(Y.redirects&&Object.keys(Y.redirects).length>0){G("Generating redirects...");let r=new Set(N.map((g)=>g.urlPattern)),Q0=lD(Y.redirects,z,r);D+=Q0}if(E4)G(`Generating sitemap (${H4.length} URL(s))...`),D+=pD(H4,z);else if(!m0&&Y.build.sitemap!==!1)console.warn("sitemap.xml skipped — set `url` in project.json to enable sitemap generation.");if(s6(K))G("Copying public/ assets..."),qQ(K,z,{recursive:!0});if(E4)D+=iD(z,m0);if(Y.copy){G("Copying mapped files...");for(let[r,Q0]of Object.entries(Y.copy)){let g=x0(Z,r),U0=x0(z,Q0);_6(v1(U0),{recursive:!0}),qQ(g,U0)}}if(G(`
257
+ Build complete: ${N.length} routes, ${D} files`),J.length>0)G(` ${J.length} error(s)`);return{errors:J,files:D,routes:N.length}}async function vD(Z,Q,W,X={},J=null,G=new Map,Y=null,z,q){let K=await U9(Z.sourcePath,z),V=A7(K,Q,W),H=K.$head??V._pageHead??[],B=V.$head??[],F=K.title??V._pageTitle??null;delete V._pageHead,delete V._pageTitle,zG(V,Q,Z,W),await qG(V,Z,W,{config:Q,sections:X,...q===void 0?{}:{registry:q}});let A=F1(V.state??{}),M=F??Q.name??"Jx Site";if(typeof M==="string"&&e(M))M=i0(M,A)??M;let I=u$(H,A),N=u$(B,A);j9(V,A);let D={counter:{n:0},media:{...Q.$media,...V.$media},rules:[]};if(UQ(V,G,D),V.state)for(let[s,J0]of Object.entries(V.state)){if(s==="$site"||s==="$page")continue;if(J0&&typeof J0==="object"&&!Array.isArray(J0)&&J0.timing==="compiler")delete V.state[s];else if(Array.isArray(J0))delete V.state[s]}let P=gD(Q.$head??[]),v=GG(P,N,I,{title:M,charset:Q.defaults?.charset??"utf8",...Q.name!=null&&{siteName:Q.name},...Q.url!=null&&{siteUrl:Q.url},pageUrl:Z.urlPattern});if(Q.$media)V.$media={...Q.$media,...V.$media};if(Q.images?.optimize&&(J||Y))await g$(V,Q.images,W,J,Y??void 0);let x=await B7(V,{lang:Q.defaults?.lang??"en",projectStyle:Q.style??null,title:M});if(D.rules.length>0)x.html=x.html.replace("</head>",`<style>
258
+ ${D.rules.join(`
256
259
  `)}
257
260
  </style>
258
- </head>`);x.html=$D(x.html,v,X.defaults?.lang??"en");let p=(V.$elements??[]).filter((s)=>typeof s==="string"&&!s.startsWith("./")&&!s.startsWith("../"));if(p.length>0)x.html=zD(x.html,p);let f=null;if(!X.build?.adapter)try{let s=await X9(Z.sourcePath);if(s)f=s}catch{}return{doc:V,excludeFromSitemap:K.$sitemap===!1,files:x.files,html:x.html,serverHandler:f}}function WD(Z,X,Q){if(Z.length===0)return{connectors:[],mounts:[]};let W={};for(let z of X.projectContributions()){let{key:q}=z.project;if(q in Q)W[q]=Q[q]}let J=Z.map((z)=>{let q=z.server,{module:K}=q;if(typeof K!=="string"||K==="")throw Error(`Extension class "${z.name}": server.module (a bare import specifier) is required to generate a deployable worker`);return{basePath:q.basePath,className:z.classDef.title??z.name,module:K,options:{basePath:q.basePath,sections:W},order:q.order??100}}),G=new Set;for(let z of Object.values(W)){if(!z||typeof z!=="object"||Array.isArray(z))continue;for(let q of Object.values(z)){let K=q?.provider;if(typeof K==="string")G.add(K)}}let Y=[];for(let z of X.connectors()){let q=String(z.connector.provider);if(!G.has(q))continue;let{module:K}=z.connector;if(typeof K!=="string"||K==="")throw Error(`Connector class "${z.name}": connector.module (a bare import specifier) is required to generate a deployable worker`);Y.push({className:z.classDef.title??z.name,module:K,provider:q})}return{connectors:Y,mounts:J}}function w$(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[J,G]of Object.entries(W.attributes))if(typeof G==="string"&&e(G))W.attributes[J]=l0(G,X)??G}if(typeof W.textContent==="string"&&e(W.textContent))W.textContent=l0(W.textContent,X)??W.textContent;return W})}function JD(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 J=Q.attributes[W];if(typeof J==="string"&&GD(J))Q.attributes[W]=`/node_modules/${J}`}return Q})}function GD(Z){return!Z.startsWith("/")&&!Z.startsWith("./")&&!Z.startsWith("../")&&!Z.startsWith("http")&&!Z.startsWith("data:")}function O$(Z,X){if(!Z||typeof Z!=="object")return Z;let Q={};for(let[W,J]of Object.entries(Z))if(W==="children"&&Array.isArray(J))Q.children=J.map((G)=>{if(typeof G==="string")return G;return O$(G,X)});else if(W==="style"&&J&&typeof J==="object"){let G={...J};for(let[Y,z]of Object.entries(G))if(e(z))G[Y]=o8(z,X)??z;Q.style=G}else if(W==="attributes"&&J&&typeof J==="object"){let G={...J};for(let[Y,z]of Object.entries(G))if(e(z))G[Y]=o8(z,X)??z;Q.attributes=G}else if(W==="$props"&&J&&typeof J==="object"){let G={...J};for(let[Y,z]of Object.entries(G))if(e(z)){let q=o8(z,X);G[Y]=q!==null?q??null:z}Q.$props=G}else if(typeof J==="string"&&e(J))Q[W]=o8(J,X)??J;else Q[W]=J;return Q}function o8(Z,X){try{let Q=X.$map?.item,W=X.$map?.index,J=Z.match(/^\$\{(.+)\}$/s);if(J)return Function("state","$map","item","index",`return (${J[1]})`)(X,X.$map,Q,W);return Function("state","$map","item","index",`return \`${Z}\``)(X,X.$map,Q,W)}catch{return null}}function A9(Z,X){if(!Z||typeof Z!=="object")return;if(typeof Z.innerHTML==="string"&&e(Z.innerHTML)){let W=l0(Z.innerHTML,X);if(W!=null)Z.innerHTML=String(W).replaceAll("${","&#36;{")}if(typeof Z.textContent==="string"&&e(Z.textContent))Z.textContent=l0(Z.textContent,X)??Z.textContent;if(Z.style&&typeof Z.style==="object"){for(let[W,J]of Object.entries(Z.style))if(typeof J==="string"&&e(J))Z.style[W]=l0(J,X)??J}if(Z.attributes&&typeof Z.attributes==="object"){for(let[W,J]of Object.entries(Z.attributes))if(typeof J==="string"&&e(J))Z.attributes[W]=l0(J,X)??J}if(Z.$props&&typeof Z.$props==="object"){for(let[W,J]of Object.entries(Z.$props))if(typeof J==="string"&&e(J))Z.$props[W]=l0(J,X)??J}let Q=Z.children;if(x0(Q)){let W=j$(Q,X);if(W){Z.children=W;return}}if(typeof Q==="string"&&e(Q)){let W=l0(Q,X);if(Array.isArray(W)){let J=W;Z.children=J;for(let G of J)A9(G,X)}}else if(Array.isArray(Z.children)){let W=0;while(W<Z.children.length){let J=Z.children[W];if(typeof J==="string"&&e(J)){let G=l0(J,X);if(Array.isArray(G)){let Y=G;Z.children.splice(W,1,...Y);for(let z of Y)A9(z,X);W+=Y.length;continue}}if(x0(J)){let G=j$(J,X);if(G){Z.children.splice(W,1,...G),W+=G.length;continue}}A9(J,X),W+=1}}}function j$(Z,X){let Q=Z.items,W=null;if(J4(Q))W=o5(Q.$ref,X);else if(Array.isArray(Q))W=Q;let J=Z.map;if(!Array.isArray(W)||!J)return null;return W.map((G,Y)=>{let z=Object.create(X);z.$map={index:Y,item:G},z["$map/item"]=G,z["$map/index"]=Y;let q=O$(J,z);return A9(q,z),q})}function t7(Z,X,Q){if(!Z||typeof Z!=="object")return;if(Array.isArray(Z)){for(let J of Z)t7(J,X,Q);return}if(Array.isArray(Z.children))for(let J of Z.children)t7(J,X,Q);let W=X.get(Z.tagName);if(W){if(Z.attributes){let z=null;for(let[q,K]of Object.entries(Z.attributes))if(q.startsWith("props.")&&q.length>6)z??={},z[q.slice(6)]=K,delete Z.attributes[q];if(z)Z.$props={...z,...Z.$props}}let J=Array.isArray(Z.children)&&Z.children.length>0?Z.children.map((z)=>{if(Q&&z&&typeof z==="object")V6(z,Q.rules,Q.media,"",Q.counter,"jxs");return G1(z,{},null)}).join(`
259
- `):null,G=MQ(W,Z.$props||null,J),Y=e5(W);if(Z.innerHTML=G,delete Z.children,W.style&&Z.$props){let z={...W.state};for(let[V,B]of Object.entries(Z.$props))z[V]=V in z?B:B;let q=K1(z,null),K={};for(let[V,B]of Object.entries(W.style))if(typeof B==="string"&&e(B)){let H=T0(B,q);if(H!=null)K[V]=H}if(Object.keys(K).length>0)Z.style={...Z.style,...K}}if(delete Z.$props,Y)Z.$static=!0;else Z.$prerendered=!0}}function YD(Z,X,Q=new Map,W=new Set){let J=X.filter((H)=>Z.includes(`<${H}`));if(J.length===0)return Z;let G=J.filter((H)=>Q.has(H)).map((H)=>`<link rel="stylesheet" href="/components/${H}.css">`).join(`
261
+ </head>`);x.html=mD(x.html,v,Q.defaults?.lang??"en");let p=(V.$elements??[]).filter((s)=>typeof s==="string"&&!s.startsWith("./")&&!s.startsWith("../"));if(p.length>0)x.html=uD(x.html,p);let f=null;if(!Q.build?.adapter)try{let s=await $9(Z.sourcePath);if(s)f=s}catch{}return{doc:V,excludeFromSitemap:K.$sitemap===!1,files:x.files,html:x.html,serverHandler:f}}function yD(Z,Q,W){if(Z.length===0)return{connectors:[],mounts:[]};let X={};for(let z of Q.projectContributions()){let{key:q}=z.project;if(q in W)X[q]=W[q]}let J=Z.map((z)=>{let q=z.server,{module:K}=q;if(typeof K!=="string"||K==="")throw Error(`Extension class "${z.name}": server.module (a bare import specifier) is required to generate a deployable worker`);return{basePath:q.basePath,className:z.classDef.title??z.name,module:K,options:{basePath:q.basePath,sections:X},order:q.order??100}}),G=new Set;for(let z of Object.values(X)){if(!z||typeof z!=="object"||Array.isArray(z))continue;for(let q of Object.values(z)){let K=q?.provider;if(typeof K==="string")G.add(K)}}let Y=[];for(let z of Q.connectors()){let q=String(z.connector.provider);if(!G.has(q))continue;let{module:K}=z.connector;if(typeof K!=="string"||K==="")throw Error(`Connector class "${z.name}": connector.module (a bare import specifier) is required to generate a deployable worker`);Y.push({className:z.classDef.title??z.name,module:K,provider:q})}return{connectors:Y,mounts:J}}function u$(Z,Q){return Z.map((W)=>{if(!W||typeof W!=="object")return W;let X={...W};if(X.attributes){X.attributes={...X.attributes};for(let[J,G]of Object.entries(X.attributes))if(typeof G==="string"&&e(G))X.attributes[J]=i0(G,Q)??G}if(typeof X.textContent==="string"&&e(X.textContent))X.textContent=i0(X.textContent,Q)??X.textContent;return X})}function gD(Z){return Z.map((Q)=>{if(!Q||typeof Q!=="object"||!Q.attributes)return Q;let W={...Q,attributes:{...Q.attributes}};for(let X of["href","src"]){let J=W.attributes[X];if(typeof J==="string"&&fD(J))W.attributes[X]=`/node_modules/${J}`}return W})}function fD(Z){return!Z.startsWith("/")&&!Z.startsWith("./")&&!Z.startsWith("../")&&!Z.startsWith("http")&&!Z.startsWith("data:")}function l$(Z,Q){if(!Z||typeof Z!=="object")return Z;let W={};for(let[X,J]of Object.entries(Z))if(X==="children"&&Array.isArray(J))W.children=J.map((G)=>{if(typeof G==="string")return G;return l$(G,Q)});else if(X==="style"&&J&&typeof J==="object"){let G={...J};for(let[Y,z]of Object.entries(G))if(e(z))G[Y]=Y5(z,Q)??z;W.style=G}else if(X==="attributes"&&J&&typeof J==="object"){let G={...J};for(let[Y,z]of Object.entries(G))if(e(z))G[Y]=Y5(z,Q)??z;W.attributes=G}else if(X==="$props"&&J&&typeof J==="object"){let G={...J};for(let[Y,z]of Object.entries(G))if(e(z)){let q=Y5(z,Q);G[Y]=q!==null?q??null:z}W.$props=G}else if(typeof J==="string"&&e(J))W[X]=Y5(J,Q)??J;else W[X]=J;return W}function Y5(Z,Q){try{let W=Q.$map?.item,X=Q.$map?.index,J=Z.match(/^\$\{(.+)\}$/s);if(J)return Function("state","$map","item","index",`return (${J[1]})`)(Q,Q.$map,W,X);return Function("state","$map","item","index",`return \`${Z}\``)(Q,Q.$map,W,X)}catch{return null}}function j9(Z,Q){if(!Z||typeof Z!=="object")return;if(typeof Z.innerHTML==="string"&&e(Z.innerHTML)){let X=i0(Z.innerHTML,Q);if(X!=null)Z.innerHTML=String(X).replaceAll("${","&#36;{")}if(typeof Z.textContent==="string"&&e(Z.textContent))Z.textContent=i0(Z.textContent,Q)??Z.textContent;if(Z.style&&typeof Z.style==="object"){for(let[X,J]of Object.entries(Z.style))if(typeof J==="string"&&e(J))Z.style[X]=i0(J,Q)??J}if(Z.attributes&&typeof Z.attributes==="object"){for(let[X,J]of Object.entries(Z.attributes))if(typeof J==="string"&&e(J))Z.attributes[X]=i0(J,Q)??J}if(Z.$props&&typeof Z.$props==="object"){for(let[X,J]of Object.entries(Z.$props))if(typeof J==="string"&&e(J))Z.$props[X]=i0(J,Q)??J}let W=Z.children;if(g0(W)){let X=m$(W,Q);if(X){Z.children=X;return}}if(typeof W==="string"&&e(W)){let X=i0(W,Q);if(Array.isArray(X)){let J=X;Z.children=J;for(let G of J)j9(G,Q)}}else if(Array.isArray(Z.children)){let X=0;while(X<Z.children.length){let J=Z.children[X];if(typeof J==="string"&&e(J)){let G=i0(J,Q);if(Array.isArray(G)){let Y=G;Z.children.splice(X,1,...Y);for(let z of Y)j9(z,Q);X+=Y.length;continue}}if(g0(J)){let G=m$(J,Q);if(G){Z.children.splice(X,1,...G),X+=G.length;continue}}j9(J,Q),X+=1}}}function m$(Z,Q){let W=Z.items,X=null;if(q4(W))X=KZ(W.$ref,Q);else if(Array.isArray(W))X=W;let J=Z.map;if(!Array.isArray(X)||!J)return null;return X.map((G,Y)=>{let z=Object.create(Q);z.$map={index:Y,item:G},z["$map/item"]=G,z["$map/index"]=Y;let q=l$(J,z);return j9(q,z),q})}function UQ(Z,Q,W){if(!Z||typeof Z!=="object")return;if(Array.isArray(Z)){for(let J of Z)UQ(J,Q,W);return}if(Array.isArray(Z.children))for(let J of Z.children)UQ(J,Q,W);let X=Q.get(Z.tagName);if(X){if(Z.attributes){let z=null;for(let[q,K]of Object.entries(Z.attributes))if(q.startsWith("props.")&&q.length>6)z??={},z[q.slice(6)]=K,delete Z.attributes[q];if(z)Z.$props={...z,...Z.$props}}let J=Array.isArray(Z.children)&&Z.children.length>0?Z.children.map((z)=>{if(W&&z&&typeof z==="object")M6(z,W.rules,W.media,"",W.counter,"jxs");return K1(z,{},null)}).join(`
262
+ `):null,G=vW(X,Z.$props||null,J),Y=VZ(X);if(Z.innerHTML=G,delete Z.children,X.style&&Z.$props){let z={...X.state};for(let[V,H]of Object.entries(Z.$props))z[V]=V in z?H:H;let q=F1(z,null),K={};for(let[V,H]of Object.entries(X.style))if(typeof H==="string"&&e(H)){let B=E0(H,q);if(B!=null)K[V]=B}if(Object.keys(K).length>0)Z.style={...Z.style,...K}}if(delete Z.$props,Y)Z.$static=!0;else Z.$prerendered=!0}}function hD(Z,Q,W=new Map,X=new Set){let J=Q.filter((B)=>Z.includes(`<${B}`));if(J.length===0)return Z;let G=J.filter((B)=>W.has(B)).map((B)=>`<link rel="stylesheet" href="/components/${B}.css">`).join(`
260
263
  `),Y=Z;if(G)Y=Y.replace("</head>",` ${G}
261
- </head>`);let z=J.filter((H)=>!W.has(H));if(z.length===0)return Y;let q=`<script type="importmap">
264
+ </head>`);let z=J.filter((B)=>!X.has(B));if(z.length===0)return Y;let q=`<script type="importmap">
262
265
  {
263
266
  "imports": {
264
- "@vue/reactivity": "${z1}",
265
- "lit-html": "${$1}"
267
+ "@vue/reactivity": "${V1}",
268
+ "lit-html": "${H1}"
266
269
  }
267
270
  }
268
- </script>`,K=z.map((H)=>`<script type="module" src="/components/${H}.js"></script>`).join(`
269
- `),B=(Y.includes('<script type="importmap">')?"":`${q}
270
- `)+K;return Y.replace("</body>",` ${B}
271
- </body>`)}function zD(Z,X){let Q=X.map((W)=>`<script type="module" src="/node_modules/${W}"></script>`).join(`
272
- `);return Z.replace("</body>",` ${Q}
273
- </body>`)}function $D(Z,X,Q){let W=dJ(X),J=/<head>([\s\S]*?)<\/head>/i,G=Z.match(J),Y="";if(G){let q=G[1].match(/<style>[\s\S]*?<\/style>/gi);if(q)Y+=`
271
+ </script>`,K=z.map((B)=>`<script type="module" src="/components/${B}.js"></script>`).join(`
272
+ `),H=(Y.includes('<script type="importmap">')?"":`${q}
273
+ `)+K;return Y.replace("</body>",` ${H}
274
+ </body>`)}function uD(Z,Q){let W=Q.map((X)=>`<script type="module" src="/node_modules/${X}"></script>`).join(`
275
+ `);return Z.replace("</body>",` ${W}
276
+ </body>`)}function mD(Z,Q,W){let X=YG(Q),J=/<head>([\s\S]*?)<\/head>/i,G=Z.match(J),Y="";if(G){let q=G[1].match(/<style>[\s\S]*?<\/style>/gi);if(q)Y+=`
274
277
  ${q.join(`
275
278
  `)}`;let K=G[1].match(/<script[\s\S]*?<\/script>/gi);if(K)Y+=`
276
279
  ${K.join(`
277
280
  `)}`}let z=Z;if(J.test(z))z=z.replace(J,`<head>
278
- ${W}${Y}
279
- </head>`);return z=z.replace(/<html\s[^>]*>/i,(q)=>{if(/lang=/.test(q))return q.replace(/lang="[^"]*"/,`lang="${Q}"`);return q.replace("<html",`<html lang="${Q}"`)}),z}function E$(Z,X,Q){if(Z==="/")return k1(X,"index.html");let W=Z.replace(/^\//,"");if(Q==="always")return k1(X,W,"index.html");return k1(X,`${W}.html`)}function qD(Z,X){let Q=0,W=[];for(let[J,G]of Object.entries(Z)){let Y=typeof G==="object"?G.destination:G,z=typeof G==="object"?G.status??301:301;if(J.includes(":")||J.includes("*")){W.push(`${J} ${Y} ${z}`);continue}let q=E$(J,X,"always"),K=`<!DOCTYPE html>
281
+ ${X}${Y}
282
+ </head>`);return z=z.replace(/<html\s[^>]*>/i,(q)=>{if(/lang=/.test(q))return q.replace(/lang="[^"]*"/,`lang="${W}"`);return q.replace("<html",`<html lang="${W}"`)}),z}function d$(Z,Q,W){if(Z==="/")return y1(Q,"index.html");let X=Z.replace(/^\//,"");if(W==="always")return y1(Q,X,"index.html");return y1(Q,`${X}.html`)}function lD(Z,Q,W=new Set){let X=0,J=[],G=(z)=>z.length>1&&z.endsWith("/")?z.slice(0,-1):z,Y=new Set([...W].map((z)=>G(z)));for(let[z,q]of Object.entries(Z)){let K=typeof q==="object"?q.destination:q,V=typeof q==="object"?q.status??301:301;if(z.includes(":")||z.includes("*")){J.push(`${z} ${K} ${V}`);continue}if(Y.has(G(z)))console.warn(`Redirect "${z}" overwrites a compiled page at the same route — `+"remove the redirect or the page.");let H=d$(z,Q,"always"),B=`<!DOCTYPE html>
280
283
  <html>
281
284
  <head>
282
285
  <meta charset="utf-8">
283
- <meta http-equiv="refresh" content="0;url=${o7(Y)}">
284
- <link rel="canonical" href="${o7(Y)}">
286
+ <meta http-equiv="refresh" content="0;url=${KQ(K)}">
287
+ <link rel="canonical" href="${KQ(K)}">
285
288
  <title>Redirecting...</title>
286
289
  </head>
287
290
  <body>
288
- <p>Redirecting to <a href="${o7(Y)}">${KD(Y)}</a>...</p>
291
+ <p>Redirecting to <a href="${KQ(K)}">${dD(K)}</a>...</p>
289
292
  </body>
290
- </html>`;E6(S1(q),{recursive:!0}),L4(q,K,"utf8"),Q+=1,W.push(`${J} ${Y} ${z}`)}if(W.length>0)L4(k1(X,"_redirects"),`${W.join(`
293
+ </html>`;_6(v1(H),{recursive:!0}),D4(H,B,"utf8"),X+=1,J.push(`${z} ${K} ${V}`)}if(J.length>0)D4(y1(Q,"_redirects"),`${J.join(`
291
294
  `)}
292
- `,"utf8"),Q+=1;return Q}function KD(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function o7(Z){return String(Z).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}function UD(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function VD(Z,X){if(Z.length===0)return 0;let W=`<?xml version="1.0" encoding="UTF-8"?>
295
+ `,"utf8"),X+=1;return X}function dD(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function KQ(Z){return String(Z).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}function cD(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function pD(Z,Q){if(Z.length===0)return 0;let X=`<?xml version="1.0" encoding="UTF-8"?>
293
296
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
294
297
  ${Z.map((J)=>` <url>
295
- <loc>${UD(J.loc)}</loc>
298
+ <loc>${cD(J.loc)}</loc>
296
299
  <lastmod>${J.lastmod.toISOString().slice(0,10)}</lastmod>
297
300
  </url>`).join(`
298
301
  `)}
299
302
  </urlset>
300
- `;return L4(k1(X,"sitemap.xml"),W,"utf8"),1}function BD(Z,X){let Q=k1(Z,"robots.txt"),W=p6(Q),J=W?sN(Q,"utf8"):`User-agent: *
303
+ `;return D4(y1(Q,"sitemap.xml"),X,"utf8"),1}function iD(Z,Q){let W=y1(Z,"robots.txt"),X=s6(W),J=X?CD(W,"utf8"):`User-agent: *
301
304
  Allow: /
302
305
  `;if(/^Sitemap:/im.test(J))return 0;if(!J.endsWith(`
303
306
  `))J+=`
304
307
  `;return J+=`
305
- Sitemap: ${new URL("/sitemap.xml",X).href}
306
- `,L4(Q,J,"utf8"),W?0:1}var P$=c(()=>{k4();E8();gJ();I6();hJ();mJ();pJ();wJ();W9();B6();iJ();T$();r7()});var e7="https://jxsuite.com/schema/project/fields/v2",t8="https://jxsuite.com/schema/document/paths/v2",ky;var ZX=c(()=>{ky={description:"A single field definition inside a section entry schema — a small, recursive subset of "+"JSON Schema. Recursive positions reference the effective field union via the well-known fields resource $id.",properties:{default:{},description:{type:"string"},enum:{type:"array"},format:{type:"string"},items:{$ref:"https://jxsuite.com/schema/project/fields/v2"},properties:{additionalProperties:{$ref:"https://jxsuite.com/schema/project/fields/v2"},type:"object"},required:{items:{type:"string"},type:"array"},type:{enum:["string","number","integer","boolean","array","object"],type:"string"}},required:["type"],type:"object"}});function b$(Z){let{corePath:X,fragments:Q,fieldSchemaRefs:W=[]}=Z;return{$comment:k$,$defs:{Fields:{$id:e7,anyOf:[{$ref:`${C$}#/$defs/JxFieldSchema`},{$ref:`${C$}#/$defs/RelationshipRef`},...W.map((J)=>({$ref:J}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:X},...Q.map((J)=>({$ref:J}))],type:"object",unevaluatedProperties:!1}}async function QX(Z,X,Q){let W=structuredClone(Z),J=new Map,G=new Set;XX(W,G);let Y=0,z=async(K)=>{let V=S$(K),B=J.get(V);if(B!==void 0)return B;let H;try{H=structuredClone(await X(V))}catch(I){throw Error(`bundleSchema: cannot load $ref target "${V}": ${FD(I)}`,{cause:I})}let F=typeof H.$id==="string"&&e8(H.$id)?H.$id:null;Y+=F===null?1:0;let A=F??`urn:jx:bundled:${Y}`;if(J.set(V,A),G.has(A))return A;G.add(A),H.$id=A,await q(H,HD(V),!0);let M=W.$defs??={};return M[A]=H,A},q=async(K,V,B=!1)=>{if(Array.isArray(K)){for(let M of K)await q(M,V);return}if(K===null||typeof K!=="object")return;let H=K,F=V;if(!B&&typeof H.$id==="string"&&e8(H.$id))F=null;let A=H.$ref;if(typeof A==="string"&&F!==null&&!A.startsWith("#")&&!e8(A)){let M=A.indexOf("#"),I=M===-1?A:A.slice(0,M),N=M===-1?"":A.slice(M);if(I){let T=await z(`${F}/${I}`);H.$ref=`${T}${N}`}}for(let M of Object.values(H))await q(M,F)};return await q(W,S$(Q),!0),W}function XX(Z,X){if(Array.isArray(Z)){for(let W of Z)XX(W,X);return}if(Z===null||typeof Z!=="object")return;let Q=Z;if(typeof Q.$id==="string"&&e8(Q.$id))X.add(Q.$id);for(let W of Object.values(Q))XX(W,X)}function e8(Z){return/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(Z)}function S$(Z){let X=Z.replaceAll("\\","/"),Q=X.startsWith("/"),W=[];for(let J of X.split("/")){if(J===""||J===".")continue;if(J===".."){if(W.length>0&&W.at(-1)!=="..")W.pop();else if(!Q)W.push("..");continue}W.push(J)}return(Q?"/":"")+W.join("/")}function HD(Z){let X=Z.lastIndexOf("/");if(X===-1)return".";return X===0?"/":Z.slice(0,X)}function FD(Z){return Z instanceof Error?Z.message:String(Z)}function _$(Z){let{corePath:X,pathsValueRefs:Q}=Z;return{$comment:k$,$defs:{PathsValue:Q.length>0?{$id:t8,anyOf:Q.map((W)=>({$ref:W}))}:{$id:t8}},$ref:X,$schema:"https://json-schema.org/draft/2020-12/schema"}}var C$="https://jxsuite.com/schema/project/core/v2",k$="Generated by `jx schema` from project.json#/extensions — do not edit.";var x$=c(()=>{ZX();ZX()});var d$={};x6(d$,{writeProjectSchemas:()=>m$,readBundledProjectSchemas:()=>ND});import{existsSync as u$,readFileSync as M9,statSync as v$,writeFileSync as y$}from"node:fs";import{createRequire as Z5}from"node:module";import{dirname as LD,isAbsolute as AD,relative as WX,resolve as W6,sep as JX}from"node:path";async function m$(Z){let{config:X}=A1(Z),Q=await M6(Z,X),W=g$(Z,MD),J=[],G=[],Y=[];for(let B of Q.extensions){let H=B.schemas.project;if(H)J.push(f$(Z,B,H));let F=B.schemas.document;if(F)G.push(...h$(F));let A=B.schemas.fields;if(A)Y.push(...h$(A)),J.push(f$(Z,B,A))}let z=b$({corePath:W,fieldSchemaRefs:Y,fragments:J}),q=_$({corePath:g$(Z,ID),pathsValueRefs:G}),K=W6(Z,"project.schema.json"),V=W6(Z,"document.schema.json");return y$(K,`${JSON.stringify(z,null,2)}
307
- `,"utf8"),y$(V,`${JSON.stringify(q,null,2)}
308
- `,"utf8"),{documentSchemaPath:V,projectSchemaPath:K}}async function ND(Z){let X=W6(Z),Q=W6(X,"project.json"),W=W6(X,"project.schema.json"),J=W6(X,"document.schema.json"),G=(K)=>{if(!u$(K))return!0;try{return v$(Q).mtimeMs>v$(K).mtimeMs}catch{return!1}};if(G(W)||G(J))await m$(X);let Y=DD(X),z=await QX(JSON.parse(M9(W,"utf8")),Y,X);return{document:await QX(JSON.parse(M9(J,"utf8")),Y,X),project:z}}function DD(Z){return async(X)=>{let Q=W6(X),W=WX(Z,Q);if(W.startsWith("..")||AD(W))throw Error(`Schema ref "${X}" escapes the project root ${Z}`);if(u$(Q))return JSON.parse(M9(Q,"utf8"));let J=W.split(JX).join("/"),G="node_modules/",Y=J.lastIndexOf(G);if(Y===-1)throw Error(`Schema ref "${X}" does not exist`);let z=J.slice(Y+G.length),q;try{q=Z5(W6(Z,"package.json")).resolve(z)}catch{try{q=Z5(import.meta.url).resolve(z)}catch(K){throw Error(`Schema ref "${X}" does not exist and "${z}" is not resolvable from the project or the host`,{cause:K})}}return JSON.parse(M9(q,"utf8"))}}function g$(Z,X){let Q=null;try{Q=Z5(W6(Z,"package.json")).resolve(X)}catch{try{Q=Z5(import.meta.url).resolve(X)}catch{Q=null}}let W=`./node_modules/${X}`;return Q?l$(Z,Q,W):W}function f$(Z,X,Q){let W=WX(LD(X.manifestPath),Q).split(JX).join("/"),J=`./node_modules/${X.specifier}/${W}`;return l$(Z,Q,J)}function l$(Z,X,Q){let W=WX(Z,X).split(JX).join("/");if(W.startsWith(".."))return Q;return W.startsWith("./")?W:`./${W}`}function h$(Z){let X;try{X=JSON.parse(M9(Z,"utf8"))}catch{return[]}let{$id:Q}=X;if(typeof Q!=="string"||!X.$defs)return[];return Object.keys(X.$defs).map((W)=>`${Q}#/$defs/${W}`)}var MD="@jxsuite/schema/schemas/project.core.schema.json",ID="@jxsuite/schema/schema.json";var c$=c(()=>{x$();I6();E8()});var N9=j((i$)=>{Object.defineProperty(i$,"__esModule",{value:!0});i$.regexpCode=i$.getEsmExportName=i$.getProperty=i$.safeStringify=i$.stringify=i$.strConcat=i$.addCodeArg=i$.str=i$._=i$.nil=i$._Code=i$.Name=i$.IDENTIFIER=i$._CodeOrName=void 0;class X5{}i$._CodeOrName=X5;i$.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class b1 extends X5{constructor(Z){super();if(!i$.IDENTIFIER.test(Z))throw Error("CodeGen: name must be a valid identifier");this.str=Z}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}i$.Name=b1;class E4 extends X5{constructor(Z){super();this._items=typeof Z==="string"?[Z]:Z}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let Z=this._items[0];return Z===""||Z==='""'}get str(){var Z;return(Z=this._str)!==null&&Z!==void 0?Z:this._str=this._items.reduce((X,Q)=>`${X}${Q}`,"")}get names(){var Z;return(Z=this._names)!==null&&Z!==void 0?Z:this._names=this._items.reduce((X,Q)=>{if(Q instanceof b1)X[Q.str]=(X[Q.str]||0)+1;return X},{})}}i$._Code=E4;i$.nil=new E4("");function p$(Z,...X){let Q=[Z[0]],W=0;while(W<X.length)YX(Q,X[W]),Q.push(Z[++W]);return new E4(Q)}i$._=p$;var GX=new E4("+");function n$(Z,...X){let Q=[I9(Z[0])],W=0;while(W<X.length)Q.push(GX),YX(Q,X[W]),Q.push(GX,I9(Z[++W]));return TD(Q),new E4(Q)}i$.str=n$;function YX(Z,X){if(X instanceof E4)Z.push(...X._items);else if(X instanceof b1)Z.push(X);else Z.push(OD(X))}i$.addCodeArg=YX;function TD(Z){let X=1;while(X<Z.length-1){if(Z[X]===GX){let Q=wD(Z[X-1],Z[X+1]);if(Q!==void 0){Z.splice(X-1,3,Q);continue}Z[X++]="+"}X++}}function wD(Z,X){if(X==='""')return Z;if(Z==='""')return X;if(typeof Z=="string"){if(X instanceof b1||Z[Z.length-1]!=='"')return;if(typeof X!="string")return`${Z.slice(0,-1)}${X}"`;if(X[0]==='"')return Z.slice(0,-1)+X.slice(1);return}if(typeof X=="string"&&X[0]==='"'&&!(Z instanceof b1))return`"${Z}${X.slice(1)}`;return}function jD(Z,X){return X.emptyStr()?Z:Z.emptyStr()?X:n$`${Z}${X}`}i$.strConcat=jD;function OD(Z){return typeof Z=="number"||typeof Z=="boolean"||Z===null?Z:I9(Array.isArray(Z)?Z.join(","):Z)}function ED(Z){return new E4(I9(Z))}i$.stringify=ED;function I9(Z){return JSON.stringify(Z).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}i$.safeStringify=I9;function RD(Z){return typeof Z=="string"&&i$.IDENTIFIER.test(Z)?new E4(`.${Z}`):p$`[${Z}]`}i$.getProperty=RD;function PD(Z){if(typeof Z=="string"&&i$.IDENTIFIER.test(Z))return new E4(`${Z}`);throw Error(`CodeGen: invalid export name: ${Z}, use explicit $id name mapping`)}i$.getEsmExportName=PD;function CD(Z){return new E4(Z.toString())}i$.regexpCode=CD});var KX=j((o$)=>{Object.defineProperty(o$,"__esModule",{value:!0});o$.ValueScope=o$.ValueScopeName=o$.Scope=o$.varKinds=o$.UsedValueState=void 0;var t0=N9();class a$ extends Error{constructor(Z){super(`CodeGen: "code" for ${Z} not defined`);this.value=Z.value}}var W5;(function(Z){Z[Z.Started=0]="Started",Z[Z.Completed=1]="Completed"})(W5||(o$.UsedValueState=W5={}));o$.varKinds={const:new t0.Name("const"),let:new t0.Name("let"),var:new t0.Name("var")};class $X{constructor({prefixes:Z,parent:X}={}){this._names={},this._prefixes=Z,this._parent=X}toName(Z){return Z instanceof t0.Name?Z:this.name(Z)}name(Z){return new t0.Name(this._newName(Z))}_newName(Z){let X=this._names[Z]||this._nameGroup(Z);return`${Z}${X.index++}`}_nameGroup(Z){var X,Q;if(((Q=(X=this._parent)===null||X===void 0?void 0:X._prefixes)===null||Q===void 0?void 0:Q.has(Z))||this._prefixes&&!this._prefixes.has(Z))throw Error(`CodeGen: prefix "${Z}" is not allowed in this scope`);return this._names[Z]={prefix:Z,index:0}}}o$.Scope=$X;class qX extends t0.Name{constructor(Z,X){super(X);this.prefix=Z}setValue(Z,{property:X,itemIndex:Q}){this.value=Z,this.scopePath=t0._`.${new t0.Name(X)}[${Q}]`}}o$.ValueScopeName=qX;var lD=t0._`\n`;class s$ extends $X{constructor(Z){super(Z);this._values={},this._scope=Z.scope,this.opts={...Z,_n:Z.lines?lD:t0.nil}}get(){return this._scope}name(Z){return new qX(Z,this._newName(Z))}value(Z,X){var Q;if(X.ref===void 0)throw Error("CodeGen: ref must be passed in value");let W=this.toName(Z),{prefix:J}=W,G=(Q=X.key)!==null&&Q!==void 0?Q:X.ref,Y=this._values[J];if(Y){let K=Y.get(G);if(K)return K}else Y=this._values[J]=new Map;Y.set(G,W);let z=this._scope[J]||(this._scope[J]=[]),q=z.length;return z[q]=X.ref,W.setValue(X,{property:J,itemIndex:q}),W}getValue(Z,X){let Q=this._values[Z];if(!Q)return;return Q.get(X)}scopeRefs(Z,X=this._values){return this._reduceValues(X,(Q)=>{if(Q.scopePath===void 0)throw Error(`CodeGen: name "${Q}" has no value`);return t0._`${Z}${Q.scopePath}`})}scopeCode(Z=this._values,X,Q){return this._reduceValues(Z,(W)=>{if(W.value===void 0)throw Error(`CodeGen: name "${W}" has no value`);return W.value.code},X,Q)}_reduceValues(Z,X,Q={},W){let J=t0.nil;for(let G in Z){let Y=Z[G];if(!Y)continue;let z=Q[G]=Q[G]||new Map;Y.forEach((q)=>{if(z.has(q))return;z.set(q,W5.Started);let K=X(q);if(K){let V=this.opts.es5?o$.varKinds.var:o$.varKinds.const;J=t0._`${J}${V} ${q} = ${K};${this.opts._n}`}else if(K=W===null||W===void 0?void 0:W(q))J=t0._`${J}${K}${this.opts._n}`;else throw new a$(q);z.set(q,W5.Completed)})}return J}}o$.ValueScope=s$});var Z0=j((e0)=>{Object.defineProperty(e0,"__esModule",{value:!0});e0.or=e0.and=e0.not=e0.CodeGen=e0.operators=e0.varKinds=e0.ValueScopeName=e0.ValueScope=e0.Scope=e0.Name=e0.regexpCode=e0.stringify=e0.getProperty=e0.nil=e0.strConcat=e0.str=e0._=void 0;var Y0=N9(),R4=KX(),R6=N9();Object.defineProperty(e0,"_",{enumerable:!0,get:function(){return R6._}});Object.defineProperty(e0,"str",{enumerable:!0,get:function(){return R6.str}});Object.defineProperty(e0,"strConcat",{enumerable:!0,get:function(){return R6.strConcat}});Object.defineProperty(e0,"nil",{enumerable:!0,get:function(){return R6.nil}});Object.defineProperty(e0,"getProperty",{enumerable:!0,get:function(){return R6.getProperty}});Object.defineProperty(e0,"stringify",{enumerable:!0,get:function(){return R6.stringify}});Object.defineProperty(e0,"regexpCode",{enumerable:!0,get:function(){return R6.regexpCode}});Object.defineProperty(e0,"Name",{enumerable:!0,get:function(){return R6.Name}});var q5=KX();Object.defineProperty(e0,"Scope",{enumerable:!0,get:function(){return q5.Scope}});Object.defineProperty(e0,"ValueScope",{enumerable:!0,get:function(){return q5.ValueScope}});Object.defineProperty(e0,"ValueScopeName",{enumerable:!0,get:function(){return q5.ValueScopeName}});Object.defineProperty(e0,"varKinds",{enumerable:!0,get:function(){return q5.varKinds}});e0.operators={GT:new Y0._Code(">"),GTE:new Y0._Code(">="),LT:new Y0._Code("<"),LTE:new Y0._Code("<="),EQ:new Y0._Code("==="),NEQ:new Y0._Code("!=="),NOT:new Y0._Code("!"),OR:new Y0._Code("||"),AND:new Y0._Code("&&"),ADD:new Y0._Code("+")};class P6{optimizeNodes(){return this}optimizeNames(Z,X){return this}}class e$ extends P6{constructor(Z,X,Q){super();this.varKind=Z,this.name=X,this.rhs=Q}render({es5:Z,_n:X}){let Q=Z?R4.varKinds.var:this.varKind,W=this.rhs===void 0?"":` = ${this.rhs}`;return`${Q} ${this.name}${W};`+X}optimizeNames(Z,X){if(!Z[this.name.str])return;if(this.rhs)this.rhs=x1(this.rhs,Z,X);return this}get names(){return this.rhs instanceof Y0._CodeOrName?this.rhs.names:{}}}class BX extends P6{constructor(Z,X,Q){super();this.lhs=Z,this.rhs=X,this.sideEffects=Q}render({_n:Z}){return`${this.lhs} = ${this.rhs};`+Z}optimizeNames(Z,X){if(this.lhs instanceof Y0.Name&&!Z[this.lhs.str]&&!this.sideEffects)return;return this.rhs=x1(this.rhs,Z,X),this}get names(){let Z=this.lhs instanceof Y0.Name?{}:{...this.lhs.names};return $5(Z,this.rhs)}}class Zq extends BX{constructor(Z,X,Q,W){super(Z,Q,W);this.op=X}render({_n:Z}){return`${this.lhs} ${this.op}= ${this.rhs};`+Z}}class Xq extends P6{constructor(Z){super();this.label=Z,this.names={}}render({_n:Z}){return`${this.label}:`+Z}}class Qq extends P6{constructor(Z){super();this.label=Z,this.names={}}render({_n:Z}){return`break${this.label?` ${this.label}`:""};`+Z}}class Wq extends P6{constructor(Z){super();this.error=Z}render({_n:Z}){return`throw ${this.error};`+Z}get names(){return this.error.names}}class Jq extends P6{constructor(Z){super();this.code=Z}render({_n:Z}){return`${this.code};`+Z}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(Z,X){return this.code=x1(this.code,Z,X),this}get names(){return this.code instanceof Y0._CodeOrName?this.code.names:{}}}class K5 extends P6{constructor(Z=[]){super();this.nodes=Z}render(Z){return this.nodes.reduce((X,Q)=>X+Q.render(Z),"")}optimizeNodes(){let{nodes:Z}=this,X=Z.length;while(X--){let Q=Z[X].optimizeNodes();if(Array.isArray(Q))Z.splice(X,1,...Q);else if(Q)Z[X]=Q;else Z.splice(X,1)}return Z.length>0?this:void 0}optimizeNames(Z,X){let{nodes:Q}=this,W=Q.length;while(W--){let J=Q[W];if(J.optimizeNames(Z,X))continue;nD(Z,J.names),Q.splice(W,1)}return Q.length>0?this:void 0}get names(){return this.nodes.reduce((Z,X)=>n6(Z,X.names),{})}}class C6 extends K5{render(Z){return"{"+Z._n+super.render(Z)+"}"+Z._n}}class Gq extends K5{}class D9 extends C6{}D9.kind="else";class J6 extends C6{constructor(Z,X){super(X);this.condition=Z}render(Z){let X=`if(${this.condition})`+super.render(Z);if(this.else)X+="else "+this.else.render(Z);return X}optimizeNodes(){super.optimizeNodes();let Z=this.condition;if(Z===!0)return this.nodes;let X=this.else;if(X){let Q=X.optimizeNodes();X=this.else=Array.isArray(Q)?new D9(Q):Q}if(X){if(Z===!1)return X instanceof J6?X:X.nodes;if(this.nodes.length)return this;return new J6(Kq(Z),X instanceof J6?[X]:X.nodes)}if(Z===!1||!this.nodes.length)return;return this}optimizeNames(Z,X){var Q;if(this.else=(Q=this.else)===null||Q===void 0?void 0:Q.optimizeNames(Z,X),!(super.optimizeNames(Z,X)||this.else))return;return this.condition=x1(this.condition,Z,X),this}get names(){let Z=super.names;if($5(Z,this.condition),this.else)n6(Z,this.else.names);return Z}}J6.kind="if";class _1 extends C6{}_1.kind="for";class Yq extends _1{constructor(Z){super();this.iteration=Z}render(Z){return`for(${this.iteration})`+super.render(Z)}optimizeNames(Z,X){if(!super.optimizeNames(Z,X))return;return this.iteration=x1(this.iteration,Z,X),this}get names(){return n6(super.names,this.iteration.names)}}class zq extends _1{constructor(Z,X,Q,W){super();this.varKind=Z,this.name=X,this.from=Q,this.to=W}render(Z){let X=Z.es5?R4.varKinds.var:this.varKind,{name:Q,from:W,to:J}=this;return`for(${X} ${Q}=${W}; ${Q}<${J}; ${Q}++)`+super.render(Z)}get names(){let Z=$5(super.names,this.from);return $5(Z,this.to)}}class UX extends _1{constructor(Z,X,Q,W){super();this.loop=Z,this.varKind=X,this.name=Q,this.iterable=W}render(Z){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(Z)}optimizeNames(Z,X){if(!super.optimizeNames(Z,X))return;return this.iterable=x1(this.iterable,Z,X),this}get names(){return n6(super.names,this.iterable.names)}}class J5 extends C6{constructor(Z,X,Q){super();this.name=Z,this.args=X,this.async=Q}render(Z){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(Z)}}J5.kind="func";class G5 extends K5{render(Z){return"return "+super.render(Z)}}G5.kind="return";class $q extends C6{render(Z){let X="try"+super.render(Z);if(this.catch)X+=this.catch.render(Z);if(this.finally)X+=this.finally.render(Z);return X}optimizeNodes(){var Z,X;return super.optimizeNodes(),(Z=this.catch)===null||Z===void 0||Z.optimizeNodes(),(X=this.finally)===null||X===void 0||X.optimizeNodes(),this}optimizeNames(Z,X){var Q,W;return super.optimizeNames(Z,X),(Q=this.catch)===null||Q===void 0||Q.optimizeNames(Z,X),(W=this.finally)===null||W===void 0||W.optimizeNames(Z,X),this}get names(){let Z=super.names;if(this.catch)n6(Z,this.catch.names);if(this.finally)n6(Z,this.finally.names);return Z}}class Y5 extends C6{constructor(Z){super();this.error=Z}render(Z){return`catch(${this.error})`+super.render(Z)}}Y5.kind="catch";class z5 extends C6{render(Z){return"finally"+super.render(Z)}}z5.kind="finally";class qq{constructor(Z,X={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...X,_n:X.lines?`
309
- `:""},this._extScope=Z,this._scope=new R4.Scope({parent:Z}),this._nodes=[new Gq]}toString(){return this._root.render(this.opts)}name(Z){return this._scope.name(Z)}scopeName(Z){return this._extScope.name(Z)}scopeValue(Z,X){let Q=this._extScope.value(Z,X);return(this._values[Q.prefix]||(this._values[Q.prefix]=new Set)).add(Q),Q}getScopeValue(Z,X){return this._extScope.getValue(Z,X)}scopeRefs(Z){return this._extScope.scopeRefs(Z,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(Z,X,Q,W){let J=this._scope.toName(X);if(Q!==void 0&&W)this._constants[J.str]=Q;return this._leafNode(new e$(Z,J,Q)),J}const(Z,X,Q){return this._def(R4.varKinds.const,Z,X,Q)}let(Z,X,Q){return this._def(R4.varKinds.let,Z,X,Q)}var(Z,X,Q){return this._def(R4.varKinds.var,Z,X,Q)}assign(Z,X,Q){return this._leafNode(new BX(Z,X,Q))}add(Z,X){return this._leafNode(new Zq(Z,e0.operators.ADD,X))}code(Z){if(typeof Z=="function")Z();else if(Z!==Y0.nil)this._leafNode(new Jq(Z));return this}object(...Z){let X=["{"];for(let[Q,W]of Z){if(X.length>1)X.push(",");if(X.push(Q),Q!==W||this.opts.es5)X.push(":"),(0,Y0.addCodeArg)(X,W)}return X.push("}"),new Y0._Code(X)}if(Z,X,Q){if(this._blockNode(new J6(Z)),X&&Q)this.code(X).else().code(Q).endIf();else if(X)this.code(X).endIf();else if(Q)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(Z){return this._elseNode(new J6(Z))}else(){return this._elseNode(new D9)}endIf(){return this._endBlockNode(J6,D9)}_for(Z,X){if(this._blockNode(Z),X)this.code(X).endFor();return this}for(Z,X){return this._for(new Yq(Z),X)}forRange(Z,X,Q,W,J=this.opts.es5?R4.varKinds.var:R4.varKinds.let){let G=this._scope.toName(Z);return this._for(new zq(J,G,X,Q),()=>W(G))}forOf(Z,X,Q,W=R4.varKinds.const){let J=this._scope.toName(Z);if(this.opts.es5){let G=X instanceof Y0.Name?X:this.var("_arr",X);return this.forRange("_i",0,Y0._`${G}.length`,(Y)=>{this.var(J,Y0._`${G}[${Y}]`),Q(J)})}return this._for(new UX("of",W,J,X),()=>Q(J))}forIn(Z,X,Q,W=this.opts.es5?R4.varKinds.var:R4.varKinds.const){if(this.opts.ownProperties)return this.forOf(Z,Y0._`Object.keys(${X})`,Q);let J=this._scope.toName(Z);return this._for(new UX("in",W,J,X),()=>Q(J))}endFor(){return this._endBlockNode(_1)}label(Z){return this._leafNode(new Xq(Z))}break(Z){return this._leafNode(new Qq(Z))}return(Z){let X=new G5;if(this._blockNode(X),this.code(Z),X.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(G5)}try(Z,X,Q){if(!X&&!Q)throw Error('CodeGen: "try" without "catch" and "finally"');let W=new $q;if(this._blockNode(W),this.code(Z),X){let J=this.name("e");this._currNode=W.catch=new Y5(J),X(J)}if(Q)this._currNode=W.finally=new z5,this.code(Q);return this._endBlockNode(Y5,z5)}throw(Z){return this._leafNode(new Wq(Z))}block(Z,X){if(this._blockStarts.push(this._nodes.length),Z)this.code(Z).endBlock(X);return this}endBlock(Z){let X=this._blockStarts.pop();if(X===void 0)throw Error("CodeGen: not in self-balancing block");let Q=this._nodes.length-X;if(Q<0||Z!==void 0&&Q!==Z)throw Error(`CodeGen: wrong number of nodes: ${Q} vs ${Z} expected`);return this._nodes.length=X,this}func(Z,X=Y0.nil,Q,W){if(this._blockNode(new J5(Z,X,Q)),W)this.code(W).endFunc();return this}endFunc(){return this._endBlockNode(J5)}optimize(Z=1){while(Z-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(Z){return this._currNode.nodes.push(Z),this}_blockNode(Z){this._currNode.nodes.push(Z),this._nodes.push(Z)}_endBlockNode(Z,X){let Q=this._currNode;if(Q instanceof Z||X&&Q instanceof X)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${X?`${Z.kind}/${X.kind}`:Z.kind}"`)}_elseNode(Z){let X=this._currNode;if(!(X instanceof J6))throw Error('CodeGen: "else" without "if"');return this._currNode=X.else=Z,this}get _root(){return this._nodes[0]}get _currNode(){let Z=this._nodes;return Z[Z.length-1]}set _currNode(Z){let X=this._nodes;X[X.length-1]=Z}}e0.CodeGen=qq;function n6(Z,X){for(let Q in X)Z[Q]=(Z[Q]||0)+(X[Q]||0);return Z}function $5(Z,X){return X instanceof Y0._CodeOrName?n6(Z,X.names):Z}function x1(Z,X,Q){if(Z instanceof Y0.Name)return W(Z);if(!J(Z))return Z;return new Y0._Code(Z._items.reduce((G,Y)=>{if(Y instanceof Y0.Name)Y=W(Y);if(Y instanceof Y0._Code)G.push(...Y._items);else G.push(Y);return G},[]));function W(G){let Y=Q[G.str];if(Y===void 0||X[G.str]!==1)return G;return delete X[G.str],Y}function J(G){return G instanceof Y0._Code&&G._items.some((Y)=>Y instanceof Y0.Name&&X[Y.str]===1&&Q[Y.str]!==void 0)}}function nD(Z,X){for(let Q in X)Z[Q]=(Z[Q]||0)-(X[Q]||0)}function Kq(Z){return typeof Z=="boolean"||typeof Z=="number"||Z===null?!Z:Y0._`!${VX(Z)}`}e0.not=Kq;var iD=Uq(e0.operators.AND);function rD(...Z){return Z.reduce(iD)}e0.and=rD;var aD=Uq(e0.operators.OR);function sD(...Z){return Z.reduce(aD)}e0.or=sD;function Uq(Z){return(X,Q)=>X===Y0.nil?Q:Q===Y0.nil?X:Y0._`${VX(X)} ${Z} ${VX(Q)}`}function VX(Z){return Z instanceof Y0.Name?Z:Y0._`(${Z})`}});var W0=j((Nq)=>{Object.defineProperty(Nq,"__esModule",{value:!0});Nq.checkStrictMode=Nq.getErrorPath=Nq.Type=Nq.useFunc=Nq.setEvaluated=Nq.evaluatedPropsToName=Nq.mergeEvaluated=Nq.eachItem=Nq.unescapeJsonPointer=Nq.escapeJsonPointer=Nq.escapeFragment=Nq.unescapeFragment=Nq.schemaRefOrVal=Nq.schemaHasRulesButRef=Nq.schemaHasRules=Nq.checkUnknownRules=Nq.alwaysValidSchema=Nq.toHash=void 0;var B0=Z0(),ZT=N9();function XT(Z){let X={};for(let Q of Z)X[Q]=!0;return X}Nq.toHash=XT;function QT(Z,X){if(typeof X=="boolean")return X;if(Object.keys(X).length===0)return!0;return Fq(Z,X),!Lq(X,Z.self.RULES.all)}Nq.alwaysValidSchema=QT;function Fq(Z,X=Z.schema){let{opts:Q,self:W}=Z;if(!Q.strictSchema)return;if(typeof X==="boolean")return;let J=W.RULES.keywords;for(let G in X)if(!J[G])Iq(Z,`unknown keyword: "${G}"`)}Nq.checkUnknownRules=Fq;function Lq(Z,X){if(typeof Z=="boolean")return!Z;for(let Q in Z)if(X[Q])return!0;return!1}Nq.schemaHasRules=Lq;function WT(Z,X){if(typeof Z=="boolean")return!Z;for(let Q in Z)if(Q!=="$ref"&&X.all[Q])return!0;return!1}Nq.schemaHasRulesButRef=WT;function JT({topSchemaRef:Z,schemaPath:X},Q,W,J){if(!J){if(typeof Q=="number"||typeof Q=="boolean")return Q;if(typeof Q=="string")return B0._`${Q}`}return B0._`${Z}${X}${(0,B0.getProperty)(W)}`}Nq.schemaRefOrVal=JT;function GT(Z){return Aq(decodeURIComponent(Z))}Nq.unescapeFragment=GT;function YT(Z){return encodeURIComponent(FX(Z))}Nq.escapeFragment=YT;function FX(Z){if(typeof Z=="number")return`${Z}`;return Z.replace(/~/g,"~0").replace(/\//g,"~1")}Nq.escapeJsonPointer=FX;function Aq(Z){return Z.replace(/~1/g,"/").replace(/~0/g,"~")}Nq.unescapeJsonPointer=Aq;function zT(Z,X){if(Array.isArray(Z))for(let Q of Z)X(Q);else X(Z)}Nq.eachItem=zT;function Bq({mergeNames:Z,mergeToName:X,mergeValues:Q,resultToName:W}){return(J,G,Y,z)=>{let q=Y===void 0?G:Y instanceof B0.Name?(G instanceof B0.Name?Z(J,G,Y):X(J,G,Y),Y):G instanceof B0.Name?(X(J,Y,G),G):Q(G,Y);return z===B0.Name&&!(q instanceof B0.Name)?W(J,q):q}}Nq.mergeEvaluated={props:Bq({mergeNames:(Z,X,Q)=>Z.if(B0._`${Q} !== true && ${X} !== undefined`,()=>{Z.if(B0._`${X} === true`,()=>Z.assign(Q,!0),()=>Z.assign(Q,B0._`${Q} || {}`).code(B0._`Object.assign(${Q}, ${X})`))}),mergeToName:(Z,X,Q)=>Z.if(B0._`${Q} !== true`,()=>{if(X===!0)Z.assign(Q,!0);else Z.assign(Q,B0._`${Q} || {}`),LX(Z,Q,X)}),mergeValues:(Z,X)=>Z===!0?!0:{...Z,...X},resultToName:Mq}),items:Bq({mergeNames:(Z,X,Q)=>Z.if(B0._`${Q} !== true && ${X} !== undefined`,()=>Z.assign(Q,B0._`${X} === true ? true : ${Q} > ${X} ? ${Q} : ${X}`)),mergeToName:(Z,X,Q)=>Z.if(B0._`${Q} !== true`,()=>Z.assign(Q,X===!0?!0:B0._`${Q} > ${X} ? ${Q} : ${X}`)),mergeValues:(Z,X)=>Z===!0?!0:Math.max(Z,X),resultToName:(Z,X)=>Z.var("items",X)})};function Mq(Z,X){if(X===!0)return Z.var("props",!0);let Q=Z.var("props",B0._`{}`);if(X!==void 0)LX(Z,Q,X);return Q}Nq.evaluatedPropsToName=Mq;function LX(Z,X,Q){Object.keys(Q).forEach((W)=>Z.assign(B0._`${X}${(0,B0.getProperty)(W)}`,!0))}Nq.setEvaluated=LX;var Hq={};function $T(Z,X){return Z.scopeValue("func",{ref:X,code:Hq[X.code]||(Hq[X.code]=new ZT._Code(X.code))})}Nq.useFunc=$T;var HX;(function(Z){Z[Z.Num=0]="Num",Z[Z.Str=1]="Str"})(HX||(Nq.Type=HX={}));function qT(Z,X,Q){if(Z instanceof B0.Name){let W=X===HX.Num;return Q?W?B0._`"[" + ${Z} + "]"`:B0._`"['" + ${Z} + "']"`:W?B0._`"/" + ${Z}`:B0._`"/" + ${Z}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return Q?(0,B0.getProperty)(Z).toString():"/"+FX(Z)}Nq.getErrorPath=qT;function Iq(Z,X,Q=Z.opts.strictSchema){if(!Q)return;if(X=`strict mode: ${X}`,Q===!0)throw Error(X);Z.self.logger.warn(X)}Nq.checkStrictMode=Iq});var A4=j((Tq)=>{Object.defineProperty(Tq,"__esModule",{value:!0});var u0=Z0(),RT={data:new u0.Name("data"),valCxt:new u0.Name("valCxt"),instancePath:new u0.Name("instancePath"),parentData:new u0.Name("parentData"),parentDataProperty:new u0.Name("parentDataProperty"),rootData:new u0.Name("rootData"),dynamicAnchors:new u0.Name("dynamicAnchors"),vErrors:new u0.Name("vErrors"),errors:new u0.Name("errors"),this:new u0.Name("this"),self:new u0.Name("self"),scope:new u0.Name("scope"),json:new u0.Name("json"),jsonPos:new u0.Name("jsonPos"),jsonLen:new u0.Name("jsonLen"),jsonPart:new u0.Name("jsonPart")};Tq.default=RT});var T9=j((Eq)=>{Object.defineProperty(Eq,"__esModule",{value:!0});Eq.extendErrors=Eq.resetErrorsCount=Eq.reportExtraError=Eq.reportError=Eq.keyword$DataError=Eq.keywordError=void 0;var z0=Z0(),V5=W0(),n0=A4();Eq.keywordError={message:({keyword:Z})=>z0.str`must pass "${Z}" keyword validation`};Eq.keyword$DataError={message:({keyword:Z,schemaType:X})=>X?z0.str`"${Z}" keyword must be ${X} ($data)`:z0.str`"${Z}" keyword is invalid ($data)`};function CT(Z,X=Eq.keywordError,Q,W){let{it:J}=Z,{gen:G,compositeRule:Y,allErrors:z}=J,q=Oq(Z,X,Q);if(W!==null&&W!==void 0?W:Y||z)wq(G,q);else jq(J,z0._`[${q}]`)}Eq.reportError=CT;function ST(Z,X=Eq.keywordError,Q){let{it:W}=Z,{gen:J,compositeRule:G,allErrors:Y}=W,z=Oq(Z,X,Q);if(wq(J,z),!(G||Y))jq(W,n0.default.vErrors)}Eq.reportExtraError=ST;function kT(Z,X){Z.assign(n0.default.errors,X),Z.if(z0._`${n0.default.vErrors} !== null`,()=>Z.if(X,()=>Z.assign(z0._`${n0.default.vErrors}.length`,X),()=>Z.assign(n0.default.vErrors,null)))}Eq.resetErrorsCount=kT;function bT({gen:Z,keyword:X,schemaValue:Q,data:W,errsCount:J,it:G}){if(J===void 0)throw Error("ajv implementation error");let Y=Z.name("err");Z.forRange("i",J,n0.default.errors,(z)=>{if(Z.const(Y,z0._`${n0.default.vErrors}[${z}]`),Z.if(z0._`${Y}.instancePath === undefined`,()=>Z.assign(z0._`${Y}.instancePath`,(0,z0.strConcat)(n0.default.instancePath,G.errorPath))),Z.assign(z0._`${Y}.schemaPath`,z0.str`${G.errSchemaPath}/${X}`),G.opts.verbose)Z.assign(z0._`${Y}.schema`,Q),Z.assign(z0._`${Y}.data`,W)})}Eq.extendErrors=bT;function wq(Z,X){let Q=Z.const("err",X);Z.if(z0._`${n0.default.vErrors} === null`,()=>Z.assign(n0.default.vErrors,z0._`[${Q}]`),z0._`${n0.default.vErrors}.push(${Q})`),Z.code(z0._`${n0.default.errors}++`)}function jq(Z,X){let{gen:Q,validateName:W,schemaEnv:J}=Z;if(J.$async)Q.throw(z0._`new ${Z.ValidationError}(${X})`);else Q.assign(z0._`${W}.errors`,X),Q.return(!1)}var i6={keyword:new z0.Name("keyword"),schemaPath:new z0.Name("schemaPath"),params:new z0.Name("params"),propertyName:new z0.Name("propertyName"),message:new z0.Name("message"),schema:new z0.Name("schema"),parentSchema:new z0.Name("parentSchema")};function Oq(Z,X,Q){let{createErrors:W}=Z.it;if(W===!1)return z0._`{}`;return _T(Z,X,Q)}function _T(Z,X,Q={}){let{gen:W,it:J}=Z,G=[xT(J,Q),vT(Z,Q)];return yT(Z,X,G),W.object(...G)}function xT({errorPath:Z},{instancePath:X}){let Q=X?z0.str`${Z}${(0,V5.getErrorPath)(X,V5.Type.Str)}`:Z;return[n0.default.instancePath,(0,z0.strConcat)(n0.default.instancePath,Q)]}function vT({keyword:Z,it:{errSchemaPath:X}},{schemaPath:Q,parentSchema:W}){let J=W?X:z0.str`${X}/${Z}`;if(Q)J=z0.str`${J}${(0,V5.getErrorPath)(Q,V5.Type.Str)}`;return[i6.schemaPath,J]}function yT(Z,{params:X,message:Q},W){let{keyword:J,data:G,schemaValue:Y,it:z}=Z,{opts:q,propertyName:K,topSchemaRef:V,schemaPath:B}=z;if(W.push([i6.keyword,J],[i6.params,typeof X=="function"?X(Z):X||z0._`{}`]),q.messages)W.push([i6.message,typeof Q=="function"?Q(Z):Q]);if(q.verbose)W.push([i6.schema,Y],[i6.parentSchema,z0._`${V}${B}`],[n0.default.data,G]);if(K)W.push([i6.propertyName,K])}});var kq=j((Cq)=>{Object.defineProperty(Cq,"__esModule",{value:!0});Cq.boolOrEmptySchema=Cq.topBoolOrEmptySchema=void 0;var mT=T9(),lT=Z0(),dT=A4(),cT={message:"boolean schema is false"};function pT(Z){let{gen:X,schema:Q,validateName:W}=Z;if(Q===!1)Pq(Z,!1);else if(typeof Q=="object"&&Q.$async===!0)X.return(dT.default.data);else X.assign(lT._`${W}.errors`,null),X.return(!0)}Cq.topBoolOrEmptySchema=pT;function nT(Z,X){let{gen:Q,schema:W}=Z;if(W===!1)Q.var(X,!1),Pq(Z);else Q.var(X,!0)}Cq.boolOrEmptySchema=nT;function Pq(Z,X){let{gen:Q,data:W}=Z,J={gen:Q,keyword:"false schema",data:W,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:Z};(0,mT.reportError)(J,cT,void 0,X)}});var MX=j((bq)=>{Object.defineProperty(bq,"__esModule",{value:!0});bq.getRules=bq.isJSONType=void 0;var rT=["string","number","integer","boolean","null","object","array"],aT=new Set(rT);function sT(Z){return typeof Z=="string"&&aT.has(Z)}bq.isJSONType=sT;function oT(){let Z={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...Z,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},Z.number,Z.string,Z.array,Z.object],post:{rules:[]},all:{},keywords:{}}}bq.getRules=oT});var IX=j((yq)=>{Object.defineProperty(yq,"__esModule",{value:!0});yq.shouldUseRule=yq.shouldUseGroup=yq.schemaHasRulesForType=void 0;function eT({schema:Z,self:X},Q){let W=X.RULES.types[Q];return W&&W!==!0&&xq(Z,W)}yq.schemaHasRulesForType=eT;function xq(Z,X){return X.rules.some((Q)=>vq(Z,Q))}yq.shouldUseGroup=xq;function vq(Z,X){var Q;return Z[X.keyword]!==void 0||((Q=X.definition.implements)===null||Q===void 0?void 0:Q.some((W)=>Z[W]!==void 0))}yq.shouldUseRule=vq});var w9=j((mq)=>{Object.defineProperty(mq,"__esModule",{value:!0});mq.reportTypeError=mq.checkDataTypes=mq.checkDataType=mq.coerceAndCheckDataType=mq.getJSONTypes=mq.getSchemaTypes=mq.DataType=void 0;var Qw=MX(),Ww=IX(),Jw=T9(),X0=Z0(),fq=W0(),v1;(function(Z){Z[Z.Correct=0]="Correct",Z[Z.Wrong=1]="Wrong"})(v1||(mq.DataType=v1={}));function Gw(Z){let X=hq(Z.type);if(X.includes("null")){if(Z.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!X.length&&Z.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(Z.nullable===!0)X.push("null")}return X}mq.getSchemaTypes=Gw;function hq(Z){let X=Array.isArray(Z)?Z:Z?[Z]:[];if(X.every(Qw.isJSONType))return X;throw Error("type must be JSONType or JSONType[]: "+X.join(","))}mq.getJSONTypes=hq;function Yw(Z,X){let{gen:Q,data:W,opts:J}=Z,G=zw(X,J.coerceTypes),Y=X.length>0&&!(G.length===0&&X.length===1&&(0,Ww.schemaHasRulesForType)(Z,X[0]));if(Y){let z=DX(X,W,J.strictNumbers,v1.Wrong);Q.if(z,()=>{if(G.length)$w(Z,X,G);else TX(Z)})}return Y}mq.coerceAndCheckDataType=Yw;var uq=new Set(["string","number","integer","boolean","null"]);function zw(Z,X){return X?Z.filter((Q)=>uq.has(Q)||X==="array"&&Q==="array"):[]}function $w(Z,X,Q){let{gen:W,data:J,opts:G}=Z,Y=W.let("dataType",X0._`typeof ${J}`),z=W.let("coerced",X0._`undefined`);if(G.coerceTypes==="array")W.if(X0._`${Y} == 'object' && Array.isArray(${J}) && ${J}.length == 1`,()=>W.assign(J,X0._`${J}[0]`).assign(Y,X0._`typeof ${J}`).if(DX(X,J,G.strictNumbers),()=>W.assign(z,J)));W.if(X0._`${z} !== undefined`);for(let K of Q)if(uq.has(K)||K==="array"&&G.coerceTypes==="array")q(K);W.else(),TX(Z),W.endIf(),W.if(X0._`${z} !== undefined`,()=>{W.assign(J,z),qw(Z,z)});function q(K){switch(K){case"string":W.elseIf(X0._`${Y} == "number" || ${Y} == "boolean"`).assign(z,X0._`"" + ${J}`).elseIf(X0._`${J} === null`).assign(z,X0._`""`);return;case"number":W.elseIf(X0._`${Y} == "boolean" || ${J} === null
310
- || (${Y} == "string" && ${J} && ${J} == +${J})`).assign(z,X0._`+${J}`);return;case"integer":W.elseIf(X0._`${Y} === "boolean" || ${J} === null
311
- || (${Y} === "string" && ${J} && ${J} == +${J} && !(${J} % 1))`).assign(z,X0._`+${J}`);return;case"boolean":W.elseIf(X0._`${J} === "false" || ${J} === 0 || ${J} === null`).assign(z,!1).elseIf(X0._`${J} === "true" || ${J} === 1`).assign(z,!0);return;case"null":W.elseIf(X0._`${J} === "" || ${J} === 0 || ${J} === false`),W.assign(z,null);return;case"array":W.elseIf(X0._`${Y} === "string" || ${Y} === "number"
312
- || ${Y} === "boolean" || ${J} === null`).assign(z,X0._`[${J}]`)}}}function qw({gen:Z,parentData:X,parentDataProperty:Q},W){Z.if(X0._`${X} !== undefined`,()=>Z.assign(X0._`${X}[${Q}]`,W))}function NX(Z,X,Q,W=v1.Correct){let J=W===v1.Correct?X0.operators.EQ:X0.operators.NEQ,G;switch(Z){case"null":return X0._`${X} ${J} null`;case"array":G=X0._`Array.isArray(${X})`;break;case"object":G=X0._`${X} && typeof ${X} == "object" && !Array.isArray(${X})`;break;case"integer":G=Y(X0._`!(${X} % 1) && !isNaN(${X})`);break;case"number":G=Y();break;default:return X0._`typeof ${X} ${J} ${Z}`}return W===v1.Correct?G:(0,X0.not)(G);function Y(z=X0.nil){return(0,X0.and)(X0._`typeof ${X} == "number"`,z,Q?X0._`isFinite(${X})`:X0.nil)}}mq.checkDataType=NX;function DX(Z,X,Q,W){if(Z.length===1)return NX(Z[0],X,Q,W);let J,G=(0,fq.toHash)(Z);if(G.array&&G.object){let Y=X0._`typeof ${X} != "object"`;J=G.null?Y:X0._`!${X} || ${Y}`,delete G.null,delete G.array,delete G.object}else J=X0.nil;if(G.number)delete G.integer;for(let Y in G)J=(0,X0.and)(J,NX(Y,X,Q,W));return J}mq.checkDataTypes=DX;var Kw={message:({schema:Z})=>`must be ${Z}`,params:({schema:Z,schemaValue:X})=>typeof Z=="string"?X0._`{type: ${Z}}`:X0._`{type: ${X}}`};function TX(Z){let X=Uw(Z);(0,Jw.reportError)(X,Kw)}mq.reportTypeError=TX;function Uw(Z){let{gen:X,data:Q,schema:W}=Z,J=(0,fq.schemaRefOrVal)(Z,W,"type");return{gen:X,keyword:"type",data:Q,schema:W.type,schemaCode:J,schemaValue:J,parentSchema:W,params:{},it:Z}}});var nq=j((cq)=>{Object.defineProperty(cq,"__esModule",{value:!0});cq.assignDefaults=void 0;var y1=Z0(),Mw=W0();function Iw(Z,X){let{properties:Q,items:W}=Z.schema;if(X==="object"&&Q)for(let J in Q)dq(Z,J,Q[J].default);else if(X==="array"&&Array.isArray(W))W.forEach((J,G)=>dq(Z,G,J.default))}cq.assignDefaults=Iw;function dq(Z,X,Q){let{gen:W,compositeRule:J,data:G,opts:Y}=Z;if(Q===void 0)return;let z=y1._`${G}${(0,y1.getProperty)(X)}`;if(J){(0,Mw.checkStrictMode)(Z,`default is ignored for: ${z}`);return}let q=y1._`${z} === undefined`;if(Y.useDefaults==="empty")q=y1._`${q} || ${z} === null || ${z} === ""`;W.if(q,y1._`${z} = ${(0,y1.stringify)(Q)}`)}});var M4=j((aq)=>{Object.defineProperty(aq,"__esModule",{value:!0});aq.validateUnion=aq.validateArray=aq.usePattern=aq.callValidateCode=aq.schemaProperties=aq.allSchemaProperties=aq.noPropertyInData=aq.propertyInData=aq.isOwnProperty=aq.hasPropFunc=aq.reportMissingProp=aq.checkMissingProp=aq.checkReportMissingProp=void 0;var A0=Z0(),wX=W0(),S6=A4(),Nw=W0();function Dw(Z,X){let{gen:Q,data:W,it:J}=Z;Q.if(OX(Q,W,X,J.opts.ownProperties),()=>{Z.setParams({missingProperty:A0._`${X}`},!0),Z.error()})}aq.checkReportMissingProp=Dw;function Tw({gen:Z,data:X,it:{opts:Q}},W,J){return(0,A0.or)(...W.map((G)=>(0,A0.and)(OX(Z,X,G,Q.ownProperties),A0._`${J} = ${G}`)))}aq.checkMissingProp=Tw;function ww(Z,X){Z.setParams({missingProperty:X},!0),Z.error()}aq.reportMissingProp=ww;function iq(Z){return Z.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:A0._`Object.prototype.hasOwnProperty`})}aq.hasPropFunc=iq;function jX(Z,X,Q){return A0._`${iq(Z)}.call(${X}, ${Q})`}aq.isOwnProperty=jX;function jw(Z,X,Q,W){let J=A0._`${X}${(0,A0.getProperty)(Q)} !== undefined`;return W?A0._`${J} && ${jX(Z,X,Q)}`:J}aq.propertyInData=jw;function OX(Z,X,Q,W){let J=A0._`${X}${(0,A0.getProperty)(Q)} === undefined`;return W?(0,A0.or)(J,(0,A0.not)(jX(Z,X,Q))):J}aq.noPropertyInData=OX;function rq(Z){return Z?Object.keys(Z).filter((X)=>X!=="__proto__"):[]}aq.allSchemaProperties=rq;function Ow(Z,X){return rq(X).filter((Q)=>!(0,wX.alwaysValidSchema)(Z,X[Q]))}aq.schemaProperties=Ow;function Ew({schemaCode:Z,data:X,it:{gen:Q,topSchemaRef:W,schemaPath:J,errorPath:G},it:Y},z,q,K){let V=K?A0._`${Z}, ${X}, ${W}${J}`:X,B=[[S6.default.instancePath,(0,A0.strConcat)(S6.default.instancePath,G)],[S6.default.parentData,Y.parentData],[S6.default.parentDataProperty,Y.parentDataProperty],[S6.default.rootData,S6.default.rootData]];if(Y.opts.dynamicRef)B.push([S6.default.dynamicAnchors,S6.default.dynamicAnchors]);let H=A0._`${V}, ${Q.object(...B)}`;return q!==A0.nil?A0._`${z}.call(${q}, ${H})`:A0._`${z}(${H})`}aq.callValidateCode=Ew;var Rw=A0._`new RegExp`;function Pw({gen:Z,it:{opts:X}},Q){let W=X.unicodeRegExp?"u":"",{regExp:J}=X.code,G=J(Q,W);return Z.scopeValue("pattern",{key:G.toString(),ref:G,code:A0._`${J.code==="new RegExp"?Rw:(0,Nw.useFunc)(Z,J)}(${Q}, ${W})`})}aq.usePattern=Pw;function Cw(Z){let{gen:X,data:Q,keyword:W,it:J}=Z,G=X.name("valid");if(J.allErrors){let z=X.let("valid",!0);return Y(()=>X.assign(z,!1)),z}return X.var(G,!0),Y(()=>X.break()),G;function Y(z){let q=X.const("len",A0._`${Q}.length`);X.forRange("i",0,q,(K)=>{Z.subschema({keyword:W,dataProp:K,dataPropType:wX.Type.Num},G),X.if((0,A0.not)(G),z)})}}aq.validateArray=Cw;function Sw(Z){let{gen:X,schema:Q,keyword:W,it:J}=Z;if(!Array.isArray(Q))throw Error("ajv implementation error");if(Q.some((q)=>(0,wX.alwaysValidSchema)(J,q))&&!J.opts.unevaluated)return;let Y=X.let("valid",!1),z=X.name("_valid");X.block(()=>Q.forEach((q,K)=>{let V=Z.subschema({keyword:W,schemaProp:K,compositeRule:!0},z);if(X.assign(Y,A0._`${Y} || ${z}`),!Z.mergeValidEvaluated(V,z))X.if((0,A0.not)(Y))})),Z.result(Y,()=>Z.reset(),()=>Z.error(!0))}aq.validateUnion=Sw});var XK=j((eq)=>{Object.defineProperty(eq,"__esModule",{value:!0});eq.validateKeywordUsage=eq.validSchemaType=eq.funcKeywordCode=eq.macroKeywordCode=void 0;var i0=Z0(),r6=A4(),dw=M4(),cw=T9();function pw(Z,X){let{gen:Q,keyword:W,schema:J,parentSchema:G,it:Y}=Z,z=X.macro.call(Y.self,J,G,Y),q=tq(Q,W,z);if(Y.opts.validateSchema!==!1)Y.self.validateSchema(z,!0);let K=Q.name("valid");Z.subschema({schema:z,schemaPath:i0.nil,errSchemaPath:`${Y.errSchemaPath}/${W}`,topSchemaRef:q,compositeRule:!0},K),Z.pass(K,()=>Z.error(!0))}eq.macroKeywordCode=pw;function nw(Z,X){var Q;let{gen:W,keyword:J,schema:G,parentSchema:Y,$data:z,it:q}=Z;rw(q,X);let K=!z&&X.compile?X.compile.call(q.self,G,Y,q):X.validate,V=tq(W,J,K),B=W.let("valid");Z.block$data(B,H),Z.ok((Q=X.valid)!==null&&Q!==void 0?Q:B);function H(){if(X.errors===!1){if(M(),X.modifying)oq(Z);I(()=>Z.error())}else{let N=X.async?F():A();if(X.modifying)oq(Z);I(()=>iw(Z,N))}}function F(){let N=W.let("ruleErrs",null);return W.try(()=>M(i0._`await `),(T)=>W.assign(B,!1).if(i0._`${T} instanceof ${q.ValidationError}`,()=>W.assign(N,i0._`${T}.errors`),()=>W.throw(T))),N}function A(){let N=i0._`${V}.errors`;return W.assign(N,null),M(i0.nil),N}function M(N=X.async?i0._`await `:i0.nil){let T=q.opts.passContext?r6.default.this:r6.default.self,S=!(("compile"in X)&&!z||X.schema===!1);W.assign(B,i0._`${N}${(0,dw.callValidateCode)(Z,V,T,S)}`,X.modifying)}function I(N){var T;W.if((0,i0.not)((T=X.valid)!==null&&T!==void 0?T:B),N)}}eq.funcKeywordCode=nw;function oq(Z){let{gen:X,data:Q,it:W}=Z;X.if(W.parentData,()=>X.assign(Q,i0._`${W.parentData}[${W.parentDataProperty}]`))}function iw(Z,X){let{gen:Q}=Z;Q.if(i0._`Array.isArray(${X})`,()=>{Q.assign(r6.default.vErrors,i0._`${r6.default.vErrors} === null ? ${X} : ${r6.default.vErrors}.concat(${X})`).assign(r6.default.errors,i0._`${r6.default.vErrors}.length`),(0,cw.extendErrors)(Z)},()=>Z.error())}function rw({schemaEnv:Z},X){if(X.async&&!Z.$async)throw Error("async keyword in sync schema")}function tq(Z,X,Q){if(Q===void 0)throw Error(`keyword "${X}" failed to compile`);return Z.scopeValue("keyword",typeof Q=="function"?{ref:Q}:{ref:Q,code:(0,i0.stringify)(Q)})}function aw(Z,X,Q=!1){return!X.length||X.some((W)=>W==="array"?Array.isArray(Z):W==="object"?Z&&typeof Z=="object"&&!Array.isArray(Z):typeof Z==W||Q&&typeof Z>"u")}eq.validSchemaType=aw;function sw({schema:Z,opts:X,self:Q,errSchemaPath:W},J,G){if(Array.isArray(J.keyword)?!J.keyword.includes(G):J.keyword!==G)throw Error("ajv implementation error");let Y=J.dependencies;if(Y===null||Y===void 0?void 0:Y.some((z)=>!Object.prototype.hasOwnProperty.call(Z,z)))throw Error(`parent schema must have dependencies of ${G}: ${Y.join(",")}`);if(J.validateSchema){if(!J.validateSchema(Z[G])){let q=`keyword "${G}" value is invalid at path "${W}": `+Q.errorsText(J.validateSchema.errors);if(X.validateSchema==="log")Q.logger.error(q);else throw Error(q)}}}eq.validateKeywordUsage=sw});var GK=j((WK)=>{Object.defineProperty(WK,"__esModule",{value:!0});WK.extendSubschemaMode=WK.extendSubschemaData=WK.getSubschema=void 0;var l4=Z0(),QK=W0();function Zj(Z,{keyword:X,schemaProp:Q,schema:W,schemaPath:J,errSchemaPath:G,topSchemaRef:Y}){if(X!==void 0&&W!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(X!==void 0){let z=Z.schema[X];return Q===void 0?{schema:z,schemaPath:l4._`${Z.schemaPath}${(0,l4.getProperty)(X)}`,errSchemaPath:`${Z.errSchemaPath}/${X}`}:{schema:z[Q],schemaPath:l4._`${Z.schemaPath}${(0,l4.getProperty)(X)}${(0,l4.getProperty)(Q)}`,errSchemaPath:`${Z.errSchemaPath}/${X}/${(0,QK.escapeFragment)(Q)}`}}if(W!==void 0){if(J===void 0||G===void 0||Y===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:W,schemaPath:J,topSchemaRef:Y,errSchemaPath:G}}throw Error('either "keyword" or "schema" must be passed')}WK.getSubschema=Zj;function Xj(Z,X,{dataProp:Q,dataPropType:W,data:J,dataTypes:G,propertyName:Y}){if(J!==void 0&&Q!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:z}=X;if(Q!==void 0){let{errorPath:K,dataPathArr:V,opts:B}=X,H=z.let("data",l4._`${X.data}${(0,l4.getProperty)(Q)}`,!0);q(H),Z.errorPath=l4.str`${K}${(0,QK.getErrorPath)(Q,W,B.jsPropertySyntax)}`,Z.parentDataProperty=l4._`${Q}`,Z.dataPathArr=[...V,Z.parentDataProperty]}if(J!==void 0){let K=J instanceof l4.Name?J:z.let("data",J,!0);if(q(K),Y!==void 0)Z.propertyName=Y}if(G)Z.dataTypes=G;function q(K){Z.data=K,Z.dataLevel=X.dataLevel+1,Z.dataTypes=[],X.definedProperties=new Set,Z.parentData=X.data,Z.dataNames=[...X.dataNames,K]}}WK.extendSubschemaData=Xj;function Qj(Z,{jtdDiscriminator:X,jtdMetadata:Q,compositeRule:W,createErrors:J,allErrors:G}){if(W!==void 0)Z.compositeRule=W;if(J!==void 0)Z.createErrors=J;if(G!==void 0)Z.allErrors=G;Z.jtdDiscriminator=X,Z.jtdMetadata=Q}WK.extendSubschemaMode=Qj});var EX=j((Hg,YK)=>{YK.exports=function Z(X,Q){if(X===Q)return!0;if(X&&Q&&typeof X=="object"&&typeof Q=="object"){if(X.constructor!==Q.constructor)return!1;var W,J,G;if(Array.isArray(X)){if(W=X.length,W!=Q.length)return!1;for(J=W;J--!==0;)if(!Z(X[J],Q[J]))return!1;return!0}if(X.constructor===RegExp)return X.source===Q.source&&X.flags===Q.flags;if(X.valueOf!==Object.prototype.valueOf)return X.valueOf()===Q.valueOf();if(X.toString!==Object.prototype.toString)return X.toString()===Q.toString();if(G=Object.keys(X),W=G.length,W!==Object.keys(Q).length)return!1;for(J=W;J--!==0;)if(!Object.prototype.hasOwnProperty.call(Q,G[J]))return!1;for(J=W;J--!==0;){var Y=G[J];if(!Z(X[Y],Q[Y]))return!1}return!0}return X!==X&&Q!==Q}});var $K=j((Fg,zK)=>{var k6=zK.exports=function(Z,X,Q){if(typeof X=="function")Q=X,X={};Q=X.cb||Q;var W=typeof Q=="function"?Q:Q.pre||function(){},J=Q.post||function(){};B5(X,W,J,Z,"",Z)};k6.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};k6.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};k6.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};k6.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function B5(Z,X,Q,W,J,G,Y,z,q,K){if(W&&typeof W=="object"&&!Array.isArray(W)){X(W,J,G,Y,z,q,K);for(var V in W){var B=W[V];if(Array.isArray(B)){if(V in k6.arrayKeywords)for(var H=0;H<B.length;H++)B5(Z,X,Q,B[H],J+"/"+V+"/"+H,G,J,V,W,H)}else if(V in k6.propsKeywords){if(B&&typeof B=="object")for(var F in B)B5(Z,X,Q,B[F],J+"/"+V+"/"+Gj(F),G,J,V,W,F)}else if(V in k6.keywords||Z.allKeys&&!(V in k6.skipKeywords))B5(Z,X,Q,B,J+"/"+V,G,J,V,W)}Q(W,J,G,Y,z,q,K)}}function Gj(Z){return Z.replace(/~/g,"~0").replace(/\//g,"~1")}});var j9=j((VK)=>{Object.defineProperty(VK,"__esModule",{value:!0});VK.getSchemaRefs=VK.resolveUrl=VK.normalizeId=VK._getFullPath=VK.getFullPath=VK.inlineRef=void 0;var Yj=W0(),zj=EX(),$j=$K(),qj=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Kj(Z,X=!0){if(typeof Z=="boolean")return!0;if(X===!0)return!RX(Z);if(!X)return!1;return qK(Z)<=X}VK.inlineRef=Kj;var Uj=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function RX(Z){for(let X in Z){if(Uj.has(X))return!0;let Q=Z[X];if(Array.isArray(Q)&&Q.some(RX))return!0;if(typeof Q=="object"&&RX(Q))return!0}return!1}function qK(Z){let X=0;for(let Q in Z){if(Q==="$ref")return 1/0;if(X++,qj.has(Q))continue;if(typeof Z[Q]=="object")(0,Yj.eachItem)(Z[Q],(W)=>X+=qK(W));if(X===1/0)return 1/0}return X}function KK(Z,X="",Q){if(Q!==!1)X=g1(X);let W=Z.parse(X);return UK(Z,W)}VK.getFullPath=KK;function UK(Z,X){return Z.serialize(X).split("#")[0]+"#"}VK._getFullPath=UK;var Vj=/#\/?$/;function g1(Z){return Z?Z.replace(Vj,""):""}VK.normalizeId=g1;function Bj(Z,X,Q){return Q=g1(Q),Z.resolve(X,Q)}VK.resolveUrl=Bj;var Hj=/^[a-z_][-a-z0-9._]*$/i;function Fj(Z,X){if(typeof Z=="boolean")return{};let{schemaId:Q,uriResolver:W}=this.opts,J=g1(Z[Q]||X),G={"":J},Y=KK(W,J,!1),z={},q=new Set;return $j(Z,{allKeys:!0},(B,H,F,A)=>{if(A===void 0)return;let M=Y+H,I=G[A];if(typeof B[Q]=="string")I=N.call(this,B[Q]);T.call(this,B.$anchor),T.call(this,B.$dynamicAnchor),G[H]=I;function N(S){let v=this.opts.uriResolver.resolve;if(S=g1(I?v(I,S):S),q.has(S))throw V(S);q.add(S);let x=this.refs[S];if(typeof x=="string")x=this.refs[x];if(typeof x=="object")K(B,x.schema,S);else if(S!==g1(M))if(S[0]==="#")K(B,z[S],S),z[S]=B;else this.refs[S]=M;return S}function T(S){if(typeof S=="string"){if(!Hj.test(S))throw Error(`invalid anchor "${S}"`);N.call(this,`#${S}`)}}}),z;function K(B,H,F){if(H!==void 0&&!zj(B,H))throw V(F)}function V(B){return Error(`reference "${B}" resolves to more than one schema`)}}VK.getSchemaRefs=Fj});var R9=j((PK)=>{Object.defineProperty(PK,"__esModule",{value:!0});PK.getData=PK.KeywordCxt=PK.validateFunctionCode=void 0;var MK=kq(),HK=w9(),CX=IX(),H5=w9(),Dj=nq(),E9=XK(),PX=GK(),n=Z0(),o=A4(),Tj=j9(),G6=W0(),O9=T9();function wj(Z){if(DK(Z)){if(TK(Z),NK(Z)){Ej(Z);return}}IK(Z,()=>(0,MK.topBoolOrEmptySchema)(Z))}PK.validateFunctionCode=wj;function IK({gen:Z,validateName:X,schema:Q,schemaEnv:W,opts:J},G){if(J.code.es5)Z.func(X,n._`${o.default.data}, ${o.default.valCxt}`,W.$async,()=>{Z.code(n._`"use strict"; ${FK(Q,J)}`),Oj(Z,J),Z.code(G)});else Z.func(X,n._`${o.default.data}, ${jj(J)}`,W.$async,()=>Z.code(FK(Q,J)).code(G))}function jj(Z){return n._`{${o.default.instancePath}="", ${o.default.parentData}, ${o.default.parentDataProperty}, ${o.default.rootData}=${o.default.data}${Z.dynamicRef?n._`, ${o.default.dynamicAnchors}={}`:n.nil}}={}`}function Oj(Z,X){Z.if(o.default.valCxt,()=>{if(Z.var(o.default.instancePath,n._`${o.default.valCxt}.${o.default.instancePath}`),Z.var(o.default.parentData,n._`${o.default.valCxt}.${o.default.parentData}`),Z.var(o.default.parentDataProperty,n._`${o.default.valCxt}.${o.default.parentDataProperty}`),Z.var(o.default.rootData,n._`${o.default.valCxt}.${o.default.rootData}`),X.dynamicRef)Z.var(o.default.dynamicAnchors,n._`${o.default.valCxt}.${o.default.dynamicAnchors}`)},()=>{if(Z.var(o.default.instancePath,n._`""`),Z.var(o.default.parentData,n._`undefined`),Z.var(o.default.parentDataProperty,n._`undefined`),Z.var(o.default.rootData,o.default.data),X.dynamicRef)Z.var(o.default.dynamicAnchors,n._`{}`)})}function Ej(Z){let{schema:X,opts:Q,gen:W}=Z;IK(Z,()=>{if(Q.$comment&&X.$comment)jK(Z);if(kj(Z),W.let(o.default.vErrors,null),W.let(o.default.errors,0),Q.unevaluated)Rj(Z);wK(Z),xj(Z)});return}function Rj(Z){let{gen:X,validateName:Q}=Z;Z.evaluated=X.const("evaluated",n._`${Q}.evaluated`),X.if(n._`${Z.evaluated}.dynamicProps`,()=>X.assign(n._`${Z.evaluated}.props`,n._`undefined`)),X.if(n._`${Z.evaluated}.dynamicItems`,()=>X.assign(n._`${Z.evaluated}.items`,n._`undefined`))}function FK(Z,X){let Q=typeof Z=="object"&&Z[X.schemaId];return Q&&(X.code.source||X.code.process)?n._`/*# sourceURL=${Q} */`:n.nil}function Pj(Z,X){if(DK(Z)){if(TK(Z),NK(Z)){Cj(Z,X);return}}(0,MK.boolOrEmptySchema)(Z,X)}function NK({schema:Z,self:X}){if(typeof Z=="boolean")return!Z;for(let Q in Z)if(X.RULES.all[Q])return!0;return!1}function DK(Z){return typeof Z.schema!="boolean"}function Cj(Z,X){let{schema:Q,gen:W,opts:J}=Z;if(J.$comment&&Q.$comment)jK(Z);bj(Z),_j(Z);let G=W.const("_errs",o.default.errors);wK(Z,G),W.var(X,n._`${G} === ${o.default.errors}`)}function TK(Z){(0,G6.checkUnknownRules)(Z),Sj(Z)}function wK(Z,X){if(Z.opts.jtd)return LK(Z,[],!1,X);let Q=(0,HK.getSchemaTypes)(Z.schema),W=(0,HK.coerceAndCheckDataType)(Z,Q);LK(Z,Q,!W,X)}function Sj(Z){let{schema:X,errSchemaPath:Q,opts:W,self:J}=Z;if(X.$ref&&W.ignoreKeywordsWithRef&&(0,G6.schemaHasRulesButRef)(X,J.RULES))J.logger.warn(`$ref: keywords ignored in schema at path "${Q}"`)}function kj(Z){let{schema:X,opts:Q}=Z;if(X.default!==void 0&&Q.useDefaults&&Q.strictSchema)(0,G6.checkStrictMode)(Z,"default is ignored in the schema root")}function bj(Z){let X=Z.schema[Z.opts.schemaId];if(X)Z.baseId=(0,Tj.resolveUrl)(Z.opts.uriResolver,Z.baseId,X)}function _j(Z){if(Z.schema.$async&&!Z.schemaEnv.$async)throw Error("async schema in sync schema")}function jK({gen:Z,schemaEnv:X,schema:Q,errSchemaPath:W,opts:J}){let G=Q.$comment;if(J.$comment===!0)Z.code(n._`${o.default.self}.logger.log(${G})`);else if(typeof J.$comment=="function"){let Y=n.str`${W}/$comment`,z=Z.scopeValue("root",{ref:X.root});Z.code(n._`${o.default.self}.opts.$comment(${G}, ${Y}, ${z}.schema)`)}}function xj(Z){let{gen:X,schemaEnv:Q,validateName:W,ValidationError:J,opts:G}=Z;if(Q.$async)X.if(n._`${o.default.errors} === 0`,()=>X.return(o.default.data),()=>X.throw(n._`new ${J}(${o.default.vErrors})`));else{if(X.assign(n._`${W}.errors`,o.default.vErrors),G.unevaluated)vj(Z);X.return(n._`${o.default.errors} === 0`)}}function vj({gen:Z,evaluated:X,props:Q,items:W}){if(Q instanceof n.Name)Z.assign(n._`${X}.props`,Q);if(W instanceof n.Name)Z.assign(n._`${X}.items`,W)}function LK(Z,X,Q,W){let{gen:J,schema:G,data:Y,allErrors:z,opts:q,self:K}=Z,{RULES:V}=K;if(G.$ref&&(q.ignoreKeywordsWithRef||!(0,G6.schemaHasRulesButRef)(G,V))){J.block(()=>EK(Z,"$ref",V.all.$ref.definition));return}if(!q.jtd)yj(Z,X);J.block(()=>{for(let H of V.rules)B(H);B(V.post)});function B(H){if(!(0,CX.shouldUseGroup)(G,H))return;if(H.type){if(J.if((0,H5.checkDataType)(H.type,Y,q.strictNumbers)),AK(Z,H),X.length===1&&X[0]===H.type&&Q)J.else(),(0,H5.reportTypeError)(Z);J.endIf()}else AK(Z,H);if(!z)J.if(n._`${o.default.errors} === ${W||0}`)}}function AK(Z,X){let{gen:Q,schema:W,opts:{useDefaults:J}}=Z;if(J)(0,Dj.assignDefaults)(Z,X.type);Q.block(()=>{for(let G of X.rules)if((0,CX.shouldUseRule)(W,G))EK(Z,G.keyword,G.definition,X.type)})}function yj(Z,X){if(Z.schemaEnv.meta||!Z.opts.strictTypes)return;if(gj(Z,X),!Z.opts.allowUnionTypes)fj(Z,X);hj(Z,Z.dataTypes)}function gj(Z,X){if(!X.length)return;if(!Z.dataTypes.length){Z.dataTypes=X;return}X.forEach((Q)=>{if(!OK(Z.dataTypes,Q))SX(Z,`type "${Q}" not allowed by context "${Z.dataTypes.join(",")}"`)}),mj(Z,X)}function fj(Z,X){if(X.length>1&&!(X.length===2&&X.includes("null")))SX(Z,"use allowUnionTypes to allow union type keyword")}function hj(Z,X){let Q=Z.self.RULES.all;for(let W in Q){let J=Q[W];if(typeof J=="object"&&(0,CX.shouldUseRule)(Z.schema,J)){let{type:G}=J.definition;if(G.length&&!G.some((Y)=>uj(X,Y)))SX(Z,`missing type "${G.join(",")}" for keyword "${W}"`)}}}function uj(Z,X){return Z.includes(X)||X==="number"&&Z.includes("integer")}function OK(Z,X){return Z.includes(X)||X==="integer"&&Z.includes("number")}function mj(Z,X){let Q=[];for(let W of Z.dataTypes)if(OK(X,W))Q.push(W);else if(X.includes("integer")&&W==="number")Q.push("integer");Z.dataTypes=Q}function SX(Z,X){let Q=Z.schemaEnv.baseId+Z.errSchemaPath;X+=` at "${Q}" (strictTypes)`,(0,G6.checkStrictMode)(Z,X,Z.opts.strictTypes)}class kX{constructor(Z,X,Q){if((0,E9.validateKeywordUsage)(Z,X,Q),this.gen=Z.gen,this.allErrors=Z.allErrors,this.keyword=Q,this.data=Z.data,this.schema=Z.schema[Q],this.$data=X.$data&&Z.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,G6.schemaRefOrVal)(Z,this.schema,Q,this.$data),this.schemaType=X.schemaType,this.parentSchema=Z.schema,this.params={},this.it=Z,this.def=X,this.$data)this.schemaCode=Z.gen.const("vSchema",RK(this.$data,Z));else if(this.schemaCode=this.schemaValue,!(0,E9.validSchemaType)(this.schema,X.schemaType,X.allowUndefined))throw Error(`${Q} value must be ${JSON.stringify(X.schemaType)}`);if("code"in X?X.trackErrors:X.errors!==!1)this.errsCount=Z.gen.const("_errs",o.default.errors)}result(Z,X,Q){this.failResult((0,n.not)(Z),X,Q)}failResult(Z,X,Q){if(this.gen.if(Z),Q)Q();else this.error();if(X){if(this.gen.else(),X(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(Z,X){this.failResult((0,n.not)(Z),void 0,X)}fail(Z){if(Z===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(Z),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(Z){if(!this.$data)return this.fail(Z);let{schemaCode:X}=this;this.fail(n._`${X} !== undefined && (${(0,n.or)(this.invalid$data(),Z)})`)}error(Z,X,Q){if(X){this.setParams(X),this._error(Z,Q),this.setParams({});return}this._error(Z,Q)}_error(Z,X){(Z?O9.reportExtraError:O9.reportError)(this,this.def.error,X)}$dataError(){(0,O9.reportError)(this,this.def.$dataError||O9.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,O9.resetErrorsCount)(this.gen,this.errsCount)}ok(Z){if(!this.allErrors)this.gen.if(Z)}setParams(Z,X){if(X)Object.assign(this.params,Z);else this.params=Z}block$data(Z,X,Q=n.nil){this.gen.block(()=>{this.check$data(Z,Q),X()})}check$data(Z=n.nil,X=n.nil){if(!this.$data)return;let{gen:Q,schemaCode:W,schemaType:J,def:G}=this;if(Q.if((0,n.or)(n._`${W} === undefined`,X)),Z!==n.nil)Q.assign(Z,!0);if(J.length||G.validateSchema){if(Q.elseIf(this.invalid$data()),this.$dataError(),Z!==n.nil)Q.assign(Z,!1)}Q.else()}invalid$data(){let{gen:Z,schemaCode:X,schemaType:Q,def:W,it:J}=this;return(0,n.or)(G(),Y());function G(){if(Q.length){if(!(X instanceof n.Name))throw Error("ajv implementation error");let z=Array.isArray(Q)?Q:[Q];return n._`${(0,H5.checkDataTypes)(z,X,J.opts.strictNumbers,H5.DataType.Wrong)}`}return n.nil}function Y(){if(W.validateSchema){let z=Z.scopeValue("validate$data",{ref:W.validateSchema});return n._`!${z}(${X})`}return n.nil}}subschema(Z,X){let Q=(0,PX.getSubschema)(this.it,Z);(0,PX.extendSubschemaData)(Q,this.it,Z),(0,PX.extendSubschemaMode)(Q,Z);let W={...this.it,...Q,items:void 0,props:void 0};return Pj(W,X),W}mergeEvaluated(Z,X){let{it:Q,gen:W}=this;if(!Q.opts.unevaluated)return;if(Q.props!==!0&&Z.props!==void 0)Q.props=G6.mergeEvaluated.props(W,Z.props,Q.props,X);if(Q.items!==!0&&Z.items!==void 0)Q.items=G6.mergeEvaluated.items(W,Z.items,Q.items,X)}mergeValidEvaluated(Z,X){let{it:Q,gen:W}=this;if(Q.opts.unevaluated&&(Q.props!==!0||Q.items!==!0))return W.if(X,()=>this.mergeEvaluated(Z,n.Name)),!0}}PK.KeywordCxt=kX;function EK(Z,X,Q,W){let J=new kX(Z,Q,X);if("code"in Q)Q.code(J,W);else if(J.$data&&Q.validate)(0,E9.funcKeywordCode)(J,Q);else if("macro"in Q)(0,E9.macroKeywordCode)(J,Q);else if(Q.compile||Q.validate)(0,E9.funcKeywordCode)(J,Q)}var lj=/^\/(?:[^~]|~0|~1)*$/,dj=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function RK(Z,{dataLevel:X,dataNames:Q,dataPathArr:W}){let J,G;if(Z==="")return o.default.rootData;if(Z[0]==="/"){if(!lj.test(Z))throw Error(`Invalid JSON-pointer: ${Z}`);J=Z,G=o.default.rootData}else{let K=dj.exec(Z);if(!K)throw Error(`Invalid JSON-pointer: ${Z}`);let V=+K[1];if(J=K[2],J==="#"){if(V>=X)throw Error(q("property/index",V));return W[X-V]}if(V>X)throw Error(q("data",V));if(G=Q[X-V],!J)return G}let Y=G,z=J.split("/");for(let K of z)if(K)G=n._`${G}${(0,n.getProperty)((0,G6.unescapeJsonPointer)(K))}`,Y=n._`${Y} && ${G}`;return Y;function q(K,V){return`Cannot access ${K} ${V} levels up, current level is ${X}`}}PK.getData=RK});var F5=j((kK)=>{Object.defineProperty(kK,"__esModule",{value:!0});class SK extends Error{constructor(Z){super("validation failed");this.errors=Z,this.ajv=this.validation=!0}}kK.default=SK});var P9=j((_K)=>{Object.defineProperty(_K,"__esModule",{value:!0});var bX=j9();class bK extends Error{constructor(Z,X,Q,W){super(W||`can't resolve reference ${Q} from id ${X}`);this.missingRef=(0,bX.resolveUrl)(Z,X,Q),this.missingSchema=(0,bX.normalizeId)((0,bX.getFullPath)(Z,this.missingRef))}}_K.default=bK});var S9=j((yK)=>{Object.defineProperty(yK,"__esModule",{value:!0});yK.resolveSchema=yK.getCompilingSchema=yK.resolveRef=yK.compileSchema=yK.SchemaEnv=void 0;var P4=Z0(),rj=F5(),a6=A4(),C4=j9(),xK=W0(),aj=R9();class C9{constructor(Z){var X;this.refs={},this.dynamicAnchors={};let Q;if(typeof Z.schema=="object")Q=Z.schema;this.schema=Z.schema,this.schemaId=Z.schemaId,this.root=Z.root||this,this.baseId=(X=Z.baseId)!==null&&X!==void 0?X:(0,C4.normalizeId)(Q===null||Q===void 0?void 0:Q[Z.schemaId||"$id"]),this.schemaPath=Z.schemaPath,this.localRefs=Z.localRefs,this.meta=Z.meta,this.$async=Q===null||Q===void 0?void 0:Q.$async,this.refs={}}}yK.SchemaEnv=C9;function xX(Z){let X=vK.call(this,Z);if(X)return X;let Q=(0,C4.getFullPath)(this.opts.uriResolver,Z.root.baseId),{es5:W,lines:J}=this.opts.code,{ownProperties:G}=this.opts,Y=new P4.CodeGen(this.scope,{es5:W,lines:J,ownProperties:G}),z;if(Z.$async)z=Y.scopeValue("Error",{ref:rj.default,code:P4._`require("ajv/dist/runtime/validation_error").default`});let q=Y.scopeName("validate");Z.validateName=q;let K={gen:Y,allErrors:this.opts.allErrors,data:a6.default.data,parentData:a6.default.parentData,parentDataProperty:a6.default.parentDataProperty,dataNames:[a6.default.data],dataPathArr:[P4.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:Y.scopeValue("schema",this.opts.code.source===!0?{ref:Z.schema,code:(0,P4.stringify)(Z.schema)}:{ref:Z.schema}),validateName:q,ValidationError:z,schema:Z.schema,schemaEnv:Z,rootId:Q,baseId:Z.baseId||Q,schemaPath:P4.nil,errSchemaPath:Z.schemaPath||(this.opts.jtd?"":"#"),errorPath:P4._`""`,opts:this.opts,self:this},V;try{this._compilations.add(Z),(0,aj.validateFunctionCode)(K),Y.optimize(this.opts.code.optimize);let B=Y.toString();if(V=`${Y.scopeRefs(a6.default.scope)}return ${B}`,this.opts.code.process)V=this.opts.code.process(V,Z);let F=Function(`${a6.default.self}`,`${a6.default.scope}`,V)(this,this.scope.get());if(this.scope.value(q,{ref:F}),F.errors=null,F.schema=Z.schema,F.schemaEnv=Z,Z.$async)F.$async=!0;if(this.opts.code.source===!0)F.source={validateName:q,validateCode:B,scopeValues:Y._values};if(this.opts.unevaluated){let{props:A,items:M}=K;if(F.evaluated={props:A instanceof P4.Name?void 0:A,items:M instanceof P4.Name?void 0:M,dynamicProps:A instanceof P4.Name,dynamicItems:M instanceof P4.Name},F.source)F.source.evaluated=(0,P4.stringify)(F.evaluated)}return Z.validate=F,Z}catch(B){if(delete Z.validate,delete Z.validateName,V)this.logger.error("Error compiling schema, function code:",V);throw B}finally{this._compilations.delete(Z)}}yK.compileSchema=xX;function sj(Z,X,Q){var W;Q=(0,C4.resolveUrl)(this.opts.uriResolver,X,Q);let J=Z.refs[Q];if(J)return J;let G=ej.call(this,Z,Q);if(G===void 0){let Y=(W=Z.localRefs)===null||W===void 0?void 0:W[Q],{schemaId:z}=this.opts;if(Y)G=new C9({schema:Y,schemaId:z,root:Z,baseId:X})}if(G===void 0)return;return Z.refs[Q]=oj.call(this,G)}yK.resolveRef=sj;function oj(Z){if((0,C4.inlineRef)(Z.schema,this.opts.inlineRefs))return Z.schema;return Z.validate?Z:xX.call(this,Z)}function vK(Z){for(let X of this._compilations)if(tj(X,Z))return X}yK.getCompilingSchema=vK;function tj(Z,X){return Z.schema===X.schema&&Z.root===X.root&&Z.baseId===X.baseId}function ej(Z,X){let Q;while(typeof(Q=this.refs[X])=="string")X=Q;return Q||this.schemas[X]||L5.call(this,Z,X)}function L5(Z,X){let Q=this.opts.uriResolver.parse(X),W=(0,C4._getFullPath)(this.opts.uriResolver,Q),J=(0,C4.getFullPath)(this.opts.uriResolver,Z.baseId,void 0);if(Object.keys(Z.schema).length>0&&W===J)return _X.call(this,Q,Z);let G=(0,C4.normalizeId)(W),Y=this.refs[G]||this.schemas[G];if(typeof Y=="string"){let z=L5.call(this,Z,Y);if(typeof(z===null||z===void 0?void 0:z.schema)!=="object")return;return _X.call(this,Q,z)}if(typeof(Y===null||Y===void 0?void 0:Y.schema)!=="object")return;if(!Y.validate)xX.call(this,Y);if(G===(0,C4.normalizeId)(X)){let{schema:z}=Y,{schemaId:q}=this.opts,K=z[q];if(K)J=(0,C4.resolveUrl)(this.opts.uriResolver,J,K);return new C9({schema:z,schemaId:q,root:Z,baseId:J})}return _X.call(this,Q,Y)}yK.resolveSchema=L5;var ZO=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function _X(Z,{baseId:X,schema:Q,root:W}){var J;if(((J=Z.fragment)===null||J===void 0?void 0:J[0])!=="/")return;for(let z of Z.fragment.slice(1).split("/")){if(typeof Q==="boolean")return;let q=Q[(0,xK.unescapeFragment)(z)];if(q===void 0)return;Q=q;let K=typeof Q==="object"&&Q[this.opts.schemaId];if(!ZO.has(z)&&K)X=(0,C4.resolveUrl)(this.opts.uriResolver,X,K)}let G;if(typeof Q!="boolean"&&Q.$ref&&!(0,xK.schemaHasRulesButRef)(Q,this.RULES)){let z=(0,C4.resolveUrl)(this.opts.uriResolver,X,Q.$ref);G=L5.call(this,W,z)}let{schemaId:Y}=this.opts;if(G=G||new C9({schema:Q,schemaId:Y,root:W,baseId:X}),G.schema!==G.root.schema)return G;return}});var fK=j((Dg,GO)=>{GO.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var gX=j((Tg,cK)=>{var YO=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),uK=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),vX=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),mK=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),zO=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function yX(Z){let X="",Q=0,W=0;for(W=0;W<Z.length;W++){if(Q=Z[W].charCodeAt(0),Q===48)continue;if(!(Q>=48&&Q<=57||Q>=65&&Q<=70||Q>=97&&Q<=102))return"";X+=Z[W];break}for(W+=1;W<Z.length;W++){if(Q=Z[W].charCodeAt(0),!(Q>=48&&Q<=57||Q>=65&&Q<=70||Q>=97&&Q<=102))return"";X+=Z[W]}return X}var $O=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function hK(Z){return Z.length=0,!0}function qO(Z,X,Q){if(Z.length){let W=yX(Z);if(W!=="")X.push(W);else return Q.error=!0,!1;Z.length=0}return!0}function KO(Z){let X=0,Q={error:!1,address:"",zone:""},W=[],J=[],G=!1,Y=!1,z=qO;for(let q=0;q<Z.length;q++){let K=Z[q];if(K==="["||K==="]")continue;if(K===":"){if(G===!0)Y=!0;if(!z(J,W,Q))break;if(++X>7){Q.error=!0;break}if(q>0&&Z[q-1]===":")G=!0;W.push(":");continue}else if(K==="%"){if(!z(J,W,Q))break;z=hK}else{J.push(K);continue}}if(J.length)if(z===hK)Q.zone=J.join("");else if(Y)W.push(J.join(""));else W.push(yX(J));return Q.address=W.join(""),Q}function lK(Z){if(UO(Z,":")<2)return{host:Z,isIPV6:!1};let X=KO(Z);if(!X.error){let{address:Q,address:W}=X;if(X.zone)Q+="%"+X.zone,W+="%25"+X.zone;return{host:Q,isIPV6:!0,escapedHost:W}}else return{host:Z,isIPV6:!1}}function UO(Z,X){let Q=0;for(let W=0;W<Z.length;W++)if(Z[W]===X)Q++;return Q}function VO(Z){let X=Z,Q=[],W=-1,J=0;while(J=X.length){if(J===1)if(X===".")break;else if(X==="/"){Q.push("/");break}else{Q.push(X);break}else if(J===2){if(X[0]==="."){if(X[1]===".")break;else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."||X[1]==="/"){Q.push("/");break}}}else if(J===3){if(X==="/.."){if(Q.length!==0)Q.pop();Q.push("/");break}}if(X[0]==="."){if(X[1]==="."){if(X[2]==="/"){X=X.slice(3);continue}}else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."){if(X[2]==="/"){X=X.slice(2);continue}else if(X[2]==="."){if(X[3]==="/"){if(X=X.slice(3),Q.length!==0)Q.pop();continue}}}}if((W=X.indexOf("/",1))===-1){Q.push(X);break}else Q.push(X.slice(0,W)),X=X.slice(W)}return Q.join("")}var BO={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},HO=/[@/?#:]/g,FO=/[@/?#]/g;function dK(Z,X){let Q=X?FO:HO;return Q.lastIndex=0,Z.replace(Q,(W)=>BO[W])}function LO(Z,X=!1){if(Z.indexOf("%")===-1)return Z;let Q="";for(let W=0;W<Z.length;W++){if(Z[W]==="%"&&W+2<Z.length){let J=Z.slice(W+1,W+3);if(vX(J)){let G=J.toUpperCase(),Y=String.fromCharCode(parseInt(G,16));if(X&&mK(Y))Q+=Y;else Q+="%"+G;W+=2;continue}}Q+=Z[W]}return Q}function AO(Z){let X="";for(let Q=0;Q<Z.length;Q++){if(Z[Q]==="%"&&Q+2<Z.length){let W=Z.slice(Q+1,Q+3);if(vX(W)){let J=W.toUpperCase(),G=String.fromCharCode(parseInt(J,16));if(G!=="."&&mK(G))X+=G;else X+="%"+J;Q+=2;continue}}if(zO(Z[Q]))X+=Z[Q];else X+=escape(Z[Q])}return X}function MO(Z){let X="";for(let Q=0;Q<Z.length;Q++){if(Z[Q]==="%"&&Q+2<Z.length){let W=Z.slice(Q+1,Q+3);if(vX(W)){X+="%"+W.toUpperCase(),Q+=2;continue}}X+=escape(Z[Q])}return X}function IO(Z){let X=[];if(Z.userinfo!==void 0)X.push(Z.userinfo),X.push("@");if(Z.host!==void 0){let Q=unescape(Z.host);if(!uK(Q)){let W=lK(Q);if(W.isIPV6===!0)Q=`[${W.escapedHost}]`;else Q=dK(Q,!1)}X.push(Q)}if(typeof Z.port==="number"||typeof Z.port==="string")X.push(":"),X.push(String(Z.port));return X.length?X.join(""):void 0}cK.exports={nonSimpleDomain:$O,recomposeAuthority:IO,reescapeHostDelimiters:dK,normalizePercentEncoding:LO,normalizePathEncoding:AO,escapePreservingEscapes:MO,removeDotSegments:VO,isIPv4:uK,isUUID:YO,normalizeIPv6:lK,stringArrayToHexStripped:yX}});var aK=j((wg,rK)=>{var{isUUID:NO}=gX(),DO=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,TO=["http","https","ws","wss","urn","urn:uuid"];function wO(Z){return TO.indexOf(Z)!==-1}function fX(Z){if(Z.secure===!0)return!0;else if(Z.secure===!1)return!1;else if(Z.scheme)return Z.scheme.length===3&&(Z.scheme[0]==="w"||Z.scheme[0]==="W")&&(Z.scheme[1]==="s"||Z.scheme[1]==="S")&&(Z.scheme[2]==="s"||Z.scheme[2]==="S");else return!1}function pK(Z){if(!Z.host)Z.error=Z.error||"HTTP URIs must have a host.";return Z}function nK(Z){let X=String(Z.scheme).toLowerCase()==="https";if(Z.port===(X?443:80)||Z.port==="")Z.port=void 0;if(!Z.path)Z.path="/";return Z}function jO(Z){return Z.secure=fX(Z),Z.resourceName=(Z.path||"/")+(Z.query?"?"+Z.query:""),Z.path=void 0,Z.query=void 0,Z}function OO(Z){if(Z.port===(fX(Z)?443:80)||Z.port==="")Z.port=void 0;if(typeof Z.secure==="boolean")Z.scheme=Z.secure?"wss":"ws",Z.secure=void 0;if(Z.resourceName){let[X,Q]=Z.resourceName.split("?");Z.path=X&&X!=="/"?X:void 0,Z.query=Q,Z.resourceName=void 0}return Z.fragment=void 0,Z}function EO(Z,X){if(!Z.path)return Z.error="URN can not be parsed",Z;let Q=Z.path.match(DO);if(Q){let W=X.scheme||Z.scheme||"urn";Z.nid=Q[1].toLowerCase(),Z.nss=Q[2];let J=`${W}:${X.nid||Z.nid}`,G=hX(J);if(Z.path=void 0,G)Z=G.parse(Z,X)}else Z.error=Z.error||"URN can not be parsed.";return Z}function RO(Z,X){if(Z.nid===void 0)throw Error("URN without nid cannot be serialized");let Q=X.scheme||Z.scheme||"urn",W=Z.nid.toLowerCase(),J=`${Q}:${X.nid||W}`,G=hX(J);if(G)Z=G.serialize(Z,X);let Y=Z,z=Z.nss;return Y.path=`${W||X.nid}:${z}`,X.skipEscape=!0,Y}function PO(Z,X){let Q=Z;if(Q.uuid=Q.nss,Q.nss=void 0,!X.tolerant&&(!Q.uuid||!NO(Q.uuid)))Q.error=Q.error||"UUID is not valid.";return Q}function CO(Z){let X=Z;return X.nss=(Z.uuid||"").toLowerCase(),X}var iK={scheme:"http",domainHost:!0,parse:pK,serialize:nK},SO={scheme:"https",domainHost:iK.domainHost,parse:pK,serialize:nK},A5={scheme:"ws",domainHost:!0,parse:jO,serialize:OO},kO={scheme:"wss",domainHost:A5.domainHost,parse:A5.parse,serialize:A5.serialize},bO={scheme:"urn",parse:EO,serialize:RO,skipNormalize:!0},_O={scheme:"urn:uuid",parse:PO,serialize:CO,skipNormalize:!0},M5={http:iK,https:SO,ws:A5,wss:kO,urn:bO,"urn:uuid":_O};Object.setPrototypeOf(M5,null);function hX(Z){return Z&&(M5[Z]||M5[Z.toLowerCase()])||void 0}rK.exports={wsIsSecure:fX,SCHEMES:M5,isValidSchemeName:wO,getSchemeHandler:hX}});var X3=j((jg,I5)=>{var{normalizeIPv6:xO,removeDotSegments:k9,recomposeAuthority:vO,normalizePercentEncoding:yO,normalizePathEncoding:gO,escapePreservingEscapes:fO,reescapeHostDelimiters:hO,isIPv4:uO,nonSimpleDomain:mO}=gX(),{SCHEMES:lO,getSchemeHandler:oK}=aK();function dO(Z,X){if(typeof Z==="string")Z=rO(Z,X);else if(typeof Z==="object")Z=f1(s6(Z,X),X);return Z}function cO(Z,X,Q){let W=Q?Object.assign({scheme:"null"},Q):{scheme:"null"},J=tK(f1(Z,W),f1(X,W),W,!0);return W.skipEscape=!0,s6(J,W)}function tK(Z,X,Q,W){let J={};if(!W)Z=f1(s6(Z,Q),Q),X=f1(s6(X,Q),Q);if(Q=Q||{},!Q.tolerant&&X.scheme)J.scheme=X.scheme,J.userinfo=X.userinfo,J.host=X.host,J.port=X.port,J.path=k9(X.path||""),J.query=X.query;else{if(X.userinfo!==void 0||X.host!==void 0||X.port!==void 0)J.userinfo=X.userinfo,J.host=X.host,J.port=X.port,J.path=k9(X.path||""),J.query=X.query;else{if(!X.path)if(J.path=Z.path,X.query!==void 0)J.query=X.query;else J.query=Z.query;else{if(X.path[0]==="/")J.path=k9(X.path);else{if((Z.userinfo!==void 0||Z.host!==void 0||Z.port!==void 0)&&!Z.path)J.path="/"+X.path;else if(!Z.path)J.path=X.path;else J.path=Z.path.slice(0,Z.path.lastIndexOf("/")+1)+X.path;J.path=k9(J.path)}J.query=X.query}J.userinfo=Z.userinfo,J.host=Z.host,J.port=Z.port}J.scheme=Z.scheme}return J.fragment=X.fragment,J}function pO(Z,X,Q){let W=sK(Z,Q),J=sK(X,Q);return W!==void 0&&J!==void 0&&W.toLowerCase()===J.toLowerCase()}function s6(Z,X){let Q={host:Z.host,scheme:Z.scheme,userinfo:Z.userinfo,port:Z.port,path:Z.path,query:Z.query,nid:Z.nid,nss:Z.nss,uuid:Z.uuid,fragment:Z.fragment,reference:Z.reference,resourceName:Z.resourceName,secure:Z.secure,error:""},W=Object.assign({},X),J=[],G=oK(W.scheme||Q.scheme);if(G&&G.serialize)G.serialize(Q,W);if(Q.path!==void 0)if(!W.skipEscape){if(Q.path=fO(Q.path),Q.scheme!==void 0)Q.path=Q.path.split("%3A").join(":")}else Q.path=yO(Q.path);if(W.reference!=="suffix"&&Q.scheme)J.push(Q.scheme,":");let Y=vO(Q);if(Y!==void 0){if(W.reference!=="suffix")J.push("//");if(J.push(Y),Q.path&&Q.path[0]!=="/")J.push("/")}if(Q.path!==void 0){let z=Q.path;if(!W.absolutePath&&(!G||!G.absolutePath))z=k9(z);if(Y===void 0&&z[0]==="/"&&z[1]==="/")z="/%2F"+z.slice(2);J.push(z)}if(Q.query!==void 0)J.push("?",Q.query);if(Q.fragment!==void 0)J.push("#",Q.fragment);return J.join("")}var nO=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function iO(Z,X){if(X[2]!==void 0&&Z.path&&Z.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof Z.port==="number"&&(Z.port<0||Z.port>65535))return"URI port is malformed.";return}function eK(Z,X){let Q=Object.assign({},X),W={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},J=!1,G=!1;if(Q.reference==="suffix")if(Q.scheme)Z=Q.scheme+":"+Z;else Z="//"+Z;let Y=Z.match(nO);if(Y){if(W.scheme=Y[1],W.userinfo=Y[3],W.host=Y[4],W.port=parseInt(Y[5],10),W.path=Y[6]||"",W.query=Y[7],W.fragment=Y[8],isNaN(W.port))W.port=Y[5];let z=iO(W,Y);if(z!==void 0)W.error=W.error||z,J=!0;if(W.host)if(uO(W.host)===!1){let V=xO(W.host);W.host=V.host.toLowerCase(),G=V.isIPV6}else G=!0;if(W.scheme===void 0&&W.userinfo===void 0&&W.host===void 0&&W.port===void 0&&W.query===void 0&&!W.path)W.reference="same-document";else if(W.scheme===void 0)W.reference="relative";else if(W.fragment===void 0)W.reference="absolute";else W.reference="uri";if(Q.reference&&Q.reference!=="suffix"&&Q.reference!==W.reference)W.error=W.error||"URI is not a "+Q.reference+" reference.";let q=oK(Q.scheme||W.scheme);if(!Q.unicodeSupport&&(!q||!q.unicodeSupport)){if(W.host&&(Q.domainHost||q&&q.domainHost)&&G===!1&&mO(W.host))try{W.host=URL.domainToASCII(W.host.toLowerCase())}catch(K){W.error=W.error||"Host's domain name can not be converted to ASCII: "+K}}if(!q||q&&!q.skipNormalize){if(Z.indexOf("%")!==-1){if(W.scheme!==void 0)W.scheme=unescape(W.scheme);if(W.host!==void 0)W.host=hO(unescape(W.host),G)}if(W.path)W.path=gO(W.path);if(W.fragment)try{W.fragment=encodeURI(decodeURIComponent(W.fragment))}catch{W.error=W.error||"URI malformed"}}if(q&&q.parse)q.parse(W,Q)}else W.error=W.error||"URI can not be parsed.";return{parsed:W,malformedAuthorityOrPort:J}}function f1(Z,X){return eK(Z,X).parsed}function rO(Z,X){return Z3(Z,X).normalized}function Z3(Z,X){let{parsed:Q,malformedAuthorityOrPort:W}=eK(Z,X);return{normalized:W?Z:s6(Q,X),malformedAuthorityOrPort:W}}function sK(Z,X){if(typeof Z==="string"){let{normalized:Q,malformedAuthorityOrPort:W}=Z3(Z,X);return W?void 0:Q}if(typeof Z==="object")return s6(Z,X)}var uX={SCHEMES:lO,normalize:dO,resolve:cO,resolveComponent:tK,equal:pO,serialize:s6,parse:f1};I5.exports=uX;I5.exports.default=uX;I5.exports.fastUri=uX});var J3=j((W3)=>{Object.defineProperty(W3,"__esModule",{value:!0});var Q3=X3();Q3.code='require("ajv/dist/runtime/uri").default';W3.default=Q3});var V3=j((Y6)=>{Object.defineProperty(Y6,"__esModule",{value:!0});Y6.CodeGen=Y6.Name=Y6.nil=Y6.stringify=Y6.str=Y6._=Y6.KeywordCxt=void 0;var sO=R9();Object.defineProperty(Y6,"KeywordCxt",{enumerable:!0,get:function(){return sO.KeywordCxt}});var h1=Z0();Object.defineProperty(Y6,"_",{enumerable:!0,get:function(){return h1._}});Object.defineProperty(Y6,"str",{enumerable:!0,get:function(){return h1.str}});Object.defineProperty(Y6,"stringify",{enumerable:!0,get:function(){return h1.stringify}});Object.defineProperty(Y6,"nil",{enumerable:!0,get:function(){return h1.nil}});Object.defineProperty(Y6,"Name",{enumerable:!0,get:function(){return h1.Name}});Object.defineProperty(Y6,"CodeGen",{enumerable:!0,get:function(){return h1.CodeGen}});var oO=F5(),q3=P9(),tO=MX(),b9=S9(),eO=Z0(),_9=j9(),N5=w9(),lX=W0(),G3=fK(),ZE=J3(),K3=(Z,X)=>new RegExp(Z,X);K3.code="new RegExp";var XE=["removeAdditional","useDefaults","coerceTypes"],QE=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),WE={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},JE={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Y3=200;function GE(Z){var X,Q,W,J,G,Y,z,q,K,V,B,H,F,A,M,I,N,T,S,v,x,p,f,s,K0;let E0=Z.strict,f0=(X=Z.code)===null||X===void 0?void 0:X.optimize,N4=f0===!0||f0===void 0?1:f0||0,$4=(W=(Q=Z.code)===null||Q===void 0?void 0:Q.regExp)!==null&&W!==void 0?W:K3,r=(J=Z.uriResolver)!==null&&J!==void 0?J:ZE.default;return{strictSchema:(Y=(G=Z.strictSchema)!==null&&G!==void 0?G:E0)!==null&&Y!==void 0?Y:!0,strictNumbers:(q=(z=Z.strictNumbers)!==null&&z!==void 0?z:E0)!==null&&q!==void 0?q:!0,strictTypes:(V=(K=Z.strictTypes)!==null&&K!==void 0?K:E0)!==null&&V!==void 0?V:"log",strictTuples:(H=(B=Z.strictTuples)!==null&&B!==void 0?B:E0)!==null&&H!==void 0?H:"log",strictRequired:(A=(F=Z.strictRequired)!==null&&F!==void 0?F:E0)!==null&&A!==void 0?A:!1,code:Z.code?{...Z.code,optimize:N4,regExp:$4}:{optimize:N4,regExp:$4},loopRequired:(M=Z.loopRequired)!==null&&M!==void 0?M:Y3,loopEnum:(I=Z.loopEnum)!==null&&I!==void 0?I:Y3,meta:(N=Z.meta)!==null&&N!==void 0?N:!0,messages:(T=Z.messages)!==null&&T!==void 0?T:!0,inlineRefs:(S=Z.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(v=Z.schemaId)!==null&&v!==void 0?v:"$id",addUsedSchema:(x=Z.addUsedSchema)!==null&&x!==void 0?x:!0,validateSchema:(p=Z.validateSchema)!==null&&p!==void 0?p:!0,validateFormats:(f=Z.validateFormats)!==null&&f!==void 0?f:!0,unicodeRegExp:(s=Z.unicodeRegExp)!==null&&s!==void 0?s:!0,int32range:(K0=Z.int32range)!==null&&K0!==void 0?K0:!0,uriResolver:r}}class D5{constructor(Z={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,Z=this.opts={...Z,...GE(Z)};let{es5:X,lines:Q}=this.opts.code;this.scope=new eO.ValueScope({scope:{},prefixes:QE,es5:X,lines:Q}),this.logger=UE(Z.logger);let W=Z.validateFormats;if(Z.validateFormats=!1,this.RULES=(0,tO.getRules)(),z3.call(this,WE,Z,"NOT SUPPORTED"),z3.call(this,JE,Z,"DEPRECATED","warn"),this._metaOpts=qE.call(this),Z.formats)zE.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),Z.keywords)$E.call(this,Z.keywords);if(typeof Z.meta=="object")this.addMetaSchema(Z.meta);YE.call(this),Z.validateFormats=W}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:Z,meta:X,schemaId:Q}=this.opts,W=G3;if(Q==="id")W={...G3},W.id=W.$id,delete W.$id;if(X&&Z)this.addMetaSchema(W,W[Q],!1)}defaultMeta(){let{meta:Z,schemaId:X}=this.opts;return this.opts.defaultMeta=typeof Z=="object"?Z[X]||Z:void 0}validate(Z,X){let Q;if(typeof Z=="string"){if(Q=this.getSchema(Z),!Q)throw Error(`no schema with key or ref "${Z}"`)}else Q=this.compile(Z);let W=Q(X);if(!("$async"in Q))this.errors=Q.errors;return W}compile(Z,X){let Q=this._addSchema(Z,X);return Q.validate||this._compileSchemaEnv(Q)}compileAsync(Z,X){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:Q}=this.opts;return W.call(this,Z,X);async function W(K,V){await J.call(this,K.$schema);let B=this._addSchema(K,V);return B.validate||G.call(this,B)}async function J(K){if(K&&!this.getSchema(K))await W.call(this,{$ref:K},!0)}async function G(K){try{return this._compileSchemaEnv(K)}catch(V){if(!(V instanceof q3.default))throw V;return Y.call(this,V),await z.call(this,V.missingSchema),G.call(this,K)}}function Y({missingSchema:K,missingRef:V}){if(this.refs[K])throw Error(`AnySchema ${K} is loaded but ${V} cannot be resolved`)}async function z(K){let V=await q.call(this,K);if(!this.refs[K])await J.call(this,V.$schema);if(!this.refs[K])this.addSchema(V,K,X)}async function q(K){let V=this._loading[K];if(V)return V;try{return await(this._loading[K]=Q(K))}finally{delete this._loading[K]}}}addSchema(Z,X,Q,W=this.opts.validateSchema){if(Array.isArray(Z)){for(let G of Z)this.addSchema(G,void 0,Q,W);return this}let J;if(typeof Z==="object"){let{schemaId:G}=this.opts;if(J=Z[G],J!==void 0&&typeof J!="string")throw Error(`schema ${G} must be string`)}return X=(0,_9.normalizeId)(X||J),this._checkUnique(X),this.schemas[X]=this._addSchema(Z,Q,X,W,!0),this}addMetaSchema(Z,X,Q=this.opts.validateSchema){return this.addSchema(Z,X,!0,Q),this}validateSchema(Z,X){if(typeof Z=="boolean")return!0;let Q;if(Q=Z.$schema,Q!==void 0&&typeof Q!="string")throw Error("$schema must be a string");if(Q=Q||this.opts.defaultMeta||this.defaultMeta(),!Q)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let W=this.validate(Q,Z);if(!W&&X){let J="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(J);else throw Error(J)}return W}getSchema(Z){let X;while(typeof(X=$3.call(this,Z))=="string")Z=X;if(X===void 0){let{schemaId:Q}=this.opts,W=new b9.SchemaEnv({schema:{},schemaId:Q});if(X=b9.resolveSchema.call(this,W,Z),!X)return;this.refs[Z]=X}return X.validate||this._compileSchemaEnv(X)}removeSchema(Z){if(Z instanceof RegExp)return this._removeAllSchemas(this.schemas,Z),this._removeAllSchemas(this.refs,Z),this;switch(typeof Z){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let X=$3.call(this,Z);if(typeof X=="object")this._cache.delete(X.schema);return delete this.schemas[Z],delete this.refs[Z],this}case"object":{let X=Z;this._cache.delete(X);let Q=Z[this.opts.schemaId];if(Q)Q=(0,_9.normalizeId)(Q),delete this.schemas[Q],delete this.refs[Q];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(Z){for(let X of Z)this.addKeyword(X);return this}addKeyword(Z,X){let Q;if(typeof Z=="string"){if(Q=Z,typeof X=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),X.keyword=Q}else if(typeof Z=="object"&&X===void 0){if(X=Z,Q=X.keyword,Array.isArray(Q)&&!Q.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(BE.call(this,Q,X),!X)return(0,lX.eachItem)(Q,(J)=>mX.call(this,J)),this;FE.call(this,X);let W={...X,type:(0,N5.getJSONTypes)(X.type),schemaType:(0,N5.getJSONTypes)(X.schemaType)};return(0,lX.eachItem)(Q,W.type.length===0?(J)=>mX.call(this,J,W):(J)=>W.type.forEach((G)=>mX.call(this,J,W,G))),this}getKeyword(Z){let X=this.RULES.all[Z];return typeof X=="object"?X.definition:!!X}removeKeyword(Z){let{RULES:X}=this;delete X.keywords[Z],delete X.all[Z];for(let Q of X.rules){let W=Q.rules.findIndex((J)=>J.keyword===Z);if(W>=0)Q.rules.splice(W,1)}return this}addFormat(Z,X){if(typeof X=="string")X=new RegExp(X);return this.formats[Z]=X,this}errorsText(Z=this.errors,{separator:X=", ",dataVar:Q="data"}={}){if(!Z||Z.length===0)return"No errors";return Z.map((W)=>`${Q}${W.instancePath} ${W.message}`).reduce((W,J)=>W+X+J)}$dataMetaSchema(Z,X){let Q=this.RULES.all;Z=JSON.parse(JSON.stringify(Z));for(let W of X){let J=W.split("/").slice(1),G=Z;for(let Y of J)G=G[Y];for(let Y in Q){let z=Q[Y];if(typeof z!="object")continue;let{$data:q}=z.definition,K=G[Y];if(q&&K)G[Y]=U3(K)}}return Z}_removeAllSchemas(Z,X){for(let Q in Z){let W=Z[Q];if(!X||X.test(Q)){if(typeof W=="string")delete Z[Q];else if(W&&!W.meta)this._cache.delete(W.schema),delete Z[Q]}}}_addSchema(Z,X,Q,W=this.opts.validateSchema,J=this.opts.addUsedSchema){let G,{schemaId:Y}=this.opts;if(typeof Z=="object")G=Z[Y];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof Z!="boolean")throw Error("schema must be object or boolean");let z=this._cache.get(Z);if(z!==void 0)return z;Q=(0,_9.normalizeId)(G||Q);let q=_9.getSchemaRefs.call(this,Z,Q);if(z=new b9.SchemaEnv({schema:Z,schemaId:Y,meta:X,baseId:Q,localRefs:q}),this._cache.set(z.schema,z),J&&!Q.startsWith("#")){if(Q)this._checkUnique(Q);this.refs[Q]=z}if(W)this.validateSchema(Z,!0);return z}_checkUnique(Z){if(this.schemas[Z]||this.refs[Z])throw Error(`schema with key or id "${Z}" already exists`)}_compileSchemaEnv(Z){if(Z.meta)this._compileMetaSchema(Z);else b9.compileSchema.call(this,Z);if(!Z.validate)throw Error("ajv implementation error");return Z.validate}_compileMetaSchema(Z){let X=this.opts;this.opts=this._metaOpts;try{b9.compileSchema.call(this,Z)}finally{this.opts=X}}}D5.ValidationError=oO.default;D5.MissingRefError=q3.default;Y6.default=D5;function z3(Z,X,Q,W="error"){for(let J in Z){let G=J;if(G in X)this.logger[W](`${Q}: option ${J}. ${Z[G]}`)}}function $3(Z){return Z=(0,_9.normalizeId)(Z),this.schemas[Z]||this.refs[Z]}function YE(){let Z=this.opts.schemas;if(!Z)return;if(Array.isArray(Z))this.addSchema(Z);else for(let X in Z)this.addSchema(Z[X],X)}function zE(){for(let Z in this.opts.formats){let X=this.opts.formats[Z];if(X)this.addFormat(Z,X)}}function $E(Z){if(Array.isArray(Z)){this.addVocabulary(Z);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let X in Z){let Q=Z[X];if(!Q.keyword)Q.keyword=X;this.addKeyword(Q)}}function qE(){let Z={...this.opts};for(let X of XE)delete Z[X];return Z}var KE={log(){},warn(){},error(){}};function UE(Z){if(Z===!1)return KE;if(Z===void 0)return console;if(Z.log&&Z.warn&&Z.error)return Z;throw Error("logger must implement log, warn and error methods")}var VE=/^[a-z_$][a-z0-9_$:-]*$/i;function BE(Z,X){let{RULES:Q}=this;if((0,lX.eachItem)(Z,(W)=>{if(Q.keywords[W])throw Error(`Keyword ${W} is already defined`);if(!VE.test(W))throw Error(`Keyword ${W} has invalid name`)}),!X)return;if(X.$data&&!(("code"in X)||("validate"in X)))throw Error('$data keyword must have "code" or "validate" function')}function mX(Z,X,Q){var W;let J=X===null||X===void 0?void 0:X.post;if(Q&&J)throw Error('keyword with "post" flag cannot have "type"');let{RULES:G}=this,Y=J?G.post:G.rules.find(({type:q})=>q===Q);if(!Y)Y={type:Q,rules:[]},G.rules.push(Y);if(G.keywords[Z]=!0,!X)return;let z={keyword:Z,definition:{...X,type:(0,N5.getJSONTypes)(X.type),schemaType:(0,N5.getJSONTypes)(X.schemaType)}};if(X.before)HE.call(this,Y,z,X.before);else Y.rules.push(z);G.all[Z]=z,(W=X.implements)===null||W===void 0||W.forEach((q)=>this.addKeyword(q))}function HE(Z,X,Q){let W=Z.rules.findIndex((J)=>J.keyword===Q);if(W>=0)Z.rules.splice(W,0,X);else Z.rules.push(X),this.logger.warn(`rule ${Q} is not defined`)}function FE(Z){let{metaSchema:X}=Z;if(X===void 0)return;if(Z.$data&&this.opts.$data)X=U3(X);Z.validateSchema=this.compile(X,!0)}var LE={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function U3(Z){return{anyOf:[Z,LE]}}});var H3=j((B3)=>{Object.defineProperty(B3,"__esModule",{value:!0});var IE={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};B3.default=IE});var j5=j((M3)=>{Object.defineProperty(M3,"__esModule",{value:!0});M3.callRef=M3.getValidate=void 0;var DE=P9(),F3=M4(),Z4=Z0(),u1=A4(),L3=S9(),T5=W0(),TE={keyword:"$ref",schemaType:"string",code(Z){let{gen:X,schema:Q,it:W}=Z,{baseId:J,schemaEnv:G,validateName:Y,opts:z,self:q}=W,{root:K}=G;if((Q==="#"||Q==="#/")&&J===K.baseId)return B();let V=L3.resolveRef.call(q,K,J,Q);if(V===void 0)throw new DE.default(W.opts.uriResolver,J,Q);if(V instanceof L3.SchemaEnv)return H(V);return F(V);function B(){if(G===K)return w5(Z,Y,G,G.$async);let A=X.scopeValue("root",{ref:K});return w5(Z,Z4._`${A}.validate`,K,K.$async)}function H(A){let M=A3(Z,A);w5(Z,M,A,A.$async)}function F(A){let M=X.scopeValue("schema",z.code.source===!0?{ref:A,code:(0,Z4.stringify)(A)}:{ref:A}),I=X.name("valid"),N=Z.subschema({schema:A,dataTypes:[],schemaPath:Z4.nil,topSchemaRef:M,errSchemaPath:Q},I);Z.mergeEvaluated(N),Z.ok(I)}}};function A3(Z,X){let{gen:Q}=Z;return X.validate?Q.scopeValue("validate",{ref:X.validate}):Z4._`${Q.scopeValue("wrapper",{ref:X})}.validate`}M3.getValidate=A3;function w5(Z,X,Q,W){let{gen:J,it:G}=Z,{allErrors:Y,schemaEnv:z,opts:q}=G,K=q.passContext?u1.default.this:Z4.nil;if(W)V();else B();function V(){if(!z.$async)throw Error("async schema referenced by sync schema");let A=J.let("valid");J.try(()=>{if(J.code(Z4._`await ${(0,F3.callValidateCode)(Z,X,K)}`),F(X),!Y)J.assign(A,!0)},(M)=>{if(J.if(Z4._`!(${M} instanceof ${G.ValidationError})`,()=>J.throw(M)),H(M),!Y)J.assign(A,!1)}),Z.ok(A)}function B(){Z.result((0,F3.callValidateCode)(Z,X,K),()=>F(X),()=>H(X))}function H(A){let M=Z4._`${A}.errors`;J.assign(u1.default.vErrors,Z4._`${u1.default.vErrors} === null ? ${M} : ${u1.default.vErrors}.concat(${M})`),J.assign(u1.default.errors,Z4._`${u1.default.vErrors}.length`)}function F(A){var M;if(!G.opts.unevaluated)return;let I=(M=Q===null||Q===void 0?void 0:Q.validate)===null||M===void 0?void 0:M.evaluated;if(G.props!==!0)if(I&&!I.dynamicProps){if(I.props!==void 0)G.props=T5.mergeEvaluated.props(J,I.props,G.props)}else{let N=J.var("props",Z4._`${A}.evaluated.props`);G.props=T5.mergeEvaluated.props(J,N,G.props,Z4.Name)}if(G.items!==!0)if(I&&!I.dynamicItems){if(I.items!==void 0)G.items=T5.mergeEvaluated.items(J,I.items,G.items)}else{let N=J.var("items",Z4._`${A}.evaluated.items`);G.items=T5.mergeEvaluated.items(J,N,G.items,Z4.Name)}}}M3.callRef=w5;M3.default=TE});var D3=j((N3)=>{Object.defineProperty(N3,"__esModule",{value:!0});var OE=H3(),EE=j5(),RE=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",OE.default,EE.default];N3.default=RE});var w3=j((T3)=>{Object.defineProperty(T3,"__esModule",{value:!0});var O5=Z0(),b6=O5.operators,E5={maximum:{okStr:"<=",ok:b6.LTE,fail:b6.GT},minimum:{okStr:">=",ok:b6.GTE,fail:b6.LT},exclusiveMaximum:{okStr:"<",ok:b6.LT,fail:b6.GTE},exclusiveMinimum:{okStr:">",ok:b6.GT,fail:b6.LTE}},CE={message:({keyword:Z,schemaCode:X})=>O5.str`must be ${E5[Z].okStr} ${X}`,params:({keyword:Z,schemaCode:X})=>O5._`{comparison: ${E5[Z].okStr}, limit: ${X}}`},SE={keyword:Object.keys(E5),type:"number",schemaType:"number",$data:!0,error:CE,code(Z){let{keyword:X,data:Q,schemaCode:W}=Z;Z.fail$data(O5._`${Q} ${E5[X].fail} ${W} || isNaN(${Q})`)}};T3.default=SE});var O3=j((j3)=>{Object.defineProperty(j3,"__esModule",{value:!0});var x9=Z0(),bE={message:({schemaCode:Z})=>x9.str`must be multiple of ${Z}`,params:({schemaCode:Z})=>x9._`{multipleOf: ${Z}}`},_E={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:bE,code(Z){let{gen:X,data:Q,schemaCode:W,it:J}=Z,G=J.opts.multipleOfPrecision,Y=X.let("res"),z=G?x9._`Math.abs(Math.round(${Y}) - ${Y}) > 1e-${G}`:x9._`${Y} !== parseInt(${Y})`;Z.fail$data(x9._`(${W} === 0 || (${Y} = ${Q}/${W}, ${z}))`)}};j3.default=_E});var P3=j((R3)=>{Object.defineProperty(R3,"__esModule",{value:!0});function E3(Z){let X=Z.length,Q=0,W=0,J;while(W<X)if(Q++,J=Z.charCodeAt(W++),J>=55296&&J<=56319&&W<X){if(J=Z.charCodeAt(W),(J&64512)===56320)W++}return Q}R3.default=E3;E3.code='require("ajv/dist/runtime/ucs2length").default'});var S3=j((C3)=>{Object.defineProperty(C3,"__esModule",{value:!0});var o6=Z0(),yE=W0(),gE=P3(),fE={message({keyword:Z,schemaCode:X}){let Q=Z==="maxLength"?"more":"fewer";return o6.str`must NOT have ${Q} than ${X} characters`},params:({schemaCode:Z})=>o6._`{limit: ${Z}}`},hE={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:fE,code(Z){let{keyword:X,data:Q,schemaCode:W,it:J}=Z,G=X==="maxLength"?o6.operators.GT:o6.operators.LT,Y=J.opts.unicode===!1?o6._`${Q}.length`:o6._`${(0,yE.useFunc)(Z.gen,gE.default)}(${Q})`;Z.fail$data(o6._`${Y} ${G} ${W}`)}};C3.default=hE});var b3=j((k3)=>{Object.defineProperty(k3,"__esModule",{value:!0});var mE=M4(),lE=W0(),m1=Z0(),dE={message:({schemaCode:Z})=>m1.str`must match pattern "${Z}"`,params:({schemaCode:Z})=>m1._`{pattern: ${Z}}`},cE={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:dE,code(Z){let{gen:X,data:Q,$data:W,schema:J,schemaCode:G,it:Y}=Z,z=Y.opts.unicodeRegExp?"u":"";if(W){let{regExp:q}=Y.opts.code,K=q.code==="new RegExp"?m1._`new RegExp`:(0,lE.useFunc)(X,q),V=X.let("valid");X.try(()=>X.assign(V,m1._`${K}(${G}, ${z}).test(${Q})`),()=>X.assign(V,!1)),Z.fail$data(m1._`!${V}`)}else{let q=(0,mE.usePattern)(Z,J);Z.fail$data(m1._`!${q}.test(${Q})`)}}};k3.default=cE});var x3=j((_3)=>{Object.defineProperty(_3,"__esModule",{value:!0});var v9=Z0(),nE={message({keyword:Z,schemaCode:X}){let Q=Z==="maxProperties"?"more":"fewer";return v9.str`must NOT have ${Q} than ${X} properties`},params:({schemaCode:Z})=>v9._`{limit: ${Z}}`},iE={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:nE,code(Z){let{keyword:X,data:Q,schemaCode:W}=Z,J=X==="maxProperties"?v9.operators.GT:v9.operators.LT;Z.fail$data(v9._`Object.keys(${Q}).length ${J} ${W}`)}};_3.default=iE});var y3=j((v3)=>{Object.defineProperty(v3,"__esModule",{value:!0});var y9=M4(),g9=Z0(),aE=W0(),sE={message:({params:{missingProperty:Z}})=>g9.str`must have required property '${Z}'`,params:({params:{missingProperty:Z}})=>g9._`{missingProperty: ${Z}}`},oE={keyword:"required",type:"object",schemaType:"array",$data:!0,error:sE,code(Z){let{gen:X,schema:Q,schemaCode:W,data:J,$data:G,it:Y}=Z,{opts:z}=Y;if(!G&&Q.length===0)return;let q=Q.length>=z.loopRequired;if(Y.allErrors)K();else V();if(z.strictRequired){let F=Z.parentSchema.properties,{definedProperties:A}=Z.it;for(let M of Q)if((F===null||F===void 0?void 0:F[M])===void 0&&!A.has(M)){let I=Y.schemaEnv.baseId+Y.errSchemaPath,N=`required property "${M}" is not defined at "${I}" (strictRequired)`;(0,aE.checkStrictMode)(Y,N,Y.opts.strictRequired)}}function K(){if(q||G)Z.block$data(g9.nil,B);else for(let F of Q)(0,y9.checkReportMissingProp)(Z,F)}function V(){let F=X.let("missing");if(q||G){let A=X.let("valid",!0);Z.block$data(A,()=>H(F,A)),Z.ok(A)}else X.if((0,y9.checkMissingProp)(Z,Q,F)),(0,y9.reportMissingProp)(Z,F),X.else()}function B(){X.forOf("prop",W,(F)=>{Z.setParams({missingProperty:F}),X.if((0,y9.noPropertyInData)(X,J,F,z.ownProperties),()=>Z.error())})}function H(F,A){Z.setParams({missingProperty:F}),X.forOf(F,W,()=>{X.assign(A,(0,y9.propertyInData)(X,J,F,z.ownProperties)),X.if((0,g9.not)(A),()=>{Z.error(),X.break()})},g9.nil)}}};v3.default=oE});var f3=j((g3)=>{Object.defineProperty(g3,"__esModule",{value:!0});var f9=Z0(),eE={message({keyword:Z,schemaCode:X}){let Q=Z==="maxItems"?"more":"fewer";return f9.str`must NOT have ${Q} than ${X} items`},params:({schemaCode:Z})=>f9._`{limit: ${Z}}`},ZR={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:eE,code(Z){let{keyword:X,data:Q,schemaCode:W}=Z,J=X==="maxItems"?f9.operators.GT:f9.operators.LT;Z.fail$data(f9._`${Q}.length ${J} ${W}`)}};g3.default=ZR});var R5=j((u3)=>{Object.defineProperty(u3,"__esModule",{value:!0});var h3=EX();h3.code='require("ajv/dist/runtime/equal").default';u3.default=h3});var l3=j((m3)=>{Object.defineProperty(m3,"__esModule",{value:!0});var dX=w9(),g0=Z0(),WR=W0(),JR=R5(),GR={message:({params:{i:Z,j:X}})=>g0.str`must NOT have duplicate items (items ## ${X} and ${Z} are identical)`,params:({params:{i:Z,j:X}})=>g0._`{i: ${Z}, j: ${X}}`},YR={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:GR,code(Z){let{gen:X,data:Q,$data:W,schema:J,parentSchema:G,schemaCode:Y,it:z}=Z;if(!W&&!J)return;let q=X.let("valid"),K=G.items?(0,dX.getSchemaTypes)(G.items):[];Z.block$data(q,V,g0._`${Y} === false`),Z.ok(q);function V(){let A=X.let("i",g0._`${Q}.length`),M=X.let("j");Z.setParams({i:A,j:M}),X.assign(q,!0),X.if(g0._`${A} > 1`,()=>(B()?H:F)(A,M))}function B(){return K.length>0&&!K.some((A)=>A==="object"||A==="array")}function H(A,M){let I=X.name("item"),N=(0,dX.checkDataTypes)(K,I,z.opts.strictNumbers,dX.DataType.Wrong),T=X.const("indices",g0._`{}`);X.for(g0._`;${A}--;`,()=>{if(X.let(I,g0._`${Q}[${A}]`),X.if(N,g0._`continue`),K.length>1)X.if(g0._`typeof ${I} == "string"`,g0._`${I} += "_"`);X.if(g0._`typeof ${T}[${I}] == "number"`,()=>{X.assign(M,g0._`${T}[${I}]`),Z.error(),X.assign(q,!1).break()}).code(g0._`${T}[${I}] = ${A}`)})}function F(A,M){let I=(0,WR.useFunc)(X,JR.default),N=X.name("outer");X.label(N).for(g0._`;${A}--;`,()=>X.for(g0._`${M} = ${A}; ${M}--;`,()=>X.if(g0._`${I}(${Q}[${A}], ${Q}[${M}])`,()=>{Z.error(),X.assign(q,!1).break(N)})))}}};m3.default=YR});var c3=j((d3)=>{Object.defineProperty(d3,"__esModule",{value:!0});var cX=Z0(),$R=W0(),qR=R5(),KR={message:"must be equal to constant",params:({schemaCode:Z})=>cX._`{allowedValue: ${Z}}`},UR={keyword:"const",$data:!0,error:KR,code(Z){let{gen:X,data:Q,$data:W,schemaCode:J,schema:G}=Z;if(W||G&&typeof G=="object")Z.fail$data(cX._`!${(0,$R.useFunc)(X,qR.default)}(${Q}, ${J})`);else Z.fail(cX._`${G} !== ${Q}`)}};d3.default=UR});var n3=j((p3)=>{Object.defineProperty(p3,"__esModule",{value:!0});var h9=Z0(),BR=W0(),HR=R5(),FR={message:"must be equal to one of the allowed values",params:({schemaCode:Z})=>h9._`{allowedValues: ${Z}}`},LR={keyword:"enum",schemaType:"array",$data:!0,error:FR,code(Z){let{gen:X,data:Q,$data:W,schema:J,schemaCode:G,it:Y}=Z;if(!W&&J.length===0)throw Error("enum must have non-empty array");let z=J.length>=Y.opts.loopEnum,q,K=()=>q!==null&&q!==void 0?q:q=(0,BR.useFunc)(X,HR.default),V;if(z||W)V=X.let("valid"),Z.block$data(V,B);else{if(!Array.isArray(J))throw Error("ajv implementation error");let F=X.const("vSchema",G);V=(0,h9.or)(...J.map((A,M)=>H(F,M)))}Z.pass(V);function B(){X.assign(V,!1),X.forOf("v",G,(F)=>X.if(h9._`${K()}(${Q}, ${F})`,()=>X.assign(V,!0).break()))}function H(F,A){let M=J[A];return typeof M==="object"&&M!==null?h9._`${K()}(${Q}, ${F}[${A}])`:h9._`${Q} === ${M}`}}};p3.default=LR});var r3=j((i3)=>{Object.defineProperty(i3,"__esModule",{value:!0});var MR=w3(),IR=O3(),NR=S3(),DR=b3(),TR=x3(),wR=y3(),jR=f3(),OR=l3(),ER=c3(),RR=n3(),PR=[MR.default,IR.default,NR.default,DR.default,TR.default,wR.default,jR.default,OR.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},ER.default,RR.default];i3.default=PR});var nX=j((s3)=>{Object.defineProperty(s3,"__esModule",{value:!0});s3.validateAdditionalItems=void 0;var t6=Z0(),pX=W0(),SR={message:({params:{len:Z}})=>t6.str`must NOT have more than ${Z} items`,params:({params:{len:Z}})=>t6._`{limit: ${Z}}`},kR={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:SR,code(Z){let{parentSchema:X,it:Q}=Z,{items:W}=X;if(!Array.isArray(W)){(0,pX.checkStrictMode)(Q,'"additionalItems" is ignored when "items" is not an array of schemas');return}a3(Z,W)}};function a3(Z,X){let{gen:Q,schema:W,data:J,keyword:G,it:Y}=Z;Y.items=!0;let z=Q.const("len",t6._`${J}.length`);if(W===!1)Z.setParams({len:X.length}),Z.pass(t6._`${z} <= ${X.length}`);else if(typeof W=="object"&&!(0,pX.alwaysValidSchema)(Y,W)){let K=Q.var("valid",t6._`${z} <= ${X.length}`);Q.if((0,t6.not)(K),()=>q(K)),Z.ok(K)}function q(K){Q.forRange("i",X.length,z,(V)=>{if(Z.subschema({keyword:G,dataProp:V,dataPropType:pX.Type.Num},K),!Y.allErrors)Q.if((0,t6.not)(K),()=>Q.break())})}}s3.validateAdditionalItems=a3;s3.default=kR});var iX=j((ZU)=>{Object.defineProperty(ZU,"__esModule",{value:!0});ZU.validateTuple=void 0;var t3=Z0(),P5=W0(),_R=M4(),xR={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(Z){let{schema:X,it:Q}=Z;if(Array.isArray(X))return e3(Z,"additionalItems",X);if(Q.items=!0,(0,P5.alwaysValidSchema)(Q,X))return;Z.ok((0,_R.validateArray)(Z))}};function e3(Z,X,Q=Z.schema){let{gen:W,parentSchema:J,data:G,keyword:Y,it:z}=Z;if(V(J),z.opts.unevaluated&&Q.length&&z.items!==!0)z.items=P5.mergeEvaluated.items(W,Q.length,z.items);let q=W.name("valid"),K=W.const("len",t3._`${G}.length`);Q.forEach((B,H)=>{if((0,P5.alwaysValidSchema)(z,B))return;W.if(t3._`${K} > ${H}`,()=>Z.subschema({keyword:Y,schemaProp:H,dataProp:H},q)),Z.ok(q)});function V(B){let{opts:H,errSchemaPath:F}=z,A=Q.length,M=A===B.minItems&&(A===B.maxItems||B[X]===!1);if(H.strictTuples&&!M){let I=`"${Y}" is ${A}-tuple, but minItems or maxItems/${X} are not specified or different at path "${F}"`;(0,P5.checkStrictMode)(z,I,H.strictTuples)}}}ZU.validateTuple=e3;ZU.default=xR});var WU=j((QU)=>{Object.defineProperty(QU,"__esModule",{value:!0});var yR=iX(),gR={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(Z)=>(0,yR.validateTuple)(Z,"items")};QU.default=gR});var YU=j((GU)=>{Object.defineProperty(GU,"__esModule",{value:!0});var JU=Z0(),hR=W0(),uR=M4(),mR=nX(),lR={message:({params:{len:Z}})=>JU.str`must NOT have more than ${Z} items`,params:({params:{len:Z}})=>JU._`{limit: ${Z}}`},dR={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:lR,code(Z){let{schema:X,parentSchema:Q,it:W}=Z,{prefixItems:J}=Q;if(W.items=!0,(0,hR.alwaysValidSchema)(W,X))return;if(J)(0,mR.validateAdditionalItems)(Z,J);else Z.ok((0,uR.validateArray)(Z))}};GU.default=dR});var $U=j((zU)=>{Object.defineProperty(zU,"__esModule",{value:!0});var I4=Z0(),C5=W0(),pR={message:({params:{min:Z,max:X}})=>X===void 0?I4.str`must contain at least ${Z} valid item(s)`:I4.str`must contain at least ${Z} and no more than ${X} valid item(s)`,params:({params:{min:Z,max:X}})=>X===void 0?I4._`{minContains: ${Z}}`:I4._`{minContains: ${Z}, maxContains: ${X}}`},nR={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:pR,code(Z){let{gen:X,schema:Q,parentSchema:W,data:J,it:G}=Z,Y,z,{minContains:q,maxContains:K}=W;if(G.opts.next)Y=q===void 0?1:q,z=K;else Y=1;let V=X.const("len",I4._`${J}.length`);if(Z.setParams({min:Y,max:z}),z===void 0&&Y===0){(0,C5.checkStrictMode)(G,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(z!==void 0&&Y>z){(0,C5.checkStrictMode)(G,'"minContains" > "maxContains" is always invalid'),Z.fail();return}if((0,C5.alwaysValidSchema)(G,Q)){let M=I4._`${V} >= ${Y}`;if(z!==void 0)M=I4._`${M} && ${V} <= ${z}`;Z.pass(M);return}G.items=!0;let B=X.name("valid");if(z===void 0&&Y===1)F(B,()=>X.if(B,()=>X.break()));else if(Y===0){if(X.let(B,!0),z!==void 0)X.if(I4._`${J}.length > 0`,H)}else X.let(B,!1),H();Z.result(B,()=>Z.reset());function H(){let M=X.name("_valid"),I=X.let("count",0);F(M,()=>X.if(M,()=>A(I)))}function F(M,I){X.forRange("i",0,V,(N)=>{Z.subschema({keyword:"contains",dataProp:N,dataPropType:C5.Type.Num,compositeRule:!0},M),I()})}function A(M){if(X.code(I4._`${M}++`),z===void 0)X.if(I4._`${M} >= ${Y}`,()=>X.assign(B,!0).break());else if(X.if(I4._`${M} > ${z}`,()=>X.assign(B,!1).break()),Y===1)X.assign(B,!0);else X.if(I4._`${M} >= ${Y}`,()=>X.assign(B,!0))}}};zU.default=nR});var S5=j((UU)=>{Object.defineProperty(UU,"__esModule",{value:!0});UU.validateSchemaDeps=UU.validatePropertyDeps=UU.error=void 0;var rX=Z0(),rR=W0(),u9=M4();UU.error={message:({params:{property:Z,depsCount:X,deps:Q}})=>{let W=X===1?"property":"properties";return rX.str`must have ${W} ${Q} when property ${Z} is present`},params:({params:{property:Z,depsCount:X,deps:Q,missingProperty:W}})=>rX._`{property: ${Z},
313
- missingProperty: ${W},
314
- depsCount: ${X},
315
- deps: ${Q}}`};var aR={keyword:"dependencies",type:"object",schemaType:"object",error:UU.error,code(Z){let[X,Q]=sR(Z);qU(Z,X),KU(Z,Q)}};function sR({schema:Z}){let X={},Q={};for(let W in Z){if(W==="__proto__")continue;let J=Array.isArray(Z[W])?X:Q;J[W]=Z[W]}return[X,Q]}function qU(Z,X=Z.schema){let{gen:Q,data:W,it:J}=Z;if(Object.keys(X).length===0)return;let G=Q.let("missing");for(let Y in X){let z=X[Y];if(z.length===0)continue;let q=(0,u9.propertyInData)(Q,W,Y,J.opts.ownProperties);if(Z.setParams({property:Y,depsCount:z.length,deps:z.join(", ")}),J.allErrors)Q.if(q,()=>{for(let K of z)(0,u9.checkReportMissingProp)(Z,K)});else Q.if(rX._`${q} && (${(0,u9.checkMissingProp)(Z,z,G)})`),(0,u9.reportMissingProp)(Z,G),Q.else()}}UU.validatePropertyDeps=qU;function KU(Z,X=Z.schema){let{gen:Q,data:W,keyword:J,it:G}=Z,Y=Q.name("valid");for(let z in X){if((0,rR.alwaysValidSchema)(G,X[z]))continue;Q.if((0,u9.propertyInData)(Q,W,z,G.opts.ownProperties),()=>{let q=Z.subschema({keyword:J,schemaProp:z},Y);Z.mergeValidEvaluated(q,Y)},()=>Q.var(Y,!0)),Z.ok(Y)}}UU.validateSchemaDeps=KU;UU.default=aR});var LU=j((FU)=>{Object.defineProperty(FU,"__esModule",{value:!0});var HU=Z0(),eR=W0(),ZP={message:"property name must be valid",params:({params:Z})=>HU._`{propertyName: ${Z.propertyName}}`},XP={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:ZP,code(Z){let{gen:X,schema:Q,data:W,it:J}=Z;if((0,eR.alwaysValidSchema)(J,Q))return;let G=X.name("valid");X.forIn("key",W,(Y)=>{Z.setParams({propertyName:Y}),Z.subschema({keyword:"propertyNames",data:Y,dataTypes:["string"],propertyName:Y,compositeRule:!0},G),X.if((0,HU.not)(G),()=>{if(Z.error(!0),!J.allErrors)X.break()})}),Z.ok(G)}};FU.default=XP});var aX=j((AU)=>{Object.defineProperty(AU,"__esModule",{value:!0});var k5=M4(),S4=Z0(),WP=A4(),b5=W0(),JP={message:"must NOT have additional properties",params:({params:Z})=>S4._`{additionalProperty: ${Z.additionalProperty}}`},GP={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:JP,code(Z){let{gen:X,schema:Q,parentSchema:W,data:J,errsCount:G,it:Y}=Z;if(!G)throw Error("ajv implementation error");let{allErrors:z,opts:q}=Y;if(Y.props=!0,q.removeAdditional!=="all"&&(0,b5.alwaysValidSchema)(Y,Q))return;let K=(0,k5.allSchemaProperties)(W.properties),V=(0,k5.allSchemaProperties)(W.patternProperties);B(),Z.ok(S4._`${G} === ${WP.default.errors}`);function B(){X.forIn("key",J,(I)=>{if(!K.length&&!V.length)A(I);else X.if(H(I),()=>A(I))})}function H(I){let N;if(K.length>8){let T=(0,b5.schemaRefOrVal)(Y,W.properties,"properties");N=(0,k5.isOwnProperty)(X,T,I)}else if(K.length)N=(0,S4.or)(...K.map((T)=>S4._`${I} === ${T}`));else N=S4.nil;if(V.length)N=(0,S4.or)(N,...V.map((T)=>S4._`${(0,k5.usePattern)(Z,T)}.test(${I})`));return(0,S4.not)(N)}function F(I){X.code(S4._`delete ${J}[${I}]`)}function A(I){if(q.removeAdditional==="all"||q.removeAdditional&&Q===!1){F(I);return}if(Q===!1){if(Z.setParams({additionalProperty:I}),Z.error(),!z)X.break();return}if(typeof Q=="object"&&!(0,b5.alwaysValidSchema)(Y,Q)){let N=X.name("valid");if(q.removeAdditional==="failing")M(I,N,!1),X.if((0,S4.not)(N),()=>{Z.reset(),F(I)});else if(M(I,N),!z)X.if((0,S4.not)(N),()=>X.break())}}function M(I,N,T){let S={keyword:"additionalProperties",dataProp:I,dataPropType:b5.Type.Str};if(T===!1)Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1});Z.subschema(S,N)}}};AU.default=GP});var DU=j((NU)=>{Object.defineProperty(NU,"__esModule",{value:!0});var zP=R9(),MU=M4(),sX=W0(),IU=aX(),$P={keyword:"properties",type:"object",schemaType:"object",code(Z){let{gen:X,schema:Q,parentSchema:W,data:J,it:G}=Z;if(G.opts.removeAdditional==="all"&&W.additionalProperties===void 0)IU.default.code(new zP.KeywordCxt(G,IU.default,"additionalProperties"));let Y=(0,MU.allSchemaProperties)(Q);for(let B of Y)G.definedProperties.add(B);if(G.opts.unevaluated&&Y.length&&G.props!==!0)G.props=sX.mergeEvaluated.props(X,(0,sX.toHash)(Y),G.props);let z=Y.filter((B)=>!(0,sX.alwaysValidSchema)(G,Q[B]));if(z.length===0)return;let q=X.name("valid");for(let B of z){if(K(B))V(B);else{if(X.if((0,MU.propertyInData)(X,J,B,G.opts.ownProperties)),V(B),!G.allErrors)X.else().var(q,!0);X.endIf()}Z.it.definedProperties.add(B),Z.ok(q)}function K(B){return G.opts.useDefaults&&!G.compositeRule&&Q[B].default!==void 0}function V(B){Z.subschema({keyword:"properties",schemaProp:B,dataProp:B},q)}}};NU.default=$P});var EU=j((OU)=>{Object.defineProperty(OU,"__esModule",{value:!0});var TU=M4(),_5=Z0(),wU=W0(),jU=W0(),KP={keyword:"patternProperties",type:"object",schemaType:"object",code(Z){let{gen:X,schema:Q,data:W,parentSchema:J,it:G}=Z,{opts:Y}=G,z=(0,TU.allSchemaProperties)(Q),q=z.filter((M)=>(0,wU.alwaysValidSchema)(G,Q[M]));if(z.length===0||q.length===z.length&&(!G.opts.unevaluated||G.props===!0))return;let K=Y.strictSchema&&!Y.allowMatchingProperties&&J.properties,V=X.name("valid");if(G.props!==!0&&!(G.props instanceof _5.Name))G.props=(0,jU.evaluatedPropsToName)(X,G.props);let{props:B}=G;H();function H(){for(let M of z){if(K)F(M);if(G.allErrors)A(M);else X.var(V,!0),A(M),X.if(V)}}function F(M){for(let I in K)if(new RegExp(M).test(I))(0,wU.checkStrictMode)(G,`property ${I} matches pattern ${M} (use allowMatchingProperties)`)}function A(M){X.forIn("key",W,(I)=>{X.if(_5._`${(0,TU.usePattern)(Z,M)}.test(${I})`,()=>{let N=q.includes(M);if(!N)Z.subschema({keyword:"patternProperties",schemaProp:M,dataProp:I,dataPropType:jU.Type.Str},V);if(G.opts.unevaluated&&B!==!0)X.assign(_5._`${B}[${I}]`,!0);else if(!N&&!G.allErrors)X.if((0,_5.not)(V),()=>X.break())})})}}};OU.default=KP});var PU=j((RU)=>{Object.defineProperty(RU,"__esModule",{value:!0});var VP=W0(),BP={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(Z){let{gen:X,schema:Q,it:W}=Z;if((0,VP.alwaysValidSchema)(W,Q)){Z.fail();return}let J=X.name("valid");Z.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},J),Z.failResult(J,()=>Z.reset(),()=>Z.error())},error:{message:"must NOT be valid"}};RU.default=BP});var SU=j((CU)=>{Object.defineProperty(CU,"__esModule",{value:!0});var FP=M4(),LP={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:FP.validateUnion,error:{message:"must match a schema in anyOf"}};CU.default=LP});var bU=j((kU)=>{Object.defineProperty(kU,"__esModule",{value:!0});var x5=Z0(),MP=W0(),IP={message:"must match exactly one schema in oneOf",params:({params:Z})=>x5._`{passingSchemas: ${Z.passing}}`},NP={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:IP,code(Z){let{gen:X,schema:Q,parentSchema:W,it:J}=Z;if(!Array.isArray(Q))throw Error("ajv implementation error");if(J.opts.discriminator&&W.discriminator)return;let G=Q,Y=X.let("valid",!1),z=X.let("passing",null),q=X.name("_valid");Z.setParams({passing:z}),X.block(K),Z.result(Y,()=>Z.reset(),()=>Z.error(!0));function K(){G.forEach((V,B)=>{let H;if((0,MP.alwaysValidSchema)(J,V))X.var(q,!0);else H=Z.subschema({keyword:"oneOf",schemaProp:B,compositeRule:!0},q);if(B>0)X.if(x5._`${q} && ${Y}`).assign(Y,!1).assign(z,x5._`[${z}, ${B}]`).else();X.if(q,()=>{if(X.assign(Y,!0),X.assign(z,B),H)Z.mergeEvaluated(H,x5.Name)})})}}};kU.default=NP});var xU=j((_U)=>{Object.defineProperty(_U,"__esModule",{value:!0});var TP=W0(),wP={keyword:"allOf",schemaType:"array",code(Z){let{gen:X,schema:Q,it:W}=Z;if(!Array.isArray(Q))throw Error("ajv implementation error");let J=X.name("valid");Q.forEach((G,Y)=>{if((0,TP.alwaysValidSchema)(W,G))return;let z=Z.subschema({keyword:"allOf",schemaProp:Y},J);Z.ok(J),Z.mergeEvaluated(z)})}};_U.default=wP});var fU=j((gU)=>{Object.defineProperty(gU,"__esModule",{value:!0});var v5=Z0(),yU=W0(),OP={message:({params:Z})=>v5.str`must match "${Z.ifClause}" schema`,params:({params:Z})=>v5._`{failingKeyword: ${Z.ifClause}}`},EP={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:OP,code(Z){let{gen:X,parentSchema:Q,it:W}=Z;if(Q.then===void 0&&Q.else===void 0)(0,yU.checkStrictMode)(W,'"if" without "then" and "else" is ignored');let J=vU(W,"then"),G=vU(W,"else");if(!J&&!G)return;let Y=X.let("valid",!0),z=X.name("_valid");if(q(),Z.reset(),J&&G){let V=X.let("ifClause");Z.setParams({ifClause:V}),X.if(z,K("then",V),K("else",V))}else if(J)X.if(z,K("then"));else X.if((0,v5.not)(z),K("else"));Z.pass(Y,()=>Z.error(!0));function q(){let V=Z.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},z);Z.mergeEvaluated(V)}function K(V,B){return()=>{let H=Z.subschema({keyword:V},z);if(X.assign(Y,z),Z.mergeValidEvaluated(H,Y),B)X.assign(B,v5._`${V}`);else Z.setParams({ifClause:V})}}}};function vU(Z,X){let Q=Z.schema[X];return Q!==void 0&&!(0,yU.alwaysValidSchema)(Z,Q)}gU.default=EP});var uU=j((hU)=>{Object.defineProperty(hU,"__esModule",{value:!0});var PP=W0(),CP={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:Z,parentSchema:X,it:Q}){if(X.if===void 0)(0,PP.checkStrictMode)(Q,`"${Z}" without "if" is ignored`)}};hU.default=CP});var lU=j((mU)=>{Object.defineProperty(mU,"__esModule",{value:!0});var kP=nX(),bP=WU(),_P=iX(),xP=YU(),vP=$U(),yP=S5(),gP=LU(),fP=aX(),hP=DU(),uP=EU(),mP=PU(),lP=SU(),dP=bU(),cP=xU(),pP=fU(),nP=uU();function iP(Z=!1){let X=[mP.default,lP.default,dP.default,cP.default,pP.default,nP.default,gP.default,fP.default,yP.default,hP.default,uP.default];if(Z)X.push(bP.default,xP.default);else X.push(kP.default,_P.default);return X.push(vP.default),X}mU.default=iP});var tX=j((pU)=>{Object.defineProperty(pU,"__esModule",{value:!0});pU.dynamicAnchor=void 0;var oX=Z0(),aP=A4(),dU=S9(),sP=j5(),oP={keyword:"$dynamicAnchor",schemaType:"string",code:(Z)=>cU(Z,Z.schema)};function cU(Z,X){let{gen:Q,it:W}=Z;W.schemaEnv.root.dynamicAnchors[X]=!0;let J=oX._`${aP.default.dynamicAnchors}${(0,oX.getProperty)(X)}`,G=W.errSchemaPath==="#"?W.validateName:tP(Z);Q.if(oX._`!${J}`,()=>Q.assign(J,G))}pU.dynamicAnchor=cU;function tP(Z){let{schemaEnv:X,schema:Q,self:W}=Z.it,{root:J,baseId:G,localRefs:Y,meta:z}=X.root,{schemaId:q}=W.opts,K=new dU.SchemaEnv({schema:Q,schemaId:q,root:J,baseId:G,localRefs:Y,meta:z});return dU.compileSchema.call(W,K),(0,sP.getValidate)(Z,K)}pU.default=oP});var eX=j((sU)=>{Object.defineProperty(sU,"__esModule",{value:!0});sU.dynamicRef=void 0;var iU=Z0(),ZC=A4(),rU=j5(),XC={keyword:"$dynamicRef",schemaType:"string",code:(Z)=>aU(Z,Z.schema)};function aU(Z,X){let{gen:Q,keyword:W,it:J}=Z;if(X[0]!=="#")throw Error(`"${W}" only supports hash fragment reference`);let G=X.slice(1);if(J.allErrors)Y();else{let q=Q.let("valid",!1);Y(q),Z.ok(q)}function Y(q){if(J.schemaEnv.root.dynamicAnchors[G]){let K=Q.let("_v",iU._`${ZC.default.dynamicAnchors}${(0,iU.getProperty)(G)}`);Q.if(K,z(K,q),z(J.validateName,q))}else z(J.validateName,q)()}function z(q,K){return K?()=>Q.block(()=>{(0,rU.callRef)(Z,q),Q.let(K,!0)}):()=>(0,rU.callRef)(Z,q)}}sU.dynamicRef=aU;sU.default=XC});var eU=j((tU)=>{Object.defineProperty(tU,"__esModule",{value:!0});var WC=tX(),JC=W0(),GC={keyword:"$recursiveAnchor",schemaType:"boolean",code(Z){if(Z.schema)(0,WC.dynamicAnchor)(Z,"");else(0,JC.checkStrictMode)(Z.it,"$recursiveAnchor: false is ignored")}};tU.default=GC});var XV=j((ZV)=>{Object.defineProperty(ZV,"__esModule",{value:!0});var zC=eX(),$C={keyword:"$recursiveRef",schemaType:"string",code:(Z)=>(0,zC.dynamicRef)(Z,Z.schema)};ZV.default=$C});var WV=j((QV)=>{Object.defineProperty(QV,"__esModule",{value:!0});var KC=tX(),UC=eX(),VC=eU(),BC=XV(),HC=[KC.default,UC.default,VC.default,BC.default];QV.default=HC});var YV=j((GV)=>{Object.defineProperty(GV,"__esModule",{value:!0});var JV=S5(),LC={keyword:"dependentRequired",type:"object",schemaType:"object",error:JV.error,code:(Z)=>(0,JV.validatePropertyDeps)(Z)};GV.default=LC});var $V=j((zV)=>{Object.defineProperty(zV,"__esModule",{value:!0});var MC=S5(),IC={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(Z)=>(0,MC.validateSchemaDeps)(Z)};zV.default=IC});var KV=j((qV)=>{Object.defineProperty(qV,"__esModule",{value:!0});var DC=W0(),TC={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:Z,parentSchema:X,it:Q}){if(X.contains===void 0)(0,DC.checkStrictMode)(Q,`"${Z}" without "contains" is ignored`)}};qV.default=TC});var VV=j((UV)=>{Object.defineProperty(UV,"__esModule",{value:!0});var jC=YV(),OC=$V(),EC=KV(),RC=[jC.default,OC.default,EC.default];UV.default=RC});var FV=j((HV)=>{Object.defineProperty(HV,"__esModule",{value:!0});var _6=Z0(),BV=W0(),CC=A4(),SC={message:"must NOT have unevaluated properties",params:({params:Z})=>_6._`{unevaluatedProperty: ${Z.unevaluatedProperty}}`},kC={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:SC,code(Z){let{gen:X,schema:Q,data:W,errsCount:J,it:G}=Z;if(!J)throw Error("ajv implementation error");let{allErrors:Y,props:z}=G;if(z instanceof _6.Name)X.if(_6._`${z} !== true`,()=>X.forIn("key",W,(B)=>X.if(K(z,B),()=>q(B))));else if(z!==!0)X.forIn("key",W,(B)=>z===void 0?q(B):X.if(V(z,B),()=>q(B)));G.props=!0,Z.ok(_6._`${J} === ${CC.default.errors}`);function q(B){if(Q===!1){if(Z.setParams({unevaluatedProperty:B}),Z.error(),!Y)X.break();return}if(!(0,BV.alwaysValidSchema)(G,Q)){let H=X.name("valid");if(Z.subschema({keyword:"unevaluatedProperties",dataProp:B,dataPropType:BV.Type.Str},H),!Y)X.if((0,_6.not)(H),()=>X.break())}}function K(B,H){return _6._`!${B} || !${B}[${H}]`}function V(B,H){let F=[];for(let A in B)if(B[A]===!0)F.push(_6._`${H} !== ${A}`);return(0,_6.and)(...F)}}};HV.default=kC});var MV=j((AV)=>{Object.defineProperty(AV,"__esModule",{value:!0});var e6=Z0(),LV=W0(),_C={message:({params:{len:Z}})=>e6.str`must NOT have more than ${Z} items`,params:({params:{len:Z}})=>e6._`{limit: ${Z}}`},xC={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:_C,code(Z){let{gen:X,schema:Q,data:W,it:J}=Z,G=J.items||0;if(G===!0)return;let Y=X.const("len",e6._`${W}.length`);if(Q===!1)Z.setParams({len:G}),Z.fail(e6._`${Y} > ${G}`);else if(typeof Q=="object"&&!(0,LV.alwaysValidSchema)(J,Q)){let q=X.var("valid",e6._`${Y} <= ${G}`);X.if((0,e6.not)(q),()=>z(q,G)),Z.ok(q)}J.items=!0;function z(q,K){X.forRange("i",K,Y,(V)=>{if(Z.subschema({keyword:"unevaluatedItems",dataProp:V,dataPropType:LV.Type.Num},q),!J.allErrors)X.if((0,e6.not)(q),()=>X.break())})}}};AV.default=xC});var NV=j((IV)=>{Object.defineProperty(IV,"__esModule",{value:!0});var yC=FV(),gC=MV(),fC=[yC.default,gC.default];IV.default=fC});var TV=j((DV)=>{Object.defineProperty(DV,"__esModule",{value:!0});var O0=Z0(),uC={message:({schemaCode:Z})=>O0.str`must match format "${Z}"`,params:({schemaCode:Z})=>O0._`{format: ${Z}}`},mC={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:uC,code(Z,X){let{gen:Q,data:W,$data:J,schema:G,schemaCode:Y,it:z}=Z,{opts:q,errSchemaPath:K,schemaEnv:V,self:B}=z;if(!q.validateFormats)return;if(J)H();else F();function H(){let A=Q.scopeValue("formats",{ref:B.formats,code:q.code.formats}),M=Q.const("fDef",O0._`${A}[${Y}]`),I=Q.let("fType"),N=Q.let("format");Q.if(O0._`typeof ${M} == "object" && !(${M} instanceof RegExp)`,()=>Q.assign(I,O0._`${M}.type || "string"`).assign(N,O0._`${M}.validate`),()=>Q.assign(I,O0._`"string"`).assign(N,M)),Z.fail$data((0,O0.or)(T(),S()));function T(){if(q.strictSchema===!1)return O0.nil;return O0._`${Y} && !${N}`}function S(){let v=V.$async?O0._`(${M}.async ? await ${N}(${W}) : ${N}(${W}))`:O0._`${N}(${W})`,x=O0._`(typeof ${N} == "function" ? ${v} : ${N}.test(${W}))`;return O0._`${N} && ${N} !== true && ${I} === ${X} && !${x}`}}function F(){let A=B.formats[G];if(!A){T();return}if(A===!0)return;let[M,I,N]=S(A);if(M===X)Z.pass(v());function T(){if(q.strictSchema===!1){B.logger.warn(x());return}throw Error(x());function x(){return`unknown format "${G}" ignored in schema at path "${K}"`}}function S(x){let p=x instanceof RegExp?(0,O0.regexpCode)(x):q.code.formats?O0._`${q.code.formats}${(0,O0.getProperty)(G)}`:void 0,f=Q.scopeValue("formats",{key:G,ref:x,code:p});if(typeof x=="object"&&!(x instanceof RegExp))return[x.type||"string",x.validate,O0._`${f}.validate`];return["string",x,f]}function v(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!V.$async)throw Error("async format in sync schema");return O0._`await ${N}(${W})`}return typeof I=="function"?O0._`${N}(${W})`:O0._`${N}.test(${W})`}}}};DV.default=mC});var jV=j((wV)=>{Object.defineProperty(wV,"__esModule",{value:!0});var dC=TV(),cC=[dC.default];wV.default=cC});var RV=j((OV)=>{Object.defineProperty(OV,"__esModule",{value:!0});OV.contentVocabulary=OV.metadataVocabulary=void 0;OV.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];OV.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var SV=j((CV)=>{Object.defineProperty(CV,"__esModule",{value:!0});var iC=D3(),rC=r3(),aC=lU(),sC=WV(),oC=VV(),tC=NV(),eC=jV(),PV=RV(),ZS=[sC.default,iC.default,rC.default,(0,aC.default)(!0),eC.default,PV.metadataVocabulary,PV.contentVocabulary,oC.default,tC.default];CV.default=ZS});var xV=j((bV)=>{Object.defineProperty(bV,"__esModule",{value:!0});bV.DiscrError=void 0;var kV;(function(Z){Z.Tag="tag",Z.Mapping="mapping"})(kV||(bV.DiscrError=kV={}))});var gV=j((yV)=>{Object.defineProperty(yV,"__esModule",{value:!0});var l1=Z0(),ZQ=xV(),vV=S9(),QS=P9(),WS=W0(),JS={message:({params:{discrError:Z,tagName:X}})=>Z===ZQ.DiscrError.Tag?`tag "${X}" must be string`:`value of tag "${X}" must be in oneOf`,params:({params:{discrError:Z,tag:X,tagName:Q}})=>l1._`{error: ${Z}, tag: ${Q}, tagValue: ${X}}`},GS={keyword:"discriminator",type:"object",schemaType:"object",error:JS,code(Z){let{gen:X,data:Q,schema:W,parentSchema:J,it:G}=Z,{oneOf:Y}=J;if(!G.opts.discriminator)throw Error("discriminator: requires discriminator option");let z=W.propertyName;if(typeof z!="string")throw Error("discriminator: requires propertyName");if(W.mapping)throw Error("discriminator: mapping is not supported");if(!Y)throw Error("discriminator: requires oneOf keyword");let q=X.let("valid",!1),K=X.const("tag",l1._`${Q}${(0,l1.getProperty)(z)}`);X.if(l1._`typeof ${K} == "string"`,()=>V(),()=>Z.error(!1,{discrError:ZQ.DiscrError.Tag,tag:K,tagName:z})),Z.ok(q);function V(){let F=H();X.if(!1);for(let A in F)X.elseIf(l1._`${K} === ${A}`),X.assign(q,B(F[A]));X.else(),Z.error(!1,{discrError:ZQ.DiscrError.Mapping,tag:K,tagName:z}),X.endIf()}function B(F){let A=X.name("valid"),M=Z.subschema({keyword:"oneOf",schemaProp:F},A);return Z.mergeEvaluated(M,l1.Name),A}function H(){var F;let A={},M=N(J),I=!0;for(let v=0;v<Y.length;v++){let x=Y[v];if((x===null||x===void 0?void 0:x.$ref)&&!(0,WS.schemaHasRulesButRef)(x,G.self.RULES)){let f=x.$ref;if(x=vV.resolveRef.call(G.self,G.schemaEnv.root,G.baseId,f),x instanceof vV.SchemaEnv)x=x.schema;if(x===void 0)throw new QS.default(G.opts.uriResolver,G.baseId,f)}let p=(F=x===null||x===void 0?void 0:x.properties)===null||F===void 0?void 0:F[z];if(typeof p!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${z}"`);I=I&&(M||N(x)),T(p,v)}if(!I)throw Error(`discriminator: "${z}" must be required`);return A;function N({required:v}){return Array.isArray(v)&&v.includes(z)}function T(v,x){if(v.const)S(v.const,x);else if(v.enum)for(let p of v.enum)S(p,x);else throw Error(`discriminator: "properties/${z}" must have "const" or "enum"`)}function S(v,x){if(typeof v!="string"||v in A)throw Error(`discriminator: "${z}" values must be unique strings`);A[v]=x}}}};yV.default=GS});var fV=j((Sf,zS)=>{zS.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var hV=j((kf,$S)=>{$S.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var uV=j((bf,qS)=>{qS.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var mV=j((_f,KS)=>{KS.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var lV=j((xf,US)=>{US.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var dV=j((vf,VS)=>{VS.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var cV=j((yf,BS)=>{BS.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var pV=j((gf,HS)=>{HS.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var iV=j((nV)=>{Object.defineProperty(nV,"__esModule",{value:!0});var FS=fV(),LS=hV(),AS=uV(),MS=mV(),IS=lV(),NS=dV(),DS=cV(),TS=pV(),wS=["/properties"];function jS(Z){return[FS,LS,AS,MS,IS,X(this,NS),DS,X(this,TS)].forEach((Q)=>this.addMetaSchema(Q,void 0,!1)),this;function X(Q,W){return Z?Q.$dataMetaSchema(W,wS):W}}nV.default=jS});var rV=j((X4,QQ)=>{Object.defineProperty(X4,"__esModule",{value:!0});X4.MissingRefError=X4.ValidationError=X4.CodeGen=X4.Name=X4.nil=X4.stringify=X4.str=X4._=X4.KeywordCxt=X4.Ajv2020=void 0;var ES=V3(),RS=SV(),PS=gV(),CS=iV(),XQ="https://json-schema.org/draft/2020-12/schema";class m9 extends ES.default{constructor(Z={}){super({...Z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),RS.default.forEach((Z)=>this.addVocabulary(Z)),this.opts.discriminator)this.addKeyword(PS.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:Z,meta:X}=this.opts;if(!X)return;CS.default.call(this,Z),this.refs["http://json-schema.org/schema"]=XQ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(XQ)?XQ:void 0)}}X4.Ajv2020=m9;QQ.exports=X4=m9;QQ.exports.Ajv2020=m9;Object.defineProperty(X4,"__esModule",{value:!0});X4.default=m9;var SS=R9();Object.defineProperty(X4,"KeywordCxt",{enumerable:!0,get:function(){return SS.KeywordCxt}});var d1=Z0();Object.defineProperty(X4,"_",{enumerable:!0,get:function(){return d1._}});Object.defineProperty(X4,"str",{enumerable:!0,get:function(){return d1.str}});Object.defineProperty(X4,"stringify",{enumerable:!0,get:function(){return d1.stringify}});Object.defineProperty(X4,"nil",{enumerable:!0,get:function(){return d1.nil}});Object.defineProperty(X4,"Name",{enumerable:!0,get:function(){return d1.Name}});Object.defineProperty(X4,"CodeGen",{enumerable:!0,get:function(){return d1.CodeGen}});var kS=F5();Object.defineProperty(X4,"ValidationError",{enumerable:!0,get:function(){return kS.default}});var bS=P9();Object.defineProperty(X4,"MissingRefError",{enumerable:!0,get:function(){return bS.default}})});var sV={};x6(sV,{validateProjectFile:()=>hS});import{existsSync as WQ,readFileSync as g5}from"node:fs";import{createRequire as aV}from"node:module";import{isAbsolute as vS,relative as yS,resolve as y5}from"node:path";import{fileURLToPath as gS,pathToFileURL as fS}from"node:url";async function hS(Z){let X=y5(Z),Q=y5(X,"project.json"),W=y5(X,"project.schema.json");if(!WQ(Q))throw Error(`project.json not found in ${X}`);if(!WQ(W))throw Error(`project.schema.json not found in ${X} — run \`jx schema\` to generate it from `+"project.json#/extensions");let J=JSON.parse(g5(Q,"utf8")),G=JSON.parse(g5(W,"utf8"));G.$id=fS(W).href;let Y;try{({default:Y}=await Promise.resolve().then(() => W1(rV(),1)))}catch(V){throw Error("Project validation requires ajv: bun add ajv",{cause:V})}let q=await new Y({allErrors:!0,loadSchema:(V)=>uS(V,X),strict:!1}).compileAsync(G),K=q(J);return{errors:q.errors??null,valid:K}}async function uS(Z,X){if(!Z.startsWith("file:"))throw Error(`Cannot resolve schema ref "${Z}": only project-relative file refs are loadable (canonical URIs must resolve from already-loaded fragments)`);let Q=gS(Z),W=yS(X,Q);if(W.startsWith("..")||vS(W))throw Error(`Schema ref "${Z}" escapes the project root ${X}`);if(WQ(Q))return JSON.parse(g5(Q,"utf8"));let J=W.split("\\").join("/"),G="node_modules/",Y=J.lastIndexOf(G);if(Y===-1)throw Error(`Schema ref "${Z}" does not exist`);let z=J.slice(Y+G.length),q;try{q=aV(y5(X,"package.json")).resolve(z)}catch{try{q=aV(import.meta.url).resolve(z)}catch(K){throw Error(`Schema ref "${Z}" does not exist and "${z}" is not resolvable from the project or the host`,{cause:K})}}return JSON.parse(g5(q,"utf8"))}var oV=()=>{};import{relative as JQ,resolve as mS}from"node:path";async function lS(){let Z=process.argv.slice(2),[X]=Z;if(!X||X==="--help"||X==="-h")console.log(`Usage: jx <command> [options]
308
+ Sitemap: ${new URL("/sitemap.xml",Q).href}
309
+ `,D4(W,J,"utf8"),X?0:1}var p$=u(()=>{y4();v8();ZG();E6();WG();JG();$G();uJ();K9();I6();KG();h$();zQ()});var n$={};e4(n$,{runDev:()=>sD,resolveDevEntry:()=>i$});import{createRequire as nD}from"node:module";import{join as rD}from"node:path";import{spawn as aD}from"node:child_process";function i$(Z){try{return nD(rD(Z,"package.json")).resolve("@jxsuite/server/dev")}catch{throw Error(`@jxsuite/server is not installed in ${Z}. Add it to devDependencies (e.g. \`bun add -d @jxsuite/server\`) and retry.`)}}function sD(Z,Q,W=aD,X=process){let G=[i$(Z),"--root",Z];if(Q!==void 0)G.push("--port",String(Q));let Y=W("bun",G,{stdio:"inherit"});return Y.on("error",(z)=>{if(z.code==="ENOENT")console.error("The Jx dev server runs on Bun, which was not found on your PATH. Install it from https://bun.sh and retry.");else console.error(`Failed to start the dev server: ${z.message}`);X.exitCode=1}),X.on("SIGINT",()=>{Y.kill("SIGINT")}),X.on("SIGTERM",()=>{Y.kill("SIGTERM")}),Y.on("exit",(z)=>{X.exitCode=z??0}),Y}var r$=()=>{};var t$={};e4(t$,{startPreviewServer:()=>Xw,resolvePreviewFile:()=>o$});import{createServer as oD}from"node:http";import{existsSync as z5,readFileSync as a$,statSync as tD}from"node:fs";import{extname as eD,join as VQ,normalize as Zw,resolve as s$,sep as Qw}from"node:path";function o$(Z,Q){let W=Zw(Q).replaceAll("\\","/"),X=s$(Z,`.${W.startsWith("/")?W:`/${W}`}`);if(X!==Z&&!X.startsWith(Z+Qw))return null;if(z5(X)){if(tD(X).isDirectory()){let G=VQ(X,"index.html");return z5(G)?G:null}return X}let J=VQ(X,"index.html");return z5(J)?J:null}function Xw(Z,Q){let W=s$(Z),X=oD((J,G)=>{let Y=new URL(J.url??"/","http://localhost"),z=o$(W,decodeURIComponent(Y.pathname));if(z){G.writeHead(200,{"Content-Type":Ww[eD(z).toLowerCase()]??"application/octet-stream"}),G.end(a$(z));return}let q=VQ(W,"404.html");if(z5(q)){G.writeHead(404,{"Content-Type":"text/html; charset=utf-8"}),G.end(a$(q));return}G.writeHead(404,{"Content-Type":"text/plain; charset=utf-8"}),G.end("Not found")});return X.listen(Q),X}var Ww;var e$=u(()=>{Ww={".avif":"image/avif",".css":"text/css; charset=utf-8",".gif":"image/gif",".html":"text/html; charset=utf-8",".ico":"image/x-icon",".jpeg":"image/jpeg",".jpg":"image/jpeg",".js":"text/javascript; charset=utf-8",".json":"application/json; charset=utf-8",".md":"text/markdown; charset=utf-8",".png":"image/png",".svg":"image/svg+xml",".txt":"text/plain; charset=utf-8",".webp":"image/webp",".woff2":"font/woff2",".xml":"application/xml; charset=utf-8"}});var HQ="https://jxsuite.com/schema/project/fields/v2",$5="https://jxsuite.com/schema/document/paths/v2",kg;var BQ=u(()=>{kg={description:"A single field definition inside a section entry schema — a small, recursive subset of "+"JSON Schema. Recursive positions reference the effective field union via the well-known fields resource $id.",properties:{default:{},description:{type:"string"},enum:{type:"array"},format:{type:"string"},items:{$ref:"https://jxsuite.com/schema/project/fields/v2"},properties:{additionalProperties:{$ref:"https://jxsuite.com/schema/project/fields/v2"},type:"object"},required:{items:{type:"string"},type:"array"},type:{enum:["string","number","integer","boolean","array","object"],type:"string"}},required:["type"],type:"object"}});function Xq(Z){let{corePath:Q,fragments:W,fieldSchemaRefs:X=[]}=Z;return{$comment:Wq,$defs:{Fields:{$id:HQ,anyOf:[{$ref:`${Zq}#/$defs/JxFieldSchema`},{$ref:`${Zq}#/$defs/RelationshipRef`},...X.map((J)=>({$ref:J}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:Q},...W.map((J)=>({$ref:J}))],type:"object",unevaluatedProperties:!1}}async function LQ(Z,Q,W){let X=structuredClone(Z),J=new Map,G=new Set;FQ(X,G);let Y=0,z=async(K)=>{let V=Qq(K),H=J.get(V);if(H!==void 0)return H;let B;try{B=structuredClone(await Q(V))}catch(I){throw Error(`bundleSchema: cannot load $ref target "${V}": ${Gw(I)}`,{cause:I})}let F=typeof B.$id==="string"&&q5(B.$id)?B.$id:null;Y+=F===null?1:0;let A=F??`urn:jx:bundled:${Y}`;if(J.set(V,A),G.has(A))return A;G.add(A),B.$id=A,await q(B,Jw(V),!0);let M=X.$defs??={};return M[A]=B,A},q=async(K,V,H=!1)=>{if(Array.isArray(K)){for(let M of K)await q(M,V);return}if(K===null||typeof K!=="object")return;let B=K,F=V;if(!H&&typeof B.$id==="string"&&q5(B.$id))F=null;let A=B.$ref;if(typeof A==="string"&&F!==null&&!A.startsWith("#")&&!q5(A)){let M=A.indexOf("#"),I=M===-1?A:A.slice(0,M),N=M===-1?"":A.slice(M);if(I){let D=await z(`${F}/${I}`);B.$ref=`${D}${N}`}}for(let M of Object.values(B))await q(M,F)};return await q(X,Qq(W),!0),X}function FQ(Z,Q){if(Array.isArray(Z)){for(let X of Z)FQ(X,Q);return}if(Z===null||typeof Z!=="object")return;let W=Z;if(typeof W.$id==="string"&&q5(W.$id))Q.add(W.$id);for(let X of Object.values(W))FQ(X,Q)}function q5(Z){return/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(Z)}function Qq(Z){let Q=Z.replaceAll("\\","/"),W=Q.startsWith("/"),X=[];for(let J of Q.split("/")){if(J===""||J===".")continue;if(J===".."){if(X.length>0&&X.at(-1)!=="..")X.pop();else if(!W)X.push("..");continue}X.push(J)}return(W?"/":"")+X.join("/")}function Jw(Z){let Q=Z.lastIndexOf("/");if(Q===-1)return".";return Q===0?"/":Z.slice(0,Q)}function Gw(Z){return Z instanceof Error?Z.message:String(Z)}function Jq(Z){let{corePath:Q,pathsValueRefs:W}=Z;return{$comment:Wq,$defs:{PathsValue:W.length>0?{$id:$5,anyOf:W.map((X)=>({$ref:X}))}:{$id:$5}},$ref:Q,$schema:"https://json-schema.org/draft/2020-12/schema"}}var Zq="https://jxsuite.com/schema/project/core/v2",Wq="Generated by `jx schema` from project.json#/extensions — do not edit.";var Gq=u(()=>{BQ();BQ()});var Bq={};e4(Bq,{writeProjectSchemas:()=>Vq,readBundledProjectSchemas:()=>Kw});import{existsSync as Uq,readFileSync as E9,statSync as Yq,writeFileSync as zq}from"node:fs";import{createRequire as K5}from"node:module";import{dirname as Yw,isAbsolute as zw,relative as AQ,resolve as q6,sep as MQ}from"node:path";async function Vq(Z){let{config:Q}=w1(Z),W=await j6(Z,Q),X=$q(Z,$w),J=[],G=[],Y=[];for(let H of W.extensions){let B=H.schemas.project;if(B)J.push(qq(Z,H,B));let F=H.schemas.document;if(F)G.push(...Kq(F));let A=H.schemas.fields;if(A)Y.push(...Kq(A)),J.push(qq(Z,H,A))}let z=Xq({corePath:X,fieldSchemaRefs:Y,fragments:J}),q=Jq({corePath:$q(Z,qw),pathsValueRefs:G}),K=q6(Z,"project.schema.json"),V=q6(Z,"document.schema.json");return zq(K,`${JSON.stringify(z,null,2)}
310
+ `,"utf8"),zq(V,`${JSON.stringify(q,null,2)}
311
+ `,"utf8"),{documentSchemaPath:V,projectSchemaPath:K}}async function Kw(Z){let Q=q6(Z),W=q6(Q,"project.json"),X=q6(Q,"project.schema.json"),J=q6(Q,"document.schema.json"),G=(K)=>{if(!Uq(K))return!0;try{return Yq(W).mtimeMs>Yq(K).mtimeMs}catch{return!1}};if(G(X)||G(J))await Vq(Q);let Y=Uw(Q),z=await LQ(JSON.parse(E9(X,"utf8")),Y,Q);return{document:await LQ(JSON.parse(E9(J,"utf8")),Y,Q),project:z}}function Uw(Z){return async(Q)=>{let W=q6(Q),X=AQ(Z,W);if(X.startsWith("..")||zw(X))throw Error(`Schema ref "${Q}" escapes the project root ${Z}`);if(Uq(W))return JSON.parse(E9(W,"utf8"));let J=X.split(MQ).join("/"),G="node_modules/",Y=J.lastIndexOf(G);if(Y===-1)throw Error(`Schema ref "${Q}" does not exist`);let z=J.slice(Y+G.length),q;try{q=K5(q6(Z,"package.json")).resolve(z)}catch{try{q=K5(import.meta.url).resolve(z)}catch(K){throw Error(`Schema ref "${Q}" does not exist and "${z}" is not resolvable from the project or the host`,{cause:K})}}return JSON.parse(E9(q,"utf8"))}}function $q(Z,Q){let W=null;try{W=K5(q6(Z,"package.json")).resolve(Q)}catch{try{W=K5(import.meta.url).resolve(Q)}catch{W=null}}let X=`./node_modules/${Q}`;return W?Hq(Z,W,X):X}function qq(Z,Q,W){let X=AQ(Yw(Q.manifestPath),W).split(MQ).join("/"),J=`./node_modules/${Q.specifier}/${X}`;return Hq(Z,W,J)}function Hq(Z,Q,W){let X=AQ(Z,Q).split(MQ).join("/");if(X.startsWith(".."))return W;return X.startsWith("./")?X:`./${X}`}function Kq(Z){let Q;try{Q=JSON.parse(E9(Z,"utf8"))}catch{return[]}let{$id:W}=Q;if(typeof W!=="string"||!Q.$defs)return[];return Object.keys(Q.$defs).map((X)=>`${W}#/$defs/${X}`)}var $w="@jxsuite/schema/schemas/project.core.schema.json",qw="@jxsuite/schema/schema.json";var Fq=u(()=>{Gq();E6();v8()});var R9=j((Mq)=>{Object.defineProperty(Mq,"__esModule",{value:!0});Mq.regexpCode=Mq.getEsmExportName=Mq.getProperty=Mq.safeStringify=Mq.stringify=Mq.strConcat=Mq.addCodeArg=Mq.str=Mq._=Mq.nil=Mq._Code=Mq.Name=Mq.IDENTIFIER=Mq._CodeOrName=void 0;class U5{}Mq._CodeOrName=U5;Mq.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class g1 extends U5{constructor(Z){super();if(!Mq.IDENTIFIER.test(Z))throw Error("CodeGen: name must be a valid identifier");this.str=Z}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Mq.Name=g1;class C4 extends U5{constructor(Z){super();this._items=typeof Z==="string"?[Z]:Z}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let Z=this._items[0];return Z===""||Z==='""'}get str(){var Z;return(Z=this._str)!==null&&Z!==void 0?Z:this._str=this._items.reduce((Q,W)=>`${Q}${W}`,"")}get names(){var Z;return(Z=this._names)!==null&&Z!==void 0?Z:this._names=this._items.reduce((Q,W)=>{if(W instanceof g1)Q[W.str]=(Q[W.str]||0)+1;return Q},{})}}Mq._Code=C4;Mq.nil=new C4("");function Lq(Z,...Q){let W=[Z[0]],X=0;while(X<Q.length)NQ(W,Q[X]),W.push(Z[++X]);return new C4(W)}Mq._=Lq;var IQ=new C4("+");function Aq(Z,...Q){let W=[O9(Z[0])],X=0;while(X<Q.length)W.push(IQ),NQ(W,Q[X]),W.push(IQ,O9(Z[++X]));return Vw(W),new C4(W)}Mq.str=Aq;function NQ(Z,Q){if(Q instanceof C4)Z.push(...Q._items);else if(Q instanceof g1)Z.push(Q);else Z.push(Fw(Q))}Mq.addCodeArg=NQ;function Vw(Z){let Q=1;while(Q<Z.length-1){if(Z[Q]===IQ){let W=Hw(Z[Q-1],Z[Q+1]);if(W!==void 0){Z.splice(Q-1,3,W);continue}Z[Q++]="+"}Q++}}function Hw(Z,Q){if(Q==='""')return Z;if(Z==='""')return Q;if(typeof Z=="string"){if(Q instanceof g1||Z[Z.length-1]!=='"')return;if(typeof Q!="string")return`${Z.slice(0,-1)}${Q}"`;if(Q[0]==='"')return Z.slice(0,-1)+Q.slice(1);return}if(typeof Q=="string"&&Q[0]==='"'&&!(Z instanceof g1))return`"${Z}${Q.slice(1)}`;return}function Bw(Z,Q){return Q.emptyStr()?Z:Z.emptyStr()?Q:Aq`${Z}${Q}`}Mq.strConcat=Bw;function Fw(Z){return typeof Z=="number"||typeof Z=="boolean"||Z===null?Z:O9(Array.isArray(Z)?Z.join(","):Z)}function Lw(Z){return new C4(O9(Z))}Mq.stringify=Lw;function O9(Z){return JSON.stringify(Z).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Mq.safeStringify=O9;function Aw(Z){return typeof Z=="string"&&Mq.IDENTIFIER.test(Z)?new C4(`.${Z}`):Lq`[${Z}]`}Mq.getProperty=Aw;function Mw(Z){if(typeof Z=="string"&&Mq.IDENTIFIER.test(Z))return new C4(`${Z}`);throw Error(`CodeGen: invalid export name: ${Z}, use explicit $id name mapping`)}Mq.getEsmExportName=Mw;function Iw(Z){return new C4(Z.toString())}Mq.regexpCode=Iw});var jQ=j((wq)=>{Object.defineProperty(wq,"__esModule",{value:!0});wq.ValueScope=wq.ValueScopeName=wq.Scope=wq.varKinds=wq.UsedValueState=void 0;var W4=R9();class Nq extends Error{constructor(Z){super(`CodeGen: "code" for ${Z} not defined`);this.value=Z.value}}var H5;(function(Z){Z[Z.Started=0]="Started",Z[Z.Completed=1]="Completed"})(H5||(wq.UsedValueState=H5={}));wq.varKinds={const:new W4.Name("const"),let:new W4.Name("let"),var:new W4.Name("var")};class wQ{constructor({prefixes:Z,parent:Q}={}){this._names={},this._prefixes=Z,this._parent=Q}toName(Z){return Z instanceof W4.Name?Z:this.name(Z)}name(Z){return new W4.Name(this._newName(Z))}_newName(Z){let Q=this._names[Z]||this._nameGroup(Z);return`${Z}${Q.index++}`}_nameGroup(Z){var Q,W;if(((W=(Q=this._parent)===null||Q===void 0?void 0:Q._prefixes)===null||W===void 0?void 0:W.has(Z))||this._prefixes&&!this._prefixes.has(Z))throw Error(`CodeGen: prefix "${Z}" is not allowed in this scope`);return this._names[Z]={prefix:Z,index:0}}}wq.Scope=wQ;class TQ extends W4.Name{constructor(Z,Q){super(Q);this.prefix=Z}setValue(Z,{property:Q,itemIndex:W}){this.value=Z,this.scopePath=W4._`.${new W4.Name(Q)}[${W}]`}}wq.ValueScopeName=TQ;var _w=W4._`\n`;class Dq extends wQ{constructor(Z){super(Z);this._values={},this._scope=Z.scope,this.opts={...Z,_n:Z.lines?_w:W4.nil}}get(){return this._scope}name(Z){return new TQ(Z,this._newName(Z))}value(Z,Q){var W;if(Q.ref===void 0)throw Error("CodeGen: ref must be passed in value");let X=this.toName(Z),{prefix:J}=X,G=(W=Q.key)!==null&&W!==void 0?W:Q.ref,Y=this._values[J];if(Y){let K=Y.get(G);if(K)return K}else Y=this._values[J]=new Map;Y.set(G,X);let z=this._scope[J]||(this._scope[J]=[]),q=z.length;return z[q]=Q.ref,X.setValue(Q,{property:J,itemIndex:q}),X}getValue(Z,Q){let W=this._values[Z];if(!W)return;return W.get(Q)}scopeRefs(Z,Q=this._values){return this._reduceValues(Q,(W)=>{if(W.scopePath===void 0)throw Error(`CodeGen: name "${W}" has no value`);return W4._`${Z}${W.scopePath}`})}scopeCode(Z=this._values,Q,W){return this._reduceValues(Z,(X)=>{if(X.value===void 0)throw Error(`CodeGen: name "${X}" has no value`);return X.value.code},Q,W)}_reduceValues(Z,Q,W={},X){let J=W4.nil;for(let G in Z){let Y=Z[G];if(!Y)continue;let z=W[G]=W[G]||new Map;Y.forEach((q)=>{if(z.has(q))return;z.set(q,H5.Started);let K=Q(q);if(K){let V=this.opts.es5?wq.varKinds.var:wq.varKinds.const;J=W4._`${J}${V} ${q} = ${K};${this.opts._n}`}else if(K=X===null||X===void 0?void 0:X(q))J=W4._`${J}${K}${this.opts._n}`;else throw new Nq(q);z.set(q,H5.Completed)})}return J}}wq.ValueScope=Dq});var Z0=j((X4)=>{Object.defineProperty(X4,"__esModule",{value:!0});X4.or=X4.and=X4.not=X4.CodeGen=X4.operators=X4.varKinds=X4.ValueScopeName=X4.ValueScope=X4.Scope=X4.Name=X4.regexpCode=X4.stringify=X4.getProperty=X4.nil=X4.strConcat=X4.str=X4._=void 0;var z0=R9(),S4=jQ(),b6=R9();Object.defineProperty(X4,"_",{enumerable:!0,get:function(){return b6._}});Object.defineProperty(X4,"str",{enumerable:!0,get:function(){return b6.str}});Object.defineProperty(X4,"strConcat",{enumerable:!0,get:function(){return b6.strConcat}});Object.defineProperty(X4,"nil",{enumerable:!0,get:function(){return b6.nil}});Object.defineProperty(X4,"getProperty",{enumerable:!0,get:function(){return b6.getProperty}});Object.defineProperty(X4,"stringify",{enumerable:!0,get:function(){return b6.stringify}});Object.defineProperty(X4,"regexpCode",{enumerable:!0,get:function(){return b6.regexpCode}});Object.defineProperty(X4,"Name",{enumerable:!0,get:function(){return b6.Name}});var I5=jQ();Object.defineProperty(X4,"Scope",{enumerable:!0,get:function(){return I5.Scope}});Object.defineProperty(X4,"ValueScope",{enumerable:!0,get:function(){return I5.ValueScope}});Object.defineProperty(X4,"ValueScopeName",{enumerable:!0,get:function(){return I5.ValueScopeName}});Object.defineProperty(X4,"varKinds",{enumerable:!0,get:function(){return I5.varKinds}});X4.operators={GT:new z0._Code(">"),GTE:new z0._Code(">="),LT:new z0._Code("<"),LTE:new z0._Code("<="),EQ:new z0._Code("==="),NEQ:new z0._Code("!=="),NOT:new z0._Code("!"),OR:new z0._Code("||"),AND:new z0._Code("&&"),ADD:new z0._Code("+")};class x6{optimizeNodes(){return this}optimizeNames(Z,Q){return this}}class jq extends x6{constructor(Z,Q,W){super();this.varKind=Z,this.name=Q,this.rhs=W}render({es5:Z,_n:Q}){let W=Z?S4.varKinds.var:this.varKind,X=this.rhs===void 0?"":` = ${this.rhs}`;return`${W} ${this.name}${X};`+Q}optimizeNames(Z,Q){if(!Z[this.name.str])return;if(this.rhs)this.rhs=h1(this.rhs,Z,Q);return this}get names(){return this.rhs instanceof z0._CodeOrName?this.rhs.names:{}}}class RQ extends x6{constructor(Z,Q,W){super();this.lhs=Z,this.rhs=Q,this.sideEffects=W}render({_n:Z}){return`${this.lhs} = ${this.rhs};`+Z}optimizeNames(Z,Q){if(this.lhs instanceof z0.Name&&!Z[this.lhs.str]&&!this.sideEffects)return;return this.rhs=h1(this.rhs,Z,Q),this}get names(){let Z=this.lhs instanceof z0.Name?{}:{...this.lhs.names};return M5(Z,this.rhs)}}class Eq extends RQ{constructor(Z,Q,W,X){super(Z,W,X);this.op=Q}render({_n:Z}){return`${this.lhs} ${this.op}= ${this.rhs};`+Z}}class Oq extends x6{constructor(Z){super();this.label=Z,this.names={}}render({_n:Z}){return`${this.label}:`+Z}}class Rq extends x6{constructor(Z){super();this.label=Z,this.names={}}render({_n:Z}){return`break${this.label?` ${this.label}`:""};`+Z}}class Pq extends x6{constructor(Z){super();this.error=Z}render({_n:Z}){return`throw ${this.error};`+Z}get names(){return this.error.names}}class Cq extends x6{constructor(Z){super();this.code=Z}render({_n:Z}){return`${this.code};`+Z}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(Z,Q){return this.code=h1(this.code,Z,Q),this}get names(){return this.code instanceof z0._CodeOrName?this.code.names:{}}}class N5 extends x6{constructor(Z=[]){super();this.nodes=Z}render(Z){return this.nodes.reduce((Q,W)=>Q+W.render(Z),"")}optimizeNodes(){let{nodes:Z}=this,Q=Z.length;while(Q--){let W=Z[Q].optimizeNodes();if(Array.isArray(W))Z.splice(Q,1,...W);else if(W)Z[Q]=W;else Z.splice(Q,1)}return Z.length>0?this:void 0}optimizeNames(Z,Q){let{nodes:W}=this,X=W.length;while(X--){let J=W[X];if(J.optimizeNames(Z,Q))continue;yw(Z,J.names),W.splice(X,1)}return W.length>0?this:void 0}get names(){return this.nodes.reduce((Z,Q)=>o6(Z,Q.names),{})}}class v6 extends N5{render(Z){return"{"+Z._n+super.render(Z)+"}"+Z._n}}class Sq extends N5{}class P9 extends v6{}P9.kind="else";class K6 extends v6{constructor(Z,Q){super(Q);this.condition=Z}render(Z){let Q=`if(${this.condition})`+super.render(Z);if(this.else)Q+="else "+this.else.render(Z);return Q}optimizeNodes(){super.optimizeNodes();let Z=this.condition;if(Z===!0)return this.nodes;let Q=this.else;if(Q){let W=Q.optimizeNodes();Q=this.else=Array.isArray(W)?new P9(W):W}if(Q){if(Z===!1)return Q instanceof K6?Q:Q.nodes;if(this.nodes.length)return this;return new K6(vq(Z),Q instanceof K6?[Q]:Q.nodes)}if(Z===!1||!this.nodes.length)return;return this}optimizeNames(Z,Q){var W;if(this.else=(W=this.else)===null||W===void 0?void 0:W.optimizeNames(Z,Q),!(super.optimizeNames(Z,Q)||this.else))return;return this.condition=h1(this.condition,Z,Q),this}get names(){let Z=super.names;if(M5(Z,this.condition),this.else)o6(Z,this.else.names);return Z}}K6.kind="if";class f1 extends v6{}f1.kind="for";class kq extends f1{constructor(Z){super();this.iteration=Z}render(Z){return`for(${this.iteration})`+super.render(Z)}optimizeNames(Z,Q){if(!super.optimizeNames(Z,Q))return;return this.iteration=h1(this.iteration,Z,Q),this}get names(){return o6(super.names,this.iteration.names)}}class _q extends f1{constructor(Z,Q,W,X){super();this.varKind=Z,this.name=Q,this.from=W,this.to=X}render(Z){let Q=Z.es5?S4.varKinds.var:this.varKind,{name:W,from:X,to:J}=this;return`for(${Q} ${W}=${X}; ${W}<${J}; ${W}++)`+super.render(Z)}get names(){let Z=M5(super.names,this.from);return M5(Z,this.to)}}class EQ extends f1{constructor(Z,Q,W,X){super();this.loop=Z,this.varKind=Q,this.name=W,this.iterable=X}render(Z){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(Z)}optimizeNames(Z,Q){if(!super.optimizeNames(Z,Q))return;return this.iterable=h1(this.iterable,Z,Q),this}get names(){return o6(super.names,this.iterable.names)}}class B5 extends v6{constructor(Z,Q,W){super();this.name=Z,this.args=Q,this.async=W}render(Z){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(Z)}}B5.kind="func";class F5 extends N5{render(Z){return"return "+super.render(Z)}}F5.kind="return";class bq extends v6{render(Z){let Q="try"+super.render(Z);if(this.catch)Q+=this.catch.render(Z);if(this.finally)Q+=this.finally.render(Z);return Q}optimizeNodes(){var Z,Q;return super.optimizeNodes(),(Z=this.catch)===null||Z===void 0||Z.optimizeNodes(),(Q=this.finally)===null||Q===void 0||Q.optimizeNodes(),this}optimizeNames(Z,Q){var W,X;return super.optimizeNames(Z,Q),(W=this.catch)===null||W===void 0||W.optimizeNames(Z,Q),(X=this.finally)===null||X===void 0||X.optimizeNames(Z,Q),this}get names(){let Z=super.names;if(this.catch)o6(Z,this.catch.names);if(this.finally)o6(Z,this.finally.names);return Z}}class L5 extends v6{constructor(Z){super();this.error=Z}render(Z){return`catch(${this.error})`+super.render(Z)}}L5.kind="catch";class A5 extends v6{render(Z){return"finally"+super.render(Z)}}A5.kind="finally";class xq{constructor(Z,Q={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...Q,_n:Q.lines?`
312
+ `:""},this._extScope=Z,this._scope=new S4.Scope({parent:Z}),this._nodes=[new Sq]}toString(){return this._root.render(this.opts)}name(Z){return this._scope.name(Z)}scopeName(Z){return this._extScope.name(Z)}scopeValue(Z,Q){let W=this._extScope.value(Z,Q);return(this._values[W.prefix]||(this._values[W.prefix]=new Set)).add(W),W}getScopeValue(Z,Q){return this._extScope.getValue(Z,Q)}scopeRefs(Z){return this._extScope.scopeRefs(Z,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(Z,Q,W,X){let J=this._scope.toName(Q);if(W!==void 0&&X)this._constants[J.str]=W;return this._leafNode(new jq(Z,J,W)),J}const(Z,Q,W){return this._def(S4.varKinds.const,Z,Q,W)}let(Z,Q,W){return this._def(S4.varKinds.let,Z,Q,W)}var(Z,Q,W){return this._def(S4.varKinds.var,Z,Q,W)}assign(Z,Q,W){return this._leafNode(new RQ(Z,Q,W))}add(Z,Q){return this._leafNode(new Eq(Z,X4.operators.ADD,Q))}code(Z){if(typeof Z=="function")Z();else if(Z!==z0.nil)this._leafNode(new Cq(Z));return this}object(...Z){let Q=["{"];for(let[W,X]of Z){if(Q.length>1)Q.push(",");if(Q.push(W),W!==X||this.opts.es5)Q.push(":"),(0,z0.addCodeArg)(Q,X)}return Q.push("}"),new z0._Code(Q)}if(Z,Q,W){if(this._blockNode(new K6(Z)),Q&&W)this.code(Q).else().code(W).endIf();else if(Q)this.code(Q).endIf();else if(W)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(Z){return this._elseNode(new K6(Z))}else(){return this._elseNode(new P9)}endIf(){return this._endBlockNode(K6,P9)}_for(Z,Q){if(this._blockNode(Z),Q)this.code(Q).endFor();return this}for(Z,Q){return this._for(new kq(Z),Q)}forRange(Z,Q,W,X,J=this.opts.es5?S4.varKinds.var:S4.varKinds.let){let G=this._scope.toName(Z);return this._for(new _q(J,G,Q,W),()=>X(G))}forOf(Z,Q,W,X=S4.varKinds.const){let J=this._scope.toName(Z);if(this.opts.es5){let G=Q instanceof z0.Name?Q:this.var("_arr",Q);return this.forRange("_i",0,z0._`${G}.length`,(Y)=>{this.var(J,z0._`${G}[${Y}]`),W(J)})}return this._for(new EQ("of",X,J,Q),()=>W(J))}forIn(Z,Q,W,X=this.opts.es5?S4.varKinds.var:S4.varKinds.const){if(this.opts.ownProperties)return this.forOf(Z,z0._`Object.keys(${Q})`,W);let J=this._scope.toName(Z);return this._for(new EQ("in",X,J,Q),()=>W(J))}endFor(){return this._endBlockNode(f1)}label(Z){return this._leafNode(new Oq(Z))}break(Z){return this._leafNode(new Rq(Z))}return(Z){let Q=new F5;if(this._blockNode(Q),this.code(Z),Q.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(F5)}try(Z,Q,W){if(!Q&&!W)throw Error('CodeGen: "try" without "catch" and "finally"');let X=new bq;if(this._blockNode(X),this.code(Z),Q){let J=this.name("e");this._currNode=X.catch=new L5(J),Q(J)}if(W)this._currNode=X.finally=new A5,this.code(W);return this._endBlockNode(L5,A5)}throw(Z){return this._leafNode(new Pq(Z))}block(Z,Q){if(this._blockStarts.push(this._nodes.length),Z)this.code(Z).endBlock(Q);return this}endBlock(Z){let Q=this._blockStarts.pop();if(Q===void 0)throw Error("CodeGen: not in self-balancing block");let W=this._nodes.length-Q;if(W<0||Z!==void 0&&W!==Z)throw Error(`CodeGen: wrong number of nodes: ${W} vs ${Z} expected`);return this._nodes.length=Q,this}func(Z,Q=z0.nil,W,X){if(this._blockNode(new B5(Z,Q,W)),X)this.code(X).endFunc();return this}endFunc(){return this._endBlockNode(B5)}optimize(Z=1){while(Z-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(Z){return this._currNode.nodes.push(Z),this}_blockNode(Z){this._currNode.nodes.push(Z),this._nodes.push(Z)}_endBlockNode(Z,Q){let W=this._currNode;if(W instanceof Z||Q&&W instanceof Q)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${Q?`${Z.kind}/${Q.kind}`:Z.kind}"`)}_elseNode(Z){let Q=this._currNode;if(!(Q instanceof K6))throw Error('CodeGen: "else" without "if"');return this._currNode=Q.else=Z,this}get _root(){return this._nodes[0]}get _currNode(){let Z=this._nodes;return Z[Z.length-1]}set _currNode(Z){let Q=this._nodes;Q[Q.length-1]=Z}}X4.CodeGen=xq;function o6(Z,Q){for(let W in Q)Z[W]=(Z[W]||0)+(Q[W]||0);return Z}function M5(Z,Q){return Q instanceof z0._CodeOrName?o6(Z,Q.names):Z}function h1(Z,Q,W){if(Z instanceof z0.Name)return X(Z);if(!J(Z))return Z;return new z0._Code(Z._items.reduce((G,Y)=>{if(Y instanceof z0.Name)Y=X(Y);if(Y instanceof z0._Code)G.push(...Y._items);else G.push(Y);return G},[]));function X(G){let Y=W[G.str];if(Y===void 0||Q[G.str]!==1)return G;return delete Q[G.str],Y}function J(G){return G instanceof z0._Code&&G._items.some((Y)=>Y instanceof z0.Name&&Q[Y.str]===1&&W[Y.str]!==void 0)}}function yw(Z,Q){for(let W in Q)Z[W]=(Z[W]||0)-(Q[W]||0)}function vq(Z){return typeof Z=="boolean"||typeof Z=="number"||Z===null?!Z:z0._`!${OQ(Z)}`}X4.not=vq;var gw=yq(X4.operators.AND);function fw(...Z){return Z.reduce(gw)}X4.and=fw;var hw=yq(X4.operators.OR);function uw(...Z){return Z.reduce(hw)}X4.or=uw;function yq(Z){return(Q,W)=>Q===z0.nil?W:W===z0.nil?Q:z0._`${OQ(Q)} ${Z} ${OQ(W)}`}function OQ(Z){return Z instanceof z0.Name?Z:z0._`(${Z})`}});var X0=j((pq)=>{Object.defineProperty(pq,"__esModule",{value:!0});pq.checkStrictMode=pq.getErrorPath=pq.Type=pq.useFunc=pq.setEvaluated=pq.evaluatedPropsToName=pq.mergeEvaluated=pq.eachItem=pq.unescapeJsonPointer=pq.escapeJsonPointer=pq.escapeFragment=pq.unescapeFragment=pq.schemaRefOrVal=pq.schemaHasRulesButRef=pq.schemaHasRules=pq.checkUnknownRules=pq.alwaysValidSchema=pq.toHash=void 0;var H0=Z0(),cw=R9();function pw(Z){let Q={};for(let W of Z)Q[W]=!0;return Q}pq.toHash=pw;function iw(Z,Q){if(typeof Q=="boolean")return Q;if(Object.keys(Q).length===0)return!0;return uq(Z,Q),!mq(Q,Z.self.RULES.all)}pq.alwaysValidSchema=iw;function uq(Z,Q=Z.schema){let{opts:W,self:X}=Z;if(!W.strictSchema)return;if(typeof Q==="boolean")return;let J=X.RULES.keywords;for(let G in Q)if(!J[G])cq(Z,`unknown keyword: "${G}"`)}pq.checkUnknownRules=uq;function mq(Z,Q){if(typeof Z=="boolean")return!Z;for(let W in Z)if(Q[W])return!0;return!1}pq.schemaHasRules=mq;function nw(Z,Q){if(typeof Z=="boolean")return!Z;for(let W in Z)if(W!=="$ref"&&Q.all[W])return!0;return!1}pq.schemaHasRulesButRef=nw;function rw({topSchemaRef:Z,schemaPath:Q},W,X,J){if(!J){if(typeof W=="number"||typeof W=="boolean")return W;if(typeof W=="string")return H0._`${W}`}return H0._`${Z}${Q}${(0,H0.getProperty)(X)}`}pq.schemaRefOrVal=rw;function aw(Z){return lq(decodeURIComponent(Z))}pq.unescapeFragment=aw;function sw(Z){return encodeURIComponent(CQ(Z))}pq.escapeFragment=sw;function CQ(Z){if(typeof Z=="number")return`${Z}`;return Z.replace(/~/g,"~0").replace(/\//g,"~1")}pq.escapeJsonPointer=CQ;function lq(Z){return Z.replace(/~1/g,"/").replace(/~0/g,"~")}pq.unescapeJsonPointer=lq;function ow(Z,Q){if(Array.isArray(Z))for(let W of Z)Q(W);else Q(Z)}pq.eachItem=ow;function fq({mergeNames:Z,mergeToName:Q,mergeValues:W,resultToName:X}){return(J,G,Y,z)=>{let q=Y===void 0?G:Y instanceof H0.Name?(G instanceof H0.Name?Z(J,G,Y):Q(J,G,Y),Y):G instanceof H0.Name?(Q(J,Y,G),G):W(G,Y);return z===H0.Name&&!(q instanceof H0.Name)?X(J,q):q}}pq.mergeEvaluated={props:fq({mergeNames:(Z,Q,W)=>Z.if(H0._`${W} !== true && ${Q} !== undefined`,()=>{Z.if(H0._`${Q} === true`,()=>Z.assign(W,!0),()=>Z.assign(W,H0._`${W} || {}`).code(H0._`Object.assign(${W}, ${Q})`))}),mergeToName:(Z,Q,W)=>Z.if(H0._`${W} !== true`,()=>{if(Q===!0)Z.assign(W,!0);else Z.assign(W,H0._`${W} || {}`),SQ(Z,W,Q)}),mergeValues:(Z,Q)=>Z===!0?!0:{...Z,...Q},resultToName:dq}),items:fq({mergeNames:(Z,Q,W)=>Z.if(H0._`${W} !== true && ${Q} !== undefined`,()=>Z.assign(W,H0._`${Q} === true ? true : ${W} > ${Q} ? ${W} : ${Q}`)),mergeToName:(Z,Q,W)=>Z.if(H0._`${W} !== true`,()=>Z.assign(W,Q===!0?!0:H0._`${W} > ${Q} ? ${W} : ${Q}`)),mergeValues:(Z,Q)=>Z===!0?!0:Math.max(Z,Q),resultToName:(Z,Q)=>Z.var("items",Q)})};function dq(Z,Q){if(Q===!0)return Z.var("props",!0);let W=Z.var("props",H0._`{}`);if(Q!==void 0)SQ(Z,W,Q);return W}pq.evaluatedPropsToName=dq;function SQ(Z,Q,W){Object.keys(W).forEach((X)=>Z.assign(H0._`${Q}${(0,H0.getProperty)(X)}`,!0))}pq.setEvaluated=SQ;var hq={};function tw(Z,Q){return Z.scopeValue("func",{ref:Q,code:hq[Q.code]||(hq[Q.code]=new cw._Code(Q.code))})}pq.useFunc=tw;var PQ;(function(Z){Z[Z.Num=0]="Num",Z[Z.Str=1]="Str"})(PQ||(pq.Type=PQ={}));function ew(Z,Q,W){if(Z instanceof H0.Name){let X=Q===PQ.Num;return W?X?H0._`"[" + ${Z} + "]"`:H0._`"['" + ${Z} + "']"`:X?H0._`"/" + ${Z}`:H0._`"/" + ${Z}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return W?(0,H0.getProperty)(Z).toString():"/"+CQ(Z)}pq.getErrorPath=ew;function cq(Z,Q,W=Z.opts.strictSchema){if(!W)return;if(Q=`strict mode: ${Q}`,W===!0)throw Error(Q);Z.self.logger.warn(Q)}pq.checkStrictMode=cq});var w4=j((nq)=>{Object.defineProperty(nq,"__esModule",{value:!0});var d0=Z0(),AT={data:new d0.Name("data"),valCxt:new d0.Name("valCxt"),instancePath:new d0.Name("instancePath"),parentData:new d0.Name("parentData"),parentDataProperty:new d0.Name("parentDataProperty"),rootData:new d0.Name("rootData"),dynamicAnchors:new d0.Name("dynamicAnchors"),vErrors:new d0.Name("vErrors"),errors:new d0.Name("errors"),this:new d0.Name("this"),self:new d0.Name("self"),scope:new d0.Name("scope"),json:new d0.Name("json"),jsonPos:new d0.Name("jsonPos"),jsonLen:new d0.Name("jsonLen"),jsonPart:new d0.Name("jsonPart")};nq.default=AT});var C9=j((oq)=>{Object.defineProperty(oq,"__esModule",{value:!0});oq.extendErrors=oq.resetErrorsCount=oq.reportExtraError=oq.reportError=oq.keyword$DataError=oq.keywordError=void 0;var $0=Z0(),w5=X0(),s0=w4();oq.keywordError={message:({keyword:Z})=>$0.str`must pass "${Z}" keyword validation`};oq.keyword$DataError={message:({keyword:Z,schemaType:Q})=>Q?$0.str`"${Z}" keyword must be ${Q} ($data)`:$0.str`"${Z}" keyword is invalid ($data)`};function IT(Z,Q=oq.keywordError,W,X){let{it:J}=Z,{gen:G,compositeRule:Y,allErrors:z}=J,q=sq(Z,Q,W);if(X!==null&&X!==void 0?X:Y||z)rq(G,q);else aq(J,$0._`[${q}]`)}oq.reportError=IT;function NT(Z,Q=oq.keywordError,W){let{it:X}=Z,{gen:J,compositeRule:G,allErrors:Y}=X,z=sq(Z,Q,W);if(rq(J,z),!(G||Y))aq(X,s0.default.vErrors)}oq.reportExtraError=NT;function DT(Z,Q){Z.assign(s0.default.errors,Q),Z.if($0._`${s0.default.vErrors} !== null`,()=>Z.if(Q,()=>Z.assign($0._`${s0.default.vErrors}.length`,Q),()=>Z.assign(s0.default.vErrors,null)))}oq.resetErrorsCount=DT;function wT({gen:Z,keyword:Q,schemaValue:W,data:X,errsCount:J,it:G}){if(J===void 0)throw Error("ajv implementation error");let Y=Z.name("err");Z.forRange("i",J,s0.default.errors,(z)=>{if(Z.const(Y,$0._`${s0.default.vErrors}[${z}]`),Z.if($0._`${Y}.instancePath === undefined`,()=>Z.assign($0._`${Y}.instancePath`,(0,$0.strConcat)(s0.default.instancePath,G.errorPath))),Z.assign($0._`${Y}.schemaPath`,$0.str`${G.errSchemaPath}/${Q}`),G.opts.verbose)Z.assign($0._`${Y}.schema`,W),Z.assign($0._`${Y}.data`,X)})}oq.extendErrors=wT;function rq(Z,Q){let W=Z.const("err",Q);Z.if($0._`${s0.default.vErrors} === null`,()=>Z.assign(s0.default.vErrors,$0._`[${W}]`),$0._`${s0.default.vErrors}.push(${W})`),Z.code($0._`${s0.default.errors}++`)}function aq(Z,Q){let{gen:W,validateName:X,schemaEnv:J}=Z;if(J.$async)W.throw($0._`new ${Z.ValidationError}(${Q})`);else W.assign($0._`${X}.errors`,Q),W.return(!1)}var t6={keyword:new $0.Name("keyword"),schemaPath:new $0.Name("schemaPath"),params:new $0.Name("params"),propertyName:new $0.Name("propertyName"),message:new $0.Name("message"),schema:new $0.Name("schema"),parentSchema:new $0.Name("parentSchema")};function sq(Z,Q,W){let{createErrors:X}=Z.it;if(X===!1)return $0._`{}`;return TT(Z,Q,W)}function TT(Z,Q,W={}){let{gen:X,it:J}=Z,G=[jT(J,W),ET(Z,W)];return OT(Z,Q,G),X.object(...G)}function jT({errorPath:Z},{instancePath:Q}){let W=Q?$0.str`${Z}${(0,w5.getErrorPath)(Q,w5.Type.Str)}`:Z;return[s0.default.instancePath,(0,$0.strConcat)(s0.default.instancePath,W)]}function ET({keyword:Z,it:{errSchemaPath:Q}},{schemaPath:W,parentSchema:X}){let J=X?Q:$0.str`${Q}/${Z}`;if(W)J=$0.str`${J}${(0,w5.getErrorPath)(W,w5.Type.Str)}`;return[t6.schemaPath,J]}function OT(Z,{params:Q,message:W},X){let{keyword:J,data:G,schemaValue:Y,it:z}=Z,{opts:q,propertyName:K,topSchemaRef:V,schemaPath:H}=z;if(X.push([t6.keyword,J],[t6.params,typeof Q=="function"?Q(Z):Q||$0._`{}`]),q.messages)X.push([t6.message,typeof W=="function"?W(Z):W]);if(q.verbose)X.push([t6.schema,Y],[t6.parentSchema,$0._`${V}${H}`],[s0.default.data,G]);if(K)X.push([t6.propertyName,K])}});var WK=j((ZK)=>{Object.defineProperty(ZK,"__esModule",{value:!0});ZK.boolOrEmptySchema=ZK.topBoolOrEmptySchema=void 0;var kT=C9(),_T=Z0(),bT=w4(),xT={message:"boolean schema is false"};function vT(Z){let{gen:Q,schema:W,validateName:X}=Z;if(W===!1)eq(Z,!1);else if(typeof W=="object"&&W.$async===!0)Q.return(bT.default.data);else Q.assign(_T._`${X}.errors`,null),Q.return(!0)}ZK.topBoolOrEmptySchema=vT;function yT(Z,Q){let{gen:W,schema:X}=Z;if(X===!1)W.var(Q,!1),eq(Z);else W.var(Q,!0)}ZK.boolOrEmptySchema=yT;function eq(Z,Q){let{gen:W,data:X}=Z,J={gen:W,keyword:"false schema",data:X,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:Z};(0,kT.reportError)(J,xT,void 0,Q)}});var _Q=j((XK)=>{Object.defineProperty(XK,"__esModule",{value:!0});XK.getRules=XK.isJSONType=void 0;var fT=["string","number","integer","boolean","null","object","array"],hT=new Set(fT);function uT(Z){return typeof Z=="string"&&hT.has(Z)}XK.isJSONType=uT;function mT(){let Z={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...Z,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},Z.number,Z.string,Z.array,Z.object],post:{rules:[]},all:{},keywords:{}}}XK.getRules=mT});var bQ=j((zK)=>{Object.defineProperty(zK,"__esModule",{value:!0});zK.shouldUseRule=zK.shouldUseGroup=zK.schemaHasRulesForType=void 0;function dT({schema:Z,self:Q},W){let X=Q.RULES.types[W];return X&&X!==!0&&GK(Z,X)}zK.schemaHasRulesForType=dT;function GK(Z,Q){return Q.rules.some((W)=>YK(Z,W))}zK.shouldUseGroup=GK;function YK(Z,Q){var W;return Z[Q.keyword]!==void 0||((W=Q.definition.implements)===null||W===void 0?void 0:W.some((X)=>Z[X]!==void 0))}zK.shouldUseRule=YK});var S9=j((VK)=>{Object.defineProperty(VK,"__esModule",{value:!0});VK.reportTypeError=VK.checkDataTypes=VK.checkDataType=VK.coerceAndCheckDataType=VK.getJSONTypes=VK.getSchemaTypes=VK.DataType=void 0;var iT=_Q(),nT=bQ(),rT=C9(),W0=Z0(),qK=X0(),u1;(function(Z){Z[Z.Correct=0]="Correct",Z[Z.Wrong=1]="Wrong"})(u1||(VK.DataType=u1={}));function aT(Z){let Q=KK(Z.type);if(Q.includes("null")){if(Z.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!Q.length&&Z.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(Z.nullable===!0)Q.push("null")}return Q}VK.getSchemaTypes=aT;function KK(Z){let Q=Array.isArray(Z)?Z:Z?[Z]:[];if(Q.every(iT.isJSONType))return Q;throw Error("type must be JSONType or JSONType[]: "+Q.join(","))}VK.getJSONTypes=KK;function sT(Z,Q){let{gen:W,data:X,opts:J}=Z,G=oT(Q,J.coerceTypes),Y=Q.length>0&&!(G.length===0&&Q.length===1&&(0,nT.schemaHasRulesForType)(Z,Q[0]));if(Y){let z=vQ(Q,X,J.strictNumbers,u1.Wrong);W.if(z,()=>{if(G.length)tT(Z,Q,G);else yQ(Z)})}return Y}VK.coerceAndCheckDataType=sT;var UK=new Set(["string","number","integer","boolean","null"]);function oT(Z,Q){return Q?Z.filter((W)=>UK.has(W)||Q==="array"&&W==="array"):[]}function tT(Z,Q,W){let{gen:X,data:J,opts:G}=Z,Y=X.let("dataType",W0._`typeof ${J}`),z=X.let("coerced",W0._`undefined`);if(G.coerceTypes==="array")X.if(W0._`${Y} == 'object' && Array.isArray(${J}) && ${J}.length == 1`,()=>X.assign(J,W0._`${J}[0]`).assign(Y,W0._`typeof ${J}`).if(vQ(Q,J,G.strictNumbers),()=>X.assign(z,J)));X.if(W0._`${z} !== undefined`);for(let K of W)if(UK.has(K)||K==="array"&&G.coerceTypes==="array")q(K);X.else(),yQ(Z),X.endIf(),X.if(W0._`${z} !== undefined`,()=>{X.assign(J,z),eT(Z,z)});function q(K){switch(K){case"string":X.elseIf(W0._`${Y} == "number" || ${Y} == "boolean"`).assign(z,W0._`"" + ${J}`).elseIf(W0._`${J} === null`).assign(z,W0._`""`);return;case"number":X.elseIf(W0._`${Y} == "boolean" || ${J} === null
313
+ || (${Y} == "string" && ${J} && ${J} == +${J})`).assign(z,W0._`+${J}`);return;case"integer":X.elseIf(W0._`${Y} === "boolean" || ${J} === null
314
+ || (${Y} === "string" && ${J} && ${J} == +${J} && !(${J} % 1))`).assign(z,W0._`+${J}`);return;case"boolean":X.elseIf(W0._`${J} === "false" || ${J} === 0 || ${J} === null`).assign(z,!1).elseIf(W0._`${J} === "true" || ${J} === 1`).assign(z,!0);return;case"null":X.elseIf(W0._`${J} === "" || ${J} === 0 || ${J} === false`),X.assign(z,null);return;case"array":X.elseIf(W0._`${Y} === "string" || ${Y} === "number"
315
+ || ${Y} === "boolean" || ${J} === null`).assign(z,W0._`[${J}]`)}}}function eT({gen:Z,parentData:Q,parentDataProperty:W},X){Z.if(W0._`${Q} !== undefined`,()=>Z.assign(W0._`${Q}[${W}]`,X))}function xQ(Z,Q,W,X=u1.Correct){let J=X===u1.Correct?W0.operators.EQ:W0.operators.NEQ,G;switch(Z){case"null":return W0._`${Q} ${J} null`;case"array":G=W0._`Array.isArray(${Q})`;break;case"object":G=W0._`${Q} && typeof ${Q} == "object" && !Array.isArray(${Q})`;break;case"integer":G=Y(W0._`!(${Q} % 1) && !isNaN(${Q})`);break;case"number":G=Y();break;default:return W0._`typeof ${Q} ${J} ${Z}`}return X===u1.Correct?G:(0,W0.not)(G);function Y(z=W0.nil){return(0,W0.and)(W0._`typeof ${Q} == "number"`,z,W?W0._`isFinite(${Q})`:W0.nil)}}VK.checkDataType=xQ;function vQ(Z,Q,W,X){if(Z.length===1)return xQ(Z[0],Q,W,X);let J,G=(0,qK.toHash)(Z);if(G.array&&G.object){let Y=W0._`typeof ${Q} != "object"`;J=G.null?Y:W0._`!${Q} || ${Y}`,delete G.null,delete G.array,delete G.object}else J=W0.nil;if(G.number)delete G.integer;for(let Y in G)J=(0,W0.and)(J,xQ(Y,Q,W,X));return J}VK.checkDataTypes=vQ;var Zj={message:({schema:Z})=>`must be ${Z}`,params:({schema:Z,schemaValue:Q})=>typeof Z=="string"?W0._`{type: ${Z}}`:W0._`{type: ${Q}}`};function yQ(Z){let Q=Qj(Z);(0,rT.reportError)(Q,Zj)}VK.reportTypeError=yQ;function Qj(Z){let{gen:Q,data:W,schema:X}=Z,J=(0,qK.schemaRefOrVal)(Z,X,"type");return{gen:Q,keyword:"type",data:W,schema:X.type,schemaCode:J,schemaValue:J,parentSchema:X,params:{},it:Z}}});var AK=j((FK)=>{Object.defineProperty(FK,"__esModule",{value:!0});FK.assignDefaults=void 0;var m1=Z0(),$j=X0();function qj(Z,Q){let{properties:W,items:X}=Z.schema;if(Q==="object"&&W)for(let J in W)BK(Z,J,W[J].default);else if(Q==="array"&&Array.isArray(X))X.forEach((J,G)=>BK(Z,G,J.default))}FK.assignDefaults=qj;function BK(Z,Q,W){let{gen:X,compositeRule:J,data:G,opts:Y}=Z;if(W===void 0)return;let z=m1._`${G}${(0,m1.getProperty)(Q)}`;if(J){(0,$j.checkStrictMode)(Z,`default is ignored for: ${z}`);return}let q=m1._`${z} === undefined`;if(Y.useDefaults==="empty")q=m1._`${q} || ${z} === null || ${z} === ""`;X.if(q,m1._`${z} = ${(0,m1.stringify)(W)}`)}});var T4=j((NK)=>{Object.defineProperty(NK,"__esModule",{value:!0});NK.validateUnion=NK.validateArray=NK.usePattern=NK.callValidateCode=NK.schemaProperties=NK.allSchemaProperties=NK.noPropertyInData=NK.propertyInData=NK.isOwnProperty=NK.hasPropFunc=NK.reportMissingProp=NK.checkMissingProp=NK.checkReportMissingProp=void 0;var M0=Z0(),gQ=X0(),y6=w4(),Kj=X0();function Uj(Z,Q){let{gen:W,data:X,it:J}=Z;W.if(hQ(W,X,Q,J.opts.ownProperties),()=>{Z.setParams({missingProperty:M0._`${Q}`},!0),Z.error()})}NK.checkReportMissingProp=Uj;function Vj({gen:Z,data:Q,it:{opts:W}},X,J){return(0,M0.or)(...X.map((G)=>(0,M0.and)(hQ(Z,Q,G,W.ownProperties),M0._`${J} = ${G}`)))}NK.checkMissingProp=Vj;function Hj(Z,Q){Z.setParams({missingProperty:Q},!0),Z.error()}NK.reportMissingProp=Hj;function MK(Z){return Z.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:M0._`Object.prototype.hasOwnProperty`})}NK.hasPropFunc=MK;function fQ(Z,Q,W){return M0._`${MK(Z)}.call(${Q}, ${W})`}NK.isOwnProperty=fQ;function Bj(Z,Q,W,X){let J=M0._`${Q}${(0,M0.getProperty)(W)} !== undefined`;return X?M0._`${J} && ${fQ(Z,Q,W)}`:J}NK.propertyInData=Bj;function hQ(Z,Q,W,X){let J=M0._`${Q}${(0,M0.getProperty)(W)} === undefined`;return X?(0,M0.or)(J,(0,M0.not)(fQ(Z,Q,W))):J}NK.noPropertyInData=hQ;function IK(Z){return Z?Object.keys(Z).filter((Q)=>Q!=="__proto__"):[]}NK.allSchemaProperties=IK;function Fj(Z,Q){return IK(Q).filter((W)=>!(0,gQ.alwaysValidSchema)(Z,Q[W]))}NK.schemaProperties=Fj;function Lj({schemaCode:Z,data:Q,it:{gen:W,topSchemaRef:X,schemaPath:J,errorPath:G},it:Y},z,q,K){let V=K?M0._`${Z}, ${Q}, ${X}${J}`:Q,H=[[y6.default.instancePath,(0,M0.strConcat)(y6.default.instancePath,G)],[y6.default.parentData,Y.parentData],[y6.default.parentDataProperty,Y.parentDataProperty],[y6.default.rootData,y6.default.rootData]];if(Y.opts.dynamicRef)H.push([y6.default.dynamicAnchors,y6.default.dynamicAnchors]);let B=M0._`${V}, ${W.object(...H)}`;return q!==M0.nil?M0._`${z}.call(${q}, ${B})`:M0._`${z}(${B})`}NK.callValidateCode=Lj;var Aj=M0._`new RegExp`;function Mj({gen:Z,it:{opts:Q}},W){let X=Q.unicodeRegExp?"u":"",{regExp:J}=Q.code,G=J(W,X);return Z.scopeValue("pattern",{key:G.toString(),ref:G,code:M0._`${J.code==="new RegExp"?Aj:(0,Kj.useFunc)(Z,J)}(${W}, ${X})`})}NK.usePattern=Mj;function Ij(Z){let{gen:Q,data:W,keyword:X,it:J}=Z,G=Q.name("valid");if(J.allErrors){let z=Q.let("valid",!0);return Y(()=>Q.assign(z,!1)),z}return Q.var(G,!0),Y(()=>Q.break()),G;function Y(z){let q=Q.const("len",M0._`${W}.length`);Q.forRange("i",0,q,(K)=>{Z.subschema({keyword:X,dataProp:K,dataPropType:gQ.Type.Num},G),Q.if((0,M0.not)(G),z)})}}NK.validateArray=Ij;function Nj(Z){let{gen:Q,schema:W,keyword:X,it:J}=Z;if(!Array.isArray(W))throw Error("ajv implementation error");if(W.some((q)=>(0,gQ.alwaysValidSchema)(J,q))&&!J.opts.unevaluated)return;let Y=Q.let("valid",!1),z=Q.name("_valid");Q.block(()=>W.forEach((q,K)=>{let V=Z.subschema({keyword:X,schemaProp:K,compositeRule:!0},z);if(Q.assign(Y,M0._`${Y} || ${z}`),!Z.mergeValidEvaluated(V,z))Q.if((0,M0.not)(Y))})),Z.result(Y,()=>Z.reset(),()=>Z.error(!0))}NK.validateUnion=Nj});var OK=j((jK)=>{Object.defineProperty(jK,"__esModule",{value:!0});jK.validateKeywordUsage=jK.validSchemaType=jK.funcKeywordCode=jK.macroKeywordCode=void 0;var o0=Z0(),e6=w4(),bj=T4(),xj=C9();function vj(Z,Q){let{gen:W,keyword:X,schema:J,parentSchema:G,it:Y}=Z,z=Q.macro.call(Y.self,J,G,Y),q=TK(W,X,z);if(Y.opts.validateSchema!==!1)Y.self.validateSchema(z,!0);let K=W.name("valid");Z.subschema({schema:z,schemaPath:o0.nil,errSchemaPath:`${Y.errSchemaPath}/${X}`,topSchemaRef:q,compositeRule:!0},K),Z.pass(K,()=>Z.error(!0))}jK.macroKeywordCode=vj;function yj(Z,Q){var W;let{gen:X,keyword:J,schema:G,parentSchema:Y,$data:z,it:q}=Z;fj(q,Q);let K=!z&&Q.compile?Q.compile.call(q.self,G,Y,q):Q.validate,V=TK(X,J,K),H=X.let("valid");Z.block$data(H,B),Z.ok((W=Q.valid)!==null&&W!==void 0?W:H);function B(){if(Q.errors===!1){if(M(),Q.modifying)wK(Z);I(()=>Z.error())}else{let N=Q.async?F():A();if(Q.modifying)wK(Z);I(()=>gj(Z,N))}}function F(){let N=X.let("ruleErrs",null);return X.try(()=>M(o0._`await `),(D)=>X.assign(H,!1).if(o0._`${D} instanceof ${q.ValidationError}`,()=>X.assign(N,o0._`${D}.errors`),()=>X.throw(D))),N}function A(){let N=o0._`${V}.errors`;return X.assign(N,null),M(o0.nil),N}function M(N=Q.async?o0._`await `:o0.nil){let D=q.opts.passContext?e6.default.this:e6.default.self,P=!(("compile"in Q)&&!z||Q.schema===!1);X.assign(H,o0._`${N}${(0,bj.callValidateCode)(Z,V,D,P)}`,Q.modifying)}function I(N){var D;X.if((0,o0.not)((D=Q.valid)!==null&&D!==void 0?D:H),N)}}jK.funcKeywordCode=yj;function wK(Z){let{gen:Q,data:W,it:X}=Z;Q.if(X.parentData,()=>Q.assign(W,o0._`${X.parentData}[${X.parentDataProperty}]`))}function gj(Z,Q){let{gen:W}=Z;W.if(o0._`Array.isArray(${Q})`,()=>{W.assign(e6.default.vErrors,o0._`${e6.default.vErrors} === null ? ${Q} : ${e6.default.vErrors}.concat(${Q})`).assign(e6.default.errors,o0._`${e6.default.vErrors}.length`),(0,xj.extendErrors)(Z)},()=>Z.error())}function fj({schemaEnv:Z},Q){if(Q.async&&!Z.$async)throw Error("async keyword in sync schema")}function TK(Z,Q,W){if(W===void 0)throw Error(`keyword "${Q}" failed to compile`);return Z.scopeValue("keyword",typeof W=="function"?{ref:W}:{ref:W,code:(0,o0.stringify)(W)})}function hj(Z,Q,W=!1){return!Q.length||Q.some((X)=>X==="array"?Array.isArray(Z):X==="object"?Z&&typeof Z=="object"&&!Array.isArray(Z):typeof Z==X||W&&typeof Z>"u")}jK.validSchemaType=hj;function uj({schema:Z,opts:Q,self:W,errSchemaPath:X},J,G){if(Array.isArray(J.keyword)?!J.keyword.includes(G):J.keyword!==G)throw Error("ajv implementation error");let Y=J.dependencies;if(Y===null||Y===void 0?void 0:Y.some((z)=>!Object.prototype.hasOwnProperty.call(Z,z)))throw Error(`parent schema must have dependencies of ${G}: ${Y.join(",")}`);if(J.validateSchema){if(!J.validateSchema(Z[G])){let q=`keyword "${G}" value is invalid at path "${X}": `+W.errorsText(J.validateSchema.errors);if(Q.validateSchema==="log")W.logger.error(q);else throw Error(q)}}}jK.validateKeywordUsage=uj});var SK=j((PK)=>{Object.defineProperty(PK,"__esModule",{value:!0});PK.extendSubschemaMode=PK.extendSubschemaData=PK.getSubschema=void 0;var n4=Z0(),RK=X0();function cj(Z,{keyword:Q,schemaProp:W,schema:X,schemaPath:J,errSchemaPath:G,topSchemaRef:Y}){if(Q!==void 0&&X!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(Q!==void 0){let z=Z.schema[Q];return W===void 0?{schema:z,schemaPath:n4._`${Z.schemaPath}${(0,n4.getProperty)(Q)}`,errSchemaPath:`${Z.errSchemaPath}/${Q}`}:{schema:z[W],schemaPath:n4._`${Z.schemaPath}${(0,n4.getProperty)(Q)}${(0,n4.getProperty)(W)}`,errSchemaPath:`${Z.errSchemaPath}/${Q}/${(0,RK.escapeFragment)(W)}`}}if(X!==void 0){if(J===void 0||G===void 0||Y===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:X,schemaPath:J,topSchemaRef:Y,errSchemaPath:G}}throw Error('either "keyword" or "schema" must be passed')}PK.getSubschema=cj;function pj(Z,Q,{dataProp:W,dataPropType:X,data:J,dataTypes:G,propertyName:Y}){if(J!==void 0&&W!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:z}=Q;if(W!==void 0){let{errorPath:K,dataPathArr:V,opts:H}=Q,B=z.let("data",n4._`${Q.data}${(0,n4.getProperty)(W)}`,!0);q(B),Z.errorPath=n4.str`${K}${(0,RK.getErrorPath)(W,X,H.jsPropertySyntax)}`,Z.parentDataProperty=n4._`${W}`,Z.dataPathArr=[...V,Z.parentDataProperty]}if(J!==void 0){let K=J instanceof n4.Name?J:z.let("data",J,!0);if(q(K),Y!==void 0)Z.propertyName=Y}if(G)Z.dataTypes=G;function q(K){Z.data=K,Z.dataLevel=Q.dataLevel+1,Z.dataTypes=[],Q.definedProperties=new Set,Z.parentData=Q.data,Z.dataNames=[...Q.dataNames,K]}}PK.extendSubschemaData=pj;function ij(Z,{jtdDiscriminator:Q,jtdMetadata:W,compositeRule:X,createErrors:J,allErrors:G}){if(X!==void 0)Z.compositeRule=X;if(J!==void 0)Z.createErrors=J;if(G!==void 0)Z.allErrors=G;Z.jtdDiscriminator=Q,Z.jtdMetadata=W}PK.extendSubschemaMode=ij});var uQ=j((Bf,kK)=>{kK.exports=function Z(Q,W){if(Q===W)return!0;if(Q&&W&&typeof Q=="object"&&typeof W=="object"){if(Q.constructor!==W.constructor)return!1;var X,J,G;if(Array.isArray(Q)){if(X=Q.length,X!=W.length)return!1;for(J=X;J--!==0;)if(!Z(Q[J],W[J]))return!1;return!0}if(Q.constructor===RegExp)return Q.source===W.source&&Q.flags===W.flags;if(Q.valueOf!==Object.prototype.valueOf)return Q.valueOf()===W.valueOf();if(Q.toString!==Object.prototype.toString)return Q.toString()===W.toString();if(G=Object.keys(Q),X=G.length,X!==Object.keys(W).length)return!1;for(J=X;J--!==0;)if(!Object.prototype.hasOwnProperty.call(W,G[J]))return!1;for(J=X;J--!==0;){var Y=G[J];if(!Z(Q[Y],W[Y]))return!1}return!0}return Q!==Q&&W!==W}});var bK=j((Ff,_K)=>{var g6=_K.exports=function(Z,Q,W){if(typeof Q=="function")W=Q,Q={};W=Q.cb||W;var X=typeof W=="function"?W:W.pre||function(){},J=W.post||function(){};T5(Q,X,J,Z,"",Z)};g6.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};g6.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};g6.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};g6.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function T5(Z,Q,W,X,J,G,Y,z,q,K){if(X&&typeof X=="object"&&!Array.isArray(X)){Q(X,J,G,Y,z,q,K);for(var V in X){var H=X[V];if(Array.isArray(H)){if(V in g6.arrayKeywords)for(var B=0;B<H.length;B++)T5(Z,Q,W,H[B],J+"/"+V+"/"+B,G,J,V,X,B)}else if(V in g6.propsKeywords){if(H&&typeof H=="object")for(var F in H)T5(Z,Q,W,H[F],J+"/"+V+"/"+aj(F),G,J,V,X,F)}else if(V in g6.keywords||Z.allKeys&&!(V in g6.skipKeywords))T5(Z,Q,W,H,J+"/"+V,G,J,V,X)}W(X,J,G,Y,z,q,K)}}function aj(Z){return Z.replace(/~/g,"~0").replace(/\//g,"~1")}});var k9=j((gK)=>{Object.defineProperty(gK,"__esModule",{value:!0});gK.getSchemaRefs=gK.resolveUrl=gK.normalizeId=gK._getFullPath=gK.getFullPath=gK.inlineRef=void 0;var sj=X0(),oj=uQ(),tj=bK(),ej=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function ZE(Z,Q=!0){if(typeof Z=="boolean")return!0;if(Q===!0)return!mQ(Z);if(!Q)return!1;return xK(Z)<=Q}gK.inlineRef=ZE;var QE=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function mQ(Z){for(let Q in Z){if(QE.has(Q))return!0;let W=Z[Q];if(Array.isArray(W)&&W.some(mQ))return!0;if(typeof W=="object"&&mQ(W))return!0}return!1}function xK(Z){let Q=0;for(let W in Z){if(W==="$ref")return 1/0;if(Q++,ej.has(W))continue;if(typeof Z[W]=="object")(0,sj.eachItem)(Z[W],(X)=>Q+=xK(X));if(Q===1/0)return 1/0}return Q}function vK(Z,Q="",W){if(W!==!1)Q=l1(Q);let X=Z.parse(Q);return yK(Z,X)}gK.getFullPath=vK;function yK(Z,Q){return Z.serialize(Q).split("#")[0]+"#"}gK._getFullPath=yK;var WE=/#\/?$/;function l1(Z){return Z?Z.replace(WE,""):""}gK.normalizeId=l1;function XE(Z,Q,W){return W=l1(W),Z.resolve(Q,W)}gK.resolveUrl=XE;var JE=/^[a-z_][-a-z0-9._]*$/i;function GE(Z,Q){if(typeof Z=="boolean")return{};let{schemaId:W,uriResolver:X}=this.opts,J=l1(Z[W]||Q),G={"":J},Y=vK(X,J,!1),z={},q=new Set;return tj(Z,{allKeys:!0},(H,B,F,A)=>{if(A===void 0)return;let M=Y+B,I=G[A];if(typeof H[W]=="string")I=N.call(this,H[W]);D.call(this,H.$anchor),D.call(this,H.$dynamicAnchor),G[B]=I;function N(P){let v=this.opts.uriResolver.resolve;if(P=l1(I?v(I,P):P),q.has(P))throw V(P);q.add(P);let x=this.refs[P];if(typeof x=="string")x=this.refs[x];if(typeof x=="object")K(H,x.schema,P);else if(P!==l1(M))if(P[0]==="#")K(H,z[P],P),z[P]=H;else this.refs[P]=M;return P}function D(P){if(typeof P=="string"){if(!JE.test(P))throw Error(`invalid anchor "${P}"`);N.call(this,`#${P}`)}}}),z;function K(H,B,F){if(B!==void 0&&!oj(H,B))throw V(F)}function V(H){return Error(`reference "${H}" resolves to more than one schema`)}}gK.getSchemaRefs=GE});var x9=j((eK)=>{Object.defineProperty(eK,"__esModule",{value:!0});eK.getData=eK.KeywordCxt=eK.validateFunctionCode=void 0;var dK=WK(),hK=S9(),dQ=bQ(),j5=S9(),UE=AK(),b9=OK(),lQ=SK(),i=Z0(),o=w4(),VE=k9(),U6=X0(),_9=C9();function HE(Z){if(iK(Z)){if(nK(Z),pK(Z)){LE(Z);return}}cK(Z,()=>(0,dK.topBoolOrEmptySchema)(Z))}eK.validateFunctionCode=HE;function cK({gen:Z,validateName:Q,schema:W,schemaEnv:X,opts:J},G){if(J.code.es5)Z.func(Q,i._`${o.default.data}, ${o.default.valCxt}`,X.$async,()=>{Z.code(i._`"use strict"; ${uK(W,J)}`),FE(Z,J),Z.code(G)});else Z.func(Q,i._`${o.default.data}, ${BE(J)}`,X.$async,()=>Z.code(uK(W,J)).code(G))}function BE(Z){return i._`{${o.default.instancePath}="", ${o.default.parentData}, ${o.default.parentDataProperty}, ${o.default.rootData}=${o.default.data}${Z.dynamicRef?i._`, ${o.default.dynamicAnchors}={}`:i.nil}}={}`}function FE(Z,Q){Z.if(o.default.valCxt,()=>{if(Z.var(o.default.instancePath,i._`${o.default.valCxt}.${o.default.instancePath}`),Z.var(o.default.parentData,i._`${o.default.valCxt}.${o.default.parentData}`),Z.var(o.default.parentDataProperty,i._`${o.default.valCxt}.${o.default.parentDataProperty}`),Z.var(o.default.rootData,i._`${o.default.valCxt}.${o.default.rootData}`),Q.dynamicRef)Z.var(o.default.dynamicAnchors,i._`${o.default.valCxt}.${o.default.dynamicAnchors}`)},()=>{if(Z.var(o.default.instancePath,i._`""`),Z.var(o.default.parentData,i._`undefined`),Z.var(o.default.parentDataProperty,i._`undefined`),Z.var(o.default.rootData,o.default.data),Q.dynamicRef)Z.var(o.default.dynamicAnchors,i._`{}`)})}function LE(Z){let{schema:Q,opts:W,gen:X}=Z;cK(Z,()=>{if(W.$comment&&Q.$comment)aK(Z);if(DE(Z),X.let(o.default.vErrors,null),X.let(o.default.errors,0),W.unevaluated)AE(Z);rK(Z),jE(Z)});return}function AE(Z){let{gen:Q,validateName:W}=Z;Z.evaluated=Q.const("evaluated",i._`${W}.evaluated`),Q.if(i._`${Z.evaluated}.dynamicProps`,()=>Q.assign(i._`${Z.evaluated}.props`,i._`undefined`)),Q.if(i._`${Z.evaluated}.dynamicItems`,()=>Q.assign(i._`${Z.evaluated}.items`,i._`undefined`))}function uK(Z,Q){let W=typeof Z=="object"&&Z[Q.schemaId];return W&&(Q.code.source||Q.code.process)?i._`/*# sourceURL=${W} */`:i.nil}function ME(Z,Q){if(iK(Z)){if(nK(Z),pK(Z)){IE(Z,Q);return}}(0,dK.boolOrEmptySchema)(Z,Q)}function pK({schema:Z,self:Q}){if(typeof Z=="boolean")return!Z;for(let W in Z)if(Q.RULES.all[W])return!0;return!1}function iK(Z){return typeof Z.schema!="boolean"}function IE(Z,Q){let{schema:W,gen:X,opts:J}=Z;if(J.$comment&&W.$comment)aK(Z);wE(Z),TE(Z);let G=X.const("_errs",o.default.errors);rK(Z,G),X.var(Q,i._`${G} === ${o.default.errors}`)}function nK(Z){(0,U6.checkUnknownRules)(Z),NE(Z)}function rK(Z,Q){if(Z.opts.jtd)return mK(Z,[],!1,Q);let W=(0,hK.getSchemaTypes)(Z.schema),X=(0,hK.coerceAndCheckDataType)(Z,W);mK(Z,W,!X,Q)}function NE(Z){let{schema:Q,errSchemaPath:W,opts:X,self:J}=Z;if(Q.$ref&&X.ignoreKeywordsWithRef&&(0,U6.schemaHasRulesButRef)(Q,J.RULES))J.logger.warn(`$ref: keywords ignored in schema at path "${W}"`)}function DE(Z){let{schema:Q,opts:W}=Z;if(Q.default!==void 0&&W.useDefaults&&W.strictSchema)(0,U6.checkStrictMode)(Z,"default is ignored in the schema root")}function wE(Z){let Q=Z.schema[Z.opts.schemaId];if(Q)Z.baseId=(0,VE.resolveUrl)(Z.opts.uriResolver,Z.baseId,Q)}function TE(Z){if(Z.schema.$async&&!Z.schemaEnv.$async)throw Error("async schema in sync schema")}function aK({gen:Z,schemaEnv:Q,schema:W,errSchemaPath:X,opts:J}){let G=W.$comment;if(J.$comment===!0)Z.code(i._`${o.default.self}.logger.log(${G})`);else if(typeof J.$comment=="function"){let Y=i.str`${X}/$comment`,z=Z.scopeValue("root",{ref:Q.root});Z.code(i._`${o.default.self}.opts.$comment(${G}, ${Y}, ${z}.schema)`)}}function jE(Z){let{gen:Q,schemaEnv:W,validateName:X,ValidationError:J,opts:G}=Z;if(W.$async)Q.if(i._`${o.default.errors} === 0`,()=>Q.return(o.default.data),()=>Q.throw(i._`new ${J}(${o.default.vErrors})`));else{if(Q.assign(i._`${X}.errors`,o.default.vErrors),G.unevaluated)EE(Z);Q.return(i._`${o.default.errors} === 0`)}}function EE({gen:Z,evaluated:Q,props:W,items:X}){if(W instanceof i.Name)Z.assign(i._`${Q}.props`,W);if(X instanceof i.Name)Z.assign(i._`${Q}.items`,X)}function mK(Z,Q,W,X){let{gen:J,schema:G,data:Y,allErrors:z,opts:q,self:K}=Z,{RULES:V}=K;if(G.$ref&&(q.ignoreKeywordsWithRef||!(0,U6.schemaHasRulesButRef)(G,V))){J.block(()=>oK(Z,"$ref",V.all.$ref.definition));return}if(!q.jtd)OE(Z,Q);J.block(()=>{for(let B of V.rules)H(B);H(V.post)});function H(B){if(!(0,dQ.shouldUseGroup)(G,B))return;if(B.type){if(J.if((0,j5.checkDataType)(B.type,Y,q.strictNumbers)),lK(Z,B),Q.length===1&&Q[0]===B.type&&W)J.else(),(0,j5.reportTypeError)(Z);J.endIf()}else lK(Z,B);if(!z)J.if(i._`${o.default.errors} === ${X||0}`)}}function lK(Z,Q){let{gen:W,schema:X,opts:{useDefaults:J}}=Z;if(J)(0,UE.assignDefaults)(Z,Q.type);W.block(()=>{for(let G of Q.rules)if((0,dQ.shouldUseRule)(X,G))oK(Z,G.keyword,G.definition,Q.type)})}function OE(Z,Q){if(Z.schemaEnv.meta||!Z.opts.strictTypes)return;if(RE(Z,Q),!Z.opts.allowUnionTypes)PE(Z,Q);CE(Z,Z.dataTypes)}function RE(Z,Q){if(!Q.length)return;if(!Z.dataTypes.length){Z.dataTypes=Q;return}Q.forEach((W)=>{if(!sK(Z.dataTypes,W))cQ(Z,`type "${W}" not allowed by context "${Z.dataTypes.join(",")}"`)}),kE(Z,Q)}function PE(Z,Q){if(Q.length>1&&!(Q.length===2&&Q.includes("null")))cQ(Z,"use allowUnionTypes to allow union type keyword")}function CE(Z,Q){let W=Z.self.RULES.all;for(let X in W){let J=W[X];if(typeof J=="object"&&(0,dQ.shouldUseRule)(Z.schema,J)){let{type:G}=J.definition;if(G.length&&!G.some((Y)=>SE(Q,Y)))cQ(Z,`missing type "${G.join(",")}" for keyword "${X}"`)}}}function SE(Z,Q){return Z.includes(Q)||Q==="number"&&Z.includes("integer")}function sK(Z,Q){return Z.includes(Q)||Q==="integer"&&Z.includes("number")}function kE(Z,Q){let W=[];for(let X of Z.dataTypes)if(sK(Q,X))W.push(X);else if(Q.includes("integer")&&X==="number")W.push("integer");Z.dataTypes=W}function cQ(Z,Q){let W=Z.schemaEnv.baseId+Z.errSchemaPath;Q+=` at "${W}" (strictTypes)`,(0,U6.checkStrictMode)(Z,Q,Z.opts.strictTypes)}class pQ{constructor(Z,Q,W){if((0,b9.validateKeywordUsage)(Z,Q,W),this.gen=Z.gen,this.allErrors=Z.allErrors,this.keyword=W,this.data=Z.data,this.schema=Z.schema[W],this.$data=Q.$data&&Z.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,U6.schemaRefOrVal)(Z,this.schema,W,this.$data),this.schemaType=Q.schemaType,this.parentSchema=Z.schema,this.params={},this.it=Z,this.def=Q,this.$data)this.schemaCode=Z.gen.const("vSchema",tK(this.$data,Z));else if(this.schemaCode=this.schemaValue,!(0,b9.validSchemaType)(this.schema,Q.schemaType,Q.allowUndefined))throw Error(`${W} value must be ${JSON.stringify(Q.schemaType)}`);if("code"in Q?Q.trackErrors:Q.errors!==!1)this.errsCount=Z.gen.const("_errs",o.default.errors)}result(Z,Q,W){this.failResult((0,i.not)(Z),Q,W)}failResult(Z,Q,W){if(this.gen.if(Z),W)W();else this.error();if(Q){if(this.gen.else(),Q(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(Z,Q){this.failResult((0,i.not)(Z),void 0,Q)}fail(Z){if(Z===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(Z),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(Z){if(!this.$data)return this.fail(Z);let{schemaCode:Q}=this;this.fail(i._`${Q} !== undefined && (${(0,i.or)(this.invalid$data(),Z)})`)}error(Z,Q,W){if(Q){this.setParams(Q),this._error(Z,W),this.setParams({});return}this._error(Z,W)}_error(Z,Q){(Z?_9.reportExtraError:_9.reportError)(this,this.def.error,Q)}$dataError(){(0,_9.reportError)(this,this.def.$dataError||_9.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,_9.resetErrorsCount)(this.gen,this.errsCount)}ok(Z){if(!this.allErrors)this.gen.if(Z)}setParams(Z,Q){if(Q)Object.assign(this.params,Z);else this.params=Z}block$data(Z,Q,W=i.nil){this.gen.block(()=>{this.check$data(Z,W),Q()})}check$data(Z=i.nil,Q=i.nil){if(!this.$data)return;let{gen:W,schemaCode:X,schemaType:J,def:G}=this;if(W.if((0,i.or)(i._`${X} === undefined`,Q)),Z!==i.nil)W.assign(Z,!0);if(J.length||G.validateSchema){if(W.elseIf(this.invalid$data()),this.$dataError(),Z!==i.nil)W.assign(Z,!1)}W.else()}invalid$data(){let{gen:Z,schemaCode:Q,schemaType:W,def:X,it:J}=this;return(0,i.or)(G(),Y());function G(){if(W.length){if(!(Q instanceof i.Name))throw Error("ajv implementation error");let z=Array.isArray(W)?W:[W];return i._`${(0,j5.checkDataTypes)(z,Q,J.opts.strictNumbers,j5.DataType.Wrong)}`}return i.nil}function Y(){if(X.validateSchema){let z=Z.scopeValue("validate$data",{ref:X.validateSchema});return i._`!${z}(${Q})`}return i.nil}}subschema(Z,Q){let W=(0,lQ.getSubschema)(this.it,Z);(0,lQ.extendSubschemaData)(W,this.it,Z),(0,lQ.extendSubschemaMode)(W,Z);let X={...this.it,...W,items:void 0,props:void 0};return ME(X,Q),X}mergeEvaluated(Z,Q){let{it:W,gen:X}=this;if(!W.opts.unevaluated)return;if(W.props!==!0&&Z.props!==void 0)W.props=U6.mergeEvaluated.props(X,Z.props,W.props,Q);if(W.items!==!0&&Z.items!==void 0)W.items=U6.mergeEvaluated.items(X,Z.items,W.items,Q)}mergeValidEvaluated(Z,Q){let{it:W,gen:X}=this;if(W.opts.unevaluated&&(W.props!==!0||W.items!==!0))return X.if(Q,()=>this.mergeEvaluated(Z,i.Name)),!0}}eK.KeywordCxt=pQ;function oK(Z,Q,W,X){let J=new pQ(Z,W,Q);if("code"in W)W.code(J,X);else if(J.$data&&W.validate)(0,b9.funcKeywordCode)(J,W);else if("macro"in W)(0,b9.macroKeywordCode)(J,W);else if(W.compile||W.validate)(0,b9.funcKeywordCode)(J,W)}var _E=/^\/(?:[^~]|~0|~1)*$/,bE=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function tK(Z,{dataLevel:Q,dataNames:W,dataPathArr:X}){let J,G;if(Z==="")return o.default.rootData;if(Z[0]==="/"){if(!_E.test(Z))throw Error(`Invalid JSON-pointer: ${Z}`);J=Z,G=o.default.rootData}else{let K=bE.exec(Z);if(!K)throw Error(`Invalid JSON-pointer: ${Z}`);let V=+K[1];if(J=K[2],J==="#"){if(V>=Q)throw Error(q("property/index",V));return X[Q-V]}if(V>Q)throw Error(q("data",V));if(G=W[Q-V],!J)return G}let Y=G,z=J.split("/");for(let K of z)if(K)G=i._`${G}${(0,i.getProperty)((0,U6.unescapeJsonPointer)(K))}`,Y=i._`${Y} && ${G}`;return Y;function q(K,V){return`Cannot access ${K} ${V} levels up, current level is ${Q}`}}eK.getData=tK});var E5=j((W3)=>{Object.defineProperty(W3,"__esModule",{value:!0});class Q3 extends Error{constructor(Z){super("validation failed");this.errors=Z,this.ajv=this.validation=!0}}W3.default=Q3});var v9=j((J3)=>{Object.defineProperty(J3,"__esModule",{value:!0});var iQ=k9();class X3 extends Error{constructor(Z,Q,W,X){super(X||`can't resolve reference ${W} from id ${Q}`);this.missingRef=(0,iQ.resolveUrl)(Z,Q,W),this.missingSchema=(0,iQ.normalizeId)((0,iQ.getFullPath)(Z,this.missingRef))}}J3.default=X3});var g9=j((z3)=>{Object.defineProperty(z3,"__esModule",{value:!0});z3.resolveSchema=z3.getCompilingSchema=z3.resolveRef=z3.compileSchema=z3.SchemaEnv=void 0;var k4=Z0(),fE=E5(),Z1=w4(),_4=k9(),G3=X0(),hE=x9();class y9{constructor(Z){var Q;this.refs={},this.dynamicAnchors={};let W;if(typeof Z.schema=="object")W=Z.schema;this.schema=Z.schema,this.schemaId=Z.schemaId,this.root=Z.root||this,this.baseId=(Q=Z.baseId)!==null&&Q!==void 0?Q:(0,_4.normalizeId)(W===null||W===void 0?void 0:W[Z.schemaId||"$id"]),this.schemaPath=Z.schemaPath,this.localRefs=Z.localRefs,this.meta=Z.meta,this.$async=W===null||W===void 0?void 0:W.$async,this.refs={}}}z3.SchemaEnv=y9;function rQ(Z){let Q=Y3.call(this,Z);if(Q)return Q;let W=(0,_4.getFullPath)(this.opts.uriResolver,Z.root.baseId),{es5:X,lines:J}=this.opts.code,{ownProperties:G}=this.opts,Y=new k4.CodeGen(this.scope,{es5:X,lines:J,ownProperties:G}),z;if(Z.$async)z=Y.scopeValue("Error",{ref:fE.default,code:k4._`require("ajv/dist/runtime/validation_error").default`});let q=Y.scopeName("validate");Z.validateName=q;let K={gen:Y,allErrors:this.opts.allErrors,data:Z1.default.data,parentData:Z1.default.parentData,parentDataProperty:Z1.default.parentDataProperty,dataNames:[Z1.default.data],dataPathArr:[k4.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:Y.scopeValue("schema",this.opts.code.source===!0?{ref:Z.schema,code:(0,k4.stringify)(Z.schema)}:{ref:Z.schema}),validateName:q,ValidationError:z,schema:Z.schema,schemaEnv:Z,rootId:W,baseId:Z.baseId||W,schemaPath:k4.nil,errSchemaPath:Z.schemaPath||(this.opts.jtd?"":"#"),errorPath:k4._`""`,opts:this.opts,self:this},V;try{this._compilations.add(Z),(0,hE.validateFunctionCode)(K),Y.optimize(this.opts.code.optimize);let H=Y.toString();if(V=`${Y.scopeRefs(Z1.default.scope)}return ${H}`,this.opts.code.process)V=this.opts.code.process(V,Z);let F=Function(`${Z1.default.self}`,`${Z1.default.scope}`,V)(this,this.scope.get());if(this.scope.value(q,{ref:F}),F.errors=null,F.schema=Z.schema,F.schemaEnv=Z,Z.$async)F.$async=!0;if(this.opts.code.source===!0)F.source={validateName:q,validateCode:H,scopeValues:Y._values};if(this.opts.unevaluated){let{props:A,items:M}=K;if(F.evaluated={props:A instanceof k4.Name?void 0:A,items:M instanceof k4.Name?void 0:M,dynamicProps:A instanceof k4.Name,dynamicItems:M instanceof k4.Name},F.source)F.source.evaluated=(0,k4.stringify)(F.evaluated)}return Z.validate=F,Z}catch(H){if(delete Z.validate,delete Z.validateName,V)this.logger.error("Error compiling schema, function code:",V);throw H}finally{this._compilations.delete(Z)}}z3.compileSchema=rQ;function uE(Z,Q,W){var X;W=(0,_4.resolveUrl)(this.opts.uriResolver,Q,W);let J=Z.refs[W];if(J)return J;let G=dE.call(this,Z,W);if(G===void 0){let Y=(X=Z.localRefs)===null||X===void 0?void 0:X[W],{schemaId:z}=this.opts;if(Y)G=new y9({schema:Y,schemaId:z,root:Z,baseId:Q})}if(G===void 0)return;return Z.refs[W]=mE.call(this,G)}z3.resolveRef=uE;function mE(Z){if((0,_4.inlineRef)(Z.schema,this.opts.inlineRefs))return Z.schema;return Z.validate?Z:rQ.call(this,Z)}function Y3(Z){for(let Q of this._compilations)if(lE(Q,Z))return Q}z3.getCompilingSchema=Y3;function lE(Z,Q){return Z.schema===Q.schema&&Z.root===Q.root&&Z.baseId===Q.baseId}function dE(Z,Q){let W;while(typeof(W=this.refs[Q])=="string")Q=W;return W||this.schemas[Q]||O5.call(this,Z,Q)}function O5(Z,Q){let W=this.opts.uriResolver.parse(Q),X=(0,_4._getFullPath)(this.opts.uriResolver,W),J=(0,_4.getFullPath)(this.opts.uriResolver,Z.baseId,void 0);if(Object.keys(Z.schema).length>0&&X===J)return nQ.call(this,W,Z);let G=(0,_4.normalizeId)(X),Y=this.refs[G]||this.schemas[G];if(typeof Y=="string"){let z=O5.call(this,Z,Y);if(typeof(z===null||z===void 0?void 0:z.schema)!=="object")return;return nQ.call(this,W,z)}if(typeof(Y===null||Y===void 0?void 0:Y.schema)!=="object")return;if(!Y.validate)rQ.call(this,Y);if(G===(0,_4.normalizeId)(Q)){let{schema:z}=Y,{schemaId:q}=this.opts,K=z[q];if(K)J=(0,_4.resolveUrl)(this.opts.uriResolver,J,K);return new y9({schema:z,schemaId:q,root:Z,baseId:J})}return nQ.call(this,W,Y)}z3.resolveSchema=O5;var cE=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function nQ(Z,{baseId:Q,schema:W,root:X}){var J;if(((J=Z.fragment)===null||J===void 0?void 0:J[0])!=="/")return;for(let z of Z.fragment.slice(1).split("/")){if(typeof W==="boolean")return;let q=W[(0,G3.unescapeFragment)(z)];if(q===void 0)return;W=q;let K=typeof W==="object"&&W[this.opts.schemaId];if(!cE.has(z)&&K)Q=(0,_4.resolveUrl)(this.opts.uriResolver,Q,K)}let G;if(typeof W!="boolean"&&W.$ref&&!(0,G3.schemaHasRulesButRef)(W,this.RULES)){let z=(0,_4.resolveUrl)(this.opts.uriResolver,Q,W.$ref);G=O5.call(this,X,z)}let{schemaId:Y}=this.opts;if(G=G||new y9({schema:W,schemaId:Y,root:X,baseId:Q}),G.schema!==G.root.schema)return G;return}});var q3=j((Df,aE)=>{aE.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var oQ=j((wf,F3)=>{var sE=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),U3=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),aQ=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),V3=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),oE=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function sQ(Z){let Q="",W=0,X=0;for(X=0;X<Z.length;X++){if(W=Z[X].charCodeAt(0),W===48)continue;if(!(W>=48&&W<=57||W>=65&&W<=70||W>=97&&W<=102))return"";Q+=Z[X];break}for(X+=1;X<Z.length;X++){if(W=Z[X].charCodeAt(0),!(W>=48&&W<=57||W>=65&&W<=70||W>=97&&W<=102))return"";Q+=Z[X]}return Q}var tE=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function K3(Z){return Z.length=0,!0}function eE(Z,Q,W){if(Z.length){let X=sQ(Z);if(X!=="")Q.push(X);else return W.error=!0,!1;Z.length=0}return!0}function ZO(Z){let Q=0,W={error:!1,address:"",zone:""},X=[],J=[],G=!1,Y=!1,z=eE;for(let q=0;q<Z.length;q++){let K=Z[q];if(K==="["||K==="]")continue;if(K===":"){if(G===!0)Y=!0;if(!z(J,X,W))break;if(++Q>7){W.error=!0;break}if(q>0&&Z[q-1]===":")G=!0;X.push(":");continue}else if(K==="%"){if(!z(J,X,W))break;z=K3}else{J.push(K);continue}}if(J.length)if(z===K3)W.zone=J.join("");else if(Y)X.push(J.join(""));else X.push(sQ(J));return W.address=X.join(""),W}function H3(Z){if(QO(Z,":")<2)return{host:Z,isIPV6:!1};let Q=ZO(Z);if(!Q.error){let{address:W,address:X}=Q;if(Q.zone)W+="%"+Q.zone,X+="%25"+Q.zone;return{host:W,isIPV6:!0,escapedHost:X}}else return{host:Z,isIPV6:!1}}function QO(Z,Q){let W=0;for(let X=0;X<Z.length;X++)if(Z[X]===Q)W++;return W}function WO(Z){let Q=Z,W=[],X=-1,J=0;while(J=Q.length){if(J===1)if(Q===".")break;else if(Q==="/"){W.push("/");break}else{W.push(Q);break}else if(J===2){if(Q[0]==="."){if(Q[1]===".")break;else if(Q[1]==="/"){Q=Q.slice(2);continue}}else if(Q[0]==="/"){if(Q[1]==="."||Q[1]==="/"){W.push("/");break}}}else if(J===3){if(Q==="/.."){if(W.length!==0)W.pop();W.push("/");break}}if(Q[0]==="."){if(Q[1]==="."){if(Q[2]==="/"){Q=Q.slice(3);continue}}else if(Q[1]==="/"){Q=Q.slice(2);continue}}else if(Q[0]==="/"){if(Q[1]==="."){if(Q[2]==="/"){Q=Q.slice(2);continue}else if(Q[2]==="."){if(Q[3]==="/"){if(Q=Q.slice(3),W.length!==0)W.pop();continue}}}}if((X=Q.indexOf("/",1))===-1){W.push(Q);break}else W.push(Q.slice(0,X)),Q=Q.slice(X)}return W.join("")}var XO={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},JO=/[@/?#:]/g,GO=/[@/?#]/g;function B3(Z,Q){let W=Q?GO:JO;return W.lastIndex=0,Z.replace(W,(X)=>XO[X])}function YO(Z,Q=!1){if(Z.indexOf("%")===-1)return Z;let W="";for(let X=0;X<Z.length;X++){if(Z[X]==="%"&&X+2<Z.length){let J=Z.slice(X+1,X+3);if(aQ(J)){let G=J.toUpperCase(),Y=String.fromCharCode(parseInt(G,16));if(Q&&V3(Y))W+=Y;else W+="%"+G;X+=2;continue}}W+=Z[X]}return W}function zO(Z){let Q="";for(let W=0;W<Z.length;W++){if(Z[W]==="%"&&W+2<Z.length){let X=Z.slice(W+1,W+3);if(aQ(X)){let J=X.toUpperCase(),G=String.fromCharCode(parseInt(J,16));if(G!=="."&&V3(G))Q+=G;else Q+="%"+J;W+=2;continue}}if(oE(Z[W]))Q+=Z[W];else Q+=escape(Z[W])}return Q}function $O(Z){let Q="";for(let W=0;W<Z.length;W++){if(Z[W]==="%"&&W+2<Z.length){let X=Z.slice(W+1,W+3);if(aQ(X)){Q+="%"+X.toUpperCase(),W+=2;continue}}Q+=escape(Z[W])}return Q}function qO(Z){let Q=[];if(Z.userinfo!==void 0)Q.push(Z.userinfo),Q.push("@");if(Z.host!==void 0){let W=unescape(Z.host);if(!U3(W)){let X=H3(W);if(X.isIPV6===!0)W=`[${X.escapedHost}]`;else W=B3(W,!1)}Q.push(W)}if(typeof Z.port==="number"||typeof Z.port==="string")Q.push(":"),Q.push(String(Z.port));return Q.length?Q.join(""):void 0}F3.exports={nonSimpleDomain:tE,recomposeAuthority:qO,reescapeHostDelimiters:B3,normalizePercentEncoding:YO,normalizePathEncoding:zO,escapePreservingEscapes:$O,removeDotSegments:WO,isIPv4:U3,isUUID:sE,normalizeIPv6:H3,stringArrayToHexStripped:sQ}});var N3=j((Tf,I3)=>{var{isUUID:KO}=oQ(),UO=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,VO=["http","https","ws","wss","urn","urn:uuid"];function HO(Z){return VO.indexOf(Z)!==-1}function tQ(Z){if(Z.secure===!0)return!0;else if(Z.secure===!1)return!1;else if(Z.scheme)return Z.scheme.length===3&&(Z.scheme[0]==="w"||Z.scheme[0]==="W")&&(Z.scheme[1]==="s"||Z.scheme[1]==="S")&&(Z.scheme[2]==="s"||Z.scheme[2]==="S");else return!1}function L3(Z){if(!Z.host)Z.error=Z.error||"HTTP URIs must have a host.";return Z}function A3(Z){let Q=String(Z.scheme).toLowerCase()==="https";if(Z.port===(Q?443:80)||Z.port==="")Z.port=void 0;if(!Z.path)Z.path="/";return Z}function BO(Z){return Z.secure=tQ(Z),Z.resourceName=(Z.path||"/")+(Z.query?"?"+Z.query:""),Z.path=void 0,Z.query=void 0,Z}function FO(Z){if(Z.port===(tQ(Z)?443:80)||Z.port==="")Z.port=void 0;if(typeof Z.secure==="boolean")Z.scheme=Z.secure?"wss":"ws",Z.secure=void 0;if(Z.resourceName){let[Q,W]=Z.resourceName.split("?");Z.path=Q&&Q!=="/"?Q:void 0,Z.query=W,Z.resourceName=void 0}return Z.fragment=void 0,Z}function LO(Z,Q){if(!Z.path)return Z.error="URN can not be parsed",Z;let W=Z.path.match(UO);if(W){let X=Q.scheme||Z.scheme||"urn";Z.nid=W[1].toLowerCase(),Z.nss=W[2];let J=`${X}:${Q.nid||Z.nid}`,G=eQ(J);if(Z.path=void 0,G)Z=G.parse(Z,Q)}else Z.error=Z.error||"URN can not be parsed.";return Z}function AO(Z,Q){if(Z.nid===void 0)throw Error("URN without nid cannot be serialized");let W=Q.scheme||Z.scheme||"urn",X=Z.nid.toLowerCase(),J=`${W}:${Q.nid||X}`,G=eQ(J);if(G)Z=G.serialize(Z,Q);let Y=Z,z=Z.nss;return Y.path=`${X||Q.nid}:${z}`,Q.skipEscape=!0,Y}function MO(Z,Q){let W=Z;if(W.uuid=W.nss,W.nss=void 0,!Q.tolerant&&(!W.uuid||!KO(W.uuid)))W.error=W.error||"UUID is not valid.";return W}function IO(Z){let Q=Z;return Q.nss=(Z.uuid||"").toLowerCase(),Q}var M3={scheme:"http",domainHost:!0,parse:L3,serialize:A3},NO={scheme:"https",domainHost:M3.domainHost,parse:L3,serialize:A3},R5={scheme:"ws",domainHost:!0,parse:BO,serialize:FO},DO={scheme:"wss",domainHost:R5.domainHost,parse:R5.parse,serialize:R5.serialize},wO={scheme:"urn",parse:LO,serialize:AO,skipNormalize:!0},TO={scheme:"urn:uuid",parse:MO,serialize:IO,skipNormalize:!0},P5={http:M3,https:NO,ws:R5,wss:DO,urn:wO,"urn:uuid":TO};Object.setPrototypeOf(P5,null);function eQ(Z){return Z&&(P5[Z]||P5[Z.toLowerCase()])||void 0}I3.exports={wsIsSecure:tQ,SCHEMES:P5,isValidSchemeName:HO,getSchemeHandler:eQ}});var O3=j((jf,C5)=>{var{normalizeIPv6:jO,removeDotSegments:f9,recomposeAuthority:EO,normalizePercentEncoding:OO,normalizePathEncoding:RO,escapePreservingEscapes:PO,reescapeHostDelimiters:CO,isIPv4:SO,nonSimpleDomain:kO}=oQ(),{SCHEMES:_O,getSchemeHandler:w3}=N3();function bO(Z,Q){if(typeof Z==="string")Z=fO(Z,Q);else if(typeof Z==="object")Z=d1(Q1(Z,Q),Q);return Z}function xO(Z,Q,W){let X=W?Object.assign({scheme:"null"},W):{scheme:"null"},J=T3(d1(Z,X),d1(Q,X),X,!0);return X.skipEscape=!0,Q1(J,X)}function T3(Z,Q,W,X){let J={};if(!X)Z=d1(Q1(Z,W),W),Q=d1(Q1(Q,W),W);if(W=W||{},!W.tolerant&&Q.scheme)J.scheme=Q.scheme,J.userinfo=Q.userinfo,J.host=Q.host,J.port=Q.port,J.path=f9(Q.path||""),J.query=Q.query;else{if(Q.userinfo!==void 0||Q.host!==void 0||Q.port!==void 0)J.userinfo=Q.userinfo,J.host=Q.host,J.port=Q.port,J.path=f9(Q.path||""),J.query=Q.query;else{if(!Q.path)if(J.path=Z.path,Q.query!==void 0)J.query=Q.query;else J.query=Z.query;else{if(Q.path[0]==="/")J.path=f9(Q.path);else{if((Z.userinfo!==void 0||Z.host!==void 0||Z.port!==void 0)&&!Z.path)J.path="/"+Q.path;else if(!Z.path)J.path=Q.path;else J.path=Z.path.slice(0,Z.path.lastIndexOf("/")+1)+Q.path;J.path=f9(J.path)}J.query=Q.query}J.userinfo=Z.userinfo,J.host=Z.host,J.port=Z.port}J.scheme=Z.scheme}return J.fragment=Q.fragment,J}function vO(Z,Q,W){let X=D3(Z,W),J=D3(Q,W);return X!==void 0&&J!==void 0&&X.toLowerCase()===J.toLowerCase()}function Q1(Z,Q){let W={host:Z.host,scheme:Z.scheme,userinfo:Z.userinfo,port:Z.port,path:Z.path,query:Z.query,nid:Z.nid,nss:Z.nss,uuid:Z.uuid,fragment:Z.fragment,reference:Z.reference,resourceName:Z.resourceName,secure:Z.secure,error:""},X=Object.assign({},Q),J=[],G=w3(X.scheme||W.scheme);if(G&&G.serialize)G.serialize(W,X);if(W.path!==void 0)if(!X.skipEscape){if(W.path=PO(W.path),W.scheme!==void 0)W.path=W.path.split("%3A").join(":")}else W.path=OO(W.path);if(X.reference!=="suffix"&&W.scheme)J.push(W.scheme,":");let Y=EO(W);if(Y!==void 0){if(X.reference!=="suffix")J.push("//");if(J.push(Y),W.path&&W.path[0]!=="/")J.push("/")}if(W.path!==void 0){let z=W.path;if(!X.absolutePath&&(!G||!G.absolutePath))z=f9(z);if(Y===void 0&&z[0]==="/"&&z[1]==="/")z="/%2F"+z.slice(2);J.push(z)}if(W.query!==void 0)J.push("?",W.query);if(W.fragment!==void 0)J.push("#",W.fragment);return J.join("")}var yO=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function gO(Z,Q){if(Q[2]!==void 0&&Z.path&&Z.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof Z.port==="number"&&(Z.port<0||Z.port>65535))return"URI port is malformed.";return}function j3(Z,Q){let W=Object.assign({},Q),X={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},J=!1,G=!1;if(W.reference==="suffix")if(W.scheme)Z=W.scheme+":"+Z;else Z="//"+Z;let Y=Z.match(yO);if(Y){if(X.scheme=Y[1],X.userinfo=Y[3],X.host=Y[4],X.port=parseInt(Y[5],10),X.path=Y[6]||"",X.query=Y[7],X.fragment=Y[8],isNaN(X.port))X.port=Y[5];let z=gO(X,Y);if(z!==void 0)X.error=X.error||z,J=!0;if(X.host)if(SO(X.host)===!1){let V=jO(X.host);X.host=V.host.toLowerCase(),G=V.isIPV6}else G=!0;if(X.scheme===void 0&&X.userinfo===void 0&&X.host===void 0&&X.port===void 0&&X.query===void 0&&!X.path)X.reference="same-document";else if(X.scheme===void 0)X.reference="relative";else if(X.fragment===void 0)X.reference="absolute";else X.reference="uri";if(W.reference&&W.reference!=="suffix"&&W.reference!==X.reference)X.error=X.error||"URI is not a "+W.reference+" reference.";let q=w3(W.scheme||X.scheme);if(!W.unicodeSupport&&(!q||!q.unicodeSupport)){if(X.host&&(W.domainHost||q&&q.domainHost)&&G===!1&&kO(X.host))try{X.host=URL.domainToASCII(X.host.toLowerCase())}catch(K){X.error=X.error||"Host's domain name can not be converted to ASCII: "+K}}if(!q||q&&!q.skipNormalize){if(Z.indexOf("%")!==-1){if(X.scheme!==void 0)X.scheme=unescape(X.scheme);if(X.host!==void 0)X.host=CO(unescape(X.host),G)}if(X.path)X.path=RO(X.path);if(X.fragment)try{X.fragment=encodeURI(decodeURIComponent(X.fragment))}catch{X.error=X.error||"URI malformed"}}if(q&&q.parse)q.parse(X,W)}else X.error=X.error||"URI can not be parsed.";return{parsed:X,malformedAuthorityOrPort:J}}function d1(Z,Q){return j3(Z,Q).parsed}function fO(Z,Q){return E3(Z,Q).normalized}function E3(Z,Q){let{parsed:W,malformedAuthorityOrPort:X}=j3(Z,Q);return{normalized:X?Z:Q1(W,Q),malformedAuthorityOrPort:X}}function D3(Z,Q){if(typeof Z==="string"){let{normalized:W,malformedAuthorityOrPort:X}=E3(Z,Q);return X?void 0:W}if(typeof Z==="object")return Q1(Z,Q)}var ZW={SCHEMES:_O,normalize:bO,resolve:xO,resolveComponent:T3,equal:vO,serialize:Q1,parse:d1};C5.exports=ZW;C5.exports.default=ZW;C5.exports.fastUri=ZW});var C3=j((P3)=>{Object.defineProperty(P3,"__esModule",{value:!0});var R3=O3();R3.code='require("ajv/dist/runtime/uri").default';P3.default=R3});var g3=j((V6)=>{Object.defineProperty(V6,"__esModule",{value:!0});V6.CodeGen=V6.Name=V6.nil=V6.stringify=V6.str=V6._=V6.KeywordCxt=void 0;var uO=x9();Object.defineProperty(V6,"KeywordCxt",{enumerable:!0,get:function(){return uO.KeywordCxt}});var c1=Z0();Object.defineProperty(V6,"_",{enumerable:!0,get:function(){return c1._}});Object.defineProperty(V6,"str",{enumerable:!0,get:function(){return c1.str}});Object.defineProperty(V6,"stringify",{enumerable:!0,get:function(){return c1.stringify}});Object.defineProperty(V6,"nil",{enumerable:!0,get:function(){return c1.nil}});Object.defineProperty(V6,"Name",{enumerable:!0,get:function(){return c1.Name}});Object.defineProperty(V6,"CodeGen",{enumerable:!0,get:function(){return c1.CodeGen}});var mO=E5(),x3=v9(),lO=_Q(),h9=g9(),dO=Z0(),u9=k9(),S5=S9(),WW=X0(),S3=q3(),cO=C3(),v3=(Z,Q)=>new RegExp(Z,Q);v3.code="new RegExp";var pO=["removeAdditional","useDefaults","coerceTypes"],iO=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),nO={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},rO={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},k3=200;function aO(Z){var Q,W,X,J,G,Y,z,q,K,V,H,B,F,A,M,I,N,D,P,v,x,p,f,s,J0;let C0=Z.strict,m0=(Q=Z.code)===null||Q===void 0?void 0:Q.optimize,E4=m0===!0||m0===void 0?1:m0||0,H4=(X=(W=Z.code)===null||W===void 0?void 0:W.regExp)!==null&&X!==void 0?X:v3,r=(J=Z.uriResolver)!==null&&J!==void 0?J:cO.default;return{strictSchema:(Y=(G=Z.strictSchema)!==null&&G!==void 0?G:C0)!==null&&Y!==void 0?Y:!0,strictNumbers:(q=(z=Z.strictNumbers)!==null&&z!==void 0?z:C0)!==null&&q!==void 0?q:!0,strictTypes:(V=(K=Z.strictTypes)!==null&&K!==void 0?K:C0)!==null&&V!==void 0?V:"log",strictTuples:(B=(H=Z.strictTuples)!==null&&H!==void 0?H:C0)!==null&&B!==void 0?B:"log",strictRequired:(A=(F=Z.strictRequired)!==null&&F!==void 0?F:C0)!==null&&A!==void 0?A:!1,code:Z.code?{...Z.code,optimize:E4,regExp:H4}:{optimize:E4,regExp:H4},loopRequired:(M=Z.loopRequired)!==null&&M!==void 0?M:k3,loopEnum:(I=Z.loopEnum)!==null&&I!==void 0?I:k3,meta:(N=Z.meta)!==null&&N!==void 0?N:!0,messages:(D=Z.messages)!==null&&D!==void 0?D:!0,inlineRefs:(P=Z.inlineRefs)!==null&&P!==void 0?P:!0,schemaId:(v=Z.schemaId)!==null&&v!==void 0?v:"$id",addUsedSchema:(x=Z.addUsedSchema)!==null&&x!==void 0?x:!0,validateSchema:(p=Z.validateSchema)!==null&&p!==void 0?p:!0,validateFormats:(f=Z.validateFormats)!==null&&f!==void 0?f:!0,unicodeRegExp:(s=Z.unicodeRegExp)!==null&&s!==void 0?s:!0,int32range:(J0=Z.int32range)!==null&&J0!==void 0?J0:!0,uriResolver:r}}class k5{constructor(Z={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,Z=this.opts={...Z,...aO(Z)};let{es5:Q,lines:W}=this.opts.code;this.scope=new dO.ValueScope({scope:{},prefixes:iO,es5:Q,lines:W}),this.logger=QR(Z.logger);let X=Z.validateFormats;if(Z.validateFormats=!1,this.RULES=(0,lO.getRules)(),_3.call(this,nO,Z,"NOT SUPPORTED"),_3.call(this,rO,Z,"DEPRECATED","warn"),this._metaOpts=eO.call(this),Z.formats)oO.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),Z.keywords)tO.call(this,Z.keywords);if(typeof Z.meta=="object")this.addMetaSchema(Z.meta);sO.call(this),Z.validateFormats=X}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:Z,meta:Q,schemaId:W}=this.opts,X=S3;if(W==="id")X={...S3},X.id=X.$id,delete X.$id;if(Q&&Z)this.addMetaSchema(X,X[W],!1)}defaultMeta(){let{meta:Z,schemaId:Q}=this.opts;return this.opts.defaultMeta=typeof Z=="object"?Z[Q]||Z:void 0}validate(Z,Q){let W;if(typeof Z=="string"){if(W=this.getSchema(Z),!W)throw Error(`no schema with key or ref "${Z}"`)}else W=this.compile(Z);let X=W(Q);if(!("$async"in W))this.errors=W.errors;return X}compile(Z,Q){let W=this._addSchema(Z,Q);return W.validate||this._compileSchemaEnv(W)}compileAsync(Z,Q){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:W}=this.opts;return X.call(this,Z,Q);async function X(K,V){await J.call(this,K.$schema);let H=this._addSchema(K,V);return H.validate||G.call(this,H)}async function J(K){if(K&&!this.getSchema(K))await X.call(this,{$ref:K},!0)}async function G(K){try{return this._compileSchemaEnv(K)}catch(V){if(!(V instanceof x3.default))throw V;return Y.call(this,V),await z.call(this,V.missingSchema),G.call(this,K)}}function Y({missingSchema:K,missingRef:V}){if(this.refs[K])throw Error(`AnySchema ${K} is loaded but ${V} cannot be resolved`)}async function z(K){let V=await q.call(this,K);if(!this.refs[K])await J.call(this,V.$schema);if(!this.refs[K])this.addSchema(V,K,Q)}async function q(K){let V=this._loading[K];if(V)return V;try{return await(this._loading[K]=W(K))}finally{delete this._loading[K]}}}addSchema(Z,Q,W,X=this.opts.validateSchema){if(Array.isArray(Z)){for(let G of Z)this.addSchema(G,void 0,W,X);return this}let J;if(typeof Z==="object"){let{schemaId:G}=this.opts;if(J=Z[G],J!==void 0&&typeof J!="string")throw Error(`schema ${G} must be string`)}return Q=(0,u9.normalizeId)(Q||J),this._checkUnique(Q),this.schemas[Q]=this._addSchema(Z,W,Q,X,!0),this}addMetaSchema(Z,Q,W=this.opts.validateSchema){return this.addSchema(Z,Q,!0,W),this}validateSchema(Z,Q){if(typeof Z=="boolean")return!0;let W;if(W=Z.$schema,W!==void 0&&typeof W!="string")throw Error("$schema must be a string");if(W=W||this.opts.defaultMeta||this.defaultMeta(),!W)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let X=this.validate(W,Z);if(!X&&Q){let J="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(J);else throw Error(J)}return X}getSchema(Z){let Q;while(typeof(Q=b3.call(this,Z))=="string")Z=Q;if(Q===void 0){let{schemaId:W}=this.opts,X=new h9.SchemaEnv({schema:{},schemaId:W});if(Q=h9.resolveSchema.call(this,X,Z),!Q)return;this.refs[Z]=Q}return Q.validate||this._compileSchemaEnv(Q)}removeSchema(Z){if(Z instanceof RegExp)return this._removeAllSchemas(this.schemas,Z),this._removeAllSchemas(this.refs,Z),this;switch(typeof Z){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let Q=b3.call(this,Z);if(typeof Q=="object")this._cache.delete(Q.schema);return delete this.schemas[Z],delete this.refs[Z],this}case"object":{let Q=Z;this._cache.delete(Q);let W=Z[this.opts.schemaId];if(W)W=(0,u9.normalizeId)(W),delete this.schemas[W],delete this.refs[W];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(Z){for(let Q of Z)this.addKeyword(Q);return this}addKeyword(Z,Q){let W;if(typeof Z=="string"){if(W=Z,typeof Q=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),Q.keyword=W}else if(typeof Z=="object"&&Q===void 0){if(Q=Z,W=Q.keyword,Array.isArray(W)&&!W.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(XR.call(this,W,Q),!Q)return(0,WW.eachItem)(W,(J)=>QW.call(this,J)),this;GR.call(this,Q);let X={...Q,type:(0,S5.getJSONTypes)(Q.type),schemaType:(0,S5.getJSONTypes)(Q.schemaType)};return(0,WW.eachItem)(W,X.type.length===0?(J)=>QW.call(this,J,X):(J)=>X.type.forEach((G)=>QW.call(this,J,X,G))),this}getKeyword(Z){let Q=this.RULES.all[Z];return typeof Q=="object"?Q.definition:!!Q}removeKeyword(Z){let{RULES:Q}=this;delete Q.keywords[Z],delete Q.all[Z];for(let W of Q.rules){let X=W.rules.findIndex((J)=>J.keyword===Z);if(X>=0)W.rules.splice(X,1)}return this}addFormat(Z,Q){if(typeof Q=="string")Q=new RegExp(Q);return this.formats[Z]=Q,this}errorsText(Z=this.errors,{separator:Q=", ",dataVar:W="data"}={}){if(!Z||Z.length===0)return"No errors";return Z.map((X)=>`${W}${X.instancePath} ${X.message}`).reduce((X,J)=>X+Q+J)}$dataMetaSchema(Z,Q){let W=this.RULES.all;Z=JSON.parse(JSON.stringify(Z));for(let X of Q){let J=X.split("/").slice(1),G=Z;for(let Y of J)G=G[Y];for(let Y in W){let z=W[Y];if(typeof z!="object")continue;let{$data:q}=z.definition,K=G[Y];if(q&&K)G[Y]=y3(K)}}return Z}_removeAllSchemas(Z,Q){for(let W in Z){let X=Z[W];if(!Q||Q.test(W)){if(typeof X=="string")delete Z[W];else if(X&&!X.meta)this._cache.delete(X.schema),delete Z[W]}}}_addSchema(Z,Q,W,X=this.opts.validateSchema,J=this.opts.addUsedSchema){let G,{schemaId:Y}=this.opts;if(typeof Z=="object")G=Z[Y];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof Z!="boolean")throw Error("schema must be object or boolean");let z=this._cache.get(Z);if(z!==void 0)return z;W=(0,u9.normalizeId)(G||W);let q=u9.getSchemaRefs.call(this,Z,W);if(z=new h9.SchemaEnv({schema:Z,schemaId:Y,meta:Q,baseId:W,localRefs:q}),this._cache.set(z.schema,z),J&&!W.startsWith("#")){if(W)this._checkUnique(W);this.refs[W]=z}if(X)this.validateSchema(Z,!0);return z}_checkUnique(Z){if(this.schemas[Z]||this.refs[Z])throw Error(`schema with key or id "${Z}" already exists`)}_compileSchemaEnv(Z){if(Z.meta)this._compileMetaSchema(Z);else h9.compileSchema.call(this,Z);if(!Z.validate)throw Error("ajv implementation error");return Z.validate}_compileMetaSchema(Z){let Q=this.opts;this.opts=this._metaOpts;try{h9.compileSchema.call(this,Z)}finally{this.opts=Q}}}k5.ValidationError=mO.default;k5.MissingRefError=x3.default;V6.default=k5;function _3(Z,Q,W,X="error"){for(let J in Z){let G=J;if(G in Q)this.logger[X](`${W}: option ${J}. ${Z[G]}`)}}function b3(Z){return Z=(0,u9.normalizeId)(Z),this.schemas[Z]||this.refs[Z]}function sO(){let Z=this.opts.schemas;if(!Z)return;if(Array.isArray(Z))this.addSchema(Z);else for(let Q in Z)this.addSchema(Z[Q],Q)}function oO(){for(let Z in this.opts.formats){let Q=this.opts.formats[Z];if(Q)this.addFormat(Z,Q)}}function tO(Z){if(Array.isArray(Z)){this.addVocabulary(Z);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let Q in Z){let W=Z[Q];if(!W.keyword)W.keyword=Q;this.addKeyword(W)}}function eO(){let Z={...this.opts};for(let Q of pO)delete Z[Q];return Z}var ZR={log(){},warn(){},error(){}};function QR(Z){if(Z===!1)return ZR;if(Z===void 0)return console;if(Z.log&&Z.warn&&Z.error)return Z;throw Error("logger must implement log, warn and error methods")}var WR=/^[a-z_$][a-z0-9_$:-]*$/i;function XR(Z,Q){let{RULES:W}=this;if((0,WW.eachItem)(Z,(X)=>{if(W.keywords[X])throw Error(`Keyword ${X} is already defined`);if(!WR.test(X))throw Error(`Keyword ${X} has invalid name`)}),!Q)return;if(Q.$data&&!(("code"in Q)||("validate"in Q)))throw Error('$data keyword must have "code" or "validate" function')}function QW(Z,Q,W){var X;let J=Q===null||Q===void 0?void 0:Q.post;if(W&&J)throw Error('keyword with "post" flag cannot have "type"');let{RULES:G}=this,Y=J?G.post:G.rules.find(({type:q})=>q===W);if(!Y)Y={type:W,rules:[]},G.rules.push(Y);if(G.keywords[Z]=!0,!Q)return;let z={keyword:Z,definition:{...Q,type:(0,S5.getJSONTypes)(Q.type),schemaType:(0,S5.getJSONTypes)(Q.schemaType)}};if(Q.before)JR.call(this,Y,z,Q.before);else Y.rules.push(z);G.all[Z]=z,(X=Q.implements)===null||X===void 0||X.forEach((q)=>this.addKeyword(q))}function JR(Z,Q,W){let X=Z.rules.findIndex((J)=>J.keyword===W);if(X>=0)Z.rules.splice(X,0,Q);else Z.rules.push(Q),this.logger.warn(`rule ${W} is not defined`)}function GR(Z){let{metaSchema:Q}=Z;if(Q===void 0)return;if(Z.$data&&this.opts.$data)Q=y3(Q);Z.validateSchema=this.compile(Q,!0)}var YR={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function y3(Z){return{anyOf:[Z,YR]}}});var h3=j((f3)=>{Object.defineProperty(f3,"__esModule",{value:!0});var qR={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};f3.default=qR});var x5=j((d3)=>{Object.defineProperty(d3,"__esModule",{value:!0});d3.callRef=d3.getValidate=void 0;var UR=v9(),u3=T4(),J4=Z0(),p1=w4(),m3=g9(),_5=X0(),VR={keyword:"$ref",schemaType:"string",code(Z){let{gen:Q,schema:W,it:X}=Z,{baseId:J,schemaEnv:G,validateName:Y,opts:z,self:q}=X,{root:K}=G;if((W==="#"||W==="#/")&&J===K.baseId)return H();let V=m3.resolveRef.call(q,K,J,W);if(V===void 0)throw new UR.default(X.opts.uriResolver,J,W);if(V instanceof m3.SchemaEnv)return B(V);return F(V);function H(){if(G===K)return b5(Z,Y,G,G.$async);let A=Q.scopeValue("root",{ref:K});return b5(Z,J4._`${A}.validate`,K,K.$async)}function B(A){let M=l3(Z,A);b5(Z,M,A,A.$async)}function F(A){let M=Q.scopeValue("schema",z.code.source===!0?{ref:A,code:(0,J4.stringify)(A)}:{ref:A}),I=Q.name("valid"),N=Z.subschema({schema:A,dataTypes:[],schemaPath:J4.nil,topSchemaRef:M,errSchemaPath:W},I);Z.mergeEvaluated(N),Z.ok(I)}}};function l3(Z,Q){let{gen:W}=Z;return Q.validate?W.scopeValue("validate",{ref:Q.validate}):J4._`${W.scopeValue("wrapper",{ref:Q})}.validate`}d3.getValidate=l3;function b5(Z,Q,W,X){let{gen:J,it:G}=Z,{allErrors:Y,schemaEnv:z,opts:q}=G,K=q.passContext?p1.default.this:J4.nil;if(X)V();else H();function V(){if(!z.$async)throw Error("async schema referenced by sync schema");let A=J.let("valid");J.try(()=>{if(J.code(J4._`await ${(0,u3.callValidateCode)(Z,Q,K)}`),F(Q),!Y)J.assign(A,!0)},(M)=>{if(J.if(J4._`!(${M} instanceof ${G.ValidationError})`,()=>J.throw(M)),B(M),!Y)J.assign(A,!1)}),Z.ok(A)}function H(){Z.result((0,u3.callValidateCode)(Z,Q,K),()=>F(Q),()=>B(Q))}function B(A){let M=J4._`${A}.errors`;J.assign(p1.default.vErrors,J4._`${p1.default.vErrors} === null ? ${M} : ${p1.default.vErrors}.concat(${M})`),J.assign(p1.default.errors,J4._`${p1.default.vErrors}.length`)}function F(A){var M;if(!G.opts.unevaluated)return;let I=(M=W===null||W===void 0?void 0:W.validate)===null||M===void 0?void 0:M.evaluated;if(G.props!==!0)if(I&&!I.dynamicProps){if(I.props!==void 0)G.props=_5.mergeEvaluated.props(J,I.props,G.props)}else{let N=J.var("props",J4._`${A}.evaluated.props`);G.props=_5.mergeEvaluated.props(J,N,G.props,J4.Name)}if(G.items!==!0)if(I&&!I.dynamicItems){if(I.items!==void 0)G.items=_5.mergeEvaluated.items(J,I.items,G.items)}else{let N=J.var("items",J4._`${A}.evaluated.items`);G.items=_5.mergeEvaluated.items(J,N,G.items,J4.Name)}}}d3.callRef=b5;d3.default=VR});var i3=j((p3)=>{Object.defineProperty(p3,"__esModule",{value:!0});var FR=h3(),LR=x5(),AR=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",FR.default,LR.default];p3.default=AR});var r3=j((n3)=>{Object.defineProperty(n3,"__esModule",{value:!0});var v5=Z0(),f6=v5.operators,y5={maximum:{okStr:"<=",ok:f6.LTE,fail:f6.GT},minimum:{okStr:">=",ok:f6.GTE,fail:f6.LT},exclusiveMaximum:{okStr:"<",ok:f6.LT,fail:f6.GTE},exclusiveMinimum:{okStr:">",ok:f6.GT,fail:f6.LTE}},IR={message:({keyword:Z,schemaCode:Q})=>v5.str`must be ${y5[Z].okStr} ${Q}`,params:({keyword:Z,schemaCode:Q})=>v5._`{comparison: ${y5[Z].okStr}, limit: ${Q}}`},NR={keyword:Object.keys(y5),type:"number",schemaType:"number",$data:!0,error:IR,code(Z){let{keyword:Q,data:W,schemaCode:X}=Z;Z.fail$data(v5._`${W} ${y5[Q].fail} ${X} || isNaN(${W})`)}};n3.default=NR});var s3=j((a3)=>{Object.defineProperty(a3,"__esModule",{value:!0});var m9=Z0(),wR={message:({schemaCode:Z})=>m9.str`must be multiple of ${Z}`,params:({schemaCode:Z})=>m9._`{multipleOf: ${Z}}`},TR={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:wR,code(Z){let{gen:Q,data:W,schemaCode:X,it:J}=Z,G=J.opts.multipleOfPrecision,Y=Q.let("res"),z=G?m9._`Math.abs(Math.round(${Y}) - ${Y}) > 1e-${G}`:m9._`${Y} !== parseInt(${Y})`;Z.fail$data(m9._`(${X} === 0 || (${Y} = ${W}/${X}, ${z}))`)}};a3.default=TR});var e3=j((t3)=>{Object.defineProperty(t3,"__esModule",{value:!0});function o3(Z){let Q=Z.length,W=0,X=0,J;while(X<Q)if(W++,J=Z.charCodeAt(X++),J>=55296&&J<=56319&&X<Q){if(J=Z.charCodeAt(X),(J&64512)===56320)X++}return W}t3.default=o3;o3.code='require("ajv/dist/runtime/ucs2length").default'});var QU=j((ZU)=>{Object.defineProperty(ZU,"__esModule",{value:!0});var W1=Z0(),OR=X0(),RR=e3(),PR={message({keyword:Z,schemaCode:Q}){let W=Z==="maxLength"?"more":"fewer";return W1.str`must NOT have ${W} than ${Q} characters`},params:({schemaCode:Z})=>W1._`{limit: ${Z}}`},CR={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:PR,code(Z){let{keyword:Q,data:W,schemaCode:X,it:J}=Z,G=Q==="maxLength"?W1.operators.GT:W1.operators.LT,Y=J.opts.unicode===!1?W1._`${W}.length`:W1._`${(0,OR.useFunc)(Z.gen,RR.default)}(${W})`;Z.fail$data(W1._`${Y} ${G} ${X}`)}};ZU.default=CR});var XU=j((WU)=>{Object.defineProperty(WU,"__esModule",{value:!0});var kR=T4(),_R=X0(),i1=Z0(),bR={message:({schemaCode:Z})=>i1.str`must match pattern "${Z}"`,params:({schemaCode:Z})=>i1._`{pattern: ${Z}}`},xR={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:bR,code(Z){let{gen:Q,data:W,$data:X,schema:J,schemaCode:G,it:Y}=Z,z=Y.opts.unicodeRegExp?"u":"";if(X){let{regExp:q}=Y.opts.code,K=q.code==="new RegExp"?i1._`new RegExp`:(0,_R.useFunc)(Q,q),V=Q.let("valid");Q.try(()=>Q.assign(V,i1._`${K}(${G}, ${z}).test(${W})`),()=>Q.assign(V,!1)),Z.fail$data(i1._`!${V}`)}else{let q=(0,kR.usePattern)(Z,J);Z.fail$data(i1._`!${q}.test(${W})`)}}};WU.default=xR});var GU=j((JU)=>{Object.defineProperty(JU,"__esModule",{value:!0});var l9=Z0(),yR={message({keyword:Z,schemaCode:Q}){let W=Z==="maxProperties"?"more":"fewer";return l9.str`must NOT have ${W} than ${Q} properties`},params:({schemaCode:Z})=>l9._`{limit: ${Z}}`},gR={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:yR,code(Z){let{keyword:Q,data:W,schemaCode:X}=Z,J=Q==="maxProperties"?l9.operators.GT:l9.operators.LT;Z.fail$data(l9._`Object.keys(${W}).length ${J} ${X}`)}};JU.default=gR});var zU=j((YU)=>{Object.defineProperty(YU,"__esModule",{value:!0});var d9=T4(),c9=Z0(),hR=X0(),uR={message:({params:{missingProperty:Z}})=>c9.str`must have required property '${Z}'`,params:({params:{missingProperty:Z}})=>c9._`{missingProperty: ${Z}}`},mR={keyword:"required",type:"object",schemaType:"array",$data:!0,error:uR,code(Z){let{gen:Q,schema:W,schemaCode:X,data:J,$data:G,it:Y}=Z,{opts:z}=Y;if(!G&&W.length===0)return;let q=W.length>=z.loopRequired;if(Y.allErrors)K();else V();if(z.strictRequired){let F=Z.parentSchema.properties,{definedProperties:A}=Z.it;for(let M of W)if((F===null||F===void 0?void 0:F[M])===void 0&&!A.has(M)){let I=Y.schemaEnv.baseId+Y.errSchemaPath,N=`required property "${M}" is not defined at "${I}" (strictRequired)`;(0,hR.checkStrictMode)(Y,N,Y.opts.strictRequired)}}function K(){if(q||G)Z.block$data(c9.nil,H);else for(let F of W)(0,d9.checkReportMissingProp)(Z,F)}function V(){let F=Q.let("missing");if(q||G){let A=Q.let("valid",!0);Z.block$data(A,()=>B(F,A)),Z.ok(A)}else Q.if((0,d9.checkMissingProp)(Z,W,F)),(0,d9.reportMissingProp)(Z,F),Q.else()}function H(){Q.forOf("prop",X,(F)=>{Z.setParams({missingProperty:F}),Q.if((0,d9.noPropertyInData)(Q,J,F,z.ownProperties),()=>Z.error())})}function B(F,A){Z.setParams({missingProperty:F}),Q.forOf(F,X,()=>{Q.assign(A,(0,d9.propertyInData)(Q,J,F,z.ownProperties)),Q.if((0,c9.not)(A),()=>{Z.error(),Q.break()})},c9.nil)}}};YU.default=mR});var qU=j(($U)=>{Object.defineProperty($U,"__esModule",{value:!0});var p9=Z0(),dR={message({keyword:Z,schemaCode:Q}){let W=Z==="maxItems"?"more":"fewer";return p9.str`must NOT have ${W} than ${Q} items`},params:({schemaCode:Z})=>p9._`{limit: ${Z}}`},cR={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:dR,code(Z){let{keyword:Q,data:W,schemaCode:X}=Z,J=Q==="maxItems"?p9.operators.GT:p9.operators.LT;Z.fail$data(p9._`${W}.length ${J} ${X}`)}};$U.default=cR});var g5=j((UU)=>{Object.defineProperty(UU,"__esModule",{value:!0});var KU=uQ();KU.code='require("ajv/dist/runtime/equal").default';UU.default=KU});var HU=j((VU)=>{Object.defineProperty(VU,"__esModule",{value:!0});var XW=S9(),u0=Z0(),nR=X0(),rR=g5(),aR={message:({params:{i:Z,j:Q}})=>u0.str`must NOT have duplicate items (items ## ${Q} and ${Z} are identical)`,params:({params:{i:Z,j:Q}})=>u0._`{i: ${Z}, j: ${Q}}`},sR={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:aR,code(Z){let{gen:Q,data:W,$data:X,schema:J,parentSchema:G,schemaCode:Y,it:z}=Z;if(!X&&!J)return;let q=Q.let("valid"),K=G.items?(0,XW.getSchemaTypes)(G.items):[];Z.block$data(q,V,u0._`${Y} === false`),Z.ok(q);function V(){let A=Q.let("i",u0._`${W}.length`),M=Q.let("j");Z.setParams({i:A,j:M}),Q.assign(q,!0),Q.if(u0._`${A} > 1`,()=>(H()?B:F)(A,M))}function H(){return K.length>0&&!K.some((A)=>A==="object"||A==="array")}function B(A,M){let I=Q.name("item"),N=(0,XW.checkDataTypes)(K,I,z.opts.strictNumbers,XW.DataType.Wrong),D=Q.const("indices",u0._`{}`);Q.for(u0._`;${A}--;`,()=>{if(Q.let(I,u0._`${W}[${A}]`),Q.if(N,u0._`continue`),K.length>1)Q.if(u0._`typeof ${I} == "string"`,u0._`${I} += "_"`);Q.if(u0._`typeof ${D}[${I}] == "number"`,()=>{Q.assign(M,u0._`${D}[${I}]`),Z.error(),Q.assign(q,!1).break()}).code(u0._`${D}[${I}] = ${A}`)})}function F(A,M){let I=(0,nR.useFunc)(Q,rR.default),N=Q.name("outer");Q.label(N).for(u0._`;${A}--;`,()=>Q.for(u0._`${M} = ${A}; ${M}--;`,()=>Q.if(u0._`${I}(${W}[${A}], ${W}[${M}])`,()=>{Z.error(),Q.assign(q,!1).break(N)})))}}};VU.default=sR});var FU=j((BU)=>{Object.defineProperty(BU,"__esModule",{value:!0});var JW=Z0(),tR=X0(),eR=g5(),ZP={message:"must be equal to constant",params:({schemaCode:Z})=>JW._`{allowedValue: ${Z}}`},QP={keyword:"const",$data:!0,error:ZP,code(Z){let{gen:Q,data:W,$data:X,schemaCode:J,schema:G}=Z;if(X||G&&typeof G=="object")Z.fail$data(JW._`!${(0,tR.useFunc)(Q,eR.default)}(${W}, ${J})`);else Z.fail(JW._`${G} !== ${W}`)}};BU.default=QP});var AU=j((LU)=>{Object.defineProperty(LU,"__esModule",{value:!0});var i9=Z0(),XP=X0(),JP=g5(),GP={message:"must be equal to one of the allowed values",params:({schemaCode:Z})=>i9._`{allowedValues: ${Z}}`},YP={keyword:"enum",schemaType:"array",$data:!0,error:GP,code(Z){let{gen:Q,data:W,$data:X,schema:J,schemaCode:G,it:Y}=Z;if(!X&&J.length===0)throw Error("enum must have non-empty array");let z=J.length>=Y.opts.loopEnum,q,K=()=>q!==null&&q!==void 0?q:q=(0,XP.useFunc)(Q,JP.default),V;if(z||X)V=Q.let("valid"),Z.block$data(V,H);else{if(!Array.isArray(J))throw Error("ajv implementation error");let F=Q.const("vSchema",G);V=(0,i9.or)(...J.map((A,M)=>B(F,M)))}Z.pass(V);function H(){Q.assign(V,!1),Q.forOf("v",G,(F)=>Q.if(i9._`${K()}(${W}, ${F})`,()=>Q.assign(V,!0).break()))}function B(F,A){let M=J[A];return typeof M==="object"&&M!==null?i9._`${K()}(${W}, ${F}[${A}])`:i9._`${W} === ${M}`}}};LU.default=YP});var IU=j((MU)=>{Object.defineProperty(MU,"__esModule",{value:!0});var $P=r3(),qP=s3(),KP=QU(),UP=XU(),VP=GU(),HP=zU(),BP=qU(),FP=HU(),LP=FU(),AP=AU(),MP=[$P.default,qP.default,KP.default,UP.default,VP.default,HP.default,BP.default,FP.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},LP.default,AP.default];MU.default=MP});var YW=j((DU)=>{Object.defineProperty(DU,"__esModule",{value:!0});DU.validateAdditionalItems=void 0;var X1=Z0(),GW=X0(),NP={message:({params:{len:Z}})=>X1.str`must NOT have more than ${Z} items`,params:({params:{len:Z}})=>X1._`{limit: ${Z}}`},DP={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:NP,code(Z){let{parentSchema:Q,it:W}=Z,{items:X}=Q;if(!Array.isArray(X)){(0,GW.checkStrictMode)(W,'"additionalItems" is ignored when "items" is not an array of schemas');return}NU(Z,X)}};function NU(Z,Q){let{gen:W,schema:X,data:J,keyword:G,it:Y}=Z;Y.items=!0;let z=W.const("len",X1._`${J}.length`);if(X===!1)Z.setParams({len:Q.length}),Z.pass(X1._`${z} <= ${Q.length}`);else if(typeof X=="object"&&!(0,GW.alwaysValidSchema)(Y,X)){let K=W.var("valid",X1._`${z} <= ${Q.length}`);W.if((0,X1.not)(K),()=>q(K)),Z.ok(K)}function q(K){W.forRange("i",Q.length,z,(V)=>{if(Z.subschema({keyword:G,dataProp:V,dataPropType:GW.Type.Num},K),!Y.allErrors)W.if((0,X1.not)(K),()=>W.break())})}}DU.validateAdditionalItems=NU;DU.default=DP});var zW=j((EU)=>{Object.defineProperty(EU,"__esModule",{value:!0});EU.validateTuple=void 0;var TU=Z0(),f5=X0(),TP=T4(),jP={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(Z){let{schema:Q,it:W}=Z;if(Array.isArray(Q))return jU(Z,"additionalItems",Q);if(W.items=!0,(0,f5.alwaysValidSchema)(W,Q))return;Z.ok((0,TP.validateArray)(Z))}};function jU(Z,Q,W=Z.schema){let{gen:X,parentSchema:J,data:G,keyword:Y,it:z}=Z;if(V(J),z.opts.unevaluated&&W.length&&z.items!==!0)z.items=f5.mergeEvaluated.items(X,W.length,z.items);let q=X.name("valid"),K=X.const("len",TU._`${G}.length`);W.forEach((H,B)=>{if((0,f5.alwaysValidSchema)(z,H))return;X.if(TU._`${K} > ${B}`,()=>Z.subschema({keyword:Y,schemaProp:B,dataProp:B},q)),Z.ok(q)});function V(H){let{opts:B,errSchemaPath:F}=z,A=W.length,M=A===H.minItems&&(A===H.maxItems||H[Q]===!1);if(B.strictTuples&&!M){let I=`"${Y}" is ${A}-tuple, but minItems or maxItems/${Q} are not specified or different at path "${F}"`;(0,f5.checkStrictMode)(z,I,B.strictTuples)}}}EU.validateTuple=jU;EU.default=jP});var PU=j((RU)=>{Object.defineProperty(RU,"__esModule",{value:!0});var OP=zW(),RP={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(Z)=>(0,OP.validateTuple)(Z,"items")};RU.default=RP});var kU=j((SU)=>{Object.defineProperty(SU,"__esModule",{value:!0});var CU=Z0(),CP=X0(),SP=T4(),kP=YW(),_P={message:({params:{len:Z}})=>CU.str`must NOT have more than ${Z} items`,params:({params:{len:Z}})=>CU._`{limit: ${Z}}`},bP={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:_P,code(Z){let{schema:Q,parentSchema:W,it:X}=Z,{prefixItems:J}=W;if(X.items=!0,(0,CP.alwaysValidSchema)(X,Q))return;if(J)(0,kP.validateAdditionalItems)(Z,J);else Z.ok((0,SP.validateArray)(Z))}};SU.default=bP});var bU=j((_U)=>{Object.defineProperty(_U,"__esModule",{value:!0});var j4=Z0(),h5=X0(),vP={message:({params:{min:Z,max:Q}})=>Q===void 0?j4.str`must contain at least ${Z} valid item(s)`:j4.str`must contain at least ${Z} and no more than ${Q} valid item(s)`,params:({params:{min:Z,max:Q}})=>Q===void 0?j4._`{minContains: ${Z}}`:j4._`{minContains: ${Z}, maxContains: ${Q}}`},yP={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:vP,code(Z){let{gen:Q,schema:W,parentSchema:X,data:J,it:G}=Z,Y,z,{minContains:q,maxContains:K}=X;if(G.opts.next)Y=q===void 0?1:q,z=K;else Y=1;let V=Q.const("len",j4._`${J}.length`);if(Z.setParams({min:Y,max:z}),z===void 0&&Y===0){(0,h5.checkStrictMode)(G,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(z!==void 0&&Y>z){(0,h5.checkStrictMode)(G,'"minContains" > "maxContains" is always invalid'),Z.fail();return}if((0,h5.alwaysValidSchema)(G,W)){let M=j4._`${V} >= ${Y}`;if(z!==void 0)M=j4._`${M} && ${V} <= ${z}`;Z.pass(M);return}G.items=!0;let H=Q.name("valid");if(z===void 0&&Y===1)F(H,()=>Q.if(H,()=>Q.break()));else if(Y===0){if(Q.let(H,!0),z!==void 0)Q.if(j4._`${J}.length > 0`,B)}else Q.let(H,!1),B();Z.result(H,()=>Z.reset());function B(){let M=Q.name("_valid"),I=Q.let("count",0);F(M,()=>Q.if(M,()=>A(I)))}function F(M,I){Q.forRange("i",0,V,(N)=>{Z.subschema({keyword:"contains",dataProp:N,dataPropType:h5.Type.Num,compositeRule:!0},M),I()})}function A(M){if(Q.code(j4._`${M}++`),z===void 0)Q.if(j4._`${M} >= ${Y}`,()=>Q.assign(H,!0).break());else if(Q.if(j4._`${M} > ${z}`,()=>Q.assign(H,!1).break()),Y===1)Q.assign(H,!0);else Q.if(j4._`${M} >= ${Y}`,()=>Q.assign(H,!0))}}};_U.default=yP});var u5=j((yU)=>{Object.defineProperty(yU,"__esModule",{value:!0});yU.validateSchemaDeps=yU.validatePropertyDeps=yU.error=void 0;var $W=Z0(),fP=X0(),n9=T4();yU.error={message:({params:{property:Z,depsCount:Q,deps:W}})=>{let X=Q===1?"property":"properties";return $W.str`must have ${X} ${W} when property ${Z} is present`},params:({params:{property:Z,depsCount:Q,deps:W,missingProperty:X}})=>$W._`{property: ${Z},
316
+ missingProperty: ${X},
317
+ depsCount: ${Q},
318
+ deps: ${W}}`};var hP={keyword:"dependencies",type:"object",schemaType:"object",error:yU.error,code(Z){let[Q,W]=uP(Z);xU(Z,Q),vU(Z,W)}};function uP({schema:Z}){let Q={},W={};for(let X in Z){if(X==="__proto__")continue;let J=Array.isArray(Z[X])?Q:W;J[X]=Z[X]}return[Q,W]}function xU(Z,Q=Z.schema){let{gen:W,data:X,it:J}=Z;if(Object.keys(Q).length===0)return;let G=W.let("missing");for(let Y in Q){let z=Q[Y];if(z.length===0)continue;let q=(0,n9.propertyInData)(W,X,Y,J.opts.ownProperties);if(Z.setParams({property:Y,depsCount:z.length,deps:z.join(", ")}),J.allErrors)W.if(q,()=>{for(let K of z)(0,n9.checkReportMissingProp)(Z,K)});else W.if($W._`${q} && (${(0,n9.checkMissingProp)(Z,z,G)})`),(0,n9.reportMissingProp)(Z,G),W.else()}}yU.validatePropertyDeps=xU;function vU(Z,Q=Z.schema){let{gen:W,data:X,keyword:J,it:G}=Z,Y=W.name("valid");for(let z in Q){if((0,fP.alwaysValidSchema)(G,Q[z]))continue;W.if((0,n9.propertyInData)(W,X,z,G.opts.ownProperties),()=>{let q=Z.subschema({keyword:J,schemaProp:z},Y);Z.mergeValidEvaluated(q,Y)},()=>W.var(Y,!0)),Z.ok(Y)}}yU.validateSchemaDeps=vU;yU.default=hP});var mU=j((uU)=>{Object.defineProperty(uU,"__esModule",{value:!0});var hU=Z0(),dP=X0(),cP={message:"property name must be valid",params:({params:Z})=>hU._`{propertyName: ${Z.propertyName}}`},pP={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:cP,code(Z){let{gen:Q,schema:W,data:X,it:J}=Z;if((0,dP.alwaysValidSchema)(J,W))return;let G=Q.name("valid");Q.forIn("key",X,(Y)=>{Z.setParams({propertyName:Y}),Z.subschema({keyword:"propertyNames",data:Y,dataTypes:["string"],propertyName:Y,compositeRule:!0},G),Q.if((0,hU.not)(G),()=>{if(Z.error(!0),!J.allErrors)Q.break()})}),Z.ok(G)}};uU.default=pP});var qW=j((lU)=>{Object.defineProperty(lU,"__esModule",{value:!0});var m5=T4(),b4=Z0(),nP=w4(),l5=X0(),rP={message:"must NOT have additional properties",params:({params:Z})=>b4._`{additionalProperty: ${Z.additionalProperty}}`},aP={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:rP,code(Z){let{gen:Q,schema:W,parentSchema:X,data:J,errsCount:G,it:Y}=Z;if(!G)throw Error("ajv implementation error");let{allErrors:z,opts:q}=Y;if(Y.props=!0,q.removeAdditional!=="all"&&(0,l5.alwaysValidSchema)(Y,W))return;let K=(0,m5.allSchemaProperties)(X.properties),V=(0,m5.allSchemaProperties)(X.patternProperties);H(),Z.ok(b4._`${G} === ${nP.default.errors}`);function H(){Q.forIn("key",J,(I)=>{if(!K.length&&!V.length)A(I);else Q.if(B(I),()=>A(I))})}function B(I){let N;if(K.length>8){let D=(0,l5.schemaRefOrVal)(Y,X.properties,"properties");N=(0,m5.isOwnProperty)(Q,D,I)}else if(K.length)N=(0,b4.or)(...K.map((D)=>b4._`${I} === ${D}`));else N=b4.nil;if(V.length)N=(0,b4.or)(N,...V.map((D)=>b4._`${(0,m5.usePattern)(Z,D)}.test(${I})`));return(0,b4.not)(N)}function F(I){Q.code(b4._`delete ${J}[${I}]`)}function A(I){if(q.removeAdditional==="all"||q.removeAdditional&&W===!1){F(I);return}if(W===!1){if(Z.setParams({additionalProperty:I}),Z.error(),!z)Q.break();return}if(typeof W=="object"&&!(0,l5.alwaysValidSchema)(Y,W)){let N=Q.name("valid");if(q.removeAdditional==="failing")M(I,N,!1),Q.if((0,b4.not)(N),()=>{Z.reset(),F(I)});else if(M(I,N),!z)Q.if((0,b4.not)(N),()=>Q.break())}}function M(I,N,D){let P={keyword:"additionalProperties",dataProp:I,dataPropType:l5.Type.Str};if(D===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});Z.subschema(P,N)}}};lU.default=aP});var iU=j((pU)=>{Object.defineProperty(pU,"__esModule",{value:!0});var oP=x9(),dU=T4(),KW=X0(),cU=qW(),tP={keyword:"properties",type:"object",schemaType:"object",code(Z){let{gen:Q,schema:W,parentSchema:X,data:J,it:G}=Z;if(G.opts.removeAdditional==="all"&&X.additionalProperties===void 0)cU.default.code(new oP.KeywordCxt(G,cU.default,"additionalProperties"));let Y=(0,dU.allSchemaProperties)(W);for(let H of Y)G.definedProperties.add(H);if(G.opts.unevaluated&&Y.length&&G.props!==!0)G.props=KW.mergeEvaluated.props(Q,(0,KW.toHash)(Y),G.props);let z=Y.filter((H)=>!(0,KW.alwaysValidSchema)(G,W[H]));if(z.length===0)return;let q=Q.name("valid");for(let H of z){if(K(H))V(H);else{if(Q.if((0,dU.propertyInData)(Q,J,H,G.opts.ownProperties)),V(H),!G.allErrors)Q.else().var(q,!0);Q.endIf()}Z.it.definedProperties.add(H),Z.ok(q)}function K(H){return G.opts.useDefaults&&!G.compositeRule&&W[H].default!==void 0}function V(H){Z.subschema({keyword:"properties",schemaProp:H,dataProp:H},q)}}};pU.default=tP});var oU=j((sU)=>{Object.defineProperty(sU,"__esModule",{value:!0});var nU=T4(),d5=Z0(),rU=X0(),aU=X0(),ZC={keyword:"patternProperties",type:"object",schemaType:"object",code(Z){let{gen:Q,schema:W,data:X,parentSchema:J,it:G}=Z,{opts:Y}=G,z=(0,nU.allSchemaProperties)(W),q=z.filter((M)=>(0,rU.alwaysValidSchema)(G,W[M]));if(z.length===0||q.length===z.length&&(!G.opts.unevaluated||G.props===!0))return;let K=Y.strictSchema&&!Y.allowMatchingProperties&&J.properties,V=Q.name("valid");if(G.props!==!0&&!(G.props instanceof d5.Name))G.props=(0,aU.evaluatedPropsToName)(Q,G.props);let{props:H}=G;B();function B(){for(let M of z){if(K)F(M);if(G.allErrors)A(M);else Q.var(V,!0),A(M),Q.if(V)}}function F(M){for(let I in K)if(new RegExp(M).test(I))(0,rU.checkStrictMode)(G,`property ${I} matches pattern ${M} (use allowMatchingProperties)`)}function A(M){Q.forIn("key",X,(I)=>{Q.if(d5._`${(0,nU.usePattern)(Z,M)}.test(${I})`,()=>{let N=q.includes(M);if(!N)Z.subschema({keyword:"patternProperties",schemaProp:M,dataProp:I,dataPropType:aU.Type.Str},V);if(G.opts.unevaluated&&H!==!0)Q.assign(d5._`${H}[${I}]`,!0);else if(!N&&!G.allErrors)Q.if((0,d5.not)(V),()=>Q.break())})})}}};sU.default=ZC});var eU=j((tU)=>{Object.defineProperty(tU,"__esModule",{value:!0});var WC=X0(),XC={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(Z){let{gen:Q,schema:W,it:X}=Z;if((0,WC.alwaysValidSchema)(X,W)){Z.fail();return}let J=Q.name("valid");Z.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},J),Z.failResult(J,()=>Z.reset(),()=>Z.error())},error:{message:"must NOT be valid"}};tU.default=XC});var QV=j((ZV)=>{Object.defineProperty(ZV,"__esModule",{value:!0});var GC=T4(),YC={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:GC.validateUnion,error:{message:"must match a schema in anyOf"}};ZV.default=YC});var XV=j((WV)=>{Object.defineProperty(WV,"__esModule",{value:!0});var c5=Z0(),$C=X0(),qC={message:"must match exactly one schema in oneOf",params:({params:Z})=>c5._`{passingSchemas: ${Z.passing}}`},KC={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:qC,code(Z){let{gen:Q,schema:W,parentSchema:X,it:J}=Z;if(!Array.isArray(W))throw Error("ajv implementation error");if(J.opts.discriminator&&X.discriminator)return;let G=W,Y=Q.let("valid",!1),z=Q.let("passing",null),q=Q.name("_valid");Z.setParams({passing:z}),Q.block(K),Z.result(Y,()=>Z.reset(),()=>Z.error(!0));function K(){G.forEach((V,H)=>{let B;if((0,$C.alwaysValidSchema)(J,V))Q.var(q,!0);else B=Z.subschema({keyword:"oneOf",schemaProp:H,compositeRule:!0},q);if(H>0)Q.if(c5._`${q} && ${Y}`).assign(Y,!1).assign(z,c5._`[${z}, ${H}]`).else();Q.if(q,()=>{if(Q.assign(Y,!0),Q.assign(z,H),B)Z.mergeEvaluated(B,c5.Name)})})}}};WV.default=KC});var GV=j((JV)=>{Object.defineProperty(JV,"__esModule",{value:!0});var VC=X0(),HC={keyword:"allOf",schemaType:"array",code(Z){let{gen:Q,schema:W,it:X}=Z;if(!Array.isArray(W))throw Error("ajv implementation error");let J=Q.name("valid");W.forEach((G,Y)=>{if((0,VC.alwaysValidSchema)(X,G))return;let z=Z.subschema({keyword:"allOf",schemaProp:Y},J);Z.ok(J),Z.mergeEvaluated(z)})}};JV.default=HC});var qV=j(($V)=>{Object.defineProperty($V,"__esModule",{value:!0});var p5=Z0(),zV=X0(),FC={message:({params:Z})=>p5.str`must match "${Z.ifClause}" schema`,params:({params:Z})=>p5._`{failingKeyword: ${Z.ifClause}}`},LC={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:FC,code(Z){let{gen:Q,parentSchema:W,it:X}=Z;if(W.then===void 0&&W.else===void 0)(0,zV.checkStrictMode)(X,'"if" without "then" and "else" is ignored');let J=YV(X,"then"),G=YV(X,"else");if(!J&&!G)return;let Y=Q.let("valid",!0),z=Q.name("_valid");if(q(),Z.reset(),J&&G){let V=Q.let("ifClause");Z.setParams({ifClause:V}),Q.if(z,K("then",V),K("else",V))}else if(J)Q.if(z,K("then"));else Q.if((0,p5.not)(z),K("else"));Z.pass(Y,()=>Z.error(!0));function q(){let V=Z.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},z);Z.mergeEvaluated(V)}function K(V,H){return()=>{let B=Z.subschema({keyword:V},z);if(Q.assign(Y,z),Z.mergeValidEvaluated(B,Y),H)Q.assign(H,p5._`${V}`);else Z.setParams({ifClause:V})}}}};function YV(Z,Q){let W=Z.schema[Q];return W!==void 0&&!(0,zV.alwaysValidSchema)(Z,W)}$V.default=LC});var UV=j((KV)=>{Object.defineProperty(KV,"__esModule",{value:!0});var MC=X0(),IC={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:Z,parentSchema:Q,it:W}){if(Q.if===void 0)(0,MC.checkStrictMode)(W,`"${Z}" without "if" is ignored`)}};KV.default=IC});var HV=j((VV)=>{Object.defineProperty(VV,"__esModule",{value:!0});var DC=YW(),wC=PU(),TC=zW(),jC=kU(),EC=bU(),OC=u5(),RC=mU(),PC=qW(),CC=iU(),SC=oU(),kC=eU(),_C=QV(),bC=XV(),xC=GV(),vC=qV(),yC=UV();function gC(Z=!1){let Q=[kC.default,_C.default,bC.default,xC.default,vC.default,yC.default,RC.default,PC.default,OC.default,CC.default,SC.default];if(Z)Q.push(wC.default,jC.default);else Q.push(DC.default,TC.default);return Q.push(EC.default),Q}VV.default=gC});var VW=j((LV)=>{Object.defineProperty(LV,"__esModule",{value:!0});LV.dynamicAnchor=void 0;var UW=Z0(),hC=w4(),BV=g9(),uC=x5(),mC={keyword:"$dynamicAnchor",schemaType:"string",code:(Z)=>FV(Z,Z.schema)};function FV(Z,Q){let{gen:W,it:X}=Z;X.schemaEnv.root.dynamicAnchors[Q]=!0;let J=UW._`${hC.default.dynamicAnchors}${(0,UW.getProperty)(Q)}`,G=X.errSchemaPath==="#"?X.validateName:lC(Z);W.if(UW._`!${J}`,()=>W.assign(J,G))}LV.dynamicAnchor=FV;function lC(Z){let{schemaEnv:Q,schema:W,self:X}=Z.it,{root:J,baseId:G,localRefs:Y,meta:z}=Q.root,{schemaId:q}=X.opts,K=new BV.SchemaEnv({schema:W,schemaId:q,root:J,baseId:G,localRefs:Y,meta:z});return BV.compileSchema.call(X,K),(0,uC.getValidate)(Z,K)}LV.default=mC});var HW=j((DV)=>{Object.defineProperty(DV,"__esModule",{value:!0});DV.dynamicRef=void 0;var MV=Z0(),cC=w4(),IV=x5(),pC={keyword:"$dynamicRef",schemaType:"string",code:(Z)=>NV(Z,Z.schema)};function NV(Z,Q){let{gen:W,keyword:X,it:J}=Z;if(Q[0]!=="#")throw Error(`"${X}" only supports hash fragment reference`);let G=Q.slice(1);if(J.allErrors)Y();else{let q=W.let("valid",!1);Y(q),Z.ok(q)}function Y(q){if(J.schemaEnv.root.dynamicAnchors[G]){let K=W.let("_v",MV._`${cC.default.dynamicAnchors}${(0,MV.getProperty)(G)}`);W.if(K,z(K,q),z(J.validateName,q))}else z(J.validateName,q)()}function z(q,K){return K?()=>W.block(()=>{(0,IV.callRef)(Z,q),W.let(K,!0)}):()=>(0,IV.callRef)(Z,q)}}DV.dynamicRef=NV;DV.default=pC});var jV=j((TV)=>{Object.defineProperty(TV,"__esModule",{value:!0});var nC=VW(),rC=X0(),aC={keyword:"$recursiveAnchor",schemaType:"boolean",code(Z){if(Z.schema)(0,nC.dynamicAnchor)(Z,"");else(0,rC.checkStrictMode)(Z.it,"$recursiveAnchor: false is ignored")}};TV.default=aC});var OV=j((EV)=>{Object.defineProperty(EV,"__esModule",{value:!0});var oC=HW(),tC={keyword:"$recursiveRef",schemaType:"string",code:(Z)=>(0,oC.dynamicRef)(Z,Z.schema)};EV.default=tC});var PV=j((RV)=>{Object.defineProperty(RV,"__esModule",{value:!0});var ZS=VW(),QS=HW(),WS=jV(),XS=OV(),JS=[ZS.default,QS.default,WS.default,XS.default];RV.default=JS});var kV=j((SV)=>{Object.defineProperty(SV,"__esModule",{value:!0});var CV=u5(),YS={keyword:"dependentRequired",type:"object",schemaType:"object",error:CV.error,code:(Z)=>(0,CV.validatePropertyDeps)(Z)};SV.default=YS});var bV=j((_V)=>{Object.defineProperty(_V,"__esModule",{value:!0});var $S=u5(),qS={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(Z)=>(0,$S.validateSchemaDeps)(Z)};_V.default=qS});var vV=j((xV)=>{Object.defineProperty(xV,"__esModule",{value:!0});var US=X0(),VS={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:Z,parentSchema:Q,it:W}){if(Q.contains===void 0)(0,US.checkStrictMode)(W,`"${Z}" without "contains" is ignored`)}};xV.default=VS});var gV=j((yV)=>{Object.defineProperty(yV,"__esModule",{value:!0});var BS=kV(),FS=bV(),LS=vV(),AS=[BS.default,FS.default,LS.default];yV.default=AS});var uV=j((hV)=>{Object.defineProperty(hV,"__esModule",{value:!0});var h6=Z0(),fV=X0(),IS=w4(),NS={message:"must NOT have unevaluated properties",params:({params:Z})=>h6._`{unevaluatedProperty: ${Z.unevaluatedProperty}}`},DS={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:NS,code(Z){let{gen:Q,schema:W,data:X,errsCount:J,it:G}=Z;if(!J)throw Error("ajv implementation error");let{allErrors:Y,props:z}=G;if(z instanceof h6.Name)Q.if(h6._`${z} !== true`,()=>Q.forIn("key",X,(H)=>Q.if(K(z,H),()=>q(H))));else if(z!==!0)Q.forIn("key",X,(H)=>z===void 0?q(H):Q.if(V(z,H),()=>q(H)));G.props=!0,Z.ok(h6._`${J} === ${IS.default.errors}`);function q(H){if(W===!1){if(Z.setParams({unevaluatedProperty:H}),Z.error(),!Y)Q.break();return}if(!(0,fV.alwaysValidSchema)(G,W)){let B=Q.name("valid");if(Z.subschema({keyword:"unevaluatedProperties",dataProp:H,dataPropType:fV.Type.Str},B),!Y)Q.if((0,h6.not)(B),()=>Q.break())}}function K(H,B){return h6._`!${H} || !${H}[${B}]`}function V(H,B){let F=[];for(let A in H)if(H[A]===!0)F.push(h6._`${B} !== ${A}`);return(0,h6.and)(...F)}}};hV.default=DS});var dV=j((lV)=>{Object.defineProperty(lV,"__esModule",{value:!0});var J1=Z0(),mV=X0(),TS={message:({params:{len:Z}})=>J1.str`must NOT have more than ${Z} items`,params:({params:{len:Z}})=>J1._`{limit: ${Z}}`},jS={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:TS,code(Z){let{gen:Q,schema:W,data:X,it:J}=Z,G=J.items||0;if(G===!0)return;let Y=Q.const("len",J1._`${X}.length`);if(W===!1)Z.setParams({len:G}),Z.fail(J1._`${Y} > ${G}`);else if(typeof W=="object"&&!(0,mV.alwaysValidSchema)(J,W)){let q=Q.var("valid",J1._`${Y} <= ${G}`);Q.if((0,J1.not)(q),()=>z(q,G)),Z.ok(q)}J.items=!0;function z(q,K){Q.forRange("i",K,Y,(V)=>{if(Z.subschema({keyword:"unevaluatedItems",dataProp:V,dataPropType:mV.Type.Num},q),!J.allErrors)Q.if((0,J1.not)(q),()=>Q.break())})}}};lV.default=jS});var pV=j((cV)=>{Object.defineProperty(cV,"__esModule",{value:!0});var OS=uV(),RS=dV(),PS=[OS.default,RS.default];cV.default=PS});var nV=j((iV)=>{Object.defineProperty(iV,"__esModule",{value:!0});var P0=Z0(),SS={message:({schemaCode:Z})=>P0.str`must match format "${Z}"`,params:({schemaCode:Z})=>P0._`{format: ${Z}}`},kS={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:SS,code(Z,Q){let{gen:W,data:X,$data:J,schema:G,schemaCode:Y,it:z}=Z,{opts:q,errSchemaPath:K,schemaEnv:V,self:H}=z;if(!q.validateFormats)return;if(J)B();else F();function B(){let A=W.scopeValue("formats",{ref:H.formats,code:q.code.formats}),M=W.const("fDef",P0._`${A}[${Y}]`),I=W.let("fType"),N=W.let("format");W.if(P0._`typeof ${M} == "object" && !(${M} instanceof RegExp)`,()=>W.assign(I,P0._`${M}.type || "string"`).assign(N,P0._`${M}.validate`),()=>W.assign(I,P0._`"string"`).assign(N,M)),Z.fail$data((0,P0.or)(D(),P()));function D(){if(q.strictSchema===!1)return P0.nil;return P0._`${Y} && !${N}`}function P(){let v=V.$async?P0._`(${M}.async ? await ${N}(${X}) : ${N}(${X}))`:P0._`${N}(${X})`,x=P0._`(typeof ${N} == "function" ? ${v} : ${N}.test(${X}))`;return P0._`${N} && ${N} !== true && ${I} === ${Q} && !${x}`}}function F(){let A=H.formats[G];if(!A){D();return}if(A===!0)return;let[M,I,N]=P(A);if(M===Q)Z.pass(v());function D(){if(q.strictSchema===!1){H.logger.warn(x());return}throw Error(x());function x(){return`unknown format "${G}" ignored in schema at path "${K}"`}}function P(x){let p=x instanceof RegExp?(0,P0.regexpCode)(x):q.code.formats?P0._`${q.code.formats}${(0,P0.getProperty)(G)}`:void 0,f=W.scopeValue("formats",{key:G,ref:x,code:p});if(typeof x=="object"&&!(x instanceof RegExp))return[x.type||"string",x.validate,P0._`${f}.validate`];return["string",x,f]}function v(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!V.$async)throw Error("async format in sync schema");return P0._`await ${N}(${X})`}return typeof I=="function"?P0._`${N}(${X})`:P0._`${N}.test(${X})`}}}};iV.default=kS});var aV=j((rV)=>{Object.defineProperty(rV,"__esModule",{value:!0});var bS=nV(),xS=[bS.default];rV.default=xS});var tV=j((sV)=>{Object.defineProperty(sV,"__esModule",{value:!0});sV.contentVocabulary=sV.metadataVocabulary=void 0;sV.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];sV.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var QH=j((ZH)=>{Object.defineProperty(ZH,"__esModule",{value:!0});var gS=i3(),fS=IU(),hS=HV(),uS=PV(),mS=gV(),lS=pV(),dS=aV(),eV=tV(),cS=[uS.default,gS.default,fS.default,(0,hS.default)(!0),dS.default,eV.metadataVocabulary,eV.contentVocabulary,mS.default,lS.default];ZH.default=cS});var GH=j((XH)=>{Object.defineProperty(XH,"__esModule",{value:!0});XH.DiscrError=void 0;var WH;(function(Z){Z.Tag="tag",Z.Mapping="mapping"})(WH||(XH.DiscrError=WH={}))});var $H=j((zH)=>{Object.defineProperty(zH,"__esModule",{value:!0});var n1=Z0(),BW=GH(),YH=g9(),iS=v9(),nS=X0(),rS={message:({params:{discrError:Z,tagName:Q}})=>Z===BW.DiscrError.Tag?`tag "${Q}" must be string`:`value of tag "${Q}" must be in oneOf`,params:({params:{discrError:Z,tag:Q,tagName:W}})=>n1._`{error: ${Z}, tag: ${W}, tagValue: ${Q}}`},aS={keyword:"discriminator",type:"object",schemaType:"object",error:rS,code(Z){let{gen:Q,data:W,schema:X,parentSchema:J,it:G}=Z,{oneOf:Y}=J;if(!G.opts.discriminator)throw Error("discriminator: requires discriminator option");let z=X.propertyName;if(typeof z!="string")throw Error("discriminator: requires propertyName");if(X.mapping)throw Error("discriminator: mapping is not supported");if(!Y)throw Error("discriminator: requires oneOf keyword");let q=Q.let("valid",!1),K=Q.const("tag",n1._`${W}${(0,n1.getProperty)(z)}`);Q.if(n1._`typeof ${K} == "string"`,()=>V(),()=>Z.error(!1,{discrError:BW.DiscrError.Tag,tag:K,tagName:z})),Z.ok(q);function V(){let F=B();Q.if(!1);for(let A in F)Q.elseIf(n1._`${K} === ${A}`),Q.assign(q,H(F[A]));Q.else(),Z.error(!1,{discrError:BW.DiscrError.Mapping,tag:K,tagName:z}),Q.endIf()}function H(F){let A=Q.name("valid"),M=Z.subschema({keyword:"oneOf",schemaProp:F},A);return Z.mergeEvaluated(M,n1.Name),A}function B(){var F;let A={},M=N(J),I=!0;for(let v=0;v<Y.length;v++){let x=Y[v];if((x===null||x===void 0?void 0:x.$ref)&&!(0,nS.schemaHasRulesButRef)(x,G.self.RULES)){let f=x.$ref;if(x=YH.resolveRef.call(G.self,G.schemaEnv.root,G.baseId,f),x instanceof YH.SchemaEnv)x=x.schema;if(x===void 0)throw new iS.default(G.opts.uriResolver,G.baseId,f)}let p=(F=x===null||x===void 0?void 0:x.properties)===null||F===void 0?void 0:F[z];if(typeof p!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${z}"`);I=I&&(M||N(x)),D(p,v)}if(!I)throw Error(`discriminator: "${z}" must be required`);return A;function N({required:v}){return Array.isArray(v)&&v.includes(z)}function D(v,x){if(v.const)P(v.const,x);else if(v.enum)for(let p of v.enum)P(p,x);else throw Error(`discriminator: "properties/${z}" must have "const" or "enum"`)}function P(v,x){if(typeof v!="string"||v in A)throw Error(`discriminator: "${z}" values must be unique strings`);A[v]=x}}}};zH.default=aS});var qH=j((kh,oS)=>{oS.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var KH=j((_h,tS)=>{tS.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var UH=j((bh,eS)=>{eS.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var VH=j((xh,Zk)=>{Zk.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var HH=j((vh,Qk)=>{Qk.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var BH=j((yh,Wk)=>{Wk.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var FH=j((gh,Xk)=>{Xk.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var LH=j((fh,Jk)=>{Jk.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var MH=j((AH)=>{Object.defineProperty(AH,"__esModule",{value:!0});var Gk=qH(),Yk=KH(),zk=UH(),$k=VH(),qk=HH(),Kk=BH(),Uk=FH(),Vk=LH(),Hk=["/properties"];function Bk(Z){return[Gk,Yk,zk,$k,qk,Q(this,Kk),Uk,Q(this,Vk)].forEach((W)=>this.addMetaSchema(W,void 0,!1)),this;function Q(W,X){return Z?W.$dataMetaSchema(X,Hk):X}}AH.default=Bk});var IH=j((G4,LW)=>{Object.defineProperty(G4,"__esModule",{value:!0});G4.MissingRefError=G4.ValidationError=G4.CodeGen=G4.Name=G4.nil=G4.stringify=G4.str=G4._=G4.KeywordCxt=G4.Ajv2020=void 0;var Lk=g3(),Ak=QH(),Mk=$H(),Ik=MH(),FW="https://json-schema.org/draft/2020-12/schema";class r9 extends Lk.default{constructor(Z={}){super({...Z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),Ak.default.forEach((Z)=>this.addVocabulary(Z)),this.opts.discriminator)this.addKeyword(Mk.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:Z,meta:Q}=this.opts;if(!Q)return;Ik.default.call(this,Z),this.refs["http://json-schema.org/schema"]=FW}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(FW)?FW:void 0)}}G4.Ajv2020=r9;LW.exports=G4=r9;LW.exports.Ajv2020=r9;Object.defineProperty(G4,"__esModule",{value:!0});G4.default=r9;var Nk=x9();Object.defineProperty(G4,"KeywordCxt",{enumerable:!0,get:function(){return Nk.KeywordCxt}});var r1=Z0();Object.defineProperty(G4,"_",{enumerable:!0,get:function(){return r1._}});Object.defineProperty(G4,"str",{enumerable:!0,get:function(){return r1.str}});Object.defineProperty(G4,"stringify",{enumerable:!0,get:function(){return r1.stringify}});Object.defineProperty(G4,"nil",{enumerable:!0,get:function(){return r1.nil}});Object.defineProperty(G4,"Name",{enumerable:!0,get:function(){return r1.Name}});Object.defineProperty(G4,"CodeGen",{enumerable:!0,get:function(){return r1.CodeGen}});var Dk=E5();Object.defineProperty(G4,"ValidationError",{enumerable:!0,get:function(){return Dk.default}});var wk=v9();Object.defineProperty(G4,"MissingRefError",{enumerable:!0,get:function(){return wk.default}})});var DH={};e4(DH,{validateProjectFile:()=>Ck});import{existsSync as AW,readFileSync as n5}from"node:fs";import{createRequire as NH}from"node:module";import{isAbsolute as Ek,relative as Ok,resolve as i5}from"node:path";import{fileURLToPath as Rk,pathToFileURL as Pk}from"node:url";async function Ck(Z){let Q=i5(Z),W=i5(Q,"project.json"),X=i5(Q,"project.schema.json");if(!AW(W))throw Error(`project.json not found in ${Q}`);if(!AW(X))throw Error(`project.schema.json not found in ${Q} — run \`jx schema\` to generate it from `+"project.json#/extensions");let J=JSON.parse(n5(W,"utf8")),G=JSON.parse(n5(X,"utf8"));G.$id=Pk(X).href;let Y;try{({default:Y}=await Promise.resolve().then(() => $1(IH(),1)))}catch(V){throw Error("Project validation requires ajv: bun add ajv",{cause:V})}let q=await new Y({allErrors:!0,loadSchema:(V)=>Sk(V,Q),strict:!1}).compileAsync(G),K=q(J);return{errors:q.errors??null,valid:K}}async function Sk(Z,Q){if(!Z.startsWith("file:"))throw Error(`Cannot resolve schema ref "${Z}": only project-relative file refs are loadable (canonical URIs must resolve from already-loaded fragments)`);let W=Rk(Z),X=Ok(Q,W);if(X.startsWith("..")||Ek(X))throw Error(`Schema ref "${Z}" escapes the project root ${Q}`);if(AW(W))return JSON.parse(n5(W,"utf8"));let J=X.split("\\").join("/"),G="node_modules/",Y=J.lastIndexOf(G);if(Y===-1)throw Error(`Schema ref "${Z}" does not exist`);let z=J.slice(Y+G.length),q;try{q=NH(i5(Q,"package.json")).resolve(z)}catch{try{q=NH(import.meta.url).resolve(z)}catch(K){throw Error(`Schema ref "${Z}" does not exist and "${z}" is not resolvable from the project or the host`,{cause:K})}}return JSON.parse(n5(q,"utf8"))}var wH=()=>{};import{relative as MW,resolve as TH}from"node:path";async function kk(){let Z=process.argv.slice(2),[Q]=Z;if(!Q||Q==="--help"||Q==="-h")console.log(`Usage: jx <command> [options]
316
319
 
317
320
  Commands:
318
321
  build [root] Build a Jx site to dist/
322
+ dev [root] Start the dev server (requires @jxsuite/server and Bun)
323
+ preview [root] Serve an already-built dist/ directory
319
324
  schema [root] Generate project.schema.json + document.schema.json from project.json#/extensions
320
325
  validate [root] Validate project.json against its generated project.schema.json
321
326
  db push [root] Sync the data section's tables to their connections (additive-only)
@@ -323,9 +328,10 @@ Commands:
323
328
  Options:
324
329
  --verbose Print detailed build progress
325
330
  --no-clean Don't clean outDir before building
331
+ --port <n> dev/preview: port to listen on (default 3000 / 4173)
326
332
  --dry-run db push: print the statements without executing them
327
- --connection db push: restrict to one connection name`),process.exit(0);let Q=X==="db",W=Q?Z[1]:null,J=Z.slice(Q?2:1),G=new Set,Y=[],z;for(let V=0;V<J.length;V+=1){let B=J[V];if(B==="--connection")V+=1,z=J[V];else if(B.startsWith("--"))G.add(B);else Y.push(B)}let[q]=Y,K=mS(q??".");if(Q){if(W!=="push")console.error(`Unknown db subcommand: ${W??"(none)"}
328
- Usage: jx db push [root] [--dry-run] [--connection <name>]`),process.exit(1);let V=G.has("--dry-run");try{let{dbPush:B}=await Promise.resolve().then(() => (bJ(),kJ)),{results:H,bindingsPatched:F,wranglerPath:A}=await B(K,{dryRun:V,...z===void 0?{}:{connection:z}});for(let M of H){let I=M.applied?"applied":"dry-run";console.log(`${M.connection} (${M.provider}) — ${M.tables.length} table(s), ${M.statements.length} statement(s) [${I}]`);for(let N of M.statements)console.log(` ${N}`);for(let N of M.warnings)console.warn(` warning: ${N}`)}if(F&&A)console.log(`Updated bindings in ${JQ(K,A)}`)}catch(B){console.error(`db push failed: ${B.message}`),process.exit(1)}return}if(X==="build"){let V=G.has("--verbose"),B=!G.has("--no-clean");console.log(`Building site from ${K}...`);try{let{buildSite:H}=await Promise.resolve().then(() => (P$(),R$)),F=await H(K,{clean:B,verbose:V});if(F.errors.length>0){console.error(`
329
- Build completed with ${F.errors.length} error(s):`);for(let A of F.errors)console.error(` - ${A}`);process.exit(1)}console.log(`
330
- Done: ${F.routes} routes → ${F.files} files`)}catch(H){console.error(`Build failed: ${H.message}`),process.exit(1)}}else if(X==="schema")try{let{writeProjectSchemas:V}=await Promise.resolve().then(() => (c$(),d$)),{projectSchemaPath:B,documentSchemaPath:H}=await V(K);console.log(`Wrote ${JQ(K,B)}`),console.log(`Wrote ${JQ(K,H)}`)}catch(V){console.error(`Schema generation failed: ${V.message}`),process.exit(1)}else if(X==="validate")try{let{validateProjectFile:V}=await Promise.resolve().then(() => (oV(),sV)),{valid:B,errors:H}=await V(K);if(B)console.log(`project.json is valid (${K})`);else{console.error(`project.json is INVALID (${K}):`);for(let F of H??[]){let{instancePath:A,message:M}=F??{};console.error(` - ${A||"/"}: ${M??JSON.stringify(F)}`)}process.exit(1)}}catch(V){console.error(`Validation failed: ${V.message}`),process.exit(1)}else console.error(`Unknown command: ${X}
331
- Run "jx --help" for usage.`),process.exit(1)}var ef=lS();export{ef as ready};
333
+ --connection db push: restrict to one connection name`),process.exit(0);let W=Q==="db",X=W?Z[1]:null,J=Z.slice(W?2:1),G=new Set,Y=[],z,q;for(let H=0;H<J.length;H+=1){let B=J[H];if(B==="--connection")H+=1,z=J[H];else if(B==="--port"){H+=1;let F=Math.trunc(Number(J[H]??""));if(Number.isFinite(F)&&F>=0)q=F}else if(B.startsWith("--"))G.add(B);else Y.push(B)}let[K]=Y,V=TH(K??".");if(W){if(X!=="push")console.error(`Unknown db subcommand: ${X??"(none)"}
334
+ Usage: jx db push [root] [--dry-run] [--connection <name>]`),process.exit(1);let H=G.has("--dry-run");try{let{dbPush:B}=await Promise.resolve().then(() => (aJ(),rJ)),{results:F,bindingsPatched:A,wranglerPath:M}=await B(V,{dryRun:H,...z===void 0?{}:{connection:z}});for(let I of F){let N=I.applied?"applied":"dry-run";console.log(`${I.connection} (${I.provider}) — ${I.tables.length} table(s), ${I.statements.length} statement(s) [${N}]`);for(let D of I.statements)console.log(` ${D}`);for(let D of I.warnings)console.warn(` warning: ${D}`)}if(A&&M)console.log(`Updated bindings in ${MW(V,M)}`)}catch(B){console.error(`db push failed: ${B.message}`),process.exit(1)}return}if(Q==="build"){let H=G.has("--verbose"),B=!G.has("--no-clean");console.log(`Building site from ${V}...`);try{let{buildSite:F}=await Promise.resolve().then(() => (p$(),c$)),A=await F(V,{clean:B,verbose:H});if(A.errors.length>0){console.error(`
335
+ Build completed with ${A.errors.length} error(s):`);for(let M of A.errors)console.error(` - ${M}`);process.exit(1)}console.log(`
336
+ Done: ${A.routes} routes → ${A.files} files`)}catch(F){console.error(`Build failed: ${F.message}`),process.exit(1)}}else if(Q==="dev")try{let{runDev:H}=await Promise.resolve().then(() => (r$(),n$));H(V,q)}catch(H){console.error(H.message),process.exit(1)}else if(Q==="preview"){let{existsSync:H}=await import("node:fs"),B=TH(V,"dist");if(!H(B))console.error(`No build output at ${B} — run \`jx build\` first.`),process.exit(1);let{startPreviewServer:F}=await Promise.resolve().then(() => (e$(),t$)),A=q??4173;F(B,A),console.log(`Previewing ${B} at http://localhost:${A}`)}else if(Q==="schema")try{let{writeProjectSchemas:H}=await Promise.resolve().then(() => (Fq(),Bq)),{projectSchemaPath:B,documentSchemaPath:F}=await H(V);console.log(`Wrote ${MW(V,B)}`),console.log(`Wrote ${MW(V,F)}`)}catch(H){console.error(`Schema generation failed: ${H.message}`),process.exit(1)}else if(Q==="validate")try{let{validateProjectFile:H}=await Promise.resolve().then(() => (wH(),DH)),{valid:B,errors:F}=await H(V);if(B)console.log(`project.json is valid (${V})`);else{console.error(`project.json is INVALID (${V}):`);for(let A of F??[]){let{instancePath:M,message:I}=A??{};console.error(` - ${M||"/"}: ${I??JSON.stringify(A)}`)}process.exit(1)}}catch(H){console.error(`Validation failed: ${H.message}`),process.exit(1)}else console.error(`Unknown command: ${Q}
337
+ Run "jx --help" for usage.`),process.exit(1)}var eh=kk();export{eh as ready};