fixparser-plugin-mcp 9.1.7-8db521e7 → 9.1.7-8faff314

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.
@@ -1,6 +1,52 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var r=require("fixparser");var R=require("@modelcontextprotocol/sdk/server/index.js"),O=require("@modelcontextprotocol/sdk/server/stdio.js"),c=require("@modelcontextprotocol/sdk/types.js"),e=require("fixparser"),S={type:"object",properties:{fixString:{type:"string",description:"FIX message string to parse"}},required:["fixString"]},f={type:"object",properties:{fixString:{type:"string",description:"FIX message string to parse"}},required:["fixString"]},T={type:"object",properties:{clOrdID:{type:"string",description:"Client Order ID"},handlInst:{type:"string",enum:["1","2","3"],description:'Handling instruction (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use "1" for Manual, "2" for Automated, "3" for AutomatedNoIntervention)'},quantity:{type:"number",description:"Order quantity"},price:{type:"number",description:"Order price"},ordType:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","P","Q","R","S"],description:'Order type (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use "1" for Market, "2" for Limit, "3" for Stop)'},side:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H"],description:'Order side (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use "1" for Buy, "2" for Sell, "3" for BuyMinus, "4" for SellPlus, "5" for SellShort, "6" for SellShortExempt, "7" for Undisclosed, "8" for Cross, "9" for CrossShort, "A" for CrossShortExempt, "B" for AsDefined, "C" for Opposite, "D" for Subscribe, "E" for Redeem, "F" for Lend, "G" for Borrow, "H" for SellUndisclosed)'},symbol:{type:"string",description:"Trading symbol"},timeInForce:{type:"string",enum:["0","1","2","3","4","5","6","7","8","9","A","B","C"],description:'Time in force (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use "0" for Day, "1" for Good Till Cancel, "2" for At Opening, "3" for Immediate or Cancel, "4" for Fill or Kill, "5" for Good Till Crossing, "6" for Good Till Date)'}},required:["clOrdID","quantity","price","side","symbol","handlInst","ordType","timeInForce"]},I={type:"object",properties:{mdUpdateType:{type:"string",enum:["0","1"],description:'Market data update type (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use "0" for FullRefresh, "1" for IncrementalRefresh)'},symbol:{type:"string",description:"Trading symbol"},mdReqID:{type:"string",description:"Market data request ID"},subscriptionRequestType:{type:"string",enum:["0","1","2"],description:'Subscription request type (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use "0" for Snapshot + Updates, "1" for Snapshot, "2" for Unsubscribe)'},mdEntryType:{type:"string",enum:["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","J","K","L","M","N","O","P","Q","S","R","T","U","V","W","X","Y","Z","a","b","c","d","e","g","h","i","t"],description:'Market data entry type (IMPORTANT: Use the numeric/alphabetic value, not the descriptive name. For example, use "0" for Bid, "1" for Offer, "2" for Trade, "3" for Index Value, "4" for Opening Price)'}},required:["symbol","mdReqID"]},q=class{parser;server=new R.Server({name:"fixparser",version:"1.0.0"},{capabilities:{tools:{},prompts:{},resources:{}}});transport=new O.StdioServerTransport;onReady=void 0;pendingRequests=new Map;constructor({logger:a,onReady:i}){i&&(this.onReady=i)}async register(a){this.parser=a,this.parser.addOnMessageCallback(i=>{let o=i.messageType;if(o===e.Messages.MarketDataSnapshotFullRefresh||o===e.Messages.ExecutionReport||o===e.Messages.Reject){let n=o===e.Messages.MarketDataSnapshotFullRefresh?i.getField(e.Fields.MDReqID):o===e.Messages.Reject?i.getField(e.Fields.RefSeqNum):i.getField(e.Fields.ClOrdID);if(n){let t=n.value;if(typeof t=="string"||typeof t=="number")if(o===e.Messages.Reject){let s=i.getField(e.Fields.RefMsgType);if(s&&s.value===e.Messages.NewOrderSingle){let p=this.pendingRequests.get(String(t));p&&(p(i),this.pendingRequests.delete(String(t)))}}else{let s=this.pendingRequests.get(String(t));s&&(s(i),this.pendingRequests.delete(String(t)))}}}}),this.addWorkflows(),await this.server.connect(this.transport),this.onReady&&this.onReady()}addWorkflows(){if(!this.parser||!this.server)return;let a=(i,o)=>{let n={};for(let[t,s]of Object.entries(o.properties||{})){let p=s,d=i?.[t];if(p.required&&d==null)throw new Error(`Required property '${t}' is missing`);d!==void 0?n[t]=d:p.default!==void 0&&(n[t]=p.default)}return n};this.server.setRequestHandler(c.ListResourcesRequestSchema,async()=>({resources:[]})),this.server.setRequestHandler(c.ListToolsRequestSchema,async()=>({tools:[{name:"parse",description:"Parses a FIX message and describes it in plain language",inputSchema:S},{name:"parseToJSON",description:"Parses a FIX message into JSON",inputSchema:f},{name:"newOrderSingle",description:"Creates and sends a New Order Single",inputSchema:T},{name:"marketDataRequest",description:"Sends a request for Market Data with the given symbol",inputSchema:I}]})),this.server.setRequestHandler(c.CallToolRequestSchema,async i=>{let{name:o,arguments:n}=i.params;switch(o){case"parse":try{let{fixString:t}=a(n,S),s=this.parser?.parse(t);return!s||s.length===0?{isError:!0,content:[{type:"text",text:"Error: Failed to parse FIX string"}]}:{content:[{type:"text",text:`${s[0].description}
3
- ${s[0].messageTypeDescription}`}]}}catch(t){return{isError:!0,content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Failed to parse FIX string"}`}]}}case"parseToJSON":try{let{fixString:t}=a(n,f),s=this.parser?.parse(t);return!s||s.length===0?{isError:!0,content:[{type:"text",text:"Error: Failed to parse FIX string"}]}:{content:[{type:"text",text:`${s[0].toFIXJSON()}`}]}}catch(t){return{isError:!0,content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Failed to parse FIX string"}`}]}}case"newOrderSingle":try{let{clOrdID:t,handlInst:s,quantity:p,price:d,ordType:l,side:u,symbol:m,timeInForce:g}=a(n,T),y=new Promise(M=>{this.pendingRequests.set(t,M)}),x=this.parser?.createMessage(new e.Field(e.Fields.MsgType,e.Messages.NewOrderSingle),new e.Field(e.Fields.MsgSeqNum,this.parser?.getNextTargetMsgSeqNum()),new e.Field(e.Fields.SenderCompID,this.parser?.sender),new e.Field(e.Fields.TargetCompID,this.parser?.target),new e.Field(e.Fields.SendingTime,this.parser?.getTimestamp()),new e.Field(e.Fields.ClOrdID,t),new e.Field(e.Fields.Side,u),new e.Field(e.Fields.Symbol,m),new e.Field(e.Fields.OrderQty,p),new e.Field(e.Fields.Price,d),new e.Field(e.Fields.OrdType,l),new e.Field(e.Fields.HandlInst,s),new e.Field(e.Fields.TimeInForce,g),new e.Field(e.Fields.TransactTime,this.parser?.getTimestamp()));if(!this.parser?.connected)return{isError:!0,content:[{type:"text",text:"Error: Not connected. Ignoring message."}]};this.parser?.send(x);let h=await y;return{content:[{type:"text",text:h.messageType===e.Messages.Reject?`Reject message for order ${t}: ${JSON.stringify(h.toFIXJSON())}`:`Execution Report for order ${t}: ${JSON.stringify(h.toFIXJSON())}`}]}}catch(t){return{isError:!0,content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Failed to create order"}`}]}}case"marketDataRequest":try{let{mdUpdateType:t,symbol:s,mdReqID:p,subscriptionRequestType:d,mdEntryType:l}=a(n,I),u=new Promise(y=>{this.pendingRequests.set(p,y)}),m=this.parser?.createMessage(new e.Field(e.Fields.MsgType,e.Messages.MarketDataRequest),new e.Field(e.Fields.SenderCompID,this.parser?.sender),new e.Field(e.Fields.MsgSeqNum,this.parser?.getNextTargetMsgSeqNum()),new e.Field(e.Fields.TargetCompID,this.parser?.target),new e.Field(e.Fields.SendingTime,this.parser?.getTimestamp()),new e.Field(e.Fields.MarketDepth,0),new e.Field(e.Fields.MDUpdateType,t),new e.Field(e.Fields.NoRelatedSym,1),new e.Field(e.Fields.Symbol,s),new e.Field(e.Fields.MDReqID,p),new e.Field(e.Fields.SubscriptionRequestType,d),new e.Field(e.Fields.NoMDEntryTypes,1),new e.Field(e.Fields.MDEntryType,l));if(!this.parser?.connected)return{isError:!0,content:[{type:"text",text:"Error: Not connected. Ignoring message."}]};this.parser?.send(m);let g=await u;return{content:[{type:"text",text:`Market data for ${s}: ${JSON.stringify(g.toFIXJSON())}`}]}}catch(t){return{isError:!0,content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Failed to request market data"}`}]}}default:throw new Error(`Unknown tool: ${o}`)}}),this.server.setRequestHandler(c.ListPromptsRequestSchema,async()=>({prompts:[{name:"parse",description:"Parses a FIX message and describes it in plain language",arguments:[{name:"fixString",description:"FIX message string to parse",required:!0}]},{name:"parseToJSON",description:"Parses a FIX message into JSON",arguments:[{name:"fixString",description:"FIX message string to parse",required:!0}]},{name:"newOrderSingle",description:"Creates and sends a New Order Single. IMPORTANT: All parameters must be explicitly provided by the user - no assumptions will be made.",arguments:[{name:"clOrdID",description:"Client Order ID",required:!0},{name:"handlInst",description:"Handling instruction (1=Manual, 2=Automated, 3=AutomatedNoIntervention)",required:!0},{name:"quantity",description:"Order quantity",required:!0},{name:"price",description:"Order price",required:!0},{name:"ordType",description:"Order type (1=Market, 2=Limit, 3=Stop)",required:!0},{name:"side",description:"Order side (1=Buy, 2=Sell, 3=BuyMinus, 4=SellPlus, 5=SellShort, 6=SellShortExempt, 7=Undisclosed, 8=Cross, 9=CrossShort, A=CrossShortExempt, B=AsDefined, C=Opposite, D=Subscribe, E=Redeem, F=Lend, G=Borrow, H=SellUndisclosed)",required:!0},{name:"symbol",description:"Trading symbol",required:!0},{name:"timeInForce",description:"Time in force (0=Day, 1=Good Till Cancel, 2=At Opening, 3=Immediate or Cancel, 4=Fill or Kill, 5=Good Till Crossing, 6=Good Till Date)",required:!0}]},{name:"marketDataRequest",description:"Sends a request for Market Data with the given symbol. IMPORTANT: All parameters must be explicitly provided by the user - no assumptions will be made.",arguments:[{name:"mdUpdateType",description:"Market data update type (0=FullRefresh, 1=IncrementalRefresh)",required:!0},{name:"symbol",description:"Trading symbol",required:!0},{name:"mdReqID",description:"Market data request ID",required:!0},{name:"subscriptionRequestType",description:"Subscription request type (0=Snapshot + Updates, 1=Snapshot, 2=Unsubscribe)",required:!0},{name:"mdEntryType",description:"Market data entry type (0=Bid, 1=Offer, 2=Trade, 3=Index Value, 4=Opening Price)",required:!0}]}]})),this.server.setRequestHandler(c.GetPromptRequestSchema,async i=>{let{name:o,arguments:n}=i.params;switch(o){case"parse":return{messages:[{role:"user",content:{type:"text",text:`Please parse and explain this FIX message: ${n?.fixString||""}`}}]};case"parseToJSON":return{messages:[{role:"user",content:{type:"text",text:`Please parse the FIX message to JSON: ${n?.fixString||""}`}}]};case"newOrderSingle":{let{clOrdID:t,handlInst:s,quantity:p,price:d,ordType:l,side:u,symbol:m,timeInForce:g}=n||{};return{messages:[{role:"user",content:{type:"text",text:["You are an AI assistant that helps users create FIX New Order Single messages.","You must **first verify** that all required fields are provided:","- ClOrdID (Client Order ID)","- HandlInst (1=Manual, 2=Automated, 3=AutomatedNoIntervention)","- Quantity (Order quantity)","- Price (Order price)","- OrdType (1=Market, 2=Limit, 3=Stop)","- Side (1=Buy, 2=Sell, 3=BuyMinus, 4=SellPlus, 5=SellShort, 6=SellShortExempt, 7=Undisclosed, 8=Cross, 9=CrossShort, A=CrossShortExempt, B=AsDefined, C=Opposite, D=Subscribe, E=Redeem, F=Lend, G=Borrow, H=SellUndisclosed)","- Symbol (Trading symbol)","- TimeInForce (0=Day, 1=Good Till Cancel, 2=At Opening, 3=Immediate or Cancel, 4=Fill or Kill, 5=Good Till Crossing, 6=Good Till Date)","","Only when all fields are present and valid, respond with:","`VERIFICATION: All parameters valid. Ready to proceed.`","","Otherwise, list the missing or invalid ones.","","Do not create the FIX message until verification is complete.","","Current parameters:",`- ClOrdID: ${t}`,`- HandlInst: ${s}`,`- Quantity: ${p}`,`- Price: ${d}`,`- OrdType: ${l}`,`- Side: ${u}`,`- Symbol: ${m}`,`- TimeInForce: ${g}`,"","IMPORTANT: The response will be either:","1. An Execution Report (MsgType=8) if the order was successfully placed","2. A Reject message (MsgType=3) if the order failed to execute (e.g., due to missing or invalid parameters)"].join(`
4
- `)}}]}}case"marketDataRequest":{let{mdUpdateType:t,symbol:s,mdReqID:p,subscriptionRequestType:d,mdEntryType:l}=n||{};return{messages:[{role:"user",content:{type:"text",text:["You are an AI assistant that helps users create FIX Market Data Request messages.","You must **first verify** that all required fields are provided:","- MDUpdateType (0=FullRefresh, 1=IncrementalRefresh)","- Symbol (Trading symbol)","- MDReqID (Market data request ID)","- SubscriptionRequestType (0=Snapshot + Updates, 1=Snapshot, 2=Unsubscribe)","- MDEntryType (0=Bid, 1=Offer, 2=Trade, 3=Index Value, 4=Opening Price)","","Only when all fields are present and valid, respond with:","`VERIFICATION: All parameters valid. Ready to proceed.`","","Otherwise, list the missing or invalid ones.","","Do not create the FIX message until verification is complete.","","Current parameters:",`- MDUpdateType: ${t}`,`- Symbol: ${s}`,`- MDReqID: ${p}`,`- SubscriptionRequestType: ${d}`,`- MDEntryType: ${l}`].join(`
5
- `)}}]}}default:throw new Error(`Unknown prompt: ${o}`)}}),process.on("SIGINT",async()=>{await this.server.close(),process.exit(0)})}};var w="CLIENT2",F="EXECUTOR",D=async()=>{await r.LicenseManager.setLicenseKey(process.env.FIXPARSER_LICENSE_KEY);let a=new r.FIXParser({logging:!1,plugins:[new q({port:3099,onReady:()=>{}})]}),i=()=>{let n=a.createMessage(new r.Field(r.Fields.MsgType,r.Messages.Logon),new r.Field(r.Fields.MsgSeqNum,a.getNextTargetMsgSeqNum()),new r.Field(r.Fields.SenderCompID,w),new r.Field(r.Fields.SendingTime,a.getTimestamp()),new r.Field(r.Fields.TargetCompID,F),new r.Field(r.Fields.ResetSeqNumFlag,r.ResetSeqNumFlag.Yes),new r.Field(r.Fields.EncryptMethod,r.EncryptMethod.None),new r.Field(r.Fields.HeartBtInt,10));a.send(n)},o={host:process.env.FIXPARSER_HOST||"10.0.1.42",port:process.env.FIXPARSER_PORT?Number.parseInt(process.env.FIXPARSER_PORT,10):5001,protocol:"tcp",sender:process.env.FIXPARSER_SENDER||w,target:process.env.FIXPARSER_TARGET||F,fixVersion:process.env.FIXPARSER_TARGET||"FIX.4.4",onOpen:()=>{i()},onMessage:n=>{},onClose:()=>{setTimeout(()=>{a.connect(o)},1e3)}};a.connect(o)};D().catch(a=>console.error("Error initializing server:",a));
2
+ "use strict";var N=require("fixparser");var le=class{format;constructor({format:P="json"}){this.format=P}configure(P){this.format=P.format||"json"}async send(P){if(this.format==="json")console.log(JSON.stringify(P));else if(this.format==="jsonrpc"){let{message:y,...e}=P,r={jsonrpc:"2.0",method:P.level,params:{message:y,...e},id:P.id||Date.now()};console.log(JSON.stringify(r))}else{let{name:y,id:e,message:r,level:u,...b}=P,s=Object.entries(b).map(([i,c])=>`${i}: ${c}`),f="";y&&(f+=`${y} `),f+=`${e}: ${r}`,console.log(f,s.join(", "))}}async flush(){}async close(){}status(){return"connected"}};var be=require("@modelcontextprotocol/sdk/server/index.js"),ye=require("@modelcontextprotocol/sdk/server/stdio.js"),$=require("fixparser"),V=require("zod"),Ee=Object.create,he=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,de=Object.getOwnPropertyNames,Pe=Object.getPrototypeOf,Ie=Object.prototype.hasOwnProperty,D=(P=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(P,{get:(y,e)=>(typeof require<"u"?require:y)[e]}):P)(function(P){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+P+'" is not supported')}),O=(P,y)=>function(){return y||(0,P[de(P)[0]])((y={exports:{}}).exports,y),y.exports},Re=(P,y,e,r)=>{if(y&&typeof y=="object"||typeof y=="function")for(let u of de(y))!Ie.call(P,u)&&u!==e&&he(P,u,{get:()=>y[u],enumerable:!(r=xe(y,u))||r.enumerable});return P},Se=(P,y,e)=>(e=P!=null?Ee(Pe(P)):{},Re(y||!P||!P.__esModule?he(e,"default",{value:P,enumerable:!0}):e,P)),J=O({"../../node_modules/sharp/lib/is.js"(P,y){"use strict";var e=function(p){return typeof p<"u"&&p!==null},r=function(p){return typeof p=="object"},u=function(p){return Object.prototype.toString.call(p)==="[object Object]"},b=function(p){return typeof p=="function"},s=function(p){return typeof p=="boolean"},f=function(p){return p instanceof Buffer},i=function(p){if(e(p))switch(p.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},c=function(p){return p instanceof ArrayBuffer},n=function(p){return typeof p=="string"&&p.length>0},l=function(p){return typeof p=="number"&&!Number.isNaN(p)},d=function(p){return Number.isInteger(p)},a=function(p,v,x){return p>=v&&p<=x},o=function(p,v){return v.includes(p)},h=function(p,v,x){return new Error(`Expected ${v} for ${p} but received ${x} of type ${typeof x}`)},m=function(p,v){return v.message=p.message,v};y.exports={defined:e,object:r,plainObject:u,fn:b,bool:s,buffer:f,typedArray:i,arrayBuffer:c,string:n,number:l,integer:d,inRange:a,inArray:o,invalidParameterError:h,nativeError:m}}}),je=O({"../../node_modules/detect-libc/lib/process.js"(P,y){"use strict";var e=()=>process.platform==="linux",r=null,u=()=>{if(!r)if(e()&&process.report){let b=process.report.excludeNetwork;process.report.excludeNetwork=!0,r=process.report.getReport(),process.report.excludeNetwork=b}else r={};return r};y.exports={isLinux:e,getReport:u}}}),Ae=O({"../../node_modules/detect-libc/lib/filesystem.js"(P,y){"use strict";var e=D("fs"),r="/usr/bin/ldd",u=s=>e.readFileSync(s,"utf-8"),b=s=>new Promise((f,i)=>{e.readFile(s,"utf-8",(c,n)=>{c?i(c):f(n)})});y.exports={LDD_PATH:r,readFileSync:u,readFile:b}}}),ae=O({"../../node_modules/detect-libc/lib/detect-libc.js"(P,y){"use strict";var e=D("child_process"),{isLinux:r,getReport:u}=je(),{LDD_PATH:b,readFile:s,readFileSync:f}=Ae(),i,c,n="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",l="",d=()=>l||new Promise(w=>{e.exec(n,(j,t)=>{l=j?" ":t,w(l)})}),a=()=>{if(!l)try{l=e.execSync(n,{encoding:"utf8"})}catch{l=" "}return l},o="glibc",h=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,m="musl",p=w=>w.includes("libc.musl-")||w.includes("ld-musl-"),v=()=>{let w=u();return w.header&&w.header.glibcVersionRuntime?o:Array.isArray(w.sharedObjects)&&w.sharedObjects.some(p)?m:null},x=w=>{let[j,t]=w.split(/[\r\n]+/);return j&&j.includes(o)?o:t&&t.includes(m)?m:null},T=w=>w.includes("musl")?m:w.includes("GNU C Library")?o:null,_=async()=>{if(i!==void 0)return i;i=null;try{let w=await s(b);i=T(w)}catch{}return i},q=()=>{if(i!==void 0)return i;i=null;try{let w=f(b);i=T(w)}catch{}return i},z=async()=>{let w=null;if(r()&&(w=await _(),w||(w=v()),!w)){let j=await d();w=x(j)}return w},G=()=>{let w=null;if(r()&&(w=q(),w||(w=v()),!w)){let j=a();w=x(j)}return w},U=async()=>r()&&await z()!==o,H=()=>r()&&G()!==o,g=async()=>{if(c!==void 0)return c;c=null;try{let j=(await s(b)).match(h);j&&(c=j[1])}catch{}return c},S=()=>{if(c!==void 0)return c;c=null;try{let j=f(b).match(h);j&&(c=j[1])}catch{}return c},F=()=>{let w=u();return w.header&&w.header.glibcVersionRuntime?w.header.glibcVersionRuntime:null},W=w=>w.trim().split(/\s+/)[1],Q=w=>{let[j,t,E]=w.split(/[\r\n]+/);return j&&j.includes(o)?W(j):t&&E&&t.includes(m)?W(E):null},I=async()=>{let w=null;if(r()&&(w=await g(),w||(w=F()),!w)){let j=await d();w=Q(j)}return w},R=()=>{let w=null;if(r()&&(w=S(),w||(w=F()),!w)){let j=a();w=Q(j)}return w};y.exports={GLIBC:o,MUSL:m,family:z,familySync:G,isNonGlibcLinux:U,isNonGlibcLinuxSync:H,version:I,versionSync:R}}}),re=O({"../../node_modules/sharp/node_modules/semver/internal/debug.js"(P,y){"use strict";var e=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};y.exports=e}}),se=O({"../../node_modules/sharp/node_modules/semver/internal/constants.js"(P,y){"use strict";var e="2.0.0",r=256,u=Number.MAX_SAFE_INTEGER||9007199254740991,b=16,s=r-6,f=["major","premajor","minor","preminor","patch","prepatch","prerelease"];y.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:b,MAX_SAFE_BUILD_LENGTH:s,MAX_SAFE_INTEGER:u,RELEASE_TYPES:f,SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}}),te=O({"../../node_modules/sharp/node_modules/semver/internal/re.js"(P,y){"use strict";var{MAX_SAFE_COMPONENT_LENGTH:e,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:u}=se(),b=re();P=y.exports={};var s=P.re=[],f=P.safeRe=[],i=P.src=[],c=P.safeSrc=[],n=P.t={},l=0,d="[a-zA-Z0-9-]",a=[["\\s",1],["\\d",u],[d,r]],o=m=>{for(let[p,v]of a)m=m.split(`${p}*`).join(`${p}{0,${v}}`).split(`${p}+`).join(`${p}{1,${v}}`);return m},h=(m,p,v)=>{let x=o(p),T=l++;b(m,T,p),n[m]=T,i[T]=p,c[T]=x,s[T]=new RegExp(p,v?"g":void 0),f[T]=new RegExp(x,v?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),h("MAINVERSION",`(${i[n.NUMERICIDENTIFIER]})\\.(${i[n.NUMERICIDENTIFIER]})\\.(${i[n.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${i[n.NUMERICIDENTIFIERLOOSE]})\\.(${i[n.NUMERICIDENTIFIERLOOSE]})\\.(${i[n.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${i[n.NONNUMERICIDENTIFIER]}|${i[n.NUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${i[n.NONNUMERICIDENTIFIER]}|${i[n.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASE",`(?:-(${i[n.PRERELEASEIDENTIFIER]}(?:\\.${i[n.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${i[n.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[n.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${d}+`),h("BUILD",`(?:\\+(${i[n.BUILDIDENTIFIER]}(?:\\.${i[n.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${i[n.MAINVERSION]}${i[n.PRERELEASE]}?${i[n.BUILD]}?`),h("FULL",`^${i[n.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${i[n.MAINVERSIONLOOSE]}${i[n.PRERELEASELOOSE]}?${i[n.BUILD]}?`),h("LOOSE",`^${i[n.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${i[n.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${i[n.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${i[n.XRANGEIDENTIFIER]})(?:\\.(${i[n.XRANGEIDENTIFIER]})(?:\\.(${i[n.XRANGEIDENTIFIER]})(?:${i[n.PRERELEASE]})?${i[n.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${i[n.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[n.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[n.XRANGEIDENTIFIERLOOSE]})(?:${i[n.PRERELEASELOOSE]})?${i[n.BUILD]}?)?)?`),h("XRANGE",`^${i[n.GTLT]}\\s*${i[n.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${i[n.GTLT]}\\s*${i[n.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${e}})(?:\\.(\\d{1,${e}}))?(?:\\.(\\d{1,${e}}))?`),h("COERCE",`${i[n.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",i[n.COERCEPLAIN]+`(?:${i[n.PRERELEASE]})?(?:${i[n.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",i[n.COERCE],!0),h("COERCERTLFULL",i[n.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${i[n.LONETILDE]}\\s+`,!0),P.tildeTrimReplace="$1~",h("TILDE",`^${i[n.LONETILDE]}${i[n.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${i[n.LONETILDE]}${i[n.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${i[n.LONECARET]}\\s+`,!0),P.caretTrimReplace="$1^",h("CARET",`^${i[n.LONECARET]}${i[n.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${i[n.LONECARET]}${i[n.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${i[n.GTLT]}\\s*(${i[n.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${i[n.GTLT]}\\s*(${i[n.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${i[n.GTLT]}\\s*(${i[n.LOOSEPLAIN]}|${i[n.XRANGEPLAIN]})`,!0),P.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${i[n.XRANGEPLAIN]})\\s+-\\s+(${i[n.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${i[n.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[n.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}}),oe=O({"../../node_modules/sharp/node_modules/semver/internal/parse-options.js"(P,y){"use strict";var e=Object.freeze({loose:!0}),r=Object.freeze({}),u=b=>b?typeof b!="object"?e:b:r;y.exports=u}}),$e=O({"../../node_modules/sharp/node_modules/semver/internal/identifiers.js"(P,y){"use strict";var e=/^[0-9]+$/,r=(b,s)=>{let f=e.test(b),i=e.test(s);return f&&i&&(b=+b,s=+s),b===s?0:f&&!i?-1:i&&!f?1:b<s?-1:1},u=(b,s)=>r(s,b);y.exports={compareIdentifiers:r,rcompareIdentifiers:u}}}),Z=O({"../../node_modules/sharp/node_modules/semver/classes/semver.js"(P,y){"use strict";var e=re(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:u}=se(),{safeRe:b,t:s}=te(),f=oe(),{compareIdentifiers:i}=$e(),c=class X{constructor(l,d){if(d=f(d),l instanceof X){if(l.loose===!!d.loose&&l.includePrerelease===!!d.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>r)throw new TypeError(`version is longer than ${r} characters`);e("SemVer",l,d),this.options=d,this.loose=!!d.loose,this.includePrerelease=!!d.includePrerelease;let a=l.trim().match(d.loose?b[s.LOOSE]:b[s.FULL]);if(!a)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>u||this.major<0)throw new TypeError("Invalid major version");if(this.minor>u||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>u||this.patch<0)throw new TypeError("Invalid patch version");a[4]?this.prerelease=a[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let h=+o;if(h>=0&&h<u)return h}return o}):this.prerelease=[],this.build=a[5]?a[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof X)){if(typeof l=="string"&&l===this.version)return 0;l=new X(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof X||(l=new X(l,this.options)),i(this.major,l.major)||i(this.minor,l.minor)||i(this.patch,l.patch)}comparePre(l){if(l instanceof X||(l=new X(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let d=0;do{let a=this.prerelease[d],o=l.prerelease[d];if(e("prerelease compare",d,a,o),a===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(a===void 0)return-1;if(a===o)continue;return i(a,o)}while(++d)}compareBuild(l){l instanceof X||(l=new X(l,this.options));let d=0;do{let a=this.build[d],o=l.build[d];if(e("build compare",d,a,o),a===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(a===void 0)return-1;if(a===o)continue;return i(a,o)}while(++d)}inc(l,d,a){if(l.startsWith("pre")){if(!d&&a===!1)throw new Error("invalid increment argument: identifier is empty");if(d){let o=`-${d}`.match(this.options.loose?b[s.PRERELEASELOOSE]:b[s.PRERELEASE]);if(!o||o[1]!==d)throw new Error(`invalid identifier: ${d}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",d,a);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",d,a);break;case"prepatch":this.prerelease.length=0,this.inc("patch",d,a),this.inc("pre",d,a);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",d,a),this.inc("pre",d,a);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(a)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(d===this.prerelease.join(".")&&a===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(d){let h=[d,o];a===!1&&(h=[d]),i(this.prerelease[0],d)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};y.exports=c}}),ke=O({"../../node_modules/sharp/node_modules/semver/functions/parse.js"(P,y){"use strict";var e=Z(),r=(u,b,s=!1)=>{if(u instanceof e)return u;try{return new e(u,b)}catch(f){if(!s)return null;throw f}};y.exports=r}}),Le=O({"../../node_modules/sharp/node_modules/semver/functions/coerce.js"(P,y){"use strict";var e=Z(),r=ke(),{safeRe:u,t:b}=te(),s=(f,i)=>{if(f instanceof e)return f;if(typeof f=="number"&&(f=String(f)),typeof f!="string")return null;i=i||{};let c=null;if(!i.rtl)c=f.match(i.includePrerelease?u[b.COERCEFULL]:u[b.COERCE]);else{let h=i.includePrerelease?u[b.COERCERTLFULL]:u[b.COERCERTL],m;for(;(m=h.exec(f))&&(!c||c.index+c[0].length!==f.length);)(!c||m.index+m[0].length!==c.index+c[0].length)&&(c=m),h.lastIndex=m.index+m[1].length+m[2].length;h.lastIndex=-1}if(c===null)return null;let n=c[2],l=c[3]||"0",d=c[4]||"0",a=i.includePrerelease&&c[5]?`-${c[5]}`:"",o=i.includePrerelease&&c[6]?`+${c[6]}`:"";return r(`${n}.${l}.${d}${a}${o}`,i)};y.exports=s}}),K=O({"../../node_modules/sharp/node_modules/semver/functions/compare.js"(P,y){"use strict";var e=Z(),r=(u,b,s)=>new e(u,s).compare(new e(b,s));y.exports=r}}),fe=O({"../../node_modules/sharp/node_modules/semver/functions/gte.js"(P,y){"use strict";var e=K(),r=(u,b,s)=>e(u,b,s)>=0;y.exports=r}}),Oe=O({"../../node_modules/sharp/node_modules/semver/internal/lrucache.js"(P,y){"use strict";var e=class{constructor(){this.max=1e3,this.map=new Map}get(r){let u=this.map.get(r);if(u!==void 0)return this.map.delete(r),this.map.set(r,u),u}delete(r){return this.map.delete(r)}set(r,u){if(!this.delete(r)&&u!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(r,u)}return this}};y.exports=e}}),Te=O({"../../node_modules/sharp/node_modules/semver/functions/eq.js"(P,y){"use strict";var e=K(),r=(u,b,s)=>e(u,b,s)===0;y.exports=r}}),_e=O({"../../node_modules/sharp/node_modules/semver/functions/neq.js"(P,y){"use strict";var e=K(),r=(u,b,s)=>e(u,b,s)!==0;y.exports=r}}),Ce=O({"../../node_modules/sharp/node_modules/semver/functions/gt.js"(P,y){"use strict";var e=K(),r=(u,b,s)=>e(u,b,s)>0;y.exports=r}}),Ne=O({"../../node_modules/sharp/node_modules/semver/functions/lt.js"(P,y){"use strict";var e=K(),r=(u,b,s)=>e(u,b,s)<0;y.exports=r}}),Fe=O({"../../node_modules/sharp/node_modules/semver/functions/lte.js"(P,y){"use strict";var e=K(),r=(u,b,s)=>e(u,b,s)<=0;y.exports=r}}),Me=O({"../../node_modules/sharp/node_modules/semver/functions/cmp.js"(P,y){"use strict";var e=Te(),r=_e(),u=Ce(),b=fe(),s=Ne(),f=Fe(),i=(c,n,l,d)=>{switch(n){case"===":return typeof c=="object"&&(c=c.version),typeof l=="object"&&(l=l.version),c===l;case"!==":return typeof c=="object"&&(c=c.version),typeof l=="object"&&(l=l.version),c!==l;case"":case"=":case"==":return e(c,l,d);case"!=":return r(c,l,d);case">":return u(c,l,d);case">=":return b(c,l,d);case"<":return s(c,l,d);case"<=":return f(c,l,d);default:throw new TypeError(`Invalid operator: ${n}`)}};y.exports=i}}),De=O({"../../node_modules/sharp/node_modules/semver/classes/comparator.js"(P,y){"use strict";var e=Symbol("SemVer ANY"),r=class ne{static get ANY(){return e}constructor(d,a){if(a=u(a),d instanceof ne){if(d.loose===!!a.loose)return d;d=d.value}d=d.trim().split(/\s+/).join(" "),i("comparator",d,a),this.options=a,this.loose=!!a.loose,this.parse(d),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(d){let a=this.options.loose?b[s.COMPARATORLOOSE]:b[s.COMPARATOR],o=d.match(a);if(!o)throw new TypeError(`Invalid comparator: ${d}`);this.operator=o[1]!==void 0?o[1]:"",this.operator==="="&&(this.operator=""),o[2]?this.semver=new c(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(d){if(i("Comparator.test",d,this.options.loose),this.semver===e||d===e)return!0;if(typeof d=="string")try{d=new c(d,this.options)}catch{return!1}return f(d,this.operator,this.semver,this.options)}intersects(d,a){if(!(d instanceof ne))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new n(d.value,a).test(this.value):d.operator===""?d.value===""?!0:new n(this.value,a).test(d.semver):(a=u(a),a.includePrerelease&&(this.value==="<0.0.0-0"||d.value==="<0.0.0-0")||!a.includePrerelease&&(this.value.startsWith("<0.0.0")||d.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&d.operator.startsWith(">")||this.operator.startsWith("<")&&d.operator.startsWith("<")||this.semver.version===d.semver.version&&this.operator.includes("=")&&d.operator.includes("=")||f(this.semver,"<",d.semver,a)&&this.operator.startsWith(">")&&d.operator.startsWith("<")||f(this.semver,">",d.semver,a)&&this.operator.startsWith("<")&&d.operator.startsWith(">")))}};y.exports=r;var u=oe(),{safeRe:b,t:s}=te(),f=Me(),i=re(),c=Z(),n=ue()}}),ue=O({"../../node_modules/sharp/node_modules/semver/classes/range.js"(P,y){"use strict";var e=/\s+/g,r=class ee{constructor(R,w){if(w=s(w),R instanceof ee)return R.loose===!!w.loose&&R.includePrerelease===!!w.includePrerelease?R:new ee(R.raw,w);if(R instanceof f)return this.raw=R.value,this.set=[[R]],this.formatted=void 0,this;if(this.options=w,this.loose=!!w.loose,this.includePrerelease=!!w.includePrerelease,this.raw=R.trim().replace(e," "),this.set=this.raw.split("||").map(j=>this.parseRange(j.trim())).filter(j=>j.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let j=this.set[0];if(this.set=this.set.filter(t=>!p(t[0])),this.set.length===0)this.set=[j];else if(this.set.length>1){for(let t of this.set)if(t.length===1&&v(t[0])){this.set=[t];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let R=0;R<this.set.length;R++){R>0&&(this.formatted+="||");let w=this.set[R];for(let j=0;j<w.length;j++)j>0&&(this.formatted+=" "),this.formatted+=w[j].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(R){let j=((this.options.includePrerelease&&h)|(this.options.loose&&m))+":"+R,t=b.get(j);if(t)return t;let E=this.options.loose,A=E?n[l.HYPHENRANGELOOSE]:n[l.HYPHENRANGE];R=R.replace(A,W(this.options.includePrerelease)),i("hyphen replace",R),R=R.replace(n[l.COMPARATORTRIM],d),i("comparator trim",R),R=R.replace(n[l.TILDETRIM],a),i("tilde trim",R),R=R.replace(n[l.CARETTRIM],o),i("caret trim",R);let L=R.split(" ").map(M=>T(M,this.options)).join(" ").split(/\s+/).map(M=>F(M,this.options));E&&(L=L.filter(M=>(i("loose invalid filter",M,this.options),!!M.match(n[l.COMPARATORLOOSE])))),i("range list",L);let k=new Map,C=L.map(M=>new f(M,this.options));for(let M of C){if(p(M))return[M];k.set(M.value,M)}k.size>1&&k.has("")&&k.delete("");let B=[...k.values()];return b.set(j,B),B}intersects(R,w){if(!(R instanceof ee))throw new TypeError("a Range is required");return this.set.some(j=>x(j,w)&&R.set.some(t=>x(t,w)&&j.every(E=>t.every(A=>E.intersects(A,w)))))}test(R){if(!R)return!1;if(typeof R=="string")try{R=new c(R,this.options)}catch{return!1}for(let w=0;w<this.set.length;w++)if(Q(this.set[w],R,this.options))return!0;return!1}};y.exports=r;var u=Oe(),b=new u,s=oe(),f=De(),i=re(),c=Z(),{safeRe:n,t:l,comparatorTrimReplace:d,tildeTrimReplace:a,caretTrimReplace:o}=te(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:m}=se(),p=I=>I.value==="<0.0.0-0",v=I=>I.value==="",x=(I,R)=>{let w=!0,j=I.slice(),t=j.pop();for(;w&&j.length;)w=j.every(E=>t.intersects(E,R)),t=j.pop();return w},T=(I,R)=>(i("comp",I,R),I=G(I,R),i("caret",I),I=q(I,R),i("tildes",I),I=H(I,R),i("xrange",I),I=S(I,R),i("stars",I),I),_=I=>!I||I.toLowerCase()==="x"||I==="*",q=(I,R)=>I.trim().split(/\s+/).map(w=>z(w,R)).join(" "),z=(I,R)=>{let w=R.loose?n[l.TILDELOOSE]:n[l.TILDE];return I.replace(w,(j,t,E,A,L)=>{i("tilde",I,j,t,E,A,L);let k;return _(t)?k="":_(E)?k=`>=${t}.0.0 <${+t+1}.0.0-0`:_(A)?k=`>=${t}.${E}.0 <${t}.${+E+1}.0-0`:L?(i("replaceTilde pr",L),k=`>=${t}.${E}.${A}-${L} <${t}.${+E+1}.0-0`):k=`>=${t}.${E}.${A} <${t}.${+E+1}.0-0`,i("tilde return",k),k})},G=(I,R)=>I.trim().split(/\s+/).map(w=>U(w,R)).join(" "),U=(I,R)=>{i("caret",I,R);let w=R.loose?n[l.CARETLOOSE]:n[l.CARET],j=R.includePrerelease?"-0":"";return I.replace(w,(t,E,A,L,k)=>{i("caret",I,t,E,A,L,k);let C;return _(E)?C="":_(A)?C=`>=${E}.0.0${j} <${+E+1}.0.0-0`:_(L)?E==="0"?C=`>=${E}.${A}.0${j} <${E}.${+A+1}.0-0`:C=`>=${E}.${A}.0${j} <${+E+1}.0.0-0`:k?(i("replaceCaret pr",k),E==="0"?A==="0"?C=`>=${E}.${A}.${L}-${k} <${E}.${A}.${+L+1}-0`:C=`>=${E}.${A}.${L}-${k} <${E}.${+A+1}.0-0`:C=`>=${E}.${A}.${L}-${k} <${+E+1}.0.0-0`):(i("no pr"),E==="0"?A==="0"?C=`>=${E}.${A}.${L}${j} <${E}.${A}.${+L+1}-0`:C=`>=${E}.${A}.${L}${j} <${E}.${+A+1}.0-0`:C=`>=${E}.${A}.${L} <${+E+1}.0.0-0`),i("caret return",C),C})},H=(I,R)=>(i("replaceXRanges",I,R),I.split(/\s+/).map(w=>g(w,R)).join(" ")),g=(I,R)=>{I=I.trim();let w=R.loose?n[l.XRANGELOOSE]:n[l.XRANGE];return I.replace(w,(j,t,E,A,L,k)=>{i("xRange",I,j,t,E,A,L,k);let C=_(E),B=C||_(A),M=B||_(L),Y=M;return t==="="&&Y&&(t=""),k=R.includePrerelease?"-0":"",C?t===">"||t==="<"?j="<0.0.0-0":j="*":t&&Y?(B&&(A=0),L=0,t===">"?(t=">=",B?(E=+E+1,A=0,L=0):(A=+A+1,L=0)):t==="<="&&(t="<",B?E=+E+1:A=+A+1),t==="<"&&(k="-0"),j=`${t+E}.${A}.${L}${k}`):B?j=`>=${E}.0.0${k} <${+E+1}.0.0-0`:M&&(j=`>=${E}.${A}.0${k} <${E}.${+A+1}.0-0`),i("xRange return",j),j})},S=(I,R)=>(i("replaceStars",I,R),I.trim().replace(n[l.STAR],"")),F=(I,R)=>(i("replaceGTE0",I,R),I.trim().replace(n[R.includePrerelease?l.GTE0PRE:l.GTE0],"")),W=I=>(R,w,j,t,E,A,L,k,C,B,M,Y)=>(_(j)?w="":_(t)?w=`>=${j}.0.0${I?"-0":""}`:_(E)?w=`>=${j}.${t}.0${I?"-0":""}`:A?w=`>=${w}`:w=`>=${w}${I?"-0":""}`,_(C)?k="":_(B)?k=`<${+C+1}.0.0-0`:_(M)?k=`<${C}.${+B+1}.0-0`:Y?k=`<=${C}.${B}.${M}-${Y}`:I?k=`<${C}.${B}.${+M+1}-0`:k=`<=${k}`,`${w} ${k}`.trim()),Q=(I,R,w)=>{for(let j=0;j<I.length;j++)if(!I[j].test(R))return!1;if(R.prerelease.length&&!w.includePrerelease){for(let j=0;j<I.length;j++)if(i(I[j].semver),I[j].semver!==f.ANY&&I[j].semver.prerelease.length>0){let t=I[j].semver;if(t.major===R.major&&t.minor===R.minor&&t.patch===R.patch)return!0}return!1}return!0}}}),Be=O({"../../node_modules/sharp/node_modules/semver/functions/satisfies.js"(P,y){"use strict";var e=ue(),r=(u,b,s)=>{try{b=new e(b,s)}catch{return!1}return b.test(u)};y.exports=r}}),me=O({"../../node_modules/sharp/package.json"(P,y){y.exports={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.34.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\xE4ck <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\xFCnemann <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\xE9r\xE9my 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\u011B\u0161ovec <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\xF1o <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\xE9 <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>"],scripts:{install:"node install/check",clean:"rm -rf src/build/ .nyc_output/ coverage/ test/fixtures/output.*",test:"npm run test-lint && npm run test-unit && npm run test-licensing && npm run test-types","test-lint":"semistandard && cpplint","test-unit":"nyc --reporter=lcov --reporter=text --check-coverage --branches=100 mocha","test-licensing":'license-checker --production --summary --onlyAllow="Apache-2.0;BSD;ISC;LGPL-3.0-or-later;MIT"',"test-leak":"./test/leak/leak.sh","test-types":"tsd","package-from-local-build":"node npm/from-local-build","package-from-github-release":"node npm/from-github-release","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",main:"lib/index.js",types:"lib/index.d.ts",files:["install","lib","src/*.{cc,h,gyp}"],repository:{type:"git",url:"git://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{color:"^4.2.3","detect-libc":"^2.0.4",semver:"^7.7.2"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.34.2","@img/sharp-darwin-x64":"0.34.2","@img/sharp-libvips-darwin-arm64":"1.1.0","@img/sharp-libvips-darwin-x64":"1.1.0","@img/sharp-libvips-linux-arm":"1.1.0","@img/sharp-libvips-linux-arm64":"1.1.0","@img/sharp-libvips-linux-ppc64":"1.1.0","@img/sharp-libvips-linux-s390x":"1.1.0","@img/sharp-libvips-linux-x64":"1.1.0","@img/sharp-libvips-linuxmusl-arm64":"1.1.0","@img/sharp-libvips-linuxmusl-x64":"1.1.0","@img/sharp-linux-arm":"0.34.2","@img/sharp-linux-arm64":"0.34.2","@img/sharp-linux-s390x":"0.34.2","@img/sharp-linux-x64":"0.34.2","@img/sharp-linuxmusl-arm64":"0.34.2","@img/sharp-linuxmusl-x64":"0.34.2","@img/sharp-wasm32":"0.34.2","@img/sharp-win32-arm64":"0.34.2","@img/sharp-win32-ia32":"0.34.2","@img/sharp-win32-x64":"0.34.2"},devDependencies:{"@emnapi/runtime":"^1.4.3","@img/sharp-libvips-dev":"1.1.0","@img/sharp-libvips-dev-wasm32":"1.1.0","@img/sharp-libvips-win32-arm64":"1.1.0","@img/sharp-libvips-win32-ia32":"1.1.0","@img/sharp-libvips-win32-x64":"1.1.0","@types/node":"*",cc:"^3.0.1",emnapi:"^1.4.3","exif-reader":"^2.0.2","extract-zip":"^2.0.1",icc:"^3.0.0","jsdoc-to-markdown":"^9.1.1","license-checker":"^25.0.1",mocha:"^11.4.0","node-addon-api":"^8.3.1",nyc:"^17.1.0",prebuild:"^13.0.1",semistandard:"^17.0.0","tar-fs":"^3.0.8",tsd:"^0.32.0"},license:"Apache-2.0",engines:{node:"^18.17.0 || ^20.3.0 || >=21.0.0"},config:{libvips:">=8.16.1"},funding:{url:"https://opencollective.com/libvips"},binary:{napi_versions:[9]},semistandard:{env:["mocha"]},cc:{linelength:"120",filter:["build/include"]},nyc:{include:["lib"]},tsd:{directory:"test/types/"}}}}),ge=O({"../../node_modules/sharp/lib/libvips.js"(P,y){"use strict";var{spawnSync:e}=D("node:child_process"),{createHash:r}=D("node:crypto"),u=Le(),b=fe(),s=Be(),f=ae(),{config:i,engines:c,optionalDependencies:n}=me(),l=process.env.npm_package_config_libvips||i.libvips,d=u(l).version,a=["darwin-arm64","darwin-x64","linux-arm","linux-arm64","linux-ppc64","linux-s390x","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],o={encoding:"utf8",shell:!0},h=I=>{I instanceof Error?console.error(`sharp: Installation error: ${I.message}`):console.log(`sharp: ${I}`)},m=()=>f.isNonGlibcLinuxSync()?f.familySync():"",p=()=>`${process.platform}${m()}-${process.arch}`,v=()=>{if(z())return"wasm32";let{npm_config_arch:I,npm_config_platform:R,npm_config_libc:w}=process.env,j=typeof w=="string"?w:m();return`${R||process.platform}${j}-${I||process.arch}`},x=()=>{try{return D(`@img/sharp-libvips-dev-${v()}/include`)}catch{try{return D("@img/sharp-libvips-dev/include")}catch{}}return""},T=()=>{try{return D("@img/sharp-libvips-dev/cplusplus")}catch{}return""},_=()=>{try{return D(`@img/sharp-libvips-dev-${v()}/lib`)}catch{try{return D(`@img/sharp-libvips-${v()}/lib`)}catch{}}return""},q=()=>{if(process.release?.name==="node"&&process.versions&&!s(process.versions.node,c.node))return{found:process.versions.node,expected:c.node}},z=()=>{let{CC:I}=process.env;return!!(I&&I.endsWith("/emcc"))},G=()=>process.platform==="darwin"&&process.arch==="x64"?(e("sysctl sysctl.proc_translated",o).stdout||"").trim()==="sysctl.proc_translated: 1":!1,U=I=>r("sha512").update(I).digest("hex"),H=()=>{try{let I=U(`imgsharp-libvips-${v()}`),R=u(n[`@img/sharp-libvips-${v()}`],{includePrerelease:!0}).version;return U(`${I}npm:${R}`).slice(0,10)}catch{}return""},g=()=>e(`node-gyp rebuild --directory=src ${z()?"--nodedir=emscripten":""}`,{...o,stdio:"inherit"}).status,S=()=>process.platform!=="win32"?(e("pkg-config --modversion vips-cpp",{...o,env:{...process.env,PKG_CONFIG_PATH:F()}}).stdout||"").trim():"",F=()=>process.platform!=="win32"?[(e('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2',o).stdout||"").trim(),process.env.PKG_CONFIG_PATH,"/usr/local/lib/pkgconfig","/usr/lib/pkgconfig","/usr/local/libdata/pkgconfig","/usr/libdata/pkgconfig"].filter(Boolean).join(":"):"",W=(I,R,w)=>(w&&w(`Detected ${R}, skipping search for globally-installed libvips`),I),Q=I=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return W(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",I);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return W(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",I);if(G())return W(!1,"Rosetta",I);let R=S();return!!R&&b(R,d)};y.exports={minimumLibvipsVersion:d,prebuiltPlatforms:a,buildPlatformArch:v,buildSharpLibvipsIncludeDir:x,buildSharpLibvipsCPlusPlusDir:T,buildSharpLibvipsLibDir:_,isUnsupportedNodeRuntime:q,runtimePlatformArch:p,log:h,yarnLocator:H,spawnRebuild:g,globalLibvipsVersion:S,pkgConfigPath:F,useGlobalLibvips:Q}}}),ie=O({"../../node_modules/sharp/lib/sharp.js"(P,y){"use strict";var{familySync:e,versionSync:r}=ae(),{runtimePlatformArch:u,isUnsupportedNodeRuntime:b,prebuiltPlatforms:s,minimumLibvipsVersion:f}=ge(),i=u(),c=[`../src/build/Release/sharp-${i}.node`,"../src/build/Release/sharp-wasm32.node",`@img/sharp-${i}/sharp.node`,"@img/sharp-wasm32/sharp.node"],n,l,d=[];for(n of c)try{l=D(n);break}catch(a){d.push(a)}if(l&&n.startsWith("@img/sharp-linux-x64")&&!l._isUsingX64V2()){let a=new Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");a.code="Unsupported CPU",d.push(a),l=null}if(l)y.exports=l;else{let[a,o,h]=["linux","darwin","win32"].map(v=>i.startsWith(v)),m=[`Could not load the "sharp" module using the ${i} runtime`];d.forEach(v=>{v.code!=="MODULE_NOT_FOUND"&&m.push(`${v.code}: ${v.message}`)});let p=d.map(v=>v.message).join(" ");if(m.push("Possible solutions:"),b()){let{found:v,expected:x}=b();m.push("- Please upgrade Node.js:",` Found ${v}`,` Requires ${x}`)}else if(s.includes(i)){let[v,x]=i.split("-"),T=v.endsWith("musl")?" --libc=musl":"";m.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=${v.replace("musl","")}${T} --cpu=${x} sharp`)}else m.push(`- Manually install libvips >= ${f}`,"- Add experimental WebAssembly-based dependencies:"," npm install --cpu=wasm32 sharp"," npm install @img/sharp-wasm32");if(a&&/(symbol not found|CXXABI_)/i.test(p))try{let{config:v}=D(`@img/sharp-libvips-${i}/package`),x=`${e()} ${r()}`,T=`${v.musl?"musl":"glibc"} ${v.musl||v.glibc}`;m.push("- Update your OS:",` Found ${x}`,` Requires ${T}`)}catch{}throw a&&/\/snap\/core[0-9]{2}/.test(p)&&m.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),o&&/Incompatible library version/.test(p)&&m.push("- Update Homebrew:"," brew update && brew upgrade vips"),d.some(v=>v.code==="ERR_DLOPEN_DISABLED")&&m.push("- Run Node.js without using the --no-addons flag"),h&&/The specified procedure could not be found/.test(p)&&m.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"),m.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(m.join(`
3
+ `))}}}),qe=O({"../../node_modules/sharp/lib/constructor.js"(P,y){"use strict";var e=D("node:util"),r=D("node:stream"),u=J();ie();var b=e.debuglog("sharp"),s=function(i,c){if(arguments.length===1&&!u.defined(i))throw new Error("Invalid input");return this instanceof s?(r.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],rotateBeforePreExtract:!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:.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:8,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:n=>{this.emit("warning",n),b(n)},queueListener:function(n){s.queue.emit("change",n)}},this.options.input=this._createInputDescriptor(i,c,{allowStream:!0}),this):new s(i,c)};Object.setPrototypeOf(s.prototype,r.Duplex.prototype),Object.setPrototypeOf(s,r.Duplex);function f(){let i=this.constructor.call(),{debuglog:c,queueListener:n,...l}=this.options;return i.options=structuredClone(l),i.options.debuglog=c,i.options.queueListener=n,this._isStreamInput()&&this.on("finish",()=>{this._flattenBufferIn(),i.options.input.buffer=this.options.input.buffer,i.emit("finish")}),i}Object.assign(s.prototype,{clone:f}),y.exports=s}}),Ge=O({"../../node_modules/sharp/lib/input.js"(P,y){"use strict";var e=J(),r=ie(),u={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"};function b(d){let{raw:a,density:o,limitInputPixels:h,ignoreIcc:m,unlimited:p,sequentialRead:v,failOn:x,failOnError:T,animated:_,page:q,pages:z,subifd:G,pdfBackground:U,autoOrient:H}=d;return[a,o,h,m,p,v,x,T,_,q,z,G,U,H].some(e.defined)?{raw:a,density:o,limitInputPixels:h,ignoreIcc:m,unlimited:p,sequentialRead:v,failOn:x,failOnError:T,animated:_,page:q,pages:z,subifd:G,pdfBackground:U,autoOrient:H}:void 0}function s(d,a,o){let h={autoOrient:!1,failOn:"warning",limitInputPixels:Math.pow(16383,2),ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(e.string(d))h.file=d;else if(e.buffer(d)){if(d.length===0)throw Error("Input Buffer is empty");h.buffer=d}else if(e.arrayBuffer(d)){if(d.byteLength===0)throw Error("Input bit Array is empty");h.buffer=Buffer.from(d,0,d.byteLength)}else if(e.typedArray(d)){if(d.length===0)throw Error("Input Bit Array is empty");h.buffer=Buffer.from(d.buffer,d.byteOffset,d.byteLength)}else if(e.plainObject(d)&&!e.defined(a))a=d,b(a)&&(h.buffer=[]);else if(!e.defined(d)&&!e.defined(a)&&e.object(o)&&o.allowStream)h.buffer=[];else if(Array.isArray(d))if(d.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=d.map(m=>this._createInputDescriptor(m));else throw new Error("Recursive join is unsupported");else throw new Error("Expected at least two images to join");else throw new Error(`Unsupported input '${d}' of type ${typeof d}${e.defined(a)?` when also providing options of type ${typeof a}`:""}`);if(e.object(a)){if(e.defined(a.failOnError))if(e.bool(a.failOnError))h.failOn=a.failOnError?"warning":"none";else throw e.invalidParameterError("failOnError","boolean",a.failOnError);if(e.defined(a.failOn))if(e.string(a.failOn)&&e.inArray(a.failOn,["none","truncated","error","warning"]))h.failOn=a.failOn;else throw e.invalidParameterError("failOn","one of: none, truncated, error, warning",a.failOn);if(e.defined(a.autoOrient))if(e.bool(a.autoOrient))h.autoOrient=a.autoOrient;else throw e.invalidParameterError("autoOrient","boolean",a.autoOrient);if(e.defined(a.density))if(e.inRange(a.density,1,1e5))h.density=a.density;else throw e.invalidParameterError("density","number between 1 and 100000",a.density);if(e.defined(a.ignoreIcc))if(e.bool(a.ignoreIcc))h.ignoreIcc=a.ignoreIcc;else throw e.invalidParameterError("ignoreIcc","boolean",a.ignoreIcc);if(e.defined(a.limitInputPixels))if(e.bool(a.limitInputPixels))h.limitInputPixels=a.limitInputPixels?Math.pow(16383,2):0;else if(e.integer(a.limitInputPixels)&&e.inRange(a.limitInputPixels,0,Number.MAX_SAFE_INTEGER))h.limitInputPixels=a.limitInputPixels;else throw e.invalidParameterError("limitInputPixels","positive integer",a.limitInputPixels);if(e.defined(a.unlimited))if(e.bool(a.unlimited))h.unlimited=a.unlimited;else throw e.invalidParameterError("unlimited","boolean",a.unlimited);if(e.defined(a.sequentialRead))if(e.bool(a.sequentialRead))h.sequentialRead=a.sequentialRead;else throw e.invalidParameterError("sequentialRead","boolean",a.sequentialRead);if(e.defined(a.raw))if(e.object(a.raw)&&e.integer(a.raw.width)&&a.raw.width>0&&e.integer(a.raw.height)&&a.raw.height>0&&e.integer(a.raw.channels)&&e.inRange(a.raw.channels,1,4))switch(h.rawWidth=a.raw.width,h.rawHeight=a.raw.height,h.rawChannels=a.raw.channels,h.rawPremultiplied=!!a.raw.premultiplied,d.constructor){case Uint8Array:case Uint8ClampedArray:h.rawDepth="uchar";break;case Int8Array:h.rawDepth="char";break;case Uint16Array:h.rawDepth="ushort";break;case Int16Array:h.rawDepth="short";break;case Uint32Array:h.rawDepth="uint";break;case Int32Array:h.rawDepth="int";break;case Float32Array:h.rawDepth="float";break;case Float64Array:h.rawDepth="double";break;default:h.rawDepth="uchar";break}else throw new Error("Expected width, height and channels for raw pixel input");if(e.defined(a.animated))if(e.bool(a.animated))h.pages=a.animated?-1:1;else throw e.invalidParameterError("animated","boolean",a.animated);if(e.defined(a.pages))if(e.integer(a.pages)&&e.inRange(a.pages,-1,1e5))h.pages=a.pages;else throw e.invalidParameterError("pages","integer between -1 and 100000",a.pages);if(e.defined(a.page))if(e.integer(a.page)&&e.inRange(a.page,0,1e5))h.page=a.page;else throw e.invalidParameterError("page","integer between 0 and 100000",a.page);if(e.defined(a.level))if(e.integer(a.level)&&e.inRange(a.level,0,256))h.level=a.level;else throw e.invalidParameterError("level","integer between 0 and 256",a.level);if(e.defined(a.subifd))if(e.integer(a.subifd)&&e.inRange(a.subifd,-1,1e5))h.subifd=a.subifd;else throw e.invalidParameterError("subifd","integer between -1 and 100000",a.subifd);if(e.defined(a.pdfBackground)&&(h.pdfBackground=this._getBackgroundColourOption(a.pdfBackground)),e.defined(a.create))if(e.object(a.create)&&e.integer(a.create.width)&&a.create.width>0&&e.integer(a.create.height)&&a.create.height>0&&e.integer(a.create.channels)){if(h.createWidth=a.create.width,h.createHeight=a.create.height,h.createChannels=a.create.channels,e.defined(a.create.noise)){if(!e.object(a.create.noise))throw new Error("Expected noise to be an object");if(!e.inArray(a.create.noise.type,["gaussian"]))throw new Error("Only gaussian noise is supported at the moment");if(!e.inRange(a.create.channels,1,4))throw e.invalidParameterError("create.channels","number between 1 and 4",a.create.channels);if(h.createNoiseType=a.create.noise.type,e.number(a.create.noise.mean)&&e.inRange(a.create.noise.mean,0,1e4))h.createNoiseMean=a.create.noise.mean;else throw e.invalidParameterError("create.noise.mean","number between 0 and 10000",a.create.noise.mean);if(e.number(a.create.noise.sigma)&&e.inRange(a.create.noise.sigma,0,1e4))h.createNoiseSigma=a.create.noise.sigma;else throw e.invalidParameterError("create.noise.sigma","number between 0 and 10000",a.create.noise.sigma)}else if(e.defined(a.create.background)){if(!e.inRange(a.create.channels,3,4))throw e.invalidParameterError("create.channels","number between 3 and 4",a.create.channels);h.createBackground=this._getBackgroundColourOption(a.create.background)}else throw new Error("Expected valid noise or background to create a new input image");delete h.buffer}else throw new Error("Expected valid width, height and channels to create a new input image");if(e.defined(a.text))if(e.object(a.text)&&e.string(a.text.text)){if(h.textValue=a.text.text,e.defined(a.text.height)&&e.defined(a.text.dpi))throw new Error("Expected only one of dpi or height");if(e.defined(a.text.font))if(e.string(a.text.font))h.textFont=a.text.font;else throw e.invalidParameterError("text.font","string",a.text.font);if(e.defined(a.text.fontfile))if(e.string(a.text.fontfile))h.textFontfile=a.text.fontfile;else throw e.invalidParameterError("text.fontfile","string",a.text.fontfile);if(e.defined(a.text.width))if(e.integer(a.text.width)&&a.text.width>0)h.textWidth=a.text.width;else throw e.invalidParameterError("text.width","positive integer",a.text.width);if(e.defined(a.text.height))if(e.integer(a.text.height)&&a.text.height>0)h.textHeight=a.text.height;else throw e.invalidParameterError("text.height","positive integer",a.text.height);if(e.defined(a.text.align))if(e.string(a.text.align)&&e.string(this.constructor.align[a.text.align]))h.textAlign=this.constructor.align[a.text.align];else throw e.invalidParameterError("text.align","valid alignment",a.text.align);if(e.defined(a.text.justify))if(e.bool(a.text.justify))h.textJustify=a.text.justify;else throw e.invalidParameterError("text.justify","boolean",a.text.justify);if(e.defined(a.text.dpi))if(e.integer(a.text.dpi)&&e.inRange(a.text.dpi,1,1e6))h.textDpi=a.text.dpi;else throw e.invalidParameterError("text.dpi","integer between 1 and 1000000",a.text.dpi);if(e.defined(a.text.rgba))if(e.bool(a.text.rgba))h.textRgba=a.text.rgba;else throw e.invalidParameterError("text.rgba","bool",a.text.rgba);if(e.defined(a.text.spacing))if(e.integer(a.text.spacing)&&e.inRange(a.text.spacing,-1e6,1e6))h.textSpacing=a.text.spacing;else throw e.invalidParameterError("text.spacing","integer between -1000000 and 1000000",a.text.spacing);if(e.defined(a.text.wrap))if(e.string(a.text.wrap)&&e.inArray(a.text.wrap,["word","char","word-char","none"]))h.textWrap=a.text.wrap;else throw e.invalidParameterError("text.wrap","one of: word, char, word-char, none",a.text.wrap);delete h.buffer}else throw new Error("Expected a valid string to create an image with text.");if(e.defined(a.join))if(e.defined(this.options.join)){if(e.defined(a.join.animated))if(e.bool(a.join.animated))h.joinAnimated=a.join.animated;else throw e.invalidParameterError("join.animated","boolean",a.join.animated);if(e.defined(a.join.across))if(e.integer(a.join.across)&&e.inRange(a.join.across,1,1e6))h.joinAcross=a.join.across;else throw e.invalidParameterError("join.across","integer between 1 and 100000",a.join.across);if(e.defined(a.join.shim))if(e.integer(a.join.shim)&&e.inRange(a.join.shim,0,1e6))h.joinShim=a.join.shim;else throw e.invalidParameterError("join.shim","integer between 0 and 100000",a.join.shim);if(e.defined(a.join.background)&&(h.joinBackground=this._getBackgroundColourOption(a.join.background)),e.defined(a.join.halign))if(e.string(a.join.halign)&&e.string(this.constructor.align[a.join.halign]))h.joinHalign=this.constructor.align[a.join.halign];else throw e.invalidParameterError("join.halign","valid alignment",a.join.halign);if(e.defined(a.join.valign))if(e.string(a.join.valign)&&e.string(this.constructor.align[a.join.valign]))h.joinValign=this.constructor.align[a.join.valign];else throw e.invalidParameterError("join.valign","valid alignment",a.join.valign)}else throw new Error("Expected input to be an array of images to join")}else if(e.defined(a))throw new Error("Invalid input options "+a);return h}function f(d,a,o){Array.isArray(this.options.input.buffer)?e.buffer(d)?(this.options.input.buffer.length===0&&this.on("finish",()=>{this.streamInFinished=!0}),this.options.input.buffer.push(d),o()):o(new Error("Non-Buffer data on Writable Stream")):o(new Error("Unexpected data on Writable Stream"))}function i(){this._isStreamInput()&&(this.options.input.buffer=Buffer.concat(this.options.input.buffer))}function c(){return Array.isArray(this.options.input.buffer)}function n(d){let a=Error();return e.fn(d)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),r.metadata(this.options,(o,h)=>{o?d(e.nativeError(o,a)):d(null,h)})}):r.metadata(this.options,(o,h)=>{o?d(e.nativeError(o,a)):d(null,h)}),this):this._isStreamInput()?new Promise((o,h)=>{let m=()=>{this._flattenBufferIn(),r.metadata(this.options,(p,v)=>{p?h(e.nativeError(p,a)):o(v)})};this.writableFinished?m():this.once("finish",m)}):new Promise((o,h)=>{r.metadata(this.options,(m,p)=>{m?h(e.nativeError(m,a)):o(p)})})}function l(d){let a=Error();return e.fn(d)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),r.stats(this.options,(o,h)=>{o?d(e.nativeError(o,a)):d(null,h)})}):r.stats(this.options,(o,h)=>{o?d(e.nativeError(o,a)):d(null,h)}),this):this._isStreamInput()?new Promise((o,h)=>{this.on("finish",function(){this._flattenBufferIn(),r.stats(this.options,(m,p)=>{m?h(e.nativeError(m,a)):o(p)})})}):new Promise((o,h)=>{r.stats(this.options,(m,p)=>{m?h(e.nativeError(m,a)):o(p)})})}y.exports=function(d){Object.assign(d.prototype,{_inputOptionsFromObject:b,_createInputDescriptor:s,_write:f,_flattenBufferIn:i,_isStreamInput:c,metadata:n,stats:l}),d.align=u}}}),ze=O({"../../node_modules/sharp/lib/resize.js"(P,y){"use strict";var e=J(),r={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},u={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},b={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},s={entropy:16,attention:17},f={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},i={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},c={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};function n(m){return m.angle%360!==0||m.input.autoOrient===!0||m.rotationAngle!==0}function l(m){return m.width!==-1||m.height!==-1}function d(m,p,v){if(l(this.options)&&this.options.debuglog("ignoring previous resize options"),this.options.widthPost!==-1&&this.options.debuglog("operation order will be: extract, resize, extract"),e.defined(m))if(e.object(m)&&!e.defined(v))v=m;else if(e.integer(m)&&m>0)this.options.width=m;else throw e.invalidParameterError("width","positive integer",m);else this.options.width=-1;if(e.defined(p))if(e.integer(p)&&p>0)this.options.height=p;else throw e.invalidParameterError("height","positive integer",p);else this.options.height=-1;if(e.object(v)){if(e.defined(v.width))if(e.integer(v.width)&&v.width>0)this.options.width=v.width;else throw e.invalidParameterError("width","positive integer",v.width);if(e.defined(v.height))if(e.integer(v.height)&&v.height>0)this.options.height=v.height;else throw e.invalidParameterError("height","positive integer",v.height);if(e.defined(v.fit)){let x=c[v.fit];if(e.string(x))this.options.canvas=x;else throw e.invalidParameterError("fit","valid fit",v.fit)}if(e.defined(v.position)){let x=e.integer(v.position)?v.position:s[v.position]||u[v.position]||r[v.position];if(e.integer(x)&&(e.inRange(x,0,8)||e.inRange(x,16,17)))this.options.position=x;else throw e.invalidParameterError("position","valid position/gravity/strategy",v.position)}if(this._setBackgroundColourOption("resizeBackground",v.background),e.defined(v.kernel))if(e.string(f[v.kernel]))this.options.kernel=f[v.kernel];else throw e.invalidParameterError("kernel","valid kernel name",v.kernel);e.defined(v.withoutEnlargement)&&this._setBooleanOption("withoutEnlargement",v.withoutEnlargement),e.defined(v.withoutReduction)&&this._setBooleanOption("withoutReduction",v.withoutReduction),e.defined(v.fastShrinkOnLoad)&&this._setBooleanOption("fastShrinkOnLoad",v.fastShrinkOnLoad)}return n(this.options)&&l(this.options)&&(this.options.rotateBeforePreExtract=!0),this}function a(m){if(e.integer(m)&&m>0)this.options.extendTop=m,this.options.extendBottom=m,this.options.extendLeft=m,this.options.extendRight=m;else if(e.object(m)){if(e.defined(m.top))if(e.integer(m.top)&&m.top>=0)this.options.extendTop=m.top;else throw e.invalidParameterError("top","positive integer",m.top);if(e.defined(m.bottom))if(e.integer(m.bottom)&&m.bottom>=0)this.options.extendBottom=m.bottom;else throw e.invalidParameterError("bottom","positive integer",m.bottom);if(e.defined(m.left))if(e.integer(m.left)&&m.left>=0)this.options.extendLeft=m.left;else throw e.invalidParameterError("left","positive integer",m.left);if(e.defined(m.right))if(e.integer(m.right)&&m.right>=0)this.options.extendRight=m.right;else throw e.invalidParameterError("right","positive integer",m.right);if(this._setBackgroundColourOption("extendBackground",m.background),e.defined(m.extendWith))if(e.string(b[m.extendWith]))this.options.extendWith=b[m.extendWith];else throw e.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",m.extendWith)}else throw e.invalidParameterError("extend","integer or object",m);return this}function o(m){let p=l(this.options)||this.options.widthPre!==-1?"Post":"Pre";return this.options[`width${p}`]!==-1&&this.options.debuglog("ignoring previous extract options"),["left","top","width","height"].forEach(function(v){let x=m[v];if(e.integer(x)&&x>=0)this.options[v+(v==="left"||v==="top"?"Offset":"")+p]=x;else throw e.invalidParameterError(v,"integer",x)},this),n(this.options)&&!l(this.options)&&(this.options.widthPre===-1||this.options.widthPost===-1)&&(this.options.rotateBeforePreExtract=!0),this}function h(m){if(this.options.trimThreshold=10,e.defined(m))if(e.object(m)){if(e.defined(m.background)&&this._setBackgroundColourOption("trimBackground",m.background),e.defined(m.threshold))if(e.number(m.threshold)&&m.threshold>=0)this.options.trimThreshold=m.threshold;else throw e.invalidParameterError("threshold","positive number",m.threshold);e.defined(m.lineArt)&&this._setBooleanOption("trimLineArt",m.lineArt)}else throw e.invalidParameterError("trim","object",m);return n(this.options)&&(this.options.rotateBeforePreExtract=!0),this}y.exports=function(m){Object.assign(m.prototype,{resize:d,extend:a,extract:o,trim:h}),m.gravity=r,m.strategy=s,m.kernel=f,m.fit=i,m.position=u}}}),Ue=O({"../../node_modules/sharp/lib/composite.js"(P,y){"use strict";var e=J(),r={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 u(b){if(!Array.isArray(b))throw e.invalidParameterError("images to composite","array",b);return this.options.composite=b.map(s=>{if(!e.object(s))throw e.invalidParameterError("image to composite","object",s);let f=this._inputOptionsFromObject(s),i={input:this._createInputDescriptor(s.input,f,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(e.defined(s.blend))if(e.string(r[s.blend]))i.blend=r[s.blend];else throw e.invalidParameterError("blend","valid blend name",s.blend);if(e.defined(s.tile))if(e.bool(s.tile))i.tile=s.tile;else throw e.invalidParameterError("tile","boolean",s.tile);if(e.defined(s.left))if(e.integer(s.left))i.left=s.left;else throw e.invalidParameterError("left","integer",s.left);if(e.defined(s.top))if(e.integer(s.top))i.top=s.top;else throw e.invalidParameterError("top","integer",s.top);if(e.defined(s.top)!==e.defined(s.left))throw new Error("Expected both left and top to be set");if(i.hasOffset=e.integer(s.top)&&e.integer(s.left),e.defined(s.gravity))if(e.integer(s.gravity)&&e.inRange(s.gravity,0,8))i.gravity=s.gravity;else if(e.string(s.gravity)&&e.integer(this.constructor.gravity[s.gravity]))i.gravity=this.constructor.gravity[s.gravity];else throw e.invalidParameterError("gravity","valid gravity",s.gravity);if(e.defined(s.premultiplied))if(e.bool(s.premultiplied))i.premultiplied=s.premultiplied;else throw e.invalidParameterError("premultiplied","boolean",s.premultiplied);return i}),this}y.exports=function(b){b.prototype.composite=u,b.blend=r}}}),He=O({"../../node_modules/sharp/lib/operation.js"(P,y){"use strict";var e=J(),r={integer:"integer",float:"float",approximate:"approximate"};function u(g,S){if(!e.defined(g))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),e.integer(g)&&!(g%90))this.options.angle=g;else if(e.number(g))this.options.rotationAngle=g,e.object(S)&&S.background&&this._setBackgroundColourOption("rotationBackground",S.background);else throw e.invalidParameterError("angle","numeric",g);return this}function b(){return this.options.input.autoOrient=!0,this}function s(g){return this.options.flip=e.bool(g)?g:!0,this}function f(g){return this.options.flop=e.bool(g)?g:!0,this}function i(g,S){let F=[].concat(...g);if(F.length===4&&F.every(e.number))this.options.affineMatrix=F;else throw e.invalidParameterError("matrix","1x4 or 2x2 array",g);if(e.defined(S))if(e.object(S)){if(this._setBackgroundColourOption("affineBackground",S.background),e.defined(S.idx))if(e.number(S.idx))this.options.affineIdx=S.idx;else throw e.invalidParameterError("options.idx","number",S.idx);if(e.defined(S.idy))if(e.number(S.idy))this.options.affineIdy=S.idy;else throw e.invalidParameterError("options.idy","number",S.idy);if(e.defined(S.odx))if(e.number(S.odx))this.options.affineOdx=S.odx;else throw e.invalidParameterError("options.odx","number",S.odx);if(e.defined(S.ody))if(e.number(S.ody))this.options.affineOdy=S.ody;else throw e.invalidParameterError("options.ody","number",S.ody);if(e.defined(S.interpolator))if(e.inArray(S.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=S.interpolator;else throw e.invalidParameterError("options.interpolator","valid interpolator name",S.interpolator)}else throw e.invalidParameterError("options","object",S);return this}function c(g,S,F){if(!e.defined(g))this.options.sharpenSigma=-1;else if(e.bool(g))this.options.sharpenSigma=g?-1:0;else if(e.number(g)&&e.inRange(g,.01,1e4)){if(this.options.sharpenSigma=g,e.defined(S))if(e.number(S)&&e.inRange(S,0,1e4))this.options.sharpenM1=S;else throw e.invalidParameterError("flat","number between 0 and 10000",S);if(e.defined(F))if(e.number(F)&&e.inRange(F,0,1e4))this.options.sharpenM2=F;else throw e.invalidParameterError("jagged","number between 0 and 10000",F)}else if(e.plainObject(g)){if(e.number(g.sigma)&&e.inRange(g.sigma,1e-6,10))this.options.sharpenSigma=g.sigma;else throw e.invalidParameterError("options.sigma","number between 0.000001 and 10",g.sigma);if(e.defined(g.m1))if(e.number(g.m1)&&e.inRange(g.m1,0,1e6))this.options.sharpenM1=g.m1;else throw e.invalidParameterError("options.m1","number between 0 and 1000000",g.m1);if(e.defined(g.m2))if(e.number(g.m2)&&e.inRange(g.m2,0,1e6))this.options.sharpenM2=g.m2;else throw e.invalidParameterError("options.m2","number between 0 and 1000000",g.m2);if(e.defined(g.x1))if(e.number(g.x1)&&e.inRange(g.x1,0,1e6))this.options.sharpenX1=g.x1;else throw e.invalidParameterError("options.x1","number between 0 and 1000000",g.x1);if(e.defined(g.y2))if(e.number(g.y2)&&e.inRange(g.y2,0,1e6))this.options.sharpenY2=g.y2;else throw e.invalidParameterError("options.y2","number between 0 and 1000000",g.y2);if(e.defined(g.y3))if(e.number(g.y3)&&e.inRange(g.y3,0,1e6))this.options.sharpenY3=g.y3;else throw e.invalidParameterError("options.y3","number between 0 and 1000000",g.y3)}else throw e.invalidParameterError("sigma","number between 0.01 and 10000",g);return this}function n(g){if(!e.defined(g))this.options.medianSize=3;else if(e.integer(g)&&e.inRange(g,1,1e3))this.options.medianSize=g;else throw e.invalidParameterError("size","integer between 1 and 1000",g);return this}function l(g){let S;if(e.number(g))S=g;else if(e.plainObject(g)){if(!e.number(g.sigma))throw e.invalidParameterError("options.sigma","number between 0.3 and 1000",S);if(S=g.sigma,"precision"in g)if(e.string(r[g.precision]))this.options.precision=r[g.precision];else throw e.invalidParameterError("precision","one of: integer, float, approximate",g.precision);if("minAmplitude"in g)if(e.number(g.minAmplitude)&&e.inRange(g.minAmplitude,.001,1))this.options.minAmpl=g.minAmplitude;else throw e.invalidParameterError("minAmplitude","number between 0.001 and 1",g.minAmplitude)}if(!e.defined(g))this.options.blurSigma=-1;else if(e.bool(g))this.options.blurSigma=g?-1:0;else if(e.number(S)&&e.inRange(S,.3,1e3))this.options.blurSigma=S;else throw e.invalidParameterError("sigma","number between 0.3 and 1000",S);return this}function d(g){if(!e.defined(g))this.options.dilateWidth=1;else if(e.integer(g)&&g>0)this.options.dilateWidth=g;else throw e.invalidParameterError("dilate","positive integer",d);return this}function a(g){if(!e.defined(g))this.options.erodeWidth=1;else if(e.integer(g)&&g>0)this.options.erodeWidth=g;else throw e.invalidParameterError("erode","positive integer",a);return this}function o(g){return this.options.flatten=e.bool(g)?g:!0,e.object(g)&&this._setBackgroundColourOption("flattenBackground",g.background),this}function h(){return this.options.unflatten=!0,this}function m(g,S){if(!e.defined(g))this.options.gamma=2.2;else if(e.number(g)&&e.inRange(g,1,3))this.options.gamma=g;else throw e.invalidParameterError("gamma","number between 1.0 and 3.0",g);if(!e.defined(S))this.options.gammaOut=this.options.gamma;else if(e.number(S)&&e.inRange(S,1,3))this.options.gammaOut=S;else throw e.invalidParameterError("gammaOut","number between 1.0 and 3.0",S);return this}function p(g){if(this.options.negate=e.bool(g)?g:!0,e.plainObject(g)&&"alpha"in g)if(e.bool(g.alpha))this.options.negateAlpha=g.alpha;else throw e.invalidParameterError("alpha","should be boolean value",g.alpha);return this}function v(g){if(e.plainObject(g)){if(e.defined(g.lower))if(e.number(g.lower)&&e.inRange(g.lower,0,99))this.options.normaliseLower=g.lower;else throw e.invalidParameterError("lower","number between 0 and 99",g.lower);if(e.defined(g.upper))if(e.number(g.upper)&&e.inRange(g.upper,1,100))this.options.normaliseUpper=g.upper;else throw e.invalidParameterError("upper","number between 1 and 100",g.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw e.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function x(g){return this.normalise(g)}function T(g){if(e.plainObject(g)){if(e.integer(g.width)&&g.width>0)this.options.claheWidth=g.width;else throw e.invalidParameterError("width","integer greater than zero",g.width);if(e.integer(g.height)&&g.height>0)this.options.claheHeight=g.height;else throw e.invalidParameterError("height","integer greater than zero",g.height);if(e.defined(g.maxSlope))if(e.integer(g.maxSlope)&&e.inRange(g.maxSlope,0,100))this.options.claheMaxSlope=g.maxSlope;else throw e.invalidParameterError("maxSlope","integer between 0 and 100",g.maxSlope)}else throw e.invalidParameterError("options","plain object",g);return this}function _(g){if(!e.object(g)||!Array.isArray(g.kernel)||!e.integer(g.width)||!e.integer(g.height)||!e.inRange(g.width,3,1001)||!e.inRange(g.height,3,1001)||g.height*g.width!==g.kernel.length)throw new Error("Invalid convolution kernel");return e.integer(g.scale)||(g.scale=g.kernel.reduce(function(S,F){return S+F},0)),g.scale<1&&(g.scale=1),e.integer(g.offset)||(g.offset=0),this.options.convKernel=g,this}function q(g,S){if(!e.defined(g))this.options.threshold=128;else if(e.bool(g))this.options.threshold=g?128:0;else if(e.integer(g)&&e.inRange(g,0,255))this.options.threshold=g;else throw e.invalidParameterError("threshold","integer between 0 and 255",g);return!e.object(S)||S.greyscale===!0||S.grayscale===!0?this.options.thresholdGrayscale=!0:this.options.thresholdGrayscale=!1,this}function z(g,S,F){if(this.options.boolean=this._createInputDescriptor(g,F),e.string(S)&&e.inArray(S,["and","or","eor"]))this.options.booleanOp=S;else throw e.invalidParameterError("operator","one of: and, or, eor",S);return this}function G(g,S){if(!e.defined(g)&&e.number(S)?g=1:e.number(g)&&!e.defined(S)&&(S=0),!e.defined(g))this.options.linearA=[];else if(e.number(g))this.options.linearA=[g];else if(Array.isArray(g)&&g.length&&g.every(e.number))this.options.linearA=g;else throw e.invalidParameterError("a","number or array of numbers",g);if(!e.defined(S))this.options.linearB=[];else if(e.number(S))this.options.linearB=[S];else if(Array.isArray(S)&&S.length&&S.every(e.number))this.options.linearB=S;else throw e.invalidParameterError("b","number or array of numbers",S);if(this.options.linearA.length!==this.options.linearB.length)throw new Error("Expected a and b to be arrays of the same length");return this}function U(g){if(!Array.isArray(g))throw e.invalidParameterError("inputMatrix","array",g);if(g.length!==3&&g.length!==4)throw e.invalidParameterError("inputMatrix","3x3 or 4x4 array",g.length);let S=g.flat().map(Number);if(S.length!==9&&S.length!==16)throw e.invalidParameterError("inputMatrix","cardinality of 9 or 16",S.length);return this.options.recombMatrix=S,this}function H(g){if(!e.plainObject(g))throw e.invalidParameterError("options","plain object",g);if("brightness"in g)if(e.number(g.brightness)&&g.brightness>=0)this.options.brightness=g.brightness;else throw e.invalidParameterError("brightness","number above zero",g.brightness);if("saturation"in g)if(e.number(g.saturation)&&g.saturation>=0)this.options.saturation=g.saturation;else throw e.invalidParameterError("saturation","number above zero",g.saturation);if("hue"in g)if(e.integer(g.hue))this.options.hue=g.hue%360;else throw e.invalidParameterError("hue","number",g.hue);if("lightness"in g)if(e.number(g.lightness))this.options.lightness=g.lightness;else throw e.invalidParameterError("lightness","number",g.lightness);return this}y.exports=function(g){Object.assign(g.prototype,{autoOrient:b,rotate:u,flip:s,flop:f,affine:i,sharpen:c,erode:a,dilate:d,median:n,blur:l,flatten:o,unflatten:h,gamma:m,negate:p,normalise:v,normalize:x,clahe:T,convolve:_,threshold:q,boolean:z,linear:G,recomb:U,modulate:H})}}}),pe=O({"../../node_modules/color-name/index.js"(P,y){"use strict";y.exports={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]}}}),We=O({"../../node_modules/simple-swizzle/node_modules/is-arrayish/index.js"(P,y){y.exports=function(r){return!r||typeof r=="string"?!1:r instanceof Array||Array.isArray(r)||r.length>=0&&(r.splice instanceof Function||Object.getOwnPropertyDescriptor(r,r.length-1)&&r.constructor.name!=="String")}}}),Xe=O({"../../node_modules/simple-swizzle/index.js"(P,y){"use strict";var e=We(),r=Array.prototype.concat,u=Array.prototype.slice,b=y.exports=function(f){for(var i=[],c=0,n=f.length;c<n;c++){var l=f[c];e(l)?i=r.call(i,u.call(l)):i.push(l)}return i};b.wrap=function(s){return function(){return s(b(arguments))}}}}),Ve=O({"../../node_modules/color-string/index.js"(P,y){var e=pe(),r=Xe(),u=Object.hasOwnProperty,b=Object.create(null);for(s in e)u.call(e,s)&&(b[e[s]]=s);var s,f=y.exports={to:{},get:{}};f.get=function(n){var l=n.substring(0,3).toLowerCase(),d,a;switch(l){case"hsl":d=f.get.hsl(n),a="hsl";break;case"hwb":d=f.get.hwb(n),a="hwb";break;default:d=f.get.rgb(n),a="rgb";break}return d?{model:a,value:d}:null},f.get.rgb=function(n){if(!n)return null;var l=/^#([a-f0-9]{3,4})$/i,d=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,a=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,h=/^(\w+)$/,m=[0,0,0,1],p,v,x;if(p=n.match(d)){for(x=p[2],p=p[1],v=0;v<3;v++){var T=v*2;m[v]=parseInt(p.slice(T,T+2),16)}x&&(m[3]=parseInt(x,16)/255)}else if(p=n.match(l)){for(p=p[1],x=p[3],v=0;v<3;v++)m[v]=parseInt(p[v]+p[v],16);x&&(m[3]=parseInt(x+x,16)/255)}else if(p=n.match(a)){for(v=0;v<3;v++)m[v]=parseInt(p[v+1],0);p[4]&&(p[5]?m[3]=parseFloat(p[4])*.01:m[3]=parseFloat(p[4]))}else if(p=n.match(o)){for(v=0;v<3;v++)m[v]=Math.round(parseFloat(p[v+1])*2.55);p[4]&&(p[5]?m[3]=parseFloat(p[4])*.01:m[3]=parseFloat(p[4]))}else return(p=n.match(h))?p[1]==="transparent"?[0,0,0,0]:u.call(e,p[1])?(m=e[p[1]],m[3]=1,m):null:null;for(v=0;v<3;v++)m[v]=i(m[v],0,255);return m[3]=i(m[3],0,1),m},f.get.hsl=function(n){if(!n)return null;var l=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,d=n.match(l);if(d){var a=parseFloat(d[4]),o=(parseFloat(d[1])%360+360)%360,h=i(parseFloat(d[2]),0,100),m=i(parseFloat(d[3]),0,100),p=i(isNaN(a)?1:a,0,1);return[o,h,m,p]}return null},f.get.hwb=function(n){if(!n)return null;var l=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,d=n.match(l);if(d){var a=parseFloat(d[4]),o=(parseFloat(d[1])%360+360)%360,h=i(parseFloat(d[2]),0,100),m=i(parseFloat(d[3]),0,100),p=i(isNaN(a)?1:a,0,1);return[o,h,m,p]}return null},f.to.hex=function(){var n=r(arguments);return"#"+c(n[0])+c(n[1])+c(n[2])+(n[3]<1?c(Math.round(n[3]*255)):"")},f.to.rgb=function(){var n=r(arguments);return n.length<4||n[3]===1?"rgb("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+")":"rgba("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+", "+n[3]+")"},f.to.rgb.percent=function(){var n=r(arguments),l=Math.round(n[0]/255*100),d=Math.round(n[1]/255*100),a=Math.round(n[2]/255*100);return n.length<4||n[3]===1?"rgb("+l+"%, "+d+"%, "+a+"%)":"rgba("+l+"%, "+d+"%, "+a+"%, "+n[3]+")"},f.to.hsl=function(){var n=r(arguments);return n.length<4||n[3]===1?"hsl("+n[0]+", "+n[1]+"%, "+n[2]+"%)":"hsla("+n[0]+", "+n[1]+"%, "+n[2]+"%, "+n[3]+")"},f.to.hwb=function(){var n=r(arguments),l="";return n.length>=4&&n[3]!==1&&(l=", "+n[3]),"hwb("+n[0]+", "+n[1]+"%, "+n[2]+"%"+l+")"},f.to.keyword=function(n){return b[n.slice(0,3)]};function i(n,l,d){return Math.min(Math.max(l,n),d)}function c(n){var l=Math.round(n).toString(16).toUpperCase();return l.length<2?"0"+l:l}}}),ve=O({"../../node_modules/color-convert/conversions.js"(P,y){var e=pe(),r={};for(let s of Object.keys(e))r[e[s]]=s;var u={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},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"]}};y.exports=u;for(let s of Object.keys(u)){if(!("channels"in u[s]))throw new Error("missing channels property: "+s);if(!("labels"in u[s]))throw new Error("missing channel labels property: "+s);if(u[s].labels.length!==u[s].channels)throw new Error("channel and label counts mismatch: "+s);let{channels:f,labels:i}=u[s];delete u[s].channels,delete u[s].labels,Object.defineProperty(u[s],"channels",{value:f}),Object.defineProperty(u[s],"labels",{value:i})}u.rgb.hsl=function(s){let f=s[0]/255,i=s[1]/255,c=s[2]/255,n=Math.min(f,i,c),l=Math.max(f,i,c),d=l-n,a,o;l===n?a=0:f===l?a=(i-c)/d:i===l?a=2+(c-f)/d:c===l&&(a=4+(f-i)/d),a=Math.min(a*60,360),a<0&&(a+=360);let h=(n+l)/2;return l===n?o=0:h<=.5?o=d/(l+n):o=d/(2-l-n),[a,o*100,h*100]},u.rgb.hsv=function(s){let f,i,c,n,l,d=s[0]/255,a=s[1]/255,o=s[2]/255,h=Math.max(d,a,o),m=h-Math.min(d,a,o),p=function(v){return(h-v)/6/m+1/2};return m===0?(n=0,l=0):(l=m/h,f=p(d),i=p(a),c=p(o),d===h?n=c-i:a===h?n=1/3+f-c:o===h&&(n=2/3+i-f),n<0?n+=1:n>1&&(n-=1)),[n*360,l*100,h*100]},u.rgb.hwb=function(s){let f=s[0],i=s[1],c=s[2],n=u.rgb.hsl(s)[0],l=1/255*Math.min(f,Math.min(i,c));return c=1-1/255*Math.max(f,Math.max(i,c)),[n,l*100,c*100]},u.rgb.cmyk=function(s){let f=s[0]/255,i=s[1]/255,c=s[2]/255,n=Math.min(1-f,1-i,1-c),l=(1-f-n)/(1-n)||0,d=(1-i-n)/(1-n)||0,a=(1-c-n)/(1-n)||0;return[l*100,d*100,a*100,n*100]};function b(s,f){return(s[0]-f[0])**2+(s[1]-f[1])**2+(s[2]-f[2])**2}u.rgb.keyword=function(s){let f=r[s];if(f)return f;let i=1/0,c;for(let n of Object.keys(e)){let l=e[n],d=b(s,l);d<i&&(i=d,c=n)}return c},u.keyword.rgb=function(s){return e[s]},u.rgb.xyz=function(s){let f=s[0]/255,i=s[1]/255,c=s[2]/255;f=f>.04045?((f+.055)/1.055)**2.4:f/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,c=c>.04045?((c+.055)/1.055)**2.4:c/12.92;let n=f*.4124+i*.3576+c*.1805,l=f*.2126+i*.7152+c*.0722,d=f*.0193+i*.1192+c*.9505;return[n*100,l*100,d*100]},u.rgb.lab=function(s){let f=u.rgb.xyz(s),i=f[0],c=f[1],n=f[2];i/=95.047,c/=100,n/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,c=c>.008856?c**(1/3):7.787*c+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let l=116*c-16,d=500*(i-c),a=200*(c-n);return[l,d,a]},u.hsl.rgb=function(s){let f=s[0]/360,i=s[1]/100,c=s[2]/100,n,l,d;if(i===0)return d=c*255,[d,d,d];c<.5?n=c*(1+i):n=c+i-c*i;let a=2*c-n,o=[0,0,0];for(let h=0;h<3;h++)l=f+1/3*-(h-1),l<0&&l++,l>1&&l--,6*l<1?d=a+(n-a)*6*l:2*l<1?d=n:3*l<2?d=a+(n-a)*(2/3-l)*6:d=a,o[h]=d*255;return o},u.hsl.hsv=function(s){let f=s[0],i=s[1]/100,c=s[2]/100,n=i,l=Math.max(c,.01);c*=2,i*=c<=1?c:2-c,n*=l<=1?l:2-l;let d=(c+i)/2,a=c===0?2*n/(l+n):2*i/(c+i);return[f,a*100,d*100]},u.hsv.rgb=function(s){let f=s[0]/60,i=s[1]/100,c=s[2]/100,n=Math.floor(f)%6,l=f-Math.floor(f),d=255*c*(1-i),a=255*c*(1-i*l),o=255*c*(1-i*(1-l));switch(c*=255,n){case 0:return[c,o,d];case 1:return[a,c,d];case 2:return[d,c,o];case 3:return[d,a,c];case 4:return[o,d,c];case 5:return[c,d,a]}},u.hsv.hsl=function(s){let f=s[0],i=s[1]/100,c=s[2]/100,n=Math.max(c,.01),l,d;d=(2-i)*c;let a=(2-i)*n;return l=i*n,l/=a<=1?a:2-a,l=l||0,d/=2,[f,l*100,d*100]},u.hwb.rgb=function(s){let f=s[0]/360,i=s[1]/100,c=s[2]/100,n=i+c,l;n>1&&(i/=n,c/=n);let d=Math.floor(6*f),a=1-c;l=6*f-d,(d&1)!==0&&(l=1-l);let o=i+l*(a-i),h,m,p;switch(d){default:case 6:case 0:h=a,m=o,p=i;break;case 1:h=o,m=a,p=i;break;case 2:h=i,m=a,p=o;break;case 3:h=i,m=o,p=a;break;case 4:h=o,m=i,p=a;break;case 5:h=a,m=i,p=o;break}return[h*255,m*255,p*255]},u.cmyk.rgb=function(s){let f=s[0]/100,i=s[1]/100,c=s[2]/100,n=s[3]/100,l=1-Math.min(1,f*(1-n)+n),d=1-Math.min(1,i*(1-n)+n),a=1-Math.min(1,c*(1-n)+n);return[l*255,d*255,a*255]},u.xyz.rgb=function(s){let f=s[0]/100,i=s[1]/100,c=s[2]/100,n,l,d;return n=f*3.2406+i*-1.5372+c*-.4986,l=f*-.9689+i*1.8758+c*.0415,d=f*.0557+i*-.204+c*1.057,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,d=d>.0031308?1.055*d**(1/2.4)-.055:d*12.92,n=Math.min(Math.max(0,n),1),l=Math.min(Math.max(0,l),1),d=Math.min(Math.max(0,d),1),[n*255,l*255,d*255]},u.xyz.lab=function(s){let f=s[0],i=s[1],c=s[2];f/=95.047,i/=100,c/=108.883,f=f>.008856?f**(1/3):7.787*f+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;let n=116*i-16,l=500*(f-i),d=200*(i-c);return[n,l,d]},u.lab.xyz=function(s){let f=s[0],i=s[1],c=s[2],n,l,d;l=(f+16)/116,n=i/500+l,d=l-c/200;let a=l**3,o=n**3,h=d**3;return l=a>.008856?a:(l-16/116)/7.787,n=o>.008856?o:(n-16/116)/7.787,d=h>.008856?h:(d-16/116)/7.787,n*=95.047,l*=100,d*=108.883,[n,l,d]},u.lab.lch=function(s){let f=s[0],i=s[1],c=s[2],n;n=Math.atan2(c,i)*360/2/Math.PI,n<0&&(n+=360);let d=Math.sqrt(i*i+c*c);return[f,d,n]},u.lch.lab=function(s){let f=s[0],i=s[1],n=s[2]/360*2*Math.PI,l=i*Math.cos(n),d=i*Math.sin(n);return[f,l,d]},u.rgb.ansi16=function(s,f=null){let[i,c,n]=s,l=f===null?u.rgb.hsv(s)[2]:f;if(l=Math.round(l/50),l===0)return 30;let d=30+(Math.round(n/255)<<2|Math.round(c/255)<<1|Math.round(i/255));return l===2&&(d+=60),d},u.hsv.ansi16=function(s){return u.rgb.ansi16(u.hsv.rgb(s),s[2])},u.rgb.ansi256=function(s){let f=s[0],i=s[1],c=s[2];return f===i&&i===c?f<8?16:f>248?231:Math.round((f-8)/247*24)+232:16+36*Math.round(f/255*5)+6*Math.round(i/255*5)+Math.round(c/255*5)},u.ansi16.rgb=function(s){let f=s%10;if(f===0||f===7)return s>50&&(f+=3.5),f=f/10.5*255,[f,f,f];let i=(~~(s>50)+1)*.5,c=(f&1)*i*255,n=(f>>1&1)*i*255,l=(f>>2&1)*i*255;return[c,n,l]},u.ansi256.rgb=function(s){if(s>=232){let l=(s-232)*10+8;return[l,l,l]}s-=16;let f,i=Math.floor(s/36)/5*255,c=Math.floor((f=s%36)/6)/5*255,n=f%6/5*255;return[i,c,n]},u.rgb.hex=function(s){let i=(((Math.round(s[0])&255)<<16)+((Math.round(s[1])&255)<<8)+(Math.round(s[2])&255)).toString(16).toUpperCase();return"000000".substring(i.length)+i},u.hex.rgb=function(s){let f=s.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!f)return[0,0,0];let i=f[0];f[0].length===3&&(i=i.split("").map(a=>a+a).join(""));let c=parseInt(i,16),n=c>>16&255,l=c>>8&255,d=c&255;return[n,l,d]},u.rgb.hcg=function(s){let f=s[0]/255,i=s[1]/255,c=s[2]/255,n=Math.max(Math.max(f,i),c),l=Math.min(Math.min(f,i),c),d=n-l,a,o;return d<1?a=l/(1-d):a=0,d<=0?o=0:n===f?o=(i-c)/d%6:n===i?o=2+(c-f)/d:o=4+(f-i)/d,o/=6,o%=1,[o*360,d*100,a*100]},u.hsl.hcg=function(s){let f=s[1]/100,i=s[2]/100,c=i<.5?2*f*i:2*f*(1-i),n=0;return c<1&&(n=(i-.5*c)/(1-c)),[s[0],c*100,n*100]},u.hsv.hcg=function(s){let f=s[1]/100,i=s[2]/100,c=f*i,n=0;return c<1&&(n=(i-c)/(1-c)),[s[0],c*100,n*100]},u.hcg.rgb=function(s){let f=s[0]/360,i=s[1]/100,c=s[2]/100;if(i===0)return[c*255,c*255,c*255];let n=[0,0,0],l=f%1*6,d=l%1,a=1-d,o=0;switch(Math.floor(l)){case 0:n[0]=1,n[1]=d,n[2]=0;break;case 1:n[0]=a,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=d;break;case 3:n[0]=0,n[1]=a,n[2]=1;break;case 4:n[0]=d,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=a}return o=(1-i)*c,[(i*n[0]+o)*255,(i*n[1]+o)*255,(i*n[2]+o)*255]},u.hcg.hsv=function(s){let f=s[1]/100,i=s[2]/100,c=f+i*(1-f),n=0;return c>0&&(n=f/c),[s[0],n*100,c*100]},u.hcg.hsl=function(s){let f=s[1]/100,c=s[2]/100*(1-f)+.5*f,n=0;return c>0&&c<.5?n=f/(2*c):c>=.5&&c<1&&(n=f/(2*(1-c))),[s[0],n*100,c*100]},u.hcg.hwb=function(s){let f=s[1]/100,i=s[2]/100,c=f+i*(1-f);return[s[0],(c-f)*100,(1-c)*100]},u.hwb.hcg=function(s){let f=s[1]/100,c=1-s[2]/100,n=c-f,l=0;return n<1&&(l=(c-n)/(1-n)),[s[0],n*100,l*100]},u.apple.rgb=function(s){return[s[0]/65535*255,s[1]/65535*255,s[2]/65535*255]},u.rgb.apple=function(s){return[s[0]/255*65535,s[1]/255*65535,s[2]/255*65535]},u.gray.rgb=function(s){return[s[0]/100*255,s[0]/100*255,s[0]/100*255]},u.gray.hsl=function(s){return[0,0,s[0]]},u.gray.hsv=u.gray.hsl,u.gray.hwb=function(s){return[0,100,s[0]]},u.gray.cmyk=function(s){return[0,0,0,s[0]]},u.gray.lab=function(s){return[s[0],0,0]},u.gray.hex=function(s){let f=Math.round(s[0]/100*255)&255,c=((f<<16)+(f<<8)+f).toString(16).toUpperCase();return"000000".substring(c.length)+c},u.rgb.gray=function(s){return[(s[0]+s[1]+s[2])/3/255*100]}}}),Je=O({"../../node_modules/color-convert/route.js"(P,y){var e=ve();function r(){let f={},i=Object.keys(e);for(let c=i.length,n=0;n<c;n++)f[i[n]]={distance:-1,parent:null};return f}function u(f){let i=r(),c=[f];for(i[f].distance=0;c.length;){let n=c.pop(),l=Object.keys(e[n]);for(let d=l.length,a=0;a<d;a++){let o=l[a],h=i[o];h.distance===-1&&(h.distance=i[n].distance+1,h.parent=n,c.unshift(o))}}return i}function b(f,i){return function(c){return i(f(c))}}function s(f,i){let c=[i[f].parent,f],n=e[i[f].parent][f],l=i[f].parent;for(;i[l].parent;)c.unshift(i[l].parent),n=b(e[i[l].parent][l],n),l=i[l].parent;return n.conversion=c,n}y.exports=function(f){let i=u(f),c={},n=Object.keys(i);for(let l=n.length,d=0;d<l;d++){let a=n[d];i[a].parent!==null&&(c[a]=s(a,i))}return c}}}),Qe=O({"../../node_modules/color-convert/index.js"(P,y){var e=ve(),r=Je(),u={},b=Object.keys(e);function s(i){let c=function(...n){let l=n[0];return l==null?l:(l.length>1&&(n=l),i(n))};return"conversion"in i&&(c.conversion=i.conversion),c}function f(i){let c=function(...n){let l=n[0];if(l==null)return l;l.length>1&&(n=l);let d=i(n);if(typeof d=="object")for(let a=d.length,o=0;o<a;o++)d[o]=Math.round(d[o]);return d};return"conversion"in i&&(c.conversion=i.conversion),c}b.forEach(i=>{u[i]={},Object.defineProperty(u[i],"channels",{value:e[i].channels}),Object.defineProperty(u[i],"labels",{value:e[i].labels});let c=r(i);Object.keys(c).forEach(l=>{let d=c[l];u[i][l]=f(d),u[i][l].raw=s(d)})}),y.exports=u}}),Ke=O({"../../node_modules/color/index.js"(P,y){var e=Ve(),r=Qe(),u=["keyword","gray","hex"],b={};for(let o of Object.keys(r))b[[...r[o].labels].sort().join("")]=o;var s={};function f(o,h){if(!(this instanceof f))return new f(o,h);if(h&&h in u&&(h=null),h&&!(h in r))throw new Error("Unknown model: "+h);let m,p;if(o==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(o instanceof f)this.model=o.model,this.color=[...o.color],this.valpha=o.valpha;else if(typeof o=="string"){let v=e.get(o);if(v===null)throw new Error("Unable to parse color from string: "+o);this.model=v.model,p=r[this.model].channels,this.color=v.value.slice(0,p),this.valpha=typeof v.value[p]=="number"?v.value[p]:1}else if(o.length>0){this.model=h||"rgb",p=r[this.model].channels;let v=Array.prototype.slice.call(o,0,p);this.color=a(v,p),this.valpha=typeof o[p]=="number"?o[p]:1}else if(typeof o=="number")this.model="rgb",this.color=[o>>16&255,o>>8&255,o&255],this.valpha=1;else{this.valpha=1;let v=Object.keys(o);"alpha"in o&&(v.splice(v.indexOf("alpha"),1),this.valpha=typeof o.alpha=="number"?o.alpha:0);let x=v.sort().join("");if(!(x in b))throw new Error("Unable to parse color from object: "+JSON.stringify(o));this.model=b[x];let{labels:T}=r[this.model],_=[];for(m=0;m<T.length;m++)_.push(o[T[m]]);this.color=a(_)}if(s[this.model])for(p=r[this.model].channels,m=0;m<p;m++){let v=s[this.model][m];v&&(this.color[m]=v(this.color[m]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}f.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(o){let h=this.model in e.to?this:this.rgb();h=h.round(typeof o=="number"?o:1);let m=h.valpha===1?h.color:[...h.color,this.valpha];return e.to[h.model](m)},percentString(o){let h=this.rgb().round(typeof o=="number"?o:1),m=h.valpha===1?h.color:[...h.color,this.valpha];return e.to.rgb.percent(m)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let o={},{channels:h}=r[this.model],{labels:m}=r[this.model];for(let p=0;p<h;p++)o[m[p]]=this.color[p];return this.valpha!==1&&(o.alpha=this.valpha),o},unitArray(){let o=this.rgb().color;return o[0]/=255,o[1]/=255,o[2]/=255,this.valpha!==1&&o.push(this.valpha),o},unitObject(){let o=this.rgb().object();return o.r/=255,o.g/=255,o.b/=255,this.valpha!==1&&(o.alpha=this.valpha),o},round(o){return o=Math.max(o||0,0),new f([...this.color.map(c(o)),this.valpha],this.model)},alpha(o){return o!==void 0?new f([...this.color,Math.max(0,Math.min(1,o))],this.model):this.valpha},red:n("rgb",0,l(255)),green:n("rgb",1,l(255)),blue:n("rgb",2,l(255)),hue:n(["hsl","hsv","hsl","hwb","hcg"],0,o=>(o%360+360)%360),saturationl:n("hsl",1,l(100)),lightness:n("hsl",2,l(100)),saturationv:n("hsv",1,l(100)),value:n("hsv",2,l(100)),chroma:n("hcg",1,l(100)),gray:n("hcg",2,l(100)),white:n("hwb",1,l(100)),wblack:n("hwb",2,l(100)),cyan:n("cmyk",0,l(100)),magenta:n("cmyk",1,l(100)),yellow:n("cmyk",2,l(100)),black:n("cmyk",3,l(100)),x:n("xyz",0,l(95.047)),y:n("xyz",1,l(100)),z:n("xyz",2,l(108.833)),l:n("lab",0,l(100)),a:n("lab",1),b:n("lab",2),keyword(o){return o!==void 0?new f(o):r[this.model].keyword(this.color)},hex(o){return o!==void 0?new f(o):e.to.hex(this.rgb().round().color)},hexa(o){if(o!==void 0)return new f(o);let h=this.rgb().round().color,m=Math.round(this.valpha*255).toString(16).toUpperCase();return m.length===1&&(m="0"+m),e.to.hex(h)+m},rgbNumber(){let o=this.rgb().color;return(o[0]&255)<<16|(o[1]&255)<<8|o[2]&255},luminosity(){let o=this.rgb().color,h=[];for(let[m,p]of o.entries()){let v=p/255;h[m]=v<=.04045?v/12.92:((v+.055)/1.055)**2.4}return .2126*h[0]+.7152*h[1]+.0722*h[2]},contrast(o){let h=this.luminosity(),m=o.luminosity();return h>m?(h+.05)/(m+.05):(m+.05)/(h+.05)},level(o){let h=this.contrast(o);return h>=7?"AAA":h>=4.5?"AA":""},isDark(){let o=this.rgb().color;return(o[0]*2126+o[1]*7152+o[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let o=this.rgb();for(let h=0;h<3;h++)o.color[h]=255-o.color[h];return o},lighten(o){let h=this.hsl();return h.color[2]+=h.color[2]*o,h},darken(o){let h=this.hsl();return h.color[2]-=h.color[2]*o,h},saturate(o){let h=this.hsl();return h.color[1]+=h.color[1]*o,h},desaturate(o){let h=this.hsl();return h.color[1]-=h.color[1]*o,h},whiten(o){let h=this.hwb();return h.color[1]+=h.color[1]*o,h},blacken(o){let h=this.hwb();return h.color[2]+=h.color[2]*o,h},grayscale(){let o=this.rgb().color,h=o[0]*.3+o[1]*.59+o[2]*.11;return f.rgb(h,h,h)},fade(o){return this.alpha(this.valpha-this.valpha*o)},opaquer(o){return this.alpha(this.valpha+this.valpha*o)},rotate(o){let h=this.hsl(),m=h.color[0];return m=(m+o)%360,m=m<0?360+m:m,h.color[0]=m,h},mix(o,h){if(!o||!o.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof o);let m=o.rgb(),p=this.rgb(),v=h===void 0?.5:h,x=2*v-1,T=m.alpha()-p.alpha(),_=((x*T===-1?x:(x+T)/(1+x*T))+1)/2,q=1-_;return f.rgb(_*m.red()+q*p.red(),_*m.green()+q*p.green(),_*m.blue()+q*p.blue(),m.alpha()*v+p.alpha()*(1-v))}};for(let o of Object.keys(r)){if(u.includes(o))continue;let{channels:h}=r[o];f.prototype[o]=function(...m){return this.model===o?new f(this):m.length>0?new f(m,o):new f([...d(r[this.model][o].raw(this.color)),this.valpha],o)},f[o]=function(...m){let p=m[0];return typeof p=="number"&&(p=a(m,h)),new f(p,o)}}function i(o,h){return Number(o.toFixed(h))}function c(o){return function(h){return i(h,o)}}function n(o,h,m){o=Array.isArray(o)?o:[o];for(let p of o)(s[p]||(s[p]=[]))[h]=m;return o=o[0],function(p){let v;return p!==void 0?(m&&(p=m(p)),v=this[o](),v.color[h]=p,v):(v=this[o]().color[h],m&&(v=m(v)),v)}}function l(o){return function(h){return Math.max(0,Math.min(o,h))}}function d(o){return Array.isArray(o)?o:[o]}function a(o,h){for(let m=0;m<h;m++)typeof o[m]!="number"&&(o[m]=0);return o}y.exports=f}}),Ye=O({"../../node_modules/sharp/lib/colour.js"(P,y){"use strict";var e=Ke(),r=J(),u={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};function b(o){return this._setBackgroundColourOption("tint",o),this}function s(o){return this.options.greyscale=r.bool(o)?o:!0,this}function f(o){return this.greyscale(o)}function i(o){if(!r.string(o))throw r.invalidParameterError("colourspace","string",o);return this.options.colourspacePipeline=o,this}function c(o){return this.pipelineColourspace(o)}function n(o){if(!r.string(o))throw r.invalidParameterError("colourspace","string",o);return this.options.colourspace=o,this}function l(o){return this.toColourspace(o)}function d(o){if(r.object(o)||r.string(o)){let h=e(o);return[h.red(),h.green(),h.blue(),Math.round(h.alpha()*255)]}else throw r.invalidParameterError("background","object or string",o)}function a(o,h){r.defined(h)&&(this.options[o]=d(h))}y.exports=function(o){Object.assign(o.prototype,{tint:b,greyscale:s,grayscale:f,pipelineColourspace:i,pipelineColorspace:c,toColourspace:n,toColorspace:l,_getBackgroundColourOption:d,_setBackgroundColourOption:a}),o.colourspace=u,o.colorspace=u}}}),Ze=O({"../../node_modules/sharp/lib/channel.js"(P,y){"use strict";var e=J(),r={and:"and",or:"or",eor:"eor"};function u(){return this.options.removeAlpha=!0,this}function b(c){if(e.defined(c))if(e.number(c)&&e.inRange(c,0,1))this.options.ensureAlpha=c;else throw e.invalidParameterError("alpha","number between 0 and 1",c);else this.options.ensureAlpha=1;return this}function s(c){let n={red:0,green:1,blue:2,alpha:3};if(Object.keys(n).includes(c)&&(c=n[c]),e.integer(c)&&e.inRange(c,0,4))this.options.extractChannel=c;else throw e.invalidParameterError("channel","integer or one of: red, green, blue, alpha",c);return this}function f(c,n){return Array.isArray(c)?c.forEach(function(l){this.options.joinChannelIn.push(this._createInputDescriptor(l,n))},this):this.options.joinChannelIn.push(this._createInputDescriptor(c,n)),this}function i(c){if(e.string(c)&&e.inArray(c,["and","or","eor"]))this.options.bandBoolOp=c;else throw e.invalidParameterError("boolOp","one of: and, or, eor",c);return this}y.exports=function(c){Object.assign(c.prototype,{removeAlpha:u,ensureAlpha:b,extractChannel:s,joinChannel:f,bandbool:i}),c.bool=r}}}),er=O({"../../node_modules/sharp/lib/output.js"(P,y){"use strict";var e=D("node:path"),r=J(),u=ie(),b=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"]]),s=/\.(jp[2x]|j2[kc])$/i,f=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),i=t=>1<<31-Math.clz32(Math.ceil(Math.log2(t)));function c(t,E){let A;if(r.string(t)?r.string(this.options.input.file)&&e.resolve(this.options.input.file)===e.resolve(t)?A=new Error("Cannot use same file for input and output"):s.test(e.extname(t))&&!this.constructor.format.jp2k.output.file&&(A=f()):A=new Error("Missing output file path"),A)if(r.fn(E))E(A);else return Promise.reject(A);else{this.options.fileOut=t;let L=Error();return this._pipeline(E,L)}return this}function n(t,E){r.object(t)?this._setBooleanOption("resolveWithObject",t.resolveWithObject):this.options.resolveWithObject&&(this.options.resolveWithObject=!1),this.options.fileOut="";let A=Error();return this._pipeline(r.fn(t)?t:E,A)}function l(){return this.options.keepMetadata|=1,this}function d(t){if(r.object(t))for(let[E,A]of Object.entries(t))if(r.object(A))for(let[L,k]of Object.entries(A))if(r.string(k))this.options.withExif[`exif-${E.toLowerCase()}-${L}`]=k;else throw r.invalidParameterError(`${E}.${L}`,"string",k);else throw r.invalidParameterError(E,"object",A);else throw r.invalidParameterError("exif","object",t);return this.options.withExifMerge=!1,this.keepExif()}function a(t){return this.withExif(t),this.options.withExifMerge=!0,this}function o(){return this.options.keepMetadata|=8,this}function h(t,E){if(r.string(t))this.options.withIccProfile=t;else throw r.invalidParameterError("icc","string",t);if(this.keepIccProfile(),r.object(E)&&r.defined(E.attach))if(r.bool(E.attach))E.attach||(this.options.keepMetadata&=-9);else throw r.invalidParameterError("attach","boolean",E.attach);return this}function m(){return this.options.keepMetadata=31,this}function p(t){if(this.keepMetadata(),this.withIccProfile("srgb"),r.object(t)){if(r.defined(t.orientation))if(r.integer(t.orientation)&&r.inRange(t.orientation,1,8))this.options.withMetadataOrientation=t.orientation;else throw r.invalidParameterError("orientation","integer between 1 and 8",t.orientation);if(r.defined(t.density))if(r.number(t.density)&&t.density>0)this.options.withMetadataDensity=t.density;else throw r.invalidParameterError("density","positive number",t.density);r.defined(t.icc)&&this.withIccProfile(t.icc),r.defined(t.exif)&&this.withExifMerge(t.exif)}return this}function v(t,E){let A=b.get((r.object(t)&&r.string(t.id)?t.id:t).toLowerCase());if(!A)throw r.invalidParameterError("format",`one of: ${[...b.keys()].join(", ")}`,t);return this[A](E)}function x(t){if(r.object(t)){if(r.defined(t.quality))if(r.integer(t.quality)&&r.inRange(t.quality,1,100))this.options.jpegQuality=t.quality;else throw r.invalidParameterError("quality","integer between 1 and 100",t.quality);if(r.defined(t.progressive)&&this._setBooleanOption("jpegProgressive",t.progressive),r.defined(t.chromaSubsampling))if(r.string(t.chromaSubsampling)&&r.inArray(t.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=t.chromaSubsampling;else throw r.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",t.chromaSubsampling);let E=r.bool(t.optimizeCoding)?t.optimizeCoding:t.optimiseCoding;if(r.defined(E)&&this._setBooleanOption("jpegOptimiseCoding",E),r.defined(t.mozjpeg))if(r.bool(t.mozjpeg))t.mozjpeg&&(this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3);else throw r.invalidParameterError("mozjpeg","boolean",t.mozjpeg);let A=r.bool(t.trellisQuantization)?t.trellisQuantization:t.trellisQuantisation;r.defined(A)&&this._setBooleanOption("jpegTrellisQuantisation",A),r.defined(t.overshootDeringing)&&this._setBooleanOption("jpegOvershootDeringing",t.overshootDeringing);let L=r.bool(t.optimizeScans)?t.optimizeScans:t.optimiseScans;r.defined(L)&&(this._setBooleanOption("jpegOptimiseScans",L),L&&(this.options.jpegProgressive=!0));let k=r.number(t.quantizationTable)?t.quantizationTable:t.quantisationTable;if(r.defined(k))if(r.integer(k)&&r.inRange(k,0,8))this.options.jpegQuantisationTable=k;else throw r.invalidParameterError("quantisationTable","integer between 0 and 8",k)}return this._updateFormatOut("jpeg",t)}function T(t){if(r.object(t)){if(r.defined(t.progressive)&&this._setBooleanOption("pngProgressive",t.progressive),r.defined(t.compressionLevel))if(r.integer(t.compressionLevel)&&r.inRange(t.compressionLevel,0,9))this.options.pngCompressionLevel=t.compressionLevel;else throw r.invalidParameterError("compressionLevel","integer between 0 and 9",t.compressionLevel);r.defined(t.adaptiveFiltering)&&this._setBooleanOption("pngAdaptiveFiltering",t.adaptiveFiltering);let E=t.colours||t.colors;if(r.defined(E))if(r.integer(E)&&r.inRange(E,2,256))this.options.pngBitdepth=i(E);else throw r.invalidParameterError("colours","integer between 2 and 256",E);if(r.defined(t.palette)?this._setBooleanOption("pngPalette",t.palette):[t.quality,t.effort,t.colours,t.colors,t.dither].some(r.defined)&&this._setBooleanOption("pngPalette",!0),this.options.pngPalette){if(r.defined(t.quality))if(r.integer(t.quality)&&r.inRange(t.quality,0,100))this.options.pngQuality=t.quality;else throw r.invalidParameterError("quality","integer between 0 and 100",t.quality);if(r.defined(t.effort))if(r.integer(t.effort)&&r.inRange(t.effort,1,10))this.options.pngEffort=t.effort;else throw r.invalidParameterError("effort","integer between 1 and 10",t.effort);if(r.defined(t.dither))if(r.number(t.dither)&&r.inRange(t.dither,0,1))this.options.pngDither=t.dither;else throw r.invalidParameterError("dither","number between 0.0 and 1.0",t.dither)}}return this._updateFormatOut("png",t)}function _(t){if(r.object(t)){if(r.defined(t.quality))if(r.integer(t.quality)&&r.inRange(t.quality,1,100))this.options.webpQuality=t.quality;else throw r.invalidParameterError("quality","integer between 1 and 100",t.quality);if(r.defined(t.alphaQuality))if(r.integer(t.alphaQuality)&&r.inRange(t.alphaQuality,0,100))this.options.webpAlphaQuality=t.alphaQuality;else throw r.invalidParameterError("alphaQuality","integer between 0 and 100",t.alphaQuality);if(r.defined(t.lossless)&&this._setBooleanOption("webpLossless",t.lossless),r.defined(t.nearLossless)&&this._setBooleanOption("webpNearLossless",t.nearLossless),r.defined(t.smartSubsample)&&this._setBooleanOption("webpSmartSubsample",t.smartSubsample),r.defined(t.smartDeblock)&&this._setBooleanOption("webpSmartDeblock",t.smartDeblock),r.defined(t.preset))if(r.string(t.preset)&&r.inArray(t.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=t.preset;else throw r.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",t.preset);if(r.defined(t.effort))if(r.integer(t.effort)&&r.inRange(t.effort,0,6))this.options.webpEffort=t.effort;else throw r.invalidParameterError("effort","integer between 0 and 6",t.effort);r.defined(t.minSize)&&this._setBooleanOption("webpMinSize",t.minSize),r.defined(t.mixed)&&this._setBooleanOption("webpMixed",t.mixed)}return G(t,this.options),this._updateFormatOut("webp",t)}function q(t){if(r.object(t)){r.defined(t.reuse)&&this._setBooleanOption("gifReuse",t.reuse),r.defined(t.progressive)&&this._setBooleanOption("gifProgressive",t.progressive);let E=t.colours||t.colors;if(r.defined(E))if(r.integer(E)&&r.inRange(E,2,256))this.options.gifBitdepth=i(E);else throw r.invalidParameterError("colours","integer between 2 and 256",E);if(r.defined(t.effort))if(r.number(t.effort)&&r.inRange(t.effort,1,10))this.options.gifEffort=t.effort;else throw r.invalidParameterError("effort","integer between 1 and 10",t.effort);if(r.defined(t.dither))if(r.number(t.dither)&&r.inRange(t.dither,0,1))this.options.gifDither=t.dither;else throw r.invalidParameterError("dither","number between 0.0 and 1.0",t.dither);if(r.defined(t.interFrameMaxError))if(r.number(t.interFrameMaxError)&&r.inRange(t.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=t.interFrameMaxError;else throw r.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",t.interFrameMaxError);if(r.defined(t.interPaletteMaxError))if(r.number(t.interPaletteMaxError)&&r.inRange(t.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=t.interPaletteMaxError;else throw r.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",t.interPaletteMaxError)}return G(t,this.options),this._updateFormatOut("gif",t)}function z(t){if(!this.constructor.format.jp2k.output.buffer)throw f();if(r.object(t)){if(r.defined(t.quality))if(r.integer(t.quality)&&r.inRange(t.quality,1,100))this.options.jp2Quality=t.quality;else throw r.invalidParameterError("quality","integer between 1 and 100",t.quality);if(r.defined(t.lossless))if(r.bool(t.lossless))this.options.jp2Lossless=t.lossless;else throw r.invalidParameterError("lossless","boolean",t.lossless);if(r.defined(t.tileWidth))if(r.integer(t.tileWidth)&&r.inRange(t.tileWidth,1,32768))this.options.jp2TileWidth=t.tileWidth;else throw r.invalidParameterError("tileWidth","integer between 1 and 32768",t.tileWidth);if(r.defined(t.tileHeight))if(r.integer(t.tileHeight)&&r.inRange(t.tileHeight,1,32768))this.options.jp2TileHeight=t.tileHeight;else throw r.invalidParameterError("tileHeight","integer between 1 and 32768",t.tileHeight);if(r.defined(t.chromaSubsampling))if(r.string(t.chromaSubsampling)&&r.inArray(t.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=t.chromaSubsampling;else throw r.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",t.chromaSubsampling)}return this._updateFormatOut("jp2",t)}function G(t,E){if(r.object(t)&&r.defined(t.loop))if(r.integer(t.loop)&&r.inRange(t.loop,0,65535))E.loop=t.loop;else throw r.invalidParameterError("loop","integer between 0 and 65535",t.loop);if(r.object(t)&&r.defined(t.delay))if(r.integer(t.delay)&&r.inRange(t.delay,0,65535))E.delay=[t.delay];else if(Array.isArray(t.delay)&&t.delay.every(r.integer)&&t.delay.every(A=>r.inRange(A,0,65535)))E.delay=t.delay;else throw r.invalidParameterError("delay","integer or an array of integers between 0 and 65535",t.delay)}function U(t){if(r.object(t)){if(r.defined(t.quality))if(r.integer(t.quality)&&r.inRange(t.quality,1,100))this.options.tiffQuality=t.quality;else throw r.invalidParameterError("quality","integer between 1 and 100",t.quality);if(r.defined(t.bitdepth))if(r.integer(t.bitdepth)&&r.inArray(t.bitdepth,[1,2,4,8]))this.options.tiffBitdepth=t.bitdepth;else throw r.invalidParameterError("bitdepth","1, 2, 4 or 8",t.bitdepth);if(r.defined(t.tile)&&this._setBooleanOption("tiffTile",t.tile),r.defined(t.tileWidth))if(r.integer(t.tileWidth)&&t.tileWidth>0)this.options.tiffTileWidth=t.tileWidth;else throw r.invalidParameterError("tileWidth","integer greater than zero",t.tileWidth);if(r.defined(t.tileHeight))if(r.integer(t.tileHeight)&&t.tileHeight>0)this.options.tiffTileHeight=t.tileHeight;else throw r.invalidParameterError("tileHeight","integer greater than zero",t.tileHeight);if(r.defined(t.miniswhite)&&this._setBooleanOption("tiffMiniswhite",t.miniswhite),r.defined(t.pyramid)&&this._setBooleanOption("tiffPyramid",t.pyramid),r.defined(t.xres))if(r.number(t.xres)&&t.xres>0)this.options.tiffXres=t.xres;else throw r.invalidParameterError("xres","number greater than zero",t.xres);if(r.defined(t.yres))if(r.number(t.yres)&&t.yres>0)this.options.tiffYres=t.yres;else throw r.invalidParameterError("yres","number greater than zero",t.yres);if(r.defined(t.compression))if(r.string(t.compression)&&r.inArray(t.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=t.compression;else throw r.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",t.compression);if(r.defined(t.predictor))if(r.string(t.predictor)&&r.inArray(t.predictor,["none","horizontal","float"]))this.options.tiffPredictor=t.predictor;else throw r.invalidParameterError("predictor","one of: none, horizontal, float",t.predictor);if(r.defined(t.resolutionUnit))if(r.string(t.resolutionUnit)&&r.inArray(t.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=t.resolutionUnit;else throw r.invalidParameterError("resolutionUnit","one of: inch, cm",t.resolutionUnit)}return this._updateFormatOut("tiff",t)}function H(t){return this.heif({...t,compression:"av1"})}function g(t){if(r.object(t)){if(r.string(t.compression)&&r.inArray(t.compression,["av1","hevc"]))this.options.heifCompression=t.compression;else throw r.invalidParameterError("compression","one of: av1, hevc",t.compression);if(r.defined(t.quality))if(r.integer(t.quality)&&r.inRange(t.quality,1,100))this.options.heifQuality=t.quality;else throw r.invalidParameterError("quality","integer between 1 and 100",t.quality);if(r.defined(t.lossless))if(r.bool(t.lossless))this.options.heifLossless=t.lossless;else throw r.invalidParameterError("lossless","boolean",t.lossless);if(r.defined(t.effort))if(r.integer(t.effort)&&r.inRange(t.effort,0,9))this.options.heifEffort=t.effort;else throw r.invalidParameterError("effort","integer between 0 and 9",t.effort);if(r.defined(t.chromaSubsampling))if(r.string(t.chromaSubsampling)&&r.inArray(t.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=t.chromaSubsampling;else throw r.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",t.chromaSubsampling);if(r.defined(t.bitdepth))if(r.integer(t.bitdepth)&&r.inArray(t.bitdepth,[8,10,12])){if(t.bitdepth!==8&&this.constructor.versions.heif)throw r.invalidParameterError("bitdepth when using prebuilt binaries",8,t.bitdepth);this.options.heifBitdepth=t.bitdepth}else throw r.invalidParameterError("bitdepth","8, 10 or 12",t.bitdepth)}else throw r.invalidParameterError("options","Object",t);return this._updateFormatOut("heif",t)}function S(t){if(r.object(t)){if(r.defined(t.quality))if(r.integer(t.quality)&&r.inRange(t.quality,1,100))this.options.jxlDistance=t.quality>=30?.1+(100-t.quality)*.09:53/3e3*t.quality*t.quality-23/20*t.quality+25;else throw r.invalidParameterError("quality","integer between 1 and 100",t.quality);else if(r.defined(t.distance))if(r.number(t.distance)&&r.inRange(t.distance,0,15))this.options.jxlDistance=t.distance;else throw r.invalidParameterError("distance","number between 0.0 and 15.0",t.distance);if(r.defined(t.decodingTier))if(r.integer(t.decodingTier)&&r.inRange(t.decodingTier,0,4))this.options.jxlDecodingTier=t.decodingTier;else throw r.invalidParameterError("decodingTier","integer between 0 and 4",t.decodingTier);if(r.defined(t.lossless))if(r.bool(t.lossless))this.options.jxlLossless=t.lossless;else throw r.invalidParameterError("lossless","boolean",t.lossless);if(r.defined(t.effort))if(r.integer(t.effort)&&r.inRange(t.effort,1,9))this.options.jxlEffort=t.effort;else throw r.invalidParameterError("effort","integer between 1 and 9",t.effort)}return G(t,this.options),this._updateFormatOut("jxl",t)}function F(t){if(r.object(t)&&r.defined(t.depth))if(r.string(t.depth)&&r.inArray(t.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=t.depth;else throw r.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",t.depth);return this._updateFormatOut("raw")}function W(t){if(r.object(t)){if(r.defined(t.size))if(r.integer(t.size)&&r.inRange(t.size,1,8192))this.options.tileSize=t.size;else throw r.invalidParameterError("size","integer between 1 and 8192",t.size);if(r.defined(t.overlap))if(r.integer(t.overlap)&&r.inRange(t.overlap,0,8192)){if(t.overlap>this.options.tileSize)throw r.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,t.overlap);this.options.tileOverlap=t.overlap}else throw r.invalidParameterError("overlap","integer between 0 and 8192",t.overlap);if(r.defined(t.container))if(r.string(t.container)&&r.inArray(t.container,["fs","zip"]))this.options.tileContainer=t.container;else throw r.invalidParameterError("container","one of: fs, zip",t.container);if(r.defined(t.layout))if(r.string(t.layout)&&r.inArray(t.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=t.layout;else throw r.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",t.layout);if(r.defined(t.angle))if(r.integer(t.angle)&&!(t.angle%90))this.options.tileAngle=t.angle;else throw r.invalidParameterError("angle","positive/negative multiple of 90",t.angle);if(this._setBackgroundColourOption("tileBackground",t.background),r.defined(t.depth))if(r.string(t.depth)&&r.inArray(t.depth,["onepixel","onetile","one"]))this.options.tileDepth=t.depth;else throw r.invalidParameterError("depth","one of: onepixel, onetile, one",t.depth);if(r.defined(t.skipBlanks))if(r.integer(t.skipBlanks)&&r.inRange(t.skipBlanks,-1,65535))this.options.tileSkipBlanks=t.skipBlanks;else throw r.invalidParameterError("skipBlanks","integer between -1 and 255/65535",t.skipBlanks);else r.defined(t.layout)&&t.layout==="google"&&(this.options.tileSkipBlanks=5);let E=r.bool(t.center)?t.center:t.centre;if(r.defined(E)&&this._setBooleanOption("tileCentre",E),r.defined(t.id))if(r.string(t.id))this.options.tileId=t.id;else throw r.invalidParameterError("id","string",t.id);if(r.defined(t.basename))if(r.string(t.basename))this.options.tileBasename=t.basename;else throw r.invalidParameterError("basename","string",t.basename)}if(r.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw r.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function Q(t){if(!r.plainObject(t))throw r.invalidParameterError("options","object",t);if(r.integer(t.seconds)&&r.inRange(t.seconds,0,3600))this.options.timeoutSeconds=t.seconds;else throw r.invalidParameterError("seconds","integer between 0 and 3600",t.seconds);return this}function I(t,E){return r.object(E)&&E.force===!1||(this.options.formatOut=t),this}function R(t,E){if(r.bool(E))this.options[t]=E;else throw r.invalidParameterError(t,"boolean",E)}function w(){if(!this.options.streamOut){this.options.streamOut=!0;let t=Error();this._pipeline(void 0,t)}}function j(t,E){return typeof t=="function"?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),u.pipeline(this.options,(A,L,k)=>{A?t(r.nativeError(A,E)):t(null,L,k)})}):u.pipeline(this.options,(A,L,k)=>{A?t(r.nativeError(A,E)):t(null,L,k)}),this):this.options.streamOut?(this._isStreamInput()?(this.once("finish",()=>{this._flattenBufferIn(),u.pipeline(this.options,(A,L,k)=>{A?this.emit("error",r.nativeError(A,E)):(this.emit("info",k),this.push(L)),this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished&&this.emit("finish")):u.pipeline(this.options,(A,L,k)=>{A?this.emit("error",r.nativeError(A,E)):(this.emit("info",k),this.push(L)),this.push(null),this.on("end",()=>this.emit("close"))}),this):this._isStreamInput()?new Promise((A,L)=>{this.once("finish",()=>{this._flattenBufferIn(),u.pipeline(this.options,(k,C,B)=>{k?L(r.nativeError(k,E)):this.options.resolveWithObject?A({data:C,info:B}):A(C)})})}):new Promise((A,L)=>{u.pipeline(this.options,(k,C,B)=>{k?L(r.nativeError(k,E)):this.options.resolveWithObject?A({data:C,info:B}):A(C)})})}y.exports=function(t){Object.assign(t.prototype,{toFile:c,toBuffer:n,keepExif:l,withExif:d,withExifMerge:a,keepIccProfile:o,withIccProfile:h,keepMetadata:m,withMetadata:p,toFormat:v,jpeg:x,jp2:z,png:T,webp:_,tiff:U,avif:H,heif:g,jxl:S,gif:q,raw:F,tile:W,timeout:Q,_updateFormatOut:I,_setBooleanOption:R,_read:w,_pipeline:j})}}}),rr=O({"../../node_modules/sharp/lib/utility.js"(P,y){"use strict";var e=D("node:events"),r=ae(),u=J(),{runtimePlatformArch:b}=ge(),s=ie(),f=b(),i=s.libvipsVersion(),c=s.format();c.heif.output.alias=["avif","heic"],c.jpeg.output.alias=["jpe","jpg"],c.tiff.output.alias=["tif"],c.jp2k.output.alias=["j2c","j2k","jp2","jpx"];var n={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},l={vips:i.semver};if(!i.isGlobal)if(i.isWasm)try{l=D("@img/sharp-wasm32/versions")}catch{}else try{l=D(`@img/sharp-${f}/versions`)}catch{try{l=D(`@img/sharp-libvips-${f}/versions`)}catch{}}l.sharp=me().version,l.heif&&c.heif&&(c.heif.input.fileSuffix=[".avif"],c.heif.output.alias=["avif"]);function d(x){return u.bool(x)?x?s.cache(50,20,100):s.cache(0,0,0):u.object(x)?s.cache(x.memory,x.files,x.items):s.cache()}d(!0);function a(x){return s.concurrency(u.integer(x)?x:null)}r.familySync()===r.GLIBC&&!s._isUsingJemalloc()?s.concurrency(1):r.familySync()===r.MUSL&&s.concurrency()===1024&&s.concurrency(D("node:os").availableParallelism());var o=new e.EventEmitter;function h(){return s.counters()}function m(x){return s.simd(u.bool(x)?x:null)}function p(x){if(u.object(x))if(Array.isArray(x.operation)&&x.operation.every(u.string))s.block(x.operation,!0);else throw u.invalidParameterError("operation","Array<string>",x.operation);else throw u.invalidParameterError("options","object",x)}function v(x){if(u.object(x))if(Array.isArray(x.operation)&&x.operation.every(u.string))s.block(x.operation,!1);else throw u.invalidParameterError("operation","Array<string>",x.operation);else throw u.invalidParameterError("options","object",x)}y.exports=function(x){x.cache=d,x.concurrency=a,x.counters=h,x.simd=m,x.format=c,x.interpolators=n,x.versions=l,x.queue=o,x.block=p,x.unblock=v}}}),tr=O({"../../node_modules/sharp/lib/index.js"(P,y){"use strict";var e=qe();Ge()(e),ze()(e),Ue()(e),He()(e),Ye()(e),Ze()(e),er()(e),rr()(e),y.exports=e}}),ir=Se(tr(),1),ce={parse:{description:"Parses a FIX message and describes it in plain language",schema:{type:"object",properties:{fixString:{type:"string"}},required:["fixString"]}},parseToJSON:{description:"Parses a FIX message into JSON",schema:{type:"object",properties:{fixString:{type:"string"}},required:["fixString"]}},verifyOrder:{description:"Verifies order parameters before execution. verifyOrder must be called before executeOrder.",schema:{type:"object",properties:{clOrdID:{type:"string"},handlInst:{type:"string",enum:["1","2","3"],description:"Handling Instructions: 1=Automated Execution No Intervention, 2=Automated Execution Intervention OK, 3=Manual Order"},quantity:{type:"string"},price:{type:"string"},ordType:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","P","Q","R","S"],description:"Order Type: 1=Market, 2=Limit, 3=Stop, 4=StopLimit, 5=MarketOnClose, 6=WithOrWithout, 7=LimitOrBetter, 8=LimitWithOrWithout, 9=OnBasis, A=OnClose, B=LimitOnClose, C=ForexMarket, D=PreviouslyQuoted, E=PreviouslyIndicated, F=ForexLimit, G=ForexSwap, H=ForexPreviouslyQuoted, I=Funari, J=MarketIfTouched, K=MarketWithLeftOverAsLimit, L=PreviousFundValuationPoint, M=NextFundValuationPoint, P=Pegged, Q=CounterOrderSelection, R=StopOnBidOrOffer, S=StopLimitOnBidOrOffer"},side:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H"],description:"Side: 1=Buy, 2=Sell, 3=BuyMinus, 4=SellPlus, 5=SellShort, 6=SellShortExempt, 7=Undisclosed, 8=Cross, 9=CrossShort, A=CrossShortExempt, B=AsDefined, C=Opposite, D=Subscribe, E=Redeem, F=Lend, G=Borrow, H=SellUndisclosed"},symbol:{type:"string"},timeInForce:{type:"string",enum:["0","1","2","3","4","5","6","7","8","9","A","B","C"],description:"Time In Force: 0=Day, 1=GoodTillCancel, 2=AtTheOpening, 3=ImmediateOrCancel, 4=FillOrKill, 5=GoodTillCrossing, 6=GoodTillDate, 7=AtTheClose, 8=GoodThroughCrossing, 9=AtCrossing, A=GoodForTime, B=GoodForAuction, C=GoodForMonth"}},required:["clOrdID","handlInst","quantity","price","ordType","side","symbol","timeInForce"]}},executeOrder:{description:"Executes a verified order. verifyOrder must be called before executeOrder. user has to explicitly allow executeOrder.",schema:{type:"object",properties:{clOrdID:{type:"string"},handlInst:{type:"string",enum:["1","2","3"],description:"Handling Instructions: 1=Automated Execution No Intervention, 2=Automated Execution Intervention OK, 3=Manual Order"},quantity:{type:"string"},price:{type:"string"},ordType:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","P","Q","R","S"],description:"Order Type: 1=Market, 2=Limit, 3=Stop, 4=StopLimit, 5=MarketOnClose, 6=WithOrWithout, 7=LimitOrBetter, 8=LimitWithOrWithout, 9=OnBasis, A=OnClose, B=LimitOnClose, C=ForexMarket, D=PreviouslyQuoted, E=PreviouslyIndicated, F=ForexLimit, G=ForexSwap, H=ForexPreviouslyQuoted, I=Funari, J=MarketIfTouched, K=MarketWithLeftOverAsLimit, L=PreviousFundValuationPoint, M=NextFundValuationPoint, P=Pegged, Q=CounterOrderSelection, R=StopOnBidOrOffer, S=StopLimitOnBidOrOffer"},side:{type:"string",enum:["1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H"],description:"Side: 1=Buy, 2=Sell, 3=BuyMinus, 4=SellPlus, 5=SellShort, 6=SellShortExempt, 7=Undisclosed, 8=Cross, 9=CrossShort, A=CrossShortExempt, B=AsDefined, C=Opposite, D=Subscribe, E=Redeem, F=Lend, G=Borrow, H=SellUndisclosed"},symbol:{type:"string"},timeInForce:{type:"string",enum:["0","1","2","3","4","5","6","7","8","9","A","B","C"],description:"Time In Force: 0=Day, 1=GoodTillCancel, 2=AtTheOpening, 3=ImmediateOrCancel, 4=FillOrKill, 5=GoodTillCrossing, 6=GoodTillDate, 7=AtTheClose, 8=GoodThroughCrossing, 9=AtCrossing, A=GoodForTime, B=GoodForAuction, C=GoodForMonth"}},required:["clOrdID","handlInst","quantity","price","ordType","side","symbol","timeInForce"]}},marketDataRequest:{description:"Requests market data for specified symbols",schema:{type:"object",properties:{mdUpdateType:{type:"string",enum:["0","1"],description:"Market Data Update Type: 0=Full Refresh, 1=Incremental Refresh"},symbols:{type:"array",items:{type:"string"}},mdReqID:{type:"string"},subscriptionRequestType:{type:"string",enum:["0","1","2"],description:"Subscription Request Type: 0=Snapshot, 1=Snapshot + Updates, 2=Disable Previous Snapshot + Update Request"},mdEntryTypes:{type:"array",items:{type:"string",enum:["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],description:"Market Data Entry Types: 0=Bid, 1=Offer, 2=Trade, 3=Index Value, 4=Opening Price, 5=Closing Price, 6=Settlement Price, 7=High Price, 8=Low Price, 9=Trade Volume, A=Open Interest, B=Simulated Sell Price, C=Simulated Buy Price, D=Empty Book, E=Session High Bid, F=Session Low Offer, G=Fixing Price, H=Electronic Volume, I=Threshold Limits and Price Band Variation, J=Clearing Price, K=Open Interest Change, L=Last Trade Price, M=Last Trade Volume, N=Last Trade Time, O=Last Trade Tick, P=Last Trade Exchange, Q=Last Trade ID, R=Last Trade Side, S=Last Trade Price Change, T=Last Trade Price Change Percent, U=Last Trade Price Change Basis Points, V=Last Trade Price Change Points, W=Last Trade Price Change Ticks, X=Last Trade Price Change Ticks Percent, Y=Last Trade Price Change Ticks Basis Points, Z=Last Trade Price Change Ticks Points"}}},required:["mdUpdateType","symbols","mdReqID","subscriptionRequestType","mdEntryTypes"]}},getStockGraph:{description:"Generates a price chart for a given symbol",schema:{type:"object",properties:{symbol:{type:"string"}},required:["symbol"]}},getStockPriceHistory:{description:"Returns price history for a given symbol",schema:{type:"object",properties:{symbol:{type:"string"}},required:["symbol"]}}},we=class{parser;server=new be.Server({name:"fixparser",version:"1.0.0"},{capabilities:{tools:Object.entries(ce).reduce((P,[y,{description:e,schema:r}])=>(P[y]={description:e,parameters:r},P),{})}});transport=new ye.StdioServerTransport;onReady=void 0;pendingRequests=new Map;verifiedOrders=new Map;marketDataPrices=new Map;MAX_PRICE_HISTORY=1e5;constructor({logger:P,onReady:y}){y&&(this.onReady=y)}async register(P){this.parser=P,this.parser.addOnMessageCallback(y=>{this.parser?.logger.log({level:"info",message:`MCP Server received message: ${y.messageType}: ${y.description}`});let e=y.messageType;if(e===$.Messages.MarketDataSnapshotFullRefresh||e===$.Messages.ExecutionReport||e===$.Messages.Reject||e===$.Messages.MarketDataIncrementalRefresh){this.parser?.logger.log({level:"info",message:`MCP Server handling message type: ${e}`});let r;if(e===$.Messages.MarketDataIncrementalRefresh||e===$.Messages.MarketDataSnapshotFullRefresh){let u=y.getField($.Fields.Symbol),b=y.getField($.Fields.MDEntryPx),s=y.getField($.Fields.MDEntryTime)?.value||Date.now();if(u?.value&&b?.value){let f=String(u.value),i=Number(b.value),c=this.marketDataPrices.get(f)||[];c.push({timestamp:Number(s),price:i}),c.length>this.MAX_PRICE_HISTORY&&c.shift(),this.marketDataPrices.set(f,c),this.parser?.logger.log({level:"info",message:`MCP Server added ${u}: ${i}`}),this.server.notification({method:"priceUpdate",params:{symbol:f,price:i,timestamp:Number(s)}})}}if(e===$.Messages.MarketDataSnapshotFullRefresh){let u=y.getField($.Fields.MDReqID);u&&(r=String(u.value))}else if(e===$.Messages.ExecutionReport){let u=y.getField($.Fields.ClOrdID);u&&(r=String(u.value))}else if(e===$.Messages.Reject){let u=y.getField($.Fields.RefSeqNum);u&&(r=String(u.value))}if(r){let u=this.pendingRequests.get(r);u&&(u(y),this.pendingRequests.delete(r))}}}),this.addWorkflows(),await this.server.connect(this.transport),this.onReady&&this.onReady()}addWorkflows(){this.parser&&this.server&&(this.server.setRequestHandler(V.z.object({method:V.z.literal("tools/list")}),async(P,y)=>({tools:Object.entries(ce).map(([e,{description:r,schema:u}])=>({name:e,description:r,inputSchema:u}))})),this.server.setRequestHandler(V.z.object({method:V.z.literal("tools/call"),params:V.z.object({name:V.z.string(),arguments:V.z.any(),_meta:V.z.object({progressToken:V.z.number()}).optional()})}),async(P,y)=>{let{name:e,arguments:r}=P.params;switch(e){case"parse":try{let u=this.parser?.parse(r.fixString);return!u||u.length===0?{content:[{type:"text",text:"Error: Failed to parse FIX string",uri:"parse"}],isError:!0}:{content:[{type:"text",text:`${u[0].description}
4
+ ${u[0].messageTypeDescription}`,uri:"parse"}]}}catch(u){return{content:[{type:"text",text:`Error: ${u instanceof Error?u.message:"Failed to parse FIX string"}`,uri:"parse"}],isError:!0}}case"parseToJSON":try{let u=this.parser?.parse(r.fixString);return!u||u.length===0?{content:[{type:"text",text:"Error: Failed to parse FIX string",uri:"parseToJSON"}],isError:!0}:{content:[{type:"text",text:`${u[0].toFIXJSON()}`,uri:"parseToJSON"}]}}catch(u){return{content:[{type:"text",text:`Error: ${u instanceof Error?u.message:"Failed to parse FIX string"}`,uri:"parseToJSON"}],isError:!0}}case"verifyOrder":try{this.verifiedOrders.set(r.clOrdID,{clOrdID:r.clOrdID,handlInst:r.handlInst,quantity:Number.parseFloat(r.quantity),price:Number.parseFloat(r.price),ordType:r.ordType,side:r.side,symbol:r.symbol,timeInForce:r.timeInForce});let u={1:"Market",2:"Limit",3:"Stop",4:"StopLimit",5:"MarketOnClose",6:"WithOrWithout",7:"LimitOrBetter",8:"LimitWithOrWithout",9:"OnBasis",A:"OnClose",B:"LimitOnClose",C:"ForexMarket",D:"PreviouslyQuoted",E:"PreviouslyIndicated",F:"ForexLimit",G:"ForexSwap",H:"ForexPreviouslyQuoted",I:"Funari",J:"MarketIfTouched",K:"MarketWithLeftOverAsLimit",L:"PreviousFundValuationPoint",M:"NextFundValuationPoint",P:"Pegged",Q:"CounterOrderSelection",R:"StopOnBidOrOffer",S:"StopLimitOnBidOrOffer"},b={1:"Buy",2:"Sell",3:"BuyMinus",4:"SellPlus",5:"SellShort",6:"SellShortExempt",7:"Undisclosed",8:"Cross",9:"CrossShort",A:"CrossShortExempt",B:"AsDefined",C:"Opposite",D:"Subscribe",E:"Redeem",F:"Lend",G:"Borrow",H:"SellUndisclosed"},s={0:"Day",1:"GoodTillCancel",2:"AtTheOpening",3:"ImmediateOrCancel",4:"FillOrKill",5:"GoodTillCrossing",6:"GoodTillDate",7:"AtTheClose",8:"GoodThroughCrossing",9:"AtCrossing",A:"GoodForTime",B:"GoodForAuction",C:"GoodForMonth"},f={1:"AutomatedExecutionNoIntervention",2:"AutomatedExecutionInterventionOK",3:"ManualOrder"};return{content:[{type:"text",text:`VERIFICATION: All parameters valid. Ready to proceed with order execution.
5
+
6
+ Parameters verified:
7
+ - ClOrdID: ${r.clOrdID}
8
+ - HandlInst: ${r.handlInst} (${f[r.handlInst]})
9
+ - Quantity: ${r.quantity}
10
+ - Price: ${r.price}
11
+ - OrdType: ${r.ordType} (${u[r.ordType]})
12
+ - Side: ${r.side} (${b[r.side]})
13
+ - Symbol: ${r.symbol}
14
+ - TimeInForce: ${r.timeInForce} (${s[r.timeInForce]})
15
+
16
+ To execute this order, call the executeOrder tool with these exact same parameters.`,uri:"verifyOrder"}]}}catch(u){return{content:[{type:"text",text:`Error: ${u instanceof Error?u.message:"Failed to verify order parameters"}`,uri:"verifyOrder"}],isError:!0}}case"executeOrder":try{let u=this.verifiedOrders.get(r.clOrdID);if(!u)return{content:[{type:"text",text:`Error: Order ${r.clOrdID} has not been verified. Please call verifyOrder first.`,uri:"executeOrder"}],isError:!0};if(u.handlInst!==r.handlInst||u.quantity!==Number.parseFloat(r.quantity)||u.price!==Number.parseFloat(r.price)||u.ordType!==r.ordType||u.side!==r.side||u.symbol!==r.symbol||u.timeInForce!==r.timeInForce)return{content:[{type:"text",text:"Error: Order parameters do not match the verified order. Please use the exact same parameters that were verified.",uri:"executeOrder"}],isError:!0};let b=new Promise(i=>{this.pendingRequests.set(r.clOrdID,i)}),s=this.parser?.createMessage(new $.Field($.Fields.MsgType,$.Messages.NewOrderSingle),new $.Field($.Fields.MsgSeqNum,this.parser?.getNextTargetMsgSeqNum()),new $.Field($.Fields.SenderCompID,this.parser?.sender),new $.Field($.Fields.TargetCompID,this.parser?.target),new $.Field($.Fields.SendingTime,this.parser?.getTimestamp()),new $.Field($.Fields.ClOrdID,r.clOrdID),new $.Field($.Fields.Side,r.side),new $.Field($.Fields.Symbol,r.symbol),new $.Field($.Fields.OrderQty,Number.parseFloat(r.quantity)),new $.Field($.Fields.Price,Number.parseFloat(r.price)),new $.Field($.Fields.OrdType,r.ordType),new $.Field($.Fields.HandlInst,r.handlInst),new $.Field($.Fields.TimeInForce,r.timeInForce),new $.Field($.Fields.TransactTime,this.parser?.getTimestamp()));if(!this.parser?.connected)return{content:[{type:"text",text:"Error: Not connected. Ignoring message.",uri:"executeOrder"}],isError:!0};this.parser?.send(s);let f=await b;return this.verifiedOrders.delete(r.clOrdID),{content:[{type:"text",text:f.messageType===$.Messages.Reject?`Reject message for order ${r.clOrdID}: ${JSON.stringify(f.toFIXJSON())}`:`Execution Report for order ${r.clOrdID}: ${JSON.stringify(f.toFIXJSON())}`,uri:"executeOrder"}]}}catch(u){return{content:[{type:"text",text:`Error: ${u instanceof Error?u.message:"Failed to execute order"}`,uri:"executeOrder"}],isError:!0}}case"marketDataRequest":try{let u=new Promise(i=>{this.pendingRequests.set(r.mdReqID,i)}),b=[new $.Field($.Fields.MsgType,$.Messages.MarketDataRequest),new $.Field($.Fields.SenderCompID,this.parser?.sender),new $.Field($.Fields.MsgSeqNum,this.parser?.getNextTargetMsgSeqNum()),new $.Field($.Fields.TargetCompID,this.parser?.target),new $.Field($.Fields.SendingTime,this.parser?.getTimestamp()),new $.Field($.Fields.MDReqID,r.mdReqID),new $.Field($.Fields.SubscriptionRequestType,r.subscriptionRequestType),new $.Field($.Fields.MarketDepth,0),new $.Field($.Fields.MDUpdateType,r.mdUpdateType)];b.push(new $.Field($.Fields.NoRelatedSym,r.symbols.length)),r.symbols.forEach(i=>{b.push(new $.Field($.Fields.Symbol,i))}),b.push(new $.Field($.Fields.NoMDEntryTypes,r.mdEntryTypes.length)),r.mdEntryTypes.forEach(i=>{b.push(new $.Field($.Fields.MDEntryType,i))});let s=this.parser?.createMessage(...b);if(!this.parser?.connected)return{content:[{type:"text",text:"Error: Not connected. Ignoring message.",uri:"marketDataRequest"}],isError:!0};this.parser?.send(s);let f=await u;return{content:[{type:"text",text:`Market data for ${r.symbols.join(", ")}: ${JSON.stringify(f.toFIXJSON())}`,uri:"marketDataRequest"}]}}catch(u){return{content:[{type:"text",text:`Error: ${u instanceof Error?u.message:"Failed to request market data"}`,uri:"marketDataRequest"}],isError:!0}}case"getStockGraph":try{let u=r.symbol,b=this.marketDataPrices.get(u)||[];if(b.length===0)return{content:[{type:"text",text:`No price data available for ${u}`,uri:"getStockGraph"}]};let s=600,f=300,i=40,c=(s-2*i)/(b.length-1),n=Math.min(...b.map(p=>p.price)),l=Math.max(...b.map(p=>p.price)),d=(f-2*i)/(l-n),a=b.map((p,v)=>{let x=i+v*c,T=f-i-(p.price-n)*d;return`${x},${T}`}).join(" L "),o=`<?xml version="1.0" encoding="UTF-8"?>
17
+ <svg width="${s}" height="${f}" xmlns="http://www.w3.org/2000/svg">
18
+ <!-- Background -->
19
+ <rect width="100%" height="100%" fill="#f8f9fa"/>
20
+
21
+ <!-- Grid lines -->
22
+ <g stroke="#e9ecef" stroke-width="1">
23
+ ${Array.from({length:5},(p,v)=>{let x=i+(f-2*i)*v/4;return`<line x1="${i}" y1="${x}" x2="${s-i}" y2="${x}"/>`}).join(`
24
+ `)}
25
+ </g>
26
+
27
+ <!-- Price line -->
28
+ <path d="M ${a}"
29
+ fill="none"
30
+ stroke="#007bff"
31
+ stroke-width="2"/>
32
+
33
+ <!-- Data points -->
34
+ ${b.map((p,v)=>{let x=i+v*c,T=f-i-(p.price-n)*d;return`<circle cx="${x}" cy="${T}" r="3" fill="#007bff"/>`}).join(`
35
+ `)}
36
+
37
+ <!-- Labels -->
38
+ <g font-family="Arial" font-size="12" fill="#495057">
39
+ ${Array.from({length:5},(p,v)=>{let x=i+(s-2*i)*v/4,T=Math.floor((b.length-1)*v/4),_=new Date(b[T].timestamp).toLocaleTimeString();return`<text x="${x+i}" y="${f-i+20}" text-anchor="middle">${_}</text>`}).join(`
40
+ `)}
41
+ ${Array.from({length:5},(p,v)=>{let x=i+(f-2*i)*v/4,T=l-(l-n)*v/4;return`<text x="${i-5}" y="${x+4}" text-anchor="end">$${T.toFixed(2)}</text>`}).join(`
42
+ `)}
43
+ </g>
44
+
45
+ <!-- Title -->
46
+ <text x="${s/2}" y="${i/2}"
47
+ font-family="Arial" font-size="16" font-weight="bold"
48
+ text-anchor="middle" fill="#212529">
49
+ ${u} - Price Chart (${b.length} points)
50
+ </text>
51
+ </svg>`;return{content:[{type:"image",text:(await(0,ir.default)(Buffer.from(o)).png().toBuffer()).toString("base64"),uri:"getStockGraph",mimeType:"image/png"}]}}catch(u){return{content:[{type:"text",text:`Error: ${u instanceof Error?u.message:"Failed to generate stock graph"}`,uri:"getStockGraph"}],isError:!0}}case"getStockPriceHistory":try{let u=r.symbol,b=this.marketDataPrices.get(u)||[];return b.length===0?{content:[{type:"text",text:`No price data available for ${u}`,uri:"getStockPriceHistory"}]}:{content:[{type:"text",text:JSON.stringify({symbol:u,count:b.length,prices:b.map(s=>({timestamp:new Date(s.timestamp).toISOString(),price:s.price}))},null,2),uri:"getStockPriceHistory"}]}}catch(u){return{content:[{type:"text",text:`Error: ${u instanceof Error?u.message:"Failed to get stock price history"}`,uri:"getStockPriceHistory"}],isError:!0}}default:return{content:[{type:"text",text:`Tool not found: ${e}`,uri:e}],isError:!0}}}),process.on("SIGINT",async()=>{await this.server.close(),process.exit(0)}))}};var nr=async()=>{await N.LicenseManager.setLicenseKey(process.env.FIXPARSER_LICENSE_KEY);let P=process.env.FIXPARSER_SENDER||"SENDER",y=process.env.FIXPARSER_TARGET||"TARGET",e=new N.FIXParser({logging:!0,logOptions:{level:"info",format:"jsonrpc",transport:new le({format:"jsonrpc"})},plugins:[new we({port:3099,onReady:()=>{}})]}),r=()=>{let b=e.createMessage(new N.Field(N.Fields.MsgType,N.Messages.Logon),new N.Field(N.Fields.MsgSeqNum,e.getNextTargetMsgSeqNum()),new N.Field(N.Fields.SenderCompID,P),new N.Field(N.Fields.SendingTime,e.getTimestamp()),new N.Field(N.Fields.TargetCompID,y),new N.Field(N.Fields.ResetSeqNumFlag,N.ResetSeqNumFlag.Yes),new N.Field(N.Fields.EncryptMethod,N.EncryptMethod.None),new N.Field(N.Fields.HeartBtInt,10));e.send(b)},u={host:process.env.FIXPARSER_HOST||"10.0.1.42",port:process.env.FIXPARSER_PORT?Number.parseInt(process.env.FIXPARSER_PORT,10):5001,protocol:"tcp",sender:P,target:y,fixVersion:"FIX.4.4",onOpen:()=>{e.logger.log({level:"info",message:"FIXParser logging in..."}),r()},onClose:()=>{e.logger.log({level:"info",message:"FIXParser disconnected. Reconnecting in 1 second..."}),setTimeout(()=>{e.connect(u)},1e3)}};e.connect(u)};nr().catch(P=>console.error("Error initializing server:",P));
6
52
  //# sourceMappingURL=example_mcp_local.js.map