@tachybase/plugin-auth-saml 0.23.8

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 (67) hide show
  1. package/.turbo/turbo-build.log +14 -0
  2. package/README.md +11 -0
  3. package/README.zh-CN.md +55 -0
  4. package/client.d.ts +2 -0
  5. package/client.js +1 -0
  6. package/dist/client/Options.d.ts +2 -0
  7. package/dist/client/SAMLButton.d.ts +5 -0
  8. package/dist/client/index.d.ts +5 -0
  9. package/dist/client/index.js +3 -0
  10. package/dist/client/locale/index.d.ts +3 -0
  11. package/dist/client/schemas/saml.d.ts +35 -0
  12. package/dist/constants.d.ts +2 -0
  13. package/dist/constants.js +31 -0
  14. package/dist/externalVersion.js +14 -0
  15. package/dist/index.d.ts +2 -0
  16. package/dist/index.js +39 -0
  17. package/dist/locale/en-US.json +26 -0
  18. package/dist/locale/es-ES.json +22 -0
  19. package/dist/locale/fr-FR.json +22 -0
  20. package/dist/locale/ko_KR.json +29 -0
  21. package/dist/locale/pt-BR.json +22 -0
  22. package/dist/locale/zh-CN.json +29 -0
  23. package/dist/node_modules/@node-saml/node-saml/LICENSE +23 -0
  24. package/dist/node_modules/@node-saml/node-saml/lib/algorithms.d.ts +5 -0
  25. package/dist/node_modules/@node-saml/node-saml/lib/algorithms.js +41 -0
  26. package/dist/node_modules/@node-saml/node-saml/lib/crypto.d.ts +5 -0
  27. package/dist/node_modules/@node-saml/node-saml/lib/crypto.js +48 -0
  28. package/dist/node_modules/@node-saml/node-saml/lib/datetime.d.ts +13 -0
  29. package/dist/node_modules/@node-saml/node-saml/lib/datetime.js +27 -0
  30. package/dist/node_modules/@node-saml/node-saml/lib/index.d.ts +3 -0
  31. package/dist/node_modules/@node-saml/node-saml/lib/index.js +9 -0
  32. package/dist/node_modules/@node-saml/node-saml/lib/inmemory-cache-provider.d.ts +38 -0
  33. package/dist/node_modules/@node-saml/node-saml/lib/inmemory-cache-provider.js +100 -0
  34. package/dist/node_modules/@node-saml/node-saml/lib/metadata.d.ts +2 -0
  35. package/dist/node_modules/@node-saml/node-saml/lib/metadata.js +112 -0
  36. package/dist/node_modules/@node-saml/node-saml/lib/passport-saml-types.d.ts +8 -0
  37. package/dist/node_modules/@node-saml/node-saml/lib/passport-saml-types.js +3 -0
  38. package/dist/node_modules/@node-saml/node-saml/lib/saml-post-signing.d.ts +3 -0
  39. package/dist/node_modules/@node-saml/node-saml/lib/saml-post-signing.js +15 -0
  40. package/dist/node_modules/@node-saml/node-saml/lib/saml.d.ts +75 -0
  41. package/dist/node_modules/@node-saml/node-saml/lib/saml.js +1005 -0
  42. package/dist/node_modules/@node-saml/node-saml/lib/types.d.ts +219 -0
  43. package/dist/node_modules/@node-saml/node-saml/lib/types.js +21 -0
  44. package/dist/node_modules/@node-saml/node-saml/lib/utility.d.ts +5 -0
  45. package/dist/node_modules/@node-saml/node-saml/lib/utility.js +27 -0
  46. package/dist/node_modules/@node-saml/node-saml/lib/xml.d.ts +26 -0
  47. package/dist/node_modules/@node-saml/node-saml/lib/xml.js +234 -0
  48. package/dist/node_modules/@node-saml/node-saml/package.json +1 -0
  49. package/dist/server/actions/getAuthUrl.d.ts +2 -0
  50. package/dist/server/actions/getAuthUrl.js +35 -0
  51. package/dist/server/actions/metadata.d.ts +2 -0
  52. package/dist/server/actions/metadata.js +36 -0
  53. package/dist/server/actions/redirect.d.ts +2 -0
  54. package/dist/server/actions/redirect.js +49 -0
  55. package/dist/server/index.d.ts +1 -0
  56. package/dist/server/index.js +33 -0
  57. package/dist/server/migrations/20231008112900-update-autosignup.d.ts +6 -0
  58. package/dist/server/migrations/20231008112900-update-autosignup.js +52 -0
  59. package/dist/server/plugin.d.ts +11 -0
  60. package/dist/server/plugin.js +70 -0
  61. package/dist/server/saml-auth.d.ts +8 -0
  62. package/dist/server/saml-auth.js +110 -0
  63. package/dist/swagger/index.d.ts +137 -0
  64. package/dist/swagger/index.js +163 -0
  65. package/package.json +35 -0
  66. package/server.d.ts +2 -0
  67. package/server.js +1 -0
@@ -0,0 +1,9 @@
1
+ (function(){var e={7775:function(e,r,n){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.getSigner=r.getDigestAlgorithm=r.getSigningAlgorithm=void 0;const i=n(6982);function getSigningAlgorithm(e){switch(e){case"sha256":return"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256";case"sha512":return"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";case"sha1":default:return"http://www.w3.org/2000/09/xmldsig#rsa-sha1"}}r.getSigningAlgorithm=getSigningAlgorithm;function getDigestAlgorithm(e){switch(e){case"sha256":return"http://www.w3.org/2001/04/xmlenc#sha256";case"sha512":return"http://www.w3.org/2001/04/xmlenc#sha512";case"sha1":default:return"http://www.w3.org/2000/09/xmldsig#sha1"}}r.getDigestAlgorithm=getDigestAlgorithm;function getSigner(e){switch(e){case"sha256":return i.createSign("RSA-SHA256");case"sha512":return i.createSign("RSA-SHA512");case"sha1":default:return i.createSign("RSA-SHA1")}}r.getSigner=getSigner},5232:function(e,r,n){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.removeCertPEMHeaderAndFooter=r.generateUniqueId=r.certToPEM=r.keyToPEM=void 0;const i=n(6982);const o=n(8581);const keyToPEM=e=>{(0,o.assertRequired)(e,"key is required");if(typeof e!=="string")return e;if(e.split(/\r?\n/).length!==1)return e;const r=e.match(/.{1,64}/g);if(r){const e=["-----BEGIN PRIVATE KEY-----",...r,"-----END PRIVATE KEY-----",""].join("\n");return e}throw new Error("Invalid key")};r.keyToPEM=keyToPEM;const certToPEM=e=>{const r=e.match(/.{1,64}/g);(0,o.assertRequired)(r,"cert is invalid");let n=r.join("\n");if(n.indexOf("-BEGIN CERTIFICATE-")===-1)n="-----BEGIN CERTIFICATE-----\n"+n;if(n.indexOf("-END CERTIFICATE-")===-1)n=n+"\n-----END CERTIFICATE-----\n";return n};r.certToPEM=certToPEM;const generateUniqueId=()=>"_"+i.randomBytes(20).toString("hex");r.generateUniqueId=generateUniqueId;const removeCertPEMHeaderAndFooter=e=>{e=e.replace(/-----BEGIN CERTIFICATE-----\r?\n?/,"");e=e.replace(/-----END CERTIFICATE-----\r?\n?/,"");e=e.replace(/\r\n/g,"\n");return e};r.removeCertPEMHeaderAndFooter=removeCertPEMHeaderAndFooter},2064:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.dateStringToTimestamp=r.generateInstant=void 0;const generateInstant=()=>(new Date).toISOString();r.generateInstant=generateInstant;const dateStringToTimestamp=(e,r)=>{const n=Date.parse(e);if(isNaN(n)){throw new Error(`Error parsing ${r}: '${e}' is not a valid date`)}return n};r.dateStringToTimestamp=dateStringToTimestamp},3982:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.InMemoryCacheProvider=void 0;class InMemoryCacheProvider{constructor(e){var r;this.lastPrune=0;this.cacheKeys={};this.options={...e,keyExpirationPeriodMs:(r=e.keyExpirationPeriodMs)!==null&&r!==void 0?r:288e5};this.prune=()=>{const e=(new Date).getTime();if(e>this.lastPrune+this.options.keyExpirationPeriodMs){const r=Object.keys(this.cacheKeys);const n=[];r.forEach((r=>{if(e>=this.cacheKeys[r].createdAt+this.options.keyExpirationPeriodMs){n.push(r)}}));n.forEach((e=>this.removeAsync(e)));this.lastPrune=e}};this.removeKeyIfExpired=async(e,r)=>{if(this.cacheKeys[e]&&r>=this.cacheKeys[e].createdAt+this.options.keyExpirationPeriodMs){await this.removeAsync(e)}}}async saveAsync(e,r){this.prune();const n=(new Date).getTime();await this.removeKeyIfExpired(e,n);if(!this.cacheKeys[e]){this.cacheKeys[e]={createdAt:n,value:r};return this.cacheKeys[e]}else{return null}}async getAsync(e){this.prune();const r=(new Date).getTime();await this.removeKeyIfExpired(e,r);if(this.cacheKeys[e]){return this.cacheKeys[e].value}else{return null}}async removeAsync(e){if(e!=null&&this.cacheKeys[e]){delete this.cacheKeys[e];return e}else{return null}}}r.InMemoryCacheProvider=InMemoryCacheProvider},1800:function(e,r,n){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.generateServiceProviderMetadata=void 0;const i=n(5232);const o=n(8748);const s=n(8581);const a=n(9392);const generateServiceProviderMetadata=e=>{const{issuer:r,callbackUrl:n,logoutCallbackUrl:u,identifierFormat:l,wantAssertionsSigned:c,decryptionPvk:p,privateKey:h,metadataContactPerson:f,metadataOrganization:d,generateUniqueId:m}=e;let{signingCerts:g,decryptionCert:y}=e;if(p!=null){if(!y){throw new Error("Missing decryptionCert while generating metadata for decrypting service provider")}}else{y=null}if(h!=null){if(!g){throw new Error("Missing signingCert while generating metadata for signing service provider messages")}g=!Array.isArray(g)?[g]:g}else{g=null}const w={EntityDescriptor:{"@xmlns":"urn:oasis:names:tc:SAML:2.0:metadata","@xmlns:ds":"http://www.w3.org/2000/09/xmldsig#","@entityID":r,"@ID":m(),SPSSODescriptor:{"@protocolSupportEnumeration":"urn:oasis:names:tc:SAML:2.0:protocol","@AuthnRequestsSigned":"false"},...f?{ContactPerson:f}:{},...d?{Organization:d}:{}}};if(y!=null||g!=null){w.EntityDescriptor.SPSSODescriptor.KeyDescriptor=[];if((0,o.isValidSamlSigningOptions)(e)){(0,s.assertRequired)(g,"Missing signingCert while generating metadata for signing service provider messages");w.EntityDescriptor.SPSSODescriptor["@AuthnRequestsSigned"]=true;const e=Array.isArray(g)?g:[g];const r=e.map((e=>({"@use":"signing","ds:KeyInfo":{"ds:X509Data":{"ds:X509Certificate":{"#text":(0,i.removeCertPEMHeaderAndFooter)(e)}}}})));w.EntityDescriptor.SPSSODescriptor.KeyDescriptor.push(r)}if(p!=null){(0,s.assertRequired)(y,"Missing decryptionCert while generating metadata for decrypting service provider");y=(0,i.removeCertPEMHeaderAndFooter)(y);w.EntityDescriptor.SPSSODescriptor.KeyDescriptor.push({"@use":"encryption","ds:KeyInfo":{"ds:X509Data":{"ds:X509Certificate":{"#text":y}}},EncryptionMethod:[{"@Algorithm":"http://www.w3.org/2009/xmlenc11#aes256-gcm"},{"@Algorithm":"http://www.w3.org/2009/xmlenc11#aes128-gcm"},{"@Algorithm":"http://www.w3.org/2001/04/xmlenc#aes256-cbc"},{"@Algorithm":"http://www.w3.org/2001/04/xmlenc#aes128-cbc"}]})}}if(u!=null){w.EntityDescriptor.SPSSODescriptor.SingleLogoutService={"@Binding":"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST","@Location":u}}if(l!=null){w.EntityDescriptor.SPSSODescriptor.NameIDFormat=l}if(c){w.EntityDescriptor.SPSSODescriptor["@WantAssertionsSigned"]=true}w.EntityDescriptor.SPSSODescriptor.AssertionConsumerService={"@index":"1","@isDefault":"true","@Binding":"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST","@Location":n};let v=(0,a.buildXmlBuilderObject)(w,true);if(e.signMetadata===true&&(0,o.isValidSamlSigningOptions)(e)){v=(0,s.signXmlMetadata)(v,{privateKey:e.privateKey,signatureAlgorithm:e.signatureAlgorithm,xmlSignatureTransforms:e.xmlSignatureTransforms,digestAlgorithm:e.digestAlgorithm})}return v};r.generateServiceProviderMetadata=generateServiceProviderMetadata},9165:function(e,r,n){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.signAuthnRequestPost=r.signSamlPost=void 0;const i=n(9392);const o='/*[local-name(.)="AuthnRequest" and namespace-uri(.)="urn:oasis:names:tc:SAML:2.0:protocol"]';const s='/*[local-name(.)="Issuer" and namespace-uri(.)="urn:oasis:names:tc:SAML:2.0:assertion"]';function signSamlPost(e,r,n){return(0,i.signXml)(e,r,{reference:r+s,action:"after"},n)}r.signSamlPost=signSamlPost;function signAuthnRequestPost(e,r){return signSamlPost(e,o,r)}r.signAuthnRequestPost=signAuthnRequestPost},5720:function(e,r,n){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.SAML=void 0;const i=n(8441);const o=(0,i.default)("node-saml");const s=n(3106);const a=n(6982);const u=n(7016);const l=n(3480);const c=n(9023);const p=n(3982);const h=n(7775);const f=n(8748);const d=n(8581);const m=n(9392);const g=n(5232);const y=n(2064);const w=n(9165);const v=n(1800);const b=c.promisify(s.inflateRaw);const N=c.promisify(s.deflateRaw);class SAML{constructor(e){this.options=this.initialize(e);this.cacheProvider=this.options.cacheProvider}initialize(e){var r,n,i,o,s,a,u,l,c,h,m,y,w,v,b,N,E,T,D,S,A,O,x,I,L,P,C,M;if(!e){throw new TypeError("SamlOptions required on construction")}(0,d.assertRequired)(e.issuer,"issuer is required");(0,d.assertRequired)(e.cert,"cert is required");(0,d.assertBooleanIfPresent)(e.passive);(0,d.assertBooleanIfPresent)(e.disableRequestedAuthnContext);(0,d.assertBooleanIfPresent)(e.forceAuthn);(0,d.assertBooleanIfPresent)(e.skipRequestCompression);(0,d.assertBooleanIfPresent)(e.disableRequestAcsUrl);(0,d.assertBooleanIfPresent)(e.allowCreate);(0,d.assertBooleanIfPresent)(e.wantAssertionsSigned);(0,d.assertBooleanIfPresent)(e.wantAuthnResponseSigned);(0,d.assertBooleanIfPresent)(e.signMetadata);const X={...e,passive:(r=e.passive)!==null&&r!==void 0?r:false,disableRequestedAuthnContext:(n=e.disableRequestedAuthnContext)!==null&&n!==void 0?n:false,additionalParams:(i=e.additionalParams)!==null&&i!==void 0?i:{},additionalAuthorizeParams:(o=e.additionalAuthorizeParams)!==null&&o!==void 0?o:{},additionalLogoutParams:(s=e.additionalLogoutParams)!==null&&s!==void 0?s:{},forceAuthn:(a=e.forceAuthn)!==null&&a!==void 0?a:false,skipRequestCompression:(u=e.skipRequestCompression)!==null&&u!==void 0?u:false,disableRequestAcsUrl:(l=e.disableRequestAcsUrl)!==null&&l!==void 0?l:false,acceptedClockSkewMs:(c=e.acceptedClockSkewMs)!==null&&c!==void 0?c:0,maxAssertionAgeMs:(h=e.maxAssertionAgeMs)!==null&&h!==void 0?h:0,path:(m=e.path)!==null&&m!==void 0?m:"/saml/consume",host:(y=e.host)!==null&&y!==void 0?y:"localhost",issuer:e.issuer,audience:(v=(w=e.audience)!==null&&w!==void 0?w:e.issuer)!==null&&v!==void 0?v:"unknown_audience",identifierFormat:e.identifierFormat===undefined?"urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress":e.identifierFormat,allowCreate:(b=e.allowCreate)!==null&&b!==void 0?b:true,spNameQualifier:e.spNameQualifier,wantAssertionsSigned:(N=e.wantAssertionsSigned)!==null&&N!==void 0?N:true,wantAuthnResponseSigned:(E=e.wantAuthnResponseSigned)!==null&&E!==void 0?E:true,authnContext:(T=e.authnContext)!==null&&T!==void 0?T:["urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"],validateInResponseTo:(D=e.validateInResponseTo)!==null&&D!==void 0?D:f.ValidateInResponseTo.never,cert:e.cert,requestIdExpirationPeriodMs:(S=e.requestIdExpirationPeriodMs)!==null&&S!==void 0?S:288e5,cacheProvider:(A=e.cacheProvider)!==null&&A!==void 0?A:new p.InMemoryCacheProvider({keyExpirationPeriodMs:e.requestIdExpirationPeriodMs}),logoutUrl:(x=(O=e.logoutUrl)!==null&&O!==void 0?O:e.entryPoint)!==null&&x!==void 0?x:"",signatureAlgorithm:(I=e.signatureAlgorithm)!==null&&I!==void 0?I:"sha1",authnRequestBinding:(L=e.authnRequestBinding)!==null&&L!==void 0?L:"HTTP-Redirect",generateUniqueId:(P=e.generateUniqueId)!==null&&P!==void 0?P:g.generateUniqueId,signMetadata:(C=e.signMetadata)!==null&&C!==void 0?C:false,racComparison:(M=e.racComparison)!==null&&M!==void 0?M:"exact"};if(!["exact","minimum","maximum","better"].includes(X.racComparison)){throw new TypeError("racComparison must be one of ['exact', 'minimum', 'maximum', 'better']")}return X}getCallbackUrl(e){if(this.options.callbackUrl){return this.options.callbackUrl}else{const r=new u.URL("http://localhost");if(e){r.host=e}else{r.host=this.options.host}if(this.options.protocol){r.protocol=this.options.protocol}r.pathname=this.options.path;return r.toString()}}signRequest(e){(0,d.assertRequired)(this.options.privateKey,"privateKey is required");const r={};e.SigAlg=h.getSigningAlgorithm(this.options.signatureAlgorithm);const n=h.getSigner(this.options.signatureAlgorithm);if(e.SAMLRequest){r.SAMLRequest=e.SAMLRequest}if(e.SAMLResponse){r.SAMLResponse=e.SAMLResponse}if(e.RelayState){r.RelayState=e.RelayState}if(e.SigAlg){r.SigAlg=e.SigAlg}n.update(l.stringify(r));e.Signature=n.sign((0,g.keyToPEM)(this.options.privateKey),"base64")}async generateAuthorizeRequestAsync(e,r,n){(0,d.assertRequired)(this.options.entryPoint,"entryPoint is required");const i=this.options.generateUniqueId();const o=(0,y.generateInstant)();if(this.mustValidateInResponseTo(true)){await this.cacheProvider.saveAsync(i,o)}const s={"samlp:AuthnRequest":{"@xmlns:samlp":"urn:oasis:names:tc:SAML:2.0:protocol","@ID":i,"@Version":"2.0","@IssueInstant":o,"@ProtocolBinding":"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST","@Destination":this.options.entryPoint,"saml:Issuer":{"@xmlns:saml":"urn:oasis:names:tc:SAML:2.0:assertion","#text":this.options.issuer}}};if(e)s["samlp:AuthnRequest"]["@IsPassive"]=true;if(this.options.forceAuthn===true){s["samlp:AuthnRequest"]["@ForceAuthn"]=true}if(!this.options.disableRequestAcsUrl){s["samlp:AuthnRequest"]["@AssertionConsumerServiceURL"]=this.getCallbackUrl(n)}const a=this.options.samlAuthnRequestExtensions;if(a!=null){if(typeof a!="object"){throw new TypeError("samlAuthnRequestExtensions should be Object")}s["samlp:AuthnRequest"]["samlp:Extensions"]={"@xmlns:samlp":"urn:oasis:names:tc:SAML:2.0:protocol",...a}}const u={"@xmlns:samlp":"urn:oasis:names:tc:SAML:2.0:protocol","@AllowCreate":this.options.allowCreate};if(this.options.identifierFormat!=null){u["@Format"]=this.options.identifierFormat}if(this.options.spNameQualifier!=null){u["@SPNameQualifier"]=this.options.spNameQualifier}s["samlp:AuthnRequest"]["samlp:NameIDPolicy"]=u;if(!this.options.disableRequestedAuthnContext){const e=[];this.options.authnContext.forEach((function(r){e.push({"@xmlns:saml":"urn:oasis:names:tc:SAML:2.0:assertion","#text":r})}));s["samlp:AuthnRequest"]["samlp:RequestedAuthnContext"]={"@xmlns:samlp":"urn:oasis:names:tc:SAML:2.0:protocol","@Comparison":this.options.racComparison,"saml:AuthnContextClassRef":e}}if(this.options.attributeConsumingServiceIndex!=null){s["samlp:AuthnRequest"]["@AttributeConsumingServiceIndex"]=this.options.attributeConsumingServiceIndex}if(this.options.providerName!=null){s["samlp:AuthnRequest"]["@ProviderName"]=this.options.providerName}if(this.options.scoping!=null){const e={"@xmlns:samlp":"urn:oasis:names:tc:SAML:2.0:protocol"};if(typeof this.options.scoping.proxyCount==="number"){e["@ProxyCount"]=this.options.scoping.proxyCount}if(this.options.scoping.idpList){e["samlp:IDPList"]=this.options.scoping.idpList.map((e=>{const r={"@xmlns:samlp":"urn:oasis:names:tc:SAML:2.0:protocol"};if(e.entries){r["samlp:IDPEntry"]=e.entries.map((e=>{const r={"@xmlns:samlp":"urn:oasis:names:tc:SAML:2.0:protocol"};r["@ProviderID"]=e.providerId;if(e.name){r["@Name"]=e.name}if(e.loc){r["@Loc"]=e.loc}return r}))}if(e.getComplete){r["samlp:GetComplete"]=e.getComplete}return r}))}if(this.options.scoping.requesterId){e["samlp:RequesterID"]=this.options.scoping.requesterId}s["samlp:AuthnRequest"]["samlp:Scoping"]=e}let l=(0,m.buildXmlBuilderObject)(s,false);if(r&&(0,f.isValidSamlSigningOptions)(this.options)){l=(0,w.signAuthnRequestPost)(l,this.options)}return l}async _generateLogoutRequest(e){const r=this.options.generateUniqueId();const n=(0,y.generateInstant)();const i={"samlp:LogoutRequest":{"@xmlns:samlp":"urn:oasis:names:tc:SAML:2.0:protocol","@xmlns:saml":"urn:oasis:names:tc:SAML:2.0:assertion","@ID":r,"@Version":"2.0","@IssueInstant":n,"@Destination":this.options.logoutUrl,"saml:Issuer":{"@xmlns:saml":"urn:oasis:names:tc:SAML:2.0:assertion","#text":this.options.issuer},"samlp:Extensions":{},"saml:NameID":{"@Format":e.nameIDFormat,"#text":e.nameID}}};const o=this.options.samlLogoutRequestExtensions;if(o!=null){if(typeof o!="object"){throw new TypeError("samlLogoutRequestExtensions should be Object")}i["samlp:LogoutRequest"]["samlp:Extensions"]={"@xmlns:samlp":"urn:oasis:names:tc:SAML:2.0:protocol",...o}}else{delete i["samlp:LogoutRequest"]["samlp:Extensions"]}if(e.nameQualifier!=null){i["samlp:LogoutRequest"]["saml:NameID"]["@NameQualifier"]=e.nameQualifier}if(e.spNameQualifier!=null){i["samlp:LogoutRequest"]["saml:NameID"]["@SPNameQualifier"]=e.spNameQualifier}if(e.sessionIndex){i["samlp:LogoutRequest"]["saml2p:SessionIndex"]={"@xmlns:saml2p":"urn:oasis:names:tc:SAML:2.0:protocol","#text":e.sessionIndex}}await this.cacheProvider.saveAsync(r,n);return(0,m.buildXmlBuilderObject)(i,false)}_generateLogoutResponse(e,r){const n=this.options.generateUniqueId();const i=(0,y.generateInstant)();const o={"samlp:StatusCode":{"@Value":"urn:oasis:names:tc:SAML:2.0:status:Success"}};const s={"samlp:StatusCode":{"@Value":"urn:oasis:names:tc:SAML:2.0:status:Requester","samlp:StatusCode":{"@Value":"urn:oasis:names:tc:SAML:2.0:status:UnknownPrincipal"}}};const a={"samlp:LogoutResponse":{"@xmlns:samlp":"urn:oasis:names:tc:SAML:2.0:protocol","@xmlns:saml":"urn:oasis:names:tc:SAML:2.0:assertion","@ID":n,"@Version":"2.0","@IssueInstant":i,"@Destination":this.options.logoutUrl,"@InResponseTo":e.ID,"saml:Issuer":{"#text":this.options.issuer},"samlp:Status":r?o:s}};return(0,m.buildXmlBuilderObject)(a,false)}async _requestToUrlAsync(e,r,n,i){(0,d.assertRequired)(this.options.entryPoint,"entryPoint is required");const o=e||r;(0,d.assertRequired)(o,"either request or response is required");let s;if(this.options.skipRequestCompression){s=Buffer.from(o,"utf8")}else{s=await N(o)}const a=s.toString("base64");let l=new u.URL(this.options.entryPoint);if(n==="logout"){if(this.options.logoutUrl){l=new u.URL(this.options.logoutUrl)}}else if(n!=="authorize"){throw new Error("Unknown operation: "+n)}const c=e?{SAMLRequest:a}:{SAMLResponse:a};Object.keys(i).forEach((e=>{c[e]=i[e]}));if((0,f.isValidSamlSigningOptions)(this.options)){if(!this.options.entryPoint){throw new Error('"entryPoint" config parameter is required for signed messages')}this.signRequest(c)}Object.keys(c).forEach((e=>{l.searchParams.set(e,c[e])}));return l.toString()}_getAdditionalParams(e,r,n){const i={};if(typeof e==="string"&&e.length>0){i.RelayState=e}return Object.assign(i,this.options.additionalParams,r==="logout"?this.options.additionalLogoutParams:this.options.additionalAuthorizeParams,n!==null&&n!==void 0?n:{})}async getAuthorizeUrlAsync(e,r,n){const i=await this.generateAuthorizeRequestAsync(this.options.passive,false,r);const o="authorize";const s=n?n.additionalParams||{}:{};return await this._requestToUrlAsync(i,null,o,this._getAdditionalParams(e,o,s))}async getAuthorizeFormAsync(e,r){(0,d.assertRequired)(this.options.entryPoint,"entryPoint is required");const quoteattr=function(e,r){const n=r?"&#13;":"\n";return(""+e).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r\n/g,n).replace(/[\r\n]/g,n)};const n=await this.generateAuthorizeRequestAsync(this.options.passive,true,r);let i;if(this.options.skipRequestCompression){i=Buffer.from(n,"utf8")}else{i=await N(n)}const o="authorize";const s=this._getAdditionalParams(e,o);const a={SAMLRequest:i.toString("base64")};Object.keys(s).forEach((e=>{a[e]=s[e]||""}));const u=Object.keys(a).map((e=>'<input type="hidden" name="'+e+'" value="'+quoteattr(a[e])+'" />')).join("\r\n");return["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta http-equiv="x-ua-compatible" content="ie=edge">',"</head>",'<body onload="document.forms[0].submit()">',"<noscript>","<p><strong>Note:</strong> Since your browser does not support JavaScript, you must press the button below once to proceed.</p>","</noscript>",'<form method="post" action="'+encodeURI(this.options.entryPoint)+'">',u,'<input type="submit" value="Submit" />',"</form>",'<script>document.forms[0].style.display="none";<\/script>',"</body>","</html>"].join("\r\n")}async getLogoutUrlAsync(e,r,n){const i=await this._generateLogoutRequest(e);const o="logout";const s=n?n.additionalParams||{}:{};return await this._requestToUrlAsync(i,null,o,this._getAdditionalParams(r,o,s))}getLogoutResponseUrl(e,r,n,i,o){c.callbackify((()=>this.getLogoutResponseUrlAsync(e,r,n,i)))(o)}async getLogoutResponseUrlAsync(e,r,n,i){const o=this._generateLogoutResponse(e,i);const s="logout";const a=n?n.additionalParams||{}:{};return await this._requestToUrlAsync(null,o,s,this._getAdditionalParams(r,s,a))}async certsToCheck(){let e;if(typeof this.options.cert==="function"){e=await c.promisify(this.options.cert)().then((e=>{(0,d.assertRequired)(e,"callback didn't return cert");if(!Array.isArray(e)){e=[e]}return e}))}else if(Array.isArray(this.options.cert)){e=this.options.cert}else{e=[this.options.cert]}e.forEach((e=>{(0,d.assertRequired)(e,"unknown cert found")}));return e}async validatePostResponseAsync(e){var r,n,i,s;let a;let u;let l=null;try{a=Buffer.from(e.SAMLResponse,"base64").toString("utf8");u=await(0,m.parseDomFromString)(a);const o=m.xpath.selectAttributes(u,"/*[local-name()='Response']/@InResponseTo");if(o){l=o.length?o[0].nodeValue:null;await this.validateInResponseTo(l)}const c=await this.certsToCheck();let p=false;if((0,m.validateSignature)(a,u.documentElement,c)){p=true}if(this.options.wantAuthnResponseSigned===true&&p===false){throw new Error("Invalid document signature")}const h=m.xpath.selectElements(u,"/*[local-name()='Response']/*[local-name()='Assertion']");const g=m.xpath.selectElements(u,"/*[local-name()='Response']/*[local-name()='EncryptedAssertion']");if(h.length+g.length>1){throw new Error("Invalid signature: multiple assertions")}if(h.length==1){if((this.options.wantAssertionsSigned||!p)&&!(0,m.validateSignature)(a,h[0],c)){throw new Error("Invalid signature")}return await this.processValidlySignedAssertionAsync(h[0].toString(),a,l)}if(g.length==1){(0,d.assertRequired)(this.options.decryptionPvk,"No decryption key for encrypted SAML response");const e=g[0].toString();const r=await(0,m.decryptXml)(e,this.options.decryptionPvk);const n=await(0,m.parseDomFromString)(r);const i=m.xpath.selectElements(n,"/*[local-name()='Assertion']");if(i.length!=1)throw new Error("Invalid EncryptedAssertion content");if((this.options.wantAssertionsSigned||!p)&&!(0,m.validateSignature)(r,i[0],c)){throw new Error("Invalid signature from encrypted assertion")}return await this.processValidlySignedAssertionAsync(i[0].toString(),a,l)}const y=await(0,m.parseXml2JsFromString)(a);const w=y.Response;if(w){if(!("Assertion"in w)){const e=w.Status;if(e){const o=e[0].StatusCode;if(o&&((r=o[0].$)===null||r===void 0?void 0:r.Value)==="urn:oasis:names:tc:SAML:2.0:status:Responder"){const e=o[0].StatusCode;if(e&&((n=e[0].$)===null||n===void 0?void 0:n.Value)==="urn:oasis:names:tc:SAML:2.0:status:NoPassive"){if(!p){throw new Error("Invalid signature: NoPassive")}return{profile:null,loggedOut:false}}}if(o&&((i=o[0].$)===null||i===void 0?void 0:i.Value)){const r=o[0].$.Value.match(/[^:]*$/);if(r&&r[0]!="Success"){let n="unspecified";if(e[0].StatusMessage){n=e[0].StatusMessage[0]._||n}else if(o[0].StatusCode){const e=(s=o[0].StatusCode[0].$)===null||s===void 0?void 0:s.Value.match(/[^:]*$/);n=e?e[0]:n}const i=(0,m.buildXml2JsObject)("Status",e[0]);throw new f.ErrorWithXmlStatus("SAML provider returned "+r+" error: "+n,i)}}}}throw new Error("Missing SAML assertion")}else{if(!p){throw new Error("Invalid signature: No response found")}const e=y.LogoutResponse;if(e){return{profile:null,loggedOut:true}}else{throw new Error("Unknown SAML response message")}}}catch(e){o("validatePostResponse resulted in an error: %s",e);if(this.mustValidateInResponseTo(Boolean(l))){await this.cacheProvider.removeAsync(l)}throw e}}async validateInResponseTo(e){if(this.mustValidateInResponseTo(Boolean(e))){if(e){const r=await this.cacheProvider.getAsync(e);if(!r)throw new Error("InResponseTo is not valid");return}else{throw new Error("InResponseTo is missing from response")}}}async validateRedirectAsync(e,r){const n=e.SAMLRequest?"SAMLRequest":"SAMLResponse";const i=Buffer.from(e[n],"base64");const o=await b(i);const s=await(0,m.parseDomFromString)(o.toString());const a=await(0,m.parseXml2JsFromString)(o);n==="SAMLResponse"?await this.verifyLogoutResponse(a):this.verifyLogoutRequest(a);await this.hasValidSignatureForRedirect(e,r);return await this.processValidlySignedSamlLogoutAsync(a,s)}async hasValidSignatureForRedirect(e,r){const n=r.split("&");const getParam=e=>{const r=n.filter((r=>new RegExp(e).test(r)));return r[0]};if(e.Signature){let r=getParam("SAMLRequest")||getParam("SAMLResponse");if(getParam("RelayState")){r+="&"+getParam("RelayState")}r+="&"+getParam("SigAlg");const n=await this.certsToCheck();const i=n.some((n=>this.validateSignatureForRedirect(r,e.Signature,e.SigAlg,n)));if(!i){throw new Error("Invalid query signature")}}else{return true}}validateSignatureForRedirect(e,r,n,i){function hasMatch(e){const r=n.toLowerCase().replace(/.*#(.*)$/,"$1");return e.toLowerCase()===r}const o=a.getHashes().findIndex(hasMatch);let s;if(o>-1){s=a.getHashes()[o]}else{throw new Error(n+" is not supported")}const u=a.createVerify(s);u.update(e);return u.verify((0,g.certToPEM)(i),r,"base64")}verifyLogoutRequest(e){this.verifyIssuer(e.LogoutRequest);const r=(new Date).getTime();const n=e.LogoutRequest.$;const i=this.checkTimestampsValidityError(r,n.NotBefore,n.NotOnOrAfter);if(i){throw i}}async verifyLogoutResponse(e){const r=e.LogoutResponse.Status[0].StatusCode[0].$.Value;if(r!=="urn:oasis:names:tc:SAML:2.0:status:Success")throw new Error("Bad status code: "+r);this.verifyIssuer(e.LogoutResponse);const n=e.LogoutResponse.$.InResponseTo;if(n){return this.validateInResponseTo(n)}return}verifyIssuer(e){if(this.options.idpIssuer!=null){const r=e.Issuer;if(r){if(r[0]._!==this.options.idpIssuer)throw new Error("Unknown SAML issuer. Expected: "+this.options.idpIssuer+" Received: "+r[0]._)}else{throw new Error("Missing SAML issuer")}}}async processValidlySignedAssertionAsync(e,r,n){let i;const o=(new Date).getTime();const s={};const a=await(0,m.parseXml2JsFromString)(e);const u=a;const l=a.Assertion;e:{const e=l.Issuer;if(e&&e[0]._){s.issuer=e[0]._}if(n!=null){s.inResponseTo=n}const r=l.AuthnStatement;if(r){if(r[0].$&&r[0].$.SessionIndex){s.sessionIndex=r[0].$.SessionIndex}}const a=l.Subject;let u;let c=null;let p=null;if(a){const e=a[0].NameID;if(e&&e[0]._){s.nameID=e[0]._;if(e[0].$&&e[0].$.Format){s.nameIDFormat=e[0].$.Format;s.nameQualifier=e[0].$.NameQualifier;s.spNameQualifier=e[0].$.SPNameQualifier}}p=a[0].SubjectConfirmation;u=p===null||p===void 0?void 0:p.find((e=>{var r;const n=(r=e.SubjectConfirmationData)===null||r===void 0?void 0:r[0];if(n===null||n===void 0?void 0:n.$){const e=n.$.NotBefore;const r=n.$.NotOnOrAfter;const i=this.calcMaxAgeAssertionTime(this.options.maxAssertionAgeMs,r,l.$.IssueInstant);const s=this.checkTimestampsValidityError(o,e,r,i);if(s===null)return true}return false}));if(u!=null){c=u.SubjectConfirmationData[0]}}if(this.mustValidateInResponseTo(Boolean(n))){if(u){if(c===null||c===void 0?void 0:c.$){const e=c.$.InResponseTo;if(n&&e&&e!=n){await this.cacheProvider.removeAsync(n);throw new Error("InResponseTo does not match subjectInResponseTo")}else if(e){let r=false;const i=await this.cacheProvider.getAsync(e);if(i){const e=new Date(i);if(o<e.getTime()+this.options.requestIdExpirationPeriodMs)r=true}await this.cacheProvider.removeAsync(n);if(!r){throw new Error("SubjectInResponseTo is not valid")}break e}}}else{if(p!=null&&u==null){i="No valid subject confirmation found among those available in the SAML assertion";throw new Error(i)}else{await this.cacheProvider.removeAsync(n);break e}}}else{break e}}const c=l.Conditions?l.Conditions[0]:null;if(l.Conditions&&l.Conditions.length>1){i="Unable to process multiple conditions in SAML assertion";throw new Error(i)}if(c&&c.$){const e=this.calcMaxAgeAssertionTime(this.options.maxAssertionAgeMs,c.$.NotOnOrAfter,l.$.IssueInstant);const r=this.checkTimestampsValidityError(o,c.$.NotBefore,c.$.NotOnOrAfter,e);if(r)throw r}if(this.options.audience!==false){const e=this.checkAudienceValidityError(this.options.audience,c.AudienceRestriction);if(e)throw e}const p=l.AttributeStatement;if(p){const e=[].concat(...p.filter((e=>Array.isArray(e.Attribute))).map((e=>e.Attribute)));const attrValueMapper=e=>{const r=Object.keys(e).some((e=>e!=="_"&&e!=="$"));return r?e:e._};if(e.length>0){const r={};e.forEach((e=>{if(!Object.prototype.hasOwnProperty.call(e,"AttributeValue")){return}const n=e.$.Name;const i=e.AttributeValue.length===1?attrValueMapper(e.AttributeValue[0]):e.AttributeValue.map(attrValueMapper);r[n]=i;if(Object.prototype.hasOwnProperty.call(s,n)){return}s[n]=i}));s.attributes=r}}if(!s.mail&&s["urn:oid:0.9.2342.19200300.100.1.3"]){s.mail=s["urn:oid:0.9.2342.19200300.100.1.3"]}if(!s.email&&s.mail){s.email=s.mail}s.getAssertionXml=()=>e.toString();s.getAssertion=()=>u;s.getSamlResponseXml=()=>r;return{profile:s,loggedOut:false}}checkTimestampsValidityError(e,r,n,i){if(this.options.acceptedClockSkewMs==-1)return null;if(r){const n=(0,y.dateStringToTimestamp)(r,"NotBefore");if(e+this.options.acceptedClockSkewMs<n)return new Error("SAML assertion not yet valid")}if(n){const r=(0,y.dateStringToTimestamp)(n,"NotOnOrAfter");if(e-this.options.acceptedClockSkewMs>=r)return new Error("SAML assertion expired: clocks skewed too much")}if(i){if(e-this.options.acceptedClockSkewMs>=i)return new Error("SAML assertion expired: assertion too old")}return null}checkAudienceValidityError(e,r){if(!r||r.length<1){return new Error("SAML assertion has no AudienceRestriction")}const n=r.map((r=>{if(!r.Audience||!r.Audience[0]||!r.Audience[0]._){return new Error("SAML assertion AudienceRestriction has no Audience value")}if(r.Audience[0]._!==e){return new Error("SAML assertion audience mismatch")}return null})).filter((e=>e!==null));if(n.length>0){return n[0]}return null}async validatePostRequestAsync(e){const r=Buffer.from(e.SAMLRequest,"base64").toString("utf8");const n=await(0,m.parseDomFromString)(r);const i=await(0,m.parseXml2JsFromString)(r);const o=await this.certsToCheck();if(!(0,m.validateSignature)(r,n.documentElement,o)){throw new Error("Invalid signature on documentElement")}return await this.processValidlySignedPostRequestAsync(i,n)}async processValidlySignedPostRequestAsync(e,r){var n;const i=e.LogoutRequest;this.verifyLogoutRequest(e);if(i){const e={};if(i.$.ID){e.ID=i.$.ID}else{throw new Error("Missing SAML LogoutRequest ID")}const o=i.Issuer;if(o&&o[0]._){e.issuer=o[0]._}else{throw new Error("Missing SAML issuer")}const s=await(0,m.getNameIdAsync)(r,(n=this.options.decryptionPvk)!==null&&n!==void 0?n:null);if(s.value){e.nameID=s.value;if(s.format){e.nameIDFormat=s.format}}else{throw new Error("Missing SAML NameID")}const a=i.SessionIndex;if(a){e.sessionIndex=a[0]._}return{profile:e,loggedOut:true}}else{throw new Error("Unknown SAML request message")}}async processValidlySignedSamlLogoutAsync(e,r){const n=e.LogoutResponse;const i=e.LogoutRequest;if(n){return{profile:null,loggedOut:true}}else if(i){return await this.processValidlySignedPostRequestAsync(e,r)}else{throw new Error("Unknown SAML response message")}}generateServiceProviderMetadata(e,r){const n=this.getCallbackUrl();return(0,v.generateServiceProviderMetadata)({...this.options,callbackUrl:n,decryptionCert:e,signingCerts:r})}calcMaxAgeAssertionTime(e,r,n){const i=(0,y.dateStringToTimestamp)(r,"NotOnOrAfter");const o=(0,y.dateStringToTimestamp)(n,"IssueInstant");if(e===0){return i}const s=o+e;return s<i?s:i}mustValidateInResponseTo(e){return this.options.validateInResponseTo===f.ValidateInResponseTo.always||this.options.validateInResponseTo===f.ValidateInResponseTo.ifPresent&&e}}r.SAML=SAML},8748:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.ErrorWithXmlStatus=r.ValidateInResponseTo=r.isValidSamlSigningOptions=void 0;const isValidSamlSigningOptions=e=>e.privateKey!=null;r.isValidSamlSigningOptions=isValidSamlSigningOptions;var n;(function(e){e["never"]="never";e["ifPresent"]="ifPresent";e["always"]="always"})(n=r.ValidateInResponseTo||(r.ValidateInResponseTo={}));class ErrorWithXmlStatus extends Error{constructor(e,r){super(e);this.xmlStatus=r}}r.ErrorWithXmlStatus=ErrorWithXmlStatus},8581:function(e,r,n){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.signXmlMetadata=r.signXmlResponse=r.assertBooleanIfPresent=r.assertRequired=void 0;const i=n(9392);function assertRequired(e,r){if(e===undefined||e===null||typeof e==="string"&&e.length===0){throw new TypeError(r!==null&&r!==void 0?r:"value does not exist")}}r.assertRequired=assertRequired;function assertBooleanIfPresent(e,r){if(e!=null&&typeof e!="boolean"){throw new TypeError(r!==null&&r!==void 0?r:"value is set but not boolean")}}r.assertBooleanIfPresent=assertBooleanIfPresent;function signXmlResponse(e,r){const n='//*[local-name(.)="Response" and namespace-uri(.)="urn:oasis:names:tc:SAML:2.0:protocol"]';return(0,i.signXml)(e,n,{reference:n,action:"append"},r)}r.signXmlResponse=signXmlResponse;function signXmlMetadata(e,r){const n='//*[local-name(.)="EntityDescriptor" and namespace-uri(.)="urn:oasis:names:tc:SAML:2.0:metadata"]';return(0,i.signXml)(e,n,{reference:n,action:"prepend"},r)}r.signXmlMetadata=signXmlMetadata},9392:function(e,r,n){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.getNameIdAsync=r.promiseWithNameId=r.buildXmlBuilderObject=r.buildXml2JsObject=r.parseXml2JsFromString=r.parseDomFromString=r.signXml=r.validateXmlSignatureForCert=r.validateSignature=r.decryptXml=r.xpath=void 0;const i=n(9023);const o=n(6877);const s=n(197);const a=n(8737);const u=n(8123);const l=n(4512);const c=n(8748);const p=n(7775);const h=n(8581);const f=n(5232);const selectXPath=(e,r,n)=>{const i=o.xpath(r,n);if(!e(i)){throw new Error("invalid xpath return type")}return i};const attributesXPathTypeGuard=e=>e.every((e=>{if(typeof e!="object"){return false}return typeof e.nodeType==="number"&&e.nodeType===e.ATTRIBUTE_NODE}));const elementsXPathTypeGuard=e=>e.every((e=>{if(typeof e!="object"){return false}return typeof e.nodeType==="number"&&e.nodeType===e.ELEMENT_NODE}));r.xpath={selectAttributes:(e,r)=>selectXPath(attributesXPathTypeGuard,e,r),selectElements:(e,r)=>selectXPath(elementsXPathTypeGuard,e,r)};const decryptXml=async(e,r)=>i.promisify(s.decrypt).bind(s)(e,{key:r});r.decryptXml=decryptXml;const normalizeNewlines=e=>e.replace(/\r\n?/g,"\n");const validateSignature=(e,n,i)=>{const o=".//*["+"local-name(.)='Signature' and "+"namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#' and "+"descendant::*[local-name(.)='Reference' and @URI='#"+n.getAttribute("ID")+"']"+"]";const s=r.xpath.selectElements(n,o);if(s.length!==1){return false}const a=".//*["+"local-name(.)='Transform' and "+"namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#' and "+"ancestor::*[local-name(.)='Reference' and @URI='#"+n.getAttribute("ID")+"']"+"]";const u=r.xpath.selectElements(n,a);if(u.length>2){throw new Error("Invalid signature, too many transforms")}const l=s[0];return i.some((i=>(0,r.validateXmlSignatureForCert)(l,(0,f.certToPEM)(i),e,n)))};r.validateSignature=validateSignature;const validateXmlSignatureForCert=(e,n,i,s)=>{const a=new o.SignedXml;a.keyInfoProvider={file:"",getKeyInfo:()=>"<X509Data></X509Data>",getKey:()=>Buffer.from(n)};a.loadSignature(e);if(a.references.length!=1)return false;const u=a.references[0].uri;(0,h.assertRequired)(u,"signature reference uri not found");const l=u[0]==="#"?u.substring(1):u;const c=s.getAttribute("ID")?"ID":"Id";if(s.getAttribute(c)!=l)return false;const p=r.xpath.selectElements(s.ownerDocument,"//*[@"+c+"='"+l+"']");if(p.length>1){return false}i=normalizeNewlines(i);return a.checkSignature(i)};r.validateXmlSignatureForCert=validateXmlSignatureForCert;const signXml=(e,r,n,i)=>{var s;const a=["http://www.w3.org/2000/09/xmldsig#enveloped-signature","http://www.w3.org/2001/10/xml-exc-c14n#"];if(!e)throw new Error("samlMessage is required");if(!n)throw new Error("location is required");if(!i)throw new Error("options is required");if(!(0,c.isValidSamlSigningOptions)(i))throw new Error("options.privateKey is required");const u=(s=i.xmlSignatureTransforms)!==null&&s!==void 0?s:a;const l=new o.SignedXml;if(i.signatureAlgorithm!=null){l.signatureAlgorithm=p.getSigningAlgorithm(i.signatureAlgorithm)}l.addReference(r,u,p.getDigestAlgorithm(i.digestAlgorithm));l.signingKey=i.privateKey;l.computeSignature(e,{location:n});return l.getSignedXml()};r.signXml=signXml;const parseDomFromString=e=>new Promise((function(r,n){function errHandler(e){return n(new Error(e))}const i=new a.DOMParser({locator:{},errorHandler:{error:errHandler,fatalError:errHandler}}).parseFromString(e,"text/xml");if(!Object.prototype.hasOwnProperty.call(i,"documentElement")){return n(new Error("Not a valid XML document"))}return r(i)}));r.parseDomFromString=parseDomFromString;const parseXml2JsFromString=async e=>{const r={explicitRoot:true,explicitCharkey:true,tagNameProcessors:[u.processors.stripPrefix]};const n=new u.Parser(r);return n.parseStringPromise(e)};r.parseXml2JsFromString=parseXml2JsFromString;const buildXml2JsObject=(e,r)=>{const n={rootName:e,headless:true};return new u.Builder(n).buildObject(r)};r.buildXml2JsObject=buildXml2JsObject;const buildXmlBuilderObject=(e,r)=>{const n=r?{pretty:true,indent:" ",newline:"\n"}:{};return l.create(e).end(n)};r.buildXmlBuilderObject=buildXmlBuilderObject;const promiseWithNameId=async e=>{const n=r.xpath.selectAttributes(e,"@Format");return{value:e.textContent,format:n&&n[0]&&n[0].nodeValue}};r.promiseWithNameId=promiseWithNameId;const getNameIdAsync=async(e,n)=>{const i=r.xpath.selectElements(e,"/*[local-name()='LogoutRequest']/*[local-name()='NameID']");const o=r.xpath.selectElements(e,"/*[local-name()='LogoutRequest']/*[local-name()='EncryptedID']");if(i.length+o.length>1){throw new Error("Invalid LogoutRequest")}if(i.length===1){return(0,r.promiseWithNameId)(i[0])}if(o.length===1){(0,h.assertRequired)(n,"No decryption key found getting name ID for encrypted SAML response");const e=r.xpath.selectElements(o[0],"./*[local-name()='EncryptedData']");if(e.length!==1){throw new Error("Invalid LogoutRequest")}const i=e[0].toString();const s=await(0,r.decryptXml)(i,n);const a=await(0,r.parseDomFromString)(s);const u=r.xpath.selectElements(a,"/*[local-name()='NameID']");if(u.length!==1){throw new Error("Invalid EncryptedAssertion content")}return await(0,r.promiseWithNameId)(u[0])}throw new Error("Missing SAML NameID")};r.getNameIdAsync=getNameIdAsync},5741:function(e,r){"use strict";function find(e,r,n){if(n===undefined){n=Array.prototype}if(e&&typeof n.find==="function"){return n.find.call(e,r)}for(var i=0;i<e.length;i++){if(Object.prototype.hasOwnProperty.call(e,i)){var o=e[i];if(r.call(undefined,o,i,e)){return o}}}}function freeze(e,r){if(r===undefined){r=Object}return r&&typeof r.freeze==="function"?r.freeze(e):e}function assign(e,r){if(e===null||typeof e!=="object"){throw new TypeError("target is not an object")}for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}return e}var n=freeze({HTML:"text/html",isHTML:function(e){return e===n.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"});var i=freeze({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===i.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});r.assign=assign;r.find=find;r.freeze=freeze;r.MIME_TYPE=n;r.NAMESPACE=i},6425:function(e,r,n){var i;var o=n(5741);var s=n(6537);var a=n(1510);var u=n(8197);var l=s.DOMImplementation;var c=o.NAMESPACE;var p=u.ParseError;var h=u.XMLReader;function normalizeLineEndings(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function DOMParser(e){this.options=e||{locator:{}}}DOMParser.prototype.parseFromString=function(e,r){var n=this.options;var i=new h;var o=n.domBuilder||new DOMHandler;var s=n.errorHandler;var u=n.locator;var l=n.xmlns||{};var p=/\/x?html?$/.test(r);var f=p?a.HTML_ENTITIES:a.XML_ENTITIES;if(u){o.setDocumentLocator(u)}i.errorHandler=buildErrorHandler(s,o,u);i.domBuilder=n.domBuilder||o;if(p){l[""]=c.HTML}l.xml=l.xml||c.XML;var d=n.normalizeLineEndings||normalizeLineEndings;if(e&&typeof e==="string"){i.parse(d(e),l,f)}else{i.errorHandler.error("invalid doc source")}return o.doc};function buildErrorHandler(e,r,n){if(!e){if(r instanceof DOMHandler){return r}e=r}var i={};var o=e instanceof Function;n=n||{};function build(r){var s=e[r];if(!s&&o){s=e.length==2?function(n){e(r,n)}:e}i[r]=s&&function(e){s("[xmldom "+r+"]\t"+e+_locator(n))}||function(){}}build("warning");build("error");build("fatalError");return i}function DOMHandler(){this.cdata=false}function position(e,r){r.lineNumber=e.lineNumber;r.columnNumber=e.columnNumber}DOMHandler.prototype={startDocument:function(){this.doc=(new l).createDocument(null,null,null);if(this.locator){this.doc.documentURI=this.locator.systemId}},startElement:function(e,r,n,i){var o=this.doc;var s=o.createElementNS(e,n||r);var a=i.length;appendElement(this,s);this.currentElement=s;this.locator&&position(this.locator,s);for(var u=0;u<a;u++){var e=i.getURI(u);var l=i.getValue(u);var n=i.getQName(u);var c=o.createAttributeNS(e,n);this.locator&&position(i.getLocator(u),c);c.value=c.nodeValue=l;s.setAttributeNode(c)}},endElement:function(e,r,n){var i=this.currentElement;var o=i.tagName;this.currentElement=i.parentNode},startPrefixMapping:function(e,r){},endPrefixMapping:function(e){},processingInstruction:function(e,r){var n=this.doc.createProcessingInstruction(e,r);this.locator&&position(this.locator,n);appendElement(this,n)},ignorableWhitespace:function(e,r,n){},characters:function(e,r,n){e=_toString.apply(this,arguments);if(e){if(this.cdata){var i=this.doc.createCDATASection(e)}else{var i=this.doc.createTextNode(e)}if(this.currentElement){this.currentElement.appendChild(i)}else if(/^\s*$/.test(e)){this.doc.appendChild(i)}this.locator&&position(this.locator,i)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){if(this.locator=e){e.lineNumber=0}},comment:function(e,r,n){e=_toString.apply(this,arguments);var i=this.doc.createComment(e);this.locator&&position(this.locator,i);appendElement(this,i)},startCDATA:function(){this.cdata=true},endCDATA:function(){this.cdata=false},startDTD:function(e,r,n){var i=this.doc.implementation;if(i&&i.createDocumentType){var o=i.createDocumentType(e,r,n);this.locator&&position(this.locator,o);appendElement(this,o);this.doc.doctype=o}},warning:function(e){console.warn("[xmldom warning]\t"+e,_locator(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,_locator(this.locator))},fatalError:function(e){throw new p(e,this.locator)}};function _locator(e){if(e){return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}}function _toString(e,r,n){if(typeof e=="string"){return e.substr(r,n)}else{if(e.length>=r+n||r){return new java.lang.String(e,r,n)+""}return e}}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){DOMHandler.prototype[e]=function(){return null}}));function appendElement(e,r){if(!e.currentElement){e.doc.appendChild(r)}else{e.currentElement.appendChild(r)}}i=DOMHandler;i=normalizeLineEndings;r.DOMParser=DOMParser},6537:function(e,r,n){var i=n(5741);var o=i.find;var s=i.NAMESPACE;function notEmptyString(e){return e!==""}function splitOnASCIIWhitespace(e){return e?e.split(/[\t\n\f\r ]+/).filter(notEmptyString):[]}function orderedSetReducer(e,r){if(!e.hasOwnProperty(r)){e[r]=true}return e}function toOrderedSet(e){if(!e)return[];var r=splitOnASCIIWhitespace(e);return Object.keys(r.reduce(orderedSetReducer,{}))}function arrayIncludes(e){return function(r){return e&&e.indexOf(r)!==-1}}function copy(e,r){for(var n in e){if(Object.prototype.hasOwnProperty.call(e,n)){r[n]=e[n]}}}function _extends(e,r){var n=e.prototype;if(!(n instanceof r)){function t(){}t.prototype=r.prototype;t=new t;copy(n,t);e.prototype=n=t}if(n.constructor!=e){if(typeof e!="function"){console.error("unknown Class:"+e)}n.constructor=e}}var a={};var u=a.ELEMENT_NODE=1;var l=a.ATTRIBUTE_NODE=2;var c=a.TEXT_NODE=3;var p=a.CDATA_SECTION_NODE=4;var h=a.ENTITY_REFERENCE_NODE=5;var f=a.ENTITY_NODE=6;var d=a.PROCESSING_INSTRUCTION_NODE=7;var m=a.COMMENT_NODE=8;var g=a.DOCUMENT_NODE=9;var y=a.DOCUMENT_TYPE_NODE=10;var w=a.DOCUMENT_FRAGMENT_NODE=11;var v=a.NOTATION_NODE=12;var b={};var N={};var E=b.INDEX_SIZE_ERR=(N[1]="Index size error",1);var T=b.DOMSTRING_SIZE_ERR=(N[2]="DOMString size error",2);var D=b.HIERARCHY_REQUEST_ERR=(N[3]="Hierarchy request error",3);var S=b.WRONG_DOCUMENT_ERR=(N[4]="Wrong document",4);var A=b.INVALID_CHARACTER_ERR=(N[5]="Invalid character",5);var O=b.NO_DATA_ALLOWED_ERR=(N[6]="No data allowed",6);var x=b.NO_MODIFICATION_ALLOWED_ERR=(N[7]="No modification allowed",7);var I=b.NOT_FOUND_ERR=(N[8]="Not found",8);var L=b.NOT_SUPPORTED_ERR=(N[9]="Not supported",9);var P=b.INUSE_ATTRIBUTE_ERR=(N[10]="Attribute in use",10);var C=b.INVALID_STATE_ERR=(N[11]="Invalid state",11);var M=b.SYNTAX_ERR=(N[12]="Syntax error",12);var X=b.INVALID_MODIFICATION_ERR=(N[13]="Invalid modification",13);var R=b.NAMESPACE_ERR=(N[14]="Invalid namespace",14);var _=b.INVALID_ACCESS_ERR=(N[15]="Invalid access",15);function DOMException(e,r){if(r instanceof Error){var n=r}else{n=this;Error.call(this,N[e]);this.message=N[e];if(Error.captureStackTrace)Error.captureStackTrace(this,DOMException)}n.code=e;if(r)this.message=this.message+": "+r;return n}DOMException.prototype=Error.prototype;copy(b,DOMException);function NodeList(){}NodeList.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,r){for(var n=[],i=0;i<this.length;i++){serializeToString(this[i],n,e,r)}return n.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}};function LiveNodeList(e,r){this._node=e;this._refresh=r;_updateLiveList(this)}function _updateLiveList(e){var r=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==r){var n=e._refresh(e._node);__set__(e,"length",n.length);if(!e.$$length||n.length<e.$$length){for(var i=n.length;i in e;i++){if(Object.prototype.hasOwnProperty.call(e,i)){delete e[i]}}}copy(n,e);e._inc=r}}LiveNodeList.prototype.item=function(e){_updateLiveList(this);return this[e]||null};_extends(LiveNodeList,NodeList);function NamedNodeMap(){}function _findNodeIndex(e,r){var n=e.length;while(n--){if(e[n]===r){return n}}}function _addNamedNode(e,r,n,i){if(i){r[_findNodeIndex(r,i)]=n}else{r[r.length++]=n}if(e){n.ownerElement=e;var o=e.ownerDocument;if(o){i&&_onRemoveAttribute(o,e,i);_onAddAttribute(o,e,n)}}}function _removeNamedNode(e,r,n){var i=_findNodeIndex(r,n);if(i>=0){var o=r.length-1;while(i<o){r[i]=r[++i]}r.length=o;if(e){var s=e.ownerDocument;if(s){_onRemoveAttribute(s,e,n);n.ownerElement=null}}}else{throw new DOMException(I,new Error(e.tagName+"@"+n))}}NamedNodeMap.prototype={length:0,item:NodeList.prototype.item,getNamedItem:function(e){var r=this.length;while(r--){var n=this[r];if(n.nodeName==e){return n}}},setNamedItem:function(e){var r=e.ownerElement;if(r&&r!=this._ownerElement){throw new DOMException(P)}var n=this.getNamedItem(e.nodeName);_addNamedNode(this._ownerElement,this,e,n);return n},setNamedItemNS:function(e){var r=e.ownerElement,n;if(r&&r!=this._ownerElement){throw new DOMException(P)}n=this.getNamedItemNS(e.namespaceURI,e.localName);_addNamedNode(this._ownerElement,this,e,n);return n},removeNamedItem:function(e){var r=this.getNamedItem(e);_removeNamedNode(this._ownerElement,this,r);return r},removeNamedItemNS:function(e,r){var n=this.getNamedItemNS(e,r);_removeNamedNode(this._ownerElement,this,n);return n},getNamedItemNS:function(e,r){var n=this.length;while(n--){var i=this[n];if(i.localName==r&&i.namespaceURI==e){return i}}return null}};function DOMImplementation(){}DOMImplementation.prototype={hasFeature:function(e,r){return true},createDocument:function(e,r,n){var i=new Document;i.implementation=this;i.childNodes=new NodeList;i.doctype=n||null;if(n){i.appendChild(n)}if(r){var o=i.createElementNS(e,r);i.appendChild(o)}return i},createDocumentType:function(e,r,n){var i=new DocumentType;i.name=e;i.nodeName=e;i.publicId=r||"";i.systemId=n||"";return i}};function Node(){}Node.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,r){return _insertBefore(this,e,r)},replaceChild:function(e,r){_insertBefore(this,e,r,assertPreReplacementValidityInDocument);if(r){this.removeChild(r)}},removeChild:function(e){return _removeChild(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return cloneNode(this.ownerDocument||this,this,e)},normalize:function(){var e=this.firstChild;while(e){var r=e.nextSibling;if(r&&r.nodeType==c&&e.nodeType==c){this.removeChild(r);e.appendData(r.data)}else{e.normalize();e=r}}},isSupported:function(e,r){return this.ownerDocument.implementation.hasFeature(e,r)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){var r=this;while(r){var n=r._nsMap;if(n){for(var i in n){if(Object.prototype.hasOwnProperty.call(n,i)&&n[i]===e){return i}}}r=r.nodeType==l?r.ownerDocument:r.parentNode}return null},lookupNamespaceURI:function(e){var r=this;while(r){var n=r._nsMap;if(n){if(Object.prototype.hasOwnProperty.call(n,e)){return n[e]}}r=r.nodeType==l?r.ownerDocument:r.parentNode}return null},isDefaultNamespace:function(e){var r=this.lookupPrefix(e);return r==null}};function _xmlEncoder(e){return e=="<"&&"&lt;"||e==">"&&"&gt;"||e=="&"&&"&amp;"||e=='"'&&"&quot;"||"&#"+e.charCodeAt()+";"}copy(a,Node);copy(a,Node.prototype);function _visitNode(e,r){if(r(e)){return true}if(e=e.firstChild){do{if(_visitNode(e,r)){return true}}while(e=e.nextSibling)}}function Document(){this.ownerDocument=this}function _onAddAttribute(e,r,n){e&&e._inc++;var i=n.namespaceURI;if(i===s.XMLNS){r._nsMap[n.prefix?n.localName:""]=n.value}}function _onRemoveAttribute(e,r,n,i){e&&e._inc++;var o=n.namespaceURI;if(o===s.XMLNS){delete r._nsMap[n.prefix?n.localName:""]}}function _onUpdateChild(e,r,n){if(e&&e._inc){e._inc++;var i=r.childNodes;if(n){i[i.length++]=n}else{var o=r.firstChild;var s=0;while(o){i[s++]=o;o=o.nextSibling}i.length=s;delete i[i.length]}}}function _removeChild(e,r){var n=r.previousSibling;var i=r.nextSibling;if(n){n.nextSibling=i}else{e.firstChild=i}if(i){i.previousSibling=n}else{e.lastChild=n}r.parentNode=null;r.previousSibling=null;r.nextSibling=null;_onUpdateChild(e.ownerDocument,e);return r}function hasValidParentNodeType(e){return e&&(e.nodeType===Node.DOCUMENT_NODE||e.nodeType===Node.DOCUMENT_FRAGMENT_NODE||e.nodeType===Node.ELEMENT_NODE)}function hasInsertableNodeType(e){return e&&(isElementNode(e)||isTextNode(e)||isDocTypeNode(e)||e.nodeType===Node.DOCUMENT_FRAGMENT_NODE||e.nodeType===Node.COMMENT_NODE||e.nodeType===Node.PROCESSING_INSTRUCTION_NODE)}function isDocTypeNode(e){return e&&e.nodeType===Node.DOCUMENT_TYPE_NODE}function isElementNode(e){return e&&e.nodeType===Node.ELEMENT_NODE}function isTextNode(e){return e&&e.nodeType===Node.TEXT_NODE}function isElementInsertionPossible(e,r){var n=e.childNodes||[];if(o(n,isElementNode)||isDocTypeNode(r)){return false}var i=o(n,isDocTypeNode);return!(r&&i&&n.indexOf(i)>n.indexOf(r))}function isElementReplacementPossible(e,r){var n=e.childNodes||[];function hasElementChildThatIsNotChild(e){return isElementNode(e)&&e!==r}if(o(n,hasElementChildThatIsNotChild)){return false}var i=o(n,isDocTypeNode);return!(r&&i&&n.indexOf(i)>n.indexOf(r))}function assertPreInsertionValidity1to5(e,r,n){if(!hasValidParentNodeType(e)){throw new DOMException(D,"Unexpected parent node type "+e.nodeType)}if(n&&n.parentNode!==e){throw new DOMException(I,"child not in parent")}if(!hasInsertableNodeType(r)||isDocTypeNode(r)&&e.nodeType!==Node.DOCUMENT_NODE){throw new DOMException(D,"Unexpected node type "+r.nodeType+" for parent node type "+e.nodeType)}}function assertPreInsertionValidityInDocument(e,r,n){var i=e.childNodes||[];var s=r.childNodes||[];if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var a=s.filter(isElementNode);if(a.length>1||o(s,isTextNode)){throw new DOMException(D,"More than one element or text in fragment")}if(a.length===1&&!isElementInsertionPossible(e,n)){throw new DOMException(D,"Element in fragment can not be inserted before doctype")}}if(isElementNode(r)){if(!isElementInsertionPossible(e,n)){throw new DOMException(D,"Only one element can be added and only after doctype")}}if(isDocTypeNode(r)){if(o(i,isDocTypeNode)){throw new DOMException(D,"Only one doctype is allowed")}var u=o(i,isElementNode);if(n&&i.indexOf(u)<i.indexOf(n)){throw new DOMException(D,"Doctype can only be inserted before an element")}if(!n&&u){throw new DOMException(D,"Doctype can not be appended since element is present")}}}function assertPreReplacementValidityInDocument(e,r,n){var i=e.childNodes||[];var s=r.childNodes||[];if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var a=s.filter(isElementNode);if(a.length>1||o(s,isTextNode)){throw new DOMException(D,"More than one element or text in fragment")}if(a.length===1&&!isElementReplacementPossible(e,n)){throw new DOMException(D,"Element in fragment can not be inserted before doctype")}}if(isElementNode(r)){if(!isElementReplacementPossible(e,n)){throw new DOMException(D,"Only one element can be added and only after doctype")}}if(isDocTypeNode(r)){function hasDoctypeChildThatIsNotChild(e){return isDocTypeNode(e)&&e!==n}if(o(i,hasDoctypeChildThatIsNotChild)){throw new DOMException(D,"Only one doctype is allowed")}var u=o(i,isElementNode);if(n&&i.indexOf(u)<i.indexOf(n)){throw new DOMException(D,"Doctype can only be inserted before an element")}}}function _insertBefore(e,r,n,i){assertPreInsertionValidity1to5(e,r,n);if(e.nodeType===Node.DOCUMENT_NODE){(i||assertPreInsertionValidityInDocument)(e,r,n)}var o=r.parentNode;if(o){o.removeChild(r)}if(r.nodeType===w){var s=r.firstChild;if(s==null){return r}var a=r.lastChild}else{s=a=r}var u=n?n.previousSibling:e.lastChild;s.previousSibling=u;a.nextSibling=n;if(u){u.nextSibling=s}else{e.firstChild=s}if(n==null){e.lastChild=a}else{n.previousSibling=a}do{s.parentNode=e}while(s!==a&&(s=s.nextSibling));_onUpdateChild(e.ownerDocument||e,e);if(r.nodeType==w){r.firstChild=r.lastChild=null}return r}function _appendSingleChild(e,r){if(r.parentNode){r.parentNode.removeChild(r)}r.parentNode=e;r.previousSibling=e.lastChild;r.nextSibling=null;if(r.previousSibling){r.previousSibling.nextSibling=r}else{e.firstChild=r}e.lastChild=r;_onUpdateChild(e.ownerDocument,e,r);return r}Document.prototype={nodeName:"#document",nodeType:g,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,r){if(e.nodeType==w){var n=e.firstChild;while(n){var i=n.nextSibling;this.insertBefore(n,r);n=i}return e}_insertBefore(this,e,r);e.ownerDocument=this;if(this.documentElement===null&&e.nodeType===u){this.documentElement=e}return e},removeChild:function(e){if(this.documentElement==e){this.documentElement=null}return _removeChild(this,e)},replaceChild:function(e,r){_insertBefore(this,e,r,assertPreReplacementValidityInDocument);e.ownerDocument=this;if(r){this.removeChild(r)}if(isElementNode(e)){this.documentElement=e}},importNode:function(e,r){return importNode(this,e,r)},getElementById:function(e){var r=null;_visitNode(this.documentElement,(function(n){if(n.nodeType==u){if(n.getAttribute("id")==e){r=n;return true}}}));return r},getElementsByClassName:function(e){var r=toOrderedSet(e);return new LiveNodeList(this,(function(n){var i=[];if(r.length>0){_visitNode(n.documentElement,(function(o){if(o!==n&&o.nodeType===u){var s=o.getAttribute("class");if(s){var a=e===s;if(!a){var l=toOrderedSet(s);a=r.every(arrayIncludes(l))}if(a){i.push(o)}}}}))}return i}))},createElement:function(e){var r=new Element;r.ownerDocument=this;r.nodeName=e;r.tagName=e;r.localName=e;r.childNodes=new NodeList;var n=r.attributes=new NamedNodeMap;n._ownerElement=r;return r},createDocumentFragment:function(){var e=new DocumentFragment;e.ownerDocument=this;e.childNodes=new NodeList;return e},createTextNode:function(e){var r=new Text;r.ownerDocument=this;r.appendData(e);return r},createComment:function(e){var r=new Comment;r.ownerDocument=this;r.appendData(e);return r},createCDATASection:function(e){var r=new CDATASection;r.ownerDocument=this;r.appendData(e);return r},createProcessingInstruction:function(e,r){var n=new ProcessingInstruction;n.ownerDocument=this;n.tagName=n.nodeName=n.target=e;n.nodeValue=n.data=r;return n},createAttribute:function(e){var r=new Attr;r.ownerDocument=this;r.name=e;r.nodeName=e;r.localName=e;r.specified=true;return r},createEntityReference:function(e){var r=new EntityReference;r.ownerDocument=this;r.nodeName=e;return r},createElementNS:function(e,r){var n=new Element;var i=r.split(":");var o=n.attributes=new NamedNodeMap;n.childNodes=new NodeList;n.ownerDocument=this;n.nodeName=r;n.tagName=r;n.namespaceURI=e;if(i.length==2){n.prefix=i[0];n.localName=i[1]}else{n.localName=r}o._ownerElement=n;return n},createAttributeNS:function(e,r){var n=new Attr;var i=r.split(":");n.ownerDocument=this;n.nodeName=r;n.name=r;n.namespaceURI=e;n.specified=true;if(i.length==2){n.prefix=i[0];n.localName=i[1]}else{n.localName=r}return n}};_extends(Document,Node);function Element(){this._nsMap={}}Element.prototype={nodeType:u,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var r=this.getAttributeNode(e);return r&&r.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,r){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+r;this.setAttributeNode(n)},removeAttribute:function(e){var r=this.getAttributeNode(e);r&&this.removeAttributeNode(r)},appendChild:function(e){if(e.nodeType===w){return this.insertBefore(e,null)}else{return _appendSingleChild(this,e)}},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,r){var n=this.getAttributeNodeNS(e,r);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,r){return this.getAttributeNodeNS(e,r)!=null},getAttributeNS:function(e,r){var n=this.getAttributeNodeNS(e,r);return n&&n.value||""},setAttributeNS:function(e,r,n){var i=this.ownerDocument.createAttributeNS(e,r);i.value=i.nodeValue=""+n;this.setAttributeNode(i)},getAttributeNodeNS:function(e,r){return this.attributes.getNamedItemNS(e,r)},getElementsByTagName:function(e){return new LiveNodeList(this,(function(r){var n=[];_visitNode(r,(function(i){if(i!==r&&i.nodeType==u&&(e==="*"||i.tagName==e)){n.push(i)}}));return n}))},getElementsByTagNameNS:function(e,r){return new LiveNodeList(this,(function(n){var i=[];_visitNode(n,(function(o){if(o!==n&&o.nodeType===u&&(e==="*"||o.namespaceURI===e)&&(r==="*"||o.localName==r)){i.push(o)}}));return i}))}};Document.prototype.getElementsByTagName=Element.prototype.getElementsByTagName;Document.prototype.getElementsByTagNameNS=Element.prototype.getElementsByTagNameNS;_extends(Element,Node);function Attr(){}Attr.prototype.nodeType=l;_extends(Attr,Node);function CharacterData(){}CharacterData.prototype={data:"",substringData:function(e,r){return this.data.substring(e,e+r)},appendData:function(e){e=this.data+e;this.nodeValue=this.data=e;this.length=e.length},insertData:function(e,r){this.replaceData(e,0,r)},appendChild:function(e){throw new Error(N[D])},deleteData:function(e,r){this.replaceData(e,r,"")},replaceData:function(e,r,n){var i=this.data.substring(0,e);var o=this.data.substring(e+r);n=i+n+o;this.nodeValue=this.data=n;this.length=n.length}};_extends(CharacterData,Node);function Text(){}Text.prototype={nodeName:"#text",nodeType:c,splitText:function(e){var r=this.data;var n=r.substring(e);r=r.substring(0,e);this.data=this.nodeValue=r;this.length=r.length;var i=this.ownerDocument.createTextNode(n);if(this.parentNode){this.parentNode.insertBefore(i,this.nextSibling)}return i}};_extends(Text,CharacterData);function Comment(){}Comment.prototype={nodeName:"#comment",nodeType:m};_extends(Comment,CharacterData);function CDATASection(){}CDATASection.prototype={nodeName:"#cdata-section",nodeType:p};_extends(CDATASection,CharacterData);function DocumentType(){}DocumentType.prototype.nodeType=y;_extends(DocumentType,Node);function Notation(){}Notation.prototype.nodeType=v;_extends(Notation,Node);function Entity(){}Entity.prototype.nodeType=f;_extends(Entity,Node);function EntityReference(){}EntityReference.prototype.nodeType=h;_extends(EntityReference,Node);function DocumentFragment(){}DocumentFragment.prototype.nodeName="#document-fragment";DocumentFragment.prototype.nodeType=w;_extends(DocumentFragment,Node);function ProcessingInstruction(){}ProcessingInstruction.prototype.nodeType=d;_extends(ProcessingInstruction,Node);function XMLSerializer(){}XMLSerializer.prototype.serializeToString=function(e,r,n){return nodeSerializeToString.call(e,r,n)};Node.prototype.toString=nodeSerializeToString;function nodeSerializeToString(e,r){var n=[];var i=this.nodeType==9&&this.documentElement||this;var o=i.prefix;var s=i.namespaceURI;if(s&&o==null){var o=i.lookupPrefix(s);if(o==null){var a=[{namespace:s,prefix:null}]}}serializeToString(this,n,e,r,a);return n.join("")}function needNamespaceDefine(e,r,n){var i=e.prefix||"";var o=e.namespaceURI;if(!o){return false}if(i==="xml"&&o===s.XML||o===s.XMLNS){return false}var a=n.length;while(a--){var u=n[a];if(u.prefix===i){return u.namespace!==o}}return true}function addSerializedAttribute(e,r,n){e.push(" ",r,'="',n.replace(/[<>&"\t\n\r]/g,_xmlEncoder),'"')}function serializeToString(e,r,n,i,o){if(!o){o=[]}if(i){e=i(e);if(e){if(typeof e=="string"){r.push(e);return}}else{return}}switch(e.nodeType){case u:var a=e.attributes;var f=a.length;var v=e.firstChild;var b=e.tagName;n=s.isHTML(e.namespaceURI)||n;var N=b;if(!n&&!e.prefix&&e.namespaceURI){var E;for(var T=0;T<a.length;T++){if(a.item(T).name==="xmlns"){E=a.item(T).value;break}}if(!E){for(var D=o.length-1;D>=0;D--){var S=o[D];if(S.prefix===""&&S.namespace===e.namespaceURI){E=S.namespace;break}}}if(E!==e.namespaceURI){for(var D=o.length-1;D>=0;D--){var S=o[D];if(S.namespace===e.namespaceURI){if(S.prefix){N=S.prefix+":"+b}break}}}}r.push("<",N);for(var A=0;A<f;A++){var O=a.item(A);if(O.prefix=="xmlns"){o.push({prefix:O.localName,namespace:O.value})}else if(O.nodeName=="xmlns"){o.push({prefix:"",namespace:O.value})}}for(var A=0;A<f;A++){var O=a.item(A);if(needNamespaceDefine(O,n,o)){var x=O.prefix||"";var I=O.namespaceURI;addSerializedAttribute(r,x?"xmlns:"+x:"xmlns",I);o.push({prefix:x,namespace:I})}serializeToString(O,r,n,i,o)}if(b===N&&needNamespaceDefine(e,n,o)){var x=e.prefix||"";var I=e.namespaceURI;addSerializedAttribute(r,x?"xmlns:"+x:"xmlns",I);o.push({prefix:x,namespace:I})}if(v||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(b)){r.push(">");if(n&&/^script$/i.test(b)){while(v){if(v.data){r.push(v.data)}else{serializeToString(v,r,n,i,o.slice())}v=v.nextSibling}}else{while(v){serializeToString(v,r,n,i,o.slice());v=v.nextSibling}}r.push("</",N,">")}else{r.push("/>")}return;case g:case w:var v=e.firstChild;while(v){serializeToString(v,r,n,i,o.slice());v=v.nextSibling}return;case l:return addSerializedAttribute(r,e.name,e.value);case c:return r.push(e.data.replace(/[<&>]/g,_xmlEncoder));case p:return r.push("<![CDATA[",e.data,"]]>");case m:return r.push("\x3c!--",e.data,"--\x3e");case y:var L=e.publicId;var P=e.systemId;r.push("<!DOCTYPE ",e.name);if(L){r.push(" PUBLIC ",L);if(P&&P!="."){r.push(" ",P)}r.push(">")}else if(P&&P!="."){r.push(" SYSTEM ",P,">")}else{var C=e.internalSubset;if(C){r.push(" [",C,"]")}r.push(">")}return;case d:return r.push("<?",e.target," ",e.data,"?>");case h:return r.push("&",e.nodeName,";");default:r.push("??",e.nodeName)}}function importNode(e,r,n){var i;switch(r.nodeType){case u:i=r.cloneNode(false);i.ownerDocument=e;case w:break;case l:n=true;break}if(!i){i=r.cloneNode(false)}i.ownerDocument=e;i.parentNode=null;if(n){var o=r.firstChild;while(o){i.appendChild(importNode(e,o,n));o=o.nextSibling}}return i}function cloneNode(e,r,n){var i=new r.constructor;for(var o in r){if(Object.prototype.hasOwnProperty.call(r,o)){var s=r[o];if(typeof s!="object"){if(s!=i[o]){i[o]=s}}}}if(r.childNodes){i.childNodes=new NodeList}i.ownerDocument=e;switch(i.nodeType){case u:var a=r.attributes;var c=i.attributes=new NamedNodeMap;var p=a.length;c._ownerElement=i;for(var h=0;h<p;h++){i.setAttributeNode(cloneNode(e,a.item(h),true))}break;case l:n=true}if(n){var f=r.firstChild;while(f){i.appendChild(cloneNode(e,f,n));f=f.nextSibling}}return i}function __set__(e,r,n){e[r]=n}try{if(Object.defineProperty){Object.defineProperty(LiveNodeList.prototype,"length",{get:function(){_updateLiveList(this);return this.$$length}});Object.defineProperty(Node.prototype,"textContent",{get:function(){return getTextContent(this)},set:function(e){switch(this.nodeType){case u:case w:while(this.firstChild){this.removeChild(this.firstChild)}if(e||String(e)){this.appendChild(this.ownerDocument.createTextNode(e))}break;default:this.data=e;this.value=e;this.nodeValue=e}}});function getTextContent(e){switch(e.nodeType){case u:case w:var r=[];e=e.firstChild;while(e){if(e.nodeType!==7&&e.nodeType!==8){r.push(getTextContent(e))}e=e.nextSibling}return r.join("");default:return e.nodeValue}}__set__=function(e,r,n){e["$$"+r]=n}}}catch(B){}r.DocumentType=DocumentType;r.DOMException=DOMException;r.DOMImplementation=DOMImplementation;r.Element=Element;r.Node=Node;r.NodeList=NodeList;r.XMLSerializer=XMLSerializer},1510:function(e,r,n){"use strict";var i=n(5741).freeze;r.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});r.HTML_ENTITIES=i({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"});r.entityMap=r.HTML_ENTITIES},8737:function(e,r,n){var i=n(6537);r.DOMImplementation=i.DOMImplementation;r.XMLSerializer=i.XMLSerializer;r.DOMParser=n(6425).DOMParser},8197:function(e,r,n){var i=n(5741).NAMESPACE;var o=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var s=new RegExp("[\\-\\.0-9"+o.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");var a=new RegExp("^"+o.source+s.source+"*(?::"+o.source+s.source+"*)?$");var u=0;var l=1;var c=2;var p=3;var h=4;var f=5;var d=6;var m=7;function ParseError(e,r){this.message=e;this.locator=r;if(Error.captureStackTrace)Error.captureStackTrace(this,ParseError)}ParseError.prototype=new Error;ParseError.prototype.name=ParseError.name;function XMLReader(){}XMLReader.prototype={parse:function(e,r,n){var i=this.domBuilder;i.startDocument();_copy(r,r={});parse(e,r,n,i,this.errorHandler);i.endDocument()}};function parse(e,r,n,o,s){function fixedFromCharCode(e){if(e>65535){e-=65536;var r=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(r,n)}else{return String.fromCharCode(e)}}function entityReplacer(e){var r=e.slice(1,-1);if(Object.hasOwnProperty.call(n,r)){return n[r]}else if(r.charAt(0)==="#"){return fixedFromCharCode(parseInt(r.substr(1).replace("x","0x")))}else{s.error("entity not found:"+e);return e}}function appendText(r){if(r>f){var n=e.substring(f,r).replace(/&#?\w+;/g,entityReplacer);c&&position(f);o.characters(n,0,r-f);f=r}}function position(r,n){while(r>=u&&(n=l.exec(e))){a=n.index;u=a+n[0].length;c.lineNumber++}c.columnNumber=r-a+1}var a=0;var u=0;var l=/.*(?:\r\n?|\n)|.*$/g;var c=o.locator;var p=[{currentNSMap:r}];var h={};var f=0;while(true){try{var d=e.indexOf("<",f);if(d<0){if(!e.substr(f).match(/^\s*$/)){var m=o.doc;var g=m.createTextNode(e.substr(f));m.appendChild(g);o.currentElement=g}return}if(d>f){appendText(d)}switch(e.charAt(d+1)){case"/":var y=e.indexOf(">",d+3);var w=e.substring(d+2,y).replace(/[ \t\n\r]+$/g,"");var v=p.pop();if(y<0){w=e.substring(d+2).replace(/[\s<].*/,"");s.error("end tag name: "+w+" is not complete:"+v.tagName);y=d+1+w.length}else if(w.match(/\s</)){w=w.replace(/[\s<].*/,"");s.error("end tag name: "+w+" maybe not complete");y=d+1+w.length}var b=v.localNSMap;var N=v.tagName==w;var E=N||v.tagName&&v.tagName.toLowerCase()==w.toLowerCase();if(E){o.endElement(v.uri,v.localName,w);if(b){for(var T in b){if(Object.prototype.hasOwnProperty.call(b,T)){o.endPrefixMapping(T)}}}if(!N){s.fatalError("end tag name: "+w+" is not match the current start tagName:"+v.tagName)}}else{p.push(v)}y++;break;case"?":c&&position(d);y=parseInstruction(e,d,o);break;case"!":c&&position(d);y=parseDCC(e,d,o,s);break;default:c&&position(d);var D=new ElementAttributes;var S=p[p.length-1].currentNSMap;var y=parseElementStartPart(e,d,D,S,entityReplacer,s);var A=D.length;if(!D.closed&&fixSelfClosed(e,y,D.tagName,h)){D.closed=true;if(!n.nbsp){s.warning("unclosed xml attribute")}}if(c&&A){var O=copyLocator(c,{});for(var x=0;x<A;x++){var I=D[x];position(I.offset);I.locator=copyLocator(c,{})}o.locator=O;if(appendElement(D,o,S)){p.push(D)}o.locator=c}else{if(appendElement(D,o,S)){p.push(D)}}if(i.isHTML(D.uri)&&!D.closed){y=parseHtmlSpecialContent(e,y,D.tagName,entityReplacer,o)}else{y++}}}catch(e){if(e instanceof ParseError){throw e}s.error("element parse error: "+e);y=-1}if(y>f){f=y}else{appendText(Math.max(d,f)+1)}}}function copyLocator(e,r){r.lineNumber=e.lineNumber;r.columnNumber=e.columnNumber;return r}function parseElementStartPart(e,r,n,o,s,a){function addAttribute(e,r,i){if(n.attributeNames.hasOwnProperty(e)){a.fatalError("Attribute "+e+" redefined")}n.addValue(e,r.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),i)}var g;var y;var w=++r;var v=u;while(true){var b=e.charAt(w);switch(b){case"=":if(v===l){g=e.slice(r,w);v=p}else if(v===c){v=p}else{throw new Error("attribute equal must after attrName")}break;case"'":case'"':if(v===p||v===l){if(v===l){a.warning('attribute value must after "="');g=e.slice(r,w)}r=w+1;w=e.indexOf(b,r);if(w>0){y=e.slice(r,w);addAttribute(g,y,r-1);v=f}else{throw new Error("attribute value no end '"+b+"' match")}}else if(v==h){y=e.slice(r,w);addAttribute(g,y,r);a.warning('attribute "'+g+'" missed start quot('+b+")!!");r=w+1;v=f}else{throw new Error('attribute value must after "="')}break;case"/":switch(v){case u:n.setTagName(e.slice(r,w));case f:case d:case m:v=m;n.closed=true;case h:case l:break;case c:n.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case"":a.error("unexpected end of input");if(v==u){n.setTagName(e.slice(r,w))}return w;case">":switch(v){case u:n.setTagName(e.slice(r,w));case f:case d:case m:break;case h:case l:y=e.slice(r,w);if(y.slice(-1)==="/"){n.closed=true;y=y.slice(0,-1)}case c:if(v===c){y=g}if(v==h){a.warning('attribute "'+y+'" missed quot(")!');addAttribute(g,y,r)}else{if(!i.isHTML(o[""])||!y.match(/^(?:disabled|checked|selected)$/i)){a.warning('attribute "'+y+'" missed value!! "'+y+'" instead!!')}addAttribute(y,y,r)}break;case p:throw new Error("attribute value missed!!")}return w;case"€":b=" ";default:if(b<=" "){switch(v){case u:n.setTagName(e.slice(r,w));v=d;break;case l:g=e.slice(r,w);v=c;break;case h:var y=e.slice(r,w);a.warning('attribute "'+y+'" missed quot(")!!');addAttribute(g,y,r);case f:v=d;break}}else{switch(v){case c:var N=n.tagName;if(!i.isHTML(o[""])||!g.match(/^(?:disabled|checked|selected)$/i)){a.warning('attribute "'+g+'" missed value!! "'+g+'" instead2!!')}addAttribute(g,g,r);r=w;v=l;break;case f:a.warning('attribute space is required"'+g+'"!!');case d:v=l;r=w;break;case p:v=h;r=w;break;case m:throw new Error("elements closed character '/' and '>' must be connected to")}}}w++}}function appendElement(e,r,n){var o=e.tagName;var s=null;var a=e.length;while(a--){var u=e[a];var l=u.qName;var c=u.value;var p=l.indexOf(":");if(p>0){var h=u.prefix=l.slice(0,p);var f=l.slice(p+1);var d=h==="xmlns"&&f}else{f=l;h=null;d=l==="xmlns"&&""}u.localName=f;if(d!==false){if(s==null){s={};_copy(n,n={})}n[d]=s[d]=c;u.uri=i.XMLNS;r.startPrefixMapping(d,c)}}var a=e.length;while(a--){u=e[a];var h=u.prefix;if(h){if(h==="xml"){u.uri=i.XML}if(h!=="xmlns"){u.uri=n[h||""]}}}var p=o.indexOf(":");if(p>0){h=e.prefix=o.slice(0,p);f=e.localName=o.slice(p+1)}else{h=null;f=e.localName=o}var m=e.uri=n[h||""];r.startElement(m,f,o,e);if(e.closed){r.endElement(m,f,o);if(s){for(h in s){if(Object.prototype.hasOwnProperty.call(s,h)){r.endPrefixMapping(h)}}}}else{e.currentNSMap=n;e.localNSMap=s;return true}}function parseHtmlSpecialContent(e,r,n,i,o){if(/^(?:script|textarea)$/i.test(n)){var s=e.indexOf("</"+n+">",r);var a=e.substring(r+1,s);if(/[&<]/.test(a)){if(/^script$/i.test(n)){o.characters(a,0,a.length);return s}a=a.replace(/&#?\w+;/g,i);o.characters(a,0,a.length);return s}}return r+1}function fixSelfClosed(e,r,n,i){var o=i[n];if(o==null){o=e.lastIndexOf("</"+n+">");if(o<r){o=e.lastIndexOf("</"+n)}i[n]=o}return o<r}function _copy(e,r){for(var n in e){if(Object.prototype.hasOwnProperty.call(e,n)){r[n]=e[n]}}}function parseDCC(e,r,n,i){var o=e.charAt(r+2);switch(o){case"-":if(e.charAt(r+3)==="-"){var s=e.indexOf("--\x3e",r+4);if(s>r){n.comment(e,r+4,s-r-4);return s+3}else{i.error("Unclosed comment");return-1}}else{return-1}default:if(e.substr(r+3,6)=="CDATA["){var s=e.indexOf("]]>",r+9);n.startCDATA();n.characters(e,r+9,s-r-9);n.endCDATA();return s+3}var a=split(e,r);var u=a.length;if(u>1&&/!doctype/i.test(a[0][0])){var l=a[1][0];var c=false;var p=false;if(u>3){if(/^public$/i.test(a[2][0])){c=a[3][0];p=u>4&&a[4][0]}else if(/^system$/i.test(a[2][0])){p=a[3][0]}}var h=a[u-1];n.startDTD(l,c,p);n.endDTD();return h.index+h[0].length}}return-1}function parseInstruction(e,r,n){var i=e.indexOf("?>",r);if(i){var o=e.substring(r,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(o){var s=o[0].length;n.processingInstruction(o[1],o[2]);return i+2}else{return-1}}return-1}function ElementAttributes(){this.attributeNames={}}ElementAttributes.prototype={setTagName:function(e){if(!a.test(e)){throw new Error("invalid tagName:"+e)}this.tagName=e},addValue:function(e,r,n){if(!a.test(e)){throw new Error("invalid attribute:"+e)}this.attributeNames[e]=this.length;this[this.length++]={qName:e,value:r,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function split(e,r){var n;var i=[];var o=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;o.lastIndex=r;o.exec(e);while(n=o.exec(e)){i.push(n);if(n[1])return i}}r.XMLReader=XMLReader;r.ParseError=ParseError},8121:function(e,r,n){r.formatArgs=formatArgs;r.save=save;r.load=load;r.useColors=useColors;r.storage=localstorage();r.destroy=(()=>{let e=false;return()=>{if(!e){e=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();r.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}let e;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(r){r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff);if(!this.useColors){return}const n="color: "+this.color;r.splice(1,0,n,"color: inherit");let i=0;let o=0;r[0].replace(/%[a-zA-Z%]/g,(e=>{if(e==="%%"){return}i++;if(e==="%c"){o=i}}));r.splice(o,0,n)}r.log=console.debug||console.log||(()=>{});function save(e){try{if(e){r.storage.setItem("debug",e)}else{r.storage.removeItem("debug")}}catch(e){}}function load(){let e;try{e=r.storage.getItem("debug")}catch(e){}if(!e&&typeof process!=="undefined"&&"env"in process){e=process.env.DEBUG}return e}function localstorage(){try{return localStorage}catch(e){}}e.exports=n(6192)(r);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},6192:function(e,r,n){function setup(e){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=n(2134);createDebug.destroy=destroy;Object.keys(e).forEach((r=>{createDebug[r]=e[r]}));createDebug.names=[];createDebug.skips=[];createDebug.formatters={};function selectColor(e){let r=0;for(let n=0;n<e.length;n++){r=(r<<5)-r+e.charCodeAt(n);r|=0}return createDebug.colors[Math.abs(r)%createDebug.colors.length]}createDebug.selectColor=selectColor;function createDebug(e){let r;let n=null;let i;let o;function debug(...e){if(!debug.enabled){return}const n=debug;const i=Number(new Date);const o=i-(r||i);n.diff=o;n.prev=r;n.curr=i;r=i;e[0]=createDebug.coerce(e[0]);if(typeof e[0]!=="string"){e.unshift("%O")}let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if(r==="%%"){return"%"}s++;const o=createDebug.formatters[i];if(typeof o==="function"){const i=e[s];r=o.call(n,i);e.splice(s,1);s--}return r}));createDebug.formatArgs.call(n,e);const a=n.log||createDebug.log;a.apply(n,e)}debug.namespace=e;debug.useColors=createDebug.useColors();debug.color=createDebug.selectColor(e);debug.extend=extend;debug.destroy=createDebug.destroy;Object.defineProperty(debug,"enabled",{enumerable:true,configurable:false,get:()=>{if(n!==null){return n}if(i!==createDebug.namespaces){i=createDebug.namespaces;o=createDebug.enabled(e)}return o},set:e=>{n=e}});if(typeof createDebug.init==="function"){createDebug.init(debug)}return debug}function extend(e,r){const n=createDebug(this.namespace+(typeof r==="undefined"?":":r)+e);n.log=this.log;return n}function enable(e){createDebug.save(e);createDebug.namespaces=e;createDebug.names=[];createDebug.skips=[];let r;const n=(typeof e==="string"?e:"").split(/[\s,]+/);const i=n.length;for(r=0;r<i;r++){if(!n[r]){continue}e=n[r].replace(/\*/g,".*?");if(e[0]==="-"){createDebug.skips.push(new RegExp("^"+e.slice(1)+"$"))}else{createDebug.names.push(new RegExp("^"+e+"$"))}}}function disable(){const e=[...createDebug.names.map(toNamespace),...createDebug.skips.map(toNamespace).map((e=>"-"+e))].join(",");createDebug.enable("");return e}function enabled(e){if(e[e.length-1]==="*"){return true}let r;let n;for(r=0,n=createDebug.skips.length;r<n;r++){if(createDebug.skips[r].test(e)){return false}}for(r=0,n=createDebug.names.length;r<n;r++){if(createDebug.names[r].test(e)){return true}}return false}function toNamespace(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}function coerce(e){if(e instanceof Error){return e.stack||e.message}return e}function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}createDebug.enable(createDebug.load());return createDebug}e.exports=setup},8441:function(e,r,n){if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){e.exports=n(8121)}else{e.exports=n(3537)}},3537:function(e,r,n){const i=n(2018);const o=n(9023);r.init=init;r.log=log;r.formatArgs=formatArgs;r.save=save;r.load=load;r.useColors=useColors;r.destroy=o.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");r.colors=[6,2,3,4,5,1];try{const e=n(5414);if(e&&(e.stderr||e).level>=2){r.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}}catch(e){}r.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,r)=>{const n=r.substring(6).toLowerCase().replace(/_([a-z])/g,((e,r)=>r.toUpperCase()));let i=process.env[r];if(/^(yes|on|true|enabled)$/i.test(i)){i=true}else if(/^(no|off|false|disabled)$/i.test(i)){i=false}else if(i==="null"){i=null}else{i=Number(i)}e[n]=i;return e}),{});function useColors(){return"colors"in r.inspectOpts?Boolean(r.inspectOpts.colors):i.isatty(process.stderr.fd)}function formatArgs(r){const{namespace:n,useColors:i}=this;if(i){const i=this.color;const o="[3"+(i<8?i:"8;5;"+i);const s=` ${o};1m${n} `;r[0]=s+r[0].split("\n").join("\n"+s);r.push(o+"m+"+e.exports.humanize(this.diff)+"")}else{r[0]=getDate()+n+" "+r[0]}}function getDate(){if(r.inspectOpts.hideDate){return""}return(new Date).toISOString()+" "}function log(...e){return process.stderr.write(o.formatWithOptions(r.inspectOpts,...e)+"\n")}function save(e){if(e){process.env.DEBUG=e}else{delete process.env.DEBUG}}function load(){return process.env.DEBUG}function init(e){e.inspectOpts={};const n=Object.keys(r.inspectOpts);for(let i=0;i<n.length;i++){e.inspectOpts[n[i]]=r.inspectOpts[n[i]]}}e.exports=n(6192)(r);const{formatters:s}=e.exports;s.o=function(e){this.inspectOpts.colors=this.useColors;return o.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")};s.O=function(e){this.inspectOpts.colors=this.useColors;return o.inspect(e,this.inspectOpts)}},846:function(e){"use strict";
2
+ /*!
3
+ * escape-html
4
+ * Copyright(c) 2012-2013 TJ Holowaychuk
5
+ * Copyright(c) 2015 Andreas Lubbe
6
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
7
+ * MIT Licensed
8
+ */var r=/["'&<>]/;e.exports=escapeHtml;function escapeHtml(e){var n=""+e;var i=r.exec(n);if(!i){return n}var o;var s="";var a=0;var u=0;for(a=i.index;a<n.length;a++){switch(n.charCodeAt(a)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 39:o="&#39;";break;case 60:o="&lt;";break;case 62:o="&gt;";break;default:continue}if(u!==a){s+=n.substring(u,a)}u=a+1;s+=o}return u!==a?s+n.substring(u,a):s}},2871:function(e){"use strict";e.exports=(e,r)=>{r=r||process.argv;const n=e.startsWith("-")?"":e.length===1?"-":"--";const i=r.indexOf(n+e);const o=r.indexOf("--");return i!==-1&&(o===-1?true:i<o)}},2134:function(e){var r=1e3;var n=r*60;var i=n*60;var o=i*24;var s=o*7;var a=o*365.25;e.exports=function(e,r){r=r||{};var n=typeof e;if(n==="string"&&e.length>0){return parse(e)}else if(n==="number"&&isFinite(e)){return r.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!u){return}var l=parseFloat(u[1]);var c=(u[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return l*a;case"weeks":case"week":case"w":return l*s;case"days":case"day":case"d":return l*o;case"hours":case"hour":case"hrs":case"hr":case"h":return l*i;case"minutes":case"minute":case"mins":case"min":case"m":return l*n;case"seconds":case"second":case"secs":case"sec":case"s":return l*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return undefined}}function fmtShort(e){var s=Math.abs(e);if(s>=o){return Math.round(e/o)+"d"}if(s>=i){return Math.round(e/i)+"h"}if(s>=n){return Math.round(e/n)+"m"}if(s>=r){return Math.round(e/r)+"s"}return e+"ms"}function fmtLong(e){var s=Math.abs(e);if(s>=o){return plural(e,s,o,"day")}if(s>=i){return plural(e,s,i,"hour")}if(s>=n){return plural(e,s,n,"minute")}if(s>=r){return plural(e,s,r,"second")}return e+" ms"}function plural(e,r,n,i){var o=r>=n*1.5;return Math.round(e/n)+" "+i+(o?"s":"")}},6426:function(e,r,n){(function(e){e.parser=function(e,r){return new SAXParser(e,r)};e.SAXParser=SAXParser;e.SAXStream=SAXStream;e.createStream=createStream;e.MAX_BUFFER_LENGTH=64*1024;var r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function SAXParser(r,n){if(!(this instanceof SAXParser)){return new SAXParser(r,n)}var i=this;clearBuffers(i);i.q=i.c="";i.bufferCheckPosition=e.MAX_BUFFER_LENGTH;i.opt=n||{};i.opt.lowercase=i.opt.lowercase||i.opt.lowercasetags;i.looseCase=i.opt.lowercase?"toLowerCase":"toUpperCase";i.tags=[];i.closed=i.closedRoot=i.sawRoot=false;i.tag=i.error=null;i.strict=!!r;i.noscript=!!(r||i.opt.noscript);i.state=m.BEGIN;i.strictEntities=i.opt.strictEntities;i.ENTITIES=i.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES);i.attribList=[];if(i.opt.xmlns){i.ns=Object.create(c)}if(i.opt.unquotedAttributeValues===undefined){i.opt.unquotedAttributeValues=!r}i.trackPosition=i.opt.position!==false;if(i.trackPosition){i.position=i.line=i.column=0}emit(i,"onready")}if(!Object.create){Object.create=function(e){function F(){}F.prototype=e;var r=new F;return r}}if(!Object.keys){Object.keys=function(e){var r=[];for(var n in e)if(e.hasOwnProperty(n))r.push(n);return r}}function checkBufferLength(n){var i=Math.max(e.MAX_BUFFER_LENGTH,10);var o=0;for(var s=0,a=r.length;s<a;s++){var u=n[r[s]].length;if(u>i){switch(r[s]){case"textNode":closeText(n);break;case"cdata":emitNode(n,"oncdata",n.cdata);n.cdata="";break;case"script":emitNode(n,"onscript",n.script);n.script="";break;default:error(n,"Max buffer length exceeded: "+r[s])}}o=Math.max(o,u)}var l=e.MAX_BUFFER_LENGTH-o;n.bufferCheckPosition=l+n.position}function clearBuffers(e){for(var n=0,i=r.length;n<i;n++){e[r[n]]=""}}function flushBuffers(e){closeText(e);if(e.cdata!==""){emitNode(e,"oncdata",e.cdata);e.cdata=""}if(e.script!==""){emitNode(e,"onscript",e.script);e.script=""}}SAXParser.prototype={end:function(){end(this)},write:write,resume:function(){this.error=null;return this},close:function(){return this.write(null)},flush:function(){flushBuffers(this)}};var i;try{i=n(2203).Stream}catch(e){i=function(){}}if(!i)i=function(){};var o=e.EVENTS.filter((function(e){return e!=="error"&&e!=="end"}));function createStream(e,r){return new SAXStream(e,r)}function SAXStream(e,r){if(!(this instanceof SAXStream)){return new SAXStream(e,r)}i.apply(this);this._parser=new SAXParser(e,r);this.writable=true;this.readable=true;var n=this;this._parser.onend=function(){n.emit("end")};this._parser.onerror=function(e){n.emit("error",e);n._parser.error=null};this._decoder=null;o.forEach((function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(r){if(!r){n.removeAllListeners(e);n._parser["on"+e]=r;return r}n.on(e,r)},enumerable:true,configurable:false})}))}SAXStream.prototype=Object.create(i.prototype,{constructor:{value:SAXStream}});SAXStream.prototype.write=function(e){if(typeof Buffer==="function"&&typeof Buffer.isBuffer==="function"&&Buffer.isBuffer(e)){if(!this._decoder){var r=n(3193).StringDecoder;this._decoder=new r("utf8")}e=this._decoder.write(e)}this._parser.write(e.toString());this.emit("data",e);return true};SAXStream.prototype.end=function(e){if(e&&e.length){this.write(e)}this._parser.end();return true};SAXStream.prototype.on=function(e,r){var n=this;if(!n._parser["on"+e]&&o.indexOf(e)!==-1){n._parser["on"+e]=function(){var r=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);r.splice(0,0,e);n.emit.apply(n,r)}}return i.prototype.on.call(n,e,r)};var s="[CDATA[";var a="DOCTYPE";var u="http://www.w3.org/XML/1998/namespace";var l="http://www.w3.org/2000/xmlns/";var c={xml:u,xmlns:l};var p=/[:_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]/;var 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-]/;var f=/[#:_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]/;var 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-]/;function isWhitespace(e){return e===" "||e==="\n"||e==="\r"||e==="\t"}function isQuote(e){return e==='"'||e==="'"}function isAttribEnd(e){return e===">"||isWhitespace(e)}function isMatch(e,r){return e.test(r)}function notMatch(e,r){return!isMatch(e,r)}var m=0;e.STATE={BEGIN:m++,BEGIN_WHITESPACE:m++,TEXT:m++,TEXT_ENTITY:m++,OPEN_WAKA:m++,SGML_DECL:m++,SGML_DECL_QUOTED:m++,DOCTYPE:m++,DOCTYPE_QUOTED:m++,DOCTYPE_DTD:m++,DOCTYPE_DTD_QUOTED:m++,COMMENT_STARTING:m++,COMMENT:m++,COMMENT_ENDING:m++,COMMENT_ENDED:m++,CDATA:m++,CDATA_ENDING:m++,CDATA_ENDING_2:m++,PROC_INST:m++,PROC_INST_BODY:m++,PROC_INST_ENDING:m++,OPEN_TAG:m++,OPEN_TAG_SLASH:m++,ATTRIB:m++,ATTRIB_NAME:m++,ATTRIB_NAME_SAW_WHITE:m++,ATTRIB_VALUE:m++,ATTRIB_VALUE_QUOTED:m++,ATTRIB_VALUE_CLOSED:m++,ATTRIB_VALUE_UNQUOTED:m++,ATTRIB_VALUE_ENTITY_Q:m++,ATTRIB_VALUE_ENTITY_U:m++,CLOSE_TAG:m++,CLOSE_TAG_SAW_WHITE:m++,SCRIPT:m++,SCRIPT_ENDING:m++};e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};e.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(e.ENTITIES).forEach((function(r){var n=e.ENTITIES[r];var i=typeof n==="number"?String.fromCharCode(n):n;e.ENTITIES[r]=i}));for(var g in e.STATE){e.STATE[e.STATE[g]]=g}m=e.STATE;function emit(e,r,n){e[r]&&e[r](n)}function emitNode(e,r,n){if(e.textNode)closeText(e);emit(e,r,n)}function closeText(e){e.textNode=textopts(e.opt,e.textNode);if(e.textNode)emit(e,"ontext",e.textNode);e.textNode=""}function textopts(e,r){if(e.trim)r=r.trim();if(e.normalize)r=r.replace(/\s+/g," ");return r}function error(e,r){closeText(e);if(e.trackPosition){r+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c}r=new Error(r);e.error=r;emit(e,"onerror",r);return e}function end(e){if(e.sawRoot&&!e.closedRoot)strictFail(e,"Unclosed root tag");if(e.state!==m.BEGIN&&e.state!==m.BEGIN_WHITESPACE&&e.state!==m.TEXT){error(e,"Unexpected end")}closeText(e);e.c="";e.closed=true;emit(e,"onend");SAXParser.call(e,e.strict,e.opt);return e}function strictFail(e,r){if(typeof e!=="object"||!(e instanceof SAXParser)){throw new Error("bad call to strictFail")}if(e.strict){error(e,r)}}function newTag(e){if(!e.strict)e.tagName=e.tagName[e.looseCase]();var r=e.tags[e.tags.length-1]||e;var n=e.tag={name:e.tagName,attributes:{}};if(e.opt.xmlns){n.ns=r.ns}e.attribList.length=0;emitNode(e,"onopentagstart",n)}function qname(e,r){var n=e.indexOf(":");var i=n<0?["",e]:e.split(":");var o=i[0];var s=i[1];if(r&&e==="xmlns"){o="xmlns";s=""}return{prefix:o,local:s}}function attrib(e){if(!e.strict){e.attribName=e.attribName[e.looseCase]()}if(e.attribList.indexOf(e.attribName)!==-1||e.tag.attributes.hasOwnProperty(e.attribName)){e.attribName=e.attribValue="";return}if(e.opt.xmlns){var r=qname(e.attribName,true);var n=r.prefix;var i=r.local;if(n==="xmlns"){if(i==="xml"&&e.attribValue!==u){strictFail(e,"xml: prefix must be bound to "+u+"\n"+"Actual: "+e.attribValue)}else if(i==="xmlns"&&e.attribValue!==l){strictFail(e,"xmlns: prefix must be bound to "+l+"\n"+"Actual: "+e.attribValue)}else{var o=e.tag;var s=e.tags[e.tags.length-1]||e;if(o.ns===s.ns){o.ns=Object.create(s.ns)}o.ns[i]=e.attribValue}}e.attribList.push([e.attribName,e.attribValue])}else{e.tag.attributes[e.attribName]=e.attribValue;emitNode(e,"onattribute",{name:e.attribName,value:e.attribValue})}e.attribName=e.attribValue=""}function openTag(e,r){if(e.opt.xmlns){var n=e.tag;var i=qname(e.tagName);n.prefix=i.prefix;n.local=i.local;n.uri=n.ns[i.prefix]||"";if(n.prefix&&!n.uri){strictFail(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName));n.uri=i.prefix}var o=e.tags[e.tags.length-1]||e;if(n.ns&&o.ns!==n.ns){Object.keys(n.ns).forEach((function(r){emitNode(e,"onopennamespace",{prefix:r,uri:n.ns[r]})}))}for(var s=0,a=e.attribList.length;s<a;s++){var u=e.attribList[s];var l=u[0];var c=u[1];var p=qname(l,true);var h=p.prefix;var f=p.local;var d=h===""?"":n.ns[h]||"";var g={name:l,value:c,prefix:h,local:f,uri:d};if(h&&h!=="xmlns"&&!d){strictFail(e,"Unbound namespace prefix: "+JSON.stringify(h));g.uri=h}e.tag.attributes[l]=g;emitNode(e,"onattribute",g)}e.attribList.length=0}e.tag.isSelfClosing=!!r;e.sawRoot=true;e.tags.push(e.tag);emitNode(e,"onopentag",e.tag);if(!r){if(!e.noscript&&e.tagName.toLowerCase()==="script"){e.state=m.SCRIPT}else{e.state=m.TEXT}e.tag=null;e.tagName=""}e.attribName=e.attribValue="";e.attribList.length=0}function closeTag(e){if(!e.tagName){strictFail(e,"Weird empty close tag.");e.textNode+="</>";e.state=m.TEXT;return}if(e.script){if(e.tagName!=="script"){e.script+="</"+e.tagName+">";e.tagName="";e.state=m.SCRIPT;return}emitNode(e,"onscript",e.script);e.script=""}var r=e.tags.length;var n=e.tagName;if(!e.strict){n=n[e.looseCase]()}var i=n;while(r--){var o=e.tags[r];if(o.name!==i){strictFail(e,"Unexpected close tag")}else{break}}if(r<0){strictFail(e,"Unmatched closing tag: "+e.tagName);e.textNode+="</"+e.tagName+">";e.state=m.TEXT;return}e.tagName=n;var s=e.tags.length;while(s-- >r){var a=e.tag=e.tags.pop();e.tagName=e.tag.name;emitNode(e,"onclosetag",e.tagName);var u={};for(var l in a.ns){u[l]=a.ns[l]}var c=e.tags[e.tags.length-1]||e;if(e.opt.xmlns&&a.ns!==c.ns){Object.keys(a.ns).forEach((function(r){var n=a.ns[r];emitNode(e,"onclosenamespace",{prefix:r,uri:n})}))}}if(r===0)e.closedRoot=true;e.tagName=e.attribValue=e.attribName="";e.attribList.length=0;e.state=m.TEXT}function parseEntity(e){var r=e.entity;var n=r.toLowerCase();var i;var o="";if(e.ENTITIES[r]){return e.ENTITIES[r]}if(e.ENTITIES[n]){return e.ENTITIES[n]}r=n;if(r.charAt(0)==="#"){if(r.charAt(1)==="x"){r=r.slice(2);i=parseInt(r,16);o=i.toString(16)}else{r=r.slice(1);i=parseInt(r,10);o=i.toString(10)}}r=r.replace(/^0+/,"");if(isNaN(i)||o.toLowerCase()!==r){strictFail(e,"Invalid character entity");return"&"+e.entity+";"}return String.fromCodePoint(i)}function beginWhiteSpace(e,r){if(r==="<"){e.state=m.OPEN_WAKA;e.startTagPosition=e.position}else if(!isWhitespace(r)){strictFail(e,"Non-whitespace before first tag.");e.textNode=r;e.state=m.TEXT}}function charAt(e,r){var n="";if(r<e.length){n=e.charAt(r)}return n}function write(r){var n=this;if(this.error){throw this.error}if(n.closed){return error(n,"Cannot write after close. Assign an onready handler.")}if(r===null){return end(n)}if(typeof r==="object"){r=r.toString()}var i=0;var o="";while(true){o=charAt(r,i++);n.c=o;if(!o){break}if(n.trackPosition){n.position++;if(o==="\n"){n.line++;n.column=0}else{n.column++}}switch(n.state){case m.BEGIN:n.state=m.BEGIN_WHITESPACE;if(o==="\ufeff"){continue}beginWhiteSpace(n,o);continue;case m.BEGIN_WHITESPACE:beginWhiteSpace(n,o);continue;case m.TEXT:if(n.sawRoot&&!n.closedRoot){var u=i-1;while(o&&o!=="<"&&o!=="&"){o=charAt(r,i++);if(o&&n.trackPosition){n.position++;if(o==="\n"){n.line++;n.column=0}else{n.column++}}}n.textNode+=r.substring(u,i-1)}if(o==="<"&&!(n.sawRoot&&n.closedRoot&&!n.strict)){n.state=m.OPEN_WAKA;n.startTagPosition=n.position}else{if(!isWhitespace(o)&&(!n.sawRoot||n.closedRoot)){strictFail(n,"Text data outside of root node.")}if(o==="&"){n.state=m.TEXT_ENTITY}else{n.textNode+=o}}continue;case m.SCRIPT:if(o==="<"){n.state=m.SCRIPT_ENDING}else{n.script+=o}continue;case m.SCRIPT_ENDING:if(o==="/"){n.state=m.CLOSE_TAG}else{n.script+="<"+o;n.state=m.SCRIPT}continue;case m.OPEN_WAKA:if(o==="!"){n.state=m.SGML_DECL;n.sgmlDecl=""}else if(isWhitespace(o)){}else if(isMatch(p,o)){n.state=m.OPEN_TAG;n.tagName=o}else if(o==="/"){n.state=m.CLOSE_TAG;n.tagName=""}else if(o==="?"){n.state=m.PROC_INST;n.procInstName=n.procInstBody=""}else{strictFail(n,"Unencoded <");if(n.startTagPosition+1<n.position){var l=n.position-n.startTagPosition;o=new Array(l).join(" ")+o}n.textNode+="<"+o;n.state=m.TEXT}continue;case m.SGML_DECL:if(n.sgmlDecl+o==="--"){n.state=m.COMMENT;n.comment="";n.sgmlDecl="";continue}if(n.doctype&&n.doctype!==true&&n.sgmlDecl){n.state=m.DOCTYPE_DTD;n.doctype+="<!"+n.sgmlDecl+o;n.sgmlDecl=""}else if((n.sgmlDecl+o).toUpperCase()===s){emitNode(n,"onopencdata");n.state=m.CDATA;n.sgmlDecl="";n.cdata=""}else if((n.sgmlDecl+o).toUpperCase()===a){n.state=m.DOCTYPE;if(n.doctype||n.sawRoot){strictFail(n,"Inappropriately located doctype declaration")}n.doctype="";n.sgmlDecl=""}else if(o===">"){emitNode(n,"onsgmldeclaration",n.sgmlDecl);n.sgmlDecl="";n.state=m.TEXT}else if(isQuote(o)){n.state=m.SGML_DECL_QUOTED;n.sgmlDecl+=o}else{n.sgmlDecl+=o}continue;case m.SGML_DECL_QUOTED:if(o===n.q){n.state=m.SGML_DECL;n.q=""}n.sgmlDecl+=o;continue;case m.DOCTYPE:if(o===">"){n.state=m.TEXT;emitNode(n,"ondoctype",n.doctype);n.doctype=true}else{n.doctype+=o;if(o==="["){n.state=m.DOCTYPE_DTD}else if(isQuote(o)){n.state=m.DOCTYPE_QUOTED;n.q=o}}continue;case m.DOCTYPE_QUOTED:n.doctype+=o;if(o===n.q){n.q="";n.state=m.DOCTYPE}continue;case m.DOCTYPE_DTD:if(o==="]"){n.doctype+=o;n.state=m.DOCTYPE}else if(o==="<"){n.state=m.OPEN_WAKA;n.startTagPosition=n.position}else if(isQuote(o)){n.doctype+=o;n.state=m.DOCTYPE_DTD_QUOTED;n.q=o}else{n.doctype+=o}continue;case m.DOCTYPE_DTD_QUOTED:n.doctype+=o;if(o===n.q){n.state=m.DOCTYPE_DTD;n.q=""}continue;case m.COMMENT:if(o==="-"){n.state=m.COMMENT_ENDING}else{n.comment+=o}continue;case m.COMMENT_ENDING:if(o==="-"){n.state=m.COMMENT_ENDED;n.comment=textopts(n.opt,n.comment);if(n.comment){emitNode(n,"oncomment",n.comment)}n.comment=""}else{n.comment+="-"+o;n.state=m.COMMENT}continue;case m.COMMENT_ENDED:if(o!==">"){strictFail(n,"Malformed comment");n.comment+="--"+o;n.state=m.COMMENT}else if(n.doctype&&n.doctype!==true){n.state=m.DOCTYPE_DTD}else{n.state=m.TEXT}continue;case m.CDATA:if(o==="]"){n.state=m.CDATA_ENDING}else{n.cdata+=o}continue;case m.CDATA_ENDING:if(o==="]"){n.state=m.CDATA_ENDING_2}else{n.cdata+="]"+o;n.state=m.CDATA}continue;case m.CDATA_ENDING_2:if(o===">"){if(n.cdata){emitNode(n,"oncdata",n.cdata)}emitNode(n,"onclosecdata");n.cdata="";n.state=m.TEXT}else if(o==="]"){n.cdata+="]"}else{n.cdata+="]]"+o;n.state=m.CDATA}continue;case m.PROC_INST:if(o==="?"){n.state=m.PROC_INST_ENDING}else if(isWhitespace(o)){n.state=m.PROC_INST_BODY}else{n.procInstName+=o}continue;case m.PROC_INST_BODY:if(!n.procInstBody&&isWhitespace(o)){continue}else if(o==="?"){n.state=m.PROC_INST_ENDING}else{n.procInstBody+=o}continue;case m.PROC_INST_ENDING:if(o===">"){emitNode(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody});n.procInstName=n.procInstBody="";n.state=m.TEXT}else{n.procInstBody+="?"+o;n.state=m.PROC_INST_BODY}continue;case m.OPEN_TAG:if(isMatch(h,o)){n.tagName+=o}else{newTag(n);if(o===">"){openTag(n)}else if(o==="/"){n.state=m.OPEN_TAG_SLASH}else{if(!isWhitespace(o)){strictFail(n,"Invalid character in tag name")}n.state=m.ATTRIB}}continue;case m.OPEN_TAG_SLASH:if(o===">"){openTag(n,true);closeTag(n)}else{strictFail(n,"Forward-slash in opening tag not followed by >");n.state=m.ATTRIB}continue;case m.ATTRIB:if(isWhitespace(o)){continue}else if(o===">"){openTag(n)}else if(o==="/"){n.state=m.OPEN_TAG_SLASH}else if(isMatch(p,o)){n.attribName=o;n.attribValue="";n.state=m.ATTRIB_NAME}else{strictFail(n,"Invalid attribute name")}continue;case m.ATTRIB_NAME:if(o==="="){n.state=m.ATTRIB_VALUE}else if(o===">"){strictFail(n,"Attribute without value");n.attribValue=n.attribName;attrib(n);openTag(n)}else if(isWhitespace(o)){n.state=m.ATTRIB_NAME_SAW_WHITE}else if(isMatch(h,o)){n.attribName+=o}else{strictFail(n,"Invalid attribute name")}continue;case m.ATTRIB_NAME_SAW_WHITE:if(o==="="){n.state=m.ATTRIB_VALUE}else if(isWhitespace(o)){continue}else{strictFail(n,"Attribute without value");n.tag.attributes[n.attribName]="";n.attribValue="";emitNode(n,"onattribute",{name:n.attribName,value:""});n.attribName="";if(o===">"){openTag(n)}else if(isMatch(p,o)){n.attribName=o;n.state=m.ATTRIB_NAME}else{strictFail(n,"Invalid attribute name");n.state=m.ATTRIB}}continue;case m.ATTRIB_VALUE:if(isWhitespace(o)){continue}else if(isQuote(o)){n.q=o;n.state=m.ATTRIB_VALUE_QUOTED}else{if(!n.opt.unquotedAttributeValues){error(n,"Unquoted attribute value")}n.state=m.ATTRIB_VALUE_UNQUOTED;n.attribValue=o}continue;case m.ATTRIB_VALUE_QUOTED:if(o!==n.q){if(o==="&"){n.state=m.ATTRIB_VALUE_ENTITY_Q}else{n.attribValue+=o}continue}attrib(n);n.q="";n.state=m.ATTRIB_VALUE_CLOSED;continue;case m.ATTRIB_VALUE_CLOSED:if(isWhitespace(o)){n.state=m.ATTRIB}else if(o===">"){openTag(n)}else if(o==="/"){n.state=m.OPEN_TAG_SLASH}else if(isMatch(p,o)){strictFail(n,"No whitespace between attributes");n.attribName=o;n.attribValue="";n.state=m.ATTRIB_NAME}else{strictFail(n,"Invalid attribute name")}continue;case m.ATTRIB_VALUE_UNQUOTED:if(!isAttribEnd(o)){if(o==="&"){n.state=m.ATTRIB_VALUE_ENTITY_U}else{n.attribValue+=o}continue}attrib(n);if(o===">"){openTag(n)}else{n.state=m.ATTRIB}continue;case m.CLOSE_TAG:if(!n.tagName){if(isWhitespace(o)){continue}else if(notMatch(p,o)){if(n.script){n.script+="</"+o;n.state=m.SCRIPT}else{strictFail(n,"Invalid tagname in closing tag.")}}else{n.tagName=o}}else if(o===">"){closeTag(n)}else if(isMatch(h,o)){n.tagName+=o}else if(n.script){n.script+="</"+n.tagName;n.tagName="";n.state=m.SCRIPT}else{if(!isWhitespace(o)){strictFail(n,"Invalid tagname in closing tag")}n.state=m.CLOSE_TAG_SAW_WHITE}continue;case m.CLOSE_TAG_SAW_WHITE:if(isWhitespace(o)){continue}if(o===">"){closeTag(n)}else{strictFail(n,"Invalid characters in closing tag")}continue;case m.TEXT_ENTITY:case m.ATTRIB_VALUE_ENTITY_Q:case m.ATTRIB_VALUE_ENTITY_U:var c;var g;switch(n.state){case m.TEXT_ENTITY:c=m.TEXT;g="textNode";break;case m.ATTRIB_VALUE_ENTITY_Q:c=m.ATTRIB_VALUE_QUOTED;g="attribValue";break;case m.ATTRIB_VALUE_ENTITY_U:c=m.ATTRIB_VALUE_UNQUOTED;g="attribValue";break}if(o===";"){var y=parseEntity(n);if(n.opt.unparsedEntities&&!Object.values(e.XML_ENTITIES).includes(y)){n.entity="";n.state=c;n.write(y)}else{n[g]+=y;n.entity="";n.state=c}}else if(isMatch(n.entity.length?d:f,o)){n.entity+=o}else{strictFail(n,"Invalid character in entity name");n[g]+="&"+n.entity+o;n.entity="";n.state=c}continue;default:{throw new Error(n,"Unknown state: "+n.state)}}}if(n.position>=n.bufferCheckPosition){checkBufferLength(n)}return n}
9
+ /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var e=String.fromCharCode;var r=Math.floor;var fromCodePoint=function(){var n=16384;var i=[];var o;var s;var a=-1;var u=arguments.length;if(!u){return""}var l="";while(++a<u){var c=Number(arguments[a]);if(!isFinite(c)||c<0||c>1114111||r(c)!==c){throw RangeError("Invalid code point: "+c)}if(c<=65535){i.push(c)}else{c-=65536;o=(c>>10)+55296;s=c%1024+56320;i.push(o,s)}if(a+1===u||i.length>n){l+=e.apply(null,i);i.length=0}}return l};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true})}else{String.fromCodePoint=fromCodePoint}})()}})(false?0:r)},5414:function(e,r,n){"use strict";const i=n(857);const o=n(2871);const s=process.env;let a;if(o("no-color")||o("no-colors")||o("color=false")){a=false}else if(o("color")||o("colors")||o("color=true")||o("color=always")){a=true}if("FORCE_COLOR"in s){a=s.FORCE_COLOR.length===0||parseInt(s.FORCE_COLOR,10)!==0}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(a===false){return 0}if(o("color=16m")||o("color=full")||o("color=truecolor")){return 3}if(o("color=256")){return 2}if(e&&!e.isTTY&&a!==true){return 0}const r=a?1:0;if(process.platform==="win32"){const e=i.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in s))||s.CI_NAME==="codeship"){return 1}return r}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}if(s.TERM==="dumb"){return r}return r}function getSupportLevel(e){const r=supportsColor(e);return translateLevel(r)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},6877:function(e,r,n){var i=n(8230).select;e.exports=n(1513);e.exports.C14nCanonicalization=n(554).C14nCanonicalization;e.exports.C14nCanonicalizationWithComments=n(554).C14nCanonicalizationWithComments;e.exports.ExclusiveCanonicalization=n(5756).ExclusiveCanonicalization;e.exports.ExclusiveCanonicalizationWithComments=n(5756).ExclusiveCanonicalizationWithComments;e.exports.xpath=function(e,r){return i(r,e)}},554:function(e,r,n){var i=n(5056);r.C14nCanonicalization=C14nCanonicalization;r.C14nCanonicalizationWithComments=C14nCanonicalizationWithComments;function C14nCanonicalization(){this.includeComments=false}C14nCanonicalization.prototype.attrCompare=function(e,r){if(!e.namespaceURI&&r.namespaceURI){return-1}if(!r.namespaceURI&&e.namespaceURI){return 1}var n=e.namespaceURI+e.localName;var i=r.namespaceURI+r.localName;if(n===i)return 0;else if(n<i)return-1;else return 1};C14nCanonicalization.prototype.nsCompare=function(e,r){var n=e.prefix;var i=r.prefix;if(n==i){return 0}return n.localeCompare(i)};C14nCanonicalization.prototype.renderAttrs=function(e,r){var n,o,s,a=[],u=[];if(e.nodeType===8){return this.renderComment(e)}if(e.attributes){for(o=0;o<e.attributes.length;++o){s=e.attributes[o];if(s.name.indexOf("xmlns")===0){continue}u.push(s)}}u.sort(this.attrCompare);for(n in u){if(!u.hasOwnProperty(n)){continue}s=u[n];a.push(" ",s.name,'="',i.encodeSpecialCharactersInAttribute(s.value),'"')}return a.join("")};C14nCanonicalization.prototype.renderNs=function(e,r,n,i,o){var s,a,u,l,c=[],p=n,h=[],f=e.namespaceURI||"";if(e.prefix){if(r.indexOf(e.prefix)==-1){h.push({prefix:e.prefix,namespaceURI:e.namespaceURI||i[e.prefix]});r.push(e.prefix)}}else if(n!=f){p=e.namespaceURI;c.push(' xmlns="',p,'"')}if(e.attributes){for(a=0;a<e.attributes.length;++a){l=e.attributes[a];if(l.prefix==="xmlns"&&r.indexOf(l.localName)===-1){h.push({prefix:l.localName,namespaceURI:l.value});r.push(l.localName)}if(l.prefix&&r.indexOf(l.prefix)==-1&&l.prefix!="xmlns"&&l.prefix!="xml"){h.push({prefix:l.prefix,namespaceURI:l.namespaceURI});r.push(l.prefix)}}}if(Array.isArray(o)&&o.length>0){for(var d in o){if(!o.hasOwnProperty(d))continue;var m=false;for(var g in h){if(h[g].prefix===o[d].prefix&&h[g].namespaceURI===o[d].namespaceURI){m=true}}if(!m){h.push(o[d])}}}h.sort(this.nsCompare);for(s in h){if(!h.hasOwnProperty(s)){continue}u=h[s];c.push(" xmlns",u.prefix?":"+u.prefix:"",'="',u.namespaceURI,'"')}return{rendered:c.join(""),newDefaultNs:p}};C14nCanonicalization.prototype.processInner=function(e,r,n,o,s){if(e.nodeType===8){return this.renderComment(e)}if(e.data){return i.encodeSpecialCharactersInText(e.data)}var a,u,l=this.renderNs(e,r,n,o,s),c=["<",e.tagName,l.rendered,this.renderAttrs(e,l.newDefaultNs),">"];for(a=0;a<e.childNodes.length;++a){u=r.slice(0);c.push(this.processInner(e.childNodes[a],u,l.newDefaultNs,o,[]))}c.push("</",e.tagName,">");return c.join("")};C14nCanonicalization.prototype.renderComment=function(e){if(!this.includeComments){return""}var r=e.ownerDocument===e.parentNode,n=null,o=null;if(r){var s=e,a=e;while(s!==null){if(s===e.ownerDocument.documentElement){n=true;break}s=s.nextSibling}while(a!==null){if(a===e.ownerDocument.documentElement){o=true;break}a=a.previousSibling}}return(o?"\n":"")+"\x3c!--"+i.encodeSpecialCharactersInText(e.data)+"--\x3e"+(n?"\n":"")};C14nCanonicalization.prototype.process=function(e,r){r=r||{};var n=r.defaultNs||"";var i=r.defaultNsForPrefix||{};var o=r.ancestorNamespaces||[];var s=[];for(var a=0;a<o.length;a++){s.push(o[a].prefix)}var u=this.processInner(e,s,n,i,o);return u};C14nCanonicalization.prototype.getAlgorithmName=function(){return"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"};r.C14nCanonicalizationWithComments=C14nCanonicalizationWithComments;function C14nCanonicalizationWithComments(){C14nCanonicalization.call(this);this.includeComments=true}C14nCanonicalizationWithComments.prototype=Object.create(C14nCanonicalization.prototype);C14nCanonicalizationWithComments.prototype.constructor=C14nCanonicalizationWithComments;C14nCanonicalizationWithComments.prototype.getAlgorithmName=function(){return"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"}},4410:function(e,r,n){var i=n(8230);var o=n(5056);r.v=EnvelopedSignature;function EnvelopedSignature(){}EnvelopedSignature.prototype.process=function(e,r){if(null==r.signatureNode){var n=i.select("./*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",e)[0];if(n)n.parentNode.removeChild(n);return e}var s=r.signatureNode;var a=o.findFirst(s,".//*[local-name(.)='SignatureValue']/text()").data;var u=i.select(".//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",e);for(var l in u){if(!u.hasOwnProperty(l))continue;var c=u[l];var p=o.findFirst(c,".//*[local-name(.)='SignatureValue']/text()").data;if(a===p){c.parentNode.removeChild(c)}}return e};EnvelopedSignature.prototype.getAlgorithmName=function(){return"http://www.w3.org/2000/09/xmldsig#enveloped-signature"}},5756:function(e,r,n){var i=n(5056);r.ExclusiveCanonicalization=ExclusiveCanonicalization;r.ExclusiveCanonicalizationWithComments=ExclusiveCanonicalizationWithComments;function ExclusiveCanonicalization(){this.includeComments=false}ExclusiveCanonicalization.prototype.attrCompare=function(e,r){if(!e.namespaceURI&&r.namespaceURI){return-1}if(!r.namespaceURI&&e.namespaceURI){return 1}var n=e.namespaceURI+e.localName;var i=r.namespaceURI+r.localName;if(n===i)return 0;else if(n<i)return-1;else return 1};ExclusiveCanonicalization.prototype.nsCompare=function(e,r){var n=e.prefix;var i=r.prefix;if(n==i){return 0}return n.localeCompare(i)};ExclusiveCanonicalization.prototype.renderAttrs=function(e,r){var n,o,s,a=[],u=[];if(e.nodeType===8){return this.renderComment(e)}if(e.attributes){for(o=0;o<e.attributes.length;++o){s=e.attributes[o];if(s.name.indexOf("xmlns")===0){continue}u.push(s)}}u.sort(this.attrCompare);for(n in u){if(!u.hasOwnProperty(n)){continue}s=u[n];a.push(" ",s.name,'="',i.encodeSpecialCharactersInAttribute(s.value),'"')}return a.join("")};function isPrefixInScope(e,r,n){var i=false;e.forEach((function(e){if(e.prefix===r&&e.namespaceURI===n){i=true}}));return i}ExclusiveCanonicalization.prototype.renderNs=function(e,r,n,i,o){var s,a,u,l,c=[],p=n,h=[],f=e.namespaceURI||"";if(e.prefix){if(!isPrefixInScope(r,e.prefix,e.namespaceURI||i[e.prefix])){h.push({prefix:e.prefix,namespaceURI:e.namespaceURI||i[e.prefix]});r.push({prefix:e.prefix,namespaceURI:e.namespaceURI||i[e.prefix]})}}else if(n!=f){p=e.namespaceURI;c.push(' xmlns="',p,'"')}if(e.attributes){for(a=0;a<e.attributes.length;++a){l=e.attributes[a];if(l.prefix&&!isPrefixInScope(r,l.localName,l.value)&&o.indexOf(l.localName)>=0){h.push({prefix:l.localName,namespaceURI:l.value});r.push({prefix:l.localName,namespaceURI:l.value})}if(l.prefix&&!isPrefixInScope(r,l.prefix,l.namespaceURI)&&l.prefix!="xmlns"&&l.prefix!="xml"){h.push({prefix:l.prefix,namespaceURI:l.namespaceURI});r.push({prefix:l.prefix,namespaceURI:l.namespaceURI})}}}h.sort(this.nsCompare);for(s in h){if(!h.hasOwnProperty(s)){continue}u=h[s];c.push(" xmlns:",u.prefix,'="',u.namespaceURI,'"')}return{rendered:c.join(""),newDefaultNs:p}};ExclusiveCanonicalization.prototype.processInner=function(e,r,n,o,s){if(e.nodeType===8){return this.renderComment(e)}if(e.data){return i.encodeSpecialCharactersInText(e.data)}var a,u,l=this.renderNs(e,r,n,o,s),c=["<",e.tagName,l.rendered,this.renderAttrs(e,l.newDefaultNs),">"];for(a=0;a<e.childNodes.length;++a){u=r.slice(0);c.push(this.processInner(e.childNodes[a],u,l.newDefaultNs,o,s))}c.push("</",e.tagName,">");return c.join("")};ExclusiveCanonicalization.prototype.renderComment=function(e){if(!this.includeComments){return""}var r=e.ownerDocument===e.parentNode,n=null,o=null;if(r){var s=e,a=e;while(s!==null){if(s===e.ownerDocument.documentElement){n=true;break}s=s.nextSibling}while(a!==null){if(a===e.ownerDocument.documentElement){o=true;break}a=a.previousSibling}}return(o?"\n":"")+"\x3c!--"+i.encodeSpecialCharactersInText(e.data)+"--\x3e"+(n?"\n":"")};ExclusiveCanonicalization.prototype.process=function(e,r){r=r||{};var n=r.inclusiveNamespacesPrefixList||[];var o=r.defaultNs||"";var s=r.defaultNsForPrefix||{};if(!(n instanceof Array)){n=n.split(" ")}var a=r.ancestorNamespaces||[];if(n.length==0){var u=i.findChilds(e,"CanonicalizationMethod");if(u.length!=0){var l=i.findChilds(u[0],"InclusiveNamespaces");if(l.length!=0){n=l[0].getAttribute("PrefixList").split(" ")}}}if(n){var c=n instanceof Array?n:n.split(" ");c.forEach((function(r){if(a){a.forEach((function(n){if(r==n.prefix){e.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:"+r,n.namespaceURI)}}))}}))}var p=this.processInner(e,[],o,s,n);return p};ExclusiveCanonicalization.prototype.getAlgorithmName=function(){return"http://www.w3.org/2001/10/xml-exc-c14n#"};r.ExclusiveCanonicalizationWithComments=ExclusiveCanonicalizationWithComments;function ExclusiveCanonicalizationWithComments(){ExclusiveCanonicalization.call(this);this.includeComments=true}ExclusiveCanonicalizationWithComments.prototype=Object.create(ExclusiveCanonicalization.prototype);ExclusiveCanonicalizationWithComments.prototype.constructor=ExclusiveCanonicalizationWithComments;ExclusiveCanonicalizationWithComments.prototype.getAlgorithmName=function(){return"http://www.w3.org/2001/10/xml-exc-c14n#WithComments"}},7074:function(e,r,n){var i=n(3091),o=n(9896);function FileKeyInfo(e){var r=o.readFileSync(e);i.apply(this,[r])}FileKeyInfo.prototype=i.prototype;FileKeyInfo.prototype.constructor=FileKeyInfo;e.exports=FileKeyInfo},1513:function(e,r,n){var i=n(8230),o=n(8737).DOMParser,s=n(5056),a=n(554),u=n(5756),l=n(4410).v,c=n(3091),p=n(7074),h=n(6982);r.SignedXml=SignedXml;r.StringKeyInfo=c;r.FileKeyInfo=p;function SHA1(){this.getHash=function(e){var r=h.createHash("sha1");r.update(e,"utf8");var n=r.digest("base64");return n};this.getAlgorithmName=function(){return"http://www.w3.org/2000/09/xmldsig#sha1"}}function SHA256(){this.getHash=function(e){var r=h.createHash("sha256");r.update(e,"utf8");var n=r.digest("base64");return n};this.getAlgorithmName=function(){return"http://www.w3.org/2001/04/xmlenc#sha256"}}function SHA512(){this.getHash=function(e){var r=h.createHash("sha512");r.update(e,"utf8");var n=r.digest("base64");return n};this.getAlgorithmName=function(){return"http://www.w3.org/2001/04/xmlenc#sha512"}}function RSASHA1(){this.getSignature=function(e,r,n){var i=h.createSign("RSA-SHA1");i.update(e);var o=i.sign(r,"base64");if(n)n(null,o);return o};this.verifySignature=function(e,r,n,i){var o=h.createVerify("RSA-SHA1");o.update(e);var s=o.verify(r,n,"base64");if(i)i(null,s);return s};this.getAlgorithmName=function(){return"http://www.w3.org/2000/09/xmldsig#rsa-sha1"}}function RSASHA256(){this.getSignature=function(e,r,n){var i=h.createSign("RSA-SHA256");i.update(e);var o=i.sign(r,"base64");if(n)n(null,o);return o};this.verifySignature=function(e,r,n,i){var o=h.createVerify("RSA-SHA256");o.update(e);var s=o.verify(r,n,"base64");if(i)i(null,s);return s};this.getAlgorithmName=function(){return"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"}}function RSASHA512(){this.getSignature=function(e,r,n){var i=h.createSign("RSA-SHA512");i.update(e);var o=i.sign(r,"base64");if(n)n(null,o);return o};this.verifySignature=function(e,r,n,i){var o=h.createVerify("RSA-SHA512");o.update(e);var s=o.verify(r,n,"base64");if(i)i(null,s);return s};this.getAlgorithmName=function(){return"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"}}function HMACSHA1(){this.verifySignature=function(e,r,n){var i=h.createHmac("SHA1",r);i.update(e);var o=i.digest("base64");return o===n};this.getAlgorithmName=function(){return"http://www.w3.org/2000/09/xmldsig#hmac-sha1"};this.getSignature=function(e,r){var n=h.createHmac("SHA1",r);n.update(e);var i=n.digest("base64");return i}}function findAncestorNs(e,r,n){var o=i.selectWithResolver(r,e,n);if(!Array.isArray(o)||o.length<1){return[]}var s=collectAncestorNamespaces(o[0]);var a=[];for(var u=0;u<s.length;u++){var l=true;for(var c in a){if(a[c].prefix===s[u].prefix){l=false;break}}if(l){a.push(s[u])}}var p=[];const h=findNSPrefix(o[0]);for(const e of a){if(e.prefix!==h){p.push(e)}}return p}function collectAncestorNamespaces(e,r){if(!r){r=[]}var n=e.parentNode;if(!n){return r}if(n.attributes&&n.attributes.length>0){for(var i=0;i<n.attributes.length;i++){var o=n.attributes[i];if(o&&o.nodeName&&o.nodeName.search(/^xmlns:?/)!==-1){r.push({prefix:o.nodeName.replace(/^xmlns:?/,""),namespaceURI:o.nodeValue})}}}return collectAncestorNamespaces(n,r)}function findNSPrefix(e){const r=e.attributes;for(let e=0;e<r.length;e++){const n=r[e].nodeName;if(n.search(/^xmlns:?/)!==-1){return n.replace(/^xmlns:?/,"")}}return e.prefix||""}function SignedXml(e,r){this.options=r||{};this.idMode=e;this.references=[];this.id=0;this.signingKey=null;this.signingCert=null;this.signatureAlgorithm=this.options.signatureAlgorithm||"http://www.w3.org/2000/09/xmldsig#rsa-sha1";this.keyInfoProvider=null;this.canonicalizationAlgorithm=this.options.canonicalizationAlgorithm||"http://www.w3.org/2001/10/xml-exc-c14n#";this.inclusiveNamespacesPrefixList=this.options.inclusiveNamespacesPrefixList||"";this.signedXml="";this.signatureXml="";this.signatureNode=null;this.signatureValue="";this.originalXmlWithIds="";this.validationErrors=[];this.keyInfo=null;this.idAttributes=["Id","ID","id"];if(this.options.idAttribute)this.idAttributes.splice(0,0,this.options.idAttribute);this.implicitTransforms=this.options.implicitTransforms||[]}SignedXml.CanonicalizationAlgorithms={"http://www.w3.org/TR/2001/REC-xml-c14n-20010315":a.C14nCanonicalization,"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments":a.C14nCanonicalizationWithComments,"http://www.w3.org/2001/10/xml-exc-c14n#":u.ExclusiveCanonicalization,"http://www.w3.org/2001/10/xml-exc-c14n#WithComments":u.ExclusiveCanonicalizationWithComments,"http://www.w3.org/2000/09/xmldsig#enveloped-signature":l};SignedXml.HashAlgorithms={"http://www.w3.org/2000/09/xmldsig#sha1":SHA1,"http://www.w3.org/2001/04/xmlenc#sha256":SHA256,"http://www.w3.org/2001/04/xmlenc#sha512":SHA512};SignedXml.SignatureAlgorithms={"http://www.w3.org/2000/09/xmldsig#rsa-sha1":RSASHA1,"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256":RSASHA256,"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512":RSASHA512};SignedXml.enableHMAC=function(){SignedXml.SignatureAlgorithms={"http://www.w3.org/2000/09/xmldsig#hmac-sha1":HMACSHA1}};SignedXml.defaultNsForPrefix={ds:"http://www.w3.org/2000/09/xmldsig#"};SignedXml.findAncestorNs=findAncestorNs;SignedXml.prototype.checkSignature=function(e,r){if(r!=null&&typeof r!=="function"){throw new Error("Last parameter must be a callback function")}this.validationErrors=[];this.signedXml=e;if(!this.keyInfoProvider){var n=new Error("cannot validate signature since no key info resolver was provided");if(!r){throw n}else{r(n);return}}this.signingKey=this.keyInfoProvider.getKey(this.keyInfo);if(!this.signingKey){var i=new Error("key info provider could not resolve key info "+this.keyInfo);if(!r){throw i}else{r(i);return}}var s=(new o).parseFromString(e);if(!this.validateReferences(s)){if(!r){return false}else{r(new Error("Could not validate references"));return}}if(!r){if(!this.validateSignatureValue(s)){return false}return true}else{this.validateSignatureValue(s,(function(e,n){if(e){this.validationErrors.push("invalid signature: the signature value "+this.signatureValue+" is incorrect");r(e)}else{r(null,n)}}))}};SignedXml.prototype.getCanonSignedInfoXml=function(e){var r=s.findChilds(this.signatureNode,"SignedInfo");if(r.length==0)throw new Error("could not find SignedInfo element in the message");if(this.canonicalizationAlgorithm==="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"||this.canonicalizationAlgorithm==="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"){if(!e||typeof e!=="object"){throw new Error("When canonicalization method is non-exclusive, whole xml dom must be provided as an argument")}}var n=[];n=findAncestorNs(e,"//*[local-name()='SignedInfo']");var i={ancestorNamespaces:n};return this.getCanonXml([this.canonicalizationAlgorithm],r[0],i)};SignedXml.prototype.getCanonReferenceXml=function(e,r,n){if(Array.isArray(r.transforms)){r.ancestorNamespaces=findAncestorNs(e,r.xpath,this.namespaceResolver)}var i={inclusiveNamespacesPrefixList:r.inclusiveNamespacesPrefixList,ancestorNamespaces:r.ancestorNamespaces};return this.getCanonXml(r.transforms,n,i)};SignedXml.prototype.validateSignatureValue=function(e,r){var n=this.getCanonSignedInfoXml(e);var i=this.findSignatureAlgorithm(this.signatureAlgorithm);var o=i.verifySignature(n,this.signingKey,this.signatureValue,r);if(!o&&!r)this.validationErrors.push("invalid signature: the signature value "+this.signatureValue+" is incorrect");return o};SignedXml.prototype.calculateSignatureValue=function(e,r){var n=this.getCanonSignedInfoXml(e);var i=this.findSignatureAlgorithm(this.signatureAlgorithm);this.signatureValue=i.getSignature(n,this.signingKey,r)};SignedXml.prototype.findSignatureAlgorithm=function(e){var r=SignedXml.SignatureAlgorithms[e];if(r)return new r;else throw new Error("signature algorithm '"+e+"' is not supported")};SignedXml.prototype.findCanonicalizationAlgorithm=function(e){var r=SignedXml.CanonicalizationAlgorithms[e];if(r)return new r;else throw new Error("canonicalization algorithm '"+e+"' is not supported")};SignedXml.prototype.findHashAlgorithm=function(e){var r=SignedXml.HashAlgorithms[e];if(r)return new r;else throw new Error("hash algorithm '"+e+"' is not supported")};SignedXml.prototype.validateReferences=function(e){for(var r in this.references){if(!this.references.hasOwnProperty(r))continue;var n=this.references[r];var o=n.uri[0]=="#"?n.uri.substring(1):n.uri;var s=[];if(o==""){s=i.select("//*",e)}else if(o.indexOf("'")!=-1){throw new Error("Cannot validate a uri with quotes inside it")}else{var a;var u=0;for(var l in this.idAttributes){if(!this.idAttributes.hasOwnProperty(l))continue;var c="//*[@*[local-name(.)='"+this.idAttributes[l]+"']='"+o+"']";var p=i.select(c,e);u+=p.length;if(p.length>0){s=p;a=c}}if(u>1){throw new Error("Cannot validate a document which contains multiple elements with the "+"same value for the ID / Id / Id attributes, in order to prevent "+"signature wrapping attack.")}n.xpath=a}if(s.length==0){this.validationErrors.push("invalid signature: the signature references an element with uri "+n.uri+" but could not find such element in the xml");return false}var h=this.getCanonReferenceXml(e,n,s[0]);var f=this.findHashAlgorithm(n.digestAlgorithm);var d=f.getHash(h);if(!validateDigestValue(d,n.digestValue)){this.validationErrors.push("invalid signature: for uri "+n.uri+" calculated digest is "+d+" but the xml to validate supplies digest "+n.digestValue);return false}}return true};function validateDigestValue(e,r){var n,i;var o=/^v(\d+)/.exec(process.version)[1];if(+o>=6){n=Buffer.from(e,"base64");i=Buffer.from(r,"base64")}else{n=new Buffer(e,"base64");i=new Buffer(r,"base64")}if(typeof n.equals==="function"){return n.equals(i)}if(n.length!==i.length){return false}for(var s=0;s<n.length;s++){if(n[s]!==i[s]){return false}}return true}SignedXml.prototype.loadSignature=function(e){if(typeof e==="string"){this.signatureNode=e=(new o).parseFromString(e)}else{this.signatureNode=e}this.signatureXml=e.toString();var r=i.select(".//*[local-name(.)='CanonicalizationMethod']/@Algorithm",e);if(r.length==0)throw new Error("could not find CanonicalizationMethod/@Algorithm element");this.canonicalizationAlgorithm=r[0].value;this.signatureAlgorithm=s.findFirst(e,".//*[local-name(.)='SignatureMethod']/@Algorithm").value;this.references=[];var n=i.select(".//*[local-name(.)='SignedInfo']/*[local-name(.)='Reference']",e);if(n.length==0)throw new Error("could not find any Reference elements");for(var a in n){if(!n.hasOwnProperty(a))continue;this.loadReference(n[a])}this.signatureValue=s.findFirst(e,".//*[local-name(.)='SignatureValue']/text()").data.replace(/\r?\n/g,"");this.keyInfo=i.select(".//*[local-name(.)='KeyInfo']",e)};SignedXml.prototype.loadReference=function(e){var r=s.findChilds(e,"DigestMethod");if(r.length==0)throw new Error("could not find DigestMethod in reference "+e.toString());var n=r[0];var i=s.findAttr(n,"Algorithm");if(!i)throw new Error("could not find Algorithm attribute in node "+n.toString());var o=i.value;r=s.findChilds(e,"DigestValue");if(r.length==0)throw new Error("could not find DigestValue node in reference "+e.toString());if(r[0].childNodes.length==0||!r[0].firstChild.data){throw new Error("could not find the value of DigestValue in "+r[0].toString())}var a=r[0].firstChild.data;var u=[];var l;r=s.findChilds(e,"Transforms");if(r.length!=0){var c=r[0];var p=s.findChilds(c,"Transform");for(var h in p){if(!p.hasOwnProperty(h))continue;var f=p[h];u.push(s.findAttr(f,"Algorithm").value)}var d=s.findChilds(f,"InclusiveNamespaces");if(d.length>0){for(var m=0;m<d.length;m++){if(l){l=l+" "+d[m].getAttribute("PrefixList")}else{l=d[m].getAttribute("PrefixList")}}}}var g=Array.isArray(this.implicitTransforms)&&this.implicitTransforms.length>0;if(g){this.implicitTransforms.forEach((function(e){u.push(e)}))}if(u.length===0||u[u.length-1]==="http://www.w3.org/2000/09/xmldsig#enveloped-signature"){u.push("http://www.w3.org/TR/2001/REC-xml-c14n-20010315")}this.addReference(null,u,o,s.findAttr(e,"URI").value,a,l,false)};SignedXml.prototype.addReference=function(e,r,n,i,o,s,a){this.references.push({xpath:e,transforms:r?r:["http://www.w3.org/2001/10/xml-exc-c14n#"],digestAlgorithm:n?n:"http://www.w3.org/2000/09/xmldsig#sha1",uri:i,digestValue:o,inclusiveNamespacesPrefixList:s,isEmptyUri:a})};SignedXml.prototype.computeSignature=function(e,r,n){if(typeof r==="function"&&n==null){n=r}if(n!=null&&typeof n!=="function"){throw new Error("Last parameter must be a callback function")}var a=(new o).parseFromString(e),u="xmlns",l=[],c,p,h,f;var d=["append","prepend","before","after"];r=r||{};h=r.prefix;p=r.attrs||{};c=r.location||{};var m=r.existingPrefixes||{};this.namespaceResolver={lookupNamespaceURI:function(e){return m[e]}};c.reference=c.reference||"/*";c.action=c.action||"append";if(d.indexOf(c.action)===-1){var g=new Error("location.action option has an invalid action: "+c.action+", must be any of the following values: "+d.join(", "));if(!n){throw g}else{n(g,null);return}}if(h){u+=":"+h;f=h+":"}else{f=""}Object.keys(p).forEach((function(e){if(e!=="xmlns"&&e!==u){l.push(e+'="'+p[e]+'"')}}));l.push(u+'="http://www.w3.org/2000/09/xmldsig#"');var y="<"+f+"Signature "+l.join(" ")+">";y+=this.createSignedInfo(a,h);y+=this.getKeyInfo(h);y+="</"+f+"Signature>";this.originalXmlWithIds=a.toString();var w="";Object.keys(m).forEach((function(e){w+="xmlns:"+e+'="'+m[e]+'" '}));var v="<Dummy "+w+">"+y+"</Dummy>";var b=(new o).parseFromString(v);var N=b.documentElement.firstChild;var E=i.select(c.reference,a);if(!E||E.length===0){var T=new Error("the following xpath cannot be used because it was not found: "+c.reference);if(!n){throw T}else{n(T,null);return}}E=E[0];if(c.action==="append"){E.appendChild(N)}else if(c.action==="prepend"){E.insertBefore(N,E.firstChild)}else if(c.action==="before"){E.parentNode.insertBefore(N,E)}else if(c.action==="after"){E.parentNode.insertBefore(N,E.nextSibling)}this.signatureNode=N;var D=s.findChilds(this.signatureNode,"SignedInfo");if(D.length==0){var S=new Error("could not find SignedInfo element in the message");if(!n){throw S}else{n(S);return}}D=D[0];if(!n){this.calculateSignatureValue(a);N.insertBefore(this.createSignature(h),D.nextSibling);this.signatureXml=N.toString();this.signedXml=a.toString()}else{var A=this;this.calculateSignatureValue(a,(function(e,r){if(e){n(e)}else{A.signatureValue=r;N.insertBefore(A.createSignature(h),D.nextSibling);A.signatureXml=N.toString();A.signedXml=a.toString();n(null,A)}}))}};SignedXml.prototype.getKeyInfo=function(e){var r="";var n;n=e||"";n=n?n+":":n;if(this.keyInfoProvider){var i="";if(this.keyInfoProvider.attrs){Object.keys(this.keyInfoProvider.attrs).forEach((e=>{i+=" "+e+'="'+this.keyInfoProvider.attrs[e]+'"'}))}r+="<"+n+"KeyInfo"+i+">";r+=this.keyInfoProvider.getKeyInfo(this.signingCert||this.signingKey,e);r+="</"+n+"KeyInfo>"}return r};SignedXml.prototype.createReferences=function(e,r){var n="";r=r||"";r=r?r+":":r;for(var o in this.references){if(!this.references.hasOwnProperty(o))continue;var s=this.references[o],a=i.selectWithResolver(s.xpath,e,this.namespaceResolver);if(a.length==0){throw new Error("the following xpath cannot be signed because it was not found: "+s.xpath)}for(var u in a){if(!a.hasOwnProperty(u))continue;var l=a[u];if(s.isEmptyUri){n+="<"+r+'Reference URI="">'}else{var c=this.ensureHasId(l);s.uri=c;n+="<"+r+'Reference URI="#'+c+'">'}n+="<"+r+"Transforms>";for(var p in s.transforms){if(!s.transforms.hasOwnProperty(p))continue;var h=s.transforms[p];var f=this.findCanonicalizationAlgorithm(h);n+="<"+r+'Transform Algorithm="'+f.getAlgorithmName()+'"';if(s.inclusiveNamespacesPrefixList){n+=">";n+='<InclusiveNamespaces PrefixList="'+s.inclusiveNamespacesPrefixList+'" xmlns="'+f.getAlgorithmName()+'"/>';n+="</"+r+"Transform>"}else{n+=" />"}}var d=this.getCanonReferenceXml(e,s,l);var m=this.findHashAlgorithm(s.digestAlgorithm);n+="</"+r+"Transforms>"+"<"+r+'DigestMethod Algorithm="'+m.getAlgorithmName()+'" />'+"<"+r+"DigestValue>"+m.getHash(d)+"</"+r+"DigestValue>"+"</"+r+"Reference>"}}return n};SignedXml.prototype.getCanonXml=function(e,r,n){n=n||{};n.defaultNsForPrefix=n.defaultNsForPrefix||SignedXml.defaultNsForPrefix;n.signatureNode=this.signatureNode;var i=r.cloneNode(true);for(var o in e){if(!e.hasOwnProperty(o))continue;var s=this.findCanonicalizationAlgorithm(e[o]);i=s.process(i,n)}return i.toString()};SignedXml.prototype.ensureHasId=function(e){var r;if(this.idMode=="wssecurity"){r=s.findAttr(e,"Id","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")}else{for(var n in this.idAttributes){if(!this.idAttributes.hasOwnProperty(n))continue;r=s.findAttr(e,this.idAttributes[n],null);if(r)break}}if(r)return r.value;var i="_"+this.id++;if(this.idMode=="wssecurity"){e.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:wsu","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");e.setAttributeNS("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd","wsu:Id",i)}else{e.setAttribute("Id",i)}return i};SignedXml.prototype.createSignedInfo=function(e,r){var n=this.findCanonicalizationAlgorithm(this.canonicalizationAlgorithm);var i=this.findSignatureAlgorithm(this.signatureAlgorithm);var o;o=r||"";o=o?o+":":o;var s="<"+o+"SignedInfo>";s+="<"+o+'CanonicalizationMethod Algorithm="'+n.getAlgorithmName()+'"';if(this.inclusiveNamespacesPrefixList){s+=">";s+='<InclusiveNamespaces PrefixList="'+this.inclusiveNamespacesPrefixList+'" xmlns="'+n.getAlgorithmName()+'"/>';s+="</"+o+"CanonicalizationMethod>"}else{s+=" />"}s+="<"+o+'SignatureMethod Algorithm="'+i.getAlgorithmName()+'" />';s+=this.createReferences(e,r);s+="</"+o+"SignedInfo>";return s};SignedXml.prototype.createSignature=function(e){var r="xmlns";if(e){r+=":"+e;e+=":"}else{e=""}var n="<"+e+"SignatureValue>"+this.signatureValue+"</"+e+"SignatureValue>";var i="<"+e+"Signature "+r+'="http://www.w3.org/2000/09/xmldsig#">'+n+"</"+e+"Signature>";var s=(new o).parseFromString(i);return s.documentElement.firstChild};SignedXml.prototype.getSignatureXml=function(){return this.signatureXml};SignedXml.prototype.getOriginalXmlWithIds=function(){return this.originalXmlWithIds};SignedXml.prototype.getSignedXml=function(){return this.signedXml}},3091:function(e){function StringKeyInfo(e){this.key=e}StringKeyInfo.prototype.getKeyInfo=function(e,r){r=r||"";r=r?r+":":r;return"<"+r+"X509Data></"+r+"X509Data>"};StringKeyInfo.prototype.getKey=function(e){return this.key};e.exports=StringKeyInfo},5056:function(e,r,n){var i=n(8230).select;function findAttr(e,r,n){for(var i=0;i<e.attributes.length;i++){var o=e.attributes[i];if(attrEqualsExplicitly(o,r,n)||attrEqualsImplicitly(o,r,n,e)){return o}}return null}function findFirst(e,r){var n=i(r,e);if(n.length==0)throw"could not find xpath "+r;return n[0]}function findChilds(e,r,n){e=e.documentElement||e;var i=[];for(var o=0;o<e.childNodes.length;o++){var s=e.childNodes[o];if(s.localName==r&&(s.namespaceURI==n||!n)){i.push(s)}}return i}function attrEqualsExplicitly(e,r,n){return e.localName==r&&(e.namespaceURI==n||!n)}function attrEqualsImplicitly(e,r,n,i){return e.localName==r&&(!e.namespaceURI&&i.namespaceURI==n||!n)}var o={"&":"&amp;","<":"&lt;",'"':"&quot;","\r":"&#xD;","\n":"&#xA;","\t":"&#x9;"};var s={"&":"&amp;","<":"&lt;",">":"&gt;","\r":"&#xD;"};function encodeSpecialCharactersInAttribute(e){return e.replace(/([&<"\r\n\t])/g,(function(e,r){return o[r]}))}function encodeSpecialCharactersInText(e){return e.replace(/([&<>\r])/g,(function(e,r){return s[r]}))}r.findAttr=findAttr;r.findChilds=findChilds;r.encodeSpecialCharactersInAttribute=encodeSpecialCharactersInAttribute;r.encodeSpecialCharactersInText=encodeSpecialCharactersInText;r.findFirst=findFirst},197:function(e,r,n){r=e.exports=n(4982)},4326:function(e,r,n){var i=n(846);e.exports=({contentEncryptionMethod:e,keyInfo:r,encryptedContent:n})=>`\n<xenc:EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">\n <xenc:EncryptionMethod Algorithm="${i(e)}" />\n ${r}\n <xenc:CipherData>\n <xenc:CipherValue>${i(n)}</xenc:CipherValue>\n </xenc:CipherData>\n</xenc:EncryptedData>\n`},2159:function(e,r,n){var i=n(846);e.exports=({encryptionPublicCert:e,encryptedKey:r,keyEncryptionMethod:n})=>`\n<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">\n <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">\n <e:EncryptionMethod Algorithm="${i(n)}">\n <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />\n </e:EncryptionMethod>\n <KeyInfo>\n ${e}\n </KeyInfo>\n <e:CipherData>\n <e:CipherValue>${i(r)}</e:CipherValue>\n </e:CipherData>\n </e:EncryptedKey>\n</KeyInfo>\n`},6944:function(e,r,n){var i=n(6928),o=n(9896);var s={"encrypted-key":n(4326),keyinfo:n(2159)};function renderTemplate(e,r){return s[e](r)}function pemToCert(e){var r=/-----BEGIN CERTIFICATE-----([^-]*)-----END CERTIFICATE-----/g.exec(e);if(r.length>0){return r[1].replace(/[\n|\r\n]/g,"")}return null}function warnInsecureAlgorithm(e,r=true){if(r){console.warn(e+" is no longer recommended due to security reasons. Please deprecate its use as soon as possible.")}}e.exports={renderTemplate:renderTemplate,pemToCert:pemToCert,warnInsecureAlgorithm:warnInsecureAlgorithm}},4982:function(e,r,n){var i=n(6982);var o=n(8737);var s=n(8230);var a=n(6944);const u=["http://www.w3.org/2001/04/xmlenc#rsa-1_5","http://www.w3.org/2001/04/xmlenc#tripledes-cbc"];function encryptKeyInfoWithScheme(e,r,n,o){const s=n==="RSA-OAEP"?i.constants.RSA_PKCS1_OAEP_PADDING:i.constants.RSA_PKCS1_PADDING;const u=Buffer.isBuffer(e)?e:Buffer.from(e,"utf-8");try{var l=i.publicEncrypt({key:r.rsa_pub,padding:s},u);var c=l.toString("base64");var p={encryptedKey:c,encryptionPublicCert:"<X509Data><X509Certificate>"+a.pemToCert(r.pem.toString())+"</X509Certificate></X509Data>",keyEncryptionMethod:r.keyEncryptionAlgorithm};var h=a.renderTemplate("keyinfo",p);o(null,h)}catch(e){o(e)}}function encryptKeyInfo(e,r,n){if(!r)return n(new Error("must provide options"));if(!r.rsa_pub)return n(new Error("must provide options.rsa_pub with public key RSA"));if(!r.pem)return n(new Error("must provide options.pem with certificate"));if(!r.keyEncryptionAlgorithm)return n(new Error("encryption without encrypted key is not supported yet"));if(r.disallowEncryptionWithInsecureAlgorithm&&u.indexOf(r.keyEncryptionAlgorithm)>=0){return n(new Error("encryption algorithm "+r.keyEncryptionAlgorithm+"is not secure"))}switch(r.keyEncryptionAlgorithm){case"http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p":return encryptKeyInfoWithScheme(e,r,"RSA-OAEP",n);case"http://www.w3.org/2001/04/xmlenc#rsa-1_5":a.warnInsecureAlgorithm(r.keyEncryptionAlgorithm,r.warnInsecureAlgorithm);return encryptKeyInfoWithScheme(e,r,"RSAES-PKCS1-V1_5",n);default:return n(new Error("encryption key algorithm not supported"))}}function encrypt(e,r,n){if(!r)return n(new Error("must provide options"));if(!e)return n(new Error("must provide content to encrypt"));if(!r.rsa_pub)return n(new Error("rsa_pub option is mandatory and you should provide a valid RSA public key"));if(!r.pem)return n(new Error("pem option is mandatory and you should provide a valid x509 certificate encoded as PEM"));if(r.disallowEncryptionWithInsecureAlgorithm&&(u.indexOf(r.keyEncryptionAlgorithm)>=0||u.indexOf(r.encryptionAlgorithm)>=0)){return n(new Error("encryption algorithm "+r.keyEncryptionAlgorithm+" is not secure"))}r.input_encoding=r.input_encoding||"utf8";function generate_symmetric_key(e){switch(r.encryptionAlgorithm){case"http://www.w3.org/2001/04/xmlenc#aes128-cbc":i.randomBytes(16,e);break;case"http://www.w3.org/2001/04/xmlenc#aes256-cbc":i.randomBytes(32,e);break;case"http://www.w3.org/2009/xmlenc11#aes128-gcm":i.randomBytes(16,e);break;case"http://www.w3.org/2009/xmlenc11#aes256-gcm":i.randomBytes(32,e);break;case"http://www.w3.org/2001/04/xmlenc#tripledes-cbc":a.warnInsecureAlgorithm(r.encryptionAlgorithm,r.warnInsecureAlgorithm);i.randomBytes(24,e);break;default:i.randomBytes(32,e)}}function encrypt_content(n,i){switch(r.encryptionAlgorithm){case"http://www.w3.org/2001/04/xmlenc#aes128-cbc":encryptWithAlgorithm("aes-128-cbc",n,16,e,r.input_encoding,(function(e,r){if(e)return i(e);i(null,r)}));break;case"http://www.w3.org/2001/04/xmlenc#aes256-cbc":encryptWithAlgorithm("aes-256-cbc",n,16,e,r.input_encoding,(function(e,r){if(e)return i(e);i(null,r)}));break;case"http://www.w3.org/2009/xmlenc11#aes128-gcm":encryptWithAlgorithm("aes-128-gcm",n,12,e,r.input_encoding,(function(e,r){if(e)return i(e);i(null,r)}));break;case"http://www.w3.org/2009/xmlenc11#aes256-gcm":encryptWithAlgorithm("aes-256-gcm",n,12,e,r.input_encoding,(function(e,r){if(e)return i(e);i(null,r)}));break;case"http://www.w3.org/2001/04/xmlenc#tripledes-cbc":a.warnInsecureAlgorithm(r.encryptionAlgorithm,r.warnInsecureAlgorithm);encryptWithAlgorithm("des-ede3-cbc",n,8,e,r.input_encoding,(function(e,r){if(e)return i(e);i(null,r)}));break;default:i(new Error("encryption algorithm not supported"))}}function encrypt_key(e,n,i){encryptKeyInfo(e,r,(function(e,o){if(e)return i(e);var s=a.renderTemplate("encrypted-key",{encryptedContent:n.toString("base64"),keyInfo:o,contentEncryptionMethod:r.encryptionAlgorithm});i(null,s)}))}generate_symmetric_key((function(e,r){if(e){return n(e)}encrypt_content(r,(function(e,i){if(e){return n(e)}encrypt_key(r,i,(function(e,r){if(e){return n(e)}n(null,r)}))}))}))}function decrypt(e,r,n){if(!r)return n(new Error("must provide options"));if(!e)return n(new Error("must provide XML to encrypt"));if(!r.key)return n(new Error("key option is mandatory and you should provide a valid RSA private key"));try{var i=typeof e==="string"?(new o.DOMParser).parseFromString(e):e;var l=decryptKeyInfo(i,r);var c=s.select("//*[local-name(.)='EncryptedData']/*[local-name(.)='EncryptionMethod']",i)[0];var p=c.getAttribute("Algorithm");if(r.disallowDecryptionWithInsecureAlgorithm&&u.indexOf(p)>=0){return n(new Error("encryption algorithm "+p+" is not secure, fail to decrypt"))}var h=s.select("//*[local-name(.)='EncryptedData']/*[local-name(.)='CipherData']/*[local-name(.)='CipherValue']",i)[0];var f=Buffer.from(h.textContent,"base64");switch(p){case"http://www.w3.org/2001/04/xmlenc#aes128-cbc":return n(null,decryptWithAlgorithm("aes-128-cbc",l,16,f));case"http://www.w3.org/2001/04/xmlenc#aes256-cbc":return n(null,decryptWithAlgorithm("aes-256-cbc",l,16,f));case"http://www.w3.org/2001/04/xmlenc#tripledes-cbc":a.warnInsecureAlgorithm(p,r.warnInsecureAlgorithm);return n(null,decryptWithAlgorithm("des-ede3-cbc",l,8,f));case"http://www.w3.org/2009/xmlenc11#aes128-gcm":return n(null,decryptWithAlgorithm("aes-128-gcm",l,12,f));case"http://www.w3.org/2009/xmlenc11#aes256-gcm":return n(null,decryptWithAlgorithm("aes-256-gcm",l,12,f));default:return n(new Error("encryption algorithm "+p+" not supported"))}}catch(e){return n(e)}}function decryptKeyInfo(e,r){if(typeof e==="string")e=(new o.DOMParser).parseFromString(e);var n;var i=s.select("//*[local-name(.)='KeyInfo' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",e)[0];if(!i){i=s.select("//*[local-name(.)='EncryptedData']/*[local-name(.)='KeyInfo']",e)[0]}var l=s.select("//*[local-name(.)='KeyInfo']/*[local-name(.)='EncryptedKey']/*[local-name(.)='EncryptionMethod']",e)[0];if(!l){var c=s.select("//*[local-name(.)='EncryptedData']/*[local-name(.)='KeyInfo']/*[local-name(.)='RetrievalMethod']",e)[0];n=c?c.getAttribute("URI"):null;l=n?s.select("//*[local-name(.)='EncryptedKey' and @Id='"+n.substring(1)+"']/*[local-name(.)='EncryptionMethod']",e)[0]:null}if(!l){throw new Error("cant find encryption algorithm")}var p=l.getAttribute("Algorithm");if(r.disallowDecryptionWithInsecureAlgorithm&&u.indexOf(p)>=0){throw new Error("encryption algorithm "+p+" is not secure, fail to decrypt")}var h=n?s.select("//*[local-name(.)='EncryptedKey' and @Id='"+n.substring(1)+"']/*[local-name(.)='CipherData']/*[local-name(.)='CipherValue']",i)[0]:s.select("//*[local-name(.)='CipherValue']",i)[0];switch(p){case"http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p":return decryptKeyInfoWithScheme(h,r,"RSA-OAEP");case"http://www.w3.org/2001/04/xmlenc#rsa-1_5":a.warnInsecureAlgorithm(p,r.warnInsecureAlgorithm);return decryptKeyInfoWithScheme(h,r,"RSAES-PKCS1-V1_5");default:throw new Error("key encryption algorithm "+p+" not supported")}}function decryptKeyInfoWithScheme(e,r,n){var o=n==="RSA-OAEP"?i.constants.RSA_PKCS1_OAEP_PADDING:i.constants.RSA_PKCS1_PADDING;var s=Buffer.from(e.textContent,"base64");var a=i.privateDecrypt({key:r.key,padding:o},s);return Buffer.from(a,"binary")}function encryptWithAlgorithm(e,r,n,o,s,a){i.randomBytes(n,(function(n,u){if(n)return a(n);var l=i.createCipheriv(e,r,u);var c=l.update(o,s,"binary")+l.final("binary");var p=e.slice(-3)==="gcm"?l.getAuthTag():Buffer.from("");var h=Buffer.concat([u,Buffer.from(c,"binary"),p]);return a(null,h)}))}function decryptWithAlgorithm(e,r,n,o){var s=i.createDecipheriv(e,r,o.slice(0,n));s.setAutoPadding(false);if(e.slice(-3)==="gcm"){s.setAuthTag(o.slice(-16));o=o.slice(0,-16)}var a=s.update(o.slice(n),null,"binary")+s.final("binary");if(e.slice(-3)!=="gcm"){var u=a.charCodeAt(a.length-1);if(1<=u&&u<=n){a=a.substr(0,a.length-u)}else{callback(new Error("padding length invalid"));return}}return Buffer.from(a,"binary").toString("utf8")}r=e.exports={decrypt:decrypt,encrypt:encrypt,encryptKeyInfo:encryptKeyInfo,decryptKeyInfo:decryptKeyInfo}},4271:function(e,r){(function(){"use strict";r.stripBOM=function(e){if(e[0]==="\ufeff"){return e.substring(1)}else{return e}}}).call(this)},5454:function(e,r,n){(function(){"use strict";var e,i,o,s,a,u={}.hasOwnProperty;e=n(1203);i=n(2163).defaults;s=function(e){return typeof e==="string"&&(e.indexOf("&")>=0||e.indexOf(">")>=0||e.indexOf("<")>=0)};a=function(e){return"<![CDATA["+o(e)+"]]>"};o=function(e){return e.replace("]]>","]]]]><![CDATA[>")};r.Builder=function(){function Builder(e){var r,n,o;this.options={};n=i["0.2"];for(r in n){if(!u.call(n,r))continue;o=n[r];this.options[r]=o}for(r in e){if(!u.call(e,r))continue;o=e[r];this.options[r]=o}}Builder.prototype.buildObject=function(r){var n,o,l,c,p;n=this.options.attrkey;o=this.options.charkey;if(Object.keys(r).length===1&&this.options.rootName===i["0.2"].rootName){p=Object.keys(r)[0];r=r[p]}else{p=this.options.rootName}l=function(e){return function(r,i){var c,p,h,f,d,m;if(typeof i!=="object"){if(e.options.cdata&&s(i)){r.raw(a(i))}else{r.txt(i)}}else if(Array.isArray(i)){for(f in i){if(!u.call(i,f))continue;p=i[f];for(d in p){h=p[d];r=l(r.ele(d),h).up()}}}else{for(d in i){if(!u.call(i,d))continue;p=i[d];if(d===n){if(typeof p==="object"){for(c in p){m=p[c];r=r.att(c,m)}}}else if(d===o){if(e.options.cdata&&s(p)){r=r.raw(a(p))}else{r=r.txt(p)}}else if(Array.isArray(p)){for(f in p){if(!u.call(p,f))continue;h=p[f];if(typeof h==="string"){if(e.options.cdata&&s(h)){r=r.ele(d).raw(a(h)).up()}else{r=r.ele(d,h).up()}}else{r=l(r.ele(d),h).up()}}}else if(typeof p==="object"){r=l(r.ele(d),p).up()}else{if(typeof p==="string"&&e.options.cdata&&s(p)){r=r.ele(d).raw(a(p)).up()}else{if(p==null){p=""}r=r.ele(d,p.toString()).up()}}}}return r}}(this);c=e.create(p,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars});return l(c,r).end(this.options.renderOpts)};return Builder}()}).call(this)},2163:function(e,r){(function(){r.defaults={.1:{explicitCharkey:false,trim:true,normalize:true,normalizeTags:false,attrkey:"@",charkey:"#",explicitArray:false,ignoreAttrs:false,mergeAttrs:false,explicitRoot:false,validator:null,xmlns:false,explicitChildren:false,childkey:"@@",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:false,trim:false,normalize:false,normalizeTags:false,attrkey:"$",charkey:"_",explicitArray:true,ignoreAttrs:false,mergeAttrs:false,explicitRoot:true,validator:null,xmlns:false,explicitChildren:false,preserveChildrenOrder:false,childkey:"$$",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:true},doctype:null,renderOpts:{pretty:true,indent:" ",newline:"\n"},headless:false,chunkSize:1e4,emptyTag:"",cdata:false}}}).call(this)},2998:function(e,r,n){(function(){"use strict";var e,i,o,s,a,u,l,c,bind=function(e,r){return function(){return e.apply(r,arguments)}},extend=function(e,r){for(var n in r){if(p.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},p={}.hasOwnProperty;l=n(6426);o=n(4434);e=n(4271);u=n(1724);c=n(3557).setImmediate;i=n(2163).defaults;s=function(e){return typeof e==="object"&&e!=null&&Object.keys(e).length===0};a=function(e,r,n){var i,o,s;for(i=0,o=e.length;i<o;i++){s=e[i];r=s(r,n)}return r};r.Parser=function(n){extend(Parser,n);function Parser(e){this.parseStringPromise=bind(this.parseStringPromise,this);this.parseString=bind(this.parseString,this);this.reset=bind(this.reset,this);this.assignOrPush=bind(this.assignOrPush,this);this.processAsync=bind(this.processAsync,this);var n,o,s;if(!(this instanceof r.Parser)){return new r.Parser(e)}this.options={};o=i["0.2"];for(n in o){if(!p.call(o,n))continue;s=o[n];this.options[n]=s}for(n in e){if(!p.call(e,n))continue;s=e[n];this.options[n]=s}if(this.options.xmlns){this.options.xmlnskey=this.options.attrkey+"ns"}if(this.options.normalizeTags){if(!this.options.tagNameProcessors){this.options.tagNameProcessors=[]}this.options.tagNameProcessors.unshift(u.normalize)}this.reset()}Parser.prototype.processAsync=function(){var e,r;try{if(this.remaining.length<=this.options.chunkSize){e=this.remaining;this.remaining="";this.saxParser=this.saxParser.write(e);return this.saxParser.close()}else{e=this.remaining.substr(0,this.options.chunkSize);this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length);this.saxParser=this.saxParser.write(e);return c(this.processAsync)}}catch(e){r=e;if(!this.saxParser.errThrown){this.saxParser.errThrown=true;return this.emit(r)}}};Parser.prototype.assignOrPush=function(e,r,n){if(!(r in e)){if(!this.options.explicitArray){return e[r]=n}else{return e[r]=[n]}}else{if(!(e[r]instanceof Array)){e[r]=[e[r]]}return e[r].push(n)}};Parser.prototype.reset=function(){var e,r,n,i;this.removeAllListeners();this.saxParser=l.parser(this.options.strict,{trim:false,normalize:false,xmlns:this.options.xmlns});this.saxParser.errThrown=false;this.saxParser.onerror=function(e){return function(r){e.saxParser.resume();if(!e.saxParser.errThrown){e.saxParser.errThrown=true;return e.emit("error",r)}}}(this);this.saxParser.onend=function(e){return function(){if(!e.saxParser.ended){e.saxParser.ended=true;return e.emit("end",e.resultObject)}}}(this);this.saxParser.ended=false;this.EXPLICIT_CHARKEY=this.options.explicitCharkey;this.resultObject=null;i=[];e=this.options.attrkey;r=this.options.charkey;this.saxParser.onopentag=function(n){return function(o){var s,u,l,c,h;l=Object.create(null);l[r]="";if(!n.options.ignoreAttrs){h=o.attributes;for(s in h){if(!p.call(h,s))continue;if(!(e in l)&&!n.options.mergeAttrs){l[e]=Object.create(null)}u=n.options.attrValueProcessors?a(n.options.attrValueProcessors,o.attributes[s],s):o.attributes[s];c=n.options.attrNameProcessors?a(n.options.attrNameProcessors,s):s;if(n.options.mergeAttrs){n.assignOrPush(l,c,u)}else{l[e][c]=u}}}l["#name"]=n.options.tagNameProcessors?a(n.options.tagNameProcessors,o.name):o.name;if(n.options.xmlns){l[n.options.xmlnskey]={uri:o.uri,local:o.local}}return i.push(l)}}(this);this.saxParser.onclosetag=function(e){return function(){var n,o,u,l,c,h,f,d,m,g;h=i.pop();c=h["#name"];if(!e.options.explicitChildren||!e.options.preserveChildrenOrder){delete h["#name"]}if(h.cdata===true){n=h.cdata;delete h.cdata}m=i[i.length-1];if(h[r].match(/^\s*$/)&&!n){o=h[r];delete h[r]}else{if(e.options.trim){h[r]=h[r].trim()}if(e.options.normalize){h[r]=h[r].replace(/\s{2,}/g," ").trim()}h[r]=e.options.valueProcessors?a(e.options.valueProcessors,h[r],c):h[r];if(Object.keys(h).length===1&&r in h&&!e.EXPLICIT_CHARKEY){h=h[r]}}if(s(h)){if(typeof e.options.emptyTag==="function"){h=e.options.emptyTag()}else{h=e.options.emptyTag!==""?e.options.emptyTag:o}}if(e.options.validator!=null){g="/"+function(){var e,r,n;n=[];for(e=0,r=i.length;e<r;e++){l=i[e];n.push(l["#name"])}return n}().concat(c).join("/");(function(){var r;try{return h=e.options.validator(g,m&&m[c],h)}catch(n){r=n;return e.emit("error",r)}})()}if(e.options.explicitChildren&&!e.options.mergeAttrs&&typeof h==="object"){if(!e.options.preserveChildrenOrder){l=Object.create(null);if(e.options.attrkey in h){l[e.options.attrkey]=h[e.options.attrkey];delete h[e.options.attrkey]}if(!e.options.charsAsChildren&&e.options.charkey in h){l[e.options.charkey]=h[e.options.charkey];delete h[e.options.charkey]}if(Object.getOwnPropertyNames(h).length>0){l[e.options.childkey]=h}h=l}else if(m){m[e.options.childkey]=m[e.options.childkey]||[];f=Object.create(null);for(u in h){if(!p.call(h,u))continue;f[u]=h[u]}m[e.options.childkey].push(f);delete h["#name"];if(Object.keys(h).length===1&&r in h&&!e.EXPLICIT_CHARKEY){h=h[r]}}}if(i.length>0){return e.assignOrPush(m,c,h)}else{if(e.options.explicitRoot){d=h;h=Object.create(null);h[c]=d}e.resultObject=h;e.saxParser.ended=true;return e.emit("end",e.resultObject)}}}(this);n=function(e){return function(n){var o,s;s=i[i.length-1];if(s){s[r]+=n;if(e.options.explicitChildren&&e.options.preserveChildrenOrder&&e.options.charsAsChildren&&(e.options.includeWhiteChars||n.replace(/\\n/g,"").trim()!=="")){s[e.options.childkey]=s[e.options.childkey]||[];o={"#name":"__text__"};o[r]=n;if(e.options.normalize){o[r]=o[r].replace(/\s{2,}/g," ").trim()}s[e.options.childkey].push(o)}return s}}}(this);this.saxParser.ontext=n;return this.saxParser.oncdata=function(e){return function(e){var r;r=n(e);if(r){return r.cdata=true}}}(this)};Parser.prototype.parseString=function(r,n){var i;if(n!=null&&typeof n==="function"){this.on("end",(function(e){this.reset();return n(null,e)}));this.on("error",(function(e){this.reset();return n(e)}))}try{r=r.toString();if(r.trim()===""){this.emit("end",null);return true}r=e.stripBOM(r);if(this.options.async){this.remaining=r;c(this.processAsync);return this.saxParser}return this.saxParser.write(r).close()}catch(e){i=e;if(!(this.saxParser.errThrown||this.saxParser.ended)){this.emit("error",i);return this.saxParser.errThrown=true}else if(this.saxParser.ended){throw i}}};Parser.prototype.parseStringPromise=function(e){return new Promise(function(r){return function(n,i){return r.parseString(e,(function(e,r){if(e){return i(e)}else{return n(r)}}))}}(this))};return Parser}(o);r.parseString=function(e,n,i){var o,s,a;if(i!=null){if(typeof i==="function"){o=i}if(typeof n==="object"){s=n}}else{if(typeof n==="function"){o=n}s={}}a=new r.Parser(s);return a.parseString(e,o)};r.parseStringPromise=function(e,n){var i,o;if(typeof n==="object"){i=n}o=new r.Parser(i);return o.parseStringPromise(e)}}).call(this)},1724:function(e,r){(function(){"use strict";var e;e=new RegExp(/(?!xmlns)^.*:/);r.normalize=function(e){return e.toLowerCase()};r.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)};r.stripPrefix=function(r){return r.replace(e,"")};r.parseNumbers=function(e){if(!isNaN(e)){e=e%1===0?parseInt(e,10):parseFloat(e)}return e};r.parseBooleans=function(e){if(/^(?:true|false)$/i.test(e)){e=e.toLowerCase()==="true"}return e}}).call(this)},8123:function(e,r,n){(function(){"use strict";var e,i,o,s,extend=function(e,r){for(var n in r){if(a.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},a={}.hasOwnProperty;i=n(2163);e=n(5454);o=n(2998);s=n(1724);r.defaults=i.defaults;r.processors=s;r.ValidationError=function(e){extend(ValidationError,e);function ValidationError(e){this.message=e}return ValidationError}(Error);r.Builder=e.Builder;r.Parser=o.Parser;r.parseString=o.parseString;r.parseStringPromise=o.parseStringPromise}).call(this)},5921:function(e){(function(){e.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},1259:function(e){(function(){e.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(this)},7871:function(e){(function(){var r,n,i,o,s,a,u,l=[].slice,c={}.hasOwnProperty;r=function(){var e,r,n,i,o,a;a=arguments[0],o=2<=arguments.length?l.call(arguments,1):[];if(s(Object.assign)){Object.assign.apply(null,arguments)}else{for(e=0,n=o.length;e<n;e++){i=o[e];if(i!=null){for(r in i){if(!c.call(i,r))continue;a[r]=i[r]}}}}return a};s=function(e){return!!e&&Object.prototype.toString.call(e)==="[object Function]"};a=function(e){var r;return!!e&&((r=typeof e)==="function"||r==="object")};i=function(e){if(s(Array.isArray)){return Array.isArray(e)}else{return Object.prototype.toString.call(e)==="[object Array]"}};o=function(e){var r;if(i(e)){return!e.length}else{for(r in e){if(!c.call(e,r))continue;return false}return true}};u=function(e){var r,n;return a(e)&&(n=Object.getPrototypeOf(e))&&(r=n.constructor)&&typeof r==="function"&&r instanceof r&&Function.prototype.toString.call(r)===Function.prototype.toString.call(Object)};n=function(e){if(s(e.valueOf)){return e.valueOf()}else{return e}};e.exports.assign=r;e.exports.isFunction=s;e.exports.isObject=a;e.exports.isArray=i;e.exports.isEmpty=o;e.exports.isPlainObject=u;e.exports.getValue=n}).call(this)},5471:function(e){(function(){e.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},5696:function(e,r,n){(function(){var r,i,o;r=n(1259);o=n(7730);e.exports=i=function(){function XMLAttribute(e,n,i){this.parent=e;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}if(n==null){throw new Error("Missing attribute name. "+this.debugInfo(n))}this.name=this.stringify.name(n);this.value=this.stringify.attValue(i);this.type=r.Attribute;this.isId=false;this.schemaTypeInfo=null}Object.defineProperty(XMLAttribute.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLAttribute.prototype,"ownerElement",{get:function(){return this.parent}});Object.defineProperty(XMLAttribute.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}});Object.defineProperty(XMLAttribute.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLAttribute.prototype,"specified",{get:function(){return true}});XMLAttribute.prototype.clone=function(){return Object.create(this)};XMLAttribute.prototype.toString=function(e){return this.options.writer.attribute(this,this.options.writer.filterOptions(e))};XMLAttribute.prototype.debugInfo=function(e){e=e||this.name;if(e==null){return"parent: <"+this.parent.name+">"}else{return"attribute: {"+e+"}, parent: <"+this.parent.name+">"}};XMLAttribute.prototype.isEqualNode=function(e){if(e.namespaceURI!==this.namespaceURI){return false}if(e.prefix!==this.prefix){return false}if(e.localName!==this.localName){return false}if(e.value!==this.value){return false}return true};return XMLAttribute}()}).call(this)},3705:function(e,r,n){(function(){var r,i,o,extend=function(e,r){for(var n in r){if(s.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},s={}.hasOwnProperty;r=n(1259);o=n(8363);e.exports=i=function(e){extend(XMLCData,e);function XMLCData(e,n){XMLCData.__super__.constructor.call(this,e);if(n==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=r.CData;this.value=this.stringify.cdata(n)}XMLCData.prototype.clone=function(){return Object.create(this)};XMLCData.prototype.toString=function(e){return this.options.writer.cdata(this,this.options.writer.filterOptions(e))};return XMLCData}(o)}).call(this)},8363:function(e,r,n){(function(){var r,i,extend=function(e,r){for(var n in r){if(o.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},o={}.hasOwnProperty;i=n(7730);e.exports=r=function(e){extend(XMLCharacterData,e);function XMLCharacterData(e){XMLCharacterData.__super__.constructor.call(this,e);this.value=""}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(e){return this.value=e||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}});XMLCharacterData.prototype.clone=function(){return Object.create(this)};XMLCharacterData.prototype.substringData=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.appendData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.insertData=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.deleteData=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.replaceData=function(e,r,n){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.isEqualNode=function(e){if(!XMLCharacterData.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.data!==this.data){return false}return true};return XMLCharacterData}(i)}).call(this)},9677:function(e,r,n){(function(){var r,i,o,extend=function(e,r){for(var n in r){if(s.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},s={}.hasOwnProperty;r=n(1259);i=n(8363);e.exports=o=function(e){extend(XMLComment,e);function XMLComment(e,n){XMLComment.__super__.constructor.call(this,e);if(n==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=r.Comment;this.value=this.stringify.comment(n)}XMLComment.prototype.clone=function(){return Object.create(this)};XMLComment.prototype.toString=function(e){return this.options.writer.comment(this,this.options.writer.filterOptions(e))};return XMLComment}(i)}).call(this)},8844:function(e,r,n){(function(){var r,i,o;i=n(4426);o=n(4545);e.exports=r=function(){function XMLDOMConfiguration(){var e;this.defaultParams={"canonical-form":false,"cdata-sections":false,comments:false,"datatype-normalization":false,"element-content-whitespace":true,entities:true,"error-handler":new i,infoset:true,"validate-if-schema":false,namespaces:true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,validate:false,"well-formed":true};this.params=e=Object.create(this.defaultParams)}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new o(Object.keys(this.defaultParams))}});XMLDOMConfiguration.prototype.getParameter=function(e){if(this.params.hasOwnProperty(e)){return this.params[e]}else{return null}};XMLDOMConfiguration.prototype.canSetParameter=function(e,r){return true};XMLDOMConfiguration.prototype.setParameter=function(e,r){if(r!=null){return this.params[e]=r}else{return delete this.params[e]}};return XMLDOMConfiguration}()}).call(this)},4426:function(e){(function(){var r;e.exports=r=function(){function XMLDOMErrorHandler(){}XMLDOMErrorHandler.prototype.handleError=function(e){throw new Error(e)};return XMLDOMErrorHandler}()}).call(this)},1926:function(e){(function(){var r;e.exports=r=function(){function XMLDOMImplementation(){}XMLDOMImplementation.prototype.hasFeature=function(e,r){return true};XMLDOMImplementation.prototype.createDocumentType=function(e,r,n){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createDocument=function(e,r,n){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createHTMLDocument=function(e){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.getFeature=function(e,r){throw new Error("This DOM method is not implemented.")};return XMLDOMImplementation}()}).call(this)},4545:function(e){(function(){var r;e.exports=r=function(){function XMLDOMStringList(e){this.arr=e||[]}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});XMLDOMStringList.prototype.item=function(e){return this.arr[e]||null};XMLDOMStringList.prototype.contains=function(e){return this.arr.indexOf(e)!==-1};return XMLDOMStringList}()}).call(this)},5145:function(e,r,n){(function(){var r,i,o,extend=function(e,r){for(var n in r){if(s.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},s={}.hasOwnProperty;o=n(7730);r=n(1259);e.exports=i=function(e){extend(XMLDTDAttList,e);function XMLDTDAttList(e,n,i,o,s,a){XMLDTDAttList.__super__.constructor.call(this,e);if(n==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(i==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(n))}if(!o){throw new Error("Missing DTD attribute type. "+this.debugInfo(n))}if(!s){throw new Error("Missing DTD attribute default. "+this.debugInfo(n))}if(s.indexOf("#")!==0){s="#"+s}if(!s.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(n))}if(a&&!s.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=r.AttributeDeclaration;this.attributeName=this.stringify.name(i);this.attributeType=this.stringify.dtdAttType(o);if(a){this.defaultValue=this.stringify.dtdAttDefault(a)}this.defaultValueType=s}XMLDTDAttList.prototype.toString=function(e){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(e))};return XMLDTDAttList}(o)}).call(this)},362:function(e,r,n){(function(){var r,i,o,extend=function(e,r){for(var n in r){if(s.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},s={}.hasOwnProperty;o=n(7730);r=n(1259);e.exports=i=function(e){extend(XMLDTDElement,e);function XMLDTDElement(e,n,i){XMLDTDElement.__super__.constructor.call(this,e);if(n==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(!i){i="(#PCDATA)"}if(Array.isArray(i)){i="("+i.join(",")+")"}this.name=this.stringify.name(n);this.type=r.ElementDeclaration;this.value=this.stringify.dtdElementValue(i)}XMLDTDElement.prototype.toString=function(e){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(e))};return XMLDTDElement}(o)}).call(this)},7847:function(e,r,n){(function(){var r,i,o,s,extend=function(e,r){for(var n in r){if(a.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},a={}.hasOwnProperty;s=n(7871).isObject;o=n(7730);r=n(1259);e.exports=i=function(e){extend(XMLDTDEntity,e);function XMLDTDEntity(e,n,i,o){XMLDTDEntity.__super__.constructor.call(this,e);if(i==null){throw new Error("Missing DTD entity name. "+this.debugInfo(i))}if(o==null){throw new Error("Missing DTD entity value. "+this.debugInfo(i))}this.pe=!!n;this.name=this.stringify.name(i);this.type=r.EntityDeclaration;if(!s(o)){this.value=this.stringify.dtdEntityValue(o);this.internal=true}else{if(!o.pubID&&!o.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(i))}if(o.pubID&&!o.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(i))}this.internal=false;if(o.pubID!=null){this.pubID=this.stringify.dtdPubID(o.pubID)}if(o.sysID!=null){this.sysID=this.stringify.dtdSysID(o.sysID)}if(o.nData!=null){this.nData=this.stringify.dtdNData(o.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(i))}}}Object.defineProperty(XMLDTDEntity.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDEntity.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDTDEntity.prototype,"notationName",{get:function(){return this.nData||null}});Object.defineProperty(XMLDTDEntity.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlVersion",{get:function(){return null}});XMLDTDEntity.prototype.toString=function(e){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(e))};return XMLDTDEntity}(o)}).call(this)},5678:function(e,r,n){(function(){var r,i,o,extend=function(e,r){for(var n in r){if(s.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},s={}.hasOwnProperty;o=n(7730);r=n(1259);e.exports=i=function(e){extend(XMLDTDNotation,e);function XMLDTDNotation(e,n,i){XMLDTDNotation.__super__.constructor.call(this,e);if(n==null){throw new Error("Missing DTD notation name. "+this.debugInfo(n))}if(!i.pubID&&!i.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=r.NotationDeclaration;if(i.pubID!=null){this.pubID=this.stringify.dtdPubID(i.pubID)}if(i.sysID!=null){this.sysID=this.stringify.dtdSysID(i.sysID)}}Object.defineProperty(XMLDTDNotation.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDNotation.prototype,"systemId",{get:function(){return this.sysID}});XMLDTDNotation.prototype.toString=function(e){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(e))};return XMLDTDNotation}(o)}).call(this)},4684:function(e,r,n){(function(){var r,i,o,s,extend=function(e,r){for(var n in r){if(a.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},a={}.hasOwnProperty;s=n(7871).isObject;o=n(7730);r=n(1259);e.exports=i=function(e){extend(XMLDeclaration,e);function XMLDeclaration(e,n,i,o){var a;XMLDeclaration.__super__.constructor.call(this,e);if(s(n)){a=n,n=a.version,i=a.encoding,o=a.standalone}if(!n){n="1.0"}this.type=r.Declaration;this.version=this.stringify.xmlVersion(n);if(i!=null){this.encoding=this.stringify.xmlEncoding(i)}if(o!=null){this.standalone=this.stringify.xmlStandalone(o)}}XMLDeclaration.prototype.toString=function(e){return this.options.writer.declaration(this,this.options.writer.filterOptions(e))};return XMLDeclaration}(o)}).call(this)},5522:function(e,r,n){(function(){var r,i,o,s,a,u,l,c,p,extend=function(e,r){for(var n in r){if(h.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},h={}.hasOwnProperty;p=n(7871).isObject;c=n(7730);r=n(1259);i=n(5145);s=n(7847);o=n(362);a=n(5678);l=n(2359);e.exports=u=function(e){extend(XMLDocType,e);function XMLDocType(e,n,i){var o,s,a,u,l,c;XMLDocType.__super__.constructor.call(this,e);this.type=r.DocType;if(e.children){u=e.children;for(s=0,a=u.length;s<a;s++){o=u[s];if(o.type===r.Element){this.name=o.name;break}}}this.documentObject=e;if(p(n)){l=n,n=l.pubID,i=l.sysID}if(i==null){c=[n,i],i=c[0],n=c[1]}if(n!=null){this.pubID=this.stringify.dtdPubID(n)}if(i!=null){this.sysID=this.stringify.dtdSysID(i)}}Object.defineProperty(XMLDocType.prototype,"entities",{get:function(){var e,n,i,o,s;o={};s=this.children;for(n=0,i=s.length;n<i;n++){e=s[n];if(e.type===r.EntityDeclaration&&!e.pe){o[e.name]=e}}return new l(o)}});Object.defineProperty(XMLDocType.prototype,"notations",{get:function(){var e,n,i,o,s;o={};s=this.children;for(n=0,i=s.length;n<i;n++){e=s[n];if(e.type===r.NotationDeclaration){o[e.name]=e}}return new l(o)}});Object.defineProperty(XMLDocType.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDocType.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDocType.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLDocType.prototype.element=function(e,r){var n;n=new o(this,e,r);this.children.push(n);return this};XMLDocType.prototype.attList=function(e,r,n,o,s){var a;a=new i(this,e,r,n,o,s);this.children.push(a);return this};XMLDocType.prototype.entity=function(e,r){var n;n=new s(this,false,e,r);this.children.push(n);return this};XMLDocType.prototype.pEntity=function(e,r){var n;n=new s(this,true,e,r);this.children.push(n);return this};XMLDocType.prototype.notation=function(e,r){var n;n=new a(this,e,r);this.children.push(n);return this};XMLDocType.prototype.toString=function(e){return this.options.writer.docType(this,this.options.writer.filterOptions(e))};XMLDocType.prototype.ele=function(e,r){return this.element(e,r)};XMLDocType.prototype.att=function(e,r,n,i,o){return this.attList(e,r,n,i,o)};XMLDocType.prototype.ent=function(e,r){return this.entity(e,r)};XMLDocType.prototype.pent=function(e,r){return this.pEntity(e,r)};XMLDocType.prototype.not=function(e,r){return this.notation(e,r)};XMLDocType.prototype.up=function(){return this.root()||this.documentObject};XMLDocType.prototype.isEqualNode=function(e){if(!XMLDocType.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.name!==this.name){return false}if(e.publicId!==this.publicId){return false}if(e.systemId!==this.systemId){return false}return true};return XMLDocType}(c)}).call(this)},6047:function(e,r,n){(function(){var r,i,o,s,a,u,l,c,extend=function(e,r){for(var n in r){if(p.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},p={}.hasOwnProperty;c=n(7871).isPlainObject;o=n(1926);i=n(8844);a=n(7730);r=n(1259);l=n(5178);u=n(160);e.exports=s=function(e){extend(XMLDocument,e);function XMLDocument(e){XMLDocument.__super__.constructor.call(this,null);this.name="#document";this.type=r.Document;this.documentURI=null;this.domConfig=new i;e||(e={});if(!e.writer){e.writer=new u}this.options=e;this.stringify=new l(e)}Object.defineProperty(XMLDocument.prototype,"implementation",{value:new o});Object.defineProperty(XMLDocument.prototype,"doctype",{get:function(){var e,n,i,o;o=this.children;for(n=0,i=o.length;n<i;n++){e=o[n];if(e.type===r.DocType){return e}}return null}});Object.defineProperty(XMLDocument.prototype,"documentElement",{get:function(){return this.rootObject||null}});Object.defineProperty(XMLDocument.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"strictErrorChecking",{get:function(){return false}});Object.defineProperty(XMLDocument.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===r.Declaration){return this.children[0].encoding}else{return null}}});Object.defineProperty(XMLDocument.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===r.Declaration){return this.children[0].standalone==="yes"}else{return false}}});Object.defineProperty(XMLDocument.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===r.Declaration){return this.children[0].version}else{return"1.0"}}});Object.defineProperty(XMLDocument.prototype,"URL",{get:function(){return this.documentURI}});Object.defineProperty(XMLDocument.prototype,"origin",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"compatMode",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"characterSet",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"contentType",{get:function(){return null}});XMLDocument.prototype.end=function(e){var r;r={};if(!e){e=this.options.writer}else if(c(e)){r=e;e=this.options.writer}return e.document(this,e.filterOptions(r))};XMLDocument.prototype.toString=function(e){return this.options.writer.document(this,this.options.writer.filterOptions(e))};XMLDocument.prototype.createElement=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTextNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createComment=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createCDATASection=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createProcessingInstruction=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttribute=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEntityReference=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.importNode=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createElementNS=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttributeNS=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagNameNS=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementById=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.adoptNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.renameNode=function(e,r,n){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByClassName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEvent=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createNodeIterator=function(e,r,n){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTreeWalker=function(e,r,n){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLDocument}(a)}).call(this)},6698:function(e,r,n){(function(){var r,i,o,s,a,u,l,c,p,h,f,d,m,g,y,w,v,b,N,E,T,D,S,A,O={}.hasOwnProperty;A=n(7871),D=A.isObject,T=A.isFunction,S=A.isPlainObject,E=A.getValue;r=n(1259);d=n(6047);g=n(2520);s=n(3705);a=n(9677);w=n(8382);N=n(7389);y=n(7777);h=n(4684);f=n(5522);u=n(5145);c=n(7847);l=n(362);p=n(5678);o=n(5696);b=n(5178);v=n(160);i=n(5471);e.exports=m=function(){function XMLDocumentCB(e,n,i){var o;this.name="?xml";this.type=r.Document;e||(e={});o={};if(!e.writer){e.writer=new v}else if(S(e.writer)){o=e.writer;e.writer=new v}this.options=e;this.writer=e.writer;this.writerOptions=this.writer.filterOptions(o);this.stringify=new b(e);this.onDataCallback=n||function(){};this.onEndCallback=i||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}XMLDocumentCB.prototype.createChildNode=function(e){var n,i,o,s,a,u,l,c;switch(e.type){case r.CData:this.cdata(e.value);break;case r.Comment:this.comment(e.value);break;case r.Element:o={};l=e.attribs;for(i in l){if(!O.call(l,i))continue;n=l[i];o[i]=n.value}this.node(e.name,o);break;case r.Dummy:this.dummy();break;case r.Raw:this.raw(e.value);break;case r.Text:this.text(e.value);break;case r.ProcessingInstruction:this.instruction(e.target,e.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+e.constructor.name)}c=e.children;for(a=0,u=c.length;a<u;a++){s=c[a];this.createChildNode(s);if(s.type===r.Element){this.up()}}return this};XMLDocumentCB.prototype.dummy=function(){return this};XMLDocumentCB.prototype.node=function(e,r,n){var i;if(e==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(e))}this.openCurrent();e=E(e);if(r==null){r={}}r=E(r);if(!D(r)){i=[r,n],n=i[0],r=i[1]}this.currentNode=new g(this,e,r);this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;if(n!=null){this.text(n)}return this};XMLDocumentCB.prototype.element=function(e,n,i){var o,s,a,u,l,c;if(this.currentNode&&this.currentNode.type===r.DocType){this.dtdElement.apply(this,arguments)}else{if(Array.isArray(e)||D(e)||T(e)){u=this.options.noValidation;this.options.noValidation=true;c=new d(this.options).element("TEMP_ROOT");c.element(e);this.options.noValidation=u;l=c.children;for(s=0,a=l.length;s<a;s++){o=l[s];this.createChildNode(o);if(o.type===r.Element){this.up()}}}else{this.node(e,n,i)}}return this};XMLDocumentCB.prototype.attribute=function(e,r){var n,i;if(!this.currentNode||this.currentNode.children){throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(e))}if(e!=null){e=E(e)}if(D(e)){for(n in e){if(!O.call(e,n))continue;i=e[n];this.attribute(n,i)}}else{if(T(r)){r=r.apply()}if(this.options.keepNullAttributes&&r==null){this.currentNode.attribs[e]=new o(this,e,"")}else if(r!=null){this.currentNode.attribs[e]=new o(this,e,r)}}return this};XMLDocumentCB.prototype.text=function(e){var r;this.openCurrent();r=new N(this,e);this.onData(this.writer.text(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.cdata=function(e){var r;this.openCurrent();r=new s(this,e);this.onData(this.writer.cdata(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.comment=function(e){var r;this.openCurrent();r=new a(this,e);this.onData(this.writer.comment(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.raw=function(e){var r;this.openCurrent();r=new w(this,e);this.onData(this.writer.raw(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.instruction=function(e,r){var n,i,o,s,a;this.openCurrent();if(e!=null){e=E(e)}if(r!=null){r=E(r)}if(Array.isArray(e)){for(n=0,s=e.length;n<s;n++){i=e[n];this.instruction(i)}}else if(D(e)){for(i in e){if(!O.call(e,i))continue;o=e[i];this.instruction(i,o)}}else{if(T(r)){r=r.apply()}a=new y(this,e,r);this.onData(this.writer.processingInstruction(a,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this};XMLDocumentCB.prototype.declaration=function(e,r,n){var i;this.openCurrent();if(this.documentStarted){throw new Error("declaration() must be the first node.")}i=new h(this,e,r,n);this.onData(this.writer.declaration(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.doctype=function(e,r,n){this.openCurrent();if(e==null){throw new Error("Missing root node name.")}if(this.root){throw new Error("dtd() must come before the root node.")}this.currentNode=new f(this,r,n);this.currentNode.rootNodeName=e;this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;return this};XMLDocumentCB.prototype.dtdElement=function(e,r){var n;this.openCurrent();n=new l(this,e,r);this.onData(this.writer.dtdElement(n,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.attList=function(e,r,n,i,o){var s;this.openCurrent();s=new u(this,e,r,n,i,o);this.onData(this.writer.dtdAttList(s,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.entity=function(e,r){var n;this.openCurrent();n=new c(this,false,e,r);this.onData(this.writer.dtdEntity(n,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.pEntity=function(e,r){var n;this.openCurrent();n=new c(this,true,e,r);this.onData(this.writer.dtdEntity(n,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.notation=function(e,r){var n;this.openCurrent();n=new p(this,e,r);this.onData(this.writer.dtdNotation(n,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.up=function(){if(this.currentLevel<0){throw new Error("The document node has no parent.")}if(this.currentNode){if(this.currentNode.children){this.closeNode(this.currentNode)}else{this.openNode(this.currentNode)}this.currentNode=null}else{this.closeNode(this.openTags[this.currentLevel])}delete this.openTags[this.currentLevel];this.currentLevel--;return this};XMLDocumentCB.prototype.end=function(){while(this.currentLevel>=0){this.up()}return this.onEnd()};XMLDocumentCB.prototype.openCurrent=function(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}};XMLDocumentCB.prototype.openNode=function(e){var n,o,s,a;if(!e.isOpen){if(!this.root&&this.currentLevel===0&&e.type===r.Element){this.root=e}o="";if(e.type===r.Element){this.writerOptions.state=i.OpenTag;o=this.writer.indent(e,this.writerOptions,this.currentLevel)+"<"+e.name;a=e.attribs;for(s in a){if(!O.call(a,s))continue;n=a[s];o+=this.writer.attribute(n,this.writerOptions,this.currentLevel)}o+=(e.children?">":"/>")+this.writer.endline(e,this.writerOptions,this.currentLevel);this.writerOptions.state=i.InsideTag}else{this.writerOptions.state=i.OpenTag;o=this.writer.indent(e,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+e.rootNodeName;if(e.pubID&&e.sysID){o+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.sysID){o+=' SYSTEM "'+e.sysID+'"'}if(e.children){o+=" [";this.writerOptions.state=i.InsideTag}else{this.writerOptions.state=i.CloseTag;o+=">"}o+=this.writer.endline(e,this.writerOptions,this.currentLevel)}this.onData(o,this.currentLevel);return e.isOpen=true}};XMLDocumentCB.prototype.closeNode=function(e){var n;if(!e.isClosed){n="";this.writerOptions.state=i.CloseTag;if(e.type===r.Element){n=this.writer.indent(e,this.writerOptions,this.currentLevel)+"</"+e.name+">"+this.writer.endline(e,this.writerOptions,this.currentLevel)}else{n=this.writer.indent(e,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(e,this.writerOptions,this.currentLevel)}this.writerOptions.state=i.None;this.onData(n,this.currentLevel);return e.isClosed=true}};XMLDocumentCB.prototype.onData=function(e,r){this.documentStarted=true;return this.onDataCallback(e,r+1)};XMLDocumentCB.prototype.onEnd=function(){this.documentCompleted=true;return this.onEndCallback()};XMLDocumentCB.prototype.debugInfo=function(e){if(e==null){return""}else{return"node: <"+e+">"}};XMLDocumentCB.prototype.ele=function(){return this.element.apply(this,arguments)};XMLDocumentCB.prototype.nod=function(e,r,n){return this.node(e,r,n)};XMLDocumentCB.prototype.txt=function(e){return this.text(e)};XMLDocumentCB.prototype.dat=function(e){return this.cdata(e)};XMLDocumentCB.prototype.com=function(e){return this.comment(e)};XMLDocumentCB.prototype.ins=function(e,r){return this.instruction(e,r)};XMLDocumentCB.prototype.dec=function(e,r,n){return this.declaration(e,r,n)};XMLDocumentCB.prototype.dtd=function(e,r,n){return this.doctype(e,r,n)};XMLDocumentCB.prototype.e=function(e,r,n){return this.element(e,r,n)};XMLDocumentCB.prototype.n=function(e,r,n){return this.node(e,r,n)};XMLDocumentCB.prototype.t=function(e){return this.text(e)};XMLDocumentCB.prototype.d=function(e){return this.cdata(e)};XMLDocumentCB.prototype.c=function(e){return this.comment(e)};XMLDocumentCB.prototype.r=function(e){return this.raw(e)};XMLDocumentCB.prototype.i=function(e,r){return this.instruction(e,r)};XMLDocumentCB.prototype.att=function(){if(this.currentNode&&this.currentNode.type===r.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.a=function(){if(this.currentNode&&this.currentNode.type===r.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.ent=function(e,r){return this.entity(e,r)};XMLDocumentCB.prototype.pent=function(e,r){return this.pEntity(e,r)};XMLDocumentCB.prototype.not=function(e,r){return this.notation(e,r)};return XMLDocumentCB}()}).call(this)},6916:function(e,r,n){(function(){var r,i,o,extend=function(e,r){for(var n in r){if(s.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},s={}.hasOwnProperty;o=n(7730);r=n(1259);e.exports=i=function(e){extend(XMLDummy,e);function XMLDummy(e){XMLDummy.__super__.constructor.call(this,e);this.type=r.Dummy}XMLDummy.prototype.clone=function(){return Object.create(this)};XMLDummy.prototype.toString=function(e){return""};return XMLDummy}(o)}).call(this)},2520:function(e,r,n){(function(){var r,i,o,s,a,u,l,c,p,extend=function(e,r){for(var n in r){if(h.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},h={}.hasOwnProperty;p=n(7871),c=p.isObject,l=p.isFunction,u=p.getValue;a=n(7730);r=n(1259);i=n(5696);s=n(2359);e.exports=o=function(e){extend(XMLElement,e);function XMLElement(e,n,i){var o,s,a,u;XMLElement.__super__.constructor.call(this,e);if(n==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(n);this.type=r.Element;this.attribs={};this.schemaTypeInfo=null;if(i!=null){this.attribute(i)}if(e.type===r.Document){this.isRoot=true;this.documentObject=e;e.rootObject=this;if(e.children){u=e.children;for(s=0,a=u.length;s<a;s++){o=u[s];if(o.type===r.DocType){o.name=this.name;break}}}}}Object.defineProperty(XMLElement.prototype,"tagName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes){this.attributeMap=new s(this.attribs)}return this.attributeMap}});XMLElement.prototype.clone=function(){var e,r,n,i;n=Object.create(this);if(n.isRoot){n.documentObject=null}n.attribs={};i=this.attribs;for(r in i){if(!h.call(i,r))continue;e=i[r];n.attribs[r]=e.clone()}n.children=[];this.children.forEach((function(e){var r;r=e.clone();r.parent=n;return n.children.push(r)}));return n};XMLElement.prototype.attribute=function(e,r){var n,o;if(e!=null){e=u(e)}if(c(e)){for(n in e){if(!h.call(e,n))continue;o=e[n];this.attribute(n,o)}}else{if(l(r)){r=r.apply()}if(this.options.keepNullAttributes&&r==null){this.attribs[e]=new i(this,e,"")}else if(r!=null){this.attribs[e]=new i(this,e,r)}}return this};XMLElement.prototype.removeAttribute=function(e){var r,n,i;if(e==null){throw new Error("Missing attribute name. "+this.debugInfo())}e=u(e);if(Array.isArray(e)){for(n=0,i=e.length;n<i;n++){r=e[n];delete this.attribs[r]}}else{delete this.attribs[e]}return this};XMLElement.prototype.toString=function(e){return this.options.writer.element(this,this.options.writer.filterOptions(e))};XMLElement.prototype.att=function(e,r){return this.attribute(e,r)};XMLElement.prototype.a=function(e,r){return this.attribute(e,r)};XMLElement.prototype.getAttribute=function(e){if(this.attribs.hasOwnProperty(e)){return this.attribs[e].value}else{return null}};XMLElement.prototype.setAttribute=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNode=function(e){if(this.attribs.hasOwnProperty(e)){return this.attribs[e]}else{return null}};XMLElement.prototype.setAttributeNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNS=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNS=function(e,r,n){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNS=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNodeNS=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNodeNS=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.hasAttribute=function(e){return this.attribs.hasOwnProperty(e)};XMLElement.prototype.hasAttributeNS=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttribute=function(e,r){if(this.attribs.hasOwnProperty(e)){return this.attribs[e].isId}else{return r}};XMLElement.prototype.setIdAttributeNS=function(e,r,n){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttributeNode=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByClassName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.isEqualNode=function(e){var r,n,i;if(!XMLElement.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.namespaceURI!==this.namespaceURI){return false}if(e.prefix!==this.prefix){return false}if(e.localName!==this.localName){return false}if(e.attribs.length!==this.attribs.length){return false}for(r=n=0,i=this.attribs.length-1;0<=i?n<=i:n>=i;r=0<=i?++n:--n){if(!this.attribs[r].isEqualNode(e.attribs[r])){return false}}return true};return XMLElement}(a)}).call(this)},2359:function(e){(function(){var r;e.exports=r=function(){function XMLNamedNodeMap(e){this.nodes=e}Object.defineProperty(XMLNamedNodeMap.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});XMLNamedNodeMap.prototype.clone=function(){return this.nodes=null};XMLNamedNodeMap.prototype.getNamedItem=function(e){return this.nodes[e]};XMLNamedNodeMap.prototype.setNamedItem=function(e){var r;r=this.nodes[e.nodeName];this.nodes[e.nodeName]=e;return r||null};XMLNamedNodeMap.prototype.removeNamedItem=function(e){var r;r=this.nodes[e];delete this.nodes[e];return r||null};XMLNamedNodeMap.prototype.item=function(e){return this.nodes[Object.keys(this.nodes)[e]]||null};XMLNamedNodeMap.prototype.getNamedItemNS=function(e,r){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.setNamedItemNS=function(e){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.removeNamedItemNS=function(e,r){throw new Error("This DOM method is not implemented.")};return XMLNamedNodeMap}()}).call(this)},7730:function(e,r,n){(function(){var r,i,o,s,a,u,l,c,p,h,f,d,m,g,y,w,v,b,N,E={}.hasOwnProperty;N=n(7871),b=N.isObject,v=N.isFunction,w=N.isEmpty,y=N.getValue;c=null;o=null;s=null;a=null;u=null;m=null;g=null;d=null;l=null;i=null;f=null;p=null;r=null;e.exports=h=function(){function XMLNode(e){this.parent=e;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!c){c=n(2520);o=n(3705);s=n(9677);a=n(4684);u=n(5522);m=n(8382);g=n(7389);d=n(7777);l=n(6916);i=n(1259);f=n(2374);p=n(2359);r=n(5921)}}Object.defineProperty(XMLNode.prototype,"nodeName",{get:function(){return this.name}});Object.defineProperty(XMLNode.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLNode.prototype,"nodeValue",{get:function(){return this.value}});Object.defineProperty(XMLNode.prototype,"parentNode",{get:function(){return this.parent}});Object.defineProperty(XMLNode.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes){this.childNodeList=new f(this.children)}return this.childNodeList}});Object.defineProperty(XMLNode.prototype,"firstChild",{get:function(){return this.children[0]||null}});Object.defineProperty(XMLNode.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}});Object.defineProperty(XMLNode.prototype,"previousSibling",{get:function(){var e;e=this.parent.children.indexOf(this);return this.parent.children[e-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var e;e=this.parent.children.indexOf(this);return this.parent.children[e+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var e,r,n,o,s;if(this.nodeType===i.Element||this.nodeType===i.DocumentFragment){s="";o=this.children;for(r=0,n=o.length;r<n;r++){e=o[r];if(e.textContent){s+=e.textContent}}return s}else{return null}},set:function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLNode.prototype.setParent=function(e){var r,n,i,o,s;this.parent=e;if(e){this.options=e.options;this.stringify=e.stringify}o=this.children;s=[];for(n=0,i=o.length;n<i;n++){r=o[n];s.push(r.setParent(this))}return s};XMLNode.prototype.element=function(e,r,n){var i,o,s,a,u,l,c,p,h,f,d;l=null;if(r===null&&n==null){h=[{},null],r=h[0],n=h[1]}if(r==null){r={}}r=y(r);if(!b(r)){f=[r,n],n=f[0],r=f[1]}if(e!=null){e=y(e)}if(Array.isArray(e)){for(s=0,c=e.length;s<c;s++){o=e[s];l=this.element(o)}}else if(v(e)){l=this.element(e.apply())}else if(b(e)){for(u in e){if(!E.call(e,u))continue;d=e[u];if(v(d)){d=d.apply()}if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&u.indexOf(this.stringify.convertAttKey)===0){l=this.attribute(u.substr(this.stringify.convertAttKey.length),d)}else if(!this.options.separateArrayItems&&Array.isArray(d)&&w(d)){l=this.dummy()}else if(b(d)&&w(d)){l=this.element(u)}else if(!this.options.keepNullNodes&&d==null){l=this.dummy()}else if(!this.options.separateArrayItems&&Array.isArray(d)){for(a=0,p=d.length;a<p;a++){o=d[a];i={};i[u]=o;l=this.element(i)}}else if(b(d)){if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&u.indexOf(this.stringify.convertTextKey)===0){l=this.element(d)}else{l=this.element(u);l.element(d)}}else{l=this.element(u,d)}}}else if(!this.options.keepNullNodes&&n===null){l=this.dummy()}else{if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&e.indexOf(this.stringify.convertTextKey)===0){l=this.text(n)}else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&e.indexOf(this.stringify.convertCDataKey)===0){l=this.cdata(n)}else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&e.indexOf(this.stringify.convertCommentKey)===0){l=this.comment(n)}else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&e.indexOf(this.stringify.convertRawKey)===0){l=this.raw(n)}else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&e.indexOf(this.stringify.convertPIKey)===0){l=this.instruction(e.substr(this.stringify.convertPIKey.length),n)}else{l=this.node(e,r,n)}}if(l==null){throw new Error("Could not create any elements with: "+e+". "+this.debugInfo())}return l};XMLNode.prototype.insertBefore=function(e,r,n){var i,o,s,a,u;if(e!=null?e.type:void 0){s=e;a=r;s.setParent(this);if(a){o=children.indexOf(a);u=children.splice(o);children.push(s);Array.prototype.push.apply(children,u)}else{children.push(s)}return s}else{if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(e))}o=this.parent.children.indexOf(this);u=this.parent.children.splice(o);i=this.parent.element(e,r,n);Array.prototype.push.apply(this.parent.children,u);return i}};XMLNode.prototype.insertAfter=function(e,r,n){var i,o,s;if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(e))}o=this.parent.children.indexOf(this);s=this.parent.children.splice(o+1);i=this.parent.element(e,r,n);Array.prototype.push.apply(this.parent.children,s);return i};XMLNode.prototype.remove=function(){var e,r;if(this.isRoot){throw new Error("Cannot remove the root element. "+this.debugInfo())}e=this.parent.children.indexOf(this);[].splice.apply(this.parent.children,[e,e-e+1].concat(r=[])),r;return this.parent};XMLNode.prototype.node=function(e,r,n){var i,o;if(e!=null){e=y(e)}r||(r={});r=y(r);if(!b(r)){o=[r,n],n=o[0],r=o[1]}i=new c(this,e,r);if(n!=null){i.text(n)}this.children.push(i);return i};XMLNode.prototype.text=function(e){var r;if(b(e)){this.element(e)}r=new g(this,e);this.children.push(r);return this};XMLNode.prototype.cdata=function(e){var r;r=new o(this,e);this.children.push(r);return this};XMLNode.prototype.comment=function(e){var r;r=new s(this,e);this.children.push(r);return this};XMLNode.prototype.commentBefore=function(e){var r,n,i;n=this.parent.children.indexOf(this);i=this.parent.children.splice(n);r=this.parent.comment(e);Array.prototype.push.apply(this.parent.children,i);return this};XMLNode.prototype.commentAfter=function(e){var r,n,i;n=this.parent.children.indexOf(this);i=this.parent.children.splice(n+1);r=this.parent.comment(e);Array.prototype.push.apply(this.parent.children,i);return this};XMLNode.prototype.raw=function(e){var r;r=new m(this,e);this.children.push(r);return this};XMLNode.prototype.dummy=function(){var e;e=new l(this);return e};XMLNode.prototype.instruction=function(e,r){var n,i,o,s,a;if(e!=null){e=y(e)}if(r!=null){r=y(r)}if(Array.isArray(e)){for(s=0,a=e.length;s<a;s++){n=e[s];this.instruction(n)}}else if(b(e)){for(n in e){if(!E.call(e,n))continue;i=e[n];this.instruction(n,i)}}else{if(v(r)){r=r.apply()}o=new d(this,e,r);this.children.push(o)}return this};XMLNode.prototype.instructionBefore=function(e,r){var n,i,o;i=this.parent.children.indexOf(this);o=this.parent.children.splice(i);n=this.parent.instruction(e,r);Array.prototype.push.apply(this.parent.children,o);return this};XMLNode.prototype.instructionAfter=function(e,r){var n,i,o;i=this.parent.children.indexOf(this);o=this.parent.children.splice(i+1);n=this.parent.instruction(e,r);Array.prototype.push.apply(this.parent.children,o);return this};XMLNode.prototype.declaration=function(e,r,n){var o,s;o=this.document();s=new a(o,e,r,n);if(o.children.length===0){o.children.unshift(s)}else if(o.children[0].type===i.Declaration){o.children[0]=s}else{o.children.unshift(s)}return o.root()||o};XMLNode.prototype.dtd=function(e,r){var n,o,s,a,l,c,p,h,f,d;o=this.document();s=new u(o,e,r);f=o.children;for(a=l=0,p=f.length;l<p;a=++l){n=f[a];if(n.type===i.DocType){o.children[a]=s;return s}}d=o.children;for(a=c=0,h=d.length;c<h;a=++c){n=d[a];if(n.isRoot){o.children.splice(a,0,s);return s}}o.children.push(s);return s};XMLNode.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};XMLNode.prototype.root=function(){var e;e=this;while(e){if(e.type===i.Document){return e.rootObject}else if(e.isRoot){return e}else{e=e.parent}}};XMLNode.prototype.document=function(){var e;e=this;while(e){if(e.type===i.Document){return e}else{e=e.parent}}};XMLNode.prototype.end=function(e){return this.document().end(e)};XMLNode.prototype.prev=function(){var e;e=this.parent.children.indexOf(this);if(e<1){throw new Error("Already at the first node. "+this.debugInfo())}return this.parent.children[e-1]};XMLNode.prototype.next=function(){var e;e=this.parent.children.indexOf(this);if(e===-1||e===this.parent.children.length-1){throw new Error("Already at the last node. "+this.debugInfo())}return this.parent.children[e+1]};XMLNode.prototype.importDocument=function(e){var r;r=e.root().clone();r.parent=this;r.isRoot=false;this.children.push(r);return this};XMLNode.prototype.debugInfo=function(e){var r,n;e=e||this.name;if(e==null&&!((r=this.parent)!=null?r.name:void 0)){return""}else if(e==null){return"parent: <"+this.parent.name+">"}else if(!((n=this.parent)!=null?n.name:void 0)){return"node: <"+e+">"}else{return"node: <"+e+">, parent: <"+this.parent.name+">"}};XMLNode.prototype.ele=function(e,r,n){return this.element(e,r,n)};XMLNode.prototype.nod=function(e,r,n){return this.node(e,r,n)};XMLNode.prototype.txt=function(e){return this.text(e)};XMLNode.prototype.dat=function(e){return this.cdata(e)};XMLNode.prototype.com=function(e){return this.comment(e)};XMLNode.prototype.ins=function(e,r){return this.instruction(e,r)};XMLNode.prototype.doc=function(){return this.document()};XMLNode.prototype.dec=function(e,r,n){return this.declaration(e,r,n)};XMLNode.prototype.e=function(e,r,n){return this.element(e,r,n)};XMLNode.prototype.n=function(e,r,n){return this.node(e,r,n)};XMLNode.prototype.t=function(e){return this.text(e)};XMLNode.prototype.d=function(e){return this.cdata(e)};XMLNode.prototype.c=function(e){return this.comment(e)};XMLNode.prototype.r=function(e){return this.raw(e)};XMLNode.prototype.i=function(e,r){return this.instruction(e,r)};XMLNode.prototype.u=function(){return this.up()};XMLNode.prototype.importXMLBuilder=function(e){return this.importDocument(e)};XMLNode.prototype.replaceChild=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.removeChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.appendChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.hasChildNodes=function(){return this.children.length!==0};XMLNode.prototype.cloneNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isSupported=function(e,r){return true};XMLNode.prototype.hasAttributes=function(){return this.attribs.length!==0};XMLNode.prototype.compareDocumentPosition=function(e){var n,i;n=this;if(n===e){return 0}else if(this.document()!==e.document()){i=r.Disconnected|r.ImplementationSpecific;if(Math.random()<.5){i|=r.Preceding}else{i|=r.Following}return i}else if(n.isAncestor(e)){return r.Contains|r.Preceding}else if(n.isDescendant(e)){return r.Contains|r.Following}else if(n.isPreceding(e)){return r.Preceding}else{return r.Following}};XMLNode.prototype.isSameNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupPrefix=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isDefaultNamespace=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupNamespaceURI=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isEqualNode=function(e){var r,n,i;if(e.nodeType!==this.nodeType){return false}if(e.children.length!==this.children.length){return false}for(r=n=0,i=this.children.length-1;0<=i?n<=i:n>=i;r=0<=i?++n:--n){if(!this.children[r].isEqualNode(e.children[r])){return false}}return true};XMLNode.prototype.getFeature=function(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.setUserData=function(e,r,n){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.getUserData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.contains=function(e){if(!e){return false}return e===this||this.isDescendant(e)};XMLNode.prototype.isDescendant=function(e){var r,n,i,o,s;s=this.children;for(i=0,o=s.length;i<o;i++){r=s[i];if(e===r){return true}n=r.isDescendant(e);if(n){return true}}return false};XMLNode.prototype.isAncestor=function(e){return e.isDescendant(this)};XMLNode.prototype.isPreceding=function(e){var r,n;r=this.treePosition(e);n=this.treePosition(this);if(r===-1||n===-1){return false}else{return r<n}};XMLNode.prototype.isFollowing=function(e){var r,n;r=this.treePosition(e);n=this.treePosition(this);if(r===-1||n===-1){return false}else{return r>n}};XMLNode.prototype.treePosition=function(e){var r,n;n=0;r=false;this.foreachTreeNode(this.document(),(function(i){n++;if(!r&&i===e){return r=true}}));if(r){return n}else{return-1}};XMLNode.prototype.foreachTreeNode=function(e,r){var n,i,o,s,a;e||(e=this.document());s=e.children;for(i=0,o=s.length;i<o;i++){n=s[i];if(a=r(n)){return a}else{a=this.foreachTreeNode(n,r);if(a){return a}}}};return XMLNode}()}).call(this)},2374:function(e){(function(){var r;e.exports=r=function(){function XMLNodeList(e){this.nodes=e}Object.defineProperty(XMLNodeList.prototype,"length",{get:function(){return this.nodes.length||0}});XMLNodeList.prototype.clone=function(){return this.nodes=null};XMLNodeList.prototype.item=function(e){return this.nodes[e]||null};return XMLNodeList}()}).call(this)},7777:function(e,r,n){(function(){var r,i,o,extend=function(e,r){for(var n in r){if(s.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},s={}.hasOwnProperty;r=n(1259);i=n(8363);e.exports=o=function(e){extend(XMLProcessingInstruction,e);function XMLProcessingInstruction(e,n,i){XMLProcessingInstruction.__super__.constructor.call(this,e);if(n==null){throw new Error("Missing instruction target. "+this.debugInfo())}this.type=r.ProcessingInstruction;this.target=this.stringify.insTarget(n);this.name=this.target;if(i){this.value=this.stringify.insValue(i)}}XMLProcessingInstruction.prototype.clone=function(){return Object.create(this)};XMLProcessingInstruction.prototype.toString=function(e){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(e))};XMLProcessingInstruction.prototype.isEqualNode=function(e){if(!XMLProcessingInstruction.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.target!==this.target){return false}return true};return XMLProcessingInstruction}(i)}).call(this)},8382:function(e,r,n){(function(){var r,i,o,extend=function(e,r){for(var n in r){if(s.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},s={}.hasOwnProperty;r=n(1259);i=n(7730);e.exports=o=function(e){extend(XMLRaw,e);function XMLRaw(e,n){XMLRaw.__super__.constructor.call(this,e);if(n==null){throw new Error("Missing raw text. "+this.debugInfo())}this.type=r.Raw;this.value=this.stringify.raw(n)}XMLRaw.prototype.clone=function(){return Object.create(this)};XMLRaw.prototype.toString=function(e){return this.options.writer.raw(this,this.options.writer.filterOptions(e))};return XMLRaw}(i)}).call(this)},5345:function(e,r,n){(function(){var r,i,o,s,extend=function(e,r){for(var n in r){if(a.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},a={}.hasOwnProperty;r=n(1259);s=n(6664);i=n(5471);e.exports=o=function(e){extend(XMLStreamWriter,e);function XMLStreamWriter(e,r){this.stream=e;XMLStreamWriter.__super__.constructor.call(this,r)}XMLStreamWriter.prototype.endline=function(e,r,n){if(e.isLastRootNode&&r.state===i.CloseTag){return""}else{return XMLStreamWriter.__super__.endline.call(this,e,r,n)}};XMLStreamWriter.prototype.document=function(e,r){var n,i,o,s,a,u,l,c,p;l=e.children;for(i=o=0,a=l.length;o<a;i=++o){n=l[i];n.isLastRootNode=i===e.children.length-1}r=this.filterOptions(r);c=e.children;p=[];for(s=0,u=c.length;s<u;s++){n=c[s];p.push(this.writeChildNode(n,r,0))}return p};XMLStreamWriter.prototype.attribute=function(e,r,n){return this.stream.write(XMLStreamWriter.__super__.attribute.call(this,e,r,n))};XMLStreamWriter.prototype.cdata=function(e,r,n){return this.stream.write(XMLStreamWriter.__super__.cdata.call(this,e,r,n))};XMLStreamWriter.prototype.comment=function(e,r,n){return this.stream.write(XMLStreamWriter.__super__.comment.call(this,e,r,n))};XMLStreamWriter.prototype.declaration=function(e,r,n){return this.stream.write(XMLStreamWriter.__super__.declaration.call(this,e,r,n))};XMLStreamWriter.prototype.docType=function(e,r,n){var o,s,a,u;n||(n=0);this.openNode(e,r,n);r.state=i.OpenTag;this.stream.write(this.indent(e,r,n));this.stream.write("<!DOCTYPE "+e.root().name);if(e.pubID&&e.sysID){this.stream.write(' PUBLIC "'+e.pubID+'" "'+e.sysID+'"')}else if(e.sysID){this.stream.write(' SYSTEM "'+e.sysID+'"')}if(e.children.length>0){this.stream.write(" [");this.stream.write(this.endline(e,r,n));r.state=i.InsideTag;u=e.children;for(s=0,a=u.length;s<a;s++){o=u[s];this.writeChildNode(o,r,n+1)}r.state=i.CloseTag;this.stream.write("]")}r.state=i.CloseTag;this.stream.write(r.spaceBeforeSlash+">");this.stream.write(this.endline(e,r,n));r.state=i.None;return this.closeNode(e,r,n)};XMLStreamWriter.prototype.element=function(e,n,o){var s,u,l,c,p,h,f,d,m,g;o||(o=0);this.openNode(e,n,o);n.state=i.OpenTag;this.stream.write(this.indent(e,n,o)+"<"+e.name);m=e.attribs;for(f in m){if(!a.call(m,f))continue;s=m[f];this.attribute(s,n,o)}l=e.children.length;c=l===0?null:e.children[0];if(l===0||e.children.every((function(e){return(e.type===r.Text||e.type===r.Raw)&&e.value===""}))){if(n.allowEmpty){this.stream.write(">");n.state=i.CloseTag;this.stream.write("</"+e.name+">")}else{n.state=i.CloseTag;this.stream.write(n.spaceBeforeSlash+"/>")}}else if(n.pretty&&l===1&&(c.type===r.Text||c.type===r.Raw)&&c.value!=null){this.stream.write(">");n.state=i.InsideTag;n.suppressPrettyCount++;d=true;this.writeChildNode(c,n,o+1);n.suppressPrettyCount--;d=false;n.state=i.CloseTag;this.stream.write("</"+e.name+">")}else{this.stream.write(">"+this.endline(e,n,o));n.state=i.InsideTag;g=e.children;for(p=0,h=g.length;p<h;p++){u=g[p];this.writeChildNode(u,n,o+1)}n.state=i.CloseTag;this.stream.write(this.indent(e,n,o)+"</"+e.name+">")}this.stream.write(this.endline(e,n,o));n.state=i.None;return this.closeNode(e,n,o)};XMLStreamWriter.prototype.processingInstruction=function(e,r,n){return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this,e,r,n))};XMLStreamWriter.prototype.raw=function(e,r,n){return this.stream.write(XMLStreamWriter.__super__.raw.call(this,e,r,n))};XMLStreamWriter.prototype.text=function(e,r,n){return this.stream.write(XMLStreamWriter.__super__.text.call(this,e,r,n))};XMLStreamWriter.prototype.dtdAttList=function(e,r,n){return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this,e,r,n))};XMLStreamWriter.prototype.dtdElement=function(e,r,n){return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this,e,r,n))};XMLStreamWriter.prototype.dtdEntity=function(e,r,n){return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this,e,r,n))};XMLStreamWriter.prototype.dtdNotation=function(e,r,n){return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this,e,r,n))};return XMLStreamWriter}(s)}).call(this)},160:function(e,r,n){(function(){var r,i,extend=function(e,r){for(var n in r){if(o.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},o={}.hasOwnProperty;i=n(6664);e.exports=r=function(e){extend(XMLStringWriter,e);function XMLStringWriter(e){XMLStringWriter.__super__.constructor.call(this,e)}XMLStringWriter.prototype.document=function(e,r){var n,i,o,s,a;r=this.filterOptions(r);s="";a=e.children;for(i=0,o=a.length;i<o;i++){n=a[i];s+=this.writeChildNode(n,r,0)}if(r.pretty&&s.slice(-r.newline.length)===r.newline){s=s.slice(0,-r.newline.length)}return s};return XMLStringWriter}(i)}).call(this)},5178:function(e){(function(){var r,bind=function(e,r){return function(){return e.apply(r,arguments)}},n={}.hasOwnProperty;e.exports=r=function(){function XMLStringifier(e){this.assertLegalName=bind(this.assertLegalName,this);this.assertLegalChar=bind(this.assertLegalChar,this);var r,i,o;e||(e={});this.options=e;if(!this.options.version){this.options.version="1.0"}i=e.stringify||{};for(r in i){if(!n.call(i,r))continue;o=i[r];this[r]=o}}XMLStringifier.prototype.name=function(e){if(this.options.noValidation){return e}return this.assertLegalName(""+e||"")};XMLStringifier.prototype.text=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(this.textEscape(""+e||""))};XMLStringifier.prototype.cdata=function(e){if(this.options.noValidation){return e}e=""+e||"";e=e.replace("]]>","]]]]><![CDATA[>");return this.assertLegalChar(e)};XMLStringifier.prototype.comment=function(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+e)}return this.assertLegalChar(e)};XMLStringifier.prototype.raw=function(e){if(this.options.noValidation){return e}return""+e||""};XMLStringifier.prototype.attValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(this.attEscape(e=""+e||""))};XMLStringifier.prototype.insTarget=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.insValue=function(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/\?>/)){throw new Error("Invalid processing instruction value: "+e)}return this.assertLegalChar(e)};XMLStringifier.prototype.xmlVersion=function(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+e)}return e};XMLStringifier.prototype.xmlEncoding=function(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+e)}return this.assertLegalChar(e)};XMLStringifier.prototype.xmlStandalone=function(e){if(this.options.noValidation){return e}if(e){return"yes"}else{return"no"}};XMLStringifier.prototype.dtdPubID=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdSysID=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdElementValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdAttType=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdAttDefault=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdEntityValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdNData=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.convertAttKey="@";XMLStringifier.prototype.convertPIKey="?";XMLStringifier.prototype.convertTextKey="#text";XMLStringifier.prototype.convertCDataKey="#cdata";XMLStringifier.prototype.convertCommentKey="#comment";XMLStringifier.prototype.convertRawKey="#raw";XMLStringifier.prototype.assertLegalChar=function(e){var r,n;if(this.options.noValidation){return e}r="";if(this.options.version==="1.0"){r=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(n=e.match(r)){throw new Error("Invalid character in string: "+e+" at index "+n.index)}}else if(this.options.version==="1.1"){r=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(n=e.match(r)){throw new Error("Invalid character in string: "+e+" at index "+n.index)}}return e};XMLStringifier.prototype.assertLegalName=function(e){var r;if(this.options.noValidation){return e}this.assertLegalChar(e);r=/^([: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])*$/;if(!e.match(r)){throw new Error("Invalid character in name")}return e};XMLStringifier.prototype.textEscape=function(e){var r;if(this.options.noValidation){return e}r=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(r,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")};XMLStringifier.prototype.attEscape=function(e){var r;if(this.options.noValidation){return e}r=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(r,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")};return XMLStringifier}()}).call(this)},7389:function(e,r,n){(function(){var r,i,o,extend=function(e,r){for(var n in r){if(s.call(r,n))e[n]=r[n]}function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor;e.__super__=r.prototype;return e},s={}.hasOwnProperty;r=n(1259);i=n(8363);e.exports=o=function(e){extend(XMLText,e);function XMLText(e,n){XMLText.__super__.constructor.call(this,e);if(n==null){throw new Error("Missing element text. "+this.debugInfo())}this.name="#text";this.type=r.Text;this.value=this.stringify.text(n)}Object.defineProperty(XMLText.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLText.prototype,"wholeText",{get:function(){var e,r,n;n="";r=this.previousSibling;while(r){n=r.data+n;r=r.previousSibling}n+=this.data;e=this.nextSibling;while(e){n=n+e.data;e=e.nextSibling}return n}});XMLText.prototype.clone=function(){return Object.create(this)};XMLText.prototype.toString=function(e){return this.options.writer.text(this,this.options.writer.filterOptions(e))};XMLText.prototype.splitText=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLText.prototype.replaceWholeText=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLText}(i)}).call(this)},6664:function(e,r,n){(function(){var r,i,o,s,a,u,l,c,p,h,f,d,m,g,y,w,v,b={}.hasOwnProperty;v=n(7871).assign;r=n(1259);p=n(4684);h=n(5522);o=n(3705);s=n(9677);d=n(2520);g=n(8382);y=n(7389);m=n(7777);f=n(6916);a=n(5145);u=n(362);l=n(7847);c=n(5678);i=n(5471);e.exports=w=function(){function XMLWriterBase(e){var r,n,i;e||(e={});this.options=e;n=e.writer||{};for(r in n){if(!b.call(n,r))continue;i=n[r];this["_"+r]=this[r];this[r]=i}}XMLWriterBase.prototype.filterOptions=function(e){var r,n,o,s,a,u,l,c;e||(e={});e=v({},this.options,e);r={writer:this};r.pretty=e.pretty||false;r.allowEmpty=e.allowEmpty||false;r.indent=(n=e.indent)!=null?n:" ";r.newline=(o=e.newline)!=null?o:"\n";r.offset=(s=e.offset)!=null?s:0;r.dontPrettyTextNodes=(a=(u=e.dontPrettyTextNodes)!=null?u:e.dontprettytextnodes)!=null?a:0;r.spaceBeforeSlash=(l=(c=e.spaceBeforeSlash)!=null?c:e.spacebeforeslash)!=null?l:"";if(r.spaceBeforeSlash===true){r.spaceBeforeSlash=" "}r.suppressPrettyCount=0;r.user={};r.state=i.None;return r};XMLWriterBase.prototype.indent=function(e,r,n){var i;if(!r.pretty||r.suppressPrettyCount){return""}else if(r.pretty){i=(n||0)+r.offset+1;if(i>0){return new Array(i).join(r.indent)}}return""};XMLWriterBase.prototype.endline=function(e,r,n){if(!r.pretty||r.suppressPrettyCount){return""}else{return r.newline}};XMLWriterBase.prototype.attribute=function(e,r,n){var i;this.openAttribute(e,r,n);i=" "+e.name+'="'+e.value+'"';this.closeAttribute(e,r,n);return i};XMLWriterBase.prototype.cdata=function(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"<![CDATA[";r.state=i.InsideTag;o+=e.value;r.state=i.CloseTag;o+="]]>"+this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o};XMLWriterBase.prototype.comment=function(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"\x3c!-- ";r.state=i.InsideTag;o+=e.value;r.state=i.CloseTag;o+=" --\x3e"+this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o};XMLWriterBase.prototype.declaration=function(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"<?xml";r.state=i.InsideTag;o+=' version="'+e.version+'"';if(e.encoding!=null){o+=' encoding="'+e.encoding+'"'}if(e.standalone!=null){o+=' standalone="'+e.standalone+'"'}r.state=i.CloseTag;o+=r.spaceBeforeSlash+"?>";o+=this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o};XMLWriterBase.prototype.docType=function(e,r,n){var o,s,a,u,l;n||(n=0);this.openNode(e,r,n);r.state=i.OpenTag;u=this.indent(e,r,n);u+="<!DOCTYPE "+e.root().name;if(e.pubID&&e.sysID){u+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.sysID){u+=' SYSTEM "'+e.sysID+'"'}if(e.children.length>0){u+=" [";u+=this.endline(e,r,n);r.state=i.InsideTag;l=e.children;for(s=0,a=l.length;s<a;s++){o=l[s];u+=this.writeChildNode(o,r,n+1)}r.state=i.CloseTag;u+="]"}r.state=i.CloseTag;u+=r.spaceBeforeSlash+">";u+=this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return u};XMLWriterBase.prototype.element=function(e,n,o){var s,a,u,l,c,p,h,f,d,m,g,y,w,v;o||(o=0);m=false;g="";this.openNode(e,n,o);n.state=i.OpenTag;g+=this.indent(e,n,o)+"<"+e.name;y=e.attribs;for(d in y){if(!b.call(y,d))continue;s=y[d];g+=this.attribute(s,n,o)}u=e.children.length;l=u===0?null:e.children[0];if(u===0||e.children.every((function(e){return(e.type===r.Text||e.type===r.Raw)&&e.value===""}))){if(n.allowEmpty){g+=">";n.state=i.CloseTag;g+="</"+e.name+">"+this.endline(e,n,o)}else{n.state=i.CloseTag;g+=n.spaceBeforeSlash+"/>"+this.endline(e,n,o)}}else if(n.pretty&&u===1&&(l.type===r.Text||l.type===r.Raw)&&l.value!=null){g+=">";n.state=i.InsideTag;n.suppressPrettyCount++;m=true;g+=this.writeChildNode(l,n,o+1);n.suppressPrettyCount--;m=false;n.state=i.CloseTag;g+="</"+e.name+">"+this.endline(e,n,o)}else{if(n.dontPrettyTextNodes){w=e.children;for(c=0,h=w.length;c<h;c++){a=w[c];if((a.type===r.Text||a.type===r.Raw)&&a.value!=null){n.suppressPrettyCount++;m=true;break}}}g+=">"+this.endline(e,n,o);n.state=i.InsideTag;v=e.children;for(p=0,f=v.length;p<f;p++){a=v[p];g+=this.writeChildNode(a,n,o+1)}n.state=i.CloseTag;g+=this.indent(e,n,o)+"</"+e.name+">";if(m){n.suppressPrettyCount--}g+=this.endline(e,n,o);n.state=i.None}this.closeNode(e,n,o);return g};XMLWriterBase.prototype.writeChildNode=function(e,n,i){switch(e.type){case r.CData:return this.cdata(e,n,i);case r.Comment:return this.comment(e,n,i);case r.Element:return this.element(e,n,i);case r.Raw:return this.raw(e,n,i);case r.Text:return this.text(e,n,i);case r.ProcessingInstruction:return this.processingInstruction(e,n,i);case r.Dummy:return"";case r.Declaration:return this.declaration(e,n,i);case r.DocType:return this.docType(e,n,i);case r.AttributeDeclaration:return this.dtdAttList(e,n,i);case r.ElementDeclaration:return this.dtdElement(e,n,i);case r.EntityDeclaration:return this.dtdEntity(e,n,i);case r.NotationDeclaration:return this.dtdNotation(e,n,i);default:throw new Error("Unknown XML node type: "+e.constructor.name)}};XMLWriterBase.prototype.processingInstruction=function(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"<?";r.state=i.InsideTag;o+=e.target;if(e.value){o+=" "+e.value}r.state=i.CloseTag;o+=r.spaceBeforeSlash+"?>";o+=this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o};XMLWriterBase.prototype.raw=function(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n);r.state=i.InsideTag;o+=e.value;r.state=i.CloseTag;o+=this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o};XMLWriterBase.prototype.text=function(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n);r.state=i.InsideTag;o+=e.value;r.state=i.CloseTag;o+=this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o};XMLWriterBase.prototype.dtdAttList=function(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"<!ATTLIST";r.state=i.InsideTag;o+=" "+e.elementName+" "+e.attributeName+" "+e.attributeType;if(e.defaultValueType!=="#DEFAULT"){o+=" "+e.defaultValueType}if(e.defaultValue){o+=' "'+e.defaultValue+'"'}r.state=i.CloseTag;o+=r.spaceBeforeSlash+">"+this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o};XMLWriterBase.prototype.dtdElement=function(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"<!ELEMENT";r.state=i.InsideTag;o+=" "+e.name+" "+e.value;r.state=i.CloseTag;o+=r.spaceBeforeSlash+">"+this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o};XMLWriterBase.prototype.dtdEntity=function(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"<!ENTITY";r.state=i.InsideTag;if(e.pe){o+=" %"}o+=" "+e.name;if(e.value){o+=' "'+e.value+'"'}else{if(e.pubID&&e.sysID){o+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.sysID){o+=' SYSTEM "'+e.sysID+'"'}if(e.nData){o+=" NDATA "+e.nData}}r.state=i.CloseTag;o+=r.spaceBeforeSlash+">"+this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o};XMLWriterBase.prototype.dtdNotation=function(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"<!NOTATION";r.state=i.InsideTag;o+=" "+e.name;if(e.pubID&&e.sysID){o+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.pubID){o+=' PUBLIC "'+e.pubID+'"'}else if(e.sysID){o+=' SYSTEM "'+e.sysID+'"'}r.state=i.CloseTag;o+=r.spaceBeforeSlash+">"+this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o};XMLWriterBase.prototype.openNode=function(e,r,n){};XMLWriterBase.prototype.closeNode=function(e,r,n){};XMLWriterBase.prototype.openAttribute=function(e,r,n){};XMLWriterBase.prototype.closeAttribute=function(e,r,n){};return XMLWriterBase}()}).call(this)},1203:function(e,r,n){(function(){var r,i,o,s,a,u,l,c,p,h;h=n(7871),c=h.assign,p=h.isFunction;o=n(1926);s=n(6047);a=n(6698);l=n(160);u=n(5345);r=n(1259);i=n(5471);e.exports.create=function(e,r,n,i){var o,a;if(e==null){throw new Error("Root element needs a name.")}i=c({},r,n,i);o=new s(i);a=o.element(e);if(!i.headless){o.declaration(i);if(i.pubID!=null||i.sysID!=null){o.dtd(i)}}return a};e.exports.begin=function(e,r,n){var i;if(p(e)){i=[e,r],r=i[0],n=i[1];e={}}if(r){return new a(e,r,n)}else{return new s(e)}};e.exports.stringWriter=function(e){return new l(e)};e.exports.streamWriter=function(e,r){return new u(e,r)};e.exports.implementation=new o;e.exports.nodeType=r;e.exports.writerState=i}).call(this)},3468:function(e){(function(){e.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},7094:function(e){(function(){e.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(this)},7412:function(e){(function(){var r,n,i,o,s,a,u,l={}.hasOwnProperty;r=function(e,...r){var n,i,o,a;if(s(Object.assign)){Object.assign.apply(null,arguments)}else{for(n=0,o=r.length;n<o;n++){a=r[n];if(a!=null){for(i in a){if(!l.call(a,i))continue;e[i]=a[i]}}}}return e};s=function(e){return!!e&&Object.prototype.toString.call(e)==="[object Function]"};a=function(e){var r;return!!e&&((r=typeof e)==="function"||r==="object")};i=function(e){if(s(Array.isArray)){return Array.isArray(e)}else{return Object.prototype.toString.call(e)==="[object Array]"}};o=function(e){var r;if(i(e)){return!e.length}else{for(r in e){if(!l.call(e,r))continue;return false}return true}};u=function(e){var r,n;return a(e)&&(n=Object.getPrototypeOf(e))&&(r=n.constructor)&&typeof r==="function"&&r instanceof r&&Function.prototype.toString.call(r)===Function.prototype.toString.call(Object)};n=function(e){if(s(e.valueOf)){return e.valueOf()}else{return e}};e.exports.assign=r;e.exports.isFunction=s;e.exports.isObject=a;e.exports.isArray=i;e.exports.isEmpty=o;e.exports.isPlainObject=u;e.exports.getValue=n}).call(this)},2036:function(e){(function(){e.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},1645:function(e,r,n){(function(){var r,i,o;r=n(7094);o=n(3437);e.exports=i=function(){class XMLAttribute{constructor(e,n,i){this.parent=e;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}if(n==null){throw new Error("Missing attribute name. "+this.debugInfo(n))}this.name=this.stringify.name(n);this.value=this.stringify.attValue(i);this.type=r.Attribute;this.isId=false;this.schemaTypeInfo=null}clone(){return Object.create(this)}toString(e){return this.options.writer.attribute(this,this.options.writer.filterOptions(e))}debugInfo(e){e=e||this.name;if(e==null){return"parent: <"+this.parent.name+">"}else{return"attribute: {"+e+"}, parent: <"+this.parent.name+">"}}isEqualNode(e){if(e.namespaceURI!==this.namespaceURI){return false}if(e.prefix!==this.prefix){return false}if(e.localName!==this.localName){return false}if(e.value!==this.value){return false}return true}}Object.defineProperty(XMLAttribute.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLAttribute.prototype,"ownerElement",{get:function(){return this.parent}});Object.defineProperty(XMLAttribute.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}});Object.defineProperty(XMLAttribute.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLAttribute.prototype,"specified",{get:function(){return true}});return XMLAttribute}.call(this)}).call(this)},9188:function(e,r,n){(function(){var r,i,o;r=n(7094);o=n(3706);e.exports=i=class XMLCData extends o{constructor(e,n){super(e);if(n==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=r.CData;this.value=this.stringify.cdata(n)}clone(){return Object.create(this)}toString(e){return this.options.writer.cdata(this,this.options.writer.filterOptions(e))}}}).call(this)},3706:function(e,r,n){(function(){var r,i;i=n(3437);e.exports=r=function(){class XMLCharacterData extends i{constructor(e){super(e);this.value=""}clone(){return Object.create(this)}substringData(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendData(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}insertData(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}deleteData(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}replaceData(e,r,n){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(e){if(!super.isEqualNode(e)){return false}if(e.data!==this.data){return false}return true}}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(e){return this.value=e||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}});return XMLCharacterData}.call(this)}).call(this)},2448:function(e,r,n){(function(){var r,i,o;r=n(7094);i=n(3706);e.exports=o=class XMLComment extends i{constructor(e,n){super(e);if(n==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=r.Comment;this.value=this.stringify.comment(n)}clone(){return Object.create(this)}toString(e){return this.options.writer.comment(this,this.options.writer.filterOptions(e))}}}).call(this)},6319:function(e,r,n){(function(){var r,i,o;i=n(895);o=n(9784);e.exports=r=function(){class XMLDOMConfiguration{constructor(){var e;this.defaultParams={"canonical-form":false,"cdata-sections":false,comments:false,"datatype-normalization":false,"element-content-whitespace":true,entities:true,"error-handler":new i,infoset:true,"validate-if-schema":false,namespaces:true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,validate:false,"well-formed":true};this.params=e=Object.create(this.defaultParams)}getParameter(e){if(this.params.hasOwnProperty(e)){return this.params[e]}else{return null}}canSetParameter(e,r){return true}setParameter(e,r){if(r!=null){return this.params[e]=r}else{return delete this.params[e]}}}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new o(Object.keys(this.defaultParams))}});return XMLDOMConfiguration}.call(this)}).call(this)},895:function(e){(function(){var r;e.exports=r=class XMLDOMErrorHandler{constructor(){}handleError(e){throw new Error(e)}}}).call(this)},9391:function(e){(function(){var r;e.exports=r=class XMLDOMImplementation{hasFeature(e,r){return true}createDocumentType(e,r,n){throw new Error("This DOM method is not implemented.")}createDocument(e,r,n){throw new Error("This DOM method is not implemented.")}createHTMLDocument(e){throw new Error("This DOM method is not implemented.")}getFeature(e,r){throw new Error("This DOM method is not implemented.")}}}).call(this)},9784:function(e){(function(){var r;e.exports=r=function(){class XMLDOMStringList{constructor(e){this.arr=e||[]}item(e){return this.arr[e]||null}contains(e){return this.arr.indexOf(e)!==-1}}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});return XMLDOMStringList}.call(this)}).call(this)},3562:function(e,r,n){(function(){var r,i,o;o=n(3437);r=n(7094);e.exports=i=class XMLDTDAttList extends o{constructor(e,n,i,o,s,a){super(e);if(n==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(i==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(n))}if(!o){throw new Error("Missing DTD attribute type. "+this.debugInfo(n))}if(!s){throw new Error("Missing DTD attribute default. "+this.debugInfo(n))}if(s.indexOf("#")!==0){s="#"+s}if(!s.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(n))}if(a&&!s.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=r.AttributeDeclaration;this.attributeName=this.stringify.name(i);this.attributeType=this.stringify.dtdAttType(o);if(a){this.defaultValue=this.stringify.dtdAttDefault(a)}this.defaultValueType=s}toString(e){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(e))}}}).call(this)},8449:function(e,r,n){(function(){var r,i,o;o=n(3437);r=n(7094);e.exports=i=class XMLDTDElement extends o{constructor(e,n,i){super(e);if(n==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(!i){i="(#PCDATA)"}if(Array.isArray(i)){i="("+i.join(",")+")"}this.name=this.stringify.name(n);this.type=r.ElementDeclaration;this.value=this.stringify.dtdElementValue(i)}toString(e){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(e))}}}).call(this)},718:function(e,r,n){(function(){var r,i,o,s;({isObject:s}=n(7412));o=n(3437);r=n(7094);e.exports=i=function(){class XMLDTDEntity extends o{constructor(e,n,i,o){super(e);if(i==null){throw new Error("Missing DTD entity name. "+this.debugInfo(i))}if(o==null){throw new Error("Missing DTD entity value. "+this.debugInfo(i))}this.pe=!!n;this.name=this.stringify.name(i);this.type=r.EntityDeclaration;if(!s(o)){this.value=this.stringify.dtdEntityValue(o);this.internal=true}else{if(!o.pubID&&!o.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(i))}if(o.pubID&&!o.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(i))}this.internal=false;if(o.pubID!=null){this.pubID=this.stringify.dtdPubID(o.pubID)}if(o.sysID!=null){this.sysID=this.stringify.dtdSysID(o.sysID)}if(o.nData!=null){this.nData=this.stringify.dtdNData(o.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(i))}}}toString(e){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(e))}}Object.defineProperty(XMLDTDEntity.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDEntity.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDTDEntity.prototype,"notationName",{get:function(){return this.nData||null}});Object.defineProperty(XMLDTDEntity.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlVersion",{get:function(){return null}});return XMLDTDEntity}.call(this)}).call(this)},9567:function(e,r,n){(function(){var r,i,o;o=n(3437);r=n(7094);e.exports=i=function(){class XMLDTDNotation extends o{constructor(e,n,i){super(e);if(n==null){throw new Error("Missing DTD notation name. "+this.debugInfo(n))}if(!i.pubID&&!i.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=r.NotationDeclaration;if(i.pubID!=null){this.pubID=this.stringify.dtdPubID(i.pubID)}if(i.sysID!=null){this.sysID=this.stringify.dtdSysID(i.sysID)}}toString(e){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(e))}}Object.defineProperty(XMLDTDNotation.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDNotation.prototype,"systemId",{get:function(){return this.sysID}});return XMLDTDNotation}.call(this)}).call(this)},7609:function(e,r,n){(function(){var r,i,o,s;({isObject:s}=n(7412));o=n(3437);r=n(7094);e.exports=i=class XMLDeclaration extends o{constructor(e,n,i,o){super(e);if(s(n)){({version:n,encoding:i,standalone:o}=n)}if(!n){n="1.0"}this.type=r.Declaration;this.version=this.stringify.xmlVersion(n);if(i!=null){this.encoding=this.stringify.xmlEncoding(i)}if(o!=null){this.standalone=this.stringify.xmlStandalone(o)}}toString(e){return this.options.writer.declaration(this,this.options.writer.filterOptions(e))}}}).call(this)},8255:function(e,r,n){(function(){var r,i,o,s,a,u,l,c,p;({isObject:p}=n(7412));c=n(3437);r=n(7094);i=n(3562);s=n(718);o=n(8449);a=n(9567);l=n(5256);e.exports=u=function(){class XMLDocType extends c{constructor(e,n,i){var o,s,a,u;super(e);this.type=r.DocType;if(e.children){u=e.children;for(s=0,a=u.length;s<a;s++){o=u[s];if(o.type===r.Element){this.name=o.name;break}}}this.documentObject=e;if(p(n)){({pubID:n,sysID:i}=n)}if(i==null){[i,n]=[n,i]}if(n!=null){this.pubID=this.stringify.dtdPubID(n)}if(i!=null){this.sysID=this.stringify.dtdSysID(i)}}element(e,r){var n;n=new o(this,e,r);this.children.push(n);return this}attList(e,r,n,o,s){var a;a=new i(this,e,r,n,o,s);this.children.push(a);return this}entity(e,r){var n;n=new s(this,false,e,r);this.children.push(n);return this}pEntity(e,r){var n;n=new s(this,true,e,r);this.children.push(n);return this}notation(e,r){var n;n=new a(this,e,r);this.children.push(n);return this}toString(e){return this.options.writer.docType(this,this.options.writer.filterOptions(e))}ele(e,r){return this.element(e,r)}att(e,r,n,i,o){return this.attList(e,r,n,i,o)}ent(e,r){return this.entity(e,r)}pent(e,r){return this.pEntity(e,r)}not(e,r){return this.notation(e,r)}up(){return this.root()||this.documentObject}isEqualNode(e){if(!super.isEqualNode(e)){return false}if(e.name!==this.name){return false}if(e.publicId!==this.publicId){return false}if(e.systemId!==this.systemId){return false}return true}}Object.defineProperty(XMLDocType.prototype,"entities",{get:function(){var e,n,i,o,s;o={};s=this.children;for(n=0,i=s.length;n<i;n++){e=s[n];if(e.type===r.EntityDeclaration&&!e.pe){o[e.name]=e}}return new l(o)}});Object.defineProperty(XMLDocType.prototype,"notations",{get:function(){var e,n,i,o,s;o={};s=this.children;for(n=0,i=s.length;n<i;n++){e=s[n];if(e.type===r.NotationDeclaration){o[e.name]=e}}return new l(o)}});Object.defineProperty(XMLDocType.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDocType.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDocType.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});return XMLDocType}.call(this)}).call(this)},7632:function(e,r,n){(function(){var r,i,o,s,a,u,l,c;({isPlainObject:c}=n(7412));o=n(9391);i=n(6319);a=n(3437);r=n(7094);l=n(5179);u=n(1423);e.exports=s=function(){class XMLDocument extends a{constructor(e){super(null);this.name="#document";this.type=r.Document;this.documentURI=null;this.domConfig=new i;e||(e={});if(!e.writer){e.writer=new u}this.options=e;this.stringify=new l(e)}end(e){var r;r={};if(!e){e=this.options.writer}else if(c(e)){r=e;e=this.options.writer}return e.document(this,e.filterOptions(r))}toString(e){return this.options.writer.document(this,this.options.writer.filterOptions(e))}createElement(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}createDocumentFragment(){throw new Error("This DOM method is not implemented."+this.debugInfo())}createTextNode(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}createComment(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}createCDATASection(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}createProcessingInstruction(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createAttribute(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}createEntityReference(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}importNode(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createElementNS(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createAttributeNS(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementById(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}adoptNode(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}normalizeDocument(){throw new Error("This DOM method is not implemented."+this.debugInfo())}renameNode(e,r,n){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}createEvent(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}createRange(){throw new Error("This DOM method is not implemented."+this.debugInfo())}createNodeIterator(e,r,n){throw new Error("This DOM method is not implemented."+this.debugInfo())}createTreeWalker(e,r,n){throw new Error("This DOM method is not implemented."+this.debugInfo())}}Object.defineProperty(XMLDocument.prototype,"implementation",{value:new o});Object.defineProperty(XMLDocument.prototype,"doctype",{get:function(){var e,n,i,o;o=this.children;for(n=0,i=o.length;n<i;n++){e=o[n];if(e.type===r.DocType){return e}}return null}});Object.defineProperty(XMLDocument.prototype,"documentElement",{get:function(){return this.rootObject||null}});Object.defineProperty(XMLDocument.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"strictErrorChecking",{get:function(){return false}});Object.defineProperty(XMLDocument.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===r.Declaration){return this.children[0].encoding}else{return null}}});Object.defineProperty(XMLDocument.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===r.Declaration){return this.children[0].standalone==="yes"}else{return false}}});Object.defineProperty(XMLDocument.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===r.Declaration){return this.children[0].version}else{return"1.0"}}});Object.defineProperty(XMLDocument.prototype,"URL",{get:function(){return this.documentURI}});Object.defineProperty(XMLDocument.prototype,"origin",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"compatMode",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"characterSet",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"contentType",{get:function(){return null}});return XMLDocument}.call(this)}).call(this)},2745:function(e,r,n){(function(){var r,i,o,s,a,u,l,c,p,h,f,d,m,g,y,w,v,b,N,E,T,D,S,A={}.hasOwnProperty;({isObject:D,isFunction:T,isPlainObject:S,getValue:E}=n(7412));r=n(7094);d=n(7632);g=n(5265);s=n(9188);a=n(2448);w=n(8631);N=n(2742);y=n(5588);h=n(7609);f=n(8255);u=n(3562);c=n(718);l=n(8449);p=n(9567);o=n(1645);b=n(5179);v=n(1423);i=n(2036);e.exports=m=class XMLDocumentCB{constructor(e,n,i){var o;this.name="?xml";this.type=r.Document;e||(e={});o={};if(!e.writer){e.writer=new v}else if(S(e.writer)){o=e.writer;e.writer=new v}this.options=e;this.writer=e.writer;this.writerOptions=this.writer.filterOptions(o);this.stringify=new b(e);this.onDataCallback=n||function(){};this.onEndCallback=i||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}createChildNode(e){var n,i,o,s,a,u,l,c;switch(e.type){case r.CData:this.cdata(e.value);break;case r.Comment:this.comment(e.value);break;case r.Element:o={};l=e.attribs;for(i in l){if(!A.call(l,i))continue;n=l[i];o[i]=n.value}this.node(e.name,o);break;case r.Dummy:this.dummy();break;case r.Raw:this.raw(e.value);break;case r.Text:this.text(e.value);break;case r.ProcessingInstruction:this.instruction(e.target,e.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+e.constructor.name)}c=e.children;for(a=0,u=c.length;a<u;a++){s=c[a];this.createChildNode(s);if(s.type===r.Element){this.up()}}return this}dummy(){return this}node(e,r,n){if(e==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(e))}this.openCurrent();e=E(e);if(r==null){r={}}r=E(r);if(!D(r)){[n,r]=[r,n]}this.currentNode=new g(this,e,r);this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;if(n!=null){this.text(n)}return this}element(e,n,i){var o,s,a,u,l,c;if(this.currentNode&&this.currentNode.type===r.DocType){this.dtdElement(...arguments)}else{if(Array.isArray(e)||D(e)||T(e)){u=this.options.noValidation;this.options.noValidation=true;c=new d(this.options).element("TEMP_ROOT");c.element(e);this.options.noValidation=u;l=c.children;for(s=0,a=l.length;s<a;s++){o=l[s];this.createChildNode(o);if(o.type===r.Element){this.up()}}}else{this.node(e,n,i)}}return this}attribute(e,r){var n,i;if(!this.currentNode||this.currentNode.children){throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(e))}if(e!=null){e=E(e)}if(D(e)){for(n in e){if(!A.call(e,n))continue;i=e[n];this.attribute(n,i)}}else{if(T(r)){r=r.apply()}if(this.options.keepNullAttributes&&r==null){this.currentNode.attribs[e]=new o(this,e,"")}else if(r!=null){this.currentNode.attribs[e]=new o(this,e,r)}}return this}text(e){var r;this.openCurrent();r=new N(this,e);this.onData(this.writer.text(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}cdata(e){var r;this.openCurrent();r=new s(this,e);this.onData(this.writer.cdata(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}comment(e){var r;this.openCurrent();r=new a(this,e);this.onData(this.writer.comment(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}raw(e){var r;this.openCurrent();r=new w(this,e);this.onData(this.writer.raw(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}instruction(e,r){var n,i,o,s,a;this.openCurrent();if(e!=null){e=E(e)}if(r!=null){r=E(r)}if(Array.isArray(e)){for(n=0,s=e.length;n<s;n++){i=e[n];this.instruction(i)}}else if(D(e)){for(i in e){if(!A.call(e,i))continue;o=e[i];this.instruction(i,o)}}else{if(T(r)){r=r.apply()}a=new y(this,e,r);this.onData(this.writer.processingInstruction(a,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this}declaration(e,r,n){var i;this.openCurrent();if(this.documentStarted){throw new Error("declaration() must be the first node.")}i=new h(this,e,r,n);this.onData(this.writer.declaration(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}doctype(e,r,n){this.openCurrent();if(e==null){throw new Error("Missing root node name.")}if(this.root){throw new Error("dtd() must come before the root node.")}this.currentNode=new f(this,r,n);this.currentNode.rootNodeName=e;this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;return this}dtdElement(e,r){var n;this.openCurrent();n=new l(this,e,r);this.onData(this.writer.dtdElement(n,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}attList(e,r,n,i,o){var s;this.openCurrent();s=new u(this,e,r,n,i,o);this.onData(this.writer.dtdAttList(s,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}entity(e,r){var n;this.openCurrent();n=new c(this,false,e,r);this.onData(this.writer.dtdEntity(n,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}pEntity(e,r){var n;this.openCurrent();n=new c(this,true,e,r);this.onData(this.writer.dtdEntity(n,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}notation(e,r){var n;this.openCurrent();n=new p(this,e,r);this.onData(this.writer.dtdNotation(n,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}up(){if(this.currentLevel<0){throw new Error("The document node has no parent.")}if(this.currentNode){if(this.currentNode.children){this.closeNode(this.currentNode)}else{this.openNode(this.currentNode)}this.currentNode=null}else{this.closeNode(this.openTags[this.currentLevel])}delete this.openTags[this.currentLevel];this.currentLevel--;return this}end(){while(this.currentLevel>=0){this.up()}return this.onEnd()}openCurrent(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}}openNode(e){var n,o,s,a;if(!e.isOpen){if(!this.root&&this.currentLevel===0&&e.type===r.Element){this.root=e}o="";if(e.type===r.Element){this.writerOptions.state=i.OpenTag;o=this.writer.indent(e,this.writerOptions,this.currentLevel)+"<"+e.name;a=e.attribs;for(s in a){if(!A.call(a,s))continue;n=a[s];o+=this.writer.attribute(n,this.writerOptions,this.currentLevel)}o+=(e.children?">":"/>")+this.writer.endline(e,this.writerOptions,this.currentLevel);this.writerOptions.state=i.InsideTag}else{this.writerOptions.state=i.OpenTag;o=this.writer.indent(e,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+e.rootNodeName;if(e.pubID&&e.sysID){o+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.sysID){o+=' SYSTEM "'+e.sysID+'"'}if(e.children){o+=" [";this.writerOptions.state=i.InsideTag}else{this.writerOptions.state=i.CloseTag;o+=">"}o+=this.writer.endline(e,this.writerOptions,this.currentLevel)}this.onData(o,this.currentLevel);return e.isOpen=true}}closeNode(e){var n;if(!e.isClosed){n="";this.writerOptions.state=i.CloseTag;if(e.type===r.Element){n=this.writer.indent(e,this.writerOptions,this.currentLevel)+"</"+e.name+">"+this.writer.endline(e,this.writerOptions,this.currentLevel)}else{n=this.writer.indent(e,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(e,this.writerOptions,this.currentLevel)}this.writerOptions.state=i.None;this.onData(n,this.currentLevel);return e.isClosed=true}}onData(e,r){this.documentStarted=true;return this.onDataCallback(e,r+1)}onEnd(){this.documentCompleted=true;return this.onEndCallback()}debugInfo(e){if(e==null){return""}else{return"node: <"+e+">"}}ele(){return this.element(...arguments)}nod(e,r,n){return this.node(e,r,n)}txt(e){return this.text(e)}dat(e){return this.cdata(e)}com(e){return this.comment(e)}ins(e,r){return this.instruction(e,r)}dec(e,r,n){return this.declaration(e,r,n)}dtd(e,r,n){return this.doctype(e,r,n)}e(e,r,n){return this.element(e,r,n)}n(e,r,n){return this.node(e,r,n)}t(e){return this.text(e)}d(e){return this.cdata(e)}c(e){return this.comment(e)}r(e){return this.raw(e)}i(e,r){return this.instruction(e,r)}att(){if(this.currentNode&&this.currentNode.type===r.DocType){return this.attList(...arguments)}else{return this.attribute(...arguments)}}a(){if(this.currentNode&&this.currentNode.type===r.DocType){return this.attList(...arguments)}else{return this.attribute(...arguments)}}ent(e,r){return this.entity(e,r)}pent(e,r){return this.pEntity(e,r)}not(e,r){return this.notation(e,r)}}}).call(this)},3001:function(e,r,n){(function(){var r,i,o;o=n(3437);r=n(7094);e.exports=i=class XMLDummy extends o{constructor(e){super(e);this.type=r.Dummy}clone(){return Object.create(this)}toString(e){return""}}}).call(this)},5265:function(e,r,n){(function(){var r,i,o,s,a,u,l,c,p={}.hasOwnProperty;({isObject:c,isFunction:l,getValue:u}=n(7412));a=n(3437);r=n(7094);i=n(1645);s=n(5256);e.exports=o=function(){class XMLElement extends a{constructor(e,n,i){var o,s,a,u;super(e);if(n==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(n);this.type=r.Element;this.attribs={};this.schemaTypeInfo=null;if(i!=null){this.attribute(i)}if(e.type===r.Document){this.isRoot=true;this.documentObject=e;e.rootObject=this;if(e.children){u=e.children;for(s=0,a=u.length;s<a;s++){o=u[s];if(o.type===r.DocType){o.name=this.name;break}}}}}clone(){var e,r,n,i;n=Object.create(this);if(n.isRoot){n.documentObject=null}n.attribs={};i=this.attribs;for(r in i){if(!p.call(i,r))continue;e=i[r];n.attribs[r]=e.clone()}n.children=[];this.children.forEach((function(e){var r;r=e.clone();r.parent=n;return n.children.push(r)}));return n}attribute(e,r){var n,o;if(e!=null){e=u(e)}if(c(e)){for(n in e){if(!p.call(e,n))continue;o=e[n];this.attribute(n,o)}}else{if(l(r)){r=r.apply()}if(this.options.keepNullAttributes&&r==null){this.attribs[e]=new i(this,e,"")}else if(r!=null){this.attribs[e]=new i(this,e,r)}}return this}removeAttribute(e){var r,n,i;if(e==null){throw new Error("Missing attribute name. "+this.debugInfo())}e=u(e);if(Array.isArray(e)){for(n=0,i=e.length;n<i;n++){r=e[n];delete this.attribs[r]}}else{delete this.attribs[e]}return this}toString(e){return this.options.writer.element(this,this.options.writer.filterOptions(e))}att(e,r){return this.attribute(e,r)}a(e,r){return this.attribute(e,r)}getAttribute(e){if(this.attribs.hasOwnProperty(e)){return this.attribs[e].value}else{return null}}setAttribute(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNode(e){if(this.attribs.hasOwnProperty(e)){return this.attribs[e]}else{return null}}setAttributeNode(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeAttributeNode(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNS(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}setAttributeNS(e,r,n){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeAttributeNS(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNodeNS(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}setAttributeNodeNS(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}hasAttribute(e){return this.attribs.hasOwnProperty(e)}hasAttributeNS(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}setIdAttribute(e,r){if(this.attribs.hasOwnProperty(e)){return this.attribs[e].isId}else{return r}}setIdAttributeNS(e,r,n){throw new Error("This DOM method is not implemented."+this.debugInfo())}setIdAttributeNode(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(e){var r,n,i;if(!super.isEqualNode(e)){return false}if(e.namespaceURI!==this.namespaceURI){return false}if(e.prefix!==this.prefix){return false}if(e.localName!==this.localName){return false}if(e.attribs.length!==this.attribs.length){return false}for(r=n=0,i=this.attribs.length-1;0<=i?n<=i:n>=i;r=0<=i?++n:--n){if(!this.attribs[r].isEqualNode(e.attribs[r])){return false}}return true}}Object.defineProperty(XMLElement.prototype,"tagName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes){this.attributeMap=new s(this.attribs)}return this.attributeMap}});return XMLElement}.call(this)}).call(this)},5256:function(e){(function(){var r;e.exports=r=function(){class XMLNamedNodeMap{constructor(e){this.nodes=e}clone(){return this.nodes=null}getNamedItem(e){return this.nodes[e]}setNamedItem(e){var r;r=this.nodes[e.nodeName];this.nodes[e.nodeName]=e;return r||null}removeNamedItem(e){var r;r=this.nodes[e];delete this.nodes[e];return r||null}item(e){return this.nodes[Object.keys(this.nodes)[e]]||null}getNamedItemNS(e,r){throw new Error("This DOM method is not implemented.")}setNamedItemNS(e){throw new Error("This DOM method is not implemented.")}removeNamedItemNS(e,r){throw new Error("This DOM method is not implemented.")}}Object.defineProperty(XMLNamedNodeMap.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});return XMLNamedNodeMap}.call(this)}).call(this)},3437:function(e,r,n){(function(){var r,i,o,s,a,u,l,c,p,h,f,d,m,g,y,w,v,b,N={}.hasOwnProperty,E=[].splice;({isObject:b,isFunction:v,isEmpty:w,getValue:y}=n(7412));c=null;o=null;s=null;a=null;u=null;m=null;g=null;d=null;l=null;i=null;f=null;p=null;r=null;e.exports=h=function(){class XMLNode{constructor(e){this.parent=e;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!c){c=n(5265);o=n(9188);s=n(2448);a=n(7609);u=n(8255);m=n(8631);g=n(2742);d=n(5588);l=n(3001);i=n(7094);f=n(4897);p=n(5256);r=n(3468)}}setParent(e){var r,n,i,o,s;this.parent=e;if(e){this.options=e.options;this.stringify=e.stringify}o=this.children;s=[];for(n=0,i=o.length;n<i;n++){r=o[n];s.push(r.setParent(this))}return s}element(e,r,n){var i,o,s,a,u,l,c,p,h;l=null;if(r===null&&n==null){[r,n]=[{},null]}if(r==null){r={}}r=y(r);if(!b(r)){[n,r]=[r,n]}if(e!=null){e=y(e)}if(Array.isArray(e)){for(s=0,c=e.length;s<c;s++){o=e[s];l=this.element(o)}}else if(v(e)){l=this.element(e.apply())}else if(b(e)){for(u in e){if(!N.call(e,u))continue;h=e[u];if(v(h)){h=h.apply()}if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&u.indexOf(this.stringify.convertAttKey)===0){l=this.attribute(u.substr(this.stringify.convertAttKey.length),h)}else if(!this.options.separateArrayItems&&Array.isArray(h)&&w(h)){l=this.dummy()}else if(b(h)&&w(h)){l=this.element(u)}else if(!this.options.keepNullNodes&&h==null){l=this.dummy()}else if(!this.options.separateArrayItems&&Array.isArray(h)){for(a=0,p=h.length;a<p;a++){o=h[a];i={};i[u]=o;l=this.element(i)}}else if(b(h)){if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&u.indexOf(this.stringify.convertTextKey)===0){l=this.element(h)}else{l=this.element(u);l.element(h)}}else{l=this.element(u,h)}}}else if(!this.options.keepNullNodes&&n===null){l=this.dummy()}else{if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&e.indexOf(this.stringify.convertTextKey)===0){l=this.text(n)}else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&e.indexOf(this.stringify.convertCDataKey)===0){l=this.cdata(n)}else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&e.indexOf(this.stringify.convertCommentKey)===0){l=this.comment(n)}else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&e.indexOf(this.stringify.convertRawKey)===0){l=this.raw(n)}else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&e.indexOf(this.stringify.convertPIKey)===0){l=this.instruction(e.substr(this.stringify.convertPIKey.length),n)}else{l=this.node(e,r,n)}}if(l==null){throw new Error("Could not create any elements with: "+e+". "+this.debugInfo())}return l}insertBefore(e,r,n){var i,o,s,a,u;if(e!=null?e.type:void 0){s=e;a=r;s.setParent(this);if(a){o=children.indexOf(a);u=children.splice(o);children.push(s);Array.prototype.push.apply(children,u)}else{children.push(s)}return s}else{if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(e))}o=this.parent.children.indexOf(this);u=this.parent.children.splice(o);i=this.parent.element(e,r,n);Array.prototype.push.apply(this.parent.children,u);return i}}insertAfter(e,r,n){var i,o,s;if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(e))}o=this.parent.children.indexOf(this);s=this.parent.children.splice(o+1);i=this.parent.element(e,r,n);Array.prototype.push.apply(this.parent.children,s);return i}remove(){var e,r;if(this.isRoot){throw new Error("Cannot remove the root element. "+this.debugInfo())}e=this.parent.children.indexOf(this);E.apply(this.parent.children,[e,e-e+1].concat(r=[])),r;return this.parent}node(e,r,n){var i;if(e!=null){e=y(e)}r||(r={});r=y(r);if(!b(r)){[n,r]=[r,n]}i=new c(this,e,r);if(n!=null){i.text(n)}this.children.push(i);return i}text(e){var r;if(b(e)){this.element(e)}r=new g(this,e);this.children.push(r);return this}cdata(e){var r;r=new o(this,e);this.children.push(r);return this}comment(e){var r;r=new s(this,e);this.children.push(r);return this}commentBefore(e){var r,n,i;n=this.parent.children.indexOf(this);i=this.parent.children.splice(n);r=this.parent.comment(e);Array.prototype.push.apply(this.parent.children,i);return this}commentAfter(e){var r,n,i;n=this.parent.children.indexOf(this);i=this.parent.children.splice(n+1);r=this.parent.comment(e);Array.prototype.push.apply(this.parent.children,i);return this}raw(e){var r;r=new m(this,e);this.children.push(r);return this}dummy(){var e;e=new l(this);return e}instruction(e,r){var n,i,o,s,a;if(e!=null){e=y(e)}if(r!=null){r=y(r)}if(Array.isArray(e)){for(s=0,a=e.length;s<a;s++){n=e[s];this.instruction(n)}}else if(b(e)){for(n in e){if(!N.call(e,n))continue;i=e[n];this.instruction(n,i)}}else{if(v(r)){r=r.apply()}o=new d(this,e,r);this.children.push(o)}return this}instructionBefore(e,r){var n,i,o;i=this.parent.children.indexOf(this);o=this.parent.children.splice(i);n=this.parent.instruction(e,r);Array.prototype.push.apply(this.parent.children,o);return this}instructionAfter(e,r){var n,i,o;i=this.parent.children.indexOf(this);o=this.parent.children.splice(i+1);n=this.parent.instruction(e,r);Array.prototype.push.apply(this.parent.children,o);return this}declaration(e,r,n){var o,s;o=this.document();s=new a(o,e,r,n);if(o.children.length===0){o.children.unshift(s)}else if(o.children[0].type===i.Declaration){o.children[0]=s}else{o.children.unshift(s)}return o.root()||o}dtd(e,r){var n,o,s,a,l,c,p,h,f,d;o=this.document();s=new u(o,e,r);f=o.children;for(a=l=0,p=f.length;l<p;a=++l){n=f[a];if(n.type===i.DocType){o.children[a]=s;return s}}d=o.children;for(a=c=0,h=d.length;c<h;a=++c){n=d[a];if(n.isRoot){o.children.splice(a,0,s);return s}}o.children.push(s);return s}up(){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}root(){var e;e=this;while(e){if(e.type===i.Document){return e.rootObject}else if(e.isRoot){return e}else{e=e.parent}}}document(){var e;e=this;while(e){if(e.type===i.Document){return e}else{e=e.parent}}}end(e){return this.document().end(e)}prev(){var e;e=this.parent.children.indexOf(this);if(e<1){throw new Error("Already at the first node. "+this.debugInfo())}return this.parent.children[e-1]}next(){var e;e=this.parent.children.indexOf(this);if(e===-1||e===this.parent.children.length-1){throw new Error("Already at the last node. "+this.debugInfo())}return this.parent.children[e+1]}importDocument(e){var r,n,o,s,a;n=e.root().clone();n.parent=this;n.isRoot=false;this.children.push(n);if(this.type===i.Document){n.isRoot=true;n.documentObject=this;this.rootObject=n;if(this.children){a=this.children;for(o=0,s=a.length;o<s;o++){r=a[o];if(r.type===i.DocType){r.name=n.name;break}}}}return this}debugInfo(e){var r,n;e=e||this.name;if(e==null&&!((r=this.parent)!=null?r.name:void 0)){return""}else if(e==null){return"parent: <"+this.parent.name+">"}else if(!((n=this.parent)!=null?n.name:void 0)){return"node: <"+e+">"}else{return"node: <"+e+">, parent: <"+this.parent.name+">"}}ele(e,r,n){return this.element(e,r,n)}nod(e,r,n){return this.node(e,r,n)}txt(e){return this.text(e)}dat(e){return this.cdata(e)}com(e){return this.comment(e)}ins(e,r){return this.instruction(e,r)}doc(){return this.document()}dec(e,r,n){return this.declaration(e,r,n)}e(e,r,n){return this.element(e,r,n)}n(e,r,n){return this.node(e,r,n)}t(e){return this.text(e)}d(e){return this.cdata(e)}c(e){return this.comment(e)}r(e){return this.raw(e)}i(e,r){return this.instruction(e,r)}u(){return this.up()}importXMLBuilder(e){return this.importDocument(e)}attribute(e,r){throw new Error("attribute() applies to element nodes only.")}att(e,r){return this.attribute(e,r)}a(e,r){return this.attribute(e,r)}removeAttribute(e){throw new Error("attribute() applies to element nodes only.")}replaceChild(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeChild(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendChild(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}hasChildNodes(){return this.children.length!==0}cloneNode(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}normalize(){throw new Error("This DOM method is not implemented."+this.debugInfo())}isSupported(e,r){return true}hasAttributes(){return this.attribs.length!==0}compareDocumentPosition(e){var n,i;n=this;if(n===e){return 0}else if(this.document()!==e.document()){i=r.Disconnected|r.ImplementationSpecific;if(Math.random()<.5){i|=r.Preceding}else{i|=r.Following}return i}else if(n.isAncestor(e)){return r.Contains|r.Preceding}else if(n.isDescendant(e)){return r.Contains|r.Following}else if(n.isPreceding(e)){return r.Preceding}else{return r.Following}}isSameNode(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupPrefix(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}isDefaultNamespace(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupNamespaceURI(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(e){var r,n,i;if(e.nodeType!==this.nodeType){return false}if(e.children.length!==this.children.length){return false}for(r=n=0,i=this.children.length-1;0<=i?n<=i:n>=i;r=0<=i?++n:--n){if(!this.children[r].isEqualNode(e.children[r])){return false}}return true}getFeature(e,r){throw new Error("This DOM method is not implemented."+this.debugInfo())}setUserData(e,r,n){throw new Error("This DOM method is not implemented."+this.debugInfo())}getUserData(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}contains(e){if(!e){return false}return e===this||this.isDescendant(e)}isDescendant(e){var r,n,i,o,s;s=this.children;for(i=0,o=s.length;i<o;i++){r=s[i];if(e===r){return true}n=r.isDescendant(e);if(n){return true}}return false}isAncestor(e){return e.isDescendant(this)}isPreceding(e){var r,n;r=this.treePosition(e);n=this.treePosition(this);if(r===-1||n===-1){return false}else{return r<n}}isFollowing(e){var r,n;r=this.treePosition(e);n=this.treePosition(this);if(r===-1||n===-1){return false}else{return r>n}}treePosition(e){var r,n;n=0;r=false;this.foreachTreeNode(this.document(),(function(i){n++;if(!r&&i===e){return r=true}}));if(r){return n}else{return-1}}foreachTreeNode(e,r){var n,i,o,s,a;e||(e=this.document());s=e.children;for(i=0,o=s.length;i<o;i++){n=s[i];if(a=r(n)){return a}else{a=this.foreachTreeNode(n,r);if(a){return a}}}}}Object.defineProperty(XMLNode.prototype,"nodeName",{get:function(){return this.name}});Object.defineProperty(XMLNode.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLNode.prototype,"nodeValue",{get:function(){return this.value}});Object.defineProperty(XMLNode.prototype,"parentNode",{get:function(){return this.parent}});Object.defineProperty(XMLNode.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes){this.childNodeList=new f(this.children)}return this.childNodeList}});Object.defineProperty(XMLNode.prototype,"firstChild",{get:function(){return this.children[0]||null}});Object.defineProperty(XMLNode.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}});Object.defineProperty(XMLNode.prototype,"previousSibling",{get:function(){var e;e=this.parent.children.indexOf(this);return this.parent.children[e-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var e;e=this.parent.children.indexOf(this);return this.parent.children[e+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var e,r,n,o,s;if(this.nodeType===i.Element||this.nodeType===i.DocumentFragment){s="";o=this.children;for(r=0,n=o.length;r<n;r++){e=o[r];if(e.textContent){s+=e.textContent}}return s}else{return null}},set:function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}});return XMLNode}.call(this)}).call(this)},4897:function(e){(function(){var r;e.exports=r=function(){class XMLNodeList{constructor(e){this.nodes=e}clone(){return this.nodes=null}item(e){return this.nodes[e]||null}}Object.defineProperty(XMLNodeList.prototype,"length",{get:function(){return this.nodes.length||0}});return XMLNodeList}.call(this)}).call(this)},5588:function(e,r,n){(function(){var r,i,o;r=n(7094);i=n(3706);e.exports=o=class XMLProcessingInstruction extends i{constructor(e,n,i){super(e);if(n==null){throw new Error("Missing instruction target. "+this.debugInfo())}this.type=r.ProcessingInstruction;this.target=this.stringify.insTarget(n);this.name=this.target;if(i){this.value=this.stringify.insValue(i)}}clone(){return Object.create(this)}toString(e){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(e))}isEqualNode(e){if(!super.isEqualNode(e)){return false}if(e.target!==this.target){return false}return true}}}).call(this)},8631:function(e,r,n){(function(){var r,i,o;r=n(7094);i=n(3437);e.exports=o=class XMLRaw extends i{constructor(e,n){super(e);if(n==null){throw new Error("Missing raw text. "+this.debugInfo())}this.type=r.Raw;this.value=this.stringify.raw(n)}clone(){return Object.create(this)}toString(e){return this.options.writer.raw(this,this.options.writer.filterOptions(e))}}}).call(this)},7642:function(e,r,n){(function(){var r,i,o,s,a={}.hasOwnProperty;r=n(7094);s=n(723);i=n(2036);e.exports=o=class XMLStreamWriter extends s{constructor(e,r){super(r);this.stream=e}endline(e,r,n){if(e.isLastRootNode&&r.state===i.CloseTag){return""}else{return super.endline(e,r,n)}}document(e,r){var n,i,o,s,a,u,l,c,p;l=e.children;for(i=o=0,a=l.length;o<a;i=++o){n=l[i];n.isLastRootNode=i===e.children.length-1}r=this.filterOptions(r);c=e.children;p=[];for(s=0,u=c.length;s<u;s++){n=c[s];p.push(this.writeChildNode(n,r,0))}return p}cdata(e,r,n){return this.stream.write(super.cdata(e,r,n))}comment(e,r,n){return this.stream.write(super.comment(e,r,n))}declaration(e,r,n){return this.stream.write(super.declaration(e,r,n))}docType(e,r,n){var o,s,a,u;n||(n=0);this.openNode(e,r,n);r.state=i.OpenTag;this.stream.write(this.indent(e,r,n));this.stream.write("<!DOCTYPE "+e.root().name);if(e.pubID&&e.sysID){this.stream.write(' PUBLIC "'+e.pubID+'" "'+e.sysID+'"')}else if(e.sysID){this.stream.write(' SYSTEM "'+e.sysID+'"')}if(e.children.length>0){this.stream.write(" [");this.stream.write(this.endline(e,r,n));r.state=i.InsideTag;u=e.children;for(s=0,a=u.length;s<a;s++){o=u[s];this.writeChildNode(o,r,n+1)}r.state=i.CloseTag;this.stream.write("]")}r.state=i.CloseTag;this.stream.write(r.spaceBeforeSlash+">");this.stream.write(this.endline(e,r,n));r.state=i.None;return this.closeNode(e,r,n)}element(e,n,o){var s,u,l,c,p,h,f,d,m,g,y,w,v,b,N,E;o||(o=0);this.openNode(e,n,o);n.state=i.OpenTag;y=this.indent(e,n,o)+"<"+e.name;if(n.pretty&&n.width>0){f=y.length;v=e.attribs;for(m in v){if(!a.call(v,m))continue;s=v[m];w=this.attribute(s,n,o);u=w.length;if(f+u>n.width){E=this.indent(e,n,o+1)+w;y+=this.endline(e,n,o)+E;f=E.length}else{E=" "+w;y+=E;f+=E.length}}}else{b=e.attribs;for(m in b){if(!a.call(b,m))continue;s=b[m];y+=this.attribute(s,n,o)}}this.stream.write(y);c=e.children.length;p=c===0?null:e.children[0];if(c===0||e.children.every((function(e){return(e.type===r.Text||e.type===r.Raw||e.type===r.CData)&&e.value===""}))){if(n.allowEmpty){this.stream.write(">");n.state=i.CloseTag;this.stream.write("</"+e.name+">")}else{n.state=i.CloseTag;this.stream.write(n.spaceBeforeSlash+"/>")}}else if(n.pretty&&c===1&&(p.type===r.Text||p.type===r.Raw||p.type===r.CData)&&p.value!=null){this.stream.write(">");n.state=i.InsideTag;n.suppressPrettyCount++;g=true;this.writeChildNode(p,n,o+1);n.suppressPrettyCount--;g=false;n.state=i.CloseTag;this.stream.write("</"+e.name+">")}else{this.stream.write(">"+this.endline(e,n,o));n.state=i.InsideTag;N=e.children;for(h=0,d=N.length;h<d;h++){l=N[h];this.writeChildNode(l,n,o+1)}n.state=i.CloseTag;this.stream.write(this.indent(e,n,o)+"</"+e.name+">")}this.stream.write(this.endline(e,n,o));n.state=i.None;return this.closeNode(e,n,o)}processingInstruction(e,r,n){return this.stream.write(super.processingInstruction(e,r,n))}raw(e,r,n){return this.stream.write(super.raw(e,r,n))}text(e,r,n){return this.stream.write(super.text(e,r,n))}dtdAttList(e,r,n){return this.stream.write(super.dtdAttList(e,r,n))}dtdElement(e,r,n){return this.stream.write(super.dtdElement(e,r,n))}dtdEntity(e,r,n){return this.stream.write(super.dtdEntity(e,r,n))}dtdNotation(e,r,n){return this.stream.write(super.dtdNotation(e,r,n))}}}).call(this)},1423:function(e,r,n){(function(){var r,i;i=n(723);e.exports=r=class XMLStringWriter extends i{constructor(e){super(e)}document(e,r){var n,i,o,s,a;r=this.filterOptions(r);s="";a=e.children;for(i=0,o=a.length;i<o;i++){n=a[i];s+=this.writeChildNode(n,r,0)}if(r.pretty&&s.slice(-r.newline.length)===r.newline){s=s.slice(0,-r.newline.length)}return s}}}).call(this)},5179:function(e){(function(){var r,n={}.hasOwnProperty;e.exports=r=function(){class XMLStringifier{constructor(e){var r,i,o;this.assertLegalChar=this.assertLegalChar.bind(this);this.assertLegalName=this.assertLegalName.bind(this);e||(e={});this.options=e;if(!this.options.version){this.options.version="1.0"}i=e.stringify||{};for(r in i){if(!n.call(i,r))continue;o=i[r];this[r]=o}}name(e){if(this.options.noValidation){return e}return this.assertLegalName(""+e||"")}text(e){if(this.options.noValidation){return e}return this.assertLegalChar(this.textEscape(""+e||""))}cdata(e){if(this.options.noValidation){return e}e=""+e||"";e=e.replace("]]>","]]]]><![CDATA[>");return this.assertLegalChar(e)}comment(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+e)}return this.assertLegalChar(e)}raw(e){if(this.options.noValidation){return e}return""+e||""}attValue(e){if(this.options.noValidation){return e}return this.assertLegalChar(this.attEscape(e=""+e||""))}insTarget(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")}insValue(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/\?>/)){throw new Error("Invalid processing instruction value: "+e)}return this.assertLegalChar(e)}xmlVersion(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+e)}return e}xmlEncoding(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+e)}return this.assertLegalChar(e)}xmlStandalone(e){if(this.options.noValidation){return e}if(e){return"yes"}else{return"no"}}dtdPubID(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")}dtdSysID(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")}dtdElementValue(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")}dtdAttType(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")}dtdAttDefault(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")}dtdEntityValue(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")}dtdNData(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")}assertLegalChar(e){var r,n;if(this.options.noValidation){return e}if(this.options.version==="1.0"){r=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g;if(this.options.invalidCharReplacement!==void 0){e=e.replace(r,this.options.invalidCharReplacement)}else if(n=e.match(r)){throw new Error(`Invalid character in string: ${e} at index ${n.index}`)}}else if(this.options.version==="1.1"){r=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g;if(this.options.invalidCharReplacement!==void 0){e=e.replace(r,this.options.invalidCharReplacement)}else if(n=e.match(r)){throw new Error(`Invalid character in string: ${e} at index ${n.index}`)}}return e}assertLegalName(e){var r;if(this.options.noValidation){return e}e=this.assertLegalChar(e);r=/^([: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])*$/;if(!e.match(r)){throw new Error(`Invalid character in name: ${e}`)}return e}textEscape(e){var r;if(this.options.noValidation){return e}r=this.options.noDoubleEncoding?/(?!&(lt|gt|amp|apos|quot);)&/g:/&/g;return e.replace(r,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")}attEscape(e){var r;if(this.options.noValidation){return e}r=this.options.noDoubleEncoding?/(?!&(lt|gt|amp|apos|quot);)&/g:/&/g;return e.replace(r,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")}}XMLStringifier.prototype.convertAttKey="@";XMLStringifier.prototype.convertPIKey="?";XMLStringifier.prototype.convertTextKey="#text";XMLStringifier.prototype.convertCDataKey="#cdata";XMLStringifier.prototype.convertCommentKey="#comment";XMLStringifier.prototype.convertRawKey="#raw";return XMLStringifier}.call(this)}).call(this)},2742:function(e,r,n){(function(){var r,i,o;r=n(7094);i=n(3706);e.exports=o=function(){class XMLText extends i{constructor(e,n){super(e);if(n==null){throw new Error("Missing element text. "+this.debugInfo())}this.name="#text";this.type=r.Text;this.value=this.stringify.text(n)}clone(){return Object.create(this)}toString(e){return this.options.writer.text(this,this.options.writer.filterOptions(e))}splitText(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}replaceWholeText(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}}Object.defineProperty(XMLText.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLText.prototype,"wholeText",{get:function(){var e,r,n;n="";r=this.previousSibling;while(r){n=r.data+n;r=r.previousSibling}n+=this.data;e=this.nextSibling;while(e){n=n+e.data;e=e.nextSibling}return n}});return XMLText}.call(this)}).call(this)},723:function(e,r,n){(function(){var r,i,o,s,a,u,l,c,p,h,f,d,m,g,y,w,v,b={}.hasOwnProperty;({assign:v}=n(7412));r=n(7094);p=n(7609);h=n(8255);o=n(9188);s=n(2448);d=n(5265);g=n(8631);y=n(2742);m=n(5588);f=n(3001);a=n(3562);u=n(8449);l=n(718);c=n(9567);i=n(2036);e.exports=w=class XMLWriterBase{constructor(e){var r,n,i;e||(e={});this.options=e;n=e.writer||{};for(r in n){if(!b.call(n,r))continue;i=n[r];this["_"+r]=this[r];this[r]=i}}filterOptions(e){var r,n,o,s,a,u,l,c,p;e||(e={});e=v({},this.options,e);r={writer:this};r.pretty=e.pretty||false;r.allowEmpty=e.allowEmpty||false;r.indent=(n=e.indent)!=null?n:" ";r.newline=(o=e.newline)!=null?o:"\n";r.offset=(s=e.offset)!=null?s:0;r.width=(a=e.width)!=null?a:0;r.dontPrettyTextNodes=(u=(l=e.dontPrettyTextNodes)!=null?l:e.dontprettytextnodes)!=null?u:0;r.spaceBeforeSlash=(c=(p=e.spaceBeforeSlash)!=null?p:e.spacebeforeslash)!=null?c:"";if(r.spaceBeforeSlash===true){r.spaceBeforeSlash=" "}r.suppressPrettyCount=0;r.user={};r.state=i.None;return r}indent(e,r,n){var i;if(!r.pretty||r.suppressPrettyCount){return""}else if(r.pretty){i=(n||0)+r.offset+1;if(i>0){return new Array(i).join(r.indent)}}return""}endline(e,r,n){if(!r.pretty||r.suppressPrettyCount){return""}else{return r.newline}}attribute(e,r,n){var i;this.openAttribute(e,r,n);if(r.pretty&&r.width>0){i=e.name+'="'+e.value+'"'}else{i=" "+e.name+'="'+e.value+'"'}this.closeAttribute(e,r,n);return i}cdata(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"<![CDATA[";r.state=i.InsideTag;o+=e.value;r.state=i.CloseTag;o+="]]>"+this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o}comment(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"\x3c!-- ";r.state=i.InsideTag;o+=e.value;r.state=i.CloseTag;o+=" --\x3e"+this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o}declaration(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"<?xml";r.state=i.InsideTag;o+=' version="'+e.version+'"';if(e.encoding!=null){o+=' encoding="'+e.encoding+'"'}if(e.standalone!=null){o+=' standalone="'+e.standalone+'"'}r.state=i.CloseTag;o+=r.spaceBeforeSlash+"?>";o+=this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o}docType(e,r,n){var o,s,a,u,l;n||(n=0);this.openNode(e,r,n);r.state=i.OpenTag;u=this.indent(e,r,n);u+="<!DOCTYPE "+e.root().name;if(e.pubID&&e.sysID){u+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.sysID){u+=' SYSTEM "'+e.sysID+'"'}if(e.children.length>0){u+=" [";u+=this.endline(e,r,n);r.state=i.InsideTag;l=e.children;for(s=0,a=l.length;s<a;s++){o=l[s];u+=this.writeChildNode(o,r,n+1)}r.state=i.CloseTag;u+="]"}r.state=i.CloseTag;u+=r.spaceBeforeSlash+">";u+=this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return u}element(e,n,o){var s,a,u,l,c,p,h,f,d,m,g,y,w,v,N,E,T,D,S;o||(o=0);y=false;this.openNode(e,n,o);n.state=i.OpenTag;w=this.indent(e,n,o)+"<"+e.name;if(n.pretty&&n.width>0){f=w.length;N=e.attribs;for(g in N){if(!b.call(N,g))continue;s=N[g];v=this.attribute(s,n,o);a=v.length;if(f+a>n.width){S=this.indent(e,n,o+1)+v;w+=this.endline(e,n,o)+S;f=S.length}else{S=" "+v;w+=S;f+=S.length}}}else{E=e.attribs;for(g in E){if(!b.call(E,g))continue;s=E[g];w+=this.attribute(s,n,o)}}l=e.children.length;c=l===0?null:e.children[0];if(l===0||e.children.every((function(e){return(e.type===r.Text||e.type===r.Raw||e.type===r.CData)&&e.value===""}))){if(n.allowEmpty){w+=">";n.state=i.CloseTag;w+="</"+e.name+">"+this.endline(e,n,o)}else{n.state=i.CloseTag;w+=n.spaceBeforeSlash+"/>"+this.endline(e,n,o)}}else if(n.pretty&&l===1&&(c.type===r.Text||c.type===r.Raw||c.type===r.CData)&&c.value!=null){w+=">";n.state=i.InsideTag;n.suppressPrettyCount++;y=true;w+=this.writeChildNode(c,n,o+1);n.suppressPrettyCount--;y=false;n.state=i.CloseTag;w+="</"+e.name+">"+this.endline(e,n,o)}else{if(n.dontPrettyTextNodes){T=e.children;for(p=0,d=T.length;p<d;p++){u=T[p];if((u.type===r.Text||u.type===r.Raw||u.type===r.CData)&&u.value!=null){n.suppressPrettyCount++;y=true;break}}}w+=">"+this.endline(e,n,o);n.state=i.InsideTag;D=e.children;for(h=0,m=D.length;h<m;h++){u=D[h];w+=this.writeChildNode(u,n,o+1)}n.state=i.CloseTag;w+=this.indent(e,n,o)+"</"+e.name+">";if(y){n.suppressPrettyCount--}w+=this.endline(e,n,o);n.state=i.None}this.closeNode(e,n,o);return w}writeChildNode(e,n,i){switch(e.type){case r.CData:return this.cdata(e,n,i);case r.Comment:return this.comment(e,n,i);case r.Element:return this.element(e,n,i);case r.Raw:return this.raw(e,n,i);case r.Text:return this.text(e,n,i);case r.ProcessingInstruction:return this.processingInstruction(e,n,i);case r.Dummy:return"";case r.Declaration:return this.declaration(e,n,i);case r.DocType:return this.docType(e,n,i);case r.AttributeDeclaration:return this.dtdAttList(e,n,i);case r.ElementDeclaration:return this.dtdElement(e,n,i);case r.EntityDeclaration:return this.dtdEntity(e,n,i);case r.NotationDeclaration:return this.dtdNotation(e,n,i);default:throw new Error("Unknown XML node type: "+e.constructor.name)}}processingInstruction(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"<?";r.state=i.InsideTag;o+=e.target;if(e.value){o+=" "+e.value}r.state=i.CloseTag;o+=r.spaceBeforeSlash+"?>";o+=this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o}raw(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n);r.state=i.InsideTag;o+=e.value;r.state=i.CloseTag;o+=this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o}text(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n);r.state=i.InsideTag;o+=e.value;r.state=i.CloseTag;o+=this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o}dtdAttList(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"<!ATTLIST";r.state=i.InsideTag;o+=" "+e.elementName+" "+e.attributeName+" "+e.attributeType;if(e.defaultValueType!=="#DEFAULT"){o+=" "+e.defaultValueType}if(e.defaultValue){o+=' "'+e.defaultValue+'"'}r.state=i.CloseTag;o+=r.spaceBeforeSlash+">"+this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o}dtdElement(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"<!ELEMENT";r.state=i.InsideTag;o+=" "+e.name+" "+e.value;r.state=i.CloseTag;o+=r.spaceBeforeSlash+">"+this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o}dtdEntity(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"<!ENTITY";r.state=i.InsideTag;if(e.pe){o+=" %"}o+=" "+e.name;if(e.value){o+=' "'+e.value+'"'}else{if(e.pubID&&e.sysID){o+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.sysID){o+=' SYSTEM "'+e.sysID+'"'}if(e.nData){o+=" NDATA "+e.nData}}r.state=i.CloseTag;o+=r.spaceBeforeSlash+">"+this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o}dtdNotation(e,r,n){var o;this.openNode(e,r,n);r.state=i.OpenTag;o=this.indent(e,r,n)+"<!NOTATION";r.state=i.InsideTag;o+=" "+e.name;if(e.pubID&&e.sysID){o+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.pubID){o+=' PUBLIC "'+e.pubID+'"'}else if(e.sysID){o+=' SYSTEM "'+e.sysID+'"'}r.state=i.CloseTag;o+=r.spaceBeforeSlash+">"+this.endline(e,r,n);r.state=i.None;this.closeNode(e,r,n);return o}openNode(e,r,n){}closeNode(e,r,n){}openAttribute(e,r,n){}closeAttribute(e,r,n){}}}).call(this)},4512:function(e,r,n){(function(){var r,i,o,s,a,u,l,c,p;({assign:c,isFunction:p}=n(7412));o=n(9391);s=n(7632);a=n(2745);l=n(1423);u=n(7642);r=n(7094);i=n(2036);e.exports.create=function(e,r,n,i){var o,a;if(e==null){throw new Error("Root element needs a name.")}i=c({},r,n,i);o=new s(i);a=o.element(e);if(!i.headless){o.declaration(i);if(i.pubID!=null||i.sysID!=null){o.dtd(i)}}return a};e.exports.begin=function(e,r,n){if(p(e)){[r,n]=[e,r];e={}}if(r){return new a(e,r,n)}else{return new s(e)}};e.exports.stringWriter=function(e){return new l(e)};e.exports.streamWriter=function(e,r){return new u(e,r)};e.exports.implementation=new o;e.exports.nodeType=r;e.exports.writerState=i}).call(this)},8230:function(e,r){var n=false?0:r;(function(e){"use strict";function curry(e){var r=Array.prototype.slice,n=e.length,partial=function(e,n){return function(){return n.apply(this,e.concat(r.call(arguments)))}},fn=function(){var i=r.call(arguments);return i.length<n?partial(i,fn):e.apply(this,r.apply(arguments,[0,n]))};return fn}var forEach=function(e,r){for(var n=0;n<r.length;n+=1){e(r[n],n,r)}};var reduce=function(e,r,n){var i=r;forEach((function(r,n){i=e(i,r,n)}),n);return i};var map=function(e,r){var n=new Array(r.length);forEach((function(r,i){n[i]=e(r)}),r);return n};var filter=function(e,r){var n=[];forEach((function(r,i){if(e(r,i)){n.push(r)}}),r);return n};var includes=function(e,r){for(var n=0;n<e.length;n+=1){if(e[n]===r){return true}}return false};function always(e){return function(){return e}}function toString(e){return e.toString()}var join=function(e,r){return r.join(e)};var wrap=function(e,r,n){return e+n+r};var r=Array.prototype.concat;var n=32767;function flatten(e){var i=[];for(var o=0;o<e.length;o+=n){var s=e.slice(o,o+n);i=r.apply(i,s)}return i}function assign(e,r){var n=Object(e);for(var i=1;i<arguments.length;i++){var o=arguments[i];if(o!=null){for(var s in o){if(Object.prototype.hasOwnProperty.call(o,s)){n[s]=o[s]}}}}return n}XPathParser.prototype=new Object;XPathParser.prototype.constructor=XPathParser;XPathParser.superclass=Object.prototype;function XPathParser(){this.init()}XPathParser.prototype.init=function(){this.reduceActions=[];this.reduceActions[3]=function(e){return new OrOperation(e[0],e[2])};this.reduceActions[5]=function(e){return new AndOperation(e[0],e[2])};this.reduceActions[7]=function(e){return new EqualsOperation(e[0],e[2])};this.reduceActions[8]=function(e){return new NotEqualOperation(e[0],e[2])};this.reduceActions[10]=function(e){return new LessThanOperation(e[0],e[2])};this.reduceActions[11]=function(e){return new GreaterThanOperation(e[0],e[2])};this.reduceActions[12]=function(e){return new LessThanOrEqualOperation(e[0],e[2])};this.reduceActions[13]=function(e){return new GreaterThanOrEqualOperation(e[0],e[2])};this.reduceActions[15]=function(e){return new PlusOperation(e[0],e[2])};this.reduceActions[16]=function(e){return new MinusOperation(e[0],e[2])};this.reduceActions[18]=function(e){return new MultiplyOperation(e[0],e[2])};this.reduceActions[19]=function(e){return new DivOperation(e[0],e[2])};this.reduceActions[20]=function(e){return new ModOperation(e[0],e[2])};this.reduceActions[22]=function(e){return new UnaryMinusOperation(e[1])};this.reduceActions[24]=function(e){return new BarOperation(e[0],e[2])};this.reduceActions[25]=function(e){return new PathExpr(undefined,undefined,e[0])};this.reduceActions[27]=function(e){e[0].locationPath=e[2];return e[0]};this.reduceActions[28]=function(e){e[0].locationPath=e[2];e[0].locationPath.steps.unshift(new Step(Step.DESCENDANTORSELF,NodeTest.nodeTest,[]));return e[0]};this.reduceActions[29]=function(e){return new PathExpr(e[0],[],undefined)};this.reduceActions[30]=function(e){if(s.instance_of(e[0],PathExpr)){if(e[0].filterPredicates==undefined){e[0].filterPredicates=[]}e[0].filterPredicates.push(e[1]);return e[0]}else{return new PathExpr(e[0],[e[1]],undefined)}};this.reduceActions[32]=function(e){return e[1]};this.reduceActions[33]=function(e){return new XString(e[0])};this.reduceActions[34]=function(e){return new XNumber(e[0])};this.reduceActions[36]=function(e){return new FunctionCall(e[0],[])};this.reduceActions[37]=function(e){return new FunctionCall(e[0],e[2])};this.reduceActions[38]=function(e){return[e[0]]};this.reduceActions[39]=function(e){e[2].unshift(e[0]);return e[2]};this.reduceActions[43]=function(e){return new LocationPath(true,[])};this.reduceActions[44]=function(e){e[1].absolute=true;return e[1]};this.reduceActions[46]=function(e){return new LocationPath(false,[e[0]])};this.reduceActions[47]=function(e){e[0].steps.push(e[2]);return e[0]};this.reduceActions[49]=function(e){return new Step(e[0],e[1],[])};this.reduceActions[50]=function(e){return new Step(Step.CHILD,e[0],[])};this.reduceActions[51]=function(e){return new Step(e[0],e[1],e[2])};this.reduceActions[52]=function(e){return new Step(Step.CHILD,e[0],e[1])};this.reduceActions[54]=function(e){return[e[0]]};this.reduceActions[55]=function(e){e[1].unshift(e[0]);return e[1]};this.reduceActions[56]=function(e){if(e[0]=="ancestor"){return Step.ANCESTOR}else if(e[0]=="ancestor-or-self"){return Step.ANCESTORORSELF}else if(e[0]=="attribute"){return Step.ATTRIBUTE}else if(e[0]=="child"){return Step.CHILD}else if(e[0]=="descendant"){return Step.DESCENDANT}else if(e[0]=="descendant-or-self"){return Step.DESCENDANTORSELF}else if(e[0]=="following"){return Step.FOLLOWING}else if(e[0]=="following-sibling"){return Step.FOLLOWINGSIBLING}else if(e[0]=="namespace"){return Step.NAMESPACE}else if(e[0]=="parent"){return Step.PARENT}else if(e[0]=="preceding"){return Step.PRECEDING}else if(e[0]=="preceding-sibling"){return Step.PRECEDINGSIBLING}else if(e[0]=="self"){return Step.SELF}return-1};this.reduceActions[57]=function(e){return Step.ATTRIBUTE};this.reduceActions[59]=function(e){if(e[0]=="comment"){return NodeTest.commentTest}else if(e[0]=="text"){return NodeTest.textTest}else if(e[0]=="processing-instruction"){return NodeTest.anyPiTest}else if(e[0]=="node"){return NodeTest.nodeTest}return new NodeTest(-1,undefined)};this.reduceActions[60]=function(e){return new NodeTest.PITest(e[2])};this.reduceActions[61]=function(e){return e[1]};this.reduceActions[63]=function(e){e[1].absolute=true;e[1].steps.unshift(new Step(Step.DESCENDANTORSELF,NodeTest.nodeTest,[]));return e[1]};this.reduceActions[64]=function(e){e[0].steps.push(new Step(Step.DESCENDANTORSELF,NodeTest.nodeTest,[]));e[0].steps.push(e[2]);return e[0]};this.reduceActions[65]=function(e){return new Step(Step.SELF,NodeTest.nodeTest,[])};this.reduceActions[66]=function(e){return new Step(Step.PARENT,NodeTest.nodeTest,[])};this.reduceActions[67]=function(e){return new VariableReference(e[1])};this.reduceActions[68]=function(e){return NodeTest.nameTestAny};this.reduceActions[69]=function(e){return new NodeTest.NameTestPrefixAny(e[0].split(":")[0])};this.reduceActions[70]=function(e){return new NodeTest.NameTestQName(e[0])}};XPathParser.actionTable=[" s s sssssssss s ss s ss"," s ","r rrrrrrrrr rrrrrrr rr r "," rrrrr "," s s sssssssss s ss s ss","rs rrrrrrrr s sssssrrrrrr rrs rs "," s s sssssssss s ss s ss"," s "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s "," s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr r ","a ","r s rr r ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrs rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r srrrrrrrr rrrrrrs rr sr ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r "," sssss ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrr rrrrr rr r "," s "," s "," rrrrr "," s s sssssssss s sss s ss","r srrrrrrrr rrrrrrs rr r "," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss ss s ss"," s s sssssssss s ss s ss"," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr rr "," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," rr "," s "," rs ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrr rr r "," r "," s ","r srrrrrrrr rrrrrrs rr r ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s s sssssssss s ss s ss","r rrrrrrrrr rrrrrrr rr rr "," r "];XPathParser.actionTableNumber=[" 1 0 /.-,+*)(' & %$ # \"!"," J ","a aaaaaaaaa aaaaaaa aa a "," YYYYY "," 1 0 /.-,+*)(' & %$ # \"!","K1 KKKKKKKK . +*)('KKKKKK KK# K\" "," 1 0 /.-,+*)(' & %$ # \"!"," N "," O ","e eeeeeeeee eeeeeee ee ee ","f fffffffff fffffff ff ff ","d ddddddddd ddddddd dd dd ","B BBBBBBBBB BBBBBBB BB BB ","A AAAAAAAAA AAAAAAA AA AA "," P "," Q "," 1 . +*)(' # \" ","b bbbbbbbbb bbbbbbb bb b "," ","! S !! ! ",'" T" "" " ',"$ V $$ U $$ $ ","& &ZY&& &XW && & ",") ))))) )))\\[ )) ) ",". ....._^] ..... .. . ","1 11111111 11111 11 1 ","5 55555555 55555` 55 5 ","7 77777777 777777 77 7 ","9 99999999 999999 99 9 ",": c:::::::: ::::::b :: a: ","I fIIIIIIII IIIIIIe II I ","= ========= ======= == == ","? ????????? ??????? ?? ?? ","C CCCCCCCCC CCCCCCC CC CC ","J JJJJJJJJ JJJJJJ JJ J ","M MMMMMMMM MMMMMM MM M ","N NNNNNNNNN NNNNNNN NN N ","P PPPPPPPPP PPPPPPP PP P "," +*)(' ","R RRRRRRRRR RRRRRRR RR aR ","U UUUUUUUUU UUUUUUU UU U ","Z ZZZZZZZZZ ZZZZZZZ ZZ ZZ ","c ccccccccc ccccccc cc cc "," j ","L fLLLLLLLL LLLLLLe LL L ","6 66666666 66666 66 6 "," k "," l "," XXXXX "," 1 0 /.-,+*)(' & %$m # \"!","_ f________ ______e __ _ "," 1 0 /.-,+*)(' & %$ # \"!"," 1 0 /.-,+*)(' & %$ # \"!"," 1 0 /.-,+*)(' & %$ # \"!"," 1 0 /.-,+*)(' & %$ # \"!"," 1 0 /.-,+*)(' & %$ # \"!"," 1 0 /.-,+*)(' & %$ # \"!"," 1 0 /.-,+*)(' & %$ # \"!"," 1 0 /.-,+*)(' & %$ # \"!"," 1 0 /.-,+*)(' & %$ # \"!"," 1 0 /.-,+*)(' & %$ # \"!"," 1 0 /.-,+*)(' & %$ # \"!"," 1 0 /.-,+*)(' & %$ # \"!"," 1 0 /.-,+*)(' & %$ # \"!"," 1 0 /.-,+*)(' %$ # \"!"," 1 0 /.-,+*)(' & %$ # \"!"," 1 . +*)(' # \" "," 1 . +*)(' # \" ","> >>>>>>>>> >>>>>>> >> >> "," 1 . +*)(' # \" "," 1 . +*)(' # \" ","Q QQQQQQQQQ QQQQQQQ QQ aQ ","V VVVVVVVVV VVVVVVV VV aV ","T TTTTTTTTT TTTTTTT TT T ","@ @@@@@@@@@ @@@@@@@ @@ @@ "," ‡ ","[ [[[[[[[[[ [[[[[[[ [[ [[ ","D DDDDDDDDD DDDDDDD DD DD "," HH "," ˆ "," F‰ ","# T# ## # ","% V %% U %% % ","' 'ZY'' 'XW '' ' ","( (ZY(( (XW (( ( ","+ +++++ +++\\[ ++ + ","* ***** ***\\[ ** * ","- ----- ---\\[ -- - ",", ,,,,, ,,,\\[ ,, , ","0 00000_^] 00000 00 0 ","/ /////_^] ///// // / ","2 22222222 22222 22 2 ","3 33333333 33333 33 3 ","4 44444444 44444 44 4 ","8 88888888 888888 88 8 "," ^ "," Š ","; f;;;;;;;; ;;;;;;e ;; ; ","< f<<<<<<<< <<<<<<e << < ","O OOOOOOOOO OOOOOOO OO O ","` ````````` ``````` `` ` ","S SSSSSSSSS SSSSSSS SS S ","W WWWWWWWWW WWWWWWW WW W ","\\ \\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\ \\\\ \\\\ ","E EEEEEEEEE EEEEEEE EE EE "," 1 0 /.-,+*)(' & %$ # \"!","] ]]]]]]]]] ]]]]]]] ]] ]] "," G "];XPathParser.gotoTable=["3456789:;<=>?@ AB CDEFGH IJ "," "," "," ","L456789:;<=>?@ AB CDEFGH IJ "," M EFGH IJ "," N;<=>?@ AB CDEFGH IJ "," "," "," "," "," "," "," "," "," "," S EFGH IJ "," "," "," "," "," "," "," "," "," "," "," "," "," e "," "," "," "," "," "," "," "," "," h J "," i j "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ ABpqCDEFGH IJ "," "," r6789:;<=>?@ AB CDEFGH IJ "," s789:;<=>?@ AB CDEFGH IJ "," t89:;<=>?@ AB CDEFGH IJ "," u89:;<=>?@ AB CDEFGH IJ "," v9:;<=>?@ AB CDEFGH IJ "," w9:;<=>?@ AB CDEFGH IJ "," x9:;<=>?@ AB CDEFGH IJ "," y9:;<=>?@ AB CDEFGH IJ "," z:;<=>?@ AB CDEFGH IJ "," {:;<=>?@ AB CDEFGH IJ "," |;<=>?@ AB CDEFGH IJ "," };<=>?@ AB CDEFGH IJ "," ~;<=>?@ AB CDEFGH IJ "," =>?@ AB CDEFGH IJ ","€456789:;<=>?@ AB CDEFGH IJ"," ‚ EFGH IJ "," ƒ EFGH IJ "," "," „ GH IJ "," … GH IJ "," i † "," i ‡ "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ ABŒqCDEFGH IJ "," "," "];XPathParser.productions=[[1,1,2],[2,1,3],[3,1,4],[3,3,3,-9,4],[4,1,5],[4,3,4,-8,5],[5,1,6],[5,3,5,-22,6],[5,3,5,-5,6],[6,1,7],[6,3,6,-23,7],[6,3,6,-24,7],[6,3,6,-6,7],[6,3,6,-7,7],[7,1,8],[7,3,7,-25,8],[7,3,7,-26,8],[8,1,9],[8,3,8,-12,9],[8,3,8,-11,9],[8,3,8,-10,9],[9,1,10],[9,2,-26,9],[10,1,11],[10,3,10,-27,11],[11,1,12],[11,1,13],[11,3,13,-28,14],[11,3,13,-4,14],[13,1,15],[13,2,13,16],[15,1,17],[15,3,-29,2,-30],[15,1,-15],[15,1,-16],[15,1,18],[18,3,-13,-29,-30],[18,4,-13,-29,19,-30],[19,1,20],[19,3,20,-31,19],[20,1,2],[12,1,14],[12,1,21],[21,1,-28],[21,2,-28,14],[21,1,22],[14,1,23],[14,3,14,-28,23],[14,1,24],[23,2,25,26],[23,1,26],[23,3,25,26,27],[23,2,26,27],[23,1,28],[27,1,16],[27,2,16,27],[25,2,-14,-3],[25,1,-32],[26,1,29],[26,3,-20,-29,-30],[26,4,-21,-29,-15,-30],[16,3,-33,30,-34],[30,1,2],[22,2,-4,14],[24,3,14,-4,23],[28,1,-35],[28,1,-2],[17,2,-36,-18],[29,1,-17],[29,1,-19],[29,1,-18]];XPathParser.DOUBLEDOT=2;XPathParser.DOUBLECOLON=3;XPathParser.DOUBLESLASH=4;XPathParser.NOTEQUAL=5;XPathParser.LESSTHANOREQUAL=6;XPathParser.GREATERTHANOREQUAL=7;XPathParser.AND=8;XPathParser.OR=9;XPathParser.MOD=10;XPathParser.DIV=11;XPathParser.MULTIPLYOPERATOR=12;XPathParser.FUNCTIONNAME=13;XPathParser.AXISNAME=14;XPathParser.LITERAL=15;XPathParser.NUMBER=16;XPathParser.ASTERISKNAMETEST=17;XPathParser.QNAME=18;XPathParser.NCNAMECOLONASTERISK=19;XPathParser.NODETYPE=20;XPathParser.PROCESSINGINSTRUCTIONWITHLITERAL=21;XPathParser.EQUALS=22;XPathParser.LESSTHAN=23;XPathParser.GREATERTHAN=24;XPathParser.PLUS=25;XPathParser.MINUS=26;XPathParser.BAR=27;XPathParser.SLASH=28;XPathParser.LEFTPARENTHESIS=29;XPathParser.RIGHTPARENTHESIS=30;XPathParser.COMMA=31;XPathParser.AT=32;XPathParser.LEFTBRACKET=33;XPathParser.RIGHTBRACKET=34;XPathParser.DOT=35;XPathParser.DOLLAR=36;XPathParser.prototype.tokenize=function(e){var r=[];var n=[];var i=e+"\0";var o=0;var u=i.charAt(o++);while(1){while(u==" "||u=="\t"||u=="\r"||u=="\n"){u=i.charAt(o++)}if(u=="\0"||o>=i.length){break}if(u=="("){r.push(XPathParser.LEFTPARENTHESIS);n.push(u);u=i.charAt(o++);continue}if(u==")"){r.push(XPathParser.RIGHTPARENTHESIS);n.push(u);u=i.charAt(o++);continue}if(u=="["){r.push(XPathParser.LEFTBRACKET);n.push(u);u=i.charAt(o++);continue}if(u=="]"){r.push(XPathParser.RIGHTBRACKET);n.push(u);u=i.charAt(o++);continue}if(u=="@"){r.push(XPathParser.AT);n.push(u);u=i.charAt(o++);continue}if(u==","){r.push(XPathParser.COMMA);n.push(u);u=i.charAt(o++);continue}if(u=="|"){r.push(XPathParser.BAR);n.push(u);u=i.charAt(o++);continue}if(u=="+"){r.push(XPathParser.PLUS);n.push(u);u=i.charAt(o++);continue}if(u=="-"){r.push(XPathParser.MINUS);n.push(u);u=i.charAt(o++);continue}if(u=="="){r.push(XPathParser.EQUALS);n.push(u);u=i.charAt(o++);continue}if(u=="$"){r.push(XPathParser.DOLLAR);n.push(u);u=i.charAt(o++);continue}if(u=="."){u=i.charAt(o++);if(u=="."){r.push(XPathParser.DOUBLEDOT);n.push("..");u=i.charAt(o++);continue}if(u>="0"&&u<="9"){var l="."+u;u=i.charAt(o++);while(u>="0"&&u<="9"){l+=u;u=i.charAt(o++)}r.push(XPathParser.NUMBER);n.push(l);continue}r.push(XPathParser.DOT);n.push(".");continue}if(u=="'"||u=='"'){var c=u;var p="";while(o<i.length&&(u=i.charAt(o))!==c){p+=u;o+=1}if(u!==c){throw a.fromMessage("Unterminated string literal: "+c+p)}o+=1;r.push(XPathParser.LITERAL);n.push(p);u=i.charAt(o++);continue}if(u>="0"&&u<="9"){var l=u;u=i.charAt(o++);while(u>="0"&&u<="9"){l+=u;u=i.charAt(o++)}if(u=="."){if(i.charAt(o)>="0"&&i.charAt(o)<="9"){l+=u;l+=i.charAt(o++);u=i.charAt(o++);while(u>="0"&&u<="9"){l+=u;u=i.charAt(o++)}}}r.push(XPathParser.NUMBER);n.push(l);continue}if(u=="*"){if(r.length>0){var h=r[r.length-1];if(h!=XPathParser.AT&&h!=XPathParser.DOUBLECOLON&&h!=XPathParser.LEFTPARENTHESIS&&h!=XPathParser.LEFTBRACKET&&h!=XPathParser.AND&&h!=XPathParser.OR&&h!=XPathParser.MOD&&h!=XPathParser.DIV&&h!=XPathParser.MULTIPLYOPERATOR&&h!=XPathParser.SLASH&&h!=XPathParser.DOUBLESLASH&&h!=XPathParser.BAR&&h!=XPathParser.PLUS&&h!=XPathParser.MINUS&&h!=XPathParser.EQUALS&&h!=XPathParser.NOTEQUAL&&h!=XPathParser.LESSTHAN&&h!=XPathParser.LESSTHANOREQUAL&&h!=XPathParser.GREATERTHAN&&h!=XPathParser.GREATERTHANOREQUAL){r.push(XPathParser.MULTIPLYOPERATOR);n.push(u);u=i.charAt(o++);continue}}r.push(XPathParser.ASTERISKNAMETEST);n.push(u);u=i.charAt(o++);continue}if(u==":"){if(i.charAt(o)==":"){r.push(XPathParser.DOUBLECOLON);n.push("::");o++;u=i.charAt(o++);continue}}if(u=="/"){u=i.charAt(o++);if(u=="/"){r.push(XPathParser.DOUBLESLASH);n.push("//");u=i.charAt(o++);continue}r.push(XPathParser.SLASH);n.push("/");continue}if(u=="!"){if(i.charAt(o)=="="){r.push(XPathParser.NOTEQUAL);n.push("!=");o++;u=i.charAt(o++);continue}}if(u=="<"){if(i.charAt(o)=="="){r.push(XPathParser.LESSTHANOREQUAL);n.push("<=");o++;u=i.charAt(o++);continue}r.push(XPathParser.LESSTHAN);n.push("<");u=i.charAt(o++);continue}if(u==">"){if(i.charAt(o)=="="){r.push(XPathParser.GREATERTHANOREQUAL);n.push(">=");o++;u=i.charAt(o++);continue}r.push(XPathParser.GREATERTHAN);n.push(">");u=i.charAt(o++);continue}if(u=="_"||s.isLetter(u.charCodeAt(0))){var f=u;u=i.charAt(o++);while(s.isNCNameChar(u.charCodeAt(0))){f+=u;u=i.charAt(o++)}if(r.length>0){var h=r[r.length-1];if(h!=XPathParser.AT&&h!=XPathParser.DOUBLECOLON&&h!=XPathParser.LEFTPARENTHESIS&&h!=XPathParser.LEFTBRACKET&&h!=XPathParser.AND&&h!=XPathParser.OR&&h!=XPathParser.MOD&&h!=XPathParser.DIV&&h!=XPathParser.MULTIPLYOPERATOR&&h!=XPathParser.SLASH&&h!=XPathParser.DOUBLESLASH&&h!=XPathParser.BAR&&h!=XPathParser.PLUS&&h!=XPathParser.MINUS&&h!=XPathParser.EQUALS&&h!=XPathParser.NOTEQUAL&&h!=XPathParser.LESSTHAN&&h!=XPathParser.LESSTHANOREQUAL&&h!=XPathParser.GREATERTHAN&&h!=XPathParser.GREATERTHANOREQUAL){if(f=="and"){r.push(XPathParser.AND);n.push(f);continue}if(f=="or"){r.push(XPathParser.OR);n.push(f);continue}if(f=="mod"){r.push(XPathParser.MOD);n.push(f);continue}if(f=="div"){r.push(XPathParser.DIV);n.push(f);continue}}}if(u==":"){if(i.charAt(o)=="*"){r.push(XPathParser.NCNAMECOLONASTERISK);n.push(f+":*");o++;u=i.charAt(o++);continue}if(i.charAt(o)=="_"||s.isLetter(i.charCodeAt(o))){f+=":";u=i.charAt(o++);while(s.isNCNameChar(u.charCodeAt(0))){f+=u;u=i.charAt(o++)}if(u=="("){r.push(XPathParser.FUNCTIONNAME);n.push(f);continue}r.push(XPathParser.QNAME);n.push(f);continue}if(i.charAt(o)==":"){r.push(XPathParser.AXISNAME);n.push(f);continue}}if(u=="("){if(f=="comment"||f=="text"||f=="node"){r.push(XPathParser.NODETYPE);n.push(f);continue}if(f=="processing-instruction"){if(i.charAt(o)==")"){r.push(XPathParser.NODETYPE)}else{r.push(XPathParser.PROCESSINGINSTRUCTIONWITHLITERAL)}n.push(f);continue}r.push(XPathParser.FUNCTIONNAME);n.push(f);continue}r.push(XPathParser.QNAME);n.push(f);continue}throw new Error("Unexpected character "+u)}r.push(1);n.push("[EOF]");return[r,n]};XPathParser.SHIFT="s";XPathParser.REDUCE="r";XPathParser.ACCEPT="a";XPathParser.prototype.parse=function(e){var r;var n;var i=this.tokenize(e);if(i==undefined){return undefined}r=i[0];n=i[1];var o=0;var s=[];var a=[];var u=[];var e;var l;var c;s.push(0);a.push(1);u.push("_S");l=r[o];c=n[o++];while(1){e=s[s.length-1];switch(XPathParser.actionTable[e].charAt(l-1)){case XPathParser.SHIFT:a.push(-l);u.push(c);s.push(XPathParser.actionTableNumber[e].charCodeAt(l-1)-32);l=r[o];c=n[o++];break;case XPathParser.REDUCE:var p=XPathParser.productions[XPathParser.actionTableNumber[e].charCodeAt(l-1)-32][1];var h=[];for(var f=0;f<p;f++){a.pop();h.unshift(u.pop());s.pop()}var d=s[s.length-1];a.push(XPathParser.productions[XPathParser.actionTableNumber[e].charCodeAt(l-1)-32][0]);if(this.reduceActions[XPathParser.actionTableNumber[e].charCodeAt(l-1)-32]==undefined){u.push(h[0])}else{u.push(this.reduceActions[XPathParser.actionTableNumber[e].charCodeAt(l-1)-32](h))}s.push(XPathParser.gotoTable[d].charCodeAt(XPathParser.productions[XPathParser.actionTableNumber[e].charCodeAt(l-1)-32][0]-2)-33);break;case XPathParser.ACCEPT:return new XPath(u.pop());default:throw new Error("XPath parse error")}}};XPath.prototype=new Object;XPath.prototype.constructor=XPath;XPath.superclass=Object.prototype;function XPath(e){this.expression=e}XPath.prototype.toString=function(){return this.expression.toString()};function setIfUnset(e,r,n){if(!(r in e)){e[r]=n}}XPath.prototype.evaluate=function(e){e.contextNode=e.expressionContextNode;e.contextSize=1;e.contextPosition=1;if(e.isHtml){setIfUnset(e,"caseInsensitive",true);setIfUnset(e,"allowAnyNamespaceForNoPrefix",true)}setIfUnset(e,"caseInsensitive",false);return this.expression.evaluate(e)};XPath.XML_NAMESPACE_URI="http://www.w3.org/XML/1998/namespace";XPath.XMLNS_NAMESPACE_URI="http://www.w3.org/2000/xmlns/";Expression.prototype=new Object;Expression.prototype.constructor=Expression;Expression.superclass=Object.prototype;function Expression(){}Expression.prototype.init=function(){};Expression.prototype.toString=function(){return"<Expression>"};Expression.prototype.evaluate=function(e){throw new Error("Could not evaluate expression.")};UnaryOperation.prototype=new Expression;UnaryOperation.prototype.constructor=UnaryOperation;UnaryOperation.superclass=Expression.prototype;function UnaryOperation(e){if(arguments.length>0){this.init(e)}}UnaryOperation.prototype.init=function(e){this.rhs=e};UnaryMinusOperation.prototype=new UnaryOperation;UnaryMinusOperation.prototype.constructor=UnaryMinusOperation;UnaryMinusOperation.superclass=UnaryOperation.prototype;function UnaryMinusOperation(e){if(arguments.length>0){this.init(e)}}UnaryMinusOperation.prototype.init=function(e){UnaryMinusOperation.superclass.init.call(this,e)};UnaryMinusOperation.prototype.evaluate=function(e){return this.rhs.evaluate(e).number().negate()};UnaryMinusOperation.prototype.toString=function(){return"-"+this.rhs.toString()};BinaryOperation.prototype=new Expression;BinaryOperation.prototype.constructor=BinaryOperation;BinaryOperation.superclass=Expression.prototype;function BinaryOperation(e,r){if(arguments.length>0){this.init(e,r)}}BinaryOperation.prototype.init=function(e,r){this.lhs=e;this.rhs=r};OrOperation.prototype=new BinaryOperation;OrOperation.prototype.constructor=OrOperation;OrOperation.superclass=BinaryOperation.prototype;function OrOperation(e,r){if(arguments.length>0){this.init(e,r)}}OrOperation.prototype.init=function(e,r){OrOperation.superclass.init.call(this,e,r)};OrOperation.prototype.toString=function(){return"("+this.lhs.toString()+" or "+this.rhs.toString()+")"};OrOperation.prototype.evaluate=function(e){var r=this.lhs.evaluate(e).bool();if(r.booleanValue()){return r}return this.rhs.evaluate(e).bool()};AndOperation.prototype=new BinaryOperation;AndOperation.prototype.constructor=AndOperation;AndOperation.superclass=BinaryOperation.prototype;function AndOperation(e,r){if(arguments.length>0){this.init(e,r)}}AndOperation.prototype.init=function(e,r){AndOperation.superclass.init.call(this,e,r)};AndOperation.prototype.toString=function(){return"("+this.lhs.toString()+" and "+this.rhs.toString()+")"};AndOperation.prototype.evaluate=function(e){var r=this.lhs.evaluate(e).bool();if(!r.booleanValue()){return r}return this.rhs.evaluate(e).bool()};EqualsOperation.prototype=new BinaryOperation;EqualsOperation.prototype.constructor=EqualsOperation;EqualsOperation.superclass=BinaryOperation.prototype;function EqualsOperation(e,r){if(arguments.length>0){this.init(e,r)}}EqualsOperation.prototype.init=function(e,r){EqualsOperation.superclass.init.call(this,e,r)};EqualsOperation.prototype.toString=function(){return"("+this.lhs.toString()+" = "+this.rhs.toString()+")"};EqualsOperation.prototype.evaluate=function(e){return this.lhs.evaluate(e).equals(this.rhs.evaluate(e))};NotEqualOperation.prototype=new BinaryOperation;NotEqualOperation.prototype.constructor=NotEqualOperation;NotEqualOperation.superclass=BinaryOperation.prototype;function NotEqualOperation(e,r){if(arguments.length>0){this.init(e,r)}}NotEqualOperation.prototype.init=function(e,r){NotEqualOperation.superclass.init.call(this,e,r)};NotEqualOperation.prototype.toString=function(){return"("+this.lhs.toString()+" != "+this.rhs.toString()+")"};NotEqualOperation.prototype.evaluate=function(e){return this.lhs.evaluate(e).notequal(this.rhs.evaluate(e))};LessThanOperation.prototype=new BinaryOperation;LessThanOperation.prototype.constructor=LessThanOperation;LessThanOperation.superclass=BinaryOperation.prototype;function LessThanOperation(e,r){if(arguments.length>0){this.init(e,r)}}LessThanOperation.prototype.init=function(e,r){LessThanOperation.superclass.init.call(this,e,r)};LessThanOperation.prototype.evaluate=function(e){return this.lhs.evaluate(e).lessthan(this.rhs.evaluate(e))};LessThanOperation.prototype.toString=function(){return"("+this.lhs.toString()+" < "+this.rhs.toString()+")"};GreaterThanOperation.prototype=new BinaryOperation;GreaterThanOperation.prototype.constructor=GreaterThanOperation;GreaterThanOperation.superclass=BinaryOperation.prototype;function GreaterThanOperation(e,r){if(arguments.length>0){this.init(e,r)}}GreaterThanOperation.prototype.init=function(e,r){GreaterThanOperation.superclass.init.call(this,e,r)};GreaterThanOperation.prototype.evaluate=function(e){return this.lhs.evaluate(e).greaterthan(this.rhs.evaluate(e))};GreaterThanOperation.prototype.toString=function(){return"("+this.lhs.toString()+" > "+this.rhs.toString()+")"};LessThanOrEqualOperation.prototype=new BinaryOperation;LessThanOrEqualOperation.prototype.constructor=LessThanOrEqualOperation;LessThanOrEqualOperation.superclass=BinaryOperation.prototype;function LessThanOrEqualOperation(e,r){if(arguments.length>0){this.init(e,r)}}LessThanOrEqualOperation.prototype.init=function(e,r){LessThanOrEqualOperation.superclass.init.call(this,e,r)};LessThanOrEqualOperation.prototype.evaluate=function(e){return this.lhs.evaluate(e).lessthanorequal(this.rhs.evaluate(e))};LessThanOrEqualOperation.prototype.toString=function(){return"("+this.lhs.toString()+" <= "+this.rhs.toString()+")"};GreaterThanOrEqualOperation.prototype=new BinaryOperation;GreaterThanOrEqualOperation.prototype.constructor=GreaterThanOrEqualOperation;GreaterThanOrEqualOperation.superclass=BinaryOperation.prototype;function GreaterThanOrEqualOperation(e,r){if(arguments.length>0){this.init(e,r)}}GreaterThanOrEqualOperation.prototype.init=function(e,r){GreaterThanOrEqualOperation.superclass.init.call(this,e,r)};GreaterThanOrEqualOperation.prototype.evaluate=function(e){return this.lhs.evaluate(e).greaterthanorequal(this.rhs.evaluate(e))};GreaterThanOrEqualOperation.prototype.toString=function(){return"("+this.lhs.toString()+" >= "+this.rhs.toString()+")"};PlusOperation.prototype=new BinaryOperation;PlusOperation.prototype.constructor=PlusOperation;PlusOperation.superclass=BinaryOperation.prototype;function PlusOperation(e,r){if(arguments.length>0){this.init(e,r)}}PlusOperation.prototype.init=function(e,r){PlusOperation.superclass.init.call(this,e,r)};PlusOperation.prototype.evaluate=function(e){return this.lhs.evaluate(e).number().plus(this.rhs.evaluate(e).number())};PlusOperation.prototype.toString=function(){return"("+this.lhs.toString()+" + "+this.rhs.toString()+")"};MinusOperation.prototype=new BinaryOperation;MinusOperation.prototype.constructor=MinusOperation;MinusOperation.superclass=BinaryOperation.prototype;function MinusOperation(e,r){if(arguments.length>0){this.init(e,r)}}MinusOperation.prototype.init=function(e,r){MinusOperation.superclass.init.call(this,e,r)};MinusOperation.prototype.evaluate=function(e){return this.lhs.evaluate(e).number().minus(this.rhs.evaluate(e).number())};MinusOperation.prototype.toString=function(){return"("+this.lhs.toString()+" - "+this.rhs.toString()+")"};MultiplyOperation.prototype=new BinaryOperation;MultiplyOperation.prototype.constructor=MultiplyOperation;MultiplyOperation.superclass=BinaryOperation.prototype;function MultiplyOperation(e,r){if(arguments.length>0){this.init(e,r)}}MultiplyOperation.prototype.init=function(e,r){MultiplyOperation.superclass.init.call(this,e,r)};MultiplyOperation.prototype.evaluate=function(e){return this.lhs.evaluate(e).number().multiply(this.rhs.evaluate(e).number())};MultiplyOperation.prototype.toString=function(){return"("+this.lhs.toString()+" * "+this.rhs.toString()+")"};DivOperation.prototype=new BinaryOperation;DivOperation.prototype.constructor=DivOperation;DivOperation.superclass=BinaryOperation.prototype;function DivOperation(e,r){if(arguments.length>0){this.init(e,r)}}DivOperation.prototype.init=function(e,r){DivOperation.superclass.init.call(this,e,r)};DivOperation.prototype.evaluate=function(e){return this.lhs.evaluate(e).number().div(this.rhs.evaluate(e).number())};DivOperation.prototype.toString=function(){return"("+this.lhs.toString()+" div "+this.rhs.toString()+")"};ModOperation.prototype=new BinaryOperation;ModOperation.prototype.constructor=ModOperation;ModOperation.superclass=BinaryOperation.prototype;function ModOperation(e,r){if(arguments.length>0){this.init(e,r)}}ModOperation.prototype.init=function(e,r){ModOperation.superclass.init.call(this,e,r)};ModOperation.prototype.evaluate=function(e){return this.lhs.evaluate(e).number().mod(this.rhs.evaluate(e).number())};ModOperation.prototype.toString=function(){return"("+this.lhs.toString()+" mod "+this.rhs.toString()+")"};BarOperation.prototype=new BinaryOperation;BarOperation.prototype.constructor=BarOperation;BarOperation.superclass=BinaryOperation.prototype;function BarOperation(e,r){if(arguments.length>0){this.init(e,r)}}BarOperation.prototype.init=function(e,r){BarOperation.superclass.init.call(this,e,r)};BarOperation.prototype.evaluate=function(e){return this.lhs.evaluate(e).nodeset().union(this.rhs.evaluate(e).nodeset())};BarOperation.prototype.toString=function(){return map(toString,[this.lhs,this.rhs]).join(" | ")};PathExpr.prototype=new Expression;PathExpr.prototype.constructor=PathExpr;PathExpr.superclass=Expression.prototype;function PathExpr(e,r,n){if(arguments.length>0){this.init(e,r,n)}}PathExpr.prototype.init=function(e,r,n){PathExpr.superclass.init.call(this);this.filter=e;this.filterPredicates=r;this.locationPath=n};function findRoot(e){while(e&&e.parentNode){e=e.parentNode}return e}PathExpr.applyPredicates=function(e,r,n){if(e.length===0){return n}var i=r.extend({});return reduce((function(e,r){i.contextSize=e.length;return filter((function(e,n){i.contextNode=e;i.contextPosition=n+1;return PathExpr.predicateMatches(r,i)}),e)}),n,e)};PathExpr.getRoot=function(e,r){var n=r[0];if(n.nodeType===9){return n}if(e.virtualRoot){return e.virtualRoot}var i=n.ownerDocument;if(i){return i}var o=n;while(o.parentNode!=null){o=o.parentNode}return o};PathExpr.applyStep=function(e,r,n){var i=this;var o=[];r.contextNode=n;switch(e.axis){case Step.ANCESTOR:if(r.contextNode===r.virtualRoot){break}var s;if(r.contextNode.nodeType==2){s=PathExpr.getOwnerElement(r.contextNode)}else{s=r.contextNode.parentNode}while(s!=null){if(e.nodeTest.matches(s,r)){o.push(s)}if(s===r.virtualRoot){break}s=s.parentNode}break;case Step.ANCESTORORSELF:for(var s=r.contextNode;s!=null;s=s.nodeType==2?PathExpr.getOwnerElement(s):s.parentNode){if(e.nodeTest.matches(s,r)){o.push(s)}if(s===r.virtualRoot){break}}break;case Step.ATTRIBUTE:var a=r.contextNode.attributes;if(a!=null){for(var u=0;u<a.length;u++){var s=a.item(u);if(e.nodeTest.matches(s,r)){o.push(s)}}}break;case Step.CHILD:for(var s=r.contextNode.firstChild;s!=null;s=s.nextSibling){if(e.nodeTest.matches(s,r)){o.push(s)}}break;case Step.DESCENDANT:var l=[r.contextNode.firstChild];while(l.length>0){for(var s=l.pop();s!=null;){if(e.nodeTest.matches(s,r)){o.push(s)}if(s.firstChild!=null){l.push(s.nextSibling);s=s.firstChild}else{s=s.nextSibling}}}break;case Step.DESCENDANTORSELF:if(e.nodeTest.matches(r.contextNode,r)){o.push(r.contextNode)}var l=[r.contextNode.firstChild];while(l.length>0){for(var s=l.pop();s!=null;){if(e.nodeTest.matches(s,r)){o.push(s)}if(s.firstChild!=null){l.push(s.nextSibling);s=s.firstChild}else{s=s.nextSibling}}}break;case Step.FOLLOWING:if(r.contextNode===r.virtualRoot){break}var l=[];if(r.contextNode.firstChild!=null){l.unshift(r.contextNode.firstChild)}else{l.unshift(r.contextNode.nextSibling)}for(var s=r.contextNode.parentNode;s!=null&&s.nodeType!=9&&s!==r.virtualRoot;s=s.parentNode){l.unshift(s.nextSibling)}do{for(var s=l.pop();s!=null;){if(e.nodeTest.matches(s,r)){o.push(s)}if(s.firstChild!=null){l.push(s.nextSibling);s=s.firstChild}else{s=s.nextSibling}}}while(l.length>0);break;case Step.FOLLOWINGSIBLING:if(r.contextNode===r.virtualRoot){break}for(var s=r.contextNode.nextSibling;s!=null;s=s.nextSibling){if(e.nodeTest.matches(s,r)){o.push(s)}}break;case Step.NAMESPACE:var c={};if(r.contextNode.nodeType==1){c["xml"]=XPath.XML_NAMESPACE_URI;c["xmlns"]=XPath.XMLNS_NAMESPACE_URI;for(var s=r.contextNode;s!=null&&s.nodeType==1;s=s.parentNode){for(var u=0;u<s.attributes.length;u++){var p=s.attributes.item(u);var h=String(p.name);if(h=="xmlns"){if(c[""]==undefined){c[""]=p.value}}else if(h.length>6&&h.substring(0,6)=="xmlns:"){var f=h.substring(6,h.length);if(c[f]==undefined){c[f]=p.value}}}}for(var f in c){var d=new XPathNamespace(f,c[f],r.contextNode);if(e.nodeTest.matches(d,r)){o.push(d)}}}break;case Step.PARENT:s=null;if(r.contextNode!==r.virtualRoot){if(r.contextNode.nodeType==2){s=PathExpr.getOwnerElement(r.contextNode)}else{s=r.contextNode.parentNode}}if(s!=null&&e.nodeTest.matches(s,r)){o.push(s)}break;case Step.PRECEDING:var l;if(r.virtualRoot!=null){l=[r.virtualRoot]}else{l=[findRoot(r.contextNode)]}e:while(l.length>0){for(var s=l.pop();s!=null;){if(s==r.contextNode){break e}if(e.nodeTest.matches(s,r)){o.unshift(s)}if(s.firstChild!=null){l.push(s.nextSibling);s=s.firstChild}else{s=s.nextSibling}}}break;case Step.PRECEDINGSIBLING:if(r.contextNode===r.virtualRoot){break}for(var s=r.contextNode.previousSibling;s!=null;s=s.previousSibling){if(e.nodeTest.matches(s,r)){o.push(s)}}break;case Step.SELF:if(e.nodeTest.matches(r.contextNode,r)){o.push(r.contextNode)}break;default:}return o};function applyStepWithPredicates(e,r,n){return PathExpr.applyPredicates(e.predicates,r,PathExpr.applyStep(e,r,n))}function applyStepToNodes(e,r,n){return flatten(map(applyStepWithPredicates.bind(null,n,e),r))}PathExpr.applySteps=function(e,r,n){return reduce(applyStepToNodes.bind(null,r),n,e)};PathExpr.prototype.applyFilter=function(e,r){if(!this.filter){return{nodes:[e.contextNode]}}var n=this.filter.evaluate(e);if(!s.instance_of(n,XNodeSet)){if(this.filterPredicates!=null&&this.filterPredicates.length>0||this.locationPath!=null){throw new Error("Path expression filter must evaluate to a nodeset if predicates or location path are used")}return{nonNodes:n}}return{nodes:PathExpr.applyPredicates(this.filterPredicates||[],r,n.toUnsortedArray())}};PathExpr.applyLocationPath=function(e,r,n){if(!e){return n}var i=e.absolute?[PathExpr.getRoot(r,n)]:n;return PathExpr.applySteps(e.steps,r,i)};PathExpr.prototype.evaluate=function(e){var r=assign(new XPathContext,e);var n=this.applyFilter(e,r);if("nonNodes"in n){return n.nonNodes}var i=new XNodeSet;i.addArray(PathExpr.applyLocationPath(this.locationPath,r,n.nodes));return i};PathExpr.predicateMatches=function(e,r){var n=e.evaluate(r);return s.instance_of(n,XNumber)?r.contextPosition===n.numberValue():n.booleanValue()};PathExpr.predicateString=function(e){return wrap("[","]",e.toString())};PathExpr.predicatesString=function(e){return join("",map(PathExpr.predicateString,e))};PathExpr.prototype.toString=function(){if(this.filter!=undefined){var e=toString(this.filter);if(s.instance_of(this.filter,XString)){return wrap("'","'",e)}if(this.filterPredicates!=undefined&&this.filterPredicates.length){return wrap("(",")",e)+PathExpr.predicatesString(this.filterPredicates)}if(this.locationPath!=undefined){return e+(this.locationPath.absolute?"":"/")+toString(this.locationPath)}return e}return toString(this.locationPath)};PathExpr.getOwnerElement=function(e){if(e.ownerElement){return e.ownerElement}try{if(e.selectSingleNode){return e.selectSingleNode("..")}}catch(e){}var r=e.nodeType==9?e:e.ownerDocument;var n=r.getElementsByTagName("*");for(var i=0;i<n.length;i++){var o=n.item(i);var s=o.attributes;for(var a=0;a<s.length;a++){var u=s.item(a);if(u===e){return o}}}return null};LocationPath.prototype=new Object;LocationPath.prototype.constructor=LocationPath;LocationPath.superclass=Object.prototype;function LocationPath(e,r){if(arguments.length>0){this.init(e,r)}}LocationPath.prototype.init=function(e,r){this.absolute=e;this.steps=r};LocationPath.prototype.toString=function(){return(this.absolute?"/":"")+map(toString,this.steps).join("/")};Step.prototype=new Object;Step.prototype.constructor=Step;Step.superclass=Object.prototype;function Step(e,r,n){if(arguments.length>0){this.init(e,r,n)}}Step.prototype.init=function(e,r,n){this.axis=e;this.nodeTest=r;this.predicates=n};Step.prototype.toString=function(){return Step.STEPNAMES[this.axis]+"::"+this.nodeTest.toString()+PathExpr.predicatesString(this.predicates)};Step.ANCESTOR=0;Step.ANCESTORORSELF=1;Step.ATTRIBUTE=2;Step.CHILD=3;Step.DESCENDANT=4;Step.DESCENDANTORSELF=5;Step.FOLLOWING=6;Step.FOLLOWINGSIBLING=7;Step.NAMESPACE=8;Step.PARENT=9;Step.PRECEDING=10;Step.PRECEDINGSIBLING=11;Step.SELF=12;Step.STEPNAMES=reduce((function(e,r){return e[r[0]]=r[1],e}),{},[[Step.ANCESTOR,"ancestor"],[Step.ANCESTORORSELF,"ancestor-or-self"],[Step.ATTRIBUTE,"attribute"],[Step.CHILD,"child"],[Step.DESCENDANT,"descendant"],[Step.DESCENDANTORSELF,"descendant-or-self"],[Step.FOLLOWING,"following"],[Step.FOLLOWINGSIBLING,"following-sibling"],[Step.NAMESPACE,"namespace"],[Step.PARENT,"parent"],[Step.PRECEDING,"preceding"],[Step.PRECEDINGSIBLING,"preceding-sibling"],[Step.SELF,"self"]]);NodeTest.prototype=new Object;NodeTest.prototype.constructor=NodeTest;NodeTest.superclass=Object.prototype;function NodeTest(e,r){if(arguments.length>0){this.init(e,r)}}NodeTest.prototype.init=function(e,r){this.type=e;this.value=r};NodeTest.prototype.toString=function(){return"<unknown nodetest type>"};NodeTest.prototype.matches=function(e,r){console.warn("unknown node test type")};NodeTest.NAMETESTANY=0;NodeTest.NAMETESTPREFIXANY=1;NodeTest.NAMETESTQNAME=2;NodeTest.COMMENT=3;NodeTest.TEXT=4;NodeTest.PI=5;NodeTest.NODE=6;NodeTest.isNodeType=function(e){return function(r){return includes(e,r.nodeType)}};NodeTest.makeNodeTestType=function(e,r,n){var i=n||function(){};i.prototype=new NodeTest(e);i.prototype.constructor=i;assign(i.prototype,r);return i};NodeTest.makeNodeTypeTest=function(e,r,n){return new(NodeTest.makeNodeTestType(e,{matches:NodeTest.isNodeType(r),toString:always(n)}))};NodeTest.hasPrefix=function(e){return e.prefix||(e.nodeName||e.tagName).indexOf(":")!==-1};NodeTest.isElementOrAttribute=NodeTest.isNodeType([1,2]);NodeTest.nameSpaceMatches=function(e,r,n){var i=n.namespaceURI||"";if(!e){return!i||r.allowAnyNamespaceForNoPrefix&&!NodeTest.hasPrefix(n)}var o=r.namespaceResolver.getNamespace(e,r.expressionContextNode);if(o==null){throw new Error("Cannot resolve QName "+e)}return o===i};NodeTest.localNameMatches=function(e,r,n){var i=n.localName||n.nodeName;return r.caseInsensitive?e.toLowerCase()===i.toLowerCase():e===i};NodeTest.NameTestPrefixAny=NodeTest.makeNodeTestType(NodeTest.NAMETESTPREFIXANY,{matches:function(e,r){return NodeTest.isElementOrAttribute(e)&&NodeTest.nameSpaceMatches(this.prefix,r,e)},toString:function(){return this.prefix+":*"}},(function NameTestPrefixAny(e){this.prefix=e}));NodeTest.NameTestQName=NodeTest.makeNodeTestType(NodeTest.NAMETESTQNAME,{matches:function(e,r){return NodeTest.isNodeType([1,2,XPathNamespace.XPATH_NAMESPACE_NODE])(e)&&NodeTest.nameSpaceMatches(this.prefix,r,e)&&NodeTest.localNameMatches(this.localName,r,e)},toString:function(){return this.name}},(function NameTestQName(e){var r=e.split(":");this.name=e;this.prefix=r.length>1?r[0]:null;this.localName=r[r.length>1?1:0]}));NodeTest.PITest=NodeTest.makeNodeTestType(NodeTest.PI,{matches:function(e,r){return NodeTest.isNodeType([7])(e)&&(e.target||e.nodeName)===this.name},toString:function(){return wrap('processing-instruction("','")',this.name)}},(function(e){this.name=e}));NodeTest.nameTestAny=NodeTest.makeNodeTypeTest(NodeTest.NAMETESTANY,[1,2,XPathNamespace.XPATH_NAMESPACE_NODE],"*");NodeTest.textTest=NodeTest.makeNodeTypeTest(NodeTest.TEXT,[3,4],"text()");NodeTest.commentTest=NodeTest.makeNodeTypeTest(NodeTest.COMMENT,[8],"comment()");NodeTest.nodeTest=NodeTest.makeNodeTypeTest(NodeTest.NODE,[1,2,3,4,7,8,9],"node()");NodeTest.anyPiTest=NodeTest.makeNodeTypeTest(NodeTest.PI,[7],"processing-instruction()");VariableReference.prototype=new Expression;VariableReference.prototype.constructor=VariableReference;VariableReference.superclass=Expression.prototype;function VariableReference(e){if(arguments.length>0){this.init(e)}}VariableReference.prototype.init=function(e){this.variable=e};VariableReference.prototype.toString=function(){return"$"+this.variable};VariableReference.prototype.evaluate=function(e){var r=s.resolveQName(this.variable,e.namespaceResolver,e.contextNode,false);if(r[0]==null){throw new Error("Cannot resolve QName "+fn)}var n=e.variableResolver.getVariable(r[1],r[0]);if(!n){throw a.fromMessage("Undeclared variable: "+this.toString())}return n};FunctionCall.prototype=new Expression;FunctionCall.prototype.constructor=FunctionCall;FunctionCall.superclass=Expression.prototype;function FunctionCall(e,r){if(arguments.length>0){this.init(e,r)}}FunctionCall.prototype.init=function(e,r){this.functionName=e;this.arguments=r};FunctionCall.prototype.toString=function(){var e=this.functionName+"(";for(var r=0;r<this.arguments.length;r++){if(r>0){e+=", "}e+=this.arguments[r].toString()}return e+")"};FunctionCall.prototype.evaluate=function(e){var r=FunctionResolver.getFunctionFromContext(this.functionName,e);if(!r){throw new Error("Unknown function "+this.functionName)}var n=[e].concat(this.arguments);return r.apply(e.functionResolver.thisArg,n)};var i=new Object;i.equals=function(e,r){return e.equals(r)};i.notequal=function(e,r){return e.notequal(r)};i.lessthan=function(e,r){return e.lessthan(r)};i.greaterthan=function(e,r){return e.greaterthan(r)};i.lessthanorequal=function(e,r){return e.lessthanorequal(r)};i.greaterthanorequal=function(e,r){return e.greaterthanorequal(r)};XString.prototype=new Expression;XString.prototype.constructor=XString;XString.superclass=Expression.prototype;function XString(e){if(arguments.length>0){this.init(e)}}XString.prototype.init=function(e){this.str=String(e)};XString.prototype.toString=function(){return this.str};XString.prototype.evaluate=function(e){return this};XString.prototype.string=function(){return this};XString.prototype.number=function(){return new XNumber(this.str)};XString.prototype.bool=function(){return new XBoolean(this.str)};XString.prototype.nodeset=function(){throw new Error("Cannot convert string to nodeset")};XString.prototype.stringValue=function(){return this.str};XString.prototype.numberValue=function(){return this.number().numberValue()};XString.prototype.booleanValue=function(){return this.bool().booleanValue()};XString.prototype.equals=function(e){if(s.instance_of(e,XBoolean)){return this.bool().equals(e)}if(s.instance_of(e,XNumber)){return this.number().equals(e)}if(s.instance_of(e,XNodeSet)){return e.compareWithString(this,i.equals)}return new XBoolean(this.str==e.str)};XString.prototype.notequal=function(e){if(s.instance_of(e,XBoolean)){return this.bool().notequal(e)}if(s.instance_of(e,XNumber)){return this.number().notequal(e)}if(s.instance_of(e,XNodeSet)){return e.compareWithString(this,i.notequal)}return new XBoolean(this.str!=e.str)};XString.prototype.lessthan=function(e){return this.number().lessthan(e)};XString.prototype.greaterthan=function(e){return this.number().greaterthan(e)};XString.prototype.lessthanorequal=function(e){return this.number().lessthanorequal(e)};XString.prototype.greaterthanorequal=function(e){return this.number().greaterthanorequal(e)};XNumber.prototype=new Expression;XNumber.prototype.constructor=XNumber;XNumber.superclass=Expression.prototype;function XNumber(e){if(arguments.length>0){this.init(e)}}XNumber.prototype.init=function(e){this.num=typeof e==="string"?this.parse(e):Number(e)};XNumber.prototype.numberFormat=/^\s*-?[0-9]*\.?[0-9]+\s*$/;XNumber.prototype.parse=function(e){return this.numberFormat.test(e)?parseFloat(e):Number.NaN};function padSmallNumber(e){var r=e.split("e-");var n=r[0].replace(".","");var i=Number(r[1]);for(var o=0;o<i-1;o+=1){n="0"+n}return"0."+n}function padLargeNumber(e){var r=e.split("e");var n=r[0].replace(".","");var i=Number(r[1]);var o=i+1-n.length;for(var s=0;s<o;s+=1){n+="0"}return n}XNumber.prototype.toString=function(){var e=this.num.toString();if(e.indexOf("e-")!==-1){return padSmallNumber(e)}if(e.indexOf("e")!==-1){return padLargeNumber(e)}return e};XNumber.prototype.evaluate=function(e){return this};XNumber.prototype.string=function(){return new XString(this.toString())};XNumber.prototype.number=function(){return this};XNumber.prototype.bool=function(){return new XBoolean(this.num)};XNumber.prototype.nodeset=function(){throw new Error("Cannot convert number to nodeset")};XNumber.prototype.stringValue=function(){return this.string().stringValue()};XNumber.prototype.numberValue=function(){return this.num};XNumber.prototype.booleanValue=function(){return this.bool().booleanValue()};XNumber.prototype.negate=function(){return new XNumber(-this.num)};XNumber.prototype.equals=function(e){if(s.instance_of(e,XBoolean)){return this.bool().equals(e)}if(s.instance_of(e,XString)){return this.equals(e.number())}if(s.instance_of(e,XNodeSet)){return e.compareWithNumber(this,i.equals)}return new XBoolean(this.num==e.num)};XNumber.prototype.notequal=function(e){if(s.instance_of(e,XBoolean)){return this.bool().notequal(e)}if(s.instance_of(e,XString)){return this.notequal(e.number())}if(s.instance_of(e,XNodeSet)){return e.compareWithNumber(this,i.notequal)}return new XBoolean(this.num!=e.num)};XNumber.prototype.lessthan=function(e){if(s.instance_of(e,XNodeSet)){return e.compareWithNumber(this,i.greaterthan)}if(s.instance_of(e,XBoolean)||s.instance_of(e,XString)){return this.lessthan(e.number())}return new XBoolean(this.num<e.num)};XNumber.prototype.greaterthan=function(e){if(s.instance_of(e,XNodeSet)){return e.compareWithNumber(this,i.lessthan)}if(s.instance_of(e,XBoolean)||s.instance_of(e,XString)){return this.greaterthan(e.number())}return new XBoolean(this.num>e.num)};XNumber.prototype.lessthanorequal=function(e){if(s.instance_of(e,XNodeSet)){return e.compareWithNumber(this,i.greaterthanorequal)}if(s.instance_of(e,XBoolean)||s.instance_of(e,XString)){return this.lessthanorequal(e.number())}return new XBoolean(this.num<=e.num)};XNumber.prototype.greaterthanorequal=function(e){if(s.instance_of(e,XNodeSet)){return e.compareWithNumber(this,i.lessthanorequal)}if(s.instance_of(e,XBoolean)||s.instance_of(e,XString)){return this.greaterthanorequal(e.number())}return new XBoolean(this.num>=e.num)};XNumber.prototype.plus=function(e){return new XNumber(this.num+e.num)};XNumber.prototype.minus=function(e){return new XNumber(this.num-e.num)};XNumber.prototype.multiply=function(e){return new XNumber(this.num*e.num)};XNumber.prototype.div=function(e){return new XNumber(this.num/e.num)};XNumber.prototype.mod=function(e){return new XNumber(this.num%e.num)};XBoolean.prototype=new Expression;XBoolean.prototype.constructor=XBoolean;XBoolean.superclass=Expression.prototype;function XBoolean(e){if(arguments.length>0){this.init(e)}}XBoolean.prototype.init=function(e){this.b=Boolean(e)};XBoolean.prototype.toString=function(){return this.b.toString()};XBoolean.prototype.evaluate=function(e){return this};XBoolean.prototype.string=function(){return new XString(this.b)};XBoolean.prototype.number=function(){return new XNumber(this.b)};XBoolean.prototype.bool=function(){return this};XBoolean.prototype.nodeset=function(){throw new Error("Cannot convert boolean to nodeset")};XBoolean.prototype.stringValue=function(){return this.string().stringValue()};XBoolean.prototype.numberValue=function(){return this.number().numberValue()};XBoolean.prototype.booleanValue=function(){return this.b};XBoolean.prototype.not=function(){return new XBoolean(!this.b)};XBoolean.prototype.equals=function(e){if(s.instance_of(e,XString)||s.instance_of(e,XNumber)){return this.equals(e.bool())}if(s.instance_of(e,XNodeSet)){return e.compareWithBoolean(this,i.equals)}return new XBoolean(this.b==e.b)};XBoolean.prototype.notequal=function(e){if(s.instance_of(e,XString)||s.instance_of(e,XNumber)){return this.notequal(e.bool())}if(s.instance_of(e,XNodeSet)){return e.compareWithBoolean(this,i.notequal)}return new XBoolean(this.b!=e.b)};XBoolean.prototype.lessthan=function(e){return this.number().lessthan(e)};XBoolean.prototype.greaterthan=function(e){return this.number().greaterthan(e)};XBoolean.prototype.lessthanorequal=function(e){return this.number().lessthanorequal(e)};XBoolean.prototype.greaterthanorequal=function(e){return this.number().greaterthanorequal(e)};XBoolean.true_=new XBoolean(true);XBoolean.false_=new XBoolean(false);AVLTree.prototype=new Object;AVLTree.prototype.constructor=AVLTree;AVLTree.superclass=Object.prototype;function AVLTree(e){this.init(e)}AVLTree.prototype.init=function(e){this.left=null;this.right=null;this.node=e;this.depth=1};AVLTree.prototype.balance=function(){var e=this.left==null?0:this.left.depth;var r=this.right==null?0:this.right.depth;if(e>r+1){var n=this.left.left==null?0:this.left.left.depth;var i=this.left.right==null?0:this.left.right.depth;if(n<i){this.left.rotateRR()}this.rotateLL()}else if(e+1<r){var o=this.right.right==null?0:this.right.right.depth;var s=this.right.left==null?0:this.right.left.depth;if(s>o){this.right.rotateLL()}this.rotateRR()}};AVLTree.prototype.rotateLL=function(){var e=this.node;var r=this.right;this.node=this.left.node;this.right=this.left;this.left=this.left.left;this.right.left=this.right.right;this.right.right=r;this.right.node=e;this.right.updateInNewLocation();this.updateInNewLocation()};AVLTree.prototype.rotateRR=function(){var e=this.node;var r=this.left;this.node=this.right.node;this.left=this.right;this.right=this.right.right;this.left.right=this.left.left;this.left.left=r;this.left.node=e;this.left.updateInNewLocation();this.updateInNewLocation()};AVLTree.prototype.updateInNewLocation=function(){this.getDepthFromChildren()};AVLTree.prototype.getDepthFromChildren=function(){this.depth=this.node==null?0:1;if(this.left!=null){this.depth=this.left.depth+1}if(this.right!=null&&this.depth<=this.right.depth){this.depth=this.right.depth+1}};function nodeOrder(e,r){if(e===r){return 0}if(e.compareDocumentPosition){var n=e.compareDocumentPosition(r);if(n&1){return 1}if(n&10){return 1}if(n&20){return-1}return 0}var i=0,o=0;for(var a=e;a!=null;a=a.parentNode||a.ownerElement){i++}for(var u=r;u!=null;u=u.parentNode||u.ownerElement){o++}if(i>o){while(i>o){e=e.parentNode||e.ownerElement;i--}if(e===r){return 1}}else if(o>i){while(o>i){r=r.parentNode||r.ownerElement;o--}if(e===r){return-1}}var l=e.parentNode||e.ownerElement,c=r.parentNode||r.ownerElement;while(l!==c){e=l;r=c;l=e.parentNode||e.ownerElement;c=r.parentNode||r.ownerElement}var p=s.isAttribute(e);var h=s.isAttribute(r);if(p&&!h){return-1}if(!p&&h){return 1}if(l){var f=p?l.attributes:l.childNodes,d=f.length;for(var m=0;m<d;m+=1){var g=f[m];if(g===e){return-1}if(g===r){return 1}}}throw new Error("Unexpected: could not determine node order")}AVLTree.prototype.add=function(e){if(e===this.node){return false}var r=nodeOrder(e,this.node);var n=false;if(r==-1){if(this.left==null){this.left=new AVLTree(e);n=true}else{n=this.left.add(e);if(n){this.balance()}}}else if(r==1){if(this.right==null){this.right=new AVLTree(e);n=true}else{n=this.right.add(e);if(n){this.balance()}}}if(n){this.getDepthFromChildren()}return n};XNodeSet.prototype=new Expression;XNodeSet.prototype.constructor=XNodeSet;XNodeSet.superclass=Expression.prototype;function XNodeSet(){this.init()}XNodeSet.prototype.init=function(){this.tree=null;this.nodes=[];this.size=0};XNodeSet.prototype.toString=function(){var e=this.first();if(e==null){return""}return this.stringForNode(e)};XNodeSet.prototype.evaluate=function(e){return this};XNodeSet.prototype.string=function(){return new XString(this.toString())};XNodeSet.prototype.stringValue=function(){return this.toString()};XNodeSet.prototype.number=function(){return new XNumber(this.string())};XNodeSet.prototype.numberValue=function(){return Number(this.string())};XNodeSet.prototype.bool=function(){return new XBoolean(this.booleanValue())};XNodeSet.prototype.booleanValue=function(){return!!this.size};XNodeSet.prototype.nodeset=function(){return this};XNodeSet.prototype.stringForNode=function(e){if(e.nodeType==9||e.nodeType==1||e.nodeType===11){return this.stringForContainerNode(e)}if(e.nodeType===2){return e.value||e.nodeValue}if(e.isNamespaceNode){return e.namespace}return e.nodeValue};XNodeSet.prototype.stringForContainerNode=function(e){var r="";for(var n=e.firstChild;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3||i===4||i===9||i===11){r+=this.stringForNode(n)}}return r};XNodeSet.prototype.buildTree=function(){if(!this.tree&&this.nodes.length){this.tree=new AVLTree(this.nodes[0]);for(var e=1;e<this.nodes.length;e+=1){this.tree.add(this.nodes[e])}}return this.tree};XNodeSet.prototype.first=function(){var e=this.buildTree();if(e==null){return null}while(e.left!=null){e=e.left}return e.node};XNodeSet.prototype.add=function(e){for(var r=0;r<this.nodes.length;r+=1){if(e===this.nodes[r]){return}}this.tree=null;this.nodes.push(e);this.size+=1};XNodeSet.prototype.addArray=function(e){var r=this;forEach((function(e){r.add(e)}),e)};XNodeSet.prototype.toArray=function(){var e=[];this.toArrayRec(this.buildTree(),e);return e};XNodeSet.prototype.toArrayRec=function(e,r){if(e!=null){this.toArrayRec(e.left,r);r.push(e.node);this.toArrayRec(e.right,r)}};XNodeSet.prototype.toUnsortedArray=function(){return this.nodes.slice()};XNodeSet.prototype.compareWithString=function(e,r){var n=this.toUnsortedArray();for(var i=0;i<n.length;i++){var o=n[i];var s=new XString(this.stringForNode(o));var a=r(s,e);if(a.booleanValue()){return a}}return new XBoolean(false)};XNodeSet.prototype.compareWithNumber=function(e,r){var n=this.toUnsortedArray();for(var i=0;i<n.length;i++){var o=n[i];var s=new XNumber(this.stringForNode(o));var a=r(s,e);if(a.booleanValue()){return a}}return new XBoolean(false)};XNodeSet.prototype.compareWithBoolean=function(e,r){return r(this.bool(),e)};XNodeSet.prototype.compareWithNodeSet=function(e,r){var n=this.toUnsortedArray();var oInvert=function(e,n){return r(n,e)};for(var i=0;i<n.length;i++){var o=new XString(this.stringForNode(n[i]));var s=e.compareWithString(o,oInvert);if(s.booleanValue()){return s}}return new XBoolean(false)};XNodeSet.compareWith=curry((function(e,r){if(s.instance_of(r,XString)){return this.compareWithString(r,e)}if(s.instance_of(r,XNumber)){return this.compareWithNumber(r,e)}if(s.instance_of(r,XBoolean)){return this.compareWithBoolean(r,e)}return this.compareWithNodeSet(r,e)}));XNodeSet.prototype.equals=XNodeSet.compareWith(i.equals);XNodeSet.prototype.notequal=XNodeSet.compareWith(i.notequal);XNodeSet.prototype.lessthan=XNodeSet.compareWith(i.lessthan);XNodeSet.prototype.greaterthan=XNodeSet.compareWith(i.greaterthan);XNodeSet.prototype.lessthanorequal=XNodeSet.compareWith(i.lessthanorequal);XNodeSet.prototype.greaterthanorequal=XNodeSet.compareWith(i.greaterthanorequal);XNodeSet.prototype.union=function(e){var r=new XNodeSet;r.addArray(this.toUnsortedArray());r.addArray(e.toUnsortedArray());return r};XPathNamespace.prototype=new Object;XPathNamespace.prototype.constructor=XPathNamespace;XPathNamespace.superclass=Object.prototype;function XPathNamespace(e,r,n){this.isXPathNamespace=true;this.ownerDocument=n.ownerDocument;this.nodeName="#namespace";this.prefix=e;this.localName=e;this.namespaceURI=r;this.nodeValue=r;this.ownerElement=n;this.nodeType=XPathNamespace.XPATH_NAMESPACE_NODE}XPathNamespace.prototype.toString=function(){return'{ "'+this.prefix+'", "'+this.namespaceURI+'" }'};XPathContext.prototype=new Object;XPathContext.prototype.constructor=XPathContext;XPathContext.superclass=Object.prototype;function XPathContext(e,r,n){this.variableResolver=e!=null?e:new VariableResolver;this.namespaceResolver=r!=null?r:new NamespaceResolver;this.functionResolver=n!=null?n:new FunctionResolver}XPathContext.prototype.extend=function(e){return assign(new XPathContext,this,e)};VariableResolver.prototype=new Object;VariableResolver.prototype.constructor=VariableResolver;VariableResolver.superclass=Object.prototype;function VariableResolver(){}VariableResolver.prototype.getVariable=function(e,r){return null};FunctionResolver.prototype=new Object;FunctionResolver.prototype.constructor=FunctionResolver;FunctionResolver.superclass=Object.prototype;function FunctionResolver(e){this.thisArg=e!=null?e:o;this.functions=new Object;this.addStandardFunctions()}FunctionResolver.prototype.addStandardFunctions=function(){this.functions["{}last"]=o.last;this.functions["{}position"]=o.position;this.functions["{}count"]=o.count;this.functions["{}id"]=o.id;this.functions["{}local-name"]=o.localName;this.functions["{}namespace-uri"]=o.namespaceURI;this.functions["{}name"]=o.name;this.functions["{}string"]=o.string;this.functions["{}concat"]=o.concat;this.functions["{}starts-with"]=o.startsWith;this.functions["{}contains"]=o.contains;this.functions["{}substring-before"]=o.substringBefore;this.functions["{}substring-after"]=o.substringAfter;this.functions["{}substring"]=o.substring;this.functions["{}string-length"]=o.stringLength;this.functions["{}normalize-space"]=o.normalizeSpace;this.functions["{}translate"]=o.translate;this.functions["{}boolean"]=o.boolean_;this.functions["{}not"]=o.not;this.functions["{}true"]=o.true_;this.functions["{}false"]=o.false_;this.functions["{}lang"]=o.lang;this.functions["{}number"]=o.number;this.functions["{}sum"]=o.sum;this.functions["{}floor"]=o.floor;this.functions["{}ceiling"]=o.ceiling;this.functions["{}round"]=o.round};FunctionResolver.prototype.addFunction=function(e,r,n){this.functions["{"+e+"}"+r]=n};FunctionResolver.getFunctionFromContext=function(e,r){var n=s.resolveQName(e,r.namespaceResolver,r.contextNode,false);if(n[0]===null){throw new Error("Cannot resolve QName "+name)}return r.functionResolver.getFunction(n[1],n[0])};FunctionResolver.prototype.getFunction=function(e,r){return this.functions["{"+r+"}"+e]};NamespaceResolver.prototype=new Object;NamespaceResolver.prototype.constructor=NamespaceResolver;NamespaceResolver.superclass=Object.prototype;function NamespaceResolver(){}NamespaceResolver.prototype.getNamespace=function(e,r){if(e=="xml"){return XPath.XML_NAMESPACE_URI}else if(e=="xmlns"){return XPath.XMLNS_NAMESPACE_URI}if(r.nodeType==9){r=r.documentElement}else if(r.nodeType==2){r=PathExpr.getOwnerElement(r)}else if(r.nodeType!=1){r=r.parentNode}while(r!=null&&r.nodeType==1){var n=r.attributes;for(var i=0;i<n.length;i++){var o=n.item(i);var s=o.name||o.nodeName;if(s==="xmlns"&&e===""||s==="xmlns:"+e){return String(o.value||o.nodeValue)}}r=r.parentNode}return null};var o=new Object;o.last=function(e){if(arguments.length!=1){throw new Error("Function last expects ()")}return new XNumber(e.contextSize)};o.position=function(e){if(arguments.length!=1){throw new Error("Function position expects ()")}return new XNumber(e.contextPosition)};o.count=function(){var e=arguments[0];var r;if(arguments.length!=2||!s.instance_of(r=arguments[1].evaluate(e),XNodeSet)){throw new Error("Function count expects (node-set)")}return new XNumber(r.size)};o.id=function(){var e=arguments[0];var r;if(arguments.length!=2){throw new Error("Function id expects (object)")}r=arguments[1].evaluate(e);if(s.instance_of(r,XNodeSet)){r=r.toArray().join(" ")}else{r=r.stringValue()}var n=r.split(/[\x0d\x0a\x09\x20]+/);var i=0;var o=new XNodeSet;var a=e.contextNode.nodeType==9?e.contextNode:e.contextNode.ownerDocument;for(var u=0;u<n.length;u++){var l;if(a.getElementById){l=a.getElementById(n[u])}else{l=s.getElementById(a,n[u])}if(l!=null){o.add(l);i++}}return o};o.localName=function(e,r){var n;if(arguments.length==1){n=e.contextNode}else if(arguments.length==2){n=r.evaluate(e).first()}else{throw new Error("Function local-name expects (node-set?)")}if(n==null){return new XString("")}return new XString(n.localName||n.baseName||n.target||n.nodeName||"")};o.namespaceURI=function(){var e=arguments[0];var r;if(arguments.length==1){r=e.contextNode}else if(arguments.length==2){r=arguments[1].evaluate(e).first()}else{throw new Error("Function namespace-uri expects (node-set?)")}if(r==null){return new XString("")}return new XString(r.namespaceURI)};o.name=function(){var e=arguments[0];var r;if(arguments.length==1){r=e.contextNode}else if(arguments.length==2){r=arguments[1].evaluate(e).first()}else{throw new Error("Function name expects (node-set?)")}if(r==null){return new XString("")}if(r.nodeType==1){return new XString(r.nodeName)}else if(r.nodeType==2){return new XString(r.name||r.nodeName)}else if(r.nodeType===7){return new XString(r.target||r.nodeName)}else if(r.localName==null){return new XString("")}else{return new XString(r.localName)}};o.string=function(){var e=arguments[0];if(arguments.length==1){return new XString(XNodeSet.prototype.stringForNode(e.contextNode))}else if(arguments.length==2){return arguments[1].evaluate(e).string()}throw new Error("Function string expects (object?)")};o.concat=function(e){if(arguments.length<3){throw new Error("Function concat expects (string, string[, string]*)")}var r="";for(var n=1;n<arguments.length;n++){r+=arguments[n].evaluate(e).stringValue()}return new XString(r)};o.startsWith=function(){var e=arguments[0];if(arguments.length!=3){throw new Error("Function startsWith expects (string, string)")}var r=arguments[1].evaluate(e).stringValue();var n=arguments[2].evaluate(e).stringValue();return new XBoolean(r.substring(0,n.length)==n)};o.contains=function(){var e=arguments[0];if(arguments.length!=3){throw new Error("Function contains expects (string, string)")}var r=arguments[1].evaluate(e).stringValue();var n=arguments[2].evaluate(e).stringValue();return new XBoolean(r.indexOf(n)!==-1)};o.substringBefore=function(){var e=arguments[0];if(arguments.length!=3){throw new Error("Function substring-before expects (string, string)")}var r=arguments[1].evaluate(e).stringValue();var n=arguments[2].evaluate(e).stringValue();return new XString(r.substring(0,r.indexOf(n)))};o.substringAfter=function(){var e=arguments[0];if(arguments.length!=3){throw new Error("Function substring-after expects (string, string)")}var r=arguments[1].evaluate(e).stringValue();var n=arguments[2].evaluate(e).stringValue();if(n.length==0){return new XString(r)}var i=r.indexOf(n);if(i==-1){return new XString("")}return new XString(r.substring(i+n.length))};o.substring=function(){var e=arguments[0];if(!(arguments.length==3||arguments.length==4)){throw new Error("Function substring expects (string, number, number?)")}var r=arguments[1].evaluate(e).stringValue();var n=Math.round(arguments[2].evaluate(e).numberValue())-1;var i=arguments.length==4?n+Math.round(arguments[3].evaluate(e).numberValue()):undefined;return new XString(r.substring(n,i))};o.stringLength=function(){var e=arguments[0];var r;if(arguments.length==1){r=XNodeSet.prototype.stringForNode(e.contextNode)}else if(arguments.length==2){r=arguments[1].evaluate(e).stringValue()}else{throw new Error("Function string-length expects (string?)")}return new XNumber(r.length)};o.normalizeSpace=function(){var e=arguments[0];var r;if(arguments.length==1){r=XNodeSet.prototype.stringForNode(e.contextNode)}else if(arguments.length==2){r=arguments[1].evaluate(e).stringValue()}else{throw new Error("Function normalize-space expects (string?)")}var n=0;var i=r.length-1;while(s.isSpace(r.charCodeAt(i))){i--}var o="";while(n<=i&&s.isSpace(r.charCodeAt(n))){n++}while(n<=i){if(s.isSpace(r.charCodeAt(n))){o+=" ";while(n<=i&&s.isSpace(r.charCodeAt(n))){n++}}else{o+=r.charAt(n);n++}}return new XString(o)};o.translate=function(e,r,n,i){if(arguments.length!=4){throw new Error("Function translate expects (string, string, string)")}var o=r.evaluate(e).stringValue();var s=n.evaluate(e).stringValue();var a=i.evaluate(e).stringValue();var u=reduce((function(e,r,n){if(!(r in e)){e[r]=n>a.length?"":a[n]}return e}),{},s);var l=join("",map((function(e){return e in u?u[e]:e}),o));return new XString(l)};o.boolean_=function(){var e=arguments[0];if(arguments.length!=2){throw new Error("Function boolean expects (object)")}return arguments[1].evaluate(e).bool()};o.not=function(e,r){if(arguments.length!=2){throw new Error("Function not expects (object)")}return r.evaluate(e).bool().not()};o.true_=function(){if(arguments.length!=1){throw new Error("Function true expects ()")}return XBoolean.true_};o.false_=function(){if(arguments.length!=1){throw new Error("Function false expects ()")}return XBoolean.false_};o.lang=function(){var e=arguments[0];if(arguments.length!=2){throw new Error("Function lang expects (string)")}var r;for(var n=e.contextNode;n!=null&&n.nodeType!=9;n=n.parentNode){var i=n.getAttributeNS(XPath.XML_NAMESPACE_URI,"lang");if(i!=null){r=String(i);break}}if(r==null){return XBoolean.false_}var o=arguments[1].evaluate(e).stringValue();return new XBoolean(r.substring(0,o.length)==o&&(r.length==o.length||r.charAt(o.length)=="-"))};o.number=function(){var e=arguments[0];if(!(arguments.length==1||arguments.length==2)){throw new Error("Function number expects (object?)")}if(arguments.length==1){return new XNumber(XNodeSet.prototype.stringForNode(e.contextNode))}return arguments[1].evaluate(e).number()};o.sum=function(){var e=arguments[0];var r;if(arguments.length!=2||!s.instance_of(r=arguments[1].evaluate(e),XNodeSet)){throw new Error("Function sum expects (node-set)")}r=r.toUnsortedArray();var n=0;for(var i=0;i<r.length;i++){n+=new XNumber(XNodeSet.prototype.stringForNode(r[i])).numberValue()}return new XNumber(n)};o.floor=function(){var e=arguments[0];if(arguments.length!=2){throw new Error("Function floor expects (number)")}return new XNumber(Math.floor(arguments[1].evaluate(e).numberValue()))};o.ceiling=function(){var e=arguments[0];if(arguments.length!=2){throw new Error("Function ceiling expects (number)")}return new XNumber(Math.ceil(arguments[1].evaluate(e).numberValue()))};o.round=function(){var e=arguments[0];if(arguments.length!=2){throw new Error("Function round expects (number)")}return new XNumber(Math.round(arguments[1].evaluate(e).numberValue()))};var s=new Object;s.isAttribute=function(e){return e&&(e.nodeType===2||e.ownerElement)};s.splitQName=function(e){var r=e.indexOf(":");if(r==-1){return[null,e]}return[e.substring(0,r),e.substring(r+1)]};s.resolveQName=function(e,r,n,i){var o=s.splitQName(e);if(o[0]!=null){o[0]=r.getNamespace(o[0],n)}else{if(i){o[0]=r.getNamespace("",n);if(o[0]==null){o[0]=""}}else{o[0]=""}}return o};s.isSpace=function(e){return e==9||e==13||e==10||e==32};s.isLetter=function(e){return e>=65&&e<=90||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=255||e>=256&&e<=305||e>=308&&e<=318||e>=321&&e<=328||e>=330&&e<=382||e>=384&&e<=451||e>=461&&e<=496||e>=500&&e<=501||e>=506&&e<=535||e>=592&&e<=680||e>=699&&e<=705||e==902||e>=904&&e<=906||e==908||e>=910&&e<=929||e>=931&&e<=974||e>=976&&e<=982||e==986||e==988||e==990||e==992||e>=994&&e<=1011||e>=1025&&e<=1036||e>=1038&&e<=1103||e>=1105&&e<=1116||e>=1118&&e<=1153||e>=1168&&e<=1220||e>=1223&&e<=1224||e>=1227&&e<=1228||e>=1232&&e<=1259||e>=1262&&e<=1269||e>=1272&&e<=1273||e>=1329&&e<=1366||e==1369||e>=1377&&e<=1414||e>=1488&&e<=1514||e>=1520&&e<=1522||e>=1569&&e<=1594||e>=1601&&e<=1610||e>=1649&&e<=1719||e>=1722&&e<=1726||e>=1728&&e<=1742||e>=1744&&e<=1747||e==1749||e>=1765&&e<=1766||e>=2309&&e<=2361||e==2365||e>=2392&&e<=2401||e>=2437&&e<=2444||e>=2447&&e<=2448||e>=2451&&e<=2472||e>=2474&&e<=2480||e==2482||e>=2486&&e<=2489||e>=2524&&e<=2525||e>=2527&&e<=2529||e>=2544&&e<=2545||e>=2565&&e<=2570||e>=2575&&e<=2576||e>=2579&&e<=2600||e>=2602&&e<=2608||e>=2610&&e<=2611||e>=2613&&e<=2614||e>=2616&&e<=2617||e>=2649&&e<=2652||e==2654||e>=2674&&e<=2676||e>=2693&&e<=2699||e==2701||e>=2703&&e<=2705||e>=2707&&e<=2728||e>=2730&&e<=2736||e>=2738&&e<=2739||e>=2741&&e<=2745||e==2749||e==2784||e>=2821&&e<=2828||e>=2831&&e<=2832||e>=2835&&e<=2856||e>=2858&&e<=2864||e>=2866&&e<=2867||e>=2870&&e<=2873||e==2877||e>=2908&&e<=2909||e>=2911&&e<=2913||e>=2949&&e<=2954||e>=2958&&e<=2960||e>=2962&&e<=2965||e>=2969&&e<=2970||e==2972||e>=2974&&e<=2975||e>=2979&&e<=2980||e>=2984&&e<=2986||e>=2990&&e<=2997||e>=2999&&e<=3001||e>=3077&&e<=3084||e>=3086&&e<=3088||e>=3090&&e<=3112||e>=3114&&e<=3123||e>=3125&&e<=3129||e>=3168&&e<=3169||e>=3205&&e<=3212||e>=3214&&e<=3216||e>=3218&&e<=3240||e>=3242&&e<=3251||e>=3253&&e<=3257||e==3294||e>=3296&&e<=3297||e>=3333&&e<=3340||e>=3342&&e<=3344||e>=3346&&e<=3368||e>=3370&&e<=3385||e>=3424&&e<=3425||e>=3585&&e<=3630||e==3632||e>=3634&&e<=3635||e>=3648&&e<=3653||e>=3713&&e<=3714||e==3716||e>=3719&&e<=3720||e==3722||e==3725||e>=3732&&e<=3735||e>=3737&&e<=3743||e>=3745&&e<=3747||e==3749||e==3751||e>=3754&&e<=3755||e>=3757&&e<=3758||e==3760||e>=3762&&e<=3763||e==3773||e>=3776&&e<=3780||e>=3904&&e<=3911||e>=3913&&e<=3945||e>=4256&&e<=4293||e>=4304&&e<=4342||e==4352||e>=4354&&e<=4355||e>=4357&&e<=4359||e==4361||e>=4363&&e<=4364||e>=4366&&e<=4370||e==4412||e==4414||e==4416||e==4428||e==4430||e==4432||e>=4436&&e<=4437||e==4441||e>=4447&&e<=4449||e==4451||e==4453||e==4455||e==4457||e>=4461&&e<=4462||e>=4466&&e<=4467||e==4469||e==4510||e==4520||e==4523||e>=4526&&e<=4527||e>=4535&&e<=4536||e==4538||e>=4540&&e<=4546||e==4587||e==4592||e==4601||e>=7680&&e<=7835||e>=7840&&e<=7929||e>=7936&&e<=7957||e>=7960&&e<=7965||e>=7968&&e<=8005||e>=8008&&e<=8013||e>=8016&&e<=8023||e==8025||e==8027||e==8029||e>=8031&&e<=8061||e>=8064&&e<=8116||e>=8118&&e<=8124||e==8126||e>=8130&&e<=8132||e>=8134&&e<=8140||e>=8144&&e<=8147||e>=8150&&e<=8155||e>=8160&&e<=8172||e>=8178&&e<=8180||e>=8182&&e<=8188||e==8486||e>=8490&&e<=8491||e==8494||e>=8576&&e<=8578||e>=12353&&e<=12436||e>=12449&&e<=12538||e>=12549&&e<=12588||e>=44032&&e<=55203||e>=19968&&e<=40869||e==12295||e>=12321&&e<=12329};s.isNCNameChar=function(e){return e>=48&&e<=57||e>=1632&&e<=1641||e>=1776&&e<=1785||e>=2406&&e<=2415||e>=2534&&e<=2543||e>=2662&&e<=2671||e>=2790&&e<=2799||e>=2918&&e<=2927||e>=3047&&e<=3055||e>=3174&&e<=3183||e>=3302&&e<=3311||e>=3430&&e<=3439||e>=3664&&e<=3673||e>=3792&&e<=3801||e>=3872&&e<=3881||e==46||e==45||e==95||s.isLetter(e)||e>=768&&e<=837||e>=864&&e<=865||e>=1155&&e<=1158||e>=1425&&e<=1441||e>=1443&&e<=1465||e>=1467&&e<=1469||e==1471||e>=1473&&e<=1474||e==1476||e>=1611&&e<=1618||e==1648||e>=1750&&e<=1756||e>=1757&&e<=1759||e>=1760&&e<=1764||e>=1767&&e<=1768||e>=1770&&e<=1773||e>=2305&&e<=2307||e==2364||e>=2366&&e<=2380||e==2381||e>=2385&&e<=2388||e>=2402&&e<=2403||e>=2433&&e<=2435||e==2492||e==2494||e==2495||e>=2496&&e<=2500||e>=2503&&e<=2504||e>=2507&&e<=2509||e==2519||e>=2530&&e<=2531||e==2562||e==2620||e==2622||e==2623||e>=2624&&e<=2626||e>=2631&&e<=2632||e>=2635&&e<=2637||e>=2672&&e<=2673||e>=2689&&e<=2691||e==2748||e>=2750&&e<=2757||e>=2759&&e<=2761||e>=2763&&e<=2765||e>=2817&&e<=2819||e==2876||e>=2878&&e<=2883||e>=2887&&e<=2888||e>=2891&&e<=2893||e>=2902&&e<=2903||e>=2946&&e<=2947||e>=3006&&e<=3010||e>=3014&&e<=3016||e>=3018&&e<=3021||e==3031||e>=3073&&e<=3075||e>=3134&&e<=3140||e>=3142&&e<=3144||e>=3146&&e<=3149||e>=3157&&e<=3158||e>=3202&&e<=3203||e>=3262&&e<=3268||e>=3270&&e<=3272||e>=3274&&e<=3277||e>=3285&&e<=3286||e>=3330&&e<=3331||e>=3390&&e<=3395||e>=3398&&e<=3400||e>=3402&&e<=3405||e==3415||e==3633||e>=3636&&e<=3642||e>=3655&&e<=3662||e==3761||e>=3764&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=3864&&e<=3865||e==3893||e==3895||e==3897||e==3902||e==3903||e>=3953&&e<=3972||e>=3974&&e<=3979||e>=3984&&e<=3989||e==3991||e>=3993&&e<=4013||e>=4017&&e<=4023||e==4025||e>=8400&&e<=8412||e==8417||e>=12330&&e<=12335||e==12441||e==12442||e==183||e==720||e==721||e==903||e==1600||e==3654||e==3782||e==12293||e>=12337&&e<=12341||e>=12445&&e<=12446||e>=12540&&e<=12542};s.coalesceText=function(e){for(var r=e.firstChild;r!=null;r=r.nextSibling){if(r.nodeType==3||r.nodeType==4){var n=r.nodeValue;var i=r;r=r.nextSibling;while(r!=null&&(r.nodeType==3||r.nodeType==4)){n+=r.nodeValue;var o=r;r=r.nextSibling;o.parentNode.removeChild(o)}if(i.nodeType==4){var a=i.parentNode;if(i.nextSibling==null){a.removeChild(i);a.appendChild(a.ownerDocument.createTextNode(n))}else{var u=i.nextSibling;a.removeChild(i);a.insertBefore(a.ownerDocument.createTextNode(n),u)}}else{i.nodeValue=n}if(r==null){break}}else if(r.nodeType==1){s.coalesceText(r)}}};s.instance_of=function(e,r){while(e!=null){if(e.constructor===r){return true}if(e===Object){return false}e=e.constructor.superclass}return false};s.getElementById=function(e,r){if(e.nodeType==1){if(e.getAttribute("id")==r||e.getAttributeNS(null,"id")==r){return e}}for(var n=e.firstChild;n!=null;n=n.nextSibling){var i=s.getElementById(n,r);if(i!=null){return i}}return null};var a=function(){function getMessage(e,r){var n=r?": "+r.toString():"";switch(e){case XPathException.INVALID_EXPRESSION_ERR:return"Invalid expression"+n;case XPathException.TYPE_ERR:return"Type error"+n}return null}function XPathException(e,r,n){var i=Error.call(this,getMessage(e,r)||n);i.code=e;i.exception=r;return i}XPathException.prototype=Object.create(Error.prototype);XPathException.prototype.constructor=XPathException;XPathException.superclass=Error;XPathException.prototype.toString=function(){return this.message};XPathException.fromMessage=function(e,r){return new XPathException(null,r,e)};XPathException.INVALID_EXPRESSION_ERR=51;XPathException.TYPE_ERR=52;return XPathException}();XPathExpression.prototype={};XPathExpression.prototype.constructor=XPathExpression;XPathExpression.superclass=Object.prototype;function XPathExpression(e,r,n){this.xpath=n.parse(e);this.context=new XPathContext;this.context.namespaceResolver=new XPathNSResolverWrapper(r)}XPathExpression.getOwnerDocument=function(e){return e.nodeType===9?e:e.ownerDocument};XPathExpression.detectHtmlDom=function(e){if(!e){return false}var r=XPathExpression.getOwnerDocument(e);try{return r.implementation.hasFeature("HTML","2.0")}catch(e){return true}};XPathExpression.prototype.evaluate=function(e,r,n){this.context.expressionContextNode=e;this.context.caseInsensitive=XPathExpression.detectHtmlDom(e);var i=this.xpath.evaluate(this.context);return new XPathResult(i,r)};XPathNSResolverWrapper.prototype={};XPathNSResolverWrapper.prototype.constructor=XPathNSResolverWrapper;XPathNSResolverWrapper.superclass=Object.prototype;function XPathNSResolverWrapper(e){this.xpathNSResolver=e}XPathNSResolverWrapper.prototype.getNamespace=function(e,r){if(this.xpathNSResolver==null){return null}return this.xpathNSResolver.lookupNamespaceURI(e)};NodeXPathNSResolver.prototype={};NodeXPathNSResolver.prototype.constructor=NodeXPathNSResolver;NodeXPathNSResolver.superclass=Object.prototype;function NodeXPathNSResolver(e){this.node=e;this.namespaceResolver=new NamespaceResolver}NodeXPathNSResolver.prototype.lookupNamespaceURI=function(e){return this.namespaceResolver.getNamespace(e,this.node)};XPathResult.prototype={};XPathResult.prototype.constructor=XPathResult;XPathResult.superclass=Object.prototype;function XPathResult(e,r){if(r==XPathResult.ANY_TYPE){if(e.constructor===XString){r=XPathResult.STRING_TYPE}else if(e.constructor===XNumber){r=XPathResult.NUMBER_TYPE}else if(e.constructor===XBoolean){r=XPathResult.BOOLEAN_TYPE}else if(e.constructor===XNodeSet){r=XPathResult.UNORDERED_NODE_ITERATOR_TYPE}}this.resultType=r;switch(r){case XPathResult.NUMBER_TYPE:this.numberValue=e.numberValue();return;case XPathResult.STRING_TYPE:this.stringValue=e.stringValue();return;case XPathResult.BOOLEAN_TYPE:this.booleanValue=e.booleanValue();return;case XPathResult.ANY_UNORDERED_NODE_TYPE:case XPathResult.FIRST_ORDERED_NODE_TYPE:if(e.constructor===XNodeSet){this.singleNodeValue=e.first();return}break;case XPathResult.UNORDERED_NODE_ITERATOR_TYPE:case XPathResult.ORDERED_NODE_ITERATOR_TYPE:if(e.constructor===XNodeSet){this.invalidIteratorState=false;this.nodes=e.toArray();this.iteratorIndex=0;return}break;case XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE:case XPathResult.ORDERED_NODE_SNAPSHOT_TYPE:if(e.constructor===XNodeSet){this.nodes=e.toArray();this.snapshotLength=this.nodes.length;return}break}throw new a(a.TYPE_ERR)}XPathResult.prototype.iterateNext=function(){if(this.resultType!=XPathResult.UNORDERED_NODE_ITERATOR_TYPE&&this.resultType!=XPathResult.ORDERED_NODE_ITERATOR_TYPE){throw new a(a.TYPE_ERR)}return this.nodes[this.iteratorIndex++]};XPathResult.prototype.snapshotItem=function(e){if(this.resultType!=XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE&&this.resultType!=XPathResult.ORDERED_NODE_SNAPSHOT_TYPE){throw new a(a.TYPE_ERR)}return this.nodes[e]};XPathResult.ANY_TYPE=0;XPathResult.NUMBER_TYPE=1;XPathResult.STRING_TYPE=2;XPathResult.BOOLEAN_TYPE=3;XPathResult.UNORDERED_NODE_ITERATOR_TYPE=4;XPathResult.ORDERED_NODE_ITERATOR_TYPE=5;XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE=6;XPathResult.ORDERED_NODE_SNAPSHOT_TYPE=7;XPathResult.ANY_UNORDERED_NODE_TYPE=8;XPathResult.FIRST_ORDERED_NODE_TYPE=9;function installDOM3XPathSupport(e,r){e.createExpression=function(e,n){try{return new XPathExpression(e,n,r)}catch(e){throw new a(a.INVALID_EXPRESSION_ERR,e)}};e.createNSResolver=function(e){return new NodeXPathNSResolver(e)};e.evaluate=function(n,i,o,s,a){if(s<0||s>9){throw{code:0,toString:function(){return"Request type not supported"}}}return e.createExpression(n,o,r).evaluate(i,s,a)}}try{var u=true;try{if(document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("XPath",null)){u=false}}catch(e){}if(u){installDOM3XPathSupport(document,new XPathParser)}}catch(e){}installDOM3XPathSupport(e,new XPathParser);(function(){var r=new XPathParser;var n=new NamespaceResolver;var i=new FunctionResolver;var o=new VariableResolver;function makeNSResolverFromFunction(e){return{getNamespace:function(r,i){var o=e(r,i);return o||n.getNamespace(r,i)}}}function makeNSResolverFromObject(e){return makeNSResolverFromFunction(e.getNamespace.bind(e))}function makeNSResolverFromMap(e){return makeNSResolverFromFunction((function(r){return e[r]}))}function makeNSResolver(e){if(e&&typeof e.getNamespace==="function"){return makeNSResolverFromObject(e)}if(typeof e==="function"){return makeNSResolverFromFunction(e)}if(typeof e==="object"){return makeNSResolverFromMap(e)}return n}function convertValue(e){if(e===null||typeof e==="undefined"||e instanceof XString||e instanceof XBoolean||e instanceof XNumber||e instanceof XNodeSet){return e}switch(typeof e){case"string":return new XString(e);case"boolean":return new XBoolean(e);case"number":return new XNumber(e)}var r=new XNodeSet;r.addArray([].concat(e));return r}function makeEvaluator(e){return function(r){var n=Array.prototype.slice.call(arguments,1).map((function(e){return e.evaluate(r)}));var i=e.apply(this,[].concat(r,n));return convertValue(i)}}function makeFunctionResolverFromFunction(e){return{getFunction:function(r,n){var o=e(r,n);if(o){return makeEvaluator(o)}return i.getFunction(r,n)}}}function makeFunctionResolverFromObject(e){return makeFunctionResolverFromFunction(e.getFunction.bind(e))}function makeFunctionResolverFromMap(e){return makeFunctionResolverFromFunction((function(r){return e[r]}))}function makeFunctionResolver(e){if(e&&typeof e.getFunction==="function"){return makeFunctionResolverFromObject(e)}if(typeof e==="function"){return makeFunctionResolverFromFunction(e)}if(typeof e==="object"){return makeFunctionResolverFromMap(e)}return i}function makeVariableResolverFromFunction(e){return{getVariable:function(r,n){var i=e(r,n);return convertValue(i)}}}function makeVariableResolver(e){if(e){if(typeof e.getVariable==="function"){return makeVariableResolverFromFunction(e.getVariable.bind(e))}if(typeof e==="function"){return makeVariableResolverFromFunction(e)}if(typeof e==="object"){return makeVariableResolverFromFunction((function(r){return e[r]}))}}return o}function copyIfPresent(e,r,n){if(e in n){r[e]=n[e]}}function makeContext(e){var r=new XPathContext;if(e){r.namespaceResolver=makeNSResolver(e.namespaces);r.functionResolver=makeFunctionResolver(e.functions);r.variableResolver=makeVariableResolver(e.variables);r.expressionContextNode=e.node;copyIfPresent("allowAnyNamespaceForNoPrefix",r,e);copyIfPresent("isHtml",r,e)}else{r.namespaceResolver=n}return r}function evaluate(e,r){var n=makeContext(r);return e.evaluate(n)}var s={evaluate:function(e){return evaluate(this.expression,e)},evaluateNumber:function(e){return this.evaluate(e).numberValue()},evaluateString:function(e){return this.evaluate(e).stringValue()},evaluateBoolean:function(e){return this.evaluate(e).booleanValue()},evaluateNodeSet:function(e){return this.evaluate(e).nodeset()},select:function(e){return this.evaluateNodeSet(e).toArray()},select1:function(e){return this.select(e)[0]}};function parse(e){var n=r.parse(e);return Object.create(s,{expression:{value:n}})}e.parse=parse})();assign(e,{XPath:XPath,XPathParser:XPathParser,XPathResult:XPathResult,Step:Step,PathExpr:PathExpr,NodeTest:NodeTest,LocationPath:LocationPath,OrOperation:OrOperation,AndOperation:AndOperation,BarOperation:BarOperation,EqualsOperation:EqualsOperation,NotEqualOperation:NotEqualOperation,LessThanOperation:LessThanOperation,GreaterThanOperation:GreaterThanOperation,LessThanOrEqualOperation:LessThanOrEqualOperation,GreaterThanOrEqualOperation:GreaterThanOrEqualOperation,PlusOperation:PlusOperation,MinusOperation:MinusOperation,MultiplyOperation:MultiplyOperation,DivOperation:DivOperation,ModOperation:ModOperation,UnaryMinusOperation:UnaryMinusOperation,FunctionCall:FunctionCall,VariableReference:VariableReference,XPathContext:XPathContext,XNodeSet:XNodeSet,XBoolean:XBoolean,XString:XString,XNumber:XNumber,NamespaceResolver:NamespaceResolver,FunctionResolver:FunctionResolver,VariableResolver:VariableResolver,Utilities:s});e.select=function(r,n,i){return e.selectWithResolver(r,n,null,i)};e.useNamespaces=function(r){var n={mappings:r||{},lookupNamespaceURI:function(e){return this.mappings[e]}};return function(r,i,o){return e.selectWithResolver(r,i,n,o)}};e.selectWithResolver=function(e,r,n,i){var o=new XPathExpression(e,n,new XPathParser);var s=XPathResult.ANY_TYPE;var a=o.evaluate(r,s,null);if(a.resultType==XPathResult.STRING_TYPE){a=a.stringValue}else if(a.resultType==XPathResult.NUMBER_TYPE){a=a.numberValue}else if(a.resultType==XPathResult.BOOLEAN_TYPE){a=a.booleanValue}else{a=a.nodes;if(i){a=a[0]}}return a};e.select1=function(r,n){return e.select(r,n,true)}})(n)},6982:function(e){"use strict";e.exports=require("crypto")},4434:function(e){"use strict";e.exports=require("events")},9896:function(e){"use strict";e.exports=require("fs")},857:function(e){"use strict";e.exports=require("os")},6928:function(e){"use strict";e.exports=require("path")},3480:function(e){"use strict";e.exports=require("querystring")},2203:function(e){"use strict";e.exports=require("stream")},3193:function(e){"use strict";e.exports=require("string_decoder")},3557:function(e){"use strict";e.exports=require("timers")},2018:function(e){"use strict";e.exports=require("tty")},7016:function(e){"use strict";e.exports=require("url")},9023:function(e){"use strict";e.exports=require("util")},3106:function(e){"use strict";e.exports=require("zlib")}};var r={};function __nccwpck_require__(n){var i=r[n];if(i!==undefined){return i.exports}var o=r[n]={exports:{}};var s=true;try{e[n].call(o.exports,o,o.exports,__nccwpck_require__);s=false}finally{if(s)delete r[n]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n={};!function(){"use strict";var e=n;Object.defineProperty(e,"__esModule",{value:true});e.ValidateInResponseTo=e.SAML=void 0;const r=__nccwpck_require__(5720);Object.defineProperty(e,"SAML",{enumerable:true,get:function(){return r.SAML}});const i=__nccwpck_require__(8748);Object.defineProperty(e,"ValidateInResponseTo",{enumerable:true,get:function(){return i.ValidateInResponseTo}})}();module.exports=n})();