@php-wasm/xdebug-bridge 2.0.11 → 2.0.13

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.
@@ -0,0 +1,115 @@
1
+ "use strict";const gr=require("assert"),Ot=require("path"),Xt=require("fs"),kn=require("util"),ys=require("url"),bs=require("ws"),ws=require("net"),Es=require("timers");var Ve=typeof document<"u"?document.currentScript:null;const $i=function(){return typeof process<"u"&&process.release?.name==="node"?"NODE":typeof window<"u"?"WEB":typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?"WORKER":"NODE"}();if($i==="NODE"){let a=function(e){return new Promise(function(n,s){e.onload=e.onerror=function(i){e.onload=e.onerror=null,i.type==="load"?n(e.result):s(new Error("Failed to read the blob/file"))}})},t=function(){const e=new Uint8Array([1,2,3,4]),s=new File([e],"test").stream();try{return s.getReader({mode:"byob"}),!0}catch{return!1}};if(typeof File>"u"){class e extends Blob{constructor(s,i,r){super(s);let o;r?.lastModified&&(o=new Date),(!o||isNaN(o.getFullYear()))&&(o=new Date),this.lastModifiedDate=o,this.lastModified=o.getMilliseconds(),this.name=i||""}}global.File=e}typeof Blob.prototype.arrayBuffer>"u"&&(Blob.prototype.arrayBuffer=function(){const n=new FileReader;return n.readAsArrayBuffer(this),a(n)}),typeof Blob.prototype.text>"u"&&(Blob.prototype.text=function(){const n=new FileReader;return n.readAsText(this),a(n)}),(typeof Blob.prototype.stream>"u"||!t())&&(Blob.prototype.stream=function(){let e=0;const n=this;return new ReadableStream({type:"bytes",autoAllocateChunkSize:512*1024,async pull(s){const i=s.byobRequest.view,o=await n.slice(e,e+i.byteLength).arrayBuffer(),l=new Uint8Array(o);new Uint8Array(i.buffer).set(l);const E=l.byteLength;s.byobRequest.respond(E),e+=E,e>=n.size&&s.close()}})})}if($i==="NODE"&&typeof CustomEvent>"u"){class a extends Event{constructor(e,n={}){super(e,n),this.detail=n.detail}initCustomEvent(){}}globalThis.CustomEvent=a}const xs="playground-log",yr=(a,...t)=>{Lt.dispatchEvent(new CustomEvent(xs,{detail:{log:a,args:t}}))},Os=(a,...t)=>{switch(typeof a.message=="string"?Reflect.set(a,"message",Hn(a.message)):a.message.message&&typeof a.message.message=="string"&&Reflect.set(a.message,"message",Hn(a.message.message)),a.severity){case xt.Debug:console.debug(a.message,...t);break;case xt.Info:console.info(a.message,...t);break;case xt.Warn:console.warn(a.message,...t);break;case xt.Error:console.error(a.message,...t);break;case xt.Fatal:console.error(a.message,...t);break;default:console.log(a.message,...t)}},Is=a=>a instanceof Error?[a.message,a.stack].join(`
2
+ `):JSON.stringify(a,null,2),qi=[],br=a=>{qi.push(a)},Vn=a=>{if(a.raw===!0)br(a.message);else{const t=vs(typeof a.message=="object"?Is(a.message):a.message,a.severity,a.prefix??le.JS);br(t)}},xt={Fatal:{name:"fatal",level:0},Error:{name:"error",level:1},Warn:{name:"warn",level:2},Log:{name:"log",level:3},Info:{name:"info",level:4},Debug:{name:"debug",level:5}},le={JS:"JavaScript"};class Cs extends EventTarget{constructor(t=[]){super(),this.fatalErrorEvent="playground-fatal-error",this.severity=xt.Info,this.handlers=t}getLogs(){return this.handlers.includes(Vn)?[...qi]:(this.error(`Logs aren't stored because the logToMemory handler isn't registered.
3
+ If you're using a custom logger instance, make sure to register logToMemory handler.
4
+ `),[])}logMessage(t,...e){const n={...t,severity:t.severity??xt.Log};for(const s of this.handlers)n.severity.level<=this.severity.level&&s(n,...e)}setSeverityFilterLevel(t){this.severity=t}log(t,...e){this.logMessage({message:t,severity:xt.Log,prefix:le.JS,raw:!1},...e)}debug(t,...e){this.logMessage({message:t,severity:xt.Debug,prefix:le.JS,raw:!1},...e)}info(t,...e){this.logMessage({message:t,severity:xt.Info,prefix:le.JS,raw:!1},...e)}warn(t,...e){this.logMessage({message:t,severity:xt.Warn,prefix:le.JS,raw:!1},...e)}error(t,...e){this.logMessage({message:t,severity:xt.Error,prefix:le.JS,raw:!1},...e)}}const Ts=()=>{try{if(process.env.NODE_ENV==="test")return[Vn,yr]}catch{}return[Vn,Os,yr]},Lt=new Cs(Ts()),Hn=a=>a.replace(/\t/g,""),vs=(a,t,e)=>{const n=new Date,s=new Intl.DateTimeFormat("en-GB",{year:"numeric",month:"short",day:"2-digit",timeZone:"UTC"}).format(n).replace(/ /g,"-"),i=new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"UTC",timeZoneName:"short"}).format(n),r=s+" "+i;return a=Hn(a),`[${r}] ${e} ${t.name}: ${a}`};var it=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Kn={exports:{}},fe=typeof Reflect=="object"?Reflect:null,wr=fe&&typeof fe.apply=="function"?fe.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)},Re;fe&&typeof fe.ownKeys=="function"?Re=fe.ownKeys:Object.getOwnPropertySymbols?Re=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Re=function(t){return Object.getOwnPropertyNames(t)};function Ds(a){console&&console.warn&&console.warn(a)}var Wi=Number.isNaN||function(t){return t!==t};function ct(){ct.init.call(this)}Kn.exports=ct;Kn.exports.once=Ms;ct.EventEmitter=ct;ct.prototype._events=void 0;ct.prototype._eventsCount=0;ct.prototype._maxListeners=void 0;var Er=10;function $e(a){if(typeof a!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof a)}Object.defineProperty(ct,"defaultMaxListeners",{enumerable:!0,get:function(){return Er},set:function(a){if(typeof a!="number"||a<0||Wi(a))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+a+".");Er=a}});ct.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};ct.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Wi(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Vi(a){return a._maxListeners===void 0?ct.defaultMaxListeners:a._maxListeners}ct.prototype.getMaxListeners=function(){return Vi(this)};ct.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var s=t==="error",i=this._events;if(i!==void 0)s=s&&i.error===void 0;else if(!s)return!1;if(s){var r;if(e.length>0&&(r=e[0]),r instanceof Error)throw r;var o=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw o.context=r,o}var l=i[t];if(l===void 0)return!1;if(typeof l=="function")wr(l,this,e);else for(var E=l.length,p=ki(l,E),n=0;n<E;++n)wr(p[n],this,e);return!0};function Hi(a,t,e,n){var s,i,r;if($e(e),i=a._events,i===void 0?(i=a._events=Object.create(null),a._eventsCount=0):(i.newListener!==void 0&&(a.emit("newListener",t,e.listener?e.listener:e),i=a._events),r=i[t]),r===void 0)r=i[t]=e,++a._eventsCount;else if(typeof r=="function"?r=i[t]=n?[e,r]:[r,e]:n?r.unshift(e):r.push(e),s=Vi(a),s>0&&r.length>s&&!r.warned){r.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=a,o.type=t,o.count=r.length,Ds(o)}return a}ct.prototype.addListener=function(t,e){return Hi(this,t,e,!1)};ct.prototype.on=ct.prototype.addListener;ct.prototype.prependListener=function(t,e){return Hi(this,t,e,!0)};function _s(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function zi(a,t,e){var n={fired:!1,wrapFn:void 0,target:a,type:t,listener:e},s=_s.bind(n);return s.listener=e,n.wrapFn=s,s}ct.prototype.once=function(t,e){return $e(e),this.on(t,zi(this,t,e)),this};ct.prototype.prependOnceListener=function(t,e){return $e(e),this.prependListener(t,zi(this,t,e)),this};ct.prototype.removeListener=function(t,e){var n,s,i,r,o;if($e(e),s=this._events,s===void 0)return this;if(n=s[t],n===void 0)return this;if(n===e||n.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete s[t],s.removeListener&&this.emit("removeListener",t,n.listener||e));else if(typeof n!="function"){for(i=-1,r=n.length-1;r>=0;r--)if(n[r]===e||n[r].listener===e){o=n[r].listener,i=r;break}if(i<0)return this;i===0?n.shift():Ns(n,i),n.length===1&&(s[t]=n[0]),s.removeListener!==void 0&&this.emit("removeListener",t,o||e)}return this};ct.prototype.off=ct.prototype.removeListener;ct.prototype.removeAllListeners=function(t){var e,n,s;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var i=Object.keys(n),r;for(s=0;s<i.length;++s)r=i[s],r!=="removeListener"&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(e=n[t],typeof e=="function")this.removeListener(t,e);else if(e!==void 0)for(s=e.length-1;s>=0;s--)this.removeListener(t,e[s]);return this};function Yi(a,t,e){var n=a._events;if(n===void 0)return[];var s=n[t];return s===void 0?[]:typeof s=="function"?e?[s.listener||s]:[s]:e?As(s):ki(s,s.length)}ct.prototype.listeners=function(t){return Yi(this,t,!0)};ct.prototype.rawListeners=function(t){return Yi(this,t,!1)};ct.listenerCount=function(a,t){return typeof a.listenerCount=="function"?a.listenerCount(t):Gi.call(a,t)};ct.prototype.listenerCount=Gi;function Gi(a){var t=this._events;if(t!==void 0){var e=t[a];if(typeof e=="function")return 1;if(e!==void 0)return e.length}return 0}ct.prototype.eventNames=function(){return this._eventsCount>0?Re(this._events):[]};function ki(a,t){for(var e=new Array(t),n=0;n<t;++n)e[n]=a[n];return e}function Ns(a,t){for(;t+1<a.length;t++)a[t]=a[t+1];a.pop()}function As(a){for(var t=new Array(a.length),e=0;e<t.length;++e)t[e]=a[e].listener||a[e];return t}function Ms(a,t){return new Promise(function(e,n){function s(r){a.removeListener(t,i),n(r)}function i(){typeof a.removeListener=="function"&&a.removeListener("error",s),e([].slice.call(arguments))}Ki(a,t,i,{once:!0}),t!=="error"&&Ps(a,s,{once:!0})})}function Ps(a,t,e){typeof a.on=="function"&&Ki(a,"error",t,e)}function Ki(a,t,e,n){if(typeof a.on=="function")n.once?a.once(t,e):a.on(t,e);else if(typeof a.addEventListener=="function")a.addEventListener(t,function s(i){n.once&&a.removeEventListener(t,s),e(i)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof a)}var Qn=Kn.exports;class Qi extends Qn.EventEmitter{constructor(t=9229){super(),this.ws=null,this.wss=new bs.WebSocketServer({port:t}),this.wss.on("connection",e=>{if(this.ws){e.close();return}this.ws=e,this.emit("clientConnected"),e.on("message",n=>{Lt.debug("\x1B[1;32m[CDP][received]\x1B[0m",n.toString());let s;try{s=JSON.parse(n.toString())}catch{return}this.emit("message",s)}),e.on("close",()=>{this.ws=null,this.emit("clientDisconnected")}),e.on("error",n=>{this.emit("error",n)})})}sendMessage(t){if(!this.ws||this.ws.readyState!==this.ws.OPEN)return;const e=JSON.stringify(t);Lt.debug("\x1B[1;32m[CDP][send]\x1B[0m",e),this.ws.send(e)}close(){this.wss.close()}}class Ji extends Qn.EventEmitter{constructor(t=9003){super(),this.socket=null,this.buffer="",this.expectedLength=null,this.server=ws.createServer(),this.server.on("connection",e=>{if(this.socket){e.destroy();return}this.socket=e,e.setEncoding("utf8"),this.emit("connected"),e.on("data",n=>this.onData(n.toString())),e.on("close",()=>{this.socket=null,this.emit("close")}),e.on("error",n=>{this.emit("error",n)})}),this.server.listen(t)}onData(t){for(Lt.debug("\x1B[1;32m[XDebug][received]]\x1B[0m",t),this.buffer+=t;;){if(this.expectedLength===null){const e=this.buffer.indexOf("\0");if(e===-1)break;const n=this.buffer.substring(0,e),s=parseInt(n,10);if(isNaN(s)){this.buffer="";break}this.expectedLength=s,this.buffer=this.buffer.slice(e+1)}if(this.expectedLength!==null&&this.buffer.length>=this.expectedLength){const e=this.buffer.substring(0,this.expectedLength);this.buffer=this.buffer.slice(this.expectedLength),this.buffer.startsWith("\0")&&(this.buffer=this.buffer.slice(1));const n=e.trim();this.expectedLength=null,this.emit("message",n);continue}break}}sendCommand(t){this.socket&&(Lt.debug("\x1B[1;32m[XDebug][send]\x1B[0m",t),this.socket.write(t+"\0"))}close(){this.server.close()}}const Ls={right:Us,center:Xs},Ss=0,Be=1,Fs=2,Ue=3;class js{constructor(t){var e;this.width=t.width,this.wrap=(e=t.wrap)!==null&&e!==void 0?e:!0,this.rows=[]}span(...t){const e=this.div(...t);e.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);const e=t.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(e),e}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){const e=t.split(`
5
+ `).map(s=>s.split(" "));let n=0;return e.forEach(s=>{s.length>1&&Dt.stringWidth(s[0])>n&&(n=Math.min(Math.floor(this.width*.5),Dt.stringWidth(s[0])))}),e.forEach(s=>{this.div(...s.map((i,r)=>({text:i.trim(),padding:this.measurePadding(i),width:r===0&&s.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){const e=Dt.stripAnsi(t);return[0,e.match(/\s*$/)[0].length,0,e.match(/^\s*/)[0].length]}toString(){const t=[];return this.rows.forEach(e=>{this.rowToString(e,t)}),t.filter(e=>!e.hidden).map(e=>e.text).join(`
6
+ `)}rowToString(t,e){return this.rasterize(t).forEach((n,s)=>{let i="";n.forEach((r,o)=>{const{width:l}=t[o],E=this.negatePadding(t[o]);let p=r;if(E>Dt.stringWidth(r)&&(p+=" ".repeat(E-Dt.stringWidth(r))),t[o].align&&t[o].align!=="left"&&this.wrap){const b=Ls[t[o].align];p=b(p,E),Dt.stringWidth(p)<E&&(p+=" ".repeat((l||0)-Dt.stringWidth(p)-1))}const d=t[o].padding||[0,0,0,0];d[Ue]&&(i+=" ".repeat(d[Ue])),i+=xr(t[o],p,"| "),i+=p,i+=xr(t[o],p," |"),d[Be]&&(i+=" ".repeat(d[Be])),s===0&&e.length>0&&(i=this.renderInline(i,e[e.length-1]))}),e.push({text:i.replace(/ +$/,""),span:t.span})}),e}renderInline(t,e){const n=t.match(/^ */),s=n?n[0].length:0,i=e.text,r=Dt.stringWidth(i.trimRight());return e.span?this.wrap?s<r?t:(e.hidden=!0,i.trimRight()+" ".repeat(s-r)+t.trimLeft()):(e.hidden=!0,i+t):t}rasterize(t){const e=[],n=this.columnWidths(t);let s;return t.forEach((i,r)=>{i.width=n[r],this.wrap?s=Dt.wrap(i.text,this.negatePadding(i),{hard:!0}).split(`
7
+ `):s=i.text.split(`
8
+ `),i.border&&(s.unshift("."+"-".repeat(this.negatePadding(i)+2)+"."),s.push("'"+"-".repeat(this.negatePadding(i)+2)+"'")),i.padding&&(s.unshift(...new Array(i.padding[Ss]||0).fill("")),s.push(...new Array(i.padding[Fs]||0).fill(""))),s.forEach((o,l)=>{e[l]||e.push([]);const E=e[l];for(let p=0;p<r;p++)E[p]===void 0&&E.push("");E.push(o)})}),e}negatePadding(t){let e=t.width||0;return t.padding&&(e-=(t.padding[Ue]||0)+(t.padding[Be]||0)),t.border&&(e-=4),e}columnWidths(t){if(!this.wrap)return t.map(r=>r.width||Dt.stringWidth(r.text));let e=t.length,n=this.width;const s=t.map(r=>{if(r.width)return e--,n-=r.width,r.width}),i=e?Math.floor(n/e):0;return s.map((r,o)=>r===void 0?Math.max(i,Rs(t[o])):r)}}function xr(a,t,e){return a.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?e:" ":""}function Rs(a){const t=a.padding||[],e=1+(t[Ue]||0)+(t[Be]||0);return a.border?e+4:e}function Bs(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Us(a,t){a=a.trim();const e=Dt.stringWidth(a);return e<t?" ".repeat(t-e)+a:a}function Xs(a,t){a=a.trim();const e=Dt.stringWidth(a);return e>=t?a:" ".repeat(t-e>>1)+a}let Dt;function $s(a,t){return Dt=t,new js({width:a?.width||Bs(),wrap:a?.wrap})}const Zi=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function ts(a){return a.replace(Zi,"")}function qs(a,t){const[e,n]=a.match(Zi)||["",""];a=ts(a);let s="";for(let i=0;i<a.length;i++)i!==0&&i%t===0&&(s+=`
9
+ `),s+=a.charAt(i);return e&&n&&(s=`${e}${s}${n}`),s}function Ws(a){return $s(a,{stringWidth:t=>[...t].length,stripAnsi:ts,wrap:qs})}function Vs(a,t){let e=Ot.resolve(".",a),n;for(Xt.statSync(e).isDirectory()||(e=Ot.dirname(e));;){if(n=t(e,Xt.readdirSync(e)),n)return Ot.resolve(e,n);if(e=Ot.dirname(n=e),n===e)break}}/**
10
+ * @license
11
+ * Copyright (c) 2016, Contributors
12
+ * SPDX-License-Identifier: ISC
13
+ */function me(a){if(a!==a.toLowerCase()&&a!==a.toUpperCase()||(a=a.toLowerCase()),a.indexOf("-")===-1&&a.indexOf("_")===-1)return a;{let e="",n=!1;const s=a.match(/^-+/);for(let i=s?s[0].length:0;i<a.length;i++){let r=a.charAt(i);n&&(n=!1,r=r.toUpperCase()),i!==0&&(r==="-"||r==="_")?n=!0:r!=="-"&&r!=="_"&&(e+=r)}return e}}function es(a,t){const e=a.toLowerCase();t=t||"-";let n="";for(let s=0;s<a.length;s++){const i=e.charAt(s),r=a.charAt(s);i!==r&&s>0?n+=`${t}${e.charAt(s)}`:n+=r}return n}function ns(a){return a==null?!1:typeof a=="number"||/^0x[0-9a-f]+$/i.test(a)?!0:/^0[^.]/.test(a)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(a)}/**
14
+ * @license
15
+ * Copyright (c) 2016, Contributors
16
+ * SPDX-License-Identifier: ISC
17
+ */function Hs(a){if(Array.isArray(a))return a.map(r=>typeof r!="string"?r+"":r);a=a.trim();let t=0,e=null,n=null,s=null;const i=[];for(let r=0;r<a.length;r++){if(e=n,n=a.charAt(r),n===" "&&!s){e!==" "&&t++;continue}n===s?s=null:(n==="'"||n==='"')&&!s&&(s=n),i[t]||(i[t]=""),i[t]+=n}return i}/**
18
+ * @license
19
+ * Copyright (c) 2016, Contributors
20
+ * SPDX-License-Identifier: ISC
21
+ */var jt;(function(a){a.BOOLEAN="boolean",a.STRING="string",a.NUMBER="number",a.ARRAY="array"})(jt||(jt={}));/**
22
+ * @license
23
+ * Copyright (c) 2016, Contributors
24
+ * SPDX-License-Identifier: ISC
25
+ */let qt;class zs{constructor(t){qt=t}parse(t,e){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},e),s=Hs(t),i=typeof t=="string",r=Ys(Object.assign(Object.create(null),n.alias)),o=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),l=Object.assign(Object.create(null),n.default),E=n.configObjects||[],p=n.envPrefix,d=o["populate--"],b=d?"--":"_",w=Object.create(null),T=Object.create(null),_=n.__||qt.format,I={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},v=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,C=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(A){const f=typeof A=="object"?A.key:A,u=Object.keys(A).map(function(c){return{boolean:"bools",string:"strings",number:"numbers"}[c]}).filter(Boolean).pop();u&&(I[u][f]=!0),I.arrays[f]=!0,I.keys.push(f)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(A){I.bools[A]=!0,I.keys.push(A)}),[].concat(n.string||[]).filter(Boolean).forEach(function(A){I.strings[A]=!0,I.keys.push(A)}),[].concat(n.number||[]).filter(Boolean).forEach(function(A){I.numbers[A]=!0,I.keys.push(A)}),[].concat(n.count||[]).filter(Boolean).forEach(function(A){I.counts[A]=!0,I.keys.push(A)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(A){I.normalize[A]=!0,I.keys.push(A)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([A,f])=>{typeof f=="number"&&(I.nargs[A]=f,I.keys.push(A))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([A,f])=>{typeof f=="function"&&(I.coercions[A]=f,I.keys.push(A))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(A){I.configs[A]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([A,f])=>{(typeof f=="boolean"||typeof f=="function")&&(I.configs[A]=f)})),_t(n.key,r,n.default,I.arrays),Object.keys(l).forEach(function(A){(I.aliases[A]||[]).forEach(function(f){l[f]=l[A]})});let m=null;ht();let D=[];const M=Object.assign(Object.create(null),{_:[]}),X={};for(let A=0;A<s.length;A++){const f=s[A],u=f.replace(/^-{3,}/,"---");let c,h,N,L,F,Z;if(f!=="--"&&/^-/.test(f)&&y(f))q(f);else if(u.match(/^---+(=|$)/)){q(f);continue}else if(f.match(/^--.+=/)||!o["short-option-groups"]&&f.match(/^-.+=/))L=f.match(/^--?([^=]+)=([\s\S]*)$/),L!==null&&Array.isArray(L)&&L.length>=3&&(K(L[1],I.arrays)?A=g(A,L[1],s,L[2]):K(L[1],I.nargs)!==!1?A=U(A,L[1],s,L[2]):R(L[1],L[2],!0));else if(f.match(C)&&o["boolean-negation"])L=f.match(C),L!==null&&Array.isArray(L)&&L.length>=2&&(h=L[1],R(h,K(h,I.arrays)?[!1]:!1));else if(f.match(/^--.+/)||!o["short-option-groups"]&&f.match(/^-[^-]+/))L=f.match(/^--?(.+)/),L!==null&&Array.isArray(L)&&L.length>=2&&(h=L[1],K(h,I.arrays)?A=g(A,h,s):K(h,I.nargs)!==!1?A=U(A,h,s):(F=s[A+1],F!==void 0&&(!F.match(/^-/)||F.match(v))&&!K(h,I.bools)&&!K(h,I.counts)||/^(true|false)$/.test(F)?(R(h,F),A++):R(h,P(h))));else if(f.match(/^-.\..+=/))L=f.match(/^-([^=]+)=([\s\S]*)$/),L!==null&&Array.isArray(L)&&L.length>=3&&R(L[1],L[2]);else if(f.match(/^-.\..+/)&&!f.match(v))F=s[A+1],L=f.match(/^-(.\..+)/),L!==null&&Array.isArray(L)&&L.length>=2&&(h=L[1],F!==void 0&&!F.match(/^-/)&&!K(h,I.bools)&&!K(h,I.counts)?(R(h,F),A++):R(h,P(h)));else if(f.match(/^-[^-]+/)&&!f.match(v)){N=f.slice(1,-1).split(""),c=!1;for(let nt=0;nt<N.length;nt++){if(F=f.slice(nt+2),N[nt+1]&&N[nt+1]==="="){Z=f.slice(nt+3),h=N[nt],K(h,I.arrays)?A=g(A,h,s,Z):K(h,I.nargs)!==!1?A=U(A,h,s,Z):R(h,Z),c=!0;break}if(F==="-"){R(N[nt],F);continue}if(/[A-Za-z]/.test(N[nt])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(F)&&K(F,I.bools)===!1){R(N[nt],F),c=!0;break}if(N[nt+1]&&N[nt+1].match(/\W/)){R(N[nt],F),c=!0;break}else R(N[nt],P(N[nt]))}h=f.slice(-1)[0],!c&&h!=="-"&&(K(h,I.arrays)?A=g(A,h,s):K(h,I.nargs)!==!1?A=U(A,h,s):(F=s[A+1],F!==void 0&&(!/^(-|--)[^-]/.test(F)||F.match(v))&&!K(h,I.bools)&&!K(h,I.counts)||/^(true|false)$/.test(F)?(R(h,F),A++):R(h,P(h))))}else if(f.match(/^-[0-9]$/)&&f.match(v)&&K(f.slice(1),I.bools))h=f.slice(1),R(h,P(h));else if(f==="--"){D=s.slice(A+1);break}else if(o["halt-at-non-option"]){D=s.slice(A);break}else q(f)}V(M,!0),V(M,!1),W(M),k(),at(M,I.aliases,l,!0),ft(M),o["set-placeholder-key"]&&It(M),Object.keys(I.counts).forEach(function(A){st(M,A.split("."))||R(A,0)}),d&&D.length&&(M[b]=[]),D.forEach(function(A){M[b].push(A)}),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(M).filter(A=>A!=="--"&&A.includes("-")).forEach(A=>{delete M[A]}),o["strip-aliased"]&&[].concat(...Object.keys(r).map(A=>r[A])).forEach(A=>{o["camel-case-expansion"]&&A.includes("-")&&delete M[A.split(".").map(f=>me(f)).join(".")],delete M[A]});function q(A){const f=$("_",A);(typeof f=="string"||typeof f=="number")&&M._.push(f)}function U(A,f,u,c){let h,N=K(f,I.nargs);if(N=typeof N!="number"||isNaN(N)?1:N,N===0)return rt(c)||(m=Error(_("Argument unexpected for: %s",f))),R(f,P(f)),A;let L=rt(c)?0:1;if(o["nargs-eats-options"])u.length-(A+1)+L<N&&(m=Error(_("Not enough arguments following: %s",f))),L=N;else{for(h=A+1;h<u.length&&(!u[h].match(/^-[^0-9]/)||u[h].match(v)||y(u[h]));h++)L++;L<N&&(m=Error(_("Not enough arguments following: %s",f)))}let F=Math.min(L,N);for(!rt(c)&&F>0&&(R(f,c),F--),h=A+1;h<F+A+1;h++)R(f,u[h]);return A+F}function g(A,f,u,c){let h=[],N=c||u[A+1];const L=K(f,I.nargs);if(K(f,I.bools)&&!/^(true|false)$/.test(N))h.push(!0);else if(rt(N)||rt(c)&&/^-/.test(N)&&!v.test(N)&&!y(N)){if(l[f]!==void 0){const F=l[f];h=Array.isArray(F)?F:[F]}}else{rt(c)||h.push(B(f,c,!0));for(let F=A+1;F<u.length&&!(!o["greedy-arrays"]&&h.length>0||L&&typeof L=="number"&&h.length>=L||(N=u[F],/^-/.test(N)&&!v.test(N)&&!y(N)));F++)A=F,h.push(B(f,N,i))}return typeof L=="number"&&(L&&h.length<L||isNaN(L)&&h.length===0)&&(m=Error(_("Not enough arguments following: %s",f))),R(f,h),A}function R(A,f,u=i){if(/-/.test(A)&&o["camel-case-expansion"]){const N=A.split(".").map(function(L){return me(L)}).join(".");S(A,N)}const c=B(A,f,u),h=A.split(".");ut(M,h,c),I.aliases[A]&&I.aliases[A].forEach(function(N){const L=N.split(".");ut(M,L,c)}),h.length>1&&o["dot-notation"]&&(I.aliases[h[0]]||[]).forEach(function(N){let L=N.split(".");const F=[].concat(h);F.shift(),L=L.concat(F),(I.aliases[A]||[]).includes(L.join("."))||ut(M,L,c)}),K(A,I.normalize)&&!K(A,I.arrays)&&[A].concat(I.aliases[A]||[]).forEach(function(L){Object.defineProperty(X,L,{enumerable:!0,get(){return f},set(F){f=typeof F=="string"?qt.normalize(F):F}})})}function S(A,f){I.aliases[A]&&I.aliases[A].length||(I.aliases[A]=[f],w[f]=!0),I.aliases[f]&&I.aliases[f].length||S(f,A)}function B(A,f,u){u&&(f=Gs(f)),(K(A,I.bools)||K(A,I.counts))&&typeof f=="string"&&(f=f==="true");let c=Array.isArray(f)?f.map(function(h){return $(A,h)}):$(A,f);return K(A,I.counts)&&(rt(c)||typeof c=="boolean")&&(c=He()),K(A,I.normalize)&&K(A,I.arrays)&&(Array.isArray(f)?c=f.map(h=>qt.normalize(h)):c=qt.normalize(f)),c}function $(A,f){return!o["parse-positional-numbers"]&&A==="_"||!K(A,I.strings)&&!K(A,I.bools)&&!Array.isArray(f)&&(ns(f)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${f}`)))||!rt(f)&&K(A,I.numbers))&&(f=Number(f)),f}function W(A){const f=Object.create(null);at(f,I.aliases,l),Object.keys(I.configs).forEach(function(u){const c=A[u]||f[u];if(c)try{let h=null;const N=qt.resolve(qt.cwd(),c),L=I.configs[u];if(typeof L=="function"){try{h=L(N)}catch(F){h=F}if(h instanceof Error){m=h;return}}else h=qt.require(N);Y(h)}catch(h){h.name==="PermissionDenied"?m=h:A[u]&&(m=Error(_("Invalid JSON config file: %s",c)))}})}function Y(A,f){Object.keys(A).forEach(function(u){const c=A[u],h=f?f+"."+u:u;typeof c=="object"&&c!==null&&!Array.isArray(c)&&o["dot-notation"]?Y(c,h):(!st(M,h.split("."))||K(h,I.arrays)&&o["combine-arrays"])&&R(h,c)})}function k(){typeof E<"u"&&E.forEach(function(A){Y(A)})}function V(A,f){if(typeof p>"u")return;const u=typeof p=="string"?p:"",c=qt.env();Object.keys(c).forEach(function(h){if(u===""||h.lastIndexOf(u,0)===0){const N=h.split("__").map(function(L,F){return F===0&&(L=L.substring(u.length)),me(L)});(f&&I.configs[N.join(".")]||!f)&&!st(A,N)&&R(N.join("."),c[h])}})}function ft(A){let f;const u=new Set;Object.keys(A).forEach(function(c){if(!u.has(c)&&(f=K(c,I.coercions),typeof f=="function"))try{const h=$(c,f(A[c]));[].concat(I.aliases[c]||[],c).forEach(N=>{u.add(N),A[N]=h})}catch(h){m=h}})}function It(A){return I.keys.forEach(f=>{~f.indexOf(".")||typeof A[f]>"u"&&(A[f]=void 0)}),A}function at(A,f,u,c=!1){Object.keys(u).forEach(function(h){st(A,h.split("."))||(ut(A,h.split("."),u[h]),c&&(T[h]=!0),(f[h]||[]).forEach(function(N){st(A,N.split("."))||ut(A,N.split("."),u[h])}))})}function st(A,f){let u=A;o["dot-notation"]||(f=[f.join(".")]),f.slice(0,-1).forEach(function(h){u=u[h]||{}});const c=f[f.length-1];return typeof u!="object"?!1:c in u}function ut(A,f,u){let c=A;o["dot-notation"]||(f=[f.join(".")]),f.slice(0,-1).forEach(function(Z){Z=Or(Z),typeof c=="object"&&c[Z]===void 0&&(c[Z]={}),typeof c[Z]!="object"||Array.isArray(c[Z])?(Array.isArray(c[Z])?c[Z].push({}):c[Z]=[c[Z],{}],c=c[Z][c[Z].length-1]):c=c[Z]});const h=Or(f[f.length-1]),N=K(f.join("."),I.arrays),L=Array.isArray(u);let F=o["duplicate-arguments-array"];!F&&K(h,I.nargs)&&(F=!0,(!rt(c[h])&&I.nargs[h]===1||Array.isArray(c[h])&&c[h].length===I.nargs[h])&&(c[h]=void 0)),u===He()?c[h]=He(c[h]):Array.isArray(c[h])?F&&N&&L?c[h]=o["flatten-duplicate-arrays"]?c[h].concat(u):(Array.isArray(c[h][0])?c[h]:[c[h]]).concat([u]):!F&&!!N==!!L?c[h]=u:c[h]=c[h].concat([u]):c[h]===void 0&&N?c[h]=L?u:[u]:F&&!(c[h]===void 0||K(h,I.counts)||K(h,I.bools))?c[h]=[c[h],u]:c[h]=u}function _t(...A){A.forEach(function(f){Object.keys(f||{}).forEach(function(u){I.aliases[u]||(I.aliases[u]=[].concat(r[u]||[]),I.aliases[u].concat(u).forEach(function(c){if(/-/.test(c)&&o["camel-case-expansion"]){const h=me(c);h!==u&&I.aliases[u].indexOf(h)===-1&&(I.aliases[u].push(h),w[h]=!0)}}),I.aliases[u].concat(u).forEach(function(c){if(c.length>1&&/[A-Z]/.test(c)&&o["camel-case-expansion"]){const h=es(c,"-");h!==u&&I.aliases[u].indexOf(h)===-1&&(I.aliases[u].push(h),w[h]=!0)}}),I.aliases[u].forEach(function(c){I.aliases[c]=[u].concat(I.aliases[u].filter(function(h){return c!==h}))}))})})}function K(A,f){const u=[].concat(I.aliases[A]||[],A),c=Object.keys(f),h=u.find(N=>c.includes(N));return h?f[h]:!1}function $t(A){const f=Object.keys(I);return[].concat(f.map(c=>I[c])).some(function(c){return Array.isArray(c)?c.includes(A):c[A]})}function Q(A,...f){return[].concat(...f).some(function(c){const h=A.match(c);return h&&$t(h[1])})}function x(A){if(A.match(v)||!A.match(/^-[^-]+/))return!1;let f=!0,u;const c=A.slice(1).split("");for(let h=0;h<c.length;h++){if(u=A.slice(h+2),!$t(c[h])){f=!1;break}if(c[h+1]&&c[h+1]==="="||u==="-"||/[A-Za-z]/.test(c[h])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(u)||c[h+1]&&c[h+1].match(/\W/))break}return f}function y(A){return o["unknown-options-as-args"]&&j(A)}function j(A){return A=A.replace(/^-{3,}/,"--"),A.match(v)||x(A)?!1:!Q(A,/^-+([^=]+?)=[\s\S]*$/,C,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function P(A){return!K(A,I.bools)&&!K(A,I.counts)&&`${A}`in l?l[A]:J(ot(A))}function J(A){return{[jt.BOOLEAN]:!0,[jt.STRING]:"",[jt.NUMBER]:void 0,[jt.ARRAY]:[]}[A]}function ot(A){let f=jt.BOOLEAN;return K(A,I.strings)?f=jt.STRING:K(A,I.numbers)?f=jt.NUMBER:K(A,I.bools)?f=jt.BOOLEAN:K(A,I.arrays)&&(f=jt.ARRAY),f}function rt(A){return A===void 0}function ht(){Object.keys(I.counts).find(A=>K(A,I.arrays)?(m=Error(_("Invalid configuration: %s, opts.count excludes opts.array.",A)),!0):K(A,I.nargs)?(m=Error(_("Invalid configuration: %s, opts.count excludes opts.narg.",A)),!0):!1)}return{aliases:Object.assign({},I.aliases),argv:Object.assign(X,M),configuration:o,defaulted:Object.assign({},T),error:m,newAliases:Object.assign({},w)}}}function Ys(a){const t=[],e=Object.create(null);let n=!0;for(Object.keys(a).forEach(function(s){t.push([].concat(a[s],s))});n;){n=!1;for(let s=0;s<t.length;s++)for(let i=s+1;i<t.length;i++)if(t[s].filter(function(o){return t[i].indexOf(o)!==-1}).length){t[s]=t[s].concat(t[i]),t.splice(i,1),n=!0;break}}return t.forEach(function(s){s=s.filter(function(r,o,l){return l.indexOf(r)===o});const i=s.pop();i!==void 0&&typeof i=="string"&&(e[i]=s)}),e}function He(a){return a!==void 0?a+1:1}function Or(a){return a==="__proto__"?"___proto___":a}function Gs(a){return typeof a=="string"&&(a[0]==="'"||a[0]==='"')&&a[a.length-1]===a[0]?a.substring(1,a.length-1):a}/**
26
+ * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
27
+ * CJS and ESM environments.
28
+ *
29
+ * @license
30
+ * Copyright (c) 2016, Contributors
31
+ * SPDX-License-Identifier: ISC
32
+ */var ze,Ye,Ge;const Ir=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,Cr=(Ye=(ze=process==null?void 0:process.versions)===null||ze===void 0?void 0:ze.node)!==null&&Ye!==void 0?Ye:(Ge=process==null?void 0:process.version)===null||Ge===void 0?void 0:Ge.slice(1);if(Cr&&Number(Cr.match(/^([^.]+)/)[1])<Ir)throw Error(`yargs parser supports a minimum Node.js version of ${Ir}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const ks=process?process.env:{},rs=new zs({cwd:process.cwd,env:()=>ks,format:kn.format,normalize:Ot.normalize,resolve:Ot.resolve,require:a=>{if(typeof require<"u")return require(a);if(a.match(/\.json$/))return JSON.parse(Xt.readFileSync(a,"utf8"));throw Error("only .json config files are supported in ESM")}}),Ie=function(t,e){return rs.parse(t.slice(),e).argv};Ie.detailed=function(a,t){return rs.parse(a.slice(),t)};Ie.camelCase=me;Ie.decamelize=es;Ie.looksLikeNumber=ns;function is(){return Ks()?0:1}function Ks(){return Qs()&&!process.defaultApp}function Qs(){return!!process.versions.electron}function Js(a){return a.slice(is()+1)}function Zs(){return process.argv[is()]}class gt extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,gt)}}const to={fs:{readFileSync:Xt.readFileSync,writeFile:Xt.writeFile},format:kn.format,resolve:Ot.resolve,exists:a=>{try{return Xt.statSync(a).isFile()}catch{return!1}}};let Ft;class eo{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);const e=t.shift();let n=function(){};return typeof t[t.length-1]=="function"&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]=e,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),Ft.format.apply(Ft.format,[this.cache[this.locale][e]||e].concat(t))}__n(){const t=Array.prototype.slice.call(arguments),e=t.shift(),n=t.shift(),s=t.shift();let i=function(){};typeof t[t.length-1]=="function"&&(i=t.pop()),this.cache[this.locale]||this._readLocaleFile();let r=s===1?e:n;this.cache[this.locale][e]&&(r=this.cache[this.locale][e][s===1?"one":"other"]),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]={one:e,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();const o=[r];return~r.indexOf("%d")&&o.push(s),Ft.format.apply(Ft.format,o.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.cache[this.locale][e]=t[e])}_taggedLiteral(t,...e){let n="";return t.forEach(function(s,i){const r=e[i+1];n+=s,typeof r<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(e,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){const t=this,e=this.writeQueue[0],n=e.directory,s=e.locale,i=e.cb,r=this._resolveLocaleFile(n,s),o=JSON.stringify(this.cache[s],null,2);Ft.fs.writeFile(r,o,"utf-8",function(l){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),i(l)})}_readLocaleFile(){let t={};const e=this._resolveLocaleFile(this.directory,this.locale);try{Ft.fs.readFileSync&&(t=JSON.parse(Ft.fs.readFileSync(e,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+e),n.code==="ENOENT")t={};else throw n}this.cache[this.locale]=t}_resolveLocaleFile(t,e){let n=Ft.resolve(t,"./",e+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~e.lastIndexOf("_")){const s=Ft.resolve(t,"./",e.split("_")[0]+".json");this._fileExistsSync(s)&&(n=s)}return n}_fileExistsSync(t){return Ft.exists(t)}}function no(a,t){Ft=t;const e=new eo(a);return{__:e.__.bind(e),__n:e.__n.bind(e),setLocale:e.setLocale.bind(e),getLocale:e.getLocale.bind(e),updateLocale:e.updateLocale.bind(e),locale:e.locale}}const ro=a=>no(a,to),io="require is not supported by ESM",Tr="loading a directory of commands is not supported yet for ESM";let xe;try{xe=ys.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:Ve&&Ve.tagName.toUpperCase()==="SCRIPT"&&Ve.src||new URL("run-cli-CioU2BLc.cjs",document.baseURI).href)}catch{xe=process.cwd()}const so=xe.substring(0,xe.lastIndexOf("node_modules")),oo={assert:{notStrictEqual:gr.notStrictEqual,strictEqual:gr.strictEqual},cliui:Ws,findUp:Vs,getEnv:a=>process.env[a],inspect:kn.inspect,getCallerFile:()=>{throw new gt(Tr)},getProcessArgvBin:Zs,mainFilename:so||process.cwd(),Parser:Ie,path:{basename:Ot.basename,dirname:Ot.dirname,extname:Ot.extname,relative:Ot.relative,resolve:Ot.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(a,t)=>process.emitWarning(a,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:Xt.readFileSync,require:()=>{throw new gt(io)},requireDirectory:()=>{throw new gt(Tr)},stringWidth:a=>[...a].length,y18n:ro({directory:Ot.resolve(xe,"../../../locales"),updateFiles:!1})};function Rt(a,t,e,n){e.assert.notStrictEqual(a,t,n)}function vr(a,t){t.assert.strictEqual(typeof a,"string")}function Xe(a){return Object.keys(a)}function yt(a){return!!a&&!!a.then&&typeof a.then=="function"}function be(a){const e=a.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,s=e.shift();if(!s)throw new Error(`No command found in: ${a}`);const i={cmd:s.replace(n,""),demanded:[],optional:[]};return e.forEach((r,o)=>{let l=!1;r=r.replace(/\s/g,""),/\.+[\]>]/.test(r)&&o===e.length-1&&(l=!0),/^\[/.test(r)?i.optional.push({cmd:r.replace(n,"").split("|"),variadic:l}):i.demanded.push({cmd:r.replace(n,"").split("|"),variadic:l})}),i}const ao=["first","second","third","fourth","fifth","sixth"];function z(a,t,e){function n(){return typeof a=="object"?[{demanded:[],optional:[]},a,t]:[be(`cmd ${a}`),t,e]}try{let s=0;const[i,r,o]=n(),l=[].slice.call(r);for(;l.length&&l[l.length-1]===void 0;)l.pop();const E=o||l.length;if(E<i.demanded.length)throw new gt(`Not enough arguments provided. Expected ${i.demanded.length} but received ${l.length}.`);const p=i.demanded.length+i.optional.length;if(E>p)throw new gt(`Too many arguments provided. Expected max ${p} but received ${E}.`);i.demanded.forEach(d=>{const b=l.shift(),w=Dr(b);d.cmd.filter(_=>_===w||_==="*").length===0&&_r(w,d.cmd,s),s+=1}),i.optional.forEach(d=>{if(l.length===0)return;const b=l.shift(),w=Dr(b);d.cmd.filter(_=>_===w||_==="*").length===0&&_r(w,d.cmd,s),s+=1})}catch(s){console.warn(s.stack)}}function Dr(a){return Array.isArray(a)?"array":a===null?"null":typeof a}function _r(a,t,e){throw new gt(`Invalid ${ao[e]||"manyith"} argument. Expected ${t.join(" or ")} but received ${a}.`)}class uo{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,n=!0,s=!1){if(z("<array|function> [boolean] [boolean] [boolean]",[t,e,n],arguments.length),Array.isArray(t)){for(let i=0;i<t.length;i++){if(typeof t[i]!="function")throw Error("middleware must be a function");const r=t[i];r.applyBeforeValidation=e,r.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){const i=t;i.applyBeforeValidation=e,i.global=n,i.mutates=s,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){const n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(s=>{const i=[...n[e]||[],e];return s.option?!i.includes(s.option):!0}),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}}function co(a){return a?a.map(t=>(t.applyBeforeValidation=!1,t)):[]}function we(a,t,e,n){return e.reduce((s,i)=>{if(i.applyBeforeValidation!==n)return s;if(i.mutates){if(i.applied)return s;i.applied=!0}if(yt(s))return s.then(r=>Promise.all([r,i(r,t)])).then(([r,o])=>Object.assign(r,o));{const r=i(s,t);return yt(r)?r.then(o=>Object.assign(s,o)):Object.assign(s,r)}},a)}function Ee(a,t,e=n=>{throw n}){try{const n=lo(a)?a():a;return yt(n)?n.then(s=>t(s)):t(n)}catch(n){return e(n)}}function lo(a){return typeof a=="function"}function fo(a){if(typeof require>"u")return null;for(let t=0,e=Object.keys(require.cache),n;t<e.length;t++)if(n=require.cache[e[t]],n.exports===a)return n;return null}const oe=/(^\*)|(^\$0)/;class ho{constructor(t,e,n,s){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=s,this.usage=t,this.globalMiddleware=n,this.validation=e}addDirectory(t,e,n,s){s=s||{},typeof s.recurse!="boolean"&&(s.recurse=!1),Array.isArray(s.extensions)||(s.extensions=["js"]);const i=typeof s.visit=="function"?s.visit:r=>r;s.visit=(r,o,l)=>{const E=i(r,o,l);if(E){if(this.requireCache.has(o))return E;this.requireCache.add(o),this.addHandler(E)}return E},this.shim.requireDirectory({require:e,filename:n},t,s)}addHandler(t,e,n,s,i,r){let o=[];const l=co(i);if(s=s||(()=>{}),Array.isArray(t))if(mo(t))[t,...o]=t;else for(const E of t)this.addHandler(E);else if(yo(t)){let E=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(E=[].concat(E).concat(t.aliases)),this.addHandler(E,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(Nr(n)){this.addHandler([t].concat(o),e,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof t=="string"){const E=be(t);o=o.map(b=>be(b).cmd);let p=!1;const d=[E.cmd].concat(o).filter(b=>oe.test(b)?(p=!0,!1):!0);d.length===0&&p&&d.push("$0"),p&&(E.cmd=d[0],o=d.slice(1),t=t.replace(oe,E.cmd)),o.forEach(b=>{this.aliasMap[b]=E.cmd}),e!==!1&&this.usage.command(t,e,p,o,r),this.handlers[E.cmd]={original:t,description:e,handler:s,builder:n||{},middlewares:l,deprecated:r,demanded:E.demanded,optional:E.optional},p&&(this.defaultCommand=this.handlers[E.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,n,s,i,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,l=e.getInternalMethods().getContext(),E=l.commands.slice(),p=!t;t&&(l.commands.push(t),l.fullCommands.push(o.original));const d=this.applyBuilderUpdateUsageAndParse(p,o,e,n.aliases,E,s,i,r);return yt(d)?d.then(b=>this.applyMiddlewareAndGetResult(p,o,b.innerArgv,l,i,b.aliases,e)):this.applyMiddlewareAndGetResult(p,o,d.innerArgv,l,i,d.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,n,s,i,r,o,l){const E=e.builder;let p=n;if(zn(E)){n.getInternalMethods().getUsageInstance().freeze();const d=E(n.getInternalMethods().reset(s),l);if(yt(d))return d.then(b=>(p=Lo(b)?b:n,this.parseAndUpdateUsage(t,e,p,i,r,o)))}else go(E)&&(n.getInternalMethods().getUsageInstance().freeze(),p=n.getInternalMethods().reset(s),Object.keys(e.builder).forEach(d=>{p.option(d,E[d])}));return this.parseAndUpdateUsage(t,e,p,i,r,o)}parseAndUpdateUsage(t,e,n,s,i,r){t&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(s,e),e.description);const o=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,r);return yt(o)?o.then(l=>({aliases:n.parsed.aliases,innerArgv:l})):{aliases:n.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,e){const n=oe.test(e.original)?e.original.replace(oe,"").trim():e.original,s=t.filter(i=>!oe.test(i));return s.push(n),`$0 ${s.join(" ")}`}handleValidationAndGetResult(t,e,n,s,i,r,o,l){if(!r.getInternalMethods().getHasOutput()){const E=r.getInternalMethods().runValidation(i,l,r.parsed.error,t);n=Ee(n,p=>(E(p),p))}if(e.handler&&!r.getInternalMethods().getHasOutput()){r.getInternalMethods().setHasOutput();const E=!!r.getOptions().configuration["populate--"];r.getInternalMethods().postProcess(n,E,!1,!1),n=we(n,r,o,!1),n=Ee(n,p=>{const d=e.handler(p);return yt(d)?d.then(()=>p):p}),t||r.getInternalMethods().getUsageInstance().cacheHelpMessage(),yt(n)&&!r.getInternalMethods().hasParseCallback()&&n.catch(p=>{try{r.getInternalMethods().getUsageInstance().fail(null,p)}catch{}})}return t||(s.commands.pop(),s.fullCommands.pop()),n}applyMiddlewareAndGetResult(t,e,n,s,i,r,o){let l={};if(i)return n;o.getInternalMethods().getHasOutput()||(l=this.populatePositionals(e,n,s,o));const E=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),p=we(n,o,E,!0);return yt(p)?p.then(d=>this.handleValidationAndGetResult(t,e,d,s,r,o,E,l)):this.handleValidationAndGetResult(t,e,p,s,r,o,E,l)}populatePositionals(t,e,n,s){e._=e._.slice(n.commands.length);const i=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(i.length,e._.length);i.length;){const l=i.shift();this.populatePositional(l,e,o)}for(;r.length;){const l=r.shift();this.populatePositional(l,e,o)}return e._=n.commands.concat(e._.map(l=>""+l)),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),s),o}populatePositional(t,e,n){const s=t.cmd[0];t.variadic?n[s]=e._.splice(0).map(String):e._.length&&(n[s]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},n=be(t);return n.demanded.forEach(s=>{const[i,...r]=s.cmd;s.variadic&&(e.array.push(i),e.default[i]=[]),e.alias[i]=r,e.demand[i]=!0}),n.optional.forEach(s=>{const[i,...r]=s.cmd;s.variadic&&(e.array.push(i),e.default[i]=[]),e.alias[i]=r}),e}postProcessPositionals(t,e,n,s){const i=Object.assign({},s.getOptions());i.default=Object.assign(n.default,i.default);for(const E of Object.keys(n.alias))i.alias[E]=(i.alias[E]||[]).concat(n.alias[E]);i.array=i.array.concat(n.array),i.config={};const r=[];if(Object.keys(e).forEach(E=>{e[E].map(p=>{i.configuration["unknown-options-as-args"]&&(i.key[E]=!0),r.push(`--${E}`),r.push(p)})}),!r.length)return;const o=Object.assign({},i.configuration,{"populate--":!1}),l=this.shim.Parser.detailed(r,Object.assign({},i,{configuration:o}));if(l.error)s.getInternalMethods().getUsageInstance().fail(l.error.message,l.error);else{const E=Object.keys(e);Object.keys(e).forEach(p=>{E.push(...l.aliases[p])}),Object.keys(l.argv).forEach(p=>{E.includes(p)&&(e[p]||(e[p]=l.argv[p]),!this.isInConfigs(s,p)&&!this.isDefaulted(s,p)&&Object.prototype.hasOwnProperty.call(t,p)&&Object.prototype.hasOwnProperty.call(l.argv,p)&&(Array.isArray(t[p])||Array.isArray(l.argv[p]))?t[p]=[].concat(t[p],l.argv[p]):t[p]=l.argv[p])})}}isDefaulted(t,e){const{default:n}=t.getOptions();return Object.prototype.hasOwnProperty.call(n,e)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(e))}isInConfigs(t,e){const{configObjects:n}=t.getOptions();return n.some(s=>Object.prototype.hasOwnProperty.call(s,e))||n.some(s=>Object.prototype.hasOwnProperty.call(s,this.shim.Parser.camelCase(e)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const n=oe.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(zn(e))return e(t,!0);Nr(e)||Object.keys(e).forEach(n=>{t.option(n,e[n])})}moduleName(t){const e=fo(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:n}){for(const s of[t,e,n]){if(typeof s=="string"||s===!1)return s;Rt(s,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const t=this.frozens.pop();Rt(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function po(a,t,e,n){return new ho(a,t,e,n)}function Nr(a){return typeof a=="object"&&!!a.builder&&typeof a.handler=="function"}function mo(a){return a.every(t=>typeof t=="string")}function zn(a){return typeof a=="function"}function go(a){return typeof a=="object"}function yo(a){return typeof a=="object"&&!Array.isArray(a)}function Oe(a={},t=()=>!0){const e={};return Xe(a).forEach(n=>{t(n,a[n])&&(e[n]=a[n])}),e}function ge(a){typeof process>"u"||[process.stdout,process.stderr].forEach(t=>{const e=t;e._handle&&e.isTTY&&typeof e._handle.setBlocking=="function"&&e._handle.setBlocking(a)})}function bo(a){return typeof a=="boolean"}function wo(a,t){const e=t.y18n.__,n={},s=[];n.failFn=function(B){s.push(B)};let i=null,r=null,o=!0;n.showHelpOnFail=function(B=!0,$){const[W,Y]=typeof B=="string"?[!0,B]:[B,$];return a.getInternalMethods().isGlobalContext()&&(r=Y),i=Y,o=W,n};let l=!1;n.fail=function(B,$){const W=a.getInternalMethods().getLoggerInstance();if(s.length)for(let Y=s.length-1;Y>=0;--Y){const k=s[Y];if(bo(k)){if($)throw $;if(B)throw Error(B)}else k(B,$,n)}else{if(a.getExitProcess()&&ge(!0),!l){l=!0,o&&(a.showHelp("error"),W.error()),(B||$)&&W.error(B||$);const Y=i||r;Y&&((B||$)&&W.error(""),W.error(Y))}if($=$||new gt(B),a.getExitProcess())return a.exit(1);if(a.getInternalMethods().hasParseCallback())return a.exit(1,$);throw $}};let E=[],p=!1;n.usage=(S,B)=>S===null?(p=!0,E=[],n):(p=!1,E.push([S,B||""]),n),n.getUsage=()=>E,n.getUsageDisabled=()=>p,n.getPositionalGroupName=()=>e("Positionals:");let d=[];n.example=(S,B)=>{d.push([S,B||""])};let b=[];n.command=function(B,$,W,Y,k=!1){W&&(b=b.map(V=>(V[2]=!1,V))),b.push([B,$||"",W,Y,k])},n.getCommands=()=>b;let w={};n.describe=function(B,$){Array.isArray(B)?B.forEach(W=>{n.describe(W,$)}):typeof B=="object"?Object.keys(B).forEach(W=>{n.describe(W,B[W])}):w[B]=$},n.getDescriptions=()=>w;let T=[];n.epilog=S=>{T.push(S)};let _=!1,I;n.wrap=S=>{_=!0,I=S},n.getWrap=()=>t.getEnv("YARGS_DISABLE_WRAP")?null:(_||(I=U(),_=!0),I);const v="__yargsString__:";n.deferY18nLookup=S=>v+S,n.help=function(){if(D)return D;m();const B=a.customScriptName?a.$0:t.path.basename(a.$0),$=a.getDemandedOptions(),W=a.getDemandedCommands(),Y=a.getDeprecatedOptions(),k=a.getGroups(),V=a.getOptions();let ft=[];ft=ft.concat(Object.keys(w)),ft=ft.concat(Object.keys($)),ft=ft.concat(Object.keys(W)),ft=ft.concat(Object.keys(V.default)),ft=ft.filter(X),ft=Object.keys(ft.reduce((Q,x)=>(x!=="_"&&(Q[x]=!0),Q),{}));const It=n.getWrap(),at=t.cliui({width:It,wrap:!!It});if(!p){if(E.length)E.forEach(Q=>{at.div({text:`${Q[0].replace(/\$0/g,B)}`}),Q[1]&&at.div({text:`${Q[1]}`,padding:[1,0,0,0]})}),at.div();else if(b.length){let Q=null;W._?Q=`${B} <${e("command")}>
33
+ `:Q=`${B} [${e("command")}]
34
+ `,at.div(`${Q}`)}}if(b.length>1||b.length===1&&!b[0][2]){at.div(e("Commands:"));const Q=a.getInternalMethods().getContext(),x=Q.commands.length?`${Q.commands.join(" ")} `:"";a.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(b=b.sort((j,P)=>j[0].localeCompare(P[0])));const y=B?`${B} `:"";b.forEach(j=>{const P=`${y}${x}${j[0].replace(/^\$0 ?/,"")}`;at.span({text:P,padding:[0,2,0,2],width:C(b,It,`${B}${x}`)+4},{text:j[1]});const J=[];j[2]&&J.push(`[${e("default")}]`),j[3]&&j[3].length&&J.push(`[${e("aliases:")} ${j[3].join(", ")}]`),j[4]&&(typeof j[4]=="string"?J.push(`[${e("deprecated: %s",j[4])}]`):J.push(`[${e("deprecated")}]`)),J.length?at.div({text:J.join(" "),padding:[0,0,0,2],align:"right"}):at.div()}),at.div()}const st=(Object.keys(V.alias)||[]).concat(Object.keys(a.parsed.newAliases)||[]);ft=ft.filter(Q=>!a.parsed.newAliases[Q]&&st.every(x=>(V.alias[x]||[]).indexOf(Q)===-1));const ut=e("Options:");k[ut]||(k[ut]=[]),M(ft,V.alias,k,ut);const _t=Q=>/^--/.test(Te(Q)),K=Object.keys(k).filter(Q=>k[Q].length>0).map(Q=>{const x=k[Q].filter(X).map(y=>{if(st.includes(y))return y;for(let j=0,P;(P=st[j])!==void 0;j++)if((V.alias[P]||[]).includes(y))return P;return y});return{groupName:Q,normalizedKeys:x}}).filter(({normalizedKeys:Q})=>Q.length>0).map(({groupName:Q,normalizedKeys:x})=>{const y=x.reduce((j,P)=>(j[P]=[P].concat(V.alias[P]||[]).map(J=>Q===n.getPositionalGroupName()?J:(/^[0-9]$/.test(J)?V.boolean.includes(P)?"-":"--":J.length>1?"--":"-")+J).sort((J,ot)=>_t(J)===_t(ot)?0:_t(J)?1:-1).join(", "),j),{});return{groupName:Q,normalizedKeys:x,switches:y}});if(K.filter(({groupName:Q})=>Q!==n.getPositionalGroupName()).some(({normalizedKeys:Q,switches:x})=>!Q.every(y=>_t(x[y])))&&K.filter(({groupName:Q})=>Q!==n.getPositionalGroupName()).forEach(({normalizedKeys:Q,switches:x})=>{Q.forEach(y=>{_t(x[y])&&(x[y]=Eo(x[y],4))})}),K.forEach(({groupName:Q,normalizedKeys:x,switches:y})=>{at.div(Q),x.forEach(j=>{const P=y[j];let J=w[j]||"",ot=null;J.includes(v)&&(J=e(J.substring(v.length))),V.boolean.includes(j)&&(ot=`[${e("boolean")}]`),V.count.includes(j)&&(ot=`[${e("count")}]`),V.string.includes(j)&&(ot=`[${e("string")}]`),V.normalize.includes(j)&&(ot=`[${e("string")}]`),V.array.includes(j)&&(ot=`[${e("array")}]`),V.number.includes(j)&&(ot=`[${e("number")}]`);const rt=f=>typeof f=="string"?`[${e("deprecated: %s",f)}]`:`[${e("deprecated")}]`,ht=[j in Y?rt(Y[j]):null,ot,j in $?`[${e("required")}]`:null,V.choices&&V.choices[j]?`[${e("choices:")} ${n.stringifiedValues(V.choices[j])}]`:null,q(V.default[j],V.defaultDescription[j])].filter(Boolean).join(" ");at.span({text:Te(P),padding:[0,2,0,2+Ar(P)],width:C(y,It)+4},J);const A=a.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;ht&&!A?at.div({text:ht,padding:[0,0,0,2],align:"right"}):at.div()}),at.div()}),d.length&&(at.div(e("Examples:")),d.forEach(Q=>{Q[0]=Q[0].replace(/\$0/g,B)}),d.forEach(Q=>{Q[1]===""?at.div({text:Q[0],padding:[0,2,0,2]}):at.div({text:Q[0],padding:[0,2,0,2],width:C(d,It)+4},{text:Q[1]})}),at.div()),T.length>0){const Q=T.map(x=>x.replace(/\$0/g,B)).join(`
35
+ `);at.div(`${Q}
36
+ `)}return at.toString().replace(/\s*$/,"")};function C(S,B,$){let W=0;return Array.isArray(S)||(S=Object.values(S).map(Y=>[Y])),S.forEach(Y=>{W=Math.max(t.stringWidth($?`${$} ${Te(Y[0])}`:Te(Y[0]))+Ar(Y[0]),W)}),B&&(W=Math.min(W,parseInt((B*.5).toString(),10))),W}function m(){const S=a.getDemandedOptions(),B=a.getOptions();(Object.keys(B.alias)||[]).forEach($=>{B.alias[$].forEach(W=>{w[W]&&n.describe($,w[W]),W in S&&a.demandOption($,S[W]),B.boolean.includes(W)&&a.boolean($),B.count.includes(W)&&a.count($),B.string.includes(W)&&a.string($),B.normalize.includes(W)&&a.normalize($),B.array.includes(W)&&a.array($),B.number.includes(W)&&a.number($)})})}let D;n.cacheHelpMessage=function(){D=this.help()},n.clearCachedHelpMessage=function(){D=void 0},n.hasCachedHelpMessage=function(){return!!D};function M(S,B,$,W){let Y=[],k=null;return Object.keys($).forEach(V=>{Y=Y.concat($[V])}),S.forEach(V=>{k=[V].concat(B[V]),k.some(ft=>Y.indexOf(ft)!==-1)||$[W].push(V)}),Y}function X(S){return a.getOptions().hiddenOptions.indexOf(S)<0||a.parsed.argv[a.getOptions().showHiddenOpt]}n.showHelp=S=>{const B=a.getInternalMethods().getLoggerInstance();S||(S="error"),(typeof S=="function"?S:B[S])(n.help())},n.functionDescription=S=>["(",S.name?t.Parser.decamelize(S.name,"-"):e("generated-value"),")"].join(""),n.stringifiedValues=function(B,$){let W="";const Y=$||", ",k=[].concat(B);return!B||!k.length||k.forEach(V=>{W.length&&(W+=Y),W+=JSON.stringify(V)}),W};function q(S,B){let $=`[${e("default:")} `;if(S===void 0&&!B)return null;if(B)$+=B;else switch(typeof S){case"string":$+=`"${S}"`;break;case"object":$+=JSON.stringify(S);break;default:$+=S}return`${$}]`}function U(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let g=null;n.version=S=>{g=S},n.showVersion=S=>{const B=a.getInternalMethods().getLoggerInstance();S||(S="error"),(typeof S=="function"?S:B[S])(g)},n.reset=function(B){return i=null,l=!1,E=[],p=!1,T=[],d=[],b=[],w=Oe(w,$=>!B[$]),n};const R=[];return n.freeze=function(){R.push({failMessage:i,failureOutput:l,usages:E,usageDisabled:p,epilogs:T,examples:d,commands:b,descriptions:w})},n.unfreeze=function(B=!1){const $=R.pop();$&&(B?(w={...$.descriptions,...w},b=[...$.commands,...b],E=[...$.usages,...E],d=[...$.examples,...d],T=[...$.epilogs,...T]):{failMessage:i,failureOutput:l,usages:E,usageDisabled:p,epilogs:T,examples:d,commands:b,descriptions:w}=$)},n}function Jn(a){return typeof a=="object"}function Eo(a,t){return Jn(a)?{text:a.text,indentation:a.indentation+t}:{text:a,indentation:t}}function Ar(a){return Jn(a)?a.indentation:0}function Te(a){return Jn(a)?a.text:a}const xo=`###-begin-{{app_name}}-completions-###
37
+ #
38
+ # yargs command completion script
39
+ #
40
+ # Installation: {{app_path}} {{completion_command}} >> ~/.bashrc
41
+ # or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.
42
+ #
43
+ _{{app_name}}_yargs_completions()
44
+ {
45
+ local cur_word args type_list
46
+
47
+ cur_word="\${COMP_WORDS[COMP_CWORD]}"
48
+ args=("\${COMP_WORDS[@]}")
49
+
50
+ # ask yargs to generate completions.
51
+ type_list=$({{app_path}} --get-yargs-completions "\${args[@]}")
52
+
53
+ COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) )
54
+
55
+ # if no match was found, fall back to filename completion
56
+ if [ \${#COMPREPLY[@]} -eq 0 ]; then
57
+ COMPREPLY=()
58
+ fi
59
+
60
+ return 0
61
+ }
62
+ complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
63
+ ###-end-{{app_name}}-completions-###
64
+ `,Oo=`#compdef {{app_name}}
65
+ ###-begin-{{app_name}}-completions-###
66
+ #
67
+ # yargs command completion script
68
+ #
69
+ # Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
70
+ # or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.
71
+ #
72
+ _{{app_name}}_yargs_completions()
73
+ {
74
+ local reply
75
+ local si=$IFS
76
+ IFS=$'
77
+ ' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
78
+ IFS=$si
79
+ _describe 'values' reply
80
+ }
81
+ compdef _{{app_name}}_yargs_completions {{app_name}}
82
+ ###-end-{{app_name}}-completions-###
83
+ `;class Io{constructor(t,e,n,s){var i,r,o;this.yargs=t,this.usage=e,this.command=n,this.shim=s,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(o=((i=this.shim.getEnv("SHELL"))===null||i===void 0?void 0:i.includes("zsh"))||((r=this.shim.getEnv("ZSH_NAME"))===null||r===void 0?void 0:r.includes("zsh")))!==null&&o!==void 0?o:!1}defaultCompletion(t,e,n,s){const i=this.command.getCommandHandlers();for(let o=0,l=t.length;o<l;++o)if(i[t[o]]&&i[t[o]].builder){const E=i[t[o]].builder;if(zn(E)){this.indexAfterLastReset=o+1;const p=this.yargs.getInternalMethods().reset();return E(p,!0),p.argv}}const r=[];this.commandCompletions(r,t,n),this.optionCompletions(r,t,e,n),this.choicesFromOptionsCompletions(r,t,e,n),this.choicesFromPositionalsCompletions(r,t,e,n),s(null,r)}commandCompletions(t,e,n){const s=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&s[s.length-1]!==n&&!this.previousArgHasChoices(e)&&this.usage.getCommands().forEach(i=>{const r=be(i[0]).cmd;if(e.indexOf(r)===-1)if(!this.zshShell)t.push(r);else{const o=i[1]||"";t.push(r.replace(/:/g,"\\:")+":"+o)}})}optionCompletions(t,e,n,s){if((s.match(/^-/)||s===""&&t.length===0)&&!this.previousArgHasChoices(e)){const i=this.yargs.getOptions(),r=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(i.key).forEach(o=>{const l=!!i.configuration["boolean-negation"]&&i.boolean.includes(o);!r.includes(o)&&!i.hiddenOptions.includes(o)&&!this.argsContainKey(e,o,l)&&this.completeOptionKey(o,t,s,l&&!!i.default[o])})}}choicesFromOptionsCompletions(t,e,n,s){if(this.previousArgHasChoices(e)){const i=this.getPreviousArgChoices(e);i&&i.length>0&&t.push(...i.map(r=>r.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(t,e,n,s){if(s===""&&t.length>0&&this.previousArgHasChoices(e))return;const i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],r=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=i[n._.length-r-1];if(!o)return;const l=this.yargs.getOptions().choices[o]||[];for(const E of l)E.startsWith(s)&&t.push(E.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],n="";if(!e.startsWith("-")&&t.length>1&&(n=e,e=t[t.length-2]),!e.startsWith("-"))return;const s=e.replace(/^-+/,""),i=this.yargs.getOptions(),r=[s,...this.yargs.getAliases()[s]||[]];let o;for(const l of r)if(Object.prototype.hasOwnProperty.call(i.key,l)&&Array.isArray(i.choices[l])){o=i.choices[l];break}if(o)return o.filter(l=>!n||l.startsWith(n))}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return e!==void 0&&e.length>0}argsContainKey(t,e,n){const s=i=>t.indexOf((/^[^0-9]$/.test(i)?"-":"--")+i)!==-1;if(s(e)||n&&s(`no-${e}`))return!0;if(this.aliases){for(const i of this.aliases[e])if(s(i))return!0}return!1}completeOptionKey(t,e,n,s){var i,r,o,l;let E=t;if(this.zshShell){const w=this.usage.getDescriptions(),T=(r=(i=this===null||this===void 0?void 0:this.aliases)===null||i===void 0?void 0:i[t])===null||r===void 0?void 0:r.find(v=>{const C=w[v];return typeof C=="string"&&C.length>0}),_=T?w[T]:void 0,I=(l=(o=w[t])!==null&&o!==void 0?o:_)!==null&&l!==void 0?l:"";E=`${t.replace(/:/g,"\\:")}:${I.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const p=w=>/^--/.test(w),d=w=>/^[^0-9]$/.test(w),b=!p(n)&&d(t)?"-":"--";e.push(b+E),s&&e.push(b+"no-"+E)}customCompletion(t,e,n,s){if(Rt(this.customCompletionFunction,null,this.shim),To(this.customCompletionFunction)){const i=this.customCompletionFunction(n,e);return yt(i)?i.then(r=>{this.shim.process.nextTick(()=>{s(null,r)})}).catch(r=>{this.shim.process.nextTick(()=>{s(r,void 0)})}):s(null,i)}else return vo(this.customCompletionFunction)?this.customCompletionFunction(n,e,(i=s)=>this.defaultCompletion(t,e,n,i),i=>{s(null,i)}):this.customCompletionFunction(n,e,i=>{s(null,i)})}getCompletion(t,e){const n=t.length?t[t.length-1]:"",s=this.yargs.parse(t,!0),i=this.customCompletionFunction?r=>this.customCompletion(t,r,n,e):r=>this.defaultCompletion(t,r,n,e);return yt(s)?s.then(i):i(s)}generateCompletionScript(t,e){let n=this.zshShell?Oo:xo;const s=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),n=n.replace(/{{app_name}}/g,s),n=n.replace(/{{completion_command}}/g,e),n.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function Co(a,t,e,n){return new Io(a,t,e,n)}function To(a){return a.length<3}function vo(a){return a.length>3}function Do(a,t){if(a.length===0)return t.length;if(t.length===0)return a.length;const e=[];let n;for(n=0;n<=t.length;n++)e[n]=[n];let s;for(s=0;s<=a.length;s++)e[0][s]=s;for(n=1;n<=t.length;n++)for(s=1;s<=a.length;s++)t.charAt(n-1)===a.charAt(s-1)?e[n][s]=e[n-1][s-1]:n>1&&s>1&&t.charAt(n-2)===a.charAt(s-1)&&t.charAt(n-1)===a.charAt(s-2)?e[n][s]=e[n-2][s-2]+1:e[n][s]=Math.min(e[n-1][s-1]+1,Math.min(e[n][s-1]+1,e[n-1][s]+1));return e[t.length][a.length]}const Mr=["$0","--","_"];function _o(a,t,e){const n=e.y18n.__,s=e.y18n.__n,i={};i.nonOptionCount=function(d){const b=a.getDemandedCommands(),T=d._.length+(d["--"]?d["--"].length:0)-a.getInternalMethods().getContext().commands.length;b._&&(T<b._.min||T>b._.max)&&(T<b._.min?b._.minMsg!==void 0?t.fail(b._.minMsg?b._.minMsg.replace(/\$0/g,T.toString()).replace(/\$1/,b._.min.toString()):null):t.fail(s("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",T,T.toString(),b._.min.toString())):T>b._.max&&(b._.maxMsg!==void 0?t.fail(b._.maxMsg?b._.maxMsg.replace(/\$0/g,T.toString()).replace(/\$1/,b._.max.toString()):null):t.fail(s("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",T,T.toString(),b._.max.toString()))))},i.positionalCount=function(d,b){b<d&&t.fail(s("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",b,b+"",d+""))},i.requiredArguments=function(d,b){let w=null;for(const T of Object.keys(b))(!Object.prototype.hasOwnProperty.call(d,T)||typeof d[T]>"u")&&(w=w||{},w[T]=b[T]);if(w){const T=[];for(const I of Object.keys(w)){const v=w[I];v&&T.indexOf(v)<0&&T.push(v)}const _=T.length?`
84
+ ${T.join(`
85
+ `)}`:"";t.fail(s("Missing required argument: %s","Missing required arguments: %s",Object.keys(w).length,Object.keys(w).join(", ")+_))}},i.unknownArguments=function(d,b,w,T,_=!0){var I;const v=a.getInternalMethods().getCommandInstance().getCommands(),C=[],m=a.getInternalMethods().getContext();if(Object.keys(d).forEach(D=>{!Mr.includes(D)&&!Object.prototype.hasOwnProperty.call(w,D)&&!Object.prototype.hasOwnProperty.call(a.getInternalMethods().getParseContext(),D)&&!i.isValidAndSomeAliasIsNotNew(D,b)&&C.push(D)}),_&&(m.commands.length>0||v.length>0||T)&&d._.slice(m.commands.length).forEach(D=>{v.includes(""+D)||C.push(""+D)}),_){const M=((I=a.getDemandedCommands()._)===null||I===void 0?void 0:I.max)||0,X=m.commands.length+M;X<d._.length&&d._.slice(X).forEach(q=>{q=String(q),!m.commands.includes(q)&&!C.includes(q)&&C.push(q)})}C.length&&t.fail(s("Unknown argument: %s","Unknown arguments: %s",C.length,C.map(D=>D.trim()?D:`"${D}"`).join(", ")))},i.unknownCommands=function(d){const b=a.getInternalMethods().getCommandInstance().getCommands(),w=[],T=a.getInternalMethods().getContext();return(T.commands.length>0||b.length>0)&&d._.slice(T.commands.length).forEach(_=>{b.includes(""+_)||w.push(""+_)}),w.length>0?(t.fail(s("Unknown command: %s","Unknown commands: %s",w.length,w.join(", "))),!0):!1},i.isValidAndSomeAliasIsNotNew=function(d,b){if(!Object.prototype.hasOwnProperty.call(b,d))return!1;const w=a.parsed.newAliases;return[d,...b[d]].some(T=>!Object.prototype.hasOwnProperty.call(w,T)||!w[d])},i.limitedChoices=function(d){const b=a.getOptions(),w={};if(!Object.keys(b.choices).length)return;Object.keys(d).forEach(I=>{Mr.indexOf(I)===-1&&Object.prototype.hasOwnProperty.call(b.choices,I)&&[].concat(d[I]).forEach(v=>{b.choices[I].indexOf(v)===-1&&v!==void 0&&(w[I]=(w[I]||[]).concat(v))})});const T=Object.keys(w);if(!T.length)return;let _=n("Invalid values:");T.forEach(I=>{_+=`
86
+ ${n("Argument: %s, Given: %s, Choices: %s",I,t.stringifiedValues(w[I]),t.stringifiedValues(b.choices[I]))}`}),t.fail(_)};let r={};i.implies=function(d,b){z("<string|object> [array|number|string]",[d,b],arguments.length),typeof d=="object"?Object.keys(d).forEach(w=>{i.implies(w,d[w])}):(a.global(d),r[d]||(r[d]=[]),Array.isArray(b)?b.forEach(w=>i.implies(d,w)):(Rt(b,void 0,e),r[d].push(b)))},i.getImplied=function(){return r};function o(p,d){const b=Number(d);return d=isNaN(b)?d:b,typeof d=="number"?d=p._.length>=d:d.match(/^--no-.+/)?(d=d.match(/^--no-(.+)/)[1],d=!Object.prototype.hasOwnProperty.call(p,d)):d=Object.prototype.hasOwnProperty.call(p,d),d}i.implications=function(d){const b=[];if(Object.keys(r).forEach(w=>{const T=w;(r[w]||[]).forEach(_=>{let I=T;const v=_;I=o(d,I),_=o(d,_),I&&!_&&b.push(` ${T} -> ${v}`)})}),b.length){let w=`${n("Implications failed:")}
87
+ `;b.forEach(T=>{w+=T}),t.fail(w)}};let l={};i.conflicts=function(d,b){z("<string|object> [array|string]",[d,b],arguments.length),typeof d=="object"?Object.keys(d).forEach(w=>{i.conflicts(w,d[w])}):(a.global(d),l[d]||(l[d]=[]),Array.isArray(b)?b.forEach(w=>i.conflicts(d,w)):l[d].push(b))},i.getConflicting=()=>l,i.conflicting=function(d){Object.keys(d).forEach(b=>{l[b]&&l[b].forEach(w=>{w&&d[b]!==void 0&&d[w]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",b,w))})}),a.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(b=>{l[b].forEach(w=>{w&&d[e.Parser.camelCase(b)]!==void 0&&d[e.Parser.camelCase(w)]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",b,w))})})},i.recommendCommands=function(d,b){b=b.sort((I,v)=>v.length-I.length);let T=null,_=1/0;for(let I=0,v;(v=b[I])!==void 0;I++){const C=Do(d,v);C<=3&&C<_&&(_=C,T=v)}T&&t.fail(n("Did you mean %s?",T))},i.reset=function(d){return r=Oe(r,b=>!d[b]),l=Oe(l,b=>!d[b]),i};const E=[];return i.freeze=function(){E.push({implied:r,conflicting:l})},i.unfreeze=function(){const d=E.pop();Rt(d,void 0,e),{implied:r,conflicting:l}=d},i}let Yn=[],ye;function Gn(a,t,e,n){ye=n;let s={};if(Object.prototype.hasOwnProperty.call(a,"extends")){if(typeof a.extends!="string")return s;const i=/\.json|\..*rc$/.test(a.extends);let r=null;if(i)r=Ao(t,a.extends);else try{r=require.resolve(a.extends)}catch{return a}No(r),Yn.push(r),s=i?JSON.parse(ye.readFileSync(r,"utf8")):require(a.extends),delete a.extends,s=Gn(s,ye.path.dirname(r),e,ye)}return Yn=[],e?ss(s,a):Object.assign({},s,a)}function No(a){if(Yn.indexOf(a)>-1)throw new gt(`Circular extended configurations: '${a}'.`)}function Ao(a,t){return ye.path.resolve(a,t)}function ss(a,t){const e={};function n(s){return s&&typeof s=="object"&&!Array.isArray(s)}Object.assign(e,a);for(const s of Object.keys(t))n(t[s])&&n(e[s])?e[s]=ss(a[s],t[s]):e[s]=t[s];return e}var H=function(a,t,e,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?a!==t||!s:!t.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(a,e):s?s.value=e:t.set(a,e),e},O=function(a,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?a!==t||!n:!t.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(a):n?n.value:t.get(a)},mt,kt,he,Nt,Ct,ve,zt,Kt,De,At,_e,Mt,Bt,Tt,Pt,Ne,ae,wt,G,Ae,Me,vt,Qt,ue,Jt,Yt,Pe,tt,Zt,te,ee,et,Le,Ut,dt;function Mo(a){return(t=[],e=a.process.cwd(),n)=>{const s=new Po(t,e,n,a);return Object.defineProperty(s,"argv",{get:()=>s.parse(),enumerable:!0}),s.help(),s.version(),s}}const Pr=Symbol("copyDoubleDash"),Lr=Symbol("copyDoubleDash"),ke=Symbol("deleteFromParserHintObject"),Sr=Symbol("emitWarning"),Fr=Symbol("freeze"),jr=Symbol("getDollarZero"),ne=Symbol("getParserConfiguration"),Rr=Symbol("getUsageConfiguration"),Ke=Symbol("guessLocale"),Br=Symbol("guessVersion"),Ur=Symbol("parsePositionalNumbers"),Qe=Symbol("pkgUp"),Gt=Symbol("populateParserHintArray"),ce=Symbol("populateParserHintSingleValueDictionary"),Je=Symbol("populateParserHintArrayDictionary"),Ze=Symbol("populateParserHintDictionary"),tn=Symbol("sanitizeKey"),en=Symbol("setKey"),nn=Symbol("unfreeze"),Xr=Symbol("validateAsync"),$r=Symbol("getCommandInstance"),qr=Symbol("getContext"),Wr=Symbol("getHasOutput"),Vr=Symbol("getLoggerInstance"),Hr=Symbol("getParseContext"),zr=Symbol("getUsageInstance"),Yr=Symbol("getValidationInstance"),Se=Symbol("hasParseCallback"),Gr=Symbol("isGlobalContext"),re=Symbol("postProcess"),kr=Symbol("rebase"),rn=Symbol("reset"),pe=Symbol("runYargsParserAndExecuteCommands"),sn=Symbol("runValidation"),Kr=Symbol("setHasOutput"),ie=Symbol("kTrackManuallySetKeys");class Po{constructor(t=[],e,n,s){this.customScriptName=!1,this.parsed=!1,mt.set(this,void 0),kt.set(this,void 0),he.set(this,{commands:[],fullCommands:[]}),Nt.set(this,null),Ct.set(this,null),ve.set(this,"show-hidden"),zt.set(this,null),Kt.set(this,!0),De.set(this,{}),At.set(this,!0),_e.set(this,[]),Mt.set(this,void 0),Bt.set(this,{}),Tt.set(this,!1),Pt.set(this,null),Ne.set(this,!0),ae.set(this,void 0),wt.set(this,""),G.set(this,void 0),Ae.set(this,void 0),Me.set(this,{}),vt.set(this,null),Qt.set(this,null),ue.set(this,{}),Jt.set(this,{}),Yt.set(this,void 0),Pe.set(this,!1),tt.set(this,void 0),Zt.set(this,!1),te.set(this,!1),ee.set(this,!1),et.set(this,void 0),Le.set(this,{}),Ut.set(this,null),dt.set(this,void 0),H(this,tt,s,"f"),H(this,Yt,t,"f"),H(this,kt,e,"f"),H(this,Ae,n,"f"),H(this,Mt,new uo(this),"f"),this.$0=this[jr](),this[rn](),H(this,mt,O(this,mt,"f"),"f"),H(this,et,O(this,et,"f"),"f"),H(this,dt,O(this,dt,"f"),"f"),H(this,G,O(this,G,"f"),"f"),O(this,G,"f").showHiddenOpt=O(this,ve,"f"),H(this,ae,this[Lr](),"f")}addHelpOpt(t,e){const n="help";return z("[string|boolean] [string]",[t,e],arguments.length),O(this,Pt,"f")&&(this[ke](O(this,Pt,"f")),H(this,Pt,null,"f")),t===!1&&e===void 0?this:(H(this,Pt,typeof t=="string"?t:n,"f"),this.boolean(O(this,Pt,"f")),this.describe(O(this,Pt,"f"),e||O(this,et,"f").deferY18nLookup("Show help")),this)}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(z("[string|boolean] [string]",[t,e],arguments.length),t===!1&&e===void 0)return this;const n=typeof t=="string"?t:O(this,ve,"f");return this.boolean(n),this.describe(n,e||O(this,et,"f").deferY18nLookup("Show hidden options")),O(this,G,"f").showHiddenOpt=n,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return z("<object|string|array> [string|array]",[t,e],arguments.length),this[Je](this.alias.bind(this),"alias",t,e),this}array(t){return z("<array|string>",[t],arguments.length),this[Gt]("array",t),this[ie](t),this}boolean(t){return z("<array|string>",[t],arguments.length),this[Gt]("boolean",t),this[ie](t),this}check(t,e){return z("<function> [boolean]",[t,e],arguments.length),this.middleware((n,s)=>Ee(()=>t(n,s.getOptions()),i=>(i?(typeof i=="string"||i instanceof Error)&&O(this,et,"f").fail(i.toString(),i):O(this,et,"f").fail(O(this,tt,"f").y18n.__("Argument check failed: %s",t.toString())),n),i=>(O(this,et,"f").fail(i.message?i.message:i.toString(),i),n)),!1,e),this}choices(t,e){return z("<object|string|array> [string|array]",[t,e],arguments.length),this[Je](this.choices.bind(this),"choices",t,e),this}coerce(t,e){if(z("<object|string|array> [function]",[t,e],arguments.length),Array.isArray(t)){if(!e)throw new gt("coerce callback must be provided");for(const n of t)this.coerce(n,e);return this}else if(typeof t=="object"){for(const n of Object.keys(t))this.coerce(n,t[n]);return this}if(!e)throw new gt("coerce callback must be provided");return O(this,G,"f").key[t]=!0,O(this,Mt,"f").addCoerceMiddleware((n,s)=>{let i;return Object.prototype.hasOwnProperty.call(n,t)?Ee(()=>(i=s.getAliases(),e(n[t])),o=>{n[t]=o;const l=s.getInternalMethods().getParserConfiguration()["strip-aliased"];if(i[t]&&l!==!0)for(const E of i[t])n[E]=o;return n},o=>{throw new gt(o.message)}):n},t),this}conflicts(t,e){return z("<string|object> [string|array]",[t,e],arguments.length),O(this,dt,"f").conflicts(t,e),this}config(t="config",e,n){return z("[object|string] [string|function] [function]",[t,e,n],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=Gn(t,O(this,kt,"f"),this[ne]()["deep-merge-config"]||!1,O(this,tt,"f")),O(this,G,"f").configObjects=(O(this,G,"f").configObjects||[]).concat(t),this):(typeof e=="function"&&(n=e,e=void 0),this.describe(t,e||O(this,et,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(s=>{O(this,G,"f").config[s]=n||!0}),this)}completion(t,e,n){return z("[string] [string|boolean|function] [function]",[t,e,n],arguments.length),typeof e=="function"&&(n=e,e=void 0),H(this,Ct,t||O(this,Ct,"f")||"completion","f"),!e&&e!==!1&&(e="generate completion script"),this.command(O(this,Ct,"f"),e),n&&O(this,Nt,"f").registerFunction(n),this}command(t,e,n,s,i,r){return z("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,n,s,i,r],arguments.length),O(this,mt,"f").addHandler(t,e,n,s,i,r),this}commands(t,e,n,s,i,r){return this.command(t,e,n,s,i,r)}commandDir(t,e){z("<string> [object]",[t,e],arguments.length);const n=O(this,Ae,"f")||O(this,tt,"f").require;return O(this,mt,"f").addDirectory(t,n,O(this,tt,"f").getCallerFile(),e),this}count(t){return z("<array|string>",[t],arguments.length),this[Gt]("count",t),this[ie](t),this}default(t,e,n){return z("<object|string|array> [*] [string]",[t,e,n],arguments.length),n&&(vr(t,O(this,tt,"f")),O(this,G,"f").defaultDescription[t]=n),typeof e=="function"&&(vr(t,O(this,tt,"f")),O(this,G,"f").defaultDescription[t]||(O(this,G,"f").defaultDescription[t]=O(this,et,"f").functionDescription(e)),e=e.call()),this[ce](this.default.bind(this),"default",t,e),this}defaults(t,e,n){return this.default(t,e,n)}demandCommand(t=1,e,n,s){return z("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,n,s],arguments.length),typeof e!="number"&&(n=e,e=1/0),this.global("_",!1),O(this,G,"f").demandedCommands._={min:t,max:e,minMsg:n,maxMsg:s},this}demand(t,e,n){return Array.isArray(e)?(e.forEach(s=>{Rt(n,!0,O(this,tt,"f")),this.demandOption(s,n)}),e=1/0):typeof e!="number"&&(n=e,e=1/0),typeof t=="number"?(Rt(n,!0,O(this,tt,"f")),this.demandCommand(t,e,n,n)):Array.isArray(t)?t.forEach(s=>{Rt(n,!0,O(this,tt,"f")),this.demandOption(s,n)}):typeof n=="string"?this.demandOption(t,n):(n===!0||typeof n>"u")&&this.demandOption(t),this}demandOption(t,e){return z("<object|string|array> [string]",[t,e],arguments.length),this[ce](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return z("<string> [string|boolean]",[t,e],arguments.length),O(this,G,"f").deprecatedOptions[t]=e,this}describe(t,e){return z("<object|string|array> [string]",[t,e],arguments.length),this[en](t,!0),O(this,et,"f").describe(t,e),this}detectLocale(t){return z("<boolean>",[t],arguments.length),H(this,Kt,t,"f"),this}env(t){return z("[string|boolean]",[t],arguments.length),t===!1?delete O(this,G,"f").envPrefix:O(this,G,"f").envPrefix=t||"",this}epilogue(t){return z("<string>",[t],arguments.length),O(this,et,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return z("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach(n=>this.example(...n)):O(this,et,"f").example(t,e),this}exit(t,e){H(this,Tt,!0,"f"),H(this,zt,e,"f"),O(this,At,"f")&&O(this,tt,"f").process.exit(t)}exitProcess(t=!0){return z("[boolean]",[t],arguments.length),H(this,At,t,"f"),this}fail(t){if(z("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new gt("Invalid first argument. Expected function or boolean 'false'");return O(this,et,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return z("<array> [function]",[t,e],arguments.length),e?O(this,Nt,"f").getCompletion(t,e):new Promise((n,s)=>{O(this,Nt,"f").getCompletion(t,(i,r)=>{i?s(i):n(r)})})}getDemandedOptions(){return z([],0),O(this,G,"f").demandedOptions}getDemandedCommands(){return z([],0),O(this,G,"f").demandedCommands}getDeprecatedOptions(){return z([],0),O(this,G,"f").deprecatedOptions}getDetectLocale(){return O(this,Kt,"f")}getExitProcess(){return O(this,At,"f")}getGroups(){return Object.assign({},O(this,Bt,"f"),O(this,Jt,"f"))}getHelp(){if(H(this,Tt,!0,"f"),!O(this,et,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[pe](O(this,Yt,"f"),void 0,void 0,0,!0);if(yt(e))return e.then(()=>O(this,et,"f").help())}const t=O(this,mt,"f").runDefaultBuilderOn(this);if(yt(t))return t.then(()=>O(this,et,"f").help())}return Promise.resolve(O(this,et,"f").help())}getOptions(){return O(this,G,"f")}getStrict(){return O(this,Zt,"f")}getStrictCommands(){return O(this,te,"f")}getStrictOptions(){return O(this,ee,"f")}global(t,e){return z("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),e!==!1?O(this,G,"f").local=O(this,G,"f").local.filter(n=>t.indexOf(n)===-1):t.forEach(n=>{O(this,G,"f").local.includes(n)||O(this,G,"f").local.push(n)}),this}group(t,e){z("<string|array> <string>",[t,e],arguments.length);const n=O(this,Jt,"f")[e]||O(this,Bt,"f")[e];O(this,Jt,"f")[e]&&delete O(this,Jt,"f")[e];const s={};return O(this,Bt,"f")[e]=(n||[]).concat(t).filter(i=>s[i]?!1:s[i]=!0),this}hide(t){return z("<string>",[t],arguments.length),O(this,G,"f").hiddenOptions.push(t),this}implies(t,e){return z("<string|object> [number|string|array]",[t,e],arguments.length),O(this,dt,"f").implies(t,e),this}locale(t){return z("[string]",[t],arguments.length),t===void 0?(this[Ke](),O(this,tt,"f").y18n.getLocale()):(H(this,Kt,!1,"f"),O(this,tt,"f").y18n.setLocale(t),this)}middleware(t,e,n){return O(this,Mt,"f").addMiddleware(t,!!e,n)}nargs(t,e){return z("<string|object|array> [number]",[t,e],arguments.length),this[ce](this.nargs.bind(this),"narg",t,e),this}normalize(t){return z("<array|string>",[t],arguments.length),this[Gt]("normalize",t),this}number(t){return z("<array|string>",[t],arguments.length),this[Gt]("number",t),this[ie](t),this}option(t,e){if(z("<string|object> [object]",[t,e],arguments.length),typeof t=="object")Object.keys(t).forEach(n=>{this.options(n,t[n])});else{typeof e!="object"&&(e={}),this[ie](t),O(this,Ut,"f")&&(t==="version"||e?.alias==="version")&&this[Sr](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
88
+ `),void 0,"versionWarning"),O(this,G,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const n=e.deprecate||e.deprecated;n&&this.deprecateOption(t,n);const s=e.demand||e.required||e.require;s&&this.demand(t,s),e.demandOption&&this.demandOption(t,typeof e.demandOption=="string"?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),e.implies!==void 0&&this.implies(t,e.implies),e.nargs!==void 0&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||e.type==="boolean")&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||e.type==="array")&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||e.type==="number")&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||e.type==="string")&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||e.type==="count")&&this.count(t),typeof e.global=="boolean"&&this.global(t,e.global),e.defaultDescription&&(O(this,G,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const i=e.describe||e.description||e.desc,r=O(this,et,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(r,t)||typeof i=="string")&&this.describe(t,i),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,n){z("[string|array] [function|boolean|object] [function]",[t,e,n],arguments.length),this[Fr](),typeof t>"u"&&(t=O(this,Yt,"f")),typeof e=="object"&&(H(this,Qt,e,"f"),e=n),typeof e=="function"&&(H(this,vt,e,"f"),e=!1),e||H(this,Yt,t,"f"),O(this,vt,"f")&&H(this,At,!1,"f");const s=this[pe](t,!!e),i=this.parsed;return O(this,Nt,"f").setParsed(this.parsed),yt(s)?s.then(r=>(O(this,vt,"f")&&O(this,vt,"f").call(this,O(this,zt,"f"),r,O(this,wt,"f")),r)).catch(r=>{throw O(this,vt,"f")&&O(this,vt,"f")(r,this.parsed.argv,O(this,wt,"f")),r}).finally(()=>{this[nn](),this.parsed=i}):(O(this,vt,"f")&&O(this,vt,"f").call(this,O(this,zt,"f"),s,O(this,wt,"f")),this[nn](),this.parsed=i,s)}parseAsync(t,e,n){const s=this.parse(t,e,n);return yt(s)?s:Promise.resolve(s)}parseSync(t,e,n){const s=this.parse(t,e,n);if(yt(s))throw new gt(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return s}parserConfiguration(t){return z("<object>",[t],arguments.length),H(this,Me,t,"f"),this}pkgConf(t,e){z("<string> [string]",[t,e],arguments.length);let n=null;const s=this[Qe](e||O(this,kt,"f"));return s[t]&&typeof s[t]=="object"&&(n=Gn(s[t],e||O(this,kt,"f"),this[ne]()["deep-merge-config"]||!1,O(this,tt,"f")),O(this,G,"f").configObjects=(O(this,G,"f").configObjects||[]).concat(n)),this}positional(t,e){z("<string> <object>",[t,e],arguments.length);const n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=Oe(e,(r,o)=>r==="type"&&!["string","number","boolean"].includes(o)?!1:n.includes(r));const s=O(this,he,"f").fullCommands[O(this,he,"f").fullCommands.length-1],i=s?O(this,mt,"f").cmdToParseOptions(s):{array:[],alias:{},default:{},demand:{}};return Xe(i).forEach(r=>{const o=i[r];Array.isArray(o)?o.indexOf(t)!==-1&&(e[r]=!0):o[t]&&!(r in e)&&(e[r]=o[t])}),this.group(t,O(this,et,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return z("[boolean]",[t],arguments.length),H(this,Pe,t,"f"),this}required(t,e,n){return this.demand(t,e,n)}require(t,e,n){return this.demand(t,e,n)}requiresArg(t){return z("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&O(this,G,"f").narg[t]?this:(this[ce](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,e){return z("[string] [string]",[t,e],arguments.length),t=t||this.$0,O(this,ae,"f").log(O(this,Nt,"f").generateCompletionScript(t,e||O(this,Ct,"f")||"completion")),this}showHelp(t){if(z("[string|function]",[t],arguments.length),H(this,Tt,!0,"f"),!O(this,et,"f").hasCachedHelpMessage()){if(!this.parsed){const n=this[pe](O(this,Yt,"f"),void 0,void 0,0,!0);if(yt(n))return n.then(()=>{O(this,et,"f").showHelp(t)}),this}const e=O(this,mt,"f").runDefaultBuilderOn(this);if(yt(e))return e.then(()=>{O(this,et,"f").showHelp(t)}),this}return O(this,et,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return z("[boolean|string] [string]",[t,e],arguments.length),O(this,et,"f").showHelpOnFail(t,e),this}showVersion(t){return z("[string|function]",[t],arguments.length),O(this,et,"f").showVersion(t),this}skipValidation(t){return z("<array|string>",[t],arguments.length),this[Gt]("skipValidation",t),this}strict(t){return z("[boolean]",[t],arguments.length),H(this,Zt,t!==!1,"f"),this}strictCommands(t){return z("[boolean]",[t],arguments.length),H(this,te,t!==!1,"f"),this}strictOptions(t){return z("[boolean]",[t],arguments.length),H(this,ee,t!==!1,"f"),this}string(t){return z("<array|string>",[t],arguments.length),this[Gt]("string",t),this[ie](t),this}terminalWidth(){return z([],0),O(this,tt,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return z("<object>",[t],arguments.length),H(this,Kt,!1,"f"),O(this,tt,"f").y18n.updateLocale(t),this}usage(t,e,n,s){if(z("<string|null|undefined> [string|boolean] [function|object] [function]",[t,e,n,s],arguments.length),e!==void 0){if(Rt(t,null,O(this,tt,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,e,n,s);throw new gt(".usage() description must start with $0 if being used as alias for .command()")}else return O(this,et,"f").usage(t),this}usageConfiguration(t){return z("<object>",[t],arguments.length),H(this,Le,t,"f"),this}version(t,e,n){const s="version";if(z("[boolean|string] [string] [string]",[t,e,n],arguments.length),O(this,Ut,"f")&&(this[ke](O(this,Ut,"f")),O(this,et,"f").version(void 0),H(this,Ut,null,"f")),arguments.length===0)n=this[Br](),t=s;else if(arguments.length===1){if(t===!1)return this;n=t,t=s}else arguments.length===2&&(n=e,e=void 0);return H(this,Ut,typeof t=="string"?t:s,"f"),e=e||O(this,et,"f").deferY18nLookup("Show version number"),O(this,et,"f").version(n||void 0),this.boolean(O(this,Ut,"f")),this.describe(O(this,Ut,"f"),e),this}wrap(t){return z("<number|null|undefined>",[t],arguments.length),O(this,et,"f").wrap(t),this}[(mt=new WeakMap,kt=new WeakMap,he=new WeakMap,Nt=new WeakMap,Ct=new WeakMap,ve=new WeakMap,zt=new WeakMap,Kt=new WeakMap,De=new WeakMap,At=new WeakMap,_e=new WeakMap,Mt=new WeakMap,Bt=new WeakMap,Tt=new WeakMap,Pt=new WeakMap,Ne=new WeakMap,ae=new WeakMap,wt=new WeakMap,G=new WeakMap,Ae=new WeakMap,Me=new WeakMap,vt=new WeakMap,Qt=new WeakMap,ue=new WeakMap,Jt=new WeakMap,Yt=new WeakMap,Pe=new WeakMap,tt=new WeakMap,Zt=new WeakMap,te=new WeakMap,ee=new WeakMap,et=new WeakMap,Le=new WeakMap,Ut=new WeakMap,dt=new WeakMap,Pr)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch{}return t}[Lr](){return{log:(...t)=>{this[Se]()||console.log(...t),H(this,Tt,!0,"f"),O(this,wt,"f").length&&H(this,wt,O(this,wt,"f")+`
89
+ `,"f"),H(this,wt,O(this,wt,"f")+t.join(" "),"f")},error:(...t)=>{this[Se]()||console.error(...t),H(this,Tt,!0,"f"),O(this,wt,"f").length&&H(this,wt,O(this,wt,"f")+`
90
+ `,"f"),H(this,wt,O(this,wt,"f")+t.join(" "),"f")}}}[ke](t){Xe(O(this,G,"f")).forEach(e=>{if((s=>s==="configObjects")(e))return;const n=O(this,G,"f")[e];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete O(this,et,"f").getDescriptions()[t]}[Sr](t,e,n){O(this,De,"f")[n]||(O(this,tt,"f").process.emitWarning(t,e),O(this,De,"f")[n]=!0)}[Fr](){O(this,_e,"f").push({options:O(this,G,"f"),configObjects:O(this,G,"f").configObjects.slice(0),exitProcess:O(this,At,"f"),groups:O(this,Bt,"f"),strict:O(this,Zt,"f"),strictCommands:O(this,te,"f"),strictOptions:O(this,ee,"f"),completionCommand:O(this,Ct,"f"),output:O(this,wt,"f"),exitError:O(this,zt,"f"),hasOutput:O(this,Tt,"f"),parsed:this.parsed,parseFn:O(this,vt,"f"),parseContext:O(this,Qt,"f")}),O(this,et,"f").freeze(),O(this,dt,"f").freeze(),O(this,mt,"f").freeze(),O(this,Mt,"f").freeze()}[jr](){let t="",e;return/\b(node|iojs|electron)(\.exe)?$/.test(O(this,tt,"f").process.argv()[0])?e=O(this,tt,"f").process.argv().slice(1,2):e=O(this,tt,"f").process.argv().slice(0,1),t=e.map(n=>{const s=this[kr](O(this,kt,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&s.length<n.length?s:n}).join(" ").trim(),O(this,tt,"f").getEnv("_")&&O(this,tt,"f").getProcessArgvBin()===O(this,tt,"f").getEnv("_")&&(t=O(this,tt,"f").getEnv("_").replace(`${O(this,tt,"f").path.dirname(O(this,tt,"f").process.execPath())}/`,"")),t}[ne](){return O(this,Me,"f")}[Rr](){return O(this,Le,"f")}[Ke](){if(!O(this,Kt,"f"))return;const t=O(this,tt,"f").getEnv("LC_ALL")||O(this,tt,"f").getEnv("LC_MESSAGES")||O(this,tt,"f").getEnv("LANG")||O(this,tt,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[Br](){return this[Qe]().version||"unknown"}[Ur](t){const e=t["--"]?t["--"]:t._;for(let n=0,s;(s=e[n])!==void 0;n++)O(this,tt,"f").Parser.looksLikeNumber(s)&&Number.isSafeInteger(Math.floor(parseFloat(`${s}`)))&&(e[n]=Number(s));return t}[Qe](t){const e=t||"*";if(O(this,ue,"f")[e])return O(this,ue,"f")[e];let n={};try{let s=t||O(this,tt,"f").mainFilename;!t&&O(this,tt,"f").path.extname(s)&&(s=O(this,tt,"f").path.dirname(s));const i=O(this,tt,"f").findUp(s,(r,o)=>{if(o.includes("package.json"))return"package.json"});Rt(i,void 0,O(this,tt,"f")),n=JSON.parse(O(this,tt,"f").readFileSync(i,"utf8"))}catch{}return O(this,ue,"f")[e]=n||{},O(this,ue,"f")[e]}[Gt](t,e){e=[].concat(e),e.forEach(n=>{n=this[tn](n),O(this,G,"f")[t].push(n)})}[ce](t,e,n,s){this[Ze](t,e,n,s,(i,r,o)=>{O(this,G,"f")[i][r]=o})}[Je](t,e,n,s){this[Ze](t,e,n,s,(i,r,o)=>{O(this,G,"f")[i][r]=(O(this,G,"f")[i][r]||[]).concat(o)})}[Ze](t,e,n,s,i){if(Array.isArray(n))n.forEach(r=>{t(r,s)});else if((r=>typeof r=="object")(n))for(const r of Xe(n))t(r,n[r]);else i(e,this[tn](n),s)}[tn](t){return t==="__proto__"?"___proto___":t}[en](t,e){return this[ce](this[en].bind(this),"key",t,e),this}[nn](){var t,e,n,s,i,r,o,l,E,p,d,b;const w=O(this,_e,"f").pop();Rt(w,void 0,O(this,tt,"f"));let T;t=this,e=this,n=this,s=this,i=this,r=this,o=this,l=this,E=this,p=this,d=this,b=this,{options:{set value(_){H(t,G,_,"f")}}.value,configObjects:T,exitProcess:{set value(_){H(e,At,_,"f")}}.value,groups:{set value(_){H(n,Bt,_,"f")}}.value,output:{set value(_){H(s,wt,_,"f")}}.value,exitError:{set value(_){H(i,zt,_,"f")}}.value,hasOutput:{set value(_){H(r,Tt,_,"f")}}.value,parsed:this.parsed,strict:{set value(_){H(o,Zt,_,"f")}}.value,strictCommands:{set value(_){H(l,te,_,"f")}}.value,strictOptions:{set value(_){H(E,ee,_,"f")}}.value,completionCommand:{set value(_){H(p,Ct,_,"f")}}.value,parseFn:{set value(_){H(d,vt,_,"f")}}.value,parseContext:{set value(_){H(b,Qt,_,"f")}}.value}=w,O(this,G,"f").configObjects=T,O(this,et,"f").unfreeze(),O(this,dt,"f").unfreeze(),O(this,mt,"f").unfreeze(),O(this,Mt,"f").unfreeze()}[Xr](t,e){return Ee(e,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[$r].bind(this),getContext:this[qr].bind(this),getHasOutput:this[Wr].bind(this),getLoggerInstance:this[Vr].bind(this),getParseContext:this[Hr].bind(this),getParserConfiguration:this[ne].bind(this),getUsageConfiguration:this[Rr].bind(this),getUsageInstance:this[zr].bind(this),getValidationInstance:this[Yr].bind(this),hasParseCallback:this[Se].bind(this),isGlobalContext:this[Gr].bind(this),postProcess:this[re].bind(this),reset:this[rn].bind(this),runValidation:this[sn].bind(this),runYargsParserAndExecuteCommands:this[pe].bind(this),setHasOutput:this[Kr].bind(this)}}[$r](){return O(this,mt,"f")}[qr](){return O(this,he,"f")}[Wr](){return O(this,Tt,"f")}[Vr](){return O(this,ae,"f")}[Hr](){return O(this,Qt,"f")||{}}[zr](){return O(this,et,"f")}[Yr](){return O(this,dt,"f")}[Se](){return!!O(this,vt,"f")}[Gr](){return O(this,Ne,"f")}[re](t,e,n,s){return n||yt(t)||(e||(t=this[Pr](t)),(this[ne]()["parse-positional-numbers"]||this[ne]()["parse-positional-numbers"]===void 0)&&(t=this[Ur](t)),s&&(t=we(t,this,O(this,Mt,"f").getMiddleware(),!1))),t}[rn](t={}){H(this,G,O(this,G,"f")||{},"f");const e={};e.local=O(this,G,"f").local||[],e.configObjects=O(this,G,"f").configObjects||[];const n={};e.local.forEach(r=>{n[r]=!0,(t[r]||[]).forEach(o=>{n[o]=!0})}),Object.assign(O(this,Jt,"f"),Object.keys(O(this,Bt,"f")).reduce((r,o)=>{const l=O(this,Bt,"f")[o].filter(E=>!(E in n));return l.length>0&&(r[o]=l),r},{})),H(this,Bt,{},"f");const s=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],i=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return s.forEach(r=>{e[r]=(O(this,G,"f")[r]||[]).filter(o=>!n[o])}),i.forEach(r=>{e[r]=Oe(O(this,G,"f")[r],o=>!n[o])}),e.envPrefix=O(this,G,"f").envPrefix,H(this,G,e,"f"),H(this,et,O(this,et,"f")?O(this,et,"f").reset(n):wo(this,O(this,tt,"f")),"f"),H(this,dt,O(this,dt,"f")?O(this,dt,"f").reset(n):_o(this,O(this,et,"f"),O(this,tt,"f")),"f"),H(this,mt,O(this,mt,"f")?O(this,mt,"f").reset():po(O(this,et,"f"),O(this,dt,"f"),O(this,Mt,"f"),O(this,tt,"f")),"f"),O(this,Nt,"f")||H(this,Nt,Co(this,O(this,et,"f"),O(this,mt,"f"),O(this,tt,"f")),"f"),O(this,Mt,"f").reset(),H(this,Ct,null,"f"),H(this,wt,"","f"),H(this,zt,null,"f"),H(this,Tt,!1,"f"),this.parsed=!1,this}[kr](t,e){return O(this,tt,"f").path.relative(t,e)}[pe](t,e,n,s=0,i=!1){let r=!!n||i;t=t||O(this,Yt,"f"),O(this,G,"f").__=O(this,tt,"f").y18n.__,O(this,G,"f").configuration=this[ne]();const o=!!O(this,G,"f").configuration["populate--"],l=Object.assign({},O(this,G,"f").configuration,{"populate--":!0}),E=O(this,tt,"f").Parser.detailed(t,Object.assign({},O(this,G,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),p=Object.assign(E.argv,O(this,Qt,"f"));let d;const b=E.aliases;let w=!1,T=!1;Object.keys(p).forEach(_=>{_===O(this,Pt,"f")&&p[_]?w=!0:_===O(this,Ut,"f")&&p[_]&&(T=!0)}),p.$0=this.$0,this.parsed=E,s===0&&O(this,et,"f").clearCachedHelpMessage();try{if(this[Ke](),e)return this[re](p,o,!!n,!1);O(this,Pt,"f")&&[O(this,Pt,"f")].concat(b[O(this,Pt,"f")]||[]).filter(m=>m.length>1).includes(""+p._[p._.length-1])&&(p._.pop(),w=!0),H(this,Ne,!1,"f");const _=O(this,mt,"f").getCommands(),I=O(this,Nt,"f").completionKey in p,v=w||I||i;if(p._.length){if(_.length){let C;for(let m=s||0,D;p._[m]!==void 0;m++)if(D=String(p._[m]),_.includes(D)&&D!==O(this,Ct,"f")){const M=O(this,mt,"f").runCommand(D,this,E,m+1,i,w||T||i);return this[re](M,o,!!n,!1)}else if(!C&&D!==O(this,Ct,"f")){C=D;break}!O(this,mt,"f").hasDefaultCommand()&&O(this,Pe,"f")&&C&&!v&&O(this,dt,"f").recommendCommands(C,_)}O(this,Ct,"f")&&p._.includes(O(this,Ct,"f"))&&!I&&(O(this,At,"f")&&ge(!0),this.showCompletionScript(),this.exit(0))}if(O(this,mt,"f").hasDefaultCommand()&&!v){const C=O(this,mt,"f").runCommand(null,this,E,0,i,w||T||i);return this[re](C,o,!!n,!1)}if(I){O(this,At,"f")&&ge(!0),t=[].concat(t);const C=t.slice(t.indexOf(`--${O(this,Nt,"f").completionKey}`)+1);return O(this,Nt,"f").getCompletion(C,(m,D)=>{if(m)throw new gt(m.message);(D||[]).forEach(M=>{O(this,ae,"f").log(M)}),this.exit(0)}),this[re](p,!o,!!n,!1)}if(O(this,Tt,"f")||(w?(O(this,At,"f")&&ge(!0),r=!0,this.showHelp("log"),this.exit(0)):T&&(O(this,At,"f")&&ge(!0),r=!0,O(this,et,"f").showVersion("log"),this.exit(0))),!r&&O(this,G,"f").skipValidation.length>0&&(r=Object.keys(p).some(C=>O(this,G,"f").skipValidation.indexOf(C)>=0&&p[C]===!0)),!r){if(E.error)throw new gt(E.error.message);if(!I){const C=this[sn](b,{},E.error);n||(d=we(p,this,O(this,Mt,"f").getMiddleware(),!0)),d=this[Xr](C,d??p),yt(d)&&!n&&(d=d.then(()=>we(p,this,O(this,Mt,"f").getMiddleware(),!1)))}}}catch(_){if(_ instanceof gt)O(this,et,"f").fail(_.message,_);else throw _}return this[re](d??p,o,!!n,!0)}[sn](t,e,n,s){const i={...this.getDemandedOptions()};return r=>{if(n)throw new gt(n.message);O(this,dt,"f").nonOptionCount(r),O(this,dt,"f").requiredArguments(r,i);let o=!1;O(this,te,"f")&&(o=O(this,dt,"f").unknownCommands(r)),O(this,Zt,"f")&&!o?O(this,dt,"f").unknownArguments(r,t,e,!!s):O(this,ee,"f")&&O(this,dt,"f").unknownArguments(r,t,{},!1,!1),O(this,dt,"f").limitedChoices(r),O(this,dt,"f").implications(r),O(this,dt,"f").conflicting(r)}}[Kr](){H(this,Tt,!0,"f")}[ie](t){if(typeof t=="string")O(this,G,"f").key[t]=!0;else for(const e of t)O(this,G,"f").key[e]=!0}}function Lo(a){return!!a&&typeof a.getInternalMethods=="function"}const So=Mo(oo);var on={},Qr;function Zn(){return Qr||(Qr=1,function(){on.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
91
+ `},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}.call(it)),on}var an={},Wt={},Vt={},Jr;function Ht(){return Jr||(Jr=1,function(){var a,t,e,n,s,i,r,o=[].slice,l={}.hasOwnProperty;a=function(){var E,p,d,b,w,T;if(T=arguments[0],w=2<=arguments.length?o.call(arguments,1):[],s(Object.assign))Object.assign.apply(null,arguments);else for(E=0,d=w.length;E<d;E++)if(b=w[E],b!=null)for(p in b)l.call(b,p)&&(T[p]=b[p]);return T},s=function(E){return!!E&&Object.prototype.toString.call(E)==="[object Function]"},i=function(E){var p;return!!E&&((p=typeof E)=="function"||p==="object")},e=function(E){return s(Array.isArray)?Array.isArray(E):Object.prototype.toString.call(E)==="[object Array]"},n=function(E){var p;if(e(E))return!E.length;for(p in E)if(l.call(E,p))return!1;return!0},r=function(E){var p,d;return i(E)&&(d=Object.getPrototypeOf(E))&&(p=d.constructor)&&typeof p=="function"&&p instanceof p&&Function.prototype.toString.call(p)===Function.prototype.toString.call(Object)},t=function(E){return s(E.valueOf)?E.valueOf():E},Vt.assign=a,Vt.isFunction=s,Vt.isObject=i,Vt.isArray=e,Vt.isEmpty=n,Vt.isPlainObject=r,Vt.getValue=t}.call(it)),Vt}var un={exports:{}},Zr;function os(){return Zr||(Zr=1,function(){un.exports=function(){function a(){}return a.prototype.hasFeature=function(t,e){return!0},a.prototype.createDocumentType=function(t,e,n){throw new Error("This DOM method is not implemented.")},a.prototype.createDocument=function(t,e,n){throw new Error("This DOM method is not implemented.")},a.prototype.createHTMLDocument=function(t){throw new Error("This DOM method is not implemented.")},a.prototype.getFeature=function(t,e){throw new Error("This DOM method is not implemented.")},a}()}.call(it)),un.exports}var cn={exports:{}},ln={exports:{}},fn={exports:{}},ti;function Fo(){return ti||(ti=1,function(){fn.exports=function(){function a(){}return a.prototype.handleError=function(t){throw new Error(t)},a}()}.call(it)),fn.exports}var hn={exports:{}},ei;function jo(){return ei||(ei=1,function(){hn.exports=function(){function a(t){this.arr=t||[]}return Object.defineProperty(a.prototype,"length",{get:function(){return this.arr.length}}),a.prototype.item=function(t){return this.arr[t]||null},a.prototype.contains=function(t){return this.arr.indexOf(t)!==-1},a}()}.call(it)),hn.exports}var ni;function Ro(){return ni||(ni=1,function(){var a,t;a=Fo(),t=jo(),ln.exports=function(){function e(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new a,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=Object.create(this.defaultParams)}return Object.defineProperty(e.prototype,"parameterNames",{get:function(){return new t(Object.keys(this.defaultParams))}}),e.prototype.getParameter=function(n){return this.params.hasOwnProperty(n)?this.params[n]:null},e.prototype.canSetParameter=function(n,s){return!0},e.prototype.setParameter=function(n,s){return s!=null?this.params[n]=s:delete this.params[n]},e}()}.call(it)),ln.exports}var pn={exports:{}},dn={exports:{}},mn={exports:{}},ri;function bt(){return ri||(ri=1,function(){mn.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}.call(it)),mn.exports}var gn={exports:{}},ii;function as(){return ii||(ii=1,function(){var a;a=bt(),St(),gn.exports=function(){function t(e,n,s){if(this.parent=e,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),n==null)throw new Error("Missing attribute name. "+this.debugInfo(n));this.name=this.stringify.name(n),this.value=this.stringify.attValue(s),this.type=a.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(t.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(t.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}}),Object.defineProperty(t.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(t.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(t.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(t.prototype,"specified",{get:function(){return!0}}),t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.attribute(this,this.options.writer.filterOptions(e))},t.prototype.debugInfo=function(e){return e=e||this.name,e==null?"parent: <"+this.parent.name+">":"attribute: {"+e+"}, parent: <"+this.parent.name+">"},t.prototype.isEqualNode=function(e){return!(e.namespaceURI!==this.namespaceURI||e.prefix!==this.prefix||e.localName!==this.localName||e.value!==this.value)},t}()}.call(it)),gn.exports}var yn={exports:{}},si;function tr(){return si||(si=1,function(){yn.exports=function(){function a(t){this.nodes=t}return Object.defineProperty(a.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),a.prototype.clone=function(){return this.nodes=null},a.prototype.getNamedItem=function(t){return this.nodes[t]},a.prototype.setNamedItem=function(t){var e;return e=this.nodes[t.nodeName],this.nodes[t.nodeName]=t,e||null},a.prototype.removeNamedItem=function(t){var e;return e=this.nodes[t],delete this.nodes[t],e||null},a.prototype.item=function(t){return this.nodes[Object.keys(this.nodes)[t]]||null},a.prototype.getNamedItemNS=function(t,e){throw new Error("This DOM method is not implemented.")},a.prototype.setNamedItemNS=function(t){throw new Error("This DOM method is not implemented.")},a.prototype.removeNamedItemNS=function(t,e){throw new Error("This DOM method is not implemented.")},a}()}.call(it)),yn.exports}var oi;function er(){return oi||(oi=1,function(){var a,t,e,n,s,i,r,o,l=function(p,d){for(var b in d)E.call(d,b)&&(p[b]=d[b]);function w(){this.constructor=p}return w.prototype=d.prototype,p.prototype=new w,p.__super__=d.prototype,p},E={}.hasOwnProperty;o=Ht(),r=o.isObject,i=o.isFunction,s=o.getValue,n=St(),a=bt(),t=as(),e=tr(),dn.exports=function(p){l(d,p);function d(b,w,T){var _,I,v,C;if(d.__super__.constructor.call(this,b),w==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(w),this.type=a.Element,this.attribs={},this.schemaTypeInfo=null,T!=null&&this.attribute(T),b.type===a.Document&&(this.isRoot=!0,this.documentObject=b,b.rootObject=this,b.children)){for(C=b.children,I=0,v=C.length;I<v;I++)if(_=C[I],_.type===a.DocType){_.name=this.name;break}}}return Object.defineProperty(d.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(d.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(d.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(d.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(d.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(d.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(d.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(d.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new e(this.attribs)),this.attributeMap}}),d.prototype.clone=function(){var b,w,T,_;T=Object.create(this),T.isRoot&&(T.documentObject=null),T.attribs={},_=this.attribs;for(w in _)E.call(_,w)&&(b=_[w],T.attribs[w]=b.clone());return T.children=[],this.children.forEach(function(I){var v;return v=I.clone(),v.parent=T,T.children.push(v)}),T},d.prototype.attribute=function(b,w){var T,_;if(b!=null&&(b=s(b)),r(b))for(T in b)E.call(b,T)&&(_=b[T],this.attribute(T,_));else i(w)&&(w=w.apply()),this.options.keepNullAttributes&&w==null?this.attribs[b]=new t(this,b,""):w!=null&&(this.attribs[b]=new t(this,b,w));return this},d.prototype.removeAttribute=function(b){var w,T,_;if(b==null)throw new Error("Missing attribute name. "+this.debugInfo());if(b=s(b),Array.isArray(b))for(T=0,_=b.length;T<_;T++)w=b[T],delete this.attribs[w];else delete this.attribs[b];return this},d.prototype.toString=function(b){return this.options.writer.element(this,this.options.writer.filterOptions(b))},d.prototype.att=function(b,w){return this.attribute(b,w)},d.prototype.a=function(b,w){return this.attribute(b,w)},d.prototype.getAttribute=function(b){return this.attribs.hasOwnProperty(b)?this.attribs[b].value:null},d.prototype.setAttribute=function(b,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getAttributeNode=function(b){return this.attribs.hasOwnProperty(b)?this.attribs[b]:null},d.prototype.setAttributeNode=function(b){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.removeAttributeNode=function(b){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getElementsByTagName=function(b){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getAttributeNS=function(b,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.setAttributeNS=function(b,w,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.removeAttributeNS=function(b,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getAttributeNodeNS=function(b,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.setAttributeNodeNS=function(b){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getElementsByTagNameNS=function(b,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.hasAttribute=function(b){return this.attribs.hasOwnProperty(b)},d.prototype.hasAttributeNS=function(b,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.setIdAttribute=function(b,w){return this.attribs.hasOwnProperty(b)?this.attribs[b].isId:w},d.prototype.setIdAttributeNS=function(b,w,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.setIdAttributeNode=function(b,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getElementsByTagName=function(b){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getElementsByTagNameNS=function(b,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getElementsByClassName=function(b){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.isEqualNode=function(b){var w,T,_;if(!d.__super__.isEqualNode.apply(this,arguments).isEqualNode(b)||b.namespaceURI!==this.namespaceURI||b.prefix!==this.prefix||b.localName!==this.localName||b.attribs.length!==this.attribs.length)return!1;for(w=T=0,_=this.attribs.length-1;0<=_?T<=_:T>=_;w=0<=_?++T:--T)if(!this.attribs[w].isEqualNode(b.attribs[w]))return!1;return!0},d}(n)}.call(it)),dn.exports}var bn={exports:{}},wn={exports:{}},ai;function qe(){return ai||(ai=1,function(){var a,t=function(n,s){for(var i in s)e.call(s,i)&&(n[i]=s[i]);function r(){this.constructor=n}return r.prototype=s.prototype,n.prototype=new r,n.__super__=s.prototype,n},e={}.hasOwnProperty;a=St(),wn.exports=function(n){t(s,n);function s(i){s.__super__.constructor.call(this,i),this.value=""}return Object.defineProperty(s.prototype,"data",{get:function(){return this.value},set:function(i){return this.value=i||""}}),Object.defineProperty(s.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(s.prototype,"textContent",{get:function(){return this.value},set:function(i){return this.value=i||""}}),s.prototype.clone=function(){return Object.create(this)},s.prototype.substringData=function(i,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.appendData=function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.insertData=function(i,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.deleteData=function(i,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.replaceData=function(i,r,o){throw new Error("This DOM method is not implemented."+this.debugInfo())},s.prototype.isEqualNode=function(i){return!(!s.__super__.isEqualNode.apply(this,arguments).isEqualNode(i)||i.data!==this.data)},s}(a)}.call(it)),wn.exports}var ui;function nr(){return ui||(ui=1,function(){var a,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function o(){this.constructor=s}return o.prototype=i.prototype,s.prototype=new o,s.__super__=i.prototype,s},n={}.hasOwnProperty;a=bt(),t=qe(),bn.exports=function(s){e(i,s);function i(r,o){if(i.__super__.constructor.call(this,r),o==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=a.CData,this.value=this.stringify.cdata(o)}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))},i}(t)}.call(it)),bn.exports}var En={exports:{}},ci;function rr(){return ci||(ci=1,function(){var a,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function o(){this.constructor=s}return o.prototype=i.prototype,s.prototype=new o,s.__super__=i.prototype,s},n={}.hasOwnProperty;a=bt(),t=qe(),En.exports=function(s){e(i,s);function i(r,o){if(i.__super__.constructor.call(this,r),o==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=a.Comment,this.value=this.stringify.comment(o)}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))},i}(t)}.call(it)),En.exports}var xn={exports:{}},li;function ir(){return li||(li=1,function(){var a,t,e,n=function(i,r){for(var o in r)s.call(r,o)&&(i[o]=r[o]);function l(){this.constructor=i}return l.prototype=r.prototype,i.prototype=new l,i.__super__=r.prototype,i},s={}.hasOwnProperty;e=Ht().isObject,t=St(),a=bt(),xn.exports=function(i){n(r,i);function r(o,l,E,p){var d;r.__super__.constructor.call(this,o),e(l)&&(d=l,l=d.version,E=d.encoding,p=d.standalone),l||(l="1.0"),this.type=a.Declaration,this.version=this.stringify.xmlVersion(l),E!=null&&(this.encoding=this.stringify.xmlEncoding(E)),p!=null&&(this.standalone=this.stringify.xmlStandalone(p))}return r.prototype.toString=function(o){return this.options.writer.declaration(this,this.options.writer.filterOptions(o))},r}(t)}.call(it)),xn.exports}var On={exports:{}},In={exports:{}},fi;function sr(){return fi||(fi=1,function(){var a,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function o(){this.constructor=s}return o.prototype=i.prototype,s.prototype=new o,s.__super__=i.prototype,s},n={}.hasOwnProperty;t=St(),a=bt(),In.exports=function(s){e(i,s);function i(r,o,l,E,p,d){if(i.__super__.constructor.call(this,r),o==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(l==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(o));if(!E)throw new Error("Missing DTD attribute type. "+this.debugInfo(o));if(!p)throw new Error("Missing DTD attribute default. "+this.debugInfo(o));if(p.indexOf("#")!==0&&(p="#"+p),!p.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(o));if(d&&!p.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(o));this.elementName=this.stringify.name(o),this.type=a.AttributeDeclaration,this.attributeName=this.stringify.name(l),this.attributeType=this.stringify.dtdAttType(E),d&&(this.defaultValue=this.stringify.dtdAttDefault(d)),this.defaultValueType=p}return i.prototype.toString=function(r){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(r))},i}(t)}.call(it)),In.exports}var Cn={exports:{}},hi;function or(){return hi||(hi=1,function(){var a,t,e,n=function(i,r){for(var o in r)s.call(r,o)&&(i[o]=r[o]);function l(){this.constructor=i}return l.prototype=r.prototype,i.prototype=new l,i.__super__=r.prototype,i},s={}.hasOwnProperty;e=Ht().isObject,t=St(),a=bt(),Cn.exports=function(i){n(r,i);function r(o,l,E,p){if(r.__super__.constructor.call(this,o),E==null)throw new Error("Missing DTD entity name. "+this.debugInfo(E));if(p==null)throw new Error("Missing DTD entity value. "+this.debugInfo(E));if(this.pe=!!l,this.name=this.stringify.name(E),this.type=a.EntityDeclaration,!e(p))this.value=this.stringify.dtdEntityValue(p),this.internal=!0;else{if(!p.pubID&&!p.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(E));if(p.pubID&&!p.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(E));if(this.internal=!1,p.pubID!=null&&(this.pubID=this.stringify.dtdPubID(p.pubID)),p.sysID!=null&&(this.sysID=this.stringify.dtdSysID(p.sysID)),p.nData!=null&&(this.nData=this.stringify.dtdNData(p.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(E))}}return Object.defineProperty(r.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(r.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(r.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(r.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(r.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(r.prototype,"xmlVersion",{get:function(){return null}}),r.prototype.toString=function(o){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(o))},r}(t)}.call(it)),Cn.exports}var Tn={exports:{}},pi;function ar(){return pi||(pi=1,function(){var a,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function o(){this.constructor=s}return o.prototype=i.prototype,s.prototype=new o,s.__super__=i.prototype,s},n={}.hasOwnProperty;t=St(),a=bt(),Tn.exports=function(s){e(i,s);function i(r,o,l){if(i.__super__.constructor.call(this,r),o==null)throw new Error("Missing DTD element name. "+this.debugInfo());l||(l="(#PCDATA)"),Array.isArray(l)&&(l="("+l.join(",")+")"),this.name=this.stringify.name(o),this.type=a.ElementDeclaration,this.value=this.stringify.dtdElementValue(l)}return i.prototype.toString=function(r){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(r))},i}(t)}.call(it)),Tn.exports}var vn={exports:{}},di;function ur(){return di||(di=1,function(){var a,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function o(){this.constructor=s}return o.prototype=i.prototype,s.prototype=new o,s.__super__=i.prototype,s},n={}.hasOwnProperty;t=St(),a=bt(),vn.exports=function(s){e(i,s);function i(r,o,l){if(i.__super__.constructor.call(this,r),o==null)throw new Error("Missing DTD notation name. "+this.debugInfo(o));if(!l.pubID&&!l.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(o));this.name=this.stringify.name(o),this.type=a.NotationDeclaration,l.pubID!=null&&(this.pubID=this.stringify.dtdPubID(l.pubID)),l.sysID!=null&&(this.sysID=this.stringify.dtdSysID(l.sysID))}return Object.defineProperty(i.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(i.prototype,"systemId",{get:function(){return this.sysID}}),i.prototype.toString=function(r){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(r))},i}(t)}.call(it)),vn.exports}var mi;function cr(){return mi||(mi=1,function(){var a,t,e,n,s,i,r,o,l=function(p,d){for(var b in d)E.call(d,b)&&(p[b]=d[b]);function w(){this.constructor=p}return w.prototype=d.prototype,p.prototype=new w,p.__super__=d.prototype,p},E={}.hasOwnProperty;o=Ht().isObject,r=St(),a=bt(),t=sr(),n=or(),e=ar(),s=ur(),i=tr(),On.exports=function(p){l(d,p);function d(b,w,T){var _,I,v,C,m,D;if(d.__super__.constructor.call(this,b),this.type=a.DocType,b.children){for(C=b.children,I=0,v=C.length;I<v;I++)if(_=C[I],_.type===a.Element){this.name=_.name;break}}this.documentObject=b,o(w)&&(m=w,w=m.pubID,T=m.sysID),T==null&&(D=[w,T],T=D[0],w=D[1]),w!=null&&(this.pubID=this.stringify.dtdPubID(w)),T!=null&&(this.sysID=this.stringify.dtdSysID(T))}return Object.defineProperty(d.prototype,"entities",{get:function(){var b,w,T,_,I;for(_={},I=this.children,w=0,T=I.length;w<T;w++)b=I[w],b.type===a.EntityDeclaration&&!b.pe&&(_[b.name]=b);return new i(_)}}),Object.defineProperty(d.prototype,"notations",{get:function(){var b,w,T,_,I;for(_={},I=this.children,w=0,T=I.length;w<T;w++)b=I[w],b.type===a.NotationDeclaration&&(_[b.name]=b);return new i(_)}}),Object.defineProperty(d.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(d.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(d.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),d.prototype.element=function(b,w){var T;return T=new e(this,b,w),this.children.push(T),this},d.prototype.attList=function(b,w,T,_,I){var v;return v=new t(this,b,w,T,_,I),this.children.push(v),this},d.prototype.entity=function(b,w){var T;return T=new n(this,!1,b,w),this.children.push(T),this},d.prototype.pEntity=function(b,w){var T;return T=new n(this,!0,b,w),this.children.push(T),this},d.prototype.notation=function(b,w){var T;return T=new s(this,b,w),this.children.push(T),this},d.prototype.toString=function(b){return this.options.writer.docType(this,this.options.writer.filterOptions(b))},d.prototype.ele=function(b,w){return this.element(b,w)},d.prototype.att=function(b,w,T,_,I){return this.attList(b,w,T,_,I)},d.prototype.ent=function(b,w){return this.entity(b,w)},d.prototype.pent=function(b,w){return this.pEntity(b,w)},d.prototype.not=function(b,w){return this.notation(b,w)},d.prototype.up=function(){return this.root()||this.documentObject},d.prototype.isEqualNode=function(b){return!(!d.__super__.isEqualNode.apply(this,arguments).isEqualNode(b)||b.name!==this.name||b.publicId!==this.publicId||b.systemId!==this.systemId)},d}(r)}.call(it)),On.exports}var Dn={exports:{}},gi;function lr(){return gi||(gi=1,function(){var a,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function o(){this.constructor=s}return o.prototype=i.prototype,s.prototype=new o,s.__super__=i.prototype,s},n={}.hasOwnProperty;a=bt(),t=St(),Dn.exports=function(s){e(i,s);function i(r,o){if(i.__super__.constructor.call(this,r),o==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=a.Raw,this.value=this.stringify.raw(o)}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))},i}(t)}.call(it)),Dn.exports}var _n={exports:{}},yi;function fr(){return yi||(yi=1,function(){var a,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function o(){this.constructor=s}return o.prototype=i.prototype,s.prototype=new o,s.__super__=i.prototype,s},n={}.hasOwnProperty;a=bt(),t=qe(),_n.exports=function(s){e(i,s);function i(r,o){if(i.__super__.constructor.call(this,r),o==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=a.Text,this.value=this.stringify.text(o)}return Object.defineProperty(i.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(i.prototype,"wholeText",{get:function(){var r,o,l;for(l="",o=this.previousSibling;o;)l=o.data+l,o=o.previousSibling;for(l+=this.data,r=this.nextSibling;r;)l=l+r.data,r=r.nextSibling;return l}}),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))},i.prototype.splitText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.replaceWholeText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())},i}(t)}.call(it)),_n.exports}var Nn={exports:{}},bi;function hr(){return bi||(bi=1,function(){var a,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function o(){this.constructor=s}return o.prototype=i.prototype,s.prototype=new o,s.__super__=i.prototype,s},n={}.hasOwnProperty;a=bt(),t=qe(),Nn.exports=function(s){e(i,s);function i(r,o,l){if(i.__super__.constructor.call(this,r),o==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=a.ProcessingInstruction,this.target=this.stringify.insTarget(o),this.name=this.target,l&&(this.value=this.stringify.insValue(l))}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))},i.prototype.isEqualNode=function(r){return!(!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)||r.target!==this.target)},i}(t)}.call(it)),Nn.exports}var An={exports:{}},wi;function us(){return wi||(wi=1,function(){var a,t,e=function(s,i){for(var r in i)n.call(i,r)&&(s[r]=i[r]);function o(){this.constructor=s}return o.prototype=i.prototype,s.prototype=new o,s.__super__=i.prototype,s},n={}.hasOwnProperty;t=St(),a=bt(),An.exports=function(s){e(i,s);function i(r){i.__super__.constructor.call(this,r),this.type=a.Dummy}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return""},i}(t)}.call(it)),An.exports}var Mn={exports:{}},Ei;function Bo(){return Ei||(Ei=1,function(){Mn.exports=function(){function a(t){this.nodes=t}return Object.defineProperty(a.prototype,"length",{get:function(){return this.nodes.length||0}}),a.prototype.clone=function(){return this.nodes=null},a.prototype.item=function(t){return this.nodes[t]||null},a}()}.call(it)),Mn.exports}var Pn={exports:{}},xi;function Uo(){return xi||(xi=1,function(){Pn.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}.call(it)),Pn.exports}var Oi;function St(){return Oi||(Oi=1,function(){var a,t,e,n,s,i,r,o,l,E,p,d,b,w,T,_,I,v={}.hasOwnProperty;I=Ht(),_=I.isObject,T=I.isFunction,w=I.isEmpty,b=I.getValue,o=null,e=null,n=null,s=null,i=null,p=null,d=null,E=null,r=null,t=null,l=null,a=null,pn.exports=function(){function C(m){this.parent=m,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,o||(o=er(),e=nr(),n=rr(),s=ir(),i=cr(),p=lr(),d=fr(),E=hr(),r=us(),t=bt(),l=Bo(),tr(),a=Uo())}return Object.defineProperty(C.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(C.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(C.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(C.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(C.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new l(this.children)),this.childNodeList}}),Object.defineProperty(C.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(C.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(C.prototype,"previousSibling",{get:function(){var m;return m=this.parent.children.indexOf(this),this.parent.children[m-1]||null}}),Object.defineProperty(C.prototype,"nextSibling",{get:function(){var m;return m=this.parent.children.indexOf(this),this.parent.children[m+1]||null}}),Object.defineProperty(C.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(C.prototype,"textContent",{get:function(){var m,D,M,X,q;if(this.nodeType===t.Element||this.nodeType===t.DocumentFragment){for(q="",X=this.children,D=0,M=X.length;D<M;D++)m=X[D],m.textContent&&(q+=m.textContent);return q}else return null},set:function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),C.prototype.setParent=function(m){var D,M,X,q,U;for(this.parent=m,m&&(this.options=m.options,this.stringify=m.stringify),q=this.children,U=[],M=0,X=q.length;M<X;M++)D=q[M],U.push(D.setParent(this));return U},C.prototype.element=function(m,D,M){var X,q,U,g,R,S,B,$,W,Y,k;if(S=null,D===null&&M==null&&(W=[{},null],D=W[0],M=W[1]),D==null&&(D={}),D=b(D),_(D)||(Y=[D,M],M=Y[0],D=Y[1]),m!=null&&(m=b(m)),Array.isArray(m))for(U=0,B=m.length;U<B;U++)q=m[U],S=this.element(q);else if(T(m))S=this.element(m.apply());else if(_(m)){for(R in m)if(v.call(m,R))if(k=m[R],T(k)&&(k=k.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&R.indexOf(this.stringify.convertAttKey)===0)S=this.attribute(R.substr(this.stringify.convertAttKey.length),k);else if(!this.options.separateArrayItems&&Array.isArray(k)&&w(k))S=this.dummy();else if(_(k)&&w(k))S=this.element(R);else if(!this.options.keepNullNodes&&k==null)S=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(k))for(g=0,$=k.length;g<$;g++)q=k[g],X={},X[R]=q,S=this.element(X);else _(k)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&R.indexOf(this.stringify.convertTextKey)===0?S=this.element(k):(S=this.element(R),S.element(k)):S=this.element(R,k)}else!this.options.keepNullNodes&&M===null?S=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&m.indexOf(this.stringify.convertTextKey)===0?S=this.text(M):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&m.indexOf(this.stringify.convertCDataKey)===0?S=this.cdata(M):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&m.indexOf(this.stringify.convertCommentKey)===0?S=this.comment(M):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&m.indexOf(this.stringify.convertRawKey)===0?S=this.raw(M):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&m.indexOf(this.stringify.convertPIKey)===0?S=this.instruction(m.substr(this.stringify.convertPIKey.length),M):S=this.node(m,D,M);if(S==null)throw new Error("Could not create any elements with: "+m+". "+this.debugInfo());return S},C.prototype.insertBefore=function(m,D,M){var X,q,U,g,R;if(m?.type)return U=m,g=D,U.setParent(this),g?(q=children.indexOf(g),R=children.splice(q),children.push(U),Array.prototype.push.apply(children,R)):children.push(U),U;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(m));return q=this.parent.children.indexOf(this),R=this.parent.children.splice(q),X=this.parent.element(m,D,M),Array.prototype.push.apply(this.parent.children,R),X},C.prototype.insertAfter=function(m,D,M){var X,q,U;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(m));return q=this.parent.children.indexOf(this),U=this.parent.children.splice(q+1),X=this.parent.element(m,D,M),Array.prototype.push.apply(this.parent.children,U),X},C.prototype.remove=function(){var m;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return m=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[m,m-m+1].concat([])),this.parent},C.prototype.node=function(m,D,M){var X,q;return m!=null&&(m=b(m)),D||(D={}),D=b(D),_(D)||(q=[D,M],M=q[0],D=q[1]),X=new o(this,m,D),M!=null&&X.text(M),this.children.push(X),X},C.prototype.text=function(m){var D;return _(m)&&this.element(m),D=new d(this,m),this.children.push(D),this},C.prototype.cdata=function(m){var D;return D=new e(this,m),this.children.push(D),this},C.prototype.comment=function(m){var D;return D=new n(this,m),this.children.push(D),this},C.prototype.commentBefore=function(m){var D,M;return D=this.parent.children.indexOf(this),M=this.parent.children.splice(D),this.parent.comment(m),Array.prototype.push.apply(this.parent.children,M),this},C.prototype.commentAfter=function(m){var D,M;return D=this.parent.children.indexOf(this),M=this.parent.children.splice(D+1),this.parent.comment(m),Array.prototype.push.apply(this.parent.children,M),this},C.prototype.raw=function(m){var D;return D=new p(this,m),this.children.push(D),this},C.prototype.dummy=function(){var m;return m=new r(this),m},C.prototype.instruction=function(m,D){var M,X,q,U,g;if(m!=null&&(m=b(m)),D!=null&&(D=b(D)),Array.isArray(m))for(U=0,g=m.length;U<g;U++)M=m[U],this.instruction(M);else if(_(m))for(M in m)v.call(m,M)&&(X=m[M],this.instruction(M,X));else T(D)&&(D=D.apply()),q=new E(this,m,D),this.children.push(q);return this},C.prototype.instructionBefore=function(m,D){var M,X;return M=this.parent.children.indexOf(this),X=this.parent.children.splice(M),this.parent.instruction(m,D),Array.prototype.push.apply(this.parent.children,X),this},C.prototype.instructionAfter=function(m,D){var M,X;return M=this.parent.children.indexOf(this),X=this.parent.children.splice(M+1),this.parent.instruction(m,D),Array.prototype.push.apply(this.parent.children,X),this},C.prototype.declaration=function(m,D,M){var X,q;return X=this.document(),q=new s(X,m,D,M),X.children.length===0?X.children.unshift(q):X.children[0].type===t.Declaration?X.children[0]=q:X.children.unshift(q),X.root()||X},C.prototype.dtd=function(m,D){var M,X,q,U,g,R,S,B,$,W;for(X=this.document(),q=new i(X,m,D),$=X.children,U=g=0,S=$.length;g<S;U=++g)if(M=$[U],M.type===t.DocType)return X.children[U]=q,q;for(W=X.children,U=R=0,B=W.length;R<B;U=++R)if(M=W[U],M.isRoot)return X.children.splice(U,0,q),q;return X.children.push(q),q},C.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},C.prototype.root=function(){var m;for(m=this;m;){if(m.type===t.Document)return m.rootObject;if(m.isRoot)return m;m=m.parent}},C.prototype.document=function(){var m;for(m=this;m;){if(m.type===t.Document)return m;m=m.parent}},C.prototype.end=function(m){return this.document().end(m)},C.prototype.prev=function(){var m;if(m=this.parent.children.indexOf(this),m<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[m-1]},C.prototype.next=function(){var m;if(m=this.parent.children.indexOf(this),m===-1||m===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[m+1]},C.prototype.importDocument=function(m){var D;return D=m.root().clone(),D.parent=this,D.isRoot=!1,this.children.push(D),this},C.prototype.debugInfo=function(m){var D,M;return m=m||this.name,m==null&&!((D=this.parent)!=null&&D.name)?"":m==null?"parent: <"+this.parent.name+">":(M=this.parent)!=null&&M.name?"node: <"+m+">, parent: <"+this.parent.name+">":"node: <"+m+">"},C.prototype.ele=function(m,D,M){return this.element(m,D,M)},C.prototype.nod=function(m,D,M){return this.node(m,D,M)},C.prototype.txt=function(m){return this.text(m)},C.prototype.dat=function(m){return this.cdata(m)},C.prototype.com=function(m){return this.comment(m)},C.prototype.ins=function(m,D){return this.instruction(m,D)},C.prototype.doc=function(){return this.document()},C.prototype.dec=function(m,D,M){return this.declaration(m,D,M)},C.prototype.e=function(m,D,M){return this.element(m,D,M)},C.prototype.n=function(m,D,M){return this.node(m,D,M)},C.prototype.t=function(m){return this.text(m)},C.prototype.d=function(m){return this.cdata(m)},C.prototype.c=function(m){return this.comment(m)},C.prototype.r=function(m){return this.raw(m)},C.prototype.i=function(m,D){return this.instruction(m,D)},C.prototype.u=function(){return this.up()},C.prototype.importXMLBuilder=function(m){return this.importDocument(m)},C.prototype.replaceChild=function(m,D){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.removeChild=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.appendChild=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.hasChildNodes=function(){return this.children.length!==0},C.prototype.cloneNode=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isSupported=function(m,D){return!0},C.prototype.hasAttributes=function(){return this.attribs.length!==0},C.prototype.compareDocumentPosition=function(m){var D,M;return D=this,D===m?0:this.document()!==m.document()?(M=a.Disconnected|a.ImplementationSpecific,Math.random()<.5?M|=a.Preceding:M|=a.Following,M):D.isAncestor(m)?a.Contains|a.Preceding:D.isDescendant(m)?a.Contains|a.Following:D.isPreceding(m)?a.Preceding:a.Following},C.prototype.isSameNode=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.lookupPrefix=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isDefaultNamespace=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.lookupNamespaceURI=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isEqualNode=function(m){var D,M,X;if(m.nodeType!==this.nodeType||m.children.length!==this.children.length)return!1;for(D=M=0,X=this.children.length-1;0<=X?M<=X:M>=X;D=0<=X?++M:--M)if(!this.children[D].isEqualNode(m.children[D]))return!1;return!0},C.prototype.getFeature=function(m,D){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.setUserData=function(m,D,M){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.getUserData=function(m){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.contains=function(m){return m?m===this||this.isDescendant(m):!1},C.prototype.isDescendant=function(m){var D,M,X,q,U;for(U=this.children,X=0,q=U.length;X<q;X++)if(D=U[X],m===D||(M=D.isDescendant(m),M))return!0;return!1},C.prototype.isAncestor=function(m){return m.isDescendant(this)},C.prototype.isPreceding=function(m){var D,M;return D=this.treePosition(m),M=this.treePosition(this),D===-1||M===-1?!1:D<M},C.prototype.isFollowing=function(m){var D,M;return D=this.treePosition(m),M=this.treePosition(this),D===-1||M===-1?!1:D>M},C.prototype.treePosition=function(m){var D,M;return M=0,D=!1,this.foreachTreeNode(this.document(),function(X){if(M++,!D&&X===m)return D=!0}),D?M:-1},C.prototype.foreachTreeNode=function(m,D){var M,X,q,U,g;for(m||(m=this.document()),U=m.children,X=0,q=U.length;X<q;X++){if(M=U[X],g=D(M))return g;if(g=this.foreachTreeNode(M,D),g)return g}},C}()}.call(it)),pn.exports}var Ln={exports:{}},Ii;function cs(){return Ii||(Ii=1,function(){var a=function(e,n){return function(){return e.apply(n,arguments)}},t={}.hasOwnProperty;Ln.exports=function(){function e(n){this.assertLegalName=a(this.assertLegalName,this),this.assertLegalChar=a(this.assertLegalChar,this);var s,i,r;n||(n={}),this.options=n,this.options.version||(this.options.version="1.0"),i=n.stringify||{};for(s in i)t.call(i,s)&&(r=i[s],this[s]=r)}return e.prototype.name=function(n){return this.options.noValidation?n:this.assertLegalName(""+n||"")},e.prototype.text=function(n){return this.options.noValidation?n:this.assertLegalChar(this.textEscape(""+n||""))},e.prototype.cdata=function(n){return this.options.noValidation?n:(n=""+n||"",n=n.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(n))},e.prototype.comment=function(n){if(this.options.noValidation)return n;if(n=""+n||"",n.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+n);return this.assertLegalChar(n)},e.prototype.raw=function(n){return this.options.noValidation?n:""+n||""},e.prototype.attValue=function(n){return this.options.noValidation?n:this.assertLegalChar(this.attEscape(n=""+n||""))},e.prototype.insTarget=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.insValue=function(n){if(this.options.noValidation)return n;if(n=""+n||"",n.match(/\?>/))throw new Error("Invalid processing instruction value: "+n);return this.assertLegalChar(n)},e.prototype.xmlVersion=function(n){if(this.options.noValidation)return n;if(n=""+n||"",!n.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+n);return n},e.prototype.xmlEncoding=function(n){if(this.options.noValidation)return n;if(n=""+n||"",!n.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+n);return this.assertLegalChar(n)},e.prototype.xmlStandalone=function(n){return this.options.noValidation?n:n?"yes":"no"},e.prototype.dtdPubID=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdSysID=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdElementValue=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdAttType=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdAttDefault=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdEntityValue=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.dtdNData=function(n){return this.options.noValidation?n:this.assertLegalChar(""+n||"")},e.prototype.convertAttKey="@",e.prototype.convertPIKey="?",e.prototype.convertTextKey="#text",e.prototype.convertCDataKey="#cdata",e.prototype.convertCommentKey="#comment",e.prototype.convertRawKey="#raw",e.prototype.assertLegalChar=function(n){var s,i;if(this.options.noValidation)return n;if(s="",this.options.version==="1.0"){if(s=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,i=n.match(s))throw new Error("Invalid character in string: "+n+" at index "+i.index)}else if(this.options.version==="1.1"&&(s=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,i=n.match(s)))throw new Error("Invalid character in string: "+n+" at index "+i.index);return n},e.prototype.assertLegalName=function(n){var s;if(this.options.noValidation)return n;if(this.assertLegalChar(n),s=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!n.match(s))throw new Error("Invalid character in name");return n},e.prototype.textEscape=function(n){var s;return this.options.noValidation?n:(s=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(s,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;"))},e.prototype.attEscape=function(n){var s;return this.options.noValidation?n:(s=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,n.replace(s,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;"))},e}()}.call(it)),Ln.exports}var Sn={exports:{}},Fn={exports:{}},jn={exports:{}},Ci;function We(){return Ci||(Ci=1,function(){jn.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}.call(it)),jn.exports}var Ti;function ls(){return Ti||(Ti=1,function(){var a,t,e,n={}.hasOwnProperty;e=Ht().assign,a=bt(),ir(),cr(),nr(),rr(),er(),lr(),fr(),hr(),us(),sr(),ar(),or(),ur(),t=We(),Fn.exports=function(){function s(i){var r,o,l;i||(i={}),this.options=i,o=i.writer||{};for(r in o)n.call(o,r)&&(l=o[r],this["_"+r]=this[r],this[r]=l)}return s.prototype.filterOptions=function(i){var r,o,l,E,p,d,b,w;return i||(i={}),i=e({},this.options,i),r={writer:this},r.pretty=i.pretty||!1,r.allowEmpty=i.allowEmpty||!1,r.indent=(o=i.indent)!=null?o:" ",r.newline=(l=i.newline)!=null?l:`
92
+ `,r.offset=(E=i.offset)!=null?E:0,r.dontPrettyTextNodes=(p=(d=i.dontPrettyTextNodes)!=null?d:i.dontprettytextnodes)!=null?p:0,r.spaceBeforeSlash=(b=(w=i.spaceBeforeSlash)!=null?w:i.spacebeforeslash)!=null?b:"",r.spaceBeforeSlash===!0&&(r.spaceBeforeSlash=" "),r.suppressPrettyCount=0,r.user={},r.state=t.None,r},s.prototype.indent=function(i,r,o){var l;return!r.pretty||r.suppressPrettyCount?"":r.pretty&&(l=(o||0)+r.offset+1,l>0)?new Array(l).join(r.indent):""},s.prototype.endline=function(i,r,o){return!r.pretty||r.suppressPrettyCount?"":r.newline},s.prototype.attribute=function(i,r,o){var l;return this.openAttribute(i,r,o),l=" "+i.name+'="'+i.value+'"',this.closeAttribute(i,r,o),l},s.prototype.cdata=function(i,r,o){var l;return this.openNode(i,r,o),r.state=t.OpenTag,l=this.indent(i,r,o)+"<![CDATA[",r.state=t.InsideTag,l+=i.value,r.state=t.CloseTag,l+="]]>"+this.endline(i,r,o),r.state=t.None,this.closeNode(i,r,o),l},s.prototype.comment=function(i,r,o){var l;return this.openNode(i,r,o),r.state=t.OpenTag,l=this.indent(i,r,o)+"<!-- ",r.state=t.InsideTag,l+=i.value,r.state=t.CloseTag,l+=" -->"+this.endline(i,r,o),r.state=t.None,this.closeNode(i,r,o),l},s.prototype.declaration=function(i,r,o){var l;return this.openNode(i,r,o),r.state=t.OpenTag,l=this.indent(i,r,o)+"<?xml",r.state=t.InsideTag,l+=' version="'+i.version+'"',i.encoding!=null&&(l+=' encoding="'+i.encoding+'"'),i.standalone!=null&&(l+=' standalone="'+i.standalone+'"'),r.state=t.CloseTag,l+=r.spaceBeforeSlash+"?>",l+=this.endline(i,r,o),r.state=t.None,this.closeNode(i,r,o),l},s.prototype.docType=function(i,r,o){var l,E,p,d,b;if(o||(o=0),this.openNode(i,r,o),r.state=t.OpenTag,d=this.indent(i,r,o),d+="<!DOCTYPE "+i.root().name,i.pubID&&i.sysID?d+=' PUBLIC "'+i.pubID+'" "'+i.sysID+'"':i.sysID&&(d+=' SYSTEM "'+i.sysID+'"'),i.children.length>0){for(d+=" [",d+=this.endline(i,r,o),r.state=t.InsideTag,b=i.children,E=0,p=b.length;E<p;E++)l=b[E],d+=this.writeChildNode(l,r,o+1);r.state=t.CloseTag,d+="]"}return r.state=t.CloseTag,d+=r.spaceBeforeSlash+">",d+=this.endline(i,r,o),r.state=t.None,this.closeNode(i,r,o),d},s.prototype.element=function(i,r,o){var l,E,p,d,b,w,T,_,I,v,C,m,D,M;o||(o=0),v=!1,C="",this.openNode(i,r,o),r.state=t.OpenTag,C+=this.indent(i,r,o)+"<"+i.name,m=i.attribs;for(I in m)n.call(m,I)&&(l=m[I],C+=this.attribute(l,r,o));if(p=i.children.length,d=p===0?null:i.children[0],p===0||i.children.every(function(X){return(X.type===a.Text||X.type===a.Raw)&&X.value===""}))r.allowEmpty?(C+=">",r.state=t.CloseTag,C+="</"+i.name+">"+this.endline(i,r,o)):(r.state=t.CloseTag,C+=r.spaceBeforeSlash+"/>"+this.endline(i,r,o));else if(r.pretty&&p===1&&(d.type===a.Text||d.type===a.Raw)&&d.value!=null)C+=">",r.state=t.InsideTag,r.suppressPrettyCount++,v=!0,C+=this.writeChildNode(d,r,o+1),r.suppressPrettyCount--,v=!1,r.state=t.CloseTag,C+="</"+i.name+">"+this.endline(i,r,o);else{if(r.dontPrettyTextNodes){for(D=i.children,b=0,T=D.length;b<T;b++)if(E=D[b],(E.type===a.Text||E.type===a.Raw)&&E.value!=null){r.suppressPrettyCount++,v=!0;break}}for(C+=">"+this.endline(i,r,o),r.state=t.InsideTag,M=i.children,w=0,_=M.length;w<_;w++)E=M[w],C+=this.writeChildNode(E,r,o+1);r.state=t.CloseTag,C+=this.indent(i,r,o)+"</"+i.name+">",v&&r.suppressPrettyCount--,C+=this.endline(i,r,o),r.state=t.None}return this.closeNode(i,r,o),C},s.prototype.writeChildNode=function(i,r,o){switch(i.type){case a.CData:return this.cdata(i,r,o);case a.Comment:return this.comment(i,r,o);case a.Element:return this.element(i,r,o);case a.Raw:return this.raw(i,r,o);case a.Text:return this.text(i,r,o);case a.ProcessingInstruction:return this.processingInstruction(i,r,o);case a.Dummy:return"";case a.Declaration:return this.declaration(i,r,o);case a.DocType:return this.docType(i,r,o);case a.AttributeDeclaration:return this.dtdAttList(i,r,o);case a.ElementDeclaration:return this.dtdElement(i,r,o);case a.EntityDeclaration:return this.dtdEntity(i,r,o);case a.NotationDeclaration:return this.dtdNotation(i,r,o);default:throw new Error("Unknown XML node type: "+i.constructor.name)}},s.prototype.processingInstruction=function(i,r,o){var l;return this.openNode(i,r,o),r.state=t.OpenTag,l=this.indent(i,r,o)+"<?",r.state=t.InsideTag,l+=i.target,i.value&&(l+=" "+i.value),r.state=t.CloseTag,l+=r.spaceBeforeSlash+"?>",l+=this.endline(i,r,o),r.state=t.None,this.closeNode(i,r,o),l},s.prototype.raw=function(i,r,o){var l;return this.openNode(i,r,o),r.state=t.OpenTag,l=this.indent(i,r,o),r.state=t.InsideTag,l+=i.value,r.state=t.CloseTag,l+=this.endline(i,r,o),r.state=t.None,this.closeNode(i,r,o),l},s.prototype.text=function(i,r,o){var l;return this.openNode(i,r,o),r.state=t.OpenTag,l=this.indent(i,r,o),r.state=t.InsideTag,l+=i.value,r.state=t.CloseTag,l+=this.endline(i,r,o),r.state=t.None,this.closeNode(i,r,o),l},s.prototype.dtdAttList=function(i,r,o){var l;return this.openNode(i,r,o),r.state=t.OpenTag,l=this.indent(i,r,o)+"<!ATTLIST",r.state=t.InsideTag,l+=" "+i.elementName+" "+i.attributeName+" "+i.attributeType,i.defaultValueType!=="#DEFAULT"&&(l+=" "+i.defaultValueType),i.defaultValue&&(l+=' "'+i.defaultValue+'"'),r.state=t.CloseTag,l+=r.spaceBeforeSlash+">"+this.endline(i,r,o),r.state=t.None,this.closeNode(i,r,o),l},s.prototype.dtdElement=function(i,r,o){var l;return this.openNode(i,r,o),r.state=t.OpenTag,l=this.indent(i,r,o)+"<!ELEMENT",r.state=t.InsideTag,l+=" "+i.name+" "+i.value,r.state=t.CloseTag,l+=r.spaceBeforeSlash+">"+this.endline(i,r,o),r.state=t.None,this.closeNode(i,r,o),l},s.prototype.dtdEntity=function(i,r,o){var l;return this.openNode(i,r,o),r.state=t.OpenTag,l=this.indent(i,r,o)+"<!ENTITY",r.state=t.InsideTag,i.pe&&(l+=" %"),l+=" "+i.name,i.value?l+=' "'+i.value+'"':(i.pubID&&i.sysID?l+=' PUBLIC "'+i.pubID+'" "'+i.sysID+'"':i.sysID&&(l+=' SYSTEM "'+i.sysID+'"'),i.nData&&(l+=" NDATA "+i.nData)),r.state=t.CloseTag,l+=r.spaceBeforeSlash+">"+this.endline(i,r,o),r.state=t.None,this.closeNode(i,r,o),l},s.prototype.dtdNotation=function(i,r,o){var l;return this.openNode(i,r,o),r.state=t.OpenTag,l=this.indent(i,r,o)+"<!NOTATION",r.state=t.InsideTag,l+=" "+i.name,i.pubID&&i.sysID?l+=' PUBLIC "'+i.pubID+'" "'+i.sysID+'"':i.pubID?l+=' PUBLIC "'+i.pubID+'"':i.sysID&&(l+=' SYSTEM "'+i.sysID+'"'),r.state=t.CloseTag,l+=r.spaceBeforeSlash+">"+this.endline(i,r,o),r.state=t.None,this.closeNode(i,r,o),l},s.prototype.openNode=function(i,r,o){},s.prototype.closeNode=function(i,r,o){},s.prototype.openAttribute=function(i,r,o){},s.prototype.closeAttribute=function(i,r,o){},s}()}.call(it)),Fn.exports}var vi;function pr(){return vi||(vi=1,function(){var a,t=function(n,s){for(var i in s)e.call(s,i)&&(n[i]=s[i]);function r(){this.constructor=n}return r.prototype=s.prototype,n.prototype=new r,n.__super__=s.prototype,n},e={}.hasOwnProperty;a=ls(),Sn.exports=function(n){t(s,n);function s(i){s.__super__.constructor.call(this,i)}return s.prototype.document=function(i,r){var o,l,E,p,d;for(r=this.filterOptions(r),p="",d=i.children,l=0,E=d.length;l<E;l++)o=d[l],p+=this.writeChildNode(o,r,0);return r.pretty&&p.slice(-r.newline.length)===r.newline&&(p=p.slice(0,-r.newline.length)),p},s}(a)}.call(it)),Sn.exports}var Di;function fs(){return Di||(Di=1,function(){var a,t,e,n,s,i,r,o=function(E,p){for(var d in p)l.call(p,d)&&(E[d]=p[d]);function b(){this.constructor=E}return b.prototype=p.prototype,E.prototype=new b,E.__super__=p.prototype,E},l={}.hasOwnProperty;r=Ht().isPlainObject,e=os(),t=Ro(),n=St(),a=bt(),i=cs(),s=pr(),cn.exports=function(E){o(p,E);function p(d){p.__super__.constructor.call(this,null),this.name="#document",this.type=a.Document,this.documentURI=null,this.domConfig=new t,d||(d={}),d.writer||(d.writer=new s),this.options=d,this.stringify=new i(d)}return Object.defineProperty(p.prototype,"implementation",{value:new e}),Object.defineProperty(p.prototype,"doctype",{get:function(){var d,b,w,T;for(T=this.children,b=0,w=T.length;b<w;b++)if(d=T[b],d.type===a.DocType)return d;return null}}),Object.defineProperty(p.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(p.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(p.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(p.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===a.Declaration?this.children[0].encoding:null}}),Object.defineProperty(p.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===a.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(p.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===a.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(p.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(p.prototype,"origin",{get:function(){return null}}),Object.defineProperty(p.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(p.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(p.prototype,"contentType",{get:function(){return null}}),p.prototype.end=function(d){var b;return b={},d?r(d)&&(b=d,d=this.options.writer):d=this.options.writer,d.document(this,d.filterOptions(b))},p.prototype.toString=function(d){return this.options.writer.document(this,this.options.writer.filterOptions(d))},p.prototype.createElement=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createTextNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createComment=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createCDATASection=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createProcessingInstruction=function(d,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createAttribute=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createEntityReference=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByTagName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.importNode=function(d,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createElementNS=function(d,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createAttributeNS=function(d,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByTagNameNS=function(d,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementById=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.adoptNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.renameNode=function(d,b,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByClassName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createEvent=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createNodeIterator=function(d,b,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createTreeWalker=function(d,b,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},p}(n)}.call(it)),cn.exports}var Rn={exports:{}},_i;function Xo(){return _i||(_i=1,function(){var a,t,e,n,s,i,r,o,l,E,p,d,b,w,T,_,I,v,C,m,D,M,X,q={}.hasOwnProperty;X=Ht(),D=X.isObject,m=X.isFunction,M=X.isPlainObject,C=X.getValue,a=bt(),d=fs(),b=er(),n=nr(),s=rr(),T=lr(),v=fr(),w=hr(),E=ir(),p=cr(),i=sr(),o=or(),r=ar(),l=ur(),e=as(),I=cs(),_=pr(),t=We(),Rn.exports=function(){function U(g,R,S){var B;this.name="?xml",this.type=a.Document,g||(g={}),B={},g.writer?M(g.writer)&&(B=g.writer,g.writer=new _):g.writer=new _,this.options=g,this.writer=g.writer,this.writerOptions=this.writer.filterOptions(B),this.stringify=new I(g),this.onDataCallback=R||function(){},this.onEndCallback=S||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return U.prototype.createChildNode=function(g){var R,S,B,$,W,Y,k,V;switch(g.type){case a.CData:this.cdata(g.value);break;case a.Comment:this.comment(g.value);break;case a.Element:B={},k=g.attribs;for(S in k)q.call(k,S)&&(R=k[S],B[S]=R.value);this.node(g.name,B);break;case a.Dummy:this.dummy();break;case a.Raw:this.raw(g.value);break;case a.Text:this.text(g.value);break;case a.ProcessingInstruction:this.instruction(g.target,g.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+g.constructor.name)}for(V=g.children,W=0,Y=V.length;W<Y;W++)$=V[W],this.createChildNode($),$.type===a.Element&&this.up();return this},U.prototype.dummy=function(){return this},U.prototype.node=function(g,R,S){var B;if(g==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(g));return this.openCurrent(),g=C(g),R==null&&(R={}),R=C(R),D(R)||(B=[R,S],S=B[0],R=B[1]),this.currentNode=new b(this,g,R),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,S!=null&&this.text(S),this},U.prototype.element=function(g,R,S){var B,$,W,Y,k,V;if(this.currentNode&&this.currentNode.type===a.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(g)||D(g)||m(g))for(Y=this.options.noValidation,this.options.noValidation=!0,V=new d(this.options).element("TEMP_ROOT"),V.element(g),this.options.noValidation=Y,k=V.children,$=0,W=k.length;$<W;$++)B=k[$],this.createChildNode(B),B.type===a.Element&&this.up();else this.node(g,R,S);return this},U.prototype.attribute=function(g,R){var S,B;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(g));if(g!=null&&(g=C(g)),D(g))for(S in g)q.call(g,S)&&(B=g[S],this.attribute(S,B));else m(R)&&(R=R.apply()),this.options.keepNullAttributes&&R==null?this.currentNode.attribs[g]=new e(this,g,""):R!=null&&(this.currentNode.attribs[g]=new e(this,g,R));return this},U.prototype.text=function(g){var R;return this.openCurrent(),R=new v(this,g),this.onData(this.writer.text(R,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},U.prototype.cdata=function(g){var R;return this.openCurrent(),R=new n(this,g),this.onData(this.writer.cdata(R,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},U.prototype.comment=function(g){var R;return this.openCurrent(),R=new s(this,g),this.onData(this.writer.comment(R,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},U.prototype.raw=function(g){var R;return this.openCurrent(),R=new T(this,g),this.onData(this.writer.raw(R,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},U.prototype.instruction=function(g,R){var S,B,$,W,Y;if(this.openCurrent(),g!=null&&(g=C(g)),R!=null&&(R=C(R)),Array.isArray(g))for(S=0,W=g.length;S<W;S++)B=g[S],this.instruction(B);else if(D(g))for(B in g)q.call(g,B)&&($=g[B],this.instruction(B,$));else m(R)&&(R=R.apply()),Y=new w(this,g,R),this.onData(this.writer.processingInstruction(Y,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},U.prototype.declaration=function(g,R,S){var B;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return B=new E(this,g,R,S),this.onData(this.writer.declaration(B,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},U.prototype.doctype=function(g,R,S){if(this.openCurrent(),g==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new p(this,R,S),this.currentNode.rootNodeName=g,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},U.prototype.dtdElement=function(g,R){var S;return this.openCurrent(),S=new r(this,g,R),this.onData(this.writer.dtdElement(S,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},U.prototype.attList=function(g,R,S,B,$){var W;return this.openCurrent(),W=new i(this,g,R,S,B,$),this.onData(this.writer.dtdAttList(W,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},U.prototype.entity=function(g,R){var S;return this.openCurrent(),S=new o(this,!1,g,R),this.onData(this.writer.dtdEntity(S,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},U.prototype.pEntity=function(g,R){var S;return this.openCurrent(),S=new o(this,!0,g,R),this.onData(this.writer.dtdEntity(S,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},U.prototype.notation=function(g,R){var S;return this.openCurrent(),S=new l(this,g,R),this.onData(this.writer.dtdNotation(S,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},U.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},U.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},U.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},U.prototype.openNode=function(g){var R,S,B,$;if(!g.isOpen){if(!this.root&&this.currentLevel===0&&g.type===a.Element&&(this.root=g),S="",g.type===a.Element){this.writerOptions.state=t.OpenTag,S=this.writer.indent(g,this.writerOptions,this.currentLevel)+"<"+g.name,$=g.attribs;for(B in $)q.call($,B)&&(R=$[B],S+=this.writer.attribute(R,this.writerOptions,this.currentLevel));S+=(g.children?">":"/>")+this.writer.endline(g,this.writerOptions,this.currentLevel),this.writerOptions.state=t.InsideTag}else this.writerOptions.state=t.OpenTag,S=this.writer.indent(g,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+g.rootNodeName,g.pubID&&g.sysID?S+=' PUBLIC "'+g.pubID+'" "'+g.sysID+'"':g.sysID&&(S+=' SYSTEM "'+g.sysID+'"'),g.children?(S+=" [",this.writerOptions.state=t.InsideTag):(this.writerOptions.state=t.CloseTag,S+=">"),S+=this.writer.endline(g,this.writerOptions,this.currentLevel);return this.onData(S,this.currentLevel),g.isOpen=!0}},U.prototype.closeNode=function(g){var R;if(!g.isClosed)return R="",this.writerOptions.state=t.CloseTag,g.type===a.Element?R=this.writer.indent(g,this.writerOptions,this.currentLevel)+"</"+g.name+">"+this.writer.endline(g,this.writerOptions,this.currentLevel):R=this.writer.indent(g,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(g,this.writerOptions,this.currentLevel),this.writerOptions.state=t.None,this.onData(R,this.currentLevel),g.isClosed=!0},U.prototype.onData=function(g,R){return this.documentStarted=!0,this.onDataCallback(g,R+1)},U.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},U.prototype.debugInfo=function(g){return g==null?"":"node: <"+g+">"},U.prototype.ele=function(){return this.element.apply(this,arguments)},U.prototype.nod=function(g,R,S){return this.node(g,R,S)},U.prototype.txt=function(g){return this.text(g)},U.prototype.dat=function(g){return this.cdata(g)},U.prototype.com=function(g){return this.comment(g)},U.prototype.ins=function(g,R){return this.instruction(g,R)},U.prototype.dec=function(g,R,S){return this.declaration(g,R,S)},U.prototype.dtd=function(g,R,S){return this.doctype(g,R,S)},U.prototype.e=function(g,R,S){return this.element(g,R,S)},U.prototype.n=function(g,R,S){return this.node(g,R,S)},U.prototype.t=function(g){return this.text(g)},U.prototype.d=function(g){return this.cdata(g)},U.prototype.c=function(g){return this.comment(g)},U.prototype.r=function(g){return this.raw(g)},U.prototype.i=function(g,R){return this.instruction(g,R)},U.prototype.att=function(){return this.currentNode&&this.currentNode.type===a.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},U.prototype.a=function(){return this.currentNode&&this.currentNode.type===a.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},U.prototype.ent=function(g,R){return this.entity(g,R)},U.prototype.pent=function(g,R){return this.pEntity(g,R)},U.prototype.not=function(g,R){return this.notation(g,R)},U}()}.call(it)),Rn.exports}var Bn={exports:{}},Ni;function $o(){return Ni||(Ni=1,function(){var a,t,e,n=function(i,r){for(var o in r)s.call(r,o)&&(i[o]=r[o]);function l(){this.constructor=i}return l.prototype=r.prototype,i.prototype=new l,i.__super__=r.prototype,i},s={}.hasOwnProperty;a=bt(),e=ls(),t=We(),Bn.exports=function(i){n(r,i);function r(o,l){this.stream=o,r.__super__.constructor.call(this,l)}return r.prototype.endline=function(o,l,E){return o.isLastRootNode&&l.state===t.CloseTag?"":r.__super__.endline.call(this,o,l,E)},r.prototype.document=function(o,l){var E,p,d,b,w,T,_,I,v;for(_=o.children,p=d=0,w=_.length;d<w;p=++d)E=_[p],E.isLastRootNode=p===o.children.length-1;for(l=this.filterOptions(l),I=o.children,v=[],b=0,T=I.length;b<T;b++)E=I[b],v.push(this.writeChildNode(E,l,0));return v},r.prototype.attribute=function(o,l,E){return this.stream.write(r.__super__.attribute.call(this,o,l,E))},r.prototype.cdata=function(o,l,E){return this.stream.write(r.__super__.cdata.call(this,o,l,E))},r.prototype.comment=function(o,l,E){return this.stream.write(r.__super__.comment.call(this,o,l,E))},r.prototype.declaration=function(o,l,E){return this.stream.write(r.__super__.declaration.call(this,o,l,E))},r.prototype.docType=function(o,l,E){var p,d,b,w;if(E||(E=0),this.openNode(o,l,E),l.state=t.OpenTag,this.stream.write(this.indent(o,l,E)),this.stream.write("<!DOCTYPE "+o.root().name),o.pubID&&o.sysID?this.stream.write(' PUBLIC "'+o.pubID+'" "'+o.sysID+'"'):o.sysID&&this.stream.write(' SYSTEM "'+o.sysID+'"'),o.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(o,l,E)),l.state=t.InsideTag,w=o.children,d=0,b=w.length;d<b;d++)p=w[d],this.writeChildNode(p,l,E+1);l.state=t.CloseTag,this.stream.write("]")}return l.state=t.CloseTag,this.stream.write(l.spaceBeforeSlash+">"),this.stream.write(this.endline(o,l,E)),l.state=t.None,this.closeNode(o,l,E)},r.prototype.element=function(o,l,E){var p,d,b,w,T,_,I,v,C;E||(E=0),this.openNode(o,l,E),l.state=t.OpenTag,this.stream.write(this.indent(o,l,E)+"<"+o.name),v=o.attribs;for(I in v)s.call(v,I)&&(p=v[I],this.attribute(p,l,E));if(b=o.children.length,w=b===0?null:o.children[0],b===0||o.children.every(function(m){return(m.type===a.Text||m.type===a.Raw)&&m.value===""}))l.allowEmpty?(this.stream.write(">"),l.state=t.CloseTag,this.stream.write("</"+o.name+">")):(l.state=t.CloseTag,this.stream.write(l.spaceBeforeSlash+"/>"));else if(l.pretty&&b===1&&(w.type===a.Text||w.type===a.Raw)&&w.value!=null)this.stream.write(">"),l.state=t.InsideTag,l.suppressPrettyCount++,this.writeChildNode(w,l,E+1),l.suppressPrettyCount--,l.state=t.CloseTag,this.stream.write("</"+o.name+">");else{for(this.stream.write(">"+this.endline(o,l,E)),l.state=t.InsideTag,C=o.children,T=0,_=C.length;T<_;T++)d=C[T],this.writeChildNode(d,l,E+1);l.state=t.CloseTag,this.stream.write(this.indent(o,l,E)+"</"+o.name+">")}return this.stream.write(this.endline(o,l,E)),l.state=t.None,this.closeNode(o,l,E)},r.prototype.processingInstruction=function(o,l,E){return this.stream.write(r.__super__.processingInstruction.call(this,o,l,E))},r.prototype.raw=function(o,l,E){return this.stream.write(r.__super__.raw.call(this,o,l,E))},r.prototype.text=function(o,l,E){return this.stream.write(r.__super__.text.call(this,o,l,E))},r.prototype.dtdAttList=function(o,l,E){return this.stream.write(r.__super__.dtdAttList.call(this,o,l,E))},r.prototype.dtdElement=function(o,l,E){return this.stream.write(r.__super__.dtdElement.call(this,o,l,E))},r.prototype.dtdEntity=function(o,l,E){return this.stream.write(r.__super__.dtdEntity.call(this,o,l,E))},r.prototype.dtdNotation=function(o,l,E){return this.stream.write(r.__super__.dtdNotation.call(this,o,l,E))},r}(e)}.call(it)),Bn.exports}var Ai;function qo(){return Ai||(Ai=1,function(){var a,t,e,n,s,i,r,o,l,E;E=Ht(),o=E.assign,l=E.isFunction,e=os(),n=fs(),s=Xo(),r=pr(),i=$o(),a=bt(),t=We(),Wt.create=function(p,d,b,w){var T,_;if(p==null)throw new Error("Root element needs a name.");return w=o({},d,b,w),T=new n(w),_=T.element(p),w.headless||(T.declaration(w),(w.pubID!=null||w.sysID!=null)&&T.dtd(w)),_},Wt.begin=function(p,d,b){var w;return l(p)&&(w=[p,d],d=w[0],b=w[1],p={}),d?new s(p,d,b):new n(p)},Wt.stringWriter=function(p){return new r(p)},Wt.streamWriter=function(p,d){return new i(p,d)},Wt.implementation=new e,Wt.nodeType=a,Wt.writerState=t}.call(it)),Wt}var Mi;function Wo(){return Mi||(Mi=1,function(){var a,t,e,n,s,i={}.hasOwnProperty;a=qo(),t=Zn().defaults,n=function(r){return typeof r=="string"&&(r.indexOf("&")>=0||r.indexOf(">")>=0||r.indexOf("<")>=0)},s=function(r){return"<![CDATA["+e(r)+"]]>"},e=function(r){return r.replace("]]>","]]]]><![CDATA[>")},an.Builder=function(){function r(o){var l,E,p;this.options={},E=t["0.2"];for(l in E)i.call(E,l)&&(p=E[l],this.options[l]=p);for(l in o)i.call(o,l)&&(p=o[l],this.options[l]=p)}return r.prototype.buildObject=function(o){var l,E,p,d,b;return l=this.options.attrkey,E=this.options.charkey,Object.keys(o).length===1&&this.options.rootName===t["0.2"].rootName?(b=Object.keys(o)[0],o=o[b]):b=this.options.rootName,p=function(w){return function(T,_){var I,v,C,m,D,M;if(typeof _!="object")w.options.cdata&&n(_)?T.raw(s(_)):T.txt(_);else if(Array.isArray(_)){for(m in _)if(i.call(_,m)){v=_[m];for(D in v)C=v[D],T=p(T.ele(D),C).up()}}else for(D in _)if(i.call(_,D))if(v=_[D],D===l){if(typeof v=="object")for(I in v)M=v[I],T=T.att(I,M)}else if(D===E)w.options.cdata&&n(v)?T=T.raw(s(v)):T=T.txt(v);else if(Array.isArray(v))for(m in v)i.call(v,m)&&(C=v[m],typeof C=="string"?w.options.cdata&&n(C)?T=T.ele(D).raw(s(C)).up():T=T.ele(D,C).up():T=p(T.ele(D),C).up());else typeof v=="object"?T=p(T.ele(D),v).up():typeof v=="string"&&w.options.cdata&&n(v)?T=T.ele(D).raw(s(v)).up():(v==null&&(v=""),T=T.ele(D,v.toString()).up());return T}}(this),d=a.create(b,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),p(d,o).end(this.options.renderOpts)},r}()}.call(it)),an}var Un={},Xn={},$n={},Fe={exports:{}},qn={},de={},Pi;function Vo(){if(Pi)return de;Pi=1,de.byteLength=o,de.toByteArray=E,de.fromByteArray=b;for(var a=[],t=[],e=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,i=n.length;s<i;++s)a[s]=n[s],t[n.charCodeAt(s)]=s;t[45]=62,t[95]=63;function r(w){var T=w.length;if(T%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var _=w.indexOf("=");_===-1&&(_=T);var I=_===T?0:4-_%4;return[_,I]}function o(w){var T=r(w),_=T[0],I=T[1];return(_+I)*3/4-I}function l(w,T,_){return(T+_)*3/4-_}function E(w){var T,_=r(w),I=_[0],v=_[1],C=new e(l(w,I,v)),m=0,D=v>0?I-4:I,M;for(M=0;M<D;M+=4)T=t[w.charCodeAt(M)]<<18|t[w.charCodeAt(M+1)]<<12|t[w.charCodeAt(M+2)]<<6|t[w.charCodeAt(M+3)],C[m++]=T>>16&255,C[m++]=T>>8&255,C[m++]=T&255;return v===2&&(T=t[w.charCodeAt(M)]<<2|t[w.charCodeAt(M+1)]>>4,C[m++]=T&255),v===1&&(T=t[w.charCodeAt(M)]<<10|t[w.charCodeAt(M+1)]<<4|t[w.charCodeAt(M+2)]>>2,C[m++]=T>>8&255,C[m++]=T&255),C}function p(w){return a[w>>18&63]+a[w>>12&63]+a[w>>6&63]+a[w&63]}function d(w,T,_){for(var I,v=[],C=T;C<_;C+=3)I=(w[C]<<16&16711680)+(w[C+1]<<8&65280)+(w[C+2]&255),v.push(p(I));return v.join("")}function b(w){for(var T,_=w.length,I=_%3,v=[],C=16383,m=0,D=_-I;m<D;m+=C)v.push(d(w,m,m+C>D?D:m+C));return I===1?(T=w[_-1],v.push(a[T>>2]+a[T<<4&63]+"==")):I===2&&(T=(w[_-2]<<8)+w[_-1],v.push(a[T>>10]+a[T>>4&63]+a[T<<2&63]+"=")),v.join("")}return de}var je={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Li;function Ho(){return Li||(Li=1,je.read=function(a,t,e,n,s){var i,r,o=s*8-n-1,l=(1<<o)-1,E=l>>1,p=-7,d=e?s-1:0,b=e?-1:1,w=a[t+d];for(d+=b,i=w&(1<<-p)-1,w>>=-p,p+=o;p>0;i=i*256+a[t+d],d+=b,p-=8);for(r=i&(1<<-p)-1,i>>=-p,p+=n;p>0;r=r*256+a[t+d],d+=b,p-=8);if(i===0)i=1-E;else{if(i===l)return r?NaN:(w?-1:1)*(1/0);r=r+Math.pow(2,n),i=i-E}return(w?-1:1)*r*Math.pow(2,i-n)},je.write=function(a,t,e,n,s,i){var r,o,l,E=i*8-s-1,p=(1<<E)-1,d=p>>1,b=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=n?0:i-1,T=n?1:-1,_=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,r=p):(r=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-r))<1&&(r--,l*=2),r+d>=1?t+=b/l:t+=b*Math.pow(2,1-d),t*l>=2&&(r++,l/=2),r+d>=p?(o=0,r=p):r+d>=1?(o=(t*l-1)*Math.pow(2,s),r=r+d):(o=t*Math.pow(2,d-1)*Math.pow(2,s),r=0));s>=8;a[e+w]=o&255,w+=T,o/=256,s-=8);for(r=r<<s|o,E+=s;E>0;a[e+w]=r&255,w+=T,r/=256,E-=8);a[e+w-T]|=_*128}),je}/*!
93
+ * The buffer module from node.js, for the browser.
94
+ *
95
+ * @author Feross Aboukhadijeh <https://feross.org>
96
+ * @license MIT
97
+ */var Si;function zo(){return Si||(Si=1,function(a){var t=Vo(),e=Ho(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;a.Buffer=o,a.SlowBuffer=C,a.INSPECT_MAX_BYTES=50;var s=2147483647;a.kMaxLength=s,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{var f=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(f,u),f.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function r(f){if(f>s)throw new RangeError('The value "'+f+'" is invalid for option "size"');var u=new Uint8Array(f);return Object.setPrototypeOf(u,o.prototype),u}function o(f,u,c){if(typeof f=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(f)}return l(f,u,c)}o.poolSize=8192;function l(f,u,c){if(typeof f=="string")return b(f,u);if(ArrayBuffer.isView(f))return T(f);if(f==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f);if(rt(f,ArrayBuffer)||f&&rt(f.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(rt(f,SharedArrayBuffer)||f&&rt(f.buffer,SharedArrayBuffer)))return _(f,u,c);if(typeof f=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var h=f.valueOf&&f.valueOf();if(h!=null&&h!==f)return o.from(h,u,c);var N=I(f);if(N)return N;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof f[Symbol.toPrimitive]=="function")return o.from(f[Symbol.toPrimitive]("string"),u,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f)}o.from=function(f,u,c){return l(f,u,c)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function E(f){if(typeof f!="number")throw new TypeError('"size" argument must be of type number');if(f<0)throw new RangeError('The value "'+f+'" is invalid for option "size"')}function p(f,u,c){return E(f),f<=0?r(f):u!==void 0?typeof c=="string"?r(f).fill(u,c):r(f).fill(u):r(f)}o.alloc=function(f,u,c){return p(f,u,c)};function d(f){return E(f),r(f<0?0:v(f)|0)}o.allocUnsafe=function(f){return d(f)},o.allocUnsafeSlow=function(f){return d(f)};function b(f,u){if((typeof u!="string"||u==="")&&(u="utf8"),!o.isEncoding(u))throw new TypeError("Unknown encoding: "+u);var c=m(f,u)|0,h=r(c),N=h.write(f,u);return N!==c&&(h=h.slice(0,N)),h}function w(f){for(var u=f.length<0?0:v(f.length)|0,c=r(u),h=0;h<u;h+=1)c[h]=f[h]&255;return c}function T(f){if(rt(f,Uint8Array)){var u=new Uint8Array(f);return _(u.buffer,u.byteOffset,u.byteLength)}return w(f)}function _(f,u,c){if(u<0||f.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(f.byteLength<u+(c||0))throw new RangeError('"length" is outside of buffer bounds');var h;return u===void 0&&c===void 0?h=new Uint8Array(f):c===void 0?h=new Uint8Array(f,u):h=new Uint8Array(f,u,c),Object.setPrototypeOf(h,o.prototype),h}function I(f){if(o.isBuffer(f)){var u=v(f.length)|0,c=r(u);return c.length===0||f.copy(c,0,0,u),c}if(f.length!==void 0)return typeof f.length!="number"||ht(f.length)?r(0):w(f);if(f.type==="Buffer"&&Array.isArray(f.data))return w(f.data)}function v(f){if(f>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return f|0}function C(f){return+f!=f&&(f=0),o.alloc(+f)}o.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==o.prototype},o.compare=function(u,c){if(rt(u,Uint8Array)&&(u=o.from(u,u.offset,u.byteLength)),rt(c,Uint8Array)&&(c=o.from(c,c.offset,c.byteLength)),!o.isBuffer(u)||!o.isBuffer(c))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===c)return 0;for(var h=u.length,N=c.length,L=0,F=Math.min(h,N);L<F;++L)if(u[L]!==c[L]){h=u[L],N=c[L];break}return h<N?-1:N<h?1:0},o.isEncoding=function(u){switch(String(u).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(u,c){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return o.alloc(0);var h;if(c===void 0)for(c=0,h=0;h<u.length;++h)c+=u[h].length;var N=o.allocUnsafe(c),L=0;for(h=0;h<u.length;++h){var F=u[h];if(rt(F,Uint8Array))L+F.length>N.length?o.from(F).copy(N,L):Uint8Array.prototype.set.call(N,F,L);else if(o.isBuffer(F))F.copy(N,L);else throw new TypeError('"list" argument must be an Array of Buffers');L+=F.length}return N};function m(f,u){if(o.isBuffer(f))return f.length;if(ArrayBuffer.isView(f)||rt(f,ArrayBuffer))return f.byteLength;if(typeof f!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof f);var c=f.length,h=arguments.length>2&&arguments[2]===!0;if(!h&&c===0)return 0;for(var N=!1;;)switch(u){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return y(f).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c*2;case"hex":return c>>>1;case"base64":return J(f).length;default:if(N)return h?-1:y(f).length;u=(""+u).toLowerCase(),N=!0}}o.byteLength=m;function D(f,u,c){var h=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((c===void 0||c>this.length)&&(c=this.length),c<=0)||(c>>>=0,u>>>=0,c<=u))return"";for(f||(f="utf8");;)switch(f){case"hex":return It(this,u,c);case"utf8":case"utf-8":return W(this,u,c);case"ascii":return V(this,u,c);case"latin1":case"binary":return ft(this,u,c);case"base64":return $(this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return at(this,u,c);default:if(h)throw new TypeError("Unknown encoding: "+f);f=(f+"").toLowerCase(),h=!0}}o.prototype._isBuffer=!0;function M(f,u,c){var h=f[u];f[u]=f[c],f[c]=h}o.prototype.swap16=function(){var u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var c=0;c<u;c+=2)M(this,c,c+1);return this},o.prototype.swap32=function(){var u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var c=0;c<u;c+=4)M(this,c,c+3),M(this,c+1,c+2);return this},o.prototype.swap64=function(){var u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var c=0;c<u;c+=8)M(this,c,c+7),M(this,c+1,c+6),M(this,c+2,c+5),M(this,c+3,c+4);return this},o.prototype.toString=function(){var u=this.length;return u===0?"":arguments.length===0?W(this,0,u):D.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(u){if(!o.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:o.compare(this,u)===0},o.prototype.inspect=function(){var u="",c=a.INSPECT_MAX_BYTES;return u=this.toString("hex",0,c).replace(/(.{2})/g,"$1 ").trim(),this.length>c&&(u+=" ... "),"<Buffer "+u+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(u,c,h,N,L){if(rt(u,Uint8Array)&&(u=o.from(u,u.offset,u.byteLength)),!o.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(c===void 0&&(c=0),h===void 0&&(h=u?u.length:0),N===void 0&&(N=0),L===void 0&&(L=this.length),c<0||h>u.length||N<0||L>this.length)throw new RangeError("out of range index");if(N>=L&&c>=h)return 0;if(N>=L)return-1;if(c>=h)return 1;if(c>>>=0,h>>>=0,N>>>=0,L>>>=0,this===u)return 0;for(var F=L-N,Z=h-c,nt=Math.min(F,Z),lt=this.slice(N,L),Et=u.slice(c,h),pt=0;pt<nt;++pt)if(lt[pt]!==Et[pt]){F=lt[pt],Z=Et[pt];break}return F<Z?-1:Z<F?1:0};function X(f,u,c,h,N){if(f.length===0)return-1;if(typeof c=="string"?(h=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,ht(c)&&(c=N?0:f.length-1),c<0&&(c=f.length+c),c>=f.length){if(N)return-1;c=f.length-1}else if(c<0)if(N)c=0;else return-1;if(typeof u=="string"&&(u=o.from(u,h)),o.isBuffer(u))return u.length===0?-1:q(f,u,c,h,N);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?N?Uint8Array.prototype.indexOf.call(f,u,c):Uint8Array.prototype.lastIndexOf.call(f,u,c):q(f,[u],c,h,N);throw new TypeError("val must be string, number or Buffer")}function q(f,u,c,h,N){var L=1,F=f.length,Z=u.length;if(h!==void 0&&(h=String(h).toLowerCase(),h==="ucs2"||h==="ucs-2"||h==="utf16le"||h==="utf-16le")){if(f.length<2||u.length<2)return-1;L=2,F/=2,Z/=2,c/=2}function nt(dr,mr){return L===1?dr[mr]:dr.readUInt16BE(mr*L)}var lt;if(N){var Et=-1;for(lt=c;lt<F;lt++)if(nt(f,lt)===nt(u,Et===-1?0:lt-Et)){if(Et===-1&&(Et=lt),lt-Et+1===Z)return Et*L}else Et!==-1&&(lt-=lt-Et),Et=-1}else for(c+Z>F&&(c=F-Z),lt=c;lt>=0;lt--){for(var pt=!0,Ce=0;Ce<Z;Ce++)if(nt(f,lt+Ce)!==nt(u,Ce)){pt=!1;break}if(pt)return lt}return-1}o.prototype.includes=function(u,c,h){return this.indexOf(u,c,h)!==-1},o.prototype.indexOf=function(u,c,h){return X(this,u,c,h,!0)},o.prototype.lastIndexOf=function(u,c,h){return X(this,u,c,h,!1)};function U(f,u,c,h){c=Number(c)||0;var N=f.length-c;h?(h=Number(h),h>N&&(h=N)):h=N;var L=u.length;h>L/2&&(h=L/2);for(var F=0;F<h;++F){var Z=parseInt(u.substr(F*2,2),16);if(ht(Z))return F;f[c+F]=Z}return F}function g(f,u,c,h){return ot(y(u,f.length-c),f,c,h)}function R(f,u,c,h){return ot(j(u),f,c,h)}function S(f,u,c,h){return ot(J(u),f,c,h)}function B(f,u,c,h){return ot(P(u,f.length-c),f,c,h)}o.prototype.write=function(u,c,h,N){if(c===void 0)N="utf8",h=this.length,c=0;else if(h===void 0&&typeof c=="string")N=c,h=this.length,c=0;else if(isFinite(c))c=c>>>0,isFinite(h)?(h=h>>>0,N===void 0&&(N="utf8")):(N=h,h=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var L=this.length-c;if((h===void 0||h>L)&&(h=L),u.length>0&&(h<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");N||(N="utf8");for(var F=!1;;)switch(N){case"hex":return U(this,u,c,h);case"utf8":case"utf-8":return g(this,u,c,h);case"ascii":case"latin1":case"binary":return R(this,u,c,h);case"base64":return S(this,u,c,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,u,c,h);default:if(F)throw new TypeError("Unknown encoding: "+N);N=(""+N).toLowerCase(),F=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(f,u,c){return u===0&&c===f.length?t.fromByteArray(f):t.fromByteArray(f.slice(u,c))}function W(f,u,c){c=Math.min(f.length,c);for(var h=[],N=u;N<c;){var L=f[N],F=null,Z=L>239?4:L>223?3:L>191?2:1;if(N+Z<=c){var nt,lt,Et,pt;switch(Z){case 1:L<128&&(F=L);break;case 2:nt=f[N+1],(nt&192)===128&&(pt=(L&31)<<6|nt&63,pt>127&&(F=pt));break;case 3:nt=f[N+1],lt=f[N+2],(nt&192)===128&&(lt&192)===128&&(pt=(L&15)<<12|(nt&63)<<6|lt&63,pt>2047&&(pt<55296||pt>57343)&&(F=pt));break;case 4:nt=f[N+1],lt=f[N+2],Et=f[N+3],(nt&192)===128&&(lt&192)===128&&(Et&192)===128&&(pt=(L&15)<<18|(nt&63)<<12|(lt&63)<<6|Et&63,pt>65535&&pt<1114112&&(F=pt))}}F===null?(F=65533,Z=1):F>65535&&(F-=65536,h.push(F>>>10&1023|55296),F=56320|F&1023),h.push(F),N+=Z}return k(h)}var Y=4096;function k(f){var u=f.length;if(u<=Y)return String.fromCharCode.apply(String,f);for(var c="",h=0;h<u;)c+=String.fromCharCode.apply(String,f.slice(h,h+=Y));return c}function V(f,u,c){var h="";c=Math.min(f.length,c);for(var N=u;N<c;++N)h+=String.fromCharCode(f[N]&127);return h}function ft(f,u,c){var h="";c=Math.min(f.length,c);for(var N=u;N<c;++N)h+=String.fromCharCode(f[N]);return h}function It(f,u,c){var h=f.length;(!u||u<0)&&(u=0),(!c||c<0||c>h)&&(c=h);for(var N="",L=u;L<c;++L)N+=A[f[L]];return N}function at(f,u,c){for(var h=f.slice(u,c),N="",L=0;L<h.length-1;L+=2)N+=String.fromCharCode(h[L]+h[L+1]*256);return N}o.prototype.slice=function(u,c){var h=this.length;u=~~u,c=c===void 0?h:~~c,u<0?(u+=h,u<0&&(u=0)):u>h&&(u=h),c<0?(c+=h,c<0&&(c=0)):c>h&&(c=h),c<u&&(c=u);var N=this.subarray(u,c);return Object.setPrototypeOf(N,o.prototype),N};function st(f,u,c){if(f%1!==0||f<0)throw new RangeError("offset is not uint");if(f+u>c)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(u,c,h){u=u>>>0,c=c>>>0,h||st(u,c,this.length);for(var N=this[u],L=1,F=0;++F<c&&(L*=256);)N+=this[u+F]*L;return N},o.prototype.readUintBE=o.prototype.readUIntBE=function(u,c,h){u=u>>>0,c=c>>>0,h||st(u,c,this.length);for(var N=this[u+--c],L=1;c>0&&(L*=256);)N+=this[u+--c]*L;return N},o.prototype.readUint8=o.prototype.readUInt8=function(u,c){return u=u>>>0,c||st(u,1,this.length),this[u]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(u,c){return u=u>>>0,c||st(u,2,this.length),this[u]|this[u+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(u,c){return u=u>>>0,c||st(u,2,this.length),this[u]<<8|this[u+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(u,c){return u=u>>>0,c||st(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(u,c){return u=u>>>0,c||st(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},o.prototype.readIntLE=function(u,c,h){u=u>>>0,c=c>>>0,h||st(u,c,this.length);for(var N=this[u],L=1,F=0;++F<c&&(L*=256);)N+=this[u+F]*L;return L*=128,N>=L&&(N-=Math.pow(2,8*c)),N},o.prototype.readIntBE=function(u,c,h){u=u>>>0,c=c>>>0,h||st(u,c,this.length);for(var N=c,L=1,F=this[u+--N];N>0&&(L*=256);)F+=this[u+--N]*L;return L*=128,F>=L&&(F-=Math.pow(2,8*c)),F},o.prototype.readInt8=function(u,c){return u=u>>>0,c||st(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},o.prototype.readInt16LE=function(u,c){u=u>>>0,c||st(u,2,this.length);var h=this[u]|this[u+1]<<8;return h&32768?h|4294901760:h},o.prototype.readInt16BE=function(u,c){u=u>>>0,c||st(u,2,this.length);var h=this[u+1]|this[u]<<8;return h&32768?h|4294901760:h},o.prototype.readInt32LE=function(u,c){return u=u>>>0,c||st(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},o.prototype.readInt32BE=function(u,c){return u=u>>>0,c||st(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},o.prototype.readFloatLE=function(u,c){return u=u>>>0,c||st(u,4,this.length),e.read(this,u,!0,23,4)},o.prototype.readFloatBE=function(u,c){return u=u>>>0,c||st(u,4,this.length),e.read(this,u,!1,23,4)},o.prototype.readDoubleLE=function(u,c){return u=u>>>0,c||st(u,8,this.length),e.read(this,u,!0,52,8)},o.prototype.readDoubleBE=function(u,c){return u=u>>>0,c||st(u,8,this.length),e.read(this,u,!1,52,8)};function ut(f,u,c,h,N,L){if(!o.isBuffer(f))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>N||u<L)throw new RangeError('"value" argument is out of bounds');if(c+h>f.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(u,c,h,N){if(u=+u,c=c>>>0,h=h>>>0,!N){var L=Math.pow(2,8*h)-1;ut(this,u,c,h,L,0)}var F=1,Z=0;for(this[c]=u&255;++Z<h&&(F*=256);)this[c+Z]=u/F&255;return c+h},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(u,c,h,N){if(u=+u,c=c>>>0,h=h>>>0,!N){var L=Math.pow(2,8*h)-1;ut(this,u,c,h,L,0)}var F=h-1,Z=1;for(this[c+F]=u&255;--F>=0&&(Z*=256);)this[c+F]=u/Z&255;return c+h},o.prototype.writeUint8=o.prototype.writeUInt8=function(u,c,h){return u=+u,c=c>>>0,h||ut(this,u,c,1,255,0),this[c]=u&255,c+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(u,c,h){return u=+u,c=c>>>0,h||ut(this,u,c,2,65535,0),this[c]=u&255,this[c+1]=u>>>8,c+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(u,c,h){return u=+u,c=c>>>0,h||ut(this,u,c,2,65535,0),this[c]=u>>>8,this[c+1]=u&255,c+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(u,c,h){return u=+u,c=c>>>0,h||ut(this,u,c,4,4294967295,0),this[c+3]=u>>>24,this[c+2]=u>>>16,this[c+1]=u>>>8,this[c]=u&255,c+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(u,c,h){return u=+u,c=c>>>0,h||ut(this,u,c,4,4294967295,0),this[c]=u>>>24,this[c+1]=u>>>16,this[c+2]=u>>>8,this[c+3]=u&255,c+4},o.prototype.writeIntLE=function(u,c,h,N){if(u=+u,c=c>>>0,!N){var L=Math.pow(2,8*h-1);ut(this,u,c,h,L-1,-L)}var F=0,Z=1,nt=0;for(this[c]=u&255;++F<h&&(Z*=256);)u<0&&nt===0&&this[c+F-1]!==0&&(nt=1),this[c+F]=(u/Z>>0)-nt&255;return c+h},o.prototype.writeIntBE=function(u,c,h,N){if(u=+u,c=c>>>0,!N){var L=Math.pow(2,8*h-1);ut(this,u,c,h,L-1,-L)}var F=h-1,Z=1,nt=0;for(this[c+F]=u&255;--F>=0&&(Z*=256);)u<0&&nt===0&&this[c+F+1]!==0&&(nt=1),this[c+F]=(u/Z>>0)-nt&255;return c+h},o.prototype.writeInt8=function(u,c,h){return u=+u,c=c>>>0,h||ut(this,u,c,1,127,-128),u<0&&(u=255+u+1),this[c]=u&255,c+1},o.prototype.writeInt16LE=function(u,c,h){return u=+u,c=c>>>0,h||ut(this,u,c,2,32767,-32768),this[c]=u&255,this[c+1]=u>>>8,c+2},o.prototype.writeInt16BE=function(u,c,h){return u=+u,c=c>>>0,h||ut(this,u,c,2,32767,-32768),this[c]=u>>>8,this[c+1]=u&255,c+2},o.prototype.writeInt32LE=function(u,c,h){return u=+u,c=c>>>0,h||ut(this,u,c,4,2147483647,-2147483648),this[c]=u&255,this[c+1]=u>>>8,this[c+2]=u>>>16,this[c+3]=u>>>24,c+4},o.prototype.writeInt32BE=function(u,c,h){return u=+u,c=c>>>0,h||ut(this,u,c,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[c]=u>>>24,this[c+1]=u>>>16,this[c+2]=u>>>8,this[c+3]=u&255,c+4};function _t(f,u,c,h,N,L){if(c+h>f.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function K(f,u,c,h,N){return u=+u,c=c>>>0,N||_t(f,u,c,4),e.write(f,u,c,h,23,4),c+4}o.prototype.writeFloatLE=function(u,c,h){return K(this,u,c,!0,h)},o.prototype.writeFloatBE=function(u,c,h){return K(this,u,c,!1,h)};function $t(f,u,c,h,N){return u=+u,c=c>>>0,N||_t(f,u,c,8),e.write(f,u,c,h,52,8),c+8}o.prototype.writeDoubleLE=function(u,c,h){return $t(this,u,c,!0,h)},o.prototype.writeDoubleBE=function(u,c,h){return $t(this,u,c,!1,h)},o.prototype.copy=function(u,c,h,N){if(!o.isBuffer(u))throw new TypeError("argument should be a Buffer");if(h||(h=0),!N&&N!==0&&(N=this.length),c>=u.length&&(c=u.length),c||(c=0),N>0&&N<h&&(N=h),N===h||u.length===0||this.length===0)return 0;if(c<0)throw new RangeError("targetStart out of bounds");if(h<0||h>=this.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("sourceEnd out of bounds");N>this.length&&(N=this.length),u.length-c<N-h&&(N=u.length-c+h);var L=N-h;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(c,h,N):Uint8Array.prototype.set.call(u,this.subarray(h,N),c),L},o.prototype.fill=function(u,c,h,N){if(typeof u=="string"){if(typeof c=="string"?(N=c,c=0,h=this.length):typeof h=="string"&&(N=h,h=this.length),N!==void 0&&typeof N!="string")throw new TypeError("encoding must be a string");if(typeof N=="string"&&!o.isEncoding(N))throw new TypeError("Unknown encoding: "+N);if(u.length===1){var L=u.charCodeAt(0);(N==="utf8"&&L<128||N==="latin1")&&(u=L)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(c<0||this.length<c||this.length<h)throw new RangeError("Out of range index");if(h<=c)return this;c=c>>>0,h=h===void 0?this.length:h>>>0,u||(u=0);var F;if(typeof u=="number")for(F=c;F<h;++F)this[F]=u;else{var Z=o.isBuffer(u)?u:o.from(u,N),nt=Z.length;if(nt===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(F=0;F<h-c;++F)this[F+c]=Z[F%nt]}return this};var Q=/[^+/0-9A-Za-z-_]/g;function x(f){if(f=f.split("=")[0],f=f.trim().replace(Q,""),f.length<2)return"";for(;f.length%4!==0;)f=f+"=";return f}function y(f,u){u=u||1/0;for(var c,h=f.length,N=null,L=[],F=0;F<h;++F){if(c=f.charCodeAt(F),c>55295&&c<57344){if(!N){if(c>56319){(u-=3)>-1&&L.push(239,191,189);continue}else if(F+1===h){(u-=3)>-1&&L.push(239,191,189);continue}N=c;continue}if(c<56320){(u-=3)>-1&&L.push(239,191,189),N=c;continue}c=(N-55296<<10|c-56320)+65536}else N&&(u-=3)>-1&&L.push(239,191,189);if(N=null,c<128){if((u-=1)<0)break;L.push(c)}else if(c<2048){if((u-=2)<0)break;L.push(c>>6|192,c&63|128)}else if(c<65536){if((u-=3)<0)break;L.push(c>>12|224,c>>6&63|128,c&63|128)}else if(c<1114112){if((u-=4)<0)break;L.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw new Error("Invalid code point")}return L}function j(f){for(var u=[],c=0;c<f.length;++c)u.push(f.charCodeAt(c)&255);return u}function P(f,u){for(var c,h,N,L=[],F=0;F<f.length&&!((u-=2)<0);++F)c=f.charCodeAt(F),h=c>>8,N=c%256,L.push(N),L.push(h);return L}function J(f){return t.toByteArray(x(f))}function ot(f,u,c,h){for(var N=0;N<h&&!(N+c>=u.length||N>=f.length);++N)u[N+c]=f[N];return N}function rt(f,u){return f instanceof u||f!=null&&f.constructor!=null&&f.constructor.name!=null&&f.constructor.name===u.name}function ht(f){return f!==f}var A=function(){for(var f="0123456789abcdef",u=new Array(256),c=0;c<16;++c)for(var h=c*16,N=0;N<16;++N)u[h+N]=f[c]+f[N];return u}()}(qn)),qn}/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Fi;function Yo(){return Fi||(Fi=1,function(a,t){var e=zo(),n=e.Buffer;function s(r,o){for(var l in r)o[l]=r[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?a.exports=e:(s(e,t),t.Buffer=i);function i(r,o,l){return n(r,o,l)}i.prototype=Object.create(n.prototype),s(n,i),i.from=function(r,o,l){if(typeof r=="number")throw new TypeError("Argument must not be a number");return n(r,o,l)},i.alloc=function(r,o,l){if(typeof r!="number")throw new TypeError("Argument must be a number");var E=n(r);return o!==void 0?typeof l=="string"?E.fill(o,l):E.fill(o):E.fill(0),E},i.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return n(r)},i.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return e.SlowBuffer(r)}}(Fe,Fe.exports)),Fe.exports}var ji;function Go(){if(ji)return $n;ji=1;var a=Yo().Buffer,t=a.isEncoding||function(v){switch(v=""+v,v&&v.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function e(v){if(!v)return"utf8";for(var C;;)switch(v){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return v;default:if(C)return;v=(""+v).toLowerCase(),C=!0}}function n(v){var C=e(v);if(typeof C!="string"&&(a.isEncoding===t||!t(v)))throw new Error("Unknown encoding: "+v);return C||v}$n.StringDecoder=s;function s(v){this.encoding=n(v);var C;switch(this.encoding){case"utf16le":this.text=d,this.end=b,C=4;break;case"utf8":this.fillLast=l,C=4;break;case"base64":this.text=w,this.end=T,C=3;break;default:this.write=_,this.end=I;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=a.allocUnsafe(C)}s.prototype.write=function(v){if(v.length===0)return"";var C,m;if(this.lastNeed){if(C=this.fillLast(v),C===void 0)return"";m=this.lastNeed,this.lastNeed=0}else m=0;return m<v.length?C?C+this.text(v,m):this.text(v,m):C||""},s.prototype.end=p,s.prototype.text=E,s.prototype.fillLast=function(v){if(this.lastNeed<=v.length)return v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,v.length),this.lastNeed-=v.length};function i(v){return v<=127?0:v>>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function r(v,C,m){var D=C.length-1;if(D<m)return 0;var M=i(C[D]);return M>=0?(M>0&&(v.lastNeed=M-1),M):--D<m||M===-2?0:(M=i(C[D]),M>=0?(M>0&&(v.lastNeed=M-2),M):--D<m||M===-2?0:(M=i(C[D]),M>=0?(M>0&&(M===2?M=0:v.lastNeed=M-3),M):0))}function o(v,C,m){if((C[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&C.length>1){if((C[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&C.length>2&&(C[2]&192)!==128)return v.lastNeed=2,"�"}}function l(v){var C=this.lastTotal-this.lastNeed,m=o(this,v);if(m!==void 0)return m;if(this.lastNeed<=v.length)return v.copy(this.lastChar,C,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,C,0,v.length),this.lastNeed-=v.length}function E(v,C){var m=r(this,v,C);if(!this.lastNeed)return v.toString("utf8",C);this.lastTotal=m;var D=v.length-(m-this.lastNeed);return v.copy(this.lastChar,0,D),v.toString("utf8",C,D)}function p(v){var C=v&&v.length?this.write(v):"";return this.lastNeed?C+"�":C}function d(v,C){if((v.length-C)%2===0){var m=v.toString("utf16le",C);if(m){var D=m.charCodeAt(m.length-1);if(D>=55296&&D<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],m.slice(0,-1)}return m}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",C,v.length-1)}function b(v){var C=v&&v.length?this.write(v):"";if(this.lastNeed){var m=this.lastTotal-this.lastNeed;return C+this.lastChar.toString("utf16le",0,m)}return C}function w(v,C){var m=(v.length-C)%3;return m===0?v.toString("base64",C):(this.lastNeed=3-m,this.lastTotal=3,m===1?this.lastChar[0]=v[v.length-1]:(this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1]),v.toString("base64",C,v.length-m))}function T(v){var C=v&&v.length?this.write(v):"";return this.lastNeed?C+this.lastChar.toString("base64",0,3-this.lastNeed):C}function _(v){return v.toString(this.encoding)}function I(v){return v&&v.length?this.write(v):""}return $n}var Ri;function ko(){return Ri||(Ri=1,function(a){(function(t){t.parser=function(x,y){return new n(x,y)},t.SAXParser=n,t.SAXStream=p,t.createStream=E,t.MAX_BUFFER_LENGTH=64*1024;var e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function n(x,y){if(!(this instanceof n))return new n(x,y);var j=this;i(j),j.q=j.c="",j.bufferCheckPosition=t.MAX_BUFFER_LENGTH,j.opt=y||{},j.opt.lowercase=j.opt.lowercase||j.opt.lowercasetags,j.looseCase=j.opt.lowercase?"toLowerCase":"toUpperCase",j.tags=[],j.closed=j.closedRoot=j.sawRoot=!1,j.tag=j.error=null,j.strict=!!x,j.noscript=!!(x||j.opt.noscript),j.state=g.BEGIN,j.strictEntities=j.opt.strictEntities,j.ENTITIES=j.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),j.attribList=[],j.opt.xmlns&&(j.ns=Object.create(_)),j.opt.unquotedAttributeValues===void 0&&(j.opt.unquotedAttributeValues=!x),j.trackPosition=j.opt.position!==!1,j.trackPosition&&(j.position=j.line=j.column=0),S(j,"onready")}Object.create||(Object.create=function(x){function y(){}y.prototype=x;var j=new y;return j}),Object.keys||(Object.keys=function(x){var y=[];for(var j in x)x.hasOwnProperty(j)&&y.push(j);return y});function s(x){for(var y=Math.max(t.MAX_BUFFER_LENGTH,10),j=0,P=0,J=e.length;P<J;P++){var ot=x[e[P]].length;if(ot>y)switch(e[P]){case"textNode":$(x);break;case"cdata":B(x,"oncdata",x.cdata),x.cdata="";break;case"script":B(x,"onscript",x.script),x.script="";break;default:Y(x,"Max buffer length exceeded: "+e[P])}j=Math.max(j,ot)}var rt=t.MAX_BUFFER_LENGTH-j;x.bufferCheckPosition=rt+x.position}function i(x){for(var y=0,j=e.length;y<j;y++)x[e[y]]=""}function r(x){$(x),x.cdata!==""&&(B(x,"oncdata",x.cdata),x.cdata=""),x.script!==""&&(B(x,"onscript",x.script),x.script="")}n.prototype={end:function(){k(this)},write:Q,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){r(this)}};var o;try{o=require("stream").Stream}catch{o=function(){}}o||(o=function(){});var l=t.EVENTS.filter(function(x){return x!=="error"&&x!=="end"});function E(x,y){return new p(x,y)}function p(x,y){if(!(this instanceof p))return new p(x,y);o.apply(this),this._parser=new n(x,y),this.writable=!0,this.readable=!0;var j=this;this._parser.onend=function(){j.emit("end")},this._parser.onerror=function(P){j.emit("error",P),j._parser.error=null},this._decoder=null,l.forEach(function(P){Object.defineProperty(j,"on"+P,{get:function(){return j._parser["on"+P]},set:function(J){if(!J)return j.removeAllListeners(P),j._parser["on"+P]=J,J;j.on(P,J)},enumerable:!0,configurable:!1})})}p.prototype=Object.create(o.prototype,{constructor:{value:p}}),p.prototype.write=function(x){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(x)){if(!this._decoder){var y=Go().StringDecoder;this._decoder=new y("utf8")}x=this._decoder.write(x)}return this._parser.write(x.toString()),this.emit("data",x),!0},p.prototype.end=function(x){return x&&x.length&&this.write(x),this._parser.end(),!0},p.prototype.on=function(x,y){var j=this;return!j._parser["on"+x]&&l.indexOf(x)!==-1&&(j._parser["on"+x]=function(){var P=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);P.splice(0,0,x),j.emit.apply(j,P)}),o.prototype.on.call(j,x,y)};var d="[CDATA[",b="DOCTYPE",w="http://www.w3.org/XML/1998/namespace",T="http://www.w3.org/2000/xmlns/",_={xml:w,xmlns:T},I=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,v=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,C=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,m=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function D(x){return x===" "||x===`
98
+ `||x==="\r"||x===" "}function M(x){return x==='"'||x==="'"}function X(x){return x===">"||D(x)}function q(x,y){return x.test(y)}function U(x,y){return!q(x,y)}var g=0;t.STATE={BEGIN:g++,BEGIN_WHITESPACE:g++,TEXT:g++,TEXT_ENTITY:g++,OPEN_WAKA:g++,SGML_DECL:g++,SGML_DECL_QUOTED:g++,DOCTYPE:g++,DOCTYPE_QUOTED:g++,DOCTYPE_DTD:g++,DOCTYPE_DTD_QUOTED:g++,COMMENT_STARTING:g++,COMMENT:g++,COMMENT_ENDING:g++,COMMENT_ENDED:g++,CDATA:g++,CDATA_ENDING:g++,CDATA_ENDING_2:g++,PROC_INST:g++,PROC_INST_BODY:g++,PROC_INST_ENDING:g++,OPEN_TAG:g++,OPEN_TAG_SLASH:g++,ATTRIB:g++,ATTRIB_NAME:g++,ATTRIB_NAME_SAW_WHITE:g++,ATTRIB_VALUE:g++,ATTRIB_VALUE_QUOTED:g++,ATTRIB_VALUE_CLOSED:g++,ATTRIB_VALUE_UNQUOTED:g++,ATTRIB_VALUE_ENTITY_Q:g++,ATTRIB_VALUE_ENTITY_U:g++,CLOSE_TAG:g++,CLOSE_TAG_SAW_WHITE:g++,SCRIPT:g++,SCRIPT_ENDING:g++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(x){var y=t.ENTITIES[x],j=typeof y=="number"?String.fromCharCode(y):y;t.ENTITIES[x]=j});for(var R in t.STATE)t.STATE[t.STATE[R]]=R;g=t.STATE;function S(x,y,j){x[y]&&x[y](j)}function B(x,y,j){x.textNode&&$(x),S(x,y,j)}function $(x){x.textNode=W(x.opt,x.textNode),x.textNode&&S(x,"ontext",x.textNode),x.textNode=""}function W(x,y){return x.trim&&(y=y.trim()),x.normalize&&(y=y.replace(/\s+/g," ")),y}function Y(x,y){return $(x),x.trackPosition&&(y+=`
99
+ Line: `+x.line+`
100
+ Column: `+x.column+`
101
+ Char: `+x.c),y=new Error(y),x.error=y,S(x,"onerror",y),x}function k(x){return x.sawRoot&&!x.closedRoot&&V(x,"Unclosed root tag"),x.state!==g.BEGIN&&x.state!==g.BEGIN_WHITESPACE&&x.state!==g.TEXT&&Y(x,"Unexpected end"),$(x),x.c="",x.closed=!0,S(x,"onend"),n.call(x,x.strict,x.opt),x}function V(x,y){if(typeof x!="object"||!(x instanceof n))throw new Error("bad call to strictFail");x.strict&&Y(x,y)}function ft(x){x.strict||(x.tagName=x.tagName[x.looseCase]());var y=x.tags[x.tags.length-1]||x,j=x.tag={name:x.tagName,attributes:{}};x.opt.xmlns&&(j.ns=y.ns),x.attribList.length=0,B(x,"onopentagstart",j)}function It(x,y){var j=x.indexOf(":"),P=j<0?["",x]:x.split(":"),J=P[0],ot=P[1];return y&&x==="xmlns"&&(J="xmlns",ot=""),{prefix:J,local:ot}}function at(x){if(x.strict||(x.attribName=x.attribName[x.looseCase]()),x.attribList.indexOf(x.attribName)!==-1||x.tag.attributes.hasOwnProperty(x.attribName)){x.attribName=x.attribValue="";return}if(x.opt.xmlns){var y=It(x.attribName,!0),j=y.prefix,P=y.local;if(j==="xmlns")if(P==="xml"&&x.attribValue!==w)V(x,"xml: prefix must be bound to "+w+`
102
+ Actual: `+x.attribValue);else if(P==="xmlns"&&x.attribValue!==T)V(x,"xmlns: prefix must be bound to "+T+`
103
+ Actual: `+x.attribValue);else{var J=x.tag,ot=x.tags[x.tags.length-1]||x;J.ns===ot.ns&&(J.ns=Object.create(ot.ns)),J.ns[P]=x.attribValue}x.attribList.push([x.attribName,x.attribValue])}else x.tag.attributes[x.attribName]=x.attribValue,B(x,"onattribute",{name:x.attribName,value:x.attribValue});x.attribName=x.attribValue=""}function st(x,y){if(x.opt.xmlns){var j=x.tag,P=It(x.tagName);j.prefix=P.prefix,j.local=P.local,j.uri=j.ns[P.prefix]||"",j.prefix&&!j.uri&&(V(x,"Unbound namespace prefix: "+JSON.stringify(x.tagName)),j.uri=P.prefix);var J=x.tags[x.tags.length-1]||x;j.ns&&J.ns!==j.ns&&Object.keys(j.ns).forEach(function(F){B(x,"onopennamespace",{prefix:F,uri:j.ns[F]})});for(var ot=0,rt=x.attribList.length;ot<rt;ot++){var ht=x.attribList[ot],A=ht[0],f=ht[1],u=It(A,!0),c=u.prefix,h=u.local,N=c===""?"":j.ns[c]||"",L={name:A,value:f,prefix:c,local:h,uri:N};c&&c!=="xmlns"&&!N&&(V(x,"Unbound namespace prefix: "+JSON.stringify(c)),L.uri=c),x.tag.attributes[A]=L,B(x,"onattribute",L)}x.attribList.length=0}x.tag.isSelfClosing=!!y,x.sawRoot=!0,x.tags.push(x.tag),B(x,"onopentag",x.tag),y||(!x.noscript&&x.tagName.toLowerCase()==="script"?x.state=g.SCRIPT:x.state=g.TEXT,x.tag=null,x.tagName=""),x.attribName=x.attribValue="",x.attribList.length=0}function ut(x){if(!x.tagName){V(x,"Weird empty close tag."),x.textNode+="</>",x.state=g.TEXT;return}if(x.script){if(x.tagName!=="script"){x.script+="</"+x.tagName+">",x.tagName="",x.state=g.SCRIPT;return}B(x,"onscript",x.script),x.script=""}var y=x.tags.length,j=x.tagName;x.strict||(j=j[x.looseCase]());for(var P=j;y--;){var J=x.tags[y];if(J.name!==P)V(x,"Unexpected close tag");else break}if(y<0){V(x,"Unmatched closing tag: "+x.tagName),x.textNode+="</"+x.tagName+">",x.state=g.TEXT;return}x.tagName=j;for(var ot=x.tags.length;ot-- >y;){var rt=x.tag=x.tags.pop();x.tagName=x.tag.name,B(x,"onclosetag",x.tagName);var ht={};for(var A in rt.ns)ht[A]=rt.ns[A];var f=x.tags[x.tags.length-1]||x;x.opt.xmlns&&rt.ns!==f.ns&&Object.keys(rt.ns).forEach(function(u){var c=rt.ns[u];B(x,"onclosenamespace",{prefix:u,uri:c})})}y===0&&(x.closedRoot=!0),x.tagName=x.attribValue=x.attribName="",x.attribList.length=0,x.state=g.TEXT}function _t(x){var y=x.entity,j=y.toLowerCase(),P,J="";return x.ENTITIES[y]?x.ENTITIES[y]:x.ENTITIES[j]?x.ENTITIES[j]:(y=j,y.charAt(0)==="#"&&(y.charAt(1)==="x"?(y=y.slice(2),P=parseInt(y,16),J=P.toString(16)):(y=y.slice(1),P=parseInt(y,10),J=P.toString(10))),y=y.replace(/^0+/,""),isNaN(P)||J.toLowerCase()!==y?(V(x,"Invalid character entity"),"&"+x.entity+";"):String.fromCodePoint(P))}function K(x,y){y==="<"?(x.state=g.OPEN_WAKA,x.startTagPosition=x.position):D(y)||(V(x,"Non-whitespace before first tag."),x.textNode=y,x.state=g.TEXT)}function $t(x,y){var j="";return y<x.length&&(j=x.charAt(y)),j}function Q(x){var y=this;if(this.error)throw this.error;if(y.closed)return Y(y,"Cannot write after close. Assign an onready handler.");if(x===null)return k(y);typeof x=="object"&&(x=x.toString());for(var j=0,P="";P=$t(x,j++),y.c=P,!!P;)switch(y.trackPosition&&(y.position++,P===`
104
+ `?(y.line++,y.column=0):y.column++),y.state){case g.BEGIN:if(y.state=g.BEGIN_WHITESPACE,P==="\uFEFF")continue;K(y,P);continue;case g.BEGIN_WHITESPACE:K(y,P);continue;case g.TEXT:if(y.sawRoot&&!y.closedRoot){for(var J=j-1;P&&P!=="<"&&P!=="&";)P=$t(x,j++),P&&y.trackPosition&&(y.position++,P===`
105
+ `?(y.line++,y.column=0):y.column++);y.textNode+=x.substring(J,j-1)}P==="<"&&!(y.sawRoot&&y.closedRoot&&!y.strict)?(y.state=g.OPEN_WAKA,y.startTagPosition=y.position):(!D(P)&&(!y.sawRoot||y.closedRoot)&&V(y,"Text data outside of root node."),P==="&"?y.state=g.TEXT_ENTITY:y.textNode+=P);continue;case g.SCRIPT:P==="<"?y.state=g.SCRIPT_ENDING:y.script+=P;continue;case g.SCRIPT_ENDING:P==="/"?y.state=g.CLOSE_TAG:(y.script+="<"+P,y.state=g.SCRIPT);continue;case g.OPEN_WAKA:if(P==="!")y.state=g.SGML_DECL,y.sgmlDecl="";else if(!D(P))if(q(I,P))y.state=g.OPEN_TAG,y.tagName=P;else if(P==="/")y.state=g.CLOSE_TAG,y.tagName="";else if(P==="?")y.state=g.PROC_INST,y.procInstName=y.procInstBody="";else{if(V(y,"Unencoded <"),y.startTagPosition+1<y.position){var ot=y.position-y.startTagPosition;P=new Array(ot).join(" ")+P}y.textNode+="<"+P,y.state=g.TEXT}continue;case g.SGML_DECL:if(y.sgmlDecl+P==="--"){y.state=g.COMMENT,y.comment="",y.sgmlDecl="";continue}y.doctype&&y.doctype!==!0&&y.sgmlDecl?(y.state=g.DOCTYPE_DTD,y.doctype+="<!"+y.sgmlDecl+P,y.sgmlDecl=""):(y.sgmlDecl+P).toUpperCase()===d?(B(y,"onopencdata"),y.state=g.CDATA,y.sgmlDecl="",y.cdata=""):(y.sgmlDecl+P).toUpperCase()===b?(y.state=g.DOCTYPE,(y.doctype||y.sawRoot)&&V(y,"Inappropriately located doctype declaration"),y.doctype="",y.sgmlDecl=""):P===">"?(B(y,"onsgmldeclaration",y.sgmlDecl),y.sgmlDecl="",y.state=g.TEXT):(M(P)&&(y.state=g.SGML_DECL_QUOTED),y.sgmlDecl+=P);continue;case g.SGML_DECL_QUOTED:P===y.q&&(y.state=g.SGML_DECL,y.q=""),y.sgmlDecl+=P;continue;case g.DOCTYPE:P===">"?(y.state=g.TEXT,B(y,"ondoctype",y.doctype),y.doctype=!0):(y.doctype+=P,P==="["?y.state=g.DOCTYPE_DTD:M(P)&&(y.state=g.DOCTYPE_QUOTED,y.q=P));continue;case g.DOCTYPE_QUOTED:y.doctype+=P,P===y.q&&(y.q="",y.state=g.DOCTYPE);continue;case g.DOCTYPE_DTD:P==="]"?(y.doctype+=P,y.state=g.DOCTYPE):P==="<"?(y.state=g.OPEN_WAKA,y.startTagPosition=y.position):M(P)?(y.doctype+=P,y.state=g.DOCTYPE_DTD_QUOTED,y.q=P):y.doctype+=P;continue;case g.DOCTYPE_DTD_QUOTED:y.doctype+=P,P===y.q&&(y.state=g.DOCTYPE_DTD,y.q="");continue;case g.COMMENT:P==="-"?y.state=g.COMMENT_ENDING:y.comment+=P;continue;case g.COMMENT_ENDING:P==="-"?(y.state=g.COMMENT_ENDED,y.comment=W(y.opt,y.comment),y.comment&&B(y,"oncomment",y.comment),y.comment=""):(y.comment+="-"+P,y.state=g.COMMENT);continue;case g.COMMENT_ENDED:P!==">"?(V(y,"Malformed comment"),y.comment+="--"+P,y.state=g.COMMENT):y.doctype&&y.doctype!==!0?y.state=g.DOCTYPE_DTD:y.state=g.TEXT;continue;case g.CDATA:P==="]"?y.state=g.CDATA_ENDING:y.cdata+=P;continue;case g.CDATA_ENDING:P==="]"?y.state=g.CDATA_ENDING_2:(y.cdata+="]"+P,y.state=g.CDATA);continue;case g.CDATA_ENDING_2:P===">"?(y.cdata&&B(y,"oncdata",y.cdata),B(y,"onclosecdata"),y.cdata="",y.state=g.TEXT):P==="]"?y.cdata+="]":(y.cdata+="]]"+P,y.state=g.CDATA);continue;case g.PROC_INST:P==="?"?y.state=g.PROC_INST_ENDING:D(P)?y.state=g.PROC_INST_BODY:y.procInstName+=P;continue;case g.PROC_INST_BODY:if(!y.procInstBody&&D(P))continue;P==="?"?y.state=g.PROC_INST_ENDING:y.procInstBody+=P;continue;case g.PROC_INST_ENDING:P===">"?(B(y,"onprocessinginstruction",{name:y.procInstName,body:y.procInstBody}),y.procInstName=y.procInstBody="",y.state=g.TEXT):(y.procInstBody+="?"+P,y.state=g.PROC_INST_BODY);continue;case g.OPEN_TAG:q(v,P)?y.tagName+=P:(ft(y),P===">"?st(y):P==="/"?y.state=g.OPEN_TAG_SLASH:(D(P)||V(y,"Invalid character in tag name"),y.state=g.ATTRIB));continue;case g.OPEN_TAG_SLASH:P===">"?(st(y,!0),ut(y)):(V(y,"Forward-slash in opening tag not followed by >"),y.state=g.ATTRIB);continue;case g.ATTRIB:if(D(P))continue;P===">"?st(y):P==="/"?y.state=g.OPEN_TAG_SLASH:q(I,P)?(y.attribName=P,y.attribValue="",y.state=g.ATTRIB_NAME):V(y,"Invalid attribute name");continue;case g.ATTRIB_NAME:P==="="?y.state=g.ATTRIB_VALUE:P===">"?(V(y,"Attribute without value"),y.attribValue=y.attribName,at(y),st(y)):D(P)?y.state=g.ATTRIB_NAME_SAW_WHITE:q(v,P)?y.attribName+=P:V(y,"Invalid attribute name");continue;case g.ATTRIB_NAME_SAW_WHITE:if(P==="=")y.state=g.ATTRIB_VALUE;else{if(D(P))continue;V(y,"Attribute without value"),y.tag.attributes[y.attribName]="",y.attribValue="",B(y,"onattribute",{name:y.attribName,value:""}),y.attribName="",P===">"?st(y):q(I,P)?(y.attribName=P,y.state=g.ATTRIB_NAME):(V(y,"Invalid attribute name"),y.state=g.ATTRIB)}continue;case g.ATTRIB_VALUE:if(D(P))continue;M(P)?(y.q=P,y.state=g.ATTRIB_VALUE_QUOTED):(y.opt.unquotedAttributeValues||Y(y,"Unquoted attribute value"),y.state=g.ATTRIB_VALUE_UNQUOTED,y.attribValue=P);continue;case g.ATTRIB_VALUE_QUOTED:if(P!==y.q){P==="&"?y.state=g.ATTRIB_VALUE_ENTITY_Q:y.attribValue+=P;continue}at(y),y.q="",y.state=g.ATTRIB_VALUE_CLOSED;continue;case g.ATTRIB_VALUE_CLOSED:D(P)?y.state=g.ATTRIB:P===">"?st(y):P==="/"?y.state=g.OPEN_TAG_SLASH:q(I,P)?(V(y,"No whitespace between attributes"),y.attribName=P,y.attribValue="",y.state=g.ATTRIB_NAME):V(y,"Invalid attribute name");continue;case g.ATTRIB_VALUE_UNQUOTED:if(!X(P)){P==="&"?y.state=g.ATTRIB_VALUE_ENTITY_U:y.attribValue+=P;continue}at(y),P===">"?st(y):y.state=g.ATTRIB;continue;case g.CLOSE_TAG:if(y.tagName)P===">"?ut(y):q(v,P)?y.tagName+=P:y.script?(y.script+="</"+y.tagName,y.tagName="",y.state=g.SCRIPT):(D(P)||V(y,"Invalid tagname in closing tag"),y.state=g.CLOSE_TAG_SAW_WHITE);else{if(D(P))continue;U(I,P)?y.script?(y.script+="</"+P,y.state=g.SCRIPT):V(y,"Invalid tagname in closing tag."):y.tagName=P}continue;case g.CLOSE_TAG_SAW_WHITE:if(D(P))continue;P===">"?ut(y):V(y,"Invalid characters in closing tag");continue;case g.TEXT_ENTITY:case g.ATTRIB_VALUE_ENTITY_Q:case g.ATTRIB_VALUE_ENTITY_U:var rt,ht;switch(y.state){case g.TEXT_ENTITY:rt=g.TEXT,ht="textNode";break;case g.ATTRIB_VALUE_ENTITY_Q:rt=g.ATTRIB_VALUE_QUOTED,ht="attribValue";break;case g.ATTRIB_VALUE_ENTITY_U:rt=g.ATTRIB_VALUE_UNQUOTED,ht="attribValue";break}if(P===";"){var A=_t(y);y.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(A)?(y.entity="",y.state=rt,y.write(A)):(y[ht]+=A,y.entity="",y.state=rt)}else q(y.entity.length?m:C,P)?y.entity+=P:(V(y,"Invalid character in entity name"),y[ht]+="&"+y.entity+P,y.entity="",y.state=rt);continue;default:throw new Error(y,"Unknown state: "+y.state)}return y.position>=y.bufferCheckPosition&&s(y),y}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var x=String.fromCharCode,y=Math.floor,j=function(){var P=16384,J=[],ot,rt,ht=-1,A=arguments.length;if(!A)return"";for(var f="";++ht<A;){var u=Number(arguments[ht]);if(!isFinite(u)||u<0||u>1114111||y(u)!==u)throw RangeError("Invalid code point: "+u);u<=65535?J.push(u):(u-=65536,ot=(u>>10)+55296,rt=u%1024+56320,J.push(ot,rt)),(ht+1===A||J.length>P)&&(f+=x.apply(null,J),J.length=0)}return f};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:j,configurable:!0,writable:!0}):String.fromCodePoint=j}()})(a)}(Xn)),Xn}var Wn={},Bi;function Ko(){return Bi||(Bi=1,function(){Wn.stripBOM=function(a){return a[0]==="\uFEFF"?a.substring(1):a}}.call(it)),Wn}var se={},Ui;function hs(){return Ui||(Ui=1,function(){var a;a=new RegExp(/(?!xmlns)^.*:/),se.normalize=function(t){return t.toLowerCase()},se.firstCharLowerCase=function(t){return t.charAt(0).toLowerCase()+t.slice(1)},se.stripPrefix=function(t){return t.replace(a,"")},se.parseNumbers=function(t){return isNaN(t)||(t=t%1===0?parseInt(t,10):parseFloat(t)),t},se.parseBooleans=function(t){return/^(?:true|false)$/i.test(t)&&(t=t.toLowerCase()==="true"),t}}.call(it)),se}var Xi;function Qo(){return Xi||(Xi=1,function(a){(function(){var t,e,n,s,i,r,o,l,E,p=function(w,T){return function(){return w.apply(T,arguments)}},d=function(w,T){for(var _ in T)b.call(T,_)&&(w[_]=T[_]);function I(){this.constructor=w}return I.prototype=T.prototype,w.prototype=new I,w.__super__=T.prototype,w},b={}.hasOwnProperty;l=ko(),s=Qn,t=Ko(),o=hs(),E=Es.setImmediate,e=Zn().defaults,i=function(w){return typeof w=="object"&&w!=null&&Object.keys(w).length===0},r=function(w,T,_){var I,v,C;for(I=0,v=w.length;I<v;I++)C=w[I],T=C(T,_);return T},n=function(w,T,_){var I;return I=Object.create(null),I.value=_,I.writable=!0,I.enumerable=!0,I.configurable=!0,Object.defineProperty(w,T,I)},a.Parser=function(w){d(T,w);function T(_){this.parseStringPromise=p(this.parseStringPromise,this),this.parseString=p(this.parseString,this),this.reset=p(this.reset,this),this.assignOrPush=p(this.assignOrPush,this),this.processAsync=p(this.processAsync,this);var I,v,C;if(!(this instanceof a.Parser))return new a.Parser(_);this.options={},v=e["0.2"];for(I in v)b.call(v,I)&&(C=v[I],this.options[I]=C);for(I in _)b.call(_,I)&&(C=_[I],this.options[I]=C);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(o.normalize)),this.reset()}return T.prototype.processAsync=function(){var _,I;try{return this.remaining.length<=this.options.chunkSize?(_=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(_),this.saxParser.close()):(_=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(_),E(this.processAsync))}catch(v){if(I=v,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(I)}},T.prototype.assignOrPush=function(_,I,v){return I in _?(_[I]instanceof Array||n(_,I,[_[I]]),_[I].push(v)):this.options.explicitArray?n(_,I,[v]):n(_,I,v)},T.prototype.reset=function(){var _,I,v,C;return this.removeAllListeners(),this.saxParser=l.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(m){return function(D){if(m.saxParser.resume(),!m.saxParser.errThrown)return m.saxParser.errThrown=!0,m.emit("error",D)}}(this),this.saxParser.onend=function(m){return function(){if(!m.saxParser.ended)return m.saxParser.ended=!0,m.emit("end",m.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,C=[],_=this.options.attrkey,I=this.options.charkey,this.saxParser.onopentag=function(m){return function(D){var M,X,q,U,g;if(q={},q[I]="",!m.options.ignoreAttrs){g=D.attributes;for(M in g)b.call(g,M)&&(!(_ in q)&&!m.options.mergeAttrs&&(q[_]={}),X=m.options.attrValueProcessors?r(m.options.attrValueProcessors,D.attributes[M],M):D.attributes[M],U=m.options.attrNameProcessors?r(m.options.attrNameProcessors,M):M,m.options.mergeAttrs?m.assignOrPush(q,U,X):n(q[_],U,X))}return q["#name"]=m.options.tagNameProcessors?r(m.options.tagNameProcessors,D.name):D.name,m.options.xmlns&&(q[m.options.xmlnskey]={uri:D.uri,local:D.local}),C.push(q)}}(this),this.saxParser.onclosetag=function(m){return function(){var D,M,X,q,U,g,R,S,B,$;if(g=C.pop(),U=g["#name"],(!m.options.explicitChildren||!m.options.preserveChildrenOrder)&&delete g["#name"],g.cdata===!0&&(D=g.cdata,delete g.cdata),B=C[C.length-1],g[I].match(/^\s*$/)&&!D?(M=g[I],delete g[I]):(m.options.trim&&(g[I]=g[I].trim()),m.options.normalize&&(g[I]=g[I].replace(/\s{2,}/g," ").trim()),g[I]=m.options.valueProcessors?r(m.options.valueProcessors,g[I],U):g[I],Object.keys(g).length===1&&I in g&&!m.EXPLICIT_CHARKEY&&(g=g[I])),i(g)&&(typeof m.options.emptyTag=="function"?g=m.options.emptyTag():g=m.options.emptyTag!==""?m.options.emptyTag:M),m.options.validator!=null&&($="/"+function(){var W,Y,k;for(k=[],W=0,Y=C.length;W<Y;W++)q=C[W],k.push(q["#name"]);return k}().concat(U).join("/"),function(){var W;try{return g=m.options.validator($,B&&B[U],g)}catch(Y){return W=Y,m.emit("error",W)}}()),m.options.explicitChildren&&!m.options.mergeAttrs&&typeof g=="object"){if(!m.options.preserveChildrenOrder)q={},m.options.attrkey in g&&(q[m.options.attrkey]=g[m.options.attrkey],delete g[m.options.attrkey]),!m.options.charsAsChildren&&m.options.charkey in g&&(q[m.options.charkey]=g[m.options.charkey],delete g[m.options.charkey]),Object.getOwnPropertyNames(g).length>0&&(q[m.options.childkey]=g),g=q;else if(B){B[m.options.childkey]=B[m.options.childkey]||[],R={};for(X in g)b.call(g,X)&&n(R,X,g[X]);B[m.options.childkey].push(R),delete g["#name"],Object.keys(g).length===1&&I in g&&!m.EXPLICIT_CHARKEY&&(g=g[I])}}return C.length>0?m.assignOrPush(B,U,g):(m.options.explicitRoot&&(S=g,g={},n(g,U,S)),m.resultObject=g,m.saxParser.ended=!0,m.emit("end",m.resultObject))}}(this),v=function(m){return function(D){var M,X;if(X=C[C.length-1],X)return X[I]+=D,m.options.explicitChildren&&m.options.preserveChildrenOrder&&m.options.charsAsChildren&&(m.options.includeWhiteChars||D.replace(/\\n/g,"").trim()!=="")&&(X[m.options.childkey]=X[m.options.childkey]||[],M={"#name":"__text__"},M[I]=D,m.options.normalize&&(M[I]=M[I].replace(/\s{2,}/g," ").trim()),X[m.options.childkey].push(M)),X}}(this),this.saxParser.ontext=v,this.saxParser.oncdata=function(m){return function(D){var M;if(M=v(D),M)return M.cdata=!0}}()},T.prototype.parseString=function(_,I){var v;I!=null&&typeof I=="function"&&(this.on("end",function(C){return this.reset(),I(null,C)}),this.on("error",function(C){return this.reset(),I(C)}));try{return _=_.toString(),_.trim()===""?(this.emit("end",null),!0):(_=t.stripBOM(_),this.options.async?(this.remaining=_,E(this.processAsync),this.saxParser):this.saxParser.write(_).close())}catch(C){if(v=C,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw v}else return this.emit("error",v),this.saxParser.errThrown=!0}},T.prototype.parseStringPromise=function(_){return new Promise(function(I){return function(v,C){return I.parseString(_,function(m,D){return m?C(m):v(D)})}}(this))},T}(s),a.parseString=function(w,T,_){var I,v,C;return _!=null?(typeof _=="function"&&(I=_),typeof T=="object"&&(v=T)):(typeof T=="function"&&(I=T),v={}),C=new a.Parser(v),C.parseString(w,I)},a.parseStringPromise=function(w,T){var _,I;return typeof T=="object"&&(_=T),I=new a.Parser(_),I.parseStringPromise(w)}}).call(it)}(Un)),Un}var ps;(function(){var a,t,e,n=function(i,r){for(var o in r)s.call(r,o)&&(i[o]=r[o]);function l(){this.constructor=i}return l.prototype=r.prototype,i.prototype=new l,i.__super__=r.prototype,i},s={}.hasOwnProperty;t=Zn(),a=Wo(),e=Qo(),hs(),t.defaults,function(i){n(r,i);function r(o){this.message=o}return r}(Error),a.Builder,e.Parser,e.parseString,ps=e.parseStringPromise}).call(it);class ds{constructor(t,e,n){this.nextTxnId=1,this.pendingCommands=new Map,this.breakpoints=new Map,this.scriptIdByUrl=new Map,this.nextScriptId=1,this.objectHandles=new Map,this.nextObjectId=1,this.callFramesMap=new Map,this.xdebugConnected=!1,this.xdebugStatus="starting",this.initFileUri=null,this.dbgp=t,this.cdp=e,this.readPHPFile=n.getPHPFile,this.remoteRoot=n.remoteRoot||"",this.localRoot=n.localRoot||"";for(const s of n.knownScriptUrls)this.scriptIdByUrl.set(s,this.getOrCreateScriptId(s))}start(){this.dbgp.on("connected",()=>{this.xdebugConnected=!0,this.sendDbgpCommand("stdout","-c 1"),this.sendDbgpCommand("stderr","-c 1")}),this.dbgp.on("message",async t=>{try{const e=await ps(t,{explicitArray:!1});await this.handleDbgpMessage(e)}catch{}}),this.dbgp.on("close",()=>{this.xdebugConnected=!1,this.cdp.sendMessage({method:"Debugger.paused",params:{reason:"terminated",callFrames:[]}}),setTimeout(()=>{this.cdp.ws&&this.cdp.ws.close()},100)}),this.cdp.on("clientConnected",()=>{if(this.xdebugConnected&&(this.sendInitialScripts(),this.xdebugStatus==="starting"||this.xdebugStatus==="break")){const t=this.sendDbgpCommand("stack_get");this.pendingCommands.set(t,{})}}),this.cdp.on("message",t=>{this.handleCdpMessage(t)}),this.cdp.on("clientDisconnected",()=>{this.xdebugConnected&&this.sendDbgpCommand("detach")})}stop(){this.dbgp.close(),this.cdp.close()}sendInitialScripts(){if(this.initFileUri&&!this.scriptIdByUrl.has(this.initFileUri)){const t=this.getOrCreateScriptId(this.initFileUri);this.cdp.sendMessage({method:"Debugger.scriptParsed",params:{scriptId:t,url:this.initFileUri,startLine:0,startColumn:0,executionContextId:1}})}for(const[t,e]of this.scriptIdByUrl.entries())this.cdp.sendMessage({method:"Debugger.scriptParsed",params:{scriptId:e,url:t,startLine:0,startColumn:0,executionContextId:1}})}getOrCreateScriptId(t){let e=this.scriptIdByUrl.get(t);return e||(e=String(this.nextScriptId++),this.scriptIdByUrl.set(t,e)),e}formatPropertyFullName(t){let e=!1,n="";for(const s of t)s==='"'||s==="\\"||s==="\0"?(n+="\\"+s,e=!0):s===" "?(n+=s,e=!0):n+=s;return(e||t.includes("'"))&&(n=`"${n}"`),n}sendDbgpCommand(t,e){const s=(this.nextTxnId++).toString();let i=`${t} -i ${s}`;return e!==void 0&&(i+=` ${e}`),this.dbgp.sendCommand(i),s}async handleCdpMessage(t){const{id:e,method:n,params:s}=t;let i={},r=!0;switch(n){case"Debugger.enable":case"Runtime.enable":i={};break;case"Debugger.setBreakpointByUrl":{const{url:o,lineNumber:l}=s,E=o,p=(typeof l=="number"?l:0)+1,d=String(this.breakpoints.size+1);if(this.xdebugConnected){const b=`breakpoint_set -t line -f ${this.formatPropertyFullName(E)} -n ${p}`,w=this.sendDbgpCommand(b);this.pendingCommands.set(w,{cdpId:e,cdpMethod:n,params:{breakpointId:d,fileUri:E,line:p}}),r=!1}else this.breakpoints.set(d,{cdpId:d,xdebugId:null,file:E,line:p}),i={breakpointId:d,locations:[{scriptId:this.getOrCreateScriptId(E),lineNumber:p-1,columnNumber:0}]};break}case"Debugger.removeBreakpoint":{const{breakpointId:o}=s,l=String(o),E=this.breakpoints.get(l);if(E){if(E.xdebugId&&this.xdebugConnected){const p=`breakpoint_remove -d ${E.xdebugId}`,d=this.sendDbgpCommand(p);this.pendingCommands.set(d,{cdpId:e,cdpMethod:n}),r=!1}this.breakpoints.delete(l)}i={};break}case"Debugger.resume":{this.xdebugConnected&&(this.xdebugStatus="running",this.sendDbgpCommand("run")),i={};break}case"Debugger.stepOver":{this.xdebugConnected&&(this.xdebugStatus="running",this.sendDbgpCommand("step_over")),i={};break}case"Debugger.stepInto":{this.xdebugConnected&&(this.xdebugStatus="running",this.sendDbgpCommand("step_into")),i={};break}case"Debugger.stepOut":{this.xdebugConnected&&(this.xdebugStatus="running",this.sendDbgpCommand("step_out")),i={};break}case"Debugger.pause":{this.xdebugConnected&&this.sendDbgpCommand("break"),i={};break}case"Runtime.evaluate":case"Debugger.evaluateOnCallFrame":{const o=s.expression||"",l=s.callFrameId;if(n==="Debugger.evaluateOnCallFrame"){if(l===void 0||!this.callFramesMap.has(l)){this.cdp.sendMessage({id:e,error:{code:-32e3,message:"No such call frame"}});return}if(this.callFramesMap.get(l)!==0){this.cdp.sendMessage({id:e,error:{code:-32e3,message:"Evaluation in this frame not supported"}});return}}if(this.xdebugConnected){const E=Buffer.from(o).toString("base64"),p=this.sendDbgpCommand("eval",`-- ${E}`);this.pendingCommands.set(p,{cdpId:e,cdpMethod:n}),r=!1}else i={result:{type:"undefined",value:void 0}};break}case"Runtime.getProperties":{const{objectId:o}=s,l=this.objectHandles.get(o);if(l&&this.xdebugConnected)if(l.type==="context"){const E=l.contextId??0,d=`context_get -d ${l.depth} -c ${E} -p 0 -m 32`,b=this.sendDbgpCommand(d),w={...l,currentPage:0,aggregatedProps:[]};this.objectHandles.set(o,w),this.pendingCommands.set(b,{cdpId:e,cdpMethod:n,params:{objectId:o}}),r=!1}else if(l.type==="property"){const E=l.depth,p=l.fullname,d=this.formatPropertyFullName(p),b=`property_get -d ${E} -n ${d} -p 0 -m 32`,w=this.sendDbgpCommand(b),T={...l,currentPage:0,aggregatedProps:[]};this.objectHandles.set(o,T),this.pendingCommands.set(w,{cdpId:e,cdpMethod:n,params:{parentObjectId:o}}),r=!1}else i={result:[]};else i={result:[]};break}case"Debugger.getScriptSource":{const o=s.scriptId,l=[...this.scriptIdByUrl.entries()].find(([,p])=>p===o)?.[0];let E="";l&&(E=await this.readPHPFile(this.uriToRemotePath(l))),i={scriptSource:E};break}default:i={};break}r&&this.cdp.sendMessage({id:e,result:i})}uriToRemotePath(t){return t.startsWith("file://")?t.slice(7):t}remoteToLocal(t){let e=t;return this.remoteRoot&&e.startsWith(this.remoteRoot)&&(e=Ot.join(this.localRoot||"",e.slice(this.remoteRoot.length))),process.platform==="win32"&&e.startsWith("/")&&(e=e.slice(1)),e}async handleDbgpMessage(t){if(t.init){const e=t.init.$;this.initFileUri=e.fileuri||e.fileuri,this.xdebugStatus="starting";const n=this.sendDbgpCommand("step_into");this.pendingCommands.set(n,{}),this.cdp.ws&&this.sendInitialScripts();return}if(t.response){const e=t.response,n=e.$,s=n.command,i=n.transaction_id,r=this.pendingCommands.get(i);switch(s){case"breakpoint_set":{if(r&&r.cdpId!==void 0&&r.cdpMethod==="Debugger.setBreakpointByUrl"){const o=n.id,l=r.params;if(l){const{breakpointId:E,fileUri:p,line:d}=l;this.breakpoints.set(E,{cdpId:E,xdebugId:o,file:p,line:d});const b=this.getOrCreateScriptId(p),w={breakpointId:E,locations:[{scriptId:b,lineNumber:d-1,columnNumber:0}]};this.cdp.sendMessage({id:r.cdpId,result:w})}this.pendingCommands.delete(i)}break}case"breakpoint_remove":{r&&r.cdpId!==void 0&&(this.cdp.sendMessage({id:r.cdpId,result:{}}),this.pendingCommands.delete(i));break}case"run":case"step_into":case"step_over":case"step_out":{const o=n.status;if(this.xdebugStatus=o,e["xdebug:message"]){const l=e["xdebug:message"].$.filename;if(l&&!this.scriptIdByUrl.has(l)){const E=this.getOrCreateScriptId(l);this.cdp.sendMessage({method:"Debugger.scriptParsed",params:{scriptId:E,url:l,startLine:0,startColumn:0,executionContextId:1}})}}if(o==="break"){const l=this.sendDbgpCommand("stack_get");this.pendingCommands.set(l,{}),this.pendingCommands.delete(i)}else(o==="stopping"||o==="stopped")&&this.cdp.sendMessage({method:"Debugger.resumed",params:{}});break}case"eval":{if(r&&r.cdpId!==void 0){let o;if(e.property){const E=e.property,p=E.$.type,d=E.$.encoding;let b=null;if(Object.prototype.hasOwnProperty.call(E,"_")?b=E._:typeof E.$value<"u"&&(b=E.$value),d==="base64"&&b!==null)try{b=Buffer.from(b,"base64").toString()}catch{}if(p==="string")o={type:"string",value:b??""};else if(p==="int"||p==="float"||p==="bool"||p==="boolen"||p==="integer"||p==="double"){let w=b;p.startsWith("int")||p==="integer"?w=parseInt(b||"0",10):p==="float"||p==="double"?w=parseFloat(b||"0"):p.startsWith("bool")&&(w=b==="1"||b==="true"),o={type:"number",value:w}}else if(p==="array"||p==="object"){const w=E.$.classname||(p==="array"?"Array":"Object"),T=String(this.nextObjectId++),_=E.$.fullname||"";this.objectHandles.set(T,{type:"property",depth:0,contextId:0,fullname:_}),o={type:"object",objectId:T,className:w,description:w}}else p==="null"?o={type:"object",subtype:"null",value:null}:o={type:"undefined",value:void 0}}else o={type:"undefined",value:void 0};const l={result:o};this.cdp.sendMessage({id:r.cdpId,result:l}),this.pendingCommands.delete(i)}break}case"context_get":case"property_get":{if(r&&r.cdpId!==void 0){const o=r.params?.objectId||r.params?.parentObjectId,l=o?this.objectHandles.get(o):null,E=e.property?.property??e.property,p=[];if(E){const d=Array.isArray(E)?E:[E];for(const b of d){const w=b.$.name||b.$.fullname||"";let T=b.$.type||"undefined";const _=b.$.children==="1",I=b.$.encoding;let v=null;if(typeof b._<"u"&&(v=b._),I==="base64"&&v!==null)try{v=Buffer.from(v,"base64").toString()}catch{}if(_){const C=b.$.classname||(T==="array"?"Array":"Object"),m=String(this.nextObjectId++),D=r.cdpMethod==="Runtime.getProperties"&&r.params?.parentObjectId&&this.objectHandles.get(r.params.parentObjectId)?.contextId||0,M=r.cdpMethod==="Runtime.getProperties"&&r.params?.parentObjectId&&this.objectHandles.get(r.params.parentObjectId)?.depth||0;this.objectHandles.set(m,{type:"property",depth:M,contextId:D,fullname:b.$.fullname||w}),p.push({name:b.$.key||w,value:{type:"object",className:C,description:C,objectId:m},writable:!1,configurable:!1,enumerable:!0})}else{let C,m;T==="string"?C=v??"":T==="int"||T==="integer"?C=parseInt(v||"0",10):T==="float"||T==="double"?C=parseFloat(v||"0"):T==="bool"||T==="boolean"?(C=v==="1"||v==="true",T="boolean"):T==="null"?(C=null,m="null"):C=v;const D={type:T==="integer"?"number":T};m&&(D.subtype=m),D.value=C,p.push({name:b.$.key||w,value:D,writable:!1,configurable:!1,enumerable:!0})}}}if(l){const d=(l.aggregatedProps||[]).concat(p),b=32;if(p.length===b){const T=(l.currentPage||0)+1,_={...l,currentPage:T,aggregatedProps:d};this.objectHandles.set(o,_);let I;if(s==="context_get"){const C=l.contextId??0;I=`context_get -d ${l.depth} -c ${C} -p ${T} -m ${b}`}else{const C=l.depth,m=l.fullname,D=this.formatPropertyFullName(m);I=`property_get -d ${C} -n ${D} -p ${T} -m ${b}`}const v=this.sendDbgpCommand(I);this.pendingCommands.set(v,{cdpId:r.cdpId,cdpMethod:r.cdpMethod,params:r.params}),this.pendingCommands.delete(i);return}else{const T={result:d};this.cdp.sendMessage({id:r.cdpId,result:T}),this.pendingCommands.delete(i)}}else{const d={result:p};this.cdp.sendMessage({id:r.cdpId,result:d}),this.pendingCommands.delete(i)}}break}case"stack_get":{if(e.stack){const o=Array.isArray(e.stack)?e.stack:[e.stack],l=[];this.callFramesMap.clear();for(const p of o){const d=p.$.filename,b=this.getOrCreateScriptId(d);this.scriptIdByUrl.has(d)||(this.scriptIdByUrl.set(d,b),this.cdp.sendMessage({method:"Debugger.scriptParsed",params:{scriptId:b,url:d,startLine:0,startColumn:0,executionContextId:1}}))}for(const p of o){const d=parseInt(p.$.level,10),b=p.$.filename,w=parseInt(p.$.lineno,10),T=p.$.where&&p.$.where!=="{main}"?p.$.where:"(anonymous)",_=this.getOrCreateScriptId(b),I=`frame:${d}`;this.callFramesMap.set(I,d);const v=[],C=String(this.nextObjectId++);this.objectHandles.set(C,{type:"context",contextId:0,depth:d}),v.push({type:"local",object:{objectId:C,className:"Object",description:"Local"}});const m=String(this.nextObjectId++);this.objectHandles.set(m,{type:"context",contextId:1,depth:d}),v.push({type:"global",object:{objectId:m,className:"Object",description:"Global"}}),l.push({callFrameId:I,functionName:T,location:{scriptId:_,lineNumber:w-1,columnNumber:0},scopeChain:v,this:{type:"object",className:"Object",description:"Object",objectId:m}})}let E="pause";if(o.length>0){const p=o[0];if(p.$.filename&&p.$.lineno){const d=p.$.filename,b=parseInt(p.$.lineno,10);for(const w of this.breakpoints.values())if(w.file===d&&w.line===b){E="breakpoint";break}}}this.cdp.sendMessage({method:"Debugger.paused",params:{reason:E,callFrames:l,hitBreakpoints:E==="breakpoint"?[""]:[]}})}this.pendingCommands.delete(i);break}default:{r&&r.cdpId!==void 0&&(this.cdp.sendMessage({id:r.cdpId,result:{}}),this.pendingCommands.delete(i));break}}}else if(t.stream){const e=t.stream,n=e.$.type,s=e.$.encoding||"none";let i=typeof e._=="string"?e._:"";s==="base64"&&(i=Buffer.from(i,"base64").toString()),this.cdp.sendMessage({method:"Log.entryAdded",params:{entry:{source:"other",level:n==="stderr"?"error":"info",text:i,timestamp:Date.now(),stackTrace:{callFrames:[]}}}})}else t.notify}}async function ms(a){const t=a.cdpPort??9229,e=a.dbgpPort??9003,n=a.cdpHost??"localhost",s=a.phpRoot??void 0;Lt.log("Starting XDebug Bridge...");const i=new Qi(t);Lt.log("Connect Chrome DevTools to CDP at:"),Lt.log(`devtools://devtools/bundled/inspector.html?ws=${n}:${t}
106
+ `),await new Promise(p=>i.on("clientConnected",p)),await new Promise(p=>setTimeout(p,2e3)),Lt.log("Chrome connected! Initializing Xdebug receiver...");const r=new Ji(e);Lt.log(`XDebug receiver running on port ${e}`),Lt.log("Running a PHP script with Xdebug enabled...");function o(p){const d=[],b=Xt.readdirSync(p);for(const w of b){const T=Ot.join(p,w),_=Xt.lstatSync(T);_&&_.isDirectory()?d.push(...o(T)):w.endsWith(".php")&&d.push(`file://${T}`)}return d}const l=a.phpInstance?p=>a.phpInstance.readFileAsText(p):a.getPHPFile?a.getPHPFile:p=>{const d=p.startsWith("file://")?p.replace("file://",""):p;return Xt.readFileSync(d,"utf-8")},E=o(s);return new ds(r,i,{knownScriptUrls:E,remoteRoot:a.remoteRoot,localRoot:a.localRoot,getPHPFile:l})}const gs={Quiet:{name:"quiet",severity:xt.Fatal},Normal:{name:"normal",severity:xt.Info},Debug:{name:"debug",severity:xt.Debug}};function Jo(){return So(Js(process.argv)).usage(`
107
+ XDebug Bridge Server CLI
108
+
109
+ Usage: xdebug-bridge [options]
110
+ `).option("port",{alias:"p",type:"number",description:"Xdebug port to listen on",default:9003}).option("host",{alias:"h",type:"string",description:"Xdebug host to bind to",default:"localhost"}).option("php-root",{type:"string",description:"Path to PHP root directory",default:"./"}).option("verbosity",{type:"string",describe:"Output logs",choices:Object.values(gs).map(a=>a.name),default:"normal"}).help().epilog(`
111
+ Examples:
112
+ xdebug-bridge # Start with default settings
113
+ xdebug-bridge --port 9000 --verbosity debug # Custom port with debug logs
114
+ xdebug-bridge --php-root /path/to/php/files # Specify PHP root directory
115
+ `).wrap(null).parseSync()}async function Zo(){const a=Jo();if(a.help)return;if(a.verbosity){const e=Object.values(gs).find(n=>n.name===a.verbosity).severity;Lt.setSeverityFilterLevel(e)}(await ms({cdpPort:9229,cdpHost:a.host,dbgpPort:a.port,phpRoot:a.phpRoot})).start()}exports.CDPServer=Qi;exports.DbgpSession=Ji;exports.XdebugCDPBridge=ds;exports.main=Zo;exports.startBridge=ms;