@php-wasm/cli 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/main.js +41 -3
  2. package/main.js.map +1 -1
  3. package/package.json +9 -5
package/main.js CHANGED
@@ -1,5 +1,43 @@
1
- import c from"os";import{existsSync as w,writeFileSync as d,mkdtempSync as m,chmodSync as P}from"fs";import{rootCertificates as g}from"tls";import{LatestSupportedPHPVersion as b,SupportedPHPVersionsList as v,PHP as x}from"@php-wasm/universal";import{loadNodeRuntime as y,FileLockManagerForNode as S,useHostFilesystem as T}from"@php-wasm/node";import h from"path";let e=process.argv.slice(2);e.length||(e=["--help"]);const u=(import.meta||{}).url,r=new URL("ca-bundle.crt",u).pathname;w(r)||d(r,g.join(`
2
- `));e.unshift("-d",`openssl.cafile=${r}`);async function $(){const f=new URL("php.ini",u).pathname,s=process.env.PHP||b;if(!v.includes(s))throw new Error(`Unsupported PHP version ${s}`);const n=e.some(t=>t.startsWith("--xdebug"));n&&(e=e.filter(t=>t!=="--xdebug"));const{TMPDIR:H,...p}=process.env,i=m(h.join(c.tmpdir(),"php-wasm-bin"));d(`${i}/php`,`#!/bin/sh
1
+ import We from"os";import{readFileSync as De,writeFile as an,statSync as un,readdirSync as cn,lstatSync as ln,existsSync as fn,writeFileSync as qr,mkdtempSync as $e,chmodSync as hn}from"fs";import{rootCertificates as pn}from"tls";import{LatestSupportedPHPVersion as dn,SupportedPHPVersionsList as mn,PHP as yn}from"@php-wasm/universal";import{loadNodeRuntime as gn,FileLockManagerForNode as wn,useHostFilesystem as bn}from"@php-wasm/node";import{WebSocketServer as En}from"ws";import xn from"net";import"assert";import xe,{resolve as Ie,normalize as Tn,join as Dn}from"path";import{format as kr}from"util";import{fileURLToPath as In}from"url";import vn from"timers";var H=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ve={exports:{}},Et=typeof Reflect=="object"?Reflect:null,Ge=Et&&typeof Et.apply=="function"?Et.apply:function(o,f,u){return Function.prototype.apply.call(o,f,u)},At;Et&&typeof Et.ownKeys=="function"?At=Et.ownKeys:Object.getOwnPropertySymbols?At=function(o){return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))}:At=function(o){return Object.getOwnPropertyNames(o)};function Nn(l){console&&console.warn&&console.warn(l)}var Vr=Number.isNaN||function(o){return o!==o};function Z(){Z.init.call(this)}ve.exports=Z;ve.exports.once=Ln;Z.EventEmitter=Z;Z.prototype._events=void 0;Z.prototype._eventsCount=0;Z.prototype._maxListeners=void 0;var He=10;function Lt(l){if(typeof l!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof l)}Object.defineProperty(Z,"defaultMaxListeners",{enumerable:!0,get:function(){return He},set:function(l){if(typeof l!="number"||l<0||Vr(l))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+l+".");He=l}});Z.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};Z.prototype.setMaxListeners=function(o){if(typeof o!="number"||o<0||Vr(o))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+o+".");return this._maxListeners=o,this};function Wr(l){return l._maxListeners===void 0?Z.defaultMaxListeners:l._maxListeners}Z.prototype.getMaxListeners=function(){return Wr(this)};Z.prototype.emit=function(o){for(var f=[],u=1;u<arguments.length;u++)f.push(arguments[u]);var p=o==="error",i=this._events;if(i!==void 0)p=p&&i.error===void 0;else if(!p)return!1;if(p){var r;if(f.length>0&&(r=f[0]),r instanceof Error)throw r;var n=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw n.context=r,n}var m=i[o];if(m===void 0)return!1;if(typeof m=="function")Ge(m,this,f);else for(var N=m.length,w=zr(m,N),u=0;u<N;++u)Ge(w[u],this,f);return!0};function $r(l,o,f,u){var p,i,r;if(Lt(f),i=l._events,i===void 0?(i=l._events=Object.create(null),l._eventsCount=0):(i.newListener!==void 0&&(l.emit("newListener",o,f.listener?f.listener:f),i=l._events),r=i[o]),r===void 0)r=i[o]=f,++l._eventsCount;else if(typeof r=="function"?r=i[o]=u?[f,r]:[r,f]:u?r.unshift(f):r.push(f),p=Wr(l),p>0&&r.length>p&&!r.warned){r.warned=!0;var n=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(o)+" listeners added. Use emitter.setMaxListeners() to increase limit");n.name="MaxListenersExceededWarning",n.emitter=l,n.type=o,n.count=r.length,Nn(n)}return l}Z.prototype.addListener=function(o,f){return $r(this,o,f,!1)};Z.prototype.on=Z.prototype.addListener;Z.prototype.prependListener=function(o,f){return $r(this,o,f,!0)};function On(){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 Gr(l,o,f){var u={fired:!1,wrapFn:void 0,target:l,type:o,listener:f},p=On.bind(u);return p.listener=f,u.wrapFn=p,p}Z.prototype.once=function(o,f){return Lt(f),this.on(o,Gr(this,o,f)),this};Z.prototype.prependOnceListener=function(o,f){return Lt(f),this.prependListener(o,Gr(this,o,f)),this};Z.prototype.removeListener=function(o,f){var u,p,i,r,n;if(Lt(f),p=this._events,p===void 0)return this;if(u=p[o],u===void 0)return this;if(u===f||u.listener===f)--this._eventsCount===0?this._events=Object.create(null):(delete p[o],p.removeListener&&this.emit("removeListener",o,u.listener||f));else if(typeof u!="function"){for(i=-1,r=u.length-1;r>=0;r--)if(u[r]===f||u[r].listener===f){n=u[r].listener,i=r;break}if(i<0)return this;i===0?u.shift():Cn(u,i),u.length===1&&(p[o]=u[0]),p.removeListener!==void 0&&this.emit("removeListener",o,n||f)}return this};Z.prototype.off=Z.prototype.removeListener;Z.prototype.removeAllListeners=function(o){var f,u,p;if(u=this._events,u===void 0)return this;if(u.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):u[o]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete u[o]),this;if(arguments.length===0){var i=Object.keys(u),r;for(p=0;p<i.length;++p)r=i[p],r!=="removeListener"&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(f=u[o],typeof f=="function")this.removeListener(o,f);else if(f!==void 0)for(p=f.length-1;p>=0;p--)this.removeListener(o,f[p]);return this};function Hr(l,o,f){var u=l._events;if(u===void 0)return[];var p=u[o];return p===void 0?[]:typeof p=="function"?f?[p.listener||p]:[p]:f?An(p):zr(p,p.length)}Z.prototype.listeners=function(o){return Hr(this,o,!0)};Z.prototype.rawListeners=function(o){return Hr(this,o,!1)};Z.listenerCount=function(l,o){return typeof l.listenerCount=="function"?l.listenerCount(o):Yr.call(l,o)};Z.prototype.listenerCount=Yr;function Yr(l){var o=this._events;if(o!==void 0){var f=o[l];if(typeof f=="function")return 1;if(f!==void 0)return f.length}return 0}Z.prototype.eventNames=function(){return this._eventsCount>0?At(this._events):[]};function zr(l,o){for(var f=new Array(o),u=0;u<o;++u)f[u]=l[u];return f}function Cn(l,o){for(;o+1<l.length;o++)l[o]=l[o+1];l.pop()}function An(l){for(var o=new Array(l.length),f=0;f<o.length;++f)o[f]=l[f].listener||l[f];return o}function Ln(l,o){return new Promise(function(f,u){function p(r){l.removeListener(o,i),u(r)}function i(){typeof l.removeListener=="function"&&l.removeListener("error",p),f([].slice.call(arguments))}Kr(l,o,i,{once:!0}),o!=="error"&&_n(l,p,{once:!0})})}function _n(l,o,f){typeof l.on=="function"&&Kr(l,"error",o,f)}function Kr(l,o,f,u){if(typeof l.on=="function")u.once?l.once(o,f):l.on(o,f);else if(typeof l.addEventListener=="function")l.addEventListener(o,function p(i){u.once&&l.removeEventListener(o,p),f(i)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof l)}var Ne=ve.exports;class Mn extends Ne.EventEmitter{constructor(o=9229){super(),this.ws=null,this.wss=new En({port:o}),this.wss.on("connection",f=>{if(this.ws){f.close();return}this.ws=f,this.emit("clientConnected"),f.on("message",u=>{console.log("\x1B[1;32m[CDP][received]\x1B[0m",u.toString());let p;try{p=JSON.parse(u.toString())}catch{return}this.emit("message",p)}),f.on("close",()=>{this.ws=null,this.emit("clientDisconnected")}),f.on("error",u=>{this.emit("error",u)})})}sendMessage(o){if(!this.ws||this.ws.readyState!==this.ws.OPEN)return;const f=JSON.stringify(o);console.log("\x1B[1;32m[CDP][send]\x1B[0m",f),this.ws.send(f)}}class Pn extends Ne.EventEmitter{constructor(o=9003){super(),this.socket=null,this.buffer="",this.expectedLength=null,this.server=xn.createServer(),this.server.on("connection",f=>{if(this.socket){f.destroy();return}this.socket=f,f.setEncoding("utf8"),this.emit("connected"),f.on("data",u=>this.onData(u.toString())),f.on("close",()=>{this.socket=null,this.emit("close")}),f.on("error",u=>{this.emit("error",u)})}),this.server.listen(o)}onData(o){for(console.log("\x1B[1;32m[XDebug][received]]\x1B[0m",o),this.buffer+=o;;){if(this.expectedLength===null){const f=this.buffer.indexOf("\0");if(f===-1)break;const u=this.buffer.substring(0,f),p=parseInt(u,10);if(isNaN(p)){this.buffer="";break}this.expectedLength=p,this.buffer=this.buffer.slice(f+1)}if(this.expectedLength!==null&&this.buffer.length>=this.expectedLength){const f=this.buffer.substring(0,this.expectedLength);this.buffer=this.buffer.slice(this.expectedLength),this.buffer.startsWith("\0")&&(this.buffer=this.buffer.slice(1));const u=f.trim();this.expectedLength=null,this.emit("message",u);continue}break}}sendCommand(o){this.socket&&this.socket.write(o+"\0")}}/**
2
+ * @license
3
+ * Copyright (c) 2016, Contributors
4
+ * SPDX-License-Identifier: ISC
5
+ */function Nt(l){if(l!==l.toLowerCase()&&l!==l.toUpperCase()||(l=l.toLowerCase()),l.indexOf("-")===-1&&l.indexOf("_")===-1)return l;{let f="",u=!1;const p=l.match(/^-+/);for(let i=p?p[0].length:0;i<l.length;i++){let r=l.charAt(i);u&&(u=!1,r=r.toUpperCase()),i!==0&&(r==="-"||r==="_")?u=!0:r!=="-"&&r!=="_"&&(f+=r)}return f}}function Fn(l,o){const f=l.toLowerCase();o=o||"-";let u="";for(let p=0;p<l.length;p++){const i=f.charAt(p),r=l.charAt(p);i!==r&&p>0?u+=`${o}${f.charAt(p)}`:u+=r}return u}function Sn(l){return l==null?!1:typeof l=="number"||/^0x[0-9a-f]+$/i.test(l)?!0:/^0[^.]/.test(l)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(l)}/**
6
+ * @license
7
+ * Copyright (c) 2016, Contributors
8
+ * SPDX-License-Identifier: ISC
9
+ */function Bn(l){if(Array.isArray(l))return l.map(r=>typeof r!="string"?r+"":r);l=l.trim();let o=0,f=null,u=null,p=null;const i=[];for(let r=0;r<l.length;r++){if(f=u,u=l.charAt(r),u===" "&&!p){f!==" "&&o++;continue}u===p?p=null:(u==="'"||u==='"')&&!p&&(p=u),i[o]||(i[o]=""),i[o]+=u}return i}/**
10
+ * @license
11
+ * Copyright (c) 2016, Contributors
12
+ * SPDX-License-Identifier: ISC
13
+ */var lt;(function(l){l.BOOLEAN="boolean",l.STRING="string",l.NUMBER="number",l.ARRAY="array"})(lt||(lt={}));/**
14
+ * @license
15
+ * Copyright (c) 2016, Contributors
16
+ * SPDX-License-Identifier: ISC
17
+ */let ft;class Rn{constructor(o){ft=o}parse(o,f){const u=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},f),p=Bn(o),i=typeof o=="string",r=jn(Object.assign(Object.create(null),u.alias)),n=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},u.configuration),m=Object.assign(Object.create(null),u.default),N=u.configObjects||[],w=u.envPrefix,g=n["populate--"],x=g?"--":"_",E=Object.create(null),C=Object.create(null),M=u.__||ft.format,b={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:[]},D=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,T=new RegExp("^--"+n["negation-prefix"]+"(.+)");[].concat(u.array||[]).filter(Boolean).forEach(function(O){const s=typeof O=="object"?O.key:O,t=Object.keys(O).map(function(e){return{boolean:"bools",string:"strings",number:"numbers"}[e]}).filter(Boolean).pop();t&&(b[t][s]=!0),b.arrays[s]=!0,b.keys.push(s)}),[].concat(u.boolean||[]).filter(Boolean).forEach(function(O){b.bools[O]=!0,b.keys.push(O)}),[].concat(u.string||[]).filter(Boolean).forEach(function(O){b.strings[O]=!0,b.keys.push(O)}),[].concat(u.number||[]).filter(Boolean).forEach(function(O){b.numbers[O]=!0,b.keys.push(O)}),[].concat(u.count||[]).filter(Boolean).forEach(function(O){b.counts[O]=!0,b.keys.push(O)}),[].concat(u.normalize||[]).filter(Boolean).forEach(function(O){b.normalize[O]=!0,b.keys.push(O)}),typeof u.narg=="object"&&Object.entries(u.narg).forEach(([O,s])=>{typeof s=="number"&&(b.nargs[O]=s,b.keys.push(O))}),typeof u.coerce=="object"&&Object.entries(u.coerce).forEach(([O,s])=>{typeof s=="function"&&(b.coercions[O]=s,b.keys.push(O))}),typeof u.config<"u"&&(Array.isArray(u.config)||typeof u.config=="string"?[].concat(u.config).filter(Boolean).forEach(function(O){b.configs[O]=!0}):typeof u.config=="object"&&Object.entries(u.config).forEach(([O,s])=>{(typeof s=="boolean"||typeof s=="function")&&(b.configs[O]=s)})),bt(u.key,r,u.default,b.arrays),Object.keys(m).forEach(function(O){(b.aliases[O]||[]).forEach(function(s){m[s]=m[O]})});let h=null;it();let v=[];const A=Object.assign(Object.create(null),{_:[]}),j={};for(let O=0;O<p.length;O++){const s=p[O],t=s.replace(/^-{3,}/,"---");let e,a,I,_,P,q;if(s!=="--"&&/^-/.test(s)&&d(s))U(s);else if(t.match(/^---+(=|$)/)){U(s);continue}else if(s.match(/^--.+=/)||!n["short-option-groups"]&&s.match(/^-.+=/))_=s.match(/^--?([^=]+)=([\s\S]*)$/),_!==null&&Array.isArray(_)&&_.length>=3&&(k(_[1],b.arrays)?O=c(O,_[1],p,_[2]):k(_[1],b.nargs)!==!1?O=B(O,_[1],p,_[2]):F(_[1],_[2],!0));else if(s.match(T)&&n["boolean-negation"])_=s.match(T),_!==null&&Array.isArray(_)&&_.length>=2&&(a=_[1],F(a,k(a,b.arrays)?[!1]:!1));else if(s.match(/^--.+/)||!n["short-option-groups"]&&s.match(/^-[^-]+/))_=s.match(/^--?(.+)/),_!==null&&Array.isArray(_)&&_.length>=2&&(a=_[1],k(a,b.arrays)?O=c(O,a,p):k(a,b.nargs)!==!1?O=B(O,a,p):(P=p[O+1],P!==void 0&&(!P.match(/^-/)||P.match(D))&&!k(a,b.bools)&&!k(a,b.counts)||/^(true|false)$/.test(P)?(F(a,P),O++):F(a,L(a))));else if(s.match(/^-.\..+=/))_=s.match(/^-([^=]+)=([\s\S]*)$/),_!==null&&Array.isArray(_)&&_.length>=3&&F(_[1],_[2]);else if(s.match(/^-.\..+/)&&!s.match(D))P=p[O+1],_=s.match(/^-(.\..+)/),_!==null&&Array.isArray(_)&&_.length>=2&&(a=_[1],P!==void 0&&!P.match(/^-/)&&!k(a,b.bools)&&!k(a,b.counts)?(F(a,P),O++):F(a,L(a)));else if(s.match(/^-[^-]+/)&&!s.match(D)){I=s.slice(1,-1).split(""),e=!1;for(let V=0;V<I.length;V++){if(P=s.slice(V+2),I[V+1]&&I[V+1]==="="){q=s.slice(V+3),a=I[V],k(a,b.arrays)?O=c(O,a,p,q):k(a,b.nargs)!==!1?O=B(O,a,p,q):F(a,q),e=!0;break}if(P==="-"){F(I[V],P);continue}if(/[A-Za-z]/.test(I[V])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(P)&&k(P,b.bools)===!1){F(I[V],P),e=!0;break}if(I[V+1]&&I[V+1].match(/\W/)){F(I[V],P),e=!0;break}else F(I[V],L(I[V]))}a=s.slice(-1)[0],!e&&a!=="-"&&(k(a,b.arrays)?O=c(O,a,p):k(a,b.nargs)!==!1?O=B(O,a,p):(P=p[O+1],P!==void 0&&(!/^(-|--)[^-]/.test(P)||P.match(D))&&!k(a,b.bools)&&!k(a,b.counts)||/^(true|false)$/.test(P)?(F(a,P),O++):F(a,L(a))))}else if(s.match(/^-[0-9]$/)&&s.match(D)&&k(s.slice(1),b.bools))a=s.slice(1),F(a,L(a));else if(s==="--"){v=p.slice(O+1);break}else if(n["halt-at-non-option"]){v=p.slice(O);break}else U(s)}$(A,!0),$(A,!1),Y(A),z(),mt(A,b.aliases,m,!0),xt(A),n["set-placeholder-key"]&&gt(A),Object.keys(b.counts).forEach(function(O){Q(A,O.split("."))||F(O,0)}),g&&v.length&&(A[x]=[]),v.forEach(function(O){A[x].push(O)}),n["camel-case-expansion"]&&n["strip-dashed"]&&Object.keys(A).filter(O=>O!=="--"&&O.includes("-")).forEach(O=>{delete A[O]}),n["strip-aliased"]&&[].concat(...Object.keys(r).map(O=>r[O])).forEach(O=>{n["camel-case-expansion"]&&O.includes("-")&&delete A[O.split(".").map(s=>Nt(s)).join(".")],delete A[O]});function U(O){const s=W("_",O);(typeof s=="string"||typeof s=="number")&&A._.push(s)}function B(O,s,t,e){let a,I=k(s,b.nargs);if(I=typeof I!="number"||isNaN(I)?1:I,I===0)return G(e)||(h=Error(M("Argument unexpected for: %s",s))),F(s,L(s)),O;let _=G(e)?0:1;if(n["nargs-eats-options"])t.length-(O+1)+_<I&&(h=Error(M("Not enough arguments following: %s",s))),_=I;else{for(a=O+1;a<t.length&&(!t[a].match(/^-[^0-9]/)||t[a].match(D)||d(t[a]));a++)_++;_<I&&(h=Error(M("Not enough arguments following: %s",s)))}let P=Math.min(_,I);for(!G(e)&&P>0&&(F(s,e),P--),a=O+1;a<P+O+1;a++)F(s,t[a]);return O+P}function c(O,s,t,e){let a=[],I=e||t[O+1];const _=k(s,b.nargs);if(k(s,b.bools)&&!/^(true|false)$/.test(I))a.push(!0);else if(G(I)||G(e)&&/^-/.test(I)&&!D.test(I)&&!d(I)){if(m[s]!==void 0){const P=m[s];a=Array.isArray(P)?P:[P]}}else{G(e)||a.push(X(s,e,!0));for(let P=O+1;P<t.length&&!(!n["greedy-arrays"]&&a.length>0||_&&typeof _=="number"&&a.length>=_||(I=t[P],/^-/.test(I)&&!D.test(I)&&!d(I)));P++)O=P,a.push(X(s,I,i))}return typeof _=="number"&&(_&&a.length<_||isNaN(_)&&a.length===0)&&(h=Error(M("Not enough arguments following: %s",s))),F(s,a),O}function F(O,s,t=i){if(/-/.test(O)&&n["camel-case-expansion"]){const I=O.split(".").map(function(_){return Nt(_)}).join(".");R(O,I)}const e=X(O,s,t),a=O.split(".");et(A,a,e),b.aliases[O]&&b.aliases[O].forEach(function(I){const _=I.split(".");et(A,_,e)}),a.length>1&&n["dot-notation"]&&(b.aliases[a[0]]||[]).forEach(function(I){let _=I.split(".");const P=[].concat(a);P.shift(),_=_.concat(P),(b.aliases[O]||[]).includes(_.join("."))||et(A,_,e)}),k(O,b.normalize)&&!k(O,b.arrays)&&[O].concat(b.aliases[O]||[]).forEach(function(_){Object.defineProperty(j,_,{enumerable:!0,get(){return s},set(P){s=typeof P=="string"?ft.normalize(P):P}})})}function R(O,s){b.aliases[O]&&b.aliases[O].length||(b.aliases[O]=[s],E[s]=!0),b.aliases[s]&&b.aliases[s].length||R(s,O)}function X(O,s,t){t&&(s=Un(s)),(k(O,b.bools)||k(O,b.counts))&&typeof s=="string"&&(s=s==="true");let e=Array.isArray(s)?s.map(function(a){return W(O,a)}):W(O,s);return k(O,b.counts)&&(G(e)||typeof e=="boolean")&&(e=Pt()),k(O,b.normalize)&&k(O,b.arrays)&&(Array.isArray(s)?e=s.map(a=>ft.normalize(a)):e=ft.normalize(s)),e}function W(O,s){return!n["parse-positional-numbers"]&&O==="_"||!k(O,b.strings)&&!k(O,b.bools)&&!Array.isArray(s)&&(Sn(s)&&n["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${s}`)))||!G(s)&&k(O,b.numbers))&&(s=Number(s)),s}function Y(O){const s=Object.create(null);mt(s,b.aliases,m),Object.keys(b.configs).forEach(function(t){const e=O[t]||s[t];if(e)try{let a=null;const I=ft.resolve(ft.cwd(),e),_=b.configs[t];if(typeof _=="function"){try{a=_(I)}catch(P){a=P}if(a instanceof Error){h=a;return}}else a=ft.require(I);J(a)}catch(a){a.name==="PermissionDenied"?h=a:O[t]&&(h=Error(M("Invalid JSON config file: %s",e)))}})}function J(O,s){Object.keys(O).forEach(function(t){const e=O[t],a=s?s+"."+t:t;typeof e=="object"&&e!==null&&!Array.isArray(e)&&n["dot-notation"]?J(e,a):(!Q(A,a.split("."))||k(a,b.arrays)&&n["combine-arrays"])&&F(a,e)})}function z(){typeof N<"u"&&N.forEach(function(O){J(O)})}function $(O,s){if(typeof w>"u")return;const t=typeof w=="string"?w:"",e=ft.env();Object.keys(e).forEach(function(a){if(t===""||a.lastIndexOf(t,0)===0){const I=a.split("__").map(function(_,P){return P===0&&(_=_.substring(t.length)),Nt(_)});(s&&b.configs[I.join(".")]||!s)&&!Q(O,I)&&F(I.join("."),e[a])}})}function xt(O){let s;const t=new Set;Object.keys(O).forEach(function(e){if(!t.has(e)&&(s=k(e,b.coercions),typeof s=="function"))try{const a=W(e,s(O[e]));[].concat(b.aliases[e]||[],e).forEach(I=>{t.add(I),O[I]=a})}catch(a){h=a}})}function gt(O){return b.keys.forEach(s=>{~s.indexOf(".")||typeof O[s]>"u"&&(O[s]=void 0)}),O}function mt(O,s,t,e=!1){Object.keys(t).forEach(function(a){Q(O,a.split("."))||(et(O,a.split("."),t[a]),e&&(C[a]=!0),(s[a]||[]).forEach(function(I){Q(O,I.split("."))||et(O,I.split("."),t[a])}))})}function Q(O,s){let t=O;n["dot-notation"]||(s=[s.join(".")]),s.slice(0,-1).forEach(function(a){t=t[a]||{}});const e=s[s.length-1];return typeof t!="object"?!1:e in t}function et(O,s,t){let e=O;n["dot-notation"]||(s=[s.join(".")]),s.slice(0,-1).forEach(function(q){q=Ye(q),typeof e=="object"&&e[q]===void 0&&(e[q]={}),typeof e[q]!="object"||Array.isArray(e[q])?(Array.isArray(e[q])?e[q].push({}):e[q]=[e[q],{}],e=e[q][e[q].length-1]):e=e[q]});const a=Ye(s[s.length-1]),I=k(s.join("."),b.arrays),_=Array.isArray(t);let P=n["duplicate-arguments-array"];!P&&k(a,b.nargs)&&(P=!0,(!G(e[a])&&b.nargs[a]===1||Array.isArray(e[a])&&e[a].length===b.nargs[a])&&(e[a]=void 0)),t===Pt()?e[a]=Pt(e[a]):Array.isArray(e[a])?P&&I&&_?e[a]=n["flatten-duplicate-arrays"]?e[a].concat(t):(Array.isArray(e[a][0])?e[a]:[e[a]]).concat([t]):!P&&!!I==!!_?e[a]=t:e[a]=e[a].concat([t]):e[a]===void 0&&I?e[a]=_?t:[t]:P&&!(e[a]===void 0||k(a,b.counts)||k(a,b.bools))?e[a]=[e[a],t]:e[a]=t}function bt(...O){O.forEach(function(s){Object.keys(s||{}).forEach(function(t){b.aliases[t]||(b.aliases[t]=[].concat(r[t]||[]),b.aliases[t].concat(t).forEach(function(e){if(/-/.test(e)&&n["camel-case-expansion"]){const a=Nt(e);a!==t&&b.aliases[t].indexOf(a)===-1&&(b.aliases[t].push(a),E[a]=!0)}}),b.aliases[t].concat(t).forEach(function(e){if(e.length>1&&/[A-Z]/.test(e)&&n["camel-case-expansion"]){const a=Fn(e,"-");a!==t&&b.aliases[t].indexOf(a)===-1&&(b.aliases[t].push(a),E[a]=!0)}}),b.aliases[t].forEach(function(e){b.aliases[e]=[t].concat(b.aliases[t].filter(function(a){return e!==a}))}))})})}function k(O,s){const t=[].concat(b.aliases[O]||[],O),e=Object.keys(s),a=t.find(I=>e.includes(I));return a?s[a]:!1}function yt(O){const s=Object.keys(b);return[].concat(s.map(e=>b[e])).some(function(e){return Array.isArray(e)?e.includes(O):e[O]})}function Tt(O,...s){return[].concat(...s).some(function(e){const a=O.match(e);return a&&yt(a[1])})}function y(O){if(O.match(D)||!O.match(/^-[^-]+/))return!1;let s=!0,t;const e=O.slice(1).split("");for(let a=0;a<e.length;a++){if(t=O.slice(a+2),!yt(e[a])){s=!1;break}if(e[a+1]&&e[a+1]==="="||t==="-"||/[A-Za-z]/.test(e[a])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(t)||e[a+1]&&e[a+1].match(/\W/))break}return s}function d(O){return n["unknown-options-as-args"]&&S(O)}function S(O){return O=O.replace(/^-{3,}/,"--"),O.match(D)||y(O)?!1:!Tt(O,/^-+([^=]+?)=[\s\S]*$/,T,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function L(O){return!k(O,b.bools)&&!k(O,b.counts)&&`${O}`in m?m[O]:K(tt(O))}function K(O){return{[lt.BOOLEAN]:!0,[lt.STRING]:"",[lt.NUMBER]:void 0,[lt.ARRAY]:[]}[O]}function tt(O){let s=lt.BOOLEAN;return k(O,b.strings)?s=lt.STRING:k(O,b.numbers)?s=lt.NUMBER:k(O,b.bools)?s=lt.BOOLEAN:k(O,b.arrays)&&(s=lt.ARRAY),s}function G(O){return O===void 0}function it(){Object.keys(b.counts).find(O=>k(O,b.arrays)?(h=Error(M("Invalid configuration: %s, opts.count excludes opts.array.",O)),!0):k(O,b.nargs)?(h=Error(M("Invalid configuration: %s, opts.count excludes opts.narg.",O)),!0):!1)}return{aliases:Object.assign({},b.aliases),argv:Object.assign(j,A),configuration:n,defaulted:Object.assign({},C),error:h,newAliases:Object.assign({},E)}}}function jn(l){const o=[],f=Object.create(null);let u=!0;for(Object.keys(l).forEach(function(p){o.push([].concat(l[p],p))});u;){u=!1;for(let p=0;p<o.length;p++)for(let i=p+1;i<o.length;i++)if(o[p].filter(function(n){return o[i].indexOf(n)!==-1}).length){o[p]=o[p].concat(o[i]),o.splice(i,1),u=!0;break}}return o.forEach(function(p){p=p.filter(function(r,n,m){return m.indexOf(r)===n});const i=p.pop();i!==void 0&&typeof i=="string"&&(f[i]=p)}),f}function Pt(l){return l!==void 0?l+1:1}function Ye(l){return l==="__proto__"?"___proto___":l}function Un(l){return typeof l=="string"&&(l[0]==="'"||l[0]==='"')&&l[l.length-1]===l[0]?l.substring(1,l.length-1):l}/**
18
+ * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
19
+ * CJS and ESM environments.
20
+ *
21
+ * @license
22
+ * Copyright (c) 2016, Contributors
23
+ * SPDX-License-Identifier: ISC
24
+ */var Ft,St,Bt;const ze=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,Ke=(St=(Ft=process==null?void 0:process.versions)===null||Ft===void 0?void 0:Ft.node)!==null&&St!==void 0?St:(Bt=process==null?void 0:process.version)===null||Bt===void 0?void 0:Bt.slice(1);if(Ke&&Number(Ke.match(/^([^.]+)/)[1])<ze)throw Error(`yargs parser supports a minimum Node.js version of ${ze}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const Xn=process?process.env:{};new Rn({cwd:process.cwd,env:()=>Xn,format:kr,normalize:Tn,resolve:Ie,require:l=>{if(typeof require<"u")return require(l);if(l.match(/\.json$/))return JSON.parse(De(l,"utf8"));throw Error("only .json config files are supported in ESM")}});const qn={fs:{readFileSync:De,writeFile:an},format:kr,resolve:Ie,exists:l=>{try{return un(l).isFile()}catch{return!1}}};let ct;class kn{constructor(o){o=o||{},this.directory=o.directory||"./locales",this.updateFiles=typeof o.updateFiles=="boolean"?o.updateFiles:!0,this.locale=o.locale||"en",this.fallbackToLanguage=typeof o.fallbackToLanguage=="boolean"?o.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...o){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);const f=o.shift();let u=function(){};return typeof o[o.length-1]=="function"&&(u=o.pop()),u=u||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][f]&&this.updateFiles?(this.cache[this.locale][f]=f,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:u})):u(),ct.format.apply(ct.format,[this.cache[this.locale][f]||f].concat(o))}__n(){const o=Array.prototype.slice.call(arguments),f=o.shift(),u=o.shift(),p=o.shift();let i=function(){};typeof o[o.length-1]=="function"&&(i=o.pop()),this.cache[this.locale]||this._readLocaleFile();let r=p===1?f:u;this.cache[this.locale][f]&&(r=this.cache[this.locale][f][p===1?"one":"other"]),!this.cache[this.locale][f]&&this.updateFiles?(this.cache[this.locale][f]={one:f,other:u},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();const n=[r];return~r.indexOf("%d")&&n.push(p),ct.format.apply(ct.format,n.concat(o))}setLocale(o){this.locale=o}getLocale(){return this.locale}updateLocale(o){this.cache[this.locale]||this._readLocaleFile();for(const f in o)Object.prototype.hasOwnProperty.call(o,f)&&(this.cache[this.locale][f]=o[f])}_taggedLiteral(o,...f){let u="";return o.forEach(function(p,i){const r=f[i+1];u+=p,typeof r<"u"&&(u+="%s")}),this.__.apply(this,[u].concat([].slice.call(f,1)))}_enqueueWrite(o){this.writeQueue.push(o),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){const o=this,f=this.writeQueue[0],u=f.directory,p=f.locale,i=f.cb,r=this._resolveLocaleFile(u,p),n=JSON.stringify(this.cache[p],null,2);ct.fs.writeFile(r,n,"utf-8",function(m){o.writeQueue.shift(),o.writeQueue.length>0&&o._processWriteQueue(),i(m)})}_readLocaleFile(){let o={};const f=this._resolveLocaleFile(this.directory,this.locale);try{ct.fs.readFileSync&&(o=JSON.parse(ct.fs.readFileSync(f,"utf-8")))}catch(u){if(u instanceof SyntaxError&&(u.message="syntax error in "+f),u.code==="ENOENT")o={};else throw u}this.cache[this.locale]=o}_resolveLocaleFile(o,f){let u=ct.resolve(o,"./",f+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(u)&&~f.lastIndexOf("_")){const p=ct.resolve(o,"./",f.split("_")[0]+".json");this._fileExistsSync(p)&&(u=p)}return u}_fileExistsSync(o){return ct.exists(o)}}function Vn(l,o){ct=o;const f=new kn(l);return{__:f.__.bind(f),__n:f.__n.bind(f),setLocale:f.setLocale.bind(f),getLocale:f.getLocale.bind(f),updateLocale:f.updateLocale.bind(f),locale:f.locale}}const Wn=l=>Vn(l,qn);let It;try{It=In(import.meta.url)}catch{It=process.cwd()}const $n=It.substring(0,It.lastIndexOf("node_modules"));$n||process.cwd(),process.cwd,process.exit,process.nextTick,typeof process.stdout.columns<"u"&&process.stdout.columns,Wn({directory:Ie(It,"../../../locales"),updateFiles:!1});var Rt={},Qe;function Oe(){return Qe||(Qe=1,function(){Rt.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:`
25
+ `},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}.call(H)),Rt}var jt={},ht={},pt={},Je;function dt(){return Je||(Je=1,function(){var l,o,f,u,p,i,r,n=[].slice,m={}.hasOwnProperty;l=function(){var N,w,g,x,E,C;if(C=arguments[0],E=2<=arguments.length?n.call(arguments,1):[],p(Object.assign))Object.assign.apply(null,arguments);else for(N=0,g=E.length;N<g;N++)if(x=E[N],x!=null)for(w in x)m.call(x,w)&&(C[w]=x[w]);return C},p=function(N){return!!N&&Object.prototype.toString.call(N)==="[object Function]"},i=function(N){var w;return!!N&&((w=typeof N)=="function"||w==="object")},f=function(N){return p(Array.isArray)?Array.isArray(N):Object.prototype.toString.call(N)==="[object Array]"},u=function(N){var w;if(f(N))return!N.length;for(w in N)if(m.call(N,w))return!1;return!0},r=function(N){var w,g;return i(N)&&(g=Object.getPrototypeOf(N))&&(w=g.constructor)&&typeof w=="function"&&w instanceof w&&Function.prototype.toString.call(w)===Function.prototype.toString.call(Object)},o=function(N){return p(N.valueOf)?N.valueOf():N},pt.assign=l,pt.isFunction=p,pt.isObject=i,pt.isArray=f,pt.isEmpty=u,pt.isPlainObject=r,pt.getValue=o}.call(H)),pt}var Ut={exports:{}},Ze;function Qr(){return Ze||(Ze=1,function(){Ut.exports=function(){function l(){}return l.prototype.hasFeature=function(o,f){return!0},l.prototype.createDocumentType=function(o,f,u){throw new Error("This DOM method is not implemented.")},l.prototype.createDocument=function(o,f,u){throw new Error("This DOM method is not implemented.")},l.prototype.createHTMLDocument=function(o){throw new Error("This DOM method is not implemented.")},l.prototype.getFeature=function(o,f){throw new Error("This DOM method is not implemented.")},l}()}.call(H)),Ut.exports}var Xt={exports:{}},qt={exports:{}},kt={exports:{}},tr;function Gn(){return tr||(tr=1,function(){kt.exports=function(){function l(){}return l.prototype.handleError=function(o){throw new Error(o)},l}()}.call(H)),kt.exports}var Vt={exports:{}},er;function Hn(){return er||(er=1,function(){Vt.exports=function(){function l(o){this.arr=o||[]}return Object.defineProperty(l.prototype,"length",{get:function(){return this.arr.length}}),l.prototype.item=function(o){return this.arr[o]||null},l.prototype.contains=function(o){return this.arr.indexOf(o)!==-1},l}()}.call(H)),Vt.exports}var rr;function Yn(){return rr||(rr=1,function(){var l,o;l=Gn(),o=Hn(),qt.exports=function(){function f(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new l,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(f.prototype,"parameterNames",{get:function(){return new o(Object.keys(this.defaultParams))}}),f.prototype.getParameter=function(u){return this.params.hasOwnProperty(u)?this.params[u]:null},f.prototype.canSetParameter=function(u,p){return!0},f.prototype.setParameter=function(u,p){return p!=null?this.params[u]=p:delete this.params[u]},f}()}.call(H)),qt.exports}var Wt={exports:{}},$t={exports:{}},Gt={exports:{}},nr;function ot(){return nr||(nr=1,function(){Gt.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(H)),Gt.exports}var Ht={exports:{}},ir;function Jr(){return ir||(ir=1,function(){var l;l=ot(),ut(),Ht.exports=function(){function o(f,u,p){if(this.parent=f,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),u==null)throw new Error("Missing attribute name. "+this.debugInfo(u));this.name=this.stringify.name(u),this.value=this.stringify.attValue(p),this.type=l.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(o.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(o.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(o.prototype,"textContent",{get:function(){return this.value},set:function(f){return this.value=f||""}}),Object.defineProperty(o.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(o.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(o.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(o.prototype,"specified",{get:function(){return!0}}),o.prototype.clone=function(){return Object.create(this)},o.prototype.toString=function(f){return this.options.writer.attribute(this,this.options.writer.filterOptions(f))},o.prototype.debugInfo=function(f){return f=f||this.name,f==null?"parent: <"+this.parent.name+">":"attribute: {"+f+"}, parent: <"+this.parent.name+">"},o.prototype.isEqualNode=function(f){return!(f.namespaceURI!==this.namespaceURI||f.prefix!==this.prefix||f.localName!==this.localName||f.value!==this.value)},o}()}.call(H)),Ht.exports}var Yt={exports:{}},or;function Ce(){return or||(or=1,function(){Yt.exports=function(){function l(o){this.nodes=o}return Object.defineProperty(l.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),l.prototype.clone=function(){return this.nodes=null},l.prototype.getNamedItem=function(o){return this.nodes[o]},l.prototype.setNamedItem=function(o){var f;return f=this.nodes[o.nodeName],this.nodes[o.nodeName]=o,f||null},l.prototype.removeNamedItem=function(o){var f;return f=this.nodes[o],delete this.nodes[o],f||null},l.prototype.item=function(o){return this.nodes[Object.keys(this.nodes)[o]]||null},l.prototype.getNamedItemNS=function(o,f){throw new Error("This DOM method is not implemented.")},l.prototype.setNamedItemNS=function(o){throw new Error("This DOM method is not implemented.")},l.prototype.removeNamedItemNS=function(o,f){throw new Error("This DOM method is not implemented.")},l}()}.call(H)),Yt.exports}var sr;function Ae(){return sr||(sr=1,function(){var l,o,f,u,p,i,r,n,m=function(w,g){for(var x in g)N.call(g,x)&&(w[x]=g[x]);function E(){this.constructor=w}return E.prototype=g.prototype,w.prototype=new E,w.__super__=g.prototype,w},N={}.hasOwnProperty;n=dt(),r=n.isObject,i=n.isFunction,p=n.getValue,u=ut(),l=ot(),o=Jr(),f=Ce(),$t.exports=function(w){m(g,w);function g(x,E,C){var M,b,D,T;if(g.__super__.constructor.call(this,x),E==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(E),this.type=l.Element,this.attribs={},this.schemaTypeInfo=null,C!=null&&this.attribute(C),x.type===l.Document&&(this.isRoot=!0,this.documentObject=x,x.rootObject=this,x.children)){for(T=x.children,b=0,D=T.length;b<D;b++)if(M=T[b],M.type===l.DocType){M.name=this.name;break}}}return Object.defineProperty(g.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(g.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(g.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(g.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(g.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(g.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(g.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(g.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new f(this.attribs)),this.attributeMap}}),g.prototype.clone=function(){var x,E,C,M;C=Object.create(this),C.isRoot&&(C.documentObject=null),C.attribs={},M=this.attribs;for(E in M)N.call(M,E)&&(x=M[E],C.attribs[E]=x.clone());return C.children=[],this.children.forEach(function(b){var D;return D=b.clone(),D.parent=C,C.children.push(D)}),C},g.prototype.attribute=function(x,E){var C,M;if(x!=null&&(x=p(x)),r(x))for(C in x)N.call(x,C)&&(M=x[C],this.attribute(C,M));else i(E)&&(E=E.apply()),this.options.keepNullAttributes&&E==null?this.attribs[x]=new o(this,x,""):E!=null&&(this.attribs[x]=new o(this,x,E));return this},g.prototype.removeAttribute=function(x){var E,C,M;if(x==null)throw new Error("Missing attribute name. "+this.debugInfo());if(x=p(x),Array.isArray(x))for(C=0,M=x.length;C<M;C++)E=x[C],delete this.attribs[E];else delete this.attribs[x];return this},g.prototype.toString=function(x){return this.options.writer.element(this,this.options.writer.filterOptions(x))},g.prototype.att=function(x,E){return this.attribute(x,E)},g.prototype.a=function(x,E){return this.attribute(x,E)},g.prototype.getAttribute=function(x){return this.attribs.hasOwnProperty(x)?this.attribs[x].value:null},g.prototype.setAttribute=function(x,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNode=function(x){return this.attribs.hasOwnProperty(x)?this.attribs[x]:null},g.prototype.setAttributeNode=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNode=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNS=function(x,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNS=function(x,E,C){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNS=function(x,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNodeNS=function(x,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNodeNS=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(x,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.hasAttribute=function(x){return this.attribs.hasOwnProperty(x)},g.prototype.hasAttributeNS=function(x,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttribute=function(x,E){return this.attribs.hasOwnProperty(x)?this.attribs[x].isId:E},g.prototype.setIdAttributeNS=function(x,E,C){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttributeNode=function(x,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(x,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByClassName=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isEqualNode=function(x){var E,C,M;if(!g.__super__.isEqualNode.apply(this,arguments).isEqualNode(x)||x.namespaceURI!==this.namespaceURI||x.prefix!==this.prefix||x.localName!==this.localName||x.attribs.length!==this.attribs.length)return!1;for(E=C=0,M=this.attribs.length-1;0<=M?C<=M:C>=M;E=0<=M?++C:--C)if(!this.attribs[E].isEqualNode(x.attribs[E]))return!1;return!0},g}(u)}.call(H)),$t.exports}var zt={exports:{}},Kt={exports:{}},ar;function _t(){return ar||(ar=1,function(){var l,o=function(u,p){for(var i in p)f.call(p,i)&&(u[i]=p[i]);function r(){this.constructor=u}return r.prototype=p.prototype,u.prototype=new r,u.__super__=p.prototype,u},f={}.hasOwnProperty;l=ut(),Kt.exports=function(u){o(p,u);function p(i){p.__super__.constructor.call(this,i),this.value=""}return Object.defineProperty(p.prototype,"data",{get:function(){return this.value},set:function(i){return this.value=i||""}}),Object.defineProperty(p.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(p.prototype,"textContent",{get:function(){return this.value},set:function(i){return this.value=i||""}}),p.prototype.clone=function(){return Object.create(this)},p.prototype.substringData=function(i,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.appendData=function(i){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.insertData=function(i,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.deleteData=function(i,r){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.replaceData=function(i,r,n){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.isEqualNode=function(i){return!(!p.__super__.isEqualNode.apply(this,arguments).isEqualNode(i)||i.data!==this.data)},p}(l)}.call(H)),Kt.exports}var ur;function Le(){return ur||(ur=1,function(){var l,o,f=function(p,i){for(var r in i)u.call(i,r)&&(p[r]=i[r]);function n(){this.constructor=p}return n.prototype=i.prototype,p.prototype=new n,p.__super__=i.prototype,p},u={}.hasOwnProperty;l=ot(),o=_t(),zt.exports=function(p){f(i,p);function i(r,n){if(i.__super__.constructor.call(this,r),n==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=l.CData,this.value=this.stringify.cdata(n)}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}(o)}.call(H)),zt.exports}var Qt={exports:{}},cr;function _e(){return cr||(cr=1,function(){var l,o,f=function(p,i){for(var r in i)u.call(i,r)&&(p[r]=i[r]);function n(){this.constructor=p}return n.prototype=i.prototype,p.prototype=new n,p.__super__=i.prototype,p},u={}.hasOwnProperty;l=ot(),o=_t(),Qt.exports=function(p){f(i,p);function i(r,n){if(i.__super__.constructor.call(this,r),n==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=l.Comment,this.value=this.stringify.comment(n)}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}(o)}.call(H)),Qt.exports}var Jt={exports:{}},lr;function Me(){return lr||(lr=1,function(){var l,o,f,u=function(i,r){for(var n in r)p.call(r,n)&&(i[n]=r[n]);function m(){this.constructor=i}return m.prototype=r.prototype,i.prototype=new m,i.__super__=r.prototype,i},p={}.hasOwnProperty;f=dt().isObject,o=ut(),l=ot(),Jt.exports=function(i){u(r,i);function r(n,m,N,w){var g;r.__super__.constructor.call(this,n),f(m)&&(g=m,m=g.version,N=g.encoding,w=g.standalone),m||(m="1.0"),this.type=l.Declaration,this.version=this.stringify.xmlVersion(m),N!=null&&(this.encoding=this.stringify.xmlEncoding(N)),w!=null&&(this.standalone=this.stringify.xmlStandalone(w))}return r.prototype.toString=function(n){return this.options.writer.declaration(this,this.options.writer.filterOptions(n))},r}(o)}.call(H)),Jt.exports}var Zt={exports:{}},te={exports:{}},fr;function Pe(){return fr||(fr=1,function(){var l,o,f=function(p,i){for(var r in i)u.call(i,r)&&(p[r]=i[r]);function n(){this.constructor=p}return n.prototype=i.prototype,p.prototype=new n,p.__super__=i.prototype,p},u={}.hasOwnProperty;o=ut(),l=ot(),te.exports=function(p){f(i,p);function i(r,n,m,N,w,g){if(i.__super__.constructor.call(this,r),n==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(m==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(n));if(!N)throw new Error("Missing DTD attribute type. "+this.debugInfo(n));if(!w)throw new Error("Missing DTD attribute default. "+this.debugInfo(n));if(w.indexOf("#")!==0&&(w="#"+w),!w.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(n));if(g&&!w.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(n));this.elementName=this.stringify.name(n),this.type=l.AttributeDeclaration,this.attributeName=this.stringify.name(m),this.attributeType=this.stringify.dtdAttType(N),g&&(this.defaultValue=this.stringify.dtdAttDefault(g)),this.defaultValueType=w}return i.prototype.toString=function(r){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(r))},i}(o)}.call(H)),te.exports}var ee={exports:{}},hr;function Fe(){return hr||(hr=1,function(){var l,o,f,u=function(i,r){for(var n in r)p.call(r,n)&&(i[n]=r[n]);function m(){this.constructor=i}return m.prototype=r.prototype,i.prototype=new m,i.__super__=r.prototype,i},p={}.hasOwnProperty;f=dt().isObject,o=ut(),l=ot(),ee.exports=function(i){u(r,i);function r(n,m,N,w){if(r.__super__.constructor.call(this,n),N==null)throw new Error("Missing DTD entity name. "+this.debugInfo(N));if(w==null)throw new Error("Missing DTD entity value. "+this.debugInfo(N));if(this.pe=!!m,this.name=this.stringify.name(N),this.type=l.EntityDeclaration,!f(w))this.value=this.stringify.dtdEntityValue(w),this.internal=!0;else{if(!w.pubID&&!w.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(N));if(w.pubID&&!w.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(N));if(this.internal=!1,w.pubID!=null&&(this.pubID=this.stringify.dtdPubID(w.pubID)),w.sysID!=null&&(this.sysID=this.stringify.dtdSysID(w.sysID)),w.nData!=null&&(this.nData=this.stringify.dtdNData(w.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(N))}}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(n){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(n))},r}(o)}.call(H)),ee.exports}var re={exports:{}},pr;function Se(){return pr||(pr=1,function(){var l,o,f=function(p,i){for(var r in i)u.call(i,r)&&(p[r]=i[r]);function n(){this.constructor=p}return n.prototype=i.prototype,p.prototype=new n,p.__super__=i.prototype,p},u={}.hasOwnProperty;o=ut(),l=ot(),re.exports=function(p){f(i,p);function i(r,n,m){if(i.__super__.constructor.call(this,r),n==null)throw new Error("Missing DTD element name. "+this.debugInfo());m||(m="(#PCDATA)"),Array.isArray(m)&&(m="("+m.join(",")+")"),this.name=this.stringify.name(n),this.type=l.ElementDeclaration,this.value=this.stringify.dtdElementValue(m)}return i.prototype.toString=function(r){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(r))},i}(o)}.call(H)),re.exports}var ne={exports:{}},dr;function Be(){return dr||(dr=1,function(){var l,o,f=function(p,i){for(var r in i)u.call(i,r)&&(p[r]=i[r]);function n(){this.constructor=p}return n.prototype=i.prototype,p.prototype=new n,p.__super__=i.prototype,p},u={}.hasOwnProperty;o=ut(),l=ot(),ne.exports=function(p){f(i,p);function i(r,n,m){if(i.__super__.constructor.call(this,r),n==null)throw new Error("Missing DTD notation name. "+this.debugInfo(n));if(!m.pubID&&!m.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(n));this.name=this.stringify.name(n),this.type=l.NotationDeclaration,m.pubID!=null&&(this.pubID=this.stringify.dtdPubID(m.pubID)),m.sysID!=null&&(this.sysID=this.stringify.dtdSysID(m.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}(o)}.call(H)),ne.exports}var mr;function Re(){return mr||(mr=1,function(){var l,o,f,u,p,i,r,n,m=function(w,g){for(var x in g)N.call(g,x)&&(w[x]=g[x]);function E(){this.constructor=w}return E.prototype=g.prototype,w.prototype=new E,w.__super__=g.prototype,w},N={}.hasOwnProperty;n=dt().isObject,r=ut(),l=ot(),o=Pe(),u=Fe(),f=Se(),p=Be(),i=Ce(),Zt.exports=function(w){m(g,w);function g(x,E,C){var M,b,D,T,h,v;if(g.__super__.constructor.call(this,x),this.type=l.DocType,x.children){for(T=x.children,b=0,D=T.length;b<D;b++)if(M=T[b],M.type===l.Element){this.name=M.name;break}}this.documentObject=x,n(E)&&(h=E,E=h.pubID,C=h.sysID),C==null&&(v=[E,C],C=v[0],E=v[1]),E!=null&&(this.pubID=this.stringify.dtdPubID(E)),C!=null&&(this.sysID=this.stringify.dtdSysID(C))}return Object.defineProperty(g.prototype,"entities",{get:function(){var x,E,C,M,b;for(M={},b=this.children,E=0,C=b.length;E<C;E++)x=b[E],x.type===l.EntityDeclaration&&!x.pe&&(M[x.name]=x);return new i(M)}}),Object.defineProperty(g.prototype,"notations",{get:function(){var x,E,C,M,b;for(M={},b=this.children,E=0,C=b.length;E<C;E++)x=b[E],x.type===l.NotationDeclaration&&(M[x.name]=x);return new i(M)}}),Object.defineProperty(g.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(g.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(g.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),g.prototype.element=function(x,E){var C;return C=new f(this,x,E),this.children.push(C),this},g.prototype.attList=function(x,E,C,M,b){var D;return D=new o(this,x,E,C,M,b),this.children.push(D),this},g.prototype.entity=function(x,E){var C;return C=new u(this,!1,x,E),this.children.push(C),this},g.prototype.pEntity=function(x,E){var C;return C=new u(this,!0,x,E),this.children.push(C),this},g.prototype.notation=function(x,E){var C;return C=new p(this,x,E),this.children.push(C),this},g.prototype.toString=function(x){return this.options.writer.docType(this,this.options.writer.filterOptions(x))},g.prototype.ele=function(x,E){return this.element(x,E)},g.prototype.att=function(x,E,C,M,b){return this.attList(x,E,C,M,b)},g.prototype.ent=function(x,E){return this.entity(x,E)},g.prototype.pent=function(x,E){return this.pEntity(x,E)},g.prototype.not=function(x,E){return this.notation(x,E)},g.prototype.up=function(){return this.root()||this.documentObject},g.prototype.isEqualNode=function(x){return!(!g.__super__.isEqualNode.apply(this,arguments).isEqualNode(x)||x.name!==this.name||x.publicId!==this.publicId||x.systemId!==this.systemId)},g}(r)}.call(H)),Zt.exports}var ie={exports:{}},yr;function je(){return yr||(yr=1,function(){var l,o,f=function(p,i){for(var r in i)u.call(i,r)&&(p[r]=i[r]);function n(){this.constructor=p}return n.prototype=i.prototype,p.prototype=new n,p.__super__=i.prototype,p},u={}.hasOwnProperty;l=ot(),o=ut(),ie.exports=function(p){f(i,p);function i(r,n){if(i.__super__.constructor.call(this,r),n==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=l.Raw,this.value=this.stringify.raw(n)}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}(o)}.call(H)),ie.exports}var oe={exports:{}},gr;function Ue(){return gr||(gr=1,function(){var l,o,f=function(p,i){for(var r in i)u.call(i,r)&&(p[r]=i[r]);function n(){this.constructor=p}return n.prototype=i.prototype,p.prototype=new n,p.__super__=i.prototype,p},u={}.hasOwnProperty;l=ot(),o=_t(),oe.exports=function(p){f(i,p);function i(r,n){if(i.__super__.constructor.call(this,r),n==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=l.Text,this.value=this.stringify.text(n)}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,n,m;for(m="",n=this.previousSibling;n;)m=n.data+m,n=n.previousSibling;for(m+=this.data,r=this.nextSibling;r;)m=m+r.data,r=r.nextSibling;return m}}),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}(o)}.call(H)),oe.exports}var se={exports:{}},wr;function Xe(){return wr||(wr=1,function(){var l,o,f=function(p,i){for(var r in i)u.call(i,r)&&(p[r]=i[r]);function n(){this.constructor=p}return n.prototype=i.prototype,p.prototype=new n,p.__super__=i.prototype,p},u={}.hasOwnProperty;l=ot(),o=_t(),se.exports=function(p){f(i,p);function i(r,n,m){if(i.__super__.constructor.call(this,r),n==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=l.ProcessingInstruction,this.target=this.stringify.insTarget(n),this.name=this.target,m&&(this.value=this.stringify.insValue(m))}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}(o)}.call(H)),se.exports}var ae={exports:{}},br;function Zr(){return br||(br=1,function(){var l,o,f=function(p,i){for(var r in i)u.call(i,r)&&(p[r]=i[r]);function n(){this.constructor=p}return n.prototype=i.prototype,p.prototype=new n,p.__super__=i.prototype,p},u={}.hasOwnProperty;o=ut(),l=ot(),ae.exports=function(p){f(i,p);function i(r){i.__super__.constructor.call(this,r),this.type=l.Dummy}return i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(r){return""},i}(o)}.call(H)),ae.exports}var ue={exports:{}},Er;function zn(){return Er||(Er=1,function(){ue.exports=function(){function l(o){this.nodes=o}return Object.defineProperty(l.prototype,"length",{get:function(){return this.nodes.length||0}}),l.prototype.clone=function(){return this.nodes=null},l.prototype.item=function(o){return this.nodes[o]||null},l}()}.call(H)),ue.exports}var ce={exports:{}},xr;function Kn(){return xr||(xr=1,function(){ce.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}.call(H)),ce.exports}var Tr;function ut(){return Tr||(Tr=1,function(){var l,o,f,u,p,i,r,n,m,N,w,g,x,E,C,M,b,D={}.hasOwnProperty;b=dt(),M=b.isObject,C=b.isFunction,E=b.isEmpty,x=b.getValue,n=null,f=null,u=null,p=null,i=null,w=null,g=null,N=null,r=null,o=null,m=null,l=null,Wt.exports=function(){function T(h){this.parent=h,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,n||(n=Ae(),f=Le(),u=_e(),p=Me(),i=Re(),w=je(),g=Ue(),N=Xe(),r=Zr(),o=ot(),m=zn(),Ce(),l=Kn())}return Object.defineProperty(T.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(T.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(T.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(T.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(T.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new m(this.children)),this.childNodeList}}),Object.defineProperty(T.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(T.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(T.prototype,"previousSibling",{get:function(){var h;return h=this.parent.children.indexOf(this),this.parent.children[h-1]||null}}),Object.defineProperty(T.prototype,"nextSibling",{get:function(){var h;return h=this.parent.children.indexOf(this),this.parent.children[h+1]||null}}),Object.defineProperty(T.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(T.prototype,"textContent",{get:function(){var h,v,A,j,U;if(this.nodeType===o.Element||this.nodeType===o.DocumentFragment){for(U="",j=this.children,v=0,A=j.length;v<A;v++)h=j[v],h.textContent&&(U+=h.textContent);return U}else return null},set:function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),T.prototype.setParent=function(h){var v,A,j,U,B;for(this.parent=h,h&&(this.options=h.options,this.stringify=h.stringify),U=this.children,B=[],A=0,j=U.length;A<j;A++)v=U[A],B.push(v.setParent(this));return B},T.prototype.element=function(h,v,A){var j,U,B,c,F,R,X,W,Y,J,z;if(R=null,v===null&&A==null&&(Y=[{},null],v=Y[0],A=Y[1]),v==null&&(v={}),v=x(v),M(v)||(J=[v,A],A=J[0],v=J[1]),h!=null&&(h=x(h)),Array.isArray(h))for(B=0,X=h.length;B<X;B++)U=h[B],R=this.element(U);else if(C(h))R=this.element(h.apply());else if(M(h)){for(F in h)if(D.call(h,F))if(z=h[F],C(z)&&(z=z.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&F.indexOf(this.stringify.convertAttKey)===0)R=this.attribute(F.substr(this.stringify.convertAttKey.length),z);else if(!this.options.separateArrayItems&&Array.isArray(z)&&E(z))R=this.dummy();else if(M(z)&&E(z))R=this.element(F);else if(!this.options.keepNullNodes&&z==null)R=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(z))for(c=0,W=z.length;c<W;c++)U=z[c],j={},j[F]=U,R=this.element(j);else M(z)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&F.indexOf(this.stringify.convertTextKey)===0?R=this.element(z):(R=this.element(F),R.element(z)):R=this.element(F,z)}else!this.options.keepNullNodes&&A===null?R=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&h.indexOf(this.stringify.convertTextKey)===0?R=this.text(A):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&h.indexOf(this.stringify.convertCDataKey)===0?R=this.cdata(A):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&h.indexOf(this.stringify.convertCommentKey)===0?R=this.comment(A):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&h.indexOf(this.stringify.convertRawKey)===0?R=this.raw(A):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&h.indexOf(this.stringify.convertPIKey)===0?R=this.instruction(h.substr(this.stringify.convertPIKey.length),A):R=this.node(h,v,A);if(R==null)throw new Error("Could not create any elements with: "+h+". "+this.debugInfo());return R},T.prototype.insertBefore=function(h,v,A){var j,U,B,c,F;if(h?.type)return B=h,c=v,B.setParent(this),c?(U=children.indexOf(c),F=children.splice(U),children.push(B),Array.prototype.push.apply(children,F)):children.push(B),B;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(h));return U=this.parent.children.indexOf(this),F=this.parent.children.splice(U),j=this.parent.element(h,v,A),Array.prototype.push.apply(this.parent.children,F),j},T.prototype.insertAfter=function(h,v,A){var j,U,B;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(h));return U=this.parent.children.indexOf(this),B=this.parent.children.splice(U+1),j=this.parent.element(h,v,A),Array.prototype.push.apply(this.parent.children,B),j},T.prototype.remove=function(){var h;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return h=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[h,h-h+1].concat([])),this.parent},T.prototype.node=function(h,v,A){var j,U;return h!=null&&(h=x(h)),v||(v={}),v=x(v),M(v)||(U=[v,A],A=U[0],v=U[1]),j=new n(this,h,v),A!=null&&j.text(A),this.children.push(j),j},T.prototype.text=function(h){var v;return M(h)&&this.element(h),v=new g(this,h),this.children.push(v),this},T.prototype.cdata=function(h){var v;return v=new f(this,h),this.children.push(v),this},T.prototype.comment=function(h){var v;return v=new u(this,h),this.children.push(v),this},T.prototype.commentBefore=function(h){var v,A;return v=this.parent.children.indexOf(this),A=this.parent.children.splice(v),this.parent.comment(h),Array.prototype.push.apply(this.parent.children,A),this},T.prototype.commentAfter=function(h){var v,A;return v=this.parent.children.indexOf(this),A=this.parent.children.splice(v+1),this.parent.comment(h),Array.prototype.push.apply(this.parent.children,A),this},T.prototype.raw=function(h){var v;return v=new w(this,h),this.children.push(v),this},T.prototype.dummy=function(){var h;return h=new r(this),h},T.prototype.instruction=function(h,v){var A,j,U,B,c;if(h!=null&&(h=x(h)),v!=null&&(v=x(v)),Array.isArray(h))for(B=0,c=h.length;B<c;B++)A=h[B],this.instruction(A);else if(M(h))for(A in h)D.call(h,A)&&(j=h[A],this.instruction(A,j));else C(v)&&(v=v.apply()),U=new N(this,h,v),this.children.push(U);return this},T.prototype.instructionBefore=function(h,v){var A,j;return A=this.parent.children.indexOf(this),j=this.parent.children.splice(A),this.parent.instruction(h,v),Array.prototype.push.apply(this.parent.children,j),this},T.prototype.instructionAfter=function(h,v){var A,j;return A=this.parent.children.indexOf(this),j=this.parent.children.splice(A+1),this.parent.instruction(h,v),Array.prototype.push.apply(this.parent.children,j),this},T.prototype.declaration=function(h,v,A){var j,U;return j=this.document(),U=new p(j,h,v,A),j.children.length===0?j.children.unshift(U):j.children[0].type===o.Declaration?j.children[0]=U:j.children.unshift(U),j.root()||j},T.prototype.dtd=function(h,v){var A,j,U,B,c,F,R,X,W,Y;for(j=this.document(),U=new i(j,h,v),W=j.children,B=c=0,R=W.length;c<R;B=++c)if(A=W[B],A.type===o.DocType)return j.children[B]=U,U;for(Y=j.children,B=F=0,X=Y.length;F<X;B=++F)if(A=Y[B],A.isRoot)return j.children.splice(B,0,U),U;return j.children.push(U),U},T.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},T.prototype.root=function(){var h;for(h=this;h;){if(h.type===o.Document)return h.rootObject;if(h.isRoot)return h;h=h.parent}},T.prototype.document=function(){var h;for(h=this;h;){if(h.type===o.Document)return h;h=h.parent}},T.prototype.end=function(h){return this.document().end(h)},T.prototype.prev=function(){var h;if(h=this.parent.children.indexOf(this),h<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[h-1]},T.prototype.next=function(){var h;if(h=this.parent.children.indexOf(this),h===-1||h===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[h+1]},T.prototype.importDocument=function(h){var v;return v=h.root().clone(),v.parent=this,v.isRoot=!1,this.children.push(v),this},T.prototype.debugInfo=function(h){var v,A;return h=h||this.name,h==null&&!((v=this.parent)!=null&&v.name)?"":h==null?"parent: <"+this.parent.name+">":(A=this.parent)!=null&&A.name?"node: <"+h+">, parent: <"+this.parent.name+">":"node: <"+h+">"},T.prototype.ele=function(h,v,A){return this.element(h,v,A)},T.prototype.nod=function(h,v,A){return this.node(h,v,A)},T.prototype.txt=function(h){return this.text(h)},T.prototype.dat=function(h){return this.cdata(h)},T.prototype.com=function(h){return this.comment(h)},T.prototype.ins=function(h,v){return this.instruction(h,v)},T.prototype.doc=function(){return this.document()},T.prototype.dec=function(h,v,A){return this.declaration(h,v,A)},T.prototype.e=function(h,v,A){return this.element(h,v,A)},T.prototype.n=function(h,v,A){return this.node(h,v,A)},T.prototype.t=function(h){return this.text(h)},T.prototype.d=function(h){return this.cdata(h)},T.prototype.c=function(h){return this.comment(h)},T.prototype.r=function(h){return this.raw(h)},T.prototype.i=function(h,v){return this.instruction(h,v)},T.prototype.u=function(){return this.up()},T.prototype.importXMLBuilder=function(h){return this.importDocument(h)},T.prototype.replaceChild=function(h,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.removeChild=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.appendChild=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.hasChildNodes=function(){return this.children.length!==0},T.prototype.cloneNode=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.isSupported=function(h,v){return!0},T.prototype.hasAttributes=function(){return this.attribs.length!==0},T.prototype.compareDocumentPosition=function(h){var v,A;return v=this,v===h?0:this.document()!==h.document()?(A=l.Disconnected|l.ImplementationSpecific,Math.random()<.5?A|=l.Preceding:A|=l.Following,A):v.isAncestor(h)?l.Contains|l.Preceding:v.isDescendant(h)?l.Contains|l.Following:v.isPreceding(h)?l.Preceding:l.Following},T.prototype.isSameNode=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.lookupPrefix=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.isDefaultNamespace=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.lookupNamespaceURI=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.isEqualNode=function(h){var v,A,j;if(h.nodeType!==this.nodeType||h.children.length!==this.children.length)return!1;for(v=A=0,j=this.children.length-1;0<=j?A<=j:A>=j;v=0<=j?++A:--A)if(!this.children[v].isEqualNode(h.children[v]))return!1;return!0},T.prototype.getFeature=function(h,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.setUserData=function(h,v,A){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.getUserData=function(h){throw new Error("This DOM method is not implemented."+this.debugInfo())},T.prototype.contains=function(h){return h?h===this||this.isDescendant(h):!1},T.prototype.isDescendant=function(h){var v,A,j,U,B;for(B=this.children,j=0,U=B.length;j<U;j++)if(v=B[j],h===v||(A=v.isDescendant(h),A))return!0;return!1},T.prototype.isAncestor=function(h){return h.isDescendant(this)},T.prototype.isPreceding=function(h){var v,A;return v=this.treePosition(h),A=this.treePosition(this),v===-1||A===-1?!1:v<A},T.prototype.isFollowing=function(h){var v,A;return v=this.treePosition(h),A=this.treePosition(this),v===-1||A===-1?!1:v>A},T.prototype.treePosition=function(h){var v,A;return A=0,v=!1,this.foreachTreeNode(this.document(),function(j){if(A++,!v&&j===h)return v=!0}),v?A:-1},T.prototype.foreachTreeNode=function(h,v){var A,j,U,B,c;for(h||(h=this.document()),B=h.children,j=0,U=B.length;j<U;j++){if(A=B[j],c=v(A))return c;if(c=this.foreachTreeNode(A,v),c)return c}},T}()}.call(H)),Wt.exports}var le={exports:{}},Dr;function tn(){return Dr||(Dr=1,function(){var l=function(f,u){return function(){return f.apply(u,arguments)}},o={}.hasOwnProperty;le.exports=function(){function f(u){this.assertLegalName=l(this.assertLegalName,this),this.assertLegalChar=l(this.assertLegalChar,this);var p,i,r;u||(u={}),this.options=u,this.options.version||(this.options.version="1.0"),i=u.stringify||{};for(p in i)o.call(i,p)&&(r=i[p],this[p]=r)}return f.prototype.name=function(u){return this.options.noValidation?u:this.assertLegalName(""+u||"")},f.prototype.text=function(u){return this.options.noValidation?u:this.assertLegalChar(this.textEscape(""+u||""))},f.prototype.cdata=function(u){return this.options.noValidation?u:(u=""+u||"",u=u.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(u))},f.prototype.comment=function(u){if(this.options.noValidation)return u;if(u=""+u||"",u.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+u);return this.assertLegalChar(u)},f.prototype.raw=function(u){return this.options.noValidation?u:""+u||""},f.prototype.attValue=function(u){return this.options.noValidation?u:this.assertLegalChar(this.attEscape(u=""+u||""))},f.prototype.insTarget=function(u){return this.options.noValidation?u:this.assertLegalChar(""+u||"")},f.prototype.insValue=function(u){if(this.options.noValidation)return u;if(u=""+u||"",u.match(/\?>/))throw new Error("Invalid processing instruction value: "+u);return this.assertLegalChar(u)},f.prototype.xmlVersion=function(u){if(this.options.noValidation)return u;if(u=""+u||"",!u.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+u);return u},f.prototype.xmlEncoding=function(u){if(this.options.noValidation)return u;if(u=""+u||"",!u.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+u);return this.assertLegalChar(u)},f.prototype.xmlStandalone=function(u){return this.options.noValidation?u:u?"yes":"no"},f.prototype.dtdPubID=function(u){return this.options.noValidation?u:this.assertLegalChar(""+u||"")},f.prototype.dtdSysID=function(u){return this.options.noValidation?u:this.assertLegalChar(""+u||"")},f.prototype.dtdElementValue=function(u){return this.options.noValidation?u:this.assertLegalChar(""+u||"")},f.prototype.dtdAttType=function(u){return this.options.noValidation?u:this.assertLegalChar(""+u||"")},f.prototype.dtdAttDefault=function(u){return this.options.noValidation?u:this.assertLegalChar(""+u||"")},f.prototype.dtdEntityValue=function(u){return this.options.noValidation?u:this.assertLegalChar(""+u||"")},f.prototype.dtdNData=function(u){return this.options.noValidation?u:this.assertLegalChar(""+u||"")},f.prototype.convertAttKey="@",f.prototype.convertPIKey="?",f.prototype.convertTextKey="#text",f.prototype.convertCDataKey="#cdata",f.prototype.convertCommentKey="#comment",f.prototype.convertRawKey="#raw",f.prototype.assertLegalChar=function(u){var p,i;if(this.options.noValidation)return u;if(p="",this.options.version==="1.0"){if(p=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,i=u.match(p))throw new Error("Invalid character in string: "+u+" at index "+i.index)}else if(this.options.version==="1.1"&&(p=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,i=u.match(p)))throw new Error("Invalid character in string: "+u+" at index "+i.index);return u},f.prototype.assertLegalName=function(u){var p;if(this.options.noValidation)return u;if(this.assertLegalChar(u),p=/^([: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])*$/,!u.match(p))throw new Error("Invalid character in name");return u},f.prototype.textEscape=function(u){var p;return this.options.noValidation?u:(p=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,u.replace(p,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;"))},f.prototype.attEscape=function(u){var p;return this.options.noValidation?u:(p=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,u.replace(p,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;"))},f}()}.call(H)),le.exports}var fe={exports:{}},he={exports:{}},pe={exports:{}},Ir;function Mt(){return Ir||(Ir=1,function(){pe.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}.call(H)),pe.exports}var vr;function en(){return vr||(vr=1,function(){var l,o,f,u={}.hasOwnProperty;f=dt().assign,l=ot(),Me(),Re(),Le(),_e(),Ae(),je(),Ue(),Xe(),Zr(),Pe(),Se(),Fe(),Be(),o=Mt(),he.exports=function(){function p(i){var r,n,m;i||(i={}),this.options=i,n=i.writer||{};for(r in n)u.call(n,r)&&(m=n[r],this["_"+r]=this[r],this[r]=m)}return p.prototype.filterOptions=function(i){var r,n,m,N,w,g,x,E;return i||(i={}),i=f({},this.options,i),r={writer:this},r.pretty=i.pretty||!1,r.allowEmpty=i.allowEmpty||!1,r.indent=(n=i.indent)!=null?n:" ",r.newline=(m=i.newline)!=null?m:`
26
+ `,r.offset=(N=i.offset)!=null?N:0,r.dontPrettyTextNodes=(w=(g=i.dontPrettyTextNodes)!=null?g:i.dontprettytextnodes)!=null?w:0,r.spaceBeforeSlash=(x=(E=i.spaceBeforeSlash)!=null?E:i.spacebeforeslash)!=null?x:"",r.spaceBeforeSlash===!0&&(r.spaceBeforeSlash=" "),r.suppressPrettyCount=0,r.user={},r.state=o.None,r},p.prototype.indent=function(i,r,n){var m;return!r.pretty||r.suppressPrettyCount?"":r.pretty&&(m=(n||0)+r.offset+1,m>0)?new Array(m).join(r.indent):""},p.prototype.endline=function(i,r,n){return!r.pretty||r.suppressPrettyCount?"":r.newline},p.prototype.attribute=function(i,r,n){var m;return this.openAttribute(i,r,n),m=" "+i.name+'="'+i.value+'"',this.closeAttribute(i,r,n),m},p.prototype.cdata=function(i,r,n){var m;return this.openNode(i,r,n),r.state=o.OpenTag,m=this.indent(i,r,n)+"<![CDATA[",r.state=o.InsideTag,m+=i.value,r.state=o.CloseTag,m+="]]>"+this.endline(i,r,n),r.state=o.None,this.closeNode(i,r,n),m},p.prototype.comment=function(i,r,n){var m;return this.openNode(i,r,n),r.state=o.OpenTag,m=this.indent(i,r,n)+"<!-- ",r.state=o.InsideTag,m+=i.value,r.state=o.CloseTag,m+=" -->"+this.endline(i,r,n),r.state=o.None,this.closeNode(i,r,n),m},p.prototype.declaration=function(i,r,n){var m;return this.openNode(i,r,n),r.state=o.OpenTag,m=this.indent(i,r,n)+"<?xml",r.state=o.InsideTag,m+=' version="'+i.version+'"',i.encoding!=null&&(m+=' encoding="'+i.encoding+'"'),i.standalone!=null&&(m+=' standalone="'+i.standalone+'"'),r.state=o.CloseTag,m+=r.spaceBeforeSlash+"?>",m+=this.endline(i,r,n),r.state=o.None,this.closeNode(i,r,n),m},p.prototype.docType=function(i,r,n){var m,N,w,g,x;if(n||(n=0),this.openNode(i,r,n),r.state=o.OpenTag,g=this.indent(i,r,n),g+="<!DOCTYPE "+i.root().name,i.pubID&&i.sysID?g+=' PUBLIC "'+i.pubID+'" "'+i.sysID+'"':i.sysID&&(g+=' SYSTEM "'+i.sysID+'"'),i.children.length>0){for(g+=" [",g+=this.endline(i,r,n),r.state=o.InsideTag,x=i.children,N=0,w=x.length;N<w;N++)m=x[N],g+=this.writeChildNode(m,r,n+1);r.state=o.CloseTag,g+="]"}return r.state=o.CloseTag,g+=r.spaceBeforeSlash+">",g+=this.endline(i,r,n),r.state=o.None,this.closeNode(i,r,n),g},p.prototype.element=function(i,r,n){var m,N,w,g,x,E,C,M,b,D,T,h,v,A;n||(n=0),D=!1,T="",this.openNode(i,r,n),r.state=o.OpenTag,T+=this.indent(i,r,n)+"<"+i.name,h=i.attribs;for(b in h)u.call(h,b)&&(m=h[b],T+=this.attribute(m,r,n));if(w=i.children.length,g=w===0?null:i.children[0],w===0||i.children.every(function(j){return(j.type===l.Text||j.type===l.Raw)&&j.value===""}))r.allowEmpty?(T+=">",r.state=o.CloseTag,T+="</"+i.name+">"+this.endline(i,r,n)):(r.state=o.CloseTag,T+=r.spaceBeforeSlash+"/>"+this.endline(i,r,n));else if(r.pretty&&w===1&&(g.type===l.Text||g.type===l.Raw)&&g.value!=null)T+=">",r.state=o.InsideTag,r.suppressPrettyCount++,D=!0,T+=this.writeChildNode(g,r,n+1),r.suppressPrettyCount--,D=!1,r.state=o.CloseTag,T+="</"+i.name+">"+this.endline(i,r,n);else{if(r.dontPrettyTextNodes){for(v=i.children,x=0,C=v.length;x<C;x++)if(N=v[x],(N.type===l.Text||N.type===l.Raw)&&N.value!=null){r.suppressPrettyCount++,D=!0;break}}for(T+=">"+this.endline(i,r,n),r.state=o.InsideTag,A=i.children,E=0,M=A.length;E<M;E++)N=A[E],T+=this.writeChildNode(N,r,n+1);r.state=o.CloseTag,T+=this.indent(i,r,n)+"</"+i.name+">",D&&r.suppressPrettyCount--,T+=this.endline(i,r,n),r.state=o.None}return this.closeNode(i,r,n),T},p.prototype.writeChildNode=function(i,r,n){switch(i.type){case l.CData:return this.cdata(i,r,n);case l.Comment:return this.comment(i,r,n);case l.Element:return this.element(i,r,n);case l.Raw:return this.raw(i,r,n);case l.Text:return this.text(i,r,n);case l.ProcessingInstruction:return this.processingInstruction(i,r,n);case l.Dummy:return"";case l.Declaration:return this.declaration(i,r,n);case l.DocType:return this.docType(i,r,n);case l.AttributeDeclaration:return this.dtdAttList(i,r,n);case l.ElementDeclaration:return this.dtdElement(i,r,n);case l.EntityDeclaration:return this.dtdEntity(i,r,n);case l.NotationDeclaration:return this.dtdNotation(i,r,n);default:throw new Error("Unknown XML node type: "+i.constructor.name)}},p.prototype.processingInstruction=function(i,r,n){var m;return this.openNode(i,r,n),r.state=o.OpenTag,m=this.indent(i,r,n)+"<?",r.state=o.InsideTag,m+=i.target,i.value&&(m+=" "+i.value),r.state=o.CloseTag,m+=r.spaceBeforeSlash+"?>",m+=this.endline(i,r,n),r.state=o.None,this.closeNode(i,r,n),m},p.prototype.raw=function(i,r,n){var m;return this.openNode(i,r,n),r.state=o.OpenTag,m=this.indent(i,r,n),r.state=o.InsideTag,m+=i.value,r.state=o.CloseTag,m+=this.endline(i,r,n),r.state=o.None,this.closeNode(i,r,n),m},p.prototype.text=function(i,r,n){var m;return this.openNode(i,r,n),r.state=o.OpenTag,m=this.indent(i,r,n),r.state=o.InsideTag,m+=i.value,r.state=o.CloseTag,m+=this.endline(i,r,n),r.state=o.None,this.closeNode(i,r,n),m},p.prototype.dtdAttList=function(i,r,n){var m;return this.openNode(i,r,n),r.state=o.OpenTag,m=this.indent(i,r,n)+"<!ATTLIST",r.state=o.InsideTag,m+=" "+i.elementName+" "+i.attributeName+" "+i.attributeType,i.defaultValueType!=="#DEFAULT"&&(m+=" "+i.defaultValueType),i.defaultValue&&(m+=' "'+i.defaultValue+'"'),r.state=o.CloseTag,m+=r.spaceBeforeSlash+">"+this.endline(i,r,n),r.state=o.None,this.closeNode(i,r,n),m},p.prototype.dtdElement=function(i,r,n){var m;return this.openNode(i,r,n),r.state=o.OpenTag,m=this.indent(i,r,n)+"<!ELEMENT",r.state=o.InsideTag,m+=" "+i.name+" "+i.value,r.state=o.CloseTag,m+=r.spaceBeforeSlash+">"+this.endline(i,r,n),r.state=o.None,this.closeNode(i,r,n),m},p.prototype.dtdEntity=function(i,r,n){var m;return this.openNode(i,r,n),r.state=o.OpenTag,m=this.indent(i,r,n)+"<!ENTITY",r.state=o.InsideTag,i.pe&&(m+=" %"),m+=" "+i.name,i.value?m+=' "'+i.value+'"':(i.pubID&&i.sysID?m+=' PUBLIC "'+i.pubID+'" "'+i.sysID+'"':i.sysID&&(m+=' SYSTEM "'+i.sysID+'"'),i.nData&&(m+=" NDATA "+i.nData)),r.state=o.CloseTag,m+=r.spaceBeforeSlash+">"+this.endline(i,r,n),r.state=o.None,this.closeNode(i,r,n),m},p.prototype.dtdNotation=function(i,r,n){var m;return this.openNode(i,r,n),r.state=o.OpenTag,m=this.indent(i,r,n)+"<!NOTATION",r.state=o.InsideTag,m+=" "+i.name,i.pubID&&i.sysID?m+=' PUBLIC "'+i.pubID+'" "'+i.sysID+'"':i.pubID?m+=' PUBLIC "'+i.pubID+'"':i.sysID&&(m+=' SYSTEM "'+i.sysID+'"'),r.state=o.CloseTag,m+=r.spaceBeforeSlash+">"+this.endline(i,r,n),r.state=o.None,this.closeNode(i,r,n),m},p.prototype.openNode=function(i,r,n){},p.prototype.closeNode=function(i,r,n){},p.prototype.openAttribute=function(i,r,n){},p.prototype.closeAttribute=function(i,r,n){},p}()}.call(H)),he.exports}var Nr;function qe(){return Nr||(Nr=1,function(){var l,o=function(u,p){for(var i in p)f.call(p,i)&&(u[i]=p[i]);function r(){this.constructor=u}return r.prototype=p.prototype,u.prototype=new r,u.__super__=p.prototype,u},f={}.hasOwnProperty;l=en(),fe.exports=function(u){o(p,u);function p(i){p.__super__.constructor.call(this,i)}return p.prototype.document=function(i,r){var n,m,N,w,g;for(r=this.filterOptions(r),w="",g=i.children,m=0,N=g.length;m<N;m++)n=g[m],w+=this.writeChildNode(n,r,0);return r.pretty&&w.slice(-r.newline.length)===r.newline&&(w=w.slice(0,-r.newline.length)),w},p}(l)}.call(H)),fe.exports}var Or;function rn(){return Or||(Or=1,function(){var l,o,f,u,p,i,r,n=function(N,w){for(var g in w)m.call(w,g)&&(N[g]=w[g]);function x(){this.constructor=N}return x.prototype=w.prototype,N.prototype=new x,N.__super__=w.prototype,N},m={}.hasOwnProperty;r=dt().isPlainObject,f=Qr(),o=Yn(),u=ut(),l=ot(),i=tn(),p=qe(),Xt.exports=function(N){n(w,N);function w(g){w.__super__.constructor.call(this,null),this.name="#document",this.type=l.Document,this.documentURI=null,this.domConfig=new o,g||(g={}),g.writer||(g.writer=new p),this.options=g,this.stringify=new i(g)}return Object.defineProperty(w.prototype,"implementation",{value:new f}),Object.defineProperty(w.prototype,"doctype",{get:function(){var g,x,E,C;for(C=this.children,x=0,E=C.length;x<E;x++)if(g=C[x],g.type===l.DocType)return g;return null}}),Object.defineProperty(w.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(w.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(w.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(w.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===l.Declaration?this.children[0].encoding:null}}),Object.defineProperty(w.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===l.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(w.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===l.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(w.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(w.prototype,"origin",{get:function(){return null}}),Object.defineProperty(w.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(w.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(w.prototype,"contentType",{get:function(){return null}}),w.prototype.end=function(g){var x;return x={},g?r(g)&&(x=g,g=this.options.writer):g=this.options.writer,g.document(this,g.filterOptions(x))},w.prototype.toString=function(g){return this.options.writer.document(this,this.options.writer.filterOptions(g))},w.prototype.createElement=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.createTextNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.createComment=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.createCDATASection=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.createProcessingInstruction=function(g,x){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.createAttribute=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.createEntityReference=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.getElementsByTagName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.importNode=function(g,x){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.createElementNS=function(g,x){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.createAttributeNS=function(g,x){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.getElementsByTagNameNS=function(g,x){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.getElementById=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.adoptNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.renameNode=function(g,x,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.getElementsByClassName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.createEvent=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.createNodeIterator=function(g,x,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},w.prototype.createTreeWalker=function(g,x,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},w}(u)}.call(H)),Xt.exports}var de={exports:{}},Cr;function Qn(){return Cr||(Cr=1,function(){var l,o,f,u,p,i,r,n,m,N,w,g,x,E,C,M,b,D,T,h,v,A,j,U={}.hasOwnProperty;j=dt(),v=j.isObject,h=j.isFunction,A=j.isPlainObject,T=j.getValue,l=ot(),g=rn(),x=Ae(),u=Le(),p=_e(),C=je(),D=Ue(),E=Xe(),N=Me(),w=Re(),i=Pe(),n=Fe(),r=Se(),m=Be(),f=Jr(),b=tn(),M=qe(),o=Mt(),de.exports=function(){function B(c,F,R){var X;this.name="?xml",this.type=l.Document,c||(c={}),X={},c.writer?A(c.writer)&&(X=c.writer,c.writer=new M):c.writer=new M,this.options=c,this.writer=c.writer,this.writerOptions=this.writer.filterOptions(X),this.stringify=new b(c),this.onDataCallback=F||function(){},this.onEndCallback=R||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return B.prototype.createChildNode=function(c){var F,R,X,W,Y,J,z,$;switch(c.type){case l.CData:this.cdata(c.value);break;case l.Comment:this.comment(c.value);break;case l.Element:X={},z=c.attribs;for(R in z)U.call(z,R)&&(F=z[R],X[R]=F.value);this.node(c.name,X);break;case l.Dummy:this.dummy();break;case l.Raw:this.raw(c.value);break;case l.Text:this.text(c.value);break;case l.ProcessingInstruction:this.instruction(c.target,c.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+c.constructor.name)}for($=c.children,Y=0,J=$.length;Y<J;Y++)W=$[Y],this.createChildNode(W),W.type===l.Element&&this.up();return this},B.prototype.dummy=function(){return this},B.prototype.node=function(c,F,R){var X;if(c==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(c));return this.openCurrent(),c=T(c),F==null&&(F={}),F=T(F),v(F)||(X=[F,R],R=X[0],F=X[1]),this.currentNode=new x(this,c,F),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,R!=null&&this.text(R),this},B.prototype.element=function(c,F,R){var X,W,Y,J,z,$;if(this.currentNode&&this.currentNode.type===l.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(c)||v(c)||h(c))for(J=this.options.noValidation,this.options.noValidation=!0,$=new g(this.options).element("TEMP_ROOT"),$.element(c),this.options.noValidation=J,z=$.children,W=0,Y=z.length;W<Y;W++)X=z[W],this.createChildNode(X),X.type===l.Element&&this.up();else this.node(c,F,R);return this},B.prototype.attribute=function(c,F){var R,X;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(c));if(c!=null&&(c=T(c)),v(c))for(R in c)U.call(c,R)&&(X=c[R],this.attribute(R,X));else h(F)&&(F=F.apply()),this.options.keepNullAttributes&&F==null?this.currentNode.attribs[c]=new f(this,c,""):F!=null&&(this.currentNode.attribs[c]=new f(this,c,F));return this},B.prototype.text=function(c){var F;return this.openCurrent(),F=new D(this,c),this.onData(this.writer.text(F,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},B.prototype.cdata=function(c){var F;return this.openCurrent(),F=new u(this,c),this.onData(this.writer.cdata(F,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},B.prototype.comment=function(c){var F;return this.openCurrent(),F=new p(this,c),this.onData(this.writer.comment(F,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},B.prototype.raw=function(c){var F;return this.openCurrent(),F=new C(this,c),this.onData(this.writer.raw(F,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},B.prototype.instruction=function(c,F){var R,X,W,Y,J;if(this.openCurrent(),c!=null&&(c=T(c)),F!=null&&(F=T(F)),Array.isArray(c))for(R=0,Y=c.length;R<Y;R++)X=c[R],this.instruction(X);else if(v(c))for(X in c)U.call(c,X)&&(W=c[X],this.instruction(X,W));else h(F)&&(F=F.apply()),J=new E(this,c,F),this.onData(this.writer.processingInstruction(J,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},B.prototype.declaration=function(c,F,R){var X;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return X=new N(this,c,F,R),this.onData(this.writer.declaration(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},B.prototype.doctype=function(c,F,R){if(this.openCurrent(),c==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 w(this,F,R),this.currentNode.rootNodeName=c,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},B.prototype.dtdElement=function(c,F){var R;return this.openCurrent(),R=new r(this,c,F),this.onData(this.writer.dtdElement(R,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},B.prototype.attList=function(c,F,R,X,W){var Y;return this.openCurrent(),Y=new i(this,c,F,R,X,W),this.onData(this.writer.dtdAttList(Y,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},B.prototype.entity=function(c,F){var R;return this.openCurrent(),R=new n(this,!1,c,F),this.onData(this.writer.dtdEntity(R,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},B.prototype.pEntity=function(c,F){var R;return this.openCurrent(),R=new n(this,!0,c,F),this.onData(this.writer.dtdEntity(R,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},B.prototype.notation=function(c,F){var R;return this.openCurrent(),R=new m(this,c,F),this.onData(this.writer.dtdNotation(R,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},B.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},B.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},B.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},B.prototype.openNode=function(c){var F,R,X,W;if(!c.isOpen){if(!this.root&&this.currentLevel===0&&c.type===l.Element&&(this.root=c),R="",c.type===l.Element){this.writerOptions.state=o.OpenTag,R=this.writer.indent(c,this.writerOptions,this.currentLevel)+"<"+c.name,W=c.attribs;for(X in W)U.call(W,X)&&(F=W[X],R+=this.writer.attribute(F,this.writerOptions,this.currentLevel));R+=(c.children?">":"/>")+this.writer.endline(c,this.writerOptions,this.currentLevel),this.writerOptions.state=o.InsideTag}else this.writerOptions.state=o.OpenTag,R=this.writer.indent(c,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+c.rootNodeName,c.pubID&&c.sysID?R+=' PUBLIC "'+c.pubID+'" "'+c.sysID+'"':c.sysID&&(R+=' SYSTEM "'+c.sysID+'"'),c.children?(R+=" [",this.writerOptions.state=o.InsideTag):(this.writerOptions.state=o.CloseTag,R+=">"),R+=this.writer.endline(c,this.writerOptions,this.currentLevel);return this.onData(R,this.currentLevel),c.isOpen=!0}},B.prototype.closeNode=function(c){var F;if(!c.isClosed)return F="",this.writerOptions.state=o.CloseTag,c.type===l.Element?F=this.writer.indent(c,this.writerOptions,this.currentLevel)+"</"+c.name+">"+this.writer.endline(c,this.writerOptions,this.currentLevel):F=this.writer.indent(c,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(c,this.writerOptions,this.currentLevel),this.writerOptions.state=o.None,this.onData(F,this.currentLevel),c.isClosed=!0},B.prototype.onData=function(c,F){return this.documentStarted=!0,this.onDataCallback(c,F+1)},B.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},B.prototype.debugInfo=function(c){return c==null?"":"node: <"+c+">"},B.prototype.ele=function(){return this.element.apply(this,arguments)},B.prototype.nod=function(c,F,R){return this.node(c,F,R)},B.prototype.txt=function(c){return this.text(c)},B.prototype.dat=function(c){return this.cdata(c)},B.prototype.com=function(c){return this.comment(c)},B.prototype.ins=function(c,F){return this.instruction(c,F)},B.prototype.dec=function(c,F,R){return this.declaration(c,F,R)},B.prototype.dtd=function(c,F,R){return this.doctype(c,F,R)},B.prototype.e=function(c,F,R){return this.element(c,F,R)},B.prototype.n=function(c,F,R){return this.node(c,F,R)},B.prototype.t=function(c){return this.text(c)},B.prototype.d=function(c){return this.cdata(c)},B.prototype.c=function(c){return this.comment(c)},B.prototype.r=function(c){return this.raw(c)},B.prototype.i=function(c,F){return this.instruction(c,F)},B.prototype.att=function(){return this.currentNode&&this.currentNode.type===l.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},B.prototype.a=function(){return this.currentNode&&this.currentNode.type===l.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},B.prototype.ent=function(c,F){return this.entity(c,F)},B.prototype.pent=function(c,F){return this.pEntity(c,F)},B.prototype.not=function(c,F){return this.notation(c,F)},B}()}.call(H)),de.exports}var me={exports:{}},Ar;function Jn(){return Ar||(Ar=1,function(){var l,o,f,u=function(i,r){for(var n in r)p.call(r,n)&&(i[n]=r[n]);function m(){this.constructor=i}return m.prototype=r.prototype,i.prototype=new m,i.__super__=r.prototype,i},p={}.hasOwnProperty;l=ot(),f=en(),o=Mt(),me.exports=function(i){u(r,i);function r(n,m){this.stream=n,r.__super__.constructor.call(this,m)}return r.prototype.endline=function(n,m,N){return n.isLastRootNode&&m.state===o.CloseTag?"":r.__super__.endline.call(this,n,m,N)},r.prototype.document=function(n,m){var N,w,g,x,E,C,M,b,D;for(M=n.children,w=g=0,E=M.length;g<E;w=++g)N=M[w],N.isLastRootNode=w===n.children.length-1;for(m=this.filterOptions(m),b=n.children,D=[],x=0,C=b.length;x<C;x++)N=b[x],D.push(this.writeChildNode(N,m,0));return D},r.prototype.attribute=function(n,m,N){return this.stream.write(r.__super__.attribute.call(this,n,m,N))},r.prototype.cdata=function(n,m,N){return this.stream.write(r.__super__.cdata.call(this,n,m,N))},r.prototype.comment=function(n,m,N){return this.stream.write(r.__super__.comment.call(this,n,m,N))},r.prototype.declaration=function(n,m,N){return this.stream.write(r.__super__.declaration.call(this,n,m,N))},r.prototype.docType=function(n,m,N){var w,g,x,E;if(N||(N=0),this.openNode(n,m,N),m.state=o.OpenTag,this.stream.write(this.indent(n,m,N)),this.stream.write("<!DOCTYPE "+n.root().name),n.pubID&&n.sysID?this.stream.write(' PUBLIC "'+n.pubID+'" "'+n.sysID+'"'):n.sysID&&this.stream.write(' SYSTEM "'+n.sysID+'"'),n.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(n,m,N)),m.state=o.InsideTag,E=n.children,g=0,x=E.length;g<x;g++)w=E[g],this.writeChildNode(w,m,N+1);m.state=o.CloseTag,this.stream.write("]")}return m.state=o.CloseTag,this.stream.write(m.spaceBeforeSlash+">"),this.stream.write(this.endline(n,m,N)),m.state=o.None,this.closeNode(n,m,N)},r.prototype.element=function(n,m,N){var w,g,x,E,C,M,b,D,T;N||(N=0),this.openNode(n,m,N),m.state=o.OpenTag,this.stream.write(this.indent(n,m,N)+"<"+n.name),D=n.attribs;for(b in D)p.call(D,b)&&(w=D[b],this.attribute(w,m,N));if(x=n.children.length,E=x===0?null:n.children[0],x===0||n.children.every(function(h){return(h.type===l.Text||h.type===l.Raw)&&h.value===""}))m.allowEmpty?(this.stream.write(">"),m.state=o.CloseTag,this.stream.write("</"+n.name+">")):(m.state=o.CloseTag,this.stream.write(m.spaceBeforeSlash+"/>"));else if(m.pretty&&x===1&&(E.type===l.Text||E.type===l.Raw)&&E.value!=null)this.stream.write(">"),m.state=o.InsideTag,m.suppressPrettyCount++,this.writeChildNode(E,m,N+1),m.suppressPrettyCount--,m.state=o.CloseTag,this.stream.write("</"+n.name+">");else{for(this.stream.write(">"+this.endline(n,m,N)),m.state=o.InsideTag,T=n.children,C=0,M=T.length;C<M;C++)g=T[C],this.writeChildNode(g,m,N+1);m.state=o.CloseTag,this.stream.write(this.indent(n,m,N)+"</"+n.name+">")}return this.stream.write(this.endline(n,m,N)),m.state=o.None,this.closeNode(n,m,N)},r.prototype.processingInstruction=function(n,m,N){return this.stream.write(r.__super__.processingInstruction.call(this,n,m,N))},r.prototype.raw=function(n,m,N){return this.stream.write(r.__super__.raw.call(this,n,m,N))},r.prototype.text=function(n,m,N){return this.stream.write(r.__super__.text.call(this,n,m,N))},r.prototype.dtdAttList=function(n,m,N){return this.stream.write(r.__super__.dtdAttList.call(this,n,m,N))},r.prototype.dtdElement=function(n,m,N){return this.stream.write(r.__super__.dtdElement.call(this,n,m,N))},r.prototype.dtdEntity=function(n,m,N){return this.stream.write(r.__super__.dtdEntity.call(this,n,m,N))},r.prototype.dtdNotation=function(n,m,N){return this.stream.write(r.__super__.dtdNotation.call(this,n,m,N))},r}(f)}.call(H)),me.exports}var Lr;function Zn(){return Lr||(Lr=1,function(){var l,o,f,u,p,i,r,n,m,N;N=dt(),n=N.assign,m=N.isFunction,f=Qr(),u=rn(),p=Qn(),r=qe(),i=Jn(),l=ot(),o=Mt(),ht.create=function(w,g,x,E){var C,M;if(w==null)throw new Error("Root element needs a name.");return E=n({},g,x,E),C=new u(E),M=C.element(w),E.headless||(C.declaration(E),(E.pubID!=null||E.sysID!=null)&&C.dtd(E)),M},ht.begin=function(w,g,x){var E;return m(w)&&(E=[w,g],g=E[0],x=E[1],w={}),g?new p(w,g,x):new u(w)},ht.stringWriter=function(w){return new r(w)},ht.streamWriter=function(w,g){return new i(w,g)},ht.implementation=new f,ht.nodeType=l,ht.writerState=o}.call(H)),ht}var _r;function ti(){return _r||(_r=1,function(){var l,o,f,u,p,i={}.hasOwnProperty;l=Zn(),o=Oe().defaults,u=function(r){return typeof r=="string"&&(r.indexOf("&")>=0||r.indexOf(">")>=0||r.indexOf("<")>=0)},p=function(r){return"<![CDATA["+f(r)+"]]>"},f=function(r){return r.replace("]]>","]]]]><![CDATA[>")},jt.Builder=function(){function r(n){var m,N,w;this.options={},N=o["0.2"];for(m in N)i.call(N,m)&&(w=N[m],this.options[m]=w);for(m in n)i.call(n,m)&&(w=n[m],this.options[m]=w)}return r.prototype.buildObject=function(n){var m,N,w,g,x;return m=this.options.attrkey,N=this.options.charkey,Object.keys(n).length===1&&this.options.rootName===o["0.2"].rootName?(x=Object.keys(n)[0],n=n[x]):x=this.options.rootName,w=function(E){return function(C,M){var b,D,T,h,v,A;if(typeof M!="object")E.options.cdata&&u(M)?C.raw(p(M)):C.txt(M);else if(Array.isArray(M)){for(h in M)if(i.call(M,h)){D=M[h];for(v in D)T=D[v],C=w(C.ele(v),T).up()}}else for(v in M)if(i.call(M,v))if(D=M[v],v===m){if(typeof D=="object")for(b in D)A=D[b],C=C.att(b,A)}else if(v===N)E.options.cdata&&u(D)?C=C.raw(p(D)):C=C.txt(D);else if(Array.isArray(D))for(h in D)i.call(D,h)&&(T=D[h],typeof T=="string"?E.options.cdata&&u(T)?C=C.ele(v).raw(p(T)).up():C=C.ele(v,T).up():C=w(C.ele(v),T).up());else typeof D=="object"?C=w(C.ele(v),D).up():typeof D=="string"&&E.options.cdata&&u(D)?C=C.ele(v).raw(p(D)).up():(D==null&&(D=""),C=C.ele(v,D.toString()).up());return C}}(this),g=l.create(x,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),w(g,n).end(this.options.renderOpts)},r}()}.call(H)),jt}var ye={},ge={},we={},Ot={exports:{}},be={},Dt={},Mr;function ei(){if(Mr)return Dt;Mr=1,Dt.byteLength=n,Dt.toByteArray=N,Dt.fromByteArray=x;for(var l=[],o=[],f=typeof Uint8Array<"u"?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,i=u.length;p<i;++p)l[p]=u[p],o[u.charCodeAt(p)]=p;o[45]=62,o[95]=63;function r(E){var C=E.length;if(C%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var M=E.indexOf("=");M===-1&&(M=C);var b=M===C?0:4-M%4;return[M,b]}function n(E){var C=r(E),M=C[0],b=C[1];return(M+b)*3/4-b}function m(E,C,M){return(C+M)*3/4-M}function N(E){var C,M=r(E),b=M[0],D=M[1],T=new f(m(E,b,D)),h=0,v=D>0?b-4:b,A;for(A=0;A<v;A+=4)C=o[E.charCodeAt(A)]<<18|o[E.charCodeAt(A+1)]<<12|o[E.charCodeAt(A+2)]<<6|o[E.charCodeAt(A+3)],T[h++]=C>>16&255,T[h++]=C>>8&255,T[h++]=C&255;return D===2&&(C=o[E.charCodeAt(A)]<<2|o[E.charCodeAt(A+1)]>>4,T[h++]=C&255),D===1&&(C=o[E.charCodeAt(A)]<<10|o[E.charCodeAt(A+1)]<<4|o[E.charCodeAt(A+2)]>>2,T[h++]=C>>8&255,T[h++]=C&255),T}function w(E){return l[E>>18&63]+l[E>>12&63]+l[E>>6&63]+l[E&63]}function g(E,C,M){for(var b,D=[],T=C;T<M;T+=3)b=(E[T]<<16&16711680)+(E[T+1]<<8&65280)+(E[T+2]&255),D.push(w(b));return D.join("")}function x(E){for(var C,M=E.length,b=M%3,D=[],T=16383,h=0,v=M-b;h<v;h+=T)D.push(g(E,h,h+T>v?v:h+T));return b===1?(C=E[M-1],D.push(l[C>>2]+l[C<<4&63]+"==")):b===2&&(C=(E[M-2]<<8)+E[M-1],D.push(l[C>>10]+l[C>>4&63]+l[C<<2&63]+"=")),D.join("")}return Dt}var Ct={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Pr;function ri(){return Pr||(Pr=1,Ct.read=function(l,o,f,u,p){var i,r,n=p*8-u-1,m=(1<<n)-1,N=m>>1,w=-7,g=f?p-1:0,x=f?-1:1,E=l[o+g];for(g+=x,i=E&(1<<-w)-1,E>>=-w,w+=n;w>0;i=i*256+l[o+g],g+=x,w-=8);for(r=i&(1<<-w)-1,i>>=-w,w+=u;w>0;r=r*256+l[o+g],g+=x,w-=8);if(i===0)i=1-N;else{if(i===m)return r?NaN:(E?-1:1)*(1/0);r=r+Math.pow(2,u),i=i-N}return(E?-1:1)*r*Math.pow(2,i-u)},Ct.write=function(l,o,f,u,p,i){var r,n,m,N=i*8-p-1,w=(1<<N)-1,g=w>>1,x=p===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=u?0:i-1,C=u?1:-1,M=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(n=isNaN(o)?1:0,r=w):(r=Math.floor(Math.log(o)/Math.LN2),o*(m=Math.pow(2,-r))<1&&(r--,m*=2),r+g>=1?o+=x/m:o+=x*Math.pow(2,1-g),o*m>=2&&(r++,m/=2),r+g>=w?(n=0,r=w):r+g>=1?(n=(o*m-1)*Math.pow(2,p),r=r+g):(n=o*Math.pow(2,g-1)*Math.pow(2,p),r=0));p>=8;l[f+E]=n&255,E+=C,n/=256,p-=8);for(r=r<<p|n,N+=p;N>0;l[f+E]=r&255,E+=C,r/=256,N-=8);l[f+E-C]|=M*128}),Ct}/*!
27
+ * The buffer module from node.js, for the browser.
28
+ *
29
+ * @author Feross Aboukhadijeh <https://feross.org>
30
+ * @license MIT
31
+ */var Fr;function ni(){return Fr||(Fr=1,function(l){var o=ei(),f=ri(),u=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;l.Buffer=n,l.SlowBuffer=T,l.INSPECT_MAX_BYTES=50;var p=2147483647;l.kMaxLength=p,n.TYPED_ARRAY_SUPPORT=i(),!n.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 s=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(s,t),s.foo()===42}catch{return!1}}Object.defineProperty(n.prototype,"parent",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.buffer}}),Object.defineProperty(n.prototype,"offset",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.byteOffset}});function r(s){if(s>p)throw new RangeError('The value "'+s+'" is invalid for option "size"');var t=new Uint8Array(s);return Object.setPrototypeOf(t,n.prototype),t}function n(s,t,e){if(typeof s=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(s)}return m(s,t,e)}n.poolSize=8192;function m(s,t,e){if(typeof s=="string")return x(s,t);if(ArrayBuffer.isView(s))return C(s);if(s==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s);if(G(s,ArrayBuffer)||s&&G(s.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(G(s,SharedArrayBuffer)||s&&G(s.buffer,SharedArrayBuffer)))return M(s,t,e);if(typeof s=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var a=s.valueOf&&s.valueOf();if(a!=null&&a!==s)return n.from(a,t,e);var I=b(s);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof s[Symbol.toPrimitive]=="function")return n.from(s[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s)}n.from=function(s,t,e){return m(s,t,e)},Object.setPrototypeOf(n.prototype,Uint8Array.prototype),Object.setPrototypeOf(n,Uint8Array);function N(s){if(typeof s!="number")throw new TypeError('"size" argument must be of type number');if(s<0)throw new RangeError('The value "'+s+'" is invalid for option "size"')}function w(s,t,e){return N(s),s<=0?r(s):t!==void 0?typeof e=="string"?r(s).fill(t,e):r(s).fill(t):r(s)}n.alloc=function(s,t,e){return w(s,t,e)};function g(s){return N(s),r(s<0?0:D(s)|0)}n.allocUnsafe=function(s){return g(s)},n.allocUnsafeSlow=function(s){return g(s)};function x(s,t){if((typeof t!="string"||t==="")&&(t="utf8"),!n.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var e=h(s,t)|0,a=r(e),I=a.write(s,t);return I!==e&&(a=a.slice(0,I)),a}function E(s){for(var t=s.length<0?0:D(s.length)|0,e=r(t),a=0;a<t;a+=1)e[a]=s[a]&255;return e}function C(s){if(G(s,Uint8Array)){var t=new Uint8Array(s);return M(t.buffer,t.byteOffset,t.byteLength)}return E(s)}function M(s,t,e){if(t<0||s.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<t+(e||0))throw new RangeError('"length" is outside of buffer bounds');var a;return t===void 0&&e===void 0?a=new Uint8Array(s):e===void 0?a=new Uint8Array(s,t):a=new Uint8Array(s,t,e),Object.setPrototypeOf(a,n.prototype),a}function b(s){if(n.isBuffer(s)){var t=D(s.length)|0,e=r(t);return e.length===0||s.copy(e,0,0,t),e}if(s.length!==void 0)return typeof s.length!="number"||it(s.length)?r(0):E(s);if(s.type==="Buffer"&&Array.isArray(s.data))return E(s.data)}function D(s){if(s>=p)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p.toString(16)+" bytes");return s|0}function T(s){return+s!=s&&(s=0),n.alloc(+s)}n.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==n.prototype},n.compare=function(t,e){if(G(t,Uint8Array)&&(t=n.from(t,t.offset,t.byteLength)),G(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),!n.isBuffer(t)||!n.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var a=t.length,I=e.length,_=0,P=Math.min(a,I);_<P;++_)if(t[_]!==e[_]){a=t[_],I=e[_];break}return a<I?-1:I<a?1:0},n.isEncoding=function(t){switch(String(t).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}},n.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return n.alloc(0);var a;if(e===void 0)for(e=0,a=0;a<t.length;++a)e+=t[a].length;var I=n.allocUnsafe(e),_=0;for(a=0;a<t.length;++a){var P=t[a];if(G(P,Uint8Array))_+P.length>I.length?n.from(P).copy(I,_):Uint8Array.prototype.set.call(I,P,_);else if(n.isBuffer(P))P.copy(I,_);else throw new TypeError('"list" argument must be an Array of Buffers');_+=P.length}return I};function h(s,t){if(n.isBuffer(s))return s.length;if(ArrayBuffer.isView(s)||G(s,ArrayBuffer))return s.byteLength;if(typeof s!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof s);var e=s.length,a=arguments.length>2&&arguments[2]===!0;if(!a&&e===0)return 0;for(var I=!1;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return d(s).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return K(s).length;default:if(I)return a?-1:d(s).length;t=(""+t).toLowerCase(),I=!0}}n.byteLength=h;function v(s,t,e){var a=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(s||(s="utf8");;)switch(s){case"hex":return gt(this,t,e);case"utf8":case"utf-8":return Y(this,t,e);case"ascii":return $(this,t,e);case"latin1":case"binary":return xt(this,t,e);case"base64":return W(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return mt(this,t,e);default:if(a)throw new TypeError("Unknown encoding: "+s);s=(s+"").toLowerCase(),a=!0}}n.prototype._isBuffer=!0;function A(s,t,e){var a=s[t];s[t]=s[e],s[e]=a}n.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)A(this,e,e+1);return this},n.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)A(this,e,e+3),A(this,e+1,e+2);return this},n.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)A(this,e,e+7),A(this,e+1,e+6),A(this,e+2,e+5),A(this,e+3,e+4);return this},n.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?Y(this,0,t):v.apply(this,arguments)},n.prototype.toLocaleString=n.prototype.toString,n.prototype.equals=function(t){if(!n.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:n.compare(this,t)===0},n.prototype.inspect=function(){var t="",e=l.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},u&&(n.prototype[u]=n.prototype.inspect),n.prototype.compare=function(t,e,a,I,_){if(G(t,Uint8Array)&&(t=n.from(t,t.offset,t.byteLength)),!n.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),a===void 0&&(a=t?t.length:0),I===void 0&&(I=0),_===void 0&&(_=this.length),e<0||a>t.length||I<0||_>this.length)throw new RangeError("out of range index");if(I>=_&&e>=a)return 0;if(I>=_)return-1;if(e>=a)return 1;if(e>>>=0,a>>>=0,I>>>=0,_>>>=0,this===t)return 0;for(var P=_-I,q=a-e,V=Math.min(P,q),rt=this.slice(I,_),st=t.slice(e,a),nt=0;nt<V;++nt)if(rt[nt]!==st[nt]){P=rt[nt],q=st[nt];break}return P<q?-1:q<P?1:0};function j(s,t,e,a,I){if(s.length===0)return-1;if(typeof e=="string"?(a=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,it(e)&&(e=I?0:s.length-1),e<0&&(e=s.length+e),e>=s.length){if(I)return-1;e=s.length-1}else if(e<0)if(I)e=0;else return-1;if(typeof t=="string"&&(t=n.from(t,a)),n.isBuffer(t))return t.length===0?-1:U(s,t,e,a,I);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?I?Uint8Array.prototype.indexOf.call(s,t,e):Uint8Array.prototype.lastIndexOf.call(s,t,e):U(s,[t],e,a,I);throw new TypeError("val must be string, number or Buffer")}function U(s,t,e,a,I){var _=1,P=s.length,q=t.length;if(a!==void 0&&(a=String(a).toLowerCase(),a==="ucs2"||a==="ucs-2"||a==="utf16le"||a==="utf-16le")){if(s.length<2||t.length<2)return-1;_=2,P/=2,q/=2,e/=2}function V(ke,Ve){return _===1?ke[Ve]:ke.readUInt16BE(Ve*_)}var rt;if(I){var st=-1;for(rt=e;rt<P;rt++)if(V(s,rt)===V(t,st===-1?0:rt-st)){if(st===-1&&(st=rt),rt-st+1===q)return st*_}else st!==-1&&(rt-=rt-st),st=-1}else for(e+q>P&&(e=P-q),rt=e;rt>=0;rt--){for(var nt=!0,vt=0;vt<q;vt++)if(V(s,rt+vt)!==V(t,vt)){nt=!1;break}if(nt)return rt}return-1}n.prototype.includes=function(t,e,a){return this.indexOf(t,e,a)!==-1},n.prototype.indexOf=function(t,e,a){return j(this,t,e,a,!0)},n.prototype.lastIndexOf=function(t,e,a){return j(this,t,e,a,!1)};function B(s,t,e,a){e=Number(e)||0;var I=s.length-e;a?(a=Number(a),a>I&&(a=I)):a=I;var _=t.length;a>_/2&&(a=_/2);for(var P=0;P<a;++P){var q=parseInt(t.substr(P*2,2),16);if(it(q))return P;s[e+P]=q}return P}function c(s,t,e,a){return tt(d(t,s.length-e),s,e,a)}function F(s,t,e,a){return tt(S(t),s,e,a)}function R(s,t,e,a){return tt(K(t),s,e,a)}function X(s,t,e,a){return tt(L(t,s.length-e),s,e,a)}n.prototype.write=function(t,e,a,I){if(e===void 0)I="utf8",a=this.length,e=0;else if(a===void 0&&typeof e=="string")I=e,a=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(a)?(a=a>>>0,I===void 0&&(I="utf8")):(I=a,a=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var _=this.length-e;if((a===void 0||a>_)&&(a=_),t.length>0&&(a<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");I||(I="utf8");for(var P=!1;;)switch(I){case"hex":return B(this,t,e,a);case"utf8":case"utf-8":return c(this,t,e,a);case"ascii":case"latin1":case"binary":return F(this,t,e,a);case"base64":return R(this,t,e,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,t,e,a);default:if(P)throw new TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),P=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function W(s,t,e){return t===0&&e===s.length?o.fromByteArray(s):o.fromByteArray(s.slice(t,e))}function Y(s,t,e){e=Math.min(s.length,e);for(var a=[],I=t;I<e;){var _=s[I],P=null,q=_>239?4:_>223?3:_>191?2:1;if(I+q<=e){var V,rt,st,nt;switch(q){case 1:_<128&&(P=_);break;case 2:V=s[I+1],(V&192)===128&&(nt=(_&31)<<6|V&63,nt>127&&(P=nt));break;case 3:V=s[I+1],rt=s[I+2],(V&192)===128&&(rt&192)===128&&(nt=(_&15)<<12|(V&63)<<6|rt&63,nt>2047&&(nt<55296||nt>57343)&&(P=nt));break;case 4:V=s[I+1],rt=s[I+2],st=s[I+3],(V&192)===128&&(rt&192)===128&&(st&192)===128&&(nt=(_&15)<<18|(V&63)<<12|(rt&63)<<6|st&63,nt>65535&&nt<1114112&&(P=nt))}}P===null?(P=65533,q=1):P>65535&&(P-=65536,a.push(P>>>10&1023|55296),P=56320|P&1023),a.push(P),I+=q}return z(a)}var J=4096;function z(s){var t=s.length;if(t<=J)return String.fromCharCode.apply(String,s);for(var e="",a=0;a<t;)e+=String.fromCharCode.apply(String,s.slice(a,a+=J));return e}function $(s,t,e){var a="";e=Math.min(s.length,e);for(var I=t;I<e;++I)a+=String.fromCharCode(s[I]&127);return a}function xt(s,t,e){var a="";e=Math.min(s.length,e);for(var I=t;I<e;++I)a+=String.fromCharCode(s[I]);return a}function gt(s,t,e){var a=s.length;(!t||t<0)&&(t=0),(!e||e<0||e>a)&&(e=a);for(var I="",_=t;_<e;++_)I+=O[s[_]];return I}function mt(s,t,e){for(var a=s.slice(t,e),I="",_=0;_<a.length-1;_+=2)I+=String.fromCharCode(a[_]+a[_+1]*256);return I}n.prototype.slice=function(t,e){var a=this.length;t=~~t,e=e===void 0?a:~~e,t<0?(t+=a,t<0&&(t=0)):t>a&&(t=a),e<0?(e+=a,e<0&&(e=0)):e>a&&(e=a),e<t&&(e=t);var I=this.subarray(t,e);return Object.setPrototypeOf(I,n.prototype),I};function Q(s,t,e){if(s%1!==0||s<0)throw new RangeError("offset is not uint");if(s+t>e)throw new RangeError("Trying to access beyond buffer length")}n.prototype.readUintLE=n.prototype.readUIntLE=function(t,e,a){t=t>>>0,e=e>>>0,a||Q(t,e,this.length);for(var I=this[t],_=1,P=0;++P<e&&(_*=256);)I+=this[t+P]*_;return I},n.prototype.readUintBE=n.prototype.readUIntBE=function(t,e,a){t=t>>>0,e=e>>>0,a||Q(t,e,this.length);for(var I=this[t+--e],_=1;e>0&&(_*=256);)I+=this[t+--e]*_;return I},n.prototype.readUint8=n.prototype.readUInt8=function(t,e){return t=t>>>0,e||Q(t,1,this.length),this[t]},n.prototype.readUint16LE=n.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||Q(t,2,this.length),this[t]|this[t+1]<<8},n.prototype.readUint16BE=n.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||Q(t,2,this.length),this[t]<<8|this[t+1]},n.prototype.readUint32LE=n.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||Q(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},n.prototype.readUint32BE=n.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||Q(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},n.prototype.readIntLE=function(t,e,a){t=t>>>0,e=e>>>0,a||Q(t,e,this.length);for(var I=this[t],_=1,P=0;++P<e&&(_*=256);)I+=this[t+P]*_;return _*=128,I>=_&&(I-=Math.pow(2,8*e)),I},n.prototype.readIntBE=function(t,e,a){t=t>>>0,e=e>>>0,a||Q(t,e,this.length);for(var I=e,_=1,P=this[t+--I];I>0&&(_*=256);)P+=this[t+--I]*_;return _*=128,P>=_&&(P-=Math.pow(2,8*e)),P},n.prototype.readInt8=function(t,e){return t=t>>>0,e||Q(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},n.prototype.readInt16LE=function(t,e){t=t>>>0,e||Q(t,2,this.length);var a=this[t]|this[t+1]<<8;return a&32768?a|4294901760:a},n.prototype.readInt16BE=function(t,e){t=t>>>0,e||Q(t,2,this.length);var a=this[t+1]|this[t]<<8;return a&32768?a|4294901760:a},n.prototype.readInt32LE=function(t,e){return t=t>>>0,e||Q(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},n.prototype.readInt32BE=function(t,e){return t=t>>>0,e||Q(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},n.prototype.readFloatLE=function(t,e){return t=t>>>0,e||Q(t,4,this.length),f.read(this,t,!0,23,4)},n.prototype.readFloatBE=function(t,e){return t=t>>>0,e||Q(t,4,this.length),f.read(this,t,!1,23,4)},n.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||Q(t,8,this.length),f.read(this,t,!0,52,8)},n.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||Q(t,8,this.length),f.read(this,t,!1,52,8)};function et(s,t,e,a,I,_){if(!n.isBuffer(s))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>I||t<_)throw new RangeError('"value" argument is out of bounds');if(e+a>s.length)throw new RangeError("Index out of range")}n.prototype.writeUintLE=n.prototype.writeUIntLE=function(t,e,a,I){if(t=+t,e=e>>>0,a=a>>>0,!I){var _=Math.pow(2,8*a)-1;et(this,t,e,a,_,0)}var P=1,q=0;for(this[e]=t&255;++q<a&&(P*=256);)this[e+q]=t/P&255;return e+a},n.prototype.writeUintBE=n.prototype.writeUIntBE=function(t,e,a,I){if(t=+t,e=e>>>0,a=a>>>0,!I){var _=Math.pow(2,8*a)-1;et(this,t,e,a,_,0)}var P=a-1,q=1;for(this[e+P]=t&255;--P>=0&&(q*=256);)this[e+P]=t/q&255;return e+a},n.prototype.writeUint8=n.prototype.writeUInt8=function(t,e,a){return t=+t,e=e>>>0,a||et(this,t,e,1,255,0),this[e]=t&255,e+1},n.prototype.writeUint16LE=n.prototype.writeUInt16LE=function(t,e,a){return t=+t,e=e>>>0,a||et(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2},n.prototype.writeUint16BE=n.prototype.writeUInt16BE=function(t,e,a){return t=+t,e=e>>>0,a||et(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2},n.prototype.writeUint32LE=n.prototype.writeUInt32LE=function(t,e,a){return t=+t,e=e>>>0,a||et(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4},n.prototype.writeUint32BE=n.prototype.writeUInt32BE=function(t,e,a){return t=+t,e=e>>>0,a||et(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4},n.prototype.writeIntLE=function(t,e,a,I){if(t=+t,e=e>>>0,!I){var _=Math.pow(2,8*a-1);et(this,t,e,a,_-1,-_)}var P=0,q=1,V=0;for(this[e]=t&255;++P<a&&(q*=256);)t<0&&V===0&&this[e+P-1]!==0&&(V=1),this[e+P]=(t/q>>0)-V&255;return e+a},n.prototype.writeIntBE=function(t,e,a,I){if(t=+t,e=e>>>0,!I){var _=Math.pow(2,8*a-1);et(this,t,e,a,_-1,-_)}var P=a-1,q=1,V=0;for(this[e+P]=t&255;--P>=0&&(q*=256);)t<0&&V===0&&this[e+P+1]!==0&&(V=1),this[e+P]=(t/q>>0)-V&255;return e+a},n.prototype.writeInt8=function(t,e,a){return t=+t,e=e>>>0,a||et(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1},n.prototype.writeInt16LE=function(t,e,a){return t=+t,e=e>>>0,a||et(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2},n.prototype.writeInt16BE=function(t,e,a){return t=+t,e=e>>>0,a||et(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2},n.prototype.writeInt32LE=function(t,e,a){return t=+t,e=e>>>0,a||et(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},n.prototype.writeInt32BE=function(t,e,a){return t=+t,e=e>>>0,a||et(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function bt(s,t,e,a,I,_){if(e+a>s.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function k(s,t,e,a,I){return t=+t,e=e>>>0,I||bt(s,t,e,4),f.write(s,t,e,a,23,4),e+4}n.prototype.writeFloatLE=function(t,e,a){return k(this,t,e,!0,a)},n.prototype.writeFloatBE=function(t,e,a){return k(this,t,e,!1,a)};function yt(s,t,e,a,I){return t=+t,e=e>>>0,I||bt(s,t,e,8),f.write(s,t,e,a,52,8),e+8}n.prototype.writeDoubleLE=function(t,e,a){return yt(this,t,e,!0,a)},n.prototype.writeDoubleBE=function(t,e,a){return yt(this,t,e,!1,a)},n.prototype.copy=function(t,e,a,I){if(!n.isBuffer(t))throw new TypeError("argument should be a Buffer");if(a||(a=0),!I&&I!==0&&(I=this.length),e>=t.length&&(e=t.length),e||(e=0),I>0&&I<a&&(I=a),I===a||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(a<0||a>=this.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("sourceEnd out of bounds");I>this.length&&(I=this.length),t.length-e<I-a&&(I=t.length-e+a);var _=I-a;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,a,I):Uint8Array.prototype.set.call(t,this.subarray(a,I),e),_},n.prototype.fill=function(t,e,a,I){if(typeof t=="string"){if(typeof e=="string"?(I=e,e=0,a=this.length):typeof a=="string"&&(I=a,a=this.length),I!==void 0&&typeof I!="string")throw new TypeError("encoding must be a string");if(typeof I=="string"&&!n.isEncoding(I))throw new TypeError("Unknown encoding: "+I);if(t.length===1){var _=t.charCodeAt(0);(I==="utf8"&&_<128||I==="latin1")&&(t=_)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<a)throw new RangeError("Out of range index");if(a<=e)return this;e=e>>>0,a=a===void 0?this.length:a>>>0,t||(t=0);var P;if(typeof t=="number")for(P=e;P<a;++P)this[P]=t;else{var q=n.isBuffer(t)?t:n.from(t,I),V=q.length;if(V===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(P=0;P<a-e;++P)this[P+e]=q[P%V]}return this};var Tt=/[^+/0-9A-Za-z-_]/g;function y(s){if(s=s.split("=")[0],s=s.trim().replace(Tt,""),s.length<2)return"";for(;s.length%4!==0;)s=s+"=";return s}function d(s,t){t=t||1/0;for(var e,a=s.length,I=null,_=[],P=0;P<a;++P){if(e=s.charCodeAt(P),e>55295&&e<57344){if(!I){if(e>56319){(t-=3)>-1&&_.push(239,191,189);continue}else if(P+1===a){(t-=3)>-1&&_.push(239,191,189);continue}I=e;continue}if(e<56320){(t-=3)>-1&&_.push(239,191,189),I=e;continue}e=(I-55296<<10|e-56320)+65536}else I&&(t-=3)>-1&&_.push(239,191,189);if(I=null,e<128){if((t-=1)<0)break;_.push(e)}else if(e<2048){if((t-=2)<0)break;_.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;_.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;_.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return _}function S(s){for(var t=[],e=0;e<s.length;++e)t.push(s.charCodeAt(e)&255);return t}function L(s,t){for(var e,a,I,_=[],P=0;P<s.length&&!((t-=2)<0);++P)e=s.charCodeAt(P),a=e>>8,I=e%256,_.push(I),_.push(a);return _}function K(s){return o.toByteArray(y(s))}function tt(s,t,e,a){for(var I=0;I<a&&!(I+e>=t.length||I>=s.length);++I)t[I+e]=s[I];return I}function G(s,t){return s instanceof t||s!=null&&s.constructor!=null&&s.constructor.name!=null&&s.constructor.name===t.name}function it(s){return s!==s}var O=function(){for(var s="0123456789abcdef",t=new Array(256),e=0;e<16;++e)for(var a=e*16,I=0;I<16;++I)t[a+I]=s[e]+s[I];return t}()}(be)),be}/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Sr;function ii(){return Sr||(Sr=1,function(l,o){var f=ni(),u=f.Buffer;function p(r,n){for(var m in r)n[m]=r[m]}u.from&&u.alloc&&u.allocUnsafe&&u.allocUnsafeSlow?l.exports=f:(p(f,o),o.Buffer=i);function i(r,n,m){return u(r,n,m)}i.prototype=Object.create(u.prototype),p(u,i),i.from=function(r,n,m){if(typeof r=="number")throw new TypeError("Argument must not be a number");return u(r,n,m)},i.alloc=function(r,n,m){if(typeof r!="number")throw new TypeError("Argument must be a number");var N=u(r);return n!==void 0?typeof m=="string"?N.fill(n,m):N.fill(n):N.fill(0),N},i.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return u(r)},i.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return f.SlowBuffer(r)}}(Ot,Ot.exports)),Ot.exports}var Br;function oi(){if(Br)return we;Br=1;var l=ii().Buffer,o=l.isEncoding||function(D){switch(D=""+D,D&&D.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 f(D){if(!D)return"utf8";for(var T;;)switch(D){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 D;default:if(T)return;D=(""+D).toLowerCase(),T=!0}}function u(D){var T=f(D);if(typeof T!="string"&&(l.isEncoding===o||!o(D)))throw new Error("Unknown encoding: "+D);return T||D}we.StringDecoder=p;function p(D){this.encoding=u(D);var T;switch(this.encoding){case"utf16le":this.text=g,this.end=x,T=4;break;case"utf8":this.fillLast=m,T=4;break;case"base64":this.text=E,this.end=C,T=3;break;default:this.write=M,this.end=b;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=l.allocUnsafe(T)}p.prototype.write=function(D){if(D.length===0)return"";var T,h;if(this.lastNeed){if(T=this.fillLast(D),T===void 0)return"";h=this.lastNeed,this.lastNeed=0}else h=0;return h<D.length?T?T+this.text(D,h):this.text(D,h):T||""},p.prototype.end=w,p.prototype.text=N,p.prototype.fillLast=function(D){if(this.lastNeed<=D.length)return D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,D.length),this.lastNeed-=D.length};function i(D){return D<=127?0:D>>5===6?2:D>>4===14?3:D>>3===30?4:D>>6===2?-1:-2}function r(D,T,h){var v=T.length-1;if(v<h)return 0;var A=i(T[v]);return A>=0?(A>0&&(D.lastNeed=A-1),A):--v<h||A===-2?0:(A=i(T[v]),A>=0?(A>0&&(D.lastNeed=A-2),A):--v<h||A===-2?0:(A=i(T[v]),A>=0?(A>0&&(A===2?A=0:D.lastNeed=A-3),A):0))}function n(D,T,h){if((T[0]&192)!==128)return D.lastNeed=0,"�";if(D.lastNeed>1&&T.length>1){if((T[1]&192)!==128)return D.lastNeed=1,"�";if(D.lastNeed>2&&T.length>2&&(T[2]&192)!==128)return D.lastNeed=2,"�"}}function m(D){var T=this.lastTotal-this.lastNeed,h=n(this,D);if(h!==void 0)return h;if(this.lastNeed<=D.length)return D.copy(this.lastChar,T,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,T,0,D.length),this.lastNeed-=D.length}function N(D,T){var h=r(this,D,T);if(!this.lastNeed)return D.toString("utf8",T);this.lastTotal=h;var v=D.length-(h-this.lastNeed);return D.copy(this.lastChar,0,v),D.toString("utf8",T,v)}function w(D){var T=D&&D.length?this.write(D):"";return this.lastNeed?T+"�":T}function g(D,T){if((D.length-T)%2===0){var h=D.toString("utf16le",T);if(h){var v=h.charCodeAt(h.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1],h.slice(0,-1)}return h}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",T,D.length-1)}function x(D){var T=D&&D.length?this.write(D):"";if(this.lastNeed){var h=this.lastTotal-this.lastNeed;return T+this.lastChar.toString("utf16le",0,h)}return T}function E(D,T){var h=(D.length-T)%3;return h===0?D.toString("base64",T):(this.lastNeed=3-h,this.lastTotal=3,h===1?this.lastChar[0]=D[D.length-1]:(this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1]),D.toString("base64",T,D.length-h))}function C(D){var T=D&&D.length?this.write(D):"";return this.lastNeed?T+this.lastChar.toString("base64",0,3-this.lastNeed):T}function M(D){return D.toString(this.encoding)}function b(D){return D&&D.length?this.write(D):""}return we}var Rr;function si(){return Rr||(Rr=1,function(l){(function(o){o.parser=function(y,d){return new u(y,d)},o.SAXParser=u,o.SAXStream=w,o.createStream=N,o.MAX_BUFFER_LENGTH=64*1024;var f=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];o.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function u(y,d){if(!(this instanceof u))return new u(y,d);var S=this;i(S),S.q=S.c="",S.bufferCheckPosition=o.MAX_BUFFER_LENGTH,S.opt=d||{},S.opt.lowercase=S.opt.lowercase||S.opt.lowercasetags,S.looseCase=S.opt.lowercase?"toLowerCase":"toUpperCase",S.tags=[],S.closed=S.closedRoot=S.sawRoot=!1,S.tag=S.error=null,S.strict=!!y,S.noscript=!!(y||S.opt.noscript),S.state=c.BEGIN,S.strictEntities=S.opt.strictEntities,S.ENTITIES=S.strictEntities?Object.create(o.XML_ENTITIES):Object.create(o.ENTITIES),S.attribList=[],S.opt.xmlns&&(S.ns=Object.create(M)),S.opt.unquotedAttributeValues===void 0&&(S.opt.unquotedAttributeValues=!y),S.trackPosition=S.opt.position!==!1,S.trackPosition&&(S.position=S.line=S.column=0),R(S,"onready")}Object.create||(Object.create=function(y){function d(){}d.prototype=y;var S=new d;return S}),Object.keys||(Object.keys=function(y){var d=[];for(var S in y)y.hasOwnProperty(S)&&d.push(S);return d});function p(y){for(var d=Math.max(o.MAX_BUFFER_LENGTH,10),S=0,L=0,K=f.length;L<K;L++){var tt=y[f[L]].length;if(tt>d)switch(f[L]){case"textNode":W(y);break;case"cdata":X(y,"oncdata",y.cdata),y.cdata="";break;case"script":X(y,"onscript",y.script),y.script="";break;default:J(y,"Max buffer length exceeded: "+f[L])}S=Math.max(S,tt)}var G=o.MAX_BUFFER_LENGTH-S;y.bufferCheckPosition=G+y.position}function i(y){for(var d=0,S=f.length;d<S;d++)y[f[d]]=""}function r(y){W(y),y.cdata!==""&&(X(y,"oncdata",y.cdata),y.cdata=""),y.script!==""&&(X(y,"onscript",y.script),y.script="")}u.prototype={end:function(){z(this)},write:Tt,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){r(this)}};var n;try{n=require("stream").Stream}catch{n=function(){}}n||(n=function(){});var m=o.EVENTS.filter(function(y){return y!=="error"&&y!=="end"});function N(y,d){return new w(y,d)}function w(y,d){if(!(this instanceof w))return new w(y,d);n.apply(this),this._parser=new u(y,d),this.writable=!0,this.readable=!0;var S=this;this._parser.onend=function(){S.emit("end")},this._parser.onerror=function(L){S.emit("error",L),S._parser.error=null},this._decoder=null,m.forEach(function(L){Object.defineProperty(S,"on"+L,{get:function(){return S._parser["on"+L]},set:function(K){if(!K)return S.removeAllListeners(L),S._parser["on"+L]=K,K;S.on(L,K)},enumerable:!0,configurable:!1})})}w.prototype=Object.create(n.prototype,{constructor:{value:w}}),w.prototype.write=function(y){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(y)){if(!this._decoder){var d=oi().StringDecoder;this._decoder=new d("utf8")}y=this._decoder.write(y)}return this._parser.write(y.toString()),this.emit("data",y),!0},w.prototype.end=function(y){return y&&y.length&&this.write(y),this._parser.end(),!0},w.prototype.on=function(y,d){var S=this;return!S._parser["on"+y]&&m.indexOf(y)!==-1&&(S._parser["on"+y]=function(){var L=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);L.splice(0,0,y),S.emit.apply(S,L)}),n.prototype.on.call(S,y,d)};var g="[CDATA[",x="DOCTYPE",E="http://www.w3.org/XML/1998/namespace",C="http://www.w3.org/2000/xmlns/",M={xml:E,xmlns:C},b=/[:_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]/,D=/[:_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-]/,T=/[#:_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]/,h=/[#:_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 v(y){return y===" "||y===`
32
+ `||y==="\r"||y===" "}function A(y){return y==='"'||y==="'"}function j(y){return y===">"||v(y)}function U(y,d){return y.test(d)}function B(y,d){return!U(y,d)}var c=0;o.STATE={BEGIN:c++,BEGIN_WHITESPACE:c++,TEXT:c++,TEXT_ENTITY:c++,OPEN_WAKA:c++,SGML_DECL:c++,SGML_DECL_QUOTED:c++,DOCTYPE:c++,DOCTYPE_QUOTED:c++,DOCTYPE_DTD:c++,DOCTYPE_DTD_QUOTED:c++,COMMENT_STARTING:c++,COMMENT:c++,COMMENT_ENDING:c++,COMMENT_ENDED:c++,CDATA:c++,CDATA_ENDING:c++,CDATA_ENDING_2:c++,PROC_INST:c++,PROC_INST_BODY:c++,PROC_INST_ENDING:c++,OPEN_TAG:c++,OPEN_TAG_SLASH:c++,ATTRIB:c++,ATTRIB_NAME:c++,ATTRIB_NAME_SAW_WHITE:c++,ATTRIB_VALUE:c++,ATTRIB_VALUE_QUOTED:c++,ATTRIB_VALUE_CLOSED:c++,ATTRIB_VALUE_UNQUOTED:c++,ATTRIB_VALUE_ENTITY_Q:c++,ATTRIB_VALUE_ENTITY_U:c++,CLOSE_TAG:c++,CLOSE_TAG_SAW_WHITE:c++,SCRIPT:c++,SCRIPT_ENDING:c++},o.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},o.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(o.ENTITIES).forEach(function(y){var d=o.ENTITIES[y],S=typeof d=="number"?String.fromCharCode(d):d;o.ENTITIES[y]=S});for(var F in o.STATE)o.STATE[o.STATE[F]]=F;c=o.STATE;function R(y,d,S){y[d]&&y[d](S)}function X(y,d,S){y.textNode&&W(y),R(y,d,S)}function W(y){y.textNode=Y(y.opt,y.textNode),y.textNode&&R(y,"ontext",y.textNode),y.textNode=""}function Y(y,d){return y.trim&&(d=d.trim()),y.normalize&&(d=d.replace(/\s+/g," ")),d}function J(y,d){return W(y),y.trackPosition&&(d+=`
33
+ Line: `+y.line+`
34
+ Column: `+y.column+`
35
+ Char: `+y.c),d=new Error(d),y.error=d,R(y,"onerror",d),y}function z(y){return y.sawRoot&&!y.closedRoot&&$(y,"Unclosed root tag"),y.state!==c.BEGIN&&y.state!==c.BEGIN_WHITESPACE&&y.state!==c.TEXT&&J(y,"Unexpected end"),W(y),y.c="",y.closed=!0,R(y,"onend"),u.call(y,y.strict,y.opt),y}function $(y,d){if(typeof y!="object"||!(y instanceof u))throw new Error("bad call to strictFail");y.strict&&J(y,d)}function xt(y){y.strict||(y.tagName=y.tagName[y.looseCase]());var d=y.tags[y.tags.length-1]||y,S=y.tag={name:y.tagName,attributes:{}};y.opt.xmlns&&(S.ns=d.ns),y.attribList.length=0,X(y,"onopentagstart",S)}function gt(y,d){var S=y.indexOf(":"),L=S<0?["",y]:y.split(":"),K=L[0],tt=L[1];return d&&y==="xmlns"&&(K="xmlns",tt=""),{prefix:K,local:tt}}function mt(y){if(y.strict||(y.attribName=y.attribName[y.looseCase]()),y.attribList.indexOf(y.attribName)!==-1||y.tag.attributes.hasOwnProperty(y.attribName)){y.attribName=y.attribValue="";return}if(y.opt.xmlns){var d=gt(y.attribName,!0),S=d.prefix,L=d.local;if(S==="xmlns")if(L==="xml"&&y.attribValue!==E)$(y,"xml: prefix must be bound to "+E+`
36
+ Actual: `+y.attribValue);else if(L==="xmlns"&&y.attribValue!==C)$(y,"xmlns: prefix must be bound to "+C+`
37
+ Actual: `+y.attribValue);else{var K=y.tag,tt=y.tags[y.tags.length-1]||y;K.ns===tt.ns&&(K.ns=Object.create(tt.ns)),K.ns[L]=y.attribValue}y.attribList.push([y.attribName,y.attribValue])}else y.tag.attributes[y.attribName]=y.attribValue,X(y,"onattribute",{name:y.attribName,value:y.attribValue});y.attribName=y.attribValue=""}function Q(y,d){if(y.opt.xmlns){var S=y.tag,L=gt(y.tagName);S.prefix=L.prefix,S.local=L.local,S.uri=S.ns[L.prefix]||"",S.prefix&&!S.uri&&($(y,"Unbound namespace prefix: "+JSON.stringify(y.tagName)),S.uri=L.prefix);var K=y.tags[y.tags.length-1]||y;S.ns&&K.ns!==S.ns&&Object.keys(S.ns).forEach(function(P){X(y,"onopennamespace",{prefix:P,uri:S.ns[P]})});for(var tt=0,G=y.attribList.length;tt<G;tt++){var it=y.attribList[tt],O=it[0],s=it[1],t=gt(O,!0),e=t.prefix,a=t.local,I=e===""?"":S.ns[e]||"",_={name:O,value:s,prefix:e,local:a,uri:I};e&&e!=="xmlns"&&!I&&($(y,"Unbound namespace prefix: "+JSON.stringify(e)),_.uri=e),y.tag.attributes[O]=_,X(y,"onattribute",_)}y.attribList.length=0}y.tag.isSelfClosing=!!d,y.sawRoot=!0,y.tags.push(y.tag),X(y,"onopentag",y.tag),d||(!y.noscript&&y.tagName.toLowerCase()==="script"?y.state=c.SCRIPT:y.state=c.TEXT,y.tag=null,y.tagName=""),y.attribName=y.attribValue="",y.attribList.length=0}function et(y){if(!y.tagName){$(y,"Weird empty close tag."),y.textNode+="</>",y.state=c.TEXT;return}if(y.script){if(y.tagName!=="script"){y.script+="</"+y.tagName+">",y.tagName="",y.state=c.SCRIPT;return}X(y,"onscript",y.script),y.script=""}var d=y.tags.length,S=y.tagName;y.strict||(S=S[y.looseCase]());for(var L=S;d--;){var K=y.tags[d];if(K.name!==L)$(y,"Unexpected close tag");else break}if(d<0){$(y,"Unmatched closing tag: "+y.tagName),y.textNode+="</"+y.tagName+">",y.state=c.TEXT;return}y.tagName=S;for(var tt=y.tags.length;tt-- >d;){var G=y.tag=y.tags.pop();y.tagName=y.tag.name,X(y,"onclosetag",y.tagName);var it={};for(var O in G.ns)it[O]=G.ns[O];var s=y.tags[y.tags.length-1]||y;y.opt.xmlns&&G.ns!==s.ns&&Object.keys(G.ns).forEach(function(t){var e=G.ns[t];X(y,"onclosenamespace",{prefix:t,uri:e})})}d===0&&(y.closedRoot=!0),y.tagName=y.attribValue=y.attribName="",y.attribList.length=0,y.state=c.TEXT}function bt(y){var d=y.entity,S=d.toLowerCase(),L,K="";return y.ENTITIES[d]?y.ENTITIES[d]:y.ENTITIES[S]?y.ENTITIES[S]:(d=S,d.charAt(0)==="#"&&(d.charAt(1)==="x"?(d=d.slice(2),L=parseInt(d,16),K=L.toString(16)):(d=d.slice(1),L=parseInt(d,10),K=L.toString(10))),d=d.replace(/^0+/,""),isNaN(L)||K.toLowerCase()!==d?($(y,"Invalid character entity"),"&"+y.entity+";"):String.fromCodePoint(L))}function k(y,d){d==="<"?(y.state=c.OPEN_WAKA,y.startTagPosition=y.position):v(d)||($(y,"Non-whitespace before first tag."),y.textNode=d,y.state=c.TEXT)}function yt(y,d){var S="";return d<y.length&&(S=y.charAt(d)),S}function Tt(y){var d=this;if(this.error)throw this.error;if(d.closed)return J(d,"Cannot write after close. Assign an onready handler.");if(y===null)return z(d);typeof y=="object"&&(y=y.toString());for(var S=0,L="";L=yt(y,S++),d.c=L,!!L;)switch(d.trackPosition&&(d.position++,L===`
38
+ `?(d.line++,d.column=0):d.column++),d.state){case c.BEGIN:if(d.state=c.BEGIN_WHITESPACE,L==="\uFEFF")continue;k(d,L);continue;case c.BEGIN_WHITESPACE:k(d,L);continue;case c.TEXT:if(d.sawRoot&&!d.closedRoot){for(var K=S-1;L&&L!=="<"&&L!=="&";)L=yt(y,S++),L&&d.trackPosition&&(d.position++,L===`
39
+ `?(d.line++,d.column=0):d.column++);d.textNode+=y.substring(K,S-1)}L==="<"&&!(d.sawRoot&&d.closedRoot&&!d.strict)?(d.state=c.OPEN_WAKA,d.startTagPosition=d.position):(!v(L)&&(!d.sawRoot||d.closedRoot)&&$(d,"Text data outside of root node."),L==="&"?d.state=c.TEXT_ENTITY:d.textNode+=L);continue;case c.SCRIPT:L==="<"?d.state=c.SCRIPT_ENDING:d.script+=L;continue;case c.SCRIPT_ENDING:L==="/"?d.state=c.CLOSE_TAG:(d.script+="<"+L,d.state=c.SCRIPT);continue;case c.OPEN_WAKA:if(L==="!")d.state=c.SGML_DECL,d.sgmlDecl="";else if(!v(L))if(U(b,L))d.state=c.OPEN_TAG,d.tagName=L;else if(L==="/")d.state=c.CLOSE_TAG,d.tagName="";else if(L==="?")d.state=c.PROC_INST,d.procInstName=d.procInstBody="";else{if($(d,"Unencoded <"),d.startTagPosition+1<d.position){var tt=d.position-d.startTagPosition;L=new Array(tt).join(" ")+L}d.textNode+="<"+L,d.state=c.TEXT}continue;case c.SGML_DECL:if(d.sgmlDecl+L==="--"){d.state=c.COMMENT,d.comment="",d.sgmlDecl="";continue}d.doctype&&d.doctype!==!0&&d.sgmlDecl?(d.state=c.DOCTYPE_DTD,d.doctype+="<!"+d.sgmlDecl+L,d.sgmlDecl=""):(d.sgmlDecl+L).toUpperCase()===g?(X(d,"onopencdata"),d.state=c.CDATA,d.sgmlDecl="",d.cdata=""):(d.sgmlDecl+L).toUpperCase()===x?(d.state=c.DOCTYPE,(d.doctype||d.sawRoot)&&$(d,"Inappropriately located doctype declaration"),d.doctype="",d.sgmlDecl=""):L===">"?(X(d,"onsgmldeclaration",d.sgmlDecl),d.sgmlDecl="",d.state=c.TEXT):(A(L)&&(d.state=c.SGML_DECL_QUOTED),d.sgmlDecl+=L);continue;case c.SGML_DECL_QUOTED:L===d.q&&(d.state=c.SGML_DECL,d.q=""),d.sgmlDecl+=L;continue;case c.DOCTYPE:L===">"?(d.state=c.TEXT,X(d,"ondoctype",d.doctype),d.doctype=!0):(d.doctype+=L,L==="["?d.state=c.DOCTYPE_DTD:A(L)&&(d.state=c.DOCTYPE_QUOTED,d.q=L));continue;case c.DOCTYPE_QUOTED:d.doctype+=L,L===d.q&&(d.q="",d.state=c.DOCTYPE);continue;case c.DOCTYPE_DTD:L==="]"?(d.doctype+=L,d.state=c.DOCTYPE):L==="<"?(d.state=c.OPEN_WAKA,d.startTagPosition=d.position):A(L)?(d.doctype+=L,d.state=c.DOCTYPE_DTD_QUOTED,d.q=L):d.doctype+=L;continue;case c.DOCTYPE_DTD_QUOTED:d.doctype+=L,L===d.q&&(d.state=c.DOCTYPE_DTD,d.q="");continue;case c.COMMENT:L==="-"?d.state=c.COMMENT_ENDING:d.comment+=L;continue;case c.COMMENT_ENDING:L==="-"?(d.state=c.COMMENT_ENDED,d.comment=Y(d.opt,d.comment),d.comment&&X(d,"oncomment",d.comment),d.comment=""):(d.comment+="-"+L,d.state=c.COMMENT);continue;case c.COMMENT_ENDED:L!==">"?($(d,"Malformed comment"),d.comment+="--"+L,d.state=c.COMMENT):d.doctype&&d.doctype!==!0?d.state=c.DOCTYPE_DTD:d.state=c.TEXT;continue;case c.CDATA:L==="]"?d.state=c.CDATA_ENDING:d.cdata+=L;continue;case c.CDATA_ENDING:L==="]"?d.state=c.CDATA_ENDING_2:(d.cdata+="]"+L,d.state=c.CDATA);continue;case c.CDATA_ENDING_2:L===">"?(d.cdata&&X(d,"oncdata",d.cdata),X(d,"onclosecdata"),d.cdata="",d.state=c.TEXT):L==="]"?d.cdata+="]":(d.cdata+="]]"+L,d.state=c.CDATA);continue;case c.PROC_INST:L==="?"?d.state=c.PROC_INST_ENDING:v(L)?d.state=c.PROC_INST_BODY:d.procInstName+=L;continue;case c.PROC_INST_BODY:if(!d.procInstBody&&v(L))continue;L==="?"?d.state=c.PROC_INST_ENDING:d.procInstBody+=L;continue;case c.PROC_INST_ENDING:L===">"?(X(d,"onprocessinginstruction",{name:d.procInstName,body:d.procInstBody}),d.procInstName=d.procInstBody="",d.state=c.TEXT):(d.procInstBody+="?"+L,d.state=c.PROC_INST_BODY);continue;case c.OPEN_TAG:U(D,L)?d.tagName+=L:(xt(d),L===">"?Q(d):L==="/"?d.state=c.OPEN_TAG_SLASH:(v(L)||$(d,"Invalid character in tag name"),d.state=c.ATTRIB));continue;case c.OPEN_TAG_SLASH:L===">"?(Q(d,!0),et(d)):($(d,"Forward-slash in opening tag not followed by >"),d.state=c.ATTRIB);continue;case c.ATTRIB:if(v(L))continue;L===">"?Q(d):L==="/"?d.state=c.OPEN_TAG_SLASH:U(b,L)?(d.attribName=L,d.attribValue="",d.state=c.ATTRIB_NAME):$(d,"Invalid attribute name");continue;case c.ATTRIB_NAME:L==="="?d.state=c.ATTRIB_VALUE:L===">"?($(d,"Attribute without value"),d.attribValue=d.attribName,mt(d),Q(d)):v(L)?d.state=c.ATTRIB_NAME_SAW_WHITE:U(D,L)?d.attribName+=L:$(d,"Invalid attribute name");continue;case c.ATTRIB_NAME_SAW_WHITE:if(L==="=")d.state=c.ATTRIB_VALUE;else{if(v(L))continue;$(d,"Attribute without value"),d.tag.attributes[d.attribName]="",d.attribValue="",X(d,"onattribute",{name:d.attribName,value:""}),d.attribName="",L===">"?Q(d):U(b,L)?(d.attribName=L,d.state=c.ATTRIB_NAME):($(d,"Invalid attribute name"),d.state=c.ATTRIB)}continue;case c.ATTRIB_VALUE:if(v(L))continue;A(L)?(d.q=L,d.state=c.ATTRIB_VALUE_QUOTED):(d.opt.unquotedAttributeValues||J(d,"Unquoted attribute value"),d.state=c.ATTRIB_VALUE_UNQUOTED,d.attribValue=L);continue;case c.ATTRIB_VALUE_QUOTED:if(L!==d.q){L==="&"?d.state=c.ATTRIB_VALUE_ENTITY_Q:d.attribValue+=L;continue}mt(d),d.q="",d.state=c.ATTRIB_VALUE_CLOSED;continue;case c.ATTRIB_VALUE_CLOSED:v(L)?d.state=c.ATTRIB:L===">"?Q(d):L==="/"?d.state=c.OPEN_TAG_SLASH:U(b,L)?($(d,"No whitespace between attributes"),d.attribName=L,d.attribValue="",d.state=c.ATTRIB_NAME):$(d,"Invalid attribute name");continue;case c.ATTRIB_VALUE_UNQUOTED:if(!j(L)){L==="&"?d.state=c.ATTRIB_VALUE_ENTITY_U:d.attribValue+=L;continue}mt(d),L===">"?Q(d):d.state=c.ATTRIB;continue;case c.CLOSE_TAG:if(d.tagName)L===">"?et(d):U(D,L)?d.tagName+=L:d.script?(d.script+="</"+d.tagName,d.tagName="",d.state=c.SCRIPT):(v(L)||$(d,"Invalid tagname in closing tag"),d.state=c.CLOSE_TAG_SAW_WHITE);else{if(v(L))continue;B(b,L)?d.script?(d.script+="</"+L,d.state=c.SCRIPT):$(d,"Invalid tagname in closing tag."):d.tagName=L}continue;case c.CLOSE_TAG_SAW_WHITE:if(v(L))continue;L===">"?et(d):$(d,"Invalid characters in closing tag");continue;case c.TEXT_ENTITY:case c.ATTRIB_VALUE_ENTITY_Q:case c.ATTRIB_VALUE_ENTITY_U:var G,it;switch(d.state){case c.TEXT_ENTITY:G=c.TEXT,it="textNode";break;case c.ATTRIB_VALUE_ENTITY_Q:G=c.ATTRIB_VALUE_QUOTED,it="attribValue";break;case c.ATTRIB_VALUE_ENTITY_U:G=c.ATTRIB_VALUE_UNQUOTED,it="attribValue";break}if(L===";"){var O=bt(d);d.opt.unparsedEntities&&!Object.values(o.XML_ENTITIES).includes(O)?(d.entity="",d.state=G,d.write(O)):(d[it]+=O,d.entity="",d.state=G)}else U(d.entity.length?h:T,L)?d.entity+=L:($(d,"Invalid character in entity name"),d[it]+="&"+d.entity+L,d.entity="",d.state=G);continue;default:throw new Error(d,"Unknown state: "+d.state)}return d.position>=d.bufferCheckPosition&&p(d),d}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var y=String.fromCharCode,d=Math.floor,S=function(){var L=16384,K=[],tt,G,it=-1,O=arguments.length;if(!O)return"";for(var s="";++it<O;){var t=Number(arguments[it]);if(!isFinite(t)||t<0||t>1114111||d(t)!==t)throw RangeError("Invalid code point: "+t);t<=65535?K.push(t):(t-=65536,tt=(t>>10)+55296,G=t%1024+56320,K.push(tt,G)),(it+1===O||K.length>L)&&(s+=y.apply(null,K),K.length=0)}return s};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:S,configurable:!0,writable:!0}):String.fromCodePoint=S}()})(l)}(ge)),ge}var Ee={},jr;function ai(){return jr||(jr=1,function(){Ee.stripBOM=function(l){return l[0]==="\uFEFF"?l.substring(1):l}}.call(H)),Ee}var wt={},Ur;function nn(){return Ur||(Ur=1,function(){var l;l=new RegExp(/(?!xmlns)^.*:/),wt.normalize=function(o){return o.toLowerCase()},wt.firstCharLowerCase=function(o){return o.charAt(0).toLowerCase()+o.slice(1)},wt.stripPrefix=function(o){return o.replace(l,"")},wt.parseNumbers=function(o){return isNaN(o)||(o=o%1===0?parseInt(o,10):parseFloat(o)),o},wt.parseBooleans=function(o){return/^(?:true|false)$/i.test(o)&&(o=o.toLowerCase()==="true"),o}}.call(H)),wt}var Xr;function ui(){return Xr||(Xr=1,function(l){(function(){var o,f,u,p,i,r,n,m,N,w=function(E,C){return function(){return E.apply(C,arguments)}},g=function(E,C){for(var M in C)x.call(C,M)&&(E[M]=C[M]);function b(){this.constructor=E}return b.prototype=C.prototype,E.prototype=new b,E.__super__=C.prototype,E},x={}.hasOwnProperty;m=si(),p=Ne,o=ai(),n=nn(),N=vn.setImmediate,f=Oe().defaults,i=function(E){return typeof E=="object"&&E!=null&&Object.keys(E).length===0},r=function(E,C,M){var b,D,T;for(b=0,D=E.length;b<D;b++)T=E[b],C=T(C,M);return C},u=function(E,C,M){var b;return b=Object.create(null),b.value=M,b.writable=!0,b.enumerable=!0,b.configurable=!0,Object.defineProperty(E,C,b)},l.Parser=function(E){g(C,E);function C(M){this.parseStringPromise=w(this.parseStringPromise,this),this.parseString=w(this.parseString,this),this.reset=w(this.reset,this),this.assignOrPush=w(this.assignOrPush,this),this.processAsync=w(this.processAsync,this);var b,D,T;if(!(this instanceof l.Parser))return new l.Parser(M);this.options={},D=f["0.2"];for(b in D)x.call(D,b)&&(T=D[b],this.options[b]=T);for(b in M)x.call(M,b)&&(T=M[b],this.options[b]=T);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(n.normalize)),this.reset()}return C.prototype.processAsync=function(){var M,b;try{return this.remaining.length<=this.options.chunkSize?(M=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(M),this.saxParser.close()):(M=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(M),N(this.processAsync))}catch(D){if(b=D,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(b)}},C.prototype.assignOrPush=function(M,b,D){return b in M?(M[b]instanceof Array||u(M,b,[M[b]]),M[b].push(D)):this.options.explicitArray?u(M,b,[D]):u(M,b,D)},C.prototype.reset=function(){var M,b,D,T;return this.removeAllListeners(),this.saxParser=m.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(h){return function(v){if(h.saxParser.resume(),!h.saxParser.errThrown)return h.saxParser.errThrown=!0,h.emit("error",v)}}(this),this.saxParser.onend=function(h){return function(){if(!h.saxParser.ended)return h.saxParser.ended=!0,h.emit("end",h.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,T=[],M=this.options.attrkey,b=this.options.charkey,this.saxParser.onopentag=function(h){return function(v){var A,j,U,B,c;if(U={},U[b]="",!h.options.ignoreAttrs){c=v.attributes;for(A in c)x.call(c,A)&&(!(M in U)&&!h.options.mergeAttrs&&(U[M]={}),j=h.options.attrValueProcessors?r(h.options.attrValueProcessors,v.attributes[A],A):v.attributes[A],B=h.options.attrNameProcessors?r(h.options.attrNameProcessors,A):A,h.options.mergeAttrs?h.assignOrPush(U,B,j):u(U[M],B,j))}return U["#name"]=h.options.tagNameProcessors?r(h.options.tagNameProcessors,v.name):v.name,h.options.xmlns&&(U[h.options.xmlnskey]={uri:v.uri,local:v.local}),T.push(U)}}(this),this.saxParser.onclosetag=function(h){return function(){var v,A,j,U,B,c,F,R,X,W;if(c=T.pop(),B=c["#name"],(!h.options.explicitChildren||!h.options.preserveChildrenOrder)&&delete c["#name"],c.cdata===!0&&(v=c.cdata,delete c.cdata),X=T[T.length-1],c[b].match(/^\s*$/)&&!v?(A=c[b],delete c[b]):(h.options.trim&&(c[b]=c[b].trim()),h.options.normalize&&(c[b]=c[b].replace(/\s{2,}/g," ").trim()),c[b]=h.options.valueProcessors?r(h.options.valueProcessors,c[b],B):c[b],Object.keys(c).length===1&&b in c&&!h.EXPLICIT_CHARKEY&&(c=c[b])),i(c)&&(typeof h.options.emptyTag=="function"?c=h.options.emptyTag():c=h.options.emptyTag!==""?h.options.emptyTag:A),h.options.validator!=null&&(W="/"+function(){var Y,J,z;for(z=[],Y=0,J=T.length;Y<J;Y++)U=T[Y],z.push(U["#name"]);return z}().concat(B).join("/"),function(){var Y;try{return c=h.options.validator(W,X&&X[B],c)}catch(J){return Y=J,h.emit("error",Y)}}()),h.options.explicitChildren&&!h.options.mergeAttrs&&typeof c=="object"){if(!h.options.preserveChildrenOrder)U={},h.options.attrkey in c&&(U[h.options.attrkey]=c[h.options.attrkey],delete c[h.options.attrkey]),!h.options.charsAsChildren&&h.options.charkey in c&&(U[h.options.charkey]=c[h.options.charkey],delete c[h.options.charkey]),Object.getOwnPropertyNames(c).length>0&&(U[h.options.childkey]=c),c=U;else if(X){X[h.options.childkey]=X[h.options.childkey]||[],F={};for(j in c)x.call(c,j)&&u(F,j,c[j]);X[h.options.childkey].push(F),delete c["#name"],Object.keys(c).length===1&&b in c&&!h.EXPLICIT_CHARKEY&&(c=c[b])}}return T.length>0?h.assignOrPush(X,B,c):(h.options.explicitRoot&&(R=c,c={},u(c,B,R)),h.resultObject=c,h.saxParser.ended=!0,h.emit("end",h.resultObject))}}(this),D=function(h){return function(v){var A,j;if(j=T[T.length-1],j)return j[b]+=v,h.options.explicitChildren&&h.options.preserveChildrenOrder&&h.options.charsAsChildren&&(h.options.includeWhiteChars||v.replace(/\\n/g,"").trim()!=="")&&(j[h.options.childkey]=j[h.options.childkey]||[],A={"#name":"__text__"},A[b]=v,h.options.normalize&&(A[b]=A[b].replace(/\s{2,}/g," ").trim()),j[h.options.childkey].push(A)),j}}(this),this.saxParser.ontext=D,this.saxParser.oncdata=function(h){return function(v){var A;if(A=D(v),A)return A.cdata=!0}}()},C.prototype.parseString=function(M,b){var D;b!=null&&typeof b=="function"&&(this.on("end",function(T){return this.reset(),b(null,T)}),this.on("error",function(T){return this.reset(),b(T)}));try{return M=M.toString(),M.trim()===""?(this.emit("end",null),!0):(M=o.stripBOM(M),this.options.async?(this.remaining=M,N(this.processAsync),this.saxParser):this.saxParser.write(M).close())}catch(T){if(D=T,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw D}else return this.emit("error",D),this.saxParser.errThrown=!0}},C.prototype.parseStringPromise=function(M){return new Promise(function(b){return function(D,T){return b.parseString(M,function(h,v){return h?T(h):D(v)})}}(this))},C}(p),l.parseString=function(E,C,M){var b,D,T;return M!=null?(typeof M=="function"&&(b=M),typeof C=="object"&&(D=C)):(typeof C=="function"&&(b=C),D={}),T=new l.Parser(D),T.parseString(E,b)},l.parseStringPromise=function(E,C){var M,b;return typeof C=="object"&&(M=C),b=new l.Parser(M),b.parseStringPromise(E)}}).call(H)}(ye)),ye}var on;(function(){var l,o,f,u=function(i,r){for(var n in r)p.call(r,n)&&(i[n]=r[n]);function m(){this.constructor=i}return m.prototype=r.prototype,i.prototype=new m,i.__super__=r.prototype,i},p={}.hasOwnProperty;o=Oe(),l=ti(),f=ui(),nn(),o.defaults,function(i){u(r,i);function r(n){this.message=n}return r}(Error),l.Builder,f.Parser,f.parseString,on=f.parseStringPromise}).call(H);class ci{constructor(o,f,u){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=o,this.cdp=f,this.readPHPFile=u.getPHPFile,this.remoteRoot=u.remoteRoot||"",this.localRoot=u.localRoot||"";for(const p of u.knownScriptUrls)this.scriptIdByUrl.set(p,this.getOrCreateScriptId(p))}start(){this.dbgp.on("connected",()=>{this.xdebugConnected=!0,this.sendDbgpCommand("stdout","-c 1"),this.sendDbgpCommand("stderr","-c 1")}),this.dbgp.on("message",async o=>{try{const f=await on(o,{explicitArray:!1});await this.handleDbgpMessage(f)}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 o=this.sendDbgpCommand("stack_get");this.pendingCommands.set(o,{})}}),this.cdp.on("message",o=>{this.handleCdpMessage(o)}),this.cdp.on("clientDisconnected",()=>{this.xdebugConnected&&this.sendDbgpCommand("detach")})}sendInitialScripts(){if(this.initFileUri&&!this.scriptIdByUrl.has(this.initFileUri)){const o=this.getOrCreateScriptId(this.initFileUri);this.cdp.sendMessage({method:"Debugger.scriptParsed",params:{scriptId:o,url:this.initFileUri,startLine:0,startColumn:0,executionContextId:1}})}for(const[o,f]of this.scriptIdByUrl.entries())this.cdp.sendMessage({method:"Debugger.scriptParsed",params:{scriptId:f,url:o,startLine:0,startColumn:0,executionContextId:1}})}getOrCreateScriptId(o){let f=this.scriptIdByUrl.get(o);return f||(f=String(this.nextScriptId++),this.scriptIdByUrl.set(o,f)),f}formatPropertyFullName(o){let f=!1,u="";for(const p of o)p==='"'||p==="\\"||p==="\0"?(u+="\\"+p,f=!0):p===" "?(u+=p,f=!0):u+=p;return(f||o.includes("'"))&&(u=`"${u}"`),u}sendDbgpCommand(o,f){console.log("\x1B[1;32m[XDebug][send]\x1B[0m",o,f);const p=(this.nextTxnId++).toString();let i=`${o} -i ${p}`;return f!==void 0&&(i+=` ${f}`),this.dbgp.sendCommand(i),p}handleCdpMessage(o){const{id:f,method:u,params:p}=o;let i={},r=!0;switch(u){case"Debugger.enable":case"Runtime.enable":i={};break;case"Debugger.setBreakpointByUrl":{const{url:n,lineNumber:m}=p,N=n,w=(typeof m=="number"?m:0)+1,g=String(this.breakpoints.size+1);if(this.xdebugConnected){const x=`breakpoint_set -t line -f ${this.formatPropertyFullName(N)} -n ${w}`,E=this.sendDbgpCommand(x);this.pendingCommands.set(E,{cdpId:f,cdpMethod:u,params:{breakpointId:g,fileUri:N,line:w}}),r=!1}else this.breakpoints.set(g,{cdpId:g,xdebugId:null,file:N,line:w}),i={breakpointId:g,locations:[{scriptId:this.getOrCreateScriptId(N),lineNumber:w-1,columnNumber:0}]};break}case"Debugger.removeBreakpoint":{const{breakpointId:n}=p,m=String(n),N=this.breakpoints.get(m);if(N){if(N.xdebugId&&this.xdebugConnected){const w=`breakpoint_remove -d ${N.xdebugId}`,g=this.sendDbgpCommand(w);this.pendingCommands.set(g,{cdpId:f,cdpMethod:u}),r=!1}this.breakpoints.delete(m)}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 n=p.expression||"",m=p.callFrameId;if(u==="Debugger.evaluateOnCallFrame"){if(m===void 0||!this.callFramesMap.has(m)){this.cdp.sendMessage({id:f,error:{code:-32e3,message:"No such call frame"}});return}if(this.callFramesMap.get(m)!==0){this.cdp.sendMessage({id:f,error:{code:-32e3,message:"Evaluation in this frame not supported"}});return}}if(this.xdebugConnected){const N=Buffer.from(n).toString("base64"),w=this.sendDbgpCommand("eval",`-- ${N}`);this.pendingCommands.set(w,{cdpId:f,cdpMethod:u}),r=!1}else i={result:{type:"undefined",value:void 0}};break}case"Runtime.getProperties":{const{objectId:n}=p,m=this.objectHandles.get(n);if(m&&this.xdebugConnected)if(m.type==="context"){const N=m.contextId??0,g=`context_get -d ${m.depth} -c ${N}`,x=this.sendDbgpCommand(g);this.pendingCommands.set(x,{cdpId:f,cdpMethod:u}),r=!1}else if(m.type==="property"){const N=m.depth,w=m.fullname,g=this.formatPropertyFullName(w),x=`property_get -d ${N} -n ${g}`,E=this.sendDbgpCommand(x);this.pendingCommands.set(E,{cdpId:f,cdpMethod:u,params:{parentObjectId:n}}),r=!1}else i={result:[]};else i={result:[]};break}case"Debugger.getScriptSource":{const n=p.scriptId,m=[...this.scriptIdByUrl.entries()].find(([,w])=>w===n)?.[0];let N="";m&&(N=this.readPHPFile(this.uriToRemotePath(m))),i={scriptSource:N};break}default:i={};break}r&&this.cdp.sendMessage({id:f,result:i})}uriToRemotePath(o){return o.startsWith("file://")?o.slice(7):o}remoteToLocal(o){let f=o;return this.remoteRoot&&f.startsWith(this.remoteRoot)&&(f=xe.join(this.localRoot||"",f.slice(this.remoteRoot.length))),process.platform==="win32"&&f.startsWith("/")&&(f=f.slice(1)),f}async handleDbgpMessage(o){if(o.init){const f=o.init.$;this.initFileUri=f.fileuri||f.fileuri,this.xdebugStatus="starting";const u=this.sendDbgpCommand("step_into");this.pendingCommands.set(u,{}),this.cdp.ws&&this.sendInitialScripts();return}if(o.response){const f=o.response,u=f.$,p=u.command,i=u.transaction_id,r=this.pendingCommands.get(i);switch(p){case"breakpoint_set":{if(r&&r.cdpId!==void 0&&r.cdpMethod==="Debugger.setBreakpointByUrl"){const n=u.id,m=r.params;if(m){const{breakpointId:N,fileUri:w,line:g}=m;this.breakpoints.set(N,{cdpId:N,xdebugId:n,file:w,line:g});const x=this.getOrCreateScriptId(w),E={breakpointId:N,locations:[{scriptId:x,lineNumber:g-1,columnNumber:0}]};this.cdp.sendMessage({id:r.cdpId,result:E})}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 n=u.status;if(this.xdebugStatus=n,f["xdebug:message"]){const m=f["xdebug:message"].$.filename;if(m&&!this.scriptIdByUrl.has(m)){const N=this.getOrCreateScriptId(m);this.cdp.sendMessage({method:"Debugger.scriptParsed",params:{scriptId:N,url:m,startLine:0,startColumn:0,executionContextId:1}})}}if(n==="break"){const m=this.sendDbgpCommand("stack_get");this.pendingCommands.set(m,{}),this.pendingCommands.delete(i)}else(n==="stopping"||n==="stopped")&&this.cdp.sendMessage({method:"Debugger.resumed",params:{}});break}case"eval":{if(r&&r.cdpId!==void 0){let n;if(f.property){const N=f.property,w=N.$.type,g=N.$.encoding;let x=null;if(Object.prototype.hasOwnProperty.call(N,"_")?x=N._:typeof N.$value<"u"&&(x=N.$value),g==="base64"&&x!==null)try{x=Buffer.from(x,"base64").toString()}catch{}if(w==="string")n={type:"string",value:x??""};else if(w==="int"||w==="float"||w==="bool"||w==="boolen"||w==="integer"||w==="double"){let E=x;w.startsWith("int")||w==="integer"?E=parseInt(x||"0",10):w==="float"||w==="double"?E=parseFloat(x||"0"):w.startsWith("bool")&&(E=x==="1"||x==="true"),n={type:"number",value:E}}else if(w==="array"||w==="object"){const E=N.$.classname||(w==="array"?"Array":"Object"),C=String(this.nextObjectId++),M=N.$.fullname||"";this.objectHandles.set(C,{type:"property",depth:0,contextId:0,fullname:M}),n={type:"object",objectId:C,className:E,description:E}}else w==="null"?n={type:"object",subtype:"null",value:null}:n={type:"undefined",value:void 0}}else n={type:"undefined",value:void 0};const m={result:n};this.cdp.sendMessage({id:r.cdpId,result:m}),this.pendingCommands.delete(i)}break}case"context_get":case"property_get":{if(r&&r.cdpId!==void 0){const n=[],m=f.property;if(m){const w=Array.isArray(m)?m:[m];for(const g of w){const x=g.$.name||g.$.fullname||"";let E=g.$.type||"undefined";const C=g.$.children==="1",M=g.$.encoding;let b=null;if(typeof g._<"u"&&(b=g._),M==="base64"&&b!==null)try{b=Buffer.from(b,"base64").toString()}catch{}if(C){const D=g.$.classname||(E==="array"?"Array":"Object"),T=String(this.nextObjectId++),h=r.cdpMethod==="Runtime.getProperties"&&r.params?.parentObjectId&&this.objectHandles.get(r.params.parentObjectId)?.contextId||0,v=r.cdpMethod==="Runtime.getProperties"&&r.params?.parentObjectId&&this.objectHandles.get(r.params.parentObjectId)?.depth||0;this.objectHandles.set(T,{type:"property",depth:v,contextId:h,fullname:g.$.fullname||x}),n.push({name:g.$.key||x,value:{type:"object",className:D,description:D,objectId:T},writable:!1,configurable:!1,enumerable:!0})}else{let D,T;E==="string"?D=b??"":E==="int"||E==="integer"?D=parseInt(b||"0",10):E==="float"||E==="double"?D=parseFloat(b||"0"):E==="bool"||E==="boolean"?(D=b==="1"||b==="true",E="boolean"):E==="null"?(D=null,T="null"):D=b;const h={type:E==="integer"?"number":E};T&&(h.subtype=T),h.value=D,n.push({name:g.$.key||x,value:h,writable:!1,configurable:!1,enumerable:!0})}}}const N={result:n};this.cdp.sendMessage({id:r.cdpId,result:N}),this.pendingCommands.delete(i)}break}case"stack_get":{if(f.stack){const n=Array.isArray(f.stack)?f.stack:[f.stack],m=[];this.callFramesMap.clear();for(const w of n){const g=w.$.filename,x=this.getOrCreateScriptId(g);this.scriptIdByUrl.has(g)||(this.scriptIdByUrl.set(g,x),this.cdp.sendMessage({method:"Debugger.scriptParsed",params:{scriptId:x,url:g,startLine:0,startColumn:0,executionContextId:1}}))}for(const w of n){const g=parseInt(w.$.level,10),x=w.$.filename,E=parseInt(w.$.lineno,10),C=w.$.where&&w.$.where!=="{main}"?w.$.where:"(anonymous)",M=this.getOrCreateScriptId(x),b=`frame:${g}`;this.callFramesMap.set(b,g);const D=[],T=String(this.nextObjectId++);this.objectHandles.set(T,{type:"context",contextId:0,depth:g}),D.push({type:"local",object:{objectId:T,className:"Object",description:"Local"}});const h=String(this.nextObjectId++);this.objectHandles.set(h,{type:"context",contextId:1,depth:g}),D.push({type:"global",object:{objectId:h,className:"Object",description:"Global"}}),m.push({callFrameId:b,functionName:C,location:{scriptId:M,lineNumber:E-1,columnNumber:0},scopeChain:D,this:{type:"object",className:"Object",description:"Object",objectId:h}})}let N="pause";if(n.length>0){const w=n[0];if(w.$.filename&&w.$.lineno){const g=w.$.filename,x=parseInt(w.$.lineno,10);for(const E of this.breakpoints.values())if(E.file===g&&E.line===x){N="breakpoint";break}}}this.cdp.sendMessage({method:"Debugger.paused",params:{reason:N,callFrames:m,hitBreakpoints:N==="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(o.stream){const f=o.stream,u=f.$.type,p=f.$.encoding||"none";let i=typeof f._=="string"?f._:"";p==="base64"&&(i=Buffer.from(i,"base64").toString()),this.cdp.sendMessage({method:"Log.entryAdded",params:{entry:{source:"other",level:u==="stderr"?"error":"info",text:i,timestamp:Date.now(),stackTrace:{callFrames:[]}}}})}else o.notify}}async function li(l){const o=l.cdpPort??9229,f=l.dbgpPort??9003,u=l.cdpHost??"localhost",p=l.phpRoot??import.meta.dirname,i=new Mn(o);console.log("Connect Chrome DevTools to CDP at:"),console.log(`devtools://devtools/bundled/inspector.html?ws=${u}:${o}`),await new Promise(w=>i.on("clientConnected",w)),await new Promise(w=>setTimeout(w,2e3)),console.log("Chrome connected! Initializing Xdebug receiver...");const r=new Pn(f);console.log(`XDebug receiver running on port ${f}`),console.log("Running a PHP script with Xdebug enabled...");function n(w){const g=[],x=cn(w);for(const E of x){const C=Dn(w,E),M=ln(C);M&&M.isDirectory()?g.push(...n(C)):E.endsWith(".php")&&g.push(`file://${C}`)}return g}const m=l.phpInstance?w=>l.phpInstance.readFileAsText(w):l.getPHPFile?l.getPHPFile:w=>{const g=w.startsWith("file://")?w.replace("file://",""):w;return De(g,"utf-8")},N=n(p);return new ci(r,i,{knownScriptUrls:N,remoteRoot:l.remoteRoot,localRoot:l.localRoot,getPHPFile:m})}let at=process.argv.slice(2);at.length||(at=["--help"]);const sn=(import.meta||{}).url,Te=new URL("ca-bundle.crt",sn).pathname;fn(Te)||qr(Te,pn.join(`
40
+ `));at.unshift("-d",`openssl.cafile=${Te}`);async function fi(){const l=new URL("php.ini",sn).pathname,o=process.env.PHP||dn;if(!mn.includes(o))throw new Error(`Unsupported PHP version ${o}`);const f=at.some(g=>g.startsWith("--xdebug"));f&&(at=at.filter(g=>g!=="--xdebug"));const u=at.some(g=>g.startsWith("--experimental-devtools"));u&&(at=at.filter(g=>g!=="--experimental-devtools"));const{TMPDIR:p,...i}=process.env,r=$e(xe.join(We.tmpdir(),"php-wasm-bin"));qr(`${r}/php`,`#!/bin/sh
3
41
  ${process.argv[0]} ${process.execArgv.join(" ")} ${process.argv[1]}
4
- `),P(`${i}/php`,493);const l=m(h.join(c.tmpdir(),"php-wasm-sys-tmp")),a=new x(await y(s,{emscriptenOptions:{fileLockManager:new S,processId:1,ENV:{...p,TMPDIR:l,TERM:"xterm",PATH:`${i}:${p.PATH}`}},withXdebug:n}));T(a),e.some(t=>t.startsWith("-c"))||e.unshift("-c",f);const o=await a.cli(["php",...e]);o.stderr.pipeTo(new WritableStream({write(t){process.stderr.write(t)}})),o.stdout.pipeTo(new WritableStream({write(t){process.stdout.write(t)}})),await o.exitCode.catch(t=>{throw t.name==="ExitStatus"&&process.exit(t.status===void 0?1:t.status),t}).finally(()=>{setTimeout(()=>{process.exit(0)},100)})}$();
42
+ `),hn(`${r}/php`,493);const n=$e(xe.join(We.tmpdir(),"php-wasm-sys-tmp")),m=new yn(await gn(o,{emscriptenOptions:{fileLockManager:new wn,processId:1,ENV:{...i,TMPDIR:n,TERM:"xterm",PATH:`${r}:${i.PATH}`}},withXdebug:f}));bn(m),u&&f&&(await li({})).start(),at.some(g=>g.startsWith("-c"))||at.unshift("-c",l);const w=await m.cli(["php",...at]);w.stderr.pipeTo(new WritableStream({write(g){process.stderr.write(g)}})),w.stdout.pipeTo(new WritableStream({write(g){process.stdout.write(g)}})),await w.exitCode.catch(g=>{throw g.name==="ExitStatus"&&process.exit(g.status===void 0?1:g.status),g}).finally(()=>{setTimeout(()=>{process.exit(0)},100)})}fi();
5
43
  //# sourceMappingURL=main.js.map