@jxsuite/compiler 0.29.0 → 0.31.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 +86 -86
- package/dist/compiler.js +56 -56
- package/package.json +7 -7
- package/src/cli.ts +38 -29
- package/src/compile-cli.ts +15 -7
- package/src/shared.ts +1 -1
- package/src/site/image-optimizer.ts +8 -1
- package/src/site/site-build.ts +6 -2
- package/src/targets/compile-static.ts +8 -0
package/dist/cli.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as NX}from"node:module";var BX=Object.create;var{getPrototypeOf:HX,defineProperty:N2,getOwnPropertyNames:$X}=Object;var FX=Object.prototype.hasOwnProperty;function LX(Z){return this[Z]}var AX,MX,v6=(Z,W,X)=>{var Q=Z!=null&&typeof Z==="object";if(Q){var J=W?AX??=new WeakMap:MX??=new WeakMap,G=J.get(Z);if(G)return G}X=Z!=null?BX(HX(Z)):{};let z=W||!Z||!Z.__esModule?N2(X,"default",{value:Z,enumerable:!0}):X;for(let q of $X(Z))if(!FX.call(z,q))N2(z,q,{get:LX.bind(Z,q),enumerable:!0});if(Q)J.set(Z,z);return z};var i=(Z,W)=>()=>(W||Z((W={exports:{}}).exports,W),W.exports);var IX=(Z)=>Z;function wX(Z,W){this[Z]=IX.bind(null,W)}var w4=(Z,W)=>{for(var X in W)N2(Z,X,{get:W[X],enumerable:!0,configurable:!0,set:wX.bind(W,X)})};var d=(Z,W)=>()=>(Z&&(W=Z(Z=0)),W);var T0=NX(import.meta.url);function D2(Z){let W=Z.$map;return W&&typeof W==="object"?W:void 0}function E1(Z){return H8.has(Z)}function r0(Z,W,X,Q){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return L1(Z,W,X,Q);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return TX(Z.$ref,W,X,Q);if(Array.isArray(Z))return Z.map((J)=>r0(J,W,X,Q));return Z}function TX(Z,W,X,Q){if(Z==="$reduce/acc")return Q?.acc;if(Z.startsWith("$reduce/"))return Q?.acc;if(Z.startsWith("event#/")){let J=Z.slice(7);return Q6(X,J)}if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,z,q=D2(W);if(G==="item")z=Q?.item??q?.item??W["$map/item"];else if(G==="index")z=Q?.index??q?.index??W["$map/index"];else z=q?.[G]??W[`$map/${G}`];return J.length>2?Q6(z,J.slice(2).join("/")):z}if(Z.startsWith("#/state/")){let J=Z.slice(8),G=J.indexOf("/");if(G===-1)return W[J];return Q6(W[J.slice(0,G)],J.slice(G+1))}if(Z.startsWith("parent#/"))return W[Z.slice(8)];if(Z.startsWith("window#/"))return Q6(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return Q6(globalThis.document,Z.slice(10));return W[Z]??null}function RX(Z,W,X,Q){if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,z,q=D2(W);if(G==="item")z=Q?.item??q?.item??W["$map/item"];else if(G==="index")z=Q?.index??q?.index??W["$map/index"];else z=q?.[G]??W[`$map/${G}`];if(J.length>2){let K=J.slice(2),V=K.pop(),H=K.length>0?Q6(z,K.join("/")):z;return{key:V,obj:H}}return{key:G==="item"?"$map/item":"$map/index",obj:D2(W)??W}}if(Z.startsWith("#/state/")){let J=Z.slice(8);if(J.indexOf("/")===-1)return{key:J,obj:W};let z=J.split("/"),q=z.pop(),K=W;for(let V of z)K=K[V];return{key:q,obj:K}}return{key:Z,obj:W}}function L1(Z,W,X,Q){let{operator:J,target:G,value:z,initial:q}=Z;if(!DX.has(J))throw Error(`$expression: unknown operator "${J}"`);if(T2.has(J)&&!("value"in Z)){let K=r0(G,W,X,Q);if(J==="!")return!K;if(J==="-")return-K}if(R2.has(J)){let K=r0(G,W,X,Q),V=r0(z,W,X,Q);switch(J){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($8.has(J)){let K=r0(z,W,X,Q),{obj:V,key:H}=RX(G.$ref,W,X,Q);switch(J){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(F8.has(J)){let K=r0(G,W,X,Q);switch(J){case"push":return K.push(r0(z,W,X,Q));case"unshift":return K.unshift(r0(z,W,X,Q));case"pop":return K.pop();case"shift":return K.shift();case"splice":{let V=r0(z,W,X,Q);return K.splice(...V)}default:break}}if(P2.has(J)){let K=r0(G,W,X,Q);if(J==="reduce"){let V=r0(q,W,X,Q);for(let[H,B]of K.entries())V=L1(z,W,X,{acc:V,index:H,item:B});return V}if(J==="map")return K.map((V,H)=>L1(z,W,X,{...Q,index:H,item:V}));if(J==="filter")return K.filter((V,H)=>L1(z,W,X,{...Q,index:H,item:V}))}return}function d0(Z,W){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return c0(Z,W);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return L8(Z.$ref,W);if(Array.isArray(Z))return Z.map((X)=>d0(X,W)).join(", ");return JSON.stringify(Z)}function L8(Z,W){let X=W.statePrefix??"state",Q=W.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("event#/")){let J=Z.slice(7);return`${Q}.${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`${X}.${J.replaceAll("/",".")}`}if(Z.startsWith("parent#/"))return`${X}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replaceAll("/",".")}`;return`${X}.${Z}`}function B8(Z,W){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return L8(Z.$ref,W);return d0(Z,W)}function c0(Z,W={}){let{operator:X,target:Q,value:J,initial:G}=Z;if(T2.has(X)&&!("value"in Z)){let z=d0(Q,W);if(X==="!")return`!(${z})`;if(X==="-")return`-(${z})`}if(R2.has(X)){let z=d0(Q,W),q=d0(J,W);return`(${z} ${X} ${q})`}if($8.has(X)){let z=B8(Q,W),q=d0(J,W);return`${z} ${X} ${q}`}if(F8.has(X)){let z=B8(Q,W);switch(X){case"push":return`${z}.push(${d0(J,W)})`;case"unshift":return`${z}.unshift(${d0(J,W)})`;case"pop":return`${z}.pop()`;case"shift":return`${z}.shift()`;case"splice":{let q=Array.isArray(J)?J.map((K)=>d0(K,W)).join(", "):d0(J,W);return`${z}.splice(${q})`}default:break}}if(P2.has(X)){let z=d0(Q,W),q=c0(J,W);if(X==="reduce"){let K=d0(G,W);return`${z}.reduce((_acc, _item, _index) => ${q}, ${K})`}if(X==="map")return`${z}.map((_item, _index) => ${q})`;if(X==="filter")return`${z}.filter((_item, _index) => ${q})`}return"undefined"}function Q6(Z,W){let X=Z;for(let Q of W.split(/[./]/))X=X?.[Q];return X}var H8,T2,R2,$8,F8,P2,DX;var N4=d(()=>{H8=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),T2=new Set(["!","-"]),R2=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),$8=new Set(["=","+=","-=","*=","/="]),F8=new Set(["push","pop","shift","unshift","splice"]),P2=new Set(["reduce","map","filter"]),DX=new Set([...H8,...T2,...R2,...P2])});function g0(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function h0(Z){return g0(Z)&&typeof Z.$ref==="string"}function A1(Z){return g0(Z)&&Z.$prototype==="Function"}function a0(Z){return g0(Z)&&g0(Z.$expression)}function c1(Z){return g0(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function _2(Z){return g0(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function A8(Z){return g0(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function C1(Z){if(!g0(Z))return!1;for(let W of Object.keys(Z))if(!M8.has(W))return!1;return!0}function R0(Z){return g0(Z)&&Z.$prototype==="Array"}function j2(Z){if(R0(Z))return!0;return Array.isArray(Z)&&Z.some((W)=>R0(W))}function I8(Z){return g0(Z)&&Z.$prototype==="Class"}function s(Z){return typeof Z==="string"&&Z.includes("${")}function O1(Z){if(!Z)return[];return Z.map((W)=>typeof W==="string"?W:W.name)}var M8;var e0=d(()=>{M8=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function PX(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function k0(Z){return Z.replaceAll(/[A-Z]/g,(W)=>`-${W.toLowerCase()}`)}function j0(Z){return Object.entries(Z).filter(([W,X])=>!PX(W)&&(X===null||typeof X!=="object")).map(([W,X])=>`${k0(W)}: ${X}`).join("; ")}var x1;var y6=d(()=>{N4();e0();x1=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 T4(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[W,X]of Object.entries(Z.state)){if(W==="$site"||W==="$page")continue;if(X&&typeof X==="object"&&!Array.isArray(X)&&X.timing==="compiler")continue;if(typeof X!=="object"||X===null||Array.isArray(X))return!0;if(X.$prototype)return!0;if("default"in X)return!0;if(C1(X))continue;return!0}if(Z.$switch)return!0;if(R0(Z)||j2(Z.children))return!0;if(Array.isArray(Z.children)&&Z.children.some((W)=>T4(W)))return!0;for(let[W,X]of Object.entries(Z)){if(x1.has(W))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(s(X))return!0}if(Z.style&&typeof Z.style==="object"){for(let W of Object.values(Z.style))if(s(W))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let W of Object.values(Z.attributes))if(s(W))return!0}return!1}function N8(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(R0(Z)||j2(Z.children))return!0;for(let[W,X]of Object.entries(Z)){if(x1.has(W))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(s(X))return!0}if(Z.style&&typeof Z.style==="object"){for(let W of Object.values(Z.style))if(s(W))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let W of Object.values(Z.attributes))if(s(W))return!0}return!1}function U6(Z,W=null,X={},Q={}){let J=Z?.state?q6(Z.state,W):W??Object.create(null);return{media:Q,scope:J,scopeDefs:X}}function q6(Z={},W=null){let X=Object.create(W??null);for(let[Q,J]of Object.entries(Z)){if(typeof J!=="object"||J===null||Array.isArray(J)){l1(X,Q,D4(J));continue}let G=J;if("default"in G){l1(X,Q,D4(G.default));continue}if(!G.$prototype&&!("$expression"in G)&&!C1(G))l1(X,Q,D4(G))}for(let[Q,J]of Object.entries(Z)){if(typeof J==="string"&&s(J)){E2(X,Q,()=>E0(J,X));continue}if(!J||typeof J!=="object")continue;if(a0(J)){let G=J.$expression;if(E1(G.operator))l1(X,Q,(z,q)=>L1(G,z,q));else E2(X,Q,()=>L1(G,X,null));continue}if(A1(J)){if(J.body){let G=J.parameters?O1(J.parameters):J.arguments??[],z=Function("state",...G,J.body);if(J.body.includes("return"))E2(X,Q,()=>z(X));else l1(X,Q,z)}else l1(X,Q,()=>{});continue}if(c1(J)&&(J.$prototype==="LocalStorage"||J.$prototype==="SessionStorage"))l1(X,Q,D4(J.default??null))}return X}function l1(Z,W,X){Object.defineProperty(Z,W,{configurable:!0,enumerable:!0,value:X,writable:!0})}function E2(Z,W,X){Object.defineProperty(Z,W,{configurable:!0,enumerable:!0,get:X})}function F0(Z,W){if(s0(Z))return O2(Z.$ref,W);if(s(Z))return E0(Z,W);return Z}function s0(Z){return h0(Z)}function O2(Z,W){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let X=Z.split("/"),Q=X[1],J=W.$map?.[Q]??W[`$map/${Q}`];return X.length>2?w8(J,X.slice(2).join("/")):J}if(Z.startsWith("#/state/")){let X=Z.slice(8),Q=X.indexOf("/");if(Q===-1)return W[X];return w8(W[X.slice(0,Q)],X.slice(Q+1))}return W[Z]??null}function E0(Z,W){try{let X=Z.match(/^\$\{(.+)\}$/s);if(X)return Function("state","$map",`return (${X[1]})`)(W,W?.$map);return Function("state","$map",`return \`${Z}\``)(W,W?.$map)}catch{return null}}function w8(Z,W){if(!W)return Z;let X=Z;for(let Q of W.split("/"))X=X==null?void 0:X[Q];return X}function D4(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function G6(Z,W){let X="",Q=F0(Z.id,W),J=F0(Z.className,W),G=F0(Z.hidden,W),z=F0(Z.tabIndex,W),q=F0(Z.title,W),K=F0(Z.lang,W),V=F0(Z.dir,W);if(Q)X+=` id="${e(String(Q))}"`;if(J)X+=` class="${e(String(J))}"`;if(G)X+=" hidden";if(z!==void 0&&z!==null)X+=` tabindex="${e(String(z))}"`;if(q)X+=` title="${e(String(q))}"`;if(K)X+=` lang="${e(String(K))}"`;if(V)X+=` dir="${e(String(V))}"`;if(Z.style&&W){let H=Object.entries(Z.style).filter(([B,$])=>!B.startsWith(":")&&!B.startsWith(".")&&!B.startsWith("&")&&!B.startsWith("[")&&!B.startsWith("@")&&$!==null&&typeof $!=="object"&&typeof $==="string"&&s($)).map(([B,$])=>{let L=F0($,W);return L==null?null:`${k0(B)}: ${L}`}).filter(Boolean).join("; ");if(H)X+=` style="${H}"`}if(Z.attributes)for(let[H,B]of Object.entries(Z.attributes)){let $=F0(B,W);if($!==null&&$!==void 0&&(typeof $==="string"||typeof $==="number"||typeof $==="boolean"))X+=` ${H}="${e(String($))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)X+=' loading="lazy"';if(!Z.attributes?.decoding)X+=' decoding="async"'}if(Z.$static)X+=" data-jx-static";else if(Z.$prerendered)X+=" data-jx-prerendered";return X}function K6(Z,W={},X=null){let Q=[];if(X&&typeof X==="object"){let G=(H,B)=>{let $=j0(B);if($)Q.push(`${H} { ${$} }`);for(let[L,A]of Object.entries(B)){if(A===null||typeof A!=="object"||Array.isArray(A))continue;if(L.startsWith("@")){let D=L.startsWith("@--")?`@media ${W[L.slice(1)]??L.slice(1)}`:L,R=j0(A);if(R)Q.push(`${D} { ${H} { ${R} } }`);for(let[x,f]of Object.entries(A)){if(f===null||typeof f!=="object"||Array.isArray(f))continue;if(x.startsWith("@"))continue;let p=x.startsWith("&")?x.replace("&",H):x.startsWith(":")||x.startsWith(".")||x.startsWith("[")?`${H}${x}`:`${H} ${x}`,r=j0(f);if(r)Q.push(`${D} { ${p} { ${r} } }`)}continue}let j=L.startsWith("&")?L.replace("&",H):L.startsWith(":")||L.startsWith(".")||L.startsWith("[")?`${H}${L}`:`${H} ${L}`;G(j,A)}};for(let[H,B]of Object.entries(X))if(H.startsWith(":")||H.startsWith(".")||H.startsWith("["))G(H,B);else if(B!==null&&typeof B==="object"&&!Array.isArray(B)&&!H.startsWith("@")&&!H.startsWith("--"))G(H,B);else if(H.startsWith("@")){let $=H.startsWith("@--")?`@media ${W[H.slice(1)]??H.slice(1)}`:H.startsWith("@(")?`@media ${H.slice(1)}`:H;Q.push(`${$} { body { ${j0(B)} } }`)}let z={},q={};for(let[H,B]of Object.entries(X)){if(H.startsWith(":")||H.startsWith(".")||H.startsWith("[")||H.startsWith("@"))continue;if(B!==null&&typeof B==="object"&&!Array.isArray(B))continue;if(H.startsWith("--"))z[H]=B;else q[H]=B}let K=j0(z);if(K)Q.push(`:root { ${K} }`);let V=j0(q);if(V)Q.push(`body { ${V} }`)}if(k1(Z,Q,W,"",{n:0}),Q.length===0)return"";return`<style>
|
|
2
|
+
import{createRequire as IX}from"node:module";var qX=Object.create;var{getPrototypeOf:KX,defineProperty:w2,getOwnPropertyNames:VX}=Object;var BX=Object.prototype.hasOwnProperty;function HX(Z){return this[Z]}var $X,FX,v6=(Z,W,X)=>{var Q=Z!=null&&typeof Z==="object";if(Q){var J=W?$X??=new WeakMap:FX??=new WeakMap,G=J.get(Z);if(G)return G}X=Z!=null?qX(KX(Z)):{};let z=W||!Z||!Z.__esModule?w2(X,"default",{value:Z,enumerable:!0}):X;for(let q of VX(Z))if(!BX.call(z,q))w2(z,q,{get:HX.bind(Z,q),enumerable:!0});if(Q)J.set(Z,z);return z};var i=(Z,W)=>()=>(W||Z((W={exports:{}}).exports,W),W.exports);var LX=(Z)=>Z;function AX(Z,W){this[Z]=LX.bind(null,W)}var M4=(Z,W)=>{for(var X in W)w2(Z,X,{get:W[X],enumerable:!0,configurable:!0,set:AX.bind(W,X)})};var c=(Z,W)=>()=>(Z&&(W=Z(Z=0)),W);var T0=IX(import.meta.url);function N2(Z){let W=Z.$map;return W&&typeof W==="object"?W:void 0}function E1(Z){return H8.has(Z)}function r0(Z,W,X,Q){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return L1(Z,W,X,Q);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return wX(Z.$ref,W,X,Q);if(Array.isArray(Z))return Z.map((J)=>r0(J,W,X,Q));return Z}function wX(Z,W,X,Q){if(Z==="$reduce/acc")return Q?.acc;if(Z.startsWith("$reduce/"))return Q?.acc;if(Z.startsWith("event#/")){let J=Z.slice(7);return Q6(X,J)}if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,z,q=N2(W);if(G==="item")z=Q?.item??q?.item??W["$map/item"];else if(G==="index")z=Q?.index??q?.index??W["$map/index"];else z=q?.[G]??W[`$map/${G}`];return J.length>2?Q6(z,J.slice(2).join("/")):z}if(Z.startsWith("#/state/")){let J=Z.slice(8),G=J.indexOf("/");if(G===-1)return W[J];return Q6(W[J.slice(0,G)],J.slice(G+1))}if(Z.startsWith("parent#/"))return W[Z.slice(8)];if(Z.startsWith("window#/"))return Q6(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return Q6(globalThis.document,Z.slice(10));return W[Z]??null}function NX(Z,W,X,Q){if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,z,q=N2(W);if(G==="item")z=Q?.item??q?.item??W["$map/item"];else if(G==="index")z=Q?.index??q?.index??W["$map/index"];else z=q?.[G]??W[`$map/${G}`];if(J.length>2){let K=J.slice(2),V=K.pop(),H=K.length>0?Q6(z,K.join("/")):z;return{key:V,obj:H}}return{key:G==="item"?"$map/item":"$map/index",obj:N2(W)??W}}if(Z.startsWith("#/state/")){let J=Z.slice(8);if(J.indexOf("/")===-1)return{key:J,obj:W};let z=J.split("/"),q=z.pop(),K=W;for(let V of z)K=K[V];return{key:q,obj:K}}return{key:Z,obj:W}}function L1(Z,W,X,Q){let{operator:J,target:G,value:z,initial:q}=Z;if(!MX.has(J))throw Error(`$expression: unknown operator "${J}"`);if(D2.has(J)&&!("value"in Z)){let K=r0(G,W,X,Q);if(J==="!")return!K;if(J==="-")return-K}if(T2.has(J)){let K=r0(G,W,X,Q),V=r0(z,W,X,Q);switch(J){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($8.has(J)){let K=r0(z,W,X,Q),{obj:V,key:H}=NX(G.$ref,W,X,Q);switch(J){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(F8.has(J)){let K=r0(G,W,X,Q);switch(J){case"push":return K.push(r0(z,W,X,Q));case"unshift":return K.unshift(r0(z,W,X,Q));case"pop":return K.pop();case"shift":return K.shift();case"splice":{let V=r0(z,W,X,Q);return K.splice(...V)}default:break}}if(R2.has(J)){let K=r0(G,W,X,Q);if(J==="reduce"){let V=r0(q,W,X,Q);for(let[H,B]of K.entries())V=L1(z,W,X,{acc:V,index:H,item:B});return V}if(J==="map")return K.map((V,H)=>L1(z,W,X,{...Q,index:H,item:V}));if(J==="filter")return K.filter((V,H)=>L1(z,W,X,{...Q,index:H,item:V}))}return}function d0(Z,W){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return c0(Z,W);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return L8(Z.$ref,W);if(Array.isArray(Z))return Z.map((X)=>d0(X,W)).join(", ");return JSON.stringify(Z)}function L8(Z,W){let X=W.statePrefix??"state",Q=W.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("event#/")){let J=Z.slice(7);return`${Q}.${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`${X}.${J.replaceAll("/",".")}`}if(Z.startsWith("parent#/"))return`${X}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replaceAll("/",".")}`;return`${X}.${Z}`}function B8(Z,W){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return L8(Z.$ref,W);return d0(Z,W)}function c0(Z,W={}){let{operator:X,target:Q,value:J,initial:G}=Z;if(D2.has(X)&&!("value"in Z)){let z=d0(Q,W);if(X==="!")return`!(${z})`;if(X==="-")return`-(${z})`}if(T2.has(X)){let z=d0(Q,W),q=d0(J,W);return`(${z} ${X} ${q})`}if($8.has(X)){let z=B8(Q,W),q=d0(J,W);return`${z} ${X} ${q}`}if(F8.has(X)){let z=B8(Q,W);switch(X){case"push":return`${z}.push(${d0(J,W)})`;case"unshift":return`${z}.unshift(${d0(J,W)})`;case"pop":return`${z}.pop()`;case"shift":return`${z}.shift()`;case"splice":{let q=Array.isArray(J)?J.map((K)=>d0(K,W)).join(", "):d0(J,W);return`${z}.splice(${q})`}default:break}}if(R2.has(X)){let z=d0(Q,W),q=c0(J,W);if(X==="reduce"){let K=d0(G,W);return`${z}.reduce((_acc, _item, _index) => ${q}, ${K})`}if(X==="map")return`${z}.map((_item, _index) => ${q})`;if(X==="filter")return`${z}.filter((_item, _index) => ${q})`}return"undefined"}function Q6(Z,W){let X=Z;for(let Q of W.split(/[./]/))X=X?.[Q];return X}var H8,D2,T2,$8,F8,R2,MX;var w4=c(()=>{H8=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),D2=new Set(["!","-"]),T2=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),$8=new Set(["=","+=","-=","*=","/="]),F8=new Set(["push","pop","shift","unshift","splice"]),R2=new Set(["reduce","map","filter"]),MX=new Set([...H8,...D2,...T2,...R2])});function g0(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function h0(Z){return g0(Z)&&typeof Z.$ref==="string"}function A1(Z){return g0(Z)&&Z.$prototype==="Function"}function a0(Z){return g0(Z)&&g0(Z.$expression)}function l1(Z){return g0(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function P2(Z){return g0(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function A8(Z){return g0(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function C1(Z){if(!g0(Z))return!1;for(let W of Object.keys(Z))if(!I8.has(W))return!1;return!0}function R0(Z){return g0(Z)&&Z.$prototype==="Array"}function _2(Z){if(R0(Z))return!0;return Array.isArray(Z)&&Z.some((W)=>R0(W))}function M8(Z){return g0(Z)&&Z.$prototype==="Class"}function s(Z){return typeof Z==="string"&&Z.includes("${")}function O1(Z){if(!Z)return[];return Z.map((W)=>typeof W==="string"?W:W.name)}var I8;var e0=c(()=>{I8=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function DX(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function k0(Z){return Z.replaceAll(/[A-Z]/g,(W)=>`-${W.toLowerCase()}`)}function j0(Z){return Object.entries(Z).filter(([W,X])=>!DX(W)&&(X===null||typeof X!=="object")).map(([W,X])=>`${k0(W)}: ${X}`).join("; ")}var x1;var y6=c(()=>{w4();e0();x1=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 D4(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[W,X]of Object.entries(Z.state)){if(W==="$site"||W==="$page")continue;if(X&&typeof X==="object"&&!Array.isArray(X)&&X.timing==="compiler")continue;if(typeof X!=="object"||X===null||Array.isArray(X))return!0;if(X.$prototype)return!0;if("default"in X)return!0;if(C1(X))continue;return!0}if(Z.$switch)return!0;if(R0(Z)||_2(Z.children))return!0;if(Array.isArray(Z.children)&&Z.children.some((W)=>D4(W)))return!0;for(let[W,X]of Object.entries(Z)){if(x1.has(W))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(s(X))return!0}if(Z.style&&typeof Z.style==="object"){for(let W of Object.values(Z.style))if(s(W))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let W of Object.values(Z.attributes))if(s(W))return!0}return!1}function N8(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(R0(Z)||_2(Z.children))return!0;for(let[W,X]of Object.entries(Z)){if(x1.has(W))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(s(X))return!0}if(Z.style&&typeof Z.style==="object"){for(let W of Object.values(Z.style))if(s(W))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let W of Object.values(Z.attributes))if(s(W))return!0}return!1}function U6(Z,W=null,X={},Q={}){let J=Z?.state?q6(Z.state,W):W??Object.create(null);return{media:Q,scope:J,scopeDefs:X}}function q6(Z={},W=null){let X=Object.create(W??null);for(let[Q,J]of Object.entries(Z)){if(typeof J!=="object"||J===null||Array.isArray(J)){p1(X,Q,N4(J));continue}let G=J;if("default"in G){p1(X,Q,N4(G.default));continue}if(!G.$prototype&&!("$expression"in G)&&!C1(G))p1(X,Q,N4(G))}for(let[Q,J]of Object.entries(Z)){if(typeof J==="string"&&s(J)){j2(X,Q,()=>E0(J,X));continue}if(!J||typeof J!=="object")continue;if(a0(J)){let G=J.$expression;if(E1(G.operator))p1(X,Q,(z,q)=>L1(G,z,q));else j2(X,Q,()=>L1(G,X,null));continue}if(A1(J)){if(J.body){let G=J.parameters?O1(J.parameters):J.arguments??[],z=Function("state",...G,J.body);if(J.body.includes("return"))j2(X,Q,()=>z(X));else p1(X,Q,z)}else p1(X,Q,()=>{});continue}if(l1(J)&&(J.$prototype==="LocalStorage"||J.$prototype==="SessionStorage"))p1(X,Q,N4(J.default??null))}return X}function p1(Z,W,X){Object.defineProperty(Z,W,{configurable:!0,enumerable:!0,value:X,writable:!0})}function j2(Z,W,X){Object.defineProperty(Z,W,{configurable:!0,enumerable:!0,get:X})}function $0(Z,W){if(s0(Z))return C2(Z.$ref,W);if(s(Z))return E0(Z,W);return Z}function s0(Z){return h0(Z)}function C2(Z,W){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let X=Z.split("/"),Q=X[1],J=W.$map?.[Q]??W[`$map/${Q}`];return X.length>2?w8(J,X.slice(2).join("/")):J}if(Z.startsWith("#/state/")){let X=Z.slice(8),Q=X.indexOf("/");if(Q===-1)return W[X];return w8(W[X.slice(0,Q)],X.slice(Q+1))}return W[Z]??null}function E0(Z,W){try{let X=Z.match(/^\$\{(.+)\}$/s);if(X)return Function("state","$map",`return (${X[1]})`)(W,W?.$map);return Function("state","$map",`return \`${Z}\``)(W,W?.$map)}catch{return null}}function w8(Z,W){if(!W)return Z;let X=Z;for(let Q of W.split("/"))X=X==null?void 0:X[Q];return X}function N4(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function G6(Z,W){let X="",Q=$0(Z.id,W),J=$0(Z.className,W),G=$0(Z.hidden,W),z=$0(Z.tabIndex,W),q=$0(Z.title,W),K=$0(Z.lang,W),V=$0(Z.dir,W);if(Q)X+=` id="${e(String(Q))}"`;if(J)X+=` class="${e(String(J))}"`;if(G)X+=" hidden";if(z!==void 0&&z!==null)X+=` tabindex="${e(String(z))}"`;if(q)X+=` title="${e(String(q))}"`;if(K)X+=` lang="${e(String(K))}"`;if(V)X+=` dir="${e(String(V))}"`;if(Z.style&&W){let H=Object.entries(Z.style).filter(([B,$])=>!B.startsWith(":")&&!B.startsWith(".")&&!B.startsWith("&")&&!B.startsWith("[")&&!B.startsWith("@")&&$!==null&&typeof $!=="object"&&typeof $==="string"&&s($)).map(([B,$])=>{let L=$0($,W);return L==null?null:`${k0(B)}: ${L}`}).filter(Boolean).join("; ");if(H)X+=` style="${H}"`}if(Z.attributes)for(let[H,B]of Object.entries(Z.attributes)){let $=$0(B,W);if($!==null&&$!==void 0&&(typeof $==="string"||typeof $==="number"||typeof $==="boolean"))X+=` ${H}="${e(String($))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)X+=' loading="lazy"';if(!Z.attributes?.decoding)X+=' decoding="async"'}if(Z.$static)X+=" data-jx-static";else if(Z.$prerendered)X+=" data-jx-prerendered";return X}function K6(Z,W={},X=null){let Q=[];if(X&&typeof X==="object"){let G=(H,B)=>{let $=j0(B);if($)Q.push(`${H} { ${$} }`);for(let[L,A]of Object.entries(B)){if(A===null||typeof A!=="object"||Array.isArray(A))continue;if(L.startsWith("@")){let D=L.startsWith("@--")?`@media ${W[L.slice(1)]??L.slice(1)}`:L,R=j0(A);if(R)Q.push(`${D} { ${H} { ${R} } }`);for(let[x,d]of Object.entries(A)){if(d===null||typeof d!=="object"||Array.isArray(d))continue;if(x.startsWith("@"))continue;let m=x.startsWith("&")?x.replace("&",H):x.startsWith(":")||x.startsWith(".")||x.startsWith("[")?`${H}${x}`:`${H} ${x}`,r=j0(d);if(r)Q.push(`${D} { ${m} { ${r} } }`)}continue}let j=L.startsWith("&")?L.replace("&",H):L.startsWith(":")||L.startsWith(".")||L.startsWith("[")?`${H}${L}`:`${H} ${L}`;G(j,A)}};for(let[H,B]of Object.entries(X))if(H.startsWith(":")||H.startsWith(".")||H.startsWith("["))G(H,B);else if(B!==null&&typeof B==="object"&&!Array.isArray(B)&&!H.startsWith("@")&&!H.startsWith("--"))G(H,B);else if(H.startsWith("@")){let $=H.startsWith("@--")?`@media ${W[H.slice(1)]??H.slice(1)}`:H.startsWith("@(")?`@media ${H.slice(1)}`:H;Q.push(`${$} { body { ${j0(B)} } }`)}let z={},q={};for(let[H,B]of Object.entries(X)){if(H.startsWith(":")||H.startsWith(".")||H.startsWith("[")||H.startsWith("@"))continue;if(B!==null&&typeof B==="object"&&!Array.isArray(B))continue;if(H.startsWith("--"))z[H]=B;else q[H]=B}let K=j0(z);if(K)Q.push(`:root { ${K} }`);let V=j0(q);if(V)Q.push(`body { ${V} }`)}if(k1(Z,Q,W,"",{n:0}),Q.length===0)return"";return`<style>
|
|
3
3
|
${Q.join(`
|
|
4
4
|
`)}
|
|
5
5
|
</style>`}function D8(Z,W,X,Q){let J=j0(W);if(J)X.push(`${Z} { ${J} }`);for(let[G,z]of Object.entries(W)){if(z===null||typeof z!=="object"||Array.isArray(z))continue;if(G.startsWith("@")){let K=G.startsWith("@--")?`@media ${Q[G.slice(1)]??G.slice(1)}`:G.startsWith("@(")?`@media ${G.slice(1)}`:G,V=j0(z);if(V)X.push(`${K} { ${Z} { ${V} } }`);for(let[H,B]of Object.entries(z)){if(B===null||typeof B!=="object"||Array.isArray(B))continue;if(H.startsWith("@"))continue;let $=H.startsWith("&")?H.replace("&",Z):H.startsWith(":")||H.startsWith(".")||H.startsWith("[")?`${Z}${H}`:`${Z} ${H}`,L=j0(B);if(L)X.push(`${K} { ${$} { ${L} } }`)}continue}let q=G.startsWith("&")?G.replace("&",Z):G.startsWith(":")||G.startsWith(".")||G.startsWith("[")?`${Z}${G}`:`${Z} ${G}`;D8(q,z,X,Q)}}function k1(Z,W,X,Q="",J,G="jx"){let z=J??{n:0};if(!Z||typeof Z!=="object")return;if(Z.style&&!Z.id&&!Z.className)Z.className=`${G}-${z.n}`,z.n+=1;let q=Z.id?`#${Z.id}`:Z.className?`.${Z.className.split(" ")[0]}`:Z.tagName??"*";if(Z.style){let K=[];for(let[V,H]of Object.entries(Z.style)){if(V.startsWith(":")||V.startsWith(".")||V.startsWith("&")||V.startsWith("[")||V.startsWith("@"))continue;if(H===null||typeof H==="object")continue;if(typeof H==="string"&&s(H))continue;K.push(` ${k0(V)}: ${H};`)}if(K.length>0)W.push(`${q} {
|
|
6
6
|
${K.join(`
|
|
7
7
|
`)}
|
|
8
|
-
}`);for(let[V,H]of Object.entries(Z.style)){if(H===null||typeof H!=="object"||Array.isArray(H))continue;if(V.startsWith("@")){let B=V.startsWith("@--")?`@media ${X[V.slice(1)]??V.slice(1)}`:V.startsWith("@(")?`@media ${V.slice(1)}`:V,$=j0(H);if($)W.push(`${B} { ${q} { ${$} } }`);for(let[L,A]of Object.entries(H)){if(A===null||typeof A!=="object"||Array.isArray(A))continue;if(L.startsWith("@"))continue;let j=L.startsWith("&")?L.replace("&",q):L.startsWith(":")||L.startsWith(".")||L.startsWith("[")?`${q}${L}`:`${q} ${L}`;W.push(`${B} { ${j} { ${j0(A)} } }`)}}else{let B=V.startsWith("&")?V.replace("&",q):V.startsWith(":")||V.startsWith(".")||V.startsWith("[")?`${q}${V}`:`${q} ${V}`;D8(B,H,W,X)}}}if(Array.isArray(Z.children))for(let K of Z.children)k1(K,W,X,q,z,G);if(Z.cases&&typeof Z.cases==="object")for(let K of Object.values(Z.cases))k1(K,W,X,q,z,G)}function e(Z){return String(Z).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function
|
|
9
|
-
`);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";if(Z.$switch){let z=Z.tagName??"div",q=G6(Z,W),K
|
|
8
|
+
}`);for(let[V,H]of Object.entries(Z.style)){if(H===null||typeof H!=="object"||Array.isArray(H))continue;if(V.startsWith("@")){let B=V.startsWith("@--")?`@media ${X[V.slice(1)]??V.slice(1)}`:V.startsWith("@(")?`@media ${V.slice(1)}`:V,$=j0(H);if($)W.push(`${B} { ${q} { ${$} } }`);for(let[L,A]of Object.entries(H)){if(A===null||typeof A!=="object"||Array.isArray(A))continue;if(L.startsWith("@"))continue;let j=L.startsWith("&")?L.replace("&",q):L.startsWith(":")||L.startsWith(".")||L.startsWith("[")?`${q}${L}`:`${q} ${L}`;W.push(`${B} { ${j} { ${j0(A)} } }`)}}else{let B=V.startsWith("&")?V.replace("&",q):V.startsWith(":")||V.startsWith(".")||V.startsWith("[")?`${q}${V}`:`${q} ${V}`;D8(B,H,W,X)}}}if(Array.isArray(Z.children))for(let K of Z.children)k1(K,W,X,q,z,G);if(Z.cases&&typeof Z.cases==="object")for(let K of Object.values(Z.cases))k1(K,W,X,q,z,G)}function e(Z){return String(Z).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function T4(Z){return Z.split("-").map((W)=>W.charAt(0).toUpperCase()+W.slice(1)).join("")}function R4(Z){let W=new Map;return T8(Z,W),[...W.values()]}function T8(Z,W){if(!Z||typeof Z!=="object")return;if(Z.state){for(let[X,Q]of Object.entries(Z.state))if(P2(Q))W.set(Q.$export,{exportName:Q.$export,key:X,src:Q.$src})}if(Array.isArray(Z.children))for(let X of Z.children)T8(X,W)}function J6(Z,W,X=null){if(typeof Z==="string"){if(s(Z)&&W){let z=E0(Z,W);return z!=null?e(String(z)):e(Z)}return e(Z)}if(typeof Z==="number"||typeof Z==="boolean")return e(String(Z));if(Array.isArray(Z))return Z.map((z)=>J6(z,W,X)).join(`
|
|
9
|
+
`);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";if(Z.$switch){let z=Z.tagName??"div",q=G6(Z,W),K=$0(Z.$switch,W),V=K==null?void 0:Z.cases?.[String(K)],H=V!==void 0&&!s0(V)?J6(V,W,X):"";return`<${z}${q}>${H}</${z}>`}let Q=Z.tagName??"div";if(Q==="slot"&&X!=null)return X;let J=G6(Z,W);if(O2.has(Q))return`<${Q}${J}>`;let G="";if(Z.textContent!==void 0){let z=$0(Z.textContent,W);G=z!=null?e(String(z)):""}else if(Z.innerHTML){let z=$0(Z.innerHTML,W);G=z!=null?String(z):Z.innerHTML}else if(Array.isArray(Z.children))G=Z.children.map((z)=>J6(z,W,X)).join(`
|
|
10
10
|
`);return`<${Q}${J}>${G}</${Q}>`}function R8(Z,W=null,X=null){let Q=Z.state??{};if(W){Q={...Q};for(let[G,z]of Object.entries(W))if(G in Q){let q=Q[G];Q[G]=q&&typeof q==="object"&&!Array.isArray(q)&&"default"in q?{...q,default:z}:z}else Q[G]=z}let J=q6(Q,null);if(!Array.isArray(Z.children))return"";return Z.children.map((G)=>J6(G,J,X)).join(`
|
|
11
|
-
`)}function x2(Z){return
|
|
11
|
+
`)}function x2(Z){return E2(Z)}function E2(Z){if(!Z||typeof Z!=="object")return!0;if(Array.isArray(Z))return Z.every((W)=>E2(W));if(Z.$prototype)return!1;if(Z.$ref)return!1;if(Z.state)for(let W of Object.values(Z.state)){if(!W||typeof W!=="object")continue;let X=W;if(X.$prototype)return!1;if(X.$ref)return!1}for(let W of Object.keys(Z))if(W.startsWith("on")&&W!=="observedAttributes")return!1;if(Array.isArray(Z.children))return Z.children.every((W)=>E2(W));if(Z.children&&typeof Z.children==="object"&&Z.children.$prototype)return!1;return!0}function P8(Z,W,X=null,Q={}){let J=[];if(W&&typeof W==="object"){let G=[];for(let[z,q]of Object.entries(W)){if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")||z.startsWith("@"))continue;if(q===null||typeof q==="object")continue;if(typeof q==="string"&&s(q))continue;G.push(` ${k0(z)}: ${q};`)}if(G.length>0)J.push(`${Z} {
|
|
12
12
|
${G.join(`
|
|
13
13
|
`)}
|
|
14
14
|
}`);for(let[z,q]of Object.entries(W))if(z.startsWith("@")){let K=z.startsWith("@--")?`@media ${Q[z.slice(1)]??z.slice(1)}`:z.startsWith("@(")?`@media ${z.slice(1)}`:z;J.push(`${K} { ${Z} { ${j0(q)} } }`)}else if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")){let K=z.startsWith("&")?z.replace("&",Z):`${Z}${z}`;J.push(`${K} { ${j0(q)} }`)}}if(X&&Array.isArray(X.children)){let G={n:0};for(let z of X.children)k1(z,J,Q,"",G,Z)}return J.length>0?`${J.join(`
|
|
15
15
|
`)}
|
|
16
|
-
`:""}var z6="https://esm.sh/@vue/reactivity@3.5.32",Y6="https://esm.sh/lit-html@3.3.0",_X;var S1=d(()=>{y6();N4();e0();y6();N4();e0();_X=new Set(["input","br","hr","img","meta","link","area","col","source"])});function I1(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var jX,g6=()=>jX;var _8=d(()=>{jX=/^win/.test(globalThis.process?globalThis.process.platform:"")});function A0(Z,W){let X=new URL(I1(Z),"https://aaa.nonexistanturl.com"),Q=new URL(I1(W),X),J=W.match(/(\s*)$/)?.[1]||"";if(Q.hostname==="aaa.nonexistanturl.com"){let{pathname:z,search:q,hash:K}=Q;return z+q+decodeURIComponent(K)+J}let G=Q.toString()+J;if(G.includes("#")){let[z,q]=G.split("#",2);return z+"#"+decodeURIComponent(q||"")}return G}function p1(){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(),W=Z.slice(-1);if(W==="/"||W==="\\")return Z;else return Z+"/"}return"/"}function E8(Z){let W=CX.exec(Z||"");if(W)return W[1].toLowerCase();return}function C8(Z){let W=Z.lastIndexOf(".");if(W>=0)return vX(Z.substring(W).toLowerCase());return""}function vX(Z){let W=Z.indexOf("?");if(W>=0)Z=Z.substring(0,W);return Z}function Z1(Z){if(!Z)return"#";let W=Z.indexOf("#");if(W>=0)return Z.substring(W);return"#"}function L0(Z){if(!Z)return"";let W=Z.indexOf("#");if(W>=0)Z=Z.substring(0,W);return Z}function O8(Z){let W=E8(Z);if(W==="http"||W==="https")return!0;else if(W===void 0)return typeof window<"u";else return!1}function _4(Z){if(!Z||typeof Z!=="string")return!0;let W=Z.trim().toLowerCase();if(!W)return!0;if(W.startsWith("javascript:")||W.startsWith("vbscript:")||W.startsWith("data:"))return!0;if(W.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let X=new URL(W.startsWith("//")?"http:"+W:W);if(x8(X.hostname))return!0;let Q=X.port;if(Q&&uX(parseInt(Q)))return!0}catch{if(W.startsWith("/")&&!W.startsWith("//"))return!1;if(mX(W))return!0}return!1}function x8(Z){let W=yX(Z);if(!W)return!0;if(W==="localhost"||bX.some((J)=>W.endsWith(J)))return!0;let X=k8(W);if(X)return S8(X);let Q=gX(W);if(Q)return hX(Q);return!1}function yX(Z){let W=Z.trim().toLowerCase();if(W.startsWith("[")&&W.endsWith("]"))W=W.slice(1,-1);while(W.endsWith("."))W=W.slice(0,-1);return W}function k8(Z){let W=Z.split(".");if(W.length!==4)return;let X=W.map((Q)=>{if(!/^\d+$/.test(Q))return Number.NaN;return Number(Q)});if(X.some((Q)=>!Number.isInteger(Q)||Q<0||Q>255))return;return X}function S8([Z,W,X,Q]){return Z===0||Z===10||Z===127||Z===100&&W>=64&&W<=127||Z===169&&W===254||Z===172&&W>=16&&W<=31||Z===192&&W===0&&X===0||Z===192&&W===168||Z===198&&(W===18||W===19)||Z>=224||Z===255&&W===255&&X===255&&Q===255}function gX(Z){if(!Z.includes(":"))return;let W=Z,X=W.lastIndexOf(":"),Q=W.slice(X+1);if(Q.includes(".")){let K=k8(Q);if(!K)return;let V=K[0]*256+K[1],H=K[2]*256+K[3];W=`${W.slice(0,X+1)}${V.toString(16)}:${H.toString(16)}`}let J=W.split("::");if(J.length>2)return;let G=j8(J[0]),z=J.length===2?j8(J[1]):[];if(!G||!z)return;if(J.length===1)return G.length===8?G:void 0;let q=8-G.length-z.length;if(q<1)return;return[...G,...Array(q).fill(0),...z]}function j8(Z){if(!Z)return[];let W=Z.split(":").map((X)=>{if(!/^[\da-f]{1,4}$/i.test(X))return Number.NaN;return Number.parseInt(X,16)});if(W.some((X)=>!Number.isInteger(X)||X<0||X>65535))return;return W}function hX(Z){if(Z.length!==8)return!1;let W=Z.every((q)=>q===0),X=Z.slice(0,7).every((q)=>q===0)&&Z[7]===1,Q=(Z[0]&65024)===64512,J=(Z[0]&65472)===65152,G=(Z[0]&65280)===65280;if(W||X||Q||J||G)return!0;let z=fX(Z);return z?S8(z):!1}function fX(Z){let W=Z.slice(0,5).every((J)=>J===0),X=W&&Z[5]===0,Q=W&&Z[5]===65535;if(!X&&!Q)return;return[Math.floor(Z[6]/256),Z[6]%256,Math.floor(Z[7]/256),Z[7]%256]}function mX(Z){return Z.split(/[\s/?#]+/).map((X)=>X.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((X)=>x8(X))}function uX(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 j4(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let W=E8(Z);return W===void 0||W==="file"}function b8(Z){if(g6()){let W=p1(),X=Z.toUpperCase(),J=I1(W).toUpperCase(),G=X.includes(J),z=X.includes(J),q=kX.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(G||z||q)&&!W.startsWith("http"))Z=((V,H)=>{if(V.endsWith("/")||V.endsWith("\\"))return V+H;else return V+"/"+H})(W,Z);Z=I1(Z)}Z=encodeURI(Z);for(let W of SX)Z=Z.replace(W[0],W[1]);return Z}function B6(Z,W){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let Q=0;Q<k2.length;Q+=2)Z=Z.replace(k2[Q],k2[Q+1]);let X=Z.toLowerCase().startsWith("file://");if(X){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),g6()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(W)Z="file:///"+Z;else X=!1,Z=g6()?Z:"/"+Z}if(g6()&&!X){if(Z=Z.replace(EX,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function E4(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((W)=>{return W.replace(OX,"/").replace(xX,"~")})}var EX,CX,OX,xX,kX,SX,k2,bX,V6=(Z)=>new URL(Z);var S0=d(()=>{_8();EX=/\//g,CX=/^(\w{2,}):\/\//i,OX=/~1/g,xX=/~0/g,kX=/^[a-zA-Z]:[\\/]/,SX=[[/\?/g,"%3F"],[/#/g,"%23"]],k2=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],bX=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function v8(){let Z={},W=this;for(let X of pX(W))if(typeof X==="string"){let Q=W[X],J=typeof Q;if(!dX.includes(J))Z[X]=Q}return Z}function pX(Z,W=[]){let X=[];while(Z&&Z!==lX)X=X.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let Q=new Set(X);for(let J of W.concat(cX))Q.delete(J);return Q}function X1(Z){return Z instanceof f0||Z instanceof H6}function b2(Z){if(Z.path===null)Z.path=[];return Z}var dX,cX,lX,f0,H6,l0,C4,o0,O4,x4,S2,$6;var p0=d(()=>{S0();dX=["function","symbol","undefined"],cX=["constructor","prototype","__proto__"],lX=Object.getPrototypeOf({});f0=class f0 extends Error{name;message;source;path;code;constructor(Z,W){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=Z,this.source=W,this.path=null}toJSON=v8.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};H6=class H6 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 '${B6(Z.$refs._root$Ref.path)}'`}toJSON=v8.bind(this);static getParserErrors(Z){let W=[];for(let X of Object.values(Z.$refs._$refs))if(X.errors)W.push(...X.errors);return W}get errors(){return H6.getParserErrors(this.files)}};l0=class l0 extends f0{code="EPARSER";name="ParserError";constructor(Z,W){super(`Error parsing ${W}: ${Z}`,W)}};C4=class C4 extends f0{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};o0=class o0 extends f0{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(Z,W){super(Z.message||`Error reading file "${W}"`,W);if("code"in Z)this.ioErrorCode=String(Z.code)}};O4=class O4 extends f0{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};x4=class x4 extends f0{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,W,X,Q,J){super(`Missing $ref pointer "${Z1(W)}". Token "${Z}" does not exist.`,L0(W));this.targetToken=Z,this.targetRef=X,this.targetFound=Q,this.parentPath=J}};S2=class S2 extends f0{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};$6=class $6 extends f0{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,W){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,L0(W))}}});function C0(Z,W){let X=nX(W);return X?A0(Z,X):Z}function k4(Z){if(!Z||typeof Z!=="object"||ArrayBuffer.isView(Z))return!1;let W=Z.$schema;if(typeof W==="string"&&(W.includes("draft/2019-09/")||W.includes("draft/2020-12/")||W.includes("oas/3.1/")))return!0;let X=Z.openapi;return typeof X==="string"&&/^3\.1(?:\.|$)/.test(X)}function S4(Z,W,X,Q,J=!1){if(!J)return;let G=new Set,z=(q,K)=>{if(!q||typeof q!=="object"||ArrayBuffer.isView(q)||G.has(q))return;G.add(q);let V=C0(K,q);if(V!==K)Z._addAlias(V,q,Q,J);for(let H of Object.keys(q))z(q[H],V)};z(X,W)}function nX(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var n1=d(()=>{S0()});class i1{$ref;path;originalPath;scopeBase;value;circular;indirections;constructor(Z,W,X){this.$ref=Z,this.path=W,this.originalPath=X||W,this.scopeBase=Z.path||L0(W),this.value=void 0,this.circular=!1,this.indirections=0}resolve(Z,W,X){let Q=i1.parse(this.path,this.originalPath),J=[];if(this.value=g8(Z),this.$ref.dynamicIdScope&&!h8(this.$ref))this.scopeBase=C0(this.scopeBase,this.value);for(let z=0;z<Q.length;z++){let q=this.circular,K=B0.isExtended$Ref(this.value);if(b4(this,W,X))this.path=i1.join(this.path,Q.slice(z));else if(!q&&this.circular&&K)this.circular=!1;let V=Q[z];if(this.value[V]===void 0||this.value[V]===null&&z===Q.length-1){let H=!1;for(let j=Q.length-1;j>z;j--){let D=Q.slice(z,j+1).join("/");if(this.value[D]!==void 0){this.value=this.value[D],z=j,H=!0;break}}if(H)continue;if(V in this.value&&this.value[V]===null){this.value=v4;continue}this.value=null;let B=this.$ref.path||"",$=this.path.replace(B,""),L=i1.join("",J),A=X?.replace(B,"");throw new x4(V,decodeURI(this.originalPath),$,L,A)}else this.value=this.value[V];if(J.push(V),this.$ref.dynamicIdScope)this.scopeBase=C0(this.scopeBase,this.value)}let G=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(!this.value||this.value.$ref&&A0(G,this.value.$ref)!==X)b4(this,W,X);return this}set(Z,W,X){let Q=i1.parse(this.path),J;if(Q.length===0)return this.value=W,W;if(tX(this.path,Q),this.value=g8(Z),this.$ref.dynamicIdScope&&!h8(this.$ref))this.scopeBase=C0(this.scopeBase,this.value);for(let G=0;G<Q.length-1;G++){if(b4(this,X),J=Q[G],this.value&&this.value[J]!==void 0)this.value=this.value[J];else this.value=y8(this,J,{});if(this.$ref.dynamicIdScope)this.scopeBase=C0(this.scopeBase,this.value)}return b4(this,X),J=Q[Q.length-1],y8(this,J,W),Z}static parse(Z,W){let X=Z1(Z).substring(1);if(!X)return[];let Q=X.split("/");for(let J=0;J<Q.length;J++)Q[J]=Q[J].replace(aX,"/").replace(sX,"~");if(Q[0]!=="")throw new $6(X,W===void 0?Z:W);return Q.slice(1)}static join(Z,W){if(Z.indexOf("#")===-1)Z+="#";W=Array.isArray(W)?W:[W];for(let X=0;X<W.length;X++){let Q=W[X];Z+="/"+Q.replace(rX,"~0").replace(iX,"~1")}return Z}}function b4(Z,W,X){if(B0.isAllowed$Ref(Z.value,W)){let Q=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,J=A0(Q,Z.value.$ref);if(J===Z.path&&!eX(X))Z.circular=!0;else{let G=Z.$ref.$refs._resolve(J,Z.path,W);if(G===null)return!1;if(Z.indirections+=G.indirections+1,B0.isExtended$Ref(Z.value))return Z.value=B0.dereference(Z.value,G.value,W),!1;else Z.$ref=G.$ref,Z.path=G.path,Z.value=G.value,Z.scopeBase=Z.$ref.path;return!0}}return}function y8(Z,W,X){if(Z.value&&typeof Z.value==="object")if(W==="-"&&Array.isArray(Z.value))Z.value.push(X);else Z.value[W]=X;else throw new f0(`Error assigning $ref pointer "${Z.path}".
|
|
17
|
-
Cannot set "${W}" of a non-object.`);return X}function
|
|
18
|
-
Unsafe JSON Pointer token "${X}" cannot be used for assignment.`)}function g8(Z){if(X1(Z))throw Z;return Z}function
|
|
19
|
-
"${
|
|
20
|
-
"${
|
|
21
|
-
Parsed value is empty`);else return z}catch(z){if(!z&&W.continueOnError)throw new
|
|
16
|
+
`:""}var z6="https://esm.sh/@vue/reactivity@3.5.32",Y6="https://esm.sh/lit-html@3.3.0",O2;var S1=c(()=>{y6();w4();e0();y6();w4();e0();O2=new Set(["input","br","hr","img","meta","link","area","col","source"])});function M1(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var TX,g6=()=>TX;var _8=c(()=>{TX=/^win/.test(globalThis.process?globalThis.process.platform:"")});function A0(Z,W){let X=new URL(M1(Z),"https://aaa.nonexistanturl.com"),Q=new URL(M1(W),X),J=W.match(/(\s*)$/)?.[1]||"";if(Q.hostname==="aaa.nonexistanturl.com"){let{pathname:z,search:q,hash:K}=Q;return z+q+decodeURIComponent(K)+J}let G=Q.toString()+J;if(G.includes("#")){let[z,q]=G.split("#",2);return z+"#"+decodeURIComponent(q||"")}return G}function n1(){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(),W=Z.slice(-1);if(W==="/"||W==="\\")return Z;else return Z+"/"}return"/"}function E8(Z){let W=PX.exec(Z||"");if(W)return W[1].toLowerCase();return}function C8(Z){let W=Z.lastIndexOf(".");if(W>=0)return xX(Z.substring(W).toLowerCase());return""}function xX(Z){let W=Z.indexOf("?");if(W>=0)Z=Z.substring(0,W);return Z}function Z1(Z){if(!Z)return"#";let W=Z.indexOf("#");if(W>=0)return Z.substring(W);return"#"}function F0(Z){if(!Z)return"";let W=Z.indexOf("#");if(W>=0)Z=Z.substring(0,W);return Z}function O8(Z){let W=E8(Z);if(W==="http"||W==="https")return!0;else if(W===void 0)return typeof window<"u";else return!1}function P4(Z){if(!Z||typeof Z!=="string")return!0;let W=Z.trim().toLowerCase();if(!W)return!0;if(W.startsWith("javascript:")||W.startsWith("vbscript:")||W.startsWith("data:"))return!0;if(W.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let X=new URL(W.startsWith("//")?"http:"+W:W);if(x8(X.hostname))return!0;let Q=X.port;if(Q&&gX(parseInt(Q)))return!0}catch{if(W.startsWith("/")&&!W.startsWith("//"))return!1;if(yX(W))return!0}return!1}function x8(Z){let W=kX(Z);if(!W)return!0;if(W==="localhost"||OX.some((J)=>W.endsWith(J)))return!0;let X=k8(W);if(X)return S8(X);let Q=SX(W);if(Q)return bX(Q);return!1}function kX(Z){let W=Z.trim().toLowerCase();if(W.startsWith("[")&&W.endsWith("]"))W=W.slice(1,-1);while(W.endsWith("."))W=W.slice(0,-1);return W}function k8(Z){let W=Z.split(".");if(W.length!==4)return;let X=W.map((Q)=>{if(!/^\d+$/.test(Q))return Number.NaN;return Number(Q)});if(X.some((Q)=>!Number.isInteger(Q)||Q<0||Q>255))return;return X}function S8([Z,W,X,Q]){return Z===0||Z===10||Z===127||Z===100&&W>=64&&W<=127||Z===169&&W===254||Z===172&&W>=16&&W<=31||Z===192&&W===0&&X===0||Z===192&&W===168||Z===198&&(W===18||W===19)||Z>=224||Z===255&&W===255&&X===255&&Q===255}function SX(Z){if(!Z.includes(":"))return;let W=Z,X=W.lastIndexOf(":"),Q=W.slice(X+1);if(Q.includes(".")){let K=k8(Q);if(!K)return;let V=K[0]*256+K[1],H=K[2]*256+K[3];W=`${W.slice(0,X+1)}${V.toString(16)}:${H.toString(16)}`}let J=W.split("::");if(J.length>2)return;let G=j8(J[0]),z=J.length===2?j8(J[1]):[];if(!G||!z)return;if(J.length===1)return G.length===8?G:void 0;let q=8-G.length-z.length;if(q<1)return;return[...G,...Array(q).fill(0),...z]}function j8(Z){if(!Z)return[];let W=Z.split(":").map((X)=>{if(!/^[\da-f]{1,4}$/i.test(X))return Number.NaN;return Number.parseInt(X,16)});if(W.some((X)=>!Number.isInteger(X)||X<0||X>65535))return;return W}function bX(Z){if(Z.length!==8)return!1;let W=Z.every((q)=>q===0),X=Z.slice(0,7).every((q)=>q===0)&&Z[7]===1,Q=(Z[0]&65024)===64512,J=(Z[0]&65472)===65152,G=(Z[0]&65280)===65280;if(W||X||Q||J||G)return!0;let z=vX(Z);return z?S8(z):!1}function vX(Z){let W=Z.slice(0,5).every((J)=>J===0),X=W&&Z[5]===0,Q=W&&Z[5]===65535;if(!X&&!Q)return;return[Math.floor(Z[6]/256),Z[6]%256,Math.floor(Z[7]/256),Z[7]%256]}function yX(Z){return Z.split(/[\s/?#]+/).map((X)=>X.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((X)=>x8(X))}function gX(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 _4(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let W=E8(Z);return W===void 0||W==="file"}function b8(Z){if(g6()){let W=n1(),X=Z.toUpperCase(),J=M1(W).toUpperCase(),G=X.includes(J),z=X.includes(J),q=EX.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(G||z||q)&&!W.startsWith("http"))Z=((V,H)=>{if(V.endsWith("/")||V.endsWith("\\"))return V+H;else return V+"/"+H})(W,Z);Z=M1(Z)}Z=encodeURI(Z);for(let W of CX)Z=Z.replace(W[0],W[1]);return Z}function B6(Z,W){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let Q=0;Q<k2.length;Q+=2)Z=Z.replace(k2[Q],k2[Q+1]);let X=Z.toLowerCase().startsWith("file://");if(X){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),g6()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(W)Z="file:///"+Z;else X=!1,Z=g6()?Z:"/"+Z}if(g6()&&!X){if(Z=Z.replace(RX,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function j4(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((W)=>{return W.replace(_X,"/").replace(jX,"~")})}var RX,PX,_X,jX,EX,CX,k2,OX,V6=(Z)=>new URL(Z);var S0=c(()=>{_8();RX=/\//g,PX=/^(\w{2,}):\/\//i,_X=/~1/g,jX=/~0/g,EX=/^[a-zA-Z]:[\\/]/,CX=[[/\?/g,"%3F"],[/#/g,"%23"]],k2=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],OX=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function v8(){let Z={},W=this;for(let X of uX(W))if(typeof X==="string"){let Q=W[X],J=typeof Q;if(!hX.includes(J))Z[X]=Q}return Z}function uX(Z,W=[]){let X=[];while(Z&&Z!==mX)X=X.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let Q=new Set(X);for(let J of W.concat(fX))Q.delete(J);return Q}function X1(Z){return Z instanceof f0||Z instanceof H6}function b2(Z){if(Z.path===null)Z.path=[];return Z}var hX,fX,mX,f0,H6,l0,E4,o0,C4,O4,S2,$6;var p0=c(()=>{S0();hX=["function","symbol","undefined"],fX=["constructor","prototype","__proto__"],mX=Object.getPrototypeOf({});f0=class f0 extends Error{name;message;source;path;code;constructor(Z,W){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=Z,this.source=W,this.path=null}toJSON=v8.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};H6=class H6 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 '${B6(Z.$refs._root$Ref.path)}'`}toJSON=v8.bind(this);static getParserErrors(Z){let W=[];for(let X of Object.values(Z.$refs._$refs))if(X.errors)W.push(...X.errors);return W}get errors(){return H6.getParserErrors(this.files)}};l0=class l0 extends f0{code="EPARSER";name="ParserError";constructor(Z,W){super(`Error parsing ${W}: ${Z}`,W)}};E4=class E4 extends f0{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};o0=class o0 extends f0{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(Z,W){super(Z.message||`Error reading file "${W}"`,W);if("code"in Z)this.ioErrorCode=String(Z.code)}};C4=class C4 extends f0{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};O4=class O4 extends f0{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,W,X,Q,J){super(`Missing $ref pointer "${Z1(W)}". Token "${Z}" does not exist.`,F0(W));this.targetToken=Z,this.targetRef=X,this.targetFound=Q,this.parentPath=J}};S2=class S2 extends f0{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};$6=class $6 extends f0{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,W){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,F0(W))}}});function C0(Z,W){let X=dX(W);return X?A0(Z,X):Z}function x4(Z){if(!Z||typeof Z!=="object"||ArrayBuffer.isView(Z))return!1;let W=Z.$schema;if(typeof W==="string"&&(W.includes("draft/2019-09/")||W.includes("draft/2020-12/")||W.includes("oas/3.1/")))return!0;let X=Z.openapi;return typeof X==="string"&&/^3\.1(?:\.|$)/.test(X)}function k4(Z,W,X,Q,J=!1){if(!J)return;let G=new Set,z=(q,K)=>{if(!q||typeof q!=="object"||ArrayBuffer.isView(q)||G.has(q))return;G.add(q);let V=C0(K,q);if(V!==K)Z._addAlias(V,q,Q,J);for(let H of Object.keys(q))z(q[H],V)};z(X,W)}function dX(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var i1=c(()=>{S0()});class r1{$ref;path;originalPath;scopeBase;value;circular;indirections;constructor(Z,W,X){this.$ref=Z,this.path=W,this.originalPath=X||W,this.scopeBase=Z.path||F0(W),this.value=void 0,this.circular=!1,this.indirections=0}resolve(Z,W,X){let Q=r1.parse(this.path,this.originalPath),J=[];if(this.value=g8(Z),this.$ref.dynamicIdScope&&!h8(this.$ref))this.scopeBase=C0(this.scopeBase,this.value);for(let z=0;z<Q.length;z++){let q=this.circular,K=B0.isExtended$Ref(this.value);if(S4(this,W,X))this.path=r1.join(this.path,Q.slice(z));else if(!q&&this.circular&&K)this.circular=!1;let V=Q[z];if(this.value[V]===void 0||this.value[V]===null&&z===Q.length-1){let H=!1;for(let j=Q.length-1;j>z;j--){let D=Q.slice(z,j+1).join("/");if(this.value[D]!==void 0){this.value=this.value[D],z=j,H=!0;break}}if(H)continue;if(V in this.value&&this.value[V]===null){this.value=b4;continue}this.value=null;let B=this.$ref.path||"",$=this.path.replace(B,""),L=r1.join("",J),A=X?.replace(B,"");throw new O4(V,decodeURI(this.originalPath),$,L,A)}else this.value=this.value[V];if(J.push(V),this.$ref.dynamicIdScope)this.scopeBase=C0(this.scopeBase,this.value)}let G=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(!this.value||this.value.$ref&&A0(G,this.value.$ref)!==X)S4(this,W,X);return this}set(Z,W,X){let Q=r1.parse(this.path),J;if(Q.length===0)return this.value=W,W;if(rX(this.path,Q),this.value=g8(Z),this.$ref.dynamicIdScope&&!h8(this.$ref))this.scopeBase=C0(this.scopeBase,this.value);for(let G=0;G<Q.length-1;G++){if(S4(this,X),J=Q[G],this.value&&this.value[J]!==void 0)this.value=this.value[J];else this.value=y8(this,J,{});if(this.$ref.dynamicIdScope)this.scopeBase=C0(this.scopeBase,this.value)}return S4(this,X),J=Q[Q.length-1],y8(this,J,W),Z}static parse(Z,W){let X=Z1(Z).substring(1);if(!X)return[];let Q=X.split("/");for(let J=0;J<Q.length;J++)Q[J]=Q[J].replace(pX,"/").replace(nX,"~");if(Q[0]!=="")throw new $6(X,W===void 0?Z:W);return Q.slice(1)}static join(Z,W){if(Z.indexOf("#")===-1)Z+="#";W=Array.isArray(W)?W:[W];for(let X=0;X<W.length;X++){let Q=W[X];Z+="/"+Q.replace(lX,"~0").replace(cX,"~1")}return Z}}function S4(Z,W,X){if(B0.isAllowed$Ref(Z.value,W)){let Q=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,J=A0(Q,Z.value.$ref);if(J===Z.path&&!aX(X))Z.circular=!0;else{let G=Z.$ref.$refs._resolve(J,Z.path,W);if(G===null)return!1;if(Z.indirections+=G.indirections+1,B0.isExtended$Ref(Z.value))return Z.value=B0.dereference(Z.value,G.value,W),!1;else Z.$ref=G.$ref,Z.path=G.path,Z.value=G.value,Z.scopeBase=Z.$ref.path;return!0}}return}function y8(Z,W,X){if(Z.value&&typeof Z.value==="object")if(W==="-"&&Array.isArray(Z.value))Z.value.push(X);else Z.value[W]=X;else throw new f0(`Error assigning $ref pointer "${Z.path}".
|
|
17
|
+
Cannot set "${W}" of a non-object.`);return X}function rX(Z,W){for(let X of W)if(iX.has(X))throw new f0(`Error assigning $ref pointer "${Z}".
|
|
18
|
+
Unsafe JSON Pointer token "${X}" cannot be used for assignment.`)}function g8(Z){if(X1(Z))throw Z;return Z}function aX(Z){return typeof Z=="string"&&r1.parse(Z).length==0}function h8(Z){return Boolean(Z.path&&Z.path in Z.$refs._aliases)}var b4,cX,lX,pX,nX,iX,b0;var h6=c(()=>{F6();S0();p0();i1();b4=Symbol("null"),cX=/\//g,lX=/~/g,pX=/~1/g,nX=/~0/g,iX=new Set(["__proto__","constructor","prototype"]);b0=r1});class f6{path;value;$refs;pathType;dynamicIdScope=!1;errors=[];constructor(Z){this.$refs=Z}addError(Z){if(this.errors===void 0)this.errors=[];let W=this.errors.map(({footprint:X})=>X);if("errors"in Z&&Array.isArray(Z.errors))this.errors.push(...Z.errors.map(b2).filter(({footprint:X})=>!W.includes(X)));else if(!("footprint"in Z)||!W.includes(Z.footprint))this.errors.push(b2(Z))}exists(Z,W){try{return this.resolve(Z,W),!0}catch{return!1}}get(Z,W){return this.resolve(Z,W)?.value}resolve(Z,W,X,Q){let J=new b0(this,Z,X);try{let G=J.resolve(this.value,W,Q);if(G.value===b4)G.value=null;return G}catch(G){if(!W||!W.continueOnError||!X1(G))throw G;if(G.path===null)G.path=j4(Z1(Q));if(G instanceof $6)G.source=decodeURI(F0(Q));return this.addError(G),null}}set(Z,W){let X=new b0(this,Z);if(this.value=X.set(this.value,W),this.value===b4)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 f6.is$Ref(Z)&&Z.$ref[0]!=="#"}static isAllowed$Ref(Z,W){if(this.is$Ref(Z)){if(Z.$ref.substring(0,2)==="#/"||Z.$ref==="#")return!0;else if(Z.$ref[0]!=="#"&&(!W||W.resolve?.external))return!0}return}static isExtended$Ref(Z){return f6.is$Ref(Z)&&Object.keys(Z).length>1}static dereference(Z,W,X){if(W&&typeof W==="object"&&f6.isExtended$Ref(Z)){let Q={};for(let G of Object.keys(Z))if(G!=="$ref")Q[G]=Z[G];let J=X?.dereference?.mergeKeys??!0;for(let G of Object.keys(W)){let z=G;if(!(z in Q))Q[z]=W[z];else if(J&&typeof Q[z]==="object"&&Q[z]!==null&&typeof W[z]==="object"&&W[z]!==null)Q[z]=f8(W[z],Q[z])}return Q}else return W}}function f8(Z,W){if(typeof Z!=="object"||Z===null)return W;if(typeof W!=="object"||W===null)return W;let X=Array.isArray(Z)?[...Z]:{...Z};for(let Q of Object.keys(W))if(Array.isArray(W[Q]))X[Q]=[...W[Q]];else if(typeof W[Q]==="object"&&W[Q]!==null)X[Q]=f8(Z[Q],W[Q]);else X[Q]=W[Q];return X}var B0;var F6=c(()=>{h6();p0();S0();B0=f6});class m6{circular;paths(...Z){return m8(this._$refs,Z.flat()).map((X)=>{return M1(X.decoded)})}values(...Z){let W=this._$refs;return m8(W,Z.flat()).reduce((Q,J)=>{return Q[M1(J.decoded)]=W[J.encoded].value,Q},{})}exists(Z,W){try{return this._resolve(Z,"",W),!0}catch{return!1}}get(Z,W){return this._resolve(Z,"",W).value}set(Z,W){let X=A0(this._root$Ref.path,Z),Q=this._getRef(X);if(!Q)throw Error(`Error resolving $ref pointer "${Z}".
|
|
19
|
+
"${F0(X)}" not found.`);Q.set(X,W)}_get$Ref(Z){return Z=A0(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let W=F0(Z),X=new B0(this);return X.path=W,this._$refs[W]=X,this._root$Ref=this._root$Ref||X,X}_addAlias(Z,W,X,Q=!1){let J=F0(Z);if(!J||this._$refs[J]||this._aliases[J])return this._$refs[J]||this._aliases[J];let G=new B0(this);return G.path=J,G.pathType=X,G.value=W,G.dynamicIdScope=Q,this._aliases[J]=G,G}_resolve(Z,W,X){let Q=A0(this._root$Ref.path,Z),J=this._getRef(Q);if(!J)throw Error(`Error resolving $ref pointer "${Z}".
|
|
20
|
+
"${F0(Q)}" not found.`);return J.resolve(Q,X,Z,W)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef(Z){let W=F0(Z);return this._$refs[W]||this._aliases[W]}}function m8(Z,W){let X=Object.keys(Z);if(W=Array.isArray(W[0])?W[0]:Array.prototype.slice.call(W),W.length>0&&W[0])X=X.filter((Q)=>{return W.includes(Z[Q].pathType)});return X.map((Q)=>{return{encoded:Q,decoded:Z[Q].pathType==="file"?B6(Q,!0):Q}})}var u8=c(()=>{F6();S0()});function v2(Z){return Object.keys(Z||{}).filter((W)=>{return typeof Z[W]==="object"}).map((W)=>{return Z[W].name=W,Z[W]})}function y2(Z,W,X,Q,J){return Z.filter((G)=>{return!!d8(G,W,X,Q,J)})}function g2(Z){for(let W of Z)W.order=W.order||Number.MAX_SAFE_INTEGER;return Z.sort((W,X)=>{return W.order-X.order})}async function h2(Z,W,X,Q){let J,G,z=0;return new Promise((q,K)=>{V();function V(){if(J=Z[z++],!J)return K(G);try{let L=d8(J,W,X,H,Q);if(L&&typeof L.then==="function")L.then(B,$);else if(L!==void 0)B(L);else if(z===Z.length)throw Error("No promise has been returned or callback has been called.")}catch(L){$(L)}}function H(L,A){if(L)$(L);else B(A)}function B(L){q({plugin:J,result:L})}function $(L){G={plugin:J,error:L},V()}})}function d8(Z,W,X,Q,J){let G=Z[W];if(typeof G==="function")return G.apply(Z,[X,Q,J]);if(!Q){if(G instanceof RegExp)return G.test(X.url);else if(typeof G==="string")return G===X.extension;else if(Array.isArray(G))return G.indexOf(X.extension)!==-1}return G}async function sX(Z,W,X){let Q=typeof Z==="string"?Z:Z.url,J=typeof Z==="string"?void 0:Z.baseUrl,G=typeof Z==="string"?void 0:Z.reference,z=Q.indexOf("#"),q="";if(z>=0)q=Q.substring(z),Q=Q.substring(0,z);if(G){let H=G.indexOf("#");if(H>=0)G=G.substring(0,H)}let K=W._add(Q),V={url:Q,hash:q,extension:C8(Q),...G!==void 0?{reference:G}:{},...J!==void 0?{baseUrl:J}:{}};try{let H=await oX(V,X,W);K.pathType=H.plugin.name,V.data=H.result;let B=await tX(V,X,W);return K.value=B.result,K.dynamicIdScope=x4(K.value),k4(W,K.path,K.value,K.pathType,K.dynamicIdScope),B.result}catch(H){if(X1(H))K.value=H;throw H}}async function oX(Z,W,X){let Q=v2(W.resolve);Q=y2(Q,"canRead",Z,void 0,X),g2(Q);try{return await h2(Q,"read",Z,X)}catch(J){if(!J&&W.continueOnError)throw new C4(Z.url);else if(!J||!("error"in J))throw SyntaxError(`Unable to resolve $ref pointer "${Z.url}"`,{cause:J});else if(J.error instanceof o0)throw J.error;else throw new o0(J,Z.url)}}async function tX(Z,W,X){let Q=v2(W.parse),J=y2(Q,"canParse",Z),G=J.length>0?J:Q;g2(G);try{let z=await h2(G,"parse",Z,X);if(!z.plugin.allowEmpty&&eX(z.result))throw SyntaxError(`Error parsing "${Z.url}" as ${z.plugin.name}.
|
|
21
|
+
Parsed value is empty`);else return z}catch(z){if(!z&&W.continueOnError)throw new E4(Z.url);else if(z&&z.message&&z.message.startsWith("Error parsing"))throw z;else if(!z||!("error"in z))throw SyntaxError(`Unable to parse ${Z.url}`,{cause:z});else if(z.error instanceof l0)throw z.error;else throw new l0(z.error.message,Z.url)}}function eX(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 v4;var f2=c(()=>{S0();i1();p0();v4=sX});var c8;var l8=c(()=>{p0();c8={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(Z){let W=Z.data;if(Buffer.isBuffer(W))W=W.toString();if(typeof W==="string")if(W.trim().length===0)return;else try{return JSON.parse(W)}catch(X){if(this.allowBOM)try{let Q=W.indexOf("{");return W=W.slice(Q),JSON.parse(W)}catch(Q){throw new l0(Q.message,Z.url)}throw new l0(X.message,Z.url)}else return W}}});var ZQ,p8,WQ,XQ,QQ,JQ,z0=(Z,W)=>()=>(W||(Z((W={exports:{}}).exports,W),Z=null),W.exports),GQ=(Z,W,X,Q)=>{if(W&&typeof W==="object"||typeof W==="function"){for(var J=XQ(W),G=0,z=J.length,q;G<z;G++)if(q=J[G],!JQ.call(Z,q)&&q!==X)p8(Z,q,{get:((K)=>W[K]).bind(null,q),enumerable:!(Q=WQ(W,q))||Q.enumerable})}return Z},zQ=(Z,W,X)=>(X=Z!=null?ZQ(QQ(Z)):{},GQ(W||!Z||!Z.__esModule?p8(X,"default",{value:Z,enumerable:!0}):X,Z)),u6,d6,YQ,O0,n8,i8,r8,a8,s8,o8,t8,e8,Z5,W5,X5,Q5,J5,G5,z5,Y5,U5,m2,UQ,qQ,q5,QB,JB,GB,K5,zB,YB,UB,qB,KB,VB,BB,HB,$B,FB,u2;var d2=c(()=>{/*! js-yaml 4.2.0 https://github.com/nodeca/js-yaml @license MIT */ZQ=Object.create,p8=Object.defineProperty,WQ=Object.getOwnPropertyDescriptor,XQ=Object.getOwnPropertyNames,QQ=Object.getPrototypeOf,JQ=Object.prototype.hasOwnProperty,u6=z0((Z,W)=>{function X(K){return typeof K>"u"||K===null}function Q(K){return typeof K==="object"&&K!==null}function J(K){if(Array.isArray(K))return K;else if(X(K))return[];return[K]}function G(K,V){if(V){let H=Object.keys(V);for(let B=0,$=H.length;B<$;B+=1){let L=H[B];K[L]=V[L]}}return K}function z(K,V){let H="";for(let B=0;B<V;B+=1)H+=K;return H}function q(K){return K===0&&Number.NEGATIVE_INFINITY===1/K}W.exports.isNothing=X,W.exports.isObject=Q,W.exports.toArray=J,W.exports.repeat=z,W.exports.isNegativeZero=q,W.exports.extend=G}),d6=z0((Z,W)=>{function X(J,G){let z="",q=J.reason||"(unknown reason)";if(!J.mark)return q;if(J.mark.name)z+='in "'+J.mark.name+'" ';if(z+="("+(J.mark.line+1)+":"+(J.mark.column+1)+")",!G&&J.mark.snippet)z+=`
|
|
22
22
|
|
|
23
|
-
`+J.mark.snippet;return q+" "+z}function Q(J,G){if(Error.call(this),this.name="YAMLException",this.reason=J,this.mark=G,this.message=X(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}Q.prototype=Object.create(Error.prototype),Q.prototype.constructor=Q,Q.prototype.toString=function(G){return this.name+": "+X(this,G)},W.exports=Q}),
|
|
23
|
+
`+J.mark.snippet;return q+" "+z}function Q(J,G){if(Error.call(this),this.name="YAMLException",this.reason=J,this.mark=G,this.message=X(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}Q.prototype=Object.create(Error.prototype),Q.prototype.constructor=Q,Q.prototype.toString=function(G){return this.name+": "+X(this,G)},W.exports=Q}),YQ=z0((Z,W)=>{var X=u6();function Q(z,q,K,V,H){let B="",$="",L=Math.floor(H/2)-1;if(V-q>L)B=" ... ",q=V-L+B.length;if(K-V>L)$=" ...",K=V+L-$.length;return{str:B+z.slice(q,K).replace(/\t/g,"→")+$,pos:V-q+B.length}}function J(z,q){return X.repeat(" ",q-z.length)+z}function G(z,q){if(q=Object.create(q||null),!z.buffer)return null;if(!q.maxLength)q.maxLength=79;if(typeof q.indent!=="number")q.indent=1;if(typeof q.linesBefore!=="number")q.linesBefore=3;if(typeof q.linesAfter!=="number")q.linesAfter=2;let K=/\r?\n|\r|\0/g,V=[0],H=[],B,$=-1;while(B=K.exec(z.buffer))if(H.push(B.index),V.push(B.index+B[0].length),z.position<=B.index&&$<0)$=V.length-2;if($<0)$=V.length-1;let L="",A=Math.min(z.line+q.linesAfter,H.length).toString().length,j=q.maxLength-(q.indent+A+3);for(let R=1;R<=q.linesBefore;R++){if($-R<0)break;let x=Q(z.buffer,V[$-R],H[$-R],z.position-(V[$]-V[$-R]),j);L=X.repeat(" ",q.indent)+J((z.line-R+1).toString(),A)+" | "+x.str+`
|
|
24
24
|
`+L}let D=Q(z.buffer,V[$],H[$],z.position,j);L+=X.repeat(" ",q.indent)+J((z.line+1).toString(),A)+" | "+D.str+`
|
|
25
25
|
`,L+=X.repeat("-",q.indent+A+3+D.pos)+`^
|
|
26
26
|
`;for(let R=1;R<=q.linesAfter;R++){if($+R>=H.length)break;let x=Q(z.buffer,V[$+R],H[$+R],z.position-(V[$]-V[$+R]),j);L+=X.repeat(" ",q.indent)+J((z.line+R+1).toString(),A)+" | "+x.str+`
|
|
27
|
-
`}return L.replace(/\n$/,"")}W.exports=G}),O0=
|
|
28
|
-
\r`;function J(K){if(K===null)return!1;let V=0,H=K.length,B=Q;for(let $=0;$<H;$++){let L=B.indexOf(K.charAt($));if(L>64)continue;if(L<0)return!1;V+=6}return V%8===0}function G(K){let V=K.replace(/[\r\n=]/g,""),H=V.length,B=Q,$=0,L=[];for(let j=0;j<H;j++){if(j%4===0&&j)L.push($>>16&255),L.push($>>8&255),L.push($&255);$=$<<6|B.indexOf(V.charAt(j))}let A=H%4*6;if(A===0)L.push($>>16&255),L.push($>>8&255),L.push($&255);else if(A===18)L.push($>>10&255),L.push($>>2&255);else if(A===12)L.push($>>4&255);return new Uint8Array(L)}function z(K){let V="",H=0,B=K.length,$=Q;for(let A=0;A<B;A++){if(A%3===0&&A)V+=$[H>>18&63],V+=$[H>>12&63],V+=$[H>>6&63],V+=$[H&63];H=(H<<8)+K[A]}let L=B%3;if(L===0)V+=$[H>>18&63],V+=$[H>>12&63],V+=$[H>>6&63],V+=$[H&63];else if(L===2)V+=$[H>>10&63],V+=$[H>>4&63],V+=$[H<<2&63],V+=$[64];else if(L===1)V+=$[H>>2&63],V+=$[H<<4&63],V+=$[64],V+=$[64];return V}function q(K){return Object.prototype.toString.call(K)==="[object Uint8Array]"}W.exports=new X("tag:yaml.org,2002:binary",{kind:"scalar",resolve:J,construct:G,predicate:q,represent:z})}),
|
|
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 Q0(U){if(U<=65535)return String.fromCharCode(U);return String.fromCharCode((U-65536>>10)+55296,(U-65536&1023)+56320)}function U0(U,
|
|
30
|
-
`,
|
|
31
|
-
`,w?1+
|
|
27
|
+
`}return L.replace(/\n$/,"")}W.exports=G}),O0=z0((Z,W)=>{var X=d6(),Q=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],J=["scalar","sequence","mapping"];function G(q){let K={};if(q!==null)Object.keys(q).forEach(function(V){q[V].forEach(function(H){K[String(H)]=V})});return K}function z(q,K){if(K=K||{},Object.keys(K).forEach(function(V){if(Q.indexOf(V)===-1)throw new X('Unknown option "'+V+'" is met in definition of "'+q+'" YAML type.')}),this.options=K,this.tag=q,this.kind=K.kind||null,this.resolve=K.resolve||function(){return!0},this.construct=K.construct||function(V){return V},this.instanceOf=K.instanceOf||null,this.predicate=K.predicate||null,this.represent=K.represent||null,this.representName=K.representName||null,this.defaultStyle=K.defaultStyle||null,this.multi=K.multi||!1,this.styleAliases=G(K.styleAliases||null),J.indexOf(this.kind)===-1)throw new X('Unknown kind "'+this.kind+'" is specified for "'+q+'" YAML type.')}W.exports=z}),n8=z0((Z,W)=>{var X=d6(),Q=O0();function J(q,K){let V=[];return q[K].forEach(function(H){let B=V.length;V.forEach(function($,L){if($.tag===H.tag&&$.kind===H.kind&&$.multi===H.multi)B=L}),V[B]=H}),V}function G(){let q={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function K(V){if(V.multi)q.multi[V.kind].push(V),q.multi.fallback.push(V);else q[V.kind][V.tag]=q.fallback[V.tag]=V}for(let V=0,H=arguments.length;V<H;V+=1)arguments[V].forEach(K);return q}function z(q){return this.extend(q)}z.prototype.extend=function(K){let V=[],H=[];if(K instanceof Q)H.push(K);else if(Array.isArray(K))H=H.concat(K);else if(K&&(Array.isArray(K.implicit)||Array.isArray(K.explicit))){if(K.implicit)V=V.concat(K.implicit);if(K.explicit)H=H.concat(K.explicit)}else throw new X("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");V.forEach(function($){if(!($ instanceof Q))throw new X("Specified list of YAML types (or a single Type object) contains a non-Type object.");if($.loadKind&&$.loadKind!=="scalar")throw new X("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if($.multi)throw new X("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),H.forEach(function($){if(!($ instanceof Q))throw new X("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let B=Object.create(z.prototype);return B.implicit=(this.implicit||[]).concat(V),B.explicit=(this.explicit||[]).concat(H),B.compiledImplicit=J(B,"implicit"),B.compiledExplicit=J(B,"explicit"),B.compiledTypeMap=G(B.compiledImplicit,B.compiledExplicit),B},W.exports=z}),i8=z0((Z,W)=>{W.exports=new(O0())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(X){return X!==null?X:""}})}),r8=z0((Z,W)=>{W.exports=new(O0())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(X){return X!==null?X:[]}})}),a8=z0((Z,W)=>{W.exports=new(O0())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(X){return X!==null?X:{}}})}),s8=z0((Z,W)=>{W.exports=new(n8())({explicit:[i8(),r8(),a8()]})}),o8=z0((Z,W)=>{var X=O0();function Q(z){if(z===null)return!0;let q=z.length;return q===1&&z==="~"||q===4&&(z==="null"||z==="Null"||z==="NULL")}function J(){return null}function G(z){return z===null}W.exports=new X("tag:yaml.org,2002:null",{kind:"scalar",resolve:Q,construct:J,predicate:G,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})}),t8=z0((Z,W)=>{var X=O0();function Q(z){if(z===null)return!1;let q=z.length;return q===4&&(z==="true"||z==="True"||z==="TRUE")||q===5&&(z==="false"||z==="False"||z==="FALSE")}function J(z){return z==="true"||z==="True"||z==="TRUE"}function G(z){return Object.prototype.toString.call(z)==="[object Boolean]"}W.exports=new X("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Q,construct:J,predicate:G,represent:{lowercase:function(z){return z?"true":"false"},uppercase:function(z){return z?"TRUE":"FALSE"},camelcase:function(z){return z?"True":"False"}},defaultStyle:"lowercase"})}),e8=z0((Z,W)=>{var X=u6(),Q=O0();function J(B){return B>=48&&B<=57||B>=65&&B<=70||B>=97&&B<=102}function G(B){return B>=48&&B<=55}function z(B){return B>=48&&B<=57}function q(B){if(B===null)return!1;let $=B.length,L=0,A=!1;if(!$)return!1;let j=B[L];if(j==="-"||j==="+")j=B[++L];if(j==="0"){if(L+1===$)return!0;if(j=B[++L],j==="b"){L++;for(;L<$;L++){if(j=B[L],j!=="0"&&j!=="1")return!1;A=!0}return A&&Number.isFinite(K(B))}if(j==="x"){L++;for(;L<$;L++){if(!J(B.charCodeAt(L)))return!1;A=!0}return A&&Number.isFinite(K(B))}if(j==="o"){L++;for(;L<$;L++){if(!G(B.charCodeAt(L)))return!1;A=!0}return A&&Number.isFinite(K(B))}}for(;L<$;L++){if(!z(B.charCodeAt(L)))return!1;A=!0}if(!A)return!1;return Number.isFinite(K(B))}function K(B){let $=B,L=1,A=$[0];if(A==="-"||A==="+"){if(A==="-")L=-1;$=$.slice(1),A=$[0]}if($==="0")return 0;if(A==="0"){if($[1]==="b")return L*parseInt($.slice(2),2);if($[1]==="x")return L*parseInt($.slice(2),16);if($[1]==="o")return L*parseInt($.slice(2),8)}return L*parseInt($,10)}function V(B){return K(B)}function H(B){return Object.prototype.toString.call(B)==="[object Number]"&&B%1===0&&!X.isNegativeZero(B)}W.exports=new Q("tag:yaml.org,2002:int",{kind:"scalar",resolve:q,construct:V,predicate:H,represent:{binary:function(B){return B>=0?"0b"+B.toString(2):"-0b"+B.toString(2).slice(1)},octal:function(B){return B>=0?"0o"+B.toString(8):"-0o"+B.toString(8).slice(1)},decimal:function(B){return B.toString(10)},hexadecimal:function(B){return B>=0?"0x"+B.toString(16).toUpperCase():"-0x"+B.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})}),Z5=z0((Z,W)=>{var X=u6(),Q=O0(),J=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),G=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function z(B){if(B===null)return!1;if(!J.test(B))return!1;if(Number.isFinite(parseFloat(B,10)))return!0;return G.test(B)}function q(B){let $=B.toLowerCase(),L=$[0]==="-"?-1:1;if("+-".indexOf($[0])>=0)$=$.slice(1);if($===".inf")return L===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if($===".nan")return NaN;return L*parseFloat($,10)}var K=/^[-+]?[0-9]+e/;function V(B,$){if(isNaN(B))switch($){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===B)switch($){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===B)switch($){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(X.isNegativeZero(B))return"-0.0";let L=B.toString(10);return K.test(L)?L.replace("e",".e"):L}function H(B){return Object.prototype.toString.call(B)==="[object Number]"&&(B%1!==0||X.isNegativeZero(B))}W.exports=new Q("tag:yaml.org,2002:float",{kind:"scalar",resolve:z,construct:q,predicate:H,represent:V,defaultStyle:"lowercase"})}),W5=z0((Z,W)=>{W.exports=s8().extend({implicit:[o8(),t8(),e8(),Z5()]})}),X5=z0((Z,W)=>{W.exports=W5()}),Q5=z0((Z,W)=>{var X=O0(),Q=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),J=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 G(K){if(K===null)return!1;if(Q.exec(K)!==null)return!0;if(J.exec(K)!==null)return!0;return!1}function z(K){let V=0,H=null,B=Q.exec(K);if(B===null)B=J.exec(K);if(B===null)throw Error("Date resolve error");let $=+B[1],L=+B[2]-1,A=+B[3];if(!B[4])return new Date(Date.UTC($,L,A));let j=+B[4],D=+B[5],R=+B[6];if(B[7]){V=B[7].slice(0,3);while(V.length<3)V+="0";V=+V}if(B[9]){let d=+B[10],m=+(B[11]||0);if(H=(d*60+m)*60000,B[9]==="-")H=-H}let x=new Date(Date.UTC($,L,A,j,D,R,V));if(H)x.setTime(x.getTime()-H);return x}function q(K){return K.toISOString()}W.exports=new X("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:G,construct:z,instanceOf:Date,represent:q})}),J5=z0((Z,W)=>{var X=O0();function Q(J){return J==="<<"||J===null}W.exports=new X("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Q})}),G5=z0((Z,W)=>{var X=O0(),Q=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
28
|
+
\r`;function J(K){if(K===null)return!1;let V=0,H=K.length,B=Q;for(let $=0;$<H;$++){let L=B.indexOf(K.charAt($));if(L>64)continue;if(L<0)return!1;V+=6}return V%8===0}function G(K){let V=K.replace(/[\r\n=]/g,""),H=V.length,B=Q,$=0,L=[];for(let j=0;j<H;j++){if(j%4===0&&j)L.push($>>16&255),L.push($>>8&255),L.push($&255);$=$<<6|B.indexOf(V.charAt(j))}let A=H%4*6;if(A===0)L.push($>>16&255),L.push($>>8&255),L.push($&255);else if(A===18)L.push($>>10&255),L.push($>>2&255);else if(A===12)L.push($>>4&255);return new Uint8Array(L)}function z(K){let V="",H=0,B=K.length,$=Q;for(let A=0;A<B;A++){if(A%3===0&&A)V+=$[H>>18&63],V+=$[H>>12&63],V+=$[H>>6&63],V+=$[H&63];H=(H<<8)+K[A]}let L=B%3;if(L===0)V+=$[H>>18&63],V+=$[H>>12&63],V+=$[H>>6&63],V+=$[H&63];else if(L===2)V+=$[H>>10&63],V+=$[H>>4&63],V+=$[H<<2&63],V+=$[64];else if(L===1)V+=$[H>>2&63],V+=$[H<<4&63],V+=$[64],V+=$[64];return V}function q(K){return Object.prototype.toString.call(K)==="[object Uint8Array]"}W.exports=new X("tag:yaml.org,2002:binary",{kind:"scalar",resolve:J,construct:G,predicate:q,represent:z})}),z5=z0((Z,W)=>{var X=O0(),Q=Object.prototype.hasOwnProperty,J=Object.prototype.toString;function G(q){if(q===null)return!0;let K=[],V=q;for(let H=0,B=V.length;H<B;H+=1){let $=V[H],L=!1;if(J.call($)!=="[object Object]")return!1;let A;for(A in $)if(Q.call($,A))if(!L)L=!0;else return!1;if(!L)return!1;if(K.indexOf(A)===-1)K.push(A);else return!1}return!0}function z(q){return q!==null?q:[]}W.exports=new X("tag:yaml.org,2002:omap",{kind:"sequence",resolve:G,construct:z})}),Y5=z0((Z,W)=>{var X=O0(),Q=Object.prototype.toString;function J(z){if(z===null)return!0;let q=z,K=Array(q.length);for(let V=0,H=q.length;V<H;V+=1){let B=q[V];if(Q.call(B)!=="[object Object]")return!1;let $=Object.keys(B);if($.length!==1)return!1;K[V]=[$[0],B[$[0]]]}return!0}function G(z){if(z===null)return[];let q=z,K=Array(q.length);for(let V=0,H=q.length;V<H;V+=1){let B=q[V],$=Object.keys(B);K[V]=[$[0],B[$[0]]]}return K}W.exports=new X("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:J,construct:G})}),U5=z0((Z,W)=>{var X=O0(),Q=Object.prototype.hasOwnProperty;function J(z){if(z===null)return!0;let q=z;for(let K in q)if(Q.call(q,K)){if(q[K]!==null)return!1}return!0}function G(z){return z!==null?z:{}}W.exports=new X("tag:yaml.org,2002:set",{kind:"mapping",resolve:J,construct:G})}),m2=z0((Z,W)=>{W.exports=X5().extend({implicit:[Q5(),J5()],explicit:[G5(),z5(),Y5(),U5()]})}),UQ=z0((Z,W)=>{var X=u6(),Q=d6(),J=YQ(),G=m2(),z=Object.prototype.hasOwnProperty,q=1,K=2,V=3,H=4,B=1,$=2,L=3,A=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,j=/[\x85\u2028\u2029]/,D=/[,\[\]{}]/,R=/^(?:!|!!|![0-9A-Za-z-]+!)$/,x=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function d(U){return Object.prototype.toString.call(U)}function m(U){return U===10||U===13}function r(U){return U===9||U===32}function f(U){return U===9||U===32||U===10||U===13}function S(U){return U===44||U===91||U===93||U===123||U===125}function l(U){if(U>=48&&U<=57)return U-48;let I=U|32;if(I>=97&&I<=102)return I-97+10;return-1}function o(U){if(U===120)return 2;if(U===117)return 4;if(U===85)return 8;return 0}function W0(U){if(U>=48&&U<=57)return U-48;return-1}function X0(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 Q0(U){if(U<=65535)return String.fromCharCode(U);return String.fromCharCode((U-65536>>10)+55296,(U-65536&1023)+56320)}function U0(U,I,N){if(I==="__proto__")Object.defineProperty(U,I,{configurable:!0,enumerable:!0,writable:!0,value:N});else U[I]=N}var J0=Array(256),L0=Array(256);for(let U=0;U<256;U++)J0[U]=X0(U)?1:0,L0[U]=X0(U);function K0(U,I){this.input=U,this.filename=I.filename||null,this.schema=I.schema||G,this.onWarning=I.onWarning||null,this.legacy=I.legacy||!1,this.json=I.json||!1,this.listener=I.listener||null,this.maxDepth=typeof I.maxDepth==="number"?I.maxDepth:100,this.maxMergeSeqLength=typeof I.maxMergeSeqLength==="number"?I.maxMergeSeqLength:20,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.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function U4(U,I){let N={name:U.filename,buffer:U.input.slice(0,-1),position:U.position,line:U.line,column:U.position-U.lineStart};return N.snippet=J(N),new Q(I,N)}function u(U,I){throw U4(U,I)}function e1(U,I){if(U.onWarning)U.onWarning.call(null,U4(U,I))}function V1(U,I,N){let _=U.anchorMapTransactions;if(_.length!==0){let w=_[_.length-1];if(!z.call(w,I))w[I]={existed:z.call(U.anchorMap,I),value:U.anchorMap[I]}}U.anchorMap[I]=N}function $2(U){U.anchorMapTransactions.push(Object.create(null))}function c1(U){let I=U.anchorMapTransactions.pop(),N=U.anchorMapTransactions;if(N.length===0)return;let _=N[N.length-1],w=Object.keys(I);for(let k=0,F=w.length;k<F;k+=1){let M=w[k];if(!z.call(_,M))_[M]=I[M]}}function F2(U){let I=U.anchorMapTransactions.pop(),N=Object.keys(I);for(let _=N.length-1;_>=0;_-=1){let w=I[N[_]];if(w.existed)U.anchorMap[N[_]]=w.value;else delete U.anchorMap[N[_]]}}function x6(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 Z6(U,I){U.position=I.position,U.line=I.line,U.lineStart=I.lineStart,U.lineIndent=I.lineIndent,U.firstTabInLine=I.firstTabInLine,U.tag=I.tag,U.anchor=I.anchor,U.kind=I.kind,U.result=I.result}var q4={YAML:function(I,N,_){if(I.version!==null)u(I,"duplication of %YAML directive");if(_.length!==1)u(I,"YAML directive accepts exactly one argument");let w=/^([0-9]+)\.([0-9]+)$/.exec(_[0]);if(w===null)u(I,"ill-formed argument of the YAML directive");let k=parseInt(w[1],10),F=parseInt(w[2],10);if(k!==1)u(I,"unacceptable YAML version of the document");if(I.version=_[0],I.checkLineBreaks=F<2,F!==1&&F!==2)e1(I,"unsupported YAML version of the document")},TAG:function(I,N,_){let w;if(_.length!==2)u(I,"TAG directive accepts exactly two arguments");let k=_[0];if(w=_[1],!R.test(k))u(I,"ill-formed tag handle (first argument) of the TAG directive");if(z.call(I.tagMap,k))u(I,'there is a previously declared suffix for "'+k+'" tag handle');if(!x.test(w))u(I,"ill-formed tag prefix (second argument) of the TAG directive");try{w=decodeURIComponent(w)}catch(F){u(I,"tag prefix is malformed: "+w)}I.tagMap[k]=w}};function y0(U,I,N,_){if(I<N){let w=U.input.slice(I,N);if(_)for(let k=0,F=w.length;k<F;k+=1){let M=w.charCodeAt(k);if(!(M===9||M>=32&&M<=1114111))u(U,"expected valid JSON character")}else if(A.test(w))u(U,"the stream contains non-printable characters");U.result+=w}}function j1(U,I,N,_){if(!X.isObject(N))u(U,"cannot merge mappings; the provided source object is unacceptable");let w=Object.keys(N);for(let k=0,F=w.length;k<F;k+=1){let M=w[k];if(!z.call(I,M))U0(I,M,N[M]),_[M]=!0}}function B1(U,I,N,_,w,k,F,M,O){if(Array.isArray(w)){w=Array.prototype.slice.call(w);for(let T=0,P=w.length;T<P;T+=1){if(Array.isArray(w[T]))u(U,"nested arrays are not supported inside keys");if(typeof w==="object"&&d(w[T])==="[object Object]")w[T]="[object Object]"}}if(typeof w==="object"&&d(w)==="[object Object]")w="[object Object]";if(w=String(w),I===null)I={};if(_==="tag:yaml.org,2002:merge")if(Array.isArray(k)){if(k.length>U.maxMergeSeqLength)u(U,"merge sequence length exceeded maxMergeSeqLength ("+U.maxMergeSeqLength+")");let T=new Set;for(let P=0,C=k.length;P<C;P+=1){let E=k[P];if(T.has(E))continue;T.add(E),j1(U,I,E,N)}}else j1(U,I,k,N);else{if(!U.json&&!z.call(N,w)&&z.call(I,w))U.line=F||U.line,U.lineStart=M||U.lineStart,U.position=O||U.position,u(U,"duplicated mapping key");U0(I,w,k),delete N[w]}return I}function W6(U){let I=U.input.charCodeAt(U.position);if(I===10)U.position++;else if(I===13){if(U.position++,U.input.charCodeAt(U.position)===10)U.position++}else u(U,"a line break is expected");U.line+=1,U.lineStart=U.position,U.firstTabInLine=-1}function V0(U,I,N){let _=0,w=U.input.charCodeAt(U.position);while(w!==0){while(r(w)){if(w===9&&U.firstTabInLine===-1)U.firstTabInLine=U.position;w=U.input.charCodeAt(++U.position)}if(I&&w===35)do w=U.input.charCodeAt(++U.position);while(w!==10&&w!==13&&w!==0);if(m(w)){W6(U),w=U.input.charCodeAt(U.position),_++,U.lineIndent=0;while(w===32)U.lineIndent++,w=U.input.charCodeAt(++U.position)}else break}if(N!==-1&&_!==0&&U.lineIndent<N)e1(U,"deficient indentation");return _}function X6(U){let I=U.position,N=U.input.charCodeAt(I);if((N===45||N===46)&&N===U.input.charCodeAt(I+1)&&N===U.input.charCodeAt(I+2)){if(I+=3,N=U.input.charCodeAt(I),N===0||f(N))return!0}return!1}function H1(U,I){if(I===1)U.result+=" ";else if(I>1)U.result+=X.repeat(`
|
|
30
|
+
`,I-1)}function K4(U,I,N){let _,w,k,F,M,O,T=U.kind,P=U.result,C=U.input.charCodeAt(U.position);if(f(C)||S(C)||C===35||C===38||C===42||C===33||C===124||C===62||C===39||C===34||C===37||C===64||C===96)return!1;if(C===63||C===45){let E=U.input.charCodeAt(U.position+1);if(f(E)||N&&S(E))return!1}U.kind="scalar",U.result="",_=w=U.position,k=!1;while(C!==0){if(C===58){let E=U.input.charCodeAt(U.position+1);if(f(E)||N&&S(E))break}else if(C===35){if(f(U.input.charCodeAt(U.position-1)))break}else if(U.position===U.lineStart&&X6(U)||N&&S(C))break;else if(m(C))if(F=U.line,M=U.lineStart,O=U.lineIndent,V0(U,!1,-1),U.lineIndent>=I){k=!0,C=U.input.charCodeAt(U.position);continue}else{U.position=w,U.line=F,U.lineStart=M,U.lineIndent=O;break}if(k)y0(U,_,w,!1),H1(U,U.line-F),_=w=U.position,k=!1;if(!r(C))w=U.position+1;C=U.input.charCodeAt(++U.position)}if(y0(U,_,w,!1),U.result)return!0;return U.kind=T,U.result=P,!1}function V4(U,I){let N,_,w=U.input.charCodeAt(U.position);if(w!==39)return!1;U.kind="scalar",U.result="",U.position++,N=_=U.position;while((w=U.input.charCodeAt(U.position))!==0)if(w===39)if(y0(U,N,U.position,!0),w=U.input.charCodeAt(++U.position),w===39)N=U.position,U.position++,_=U.position;else return!0;else if(m(w))y0(U,N,_,!0),H1(U,V0(U,!1,I)),N=_=U.position;else if(U.position===U.lineStart&&X6(U))u(U,"unexpected end of the document within a single quoted scalar");else if(U.position++,!r(w))_=U.position;u(U,"unexpected end of the stream within a single quoted scalar")}function k6(U,I){let N,_,w,k=U.input.charCodeAt(U.position);if(k!==34)return!1;U.kind="scalar",U.result="",U.position++,N=_=U.position;while((k=U.input.charCodeAt(U.position))!==0)if(k===34)return y0(U,N,U.position,!0),U.position++,!0;else if(k===92){if(y0(U,N,U.position,!0),k=U.input.charCodeAt(++U.position),m(k))V0(U,!1,I);else if(k<256&&J0[k])U.result+=L0[k],U.position++;else if((w=o(k))>0){let F=w,M=0;for(;F>0;F--)if(k=U.input.charCodeAt(++U.position),(w=l(k))>=0)M=(M<<4)+w;else u(U,"expected hexadecimal character");U.result+=Q0(M),U.position++}else u(U,"unknown escape sequence");N=_=U.position}else if(m(k))y0(U,N,_,!0),H1(U,V0(U,!1,I)),N=_=U.position;else if(U.position===U.lineStart&&X6(U))u(U,"unexpected end of the document within a double quoted scalar");else if(U.position++,!r(k))_=U.position;u(U,"unexpected end of the stream within a double quoted scalar")}function B4(U,I){let N=!0,_,w,k,F=U.tag,M,O=U.anchor,T,P,C,E,h=Object.create(null),b,p,n,t=U.input.charCodeAt(U.position);if(t===91)T=93,E=!1,M=[];else if(t===123)T=125,E=!0,M={};else return!1;if(U.anchor!==null)V1(U,U.anchor,M);t=U.input.charCodeAt(++U.position);while(t!==0){if(V0(U,!0,I),t=U.input.charCodeAt(U.position),t===T)return U.position++,U.tag=F,U.anchor=O,U.kind=E?"mapping":"sequence",U.result=M,!0;else if(!N)u(U,"missed comma between flow collection entries");else if(t===44)u(U,"expected the node content, but found ','");if(p=b=n=null,P=C=!1,t===63){if(f(U.input.charCodeAt(U.position+1)))P=C=!0,U.position++,V0(U,!0,I)}if(_=U.line,w=U.lineStart,k=U.position,F1(U,I,q,!1,!0),p=U.tag,b=U.result,V0(U,!0,I),t=U.input.charCodeAt(U.position),(C||U.line===_)&&t===58)P=!0,t=U.input.charCodeAt(++U.position),V0(U,!0,I),F1(U,I,q,!1,!0),n=U.result;if(E)B1(U,M,h,p,b,n,_,w,k);else if(P)M.push(B1(U,null,h,p,b,n,_,w,k));else M.push(b);if(V0(U,!0,I),t=U.input.charCodeAt(U.position),t===44)N=!0,t=U.input.charCodeAt(++U.position);else N=!1}u(U,"unexpected end of the stream within a flow collection")}function H4(U,I){let N,_=B,w=!1,k=!1,F=I,M=0,O=!1,T,P=U.input.charCodeAt(U.position);if(P===124)N=!1;else if(P===62)N=!0;else return!1;U.kind="scalar",U.result="";while(P!==0)if(P=U.input.charCodeAt(++U.position),P===43||P===45)if(B===_)_=P===43?L:$;else u(U,"repeat of a chomping mode identifier");else if((T=W0(P))>=0)if(T===0)u(U,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!k)F=I+T-1,k=!0;else u(U,"repeat of an indentation width identifier");else break;if(r(P)){do P=U.input.charCodeAt(++U.position);while(r(P));if(P===35)do P=U.input.charCodeAt(++U.position);while(!m(P)&&P!==0)}while(P!==0){W6(U),U.lineIndent=0,P=U.input.charCodeAt(U.position);while((!k||U.lineIndent<F)&&P===32)U.lineIndent++,P=U.input.charCodeAt(++U.position);if(!k&&U.lineIndent>F)F=U.lineIndent;if(m(P)){M++;continue}if(!k&&F===0)u(U,"missing indentation for block scalar");if(U.lineIndent<F){if(_===L)U.result+=X.repeat(`
|
|
31
|
+
`,w?1+M:M);else if(_===B){if(w)U.result+=`
|
|
32
32
|
`}break}if(N)if(r(P))O=!0,U.result+=X.repeat(`
|
|
33
|
-
`,w?1+
|
|
34
|
-
`,
|
|
35
|
-
`,
|
|
36
|
-
`,w?1+
|
|
37
|
-
`;if(U.charCodeAt(0)===65279)U=U.slice(1)}let N=new K0(U,
|
|
33
|
+
`,w?1+M:M);else if(O)O=!1,U.result+=X.repeat(`
|
|
34
|
+
`,M+1);else if(M===0){if(w)U.result+=" "}else U.result+=X.repeat(`
|
|
35
|
+
`,M);else U.result+=X.repeat(`
|
|
36
|
+
`,w?1+M:M);w=!0,k=!0,M=0;let C=U.position;while(!m(P)&&P!==0)P=U.input.charCodeAt(++U.position);y0(U,C,U.position,!1)}return!0}function $1(U,I){let{tag:N,anchor:_}=U,w=[],k=!1;if(U.firstTabInLine!==-1)return!1;if(U.anchor!==null)V1(U,U.anchor,w);let F=U.input.charCodeAt(U.position);while(F!==0){if(U.firstTabInLine!==-1)U.position=U.firstTabInLine,u(U,"tab characters must not be used in indentation");if(F!==45)break;if(!f(U.input.charCodeAt(U.position+1)))break;if(k=!0,U.position++,V0(U,!0,-1)){if(U.lineIndent<=I){w.push(null),F=U.input.charCodeAt(U.position);continue}}let M=U.line;if(F1(U,I,V,!1,!0),w.push(U.result),V0(U,!0,-1),F=U.input.charCodeAt(U.position),(U.line===M||U.lineIndent>I)&&F!==0)u(U,"bad indentation of a sequence entry");else if(U.lineIndent<I)break}if(k)return U.tag=N,U.anchor=_,U.kind="sequence",U.result=w,!0;return!1}function $4(U,I,N){let _,w,k,F,M=U.tag,O=U.anchor,T={},P=Object.create(null),C=null,E=null,h=null,b=!1,p=!1;if(U.firstTabInLine!==-1)return!1;if(U.anchor!==null)V1(U,U.anchor,T);let n=U.input.charCodeAt(U.position);while(n!==0){if(!b&&U.firstTabInLine!==-1)U.position=U.firstTabInLine,u(U,"tab characters must not be used in indentation");let t=U.input.charCodeAt(U.position+1),q0=U.line;if((n===63||n===58)&&f(t)){if(n===63){if(b)B1(U,T,P,C,E,null,w,k,F),C=E=h=null;p=!0,b=!0,_=!0}else if(b)b=!1,_=!0;else u(U,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");U.position+=1,n=t}else{if(w=U.line,k=U.lineStart,F=U.position,!F1(U,N,K,!1,!0))break;if(U.line===q0){n=U.input.charCodeAt(U.position);while(r(n))n=U.input.charCodeAt(++U.position);if(n===58){if(n=U.input.charCodeAt(++U.position),!f(n))u(U,"a whitespace character is expected after the key-value separator within a block mapping");if(b)B1(U,T,P,C,E,null,w,k,F),C=E=h=null;p=!0,b=!1,_=!1,C=U.tag,E=U.result}else if(p)u(U,"can not read an implicit mapping pair; a colon is missed");else return U.tag=M,U.anchor=O,!0}else if(p)u(U,"can not read a block mapping entry; a multiline key may not be an implicit key");else return U.tag=M,U.anchor=O,!0}if(U.line===q0||U.lineIndent>I){if(b)w=U.line,k=U.lineStart,F=U.position;if(F1(U,I,H,!0,_))if(b)E=U.result;else h=U.result;if(!b)B1(U,T,P,C,E,h,w,k,F),C=E=h=null;V0(U,!0,-1),n=U.input.charCodeAt(U.position)}if((U.line===q0||U.lineIndent>I)&&n!==0)u(U,"bad indentation of a mapping entry");else if(U.lineIndent<I)break}if(b)B1(U,T,P,C,E,null,w,k,F);if(p)U.tag=M,U.anchor=O,U.kind="mapping",U.result=T;return p}function L2(U){let I=!1,N=!1,_,w,k=U.input.charCodeAt(U.position);if(k!==33)return!1;if(U.tag!==null)u(U,"duplication of a tag property");if(k=U.input.charCodeAt(++U.position),k===60)I=!0,k=U.input.charCodeAt(++U.position);else if(k===33)N=!0,_="!!",k=U.input.charCodeAt(++U.position);else _="!";let F=U.position;if(I){do k=U.input.charCodeAt(++U.position);while(k!==0&&k!==62);if(U.position<U.length)w=U.input.slice(F,U.position),k=U.input.charCodeAt(++U.position);else u(U,"unexpected end of the stream within a verbatim tag")}else{while(k!==0&&!f(k)){if(k===33)if(!N){if(_=U.input.slice(F-1,U.position+1),!R.test(_))u(U,"named tag handle cannot contain such characters");N=!0,F=U.position+1}else u(U,"tag suffix cannot contain exclamation marks");k=U.input.charCodeAt(++U.position)}if(w=U.input.slice(F,U.position),D.test(w))u(U,"tag suffix cannot contain flow indicator characters")}if(w&&!x.test(w))u(U,"tag name cannot contain such characters: "+w);try{w=decodeURIComponent(w)}catch(M){u(U,"tag name is malformed: "+w)}if(I)U.tag=w;else if(z.call(U.tagMap,_))U.tag=U.tagMap[_]+w;else if(_==="!")U.tag="!"+w;else if(_==="!!")U.tag="tag:yaml.org,2002:"+w;else u(U,'undeclared tag handle "'+_+'"');return!0}function F4(U){let I=U.input.charCodeAt(U.position);if(I!==38)return!1;if(U.anchor!==null)u(U,"duplication of an anchor property");I=U.input.charCodeAt(++U.position);let N=U.position;while(I!==0&&!f(I)&&!S(I))I=U.input.charCodeAt(++U.position);if(U.position===N)u(U,"name of an anchor node must contain at least one character");return U.anchor=U.input.slice(N,U.position),!0}function L4(U){let I=U.input.charCodeAt(U.position);if(I!==42)return!1;I=U.input.charCodeAt(++U.position);let N=U.position;while(I!==0&&!f(I)&&!S(I))I=U.input.charCodeAt(++U.position);if(U.position===N)u(U,"name of an alias node must contain at least one character");let _=U.input.slice(N,U.position);if(!z.call(U.anchorMap,_))u(U,'unidentified alias "'+_+'"');return U.result=U.anchorMap[_],V0(U,!0,-1),!0}function A2(U,I,N,_){let w=x6(U);if($2(U),Z6(U,I),U.tag=null,U.anchor=null,U.kind=null,U.result=null,$4(U,N,_)&&U.kind==="mapping")return c1(U),!0;return F2(U),Z6(U,w),!1}function F1(U,I,N,_,w){let k,F,M=1,O=!1,T=!1,P=null,C,E,h;if(U.depth>=U.maxDepth)u(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 b=k=F=H===N||V===N;if(_){if(V0(U,!0,-1)){if(O=!0,U.lineIndent>I)M=1;else if(U.lineIndent===I)M=0;else if(U.lineIndent<I)M=-1}}if(M===1)while(!0){let p=U.input.charCodeAt(U.position),n=x6(U);if(O&&(p===33&&U.tag!==null||p===38&&U.anchor!==null))break;if(!L2(U)&&!F4(U))break;if(P===null)P=n;if(V0(U,!0,-1)){if(O=!0,F=b,U.lineIndent>I)M=1;else if(U.lineIndent===I)M=0;else if(U.lineIndent<I)M=-1}else F=!1}if(F)F=O||w;if(M===1||H===N){if(q===N||K===N)E=I;else E=I+1;if(h=U.position-U.lineStart,M===1)if(F&&($1(U,h)||$4(U,h,E))||B4(U,E))T=!0;else{let p=U.input.charCodeAt(U.position);if(P!==null&&b&&!F&&p!==124&&p!==62&&A2(U,P,P.position-P.lineStart,E))T=!0;else if(k&&H4(U,E)||V4(U,E)||k6(U,E))T=!0;else if(L4(U)){if(T=!0,U.tag!==null||U.anchor!==null)u(U,"alias node should not have any properties")}else if(K4(U,E,q===N)){if(T=!0,U.tag===null)U.tag="?"}if(U.anchor!==null)V1(U,U.anchor,U.result)}else if(M===0)T=F&&$1(U,h)}if(U.tag===null){if(U.anchor!==null)V1(U,U.anchor,U.result)}else if(U.tag==="?"){if(U.result!==null&&U.kind!=="scalar")u(U,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+U.kind+'"');for(let p=0,n=U.implicitTypes.length;p<n;p+=1)if(C=U.implicitTypes[p],C.resolve(U.result)){if(U.result=C.construct(U.result),U.tag=C.tag,U.anchor!==null)V1(U,U.anchor,U.result);break}}else if(U.tag!=="!"){if(z.call(U.typeMap[U.kind||"fallback"],U.tag))C=U.typeMap[U.kind||"fallback"][U.tag];else{C=null;let p=U.typeMap.multi[U.kind||"fallback"];for(let n=0,t=p.length;n<t;n+=1)if(U.tag.slice(0,p[n].tag.length)===p[n].tag){C=p[n];break}}if(!C)u(U,"unknown tag !<"+U.tag+">");if(U.result!==null&&C.kind!==U.kind)u(U,"unacceptable node kind for !<"+U.tag+'> tag; it should be "'+C.kind+'", not "'+U.kind+'"');if(!C.resolve(U.result,U.tag))u(U,"cannot resolve a node with !<"+U.tag+"> explicit tag");else if(U.result=C.construct(U.result,U.tag),U.anchor!==null)V1(U,U.anchor,U.result)}if(U.listener!==null)U.listener("close",U);return U.depth-=1,U.tag!==null||U.anchor!==null||T}function I2(U){let I=U.position,N=!1,_;U.version=null,U.checkLineBreaks=U.legacy,U.tagMap=Object.create(null),U.anchorMap=Object.create(null);while((_=U.input.charCodeAt(U.position))!==0){if(V0(U,!0,-1),_=U.input.charCodeAt(U.position),U.lineIndent>0||_!==37)break;N=!0,_=U.input.charCodeAt(++U.position);let w=U.position;while(_!==0&&!f(_))_=U.input.charCodeAt(++U.position);let k=U.input.slice(w,U.position),F=[];if(k.length<1)u(U,"directive name must not be less than one character in length");while(_!==0){while(r(_))_=U.input.charCodeAt(++U.position);if(_===35){do _=U.input.charCodeAt(++U.position);while(_!==0&&!m(_));break}if(m(_))break;w=U.position;while(_!==0&&!f(_))_=U.input.charCodeAt(++U.position);F.push(U.input.slice(w,U.position))}if(_!==0)W6(U);if(z.call(q4,k))q4[k](U,k,F);else e1(U,'unknown document directive "'+k+'"')}if(V0(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,V0(U,!0,-1);else if(N)u(U,"directives end mark is expected");if(F1(U,U.lineIndent-1,H,!1,!0),V0(U,!0,-1),U.checkLineBreaks&&j.test(U.input.slice(I,U.position)))e1(U,"non-ASCII line breaks are interpreted as content");if(U.documents.push(U.result),U.position===U.lineStart&&X6(U)){if(U.input.charCodeAt(U.position)===46)U.position+=3,V0(U,!0,-1);return}if(U.position<U.length-1)u(U,"end of the stream or a document separator is expected")}function A4(U,I){if(U=String(U),I=I||{},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 N=new K0(U,I),_=U.indexOf("\x00");if(_!==-1)N.position=_,u(N,"null byte is not allowed in input");N.input+="\x00";while(N.input.charCodeAt(N.position)===32)N.lineIndent+=1,N.position+=1;while(N.position<N.length-1)I2(N);return N.documents}function I4(U,I,N){if(I!==null&&typeof I==="object"&&typeof N>"u")N=I,I=null;let _=A4(U,N);if(typeof I!=="function")return _;for(let w=0,k=_.length;w<k;w+=1)I(_[w])}function M2(U,I){let N=A4(U,I);if(N.length===0)return;else if(N.length===1)return N[0];throw new Q("expected a single document in the stream, but found more")}W.exports.loadAll=I4,W.exports.load=M2}),qQ=z0((Z,W)=>{var X=u6(),Q=d6(),J=m2(),G=Object.prototype.toString,z=Object.prototype.hasOwnProperty,q=65279,K=9,V=10,H=13,B=32,$=33,L=34,A=35,j=37,D=38,R=39,x=42,d=44,m=45,r=58,f=61,S=62,l=63,o=64,W0=91,X0=93,Q0=96,U0=123,J0=124,L0=125,K0={};K0[0]="\\0",K0[7]="\\a",K0[8]="\\b",K0[9]="\\t",K0[10]="\\n",K0[11]="\\v",K0[12]="\\f",K0[13]="\\r",K0[27]="\\e",K0[34]="\\\"",K0[92]="\\\\",K0[133]="\\N",K0[160]="\\_",K0[8232]="\\L",K0[8233]="\\P";var U4=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],u=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function e1(F,M){if(M===null)return{};let O={},T=Object.keys(M);for(let P=0,C=T.length;P<C;P+=1){let E=T[P],h=String(M[E]);if(E.slice(0,2)==="!!")E="tag:yaml.org,2002:"+E.slice(2);let b=F.compiledTypeMap.fallback[E];if(b&&z.call(b.styleAliases,h))h=b.styleAliases[h];O[E]=h}return O}function V1(F){let M,O,T=F.toString(16).toUpperCase();if(F<=255)M="x",O=2;else if(F<=65535)M="u",O=4;else if(F<=4294967295)M="U",O=8;else throw new Q("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+M+X.repeat("0",O-T.length)+T}var $2=1,c1=2;function F2(F){this.schema=F.schema||J,this.indent=Math.max(1,F.indent||2),this.noArrayIndent=F.noArrayIndent||!1,this.skipInvalid=F.skipInvalid||!1,this.flowLevel=X.isNothing(F.flowLevel)?-1:F.flowLevel,this.styleMap=e1(this.schema,F.styles||null),this.sortKeys=F.sortKeys||!1,this.lineWidth=F.lineWidth||80,this.noRefs=F.noRefs||!1,this.noCompatMode=F.noCompatMode||!1,this.condenseFlow=F.condenseFlow||!1,this.quotingType=F.quotingType==='"'?c1:$2,this.forceQuotes=F.forceQuotes||!1,this.replacer=typeof F.replacer==="function"?F.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function x6(F,M){let O=X.repeat(" ",M),T=0,P="",C=F.length;while(T<C){let E,h=F.indexOf(`
|
|
38
38
|
`,T);if(h===-1)E=F.slice(T),T=C;else E=F.slice(T,h+1),T=h+1;if(E.length&&E!==`
|
|
39
|
-
`)P+=O;P+=E}return P}function Z6(F,
|
|
40
|
-
`+X.repeat(" ",F.indent*
|
|
39
|
+
`)P+=O;P+=E}return P}function Z6(F,M){return`
|
|
40
|
+
`+X.repeat(" ",F.indent*M)}function q4(F,M){for(let O=0,T=F.implicitTypes.length;O<T;O+=1)if(F.implicitTypes[O].resolve(M))return!0;return!1}function y0(F){return F===B||F===K}function j1(F){return F>=32&&F<=126||F>=161&&F<=55295&&F!==8232&&F!==8233||F>=57344&&F<=65533&&F!==q||F>=65536&&F<=1114111}function B1(F){return j1(F)&&F!==q&&F!==H&&F!==V}function W6(F,M,O){let T=B1(F),P=T&&!y0(F);return(O?T:T&&F!==d&&F!==W0&&F!==X0&&F!==U0&&F!==L0)&&F!==A&&!(M===r&&!P)||B1(M)&&!y0(M)&&F===A||M===r&&P}function V0(F){return j1(F)&&F!==q&&!y0(F)&&F!==m&&F!==l&&F!==r&&F!==d&&F!==W0&&F!==X0&&F!==U0&&F!==L0&&F!==A&&F!==D&&F!==x&&F!==$&&F!==J0&&F!==f&&F!==S&&F!==R&&F!==L&&F!==j&&F!==o&&F!==Q0}function X6(F){return!y0(F)&&F!==r}function H1(F,M){let O=F.charCodeAt(M),T;if(O>=55296&&O<=56319&&M+1<F.length){if(T=F.charCodeAt(M+1),T>=56320&&T<=57343)return(O-55296)*1024+T-56320+65536}return O}function K4(F){return/^\n* /.test(F)}var V4=1,k6=2,B4=3,H4=4,$1=5;function $4(F,M,O,T,P,C,E,h){let b,p=0,n=null,t=!1,q0=!1,V8=T!==-1,S6=-1,b6=V0(H1(F,0))&&X6(H1(F,F.length-1));if(M||E)for(b=0;b<F.length;p>=65536?b+=2:b++){if(p=H1(F,b),!j1(p))return $1;b6=b6&&W6(p,n,h),n=p}else{for(b=0;b<F.length;p>=65536?b+=2:b++){if(p=H1(F,b),p===V){if(t=!0,V8)q0=q0||b-S6-1>T&&F[S6+1]!==" ",S6=b}else if(!j1(p))return $1;b6=b6&&W6(p,n,h),n=p}q0=q0||V8&&b-S6-1>T&&F[S6+1]!==" "}if(!t&&!q0){if(b6&&!E&&!P(F))return V4;return C===c1?$1:k6}if(O>9&&K4(F))return $1;if(!E)return q0?H4:B4;return C===c1?$1:k6}function L2(F,M,O,T,P){F.dump=function(){if(M.length===0)return F.quotingType===c1?'""':"''";if(!F.noCompatMode){if(U4.indexOf(M)!==-1||u.test(M))return F.quotingType===c1?'"'+M+'"':"'"+M+"'"}let C=F.indent*Math.max(1,O),E=F.lineWidth===-1?-1:Math.max(Math.min(F.lineWidth,40),F.lineWidth-C),h=T||F.flowLevel>-1&&O>=F.flowLevel;function b(p){return q4(F,p)}switch($4(M,h,F.indent,E,b,F.quotingType,F.forceQuotes&&!T,P)){case V4:return M;case k6:return"'"+M.replace(/'/g,"''")+"'";case B4:return"|"+F4(M,F.indent)+L4(x6(M,C));case H4:return">"+F4(M,F.indent)+L4(x6(A2(M,E),C));case $1:return'"'+I2(M,E)+'"';default:throw new Q("impossible error: invalid scalar style")}}()}function F4(F,M){let O=K4(F)?String(M):"",T=F[F.length-1]===`
|
|
41
41
|
`;return O+(T&&(F[F.length-2]===`
|
|
42
42
|
`||F===`
|
|
43
43
|
`)?"+":T?"":"-")+`
|
|
44
|
-
`}function
|
|
45
|
-
`?F.slice(0,-1):F}function
|
|
46
|
-
`);return h=h!==-1?h:F.length,O.lastIndex=h,F1(F.slice(0,h),
|
|
44
|
+
`}function L4(F){return F[F.length-1]===`
|
|
45
|
+
`?F.slice(0,-1):F}function A2(F,M){let O=/(\n+)([^\n]*)/g,T=function(){let h=F.indexOf(`
|
|
46
|
+
`);return h=h!==-1?h:F.length,O.lastIndex=h,F1(F.slice(0,h),M)}(),P=F[0]===`
|
|
47
47
|
`||F[0]===" ",C,E;while(E=O.exec(F)){let h=E[1],b=E[2];C=b[0]===" ",T+=h+(!P&&!C&&b!==""?`
|
|
48
|
-
`:"")+F1(b,
|
|
48
|
+
`:"")+F1(b,M),P=C}return T}function F1(F,M){if(F===""||F[0]===" ")return F;let O=/ [^ ]/g,T,P=0,C,E=0,h=0,b="";while(T=O.exec(F)){if(h=T.index,h-P>M)C=E>P?E:h,b+=`
|
|
49
49
|
`+F.slice(P,C),P=C+1;E=h}if(b+=`
|
|
50
|
-
`,F.length-P>
|
|
51
|
-
`+F.slice(E+1);else b+=F.slice(P);return b.slice(1)}function I2(F){let
|
|
52
|
-
`;return""}W.exports.dump=k}),
|
|
50
|
+
`,F.length-P>M&&E>P)b+=F.slice(P,E)+`
|
|
51
|
+
`+F.slice(E+1);else b+=F.slice(P);return b.slice(1)}function I2(F){let M="",O=0;for(let T=0;T<F.length;O>=65536?T+=2:T++){O=H1(F,T);let P=K0[O];if(!P&&j1(O)){if(M+=F[T],O>=65536)M+=F[T+1]}else M+=P||V1(O)}return M}function A4(F,M,O){let T="",P=F.tag;for(let C=0,E=O.length;C<E;C+=1){let h=O[C];if(F.replacer)h=F.replacer.call(O,String(C),h);if(N(F,M,h,!1,!1)||typeof h>"u"&&N(F,M,null,!1,!1)){if(T!=="")T+=","+(!F.condenseFlow?" ":"");T+=F.dump}}F.tag=P,F.dump="["+T+"]"}function I4(F,M,O,T){let P="",C=F.tag;for(let E=0,h=O.length;E<h;E+=1){let b=O[E];if(F.replacer)b=F.replacer.call(O,String(E),b);if(N(F,M+1,b,!0,!0,!1,!0)||typeof b>"u"&&N(F,M+1,null,!0,!0,!1,!0)){if(!T||P!=="")P+=Z6(F,M);if(F.dump&&V===F.dump.charCodeAt(0))P+="-";else P+="- ";P+=F.dump}}F.tag=C,F.dump=P||"[]"}function M2(F,M,O){let T="",P=F.tag,C=Object.keys(O);for(let E=0,h=C.length;E<h;E+=1){let b="";if(T!=="")b+=", ";if(F.condenseFlow)b+='"';let p=C[E],n=O[p];if(F.replacer)n=F.replacer.call(O,p,n);if(!N(F,M,p,!1,!1))continue;if(F.dump.length>1024)b+="? ";if(b+=F.dump+(F.condenseFlow?'"':"")+":"+(F.condenseFlow?"":" "),!N(F,M,n,!1,!1))continue;b+=F.dump,T+=b}F.tag=P,F.dump="{"+T+"}"}function U(F,M,O,T){let P="",C=F.tag,E=Object.keys(O);if(F.sortKeys===!0)E.sort();else if(typeof F.sortKeys==="function")E.sort(F.sortKeys);else if(F.sortKeys)throw new Q("sortKeys must be a boolean or a function");for(let h=0,b=E.length;h<b;h+=1){let p="";if(!T||P!=="")p+=Z6(F,M);let n=E[h],t=O[n];if(F.replacer)t=F.replacer.call(O,n,t);if(!N(F,M+1,n,!0,!0,!0))continue;let q0=F.tag!==null&&F.tag!=="?"||F.dump&&F.dump.length>1024;if(q0)if(F.dump&&V===F.dump.charCodeAt(0))p+="?";else p+="? ";if(p+=F.dump,q0)p+=Z6(F,M);if(!N(F,M+1,t,!0,q0))continue;if(F.dump&&V===F.dump.charCodeAt(0))p+=":";else p+=": ";p+=F.dump,P+=p}F.tag=C,F.dump=P||"{}"}function I(F,M,O){let T=O?F.explicitTypes:F.implicitTypes;for(let P=0,C=T.length;P<C;P+=1){let E=T[P];if((E.instanceOf||E.predicate)&&(!E.instanceOf||typeof M==="object"&&M instanceof E.instanceOf)&&(!E.predicate||E.predicate(M))){if(O)if(E.multi&&E.representName)F.tag=E.representName(M);else F.tag=E.tag;else F.tag="?";if(E.represent){let h=F.styleMap[E.tag]||E.defaultStyle,b;if(G.call(E.represent)==="[object Function]")b=E.represent(M,h);else if(z.call(E.represent,h))b=E.represent[h](M,h);else throw new Q("!<"+E.tag+'> tag resolver accepts not "'+h+'" style');F.dump=b}return!0}}return!1}function N(F,M,O,T,P,C,E){if(F.tag=null,F.dump=O,!I(F,O,!1))I(F,O,!0);let h=G.call(F.dump),b=T;if(T)T=F.flowLevel<0||F.flowLevel>M;let p=h==="[object Object]"||h==="[object Array]",n,t;if(p)n=F.duplicates.indexOf(O),t=n!==-1;if(F.tag!==null&&F.tag!=="?"||t||F.indent!==2&&M>0)P=!1;if(t&&F.usedDuplicates[n])F.dump="*ref_"+n;else{if(p&&t&&!F.usedDuplicates[n])F.usedDuplicates[n]=!0;if(h==="[object Object]"){if(T&&Object.keys(F.dump).length!==0){if(U(F,M,F.dump,P),t)F.dump="&ref_"+n+F.dump}else if(M2(F,M,F.dump),t)F.dump="&ref_"+n+" "+F.dump}else if(h==="[object Array]"){if(T&&F.dump.length!==0){if(F.noArrayIndent&&!E&&M>0)I4(F,M-1,F.dump,P);else I4(F,M,F.dump,P);if(t)F.dump="&ref_"+n+F.dump}else if(A4(F,M,F.dump),t)F.dump="&ref_"+n+" "+F.dump}else if(h==="[object String]"){if(F.tag!=="?")L2(F,F.dump,M,C,b)}else if(h==="[object Undefined]")return!1;else{if(F.skipInvalid)return!1;throw new Q("unacceptable kind of an object to dump "+h)}if(F.tag!==null&&F.tag!=="?"){let q0=encodeURI(F.tag[0]==="!"?F.tag.slice(1):F.tag).replace(/!/g,"%21");if(F.tag[0]==="!")q0="!"+q0;else if(q0.slice(0,18)==="tag:yaml.org,2002:")q0="!!"+q0.slice(18);else q0="!<"+q0+">";F.dump=q0+" "+F.dump}}return!0}function _(F,M){let O=[],T=[];w(F,O,T);let P=T.length;for(let C=0;C<P;C+=1)M.duplicates.push(O[T[C]]);M.usedDuplicates=Array(P)}function w(F,M,O){if(F!==null&&typeof F==="object"){let T=M.indexOf(F);if(T!==-1){if(O.indexOf(T)===-1)O.push(T)}else if(M.push(F),Array.isArray(F))for(let P=0,C=F.length;P<C;P+=1)w(F[P],M,O);else{let P=Object.keys(F);for(let C=0,E=P.length;C<E;C+=1)w(F[P[C]],M,O)}}}function k(F,M){M=M||{};let O=new F2(M);if(!O.noRefs)_(F,O);let T=F;if(O.replacer)T=O.replacer.call({"":T},"",T);if(N(O,0,T,!0,!0))return O.dump+`
|
|
52
|
+
`;return""}W.exports.dump=k}),q5=zQ(z0((Z,W)=>{var X=UQ(),Q=qQ();function J(G,z){return function(){throw Error("Function yaml."+G+" is removed in js-yaml 4. Use yaml."+z+" instead, which is now safe by default.")}}W.exports.Type=O0(),W.exports.Schema=n8(),W.exports.FAILSAFE_SCHEMA=s8(),W.exports.JSON_SCHEMA=W5(),W.exports.CORE_SCHEMA=X5(),W.exports.DEFAULT_SCHEMA=m2(),W.exports.load=X.load,W.exports.loadAll=X.loadAll,W.exports.dump=Q.dump,W.exports.YAMLException=d6(),W.exports.types={binary:G5(),float:Z5(),map:a8(),null:o8(),pairs:Y5(),set:U5(),timestamp:Q5(),bool:t8(),int:e8(),merge:J5(),omap:z5(),seq:r8(),str:i8()},W.exports.safeLoad=J("safeLoad","load"),W.exports.safeLoadAll=J("safeLoadAll","loadAll"),W.exports.safeDump=J("safeDump","dump")})(),1),{Type:QB,Schema:JB,FAILSAFE_SCHEMA:GB,JSON_SCHEMA:K5,CORE_SCHEMA:zB,DEFAULT_SCHEMA:YB,load:UB,loadAll:qB,dump:KB,YAMLException:VB,types:BB,safeLoad:HB,safeLoadAll:$B,safeDump:FB}=q5.default,u2=q5.default});var V5;var B5=c(()=>{p0();d2();d2();V5={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(Z){let W=Z.data;if(Buffer.isBuffer(W))W=W.toString();if(typeof W==="string")try{return u2.load(W,{schema:K5})}catch{try{return u2.load(W)}catch(X){throw new l0(X?.message||"Parser Error",Z.url)}}else return W}}});var KQ,H5;var $5=c(()=>{p0();KQ=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,H5={order:300,allowEmpty:!0,encoding:"utf8",canParse(Z){return(typeof Z.data==="string"||Buffer.isBuffer(Z.data))&&KQ.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 l0("data is not text",Z.url)}}});var VQ,F5;var L5=c(()=>{VQ=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,F5={order:400,allowEmpty:!0,canParse(Z){return Buffer.isBuffer(Z.data)&&VQ.test(Z.url)},parse(Z){if(Buffer.isBuffer(Z.data))return Z.data;else return Buffer.from(Z.data)}}});var c2;var l2=c(()=>{S0();p0();c2={order:100,canRead(Z){return _4(Z.url)},async read(Z){let W,X=await import("fs");try{W=B6(Z.url)}catch(Q){let J=Q;throw J.message=`Malformed URI: ${Z.url}: ${J.message}`,new o0(J,Z.url)}if(W.endsWith("/")||W.endsWith("\\"))W=W.slice(0,-1);try{return await X.promises.readFile(W)}catch(Q){let J=Q;throw J.message=`Error opening file ${W}: ${J.message}`,new o0(J,W)}}}});async function A5(Z,W,X){Z=V6(Z);let Q=X||[];Q.push(Z.href);try{if(W.safeUrlResolver&&P4(Z.href))throw Error(`Unsafe URL blocked by safeUrlResolver: ${Z.href}`);let J=await BQ(Z,W);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(W.redirects)&&Q.length>W.redirects){let G=Error(`Error downloading ${Q[0]}.
|
|
53
53
|
Too many redirects:
|
|
54
54
|
${Q.join(`
|
|
55
|
-
`)}`);throw G.status=J.status,new o0(G)}else{let G=AQ(J,"location");if(!G){let q=Error(`HTTP ${J.status} redirect with no location header`);throw q.status=J.status,q}let z=A0(Z.href,G);return A9(z,W,Q)}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 o0(G,Z.href)}}async function LQ(Z,W){let X,Q;if(W.timeout&&typeof AbortController<"u")X=new AbortController,Q=setTimeout(()=>X.abort(),W.timeout);let J=await fetch(Z,{method:"GET",headers:W.headers||{},credentials:W.withCredentials?"include":"same-origin",redirect:"manual",signal:X?X.signal:null});if(Q)clearTimeout(Q);return J}function AQ(Z,W){return Z.headers.get(W)}var p2;var n2=d(()=>{S0();p0();p2={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return O8(Z.url)&&(!this.safeUrlResolver||!_4(Z.url))},read(Z){let W=V6(Z.url);if(typeof window<"u"&&!W.protocol)W.protocol=V6(location.href).protocol;return A9(W,this)}}});function N9(Z,W){if(M9(W)){let X=Object.keys(W).filter((Q)=>!["__proto__","constructor","prototype"].includes(Q));for(let Q=0;Q<X.length;Q++){let J=X[Q],G=W[J],z=Z[J];if(M9(G))Z[J]=N9(z||{},G);else if(G!==void 0)Z[J]=G}}return Z}function M9(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var I9=()=>{return{parse:{json:{...c8},yaml:{...V9},text:{...H9},binary:{...F9}},resolve:{file:{...c2},http:{...p2},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},w9=(Z)=>{let W=I9();if(Z)N9(W,Z);return W};var i2=d(()=>{l8();B9();$9();L9();l2();n2()});function MQ(Z){let W,X,Q,J,G=Array.prototype.slice.call(Z);if(typeof G[G.length-1]==="function")J=G.pop();if(typeof G[0]==="string")if(W=G[0],typeof G[2]==="object")X=G[1],Q=G[2];else X=void 0,Q=G[1];else W="",X=G[0],Q=G[1];try{Q=w9(Q)}catch(z){console.error(`JSON Schema Ref Parser: Error normalizing options: ${z}`)}if(!Q.mutateInputSchema&&typeof X==="object")X=JSON.parse(JSON.stringify(X));return{path:W,schema:X,options:Q,callback:J}}var c6;var D9=d(()=>{i2();c6=MQ});function IQ(Z,W){if(!W.resolve?.external)return Promise.resolve();try{let X=Z.$refs._root$Ref.dynamicIdScope?C0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=r2(Z.schema,Z.$refs._root$Ref.path+"#",X,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,W);return Promise.all(Q)}catch(X){return Promise.reject(X)}}function r2(Z,W,X,Q,J,G,z,q){z||=new Set;let K=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!z.has(Z)){z.add(Z);let V=X;if(B0.isExternal$Ref(Z))K.push(wQ(Z,W,V,Q,J,G));let H=Object.keys(Z);for(let B of H){let $=b0.join(W,B),L=Z[B],A=Q&&L&&typeof L==="object"&&!ArrayBuffer.isView(L)?C0(V,L):V;K=K.concat(r2(L,$,A,Q,J,G,z,q))}}return K}async function wQ(Z,W,X,Q,J,G){let q=G.dereference?.externalReferenceResolution==="root"?p1():Q?X:W,K=A0(q,Z.$ref),V=L0(K),H=J._get$Ref(V);if(H)return Promise.resolve(H.value);try{let B=Z.$ref,$={url:K,baseUrl:q};if(typeof B==="string")$.reference=B;let L=await y4($,J,G),A=J._get$Ref(V),j=r2(L,V+"#",V,A?.dynamicIdScope??!1,J,G,new Set,!0);return Promise.all(j)}catch(B){if(!G?.continueOnError||!X1(B))throw B;if(J._$refs[V])B.source=decodeURI(L0(W)),B.path=E4(Z1(W));return[]}}var T9;var R9=d(()=>{F6();h6();f2();S0();p0();n1();T9=IQ});function NQ(Z,W){let X=Z.$refs._root$Ref.dynamicIdScope?C0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=[];a2(Z,"schema",Z.$refs._root$Ref.path+"#",X,Z.$refs._root$Ref.dynamicIdScope,"#",0,Q,Z.$refs,W);let J=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(DQ(Q,W,J),(W.bundle||{}).optimizeInternalRefs!==!1)PQ(Q,Z.schema)}function a2(Z,W,X,Q,J,G,z,q,K,V){let H=W===null?Z:Z[W],B=V.bundle||{},$=B.excludedPathMatcher||(()=>!1);if(H&&typeof H==="object"&&!ArrayBuffer.isView(H)&&!$(G)){let L=Q;if(B0.isAllowed$Ref(H))P9(Z,W,X,L,J,G,z,q,K,V);else{let A=Object.keys(H).sort((j,D)=>{if(j==="definitions"||j==="$defs")return-1;else if(D==="definitions"||D==="$defs")return 1;else return j.length-D.length});for(let j of A){let D=b0.join(X,j),R=b0.join(G,j),x=H[j],f=J&&x&&typeof x==="object"&&!ArrayBuffer.isView(x)?C0(L,x):L;if(B0.isAllowed$Ref(x))P9(H,j,D,f,J,R,z,q,K,V);else a2(H,j,D,f,J,R,z,q,K,V);if(x&&typeof x==="object"&&!Array.isArray(x)){if("$ref"in x)B?.onBundle?.(x.$ref,H[j],H,j)}}}}}function P9(Z,W,X,Q,J,G,z,q,K,V){let H=W===null?Z:Z[W],B=A0(J?Q:X,H.$ref),$=K._resolve(B,G,V);if($===null)return;let A=b0.parse(G).length,j=L0($.path),D=Z1($.path),R=j!==K._root$Ref.path&&!K._aliases[j],x=B0.isExtended$Ref(H);z+=$.indirections;let f=TQ(q,Z,W);if(f)if(A<f.depth||z<f.indirections)RQ(q,f);else return;if(q.push({$ref:H,parent:Z,key:W,pathFromRoot:G,depth:A,file:j,hash:D,value:$.value,circular:$.circular,extended:x,external:R,indirections:z}),!f||R)a2($.value,null,$.path,$.$ref.path,$.$ref.dynamicIdScope,G,z+1,q,K,V)}function DQ(Z,W,X){Z.sort((z,q)=>{if(z.file!==q.file)return z.file<q.file?-1:1;else if(z.hash!==q.hash)return z.hash<q.hash?-1:1;else if(z.circular!==q.circular)return z.circular?-1:1;else if(z.extended!==q.extended)return z.extended?1:-1;else if(z.indirections!==q.indirections)return z.indirections-q.indirections;else if(z.depth!==q.depth)return z.depth-q.depth;else{let K=Math.max(z.pathFromRoot.lastIndexOf("/definitions"),z.pathFromRoot.lastIndexOf("/$defs")),V=Math.max(q.pathFromRoot.lastIndexOf("/definitions"),q.pathFromRoot.lastIndexOf("/$defs"));if(K!==V)return V-K;else return z.pathFromRoot.length-q.pathFromRoot.length}});let Q,J,G;for(let z of Z){let q=W.bundle||{};if(!z.external){if(q.optimizeInternalRefs!==!1)z.$ref.$ref=z.hash}else if(z.file===Q&&z.hash===J)if(X&&_9(Z,z))z.$ref.$ref=X+G;else z.$ref.$ref=G;else if(z.file===Q&&z.hash.indexOf(J+"/")===0){let K=b0.join(G,b0.parse(z.hash.replace(J,"#")));if(X&&_9(Z,z))z.$ref.$ref=X+K;else z.$ref.$ref=K}else if(Q=z.file,J=z.hash,G=z.pathFromRoot,z.$ref=z.parent[z.key]=B0.dereference(z.$ref,z.value,W),z.circular)z.$ref.$ref=z.pathFromRoot}}function TQ(Z,W,X){for(let Q of Z)if(Q&&Q.parent===W&&Q.key===X)return Q;return}function RQ(Z,W){let X=Z.indexOf(W);Z.splice(X,1)}function PQ(Z,W){for(let X of Z){if(!X.$ref||typeof X.$ref!=="object"||!("$ref"in X.$ref))continue;let Q=X.$ref.$ref;if(typeof Q!=="string"||!Q.startsWith("#/"))continue;let J=_Q(W,Q);if(J!==Q)X.$ref.$ref=J}}function _Q(Z,W){if(!W.startsWith("#/"))return W;let X=W.slice(2).split("/"),Q=Z,J=[];for(let z of X){if(Q===null||Q===void 0||typeof Q!=="object")return W;if("$ref"in Q&&typeof Q.$ref==="string"&&Q.$ref.startsWith("#/")){let V=Q.$ref.slice(2).split("/");if(J.length=0,J.push(...V),Q=jQ(Z,Q.$ref),Q===null||Q===void 0||typeof Q!=="object")return W}let q=z.replace(/~1/g,"/").replace(/~0/g,"~"),K=Array.isArray(Q)?parseInt(q):q;Q=Q[K],J.push(z)}return"#/"+J.join("/")}function jQ(Z,W){if(!W.startsWith("#/"))return;let X=W.slice(2).split("/"),Q=Z;for(let J of X){if(Q===null||Q===void 0||typeof Q!=="object")return;let G=J.replace(/~1/g,"/").replace(/~0/g,"~"),z=Array.isArray(Q)?parseInt(G):G;Q=Q[z]}return Q}function _9(Z,W){for(let X of Z){if(X.pathFromRoot==="#"||X.pathFromRoot==="#/")continue;if(W.pathFromRoot.startsWith(X.pathFromRoot+"/")){if(X.value&&typeof X.value==="object"&&"$id"in X.value)return!0}}return!1}var j9;var E9=d(()=>{F6();h6();S0();n1();j9=NQ});function EQ(Z,W){let X=Date.now(),Q=Z.$refs._root$Ref.dynamicIdScope?C0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,J=s2(Z.schema,Z.$refs._root$Ref.path,Q,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,W,X,0);Z.$refs.circular=J.circular,Z.schema=J.value}function s2(Z,W,X,Q,J,G,z,q,K,V,H,B){let $,L={value:Z,circular:!1};O9(H,V);let A=V.dereference||{},j=A.maxDepth??500;if(B>j)throw RangeError(`Maximum dereference depth (${j}) exceeded at ${J}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let D=A.excludedPathMatcher||(()=>!1);if(A?.circular==="ignore"||!z.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!D(J)){G.add(Z),z.add(Z);let R=X;if(B0.isAllowed$Ref(Z,V))$=C9(Z,W,R,Q,J,G,z,q,K,V,H,B),L.circular=$.circular,L.value=$.value;else for(let x of Object.keys(Z)){O9(H,V);let f=b0.join(W,x),p=b0.join(J,x);if(D(p))continue;let r=Z[x],m=Q&&r&&typeof r==="object"&&!ArrayBuffer.isView(r)?C0(R,r):R,S;if(B0.isAllowed$Ref(r,V)){if($=C9(r,f,m,Q,p,G,z,q,K,V,H,B),S=$.circular,Z[x]!==$.value){let c=new Map;if(A?.preservedProperties){if(typeof Z[x]==="object"&&!Array.isArray(Z[x]))A?.preservedProperties.forEach((W0)=>{if(W0 in Z[x])c.set(W0,Z[x][W0])})}let o=$.value;if(A?.cloneReferences&&!S&&o&&typeof o==="object")o=structuredClone(o);if(Z[x]=o,A?.preservedProperties){if(c.size&&typeof Z[x]==="object"&&!Array.isArray(Z[x]))c.forEach((W0,X0)=>{Z[x][X0]=W0})}A?.onDereference?.(r.$ref,Z[x],Z,x)}}else if(!G.has(r)){if($=s2(r,f,m,Q,p,G,z,q,K,V,H,B+1),S=$.circular,Z[x]!==$.value)Z[x]=$.value}else S=g4(f,K,V);L.circular=L.circular||S}G.delete(Z)}}return L}function C9(Z,W,X,Q,J,G,z,q,K,V,H,B){let A=B0.isExternal$Ref(Z)&&V?.dereference?.externalReferenceResolution==="root"?p1():Q?X:W,j=A0(A,Z.$ref),D=q.get(j);if(D){if(!D.circular){let m=Object.keys(Z);if(m.length>1){let S={};for(let c of m)if(c!=="$ref"&&!(c in D.value))S[c]=Z[c];return{circular:D.circular,value:Object.assign({},D.value,S)}}return D}if(typeof D.value==="object"&&"$ref"in D.value&&"$ref"in Z){if(D.value.$ref===Z.$ref)return g4(W,K,V),D}else return g4(W,K,V),D}let R=K._resolve(j,W,V);if(R===null)return{circular:!1,value:null};let x=R.circular,f=x||G.has(R.value);if(f)g4(W,K,V);let p=B0.dereference(Z,R.value,V);if(!f){let m=s2(p,R.path,R.$ref.path,R.$ref.dynamicIdScope,J,G,z,q,K,V,H,B+1);f=m.circular,p=m.value}if(f&&!x&&V.dereference?.circular==="ignore")p=Z;if(x)p.$ref=J;let r={circular:f,value:p};if(Object.keys(Z).length===1)q.set(j,r);return r}function O9(Z,W){if(W&&W.timeoutMs){if(Date.now()-Z>W.timeoutMs)throw new S2(W.timeoutMs)}}function g4(Z,W,X){if(W.circular=!0,X?.dereference?.onCircular?.(Z),!X.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var x9;var k9=d(()=>{F6();h6();S0();n1();p0();x9=EQ});function CQ(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(W){setTimeout(W,0)}}var o2;var S9=d(()=>{o2=CQ()});function m0(Z,W){if(Z){W.then(function(X){o2(function(){Z(null,X)})},function(X){o2(function(){Z(X)})});return}else return W}var b9=d(()=>{S9()});class w1{schema=null;$refs=new m6;async parse(){let Z=c6(arguments),W;if(!Z.path&&!Z.schema){let Q=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return m0(Z.callback,Promise.reject(Q))}this.schema=null,this.$refs=new m6;let X="http";if(j4(Z.path))Z.path=b8(Z.path),X="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let Q=V6(Z.schema.$id),J=Q.port??(Q.protocol==="https:"?443:80);Z.path=`${Q.protocol}//${Q.hostname}:${J}`}if(Z.path=A0(p1(),Z.path),Z.schema&&typeof Z.schema==="object"){let Q=this.$refs._add(Z.path);Q.value=Z.schema,Q.pathType=X,Q.dynamicIdScope=k4(Q.value),S4(this.$refs,Q.path,Q.value,Q.pathType,Q.dynamicIdScope),W=Promise.resolve(Z.schema)}else W=y4(Z.path,this.$refs,Z.options);try{let Q=await W;if(Q!==null&&typeof Q==="object"&&!Buffer.isBuffer(Q))return this.schema=Q,m0(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,m0(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||Q}" is not a valid JSON Schema`)}catch(Q){if(!Z.options.continueOnError||!X1(Q))return m0(Z.callback,Promise.reject(Q));if(this.$refs._$refs[L0(Z.path)])this.$refs._$refs[L0(Z.path)].addError(Q);return m0(Z.callback,Promise.resolve(null))}}static parse(){let Z=new w1;return Z.parse.apply(Z,arguments)}async resolve(){let Z=c6(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await T9(this,Z.options),t2(this),m0(Z.callback,Promise.resolve(this.$refs))}catch(W){return m0(Z.callback,Promise.reject(W))}}static resolve(){let Z=new w1;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new w1;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=c6(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),j9(this,Z.options),t2(this),m0(Z.callback,Promise.resolve(this.schema))}catch(W){return m0(Z.callback,Promise.reject(W))}}static dereference(){let Z=new w1;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=c6(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),x9(this,Z.options),t2(this),m0(Z.callback,Promise.resolve(this.schema))}catch(W){return m0(Z.callback,Promise.reject(W))}}}function t2(Z){if(H6.getParserErrors(Z).length>0)throw new H6(Z)}var $H,FH,LH,v9;var y9=d(()=>{u8();f2();D9();R9();E9();k9();S0();l2();n2();p0();b9();n1();i2();S0();$H=w1.parse,FH=w1.resolve,LH=w1.bundle,v9=w1.dereference});async function l6(Z,W={}){let{baseUrl:X="/_jx/server"}=W,Q=await v9(Z),J=P4(Q);if(J.length===0)return null;let G=J.map(({exportName:q,src:K})=>`import { ${q} } from '${K}'`).join(`
|
|
56
|
-
`),z=J.map(({exportName:q})=>
|
|
55
|
+
`)}`);throw G.status=J.status,new o0(G)}else{let G=HQ(J,"location");if(!G){let q=Error(`HTTP ${J.status} redirect with no location header`);throw q.status=J.status,q}let z=A0(Z.href,G);return A5(z,W,Q)}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 o0(G,Z.href)}}async function BQ(Z,W){let X,Q;if(W.timeout&&typeof AbortController<"u")X=new AbortController,Q=setTimeout(()=>X.abort(),W.timeout);let J=await fetch(Z,{method:"GET",headers:W.headers||{},credentials:W.withCredentials?"include":"same-origin",redirect:"manual",signal:X?X.signal:null});if(Q)clearTimeout(Q);return J}function HQ(Z,W){return Z.headers.get(W)}var p2;var n2=c(()=>{S0();p0();p2={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return O8(Z.url)&&(!this.safeUrlResolver||!P4(Z.url))},read(Z){let W=V6(Z.url);if(typeof window<"u"&&!W.protocol)W.protocol=V6(location.href).protocol;return A5(W,this)}}});function N5(Z,W){if(I5(W)){let X=Object.keys(W).filter((Q)=>!["__proto__","constructor","prototype"].includes(Q));for(let Q=0;Q<X.length;Q++){let J=X[Q],G=W[J],z=Z[J];if(I5(G))Z[J]=N5(z||{},G);else if(G!==void 0)Z[J]=G}}return Z}function I5(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var M5=()=>{return{parse:{json:{...c8},yaml:{...V5},text:{...H5},binary:{...F5}},resolve:{file:{...c2},http:{...p2},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},w5=(Z)=>{let W=M5();if(Z)N5(W,Z);return W};var i2=c(()=>{l8();B5();$5();L5();l2();n2()});function $Q(Z){let W,X,Q,J,G=Array.prototype.slice.call(Z);if(typeof G[G.length-1]==="function")J=G.pop();if(typeof G[0]==="string")if(W=G[0],typeof G[2]==="object")X=G[1],Q=G[2];else X=void 0,Q=G[1];else W="",X=G[0],Q=G[1];try{Q=w5(Q)}catch(z){console.error(`JSON Schema Ref Parser: Error normalizing options: ${z}`)}if(!Q.mutateInputSchema&&typeof X==="object")X=JSON.parse(JSON.stringify(X));return{path:W,schema:X,options:Q,callback:J}}var c6;var D5=c(()=>{i2();c6=$Q});function FQ(Z,W){if(!W.resolve?.external)return Promise.resolve();try{let X=Z.$refs._root$Ref.dynamicIdScope?C0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=r2(Z.schema,Z.$refs._root$Ref.path+"#",X,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,W);return Promise.all(Q)}catch(X){return Promise.reject(X)}}function r2(Z,W,X,Q,J,G,z,q){z||=new Set;let K=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!z.has(Z)){z.add(Z);let V=X;if(B0.isExternal$Ref(Z))K.push(LQ(Z,W,V,Q,J,G));let H=Object.keys(Z);for(let B of H){let $=b0.join(W,B),L=Z[B],A=Q&&L&&typeof L==="object"&&!ArrayBuffer.isView(L)?C0(V,L):V;K=K.concat(r2(L,$,A,Q,J,G,z,q))}}return K}async function LQ(Z,W,X,Q,J,G){let q=G.dereference?.externalReferenceResolution==="root"?n1():Q?X:W,K=A0(q,Z.$ref),V=F0(K),H=J._get$Ref(V);if(H)return Promise.resolve(H.value);try{let B=Z.$ref,$={url:K,baseUrl:q};if(typeof B==="string")$.reference=B;let L=await v4($,J,G),A=J._get$Ref(V),j=r2(L,V+"#",V,A?.dynamicIdScope??!1,J,G,new Set,!0);return Promise.all(j)}catch(B){if(!G?.continueOnError||!X1(B))throw B;if(J._$refs[V])B.source=decodeURI(F0(W)),B.path=j4(Z1(W));return[]}}var T5;var R5=c(()=>{F6();h6();f2();S0();p0();i1();T5=FQ});function AQ(Z,W){let X=Z.$refs._root$Ref.dynamicIdScope?C0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=[];a2(Z,"schema",Z.$refs._root$Ref.path+"#",X,Z.$refs._root$Ref.dynamicIdScope,"#",0,Q,Z.$refs,W);let J=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(IQ(Q,W,J),(W.bundle||{}).optimizeInternalRefs!==!1)NQ(Q,Z.schema)}function a2(Z,W,X,Q,J,G,z,q,K,V){let H=W===null?Z:Z[W],B=V.bundle||{},$=B.excludedPathMatcher||(()=>!1);if(H&&typeof H==="object"&&!ArrayBuffer.isView(H)&&!$(G)){let L=Q;if(B0.isAllowed$Ref(H))P5(Z,W,X,L,J,G,z,q,K,V);else{let A=Object.keys(H).sort((j,D)=>{if(j==="definitions"||j==="$defs")return-1;else if(D==="definitions"||D==="$defs")return 1;else return j.length-D.length});for(let j of A){let D=b0.join(X,j),R=b0.join(G,j),x=H[j],d=J&&x&&typeof x==="object"&&!ArrayBuffer.isView(x)?C0(L,x):L;if(B0.isAllowed$Ref(x))P5(H,j,D,d,J,R,z,q,K,V);else a2(H,j,D,d,J,R,z,q,K,V);if(x&&typeof x==="object"&&!Array.isArray(x)){if("$ref"in x)B?.onBundle?.(x.$ref,H[j],H,j)}}}}}function P5(Z,W,X,Q,J,G,z,q,K,V){let H=W===null?Z:Z[W],B=A0(J?Q:X,H.$ref),$=K._resolve(B,G,V);if($===null)return;let A=b0.parse(G).length,j=F0($.path),D=Z1($.path),R=j!==K._root$Ref.path&&!K._aliases[j],x=Boolean(K._aliases[j])&&$.$ref.value!==K._root$Ref.value,d=B0.isExtended$Ref(H);z+=$.indirections;let m=MQ(q,Z,W);if(m)if(A<m.depth||z<m.indirections)wQ(q,m);else return;if(q.push({$ref:H,parent:Z,key:W,pathFromRoot:G,depth:A,file:j,hash:D,value:$.value,circular:$.circular,extended:d,external:R,nestedResource:x,indirections:z}),!m||R)a2($.value,null,$.path,$.$ref.path,$.$ref.dynamicIdScope,G,z+1,q,K,V)}function IQ(Z,W,X){Z.sort((z,q)=>{if(z.file!==q.file)return z.file<q.file?-1:1;else if(z.hash!==q.hash)return z.hash<q.hash?-1:1;else if(z.circular!==q.circular)return z.circular?-1:1;else if(z.extended!==q.extended)return z.extended?1:-1;else if(z.indirections!==q.indirections)return z.indirections-q.indirections;else if(z.depth!==q.depth)return z.depth-q.depth;else{let K=Math.max(z.pathFromRoot.lastIndexOf("/definitions"),z.pathFromRoot.lastIndexOf("/$defs")),V=Math.max(q.pathFromRoot.lastIndexOf("/definitions"),q.pathFromRoot.lastIndexOf("/$defs"));if(K!==V)return V-K;else return z.pathFromRoot.length-q.pathFromRoot.length}});let Q,J,G;for(let z of Z){let q=W.bundle||{};if(!z.external){if(q.optimizeInternalRefs!==!1&&!z.nestedResource)z.$ref.$ref=z.hash}else if(z.file===Q&&z.hash===J)if(X&&_5(Z,z))z.$ref.$ref=X+G;else z.$ref.$ref=G;else if(z.file===Q&&z.hash.indexOf(J+"/")===0){let K=b0.join(G,b0.parse(z.hash.replace(J,"#")));if(X&&_5(Z,z))z.$ref.$ref=X+K;else z.$ref.$ref=K}else if(Q=z.file,J=z.hash,G=z.pathFromRoot,z.$ref=z.parent[z.key]=B0.dereference(z.$ref,z.value,W),z.circular)z.$ref.$ref=z.pathFromRoot}}function MQ(Z,W,X){for(let Q of Z)if(Q&&Q.parent===W&&Q.key===X)return Q;return}function wQ(Z,W){let X=Z.indexOf(W);Z.splice(X,1)}function NQ(Z,W){for(let X of Z){if(!X.$ref||typeof X.$ref!=="object"||!("$ref"in X.$ref))continue;let Q=X.$ref.$ref;if(typeof Q!=="string"||!Q.startsWith("#/"))continue;let J=DQ(W,Q);if(J!==Q)X.$ref.$ref=J}}function DQ(Z,W){if(!W.startsWith("#/"))return W;let X=W.slice(2).split("/"),Q=Z,J=[];for(let z of X){if(Q===null||Q===void 0||typeof Q!=="object")return W;if("$ref"in Q&&typeof Q.$ref==="string"&&Q.$ref.startsWith("#/")){let V=Q.$ref.slice(2).split("/");if(J.length=0,J.push(...V),Q=TQ(Z,Q.$ref),Q===null||Q===void 0||typeof Q!=="object")return W}let q=z.replace(/~1/g,"/").replace(/~0/g,"~"),K=Array.isArray(Q)?parseInt(q):q;Q=Q[K],J.push(z)}return"#/"+J.join("/")}function TQ(Z,W){if(!W.startsWith("#/"))return;let X=W.slice(2).split("/"),Q=Z;for(let J of X){if(Q===null||Q===void 0||typeof Q!=="object")return;let G=J.replace(/~1/g,"/").replace(/~0/g,"~"),z=Array.isArray(Q)?parseInt(G):G;Q=Q[z]}return Q}function _5(Z,W){for(let X of Z){if(X.pathFromRoot==="#"||X.pathFromRoot==="#/")continue;if(W.pathFromRoot.startsWith(X.pathFromRoot+"/")){if(X.value&&typeof X.value==="object"&&"$id"in X.value)return!0}}return!1}var j5;var E5=c(()=>{F6();h6();S0();i1();j5=AQ});function RQ(Z,W){let X=Date.now(),Q=Z.$refs._root$Ref.dynamicIdScope?C0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,J=s2(Z.schema,Z.$refs._root$Ref.path,Q,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,W,X,0);Z.$refs.circular=J.circular,Z.schema=J.value}function s2(Z,W,X,Q,J,G,z,q,K,V,H,B){let $,L={value:Z,circular:!1};O5(H,V);let A=V.dereference||{},j=A.maxDepth??500;if(B>j)throw RangeError(`Maximum dereference depth (${j}) exceeded at ${J}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let D=A.excludedPathMatcher||(()=>!1);if(A?.circular==="ignore"||!z.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!D(J)){G.add(Z),z.add(Z);let R=X;if(B0.isAllowed$Ref(Z,V))$=C5(Z,W,R,Q,J,G,z,q,K,V,H,B),L.circular=$.circular,L.value=$.value;else for(let x of Object.keys(Z)){O5(H,V);let d=b0.join(W,x),m=b0.join(J,x);if(D(m))continue;let r=Z[x],f=Q&&r&&typeof r==="object"&&!ArrayBuffer.isView(r)?C0(R,r):R,S;if(B0.isAllowed$Ref(r,V)){if($=C5(r,d,f,Q,m,G,z,q,K,V,H,B),S=$.circular,Z[x]!==$.value){let l=new Map;if(A?.preservedProperties){if(typeof Z[x]==="object"&&!Array.isArray(Z[x]))A?.preservedProperties.forEach((W0)=>{if(W0 in Z[x])l.set(W0,Z[x][W0])})}let o=$.value;if(A?.cloneReferences&&!S&&o&&typeof o==="object")o=structuredClone(o);if(Z[x]=o,A?.preservedProperties){if(l.size&&typeof Z[x]==="object"&&!Array.isArray(Z[x]))l.forEach((W0,X0)=>{Z[x][X0]=W0})}A?.onDereference?.(r.$ref,Z[x],Z,x)}}else if(!G.has(r)){if($=s2(r,d,f,Q,m,G,z,q,K,V,H,B+1),S=$.circular,Z[x]!==$.value)Z[x]=$.value}else S=y4(d,K,V);L.circular=L.circular||S}G.delete(Z)}}return L}function C5(Z,W,X,Q,J,G,z,q,K,V,H,B){let A=B0.isExternal$Ref(Z)&&V?.dereference?.externalReferenceResolution==="root"?n1():Q?X:W,j=A0(A,Z.$ref),D=q.get(j);if(D){if(!D.circular){let f=Object.keys(Z);if(f.length>1){let S={};for(let l of f)if(l!=="$ref"&&!(l in D.value))S[l]=Z[l];return{circular:D.circular,value:Object.assign({},D.value,S)}}return D}if(typeof D.value==="object"&&"$ref"in D.value&&"$ref"in Z){if(D.value.$ref===Z.$ref)return y4(W,K,V),D}else return y4(W,K,V),D}let R=K._resolve(j,W,V);if(R===null)return{circular:!1,value:null};let x=R.circular,d=x||G.has(R.value);if(d)y4(W,K,V);let m=B0.dereference(Z,R.value,V);if(!d){let f=s2(m,R.path,R.$ref.path,R.$ref.dynamicIdScope,J,G,z,q,K,V,H,B+1);d=f.circular,m=f.value}if(d&&!x&&V.dereference?.circular==="ignore")m=Z;if(x)m.$ref=J;let r={circular:d,value:m};if(Object.keys(Z).length===1)q.set(j,r);return r}function O5(Z,W){if(W&&W.timeoutMs){if(Date.now()-Z>W.timeoutMs)throw new S2(W.timeoutMs)}}function y4(Z,W,X){if(W.circular=!0,X?.dereference?.onCircular?.(Z),!X.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var x5;var k5=c(()=>{F6();h6();S0();i1();p0();x5=RQ});function PQ(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(W){setTimeout(W,0)}}var o2;var S5=c(()=>{o2=PQ()});function m0(Z,W){if(Z){W.then(function(X){o2(function(){Z(null,X)})},function(X){o2(function(){Z(X)})});return}else return W}var b5=c(()=>{S5()});class w1{schema=null;$refs=new m6;async parse(){let Z=c6(arguments),W;if(!Z.path&&!Z.schema){let Q=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return m0(Z.callback,Promise.reject(Q))}this.schema=null,this.$refs=new m6;let X="http";if(_4(Z.path))Z.path=b8(Z.path),X="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let Q=V6(Z.schema.$id),J=Q.port??(Q.protocol==="https:"?443:80);Z.path=`${Q.protocol}//${Q.hostname}:${J}`}if(Z.path=A0(n1(),Z.path),Z.schema&&typeof Z.schema==="object"){let Q=this.$refs._add(Z.path);Q.value=Z.schema,Q.pathType=X,Q.dynamicIdScope=x4(Q.value),k4(this.$refs,Q.path,Q.value,Q.pathType,Q.dynamicIdScope),W=Promise.resolve(Z.schema)}else W=v4(Z.path,this.$refs,Z.options);try{let Q=await W;if(Q!==null&&typeof Q==="object"&&!Buffer.isBuffer(Q))return this.schema=Q,m0(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,m0(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||Q}" is not a valid JSON Schema`)}catch(Q){if(!Z.options.continueOnError||!X1(Q))return m0(Z.callback,Promise.reject(Q));if(this.$refs._$refs[F0(Z.path)])this.$refs._$refs[F0(Z.path)].addError(Q);return m0(Z.callback,Promise.resolve(null))}}static parse(){let Z=new w1;return Z.parse.apply(Z,arguments)}async resolve(){let Z=c6(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await T5(this,Z.options),t2(this),m0(Z.callback,Promise.resolve(this.$refs))}catch(W){return m0(Z.callback,Promise.reject(W))}}static resolve(){let Z=new w1;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new w1;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=c6(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),j5(this,Z.options),t2(this),m0(Z.callback,Promise.resolve(this.schema))}catch(W){return m0(Z.callback,Promise.reject(W))}}static dereference(){let Z=new w1;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=c6(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),x5(this,Z.options),t2(this),m0(Z.callback,Promise.resolve(this.schema))}catch(W){return m0(Z.callback,Promise.reject(W))}}}function t2(Z){if(H6.getParserErrors(Z).length>0)throw new H6(Z)}var $H,FH,LH,v5;var y5=c(()=>{u8();f2();D5();R5();E5();k5();S0();l2();n2();p0();b5();i1();i2();S0();$H=w1.parse,FH=w1.resolve,LH=w1.bundle,v5=w1.dereference});async function l6(Z,W={}){let{baseUrl:X="/_jx/server"}=W,Q=await v5(Z),J=R4(Q);if(J.length===0)return null;let G=J.map(({exportName:q,src:K})=>`import { ${q} } from '${K}'`).join(`
|
|
56
|
+
`),z=J.map(({exportName:q})=>g5(q,X)).join(`
|
|
57
57
|
`);return`// Generated by @jxsuite/compiler — do not edit manually
|
|
58
58
|
// Deploy as a Cloudflare Worker, Node server, or Bun process.
|
|
59
59
|
// Requires: npm install hono
|
|
@@ -66,7 +66,7 @@ ${z}
|
|
|
66
66
|
|
|
67
67
|
export default app
|
|
68
68
|
`}function e2(Z,W={}){let{baseUrl:X="/_jx/server",adapter:Q=null}=W;if(Z.length===0&&!Q)return null;let J=Z.map(({exportName:q,src:K})=>`import { ${q} } from '${K}'`).join(`
|
|
69
|
-
`),G=Z.map(({exportName:q})=>
|
|
69
|
+
`),G=Z.map(({exportName:q})=>g5(q,X)).join(`
|
|
70
70
|
`);return`// Generated by @jxsuite/compiler — do not edit manually
|
|
71
71
|
import { Hono } from 'hono'
|
|
72
72
|
${J}
|
|
@@ -78,7 +78,7 @@ app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
|
|
|
78
78
|
`:`
|
|
79
79
|
`}
|
|
80
80
|
export default app
|
|
81
|
-
`}function
|
|
81
|
+
`}function g5(Z,W){return`
|
|
82
82
|
app.post('${W}/${Z}', async (c) => {
|
|
83
83
|
const args = await c.req.json().catch(() => ({}))
|
|
84
84
|
try {
|
|
@@ -86,7 +86,7 @@ app.post('${W}/${Z}', async (c) => {
|
|
|
86
86
|
} catch (e) {
|
|
87
87
|
return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
|
|
88
88
|
}
|
|
89
|
-
})`}var Z3=
|
|
89
|
+
})`}var Z3=c(()=>{y5();S1()});function N1(Z){return Z instanceof Error?Z.message:String(Z)}function W3(Z,W,X){let Q;try{Q=JSON.parse(Z)}catch(J){throw Error(`Failed to parse ${X} at ${W}: ${N1(J)}`,{cause:J})}if(!g0(Q))throw Error(`Invalid ${X} at ${W}: expected a JSON object`);return Q}function b1(Z,W){return W3(Z,W,"Jx document")}function h5(Z,W){return W3(Z,W,"project config")}function f5(Z,W){return W3(Z,W,"class definition")}var D1=c(()=>{e0()});class d5{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;capabilities;#Z;#W=null;constructor(Z,W,X,Q){this.name=Z,this.classPath=W,this.classDef=X,this.#Z=Q;let J=X.format;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=X.$studio??null,this.capabilities=jQ(X)}implementation(){if(!this.#W){let Z=this.classDef.$implementation;if(!Z)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#W=this.#Z.importModule(this.#Z.resolvePath(this.classPath,Z))}return this.#W}async call(Z,...W){let X=this.capabilities[Z];if(!X)throw Error(`Format class "${this.name}" does not declare a "${Z}" capability`);let Q=await this.implementation(),J=this.classDef.title??this.name,G=Q[J]??Q.default?.[J]??Q.default,z=G?.[X.identifier];if(typeof z!=="function")throw TypeError(`Format class "${this.name}": implementation export "${J}" has no static "${X.identifier}" method`);return await z.call(G,...W)}}class c5{#Z;constructor(Z){this.#Z=Z;for(let W of u5){let X=new Map;for(let Q of Z){if(!Q.capabilities[W])continue;for(let J of Q.extensions){let G=X.get(J);if(G)throw Error(`Format conflict: "${G.name}" and "${Q.name}" both claim "${J}" with the "${W}" capability`);X.set(J,Q)}}}}get entries(){return this.#Z}byExtension(Z,W){let X=m5(Z);return this.#Z.find((Q)=>Q.extensions.includes(X)&&(!W||Q.capabilities[W]))}byName(Z){return this.#Z.find((W)=>W.name===Z)}withCapability(Z){return this.#Z.filter((W)=>W.capabilities[Z])}documentExtensions(Z){let W=new Set;for(let X of this.#Z){if(Z&&!X.documentKinds.includes(Z))continue;for(let Q of X.extensions)W.add(Q)}return W.delete(".json"),[...W]}has(Z){let W=m5(Z);return this.#Z.some((X)=>X.extensions.includes(W))}}async function l5(Z,W,X){let Q=[];for(let[J,G]of Object.entries(Z??{})){if(typeof G!=="string"||!G.endsWith(".class.json"))continue;let z,q;try{z=X?W.resolvePath(X,G):G,q=await W.loadJson(z)}catch{continue}if(!q||typeof q!=="object")continue;if(!q.format||!Array.isArray(q.format.extensions))continue;Q.push(new d5(J,z,q,W))}return new c5(Q)}function jQ(Z){let W={},X=Z.$defs?.methods??{};for(let[Q,J]of Object.entries(X)){let G=J.role;if(!G||!u5.includes(G))continue;W[G]={identifier:J.identifier??Q,timing:J.timing??_Q}}return W}function m5(Z){let W=Z.toLowerCase();return W.startsWith(".")?W:`.${W}`}var u5,_Q;var p5=c(()=>{u5=["parse","serialize","discover","load"],_Q=["compiler","server"]});var J3={};M4(J3,{unknownFormatError:()=>Q3,importImplementation:()=>h4,createNodeFormatIO:()=>i5,buildProjectFormatRegistry:()=>p6});import{readFileSync as EQ}from"node:fs";import{dirname as CQ,isAbsolute as OQ,resolve as X3,sep as g4}from"node:path";import{pathToFileURL as xQ}from"node:url";import{createRequire as n5}from"node:module";async function h4(Z){let W=[Z],X=`${g4}src${g4}`,Q=`${g4}dist${g4}`;if(Z.includes(X))W.push(Z.replace(X,Q));if(Z.endsWith(".js"))W.push(`${Z.slice(0,-3)}.ts`);let J;for(let G of W)try{return await import(xQ(G).href)}catch(z){J=z}throw J instanceof Error?J:Error(String(J))}function i5(Z){return{importModule:(W)=>h4(W),loadJson:async(W)=>JSON.parse(EQ(W,"utf8")),resolvePath:(W,X)=>{if(X.startsWith("./")||X.startsWith("../"))return X3(CQ(W),X);if(OQ(X))return X;let Q=n5(X3(Z,"package.json"));try{return Q.resolve(X)}catch{return n5(import.meta.url).resolve(X)}}}}async function p6(Z,W){return l5(W?.imports,i5(Z),X3(Z,"project.json"))}function Q3(Z,W){return Error(`No format class imported for "${W}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`)}var L6=c(()=>{p5()});async function m4(Z,W={}){let{resolveElementPath:X,$media:Q,formats:J}=W,G=[],z=new Set;async function q(K,V){let H,B;if(typeof K==="string"){let{readFileSync:d}=await import("node:fs"),{resolve:m}=await import("node:path");if(B=V?m(V,K):m(K),z.has(B))return;if(z.add(B),B.endsWith(".json"))H=b1(d(B,"utf8"),B);else{let{extname:r}=await import("node:path"),f=r(B).toLowerCase(),S=J?.byExtension?.(f,"parse");if(!S){let{unknownFormatError:l}=await Promise.resolve().then(() => (L6(),J3));throw l(B,f)}H=await S.call("parse",d(B,"utf8"))}}else{if(H=K,B=null,H.tagName&&z.has(H.tagName))return;if(H.tagName)z.add(H.tagName)}let{tagName:$}=H;if(!$||!$.includes("-"))throw Error(`compileElement: tagName "${$}" must contain a hyphen`);let{dirname:L}=await import("node:path"),A=B?L(B):null,j=[];if(Array.isArray(H.$elements))for(let d of H.$elements){let m=h0(d)?d.$ref:d;if(typeof m!=="string")continue;if(A)await q(m,A);let r=X?X(m,A):m.replace(/\.json$/,".js");j.push(r)}let D=T4($);if(Q)H.$media={...Q,...H.$media};let R=n6(H,D,j),x=B?B.replace(/\.json$/,".js"):`${$}.js`;G.push({content:R,path:x,tagName:$})}return await q(Z,W.basePath??null),{files:G}}async function kQ(Z,W={}){let{title:X="Jx App",reactivitySrc:Q="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:J="https://esm.sh/lit-html@3.3.0"}=W,G=await m4(Z,W),z=G.files.at(-1);if(!z)throw Error("compileElementPage: no element modules were produced");let{basename:q}=await import("node:path"),K=q(z.path),V=`<!DOCTYPE html>
|
|
90
90
|
<html lang="en">
|
|
91
91
|
<head>
|
|
92
92
|
<meta charset="utf-8">
|
|
@@ -105,12 +105,12 @@ app.post('${W}/${Z}', async (c) => {
|
|
|
105
105
|
<${z.tagName}></${z.tagName}>
|
|
106
106
|
<script type="module" src="./${K}"></script>
|
|
107
107
|
</body>
|
|
108
|
-
</html>`;return{files:G.files,html:V}}function
|
|
109
|
-
`)}function z3(Z,W,X){if(!Z)return"";if(R0(Z))return
|
|
110
|
-
`)}function
|
|
108
|
+
</html>`;return{files:G.files,html:V}}function SQ(Z){if(Z===null||typeof Z!=="object"||Array.isArray(Z))return JSON.stringify(Z);if("default"in Z)return JSON.stringify(Z.default);if(C1(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 n6(Z,W,X){let Q=["// Generated by @jxsuite/compiler — do not edit manually"];if(Z.$id)Q.push(`// Source: ${Z.$id}`);for(let B of X)Q.push(`import '${B}';`);let J=new Map,G=Z.state??{};for(let[B,$]of Object.entries(G)){let L=$;if(L&&typeof L==="object"&&!Array.isArray(L)&&L.$prototype==="Function"&&L.$src){let A=L.$src;if(!J.has(A))J.set(A,[]);J.get(A).push(B)}}for(let[B,$]of J)Q.push(`import { ${$.join(", ")} } from '${B}';`);Q.push("import { reactive, computed, effect } from '@vue/reactivity';","import { render, html } from 'lit-html';","",`class ${W} extends HTMLElement {`," #dispose = null;",""," constructor() {"," super();");let z=[],q=[],K=[];for(let[B,$]of Object.entries(G)){let L=$;if(a0(L)){let A=L.$expression;if(E1(A.operator))K.push([B,L]);else q.push([B,L])}else if(A1(L))if(typeof L.body==="string"&&L.body.includes("return"))q.push([B,L]);else K.push([B,L]);else{let A=SQ(L);if(A!==void 0)z.push([B,A])}}Q.push(" this.state = reactive({");for(let[B,$]of z)Q.push(` ${B}: ${$},`);Q.push(" });");for(let[B,$]of K)if(Q.push(""),a0($)){let L=c0($.$expression,{eventParam:"e",statePrefix:"s"});Q.push(` this.state.${B} = (s, e) => { ${L}; };`)}else{let A=($.parameters?O1($.parameters):$.arguments??["state"]).join(", ");if($.$src)Q.push(` this.state.${B} = (${A}) => ${B}(${A});`);else Q.push(` this.state.${B} = (${A}) => {`,` ${$.body??""}`," };")}for(let[B,$]of q)if(Q.push(""),a0($)){let L=c0($.$expression,{eventParam:"e",statePrefix:"this.state"});Q.push(` this.state.${B} = computed(() => ${L});`)}else if($.$src)Q.push(` this.state.${B} = computed(() => ${B}(this.state));`);else{Q.push(` this.state.${B} = computed(() => {`);let L=($.body??"").replaceAll("state.","this.state.");Q.push(` ${L}`," });")}Q.push(" }","");let V=[];if(Array.isArray(Z.children)){let B={n:0};for(let $ of Z.children)k1($,V,Z.$media??{},"",B,Z.tagName)}if(Q.push(" template() {"," const s = this.state;"," return html`",z3(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[$,L]of Object.entries(Z.style)){if($.startsWith(":")||$.startsWith(".")||$.startsWith("&")||$.startsWith("[")||$.startsWith("@"))continue;if(L===null||typeof L==="object")continue;let A=k0($);if(typeof L==="string"&&L.includes("${"))B.push([A,L])}if(B.length>0){Q.push(" effect(() => {");for(let[$,L]of B){let A=L.replaceAll(/\$\{([^}]+)\}/g,(j,D)=>`\${${D.replaceAll("state.","this.state.")}}`);Q.push(` this.style['${$}'] = \`${A}\`;`)}Q.push(" });")}}let H=o5(Z.children);if(H)Q.push(" const _slotted = Array.from(this.childNodes).filter(n => n.nodeType === 1 || (n.nodeType === 3 && n.textContent.trim()));");if(Q.push(" if (this.hasAttribute('data-jx-prerendered')) {"," this.removeAttribute('data-jx-prerendered');"," }"," this.innerHTML = '';"," this.#dispose = effect(() => render(this.template(), this));"),H)Q.push(" const _slot = this.querySelector('slot');"," if (_slot && _slotted.length > 0) {"," for (const n of _slotted) _slot.before(n);"," _slot.remove();"," }");return Q.push(" }",""," disconnectedCallback() {"," if (this.#dispose) { this.#dispose(); this.#dispose = null; }"," }","}","",`customElements.define('${Z.tagName}', ${W});`,""),Q.join(`
|
|
109
|
+
`)}function z3(Z,W,X){if(!Z)return"";if(R0(Z))return r5(Z,X);if(!Array.isArray(Z))return"";return Z.map((Q)=>R0(Q)?r5(Q,X):a5(Q,X)).join(`
|
|
110
|
+
`)}function a5(Z,W){if(typeof Z==="string"){if(Z.includes("${"))return`${W}${G3(Z)}`;return`${W}${e(Z)}`}if(typeof Z==="number"||typeof Z==="boolean")return`${W}${e(String(Z))}`;if(!Z||typeof Z!=="object")return"";let X=Z.tagName??"div",Q=[];if(Z.attributes)for(let[K,V]of Object.entries(Z.attributes))if(V&&typeof V==="object"&&h0(V))Q.push(`${K}="\${${T1(V.$ref)}}"`);else if(typeof V==="string"&&V.includes("${"))Q.push(`${K}="${f4(V)}"`);else Q.push(`${K}="${V}"`);if(Z.id)Q.push(`id="${Z.id}"`);if(Z.className)Q.push(`class="${Z.className}"`);for(let[K,V]of Object.entries(Z)){if(x1.has(K)||K.startsWith("$")||K.startsWith("on")||K==="tagName"||K==="id"||K==="className"||K==="style"||K==="children"||K==="textContent"||K==="innerHTML"||K==="attributes")continue;if(V&&typeof V==="object"&&V.$ref)Q.push(`.${K}="\${${T1(V.$ref)}}"`);else if(typeof V==="string"&&V.includes("${"))Q.push(`.${K}="${f4(V)}"`)}if(Z.$props)for(let[K,V]of Object.entries(Z.$props))if(V&&typeof V==="object"&&V.$ref)Q.push(`.${K}="\${${T1(V.$ref)}}"`);else Q.push(`.${K}="\${${JSON.stringify(V)}}"`);for(let[K,V]of Object.entries(Z)){if(!K.startsWith("on")||K==="observedAttributes")continue;let H=K.slice(2).toLowerCase();if(V&&typeof V==="object"&&V.$ref)Q.push(`@${H}="\${(e) => ${T1(V.$ref)}(s, e)}"`);else if(V&&typeof V==="object"&&"$expression"in V){let B=c0(V.$expression,{eventParam:"e",statePrefix:"s"});Q.push(`@${H}="\${(e) => { ${B}; }}"`)}else if(A1(V))Q.push(`@${H}="\${(e) => { ${vQ(V)} }}"`)}let J=s5(Z.style);if(J)Q.push(`style="${J}"`);let G=Q.length>0?`
|
|
111
111
|
${W} ${Q.join(`
|
|
112
112
|
${W} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(X))return`${W}<${X}${G}
|
|
113
|
-
${W}>`;let q="";if(Z.$switch){let K=h0(Z.$switch)?Z.$switch.$ref:Z.$switch,V=T1(K),H=Z.cases??{},B=[];for(let[$,L]of Object.entries(H)){if(!L||h0(L))continue;let A=
|
|
113
|
+
${W}>`;let q="";if(Z.$switch){let K=h0(Z.$switch)?Z.$switch.$ref:Z.$switch,V=T1(K),H=Z.cases??{},B=[];for(let[$,L]of Object.entries(H)){if(!L||h0(L))continue;let A=a5(L,`${W} `);B.push(` ${JSON.stringify($)}: html\`
|
|
114
114
|
${A}
|
|
115
115
|
\``)}q=`\${{
|
|
116
116
|
${B.join(`,
|
|
@@ -118,14 +118,14 @@ ${B.join(`,
|
|
|
118
118
|
}[${V}]}`}else if(Z.textContent!==void 0)q=G3(Z.textContent);else if(Z.innerHTML!==void 0)q=Z.innerHTML;else if(Z.children)q=`
|
|
119
119
|
${z3(Z.children,Z.style,`${W} `)}
|
|
120
120
|
${W}`;return`${W}<${X}${G}
|
|
121
|
-
${W}>${q}</${X}>`}function
|
|
121
|
+
${W}>${q}</${X}>`}function r5(Z,W){let X=h0(Z.items)?T1(Z.items.$ref):"ITEMS",Q=Z.map;if(!Q)return"";let J=Q.tagName??"div",G=[];if(Q.$props)for(let[V,H]of Object.entries(Q.$props))if(h0(H))G.push(`.${V}="\${${bQ(H.$ref)}}"`);else G.push(`.${V}="\${${JSON.stringify(H)}}"`);let z=s5(Q.style);if(z)G.push(`style="${z}"`);for(let[V,H]of Object.entries(Q)){if(!V.startsWith("on"))continue;let B=V.slice(2).toLowerCase();if(h0(H))G.push(`@${B}="\${(e) => ${T1(H.$ref)}(s, e)}"`);else if(a0(H)){let $=c0(H.$expression,{eventParam:"e",statePrefix:"s"});G.push(`@${B}="\${(e) => { ${$}; }}"`)}}let q=G.length>0?`
|
|
122
122
|
${W} ${G.join(`
|
|
123
123
|
${W} `)}`:"",K="";if(Q.textContent!==void 0)K=G3(Q.textContent);else if(Q.children)K=`
|
|
124
124
|
${z3(Q.children,null,`${W} `)}
|
|
125
125
|
${W} `;return`${W}\${${X}.map((item, index) => html\`
|
|
126
126
|
${W} <${J}${q}
|
|
127
127
|
${W} >${K}</${J}>
|
|
128
|
-
${W}\`)}`}function T1(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return`s.${Z}`}function
|
|
128
|
+
${W}\`)}`}function T1(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return`s.${Z}`}function bQ(Z){if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return T1(Z)}function f4(Z){return Z.replaceAll("state.","s.")}function G3(Z){if(Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string")return`\${${T1(Z.$ref)}}`;if(typeof Z==="string"&&Z.includes("${"))return f4(Z);return String(Z)}function vQ(Z){return(Z.body??"").replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function s5(Z){if(!Z||typeof Z!=="object")return"";let W=[];for(let[X,Q]of Object.entries(Z)){if(X.startsWith(":")||X.startsWith(".")||X.startsWith("&")||X.startsWith("[")||X.startsWith("@"))continue;if(Q===null||typeof Q==="object")continue;if(typeof Q==="string"&&Q.includes("${")){let J=k0(X);W.push(`${J}: ${f4(Q)}`)}}return W.join("; ")}function o5(Z){if(!Array.isArray(Z))return!1;for(let W of Z){if(!W||typeof W!=="object")continue;if(W.tagName==="slot")return!0;if(o5(W.children))return!0}return!1}var i6=c(()=>{y6();S1();e0();D1()});function t5(Z,W){let{title:X="Jx App",reactivitySrc:Q,litHtmlSrc:J}=W,G=U6(Z,null,Z.state??{},Z.$media??{}),z=K6(Z,Z.$media??{},W.projectStyle??null),q=[],K=e5(Z,!1,Z,G,q),V=[],H="",B="";if(q.length>0){for(let L of q){let A=n6(L.def,L.className,[]);V.push({content:A,path:`_islands/${L.tagName}.js`,tagName:L.tagName})}H=`<script type="importmap">
|
|
129
129
|
{
|
|
130
130
|
"imports": {
|
|
131
131
|
"@vue/reactivity": "${Q}",
|
|
@@ -146,8 +146,8 @@ ${W}\`)}`}function T1(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).repla
|
|
|
146
146
|
${K}
|
|
147
147
|
${B}
|
|
148
148
|
</body>
|
|
149
|
-
</html>`;return{files:V,html:$}}function
|
|
150
|
-
`)}return""}var
|
|
149
|
+
</html>`;return{files:V,html:$}}function e5(Z,W,X,Q,J){if(typeof Z==="string")return e(Z);if(typeof Z==="number"||typeof Z==="boolean")return e(String(Z));if(!Z||typeof Z!=="object")return"";let G=U6(X,Q.scope,X?.state??Q.scopeDefs,X?.$media??Q.media);if(W){let V=J.length,H=`jx-island-${V}`,B=`JxIsland${V}`,$={...X??Z,tagName:H};return J.push({className:B,def:$,tagName:H}),`<${H}></${H}>`}let z=Z.tagName??"div",q=G6(Z,G.scope);if(O2.has(z))return`<${z}${q}>`;let K=yQ(Z,X,G,J);return`<${z}${q}>${K}</${z}>`}function yQ(Z,W,X,Q){let J=W??Z;if(J.textContent!==void 0){let G=$0(J.textContent,X.scope);return G==null?"":e(String(G))}if(J.innerHTML)return $0(J.innerHTML,X.scope)??J.innerHTML;if(Array.isArray(J.children)){let G=Array.isArray(W?.children)?W.children:void 0;return J.children.map((z,q)=>{let K=z,V=N8(K),H=G?.[q]??z;return e5(K,V,H,X,Q)}).join(`
|
|
150
|
+
`)}return""}var Z9=c(()=>{S1();i6()});function U3(Z,W){let{title:X="Jx App",reactivitySrc:Q=z6,litHtmlSrc:J=Y6,modulePath:G="app.js"}=W,z=U6(Z,null,Z.state??{},Z.$media??{}),q=K6(Z,Z.$media??{},W.projectStyle??null),K={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},V=new Map,H=new Map,B=[],$=[],L=[],A=[],j=[],D=new Map,R=Z.state??{};for(let[f,S]of Object.entries(R)){if(S===null||typeof S!=="object"||Array.isArray(S)){if(typeof S==="string"&&s(S))$.push([f,`() => \`${S}\``]);else B.push([f,S]);continue}if(a0(S)){let l=S.$expression,o=c0(l,{eventParam:"e",statePrefix:"state"});if(E1(l.operator))A.push([f,{args:["state","e"],body:o}]);else $.push([f,`() => ${o}`]);continue}if(A1(S)){let l=S.parameters?O1(S.parameters):S.arguments;if(S.$src){if(!D.has(S.$src))D.set(S.$src,new Set);D.get(S.$src).add(f),$.push([f,`() => { return ${f}(state); }`])}else if(S.body&&S.body.includes("return"))$.push([f,`() => { ${S.body} }`]);else A.push([f,{args:l??["state"],body:S.body}]);continue}if(C1(S))continue;if(A8(S)){B.push([f,S.default]);continue}if(l1(S)){if(S.$prototype==="LocalStorage"||S.$prototype==="SessionStorage"){let l=S.$prototype==="LocalStorage"?"localStorage":"sessionStorage",o=S.key??f,W0=S.default??null;B.push([f,null]),j.push(fQ(f,l,o,W0));continue}if(S.$prototype==="Request"){B.push([f,null]),j.push(hQ(f,S));continue}if(S.$prototype==="Cookie"){B.push([f,null]),j.push(mQ(f,S.name??f,S.default??null));continue}}B.push([f,S])}let x=W9(Z,Z,z,V,H,K);for(let[f,S]of V)if(!L.some(([l])=>l===f))L.push([f,S]);for(let[f,S]of H)if(!A.some(([l])=>l===f))A.push([f,S]);let d=gQ(B,$,L,A,j,D,K,Q),m=[` "@vue/reactivity": "${Q}"`,` "lit-html": "${J}"`],r=`<!DOCTYPE html>
|
|
151
151
|
<html lang="en">
|
|
152
152
|
<head>
|
|
153
153
|
<meta charset="utf-8">
|
|
@@ -156,7 +156,7 @@ ${W}\`)}`}function T1(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).repla
|
|
|
156
156
|
<script type="importmap">
|
|
157
157
|
{
|
|
158
158
|
"imports": {
|
|
159
|
-
${
|
|
159
|
+
${m.join(`,
|
|
160
160
|
`)}
|
|
161
161
|
}
|
|
162
162
|
}
|
|
@@ -167,22 +167,22 @@ ${p.join(`,
|
|
|
167
167
|
<body>
|
|
168
168
|
${x}
|
|
169
169
|
</body>
|
|
170
|
-
</html>`;return{files:[{content:
|
|
170
|
+
</html>`;return{files:[{content:d,path:G}],html:r}}function W9(Z,W,X,Q,J,G){if(typeof Z==="string")return e(Z);if(typeof Z==="number"||typeof Z==="boolean")return e(String(Z));if(!Z||typeof Z!=="object")return"";let z=U6(W,X.scope,W?.state??X.scopeDefs,W?.$media??X.media),q=Z.tagName??"div",K=[],V=!1;if(Z.textContent!==void 0){let D=W?.textContent??Z.textContent;if(s0(D)){let R=v1(D.$ref);K.push(`:text-content="${R}"`),Y3(Q,R,D.$ref),V=!0}else if(s(D)){let R=`_t${G.t}`;G.t+=1,K.push(`:text-content="${R}"`),Q.set(R,`() => \`${D}\``),V=!0}}for(let[D,R]of Object.entries(Z)){if(!D.startsWith("on")||D==="observedAttributes")continue;let x=D.slice(2).toLowerCase();if(s0(R)){let d=v1(R.$ref);K.push(`@${x}="${d}"`),V=!0}else if(A1(R)){let d=`_h${G.h}`;G.h+=1,K.push(`@${x}="${d}"`),J.set(d,{args:R.parameters?O1(R.parameters):R.arguments??["state","event"],body:R.body}),V=!0}else if(a0(R)){let d=`_h${G.h}`;G.h+=1,K.push(`@${x}="${d}"`);let m=c0(R.$expression,{eventParam:"e",statePrefix:"state"});J.set(d,{args:["state","e"],body:m}),V=!0}}if(Z.style&&typeof Z.style==="object")for(let[D,R]of Object.entries(Z.style)){if(D.startsWith(":")||D.startsWith(".")||D.startsWith("&")||D.startsWith("[")||D.startsWith("@"))continue;if(R===null||typeof R==="object")continue;if(s(R)){let x=`_s${G.s}`;G.s+=1,K.push(`:style.${k0(D)}="${x}"`),Q.set(x,`() => \`${R}\``),V=!0}}if(Z.attributes&&typeof Z.attributes==="object"){for(let[D,R]of Object.entries(Z.attributes))if(s0(R)){let x=v1(R.$ref);K.push(`:attr.${D}="${x}"`),Y3(Q,x,R.$ref),V=!0}else if(s(R)){let x=`_t${G.t}`;G.t+=1,K.push(`:attr.${D}="${x}"`),Q.set(x,`() => \`${R}\``),V=!0}}for(let[D,R]of Object.entries(Z)){if(x1.has(D)||D.startsWith("on")||D.startsWith("$")||D==="tagName"||D==="id"||D==="className"||D==="style"||D==="children"||D==="textContent"||D==="innerHTML"||D==="attributes")continue;if(s0(R)){let x=v1(R.$ref);K.push(`:${k0(D)}="${x}"`),Y3(Q,x,R.$ref),V=!0}else if(s(R)){let x=`_t${G.t}`;G.t+=1,K.push(`:${k0(D)}="${x}"`),Q.set(x,`() => \`${R}\``),V=!0}}let H=G6(Z,z.scope),B=V?" data-bind":"",$=K.length>0?` ${K.join(" ")}`:"",L="",A=W??Z;if(A.textContent!==void 0&&!V){let D=$0(A.textContent,z.scope);L=D==null?"":e(String(D))}else if(A.textContent!==void 0&&V){let D=$0(A.textContent,z.scope);L=D==null?"":e(String(D))}else if(A.innerHTML)L=$0(A.innerHTML,z.scope)??A.innerHTML;else if(R0(A.children)){G.needsLit=!0;let D=`_list${G.l}`;G.l+=1;let R=A.children,x;if(s0(R.items))x=`state.${v1(R.items.$ref)}`;else x=JSON.stringify(R.items);let d=q3(R.map);Q.set(D,`() => (${x} ?? []).map((item, index) => html\`${d}\`)`),K.push(`:render="${D}"`),V=!0;let m=" data-bind",r=` ${K.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(q))return`<${q}${H}${m}${r}>`;return`<${q}${H}${m}${r}></${q}>`}else if(Array.isArray(A.children)&&A.children.some((D)=>R0(D))){G.needsLit=!0;let D=`_children${G.l}`;G.l+=1;let R=A.children.map((d)=>X9(d)).join(`
|
|
171
171
|
`);Q.set(D,`() => html\`
|
|
172
172
|
${R}
|
|
173
|
-
\``),K.push(`:render="${D}"`),V=!0;let x=` ${K.join(" ")}`;return`<${q}${H} data-bind${x}></${q}>`}else if(Array.isArray(A.children)){let D=Array.isArray(W?.children)?W.children:void 0;L=A.children.map((R,x)=>{let
|
|
174
|
-
`)}if(new Set(["input","br","hr","img","meta","link"]).has(q))return`<${q}${H}${B}${$}>`;return`<${q}${H}${B}${$}>${L}</${q}>`}function q3(Z){if(!Z)return"";let W=Z.tagName??"div",X="";if(Z.id)X+=` id="${Z.id}"`;if(Z.className)X+=` class="${
|
|
175
|
-
${
|
|
173
|
+
\``),K.push(`:render="${D}"`),V=!0;let x=` ${K.join(" ")}`;return`<${q}${H} data-bind${x}></${q}>`}else if(Array.isArray(A.children)){let D=Array.isArray(W?.children)?W.children:void 0;L=A.children.map((R,x)=>{let d=D?.[x]??R;return W9(R,d,z,Q,J,G)}).join(`
|
|
174
|
+
`)}if(new Set(["input","br","hr","img","meta","link"]).has(q))return`<${q}${H}${B}${$}>`;return`<${q}${H}${B}${$}>${L}</${q}>`}function q3(Z){if(!Z)return"";let W=Z.tagName??"div",X="";if(Z.id)X+=` id="${Z.id}"`;if(Z.className)X+=` class="${a1(Z.className)}"`;if(Z.attributes&&typeof Z.attributes==="object")for(let[G,z]of Object.entries(Z.attributes))X+=typeof z==="string"&&s(z)?` ${G}="${a1(z)}"`:` ${G}="${e(String(z))}"`;if(Z.style&&typeof Z.style==="object"){let G=[];for(let[z,q]of Object.entries(Z.style)){if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")||z.startsWith("@"))continue;if(q===null||typeof q==="object")continue;let K=k0(z);if(s(String(q)))G.push(`${K}: ${a1(String(q))}`);else G.push(`${K}: ${q}`)}if(G.length>0)X+=` style="${G.join("; ")}"`}for(let[G,z]of Object.entries(Z)){if(!G.startsWith("on")||G==="observedAttributes")continue;let q=G.slice(2).toLowerCase();if(s0(z)){let K=v1(z.$ref);X+=` @${q}=\${(e) => { state.$map = { item, index }; on.${K}(e); }}`}else if(z&&typeof z==="object"&&z.$prototype==="Function"){let K=a1(z.body);X+=` @${q}=\${(e) => { ${K} }}`}else if(z&&typeof z==="object"&&"$expression"in z){let K=c0(z.$expression,{eventParam:"e",statePrefix:"state"});X+=` @${q}=\${(e) => { state.$map = { item, index }; ${K}; }}`}}if(Z.contentEditable)X+=` contenteditable="${Z.contentEditable}"`;let Q="";if(Z.textContent!==void 0){let G=String(Z.textContent);if(s(G))Q=a1(G);else if(s0(Z.textContent))Q=`\${state.${v1(Z.textContent.$ref)}}`;else Q=e(G)}else if(Z.innerHTML)Q=a1(String(Z.innerHTML));else if(R0(Z.children))Q=`
|
|
175
|
+
${Q9(Z.children)}
|
|
176
176
|
`;else if(Array.isArray(Z.children))Q=`
|
|
177
|
-
${Z.children.map((G)=>
|
|
177
|
+
${Z.children.map((G)=>X9(G)).join(`
|
|
178
178
|
`)}
|
|
179
|
-
`;if(new Set(["input","br","hr","img","meta","link"]).has(W))return`<${W}${X}>`;return`<${W}${X}>${Q}</${W}>`}function
|
|
180
|
-
`)}function
|
|
181
|
-
`)}function
|
|
182
|
-
`)}function
|
|
183
|
-
`)}function v1(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replaceAll("/","_");return Z.replaceAll("/","_")}function Y3(Z,W,X){if(Z.has(W))return;if(X.startsWith("#/state/")){let J=X.slice(8).split("/");Z.set(W,`() => state.${J.join(".")}`)}else Z.set(W,`() => state.${X}`)}var K3=
|
|
184
|
-
`)}function
|
|
185
|
-
`):Z.body??"").includes("await ")}import{readFileSync as
|
|
179
|
+
`;if(new Set(["input","br","hr","img","meta","link"]).has(W))return`<${W}${X}>`;return`<${W}${X}>${Q}</${W}>`}function X9(Z){if(typeof Z==="string")return s(Z)?a1(Z):e(Z);if(typeof Z==="number"||typeof Z==="boolean")return e(String(Z));if(R0(Z))return Q9(Z);return q3(Z)}function Q9(Z){let{items:W}=Z,X=s0(W)?`state.${v1(W.$ref)}`:JSON.stringify(W??[]),Q=q3(Z.map);return`\${(${X} ?? []).map((item, index) => html\`${Q}\`)}`}function a1(Z){return Z.replaceAll("$map.","")}function gQ(Z,W,X,Q,J,G,z,q){let K=[],{needsLit:V}=z,H=W.length>0;K.push("// Generated by @jxsuite/compiler — do not edit manually");let B=["reactive","effect"];if(H)B.push("computed");if(K.push(`import { ${B.join(", ")} } from '@vue/reactivity';`),V)K.push("import { html, render } from 'lit-html';");for(let[$,L]of G)K.push(`import { ${[...L].join(", ")} } from '${$}';`);K.push("","const state = reactive({");for(let[$,L]of Z)K.push(` ${$}: ${JSON.stringify(L)},`);if(K.push("});",""),J.length>0){for(let $ of J)K.push($);K.push("")}if(W.length>0){for(let[$,L]of W)K.push(`state.${$} = computed(${L});`);K.push("")}if(X.length>0){K.push("const bind = {");for(let[$,L]of X)K.push(` ${$}: ${L},`);K.push("};")}else K.push("const bind = {};");if(K.push(""),Q.length>0){K.push("const on = {");for(let[$,L]of Q){let A=L.args??["state"],j=A.map((D)=>D==="state"?"state":"e").join(", ");K.push(` ${$}: (e) => { const fn = (${A.join(", ")}) => { ${L.body} }; fn(${j}); },`)}K.push("};")}else K.push("const on = {};");if(K.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;"),V)K.push(" if (parts[0] === 'render') {"," effect(() => { render(bind[key](), el); });"," } else if (parts[0] === 'style' && parts.length > 1) {");else K.push(" if (parts[0] === 'style' && parts.length > 1) {");return K.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);",""),K.join(`
|
|
180
|
+
`)}function hQ(Z,W){let{url:X}=W,Q=W.method??"GET",J=s(X);if(W.manual)return`// ${Z}: manual Request — fetch triggered by user action`;let G=[`// ${Z}: auto-fetch from ${J?"(dynamic URL)":X}`,"effect(() => {"];if(J)G.push(` const url = \`${X}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else G.push(` const url = ${JSON.stringify(X)};`);let z=[];if(Q!=="GET")z.push(`method: ${JSON.stringify(Q)}`);if(W.headers)z.push(`headers: ${JSON.stringify(W.headers)}`);if(W.body){let K=typeof W.body==="object"?JSON.stringify(JSON.stringify(W.body)):JSON.stringify(W.body);z.push(`body: ${K}`)}let q=z.length>0?`, { ${z.join(", ")} }`:"";return G.push(` fetch(url${q})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { state.${Z} = d; })`,` .catch(e => { state.${Z} = { error: String(e) }; });`,"});"),G.join(`
|
|
181
|
+
`)}function fQ(Z,W,X,Q){return[`// ${Z}: ${W} (key: "${X}")`,"try {",` const _s = ${W}.getItem(${JSON.stringify(X)});`,` state.${Z} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(Q)};`,`} catch { state.${Z} = ${JSON.stringify(Q)}; }`,"effect(() => {",` const v = state.${Z};`," try {",` if (v === null) ${W}.removeItem(${JSON.stringify(X)});`,` else ${W}.setItem(${JSON.stringify(X)}, JSON.stringify(v));`," } catch {}","});"].join(`
|
|
182
|
+
`)}function mQ(Z,W,X){return[`// ${Z}: Cookie (name: "${W}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${W}=([^;]*)"));`,` try { state.${Z} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(X)}; }`,` catch { state.${Z} = _m ? _m[1] : ${JSON.stringify(X)}; }`,"}"].join(`
|
|
183
|
+
`)}function v1(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replaceAll("/","_");return Z.replaceAll("/","_")}function Y3(Z,W,X){if(Z.has(W))return;if(X.startsWith("#/state/")){let J=X.slice(8).split("/");Z.set(W,`() => state.${J.join(".")}`)}else Z.set(W,`() => state.${X}`)}var K3=c(()=>{y6();S1();e0()});var G9={};M4(G9,{compileClassJson:()=>uQ});function uQ(Z,W={}){let X=Z.title;if(!X)throw Error("compileClassJson: missing title (class name)");let Q=dQ(Z.extends),J=Z.$defs,G=J?.fields??{},z=J?.constructor,q=typeof z==="object"?z:void 0,K=J?.methods??{},V=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if(Z.$id)V.push(`// Source: ${Z.$id}`);V.push("");let H=Q!=="Object"?` extends ${Q}`:"";V.push(`class ${X}${H} {`);for(let[B,$]of Object.entries(G)){if($.scope!=="static")continue;let L=$.identifier??B,A=$.access==="private"?"#":"",j=$.initializer!==void 0?JSON.stringify($.initializer):$.default!==void 0?JSON.stringify($.default):"null";V.push(` static ${A}${L} = ${j};`)}for(let[B,$]of Object.entries(G)){if($.scope==="static")continue;if($.access!=="private")continue;let L=$.identifier??B;V.push(` #${L};`)}if(Object.keys(G).length>0)V.push("");if(V.push(" constructor(config = {}) {"),q?.superCall||Q!=="Object"){let B=q?.superCall?.arguments?q.superCall.arguments.join(", "):"";V.push(` super(${B});`)}for(let[B,$]of Object.entries(G)){if($.scope==="static")continue;let L=$.identifier??B,A=$.access==="private"?"#":"",j=$.initializer!==void 0?JSON.stringify($.initializer):$.default!==void 0?JSON.stringify($.default):"null";V.push(` this.${A}${L} = config.${L} !== undefined ? config.${L} : ${j};`)}if(q?.body){let B=Array.isArray(q.body)?q.body:[q.body];for(let $ of B)V.push(` ${$}`)}V.push(" }");for(let[B,$]of Object.entries(K)){let L=$.identifier??B,A=$.scope==="static",D=$.access==="private"?"#":"",R=A?"static ":"",x=$.returnType?.$ref?.includes("Promise")||lQ($)?"async ":"",d=J9($.parameters??[]),m=cQ($.body);if(V.push(""),$.role==="accessor"){if($.getter)V.push(` ${R}get ${D}${L}() {`,` ${$.getter.body}`," }");if($.setter){let r=J9($.setter.parameters??[]);V.push(` ${R}set ${D}${L}(${r}) {`,` ${$.setter.body}`," }")}}else{V.push(` ${R}${x}${D}${L}(${d}) {`);for(let r of m)V.push(` ${r}`);V.push(" }")}}return V.push("}","",`export { ${X} };`,`export default ${X};`,""),V.join(`
|
|
184
|
+
`)}function dQ(Z){if(!Z)return"Object";if(typeof Z==="string")return Z;if(Z.$ref){let W=Z.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return W?W[1]:"Object"}return"Object"}function J9(Z){return Z.map((W)=>{if(W.$ref)return W.$ref.split("/").pop();let X=W.identifier??W.name;return typeof X==="string"?X:"arg"}).join(", ")}function cQ(Z){if(!Z)return[""];return Array.isArray(Z)?Z:[Z]}function lQ(Z){return(Array.isArray(Z.body)?Z.body.join(`
|
|
185
|
+
`):Z.body??"").includes("await ")}import{readFileSync as pQ}from"node:fs";async function V3(Z,W={}){let{title:X="Jx App",reactivitySrc:Q=z6,litHtmlSrc:J=Y6,projectStyle:G=null}=W,z;if(typeof Z==="string"){let q=pQ(Z,"utf8");if(Z.endsWith(".json"))z=b1(q,Z);else{let{extname:K}=await import("node:path"),V=K(Z).toLowerCase(),H=W.formats?.byExtension?.(V,"parse");if(!H){let{unknownFormatError:B}=await Promise.resolve().then(() => (L6(),J3));throw B(Z,V)}z=await H.call("parse",q)}}else z=Z;if(M8(z)){let{compileClassJson:q}=await Promise.resolve().then(() => G9),K=q(z,W),V=typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${z.title}.js`;return{files:[{content:K,path:V}],html:""}}if(!D4(z))return t5(z,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,title:X});if(z.tagName&&z.tagName.includes("-")){let{tagName:q}=z,K=T4(q),H={content:n6(z,K,[]),path:`${q}.js`,tagName:q},B=K6(z,z.$media??{}),$=`<!DOCTYPE html>
|
|
186
186
|
<html lang="en">
|
|
187
187
|
<head>
|
|
188
188
|
<meta charset="utf-8">
|
|
@@ -202,55 +202,55 @@ ${p.join(`,
|
|
|
202
202
|
<${q}></${q}>
|
|
203
203
|
<script type="module" src="./${q}.js"></script>
|
|
204
204
|
</body>
|
|
205
|
-
</html>`;return{files:[H],html:$}}return U3(z,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,title:X})}async function aH(Z,W){let[X,Q]=await Promise.all([V3(Z),l6(Z)]),{writeFileSync:J,mkdirSync:G}=await import("node:fs"),{dirname:z,join:q}=await import("node:path");if(W){J(W,X.html,"utf8"),console.error(`Written to ${W}`);let K=z(W);for(let V of X.files){let H=q(K,V.path);G(z(H),{recursive:!0}),J(H,V.content,"utf8"),console.error(`Written to ${H}`)}}else process.stdout.write(X.html);if(Q&&W){let K=W.replace(/(\.[^.]+)?$/,"-server.js");J(K,Q,"utf8"),console.error(`Server handler written to ${K}`)}}var
|
|
206
|
-
`)}function
|
|
205
|
+
</html>`;return{files:[H],html:$}}return U3(z,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,title:X})}async function aH(Z,W){let[X,Q]=await Promise.all([V3(Z),l6(Z)]),{writeFileSync:J,mkdirSync:G}=await import("node:fs"),{dirname:z,join:q}=await import("node:path");if(W){J(W,X.html,"utf8"),console.error(`Written to ${W}`);let K=z(W);for(let V of X.files){let H=q(K,V.path);G(z(H),{recursive:!0}),J(H,V.content,"utf8"),console.error(`Written to ${H}`)}}else process.stdout.write(X.html);if(Q&&W){let K=W.replace(/(\.[^.]+)?$/,"-server.js");J(K,Q,"utf8"),console.error(`Server handler written to ${K}`)}}var z9=c(()=>{S1();Z3();i6();Z9();K3();e0();D1();S1();Z3();i6();K3()});import{existsSync as nQ,readFileSync as iQ}from"node:fs";import{resolve as Y9}from"node:path";function U9(Z){let W=Y9(Z,"project.json");if(!nQ(W))throw Error(`project.json not found in ${Z}`);let X;try{X=h5(iQ(W,"utf8"),W)}catch(z){throw Error(`Invalid project.json: ${N1(z)}`,{cause:z})}let Q={...u4,...X,build:{...u4.build,...X.build},defaults:{...u4.defaults,...X.defaults},images:{...u4.images,...X.images}};if(X.$head)Q.$head=X.$head;if(X.$media)Q.$media=X.$media;if(X.style)Q.style=X.style;if(X.state)Q.state=X.state;if(X.redirects)Q.redirects=X.redirects;if(X.imports)Q.imports=X.imports;if(X.contentTypes)Q.contentTypes=X.contentTypes;let J=["cloudflare-workers","cloudflare-pages","node","bun"];if(Q.build.adapter&&!J.includes(Q.build.adapter))throw Error(`Unknown build adapter "${Q.build.adapter}" in project.json. Valid adapters: ${J.join(", ")}`);let G=["build","cloudflare"];if(!G.includes(Q.images.service))throw Error(`Unknown images.service "${Q.images.service}" in project.json. Valid services: ${G.join(", ")}`);return{config:Q,configPath:W,projectRoot:Y9(Z)}}var u4;var q9=c(()=>{D1();u4={$head:[],$media:{},build:{format:"directory",outDir:"./dist",provider:null,trailingSlash:"always"},contentTypes:{},defaults:{charset:"utf8",lang:"en",layout:null},images:{formats:["webp","avif"],lazyLoad:!0,optimize:!0,quality:{avif:65,jpeg:80,png:80,webp:80},service:"build",sizes:"(max-width: 768px) 100vw, 50vw",widths:[320,640,960,1280,1920]},imports:{},name:"Jx Site",redirects:{},state:{},style:{},url:""}});import{readFileSync as K9,readdirSync as rQ}from"node:fs";import{extname as B3,join as aQ,relative as sQ,resolve as oQ}from"node:path";async function r6(Z,W){let X=K9(Z,"utf8");if(Z.endsWith(".json"))return b1(X,Z);let Q=B3(Z).toLowerCase(),J=W?.byExtension(Q,"parse");if(!J)throw Error(`No format class imported for "${Q}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`);return await J.call("parse",X)}async function V9(Z,W){let X=[],Q=new Set([".json",...W?.documentExtensions("page")??[]]);return await B9(Z,Z,X,Q,W),X.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)}),X}async function B9(Z,W,X,Q,J){let G=rQ(Z,{withFileTypes:!0});for(let z of G){let q=aQ(Z,z.name);if(z.isDirectory()){if(z.name.startsWith("_"))continue;await B9(q,W,X,Q,J);continue}let K=B3(z.name).toLowerCase();if(!Q.has(K))continue;if(z.name.startsWith("_"))continue;let V=sQ(W,q),H=await tQ(V,q,J);if(H)X.push(H)}}async function tQ(Z,W,X){let Q=B3(Z),J=Q?Z.slice(0,-Q.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=[],z=!1,q=!1,K=J.replaceAll(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(H,B,$)=>{if(B)return q=!0,z=!0,G.push(B),"*";return z=!0,G.push($),`:${$}`}),V=null;try{let B=(await r6(W,X)).$layout;if(typeof B==="string")V=B}catch{}return{$layout:V,isCatchAll:q,isDynamic:z,params:G,relativePath:Z,sourcePath:W,urlPattern:K}}async function H9(Z,W,X=new Map,Q){let J=[];for(let G of Z){if(!G.isDynamic){J.push(G);continue}let z;try{z=await r6(G.sourcePath,Q)}catch{J.push(G);continue}if(!z.$paths){console.warn(`Warning: dynamic route ${G.urlPattern} has no $paths — skipping`);continue}let q=eQ(z.$paths,W,X);for(let K of q){let V=G.urlPattern,H={};for(let[B,$]of Object.entries(K))H[B]=String($),V=V.replace(`:${B}`,H[B]),V=V.replace("*",H[B]);J.push({...G,_pathParams:H,isCatchAll:!1,isDynamic:!1,params:[],urlPattern:V})}}return J}function eQ(Z,W,X){if(Array.isArray(Z))return Z;if("contentType"in Z&&Z.contentType){let Q=X.get(Z.contentType);if(!Q||Q.length===0)return console.warn(`Warning: $paths references content type "${Z.contentType}" but it has no entries`),[];let J=Z.param??"slug",G=Z.field??"id";return Q.map((z)=>({[J]:G==="id"?z.id:z.data[G]??z.id})).filter((z)=>z[J])}if("values"in Z&&Array.isArray(Z.values)){let Q=Z.param??"value";return Z.values.map((J)=>({[Q]:J}))}if("$ref"in Z&&Z.$ref){let Q=oQ(W,Z.$ref),J;try{J=JSON.parse(K9(Q,"utf8"))}catch(q){let K=q;return console.warn(`Warning: $paths.$ref could not load "${Z.$ref}": ${K.message}`),[]}if(!Array.isArray(J))return console.warn(`Warning: $paths.$ref "${Z.$ref}" must be a JSON array`),[];let G=Z.param??"id",z=Z.field??"id";return J.map((q)=>({[G]:q[z]??q.id??String(q)}))}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var $9=c(()=>{D1()});import{existsSync as ZJ,readFileSync as WJ}from"node:fs";import{resolve as XJ}from"node:path";function H3(Z,W,X){let Q=Z.$layout??W.defaults?.layout??null;if(!Q)return Z;let J=XJ(X,Q);if(!ZJ(J))throw Error(`Layout not found: ${Q} (resolved to ${J})`);let G;try{G=b1(WJ(J,"utf8"),J)}catch(V){throw Error(`Invalid layout JSON at ${J}: ${V.message}`,{cause:V})}if(G.$layout)G=H3(G,W,X);let z=Z.children??[],q=typeof z==="string"?[z]:Array.isArray(z)?z:[],K=JJ(G);if(QJ(K,q),Z.state)K.state={...K.state,...Z.state};if(Z.$media)K.$media={...K.$media,...Z.$media};if(Z.style)K.style={...K.style,...Z.style};if(Z.attributes)K.attributes={...K.attributes,...Z.attributes};if(Z.$head)K._pageHead=Z.$head;if(Z.title)K._pageTitle=Z.title;return delete K.$layout,K}function QJ(Z,W){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let X=new Map,Q=[];for(let J of W)if(J&&typeof J==="object"&&J.attributes?.slot){let G=J.attributes.slot;if(!X.has(G))X.set(G,[]);X.get(G).push(J)}else Q.push(J);F9(Z,X,Q)}function F9(Z,W,X){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let Q=[];for(let J of Z.children)if(J&&typeof J==="object"&&J.tagName==="slot"){let G=J.attributes?.name;if(G&&W.has(G))Q.push(...W.get(G)),W.delete(G);else if(!G&&X.length>0)Q.push(...X);else if(Array.isArray(J.children))Q.push(...J.children)}else F9(J,W,X),Q.push(J);Z.children=Q}function JJ(Z){return structuredClone(Z)}var L9=c(()=>{D1()});function A9(Z=[],W=[],X=[],Q={}){let J=[{attributes:{charset:Q.charset??"utf8"},tagName:"meta"},{attributes:{content:"width=device-width, initial-scale=1",name:"viewport"},tagName:"meta"}],G=new Map;for(let q of[...J,...Z,...W,...X]){let K=GJ(q);G.set(K,q)}let z=Q.title??Q.siteName??"Jx Site";if(G.set("title",{children:[z],tagName:"title"}),Q.pageUrl&&Q.siteUrl){let q=new URL(Q.pageUrl,Q.siteUrl).href;G.set("link:canonical",{attributes:{href:q,rel:"canonical"},tagName:"link"})}return[...G.values()]}function GJ(Z){if(!Z||typeof Z!=="object")return String(Z);let W=Z.tagName??"unknown",X=Z.attributes??{};if(W==="title")return"title";if(X.charset)return"meta:charset";if(W==="meta"&&X.name)return`meta:${X.name}`;if(W==="meta"&&X.property)return`meta:${X.property}`;if(W==="link"&&X.rel)return`link:${X.rel}:${X.href??""}`;if(W==="script"&&X.src)return`script:${X.src}`;if(W==="style"){let Q=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`style:${zJ(Q)}`}return`${W}:${JSON.stringify(Z)}`}function zJ(Z){let W=0;for(let X=0;X<Z.length;X++)W=Math.trunc((W<<5)-W+(Z.codePointAt(X)??0));return W.toString(36)}function I9(Z){return Z.map((W)=>YJ(W)).join(`
|
|
206
|
+
`)}function YJ(Z){if(typeof Z==="string")return Z;if(!Z||typeof Z!=="object")return"";let W=Z.tagName,X=Z.attributes??{},Q=Object.entries(X).map(([q,K])=>K===!0?q:`${q}="${UJ(K)}"`).join(" "),J=Q?`<${W} ${Q}>`:`<${W}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(W))return J;let z=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`${J}${z}</${W}>`}function UJ(Z){return String(Z).replaceAll("&","&").replaceAll('"',""").replaceAll("<","<")}import{dirname as qJ,relative as KJ,resolve as VJ}from"node:path";function M9(Z,W,X,Q=new Map,J=null){if(!Z.state)Z.state={};if(Z.state.$site={name:W.name??"Jx Site",url:W.url??"",...W.state},Z.state.$page={params:X._pathParams??{},title:Z.title??Z._pageTitle??W.name??"",url:X.urlPattern},W.state){for(let[G,z]of Object.entries(W.state))if(G!=="$site"&&G!=="$page"&&!(G in Z.state))Z.state[G]=z}if(W.$media)Z.$media={...W.$media,...Z.$media};if(W.imports&&Object.keys(W.imports).length>0){if(!Z.imports)Z.imports={};for(let[G,z]of Object.entries(W.imports))if(!(G in Z.imports)){let q=z;if(J&&X.sourcePath&&(q.startsWith("./")||q.startsWith("../"))){let K=VJ(J,q);Z.imports[G]=`./${KJ(qJ(X.sourcePath),K)}`}else Z.imports[G]=q}}if(W.$elements?.length)if(!Z.$elements?.length)Z.$elements=[...W.$elements];else{let G=new Set,z=[];for(let q of[...W.$elements,...Z.$elements]){let K=typeof q==="string"?q:q?.$ref;if(K&&!G.has(K))G.add(K),z.push(q)}Z.$elements=z}return Z}var w9=()=>{};import{existsSync as BJ,readFileSync as HJ,readdirSync as $J}from"node:fs";import{basename as N9,extname as D9,resolve as F3}from"node:path";function FJ(Z){let W=JSON.parse(HJ(Z,"utf8"));if(Array.isArray(W))return W.map((Q,J)=>({body:null,data:Q,id:Q.id??`${N9(Z,".json")}-${J}`}));let X=W;return[{body:null,data:X,id:X.id??N9(Z,".json")}]}function LJ(Z){if(D9(Z))return BJ(Z)?[Z]:[];try{return $J(Z,{recursive:!0}).filter((W)=>String(W).endsWith(".json")).map((W)=>F3(Z,String(W)))}catch{return[]}}function L3(Z,W){let X=F3(Z,"content");return{config:{contentTypes:W?.contentTypes??{}},contentDir:X}}async function T9(Z,W,X){let Q=L3(Z,W);if(!Q)return new Map;let{config:J}=Q,G=new Map;if(Object.keys(J.contentTypes).length===0)return G;let z=X??await p6(Z,W);for(let[q,K]of Object.entries(J.contentTypes)){let V=await AJ(q,K,Z,z);G.set(q,V)}return G}async function AJ(Z,W,X,Q){let{source:J}=W;if(!J)return[];let{schema:G}=W,z=W.$elements?.length?{allowedNames:W.$elements.filter((L)=>typeof L==="string"||typeof L==="object"&&L?.$ref).map((L)=>typeof L==="string"?L:L.$ref)}:void 0,q=W.format,K;if(q&&q!=="json"){if(K=Q.byName(q),!K)throw Error(`Content type "${Z}": format "${q}" is not an imported format class. Add it to project.json imports, e.g. "${q}": "@jxsuite/parser/${q}.class.json".`)}if(J.startsWith("http://")||J.startsWith("https://")){if(!K)throw Error(`Content type "${Z}": remote sources require an explicit "format" naming an imported format class with "remote": true (e.g. "Csv").`);if(!K.remote)throw Error(`Content type "${Z}": format "${K.name}" does not support remote sources (its format block lacks "remote": true).`);try{let L=await K.call("load",J,{directiveOptions:z,schema:G});if(G)$3(L,G,Z);return L}catch(L){return console.warn(`Content type "${Z}": ${N1(L)}`),[]}}let V=F3(X,J).split("\\").join("/"),H=D9(J).toLowerCase();if(q==="json"||!K&&H===".json"){let L=LJ(V),A=[];for(let j of L)A.push(...FJ(j));if(G)$3(A,G,Z);return A}if(!K&&H)K=Q.byExtension(H,"load");if(!K)throw Q3(J,H||`content type "${Z}" (directory sources need an explicit "format")`);let B=K.capabilities.discover?await K.call("discover",J,{baseDir:X}):[V],$=[];for(let L of B)$.push(...await K.call("load",L,{directiveOptions:z,schema:G}));if(G)$3($,G,Z);return $}function $3(Z,W,X){let Q=W.required??[],J=W.properties??{};for(let G of Z){for(let z of Q)if(!(z in G.data)||G.data[z]==null)console.warn(`Content validation: "${X}/${G.id}" missing required field "${z}"`);for(let[z,q]of Object.entries(J)){let K=G.data[z];if(K==null)continue;if(q.type==="string"&&typeof K!=="string")console.warn(`Content validation: "${X}/${G.id}" field "${z}" expected string, got ${typeof K}`);else if(q.type==="number"&&typeof K!=="number")console.warn(`Content validation: "${X}/${G.id}" field "${z}" expected number, got ${typeof K}`);else if(q.type==="boolean"&&typeof K!=="boolean")console.warn(`Content validation: "${X}/${G.id}" field "${z}" expected boolean, got ${typeof K}`);else if(q.type==="array"&&!Array.isArray(K))console.warn(`Content validation: "${X}/${G.id}" field "${z}" expected array, got ${typeof K}`)}}}function R9(Z,W){for(let[X,Q]of Object.entries(W.contentTypes)){let{schema:J}=Q;if(!J?.properties)continue;let G=Z.get(X);if(!G)continue;for(let[z,q]of Object.entries(J.properties)){let K=q;if(!K.$ref?.startsWith("#/contentTypes/"))continue;let V=K.$ref.replace("#/contentTypes/",""),H=Z.get(V);if(!H)continue;for(let B of G){let $=B.data[z];if(typeof $==="string"){let L=H.find((A)=>A.id===$);if(L)B.data[z]=L}}}}}var P9=c(()=>{D1();L6()});import{readFileSync as IJ}from"node:fs";import{dirname as A3,resolve as d4}from"node:path";import{createRequire as MJ}from"node:module";async function _9(Z,W,X,Q={}){let J=Z.imports??{},{state:G}=Z;if(!G)return;for(let[z,q]of Object.entries(G)){if(!l1(q))continue;if(wJ.has(q.$prototype))continue;if(q.timing&&q.timing!=="compiler")continue;if(!q.$src){let K=J[q.$prototype];if(!K)continue;q.$src=K}try{let K=await DJ(q,W,X,G,Q);if(q.timing&&K&&typeof K==="object"&&!Array.isArray(K))K.timing=q.timing;G[z]=K}catch(K){console.warn(`prototype-resolver: failed to resolve "${z}" ($prototype: "${q.$prototype}"):`,N1(K))}}}async function DJ(Z,W,X,Q,J){let G=Z.$src;if(!G)throw Error(`$prototype "${Z.$prototype}" has no $src to resolve`);let z;if(G.startsWith("./")||G.startsWith("../"))z=W.sourcePath?d4(A3(W.sourcePath),G):d4(X,G);else z=MJ(d4(X,"package.json")).resolve(G);let q=IJ(z,"utf8"),K=f5(q,z);if(!K.$implementation)throw Error(`${G} has no $implementation field`);let V=d4(A3(z),K.$implementation),H=await h4(V),B=Z.$export??K.title??Z.$prototype,$=H[B]??H.default?.[B];if(!$)throw Error(`Module ${K.$implementation} does not export "${B}"`);let L={};for(let[j,D]of Object.entries(Z))if(!NJ.has(j))L[j]=D;if(L.src&&!L.basePath&&W.sourcePath)L.basePath=A3(W.sourcePath);L._project={config:J.config??null,contentTypes:J.contentTypes??null,root:X},L._document={route:W,state:Q};let A=new $(L);if(typeof A.resolve==="function")return await A.resolve();return A}var wJ,NJ;var j9=c(()=>{L6();e0();D1();wJ=new Set(["Function","LocalStorage","SessionStorage","Array"]),NJ=new Set(["$prototype","$src","$export","timing","default","description"])});var E9=(Z)=>typeof Z<"u"&&Z!==null,TJ=(Z)=>typeof Z==="object",RJ=(Z)=>Object.prototype.toString.call(Z)==="[object Object]",PJ=(Z)=>typeof Z==="function",_J=(Z)=>typeof Z==="boolean",jJ=(Z)=>Z instanceof Buffer,EJ=(Z)=>{if(E9(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},CJ=(Z)=>Z instanceof ArrayBuffer,OJ=(Z)=>typeof Z==="string"&&Z.length>0,xJ=(Z)=>typeof Z==="number"&&!Number.isNaN(Z),kJ=(Z)=>Number.isInteger(Z),SJ=(Z,W,X)=>Z>=W&&Z<=X,bJ=(Z,W)=>W.includes(Z),vJ=(Z,W,X)=>Error(`Expected ${W} for ${Z} but received ${X} of type ${typeof X}`),yJ=(Z,W)=>{return W.message=Z.message,W},Y;var Q1=c(()=>{/*!
|
|
207
207
|
Copyright 2013 Lovell Fuller and others.
|
|
208
208
|
SPDX-License-Identifier: Apache-2.0
|
|
209
|
-
*/Y={defined:E5,object:jJ,plainObject:EJ,fn:CJ,bool:OJ,buffer:xJ,typedArray:kJ,arrayBuffer:SJ,string:bJ,number:vJ,integer:yJ,inRange:gJ,inArray:hJ,invalidParameterError:fJ,nativeError:mJ}});var x5=i((S$,O5)=>{var C5=()=>process.platform==="linux",l4=null,uJ=()=>{if(!l4)if(C5()&&process.report){let Z=process.report.excludeNetwork;process.report.excludeNetwork=!0,l4=process.report.getReport(),process.report.excludeNetwork=Z}else l4={};return l4};O5.exports={isLinux:C5,getReport:uJ}});var S5=i((b$,k5)=>{var A6=T0("fs"),dJ=(Z)=>{let W=A6.openSync(Z,"r"),X=Buffer.alloc(2048),Q=A6.readSync(W,X,0,2048,0);return A6.close(W,()=>{}),X.subarray(0,Q)},cJ=(Z)=>new Promise((W,X)=>{A6.open(Z,"r",(Q,J)=>{if(Q)X(Q);else{let G=Buffer.alloc(2048);A6.read(J,G,0,2048,0,(z,q)=>{W(G.subarray(0,q)),A6.close(J,()=>{})})}})});k5.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:dJ,readFile:cJ}});var v5=i((v$,b5)=>{var lJ=(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 W=Z.readUInt32LE(32),X=Z.readUInt16LE(54),Q=Z.readUInt16LE(56);for(let J=0;J<Q;J++){let G=W+J*X;if(Z.readUInt32LE(G)===3){let q=Z.readUInt32LE(G+8),K=Z.readUInt32LE(G+32);return Z.subarray(q,q+K).toString().replace(/\0.*$/g,"")}}return null};b5.exports={interpreterPath:lJ}});var n4=i((y$,t5)=>{var g5=T0("child_process"),{isLinux:M6,getReport:h5}=x5(),{LDD_PATH:p4,SELF_PATH:f5,readFile:M3,readFileSync:I3}=S5(),{interpreterPath:m5}=v5(),J1,G1,z1,y1="",u5=()=>{if(!y1)return new Promise((Z)=>{g5.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(W,X)=>{y1=W?" ":X,Z(y1)})});return y1},d5=()=>{if(!y1)try{y1=g5.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(Z){y1=" "}return y1},R1="glibc",c5=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,a1="musl",pJ=(Z)=>Z.includes("libc.musl-")||Z.includes("ld-musl-"),l5=()=>{let Z=h5();if(Z.header&&Z.header.glibcVersionRuntime)return R1;if(Array.isArray(Z.sharedObjects)){if(Z.sharedObjects.some(pJ))return a1}return null},p5=(Z)=>{let[W,X]=Z.split(/[\r\n]+/);if(W&&W.includes(R1))return R1;if(X&&X.includes(a1))return a1;return null},n5=(Z)=>{if(Z){if(Z.includes("/ld-musl-"))return a1;else if(Z.includes("/ld-linux-"))return R1}return null},i5=(Z)=>{if(Z=Z.toString(),Z.includes("musl"))return a1;if(Z.includes("GNU C Library"))return R1;return null},nJ=async()=>{if(G1!==void 0)return G1;G1=null;try{let Z=await M3(p4);G1=i5(Z)}catch(Z){}return G1},iJ=()=>{if(G1!==void 0)return G1;G1=null;try{let Z=I3(p4);G1=i5(Z)}catch(Z){}return G1},rJ=async()=>{if(J1!==void 0)return J1;J1=null;try{let Z=await M3(f5),W=m5(Z);J1=n5(W)}catch(Z){}return J1},aJ=()=>{if(J1!==void 0)return J1;J1=null;try{let Z=I3(f5),W=m5(Z);J1=n5(W)}catch(Z){}return J1},r5=async()=>{let Z=null;if(M6()){if(Z=await rJ(),!Z){if(Z=await nJ(),!Z)Z=l5();if(!Z){let W=await u5();Z=p5(W)}}}return Z},a5=()=>{let Z=null;if(M6()){if(Z=aJ(),!Z){if(Z=iJ(),!Z)Z=l5();if(!Z){let W=d5();Z=p5(W)}}}return Z},sJ=async()=>M6()&&await r5()!==R1,oJ=()=>M6()&&a5()!==R1,tJ=async()=>{if(z1!==void 0)return z1;z1=null;try{let W=(await M3(p4)).match(c5);if(W)z1=W[1]}catch(Z){}return z1},eJ=()=>{if(z1!==void 0)return z1;z1=null;try{let W=I3(p4).match(c5);if(W)z1=W[1]}catch(Z){}return z1},s5=()=>{let Z=h5();if(Z.header&&Z.header.glibcVersionRuntime)return Z.header.glibcVersionRuntime;return null},y5=(Z)=>Z.trim().split(/\s+/)[1],o5=(Z)=>{let[W,X,Q]=Z.split(/[\r\n]+/);if(W&&W.includes(R1))return y5(W);if(X&&Q&&X.includes(a1))return y5(Q);return null},ZG=async()=>{let Z=null;if(M6()){if(Z=await tJ(),!Z)Z=s5();if(!Z){let W=await u5();Z=o5(W)}}return Z},WG=()=>{let Z=null;if(M6()){if(Z=eJ(),!Z)Z=s5();if(!Z){let W=d5();Z=o5(W)}}return Z};t5.exports={GLIBC:R1,MUSL:a1,family:r5,familySync:a5,isNonGlibcLinux:sJ,isNonGlibcLinuxSync:oJ,version:ZG,versionSync:WG}});var I6=i((g$,e5)=>{var XG=Number.MAX_SAFE_INTEGER||9007199254740991,QG=["major","premajor","minor","preminor","patch","prepatch","prerelease"];e5.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:XG,RELEASE_TYPES:QG,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var a6=i((h$,ZZ)=>{var JG=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...Z)=>console.error("SEMVER",...Z):()=>{};ZZ.exports=JG});var w6=i((Y1,WZ)=>{var{MAX_SAFE_COMPONENT_LENGTH:w3,MAX_SAFE_BUILD_LENGTH:GG,MAX_LENGTH:zG}=I6(),YG=a6();Y1=WZ.exports={};var UG=Y1.re=[],qG=Y1.safeRe=[],y=Y1.src=[],KG=Y1.safeSrc=[],g=Y1.t={},VG=0,N3="[a-zA-Z0-9-]",BG=[["\\s",1],["\\d",zG],[N3,GG]],HG=(Z)=>{for(let[W,X]of BG)Z=Z.split(`${W}*`).join(`${W}{0,${X}}`).split(`${W}+`).join(`${W}{1,${X}}`);return Z},a=(Z,W,X)=>{let Q=HG(W),J=VG++;YG(Z,J,W),g[Z]=J,y[J]=W,KG[J]=Q,UG[J]=new RegExp(W,X?"g":void 0),qG[J]=new RegExp(Q,X?"g":void 0)};a("NUMERICIDENTIFIER","0|[1-9]\\d*");a("NUMERICIDENTIFIERLOOSE","\\d+");a("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${N3}*`);a("MAINVERSION",`(${y[g.NUMERICIDENTIFIER]})\\.(${y[g.NUMERICIDENTIFIER]})\\.(${y[g.NUMERICIDENTIFIER]})`);a("MAINVERSIONLOOSE",`(${y[g.NUMERICIDENTIFIERLOOSE]})\\.(${y[g.NUMERICIDENTIFIERLOOSE]})\\.(${y[g.NUMERICIDENTIFIERLOOSE]})`);a("PRERELEASEIDENTIFIER",`(?:${y[g.NONNUMERICIDENTIFIER]}|${y[g.NUMERICIDENTIFIER]})`);a("PRERELEASEIDENTIFIERLOOSE",`(?:${y[g.NONNUMERICIDENTIFIER]}|${y[g.NUMERICIDENTIFIERLOOSE]})`);a("PRERELEASE",`(?:-(${y[g.PRERELEASEIDENTIFIER]}(?:\\.${y[g.PRERELEASEIDENTIFIER]})*))`);a("PRERELEASELOOSE",`(?:-?(${y[g.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${y[g.PRERELEASEIDENTIFIERLOOSE]})*))`);a("BUILDIDENTIFIER",`${N3}+`);a("BUILD",`(?:\\+(${y[g.BUILDIDENTIFIER]}(?:\\.${y[g.BUILDIDENTIFIER]})*))`);a("FULLPLAIN",`v?${y[g.MAINVERSION]}${y[g.PRERELEASE]}?${y[g.BUILD]}?`);a("FULL",`^${y[g.FULLPLAIN]}$`);a("LOOSEPLAIN",`[v=\\s]*${y[g.MAINVERSIONLOOSE]}${y[g.PRERELEASELOOSE]}?${y[g.BUILD]}?`);a("LOOSE",`^${y[g.LOOSEPLAIN]}$`);a("GTLT","((?:<|>)?=?)");a("XRANGEIDENTIFIERLOOSE",`${y[g.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);a("XRANGEIDENTIFIER",`${y[g.NUMERICIDENTIFIER]}|x|X|\\*`);a("XRANGEPLAIN",`[v=\\s]*(${y[g.XRANGEIDENTIFIER]})(?:\\.(${y[g.XRANGEIDENTIFIER]})(?:\\.(${y[g.XRANGEIDENTIFIER]})(?:${y[g.PRERELEASE]})?${y[g.BUILD]}?)?)?`);a("XRANGEPLAINLOOSE",`[v=\\s]*(${y[g.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[g.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[g.XRANGEIDENTIFIERLOOSE]})(?:${y[g.PRERELEASELOOSE]})?${y[g.BUILD]}?)?)?`);a("XRANGE",`^${y[g.GTLT]}\\s*${y[g.XRANGEPLAIN]}$`);a("XRANGELOOSE",`^${y[g.GTLT]}\\s*${y[g.XRANGEPLAINLOOSE]}$`);a("COERCEPLAIN",`(^|[^\\d])(\\d{1,${w3}})(?:\\.(\\d{1,${w3}}))?(?:\\.(\\d{1,${w3}}))?`);a("COERCE",`${y[g.COERCEPLAIN]}(?:$|[^\\d])`);a("COERCEFULL",y[g.COERCEPLAIN]+`(?:${y[g.PRERELEASE]})?(?:${y[g.BUILD]})?(?:$|[^\\d])`);a("COERCERTL",y[g.COERCE],!0);a("COERCERTLFULL",y[g.COERCEFULL],!0);a("LONETILDE","(?:~>?)");a("TILDETRIM",`(\\s*)${y[g.LONETILDE]}\\s+`,!0);Y1.tildeTrimReplace="$1~";a("TILDE",`^${y[g.LONETILDE]}${y[g.XRANGEPLAIN]}$`);a("TILDELOOSE",`^${y[g.LONETILDE]}${y[g.XRANGEPLAINLOOSE]}$`);a("LONECARET","(?:\\^)");a("CARETTRIM",`(\\s*)${y[g.LONECARET]}\\s+`,!0);Y1.caretTrimReplace="$1^";a("CARET",`^${y[g.LONECARET]}${y[g.XRANGEPLAIN]}$`);a("CARETLOOSE",`^${y[g.LONECARET]}${y[g.XRANGEPLAINLOOSE]}$`);a("COMPARATORLOOSE",`^${y[g.GTLT]}\\s*(${y[g.LOOSEPLAIN]})$|^$`);a("COMPARATOR",`^${y[g.GTLT]}\\s*(${y[g.FULLPLAIN]})$|^$`);a("COMPARATORTRIM",`(\\s*)${y[g.GTLT]}\\s*(${y[g.LOOSEPLAIN]}|${y[g.XRANGEPLAIN]})`,!0);Y1.comparatorTrimReplace="$1$2$3";a("HYPHENRANGE",`^\\s*(${y[g.XRANGEPLAIN]})\\s+-\\s+(${y[g.XRANGEPLAIN]})\\s*$`);a("HYPHENRANGELOOSE",`^\\s*(${y[g.XRANGEPLAINLOOSE]})\\s+-\\s+(${y[g.XRANGEPLAINLOOSE]})\\s*$`);a("STAR","(<|>)?=?\\s*\\*");a("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");a("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var i4=i((f$,XZ)=>{var $G=Object.freeze({loose:!0}),FG=Object.freeze({}),LG=(Z)=>{if(!Z)return FG;if(typeof Z!=="object")return $G;return Z};XZ.exports=LG});var D3=i((m$,GZ)=>{var QZ=/^[0-9]+$/,JZ=(Z,W)=>{if(typeof Z==="number"&&typeof W==="number")return Z===W?0:Z<W?-1:1;let X=QZ.test(Z),Q=QZ.test(W);if(X&&Q)Z=+Z,W=+W;return Z===W?0:X&&!Q?-1:Q&&!X?1:Z<W?-1:1},AG=(Z,W)=>JZ(W,Z);GZ.exports={compareIdentifiers:JZ,rcompareIdentifiers:AG}});var P0=i((u$,YZ)=>{var r4=a6(),{MAX_LENGTH:zZ,MAX_SAFE_INTEGER:a4}=I6(),{safeRe:s4,t:o4}=w6(),MG=i4(),{compareIdentifiers:T3}=D3(),IG=(Z,W)=>{let X=W.split(".");if(X.length>Z.length)return!1;for(let Q=0;Q<X.length;Q++)if(T3(Z[Q],X[Q])!==0)return!1;return!0};class t0{constructor(Z,W){if(W=MG(W),Z instanceof t0)if(Z.loose===!!W.loose&&Z.includePrerelease===!!W.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>zZ)throw TypeError(`version is longer than ${zZ} characters`);r4("SemVer",Z,W),this.options=W,this.loose=!!W.loose,this.includePrerelease=!!W.includePrerelease;let X=Z.trim().match(W.loose?s4[o4.LOOSE]:s4[o4.FULL]);if(!X)throw TypeError(`Invalid Version: ${Z}`);if(this.raw=Z,this.major=+X[1],this.minor=+X[2],this.patch=+X[3],this.major>a4||this.major<0)throw TypeError("Invalid major version");if(this.minor>a4||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>a4||this.patch<0)throw TypeError("Invalid patch version");if(!X[4])this.prerelease=[];else this.prerelease=X[4].split(".").map((Q)=>{if(/^[0-9]+$/.test(Q)){let J=+Q;if(J>=0&&J<a4)return J}return Q});this.build=X[5]?X[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(Z){if(r4("SemVer.compare",this.version,this.options,Z),!(Z instanceof t0)){if(typeof Z==="string"&&Z===this.version)return 0;Z=new t0(Z,this.options)}if(Z.version===this.version)return 0;return this.compareMain(Z)||this.comparePre(Z)}compareMain(Z){if(!(Z instanceof t0))Z=new t0(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 t0))Z=new t0(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 W=0;do{let X=this.prerelease[W],Q=Z.prerelease[W];if(r4("prerelease compare",W,X,Q),X===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(X===void 0)return-1;else if(X===Q)continue;else return T3(X,Q)}while(++W)}compareBuild(Z){if(!(Z instanceof t0))Z=new t0(Z,this.options);let W=0;do{let X=this.build[W],Q=Z.build[W];if(r4("build compare",W,X,Q),X===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(X===void 0)return-1;else if(X===Q)continue;else return T3(X,Q)}while(++W)}inc(Z,W,X){if(Z.startsWith("pre")){if(!W&&X===!1)throw Error("invalid increment argument: identifier is empty");if(W){let Q=`-${W}`.match(this.options.loose?s4[o4.PRERELEASELOOSE]:s4[o4.PRERELEASE]);if(!Q||Q[1]!==W)throw Error(`invalid identifier: ${W}`)}}switch(Z){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",W,X);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",W,X);break;case"prepatch":this.prerelease.length=0,this.inc("patch",W,X),this.inc("pre",W,X);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",W,X);this.inc("pre",W,X);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let Q=Number(X)?1:0;if(this.prerelease.length===0)this.prerelease=[Q];else{let J=this.prerelease.length;while(--J>=0)if(typeof this.prerelease[J]==="number")this.prerelease[J]++,J=-2;if(J===-1){if(W===this.prerelease.join(".")&&X===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(Q)}}if(W){let J=[W,Q];if(X===!1)J=[W];if(IG(this.prerelease,W)){let G=this.prerelease[W.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}}YZ.exports=t0});var g1=i((d$,qZ)=>{var UZ=P0(),wG=(Z,W,X=!1)=>{if(Z instanceof UZ)return Z;try{return new UZ(Z,W)}catch(Q){if(!X)return null;throw Q}};qZ.exports=wG});var VZ=i((c$,KZ)=>{var NG=g1(),DG=(Z,W)=>{let X=NG(Z,W);return X?X.version:null};KZ.exports=DG});var HZ=i((l$,BZ)=>{var TG=g1(),RG=(Z,W)=>{let X=TG(Z.trim().replace(/^[=v]+/,""),W);return X?X.version:null};BZ.exports=RG});var LZ=i((p$,FZ)=>{var $Z=P0(),PG=(Z,W,X,Q,J)=>{if(typeof X==="string")J=Q,Q=X,X=void 0;try{return new $Z(Z instanceof $Z?Z.version:Z,X).inc(W,Q,J).version}catch(G){return null}};FZ.exports=PG});var IZ=i((n$,MZ)=>{var AZ=g1(),_G=(Z,W)=>{let X=AZ(Z,null,!0),Q=AZ(W,null,!0),J=X.compare(Q);if(J===0)return null;let G=J>0,z=G?X:Q,q=G?Q:X,K=!!z.prerelease.length;if(!!q.prerelease.length&&!K){if(!q.patch&&!q.minor)return"major";if(q.compareMain(z)===0){if(q.minor&&!q.patch)return"minor";return"patch"}}let H=K?"pre":"";if(X.major!==Q.major)return H+"major";if(X.minor!==Q.minor)return H+"minor";if(X.patch!==Q.patch)return H+"patch";return"prerelease"};MZ.exports=_G});var NZ=i((i$,wZ)=>{var jG=P0(),EG=(Z,W)=>new jG(Z,W).major;wZ.exports=EG});var TZ=i((r$,DZ)=>{var CG=P0(),OG=(Z,W)=>new CG(Z,W).minor;DZ.exports=OG});var PZ=i((a$,RZ)=>{var xG=P0(),kG=(Z,W)=>new xG(Z,W).patch;RZ.exports=kG});var jZ=i((s$,_Z)=>{var SG=g1(),bG=(Z,W)=>{let X=SG(Z,W);return X&&X.prerelease.length?X.prerelease:null};_Z.exports=bG});var n0=i((o$,CZ)=>{var EZ=P0(),vG=(Z,W,X)=>new EZ(Z,X).compare(new EZ(W,X));CZ.exports=vG});var xZ=i((t$,OZ)=>{var yG=n0(),gG=(Z,W,X)=>yG(W,Z,X);OZ.exports=gG});var SZ=i((e$,kZ)=>{var hG=n0(),fG=(Z,W)=>hG(Z,W,!0);kZ.exports=fG});var t4=i((ZF,vZ)=>{var bZ=P0(),mG=(Z,W,X)=>{let Q=new bZ(Z,X),J=new bZ(W,X);return Q.compare(J)||Q.compareBuild(J)};vZ.exports=mG});var gZ=i((WF,yZ)=>{var uG=t4(),dG=(Z,W)=>Z.sort((X,Q)=>uG(X,Q,W));yZ.exports=dG});var fZ=i((XF,hZ)=>{var cG=t4(),lG=(Z,W)=>Z.sort((X,Q)=>cG(Q,X,W));hZ.exports=lG});var s6=i((QF,mZ)=>{var pG=n0(),nG=(Z,W,X)=>pG(Z,W,X)>0;mZ.exports=nG});var e4=i((JF,uZ)=>{var iG=n0(),rG=(Z,W,X)=>iG(Z,W,X)<0;uZ.exports=rG});var R3=i((GF,dZ)=>{var aG=n0(),sG=(Z,W,X)=>aG(Z,W,X)===0;dZ.exports=sG});var P3=i((zF,cZ)=>{var oG=n0(),tG=(Z,W,X)=>oG(Z,W,X)!==0;cZ.exports=tG});var Z2=i((YF,lZ)=>{var eG=n0(),Zz=(Z,W,X)=>eG(Z,W,X)>=0;lZ.exports=Zz});var W2=i((UF,pZ)=>{var Wz=n0(),Xz=(Z,W,X)=>Wz(Z,W,X)<=0;pZ.exports=Xz});var _3=i((qF,nZ)=>{var Qz=R3(),Jz=P3(),Gz=s6(),zz=Z2(),Yz=e4(),Uz=W2(),qz=(Z,W,X,Q)=>{switch(W){case"===":if(typeof Z==="object")Z=Z.version;if(typeof X==="object")X=X.version;return Z===X;case"!==":if(typeof Z==="object")Z=Z.version;if(typeof X==="object")X=X.version;return Z!==X;case"":case"=":case"==":return Qz(Z,X,Q);case"!=":return Jz(Z,X,Q);case">":return Gz(Z,X,Q);case">=":return zz(Z,X,Q);case"<":return Yz(Z,X,Q);case"<=":return Uz(Z,X,Q);default:throw TypeError(`Invalid operator: ${W}`)}};nZ.exports=qz});var rZ=i((KF,iZ)=>{var Kz=P0(),Vz=g1(),{safeRe:X2,t:Q2}=w6(),Bz=(Z,W)=>{if(Z instanceof Kz)return Z;if(typeof Z==="number")Z=String(Z);if(typeof Z!=="string")return null;W=W||{};let X=null;if(!W.rtl)X=Z.match(W.includePrerelease?X2[Q2.COERCEFULL]:X2[Q2.COERCE]);else{let K=W.includePrerelease?X2[Q2.COERCERTLFULL]:X2[Q2.COERCERTL],V;while((V=K.exec(Z))&&(!X||X.index+X[0].length!==Z.length)){if(!X||V.index+V[0].length!==X.index+X[0].length)X=V;K.lastIndex=V.index+V[1].length+V[2].length}K.lastIndex=-1}if(X===null)return null;let Q=X[2],J=X[3]||"0",G=X[4]||"0",z=W.includePrerelease&&X[5]?`-${X[5]}`:"",q=W.includePrerelease&&X[6]?`+${X[6]}`:"";return Vz(`${Q}.${J}.${G}${z}${q}`,W)};iZ.exports=Bz});var sZ=i((VF,aZ)=>{var Hz=g1(),$z=I6(),Fz=P0(),Lz=(Z,W,X)=>{if(!$z.RELEASE_TYPES.includes(W))return null;let Q=Az(Z,X);return Q&&Mz(Q,W)},Az=(Z,W)=>{let X=Z instanceof Fz?Z.version:Z;return Hz(X,W)},Mz=(Z,W)=>{if(Iz(W))return Z.version;switch(Z.prerelease=[],W){case"major":Z.minor=0,Z.patch=0;break;case"minor":Z.patch=0;break}return Z.format()},Iz=(Z)=>{return Z.startsWith("pre")};aZ.exports=Lz});var eZ=i((BF,tZ)=>{class oZ{constructor(){this.max=1000,this.map=new Map}get(Z){let W=this.map.get(Z);if(W===void 0)return;else return this.map.delete(Z),this.map.set(Z,W),W}delete(Z){return this.map.delete(Z)}set(Z,W){if(!this.delete(Z)&&W!==void 0){if(this.map.size>=this.max){let Q=this.map.keys().next().value;this.delete(Q)}this.map.set(Z,W)}return this}}tZ.exports=oZ});var i0=i((HF,Q7)=>{var wz=/\s+/g;class o6{constructor(Z,W){if(W=Dz(W),Z instanceof o6)if(Z.loose===!!W.loose&&Z.includePrerelease===!!W.includePrerelease)return Z;else return new o6(Z.raw,W);if(Z instanceof j3)return this.raw=Z.value,this.set=[[Z]],this.formatted=void 0,this;if(this.options=W,this.loose=!!W.loose,this.includePrerelease=!!W.includePrerelease,this.raw=Z.trim().replace(wz," "),this.set=this.raw.split("||").map((X)=>this.parseRange(X.trim())).filter((X)=>X.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let X=this.set[0];if(this.set=this.set.filter((Q)=>!W7(Q[0])),this.set.length===0)this.set=[X];else if(this.set.length>1){for(let Q of this.set)if(Q.length===1&&xz(Q[0])){this.set=[Q];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let Z=0;Z<this.set.length;Z++){if(Z>0)this.formatted+="||";let W=this.set[Z];for(let X=0;X<W.length;X++){if(X>0)this.formatted+=" ";this.formatted+=W[X].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(Z){Z=Z.replace(Oz,"");let X=((this.options.includePrerelease&&Ez)|(this.options.loose&&Cz))+":"+Z,Q=Z7.get(X);if(Q)return Q;let J=this.options.loose,G=J?x0[_0.HYPHENRANGELOOSE]:x0[_0.HYPHENRANGE];Z=Z.replace(G,dz(this.options.includePrerelease)),z0("hyphen replace",Z),Z=Z.replace(x0[_0.COMPARATORTRIM],Pz),z0("comparator trim",Z),Z=Z.replace(x0[_0.TILDETRIM],_z),z0("tilde trim",Z),Z=Z.replace(x0[_0.CARETTRIM],jz),z0("caret trim",Z);let z=Z.split(" ").map((H)=>kz(H,this.options)).join(" ").split(/\s+/).map((H)=>uz(H,this.options));if(J)z=z.filter((H)=>{return z0("loose invalid filter",H,this.options),!!H.match(x0[_0.COMPARATORLOOSE])});z0("range list",z);let q=new Map,K=z.map((H)=>new j3(H,this.options));for(let H of K){if(W7(H))return[H];q.set(H.value,H)}if(q.size>1&&q.has(""))q.delete("");let V=[...q.values()];return Z7.set(X,V),V}intersects(Z,W){if(!(Z instanceof o6))throw TypeError("a Range is required");return this.set.some((X)=>{return X7(X,W)&&Z.set.some((Q)=>{return X7(Q,W)&&X.every((J)=>{return Q.every((G)=>{return J.intersects(G,W)})})})})}test(Z){if(!Z)return!1;if(typeof Z==="string")try{Z=new Tz(Z,this.options)}catch(W){return!1}for(let W=0;W<this.set.length;W++)if(cz(this.set[W],Z,this.options))return!0;return!1}}Q7.exports=o6;var Nz=eZ(),Z7=new Nz,Dz=i4(),j3=t6(),z0=a6(),Tz=P0(),{safeRe:x0,src:Rz,t:_0,comparatorTrimReplace:Pz,tildeTrimReplace:_z,caretTrimReplace:jz}=w6(),{FLAG_INCLUDE_PRERELEASE:Ez,FLAG_LOOSE:Cz}=I6(),Oz=new RegExp(Rz[_0.BUILD],"g"),W7=(Z)=>Z.value==="<0.0.0-0",xz=(Z)=>Z.value==="",X7=(Z,W)=>{let X=!0,Q=Z.slice(),J=Q.pop();while(X&&Q.length)X=Q.every((G)=>{return J.intersects(G,W)}),J=Q.pop();return X},kz=(Z,W)=>{return Z=Z.replace(x0[_0.BUILD],""),z0("comp",Z,W),Z=yz(Z,W),z0("caret",Z),Z=bz(Z,W),z0("tildes",Z),Z=hz(Z,W),z0("xrange",Z),Z=mz(Z,W),z0("stars",Z),Z},M0=(Z)=>!Z||Z.toLowerCase()==="x"||Z==="*",Sz=(Z,W,X)=>M0(Z)&&!M0(W)||M0(W)&&X&&!M0(X),bz=(Z,W)=>{return Z.trim().split(/\s+/).map((X)=>vz(X,W)).join(" ")},vz=(Z,W)=>{let X=W.loose?x0[_0.TILDELOOSE]:x0[_0.TILDE];return Z.replace(X,(Q,J,G,z,q)=>{z0("tilde",Z,Q,J,G,z,q);let K;if(M0(J))K="";else if(M0(G))K=`>=${J}.0.0 <${+J+1}.0.0-0`;else if(M0(z))K=`>=${J}.${G}.0 <${J}.${+G+1}.0-0`;else if(q)z0("replaceTilde pr",q),K=`>=${J}.${G}.${z}-${q} <${J}.${+G+1}.0-0`;else K=`>=${J}.${G}.${z} <${J}.${+G+1}.0-0`;return z0("tilde return",K),K})},yz=(Z,W)=>{return Z.trim().split(/\s+/).map((X)=>gz(X,W)).join(" ")},gz=(Z,W)=>{z0("caret",Z,W);let X=W.loose?x0[_0.CARETLOOSE]:x0[_0.CARET],Q=W.includePrerelease?"-0":"";return Z.replace(X,(J,G,z,q,K)=>{z0("caret",Z,J,G,z,q,K);let V;if(M0(G))V="";else if(M0(z))V=`>=${G}.0.0${Q} <${+G+1}.0.0-0`;else if(M0(q))if(G==="0")V=`>=${G}.${z}.0${Q} <${G}.${+z+1}.0-0`;else V=`>=${G}.${z}.0${Q} <${+G+1}.0.0-0`;else if(K)if(z0("replaceCaret pr",K),G==="0")if(z==="0")V=`>=${G}.${z}.${q}-${K} <${G}.${z}.${+q+1}-0`;else V=`>=${G}.${z}.${q}-${K} <${G}.${+z+1}.0-0`;else V=`>=${G}.${z}.${q}-${K} <${+G+1}.0.0-0`;else if(z0("no pr"),G==="0")if(z==="0")V=`>=${G}.${z}.${q} <${G}.${z}.${+q+1}-0`;else V=`>=${G}.${z}.${q} <${G}.${+z+1}.0-0`;else V=`>=${G}.${z}.${q} <${+G+1}.0.0-0`;return z0("caret return",V),V})},hz=(Z,W)=>{return z0("replaceXRanges",Z,W),Z.split(/\s+/).map((X)=>fz(X,W)).join(" ")},fz=(Z,W)=>{Z=Z.trim();let X=W.loose?x0[_0.XRANGELOOSE]:x0[_0.XRANGE];return Z.replace(X,(Q,J,G,z,q,K)=>{if(z0("xRange",Z,Q,J,G,z,q,K),Sz(G,z,q))return Z;let V=M0(G),H=V||M0(z),B=H||M0(q),$=B;if(J==="="&&$)J="";if(K=W.includePrerelease?"-0":"",V)if(J===">"||J==="<")Q="<0.0.0-0";else Q="*";else if(J&&$){if(H)z=0;if(q=0,J===">")if(J=">=",H)G=+G+1,z=0,q=0;else z=+z+1,q=0;else if(J==="<=")if(J="<",H)G=+G+1;else z=+z+1;if(J==="<")K="-0";Q=`${J+G}.${z}.${q}${K}`}else if(H)Q=`>=${G}.0.0${K} <${+G+1}.0.0-0`;else if(B)Q=`>=${G}.${z}.0${K} <${G}.${+z+1}.0-0`;return z0("xRange return",Q),Q})},mz=(Z,W)=>{return z0("replaceStars",Z,W),Z.trim().replace(x0[_0.STAR],"")},uz=(Z,W)=>{return z0("replaceGTE0",Z,W),Z.trim().replace(x0[W.includePrerelease?_0.GTE0PRE:_0.GTE0],"")},dz=(Z)=>(W,X,Q,J,G,z,q,K,V,H,B,$)=>{if(M0(Q))X="";else if(M0(J))X=`>=${Q}.0.0${Z?"-0":""}`;else if(M0(G))X=`>=${Q}.${J}.0${Z?"-0":""}`;else if(z)X=`>=${X}`;else X=`>=${X}${Z?"-0":""}`;if(M0(V))K="";else if(M0(H))K=`<${+V+1}.0.0-0`;else if(M0(B))K=`<${V}.${+H+1}.0-0`;else if($)K=`<=${V}.${H}.${B}-${$}`;else if(Z)K=`<${V}.${H}.${+B+1}-0`;else K=`<=${K}`;return`${X} ${K}`.trim()},cz=(Z,W,X)=>{for(let Q=0;Q<Z.length;Q++)if(!Z[Q].test(W))return!1;if(W.prerelease.length&&!X.includePrerelease){for(let Q=0;Q<Z.length;Q++){if(z0(Z[Q].semver),Z[Q].semver===j3.ANY)continue;if(Z[Q].semver.prerelease.length>0){let J=Z[Q].semver;if(J.major===W.major&&J.minor===W.minor&&J.patch===W.patch)return!0}}return!1}return!0}});var t6=i(($F,q7)=>{var e6=Symbol("SemVer ANY");class J2{static get ANY(){return e6}constructor(Z,W){if(W=J7(W),Z instanceof J2)if(Z.loose===!!W.loose)return Z;else Z=Z.value;if(Z=Z.trim().split(/\s+/).join(" "),C3("comparator",Z,W),this.options=W,this.loose=!!W.loose,this.parse(Z),this.semver===e6)this.value="";else this.value=this.operator+this.semver.version;C3("comp",this)}parse(Z){let W=this.options.loose?G7[z7.COMPARATORLOOSE]:G7[z7.COMPARATOR],X=Z.match(W);if(!X)throw TypeError(`Invalid comparator: ${Z}`);if(this.operator=X[1]!==void 0?X[1]:"",this.operator==="=")this.operator="";if(!X[2])this.semver=e6;else this.semver=new Y7(X[2],this.options.loose)}toString(){return this.value}test(Z){if(C3("Comparator.test",Z,this.options.loose),this.semver===e6||Z===e6)return!0;if(typeof Z==="string")try{Z=new Y7(Z,this.options)}catch(W){return!1}return E3(Z,this.operator,this.semver,this.options)}intersects(Z,W){if(!(Z instanceof J2))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new U7(Z.value,W).test(this.value)}else if(Z.operator===""){if(Z.value==="")return!0;return new U7(this.value,W).test(Z.semver)}if(W=J7(W),W.includePrerelease&&(this.value==="<0.0.0-0"||Z.value==="<0.0.0-0"))return!1;if(!W.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(E3(this.semver,"<",Z.semver,W)&&this.operator.startsWith(">")&&Z.operator.startsWith("<"))return!0;if(E3(this.semver,">",Z.semver,W)&&this.operator.startsWith("<")&&Z.operator.startsWith(">"))return!0;return!1}}q7.exports=J2;var J7=i4(),{safeRe:G7,t:z7}=w6(),E3=_3(),C3=a6(),Y7=P0(),U7=i0()});var Z4=i((FF,K7)=>{var lz=i0(),pz=(Z,W,X)=>{try{W=new lz(W,X)}catch(Q){return!1}return W.test(Z)};K7.exports=pz});var B7=i((LF,V7)=>{var nz=i0(),iz=(Z,W)=>new nz(Z,W).set.map((X)=>X.map((Q)=>Q.value).join(" ").trim().split(" "));V7.exports=iz});var $7=i((AF,H7)=>{var rz=P0(),az=i0(),sz=(Z,W,X)=>{let Q=null,J=null,G=null;try{G=new az(W,X)}catch(z){return null}return Z.forEach((z)=>{if(G.test(z)){if(!Q||J.compare(z)===-1)Q=z,J=new rz(Q,X)}}),Q};H7.exports=sz});var L7=i((MF,F7)=>{var oz=P0(),tz=i0(),ez=(Z,W,X)=>{let Q=null,J=null,G=null;try{G=new tz(W,X)}catch(z){return null}return Z.forEach((z)=>{if(G.test(z)){if(!Q||J.compare(z)===1)Q=z,J=new oz(Q,X)}}),Q};F7.exports=ez});var I7=i((IF,M7)=>{var O3=P0(),ZY=i0(),A7=s6(),WY=(Z,W)=>{Z=new ZY(Z,W);let X=new O3("0.0.0");if(Z.test(X))return X;if(X=new O3("0.0.0-0"),Z.test(X))return X;X=null;for(let Q=0;Q<Z.set.length;++Q){let J=Z.set[Q],G=null;if(J.forEach((z)=>{let q=new O3(z.semver.version);switch(z.operator){case">":if(q.prerelease.length===0)q.patch++;else q.prerelease.push(0);q.raw=q.format();case"":case">=":if(!G||A7(q,G))G=q;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${z.operator}`)}}),G&&(!X||A7(X,G)))X=G}if(X&&Z.test(X))return X;return null};M7.exports=WY});var N7=i((wF,w7)=>{var XY=i0(),QY=(Z,W)=>{try{return new XY(Z,W).range||"*"}catch(X){return null}};w7.exports=QY});var G2=i((NF,P7)=>{var JY=P0(),R7=t6(),{ANY:GY}=R7,zY=i0(),YY=Z4(),D7=s6(),T7=e4(),UY=W2(),qY=Z2(),KY=(Z,W,X,Q)=>{Z=new JY(Z,Q),W=new zY(W,Q);let J,G,z,q,K;switch(X){case">":J=D7,G=UY,z=T7,q=">",K=">=";break;case"<":J=T7,G=qY,z=D7,q="<",K="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(YY(Z,W,Q))return!1;for(let V=0;V<W.set.length;++V){let H=W.set[V],B=null,$=null;if(H.forEach((L)=>{if(L.semver===GY)L=new R7(">=0.0.0");if(B=B||L,$=$||L,J(L.semver,B.semver,Q))B=L;else if(z(L.semver,$.semver,Q))$=L}),B.operator===q||B.operator===K)return!1;if((!$.operator||$.operator===q)&&G(Z,$.semver))return!1;else if($.operator===K&&z(Z,$.semver))return!1}return!0};P7.exports=KY});var j7=i((DF,_7)=>{var VY=G2(),BY=(Z,W,X)=>VY(Z,W,">",X);_7.exports=BY});var C7=i((TF,E7)=>{var HY=G2(),$Y=(Z,W,X)=>HY(Z,W,"<",X);E7.exports=$Y});var k7=i((RF,x7)=>{var O7=i0(),FY=(Z,W,X)=>{return Z=new O7(Z,X),W=new O7(W,X),Z.intersects(W,X)};x7.exports=FY});var b7=i((PF,S7)=>{var LY=Z4(),AY=n0();S7.exports=(Z,W,X)=>{let Q=[],J=null,G=null,z=Z.sort((H,B)=>AY(H,B,X));for(let H of z)if(LY(H,W,X)){if(G=H,!J)J=H}else{if(G)Q.push([J,G]);G=null,J=null}if(J)Q.push([J,null]);let q=[];for(let[H,B]of Q)if(H===B)q.push(H);else if(!B&&H===z[0])q.push("*");else if(!B)q.push(`>=${H}`);else if(H===z[0])q.push(`<=${B}`);else q.push(`${H} - ${B}`);let K=q.join(" || "),V=typeof W.raw==="string"?W.raw:String(W);return K.length<V.length?K:W}});var m7=i((_F,f7)=>{var v7=i0(),S3=t6(),{ANY:x3}=S3,k3=Z4(),b3=n0(),MY=(Z,W,X={})=>{if(Z===W)return!0;Z=new v7(Z,X),W=new v7(W,X);let Q=!1;Z:for(let J of Z.set){for(let G of W.set){let z=wY(J,G,X);if(Q=Q||z!==null,z)continue Z}if(Q)return!1}return!0},IY=[new S3(">=0.0.0-0")],y7=[new S3(">=0.0.0")],wY=(Z,W,X)=>{if(Z===W)return!0;if(Z.length===1&&Z[0].semver===x3)if(W.length===1&&W[0].semver===x3)return!0;else if(X.includePrerelease)Z=IY;else Z=y7;if(W.length===1&&W[0].semver===x3)if(X.includePrerelease)return!0;else W=y7;let Q=new Set,J,G;for(let L of Z)if(L.operator===">"||L.operator===">=")J=g7(J,L,X);else if(L.operator==="<"||L.operator==="<=")G=h7(G,L,X);else Q.add(L.semver);if(Q.size>1)return null;let z;if(J&&G){if(z=b3(J.semver,G.semver,X),z>0)return null;else if(z===0&&(J.operator!==">="||G.operator!=="<="))return null}for(let L of Q){if(J&&!k3(L,String(J),X))return null;if(G&&!k3(L,String(G),X))return null;for(let A of W)if(!k3(L,String(A),X))return!1;return!0}let q,K,V,H,B=G&&!X.includePrerelease&&G.semver.prerelease.length?G.semver:!1,$=J&&!X.includePrerelease&&J.semver.prerelease.length?J.semver:!1;if(B&&B.prerelease.length===1&&G.operator==="<"&&B.prerelease[0]===0)B=!1;for(let L of W){if(H=H||L.operator===">"||L.operator===">=",V=V||L.operator==="<"||L.operator==="<=",J){if($){if(L.semver.prerelease&&L.semver.prerelease.length&&L.semver.major===$.major&&L.semver.minor===$.minor&&L.semver.patch===$.patch)$=!1}if(L.operator===">"||L.operator===">="){if(q=g7(J,L,X),q===L&&q!==J)return!1}else if(J.operator===">="&&!L.test(J.semver))return!1}if(G){if(B){if(L.semver.prerelease&&L.semver.prerelease.length&&L.semver.major===B.major&&L.semver.minor===B.minor&&L.semver.patch===B.patch)B=!1}if(L.operator==="<"||L.operator==="<="){if(K=h7(G,L,X),K===L&&K!==G)return!1}else if(G.operator==="<="&&!L.test(G.semver))return!1}if(!L.operator&&(G||J)&&z!==0)return!1}if(J&&V&&!G&&z!==0)return!1;if(G&&H&&!J&&z!==0)return!1;if($||B)return!1;return!0},g7=(Z,W,X)=>{if(!Z)return W;let Q=b3(Z.semver,W.semver,X);return Q>0?Z:Q<0?W:W.operator===">"&&Z.operator===">="?W:Z},h7=(Z,W,X)=>{if(!Z)return W;let Q=b3(Z.semver,W.semver,X);return Q<0?Z:Q>0?W:W.operator==="<"&&Z.operator==="<="?W:Z};f7.exports=MY});var l7=i((jF,c7)=>{var v3=w6(),u7=I6(),NY=P0(),d7=D3(),DY=g1(),TY=VZ(),RY=HZ(),PY=LZ(),_Y=IZ(),jY=NZ(),EY=TZ(),CY=PZ(),OY=jZ(),xY=n0(),kY=xZ(),SY=SZ(),bY=t4(),vY=gZ(),yY=fZ(),gY=s6(),hY=e4(),fY=R3(),mY=P3(),uY=Z2(),dY=W2(),cY=_3(),lY=rZ(),pY=sZ(),nY=t6(),iY=i0(),rY=Z4(),aY=B7(),sY=$7(),oY=L7(),tY=I7(),eY=N7(),ZU=G2(),WU=j7(),XU=C7(),QU=k7(),JU=b7(),GU=m7();c7.exports={parse:DY,valid:TY,clean:RY,inc:PY,diff:_Y,major:jY,minor:EY,patch:CY,prerelease:OY,compare:xY,rcompare:kY,compareLoose:SY,compareBuild:bY,sort:vY,rsort:yY,gt:gY,lt:hY,eq:fY,neq:mY,gte:uY,lte:dY,cmp:cY,coerce:lY,truncate:pY,Comparator:nY,Range:iY,satisfies:rY,toComparators:aY,maxSatisfying:sY,minSatisfying:oY,minVersion:tY,validRange:eY,outside:ZU,gtr:WU,ltr:XU,intersects:QU,simplifyRange:JU,subset:GU,SemVer:NY,re:v3.re,src:v3.src,tokens:v3.t,SEMVER_SPEC_VERSION:u7.SEMVER_SPEC_VERSION,RELEASE_TYPES:u7.RELEASE_TYPES,compareIdentifiers:d7.compareIdentifiers,rcompareIdentifiers:d7.rcompareIdentifiers}});var P1;var z2=d(()=>{P1={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.1",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.ts","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./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.4"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.1","@img/sharp-darwin-x64":"0.35.1","@img/sharp-freebsd-wasm32":"0.35.1","@img/sharp-libvips-darwin-arm64":"1.3.0","@img/sharp-libvips-darwin-x64":"1.3.0","@img/sharp-libvips-linux-arm":"1.3.0","@img/sharp-libvips-linux-arm64":"1.3.0","@img/sharp-libvips-linux-ppc64":"1.3.0","@img/sharp-libvips-linux-riscv64":"1.3.0","@img/sharp-libvips-linux-s390x":"1.3.0","@img/sharp-libvips-linux-x64":"1.3.0","@img/sharp-libvips-linuxmusl-arm64":"1.3.0","@img/sharp-libvips-linuxmusl-x64":"1.3.0","@img/sharp-linux-arm":"0.35.1","@img/sharp-linux-arm64":"0.35.1","@img/sharp-linux-ppc64":"0.35.1","@img/sharp-linux-riscv64":"0.35.1","@img/sharp-linux-s390x":"0.35.1","@img/sharp-linux-x64":"0.35.1","@img/sharp-linuxmusl-arm64":"0.35.1","@img/sharp-linuxmusl-x64":"0.35.1","@img/sharp-webcontainers-wasm32":"0.35.1","@img/sharp-win32-arm64":"0.35.1","@img/sharp-win32-ia32":"0.35.1","@img/sharp-win32-x64":"0.35.1"},devDependencies:{"@biomejs/biome":"^2.4.16","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.0","@img/sharp-libvips-dev":"1.3.0","@img/sharp-libvips-dev-wasm32":"1.3.0","@img/sharp-libvips-win32-arm64":"1.3.0","@img/sharp-libvips-win32-ia32":"1.3.0","@img/sharp-libvips-win32-x64":"1.3.0","@types/node":"*",emnapi:"^1.11.0","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.8.0","node-gyp":"^12.4.0",publint:"^0.3.21","tar-fs":"^3.1.2",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.3"},funding:{url:"https://opencollective.com/libvips"}}});import{spawnSync as W4}from"node:child_process";import{createHash as YU}from"node:crypto";var X4,g3,UU,n7,qU,h3,KU=(Z)=>{if(Z instanceof Error)console.error(`sharp: Installation error: ${Z.message}`);else console.log(`sharp: ${Z}`)},i7=()=>g3.default.isNonGlibcLinuxSync()?g3.default.familySync():"",VU=()=>`${process.platform}${i7()}-${process.arch}`,N6=()=>{if(r7())return"wasm32";let{npm_config_arch:Z,npm_config_platform:W,npm_config_libc:X}=process.env,Q=typeof X==="string"?X:i7();return`${W||process.platform}${Q}-${Z||process.arch}`},BU=()=>{try{return T0(`@img/sharp-libvips-dev-${N6()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},HU=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},$U=()=>{try{return T0(`@img/sharp-libvips-dev-${N6()}/lib`)}catch{try{return T0(`@img/sharp-libvips-${N6()}/lib`)}catch{}}return""},FU=()=>{if(process.release?.name==="node"&&process.versions){if(!X4.default.satisfies(process.versions.node,P1.engines.node))return{found:process.versions.node,expected:P1.engines.node}}},r7=()=>{let{CC:Z}=process.env;return Boolean(Z?.endsWith("/emcc"))},LU=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(W4("sysctl sysctl.proc_translated",h3).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},p7=(Z)=>YU("sha512").update(Z).digest("hex"),AU=()=>{try{let Z=p7(`imgsharp-libvips-${N6()}`),W=X4.default.coerce(P1.optionalDependencies[`@img/sharp-libvips-${N6()}`],{includePrerelease:!0}).version;return p7(`${Z}npm:${W}`).slice(0,10)}catch{}return""},MU=()=>W4(`node-gyp rebuild --directory=src ${r7()?"--nodedir=emscripten":""}`,{...h3,stdio:"inherit"}).status,a7=()=>{if(process.platform!=="win32")return(W4("pkg-config --modversion vips-cpp",{...h3,env:{...process.env,PKG_CONFIG_PATH:s7()}}).stdout||"").trim();else return""},IU=()=>{try{let Z=(W4("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(Z)return`${Z}/lib/pkgconfig`}catch(Z){}return},wU=()=>{try{let Z=(W4("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(Z)return Z}catch(Z){}return},s7=()=>{if(process.platform!=="win32")return[IU(),wU(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},y3=(Z,W,X)=>{if(X)X(`Detected ${W}, skipping search for globally-installed libvips`);return Z},NU=(Z)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return y3(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",Z);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return y3(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",Z);if(LU())return y3(!1,"Rosetta",Z);let W=a7();return!!W&&X4.default.gte(W,n7)},Y2;var f3=d(()=>{z2();X4=v6(l7(),1),g3=v6(n4(),1);/*!
|
|
209
|
+
*/Y={defined:E9,object:TJ,plainObject:RJ,fn:PJ,bool:_J,buffer:jJ,typedArray:EJ,arrayBuffer:CJ,string:OJ,number:xJ,integer:kJ,inRange:SJ,inArray:bJ,invalidParameterError:vJ,nativeError:yJ}});var x9=i((S$,O9)=>{var C9=()=>process.platform==="linux",c4=null,gJ=()=>{if(!c4)if(C9()&&process.report){let Z=process.report.excludeNetwork;process.report.excludeNetwork=!0,c4=process.report.getReport(),process.report.excludeNetwork=Z}else c4={};return c4};O9.exports={isLinux:C9,getReport:gJ}});var S9=i((b$,k9)=>{var A6=T0("fs"),hJ=(Z)=>{let W=A6.openSync(Z,"r"),X=Buffer.alloc(2048),Q=A6.readSync(W,X,0,2048,0);return A6.close(W,()=>{}),X.subarray(0,Q)},fJ=(Z)=>new Promise((W,X)=>{A6.open(Z,"r",(Q,J)=>{if(Q)X(Q);else{let G=Buffer.alloc(2048);A6.read(J,G,0,2048,0,(z,q)=>{W(G.subarray(0,q)),A6.close(J,()=>{})})}})});k9.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:hJ,readFile:fJ}});var v9=i((v$,b9)=>{var mJ=(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 W=Z.readUInt32LE(32),X=Z.readUInt16LE(54),Q=Z.readUInt16LE(56);for(let J=0;J<Q;J++){let G=W+J*X;if(Z.readUInt32LE(G)===3){let q=Z.readUInt32LE(G+8),K=Z.readUInt32LE(G+32);return Z.subarray(q,q+K).toString().replace(/\0.*$/g,"")}}return null};b9.exports={interpreterPath:mJ}});var p4=i((y$,t9)=>{var g9=T0("child_process"),{isLinux:I6,getReport:h9}=x9(),{LDD_PATH:l4,SELF_PATH:f9,readFile:I3,readFileSync:M3}=S9(),{interpreterPath:m9}=v9(),J1,G1,z1,y1="",u9=()=>{if(!y1)return new Promise((Z)=>{g9.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(W,X)=>{y1=W?" ":X,Z(y1)})});return y1},d9=()=>{if(!y1)try{y1=g9.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(Z){y1=" "}return y1},R1="glibc",c9=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,s1="musl",uJ=(Z)=>Z.includes("libc.musl-")||Z.includes("ld-musl-"),l9=()=>{let Z=h9();if(Z.header&&Z.header.glibcVersionRuntime)return R1;if(Array.isArray(Z.sharedObjects)){if(Z.sharedObjects.some(uJ))return s1}return null},p9=(Z)=>{let[W,X]=Z.split(/[\r\n]+/);if(W&&W.includes(R1))return R1;if(X&&X.includes(s1))return s1;return null},n9=(Z)=>{if(Z){if(Z.includes("/ld-musl-"))return s1;else if(Z.includes("/ld-linux-"))return R1}return null},i9=(Z)=>{if(Z=Z.toString(),Z.includes("musl"))return s1;if(Z.includes("GNU C Library"))return R1;return null},dJ=async()=>{if(G1!==void 0)return G1;G1=null;try{let Z=await I3(l4);G1=i9(Z)}catch(Z){}return G1},cJ=()=>{if(G1!==void 0)return G1;G1=null;try{let Z=M3(l4);G1=i9(Z)}catch(Z){}return G1},lJ=async()=>{if(J1!==void 0)return J1;J1=null;try{let Z=await I3(f9),W=m9(Z);J1=n9(W)}catch(Z){}return J1},pJ=()=>{if(J1!==void 0)return J1;J1=null;try{let Z=M3(f9),W=m9(Z);J1=n9(W)}catch(Z){}return J1},r9=async()=>{let Z=null;if(I6()){if(Z=await lJ(),!Z){if(Z=await dJ(),!Z)Z=l9();if(!Z){let W=await u9();Z=p9(W)}}}return Z},a9=()=>{let Z=null;if(I6()){if(Z=pJ(),!Z){if(Z=cJ(),!Z)Z=l9();if(!Z){let W=d9();Z=p9(W)}}}return Z},nJ=async()=>I6()&&await r9()!==R1,iJ=()=>I6()&&a9()!==R1,rJ=async()=>{if(z1!==void 0)return z1;z1=null;try{let W=(await I3(l4)).match(c9);if(W)z1=W[1]}catch(Z){}return z1},aJ=()=>{if(z1!==void 0)return z1;z1=null;try{let W=M3(l4).match(c9);if(W)z1=W[1]}catch(Z){}return z1},s9=()=>{let Z=h9();if(Z.header&&Z.header.glibcVersionRuntime)return Z.header.glibcVersionRuntime;return null},y9=(Z)=>Z.trim().split(/\s+/)[1],o9=(Z)=>{let[W,X,Q]=Z.split(/[\r\n]+/);if(W&&W.includes(R1))return y9(W);if(X&&Q&&X.includes(s1))return y9(Q);return null},sJ=async()=>{let Z=null;if(I6()){if(Z=await rJ(),!Z)Z=s9();if(!Z){let W=await u9();Z=o9(W)}}return Z},oJ=()=>{let Z=null;if(I6()){if(Z=aJ(),!Z)Z=s9();if(!Z){let W=d9();Z=o9(W)}}return Z};t9.exports={GLIBC:R1,MUSL:s1,family:r9,familySync:a9,isNonGlibcLinux:nJ,isNonGlibcLinuxSync:iJ,version:sJ,versionSync:oJ}});var M6=i((g$,e9)=>{var tJ=Number.MAX_SAFE_INTEGER||9007199254740991,eJ=["major","premajor","minor","preminor","patch","prepatch","prerelease"];e9.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:tJ,RELEASE_TYPES:eJ,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var a6=i((h$,ZZ)=>{var ZG=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...Z)=>console.error("SEMVER",...Z):()=>{};ZZ.exports=ZG});var w6=i((Y1,WZ)=>{var{MAX_SAFE_COMPONENT_LENGTH:w3,MAX_SAFE_BUILD_LENGTH:WG,MAX_LENGTH:XG}=M6(),QG=a6();Y1=WZ.exports={};var JG=Y1.re=[],GG=Y1.safeRe=[],y=Y1.src=[],zG=Y1.safeSrc=[],g=Y1.t={},YG=0,N3="[a-zA-Z0-9-]",UG=[["\\s",1],["\\d",XG],[N3,WG]],qG=(Z)=>{for(let[W,X]of UG)Z=Z.split(`${W}*`).join(`${W}{0,${X}}`).split(`${W}+`).join(`${W}{1,${X}}`);return Z},a=(Z,W,X)=>{let Q=qG(W),J=YG++;QG(Z,J,W),g[Z]=J,y[J]=W,zG[J]=Q,JG[J]=new RegExp(W,X?"g":void 0),GG[J]=new RegExp(Q,X?"g":void 0)};a("NUMERICIDENTIFIER","0|[1-9]\\d*");a("NUMERICIDENTIFIERLOOSE","\\d+");a("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${N3}*`);a("MAINVERSION",`(${y[g.NUMERICIDENTIFIER]})\\.(${y[g.NUMERICIDENTIFIER]})\\.(${y[g.NUMERICIDENTIFIER]})`);a("MAINVERSIONLOOSE",`(${y[g.NUMERICIDENTIFIERLOOSE]})\\.(${y[g.NUMERICIDENTIFIERLOOSE]})\\.(${y[g.NUMERICIDENTIFIERLOOSE]})`);a("PRERELEASEIDENTIFIER",`(?:${y[g.NONNUMERICIDENTIFIER]}|${y[g.NUMERICIDENTIFIER]})`);a("PRERELEASEIDENTIFIERLOOSE",`(?:${y[g.NONNUMERICIDENTIFIER]}|${y[g.NUMERICIDENTIFIERLOOSE]})`);a("PRERELEASE",`(?:-(${y[g.PRERELEASEIDENTIFIER]}(?:\\.${y[g.PRERELEASEIDENTIFIER]})*))`);a("PRERELEASELOOSE",`(?:-?(${y[g.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${y[g.PRERELEASEIDENTIFIERLOOSE]})*))`);a("BUILDIDENTIFIER",`${N3}+`);a("BUILD",`(?:\\+(${y[g.BUILDIDENTIFIER]}(?:\\.${y[g.BUILDIDENTIFIER]})*))`);a("FULLPLAIN",`v?${y[g.MAINVERSION]}${y[g.PRERELEASE]}?${y[g.BUILD]}?`);a("FULL",`^${y[g.FULLPLAIN]}$`);a("LOOSEPLAIN",`[v=\\s]*${y[g.MAINVERSIONLOOSE]}${y[g.PRERELEASELOOSE]}?${y[g.BUILD]}?`);a("LOOSE",`^${y[g.LOOSEPLAIN]}$`);a("GTLT","((?:<|>)?=?)");a("XRANGEIDENTIFIERLOOSE",`${y[g.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);a("XRANGEIDENTIFIER",`${y[g.NUMERICIDENTIFIER]}|x|X|\\*`);a("XRANGEPLAIN",`[v=\\s]*(${y[g.XRANGEIDENTIFIER]})(?:\\.(${y[g.XRANGEIDENTIFIER]})(?:\\.(${y[g.XRANGEIDENTIFIER]})(?:${y[g.PRERELEASE]})?${y[g.BUILD]}?)?)?`);a("XRANGEPLAINLOOSE",`[v=\\s]*(${y[g.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[g.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[g.XRANGEIDENTIFIERLOOSE]})(?:${y[g.PRERELEASELOOSE]})?${y[g.BUILD]}?)?)?`);a("XRANGE",`^${y[g.GTLT]}\\s*${y[g.XRANGEPLAIN]}$`);a("XRANGELOOSE",`^${y[g.GTLT]}\\s*${y[g.XRANGEPLAINLOOSE]}$`);a("COERCEPLAIN",`(^|[^\\d])(\\d{1,${w3}})(?:\\.(\\d{1,${w3}}))?(?:\\.(\\d{1,${w3}}))?`);a("COERCE",`${y[g.COERCEPLAIN]}(?:$|[^\\d])`);a("COERCEFULL",y[g.COERCEPLAIN]+`(?:${y[g.PRERELEASE]})?(?:${y[g.BUILD]})?(?:$|[^\\d])`);a("COERCERTL",y[g.COERCE],!0);a("COERCERTLFULL",y[g.COERCEFULL],!0);a("LONETILDE","(?:~>?)");a("TILDETRIM",`(\\s*)${y[g.LONETILDE]}\\s+`,!0);Y1.tildeTrimReplace="$1~";a("TILDE",`^${y[g.LONETILDE]}${y[g.XRANGEPLAIN]}$`);a("TILDELOOSE",`^${y[g.LONETILDE]}${y[g.XRANGEPLAINLOOSE]}$`);a("LONECARET","(?:\\^)");a("CARETTRIM",`(\\s*)${y[g.LONECARET]}\\s+`,!0);Y1.caretTrimReplace="$1^";a("CARET",`^${y[g.LONECARET]}${y[g.XRANGEPLAIN]}$`);a("CARETLOOSE",`^${y[g.LONECARET]}${y[g.XRANGEPLAINLOOSE]}$`);a("COMPARATORLOOSE",`^${y[g.GTLT]}\\s*(${y[g.LOOSEPLAIN]})$|^$`);a("COMPARATOR",`^${y[g.GTLT]}\\s*(${y[g.FULLPLAIN]})$|^$`);a("COMPARATORTRIM",`(\\s*)${y[g.GTLT]}\\s*(${y[g.LOOSEPLAIN]}|${y[g.XRANGEPLAIN]})`,!0);Y1.comparatorTrimReplace="$1$2$3";a("HYPHENRANGE",`^\\s*(${y[g.XRANGEPLAIN]})\\s+-\\s+(${y[g.XRANGEPLAIN]})\\s*$`);a("HYPHENRANGELOOSE",`^\\s*(${y[g.XRANGEPLAINLOOSE]})\\s+-\\s+(${y[g.XRANGEPLAINLOOSE]})\\s*$`);a("STAR","(<|>)?=?\\s*\\*");a("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");a("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var n4=i((f$,XZ)=>{var KG=Object.freeze({loose:!0}),VG=Object.freeze({}),BG=(Z)=>{if(!Z)return VG;if(typeof Z!=="object")return KG;return Z};XZ.exports=BG});var D3=i((m$,GZ)=>{var QZ=/^[0-9]+$/,JZ=(Z,W)=>{if(typeof Z==="number"&&typeof W==="number")return Z===W?0:Z<W?-1:1;let X=QZ.test(Z),Q=QZ.test(W);if(X&&Q)Z=+Z,W=+W;return Z===W?0:X&&!Q?-1:Q&&!X?1:Z<W?-1:1},HG=(Z,W)=>JZ(W,Z);GZ.exports={compareIdentifiers:JZ,rcompareIdentifiers:HG}});var P0=i((u$,YZ)=>{var i4=a6(),{MAX_LENGTH:zZ,MAX_SAFE_INTEGER:r4}=M6(),{safeRe:a4,t:s4}=w6(),$G=n4(),{compareIdentifiers:T3}=D3(),FG=(Z,W)=>{let X=W.split(".");if(X.length>Z.length)return!1;for(let Q=0;Q<X.length;Q++)if(T3(Z[Q],X[Q])!==0)return!1;return!0};class t0{constructor(Z,W){if(W=$G(W),Z instanceof t0)if(Z.loose===!!W.loose&&Z.includePrerelease===!!W.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>zZ)throw TypeError(`version is longer than ${zZ} characters`);i4("SemVer",Z,W),this.options=W,this.loose=!!W.loose,this.includePrerelease=!!W.includePrerelease;let X=Z.trim().match(W.loose?a4[s4.LOOSE]:a4[s4.FULL]);if(!X)throw TypeError(`Invalid Version: ${Z}`);if(this.raw=Z,this.major=+X[1],this.minor=+X[2],this.patch=+X[3],this.major>r4||this.major<0)throw TypeError("Invalid major version");if(this.minor>r4||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>r4||this.patch<0)throw TypeError("Invalid patch version");if(!X[4])this.prerelease=[];else this.prerelease=X[4].split(".").map((Q)=>{if(/^[0-9]+$/.test(Q)){let J=+Q;if(J>=0&&J<r4)return J}return Q});this.build=X[5]?X[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(Z){if(i4("SemVer.compare",this.version,this.options,Z),!(Z instanceof t0)){if(typeof Z==="string"&&Z===this.version)return 0;Z=new t0(Z,this.options)}if(Z.version===this.version)return 0;return this.compareMain(Z)||this.comparePre(Z)}compareMain(Z){if(!(Z instanceof t0))Z=new t0(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 t0))Z=new t0(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 W=0;do{let X=this.prerelease[W],Q=Z.prerelease[W];if(i4("prerelease compare",W,X,Q),X===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(X===void 0)return-1;else if(X===Q)continue;else return T3(X,Q)}while(++W)}compareBuild(Z){if(!(Z instanceof t0))Z=new t0(Z,this.options);let W=0;do{let X=this.build[W],Q=Z.build[W];if(i4("build compare",W,X,Q),X===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(X===void 0)return-1;else if(X===Q)continue;else return T3(X,Q)}while(++W)}inc(Z,W,X){if(Z.startsWith("pre")){if(!W&&X===!1)throw Error("invalid increment argument: identifier is empty");if(W){let Q=`-${W}`.match(this.options.loose?a4[s4.PRERELEASELOOSE]:a4[s4.PRERELEASE]);if(!Q||Q[1]!==W)throw Error(`invalid identifier: ${W}`)}}switch(Z){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",W,X);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",W,X);break;case"prepatch":this.prerelease.length=0,this.inc("patch",W,X),this.inc("pre",W,X);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",W,X);this.inc("pre",W,X);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let Q=Number(X)?1:0;if(this.prerelease.length===0)this.prerelease=[Q];else{let J=this.prerelease.length;while(--J>=0)if(typeof this.prerelease[J]==="number")this.prerelease[J]++,J=-2;if(J===-1){if(W===this.prerelease.join(".")&&X===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(Q)}}if(W){let J=[W,Q];if(X===!1)J=[W];if(FG(this.prerelease,W)){let G=this.prerelease[W.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}}YZ.exports=t0});var g1=i((d$,qZ)=>{var UZ=P0(),LG=(Z,W,X=!1)=>{if(Z instanceof UZ)return Z;try{return new UZ(Z,W)}catch(Q){if(!X)return null;throw Q}};qZ.exports=LG});var VZ=i((c$,KZ)=>{var AG=g1(),IG=(Z,W)=>{let X=AG(Z,W);return X?X.version:null};KZ.exports=IG});var HZ=i((l$,BZ)=>{var MG=g1(),wG=(Z,W)=>{let X=MG(Z.trim().replace(/^[=v]+/,""),W);return X?X.version:null};BZ.exports=wG});var LZ=i((p$,FZ)=>{var $Z=P0(),NG=(Z,W,X,Q,J)=>{if(typeof X==="string")J=Q,Q=X,X=void 0;try{return new $Z(Z instanceof $Z?Z.version:Z,X).inc(W,Q,J).version}catch(G){return null}};FZ.exports=NG});var MZ=i((n$,IZ)=>{var AZ=g1(),DG=(Z,W)=>{let X=AZ(Z,null,!0),Q=AZ(W,null,!0),J=X.compare(Q);if(J===0)return null;let G=J>0,z=G?X:Q,q=G?Q:X,K=!!z.prerelease.length;if(!!q.prerelease.length&&!K){if(!q.patch&&!q.minor)return"major";if(q.compareMain(z)===0){if(q.minor&&!q.patch)return"minor";return"patch"}}let H=K?"pre":"";if(X.major!==Q.major)return H+"major";if(X.minor!==Q.minor)return H+"minor";if(X.patch!==Q.patch)return H+"patch";return"prerelease"};IZ.exports=DG});var NZ=i((i$,wZ)=>{var TG=P0(),RG=(Z,W)=>new TG(Z,W).major;wZ.exports=RG});var TZ=i((r$,DZ)=>{var PG=P0(),_G=(Z,W)=>new PG(Z,W).minor;DZ.exports=_G});var PZ=i((a$,RZ)=>{var jG=P0(),EG=(Z,W)=>new jG(Z,W).patch;RZ.exports=EG});var jZ=i((s$,_Z)=>{var CG=g1(),OG=(Z,W)=>{let X=CG(Z,W);return X&&X.prerelease.length?X.prerelease:null};_Z.exports=OG});var n0=i((o$,CZ)=>{var EZ=P0(),xG=(Z,W,X)=>new EZ(Z,X).compare(new EZ(W,X));CZ.exports=xG});var xZ=i((t$,OZ)=>{var kG=n0(),SG=(Z,W,X)=>kG(W,Z,X);OZ.exports=SG});var SZ=i((e$,kZ)=>{var bG=n0(),vG=(Z,W)=>bG(Z,W,!0);kZ.exports=vG});var o4=i((ZF,vZ)=>{var bZ=P0(),yG=(Z,W,X)=>{let Q=new bZ(Z,X),J=new bZ(W,X);return Q.compare(J)||Q.compareBuild(J)};vZ.exports=yG});var gZ=i((WF,yZ)=>{var gG=o4(),hG=(Z,W)=>Z.sort((X,Q)=>gG(X,Q,W));yZ.exports=hG});var fZ=i((XF,hZ)=>{var fG=o4(),mG=(Z,W)=>Z.sort((X,Q)=>fG(Q,X,W));hZ.exports=mG});var s6=i((QF,mZ)=>{var uG=n0(),dG=(Z,W,X)=>uG(Z,W,X)>0;mZ.exports=dG});var t4=i((JF,uZ)=>{var cG=n0(),lG=(Z,W,X)=>cG(Z,W,X)<0;uZ.exports=lG});var R3=i((GF,dZ)=>{var pG=n0(),nG=(Z,W,X)=>pG(Z,W,X)===0;dZ.exports=nG});var P3=i((zF,cZ)=>{var iG=n0(),rG=(Z,W,X)=>iG(Z,W,X)!==0;cZ.exports=rG});var e4=i((YF,lZ)=>{var aG=n0(),sG=(Z,W,X)=>aG(Z,W,X)>=0;lZ.exports=sG});var Z2=i((UF,pZ)=>{var oG=n0(),tG=(Z,W,X)=>oG(Z,W,X)<=0;pZ.exports=tG});var _3=i((qF,nZ)=>{var eG=R3(),Zz=P3(),Wz=s6(),Xz=e4(),Qz=t4(),Jz=Z2(),Gz=(Z,W,X,Q)=>{switch(W){case"===":if(typeof Z==="object")Z=Z.version;if(typeof X==="object")X=X.version;return Z===X;case"!==":if(typeof Z==="object")Z=Z.version;if(typeof X==="object")X=X.version;return Z!==X;case"":case"=":case"==":return eG(Z,X,Q);case"!=":return Zz(Z,X,Q);case">":return Wz(Z,X,Q);case">=":return Xz(Z,X,Q);case"<":return Qz(Z,X,Q);case"<=":return Jz(Z,X,Q);default:throw TypeError(`Invalid operator: ${W}`)}};nZ.exports=Gz});var rZ=i((KF,iZ)=>{var zz=P0(),Yz=g1(),{safeRe:W2,t:X2}=w6(),Uz=(Z,W)=>{if(Z instanceof zz)return Z;if(typeof Z==="number")Z=String(Z);if(typeof Z!=="string")return null;W=W||{};let X=null;if(!W.rtl)X=Z.match(W.includePrerelease?W2[X2.COERCEFULL]:W2[X2.COERCE]);else{let K=W.includePrerelease?W2[X2.COERCERTLFULL]:W2[X2.COERCERTL],V;while((V=K.exec(Z))&&(!X||X.index+X[0].length!==Z.length)){if(!X||V.index+V[0].length!==X.index+X[0].length)X=V;K.lastIndex=V.index+V[1].length+V[2].length}K.lastIndex=-1}if(X===null)return null;let Q=X[2],J=X[3]||"0",G=X[4]||"0",z=W.includePrerelease&&X[5]?`-${X[5]}`:"",q=W.includePrerelease&&X[6]?`+${X[6]}`:"";return Yz(`${Q}.${J}.${G}${z}${q}`,W)};iZ.exports=Uz});var sZ=i((VF,aZ)=>{var qz=g1(),Kz=M6(),Vz=P0(),Bz=(Z,W,X)=>{if(!Kz.RELEASE_TYPES.includes(W))return null;let Q=Hz(Z,X);return Q&&$z(Q,W)},Hz=(Z,W)=>{let X=Z instanceof Vz?Z.version:Z;return qz(X,W)},$z=(Z,W)=>{if(Fz(W))return Z.version;switch(Z.prerelease=[],W){case"major":Z.minor=0,Z.patch=0;break;case"minor":Z.patch=0;break}return Z.format()},Fz=(Z)=>{return Z.startsWith("pre")};aZ.exports=Bz});var eZ=i((BF,tZ)=>{class oZ{constructor(){this.max=1000,this.map=new Map}get(Z){let W=this.map.get(Z);if(W===void 0)return;else return this.map.delete(Z),this.map.set(Z,W),W}delete(Z){return this.map.delete(Z)}set(Z,W){if(!this.delete(Z)&&W!==void 0){if(this.map.size>=this.max){let Q=this.map.keys().next().value;this.delete(Q)}this.map.set(Z,W)}return this}}tZ.exports=oZ});var i0=i((HF,Q7)=>{var Lz=/\s+/g;class o6{constructor(Z,W){if(W=Iz(W),Z instanceof o6)if(Z.loose===!!W.loose&&Z.includePrerelease===!!W.includePrerelease)return Z;else return new o6(Z.raw,W);if(Z instanceof j3)return this.raw=Z.value,this.set=[[Z]],this.formatted=void 0,this;if(this.options=W,this.loose=!!W.loose,this.includePrerelease=!!W.includePrerelease,this.raw=Z.trim().replace(Lz," "),this.set=this.raw.split("||").map((X)=>this.parseRange(X.trim())).filter((X)=>X.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let X=this.set[0];if(this.set=this.set.filter((Q)=>!W7(Q[0])),this.set.length===0)this.set=[X];else if(this.set.length>1){for(let Q of this.set)if(Q.length===1&&jz(Q[0])){this.set=[Q];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let Z=0;Z<this.set.length;Z++){if(Z>0)this.formatted+="||";let W=this.set[Z];for(let X=0;X<W.length;X++){if(X>0)this.formatted+=" ";this.formatted+=W[X].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(Z){Z=Z.replace(_z,"");let X=((this.options.includePrerelease&&Rz)|(this.options.loose&&Pz))+":"+Z,Q=Z7.get(X);if(Q)return Q;let J=this.options.loose,G=J?x0[_0.HYPHENRANGELOOSE]:x0[_0.HYPHENRANGE];Z=Z.replace(G,hz(this.options.includePrerelease)),Y0("hyphen replace",Z),Z=Z.replace(x0[_0.COMPARATORTRIM],Nz),Y0("comparator trim",Z),Z=Z.replace(x0[_0.TILDETRIM],Dz),Y0("tilde trim",Z),Z=Z.replace(x0[_0.CARETTRIM],Tz),Y0("caret trim",Z);let z=Z.split(" ").map((H)=>Ez(H,this.options)).join(" ").split(/\s+/).map((H)=>gz(H,this.options));if(J)z=z.filter((H)=>{return Y0("loose invalid filter",H,this.options),!!H.match(x0[_0.COMPARATORLOOSE])});Y0("range list",z);let q=new Map,K=z.map((H)=>new j3(H,this.options));for(let H of K){if(W7(H))return[H];q.set(H.value,H)}if(q.size>1&&q.has(""))q.delete("");let V=[...q.values()];return Z7.set(X,V),V}intersects(Z,W){if(!(Z instanceof o6))throw TypeError("a Range is required");return this.set.some((X)=>{return X7(X,W)&&Z.set.some((Q)=>{return X7(Q,W)&&X.every((J)=>{return Q.every((G)=>{return J.intersects(G,W)})})})})}test(Z){if(!Z)return!1;if(typeof Z==="string")try{Z=new Mz(Z,this.options)}catch(W){return!1}for(let W=0;W<this.set.length;W++)if(fz(this.set[W],Z,this.options))return!0;return!1}}Q7.exports=o6;var Az=eZ(),Z7=new Az,Iz=n4(),j3=t6(),Y0=a6(),Mz=P0(),{safeRe:x0,src:wz,t:_0,comparatorTrimReplace:Nz,tildeTrimReplace:Dz,caretTrimReplace:Tz}=w6(),{FLAG_INCLUDE_PRERELEASE:Rz,FLAG_LOOSE:Pz}=M6(),_z=new RegExp(wz[_0.BUILD],"g"),W7=(Z)=>Z.value==="<0.0.0-0",jz=(Z)=>Z.value==="",X7=(Z,W)=>{let X=!0,Q=Z.slice(),J=Q.pop();while(X&&Q.length)X=Q.every((G)=>{return J.intersects(G,W)}),J=Q.pop();return X},Ez=(Z,W)=>{return Z=Z.replace(x0[_0.BUILD],""),Y0("comp",Z,W),Z=kz(Z,W),Y0("caret",Z),Z=Oz(Z,W),Y0("tildes",Z),Z=bz(Z,W),Y0("xrange",Z),Z=yz(Z,W),Y0("stars",Z),Z},I0=(Z)=>!Z||Z.toLowerCase()==="x"||Z==="*",Cz=(Z,W,X)=>I0(Z)&&!I0(W)||I0(W)&&X&&!I0(X),Oz=(Z,W)=>{return Z.trim().split(/\s+/).map((X)=>xz(X,W)).join(" ")},xz=(Z,W)=>{let X=W.loose?x0[_0.TILDELOOSE]:x0[_0.TILDE];return Z.replace(X,(Q,J,G,z,q)=>{Y0("tilde",Z,Q,J,G,z,q);let K;if(I0(J))K="";else if(I0(G))K=`>=${J}.0.0 <${+J+1}.0.0-0`;else if(I0(z))K=`>=${J}.${G}.0 <${J}.${+G+1}.0-0`;else if(q)Y0("replaceTilde pr",q),K=`>=${J}.${G}.${z}-${q} <${J}.${+G+1}.0-0`;else K=`>=${J}.${G}.${z} <${J}.${+G+1}.0-0`;return Y0("tilde return",K),K})},kz=(Z,W)=>{return Z.trim().split(/\s+/).map((X)=>Sz(X,W)).join(" ")},Sz=(Z,W)=>{Y0("caret",Z,W);let X=W.loose?x0[_0.CARETLOOSE]:x0[_0.CARET],Q=W.includePrerelease?"-0":"";return Z.replace(X,(J,G,z,q,K)=>{Y0("caret",Z,J,G,z,q,K);let V;if(I0(G))V="";else if(I0(z))V=`>=${G}.0.0${Q} <${+G+1}.0.0-0`;else if(I0(q))if(G==="0")V=`>=${G}.${z}.0${Q} <${G}.${+z+1}.0-0`;else V=`>=${G}.${z}.0${Q} <${+G+1}.0.0-0`;else if(K)if(Y0("replaceCaret pr",K),G==="0")if(z==="0")V=`>=${G}.${z}.${q}-${K} <${G}.${z}.${+q+1}-0`;else V=`>=${G}.${z}.${q}-${K} <${G}.${+z+1}.0-0`;else V=`>=${G}.${z}.${q}-${K} <${+G+1}.0.0-0`;else if(Y0("no pr"),G==="0")if(z==="0")V=`>=${G}.${z}.${q} <${G}.${z}.${+q+1}-0`;else V=`>=${G}.${z}.${q} <${G}.${+z+1}.0-0`;else V=`>=${G}.${z}.${q} <${+G+1}.0.0-0`;return Y0("caret return",V),V})},bz=(Z,W)=>{return Y0("replaceXRanges",Z,W),Z.split(/\s+/).map((X)=>vz(X,W)).join(" ")},vz=(Z,W)=>{Z=Z.trim();let X=W.loose?x0[_0.XRANGELOOSE]:x0[_0.XRANGE];return Z.replace(X,(Q,J,G,z,q,K)=>{if(Y0("xRange",Z,Q,J,G,z,q,K),Cz(G,z,q))return Z;let V=I0(G),H=V||I0(z),B=H||I0(q),$=B;if(J==="="&&$)J="";if(K=W.includePrerelease?"-0":"",V)if(J===">"||J==="<")Q="<0.0.0-0";else Q="*";else if(J&&$){if(H)z=0;if(q=0,J===">")if(J=">=",H)G=+G+1,z=0,q=0;else z=+z+1,q=0;else if(J==="<=")if(J="<",H)G=+G+1;else z=+z+1;if(J==="<")K="-0";Q=`${J+G}.${z}.${q}${K}`}else if(H)Q=`>=${G}.0.0${K} <${+G+1}.0.0-0`;else if(B)Q=`>=${G}.${z}.0${K} <${G}.${+z+1}.0-0`;return Y0("xRange return",Q),Q})},yz=(Z,W)=>{return Y0("replaceStars",Z,W),Z.trim().replace(x0[_0.STAR],"")},gz=(Z,W)=>{return Y0("replaceGTE0",Z,W),Z.trim().replace(x0[W.includePrerelease?_0.GTE0PRE:_0.GTE0],"")},hz=(Z)=>(W,X,Q,J,G,z,q,K,V,H,B,$)=>{if(I0(Q))X="";else if(I0(J))X=`>=${Q}.0.0${Z?"-0":""}`;else if(I0(G))X=`>=${Q}.${J}.0${Z?"-0":""}`;else if(z)X=`>=${X}`;else X=`>=${X}${Z?"-0":""}`;if(I0(V))K="";else if(I0(H))K=`<${+V+1}.0.0-0`;else if(I0(B))K=`<${V}.${+H+1}.0-0`;else if($)K=`<=${V}.${H}.${B}-${$}`;else if(Z)K=`<${V}.${H}.${+B+1}-0`;else K=`<=${K}`;return`${X} ${K}`.trim()},fz=(Z,W,X)=>{for(let Q=0;Q<Z.length;Q++)if(!Z[Q].test(W))return!1;if(W.prerelease.length&&!X.includePrerelease){for(let Q=0;Q<Z.length;Q++){if(Y0(Z[Q].semver),Z[Q].semver===j3.ANY)continue;if(Z[Q].semver.prerelease.length>0){let J=Z[Q].semver;if(J.major===W.major&&J.minor===W.minor&&J.patch===W.patch)return!0}}return!1}return!0}});var t6=i(($F,q7)=>{var e6=Symbol("SemVer ANY");class Q2{static get ANY(){return e6}constructor(Z,W){if(W=J7(W),Z instanceof Q2)if(Z.loose===!!W.loose)return Z;else Z=Z.value;if(Z=Z.trim().split(/\s+/).join(" "),C3("comparator",Z,W),this.options=W,this.loose=!!W.loose,this.parse(Z),this.semver===e6)this.value="";else this.value=this.operator+this.semver.version;C3("comp",this)}parse(Z){let W=this.options.loose?G7[z7.COMPARATORLOOSE]:G7[z7.COMPARATOR],X=Z.match(W);if(!X)throw TypeError(`Invalid comparator: ${Z}`);if(this.operator=X[1]!==void 0?X[1]:"",this.operator==="=")this.operator="";if(!X[2])this.semver=e6;else this.semver=new Y7(X[2],this.options.loose)}toString(){return this.value}test(Z){if(C3("Comparator.test",Z,this.options.loose),this.semver===e6||Z===e6)return!0;if(typeof Z==="string")try{Z=new Y7(Z,this.options)}catch(W){return!1}return E3(Z,this.operator,this.semver,this.options)}intersects(Z,W){if(!(Z instanceof Q2))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new U7(Z.value,W).test(this.value)}else if(Z.operator===""){if(Z.value==="")return!0;return new U7(this.value,W).test(Z.semver)}if(W=J7(W),W.includePrerelease&&(this.value==="<0.0.0-0"||Z.value==="<0.0.0-0"))return!1;if(!W.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(E3(this.semver,"<",Z.semver,W)&&this.operator.startsWith(">")&&Z.operator.startsWith("<"))return!0;if(E3(this.semver,">",Z.semver,W)&&this.operator.startsWith("<")&&Z.operator.startsWith(">"))return!0;return!1}}q7.exports=Q2;var J7=n4(),{safeRe:G7,t:z7}=w6(),E3=_3(),C3=a6(),Y7=P0(),U7=i0()});var Z4=i((FF,K7)=>{var mz=i0(),uz=(Z,W,X)=>{try{W=new mz(W,X)}catch(Q){return!1}return W.test(Z)};K7.exports=uz});var B7=i((LF,V7)=>{var dz=i0(),cz=(Z,W)=>new dz(Z,W).set.map((X)=>X.map((Q)=>Q.value).join(" ").trim().split(" "));V7.exports=cz});var $7=i((AF,H7)=>{var lz=P0(),pz=i0(),nz=(Z,W,X)=>{let Q=null,J=null,G=null;try{G=new pz(W,X)}catch(z){return null}return Z.forEach((z)=>{if(G.test(z)){if(!Q||J.compare(z)===-1)Q=z,J=new lz(Q,X)}}),Q};H7.exports=nz});var L7=i((IF,F7)=>{var iz=P0(),rz=i0(),az=(Z,W,X)=>{let Q=null,J=null,G=null;try{G=new rz(W,X)}catch(z){return null}return Z.forEach((z)=>{if(G.test(z)){if(!Q||J.compare(z)===1)Q=z,J=new iz(Q,X)}}),Q};F7.exports=az});var M7=i((MF,I7)=>{var O3=P0(),sz=i0(),A7=s6(),oz=(Z,W)=>{Z=new sz(Z,W);let X=new O3("0.0.0");if(Z.test(X))return X;if(X=new O3("0.0.0-0"),Z.test(X))return X;X=null;for(let Q=0;Q<Z.set.length;++Q){let J=Z.set[Q],G=null;if(J.forEach((z)=>{let q=new O3(z.semver.version);switch(z.operator){case">":if(q.prerelease.length===0)q.patch++;else q.prerelease.push(0);q.raw=q.format();case"":case">=":if(!G||A7(q,G))G=q;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${z.operator}`)}}),G&&(!X||A7(X,G)))X=G}if(X&&Z.test(X))return X;return null};I7.exports=oz});var N7=i((wF,w7)=>{var tz=i0(),ez=(Z,W)=>{try{return new tz(Z,W).range||"*"}catch(X){return null}};w7.exports=ez});var J2=i((NF,P7)=>{var ZY=P0(),R7=t6(),{ANY:WY}=R7,XY=i0(),QY=Z4(),D7=s6(),T7=t4(),JY=Z2(),GY=e4(),zY=(Z,W,X,Q)=>{Z=new ZY(Z,Q),W=new XY(W,Q);let J,G,z,q,K;switch(X){case">":J=D7,G=JY,z=T7,q=">",K=">=";break;case"<":J=T7,G=GY,z=D7,q="<",K="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(QY(Z,W,Q))return!1;for(let V=0;V<W.set.length;++V){let H=W.set[V],B=null,$=null;if(H.forEach((L)=>{if(L.semver===WY)L=new R7(">=0.0.0");if(B=B||L,$=$||L,J(L.semver,B.semver,Q))B=L;else if(z(L.semver,$.semver,Q))$=L}),B.operator===q||B.operator===K)return!1;if((!$.operator||$.operator===q)&&G(Z,$.semver))return!1;else if($.operator===K&&z(Z,$.semver))return!1}return!0};P7.exports=zY});var j7=i((DF,_7)=>{var YY=J2(),UY=(Z,W,X)=>YY(Z,W,">",X);_7.exports=UY});var C7=i((TF,E7)=>{var qY=J2(),KY=(Z,W,X)=>qY(Z,W,"<",X);E7.exports=KY});var k7=i((RF,x7)=>{var O7=i0(),VY=(Z,W,X)=>{return Z=new O7(Z,X),W=new O7(W,X),Z.intersects(W,X)};x7.exports=VY});var b7=i((PF,S7)=>{var BY=Z4(),HY=n0();S7.exports=(Z,W,X)=>{let Q=[],J=null,G=null,z=Z.sort((H,B)=>HY(H,B,X));for(let H of z)if(BY(H,W,X)){if(G=H,!J)J=H}else{if(G)Q.push([J,G]);G=null,J=null}if(J)Q.push([J,null]);let q=[];for(let[H,B]of Q)if(H===B)q.push(H);else if(!B&&H===z[0])q.push("*");else if(!B)q.push(`>=${H}`);else if(H===z[0])q.push(`<=${B}`);else q.push(`${H} - ${B}`);let K=q.join(" || "),V=typeof W.raw==="string"?W.raw:String(W);return K.length<V.length?K:W}});var m7=i((_F,f7)=>{var v7=i0(),S3=t6(),{ANY:x3}=S3,k3=Z4(),b3=n0(),$Y=(Z,W,X={})=>{if(Z===W)return!0;Z=new v7(Z,X),W=new v7(W,X);let Q=!1;Z:for(let J of Z.set){for(let G of W.set){let z=LY(J,G,X);if(Q=Q||z!==null,z)continue Z}if(Q)return!1}return!0},FY=[new S3(">=0.0.0-0")],y7=[new S3(">=0.0.0")],LY=(Z,W,X)=>{if(Z===W)return!0;if(Z.length===1&&Z[0].semver===x3)if(W.length===1&&W[0].semver===x3)return!0;else if(X.includePrerelease)Z=FY;else Z=y7;if(W.length===1&&W[0].semver===x3)if(X.includePrerelease)return!0;else W=y7;let Q=new Set,J,G;for(let L of Z)if(L.operator===">"||L.operator===">=")J=g7(J,L,X);else if(L.operator==="<"||L.operator==="<=")G=h7(G,L,X);else Q.add(L.semver);if(Q.size>1)return null;let z;if(J&&G){if(z=b3(J.semver,G.semver,X),z>0)return null;else if(z===0&&(J.operator!==">="||G.operator!=="<="))return null}for(let L of Q){if(J&&!k3(L,String(J),X))return null;if(G&&!k3(L,String(G),X))return null;for(let A of W)if(!k3(L,String(A),X))return!1;return!0}let q,K,V,H,B=G&&!X.includePrerelease&&G.semver.prerelease.length?G.semver:!1,$=J&&!X.includePrerelease&&J.semver.prerelease.length?J.semver:!1;if(B&&B.prerelease.length===1&&G.operator==="<"&&B.prerelease[0]===0)B=!1;for(let L of W){if(H=H||L.operator===">"||L.operator===">=",V=V||L.operator==="<"||L.operator==="<=",J){if($){if(L.semver.prerelease&&L.semver.prerelease.length&&L.semver.major===$.major&&L.semver.minor===$.minor&&L.semver.patch===$.patch)$=!1}if(L.operator===">"||L.operator===">="){if(q=g7(J,L,X),q===L&&q!==J)return!1}else if(J.operator===">="&&!L.test(J.semver))return!1}if(G){if(B){if(L.semver.prerelease&&L.semver.prerelease.length&&L.semver.major===B.major&&L.semver.minor===B.minor&&L.semver.patch===B.patch)B=!1}if(L.operator==="<"||L.operator==="<="){if(K=h7(G,L,X),K===L&&K!==G)return!1}else if(G.operator==="<="&&!L.test(G.semver))return!1}if(!L.operator&&(G||J)&&z!==0)return!1}if(J&&V&&!G&&z!==0)return!1;if(G&&H&&!J&&z!==0)return!1;if($||B)return!1;return!0},g7=(Z,W,X)=>{if(!Z)return W;let Q=b3(Z.semver,W.semver,X);return Q>0?Z:Q<0?W:W.operator===">"&&Z.operator===">="?W:Z},h7=(Z,W,X)=>{if(!Z)return W;let Q=b3(Z.semver,W.semver,X);return Q<0?Z:Q>0?W:W.operator==="<"&&Z.operator==="<="?W:Z};f7.exports=$Y});var l7=i((jF,c7)=>{var v3=w6(),u7=M6(),AY=P0(),d7=D3(),IY=g1(),MY=VZ(),wY=HZ(),NY=LZ(),DY=MZ(),TY=NZ(),RY=TZ(),PY=PZ(),_Y=jZ(),jY=n0(),EY=xZ(),CY=SZ(),OY=o4(),xY=gZ(),kY=fZ(),SY=s6(),bY=t4(),vY=R3(),yY=P3(),gY=e4(),hY=Z2(),fY=_3(),mY=rZ(),uY=sZ(),dY=t6(),cY=i0(),lY=Z4(),pY=B7(),nY=$7(),iY=L7(),rY=M7(),aY=N7(),sY=J2(),oY=j7(),tY=C7(),eY=k7(),ZU=b7(),WU=m7();c7.exports={parse:IY,valid:MY,clean:wY,inc:NY,diff:DY,major:TY,minor:RY,patch:PY,prerelease:_Y,compare:jY,rcompare:EY,compareLoose:CY,compareBuild:OY,sort:xY,rsort:kY,gt:SY,lt:bY,eq:vY,neq:yY,gte:gY,lte:hY,cmp:fY,coerce:mY,truncate:uY,Comparator:dY,Range:cY,satisfies:lY,toComparators:pY,maxSatisfying:nY,minSatisfying:iY,minVersion:rY,validRange:aY,outside:sY,gtr:oY,ltr:tY,intersects:eY,simplifyRange:ZU,subset:WU,SemVer:AY,re:v3.re,src:v3.src,tokens:v3.t,SEMVER_SPEC_VERSION:u7.SEMVER_SPEC_VERSION,RELEASE_TYPES:u7.RELEASE_TYPES,compareIdentifiers:d7.compareIdentifiers,rcompareIdentifiers:d7.rcompareIdentifiers}});var P1;var G2=c(()=>{P1={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.2",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.4"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.2","@img/sharp-darwin-x64":"0.35.2","@img/sharp-freebsd-wasm32":"0.35.2","@img/sharp-libvips-darwin-arm64":"1.3.1","@img/sharp-libvips-darwin-x64":"1.3.1","@img/sharp-libvips-linux-arm":"1.3.1","@img/sharp-libvips-linux-arm64":"1.3.1","@img/sharp-libvips-linux-ppc64":"1.3.1","@img/sharp-libvips-linux-riscv64":"1.3.1","@img/sharp-libvips-linux-s390x":"1.3.1","@img/sharp-libvips-linux-x64":"1.3.1","@img/sharp-libvips-linuxmusl-arm64":"1.3.1","@img/sharp-libvips-linuxmusl-x64":"1.3.1","@img/sharp-linux-arm":"0.35.2","@img/sharp-linux-arm64":"0.35.2","@img/sharp-linux-ppc64":"0.35.2","@img/sharp-linux-riscv64":"0.35.2","@img/sharp-linux-s390x":"0.35.2","@img/sharp-linux-x64":"0.35.2","@img/sharp-linuxmusl-arm64":"0.35.2","@img/sharp-linuxmusl-x64":"0.35.2","@img/sharp-webcontainers-wasm32":"0.35.2","@img/sharp-win32-arm64":"0.35.2","@img/sharp-win32-ia32":"0.35.2","@img/sharp-win32-x64":"0.35.2"},devDependencies:{"@biomejs/biome":"^2.5.0","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.1","@img/sharp-libvips-dev":"1.3.1","@img/sharp-libvips-dev-wasm32":"1.3.1","@img/sharp-libvips-win32-arm64":"1.3.1","@img/sharp-libvips-win32-ia32":"1.3.1","@img/sharp-libvips-win32-x64":"1.3.1","@types/node":"*",emnapi:"^1.11.1","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.8.0","node-gyp":"^12.4.0",publint:"^0.3.21","tar-fs":"^3.1.2",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.3"},funding:{url:"https://opencollective.com/libvips"}}});import{spawnSync as W4}from"node:child_process";import{createHash as QU}from"node:crypto";var X4,g3,JU,n7,GU,h3,zU=(Z)=>{if(Z instanceof Error)console.error(`sharp: Installation error: ${Z.message}`);else console.log(`sharp: ${Z}`)},i7=()=>g3.default.isNonGlibcLinuxSync()?g3.default.familySync():"",YU=()=>`${process.platform}${i7()}-${process.arch}`,N6=()=>{if(r7())return"wasm32";let{npm_config_arch:Z,npm_config_platform:W,npm_config_libc:X}=process.env,Q=typeof X==="string"?X:i7();return`${W||process.platform}${Q}-${Z||process.arch}`},UU=()=>{try{return T0(`@img/sharp-libvips-dev-${N6()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},qU=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},KU=()=>{try{return T0(`@img/sharp-libvips-dev-${N6()}/lib`)}catch{try{return T0(`@img/sharp-libvips-${N6()}/lib`)}catch{}}return""},VU=()=>{if(process.release?.name==="node"&&process.versions){if(!X4.default.satisfies(process.versions.node,P1.engines.node))return{found:process.versions.node,expected:P1.engines.node}}},r7=()=>{let{CC:Z}=process.env;return Boolean(Z?.endsWith("/emcc"))},BU=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(W4("sysctl sysctl.proc_translated",h3).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},p7=(Z)=>QU("sha512").update(Z).digest("hex"),HU=()=>{try{let Z=p7(`imgsharp-libvips-${N6()}`),W=X4.default.coerce(P1.optionalDependencies[`@img/sharp-libvips-${N6()}`],{includePrerelease:!0}).version;return p7(`${Z}npm:${W}`).slice(0,10)}catch{}return""},$U=()=>W4(`node-gyp rebuild --directory=src ${r7()?"--nodedir=emscripten":""}`,{...h3,stdio:"inherit"}).status,a7=()=>{if(process.platform!=="win32")return(W4("pkg-config --modversion vips-cpp",{...h3,env:{...process.env,PKG_CONFIG_PATH:s7()}}).stdout||"").trim();else return""},FU=()=>{try{let Z=(W4("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(Z)return`${Z}/lib/pkgconfig`}catch(Z){}return},LU=()=>{try{let Z=(W4("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(Z)return Z}catch(Z){}return},s7=()=>{if(process.platform!=="win32")return[FU(),LU(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},y3=(Z,W,X)=>{if(X)X(`Detected ${W}, skipping search for globally-installed libvips`);return Z},AU=(Z)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return y3(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",Z);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return y3(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",Z);if(BU())return y3(!1,"Rosetta",Z);let W=a7();return!!W&&X4.default.gte(W,n7)},z2;var f3=c(()=>{G2();X4=v6(l7(),1),g3=v6(p4(),1);/*!
|
|
210
210
|
Copyright 2013 Lovell Fuller and others.
|
|
211
211
|
SPDX-License-Identifier: Apache-2.0
|
|
212
|
-
*/
|
|
212
|
+
*/JU=process.env.npm_package_config_libvips||P1.config.libvips,n7=X4.default.coerce(JU).version,GU=["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"],h3={encoding:"utf8",shell:!0},z2={minimumLibvipsVersion:n7,prebuiltPlatforms:GU,buildPlatformArch:N6,buildSharpLibvipsIncludeDir:UU,buildSharpLibvipsCPlusPlusDir:qU,buildSharpLibvipsLibDir:KU,isUnsupportedNodeRuntime:VU,runtimePlatformArch:YU,log:zU,yarnLocator:HU,spawnRebuild:$U,globalLibvipsVersion:a7,pkgConfigPath:s7,useGlobalLibvips:AU}});import{createRequire as IU}from"node:module";var Y2,M0,t7,MU,o7,wU,NU,h1,G0,f1,Z0;var Q4=c(()=>{f3();G2();Y2=v6(p4(),1);/*!
|
|
213
213
|
Copyright 2013 Lovell Fuller and others.
|
|
214
214
|
SPDX-License-Identifier: Apache-2.0
|
|
215
|
-
*/
|
|
216
|
-
`))}Z0=
|
|
215
|
+
*/M0=IU(import.meta.url),{version:t7}=P1,{runtimePlatformArch:MU,isUnsupportedNodeRuntime:o7,prebuiltPlatforms:wU,minimumLibvipsVersion:NU}=z2,h1=MU(),f1=[];try{G0=M0(`../src/build/Release/sharp-${h1}-${t7}.node`)}catch(Z){f1.push(Z)}if(!G0)try{G0=M0(`../src/build/Release/sharp-wasm32-${t7}.node`)}catch(Z){f1.push(Z)}if(!G0)try{switch(h1){case"darwin-arm64":G0=M0("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":G0=M0("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":G0=M0("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":G0=M0("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":G0=M0("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":G0=M0("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":G0=M0("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":G0=M0("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":G0=M0("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":G0=M0("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":G0=M0("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":G0=M0("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":G0=M0("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":G0=M0("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":G0=M0("@img/sharp-webcontainers-wasm32/sharp.node");break}if(G0&&["linux-x64","linuxmusl-x64"].includes(h1)&&!G0._isUsingX64V2()){let Z=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");Z.code="Unsupported CPU",f1.push(Z),G0=null}}catch(Z){f1.push(Z)}if(!G0)try{G0=M0("@img/sharp-wasm32/sharp.node")}catch(Z){f1.push(Z)}if(!G0){let[Z,W,X]=["linux","darwin","win32"].map((G)=>h1.startsWith(G)),Q=[`Could not load the "sharp" module using the ${h1} runtime`];f1.forEach((G)=>{if(!G.code.endsWith("MODULE_NOT_FOUND"))Q.push(`${G.code}: ${G.message}`)});let J=f1.map((G)=>G.message).join(" ");if(Q.push("Possible solutions:"),o7()){let{found:G,expected:z}=o7();Q.push("- Please upgrade Node.js:",` Found ${G}`,` Requires ${z}`)}else if(wU.includes(h1)){let[G,z]=h1.split("-"),q=G.endsWith("musl")?" --libc=musl":"";Q.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${G.replace("musl","")}${q} --cpu=${z} sharp`)}else Q.push(`- Manually install libvips >= ${NU}`," 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}=M0(`@img/sharp-libvips-${h1}/package`),z=`${Y2.familySync()} ${Y2.versionSync()}`,q=`${G.musl?"musl":"glibc"} ${G.musl||G.glibc}`;Q.push("- Update your OS:",` Found ${z}`,` Requires ${q}`)}catch(G){}if(Z&&/\/snap\/core[0-9]{2}/.test(J))Q.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(W&&/Incompatible library version/.test(J))Q.push("- Update Homebrew:"," brew update && brew upgrade vips");if(f1.some((G)=>G.code==="ERR_DLOPEN_DISABLED"))Q.push("- Run Node.js without using the --no-addons flag");if(X&&/The specified procedure could not be found/.test(J))Q.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw Q.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(Q.join(`
|
|
216
|
+
`))}Z0=G0});import DU from"node:util";import m3 from"node:stream";function PU(){let Z=this.constructor.call(),{debuglog:W,queueListener:X,...Q}=this.options;if(Z.options=structuredClone(Q),Z.options.debuglog=W,Z.options.queueListener=X,this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z.options.input.buffer=this.options.input.buffer,Z.emit("finish")});return Z}var TU,RU=(Z)=>{o1.queue.emit("change",Z)},o1=function(Z,W){if(arguments.length===1&&!Y.defined(Z))throw Error("Invalid input");if(!(this instanceof o1))return new o1(Z,W);return m3.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:(X)=>{this.emit("warning",X),TU(X)},queueListener:RU},this.options.input=this._createInputDescriptor(Z,W,{allowStream:!0}),this},U1;var e7=c(()=>{Q1();Q4();/*!
|
|
217
217
|
Copyright 2013 Lovell Fuller and others.
|
|
218
218
|
SPDX-License-Identifier: Apache-2.0
|
|
219
|
-
*/jU=_U.debuglog("sharp");Object.setPrototypeOf(o1.prototype,m3.Duplex.prototype);Object.setPrototypeOf(o1,m3.Duplex);Object.assign(o1.prototype,{clone:CU});U1=o1});function ZW(Z){let W=xU.filter((X)=>Y.defined(Z[X])).map((X)=>[X,Z[X]]);return W.length?Object.fromEntries(W):void 0}function kU(Z,W,X){let Q={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(Y.string(Z))Q.file=Z;else if(Y.buffer(Z)){if(Z.length===0)throw Error("Input Buffer is empty");Q.buffer=Z}else if(Y.arrayBuffer(Z)){if(Z.byteLength===0)throw Error("Input bit Array is empty");Q.buffer=Buffer.from(Z,0,Z.byteLength)}else if(Y.typedArray(Z)){if(Z.length===0)throw Error("Input Bit Array is empty");Q.buffer=Buffer.from(Z.buffer,Z.byteOffset,Z.byteLength)}else if(Y.plainObject(Z)&&!Y.defined(W)){if(W=Z,ZW(W))Q.buffer=[]}else if(!Y.defined(Z)&&!Y.defined(W)&&Y.object(X)&&X.allowStream)Q.buffer=[];else if(Array.isArray(Z))if(Z.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=Z.map((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}${Y.defined(W)?` when also providing options of type ${typeof W}`:""}`);if(Y.object(W)){if(Y.defined(W.failOn))if(Y.string(W.failOn)&&Y.inArray(W.failOn,["none","truncated","error","warning"]))Q.failOn=W.failOn;else throw Y.invalidParameterError("failOn","one of: none, truncated, error, warning",W.failOn);if(Y.defined(W.autoOrient))if(Y.bool(W.autoOrient))Q.autoOrient=W.autoOrient;else throw Y.invalidParameterError("autoOrient","boolean",W.autoOrient);if(Y.defined(W.density))if(Y.number(W.density)&&Y.inRange(W.density,1,1e5))Q.density=W.density;else throw Y.invalidParameterError("density","number between 1 and 100000",W.density);if(Y.defined(W.ignoreIcc))if(Y.bool(W.ignoreIcc))Q.ignoreIcc=W.ignoreIcc;else throw Y.invalidParameterError("ignoreIcc","boolean",W.ignoreIcc);if(Y.defined(W.limitInputPixels))if(Y.bool(W.limitInputPixels))Q.limitInputPixels=W.limitInputPixels?268402689:0;else if(Y.integer(W.limitInputPixels)&&Y.inRange(W.limitInputPixels,0,Number.MAX_SAFE_INTEGER))Q.limitInputPixels=W.limitInputPixels;else throw Y.invalidParameterError("limitInputPixels","positive integer",W.limitInputPixels);if(Y.defined(W.limitInputChannels))if(Y.bool(W.limitInputChannels))Q.limitInputChannels=W.limitInputChannels?5:0;else if(Y.integer(W.limitInputChannels)&&Y.inRange(W.limitInputChannels,0,Number.MAX_SAFE_INTEGER))Q.limitInputChannels=W.limitInputChannels;else throw Y.invalidParameterError("limitInputChannels","positive integer",W.limitInputChannels);if(Y.defined(W.unlimited))if(Y.bool(W.unlimited))Q.unlimited=W.unlimited;else throw Y.invalidParameterError("unlimited","boolean",W.unlimited);if(Y.defined(W.sequentialRead))if(Y.bool(W.sequentialRead))Q.sequentialRead=W.sequentialRead;else throw Y.invalidParameterError("sequentialRead","boolean",W.sequentialRead);if(Y.defined(W.raw)){if(Y.object(W.raw)&&Y.integer(W.raw.width)&&W.raw.width>0&&Y.integer(W.raw.height)&&W.raw.height>0&&Y.integer(W.raw.channels)&&Y.inRange(W.raw.channels,1,4))switch(Q.rawWidth=W.raw.width,Q.rawHeight=W.raw.height,Q.rawChannels=W.raw.channels,Z.constructor){case Uint8Array:case Uint8ClampedArray:Q.rawDepth="uchar";break;case Int8Array:Q.rawDepth="char";break;case Uint16Array:Q.rawDepth="ushort";break;case Int16Array:Q.rawDepth="short";break;case Uint32Array:Q.rawDepth="uint";break;case Int32Array:Q.rawDepth="int";break;case Float32Array:Q.rawDepth="float";break;case Float64Array:Q.rawDepth="double";break;default:Q.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(Q.rawPremultiplied=!1,Y.defined(W.raw.premultiplied))if(Y.bool(W.raw.premultiplied))Q.rawPremultiplied=W.raw.premultiplied;else throw Y.invalidParameterError("raw.premultiplied","boolean",W.raw.premultiplied);if(Q.rawPageHeight=0,Y.defined(W.raw.pageHeight))if(Y.integer(W.raw.pageHeight)&&W.raw.pageHeight>0&&W.raw.pageHeight<=W.raw.height){if(W.raw.height%W.raw.pageHeight!==0)throw Error(`Expected raw.height ${W.raw.height} to be a multiple of raw.pageHeight ${W.raw.pageHeight}`);Q.rawPageHeight=W.raw.pageHeight}else throw Y.invalidParameterError("raw.pageHeight","positive integer",W.raw.pageHeight)}if(Y.defined(W.animated))if(Y.bool(W.animated))Q.pages=W.animated?-1:1;else throw Y.invalidParameterError("animated","boolean",W.animated);if(Y.defined(W.pages))if(Y.integer(W.pages)&&Y.inRange(W.pages,-1,1e5))Q.pages=W.pages;else throw Y.invalidParameterError("pages","integer between -1 and 100000",W.pages);if(Y.defined(W.page))if(Y.integer(W.page)&&Y.inRange(W.page,0,1e5))Q.page=W.page;else throw Y.invalidParameterError("page","integer between 0 and 100000",W.page);if(Y.object(W.openSlide)&&Y.defined(W.openSlide.level))if(Y.integer(W.openSlide.level)&&Y.inRange(W.openSlide.level,0,256))Q.openSlideLevel=W.openSlide.level;else throw Y.invalidParameterError("openSlide.level","integer between 0 and 256",W.openSlide.level);else if(Y.defined(W.level))if(Y.integer(W.level)&&Y.inRange(W.level,0,256))Q.openSlideLevel=W.level;else throw Y.invalidParameterError("level","integer between 0 and 256",W.level);if(Y.object(W.tiff)&&Y.defined(W.tiff.subifd))if(Y.integer(W.tiff.subifd)&&Y.inRange(W.tiff.subifd,-1,1e5))Q.tiffSubifd=W.tiff.subifd;else throw Y.invalidParameterError("tiff.subifd","integer between -1 and 100000",W.tiff.subifd);else if(Y.defined(W.subifd))if(Y.integer(W.subifd)&&Y.inRange(W.subifd,-1,1e5))Q.tiffSubifd=W.subifd;else throw Y.invalidParameterError("subifd","integer between -1 and 100000",W.subifd);if(Y.object(W.svg)){if(Y.defined(W.svg.stylesheet))if(Y.string(W.svg.stylesheet))Q.svgStylesheet=W.svg.stylesheet;else throw Y.invalidParameterError("svg.stylesheet","string",W.svg.stylesheet);if(Y.defined(W.svg.highBitdepth))if(Y.bool(W.svg.highBitdepth))Q.svgHighBitdepth=W.svg.highBitdepth;else throw Y.invalidParameterError("svg.highBitdepth","boolean",W.svg.highBitdepth)}if(Y.object(W.pdf)&&Y.defined(W.pdf.background))Q.pdfBackground=this._getBackgroundColourOption(W.pdf.background);else if(Y.defined(W.pdfBackground))Q.pdfBackground=this._getBackgroundColourOption(W.pdfBackground);if(Y.object(W.jp2)&&Y.defined(W.jp2.oneshot))if(Y.bool(W.jp2.oneshot))Q.jp2Oneshot=W.jp2.oneshot;else throw Y.invalidParameterError("jp2.oneshot","boolean",W.jp2.oneshot);if(Y.defined(W.create))if(Y.object(W.create)&&Y.integer(W.create.width)&&W.create.width>0&&Y.integer(W.create.height)&&W.create.height>0&&Y.integer(W.create.channels)){if(Q.createWidth=W.create.width,Q.createHeight=W.create.height,Q.createChannels=W.create.channels,Q.createPageHeight=0,Y.defined(W.create.pageHeight))if(Y.integer(W.create.pageHeight)&&W.create.pageHeight>0&&W.create.pageHeight<=W.create.height){if(W.create.height%W.create.pageHeight!==0)throw Error(`Expected create.height ${W.create.height} to be a multiple of create.pageHeight ${W.create.pageHeight}`);Q.createPageHeight=W.create.pageHeight}else throw Y.invalidParameterError("create.pageHeight","positive integer",W.create.pageHeight);if(Y.defined(W.create.noise)){if(!Y.object(W.create.noise))throw Error("Expected noise to be an object");if(W.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(Q.createNoiseType=W.create.noise.type,!Y.inRange(W.create.channels,1,4))throw Y.invalidParameterError("create.channels","number between 1 and 4",W.create.channels);if(Q.createNoiseMean=128,Y.defined(W.create.noise.mean))if(Y.number(W.create.noise.mean)&&Y.inRange(W.create.noise.mean,0,1e4))Q.createNoiseMean=W.create.noise.mean;else throw Y.invalidParameterError("create.noise.mean","number between 0 and 10000",W.create.noise.mean);if(Q.createNoiseSigma=30,Y.defined(W.create.noise.sigma))if(Y.number(W.create.noise.sigma)&&Y.inRange(W.create.noise.sigma,0,1e4))Q.createNoiseSigma=W.create.noise.sigma;else throw Y.invalidParameterError("create.noise.sigma","number between 0 and 10000",W.create.noise.sigma)}else if(Y.defined(W.create.background)){if(!Y.inRange(W.create.channels,3,4))throw Y.invalidParameterError("create.channels","number between 3 and 4",W.create.channels);Q.createBackground=this._getBackgroundColourOption(W.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete Q.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(Y.defined(W.text))if(Y.object(W.text)&&Y.string(W.text.text)){if(Q.textValue=W.text.text,Y.defined(W.text.height)&&Y.defined(W.text.dpi))throw Error("Expected only one of dpi or height");if(Y.defined(W.text.font))if(Y.string(W.text.font))Q.textFont=W.text.font;else throw Y.invalidParameterError("text.font","string",W.text.font);if(Y.defined(W.text.fontfile))if(Y.string(W.text.fontfile))Q.textFontfile=W.text.fontfile;else throw Y.invalidParameterError("text.fontfile","string",W.text.fontfile);if(Y.defined(W.text.width))if(Y.integer(W.text.width)&&W.text.width>0)Q.textWidth=W.text.width;else throw Y.invalidParameterError("text.width","positive integer",W.text.width);if(Y.defined(W.text.height))if(Y.integer(W.text.height)&&W.text.height>0)Q.textHeight=W.text.height;else throw Y.invalidParameterError("text.height","positive integer",W.text.height);if(Y.defined(W.text.align))if(Y.string(W.text.align)&&Y.string(this.constructor.align[W.text.align]))Q.textAlign=this.constructor.align[W.text.align];else throw Y.invalidParameterError("text.align","valid alignment",W.text.align);if(Y.defined(W.text.justify))if(Y.bool(W.text.justify))Q.textJustify=W.text.justify;else throw Y.invalidParameterError("text.justify","boolean",W.text.justify);if(Y.defined(W.text.dpi))if(Y.integer(W.text.dpi)&&Y.inRange(W.text.dpi,1,1e6))Q.textDpi=W.text.dpi;else throw Y.invalidParameterError("text.dpi","integer between 1 and 1000000",W.text.dpi);if(Y.defined(W.text.rgba))if(Y.bool(W.text.rgba))Q.textRgba=W.text.rgba;else throw Y.invalidParameterError("text.rgba","bool",W.text.rgba);if(Y.defined(W.text.spacing))if(Y.integer(W.text.spacing)&&Y.inRange(W.text.spacing,-1e6,1e6))Q.textSpacing=W.text.spacing;else throw Y.invalidParameterError("text.spacing","integer between -1000000 and 1000000",W.text.spacing);if(Y.defined(W.text.wrap))if(Y.string(W.text.wrap)&&Y.inArray(W.text.wrap,["word","char","word-char","none"]))Q.textWrap=W.text.wrap;else throw Y.invalidParameterError("text.wrap","one of: word, char, word-char, none",W.text.wrap);delete Q.buffer}else throw Error("Expected a valid string to create an image with text.");if(Y.defined(W.join))if(Y.defined(this.options.join)){if(Y.defined(W.join.animated))if(Y.bool(W.join.animated))Q.joinAnimated=W.join.animated;else throw Y.invalidParameterError("join.animated","boolean",W.join.animated);if(Y.defined(W.join.across))if(Y.integer(W.join.across)&&Y.inRange(W.join.across,1,1e6))Q.joinAcross=W.join.across;else throw Y.invalidParameterError("join.across","integer between 1 and 100000",W.join.across);if(Y.defined(W.join.shim))if(Y.integer(W.join.shim)&&Y.inRange(W.join.shim,0,1e6))Q.joinShim=W.join.shim;else throw Y.invalidParameterError("join.shim","integer between 0 and 100000",W.join.shim);if(Y.defined(W.join.background))Q.joinBackground=this._getBackgroundColourOption(W.join.background);if(Y.defined(W.join.halign))if(Y.string(W.join.halign)&&Y.string(this.constructor.align[W.join.halign]))Q.joinHalign=this.constructor.align[W.join.halign];else throw Y.invalidParameterError("join.halign","valid alignment",W.join.halign);if(Y.defined(W.join.valign))if(Y.string(W.join.valign)&&Y.string(this.constructor.align[W.join.valign]))Q.joinValign=this.constructor.align[W.join.valign];else throw Y.invalidParameterError("join.valign","valid alignment",W.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(Y.defined(W))throw Error(`Invalid input options ${W}`);return Q}function SU(Z,W,X){if(Array.isArray(this.options.input.buffer))if(Y.buffer(Z)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push(Z),X()}else X(Error("Non-Buffer data on Writable Stream"));else X(Error("Unexpected data on Writable Stream"))}function bU(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function vU(){return Array.isArray(this.options.input.buffer)}function yU(Z){let W=Error();if(Y.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z0.metadata(this.options,(X,Q)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q)})});else Z0.metadata(this.options,(X,Q)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{let J=()=>{this._flattenBufferIn(),Z0.metadata(this.options,(G,z)=>{if(G)Q(Y.nativeError(G,W));else X(z)})};if(this.writableFinished)J();else this.once("finish",J)});else return new Promise((X,Q)=>{Z0.metadata(this.options,(J,G)=>{if(J)Q(Y.nativeError(J,W));else X(G)})})}function gU(Z){let W=Error();if(Y.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z0.stats(this.options,(X,Q)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q)})});else Z0.stats(this.options,(X,Q)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.on("finish",function(){this._flattenBufferIn(),Z0.stats(this.options,(J,G)=>{if(J)Q(Y.nativeError(J,W));else X(G)})})});else return new Promise((X,Q)=>{Z0.stats(this.options,(J,G)=>{if(J)Q(Y.nativeError(J,W));else X(G)})})}var OU,xU,WW=(Z)=>{Object.assign(Z.prototype,{_inputOptionsFromObject:ZW,_createInputDescriptor:kU,_write:SU,_flattenBufferIn:bU,_isStreamInput:vU,metadata:yU,stats:gU}),Z.align=OU};var XW=d(()=>{Q1();Q4();/*!
|
|
219
|
+
*/TU=DU.debuglog("sharp");Object.setPrototypeOf(o1.prototype,m3.Duplex.prototype);Object.setPrototypeOf(o1,m3.Duplex);Object.assign(o1.prototype,{clone:PU});U1=o1});function ZW(Z){let W=jU.filter((X)=>Y.defined(Z[X])).map((X)=>[X,Z[X]]);return W.length?Object.fromEntries(W):void 0}function EU(Z,W,X){let Q={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(Y.string(Z))Q.file=Z;else if(Y.buffer(Z)){if(Z.length===0)throw Error("Input Buffer is empty");Q.buffer=Z}else if(Y.arrayBuffer(Z)){if(Z.byteLength===0)throw Error("Input bit Array is empty");Q.buffer=Buffer.from(Z,0,Z.byteLength)}else if(Y.typedArray(Z)){if(Z.length===0)throw Error("Input Bit Array is empty");Q.buffer=Buffer.from(Z.buffer,Z.byteOffset,Z.byteLength)}else if(Y.plainObject(Z)&&!Y.defined(W)){if(W=Z,ZW(W))Q.buffer=[]}else if(!Y.defined(Z)&&!Y.defined(W)&&Y.object(X)&&X.allowStream)Q.buffer=[];else if(Array.isArray(Z))if(Z.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=Z.map((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}${Y.defined(W)?` when also providing options of type ${typeof W}`:""}`);if(Y.object(W)){if(Y.defined(W.failOn))if(Y.string(W.failOn)&&Y.inArray(W.failOn,["none","truncated","error","warning"]))Q.failOn=W.failOn;else throw Y.invalidParameterError("failOn","one of: none, truncated, error, warning",W.failOn);if(Y.defined(W.autoOrient))if(Y.bool(W.autoOrient))Q.autoOrient=W.autoOrient;else throw Y.invalidParameterError("autoOrient","boolean",W.autoOrient);if(Y.defined(W.density))if(Y.number(W.density)&&Y.inRange(W.density,1,1e5))Q.density=W.density;else throw Y.invalidParameterError("density","number between 1 and 100000",W.density);if(Y.defined(W.ignoreIcc))if(Y.bool(W.ignoreIcc))Q.ignoreIcc=W.ignoreIcc;else throw Y.invalidParameterError("ignoreIcc","boolean",W.ignoreIcc);if(Y.defined(W.limitInputPixels))if(Y.bool(W.limitInputPixels))Q.limitInputPixels=W.limitInputPixels?268402689:0;else if(Y.integer(W.limitInputPixels)&&Y.inRange(W.limitInputPixels,0,Number.MAX_SAFE_INTEGER))Q.limitInputPixels=W.limitInputPixels;else throw Y.invalidParameterError("limitInputPixels","positive integer",W.limitInputPixels);if(Y.defined(W.limitInputChannels))if(Y.bool(W.limitInputChannels))Q.limitInputChannels=W.limitInputChannels?5:0;else if(Y.integer(W.limitInputChannels)&&Y.inRange(W.limitInputChannels,0,Number.MAX_SAFE_INTEGER))Q.limitInputChannels=W.limitInputChannels;else throw Y.invalidParameterError("limitInputChannels","positive integer",W.limitInputChannels);if(Y.defined(W.unlimited))if(Y.bool(W.unlimited))Q.unlimited=W.unlimited;else throw Y.invalidParameterError("unlimited","boolean",W.unlimited);if(Y.defined(W.sequentialRead))if(Y.bool(W.sequentialRead))Q.sequentialRead=W.sequentialRead;else throw Y.invalidParameterError("sequentialRead","boolean",W.sequentialRead);if(Y.defined(W.raw)){if(Y.object(W.raw)&&Y.integer(W.raw.width)&&W.raw.width>0&&Y.integer(W.raw.height)&&W.raw.height>0&&Y.integer(W.raw.channels)&&Y.inRange(W.raw.channels,1,4))switch(Q.rawWidth=W.raw.width,Q.rawHeight=W.raw.height,Q.rawChannels=W.raw.channels,Z.constructor){case Uint8Array:case Uint8ClampedArray:Q.rawDepth="uchar";break;case Int8Array:Q.rawDepth="char";break;case Uint16Array:Q.rawDepth="ushort";break;case Int16Array:Q.rawDepth="short";break;case Uint32Array:Q.rawDepth="uint";break;case Int32Array:Q.rawDepth="int";break;case Float32Array:Q.rawDepth="float";break;case Float64Array:Q.rawDepth="double";break;default:Q.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(Q.rawPremultiplied=!1,Y.defined(W.raw.premultiplied))if(Y.bool(W.raw.premultiplied))Q.rawPremultiplied=W.raw.premultiplied;else throw Y.invalidParameterError("raw.premultiplied","boolean",W.raw.premultiplied);if(Q.rawPageHeight=0,Y.defined(W.raw.pageHeight))if(Y.integer(W.raw.pageHeight)&&W.raw.pageHeight>0&&W.raw.pageHeight<=W.raw.height){if(W.raw.height%W.raw.pageHeight!==0)throw Error(`Expected raw.height ${W.raw.height} to be a multiple of raw.pageHeight ${W.raw.pageHeight}`);Q.rawPageHeight=W.raw.pageHeight}else throw Y.invalidParameterError("raw.pageHeight","positive integer",W.raw.pageHeight)}if(Y.defined(W.animated))if(Y.bool(W.animated))Q.pages=W.animated?-1:1;else throw Y.invalidParameterError("animated","boolean",W.animated);if(Y.defined(W.pages))if(Y.integer(W.pages)&&Y.inRange(W.pages,-1,1e5))Q.pages=W.pages;else throw Y.invalidParameterError("pages","integer between -1 and 100000",W.pages);if(Y.defined(W.page))if(Y.integer(W.page)&&Y.inRange(W.page,0,1e5))Q.page=W.page;else throw Y.invalidParameterError("page","integer between 0 and 100000",W.page);if(Y.object(W.openSlide)&&Y.defined(W.openSlide.level))if(Y.integer(W.openSlide.level)&&Y.inRange(W.openSlide.level,0,256))Q.openSlideLevel=W.openSlide.level;else throw Y.invalidParameterError("openSlide.level","integer between 0 and 256",W.openSlide.level);else if(Y.defined(W.level))if(Y.integer(W.level)&&Y.inRange(W.level,0,256))Q.openSlideLevel=W.level;else throw Y.invalidParameterError("level","integer between 0 and 256",W.level);if(Y.object(W.tiff)&&Y.defined(W.tiff.subifd))if(Y.integer(W.tiff.subifd)&&Y.inRange(W.tiff.subifd,-1,1e5))Q.tiffSubifd=W.tiff.subifd;else throw Y.invalidParameterError("tiff.subifd","integer between -1 and 100000",W.tiff.subifd);else if(Y.defined(W.subifd))if(Y.integer(W.subifd)&&Y.inRange(W.subifd,-1,1e5))Q.tiffSubifd=W.subifd;else throw Y.invalidParameterError("subifd","integer between -1 and 100000",W.subifd);if(Y.object(W.svg)){if(Y.defined(W.svg.stylesheet))if(Y.string(W.svg.stylesheet))Q.svgStylesheet=W.svg.stylesheet;else throw Y.invalidParameterError("svg.stylesheet","string",W.svg.stylesheet);if(Y.defined(W.svg.highBitdepth))if(Y.bool(W.svg.highBitdepth))Q.svgHighBitdepth=W.svg.highBitdepth;else throw Y.invalidParameterError("svg.highBitdepth","boolean",W.svg.highBitdepth)}if(Y.object(W.pdf)&&Y.defined(W.pdf.background))Q.pdfBackground=this._getBackgroundColourOption(W.pdf.background);else if(Y.defined(W.pdfBackground))Q.pdfBackground=this._getBackgroundColourOption(W.pdfBackground);if(Y.object(W.jp2)&&Y.defined(W.jp2.oneshot))if(Y.bool(W.jp2.oneshot))Q.jp2Oneshot=W.jp2.oneshot;else throw Y.invalidParameterError("jp2.oneshot","boolean",W.jp2.oneshot);if(Y.defined(W.create))if(Y.object(W.create)&&Y.integer(W.create.width)&&W.create.width>0&&Y.integer(W.create.height)&&W.create.height>0&&Y.integer(W.create.channels)){if(Q.createWidth=W.create.width,Q.createHeight=W.create.height,Q.createChannels=W.create.channels,Q.createPageHeight=0,Y.defined(W.create.pageHeight))if(Y.integer(W.create.pageHeight)&&W.create.pageHeight>0&&W.create.pageHeight<=W.create.height){if(W.create.height%W.create.pageHeight!==0)throw Error(`Expected create.height ${W.create.height} to be a multiple of create.pageHeight ${W.create.pageHeight}`);Q.createPageHeight=W.create.pageHeight}else throw Y.invalidParameterError("create.pageHeight","positive integer",W.create.pageHeight);if(Y.defined(W.create.noise)){if(!Y.object(W.create.noise))throw Error("Expected noise to be an object");if(W.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(Q.createNoiseType=W.create.noise.type,!Y.inRange(W.create.channels,1,4))throw Y.invalidParameterError("create.channels","number between 1 and 4",W.create.channels);if(Q.createNoiseMean=128,Y.defined(W.create.noise.mean))if(Y.number(W.create.noise.mean)&&Y.inRange(W.create.noise.mean,0,1e4))Q.createNoiseMean=W.create.noise.mean;else throw Y.invalidParameterError("create.noise.mean","number between 0 and 10000",W.create.noise.mean);if(Q.createNoiseSigma=30,Y.defined(W.create.noise.sigma))if(Y.number(W.create.noise.sigma)&&Y.inRange(W.create.noise.sigma,0,1e4))Q.createNoiseSigma=W.create.noise.sigma;else throw Y.invalidParameterError("create.noise.sigma","number between 0 and 10000",W.create.noise.sigma)}else if(Y.defined(W.create.background)){if(!Y.inRange(W.create.channels,3,4))throw Y.invalidParameterError("create.channels","number between 3 and 4",W.create.channels);Q.createBackground=this._getBackgroundColourOption(W.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete Q.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(Y.defined(W.text))if(Y.object(W.text)&&Y.string(W.text.text)){if(Q.textValue=W.text.text,Y.defined(W.text.height)&&Y.defined(W.text.dpi))throw Error("Expected only one of dpi or height");if(Y.defined(W.text.font))if(Y.string(W.text.font))Q.textFont=W.text.font;else throw Y.invalidParameterError("text.font","string",W.text.font);if(Y.defined(W.text.fontfile))if(Y.string(W.text.fontfile))Q.textFontfile=W.text.fontfile;else throw Y.invalidParameterError("text.fontfile","string",W.text.fontfile);if(Y.defined(W.text.width))if(Y.integer(W.text.width)&&W.text.width>0)Q.textWidth=W.text.width;else throw Y.invalidParameterError("text.width","positive integer",W.text.width);if(Y.defined(W.text.height))if(Y.integer(W.text.height)&&W.text.height>0)Q.textHeight=W.text.height;else throw Y.invalidParameterError("text.height","positive integer",W.text.height);if(Y.defined(W.text.align))if(Y.string(W.text.align)&&Y.string(this.constructor.align[W.text.align]))Q.textAlign=this.constructor.align[W.text.align];else throw Y.invalidParameterError("text.align","valid alignment",W.text.align);if(Y.defined(W.text.justify))if(Y.bool(W.text.justify))Q.textJustify=W.text.justify;else throw Y.invalidParameterError("text.justify","boolean",W.text.justify);if(Y.defined(W.text.dpi))if(Y.integer(W.text.dpi)&&Y.inRange(W.text.dpi,1,1e6))Q.textDpi=W.text.dpi;else throw Y.invalidParameterError("text.dpi","integer between 1 and 1000000",W.text.dpi);if(Y.defined(W.text.rgba))if(Y.bool(W.text.rgba))Q.textRgba=W.text.rgba;else throw Y.invalidParameterError("text.rgba","bool",W.text.rgba);if(Y.defined(W.text.spacing))if(Y.integer(W.text.spacing)&&Y.inRange(W.text.spacing,-1e6,1e6))Q.textSpacing=W.text.spacing;else throw Y.invalidParameterError("text.spacing","integer between -1000000 and 1000000",W.text.spacing);if(Y.defined(W.text.wrap))if(Y.string(W.text.wrap)&&Y.inArray(W.text.wrap,["word","char","word-char","none"]))Q.textWrap=W.text.wrap;else throw Y.invalidParameterError("text.wrap","one of: word, char, word-char, none",W.text.wrap);delete Q.buffer}else throw Error("Expected a valid string to create an image with text.");if(Y.defined(W.join))if(Y.defined(this.options.join)){if(Y.defined(W.join.animated))if(Y.bool(W.join.animated))Q.joinAnimated=W.join.animated;else throw Y.invalidParameterError("join.animated","boolean",W.join.animated);if(Y.defined(W.join.across))if(Y.integer(W.join.across)&&Y.inRange(W.join.across,1,1e6))Q.joinAcross=W.join.across;else throw Y.invalidParameterError("join.across","integer between 1 and 100000",W.join.across);if(Y.defined(W.join.shim))if(Y.integer(W.join.shim)&&Y.inRange(W.join.shim,0,1e6))Q.joinShim=W.join.shim;else throw Y.invalidParameterError("join.shim","integer between 0 and 100000",W.join.shim);if(Y.defined(W.join.background))Q.joinBackground=this._getBackgroundColourOption(W.join.background);if(Y.defined(W.join.halign))if(Y.string(W.join.halign)&&Y.string(this.constructor.align[W.join.halign]))Q.joinHalign=this.constructor.align[W.join.halign];else throw Y.invalidParameterError("join.halign","valid alignment",W.join.halign);if(Y.defined(W.join.valign))if(Y.string(W.join.valign)&&Y.string(this.constructor.align[W.join.valign]))Q.joinValign=this.constructor.align[W.join.valign];else throw Y.invalidParameterError("join.valign","valid alignment",W.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(Y.defined(W))throw Error(`Invalid input options ${W}`);return Q}function CU(Z,W,X){if(Array.isArray(this.options.input.buffer))if(Y.buffer(Z)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push(Z),X()}else X(Error("Non-Buffer data on Writable Stream"));else X(Error("Unexpected data on Writable Stream"))}function OU(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function xU(){return Array.isArray(this.options.input.buffer)}function kU(Z){let W=Error();if(Y.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z0.metadata(this.options,(X,Q)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q)})});else Z0.metadata(this.options,(X,Q)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{let J=()=>{this._flattenBufferIn(),Z0.metadata(this.options,(G,z)=>{if(G)Q(Y.nativeError(G,W));else X(z)})};if(this.writableFinished)J();else this.once("finish",J)});else return new Promise((X,Q)=>{Z0.metadata(this.options,(J,G)=>{if(J)Q(Y.nativeError(J,W));else X(G)})})}function SU(Z){let W=Error();if(Y.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z0.stats(this.options,(X,Q)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q)})});else Z0.stats(this.options,(X,Q)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.on("finish",function(){this._flattenBufferIn(),Z0.stats(this.options,(J,G)=>{if(J)Q(Y.nativeError(J,W));else X(G)})})});else return new Promise((X,Q)=>{Z0.stats(this.options,(J,G)=>{if(J)Q(Y.nativeError(J,W));else X(G)})})}var _U,jU,WW=(Z)=>{Object.assign(Z.prototype,{_inputOptionsFromObject:ZW,_createInputDescriptor:EU,_write:CU,_flattenBufferIn:OU,_isStreamInput:xU,metadata:kU,stats:SU}),Z.align=_U};var XW=c(()=>{Q1();Q4();/*!
|
|
220
220
|
Copyright 2013 Lovell Fuller and others.
|
|
221
221
|
SPDX-License-Identifier: Apache-2.0
|
|
222
|
-
*/
|
|
222
|
+
*/_U={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},jU=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function d3(Z){return Z.angle%360!==0||Z.rotationAngle!==0}function U2(Z){return Z.width!==-1||Z.height!==-1}function yU(Z,W,X){if(U2(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(Y.defined(Z))if(Y.object(Z)&&!Y.defined(X))X=Z;else if(Y.integer(Z)&&Z>0)this.options.width=Z;else throw Y.invalidParameterError("width","positive integer",Z);else this.options.width=-1;if(Y.defined(W))if(Y.integer(W)&&W>0)this.options.height=W;else throw Y.invalidParameterError("height","positive integer",W);else this.options.height=-1;if(Y.object(X)){if(Y.defined(X.width))if(Y.integer(X.width)&&X.width>0)this.options.width=X.width;else throw Y.invalidParameterError("width","positive integer",X.width);if(Y.defined(X.height))if(Y.integer(X.height)&&X.height>0)this.options.height=X.height;else throw Y.invalidParameterError("height","positive integer",X.height);if(Y.defined(X.fit)){let Q=vU[X.fit];if(Y.string(Q))this.options.canvas=Q;else throw Y.invalidParameterError("fit","valid fit",X.fit)}if(Y.defined(X.position)){let Q=Y.integer(X.position)?X.position:zW[X.position]||GW[X.position]||JW[X.position];if(Y.integer(Q)&&(Y.inRange(Q,0,8)||Y.inRange(Q,16,17)))this.options.position=Q;else throw Y.invalidParameterError("position","valid position/gravity/strategy",X.position)}if(this._setBackgroundColourOption("resizeBackground",X.background),Y.defined(X.kernel))if(Y.string(u3[X.kernel]))this.options.kernel=u3[X.kernel];else throw Y.invalidParameterError("kernel","valid kernel name",X.kernel);if(Y.defined(X.withoutEnlargement))this._setBooleanOption("withoutEnlargement",X.withoutEnlargement);if(Y.defined(X.withoutReduction))this._setBooleanOption("withoutReduction",X.withoutReduction);if(Y.defined(X.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",X.fastShrinkOnLoad)}if(d3(this.options)&&U2(this.options))this.options.rotateBefore=!0;return this}function gU(Z){if(Y.integer(Z)&&Z>0)this.options.extendTop=Z,this.options.extendBottom=Z,this.options.extendLeft=Z,this.options.extendRight=Z;else if(Y.object(Z)){if(Y.defined(Z.top))if(Y.integer(Z.top)&&Z.top>=0)this.options.extendTop=Z.top;else throw Y.invalidParameterError("top","positive integer",Z.top);if(Y.defined(Z.bottom))if(Y.integer(Z.bottom)&&Z.bottom>=0)this.options.extendBottom=Z.bottom;else throw Y.invalidParameterError("bottom","positive integer",Z.bottom);if(Y.defined(Z.left))if(Y.integer(Z.left)&&Z.left>=0)this.options.extendLeft=Z.left;else throw Y.invalidParameterError("left","positive integer",Z.left);if(Y.defined(Z.right))if(Y.integer(Z.right)&&Z.right>=0)this.options.extendRight=Z.right;else throw Y.invalidParameterError("right","positive integer",Z.right);if(this._setBackgroundColourOption("extendBackground",Z.background),Y.defined(Z.extendWith))if(Y.string(QW[Z.extendWith]))this.options.extendWith=QW[Z.extendWith];else throw Y.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",Z.extendWith)}else throw Y.invalidParameterError("extend","integer or object",Z);return this}function hU(Z){let W=U2(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${W}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(X){let Q=Z[X];if(Y.integer(Q)&&Q>=0)this.options[X+(X==="left"||X==="top"?"Offset":"")+W]=Q;else throw Y.invalidParameterError(X,"integer",Q)},this),d3(this.options)&&!U2(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 fU(Z){if(this.options.trimThreshold=10,Y.defined(Z))if(Y.object(Z)){if(Y.defined(Z.background))this._setBackgroundColourOption("trimBackground",Z.background);if(Y.defined(Z.threshold))if(Y.number(Z.threshold)&&Z.threshold>=0)this.options.trimThreshold=Z.threshold;else throw Y.invalidParameterError("threshold","positive number",Z.threshold);if(Y.defined(Z.lineArt))this._setBooleanOption("trimLineArt",Z.lineArt);if(Y.defined(Z.margin))if(Y.integer(Z.margin)&&Z.margin>=0)this.options.trimMargin=Z.margin;else throw Y.invalidParameterError("margin","positive integer",Z.margin)}else throw Y.invalidParameterError("trim","object",Z);if(d3(this.options))this.options.rotateBefore=!0;return this}var JW,GW,QW,zW,u3,bU,vU,YW=(Z)=>{Object.assign(Z.prototype,{resize:yU,extend:gU,extract:hU,trim:fU}),Z.gravity=JW,Z.strategy=zW,Z.kernel=u3,Z.fit=bU,Z.position=GW};var UW=c(()=>{Q1();/*!
|
|
223
223
|
Copyright 2013 Lovell Fuller and others.
|
|
224
224
|
SPDX-License-Identifier: Apache-2.0
|
|
225
|
-
*/JW={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},GW={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},QW={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},zW={entropy:16,attention:17},u3={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},
|
|
225
|
+
*/JW={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},GW={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},QW={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},zW={entropy:16,attention:17},u3={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},bU={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},vU={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function mU(Z){if(!Array.isArray(Z))throw Y.invalidParameterError("images to composite","array",Z);return this.options.composite=Z.map((W)=>{if(!Y.object(W))throw Y.invalidParameterError("image to composite","object",W);let X=this._inputOptionsFromObject(W),Q={input:this._createInputDescriptor(W.input,X,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(Y.defined(W.blend))if(Y.string(c3[W.blend]))Q.blend=c3[W.blend];else throw Y.invalidParameterError("blend","valid blend name",W.blend);if(Y.defined(W.tile))if(Y.bool(W.tile))Q.tile=W.tile;else throw Y.invalidParameterError("tile","boolean",W.tile);if(Y.defined(W.left))if(Y.integer(W.left))Q.left=W.left;else throw Y.invalidParameterError("left","integer",W.left);if(Y.defined(W.top))if(Y.integer(W.top))Q.top=W.top;else throw Y.invalidParameterError("top","integer",W.top);if(Y.defined(W.top)!==Y.defined(W.left))throw Error("Expected both left and top to be set");else Q.hasOffset=Y.integer(W.top)&&Y.integer(W.left);if(Y.defined(W.gravity))if(Y.integer(W.gravity)&&Y.inRange(W.gravity,0,8))Q.gravity=W.gravity;else if(Y.string(W.gravity)&&Y.integer(this.constructor.gravity[W.gravity]))Q.gravity=this.constructor.gravity[W.gravity];else throw Y.invalidParameterError("gravity","valid gravity",W.gravity);if(Y.defined(W.premultiplied))if(Y.bool(W.premultiplied))Q.premultiplied=W.premultiplied;else throw Y.invalidParameterError("premultiplied","boolean",W.premultiplied);return Q}),this}var c3,qW=(Z)=>{Z.prototype.composite=mU,Z.blend=c3};var KW=c(()=>{Q1();/*!
|
|
226
226
|
Copyright 2013 Lovell Fuller and others.
|
|
227
227
|
SPDX-License-Identifier: Apache-2.0
|
|
228
|
-
*/c3={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 pU(Z,W){if(!Y.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(Y.integer(Z)&&!(Z%90))this.options.angle=Z;else if(Y.number(Z)){if(this.options.rotationAngle=Z,Y.object(W)&&W.background)this._setBackgroundColourOption("rotationBackground",W.background)}else throw Y.invalidParameterError("angle","numeric",Z);return this}function nU(){return this.options.input.autoOrient=!0,this}function iU(Z){return this.options.flip=Y.bool(Z)?Z:!0,this}function rU(Z){return this.options.flop=Y.bool(Z)?Z:!0,this}function aU(Z,W){let X=Array.isArray(Z)?[].concat(...Z):[];if(X.length===4&&X.every(Y.number))this.options.affineMatrix=X;else throw Y.invalidParameterError("matrix","1x4 or 2x2 array",Z);if(Y.defined(W))if(Y.object(W)){if(this._setBackgroundColourOption("affineBackground",W.background),Y.defined(W.idx))if(Y.number(W.idx))this.options.affineIdx=W.idx;else throw Y.invalidParameterError("options.idx","number",W.idx);if(Y.defined(W.idy))if(Y.number(W.idy))this.options.affineIdy=W.idy;else throw Y.invalidParameterError("options.idy","number",W.idy);if(Y.defined(W.odx))if(Y.number(W.odx))this.options.affineOdx=W.odx;else throw Y.invalidParameterError("options.odx","number",W.odx);if(Y.defined(W.ody))if(Y.number(W.ody))this.options.affineOdy=W.ody;else throw Y.invalidParameterError("options.ody","number",W.ody);if(Y.defined(W.interpolator))if(Y.inArray(W.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=W.interpolator;else throw Y.invalidParameterError("options.interpolator","valid interpolator name",W.interpolator)}else throw Y.invalidParameterError("options","object",W);return this}function sU(Z){if(Y.plainObject(Z)){if(Y.number(Z.sigma)&&Y.inRange(Z.sigma,0.000001,10))this.options.sharpenSigma=Z.sigma;else throw Y.invalidParameterError("options.sigma","number between 0.000001 and 10",Z.sigma);if(Y.defined(Z.m1))if(Y.number(Z.m1)&&Y.inRange(Z.m1,0,1e6))this.options.sharpenM1=Z.m1;else throw Y.invalidParameterError("options.m1","number between 0 and 1000000",Z.m1);if(Y.defined(Z.m2))if(Y.number(Z.m2)&&Y.inRange(Z.m2,0,1e6))this.options.sharpenM2=Z.m2;else throw Y.invalidParameterError("options.m2","number between 0 and 1000000",Z.m2);if(Y.defined(Z.x1))if(Y.number(Z.x1)&&Y.inRange(Z.x1,0,1e6))this.options.sharpenX1=Z.x1;else throw Y.invalidParameterError("options.x1","number between 0 and 1000000",Z.x1);if(Y.defined(Z.y2))if(Y.number(Z.y2)&&Y.inRange(Z.y2,0,1e6))this.options.sharpenY2=Z.y2;else throw Y.invalidParameterError("options.y2","number between 0 and 1000000",Z.y2);if(Y.defined(Z.y3))if(Y.number(Z.y3)&&Y.inRange(Z.y3,0,1e6))this.options.sharpenY3=Z.y3;else throw Y.invalidParameterError("options.y3","number between 0 and 1000000",Z.y3)}else this.options.sharpenSigma=-1;return this}function oU(Z){if(!Y.defined(Z))this.options.medianSize=3;else if(Y.integer(Z)&&Y.inRange(Z,1,1000))this.options.medianSize=Z;else throw Y.invalidParameterError("size","integer between 1 and 1000",Z);return this}function tU(Z){let W;if(Y.number(Z))W=Z;else if(Y.plainObject(Z)){if(!Y.number(Z.sigma))throw Y.invalidParameterError("options.sigma","number between 0.3 and 1000",W);if(W=Z.sigma,"precision"in Z)if(Y.string(VW[Z.precision]))this.options.precision=VW[Z.precision];else throw Y.invalidParameterError("precision","one of: integer, float, approximate",Z.precision);if("minAmplitude"in Z)if(Y.number(Z.minAmplitude)&&Y.inRange(Z.minAmplitude,0.001,1))this.options.minAmpl=Z.minAmplitude;else throw Y.invalidParameterError("minAmplitude","number between 0.001 and 1",Z.minAmplitude)}if(!Y.defined(Z))this.options.blurSigma=-1;else if(Y.bool(Z))this.options.blurSigma=Z?-1:0;else if(Y.number(W)&&Y.inRange(W,0.3,1000))this.options.blurSigma=W;else throw Y.invalidParameterError("sigma","number between 0.3 and 1000",W);return this}function BW(Z){if(!Y.defined(Z))this.options.dilateWidth=1;else if(Y.integer(Z)&&Z>0)this.options.dilateWidth=Z;else throw Y.invalidParameterError("dilate","positive integer",BW);return this}function HW(Z){if(!Y.defined(Z))this.options.erodeWidth=1;else if(Y.integer(Z)&&Z>0)this.options.erodeWidth=Z;else throw Y.invalidParameterError("erode","positive integer",HW);return this}function eU(Z){if(this.options.flatten=Y.bool(Z)?Z:!0,Y.object(Z))this._setBackgroundColourOption("flattenBackground",Z.background);return this}function Zq(){return this.options.unflatten=!0,this}function Wq(Z,W){if(!Y.defined(Z))this.options.gamma=2.2;else if(Y.number(Z)&&Y.inRange(Z,1,3))this.options.gamma=Z;else throw Y.invalidParameterError("gamma","number between 1.0 and 3.0",Z);if(!Y.defined(W))this.options.gammaOut=this.options.gamma;else if(Y.number(W)&&Y.inRange(W,1,3))this.options.gammaOut=W;else throw Y.invalidParameterError("gammaOut","number between 1.0 and 3.0",W);return this}function Xq(Z){if(this.options.negate=Y.bool(Z)?Z:!0,Y.plainObject(Z)&&"alpha"in Z)if(!Y.bool(Z.alpha))throw Y.invalidParameterError("alpha","should be boolean value",Z.alpha);else this.options.negateAlpha=Z.alpha;return this}function Qq(Z){if(Y.plainObject(Z)){if(Y.defined(Z.lower))if(Y.number(Z.lower)&&Y.inRange(Z.lower,0,99))this.options.normaliseLower=Z.lower;else throw Y.invalidParameterError("lower","number between 0 and 99",Z.lower);if(Y.defined(Z.upper))if(Y.number(Z.upper)&&Y.inRange(Z.upper,1,100))this.options.normaliseUpper=Z.upper;else throw Y.invalidParameterError("upper","number between 1 and 100",Z.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw Y.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function Jq(Z){return this.normalise(Z)}function Gq(Z){if(Y.plainObject(Z)){if(Y.integer(Z.width)&&Z.width>0)this.options.claheWidth=Z.width;else throw Y.invalidParameterError("width","integer greater than zero",Z.width);if(Y.integer(Z.height)&&Z.height>0)this.options.claheHeight=Z.height;else throw Y.invalidParameterError("height","integer greater than zero",Z.height);if(Y.defined(Z.maxSlope))if(Y.integer(Z.maxSlope)&&Y.inRange(Z.maxSlope,0,100))this.options.claheMaxSlope=Z.maxSlope;else throw Y.invalidParameterError("maxSlope","integer between 0 and 100",Z.maxSlope)}else throw Y.invalidParameterError("options","plain object",Z);return this}function zq(Z){if(!Y.object(Z)||!Array.isArray(Z.kernel)||!Y.integer(Z.width)||!Y.integer(Z.height)||!Y.inRange(Z.width,3,1001)||!Y.inRange(Z.height,3,1001)||Z.height*Z.width!==Z.kernel.length)throw Error("Invalid convolution kernel");if(!Y.integer(Z.scale))Z.scale=Z.kernel.reduce((W,X)=>W+X,0);if(Z.scale<1)Z.scale=1;if(!Y.integer(Z.offset))Z.offset=0;return this.options.convKernel=Z,this}function Yq(Z,W){if(!Y.defined(Z))this.options.threshold=128;else if(Y.bool(Z))this.options.threshold=Z?128:0;else if(Y.integer(Z)&&Y.inRange(Z,0,255))this.options.threshold=Z;else throw Y.invalidParameterError("threshold","integer between 0 and 255",Z);if(!Y.object(W)||W.greyscale===!0||W.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function Uq(Z,W,X){if(this.options.boolean=this._createInputDescriptor(Z,X),Y.string(W)&&Y.inArray(W,["and","or","eor"]))this.options.booleanOp=W;else throw Y.invalidParameterError("operator","one of: and, or, eor",W);return this}function qq(Z,W){if(!Y.defined(Z)&&Y.number(W))Z=1;else if(Y.number(Z)&&!Y.defined(W))W=0;if(!Y.defined(Z))this.options.linearA=[];else if(Y.number(Z))this.options.linearA=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every(Y.number))this.options.linearA=Z;else throw Y.invalidParameterError("a","number or array of numbers",Z);if(!Y.defined(W))this.options.linearB=[];else if(Y.number(W))this.options.linearB=[W];else if(Array.isArray(W)&&W.length&&W.every(Y.number))this.options.linearB=W;else throw Y.invalidParameterError("b","number or array of numbers",W);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 Kq(Z){if(!Array.isArray(Z))throw Y.invalidParameterError("inputMatrix","array",Z);if(Z.length!==3&&Z.length!==4)throw Y.invalidParameterError("inputMatrix","3x3 or 4x4 array",Z.length);let W=Z.flat().map(Number);if(W.length!==9&&W.length!==16)throw Y.invalidParameterError("inputMatrix","cardinality of 9 or 16",W.length);return this.options.recombMatrix=W,this}function Vq(Z){if(!Y.plainObject(Z))throw Y.invalidParameterError("options","plain object",Z);if("brightness"in Z)if(Y.number(Z.brightness)&&Z.brightness>=0)this.options.brightness=Z.brightness;else throw Y.invalidParameterError("brightness","number above zero",Z.brightness);if("saturation"in Z)if(Y.number(Z.saturation)&&Z.saturation>=0)this.options.saturation=Z.saturation;else throw Y.invalidParameterError("saturation","number above zero",Z.saturation);if("hue"in Z)if(Y.integer(Z.hue))this.options.hue=Z.hue%360;else throw Y.invalidParameterError("hue","number",Z.hue);if("lightness"in Z)if(Y.number(Z.lightness))this.options.lightness=Z.lightness;else throw Y.invalidParameterError("lightness","number",Z.lightness);return this}var VW,$W=(Z)=>{Object.assign(Z.prototype,{autoOrient:nU,rotate:pU,flip:iU,flop:rU,affine:aU,sharpen:sU,erode:HW,dilate:BW,median:oU,blur:tU,flatten:eU,unflatten:Zq,gamma:Wq,negate:Xq,normalise:Qq,normalize:Jq,clahe:Gq,convolve:zq,threshold:Yq,boolean:Uq,linear:qq,recomb:Kq,modulate:Vq})};var FW=d(()=>{Q1();/*!
|
|
228
|
+
*/c3={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 uU(Z,W){if(!Y.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(Y.integer(Z)&&!(Z%90))this.options.angle=Z;else if(Y.number(Z)){if(this.options.rotationAngle=Z,Y.object(W)&&W.background)this._setBackgroundColourOption("rotationBackground",W.background)}else throw Y.invalidParameterError("angle","numeric",Z);return this}function dU(){return this.options.input.autoOrient=!0,this}function cU(Z){return this.options.flip=Y.bool(Z)?Z:!0,this}function lU(Z){return this.options.flop=Y.bool(Z)?Z:!0,this}function pU(Z,W){let X=Array.isArray(Z)?[].concat(...Z):[];if(X.length===4&&X.every(Y.number))this.options.affineMatrix=X;else throw Y.invalidParameterError("matrix","1x4 or 2x2 array",Z);if(Y.defined(W))if(Y.object(W)){if(this._setBackgroundColourOption("affineBackground",W.background),Y.defined(W.idx))if(Y.number(W.idx))this.options.affineIdx=W.idx;else throw Y.invalidParameterError("options.idx","number",W.idx);if(Y.defined(W.idy))if(Y.number(W.idy))this.options.affineIdy=W.idy;else throw Y.invalidParameterError("options.idy","number",W.idy);if(Y.defined(W.odx))if(Y.number(W.odx))this.options.affineOdx=W.odx;else throw Y.invalidParameterError("options.odx","number",W.odx);if(Y.defined(W.ody))if(Y.number(W.ody))this.options.affineOdy=W.ody;else throw Y.invalidParameterError("options.ody","number",W.ody);if(Y.defined(W.interpolator))if(Y.inArray(W.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=W.interpolator;else throw Y.invalidParameterError("options.interpolator","valid interpolator name",W.interpolator)}else throw Y.invalidParameterError("options","object",W);return this}function nU(Z){if(Y.plainObject(Z)){if(Y.number(Z.sigma)&&Y.inRange(Z.sigma,0.000001,10))this.options.sharpenSigma=Z.sigma;else throw Y.invalidParameterError("options.sigma","number between 0.000001 and 10",Z.sigma);if(Y.defined(Z.m1))if(Y.number(Z.m1)&&Y.inRange(Z.m1,0,1e6))this.options.sharpenM1=Z.m1;else throw Y.invalidParameterError("options.m1","number between 0 and 1000000",Z.m1);if(Y.defined(Z.m2))if(Y.number(Z.m2)&&Y.inRange(Z.m2,0,1e6))this.options.sharpenM2=Z.m2;else throw Y.invalidParameterError("options.m2","number between 0 and 1000000",Z.m2);if(Y.defined(Z.x1))if(Y.number(Z.x1)&&Y.inRange(Z.x1,0,1e6))this.options.sharpenX1=Z.x1;else throw Y.invalidParameterError("options.x1","number between 0 and 1000000",Z.x1);if(Y.defined(Z.y2))if(Y.number(Z.y2)&&Y.inRange(Z.y2,0,1e6))this.options.sharpenY2=Z.y2;else throw Y.invalidParameterError("options.y2","number between 0 and 1000000",Z.y2);if(Y.defined(Z.y3))if(Y.number(Z.y3)&&Y.inRange(Z.y3,0,1e6))this.options.sharpenY3=Z.y3;else throw Y.invalidParameterError("options.y3","number between 0 and 1000000",Z.y3)}else this.options.sharpenSigma=-1;return this}function iU(Z){if(!Y.defined(Z))this.options.medianSize=3;else if(Y.integer(Z)&&Y.inRange(Z,1,1000))this.options.medianSize=Z;else throw Y.invalidParameterError("size","integer between 1 and 1000",Z);return this}function rU(Z){let W;if(Y.number(Z))W=Z;else if(Y.plainObject(Z)){if(!Y.number(Z.sigma))throw Y.invalidParameterError("options.sigma","number between 0.3 and 1000",W);if(W=Z.sigma,"precision"in Z)if(Y.string(VW[Z.precision]))this.options.precision=VW[Z.precision];else throw Y.invalidParameterError("precision","one of: integer, float, approximate",Z.precision);if("minAmplitude"in Z)if(Y.number(Z.minAmplitude)&&Y.inRange(Z.minAmplitude,0.001,1))this.options.minAmpl=Z.minAmplitude;else throw Y.invalidParameterError("minAmplitude","number between 0.001 and 1",Z.minAmplitude)}if(!Y.defined(Z))this.options.blurSigma=-1;else if(Y.bool(Z))this.options.blurSigma=Z?-1:0;else if(Y.number(W)&&Y.inRange(W,0.3,1000))this.options.blurSigma=W;else throw Y.invalidParameterError("sigma","number between 0.3 and 1000",W);return this}function aU(Z){if(!Y.defined(Z))this.options.dilateWidth=1;else if(Y.integer(Z)&&Y.inRange(Z,1,65536))this.options.dilateWidth=Z;else throw Y.invalidParameterError("width","integer between 1 and 65536",Z);return this}function sU(Z){if(!Y.defined(Z))this.options.erodeWidth=1;else if(Y.integer(Z)&&Y.inRange(Z,1,65536))this.options.erodeWidth=Z;else throw Y.invalidParameterError("width","integer between 1 and 65536",Z);return this}function oU(Z){if(this.options.flatten=Y.bool(Z)?Z:!0,Y.object(Z))this._setBackgroundColourOption("flattenBackground",Z.background);return this}function tU(){return this.options.unflatten=!0,this}function eU(Z,W){if(!Y.defined(Z))this.options.gamma=2.2;else if(Y.number(Z)&&Y.inRange(Z,1,3))this.options.gamma=Z;else throw Y.invalidParameterError("gamma","number between 1.0 and 3.0",Z);if(!Y.defined(W))this.options.gammaOut=this.options.gamma;else if(Y.number(W)&&Y.inRange(W,1,3))this.options.gammaOut=W;else throw Y.invalidParameterError("gammaOut","number between 1.0 and 3.0",W);return this}function Zq(Z){if(this.options.negate=Y.bool(Z)?Z:!0,Y.plainObject(Z)&&"alpha"in Z)if(!Y.bool(Z.alpha))throw Y.invalidParameterError("alpha","should be boolean value",Z.alpha);else this.options.negateAlpha=Z.alpha;return this}function Wq(Z){if(Y.plainObject(Z)){if(Y.defined(Z.lower))if(Y.number(Z.lower)&&Y.inRange(Z.lower,0,99))this.options.normaliseLower=Z.lower;else throw Y.invalidParameterError("lower","number between 0 and 99",Z.lower);if(Y.defined(Z.upper))if(Y.number(Z.upper)&&Y.inRange(Z.upper,1,100))this.options.normaliseUpper=Z.upper;else throw Y.invalidParameterError("upper","number between 1 and 100",Z.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw Y.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function Xq(Z){return this.normalise(Z)}function Qq(Z){if(Y.plainObject(Z)){if(Y.integer(Z.width)&&Z.width>0)this.options.claheWidth=Z.width;else throw Y.invalidParameterError("width","integer greater than zero",Z.width);if(Y.integer(Z.height)&&Z.height>0)this.options.claheHeight=Z.height;else throw Y.invalidParameterError("height","integer greater than zero",Z.height);if(Y.defined(Z.maxSlope))if(Y.integer(Z.maxSlope)&&Y.inRange(Z.maxSlope,0,100))this.options.claheMaxSlope=Z.maxSlope;else throw Y.invalidParameterError("maxSlope","integer between 0 and 100",Z.maxSlope)}else throw Y.invalidParameterError("options","plain object",Z);return this}function Jq(Z){if(!Y.object(Z)||!Array.isArray(Z.kernel)||!Y.integer(Z.width)||!Y.integer(Z.height)||!Y.inRange(Z.width,3,1001)||!Y.inRange(Z.height,3,1001)||Z.height*Z.width!==Z.kernel.length||!Z.kernel.every(Y.number))throw Error("Invalid convolution kernel");if(!Y.integer(Z.scale))Z.scale=Z.kernel.reduce((W,X)=>W+X,0);if(Z.scale<1)Z.scale=1;if(!Y.integer(Z.offset))Z.offset=0;return this.options.convKernel=Z,this}function Gq(Z,W){if(!Y.defined(Z))this.options.threshold=128;else if(Y.bool(Z))this.options.threshold=Z?128:0;else if(Y.integer(Z)&&Y.inRange(Z,0,255))this.options.threshold=Z;else throw Y.invalidParameterError("threshold","integer between 0 and 255",Z);if(!Y.object(W)||W.greyscale===!0||W.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function zq(Z,W,X){if(this.options.boolean=this._createInputDescriptor(Z,X),Y.string(W)&&Y.inArray(W,["and","or","eor"]))this.options.booleanOp=W;else throw Y.invalidParameterError("operator","one of: and, or, eor",W);return this}function Yq(Z,W){if(!Y.defined(Z)&&Y.number(W))Z=1;else if(Y.number(Z)&&!Y.defined(W))W=0;if(!Y.defined(Z))this.options.linearA=[];else if(Y.number(Z))this.options.linearA=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every(Y.number))this.options.linearA=Z;else throw Y.invalidParameterError("a","number or array of numbers",Z);if(!Y.defined(W))this.options.linearB=[];else if(Y.number(W))this.options.linearB=[W];else if(Array.isArray(W)&&W.length&&W.every(Y.number))this.options.linearB=W;else throw Y.invalidParameterError("b","number or array of numbers",W);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 Uq(Z){if(!Array.isArray(Z))throw Y.invalidParameterError("inputMatrix","array",Z);if(Z.length!==3&&Z.length!==4)throw Y.invalidParameterError("inputMatrix","3x3 or 4x4 array",Z.length);let W=Z.flat();if(W.length!==9&&W.length!==16)throw Y.invalidParameterError("inputMatrix","cardinality of 9 or 16",W.length);if(!W.every(Y.number))throw Y.invalidParameterError("inputMatrix","array of numbers",W);return this.options.recombMatrix=W,this}function qq(Z){if(!Y.plainObject(Z))throw Y.invalidParameterError("options","plain object",Z);if("brightness"in Z)if(Y.number(Z.brightness)&&Z.brightness>=0)this.options.brightness=Z.brightness;else throw Y.invalidParameterError("brightness","number above zero",Z.brightness);if("saturation"in Z)if(Y.number(Z.saturation)&&Z.saturation>=0)this.options.saturation=Z.saturation;else throw Y.invalidParameterError("saturation","number above zero",Z.saturation);if("hue"in Z)if(Y.integer(Z.hue))this.options.hue=Z.hue%360;else throw Y.invalidParameterError("hue","number",Z.hue);if("lightness"in Z)if(Y.number(Z.lightness))this.options.lightness=Z.lightness;else throw Y.invalidParameterError("lightness","number",Z.lightness);return this}var VW,BW=(Z)=>{Object.assign(Z.prototype,{autoOrient:dU,rotate:uU,flip:cU,flop:lU,affine:pU,sharpen:nU,erode:sU,dilate:aU,median:iU,blur:rU,flatten:oU,unflatten:tU,gamma:eU,negate:Zq,normalise:Wq,normalize:Xq,clahe:Qq,convolve:Jq,threshold:Gq,boolean:zq,linear:Yq,recomb:Uq,modulate:qq})};var HW=c(()=>{Q1();/*!
|
|
229
229
|
Copyright 2013 Lovell Fuller and others.
|
|
230
230
|
SPDX-License-Identifier: Apache-2.0
|
|
231
|
-
*/VW={integer:"integer",float:"float",approximate:"approximate"}});var NW=i((tF,wW)=>{var{defineProperty:r3,getOwnPropertyDescriptor:Bq,getOwnPropertyNames:Hq}=Object,$q=Object.prototype.hasOwnProperty,Fq=(Z,W)=>{for(var X in W)r3(Z,X,{get:W[X],enumerable:!0})},Lq=(Z,W,X,Q)=>{if(W&&typeof W==="object"||typeof W==="function"){for(let J of Hq(W))if(!$q.call(Z,J)&&J!==X)r3(Z,J,{get:()=>W[J],enumerable:!(Q=Bq(W,J))||Q.enumerable})}return Z},Aq=(Z)=>Lq(r3({},"__esModule",{value:!0}),Z),LW={};Fq(LW,{default:()=>xq});wW.exports=Aq(LW);var l3={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 l3)Object.freeze(l3[Z]);var q1=Object.freeze(l3),AW=Object.create(null);for(let Z in q1)if(Object.hasOwn(q1,Z))AW[q1[Z]]=Z;var v0={to:{},get:{}};v0.get=function(Z){let W=Z.slice(0,3).toLowerCase(),X,Q;switch(W){case"hsl":{X=v0.get.hsl(Z),Q="hsl";break}case"hwb":{X=v0.get.hwb(Z),Q="hwb";break}default:{X=v0.get.rgb(Z),Q="rgb";break}}if(!X)return null;return{model:Q,value:X}};v0.get.rgb=function(Z){if(!Z)return null;let W=/^#([a-f\d]{3,4})$/i,X=/^#([a-f\d]{6})([a-f\d]{2})?$/i,Q=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,J=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,G=/^(\w+)$/,z=[0,0,0,1],q,K,V;if(q=Z.match(X)){V=q[2],q=q[1];for(K=0;K<3;K++){let H=K*2;z[K]=Number.parseInt(q.slice(H,H+2),16)}if(V)z[3]=Number.parseInt(V,16)/255}else if(q=Z.match(W)){q=q[1],V=q[3];for(K=0;K<3;K++)z[K]=Number.parseInt(q[K]+q[K],16);if(V)z[3]=Number.parseInt(V+V,16)/255}else if(q=Z.match(Q)){for(K=0;K<3;K++)z[K]=Number.parseFloat(q[K+1]);if(q[4])z[3]=q[5]?Number.parseFloat(q[4])*0.01:Number.parseFloat(q[4])}else if(q=Z.match(J)){for(K=0;K<3;K++)z[K]=Math.round(Number.parseFloat(q[K+1])*2.55);if(q[4])z[3]=q[5]?Number.parseFloat(q[4])*0.01:Number.parseFloat(q[4])}else if(q=Z.toLowerCase().match(G)){if(q[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(q1,q[1]))return null;return z=q1[q[1]].slice(),z[3]=1,z}else return null;for(K=0;K<3;K++)z[K]=f1(z[K],0,255);return z[3]=f1(z[3],0,1),z};v0.get.hsl=function(Z){if(!Z)return null;let W=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=Z.match(W);if(X){let Q=Number.parseFloat(X[4]),J=(Number.parseFloat(X[1])%360+360)%360,G=f1(Number.parseFloat(X[2]),0,100),z=f1(Number.parseFloat(X[3]),0,100),q=f1(Number.isNaN(Q)?1:Q,0,1);return[J,G,z,q]}return null};v0.get.hwb=function(Z){if(!Z)return null;let W=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=Z.match(W);if(X){let Q=Number.parseFloat(X[4]),J=(Number.parseFloat(X[1])%360+360)%360,G=f1(Number.parseFloat(X[2]),0,100),z=f1(Number.parseFloat(X[3]),0,100),q=f1(Number.isNaN(Q)?1:Q,0,1);return[J,G,z,q]}return null};v0.to.hex=function(...Z){return"#"+K2(Z[0])+K2(Z[1])+K2(Z[2])+(Z[3]<1?K2(Math.round(Z[3]*255)):"")};v0.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]+")"};v0.to.rgb.percent=function(...Z){let W=Math.round(Z[0]/255*100),X=Math.round(Z[1]/255*100),Q=Math.round(Z[2]/255*100);return Z.length<4||Z[3]===1?"rgb("+W+"%, "+X+"%, "+Q+"%)":"rgba("+W+"%, "+X+"%, "+Q+"%, "+Z[3]+")"};v0.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]+")"};v0.to.hwb=function(...Z){let W="";if(Z.length>=4&&Z[3]!==1)W=", "+Z[3];return"hwb("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%"+W+")"};v0.to.keyword=function(...Z){return AW[Z.slice(0,3)]};function f1(Z,W,X){return Math.min(Math.max(W,Z),X)}function K2(Z){let W=Math.round(Z).toString(16).toUpperCase();return W.length<2?"0"+W:W}var D6=v0,MW={};for(let Z of Object.keys(q1))MW[q1[Z]]=Z;var v={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"]}},t1=v,_1=0.008856451679035631;function R6(Z){let W=Z>0.0031308?1.055*Z**0.4166666666666667-0.055:Z*12.92;return Math.min(Math.max(0,W),1)}function P6(Z){return Z>0.04045?((Z+0.055)/1.055)**2.4:Z/12.92}for(let Z of Object.keys(v)){if(!("channels"in v[Z]))throw Error("missing channels property: "+Z);if(!("labels"in v[Z]))throw Error("missing channel labels property: "+Z);if(v[Z].labels.length!==v[Z].channels)throw Error("channel and label counts mismatch: "+Z);let{channels:W,labels:X}=v[Z];delete v[Z].channels,delete v[Z].labels,Object.defineProperty(v[Z],"channels",{value:W}),Object.defineProperty(v[Z],"labels",{value:X})}v.rgb.hsl=function(Z){let W=Z[0]/255,X=Z[1]/255,Q=Z[2]/255,J=Math.min(W,X,Q),G=Math.max(W,X,Q),z=G-J,q,K;switch(G){case J:{q=0;break}case W:{q=(X-Q)/z;break}case X:{q=2+(Q-W)/z;break}case Q:{q=4+(W-X)/z;break}}if(q=Math.min(q*60,360),q<0)q+=360;let V=(J+G)/2;if(G===J)K=0;else if(V<=0.5)K=z/(G+J);else K=z/(2-G-J);return[q,K*100,V*100]};v.rgb.hsv=function(Z){let W,X,Q,J,G,z=Z[0]/255,q=Z[1]/255,K=Z[2]/255,V=Math.max(z,q,K),H=V-Math.min(z,q,K),B=function($){return(V-$)/6/H+0.5};if(H===0)J=0,G=0;else{switch(G=H/V,W=B(z),X=B(q),Q=B(K),V){case z:{J=Q-X;break}case q:{J=0.3333333333333333+W-Q;break}case K:{J=0.6666666666666666+X-W;break}}if(J<0)J+=1;else if(J>1)J-=1}return[J*360,G*100,V*100]};v.rgb.hwb=function(Z){let W=Z[0],X=Z[1],Q=Z[2],J=v.rgb.hsl(Z)[0],G=0.00392156862745098*Math.min(W,Math.min(X,Q));return Q=1-0.00392156862745098*Math.max(W,Math.max(X,Q)),[J,G*100,Q*100]};v.rgb.oklab=function(Z){let W=P6(Z[0]/255),X=P6(Z[1]/255),Q=P6(Z[2]/255),J=Math.cbrt(0.4122214708*W+0.5363325363*X+0.0514459929*Q),G=Math.cbrt(0.2119034982*W+0.6806995451*X+0.1073969566*Q),z=Math.cbrt(0.0883024619*W+0.2817188376*X+0.6299787005*Q),q=0.2104542553*J+0.793617785*G-0.0040720468*z,K=1.9779984951*J-2.428592205*G+0.4505937099*z,V=0.0259040371*J+0.7827717662*G-0.808675766*z;return[q*100,K*100,V*100]};v.rgb.cmyk=function(Z){let W=Z[0]/255,X=Z[1]/255,Q=Z[2]/255,J=Math.min(1-W,1-X,1-Q),G=(1-W-J)/(1-J)||0,z=(1-X-J)/(1-J)||0,q=(1-Q-J)/(1-J)||0;return[G*100,z*100,q*100,J*100]};function Mq(Z,W){return(Z[0]-W[0])**2+(Z[1]-W[1])**2+(Z[2]-W[2])**2}v.rgb.keyword=function(Z){let W=MW[Z];if(W)return W;let X=Number.POSITIVE_INFINITY,Q;for(let J of Object.keys(q1)){let G=q1[J],z=Mq(Z,G);if(z<X)X=z,Q=J}return Q};v.keyword.rgb=function(Z){return[...q1[Z]]};v.rgb.xyz=function(Z){let W=P6(Z[0]/255),X=P6(Z[1]/255),Q=P6(Z[2]/255),J=W*0.4124564+X*0.3575761+Q*0.1804375,G=W*0.2126729+X*0.7151522+Q*0.072175,z=W*0.0193339+X*0.119192+Q*0.9503041;return[J*100,G*100,z*100]};v.rgb.lab=function(Z){let W=v.rgb.xyz(Z),X=W[0],Q=W[1],J=W[2];X/=95.047,Q/=100,J/=108.883,X=X>_1?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>_1?Q**0.3333333333333333:7.787*Q+0.13793103448275862,J=J>_1?J**0.3333333333333333:7.787*J+0.13793103448275862;let G=116*Q-16,z=500*(X-Q),q=200*(Q-J);return[G,z,q]};v.hsl.rgb=function(Z){let W=Z[0]/360,X=Z[1]/100,Q=Z[2]/100,J,G;if(X===0)return G=Q*255,[G,G,G];let z=Q<0.5?Q*(1+X):Q+X-Q*X,q=2*Q-z,K=[0,0,0];for(let V=0;V<3;V++){if(J=W+0.3333333333333333*-(V-1),J<0)J++;if(J>1)J--;if(6*J<1)G=q+(z-q)*6*J;else if(2*J<1)G=z;else if(3*J<2)G=q+(z-q)*(0.6666666666666666-J)*6;else G=q;K[V]=G*255}return K};v.hsl.hsv=function(Z){let W=Z[0],X=Z[1]/100,Q=Z[2]/100,J=X,G=Math.max(Q,0.01);Q*=2,X*=Q<=1?Q:2-Q,J*=G<=1?G:2-G;let z=(Q+X)/2,q=Q===0?2*J/(G+J):2*X/(Q+X);return[W,q*100,z*100]};v.hsv.rgb=function(Z){let W=Z[0]/60,X=Z[1]/100,Q=Z[2]/100,J=Math.floor(W)%6,G=W-Math.floor(W),z=255*Q*(1-X),q=255*Q*(1-X*G),K=255*Q*(1-X*(1-G));switch(Q*=255,J){case 0:return[Q,K,z];case 1:return[q,Q,z];case 2:return[z,Q,K];case 3:return[z,q,Q];case 4:return[K,z,Q];case 5:return[Q,z,q]}};v.hsv.hsl=function(Z){let W=Z[0],X=Z[1]/100,Q=Z[2]/100,J=Math.max(Q,0.01),G,z;z=(2-X)*Q;let q=(2-X)*J;return G=X*J,G/=q<=1?q:2-q,G=G||0,z/=2,[W,G*100,z*100]};v.hwb.rgb=function(Z){let W=Z[0]/360,X=Z[1]/100,Q=Z[2]/100,J=X+Q,G;if(J>1)X/=J,Q/=J;let z=Math.floor(6*W),q=1-Q;if(G=6*W-z,(z&1)!==0)G=1-G;let K=X+G*(q-X),V,H,B;switch(z){default:case 6:case 0:{V=q,H=K,B=X;break}case 1:{V=K,H=q,B=X;break}case 2:{V=X,H=q,B=K;break}case 3:{V=X,H=K,B=q;break}case 4:{V=K,H=X,B=q;break}case 5:{V=q,H=X,B=K;break}}return[V*255,H*255,B*255]};v.cmyk.rgb=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J=Z[3]/100,G=1-Math.min(1,W*(1-J)+J),z=1-Math.min(1,X*(1-J)+J),q=1-Math.min(1,Q*(1-J)+J);return[G*255,z*255,q*255]};v.xyz.rgb=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J,G,z;return J=W*3.2404542+X*-1.5371385+Q*-0.4985314,G=W*-0.969266+X*1.8760108+Q*0.041556,z=W*0.0556434+X*-0.2040259+Q*1.0572252,J=R6(J),G=R6(G),z=R6(z),[J*255,G*255,z*255]};v.xyz.lab=function(Z){let W=Z[0],X=Z[1],Q=Z[2];W/=95.047,X/=100,Q/=108.883,W=W>_1?W**0.3333333333333333:7.787*W+0.13793103448275862,X=X>_1?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>_1?Q**0.3333333333333333:7.787*Q+0.13793103448275862;let J=116*X-16,G=500*(W-X),z=200*(X-Q);return[J,G,z]};v.xyz.oklab=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J=Math.cbrt(0.8189330101*W+0.3618667424*X-0.1288597137*Q),G=Math.cbrt(0.0329845436*W+0.9293118715*X+0.0361456387*Q),z=Math.cbrt(0.0482003018*W+0.2643662691*X+0.633851707*Q),q=0.2104542553*J+0.793617785*G-0.0040720468*z,K=1.9779984951*J-2.428592205*G+0.4505937099*z,V=0.0259040371*J+0.7827717662*G-0.808675766*z;return[q*100,K*100,V*100]};v.oklab.oklch=function(Z){return v.lab.lch(Z)};v.oklab.xyz=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J=(0.999999998*W+0.396337792*X+0.215803758*Q)**3,G=(1.000000008*W-0.105561342*X-0.063854175*Q)**3,z=(1.000000055*W-0.089484182*X-1.291485538*Q)**3,q=1.227013851*J-0.55779998*G+0.281256149*z,K=-0.040580178*J+1.11225687*G-0.071676679*z,V=-0.076381285*J-0.421481978*G+1.58616322*z;return[q*100,K*100,V*100]};v.oklab.rgb=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J=(W+0.3963377774*X+0.2158037573*Q)**3,G=(W-0.1055613458*X-0.0638541728*Q)**3,z=(W-0.0894841775*X-1.291485548*Q)**3,q=R6(4.0767416621*J-3.3077115913*G+0.2309699292*z),K=R6(-1.2684380046*J+2.6097574011*G-0.3413193965*z),V=R6(-0.0041960863*J-0.7034186147*G+1.707614701*z);return[q*255,K*255,V*255]};v.oklch.oklab=function(Z){return v.lch.lab(Z)};v.lab.xyz=function(Z){let W=Z[0],X=Z[1],Q=Z[2],J,G,z;G=(W+16)/116,J=X/500+G,z=G-Q/200;let q=G**3,K=J**3,V=z**3;return G=q>_1?q:(G-0.13793103448275862)/7.787,J=K>_1?K:(J-0.13793103448275862)/7.787,z=V>_1?V:(z-0.13793103448275862)/7.787,J*=95.047,G*=100,z*=108.883,[J,G,z]};v.lab.lch=function(Z){let W=Z[0],X=Z[1],Q=Z[2],J;if(J=Math.atan2(Q,X)*360/2/Math.PI,J<0)J+=360;let z=Math.sqrt(X*X+Q*Q);return[W,z,J]};v.lch.lab=function(Z){let W=Z[0],X=Z[1],J=Z[2]/360*2*Math.PI,G=X*Math.cos(J),z=X*Math.sin(J);return[W,G,z]};v.rgb.ansi16=function(Z,W=null){let[X,Q,J]=Z,G=W===null?v.rgb.hsv(Z)[2]:W;if(G=Math.round(G/50),G===0)return 30;let z=30+(Math.round(J/255)<<2|Math.round(Q/255)<<1|Math.round(X/255));if(G===2)z+=60;return z};v.hsv.ansi16=function(Z){return v.rgb.ansi16(v.hsv.rgb(Z),Z[2])};v.rgb.ansi256=function(Z){let W=Z[0],X=Z[1],Q=Z[2];if(W>>4===X>>4&&X>>4===Q>>4){if(W<8)return 16;if(W>248)return 231;return Math.round((W-8)/247*24)+232}return 16+36*Math.round(W/255*5)+6*Math.round(X/255*5)+Math.round(Q/255*5)};v.ansi16.rgb=function(Z){Z=Z[0];let W=Z%10;if(W===0||W===7){if(Z>50)W+=3.5;return W=W/10.5*255,[W,W,W]}let X=(Math.trunc(Z>50)+1)*0.5,Q=(W&1)*X*255,J=(W>>1&1)*X*255,G=(W>>2&1)*X*255;return[Q,J,G]};v.ansi256.rgb=function(Z){if(Z=Z[0],Z>=232){let G=(Z-232)*10+8;return[G,G,G]}Z-=16;let W,X=Math.floor(Z/36)/5*255,Q=Math.floor((W=Z%36)/6)/5*255,J=W%6/5*255;return[X,Q,J]};v.rgb.hex=function(Z){let X=(((Math.round(Z[0])&255)<<16)+((Math.round(Z[1])&255)<<8)+(Math.round(Z[2])&255)).toString(16).toUpperCase();return"000000".slice(X.length)+X};v.hex.rgb=function(Z){let W=Z.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!W)return[0,0,0];let X=W[0];if(W[0].length===3)X=[...X].map((q)=>q+q).join("");let Q=Number.parseInt(X,16),J=Q>>16&255,G=Q>>8&255,z=Q&255;return[J,G,z]};v.rgb.hcg=function(Z){let W=Z[0]/255,X=Z[1]/255,Q=Z[2]/255,J=Math.max(Math.max(W,X),Q),G=Math.min(Math.min(W,X),Q),z=J-G,q,K=z<1?G/(1-z):0;if(z<=0)q=0;else if(J===W)q=(X-Q)/z%6;else if(J===X)q=2+(Q-W)/z;else q=4+(W-X)/z;return q/=6,q%=1,[q*360,z*100,K*100]};v.hsl.hcg=function(Z){let W=Z[1]/100,X=Z[2]/100,Q=X<0.5?2*W*X:2*W*(1-X),J=0;if(Q<1)J=(X-0.5*Q)/(1-Q);return[Z[0],Q*100,J*100]};v.hsv.hcg=function(Z){let W=Z[1]/100,X=Z[2]/100,Q=W*X,J=0;if(Q<1)J=(X-Q)/(1-Q);return[Z[0],Q*100,J*100]};v.hcg.rgb=function(Z){let W=Z[0]/360,X=Z[1]/100,Q=Z[2]/100;if(X===0)return[Q*255,Q*255,Q*255];let J=[0,0,0],G=W%1*6,z=G%1,q=1-z,K=0;switch(Math.floor(G)){case 0:{J[0]=1,J[1]=z,J[2]=0;break}case 1:{J[0]=q,J[1]=1,J[2]=0;break}case 2:{J[0]=0,J[1]=1,J[2]=z;break}case 3:{J[0]=0,J[1]=q,J[2]=1;break}case 4:{J[0]=z,J[1]=0,J[2]=1;break}default:J[0]=1,J[1]=0,J[2]=q}return K=(1-X)*Q,[(X*J[0]+K)*255,(X*J[1]+K)*255,(X*J[2]+K)*255]};v.hcg.hsv=function(Z){let W=Z[1]/100,X=Z[2]/100,Q=W+X*(1-W),J=0;if(Q>0)J=W/Q;return[Z[0],J*100,Q*100]};v.hcg.hsl=function(Z){let W=Z[1]/100,Q=Z[2]/100*(1-W)+0.5*W,J=0;if(Q>0&&Q<0.5)J=W/(2*Q);else if(Q>=0.5&&Q<1)J=W/(2*(1-Q));return[Z[0],J*100,Q*100]};v.hcg.hwb=function(Z){let W=Z[1]/100,X=Z[2]/100,Q=W+X*(1-W);return[Z[0],(Q-W)*100,(1-Q)*100]};v.hwb.hcg=function(Z){let W=Z[1]/100,Q=1-Z[2]/100,J=Q-W,G=0;if(J<1)G=(Q-J)/(1-J);return[Z[0],J*100,G*100]};v.apple.rgb=function(Z){return[Z[0]/65535*255,Z[1]/65535*255,Z[2]/65535*255]};v.rgb.apple=function(Z){return[Z[0]/255*65535,Z[1]/255*65535,Z[2]/255*65535]};v.gray.rgb=function(Z){return[Z[0]/100*255,Z[0]/100*255,Z[0]/100*255]};v.gray.hsl=function(Z){return[0,0,Z[0]]};v.gray.hsv=v.gray.hsl;v.gray.hwb=function(Z){return[0,100,Z[0]]};v.gray.cmyk=function(Z){return[0,0,0,Z[0]]};v.gray.lab=function(Z){return[Z[0],0,0]};v.gray.hex=function(Z){let W=Math.round(Z[0]/100*255)&255,Q=((W<<16)+(W<<8)+W).toString(16).toUpperCase();return"000000".slice(Q.length)+Q};v.rgb.gray=function(Z){return[(Z[0]+Z[1]+Z[2])/3/255*100]};function Iq(){let Z={},W=Object.keys(t1);for(let{length:X}=W,Q=0;Q<X;Q++)Z[W[Q]]={distance:-1,parent:null};return Z}function wq(Z){let W=Iq(),X=[Z];W[Z].distance=0;while(X.length>0){let Q=X.pop(),J=Object.keys(t1[Q]);for(let{length:G}=J,z=0;z<G;z++){let q=J[z],K=W[q];if(K.distance===-1)K.distance=W[Q].distance+1,K.parent=Q,X.unshift(q)}}return W}function Nq(Z,W){return function(X){return W(Z(X))}}function Dq(Z,W){let X=[W[Z].parent,Z],Q=t1[W[Z].parent][Z],J=W[Z].parent;while(W[J].parent)X.unshift(W[J].parent),Q=Nq(t1[W[J].parent][J],Q),J=W[J].parent;return Q.conversion=X,Q}function Tq(Z){let W=wq(Z),X={},Q=Object.keys(W);for(let{length:J}=Q,G=0;G<J;G++){let z=Q[G];if(W[z].parent===null)continue;X[z]=Dq(z,W)}return X}var Rq=Tq,T6={},Pq=Object.keys(t1);function _q(Z){let W=function(...X){let Q=X[0];if(Q===void 0||Q===null)return Q;if(Q.length>1)X=Q;return Z(X)};if("conversion"in Z)W.conversion=Z.conversion;return W}function jq(Z){let W=function(...X){let Q=X[0];if(Q===void 0||Q===null)return Q;if(Q.length>1)X=Q;let J=Z(X);if(typeof J==="object")for(let{length:G}=J,z=0;z<G;z++)J[z]=Math.round(J[z]);return J};if("conversion"in Z)W.conversion=Z.conversion;return W}for(let Z of Pq){T6[Z]={},Object.defineProperty(T6[Z],"channels",{value:t1[Z].channels}),Object.defineProperty(T6[Z],"labels",{value:t1[Z].labels});let W=Rq(Z),X=Object.keys(W);for(let Q of X){let J=W[Q];T6[Z][Q]=jq(J),T6[Z][Q].raw=_q(J)}}var u0=T6,IW=["keyword","gray","hex"],p3={};for(let Z of Object.keys(u0))p3[[...u0[Z].labels].sort().join("")]=Z;var n3={};function D0(Z,W){if(!(this instanceof D0))return new D0(Z,W);if(W&&W in IW)W=null;if(W&&!(W in u0))throw Error("Unknown model: "+W);let X,Q;if(Z==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(Z instanceof D0)this.model=Z.model,this.color=[...Z.color],this.valpha=Z.valpha;else if(typeof Z==="string"){let J=D6.get(Z);if(J===null)throw Error("Unable to parse color from string: "+Z);this.model=J.model,Q=u0[this.model].channels,this.color=J.value.slice(0,Q),this.valpha=typeof J.value[Q]==="number"?J.value[Q]:1}else if(Z.length>0){this.model=W||"rgb",Q=u0[this.model].channels;let J=Array.prototype.slice.call(Z,0,Q);this.color=i3(J,Q),this.valpha=typeof Z[Q]==="number"?Z[Q]:1}else if(typeof Z==="number")this.model="rgb",this.color=[Z>>16&255,Z>>8&255,Z&255],this.valpha=1;else{this.valpha=1;let 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 p3))throw Error("Unable to parse color from object: "+JSON.stringify(Z));this.model=p3[G];let{labels:z}=u0[this.model],q=[];for(X=0;X<z.length;X++)q.push(Z[z[X]]);this.color=i3(q)}if(n3[this.model]){Q=u0[this.model].channels;for(X=0;X<Q;X++){let J=n3[this.model][X];if(J)this.color[X]=J(this.color[X])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}D0.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(Z){let W=this.model in D6.to?this:this.rgb();W=W.round(typeof Z==="number"?Z:1);let X=W.valpha===1?W.color:[...W.color,this.valpha];return D6.to[W.model](...X)},percentString(Z){let W=this.rgb().round(typeof Z==="number"?Z:1),X=W.valpha===1?W.color:[...W.color,this.valpha];return D6.to.rgb.percent(...X)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let Z={},{channels:W}=u0[this.model],{labels:X}=u0[this.model];for(let Q=0;Q<W;Q++)Z[X[Q]]=this.color[Q];if(this.valpha!==1)Z.alpha=this.valpha;return Z},unitArray(){let Z=this.rgb().color;if(Z[0]/=255,Z[1]/=255,Z[2]/=255,this.valpha!==1)Z.push(this.valpha);return Z},unitObject(){let Z=this.rgb().object();if(Z.r/=255,Z.g/=255,Z.b/=255,this.valpha!==1)Z.alpha=this.valpha;return Z},round(Z){return Z=Math.max(Z||0,0),new D0([...this.color.map(Cq(Z)),this.valpha],this.model)},alpha(Z){if(Z!==void 0)return new D0([...this.color,Math.max(0,Math.min(1,Z))],this.model);return this.valpha},red:H0("rgb",0,w0(255)),green:H0("rgb",1,w0(255)),blue:H0("rgb",2,w0(255)),hue:H0(["hsl","hsv","hsl","hwb","hcg"],0,(Z)=>(Z%360+360)%360),saturationl:H0("hsl",1,w0(100)),lightness:H0("hsl",2,w0(100)),saturationv:H0("hsv",1,w0(100)),value:H0("hsv",2,w0(100)),chroma:H0("hcg",1,w0(100)),gray:H0("hcg",2,w0(100)),white:H0("hwb",1,w0(100)),wblack:H0("hwb",2,w0(100)),cyan:H0("cmyk",0,w0(100)),magenta:H0("cmyk",1,w0(100)),yellow:H0("cmyk",2,w0(100)),black:H0("cmyk",3,w0(100)),x:H0("xyz",0,w0(95.047)),y:H0("xyz",1,w0(100)),z:H0("xyz",2,w0(108.833)),l:H0("lab",0,w0(100)),a:H0("lab",1),b:H0("lab",2),keyword(Z){if(Z!==void 0)return new D0(Z);return u0[this.model].keyword(this.color)},hex(Z){if(Z!==void 0)return new D0(Z);return D6.to.hex(...this.rgb().round().color)},hexa(Z){if(Z!==void 0)return new D0(Z);let W=this.rgb().round().color,X=Math.round(this.valpha*255).toString(16).toUpperCase();if(X.length===1)X="0"+X;return D6.to.hex(...W)+X},rgbNumber(){let Z=this.rgb().color;return(Z[0]&255)<<16|(Z[1]&255)<<8|Z[2]&255},luminosity(){let Z=this.rgb().color,W=[];for(let[X,Q]of Z.entries()){let J=Q/255;W[X]=J<=0.04045?J/12.92:((J+0.055)/1.055)**2.4}return 0.2126*W[0]+0.7152*W[1]+0.0722*W[2]},contrast(Z){let W=this.luminosity(),X=Z.luminosity();if(W>X)return(W+0.05)/(X+0.05);return(X+0.05)/(W+0.05)},level(Z){let W=this.contrast(Z);if(W>=7)return"AAA";return W>=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 W=0;W<3;W++)Z.color[W]=255-Z.color[W];return Z},lighten(Z){let W=this.hsl();return W.color[2]+=W.color[2]*Z,W},darken(Z){let W=this.hsl();return W.color[2]-=W.color[2]*Z,W},saturate(Z){let W=this.hsl();return W.color[1]+=W.color[1]*Z,W},desaturate(Z){let W=this.hsl();return W.color[1]-=W.color[1]*Z,W},whiten(Z){let W=this.hwb();return W.color[1]+=W.color[1]*Z,W},blacken(Z){let W=this.hwb();return W.color[2]+=W.color[2]*Z,W},grayscale(){let Z=this.rgb().color,W=Z[0]*0.3+Z[1]*0.59+Z[2]*0.11;return D0.rgb(W,W,W)},fade(Z){return this.alpha(this.valpha-this.valpha*Z)},opaquer(Z){return this.alpha(this.valpha+this.valpha*Z)},rotate(Z){let W=this.hsl(),X=W.color[0];return X=(X+Z)%360,X=X<0?360+X:X,W.color[0]=X,W},mix(Z,W){if(!Z||!Z.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof Z);let X=Z.rgb(),Q=this.rgb(),J=W===void 0?0.5:W,G=2*J-1,z=X.alpha()-Q.alpha(),q=((G*z===-1?G:(G+z)/(1+G*z))+1)/2,K=1-q;return D0.rgb(q*X.red()+K*Q.red(),q*X.green()+K*Q.green(),q*X.blue()+K*Q.blue(),X.alpha()*J+Q.alpha()*(1-J))}};for(let Z of Object.keys(u0)){if(IW.includes(Z))continue;let{channels:W}=u0[Z];D0.prototype[Z]=function(...X){if(this.model===Z)return new D0(this);if(X.length>0)return new D0(X,Z);return new D0([...Oq(u0[this.model][Z].raw(this.color)),this.valpha],Z)},D0[Z]=function(...X){let Q=X[0];if(typeof Q==="number")Q=i3(X,W);return new D0(Q,Z)}}function Eq(Z,W){return Number(Z.toFixed(W))}function Cq(Z){return function(W){return Eq(W,Z)}}function H0(Z,W,X){Z=Array.isArray(Z)?Z:[Z];for(let Q of Z)(n3[Q]||=[])[W]=X;return Z=Z[0],function(Q){let J;if(Q!==void 0){if(X)Q=X(Q);return J=this[Z](),J.color[W]=Q,J}if(J=this[Z]().color[W],X)J=X(J);return J}}function w0(Z){return function(W){return Math.max(0,Math.min(Z,W))}}function Oq(Z){return Array.isArray(Z)?Z:[Z]}function i3(Z,W){for(let X=0;X<W;X++)if(typeof Z[X]!=="number")Z[X]=0;return Z}var xq=D0});var TW=i((eF,DW)=>{DW.exports=NW().default});function kq(Z){return this._setBackgroundColourOption("tint",Z),this}function Sq(Z){return this.options.greyscale=Y.bool(Z)?Z:!0,this}function bq(Z){return this.greyscale(Z)}function vq(Z){if(!Y.string(Z))throw Y.invalidParameterError("colourspace","string",Z);return this.options.colourspacePipeline=Z,this}function yq(Z){return this.pipelineColourspace(Z)}function gq(Z){if(!Y.string(Z))throw Y.invalidParameterError("colourspace","string",Z);return this.options.colourspace=Z,this}function hq(Z){return this.toColourspace(Z)}function _W(Z){if(Y.object(Z)||Y.string(Z)&&Z.length>=3&&Z.length<=200){let W=PW.default(Z);return[W.red(),W.green(),W.blue(),Math.round(W.alpha()*255)]}else throw Y.invalidParameterError("background","object or string",Z)}function fq(Z,W){if(Y.defined(W))this.options[Z]=_W(W)}var PW,RW,jW=(Z)=>{Object.assign(Z.prototype,{tint:kq,greyscale:Sq,grayscale:bq,pipelineColourspace:vq,pipelineColorspace:yq,toColourspace:gq,toColorspace:hq,_getBackgroundColourOption:_W,_setBackgroundColourOption:fq}),Z.colourspace=RW,Z.colorspace=RW};var EW=d(()=>{Q1();PW=v6(TW(),1);/*!
|
|
231
|
+
*/VW={integer:"integer",float:"float",approximate:"approximate"}});var MW=i((tF,IW)=>{var{defineProperty:r3,getOwnPropertyDescriptor:Kq,getOwnPropertyNames:Vq}=Object,Bq=Object.prototype.hasOwnProperty,Hq=(Z,W)=>{for(var X in W)r3(Z,X,{get:W[X],enumerable:!0})},$q=(Z,W,X,Q)=>{if(W&&typeof W==="object"||typeof W==="function"){for(let J of Vq(W))if(!Bq.call(Z,J)&&J!==X)r3(Z,J,{get:()=>W[J],enumerable:!(Q=Kq(W,J))||Q.enumerable})}return Z},Fq=(Z)=>$q(r3({},"__esModule",{value:!0}),Z),$W={};Hq($W,{default:()=>Cq});IW.exports=Fq($W);var l3={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 l3)Object.freeze(l3[Z]);var q1=Object.freeze(l3),FW=Object.create(null);for(let Z in q1)if(Object.hasOwn(q1,Z))FW[q1[Z]]=Z;var v0={to:{},get:{}};v0.get=function(Z){let W=Z.slice(0,3).toLowerCase(),X,Q;switch(W){case"hsl":{X=v0.get.hsl(Z),Q="hsl";break}case"hwb":{X=v0.get.hwb(Z),Q="hwb";break}default:{X=v0.get.rgb(Z),Q="rgb";break}}if(!X)return null;return{model:Q,value:X}};v0.get.rgb=function(Z){if(!Z)return null;let W=/^#([a-f\d]{3,4})$/i,X=/^#([a-f\d]{6})([a-f\d]{2})?$/i,Q=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,J=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,G=/^(\w+)$/,z=[0,0,0,1],q,K,V;if(q=Z.match(X)){V=q[2],q=q[1];for(K=0;K<3;K++){let H=K*2;z[K]=Number.parseInt(q.slice(H,H+2),16)}if(V)z[3]=Number.parseInt(V,16)/255}else if(q=Z.match(W)){q=q[1],V=q[3];for(K=0;K<3;K++)z[K]=Number.parseInt(q[K]+q[K],16);if(V)z[3]=Number.parseInt(V+V,16)/255}else if(q=Z.match(Q)){for(K=0;K<3;K++)z[K]=Number.parseFloat(q[K+1]);if(q[4])z[3]=q[5]?Number.parseFloat(q[4])*0.01:Number.parseFloat(q[4])}else if(q=Z.match(J)){for(K=0;K<3;K++)z[K]=Math.round(Number.parseFloat(q[K+1])*2.55);if(q[4])z[3]=q[5]?Number.parseFloat(q[4])*0.01:Number.parseFloat(q[4])}else if(q=Z.toLowerCase().match(G)){if(q[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(q1,q[1]))return null;return z=q1[q[1]].slice(),z[3]=1,z}else return null;for(K=0;K<3;K++)z[K]=m1(z[K],0,255);return z[3]=m1(z[3],0,1),z};v0.get.hsl=function(Z){if(!Z)return null;let W=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=Z.match(W);if(X){let Q=Number.parseFloat(X[4]),J=(Number.parseFloat(X[1])%360+360)%360,G=m1(Number.parseFloat(X[2]),0,100),z=m1(Number.parseFloat(X[3]),0,100),q=m1(Number.isNaN(Q)?1:Q,0,1);return[J,G,z,q]}return null};v0.get.hwb=function(Z){if(!Z)return null;let W=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=Z.match(W);if(X){let Q=Number.parseFloat(X[4]),J=(Number.parseFloat(X[1])%360+360)%360,G=m1(Number.parseFloat(X[2]),0,100),z=m1(Number.parseFloat(X[3]),0,100),q=m1(Number.isNaN(Q)?1:Q,0,1);return[J,G,z,q]}return null};v0.to.hex=function(...Z){return"#"+q2(Z[0])+q2(Z[1])+q2(Z[2])+(Z[3]<1?q2(Math.round(Z[3]*255)):"")};v0.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]+")"};v0.to.rgb.percent=function(...Z){let W=Math.round(Z[0]/255*100),X=Math.round(Z[1]/255*100),Q=Math.round(Z[2]/255*100);return Z.length<4||Z[3]===1?"rgb("+W+"%, "+X+"%, "+Q+"%)":"rgba("+W+"%, "+X+"%, "+Q+"%, "+Z[3]+")"};v0.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]+")"};v0.to.hwb=function(...Z){let W="";if(Z.length>=4&&Z[3]!==1)W=", "+Z[3];return"hwb("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%"+W+")"};v0.to.keyword=function(...Z){return FW[Z.slice(0,3)]};function m1(Z,W,X){return Math.min(Math.max(W,Z),X)}function q2(Z){let W=Math.round(Z).toString(16).toUpperCase();return W.length<2?"0"+W:W}var D6=v0,LW={};for(let Z of Object.keys(q1))LW[q1[Z]]=Z;var v={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"]}},t1=v,_1=0.008856451679035631;function R6(Z){let W=Z>0.0031308?1.055*Z**0.4166666666666667-0.055:Z*12.92;return Math.min(Math.max(0,W),1)}function P6(Z){return Z>0.04045?((Z+0.055)/1.055)**2.4:Z/12.92}for(let Z of Object.keys(v)){if(!("channels"in v[Z]))throw Error("missing channels property: "+Z);if(!("labels"in v[Z]))throw Error("missing channel labels property: "+Z);if(v[Z].labels.length!==v[Z].channels)throw Error("channel and label counts mismatch: "+Z);let{channels:W,labels:X}=v[Z];delete v[Z].channels,delete v[Z].labels,Object.defineProperty(v[Z],"channels",{value:W}),Object.defineProperty(v[Z],"labels",{value:X})}v.rgb.hsl=function(Z){let W=Z[0]/255,X=Z[1]/255,Q=Z[2]/255,J=Math.min(W,X,Q),G=Math.max(W,X,Q),z=G-J,q,K;switch(G){case J:{q=0;break}case W:{q=(X-Q)/z;break}case X:{q=2+(Q-W)/z;break}case Q:{q=4+(W-X)/z;break}}if(q=Math.min(q*60,360),q<0)q+=360;let V=(J+G)/2;if(G===J)K=0;else if(V<=0.5)K=z/(G+J);else K=z/(2-G-J);return[q,K*100,V*100]};v.rgb.hsv=function(Z){let W,X,Q,J,G,z=Z[0]/255,q=Z[1]/255,K=Z[2]/255,V=Math.max(z,q,K),H=V-Math.min(z,q,K),B=function($){return(V-$)/6/H+0.5};if(H===0)J=0,G=0;else{switch(G=H/V,W=B(z),X=B(q),Q=B(K),V){case z:{J=Q-X;break}case q:{J=0.3333333333333333+W-Q;break}case K:{J=0.6666666666666666+X-W;break}}if(J<0)J+=1;else if(J>1)J-=1}return[J*360,G*100,V*100]};v.rgb.hwb=function(Z){let W=Z[0],X=Z[1],Q=Z[2],J=v.rgb.hsl(Z)[0],G=0.00392156862745098*Math.min(W,Math.min(X,Q));return Q=1-0.00392156862745098*Math.max(W,Math.max(X,Q)),[J,G*100,Q*100]};v.rgb.oklab=function(Z){let W=P6(Z[0]/255),X=P6(Z[1]/255),Q=P6(Z[2]/255),J=Math.cbrt(0.4122214708*W+0.5363325363*X+0.0514459929*Q),G=Math.cbrt(0.2119034982*W+0.6806995451*X+0.1073969566*Q),z=Math.cbrt(0.0883024619*W+0.2817188376*X+0.6299787005*Q),q=0.2104542553*J+0.793617785*G-0.0040720468*z,K=1.9779984951*J-2.428592205*G+0.4505937099*z,V=0.0259040371*J+0.7827717662*G-0.808675766*z;return[q*100,K*100,V*100]};v.rgb.cmyk=function(Z){let W=Z[0]/255,X=Z[1]/255,Q=Z[2]/255,J=Math.min(1-W,1-X,1-Q),G=(1-W-J)/(1-J)||0,z=(1-X-J)/(1-J)||0,q=(1-Q-J)/(1-J)||0;return[G*100,z*100,q*100,J*100]};function Lq(Z,W){return(Z[0]-W[0])**2+(Z[1]-W[1])**2+(Z[2]-W[2])**2}v.rgb.keyword=function(Z){let W=LW[Z];if(W)return W;let X=Number.POSITIVE_INFINITY,Q;for(let J of Object.keys(q1)){let G=q1[J],z=Lq(Z,G);if(z<X)X=z,Q=J}return Q};v.keyword.rgb=function(Z){return[...q1[Z]]};v.rgb.xyz=function(Z){let W=P6(Z[0]/255),X=P6(Z[1]/255),Q=P6(Z[2]/255),J=W*0.4124564+X*0.3575761+Q*0.1804375,G=W*0.2126729+X*0.7151522+Q*0.072175,z=W*0.0193339+X*0.119192+Q*0.9503041;return[J*100,G*100,z*100]};v.rgb.lab=function(Z){let W=v.rgb.xyz(Z),X=W[0],Q=W[1],J=W[2];X/=95.047,Q/=100,J/=108.883,X=X>_1?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>_1?Q**0.3333333333333333:7.787*Q+0.13793103448275862,J=J>_1?J**0.3333333333333333:7.787*J+0.13793103448275862;let G=116*Q-16,z=500*(X-Q),q=200*(Q-J);return[G,z,q]};v.hsl.rgb=function(Z){let W=Z[0]/360,X=Z[1]/100,Q=Z[2]/100,J,G;if(X===0)return G=Q*255,[G,G,G];let z=Q<0.5?Q*(1+X):Q+X-Q*X,q=2*Q-z,K=[0,0,0];for(let V=0;V<3;V++){if(J=W+0.3333333333333333*-(V-1),J<0)J++;if(J>1)J--;if(6*J<1)G=q+(z-q)*6*J;else if(2*J<1)G=z;else if(3*J<2)G=q+(z-q)*(0.6666666666666666-J)*6;else G=q;K[V]=G*255}return K};v.hsl.hsv=function(Z){let W=Z[0],X=Z[1]/100,Q=Z[2]/100,J=X,G=Math.max(Q,0.01);Q*=2,X*=Q<=1?Q:2-Q,J*=G<=1?G:2-G;let z=(Q+X)/2,q=Q===0?2*J/(G+J):2*X/(Q+X);return[W,q*100,z*100]};v.hsv.rgb=function(Z){let W=Z[0]/60,X=Z[1]/100,Q=Z[2]/100,J=Math.floor(W)%6,G=W-Math.floor(W),z=255*Q*(1-X),q=255*Q*(1-X*G),K=255*Q*(1-X*(1-G));switch(Q*=255,J){case 0:return[Q,K,z];case 1:return[q,Q,z];case 2:return[z,Q,K];case 3:return[z,q,Q];case 4:return[K,z,Q];case 5:return[Q,z,q]}};v.hsv.hsl=function(Z){let W=Z[0],X=Z[1]/100,Q=Z[2]/100,J=Math.max(Q,0.01),G,z;z=(2-X)*Q;let q=(2-X)*J;return G=X*J,G/=q<=1?q:2-q,G=G||0,z/=2,[W,G*100,z*100]};v.hwb.rgb=function(Z){let W=Z[0]/360,X=Z[1]/100,Q=Z[2]/100,J=X+Q,G;if(J>1)X/=J,Q/=J;let z=Math.floor(6*W),q=1-Q;if(G=6*W-z,(z&1)!==0)G=1-G;let K=X+G*(q-X),V,H,B;switch(z){default:case 6:case 0:{V=q,H=K,B=X;break}case 1:{V=K,H=q,B=X;break}case 2:{V=X,H=q,B=K;break}case 3:{V=X,H=K,B=q;break}case 4:{V=K,H=X,B=q;break}case 5:{V=q,H=X,B=K;break}}return[V*255,H*255,B*255]};v.cmyk.rgb=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J=Z[3]/100,G=1-Math.min(1,W*(1-J)+J),z=1-Math.min(1,X*(1-J)+J),q=1-Math.min(1,Q*(1-J)+J);return[G*255,z*255,q*255]};v.xyz.rgb=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J,G,z;return J=W*3.2404542+X*-1.5371385+Q*-0.4985314,G=W*-0.969266+X*1.8760108+Q*0.041556,z=W*0.0556434+X*-0.2040259+Q*1.0572252,J=R6(J),G=R6(G),z=R6(z),[J*255,G*255,z*255]};v.xyz.lab=function(Z){let W=Z[0],X=Z[1],Q=Z[2];W/=95.047,X/=100,Q/=108.883,W=W>_1?W**0.3333333333333333:7.787*W+0.13793103448275862,X=X>_1?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>_1?Q**0.3333333333333333:7.787*Q+0.13793103448275862;let J=116*X-16,G=500*(W-X),z=200*(X-Q);return[J,G,z]};v.xyz.oklab=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J=Math.cbrt(0.8189330101*W+0.3618667424*X-0.1288597137*Q),G=Math.cbrt(0.0329845436*W+0.9293118715*X+0.0361456387*Q),z=Math.cbrt(0.0482003018*W+0.2643662691*X+0.633851707*Q),q=0.2104542553*J+0.793617785*G-0.0040720468*z,K=1.9779984951*J-2.428592205*G+0.4505937099*z,V=0.0259040371*J+0.7827717662*G-0.808675766*z;return[q*100,K*100,V*100]};v.oklab.oklch=function(Z){return v.lab.lch(Z)};v.oklab.xyz=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J=(0.999999998*W+0.396337792*X+0.215803758*Q)**3,G=(1.000000008*W-0.105561342*X-0.063854175*Q)**3,z=(1.000000055*W-0.089484182*X-1.291485538*Q)**3,q=1.227013851*J-0.55779998*G+0.281256149*z,K=-0.040580178*J+1.11225687*G-0.071676679*z,V=-0.076381285*J-0.421481978*G+1.58616322*z;return[q*100,K*100,V*100]};v.oklab.rgb=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J=(W+0.3963377774*X+0.2158037573*Q)**3,G=(W-0.1055613458*X-0.0638541728*Q)**3,z=(W-0.0894841775*X-1.291485548*Q)**3,q=R6(4.0767416621*J-3.3077115913*G+0.2309699292*z),K=R6(-1.2684380046*J+2.6097574011*G-0.3413193965*z),V=R6(-0.0041960863*J-0.7034186147*G+1.707614701*z);return[q*255,K*255,V*255]};v.oklch.oklab=function(Z){return v.lch.lab(Z)};v.lab.xyz=function(Z){let W=Z[0],X=Z[1],Q=Z[2],J,G,z;G=(W+16)/116,J=X/500+G,z=G-Q/200;let q=G**3,K=J**3,V=z**3;return G=q>_1?q:(G-0.13793103448275862)/7.787,J=K>_1?K:(J-0.13793103448275862)/7.787,z=V>_1?V:(z-0.13793103448275862)/7.787,J*=95.047,G*=100,z*=108.883,[J,G,z]};v.lab.lch=function(Z){let W=Z[0],X=Z[1],Q=Z[2],J;if(J=Math.atan2(Q,X)*360/2/Math.PI,J<0)J+=360;let z=Math.sqrt(X*X+Q*Q);return[W,z,J]};v.lch.lab=function(Z){let W=Z[0],X=Z[1],J=Z[2]/360*2*Math.PI,G=X*Math.cos(J),z=X*Math.sin(J);return[W,G,z]};v.rgb.ansi16=function(Z,W=null){let[X,Q,J]=Z,G=W===null?v.rgb.hsv(Z)[2]:W;if(G=Math.round(G/50),G===0)return 30;let z=30+(Math.round(J/255)<<2|Math.round(Q/255)<<1|Math.round(X/255));if(G===2)z+=60;return z};v.hsv.ansi16=function(Z){return v.rgb.ansi16(v.hsv.rgb(Z),Z[2])};v.rgb.ansi256=function(Z){let W=Z[0],X=Z[1],Q=Z[2];if(W>>4===X>>4&&X>>4===Q>>4){if(W<8)return 16;if(W>248)return 231;return Math.round((W-8)/247*24)+232}return 16+36*Math.round(W/255*5)+6*Math.round(X/255*5)+Math.round(Q/255*5)};v.ansi16.rgb=function(Z){Z=Z[0];let W=Z%10;if(W===0||W===7){if(Z>50)W+=3.5;return W=W/10.5*255,[W,W,W]}let X=(Math.trunc(Z>50)+1)*0.5,Q=(W&1)*X*255,J=(W>>1&1)*X*255,G=(W>>2&1)*X*255;return[Q,J,G]};v.ansi256.rgb=function(Z){if(Z=Z[0],Z>=232){let G=(Z-232)*10+8;return[G,G,G]}Z-=16;let W,X=Math.floor(Z/36)/5*255,Q=Math.floor((W=Z%36)/6)/5*255,J=W%6/5*255;return[X,Q,J]};v.rgb.hex=function(Z){let X=(((Math.round(Z[0])&255)<<16)+((Math.round(Z[1])&255)<<8)+(Math.round(Z[2])&255)).toString(16).toUpperCase();return"000000".slice(X.length)+X};v.hex.rgb=function(Z){let W=Z.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!W)return[0,0,0];let X=W[0];if(W[0].length===3)X=[...X].map((q)=>q+q).join("");let Q=Number.parseInt(X,16),J=Q>>16&255,G=Q>>8&255,z=Q&255;return[J,G,z]};v.rgb.hcg=function(Z){let W=Z[0]/255,X=Z[1]/255,Q=Z[2]/255,J=Math.max(Math.max(W,X),Q),G=Math.min(Math.min(W,X),Q),z=J-G,q,K=z<1?G/(1-z):0;if(z<=0)q=0;else if(J===W)q=(X-Q)/z%6;else if(J===X)q=2+(Q-W)/z;else q=4+(W-X)/z;return q/=6,q%=1,[q*360,z*100,K*100]};v.hsl.hcg=function(Z){let W=Z[1]/100,X=Z[2]/100,Q=X<0.5?2*W*X:2*W*(1-X),J=0;if(Q<1)J=(X-0.5*Q)/(1-Q);return[Z[0],Q*100,J*100]};v.hsv.hcg=function(Z){let W=Z[1]/100,X=Z[2]/100,Q=W*X,J=0;if(Q<1)J=(X-Q)/(1-Q);return[Z[0],Q*100,J*100]};v.hcg.rgb=function(Z){let W=Z[0]/360,X=Z[1]/100,Q=Z[2]/100;if(X===0)return[Q*255,Q*255,Q*255];let J=[0,0,0],G=W%1*6,z=G%1,q=1-z,K=0;switch(Math.floor(G)){case 0:{J[0]=1,J[1]=z,J[2]=0;break}case 1:{J[0]=q,J[1]=1,J[2]=0;break}case 2:{J[0]=0,J[1]=1,J[2]=z;break}case 3:{J[0]=0,J[1]=q,J[2]=1;break}case 4:{J[0]=z,J[1]=0,J[2]=1;break}default:J[0]=1,J[1]=0,J[2]=q}return K=(1-X)*Q,[(X*J[0]+K)*255,(X*J[1]+K)*255,(X*J[2]+K)*255]};v.hcg.hsv=function(Z){let W=Z[1]/100,X=Z[2]/100,Q=W+X*(1-W),J=0;if(Q>0)J=W/Q;return[Z[0],J*100,Q*100]};v.hcg.hsl=function(Z){let W=Z[1]/100,Q=Z[2]/100*(1-W)+0.5*W,J=0;if(Q>0&&Q<0.5)J=W/(2*Q);else if(Q>=0.5&&Q<1)J=W/(2*(1-Q));return[Z[0],J*100,Q*100]};v.hcg.hwb=function(Z){let W=Z[1]/100,X=Z[2]/100,Q=W+X*(1-W);return[Z[0],(Q-W)*100,(1-Q)*100]};v.hwb.hcg=function(Z){let W=Z[1]/100,Q=1-Z[2]/100,J=Q-W,G=0;if(J<1)G=(Q-J)/(1-J);return[Z[0],J*100,G*100]};v.apple.rgb=function(Z){return[Z[0]/65535*255,Z[1]/65535*255,Z[2]/65535*255]};v.rgb.apple=function(Z){return[Z[0]/255*65535,Z[1]/255*65535,Z[2]/255*65535]};v.gray.rgb=function(Z){return[Z[0]/100*255,Z[0]/100*255,Z[0]/100*255]};v.gray.hsl=function(Z){return[0,0,Z[0]]};v.gray.hsv=v.gray.hsl;v.gray.hwb=function(Z){return[0,100,Z[0]]};v.gray.cmyk=function(Z){return[0,0,0,Z[0]]};v.gray.lab=function(Z){return[Z[0],0,0]};v.gray.hex=function(Z){let W=Math.round(Z[0]/100*255)&255,Q=((W<<16)+(W<<8)+W).toString(16).toUpperCase();return"000000".slice(Q.length)+Q};v.rgb.gray=function(Z){return[(Z[0]+Z[1]+Z[2])/3/255*100]};function Aq(){let Z={},W=Object.keys(t1);for(let{length:X}=W,Q=0;Q<X;Q++)Z[W[Q]]={distance:-1,parent:null};return Z}function Iq(Z){let W=Aq(),X=[Z];W[Z].distance=0;while(X.length>0){let Q=X.pop(),J=Object.keys(t1[Q]);for(let{length:G}=J,z=0;z<G;z++){let q=J[z],K=W[q];if(K.distance===-1)K.distance=W[Q].distance+1,K.parent=Q,X.unshift(q)}}return W}function Mq(Z,W){return function(X){return W(Z(X))}}function wq(Z,W){let X=[W[Z].parent,Z],Q=t1[W[Z].parent][Z],J=W[Z].parent;while(W[J].parent)X.unshift(W[J].parent),Q=Mq(t1[W[J].parent][J],Q),J=W[J].parent;return Q.conversion=X,Q}function Nq(Z){let W=Iq(Z),X={},Q=Object.keys(W);for(let{length:J}=Q,G=0;G<J;G++){let z=Q[G];if(W[z].parent===null)continue;X[z]=wq(z,W)}return X}var Dq=Nq,T6={},Tq=Object.keys(t1);function Rq(Z){let W=function(...X){let Q=X[0];if(Q===void 0||Q===null)return Q;if(Q.length>1)X=Q;return Z(X)};if("conversion"in Z)W.conversion=Z.conversion;return W}function Pq(Z){let W=function(...X){let Q=X[0];if(Q===void 0||Q===null)return Q;if(Q.length>1)X=Q;let J=Z(X);if(typeof J==="object")for(let{length:G}=J,z=0;z<G;z++)J[z]=Math.round(J[z]);return J};if("conversion"in Z)W.conversion=Z.conversion;return W}for(let Z of Tq){T6[Z]={},Object.defineProperty(T6[Z],"channels",{value:t1[Z].channels}),Object.defineProperty(T6[Z],"labels",{value:t1[Z].labels});let W=Dq(Z),X=Object.keys(W);for(let Q of X){let J=W[Q];T6[Z][Q]=Pq(J),T6[Z][Q].raw=Rq(J)}}var u0=T6,AW=["keyword","gray","hex"],p3={};for(let Z of Object.keys(u0))p3[[...u0[Z].labels].sort().join("")]=Z;var n3={};function D0(Z,W){if(!(this instanceof D0))return new D0(Z,W);if(W&&W in AW)W=null;if(W&&!(W in u0))throw Error("Unknown model: "+W);let X,Q;if(Z==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(Z instanceof D0)this.model=Z.model,this.color=[...Z.color],this.valpha=Z.valpha;else if(typeof Z==="string"){let J=D6.get(Z);if(J===null)throw Error("Unable to parse color from string: "+Z);this.model=J.model,Q=u0[this.model].channels,this.color=J.value.slice(0,Q),this.valpha=typeof J.value[Q]==="number"?J.value[Q]:1}else if(Z.length>0){this.model=W||"rgb",Q=u0[this.model].channels;let J=Array.prototype.slice.call(Z,0,Q);this.color=i3(J,Q),this.valpha=typeof Z[Q]==="number"?Z[Q]:1}else if(typeof Z==="number")this.model="rgb",this.color=[Z>>16&255,Z>>8&255,Z&255],this.valpha=1;else{this.valpha=1;let 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 p3))throw Error("Unable to parse color from object: "+JSON.stringify(Z));this.model=p3[G];let{labels:z}=u0[this.model],q=[];for(X=0;X<z.length;X++)q.push(Z[z[X]]);this.color=i3(q)}if(n3[this.model]){Q=u0[this.model].channels;for(X=0;X<Q;X++){let J=n3[this.model][X];if(J)this.color[X]=J(this.color[X])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}D0.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(Z){let W=this.model in D6.to?this:this.rgb();W=W.round(typeof Z==="number"?Z:1);let X=W.valpha===1?W.color:[...W.color,this.valpha];return D6.to[W.model](...X)},percentString(Z){let W=this.rgb().round(typeof Z==="number"?Z:1),X=W.valpha===1?W.color:[...W.color,this.valpha];return D6.to.rgb.percent(...X)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let Z={},{channels:W}=u0[this.model],{labels:X}=u0[this.model];for(let Q=0;Q<W;Q++)Z[X[Q]]=this.color[Q];if(this.valpha!==1)Z.alpha=this.valpha;return Z},unitArray(){let Z=this.rgb().color;if(Z[0]/=255,Z[1]/=255,Z[2]/=255,this.valpha!==1)Z.push(this.valpha);return Z},unitObject(){let Z=this.rgb().object();if(Z.r/=255,Z.g/=255,Z.b/=255,this.valpha!==1)Z.alpha=this.valpha;return Z},round(Z){return Z=Math.max(Z||0,0),new D0([...this.color.map(jq(Z)),this.valpha],this.model)},alpha(Z){if(Z!==void 0)return new D0([...this.color,Math.max(0,Math.min(1,Z))],this.model);return this.valpha},red:H0("rgb",0,w0(255)),green:H0("rgb",1,w0(255)),blue:H0("rgb",2,w0(255)),hue:H0(["hsl","hsv","hsl","hwb","hcg"],0,(Z)=>(Z%360+360)%360),saturationl:H0("hsl",1,w0(100)),lightness:H0("hsl",2,w0(100)),saturationv:H0("hsv",1,w0(100)),value:H0("hsv",2,w0(100)),chroma:H0("hcg",1,w0(100)),gray:H0("hcg",2,w0(100)),white:H0("hwb",1,w0(100)),wblack:H0("hwb",2,w0(100)),cyan:H0("cmyk",0,w0(100)),magenta:H0("cmyk",1,w0(100)),yellow:H0("cmyk",2,w0(100)),black:H0("cmyk",3,w0(100)),x:H0("xyz",0,w0(95.047)),y:H0("xyz",1,w0(100)),z:H0("xyz",2,w0(108.833)),l:H0("lab",0,w0(100)),a:H0("lab",1),b:H0("lab",2),keyword(Z){if(Z!==void 0)return new D0(Z);return u0[this.model].keyword(this.color)},hex(Z){if(Z!==void 0)return new D0(Z);return D6.to.hex(...this.rgb().round().color)},hexa(Z){if(Z!==void 0)return new D0(Z);let W=this.rgb().round().color,X=Math.round(this.valpha*255).toString(16).toUpperCase();if(X.length===1)X="0"+X;return D6.to.hex(...W)+X},rgbNumber(){let Z=this.rgb().color;return(Z[0]&255)<<16|(Z[1]&255)<<8|Z[2]&255},luminosity(){let Z=this.rgb().color,W=[];for(let[X,Q]of Z.entries()){let J=Q/255;W[X]=J<=0.04045?J/12.92:((J+0.055)/1.055)**2.4}return 0.2126*W[0]+0.7152*W[1]+0.0722*W[2]},contrast(Z){let W=this.luminosity(),X=Z.luminosity();if(W>X)return(W+0.05)/(X+0.05);return(X+0.05)/(W+0.05)},level(Z){let W=this.contrast(Z);if(W>=7)return"AAA";return W>=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 W=0;W<3;W++)Z.color[W]=255-Z.color[W];return Z},lighten(Z){let W=this.hsl();return W.color[2]+=W.color[2]*Z,W},darken(Z){let W=this.hsl();return W.color[2]-=W.color[2]*Z,W},saturate(Z){let W=this.hsl();return W.color[1]+=W.color[1]*Z,W},desaturate(Z){let W=this.hsl();return W.color[1]-=W.color[1]*Z,W},whiten(Z){let W=this.hwb();return W.color[1]+=W.color[1]*Z,W},blacken(Z){let W=this.hwb();return W.color[2]+=W.color[2]*Z,W},grayscale(){let Z=this.rgb().color,W=Z[0]*0.3+Z[1]*0.59+Z[2]*0.11;return D0.rgb(W,W,W)},fade(Z){return this.alpha(this.valpha-this.valpha*Z)},opaquer(Z){return this.alpha(this.valpha+this.valpha*Z)},rotate(Z){let W=this.hsl(),X=W.color[0];return X=(X+Z)%360,X=X<0?360+X:X,W.color[0]=X,W},mix(Z,W){if(!Z||!Z.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof Z);let X=Z.rgb(),Q=this.rgb(),J=W===void 0?0.5:W,G=2*J-1,z=X.alpha()-Q.alpha(),q=((G*z===-1?G:(G+z)/(1+G*z))+1)/2,K=1-q;return D0.rgb(q*X.red()+K*Q.red(),q*X.green()+K*Q.green(),q*X.blue()+K*Q.blue(),X.alpha()*J+Q.alpha()*(1-J))}};for(let Z of Object.keys(u0)){if(AW.includes(Z))continue;let{channels:W}=u0[Z];D0.prototype[Z]=function(...X){if(this.model===Z)return new D0(this);if(X.length>0)return new D0(X,Z);return new D0([...Eq(u0[this.model][Z].raw(this.color)),this.valpha],Z)},D0[Z]=function(...X){let Q=X[0];if(typeof Q==="number")Q=i3(X,W);return new D0(Q,Z)}}function _q(Z,W){return Number(Z.toFixed(W))}function jq(Z){return function(W){return _q(W,Z)}}function H0(Z,W,X){Z=Array.isArray(Z)?Z:[Z];for(let Q of Z)(n3[Q]||=[])[W]=X;return Z=Z[0],function(Q){let J;if(Q!==void 0){if(X)Q=X(Q);return J=this[Z](),J.color[W]=Q,J}if(J=this[Z]().color[W],X)J=X(J);return J}}function w0(Z){return function(W){return Math.max(0,Math.min(Z,W))}}function Eq(Z){return Array.isArray(Z)?Z:[Z]}function i3(Z,W){for(let X=0;X<W;X++)if(typeof Z[X]!=="number")Z[X]=0;return Z}var Cq=D0});var NW=i((eF,wW)=>{wW.exports=MW().default});function Oq(Z){return this._setBackgroundColourOption("tint",Z),this}function xq(Z){return this.options.greyscale=Y.bool(Z)?Z:!0,this}function kq(Z){return this.greyscale(Z)}function Sq(Z){if(!Y.string(Z))throw Y.invalidParameterError("colourspace","string",Z);return this.options.colourspacePipeline=Z,this}function bq(Z){return this.pipelineColourspace(Z)}function vq(Z){if(!Y.string(Z))throw Y.invalidParameterError("colourspace","string",Z);return this.options.colourspace=Z,this}function yq(Z){return this.toColourspace(Z)}function RW(Z){if(Y.object(Z)||Y.string(Z)&&Z.length>=3&&Z.length<=200){let W=TW.default(Z);return[W.red(),W.green(),W.blue(),Math.round(W.alpha()*255)]}else throw Y.invalidParameterError("background","object or string",Z)}function gq(Z,W){if(Y.defined(W))this.options[Z]=RW(W)}var TW,DW,PW=(Z)=>{Object.assign(Z.prototype,{tint:Oq,greyscale:xq,grayscale:kq,pipelineColourspace:Sq,pipelineColorspace:bq,toColourspace:vq,toColorspace:yq,_getBackgroundColourOption:RW,_setBackgroundColourOption:gq}),Z.colourspace=DW,Z.colorspace=DW};var _W=c(()=>{Q1();TW=v6(NW(),1);/*!
|
|
232
232
|
Copyright 2013 Lovell Fuller and others.
|
|
233
233
|
SPDX-License-Identifier: Apache-2.0
|
|
234
|
-
*/
|
|
234
|
+
*/DW={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function fq(){return this.options.removeAlpha=!0,this}function mq(Z){if(Y.defined(Z))if(Y.number(Z)&&Y.inRange(Z,0,1))this.options.ensureAlpha=Z;else throw Y.invalidParameterError("alpha","number between 0 and 1",Z);else this.options.ensureAlpha=1;return this}function uq(Z){let W={red:0,green:1,blue:2,alpha:3};if(Object.keys(W).includes(Z))Z=W[Z];if(Y.integer(Z)&&Y.inRange(Z,0,4))this.options.extractChannel=Z;else throw Y.invalidParameterError("channel","integer or one of: red, green, blue, alpha",Z);return this}function dq(Z,W){if(Array.isArray(Z))Z.forEach(function(X){this.options.joinChannelIn.push(this._createInputDescriptor(X,W))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(Z,W));return this}function cq(Z){if(Y.string(Z)&&Y.inArray(Z,["and","or","eor"]))this.options.bandBoolOp=Z;else throw Y.invalidParameterError("boolOp","one of: and, or, eor",Z);return this}var hq,jW=(Z)=>{Object.assign(Z.prototype,{removeAlpha:fq,ensureAlpha:mq,extractChannel:uq,joinChannel:dq,bandbool:cq}),Z.bool=hq};var EW=c(()=>{Q1();/*!
|
|
235
235
|
Copyright 2013 Lovell Fuller and others.
|
|
236
236
|
SPDX-License-Identifier: Apache-2.0
|
|
237
|
-
*/mq={and:"and",or:"or",eor:"eor"}});import a3 from"node:path";function iq(Z,W){let X;if(!Y.string(Z))X=Error("Missing output file path");else if(Y.string(this.options.input.file)&&a3.resolve(this.options.input.file)===a3.resolve(Z))X=Error("Cannot use same file for input and output");else if(nq.test(a3.extname(Z))&&!this.constructor.format.jp2.output.file)X=kW();if(X)if(Y.fn(W))W(X);else return Promise.reject(X);else{this.options.fileOut=Z;let Q=Error();return this._pipeline(W,Q)}return this}function rq(Z,W){if(Y.object(Z))this._setBooleanOption("resolveWithObject",Z.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let X=Error();return this._pipeline(Y.fn(Z)?Z:W,X)}function aq(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let Z=Error();return this._pipeline(null,Z)}function sq(Z){if(Y.number(Z)&&Z>0)this.options.withMetadataDensity=Z;else throw Y.invalidParameterError("density","positive number",Z);return this.keepExif()}function oq(){return this.options.keepMetadata|=1,this}function tq(Z){if(Y.object(Z))for(let[W,X]of Object.entries(Z))if(Y.object(X))for(let[Q,J]of Object.entries(X))if(Y.string(J))this.options.withExif[`exif-${W.toLowerCase()}-${Q}`]=J;else throw Y.invalidParameterError(`${W}.${Q}`,"string",J);else throw Y.invalidParameterError(W,"object",X);else throw Y.invalidParameterError("exif","object",Z);return this.options.withExifMerge=!1,this.keepExif()}function eq(Z){return this.withExif(Z),this.options.withExifMerge=!0,this}function ZK(){return this.options.keepMetadata|=8,this}function WK(Z,W){if(Y.string(Z))this.options.withIccProfile=Z;else throw Y.invalidParameterError("icc","string",Z);if(this.keepIccProfile(),Y.object(W)){if(Y.defined(W.attach))if(Y.bool(W.attach)){if(!W.attach)this.options.keepMetadata&=-9}else throw Y.invalidParameterError("attach","boolean",W.attach)}return this}function XK(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function QK(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function JK(){return this.options.keepMetadata|=2,this}function GK(Z){if(Y.string(Z)&&Z.length>0)this.options.withXmp=Z,this.options.keepMetadata|=2;else throw Y.invalidParameterError("xmp","non-empty string",Z);return this}function zK(){return this.options.keepMetadata|=31,this}function YK(Z){if(this.keepMetadata(),this.withIccProfile("srgb"),Y.object(Z)){if(Y.defined(Z.orientation))if(Y.integer(Z.orientation)&&Y.inRange(Z.orientation,1,8))this.options.withMetadataOrientation=Z.orientation;else throw Y.invalidParameterError("orientation","integer between 1 and 8",Z.orientation);if(Y.defined(Z.density))if(Y.number(Z.density)&&Z.density>0)this.options.withMetadataDensity=Z.density;else throw Y.invalidParameterError("density","positive number",Z.density);if(Y.defined(Z.icc))this.withIccProfile(Z.icc);if(Y.defined(Z.exif))this.withExifMerge(Z.exif)}return this}function UK(Z,W){let X=xW.get((Y.object(Z)&&Y.string(Z.id)?Z.id:Z).toLowerCase());if(!X)throw Y.invalidParameterError("format",`one of: ${[...xW.keys()].join(", ")}`,Z);return this[X](W)}function qK(Z){if(Y.object(Z)){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.jpegQuality=Z.quality;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(Y.defined(Z.progressive))this._setBooleanOption("jpegProgressive",Z.progressive);if(Y.defined(Z.chromaSubsampling))if(Y.string(Z.chromaSubsampling)&&Y.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=Z.chromaSubsampling;else throw Y.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);let W=Y.bool(Z.optimizeCoding)?Z.optimizeCoding:Z.optimiseCoding;if(Y.defined(W))this._setBooleanOption("jpegOptimiseCoding",W);if(Y.defined(Z.mozjpeg))if(Y.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 Y.invalidParameterError("mozjpeg","boolean",Z.mozjpeg);let X=Y.bool(Z.trellisQuantization)?Z.trellisQuantization:Z.trellisQuantisation;if(Y.defined(X))this._setBooleanOption("jpegTrellisQuantisation",X);if(Y.defined(Z.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",Z.overshootDeringing);let Q=Y.bool(Z.optimizeScans)?Z.optimizeScans:Z.optimiseScans;if(Y.defined(Q)){if(this._setBooleanOption("jpegOptimiseScans",Q),Q)this.options.jpegProgressive=!0}let J=Y.number(Z.quantizationTable)?Z.quantizationTable:Z.quantisationTable;if(Y.defined(J))if(Y.integer(J)&&Y.inRange(J,0,8))this.options.jpegQuantisationTable=J;else throw Y.invalidParameterError("quantisationTable","integer between 0 and 8",J)}return this._updateFormatOut("jpeg",Z)}function KK(Z){if(Y.object(Z)){if(Y.defined(Z.progressive))this._setBooleanOption("pngProgressive",Z.progressive);if(Y.defined(Z.compressionLevel))if(Y.integer(Z.compressionLevel)&&Y.inRange(Z.compressionLevel,0,9))this.options.pngCompressionLevel=Z.compressionLevel;else throw Y.invalidParameterError("compressionLevel","integer between 0 and 9",Z.compressionLevel);if(Y.defined(Z.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",Z.adaptiveFiltering);let W=Z.colours||Z.colors;if(Y.defined(W))if(Y.integer(W)&&Y.inRange(W,2,256))this.options.pngBitdepth=SW(W);else throw Y.invalidParameterError("colours","integer between 2 and 256",W);if(Y.defined(Z.palette))this._setBooleanOption("pngPalette",Z.palette);else if([Z.quality,Z.effort,Z.colours,Z.colors,Z.dither].some(Y.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,0,100))this.options.pngQuality=Z.quality;else throw Y.invalidParameterError("quality","integer between 0 and 100",Z.quality);if(Y.defined(Z.effort))if(Y.integer(Z.effort)&&Y.inRange(Z.effort,1,10))this.options.pngEffort=Z.effort;else throw Y.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(Y.defined(Z.dither))if(Y.number(Z.dither)&&Y.inRange(Z.dither,0,1))this.options.pngDither=Z.dither;else throw Y.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither)}}return this._updateFormatOut("png",Z)}function VK(Z){if(Y.object(Z)){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.webpQuality=Z.quality;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(Y.defined(Z.alphaQuality))if(Y.integer(Z.alphaQuality)&&Y.inRange(Z.alphaQuality,0,100))this.options.webpAlphaQuality=Z.alphaQuality;else throw Y.invalidParameterError("alphaQuality","integer between 0 and 100",Z.alphaQuality);if(Y.defined(Z.lossless))this._setBooleanOption("webpLossless",Z.lossless);if(Y.defined(Z.nearLossless))this._setBooleanOption("webpNearLossless",Z.nearLossless);if(Y.defined(Z.smartSubsample))this._setBooleanOption("webpSmartSubsample",Z.smartSubsample);if(Y.defined(Z.smartDeblock))this._setBooleanOption("webpSmartDeblock",Z.smartDeblock);if(Y.defined(Z.preset))if(Y.string(Z.preset)&&Y.inArray(Z.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=Z.preset;else throw Y.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",Z.preset);if(Y.defined(Z.effort))if(Y.integer(Z.effort)&&Y.inRange(Z.effort,0,6))this.options.webpEffort=Z.effort;else throw Y.invalidParameterError("effort","integer between 0 and 6",Z.effort);if(Y.defined(Z.minSize))this._setBooleanOption("webpMinSize",Z.minSize);if(Y.defined(Z.mixed))this._setBooleanOption("webpMixed",Z.mixed);if(Y.defined(Z.exact))this._setBooleanOption("webpExact",Z.exact)}return s3(Z,this.options),this._updateFormatOut("webp",Z)}function BK(Z){if(Y.object(Z)){if(Y.defined(Z.reuse))this._setBooleanOption("gifReuse",Z.reuse);if(Y.defined(Z.progressive))this._setBooleanOption("gifProgressive",Z.progressive);let W=Z.colours||Z.colors;if(Y.defined(W))if(Y.integer(W)&&Y.inRange(W,2,256))this.options.gifBitdepth=SW(W);else throw Y.invalidParameterError("colours","integer between 2 and 256",W);if(Y.defined(Z.effort))if(Y.number(Z.effort)&&Y.inRange(Z.effort,1,10))this.options.gifEffort=Z.effort;else throw Y.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(Y.defined(Z.dither))if(Y.number(Z.dither)&&Y.inRange(Z.dither,0,1))this.options.gifDither=Z.dither;else throw Y.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither);if(Y.defined(Z.interFrameMaxError))if(Y.number(Z.interFrameMaxError)&&Y.inRange(Z.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=Z.interFrameMaxError;else throw Y.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",Z.interFrameMaxError);if(Y.defined(Z.interPaletteMaxError))if(Y.number(Z.interPaletteMaxError)&&Y.inRange(Z.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=Z.interPaletteMaxError;else throw Y.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",Z.interPaletteMaxError);if(Y.defined(Z.keepDuplicateFrames))if(Y.bool(Z.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",Z.keepDuplicateFrames);else throw Y.invalidParameterError("keepDuplicateFrames","boolean",Z.keepDuplicateFrames)}return s3(Z,this.options),this._updateFormatOut("gif",Z)}function HK(Z){if(!this.constructor.format.jp2.output.buffer)throw kW();if(Y.object(Z)){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.jp2Quality=Z.quality;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(Y.defined(Z.lossless))if(Y.bool(Z.lossless))this.options.jp2Lossless=Z.lossless;else throw Y.invalidParameterError("lossless","boolean",Z.lossless);if(Y.defined(Z.tileWidth))if(Y.integer(Z.tileWidth)&&Y.inRange(Z.tileWidth,1,32768))this.options.jp2TileWidth=Z.tileWidth;else throw Y.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if(Y.defined(Z.tileHeight))if(Y.integer(Z.tileHeight)&&Y.inRange(Z.tileHeight,1,32768))this.options.jp2TileHeight=Z.tileHeight;else throw Y.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if(Y.defined(Z.chromaSubsampling))if(Y.string(Z.chromaSubsampling)&&Y.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=Z.chromaSubsampling;else throw Y.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling)}return this._updateFormatOut("jp2",Z)}function s3(Z,W){if(Y.object(Z)&&Y.defined(Z.loop))if(Y.integer(Z.loop)&&Y.inRange(Z.loop,0,65535))W.loop=Z.loop;else throw Y.invalidParameterError("loop","integer between 0 and 65535",Z.loop);if(Y.object(Z)&&Y.defined(Z.delay))if(Y.integer(Z.delay)&&Y.inRange(Z.delay,0,65535))W.delay=[Z.delay];else if(Array.isArray(Z.delay)&&Z.delay.every(Y.integer)&&Z.delay.every((X)=>Y.inRange(X,0,65535)))W.delay=Z.delay;else throw Y.invalidParameterError("delay","integer or an array of integers between 0 and 65535",Z.delay)}function $K(Z){if(Y.object(Z)){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.tiffQuality=Z.quality;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(Y.defined(Z.bitdepth))if(Y.integer(Z.bitdepth)&&Y.inArray(Z.bitdepth,[1,2,4]))this.options.tiffBitdepth=Z.bitdepth;else throw Y.invalidParameterError("bitdepth","1, 2 or 4",Z.bitdepth);if(Y.defined(Z.tile))this._setBooleanOption("tiffTile",Z.tile);if(Y.defined(Z.tileWidth))if(Y.integer(Z.tileWidth)&&Z.tileWidth>0)this.options.tiffTileWidth=Z.tileWidth;else throw Y.invalidParameterError("tileWidth","integer greater than zero",Z.tileWidth);if(Y.defined(Z.tileHeight))if(Y.integer(Z.tileHeight)&&Z.tileHeight>0)this.options.tiffTileHeight=Z.tileHeight;else throw Y.invalidParameterError("tileHeight","integer greater than zero",Z.tileHeight);if(Y.defined(Z.miniswhite))this._setBooleanOption("tiffMiniswhite",Z.miniswhite);if(Y.defined(Z.pyramid))this._setBooleanOption("tiffPyramid",Z.pyramid);if(Y.defined(Z.xres))if(Y.number(Z.xres)&&Z.xres>0)this.options.tiffXres=Z.xres;else throw Y.invalidParameterError("xres","number greater than zero",Z.xres);if(Y.defined(Z.yres))if(Y.number(Z.yres)&&Z.yres>0)this.options.tiffYres=Z.yres;else throw Y.invalidParameterError("yres","number greater than zero",Z.yres);if(Y.defined(Z.compression))if(Y.string(Z.compression)&&Y.inArray(Z.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=Z.compression;else throw Y.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",Z.compression);if(Y.defined(Z.bigtiff))this._setBooleanOption("tiffBigtiff",Z.bigtiff);if(Y.defined(Z.predictor))if(Y.string(Z.predictor)&&Y.inArray(Z.predictor,["none","horizontal","float"]))this.options.tiffPredictor=Z.predictor;else throw Y.invalidParameterError("predictor","one of: none, horizontal, float",Z.predictor);if(Y.defined(Z.resolutionUnit))if(Y.string(Z.resolutionUnit)&&Y.inArray(Z.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=Z.resolutionUnit;else throw Y.invalidParameterError("resolutionUnit","one of: inch, cm",Z.resolutionUnit)}return this._updateFormatOut("tiff",Z)}function FK(Z){return this.heif({...Z,compression:"av1"})}function LK(Z){if(Y.object(Z)){if(Y.string(Z.compression)&&Y.inArray(Z.compression,["av1","hevc"]))this.options.heifCompression=Z.compression;else throw Y.invalidParameterError("compression","one of: av1, hevc",Z.compression);if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.heifQuality=Z.quality;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(Y.defined(Z.lossless))if(Y.bool(Z.lossless))this.options.heifLossless=Z.lossless;else throw Y.invalidParameterError("lossless","boolean",Z.lossless);if(Y.defined(Z.effort))if(Y.integer(Z.effort)&&Y.inRange(Z.effort,0,9))this.options.heifEffort=Z.effort;else throw Y.invalidParameterError("effort","integer between 0 and 9",Z.effort);if(Y.defined(Z.chromaSubsampling))if(Y.string(Z.chromaSubsampling)&&Y.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=Z.chromaSubsampling;else throw Y.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);if(Y.defined(Z.bitdepth))if(Y.integer(Z.bitdepth)&&Y.inArray(Z.bitdepth,[8,10,12]))this.options.heifBitdepth=Z.bitdepth;else throw Y.invalidParameterError("bitdepth","8, 10 or 12",Z.bitdepth);if(Y.defined(Z.tune))if(Y.string(Z.tune)&&Y.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 Y.invalidParameterError("tune","one of: auto, iq, psnr, ssim",Z.tune)}else throw Y.invalidParameterError("options","Object",Z);return this._updateFormatOut("heif",Z)}function AK(Z){if(Y.object(Z)){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.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 Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);else if(Y.defined(Z.distance))if(Y.number(Z.distance)&&Y.inRange(Z.distance,0,15))this.options.jxlDistance=Z.distance;else throw Y.invalidParameterError("distance","number between 0.0 and 15.0",Z.distance);if(Y.defined(Z.decodingTier))if(Y.integer(Z.decodingTier)&&Y.inRange(Z.decodingTier,0,4))this.options.jxlDecodingTier=Z.decodingTier;else throw Y.invalidParameterError("decodingTier","integer between 0 and 4",Z.decodingTier);if(Y.defined(Z.lossless))if(Y.bool(Z.lossless))this.options.jxlLossless=Z.lossless;else throw Y.invalidParameterError("lossless","boolean",Z.lossless);if(Y.defined(Z.effort))if(Y.integer(Z.effort)&&Y.inRange(Z.effort,1,9))this.options.jxlEffort=Z.effort;else throw Y.invalidParameterError("effort","integer between 1 and 9",Z.effort)}return s3(Z,this.options),this._updateFormatOut("jxl",Z)}function MK(Z){if(Y.object(Z)){if(Y.defined(Z.depth))if(Y.string(Z.depth)&&Y.inArray(Z.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=Z.depth;else throw Y.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",Z.depth)}return this._updateFormatOut("raw")}function IK(Z){if(Y.object(Z)){if(Y.defined(Z.size))if(Y.integer(Z.size)&&Y.inRange(Z.size,1,8192))this.options.tileSize=Z.size;else throw Y.invalidParameterError("size","integer between 1 and 8192",Z.size);if(Y.defined(Z.overlap))if(Y.integer(Z.overlap)&&Y.inRange(Z.overlap,0,8192)){if(Z.overlap>this.options.tileSize)throw Y.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,Z.overlap);this.options.tileOverlap=Z.overlap}else throw Y.invalidParameterError("overlap","integer between 0 and 8192",Z.overlap);if(Y.defined(Z.container))if(Y.string(Z.container)&&Y.inArray(Z.container,["fs","zip"]))this.options.tileContainer=Z.container;else throw Y.invalidParameterError("container","one of: fs, zip",Z.container);if(Y.defined(Z.layout))if(Y.string(Z.layout)&&Y.inArray(Z.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=Z.layout;else throw Y.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",Z.layout);if(Y.defined(Z.angle))if(Y.integer(Z.angle)&&!(Z.angle%90))this.options.tileAngle=Z.angle;else throw Y.invalidParameterError("angle","positive/negative multiple of 90",Z.angle);if(this._setBackgroundColourOption("tileBackground",Z.background),Y.defined(Z.depth))if(Y.string(Z.depth)&&Y.inArray(Z.depth,["onepixel","onetile","one"]))this.options.tileDepth=Z.depth;else throw Y.invalidParameterError("depth","one of: onepixel, onetile, one",Z.depth);if(Y.defined(Z.skipBlanks))if(Y.integer(Z.skipBlanks)&&Y.inRange(Z.skipBlanks,-1,65535))this.options.tileSkipBlanks=Z.skipBlanks;else throw Y.invalidParameterError("skipBlanks","integer between -1 and 255/65535",Z.skipBlanks);else if(Y.defined(Z.layout)&&Z.layout==="google")this.options.tileSkipBlanks=5;let W=Y.bool(Z.center)?Z.center:Z.centre;if(Y.defined(W))this._setBooleanOption("tileCentre",W);if(Y.defined(Z.id))if(Y.string(Z.id))this.options.tileId=Z.id;else throw Y.invalidParameterError("id","string",Z.id);if(Y.defined(Z.basename))if(Y.string(Z.basename))this.options.tileBasename=Z.basename;else throw Y.invalidParameterError("basename","string",Z.basename)}if(Y.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw Y.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function wK(Z){if(!Y.plainObject(Z))throw Y.invalidParameterError("options","object",Z);if(Y.integer(Z.seconds)&&Y.inRange(Z.seconds,0,3600))this.options.timeoutSeconds=Z.seconds;else throw Y.invalidParameterError("seconds","integer between 0 and 3600",Z.seconds);return this}function NK(Z,W){if(!(Y.object(W)&&W.force===!1))this.options.formatOut=Z;return this}function DK(Z,W){if(Y.bool(W))this.options[Z]=W;else throw Y.invalidParameterError(Z,"boolean",W)}function TK(){if(!this.options.streamOut){this.options.streamOut=!0;let Z=Error();this._pipeline(void 0,Z)}}function RK(Z,W){if(typeof Z==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z0.pipeline(this.options,(X,Q,J)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q,J)})});else Z0.pipeline(this.options,(X,Q,J)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q,J)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),Z0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",Y.nativeError(X,W));else this.emit("info",J),this.push(Q);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else Z0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",Y.nativeError(X,W));else this.emit("info",J),this.push(Q);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.once("finish",()=>{this._flattenBufferIn(),Z0.pipeline(this.options,(J,G,z)=>{if(J)Q(Y.nativeError(J,W));else if(this.options.resolveWithObject)X({data:G,info:z});else X(G)})})});else return new Promise((X,Q)=>{Z0.pipeline(this.options,(J,G,z)=>{if(J)Q(Y.nativeError(J,W));else if(this.options.resolveWithObject)X({data:G,info:z});else X(G)})})}var xW,nq,kW=()=>Error("JP2 output requires libvips with support for OpenJPEG"),SW=(Z)=>1<<31-Math.clz32(Math.ceil(Math.log2(Z))),bW=(Z)=>{Object.assign(Z.prototype,{toFile:iq,toBuffer:rq,toUint8Array:aq,withDensity:sq,keepExif:oq,withExif:tq,withExifMerge:eq,keepIccProfile:ZK,withIccProfile:WK,keepGainMap:XK,withGainMap:QK,keepXmp:JK,withXmp:GK,keepMetadata:zK,withMetadata:YK,toFormat:UK,jpeg:qK,jp2:HK,png:KK,webp:VK,tiff:$K,avif:FK,heif:LK,jxl:AK,gif:BK,raw:MK,tile:IK,timeout:wK,_updateFormatOut:NK,_setBooleanOption:DK,_read:TK,_pipeline:RK})};var vW=d(()=>{Q1();Q4();/*!
|
|
237
|
+
*/hq={and:"and",or:"or",eor:"eor"}});import a3 from"node:path";function pq(Z,W){let X;if(!Y.string(Z))X=Error("Missing output file path");else if(Y.string(this.options.input.file)&&a3.resolve(this.options.input.file)===a3.resolve(Z))X=Error("Cannot use same file for input and output");else if(lq.test(a3.extname(Z))&&!this.constructor.format.jp2.output.file)X=OW();if(X)if(Y.fn(W))W(X);else return Promise.reject(X);else{this.options.fileOut=Z;let Q=Error();return this._pipeline(W,Q)}return this}function nq(Z,W){if(Y.object(Z))this._setBooleanOption("resolveWithObject",Z.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let X=Error();return this._pipeline(Y.fn(Z)?Z:W,X)}function iq(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let Z=Error();return this._pipeline(null,Z)}function rq(Z){if(Y.number(Z)&&Z>0)this.options.withMetadataDensity=Z;else throw Y.invalidParameterError("density","positive number",Z);return this.keepExif()}function aq(){return this.options.keepMetadata|=1,this}function sq(Z){if(Y.object(Z))for(let[W,X]of Object.entries(Z))if(Y.object(X))for(let[Q,J]of Object.entries(X))if(Y.string(J))this.options.withExif[`exif-${W.toLowerCase()}-${Q}`]=J;else throw Y.invalidParameterError(`${W}.${Q}`,"string",J);else throw Y.invalidParameterError(W,"object",X);else throw Y.invalidParameterError("exif","object",Z);return this.options.withExifMerge=!1,this.keepExif()}function oq(Z){return this.withExif(Z),this.options.withExifMerge=!0,this}function tq(){return this.options.keepMetadata|=8,this}function eq(Z,W){if(Y.string(Z))this.options.withIccProfile=Z;else throw Y.invalidParameterError("icc","string",Z);if(this.keepIccProfile(),Y.object(W)){if(Y.defined(W.attach))if(Y.bool(W.attach)){if(!W.attach)this.options.keepMetadata&=-9}else throw Y.invalidParameterError("attach","boolean",W.attach)}return this}function ZK(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function WK(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function XK(){return this.options.keepMetadata|=2,this}function QK(Z){if(Y.string(Z)&&Z.length>0)this.options.withXmp=Z,this.options.keepMetadata|=2;else throw Y.invalidParameterError("xmp","non-empty string",Z);return this}function JK(){return this.options.keepMetadata|=31,this}function GK(Z){if(this.keepMetadata(),this.withIccProfile("srgb"),Y.object(Z)){if(Y.defined(Z.orientation))if(Y.integer(Z.orientation)&&Y.inRange(Z.orientation,1,8))this.options.withMetadataOrientation=Z.orientation;else throw Y.invalidParameterError("orientation","integer between 1 and 8",Z.orientation);if(Y.defined(Z.density))if(Y.number(Z.density)&&Z.density>0)this.options.withMetadataDensity=Z.density;else throw Y.invalidParameterError("density","positive number",Z.density);if(Y.defined(Z.icc))this.withIccProfile(Z.icc);if(Y.defined(Z.exif))this.withExifMerge(Z.exif)}return this}function zK(Z,W){let X=CW.get((Y.object(Z)&&Y.string(Z.id)?Z.id:Z).toLowerCase());if(!X)throw Y.invalidParameterError("format",`one of: ${[...CW.keys()].join(", ")}`,Z);return this[X](W)}function YK(Z){if(Y.object(Z)){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.jpegQuality=Z.quality;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(Y.defined(Z.progressive))this._setBooleanOption("jpegProgressive",Z.progressive);if(Y.defined(Z.chromaSubsampling))if(Y.string(Z.chromaSubsampling)&&Y.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=Z.chromaSubsampling;else throw Y.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);let W=Y.bool(Z.optimizeCoding)?Z.optimizeCoding:Z.optimiseCoding;if(Y.defined(W))this._setBooleanOption("jpegOptimiseCoding",W);if(Y.defined(Z.mozjpeg))if(Y.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 Y.invalidParameterError("mozjpeg","boolean",Z.mozjpeg);let X=Y.bool(Z.trellisQuantization)?Z.trellisQuantization:Z.trellisQuantisation;if(Y.defined(X))this._setBooleanOption("jpegTrellisQuantisation",X);if(Y.defined(Z.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",Z.overshootDeringing);let Q=Y.bool(Z.optimizeScans)?Z.optimizeScans:Z.optimiseScans;if(Y.defined(Q)){if(this._setBooleanOption("jpegOptimiseScans",Q),Q)this.options.jpegProgressive=!0}let J=Y.number(Z.quantizationTable)?Z.quantizationTable:Z.quantisationTable;if(Y.defined(J))if(Y.integer(J)&&Y.inRange(J,0,8))this.options.jpegQuantisationTable=J;else throw Y.invalidParameterError("quantisationTable","integer between 0 and 8",J)}return this._updateFormatOut("jpeg",Z)}function UK(Z){if(Y.object(Z)){if(Y.defined(Z.progressive))this._setBooleanOption("pngProgressive",Z.progressive);if(Y.defined(Z.compressionLevel))if(Y.integer(Z.compressionLevel)&&Y.inRange(Z.compressionLevel,0,9))this.options.pngCompressionLevel=Z.compressionLevel;else throw Y.invalidParameterError("compressionLevel","integer between 0 and 9",Z.compressionLevel);if(Y.defined(Z.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",Z.adaptiveFiltering);let W=Z.colours||Z.colors;if(Y.defined(W))if(Y.integer(W)&&Y.inRange(W,2,256))this.options.pngBitdepth=xW(W);else throw Y.invalidParameterError("colours","integer between 2 and 256",W);if(Y.defined(Z.palette))this._setBooleanOption("pngPalette",Z.palette);else if([Z.quality,Z.effort,Z.colours,Z.colors,Z.dither].some(Y.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,0,100))this.options.pngQuality=Z.quality;else throw Y.invalidParameterError("quality","integer between 0 and 100",Z.quality);if(Y.defined(Z.effort))if(Y.integer(Z.effort)&&Y.inRange(Z.effort,1,10))this.options.pngEffort=Z.effort;else throw Y.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(Y.defined(Z.dither))if(Y.number(Z.dither)&&Y.inRange(Z.dither,0,1))this.options.pngDither=Z.dither;else throw Y.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither)}}return this._updateFormatOut("png",Z)}function qK(Z){if(Y.object(Z)){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.webpQuality=Z.quality;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(Y.defined(Z.alphaQuality))if(Y.integer(Z.alphaQuality)&&Y.inRange(Z.alphaQuality,0,100))this.options.webpAlphaQuality=Z.alphaQuality;else throw Y.invalidParameterError("alphaQuality","integer between 0 and 100",Z.alphaQuality);if(Y.defined(Z.lossless))this._setBooleanOption("webpLossless",Z.lossless);if(Y.defined(Z.nearLossless))this._setBooleanOption("webpNearLossless",Z.nearLossless);if(Y.defined(Z.smartSubsample))this._setBooleanOption("webpSmartSubsample",Z.smartSubsample);if(Y.defined(Z.smartDeblock))this._setBooleanOption("webpSmartDeblock",Z.smartDeblock);if(Y.defined(Z.preset))if(Y.string(Z.preset)&&Y.inArray(Z.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=Z.preset;else throw Y.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",Z.preset);if(Y.defined(Z.effort))if(Y.integer(Z.effort)&&Y.inRange(Z.effort,0,6))this.options.webpEffort=Z.effort;else throw Y.invalidParameterError("effort","integer between 0 and 6",Z.effort);if(Y.defined(Z.minSize))this._setBooleanOption("webpMinSize",Z.minSize);if(Y.defined(Z.mixed))this._setBooleanOption("webpMixed",Z.mixed);if(Y.defined(Z.exact))this._setBooleanOption("webpExact",Z.exact)}return s3(Z,this.options),this._updateFormatOut("webp",Z)}function KK(Z){if(Y.object(Z)){if(Y.defined(Z.reuse))this._setBooleanOption("gifReuse",Z.reuse);if(Y.defined(Z.progressive))this._setBooleanOption("gifProgressive",Z.progressive);let W=Z.colours||Z.colors;if(Y.defined(W))if(Y.integer(W)&&Y.inRange(W,2,256))this.options.gifBitdepth=xW(W);else throw Y.invalidParameterError("colours","integer between 2 and 256",W);if(Y.defined(Z.effort))if(Y.integer(Z.effort)&&Y.inRange(Z.effort,1,10))this.options.gifEffort=Z.effort;else throw Y.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(Y.defined(Z.dither))if(Y.number(Z.dither)&&Y.inRange(Z.dither,0,1))this.options.gifDither=Z.dither;else throw Y.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither);if(Y.defined(Z.interFrameMaxError))if(Y.number(Z.interFrameMaxError)&&Y.inRange(Z.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=Z.interFrameMaxError;else throw Y.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",Z.interFrameMaxError);if(Y.defined(Z.interPaletteMaxError))if(Y.number(Z.interPaletteMaxError)&&Y.inRange(Z.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=Z.interPaletteMaxError;else throw Y.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",Z.interPaletteMaxError);if(Y.defined(Z.keepDuplicateFrames))if(Y.bool(Z.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",Z.keepDuplicateFrames);else throw Y.invalidParameterError("keepDuplicateFrames","boolean",Z.keepDuplicateFrames)}return s3(Z,this.options),this._updateFormatOut("gif",Z)}function VK(Z){if(!this.constructor.format.jp2.output.buffer)throw OW();if(Y.object(Z)){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.jp2Quality=Z.quality;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(Y.defined(Z.lossless))if(Y.bool(Z.lossless))this.options.jp2Lossless=Z.lossless;else throw Y.invalidParameterError("lossless","boolean",Z.lossless);if(Y.defined(Z.tileWidth))if(Y.integer(Z.tileWidth)&&Y.inRange(Z.tileWidth,1,32768))this.options.jp2TileWidth=Z.tileWidth;else throw Y.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if(Y.defined(Z.tileHeight))if(Y.integer(Z.tileHeight)&&Y.inRange(Z.tileHeight,1,32768))this.options.jp2TileHeight=Z.tileHeight;else throw Y.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if(Y.defined(Z.chromaSubsampling))if(Y.string(Z.chromaSubsampling)&&Y.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=Z.chromaSubsampling;else throw Y.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling)}return this._updateFormatOut("jp2",Z)}function s3(Z,W){if(Y.object(Z)&&Y.defined(Z.loop))if(Y.integer(Z.loop)&&Y.inRange(Z.loop,0,65535))W.loop=Z.loop;else throw Y.invalidParameterError("loop","integer between 0 and 65535",Z.loop);if(Y.object(Z)&&Y.defined(Z.delay))if(Y.integer(Z.delay)&&Y.inRange(Z.delay,0,65535))W.delay=[Z.delay];else if(Array.isArray(Z.delay)&&Z.delay.every(Y.integer)&&Z.delay.every((X)=>Y.inRange(X,0,65535)))W.delay=Z.delay;else throw Y.invalidParameterError("delay","integer or an array of integers between 0 and 65535",Z.delay)}function BK(Z){if(Y.object(Z)){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.tiffQuality=Z.quality;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(Y.defined(Z.bitdepth))if(Y.integer(Z.bitdepth)&&Y.inArray(Z.bitdepth,[1,2,4]))this.options.tiffBitdepth=Z.bitdepth;else throw Y.invalidParameterError("bitdepth","1, 2 or 4",Z.bitdepth);if(Y.defined(Z.tile))this._setBooleanOption("tiffTile",Z.tile);if(Y.defined(Z.tileWidth))if(Y.integer(Z.tileWidth)&&Z.tileWidth>0)this.options.tiffTileWidth=Z.tileWidth;else throw Y.invalidParameterError("tileWidth","integer greater than zero",Z.tileWidth);if(Y.defined(Z.tileHeight))if(Y.integer(Z.tileHeight)&&Z.tileHeight>0)this.options.tiffTileHeight=Z.tileHeight;else throw Y.invalidParameterError("tileHeight","integer greater than zero",Z.tileHeight);if(Y.defined(Z.miniswhite))this._setBooleanOption("tiffMiniswhite",Z.miniswhite);if(Y.defined(Z.pyramid))this._setBooleanOption("tiffPyramid",Z.pyramid);if(Y.defined(Z.xres))if(Y.number(Z.xres)&&Z.xres>0)this.options.tiffXres=Z.xres;else throw Y.invalidParameterError("xres","number greater than zero",Z.xres);if(Y.defined(Z.yres))if(Y.number(Z.yres)&&Z.yres>0)this.options.tiffYres=Z.yres;else throw Y.invalidParameterError("yres","number greater than zero",Z.yres);if(Y.defined(Z.compression))if(Y.string(Z.compression)&&Y.inArray(Z.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=Z.compression;else throw Y.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",Z.compression);if(Y.defined(Z.bigtiff))this._setBooleanOption("tiffBigtiff",Z.bigtiff);if(Y.defined(Z.predictor))if(Y.string(Z.predictor)&&Y.inArray(Z.predictor,["none","horizontal","float"]))this.options.tiffPredictor=Z.predictor;else throw Y.invalidParameterError("predictor","one of: none, horizontal, float",Z.predictor);if(Y.defined(Z.resolutionUnit))if(Y.string(Z.resolutionUnit)&&Y.inArray(Z.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=Z.resolutionUnit;else throw Y.invalidParameterError("resolutionUnit","one of: inch, cm",Z.resolutionUnit)}return this._updateFormatOut("tiff",Z)}function HK(Z){return this.heif({...Z,compression:"av1"})}function $K(Z){if(Y.object(Z)){if(Y.string(Z.compression)&&Y.inArray(Z.compression,["av1","hevc"]))this.options.heifCompression=Z.compression;else throw Y.invalidParameterError("compression","one of: av1, hevc",Z.compression);if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.heifQuality=Z.quality;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(Y.defined(Z.lossless))if(Y.bool(Z.lossless))this.options.heifLossless=Z.lossless;else throw Y.invalidParameterError("lossless","boolean",Z.lossless);if(Y.defined(Z.effort))if(Y.integer(Z.effort)&&Y.inRange(Z.effort,0,9))this.options.heifEffort=Z.effort;else throw Y.invalidParameterError("effort","integer between 0 and 9",Z.effort);if(Y.defined(Z.chromaSubsampling))if(Y.string(Z.chromaSubsampling)&&Y.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=Z.chromaSubsampling;else throw Y.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);if(Y.defined(Z.bitdepth))if(Y.integer(Z.bitdepth)&&Y.inArray(Z.bitdepth,[8,10,12]))this.options.heifBitdepth=Z.bitdepth;else throw Y.invalidParameterError("bitdepth","8, 10 or 12",Z.bitdepth);if(Y.defined(Z.tune))if(Y.string(Z.tune)&&Y.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 Y.invalidParameterError("tune","one of: auto, iq, psnr, ssim",Z.tune)}else throw Y.invalidParameterError("options","Object",Z);return this._updateFormatOut("heif",Z)}function FK(Z){if(Y.object(Z)){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.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 Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);else if(Y.defined(Z.distance))if(Y.number(Z.distance)&&Y.inRange(Z.distance,0,15))this.options.jxlDistance=Z.distance;else throw Y.invalidParameterError("distance","number between 0.0 and 15.0",Z.distance);if(Y.defined(Z.decodingTier))if(Y.integer(Z.decodingTier)&&Y.inRange(Z.decodingTier,0,4))this.options.jxlDecodingTier=Z.decodingTier;else throw Y.invalidParameterError("decodingTier","integer between 0 and 4",Z.decodingTier);if(Y.defined(Z.lossless))if(Y.bool(Z.lossless))this.options.jxlLossless=Z.lossless;else throw Y.invalidParameterError("lossless","boolean",Z.lossless);if(Y.defined(Z.effort))if(Y.integer(Z.effort)&&Y.inRange(Z.effort,1,9))this.options.jxlEffort=Z.effort;else throw Y.invalidParameterError("effort","integer between 1 and 9",Z.effort)}return s3(Z,this.options),this._updateFormatOut("jxl",Z)}function LK(Z){if(Y.object(Z)){if(Y.defined(Z.depth))if(Y.string(Z.depth)&&Y.inArray(Z.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=Z.depth;else throw Y.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",Z.depth)}return this._updateFormatOut("raw")}function AK(Z){if(Y.object(Z)){if(Y.defined(Z.size))if(Y.integer(Z.size)&&Y.inRange(Z.size,1,8192))this.options.tileSize=Z.size;else throw Y.invalidParameterError("size","integer between 1 and 8192",Z.size);if(Y.defined(Z.overlap))if(Y.integer(Z.overlap)&&Y.inRange(Z.overlap,0,8192)){if(Z.overlap>this.options.tileSize)throw Y.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,Z.overlap);this.options.tileOverlap=Z.overlap}else throw Y.invalidParameterError("overlap","integer between 0 and 8192",Z.overlap);if(Y.defined(Z.container))if(Y.string(Z.container)&&Y.inArray(Z.container,["fs","zip"]))this.options.tileContainer=Z.container;else throw Y.invalidParameterError("container","one of: fs, zip",Z.container);if(Y.defined(Z.layout))if(Y.string(Z.layout)&&Y.inArray(Z.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=Z.layout;else throw Y.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",Z.layout);if(Y.defined(Z.angle))if(Y.integer(Z.angle)&&!(Z.angle%90))this.options.tileAngle=Z.angle;else throw Y.invalidParameterError("angle","positive/negative multiple of 90",Z.angle);if(this._setBackgroundColourOption("tileBackground",Z.background),Y.defined(Z.depth))if(Y.string(Z.depth)&&Y.inArray(Z.depth,["onepixel","onetile","one"]))this.options.tileDepth=Z.depth;else throw Y.invalidParameterError("depth","one of: onepixel, onetile, one",Z.depth);if(Y.defined(Z.skipBlanks))if(Y.integer(Z.skipBlanks)&&Y.inRange(Z.skipBlanks,-1,65535))this.options.tileSkipBlanks=Z.skipBlanks;else throw Y.invalidParameterError("skipBlanks","integer between -1 and 255/65535",Z.skipBlanks);else if(Y.defined(Z.layout)&&Z.layout==="google")this.options.tileSkipBlanks=5;let W=Y.bool(Z.center)?Z.center:Z.centre;if(Y.defined(W))this._setBooleanOption("tileCentre",W);if(Y.defined(Z.id))if(Y.string(Z.id))this.options.tileId=Z.id;else throw Y.invalidParameterError("id","string",Z.id);if(Y.defined(Z.basename))if(Y.string(Z.basename))this.options.tileBasename=Z.basename;else throw Y.invalidParameterError("basename","string",Z.basename)}if(Y.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw Y.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function IK(Z){if(!Y.plainObject(Z))throw Y.invalidParameterError("options","object",Z);if(Y.integer(Z.seconds)&&Y.inRange(Z.seconds,0,3600))this.options.timeoutSeconds=Z.seconds;else throw Y.invalidParameterError("seconds","integer between 0 and 3600",Z.seconds);return this}function MK(Z,W){if(!(Y.object(W)&&W.force===!1))this.options.formatOut=Z;return this}function wK(Z,W){if(Y.bool(W))this.options[Z]=W;else throw Y.invalidParameterError(Z,"boolean",W)}function NK(){if(!this.options.streamOut){this.options.streamOut=!0;let Z=Error();this._pipeline(void 0,Z)}}function DK(Z,W){if(typeof Z==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z0.pipeline(this.options,(X,Q,J)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q,J)})});else Z0.pipeline(this.options,(X,Q,J)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q,J)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),Z0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",Y.nativeError(X,W));else this.emit("info",J),this.push(Q);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else Z0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",Y.nativeError(X,W));else this.emit("info",J),this.push(Q);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.once("finish",()=>{this._flattenBufferIn(),Z0.pipeline(this.options,(J,G,z)=>{if(J)Q(Y.nativeError(J,W));else if(this.options.resolveWithObject)X({data:G,info:z});else X(G)})})});else return new Promise((X,Q)=>{Z0.pipeline(this.options,(J,G,z)=>{if(J)Q(Y.nativeError(J,W));else if(this.options.resolveWithObject)X({data:G,info:z});else X(G)})})}var CW,lq,OW=()=>Error("JP2 output requires libvips with support for OpenJPEG"),xW=(Z)=>1<<31-Math.clz32(Math.ceil(Math.log2(Z))),kW=(Z)=>{Object.assign(Z.prototype,{toFile:pq,toBuffer:nq,toUint8Array:iq,withDensity:rq,keepExif:aq,withExif:sq,withExifMerge:oq,keepIccProfile:tq,withIccProfile:eq,keepGainMap:ZK,withGainMap:WK,keepXmp:XK,withXmp:QK,keepMetadata:JK,withMetadata:GK,toFormat:zK,jpeg:YK,jp2:VK,png:UK,webp:qK,tiff:BK,avif:HK,heif:$K,jxl:FK,gif:KK,raw:LK,tile:AK,timeout:IK,_updateFormatOut:MK,_setBooleanOption:wK,_read:NK,_pipeline:DK})};var SW=c(()=>{Q1();Q4();/*!
|
|
238
238
|
Copyright 2013 Lovell Fuller and others.
|
|
239
239
|
SPDX-License-Identifier: Apache-2.0
|
|
240
|
-
*/
|
|
240
|
+
*/CW=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"]]),lq=/\.(jp[2x]|j2[kc])$/i});import TK from"node:events";import{createRequire as RK}from"node:module";import{availableParallelism as PK}from"node:os";function vW(Z){if(Y.bool(Z))if(Z)return Z0.cache(50,20,100);else return Z0.cache(0,0,0);else if(Y.object(Z))return Z0.cache(Z.memory,Z.files,Z.items);else return Z0.cache()}function jK(Z){return Z0.concurrency(Y.integer(Z)?Z:null)}function CK(){return Z0.counters()}function OK(Z){return Z0.simd(Y.bool(Z)?Z:null)}function xK(Z){if(Y.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(Y.string))Z0.block(Z.operation,!0);else throw Y.invalidParameterError("operation","Array<string>",Z.operation);else throw Y.invalidParameterError("options","object",Z)}function kK(Z){if(Y.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(Y.string))Z0.block(Z.operation,!1);else throw Y.invalidParameterError("operation","Array<string>",Z.operation);else throw Y.invalidParameterError("options","object",Z)}var J4,o3,bW,t3,u1,_K,_6,EK,yW=(Z)=>{Z.cache=vW,Z.concurrency=jK,Z.counters=CK,Z.simd=OK,Z.format=u1,Z.interpolators=_K,Z.versions=_6,Z.queue=EK,Z.block=xK,Z.unblock=kK};var gW=c(()=>{Q1();f3();Q4();G2();J4=v6(p4(),1);/*!
|
|
241
241
|
Copyright 2013 Lovell Fuller and others.
|
|
242
242
|
SPDX-License-Identifier: Apache-2.0
|
|
243
|
-
*/o3=
|
|
243
|
+
*/o3=RK(import.meta.url),bW=z2.runtimePlatformArch(),t3=Z0.libvipsVersion(),u1=Z0.format();u1.heif.output.alias=["avif","heic"];u1.jpeg.output.alias=["jpe","jpg"];u1.tiff.output.alias=["tif"];u1.jp2.output.alias=["j2c","j2k","jp2","jpx"];_K={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},_6={vips:t3.semver};if(!t3.isGlobal)if(!t3.isWasm)try{_6=o3(`@img/sharp-${bW}/versions`)}catch(Z){try{_6=o3(`@img/sharp-libvips-${bW}/versions`)}catch(W){}}else try{_6=o3("@img/sharp-wasm32/versions")}catch(Z){}_6.sharp=P1.version;if(_6.heif&&u1.heif)u1.heif.input.fileSuffix=[".avif"],u1.heif.output.alias=["avif"];vW(!0);if(J4.default.familySync()===J4.default.GLIBC&&!Z0._isUsingJemalloc())Z0.concurrency(1);else if(J4.default.familySync()===J4.default.MUSL&&Z0.concurrency()===1024)Z0.concurrency(PK());EK=new TK.EventEmitter});var e3={};M4(e3,{default:()=>SK});var SK;var Z8=c(()=>{e7();XW();UW();KW();HW();_W();EW();SW();gW();/*!
|
|
244
244
|
Copyright 2013 Lovell Fuller and others.
|
|
245
245
|
SPDX-License-Identifier: Apache-2.0
|
|
246
|
-
*/WW(U1);YW(U1);qW(U1);$W(U1);jW(U1);CW(U1);bW(U1);hW(U1);vK=U1});import{createHash as mW}from"node:crypto";import{existsSync as yK,mkdirSync as gK,readFileSync as hK}from"node:fs";import{basename as fK,extname as mK,resolve as W8}from"node:path";import{createRequire as uK}from"node:module";async function uW(){if(j6)return j6;try{return j6=(await Promise.resolve().then(() => (Z8(),e3))).default,j6}catch{}try{return j6=uK(W8(process.cwd(),"package.json"))("sharp"),j6}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${N1(Z)}`,{cause:Z})}}async function X8(Z){let X=await(await uW())(Z).metadata();return{format:X.format??"unknown",height:X.height??0,width:X.width??0}}function G4(Z){let W=hK(Z);return mW("md5").update(W).digest("hex").slice(0,8)}function Q8(Z){let W=JSON.stringify({formats:Z.formats,quality:Z.quality,widths:Z.widths});return mW("md5").update(W).digest("hex").slice(0,8)}function cK(Z,W,X,Q){return`${Z}-${W}-${X}.${Q}`}async function dW(Z,W,X){let Q=await uW(),J=await X8(Z),G=G4(Z),z=fK(Z,mK(Z)),q=W8(W,"_optimized");gK(q,{recursive:!0});let K=[],V=X.widths.filter(($)=>$<=J.width);if(V.length===0||!V.includes(J.width))V.push(J.width);V.sort(($,L)=>$-L);let H=[];for(let $ of V)for(let L of X.formats){let A=cK(z,$,G,L),j=`/${dK}/${A}`,D=W8(q,A);if(K.push({absolutePath:D,format:L,outputPath:j,width:$}),yK(D))continue;let R=X.quality[L]??80,x=Q(Z).resize($).toFormat(L,{quality:R}).toFile(D).then(()=>{});H.push(x)}let B=4;for(let $=0;$<H.length;$+=B)await Promise.all(H.slice($,$+B));return{contentHash:G,original:{format:J.format,height:J.height,width:J.width},variants:K}}function J8(Z,W){return Z.filter((X)=>X.format===W).map((X)=>`${X.outputPath} ${X.width}w`).join(", ")}var j6=null,dK="images/_optimized";var G8=d(()=>{D1()});import{existsSync as lK,mkdirSync as pK,readFileSync as nK,writeFileSync as iK}from"node:fs";import{basename as rK,resolve as V2}from"node:path";import{execSync as aK}from"node:child_process";import{tmpdir as sK}from"node:os";function E6(Z){if(z4===void 0)try{let W=aK("npm config get cache",{cwd:sK(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();z4=W&&W!=="undefined"?W:null}catch{z4=null}if(z4)return V2(z4,"jxsuite-images",rK(Z));return V2(Z,".cache/images")}function cW(Z){let W=V2(E6(Z),"manifest.json");if(!lK(W))return{entries:{},version:1};try{return JSON.parse(nK(W,"utf8"))}catch{return{entries:{},version:1}}}function lW(Z,W){let X=E6(Z);pK(X,{recursive:!0}),iK(V2(X,"manifest.json"),JSON.stringify(W,null,2),"utf8")}function pW(Z,W){let X=Z.entries[W];if(!X)return null;return X.manifest}function nW(Z,W,X,Q){Z.entries[W]={manifest:Q,source:X,timestamp:Date.now()}}var z4;var z8=d(()=>{G8()});import{existsSync as Y8}from"node:fs";import{basename as oK,extname as aW,resolve as iW}from"node:path";async function oW(Z,W){let X=W.get(Z);if(!X){let Q=G4(Z);try{let J=await X8(Z);X={width:J.width,height:J.height,hash:Q}}catch(J){if(!rW)rW=!0,console.warn(`Could not read image dimensions (${J.message}) — `+"emitting srcsets without width/height attributes.");X={width:null,height:null,hash:Q}}W.set(Z,X)}return X}function B2(Z,W,X,Q){let J=W.quality?.webp??80,G=Z.startsWith("/")?"":"/",z=Q?`?v=${Q}`:"";return W.widths.filter((q)=>q<=X).toSorted((q,K)=>q-K).map((q)=>`/cdn-cgi/image/width=${q},quality=${J},fit=scale-down,format=auto${G}${Z}${z} ${q}w`).join(", ")}async function tW(Z,W,X,Q,J){let G=`${G4(Z)}:${Q8(X)}`,z=pW(J,G);if(z){if(z.variants.every((V)=>Y8(V.absolutePath)))return z}if(!z)console.log(` Optimizing ${oK(Z)}...`);let q=await dW(Z,E6(Q),X);return nW(J,G,W,q),q}function eW(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(tK.some((W)=>Z.startsWith(W)))return!0;if(sW.has(aW(Z).toLowerCase()))return!0;return!1}function ZX(Z,W){if(W.service!=="cloudflare")return!1;if(!W.remoteDomains?.length)return!1;if(typeof Z!=="string"||!Z.startsWith("https://"))return!1;if(Z.includes("${"))return!1;try{let X=new URL(Z);if(sW.has(aW(X.pathname).toLowerCase()))return!1;return W.remoteDomains.includes(X.hostname)}catch{return!1}}function WX(Z,W){if(Z.startsWith("/"))return iW(W,"public",Z.slice(1));return iW(W,Z)}async function XX(Z,W,X,Q,J){let G=new Map;if(!W.optimize)return{imageRefs:G};return await QX(Z,W,X,Q,J??new Map,G),{imageRefs:G}}async function QX(Z,W,X,Q,J,G){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await eK(Z,W,X,Q,J,G);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await JV(Z.innerHTML,W,X,Q,J,G);if(Array.isArray(Z.children))for(let z of Z.children){if(typeof z==="string")continue;await QX(z,W,X,Q,J,G)}}async function eK(Z,W,X,Q,J,G){if(!Z.attributes)Z.attributes={};let z=Z.attributes.src??Z.src;if(typeof z!=="string")return;let q=ZX(z,W);if(!q&&eW(z))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let K;if(q)K=B2(z,W,1/0,null);else{let V=WX(z,X);if(!Y8(V))return;if(W.service==="cloudflare"){let H=await oW(V,J);K=B2(z,W,H.width??1/0,H.hash)}else{let H=G.get(V);if(!H)H=await tW(V,z,W,X,Q),G.set(V,H);let B=W.formats.includes("avif")?"avif":W.formats[0];K=J8(H.variants,B)}}if(K)Z.attributes.srcset=K,Z.attributes.sizes??=W.sizes;if(W.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function JV(Z,W,X,Q,J,G){let z=[];for(let K of Z.matchAll(ZV)){let V=K[0],H=K[1];if(XV.test(H))continue;if(QV.test(H))continue;let B=H.match(WV);if(!B)continue;let $=B[1].replaceAll("&","&"),L=ZX($,W);if(!L&&eW($))continue;let A=L?null:WX($,X);if(A&&!Y8(A))continue;let j;if(L)j=B2($,W,1/0,null);else if(W.service==="cloudflare"){let R=await oW(A,J);j=B2($,W,R.width??1/0,R.hash)}else{let R=G.get(A);if(!R)R=await tW(A,$,W,X,Q),G.set(A,R);let x=W.formats.includes("avif")?"avif":W.formats[0];j=J8(R.variants,x)}if(!j)continue;let D=` srcset="${j}" sizes="${W.sizes}"`;if(W.lazyLoad&&!/\bloading="eager"/.test(H)){if(!/\bloading=/.test(H))D+=' loading="lazy"';if(!/\bdecoding=/.test(H))D+=' decoding="async"'}z.push({match:V,replacement:`<img${H}${D}>`})}let q=Z;for(let{match:K,replacement:V}of z)q=q.replace(K,V);return q}var sW,tK,rW=!1,ZV,WV,XV,QV;var JX=d(()=>{G8();z8();sW=new Set([".svg",".gif"]),tK=["http://","https://","data:","//"];ZV=/<img\b([^>]*)>/gi,WV=/\bsrc="([^"]*)"/,XV=/\bsrcset="/,QV=/\bdata-no-optimize\b/});var qX={};w4(qX,{buildSite:()=>UV});import{copyFileSync as GV,cpSync as U8,existsSync as C6,mkdirSync as u1,readdirSync as zV,rmSync as YV,writeFileSync as K1}from"node:fs";import{dirname as O6,join as $2,resolve as N0}from"node:path";async function UV(Z,W={}){let{clean:X=!0,verbose:Q=!1}=W,J=[],G=Q?console.log.bind(console):()=>{};G("Loading project.json...");let{config:z}=U5(Z),q=N0(Z,z.build.outDir),K=N0(Z,"pages"),V=N0(Z,"public"),H=z.build.trailingSlash??"always",B=await p6(Z,z);if(B.entries.length>0)G(` Registered ${B.entries.length} format(s): ${B.entries.map((c)=>c.name).join(", ")}`);if(X&&C6(q))YV(q,{force:!0,recursive:!0});if(u1(q,{recursive:!0}),!C6(K))throw Error(`pages/ directory not found in ${Z}`);G("Discovering pages...");let $=await V5(K,B);G(` Found ${$.length} page(s)`),G("Loading content types...");let L=await T5(Z,z,B);if(L.size>0){G(` Loaded ${L.size} content type(s): ${[...L.keys()].join(", ")}`);let c=L3(Z,z);if(c)R5(L,c.config)}let A=await H5($,Z,L,B);G(` ${A.length} route(s) after expansion`);let j=0,D=N0(Z,"components"),R=[],x=new Map,f=new Map;if(C6(D)){G("Compiling components...");let c=[".json",...B.documentExtensions("component")],o=zV(D).filter((X0)=>c.some((Q0)=>X0.endsWith(Q0))),W0=N0(q,"components");u1(W0,{recursive:!0});for(let X0 of o)try{let Q0=N0(D,X0),U0=await u4(Q0,{...z.$media?{$media:z.$media}:{},formats:B});for(let $0 of U0.files){let K0=$0.path.includes("/")?$0.path.split("/").pop():$0.path;if(K1(N0(W0,K0),$0.content,"utf8"),$0.tagName)R.push($0.tagName);j+=1}let J0=await r6(Q0,B);if(J0.tagName){f.set(J0.tagName,J0);let $0=P8(J0.tagName,J0.style,J0,z.$media??{});if($0)x.set(J0.tagName,$0),K1(N0(W0,`${J0.tagName}.css`),$0,"utf8"),j+=1}}catch(Q0){let U0=Q0;J.push(`Error compiling component ${X0}: ${U0.message}`),console.error(`Error compiling component ${X0}: ${U0.message}`)}G(` Compiled ${R.length} component(s): ${R.join(", ")}`)}let p=[];if(z.build.adapter)for(let[,c]of f){let o=P4(c);for(let W0 of o){let X0=`./components/${W0.src.replace(/^\.\//,"")}`;p.push({exportName:W0.exportName,src:X0})}}let r=z.images.optimize&&z.images.service==="cloudflare",m=z.images.optimize&&!r?cW(Z):null,S=r?new Map:null;if(r)console.log('images.service is "cloudflare" — srcsets use /cdn-cgi/image transform URLs. '+"Ensure Image Transformations are enabled for your zone (Cloudflare dashboard → "+"Images → Transformations); these URLs do not work on *.pages.dev / *.workers.dev previews.");for(let c of A)try{G(` Compiling ${c.urlPattern} ...`);let o=await qV(c,z,Z,L,m,f,S,B),W0=new Set;for(let[Q0,U0]of f)if(x2(U0))W0.add(Q0);if(R.length>0)o.html=BV(o.html,R,x,W0);let X0=UX(c.urlPattern,q,H);u1(O6(X0),{recursive:!0}),K1(X0,o.html,"utf8"),j+=1;for(let Q0 of B.withCapability("serialize")){if(!Q0.exportTarget)continue;try{let U0=await Q0.call("serialize",o.doc,{buildScope:(J0)=>q6(J0,null),componentDefs:f,evaluateTemplate:(J0,$0)=>{if(!s(J0))return;return E0(J0,$0)??J0},mode:"export"});if(U0){let J0=X0.replace(/\.html$/,Q0.extensions[0]);K1(J0,U0,"utf8"),j+=1}}catch(U0){let J0=U0;J.push(`Error exporting ${Q0.name} for ${c.urlPattern}: ${J0.message}`)}}for(let Q0 of o.files){let U0=N0(O6(X0),Q0.path);u1(O6(U0),{recursive:!0}),K1(U0,Q0.content,"utf8"),j+=1}if(o.serverHandler){let Q0=N0(O6(X0),"_server.js");K1(Q0,o.serverHandler,"utf8"),j+=1}}catch(o){let W0=o,X0=`Error compiling ${c.urlPattern}: ${W0.message}`;J.push(X0),console.error(X0)}if(m&&z.images.optimize){lW(Z,m);let c=N0(E6(Z),"_optimized");if(C6(c)){let W0=N0(q,"images/_optimized");u1(W0,{recursive:!0}),U8(c,W0,{recursive:!0})}let o=Object.keys(m.entries).length;if(o>0)G(` Optimized ${o} image(s)`)}if(z.build.adapter){let{adapter:c}=z.build;G("Generating site-wide server worker...");let o=new Map;for(let Q0 of p)if(!o.has(Q0.exportName))o.set(Q0.exportName,Q0);let X0=c==="cloudflare-pages"&&o.size===0?null:e2([...o.values()],{adapter:c});if(X0){let Q0=c==="cloudflare-pages"?"_worker.js":"worker.js";if(K1(N0(q,Q0),X0,"utf8"),j+=1,G(` Generated dist/${Q0} (${o.size} server function(s))`),c==="cloudflare-pages")K1(N0(q,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
|
|
247
|
-
`,"utf8"),j+=1;let U0=N0(q,"components");
|
|
248
|
-
Build complete: ${A.length} routes, ${j} files`),J.length>0)G(` ${J.length} error(s)`);return{errors:J,files:j,routes:A.length}}async function
|
|
246
|
+
*/WW(U1);YW(U1);qW(U1);BW(U1);PW(U1);jW(U1);kW(U1);yW(U1);SK=U1});import{createHash as hW}from"node:crypto";import{existsSync as bK,mkdirSync as vK,readFileSync as yK}from"node:fs";import{basename as gK,extname as hK,resolve as W8}from"node:path";import{createRequire as fK}from"node:module";async function fW(){if(j6)return j6;try{return j6=(await Promise.resolve().then(() => (Z8(),e3))).default,j6}catch{}try{return j6=fK(W8(process.cwd(),"package.json"))("sharp"),j6}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${N1(Z)}`,{cause:Z})}}async function X8(Z){let X=await(await fW())(Z).metadata();return{format:X.format??"unknown",height:X.height??0,width:X.width??0}}function G4(Z){let W=yK(Z);return hW("md5").update(W).digest("hex").slice(0,8)}function Q8(Z){let W=JSON.stringify({formats:Z.formats,quality:Z.quality,widths:Z.widths});return hW("md5").update(W).digest("hex").slice(0,8)}function uK(Z,W,X,Q){return`${Z}-${W}-${X}.${Q}`}async function mW(Z,W,X){let Q=await fW(),J=await X8(Z),G=G4(Z),z=gK(Z,hK(Z)),q=W8(W,"_optimized");vK(q,{recursive:!0});let K=[],V=X.widths.filter(($)=>$<=J.width);if(V.length===0||!V.includes(J.width))V.push(J.width);V.sort(($,L)=>$-L);let H=[];for(let $ of V)for(let L of X.formats){let A=uK(z,$,G,L),j=`/${mK}/${A}`,D=W8(q,A);if(K.push({absolutePath:D,format:L,outputPath:j,width:$}),bK(D))continue;let R=X.quality[L]??80,x=Q(Z).resize($).toFormat(L,{quality:R}).toFile(D).then(()=>{});H.push(x)}let B=4;for(let $=0;$<H.length;$+=B)await Promise.all(H.slice($,$+B));return{contentHash:G,original:{format:J.format,height:J.height,width:J.width},variants:K}}function J8(Z,W){return Z.filter((X)=>X.format===W).map((X)=>`${X.outputPath} ${X.width}w`).join(", ")}var j6=null,mK="images/_optimized";var G8=c(()=>{D1()});import{existsSync as dK,mkdirSync as cK,readFileSync as lK,writeFileSync as pK}from"node:fs";import{basename as nK,resolve as K2}from"node:path";import{execSync as iK}from"node:child_process";import{tmpdir as rK}from"node:os";function E6(Z){if(z4===void 0)try{let W=iK("npm config get cache",{cwd:rK(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();z4=W&&W!=="undefined"?W:null}catch{z4=null}if(z4)return K2(z4,"jxsuite-images",nK(Z));return K2(Z,".cache/images")}function uW(Z){let W=K2(E6(Z),"manifest.json");if(!dK(W))return{entries:{},version:1};try{return JSON.parse(lK(W,"utf8"))}catch{return{entries:{},version:1}}}function dW(Z,W){let X=E6(Z);cK(X,{recursive:!0}),pK(K2(X,"manifest.json"),JSON.stringify(W,null,2),"utf8")}function cW(Z,W){let X=Z.entries[W];if(!X)return null;return X.manifest}function lW(Z,W,X,Q){Z.entries[W]={manifest:Q,source:X,timestamp:Date.now()}}var z4;var z8=c(()=>{G8()});import{existsSync as Y8}from"node:fs";import{basename as aK,extname as iW,resolve as pW}from"node:path";async function aW(Z,W){let X=W.get(Z);if(!X){let Q=G4(Z);try{let J=await X8(Z);X={width:J.width,height:J.height,hash:Q}}catch(J){if(!nW)nW=!0,console.warn(`Could not read image dimensions (${J.message}) — `+"emitting srcsets without width/height attributes.");X={width:null,height:null,hash:Q}}W.set(Z,X)}return X}function V2(Z,W,X,Q){let J=W.quality?.webp??80,G=Z.startsWith("/")?"":"/",z=Q?`?v=${Q}`:"";return W.widths.filter((q)=>q<=X).toSorted((q,K)=>q-K).map((q)=>`/cdn-cgi/image/width=${q},quality=${J},fit=scale-down,format=auto${G}${Z}${z} ${q}w`).join(", ")}async function sW(Z,W,X,Q,J){let G=`${G4(Z)}:${Q8(X)}`,z=cW(J,G);if(z){if(z.variants.every((V)=>Y8(V.absolutePath)))return z}if(!z)console.log(` Optimizing ${aK(Z)}...`);let q=await mW(Z,E6(Q),X);return lW(J,G,W,q),q}function oW(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(sK.some((W)=>Z.startsWith(W)))return!0;if(rW.has(iW(Z).toLowerCase()))return!0;return!1}function tW(Z,W){if(W.service!=="cloudflare")return!1;if(!W.remoteDomains?.length)return!1;if(typeof Z!=="string"||!Z.startsWith("https://"))return!1;if(Z.includes("${"))return!1;try{let X=new URL(Z);if(rW.has(iW(X.pathname).toLowerCase()))return!1;return W.remoteDomains.includes(X.hostname)}catch{return!1}}function eW(Z,W){if(Z.startsWith("/"))return pW(W,"public",Z.slice(1));return pW(W,Z)}async function ZX(Z,W,X,Q,J){let G=new Map;if(!W.optimize)return{imageRefs:G};return await WX(Z,W,X,Q,J??new Map,G),{imageRefs:G}}async function WX(Z,W,X,Q,J,G){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await oK(Z,W,X,Q,J,G);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await XV(Z.innerHTML,W,X,Q,J,G);if(Array.isArray(Z.children))for(let z of Z.children){if(typeof z==="string")continue;await WX(z,W,X,Q,J,G)}}async function oK(Z,W,X,Q,J,G){if(!Z.attributes)Z.attributes={};let z=Z.attributes.src??Z.src;if(typeof z!=="string")return;let q=tW(z,W);if(!q&&oW(z))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let K;if(q)K=V2(z,W,1/0,null);else{let V=eW(z,X);if(!Y8(V))return;if(W.service==="cloudflare"){let H=await aW(V,J);K=V2(z,W,H.width??1/0,H.hash)}else{let H=G.get(V);if(!H)H=await sW(V,z,W,X,Q),G.set(V,H);let B=W.formats.includes("avif")?"avif":W.formats[0];K=J8(H.variants,B)}}if(K)Z.attributes.srcset=K,Z.attributes.sizes??=W.sizes;if(W.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function XV(Z,W,X,Q,J,G){let z=[];for(let K of Z.matchAll(tK)){let V=K[0],H=K[1];if(ZV.test(H))continue;if(WV.test(H))continue;let B=H.match(eK);if(!B)continue;let $=B[1].replaceAll("&","&"),L=tW($,W);if(!L&&oW($))continue;let A=L?null:eW($,X);if(A&&!Y8(A))continue;let j;if(L)j=V2($,W,1/0,null);else if(W.service==="cloudflare"){let R=await aW(A,J);j=V2($,W,R.width??1/0,R.hash)}else{let R=G.get(A);if(!R)R=await sW(A,$,W,X,Q),G.set(A,R);let x=W.formats.includes("avif")?"avif":W.formats[0];j=J8(R.variants,x)}if(!j)continue;let D=` srcset="${j}" sizes="${W.sizes}"`;if(W.lazyLoad&&!/\bloading="eager"/.test(H)){if(!/\bloading=/.test(H))D+=' loading="lazy"';if(!/\bdecoding=/.test(H))D+=' decoding="async"'}z.push({match:V,replacement:`<img${H}${D}>`})}let q=Z;for(let{match:K,replacement:V}of z)q=q.replace(K,V);return q}var rW,sK,nW=!1,tK,eK,ZV,WV;var XX=c(()=>{G8();z8();rW=new Set([".svg",".gif"]),sK=["http://","https://","data:","//"];tK=/<img\b([^>]*)>/gi,eK=/\bsrc="([^"]*)"/,ZV=/\bsrcset="/,WV=/\bdata-no-optimize\b/});var YX={};M4(YX,{buildSite:()=>YV});import{copyFileSync as QV,cpSync as U8,existsSync as C6,mkdirSync as d1,readdirSync as JV,rmSync as GV,writeFileSync as K1}from"node:fs";import{basename as zV,dirname as O6,join as H2,resolve as N0}from"node:path";async function YV(Z,W={}){let{clean:X=!0,verbose:Q=!1}=W,J=[],G=Q?console.log.bind(console):()=>{};G("Loading project.json...");let{config:z}=U9(Z),q=N0(Z,z.build.outDir),K=N0(Z,"pages"),V=N0(Z,"public"),H=z.build.trailingSlash??"always",B=await p6(Z,z);if(B.entries.length>0)G(` Registered ${B.entries.length} format(s): ${B.entries.map((l)=>l.name).join(", ")}`);if(X&&C6(q))GV(q,{force:!0,recursive:!0});if(d1(q,{recursive:!0}),!C6(K))throw Error(`pages/ directory not found in ${Z}`);G("Discovering pages...");let $=await V9(K,B);G(` Found ${$.length} page(s)`),G("Loading content types...");let L=await T9(Z,z,B);if(L.size>0){G(` Loaded ${L.size} content type(s): ${[...L.keys()].join(", ")}`);let l=L3(Z,z);if(l)R9(L,l.config)}let A=await H9($,Z,L,B);G(` ${A.length} route(s) after expansion`);let j=0,D=N0(Z,"components"),R=[],x=new Map,d=new Map;if(C6(D)){G("Compiling components...");let l=[".json",...B.documentExtensions("component")],o=JV(D).filter((X0)=>l.some((Q0)=>X0.endsWith(Q0))),W0=N0(q,"components");d1(W0,{recursive:!0});for(let X0 of o)try{let Q0=N0(D,X0),U0=await m4(Q0,{...z.$media?{$media:z.$media}:{},formats:B});for(let L0 of U0.files){let K0=zV(L0.path);if(K1(N0(W0,K0),L0.content,"utf8"),L0.tagName)R.push(L0.tagName);j+=1}let J0=await r6(Q0,B);if(J0.tagName){d.set(J0.tagName,J0);let L0=P8(J0.tagName,J0.style,J0,z.$media??{});if(L0)x.set(J0.tagName,L0),K1(N0(W0,`${J0.tagName}.css`),L0,"utf8"),j+=1}}catch(Q0){let U0=Q0;J.push(`Error compiling component ${X0}: ${U0.message}`),console.error(`Error compiling component ${X0}: ${U0.message}`)}G(` Compiled ${R.length} component(s): ${R.join(", ")}`)}let m=[];if(z.build.adapter)for(let[,l]of d){let o=R4(l);for(let W0 of o){let X0=`./components/${W0.src.replace(/^\.\//,"")}`;m.push({exportName:W0.exportName,src:X0})}}let r=z.images.optimize&&z.images.service==="cloudflare",f=z.images.optimize&&!r?uW(Z):null,S=r?new Map:null;if(r)console.log('images.service is "cloudflare" — srcsets use /cdn-cgi/image transform URLs. '+"Ensure Image Transformations are enabled for your zone (Cloudflare dashboard → "+"Images → Transformations); these URLs do not work on *.pages.dev / *.workers.dev previews.");for(let l of A)try{G(` Compiling ${l.urlPattern} ...`);let o=await UV(l,z,Z,L,f,d,S,B),W0=new Set;for(let[Q0,U0]of d)if(x2(U0))W0.add(Q0);if(R.length>0)o.html=VV(o.html,R,x,W0);let X0=zX(l.urlPattern,q,H);d1(O6(X0),{recursive:!0}),K1(X0,o.html,"utf8"),j+=1;for(let Q0 of B.withCapability("serialize")){if(!Q0.exportTarget)continue;try{let U0=await Q0.call("serialize",o.doc,{buildScope:(J0)=>q6(J0,null),componentDefs:d,evaluateTemplate:(J0,L0)=>{if(!s(J0))return;return E0(J0,L0)??J0},mode:"export"});if(U0){let J0=X0.replace(/\.html$/,Q0.extensions[0]);K1(J0,U0,"utf8"),j+=1}}catch(U0){let J0=U0;J.push(`Error exporting ${Q0.name} for ${l.urlPattern}: ${J0.message}`)}}for(let Q0 of o.files){let U0=N0(O6(X0),Q0.path);d1(O6(U0),{recursive:!0}),K1(U0,Q0.content,"utf8"),j+=1}if(o.serverHandler){let Q0=N0(O6(X0),"_server.js");K1(Q0,o.serverHandler,"utf8"),j+=1}}catch(o){let W0=o,X0=`Error compiling ${l.urlPattern}: ${W0.message}`;J.push(X0),console.error(X0)}if(f&&z.images.optimize){dW(Z,f);let l=N0(E6(Z),"_optimized");if(C6(l)){let W0=N0(q,"images/_optimized");d1(W0,{recursive:!0}),U8(l,W0,{recursive:!0})}let o=Object.keys(f.entries).length;if(o>0)G(` Optimized ${o} image(s)`)}if(z.build.adapter){let{adapter:l}=z.build;G("Generating site-wide server worker...");let o=new Map;for(let Q0 of m)if(!o.has(Q0.exportName))o.set(Q0.exportName,Q0);let X0=l==="cloudflare-pages"&&o.size===0?null:e2([...o.values()],{adapter:l});if(X0){let Q0=l==="cloudflare-pages"?"_worker.js":"worker.js";if(K1(N0(q,Q0),X0,"utf8"),j+=1,G(` Generated dist/${Q0} (${o.size} server function(s))`),l==="cloudflare-pages")K1(N0(q,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
|
|
247
|
+
`,"utf8"),j+=1;let U0=N0(q,"components");d1(U0,{recursive:!0});for(let{src:J0}of o.values()){let L0=N0(Z,J0.replace(/^\.\//,"")),K0=N0(U0,J0.replace(/^\.\/components\//,""));if(C6(L0))QV(L0,K0)}}}if(z.redirects&&Object.keys(z.redirects).length>0){G("Generating redirects...");let l=$V(z.redirects,q);j+=l}if(C6(V))G("Copying public/ assets..."),U8(V,q,{recursive:!0});if(z.copy){G("Copying mapped files...");for(let[l,o]of Object.entries(z.copy)){let W0=N0(Z,l),X0=N0(q,o);d1(O6(X0),{recursive:!0}),U8(W0,X0)}}if(G(`
|
|
248
|
+
Build complete: ${A.length} routes, ${j} files`),J.length>0)G(` ${J.length} error(s)`);return{errors:J,files:j,routes:A.length}}async function UV(Z,W,X,Q=new Map,J=null,G=new Map,z=null,q){let K=await r6(Z.sourcePath,q),V=H3(K,W,X),H=K.$head??V._pageHead??[],B=V.$head??[],$=K.title??V._pageTitle??null;delete V._pageHead,delete V._pageTitle,M9(V,W,Z,Q,X),await _9(V,Z,X,{config:W,contentTypes:Q});let L=q6(V.state??{}),A=$??W.name??"Jx Site";if(typeof A==="string"&&s(A))A=E0(A,L)??A;let j=QX(H,L),D=QX(B,L);Y4(V,L);let R={counter:{n:0},media:{...W.$media,...V.$media},rules:[]};if(K8(V,G,R),V.state)for(let[S,l]of Object.entries(V.state)){if(S==="$site"||S==="$page")continue;if(l&&typeof l==="object"&&!Array.isArray(l)&&l.timing==="compiler")delete V.state[S];else if(Array.isArray(l))delete V.state[S]}let x=qV(W.$head??[]),d=A9(x,D,j,{title:A,charset:W.defaults?.charset??"utf8",...W.name!=null&&{siteName:W.name},...W.url!=null&&{siteUrl:W.url},pageUrl:Z.urlPattern});if(W.$media)V.$media={...W.$media,...V.$media};if(W.images?.optimize&&(J||z))await ZX(V,W.images,X,J,z??void 0);let m=await V3(V,{lang:W.defaults?.lang??"en",projectStyle:W.style??null,title:A});if(R.rules.length>0)m.html=m.html.replace("</head>",`<style>
|
|
249
249
|
${R.rules.join(`
|
|
250
250
|
`)}
|
|
251
251
|
</style>
|
|
252
|
-
</head>`);
|
|
253
|
-
`):null,G=R8(Q,Z.$props||null,J),z=x2(Q);if(Z.innerHTML=G,delete Z.children,Q.style&&Z.$props){let q={...Q.state};for(let[H,B]of Object.entries(Z.$props))q[H]=H in q?B:B;let K=q6(q,null),V={};for(let[H,B]of Object.entries(Q.style))if(typeof B==="string"&&s(B)){let
|
|
252
|
+
</head>`);m.html=HV(m.html,d,W.defaults?.lang??"en");let r=(V.$elements??[]).filter((S)=>typeof S==="string"&&!S.startsWith("./")&&!S.startsWith("../"));if(r.length>0)m.html=BV(m.html,r);let f=null;if(!W.build?.adapter)try{let S=await l6(Z.sourcePath);if(S)f=S}catch{}return{doc:V,files:m.files,html:m.html,serverHandler:f}}function QX(Z,W){return Z.map((X)=>{if(!X||typeof X!=="object")return X;let Q={...X};if(Q.attributes){Q.attributes={...Q.attributes};for(let[J,G]of Object.entries(Q.attributes))if(typeof G==="string"&&s(G))Q.attributes[J]=E0(G,W)??G}if(typeof Q.textContent==="string"&&s(Q.textContent))Q.textContent=E0(Q.textContent,W)??Q.textContent;return Q})}function qV(Z){return Z.map((W)=>{if(!W||typeof W!=="object"||!W.attributes)return W;let X={...W,attributes:{...W.attributes}};for(let Q of["href","src"]){let J=X.attributes[Q];if(typeof J==="string"&&KV(J))X.attributes[Q]=`/node_modules/${J}`}return X})}function KV(Z){return!Z.startsWith("/")&&!Z.startsWith("./")&&!Z.startsWith("../")&&!Z.startsWith("http")&&!Z.startsWith("data:")}function GX(Z,W){if(!Z||typeof Z!=="object")return Z;let X={};for(let[Q,J]of Object.entries(Z))if(Q==="children"&&Array.isArray(J))X.children=J.map((G)=>{if(typeof G==="string")return G;return GX(G,W)});else if(Q==="style"&&J&&typeof J==="object"){let G={...J};for(let[z,q]of Object.entries(G))if(s(q))G[z]=B2(q,W)??q;X.style=G}else if(Q==="attributes"&&J&&typeof J==="object"){let G={...J};for(let[z,q]of Object.entries(G))if(s(q))G[z]=B2(q,W)??q;X.attributes=G}else if(Q==="$props"&&J&&typeof J==="object"){let G={...J};for(let[z,q]of Object.entries(G))if(s(q)){let K=B2(q,W);G[z]=K!==null?K??null:q}X.$props=G}else if(typeof J==="string"&&s(J))X[Q]=B2(J,W)??J;else X[Q]=J;return X}function B2(Z,W){try{let X=W.$map?.item,Q=W.$map?.index,J=Z.match(/^\$\{(.+)\}$/s);if(J)return Function("state","$map","item","index",`return (${J[1]})`)(W,W.$map,X,Q);return Function("state","$map","item","index",`return \`${Z}\``)(W,W.$map,X,Q)}catch{return null}}function Y4(Z,W){if(!Z||typeof Z!=="object")return;if(typeof Z.innerHTML==="string"&&s(Z.innerHTML)){let Q=E0(Z.innerHTML,W);if(Q!=null)Z.innerHTML=String(Q).replaceAll("${","${")}if(typeof Z.textContent==="string"&&s(Z.textContent))Z.textContent=E0(Z.textContent,W)??Z.textContent;if(Z.style&&typeof Z.style==="object"){for(let[Q,J]of Object.entries(Z.style))if(typeof J==="string"&&s(J))Z.style[Q]=E0(J,W)??J}if(Z.attributes&&typeof Z.attributes==="object"){for(let[Q,J]of Object.entries(Z.attributes))if(typeof J==="string"&&s(J))Z.attributes[Q]=E0(J,W)??J}if(Z.$props&&typeof Z.$props==="object"){for(let[Q,J]of Object.entries(Z.$props))if(typeof J==="string"&&s(J))Z.$props[Q]=E0(J,W)??J}let X=Z.children;if(R0(X)){let Q=JX(X,W);if(Q){Z.children=Q;return}}if(typeof X==="string"&&s(X)){let Q=E0(X,W);if(Array.isArray(Q)){let J=Q;Z.children=J;for(let G of J)Y4(G,W)}}else if(Array.isArray(Z.children)){let Q=0;while(Q<Z.children.length){let J=Z.children[Q];if(typeof J==="string"&&s(J)){let G=E0(J,W);if(Array.isArray(G)){let z=G;Z.children.splice(Q,1,...z);for(let q of z)Y4(q,W);Q+=z.length;continue}}if(R0(J)){let G=JX(J,W);if(G){Z.children.splice(Q,1,...G),Q+=G.length;continue}}Y4(J,W),Q+=1}}}function JX(Z,W){let X=Z.items,Q=null;if(h0(X))Q=C2(X.$ref,W);else if(Array.isArray(X))Q=X;let J=Z.map;if(!Array.isArray(Q)||!J)return null;return Q.map((G,z)=>{let q=Object.create(W);q.$map={index:z,item:G},q["$map/item"]=G,q["$map/index"]=z;let K=GX(J,q);return Y4(K,q),K})}function K8(Z,W,X){if(!Z||typeof Z!=="object")return;if(Array.isArray(Z)){for(let J of Z)K8(J,W,X);return}if(Array.isArray(Z.children))for(let J of Z.children)K8(J,W,X);let Q=W.get(Z.tagName);if(Q){let J=Array.isArray(Z.children)&&Z.children.length>0?Z.children.map((q)=>{if(X&&q&&typeof q==="object")k1(q,X.rules,X.media,"",X.counter,"jxs");return J6(q,{},null)}).join(`
|
|
253
|
+
`):null,G=R8(Q,Z.$props||null,J),z=x2(Q);if(Z.innerHTML=G,delete Z.children,Q.style&&Z.$props){let q={...Q.state};for(let[H,B]of Object.entries(Z.$props))q[H]=H in q?B:B;let K=q6(q,null),V={};for(let[H,B]of Object.entries(Q.style))if(typeof B==="string"&&s(B)){let $=$0(B,K);if($!=null)V[H]=$}if(Object.keys(V).length>0)Z.style={...Z.style,...V}}if(delete Z.$props,z)Z.$static=!0;else Z.$prerendered=!0}}function VV(Z,W,X=new Map,Q=new Set){let J=W.filter(($)=>Z.includes(`<${$}`));if(J.length===0)return Z;let G=J.filter(($)=>X.has($)).map(($)=>`<link rel="stylesheet" href="/components/${$}.css">`).join(`
|
|
254
254
|
`),z=Z;if(G)z=z.replace("</head>",` ${G}
|
|
255
255
|
</head>`);let q=J.filter(($)=>!Q.has($));if(q.length===0)return z;let K=`<script type="importmap">
|
|
256
256
|
{
|
|
@@ -262,15 +262,15 @@ ${R.rules.join(`
|
|
|
262
262
|
</script>`,V=q.map(($)=>`<script type="module" src="/components/${$}.js"></script>`).join(`
|
|
263
263
|
`),B=(z.includes('<script type="importmap">')?"":`${K}
|
|
264
264
|
`)+V;return z.replace("</body>",` ${B}
|
|
265
|
-
</body>`)}function
|
|
265
|
+
</body>`)}function BV(Z,W){let X=W.map((Q)=>`<script type="module" src="/node_modules/${Q}"></script>`).join(`
|
|
266
266
|
`);return Z.replace("</body>",` ${X}
|
|
267
|
-
</body>`)}function
|
|
267
|
+
</body>`)}function HV(Z,W,X){let Q=I9(W),J=/<head>([\s\S]*?)<\/head>/i,G=Z.match(J),z="";if(G){let K=G[1].match(/<style>[\s\S]*?<\/style>/gi);if(K)z+=`
|
|
268
268
|
${K.join(`
|
|
269
269
|
`)}`;let V=G[1].match(/<script[\s\S]*?<\/script>/gi);if(V)z+=`
|
|
270
270
|
${V.join(`
|
|
271
271
|
`)}`}let q=Z;if(J.test(q))q=q.replace(J,`<head>
|
|
272
272
|
${Q}${z}
|
|
273
|
-
</head>`);return q=q.replace(/<html\s[^>]*>/i,(K)=>{if(/lang=/.test(K))return K.replace(/lang="[^"]*"/,`lang="${X}"`);return K.replace("<html",`<html lang="${X}"`)}),q}function
|
|
273
|
+
</head>`);return q=q.replace(/<html\s[^>]*>/i,(K)=>{if(/lang=/.test(K))return K.replace(/lang="[^"]*"/,`lang="${X}"`);return K.replace("<html",`<html lang="${X}"`)}),q}function zX(Z,W,X){if(Z==="/")return H2(W,"index.html");let Q=Z.replace(/^\//,"");if(X==="always")return H2(W,Q,"index.html");return H2(W,`${Q}.html`)}function $V(Z,W){let X=0,Q=[];for(let[J,G]of Object.entries(Z)){let z=typeof G==="object"?G.destination:G,q=typeof G==="object"?G.status??301:301;if(J.includes(":")||J.includes("*")){Q.push(`${J} ${z} ${q}`);continue}let K=zX(J,W,"always"),V=`<!DOCTYPE html>
|
|
274
274
|
<html>
|
|
275
275
|
<head>
|
|
276
276
|
<meta charset="utf-8">
|
|
@@ -279,18 +279,18 @@ ${R.rules.join(`
|
|
|
279
279
|
<title>Redirecting...</title>
|
|
280
280
|
</head>
|
|
281
281
|
<body>
|
|
282
|
-
<p>Redirecting to <a href="${q8(z)}">${
|
|
282
|
+
<p>Redirecting to <a href="${q8(z)}">${FV(z)}</a>...</p>
|
|
283
283
|
</body>
|
|
284
|
-
</html>`;
|
|
284
|
+
</html>`;d1(O6(K),{recursive:!0}),K1(K,V,"utf8"),X+=1,Q.push(`${J} ${z} ${q}`)}if(Q.length>0)K1(H2(W,"_redirects"),`${Q.join(`
|
|
285
285
|
`)}
|
|
286
|
-
`,"utf8"),X+=1;return X}function
|
|
286
|
+
`,"utf8"),X+=1;return X}function FV(Z){return String(Z).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function q8(Z){return String(Z).replaceAll("&","&").replaceAll('"',""").replaceAll("<","<")}var UX=c(()=>{e0();q9();$9();L6();L9();w9();z9();i6();S1();P9();j9();XX();z8()});import{resolve as LV}from"node:path";async function AV(){let Z=process.argv.slice(2),[W]=Z;if(!W||W==="--help"||W==="-h")console.log(`Usage: jx <command> [options]
|
|
287
287
|
|
|
288
288
|
Commands:
|
|
289
289
|
build [root] Build a Jx site to dist/
|
|
290
290
|
|
|
291
291
|
Options:
|
|
292
292
|
--verbose Print detailed build progress
|
|
293
|
-
--no-clean Don't clean outDir before building`),process.exit(0);if(
|
|
294
|
-
Build completed with ${
|
|
295
|
-
Done: ${
|
|
296
|
-
Run "jx --help" for usage.`),process.exit(1);
|
|
293
|
+
--no-clean Don't clean outDir before building`),process.exit(0);if(W==="build"){let X=Z.slice(1),Q=new Set(X.filter((K)=>K.startsWith("--"))),J=X.find((K)=>!K.startsWith("--")),G=LV(J??"."),z=Q.has("--verbose"),q=!Q.has("--no-clean");console.log(`Building site from ${G}...`);try{let{buildSite:K}=await Promise.resolve().then(() => (UX(),YX)),V=await K(G,{clean:q,verbose:z});if(V.errors.length>0){console.error(`
|
|
294
|
+
Build completed with ${V.errors.length} error(s):`);for(let H of V.errors)console.error(` - ${H}`);process.exit(1)}console.log(`
|
|
295
|
+
Done: ${V.routes} routes → ${V.files} files`)}catch(K){console.error(`Build failed: ${K.message}`),process.exit(1)}}else console.error(`Unknown command: ${W}
|
|
296
|
+
Run "jx --help" for usage.`),process.exit(1)}var GA=AV();export{GA as ready};
|