UNPKG

geostyler-sld-parser

Version:
14 lines 139 kB
var GeoStylerSLDParser=function(Be){"use strict";var w_=Object.defineProperty;var y_=(Be,it,Ft)=>it in Be?w_(Be,it,{enumerable:!0,configurable:!0,writable:!0,value:Ft}):Be[it]=Ft;var ye=(Be,it,Ft)=>y_(Be,typeof it!="symbol"?it+"":it,Ft);function it(o){return o!=null&&typeof o.valueOf()=="string"}function Ft(o){return o!=null&&typeof o.valueOf()=="number"}function as(o){return o!=null&&typeof o.valueOf()=="boolean"}const fs=o=>he(o)||ha(o),ha=o=>it(o)||Ft(o)||as(o)||o===null,ga=o=>["==","*=","!=","<","<=",">",">=","<=x<="].includes(o),pa=o=>["&&","||"].includes(o),da=o=>o==="!",ls=o=>cs(o)||hs(o)||Pr(o)||gs(o)||Pr(o)||as(o),cs=o=>{const r=o&&o[0]==="<=x<="?4:3;return Array.isArray(o)&&o.length===r&&ga(o[0])&&fs(o[1])&&fs(o[2])&&(o[0]!=="<=x<="||Ft(o[3]))},hs=o=>Array.isArray(o)&&o.length>=3&&pa(o[0])&&o.every((r,i)=>i===0||ls(r)),gs=o=>Array.isArray(o)&&o.length===2&&da(o[0])&&ls(o[1]),Or=o=>["abs","acos","add","asin","atan","atan2","ceil","cos","div","exp","floor","interpolate","log","max","min","modulo","mul","pi","pow","random","rint","round","sin","sqrt","strIndexOf","strLastIndexOf","strLength","sub","tan","toDegrees","toNumber","toRadians"].includes(o==null?void 0:o.name),_a=o=>["numberFormat","strAbbreviate","strCapitalize","strConcat","strDefaultIfBlank","strReplace","strStripAccents","strSubstring","strSubstringStart","strToLowerCase","strToString","strToUpperCase","strTrim"].includes(o==null?void 0:o.name),Pr=o=>["all","any","between","double2bool","equalTo","greaterThan","greaterThanOrEqualTo","in","lessThan","lessThanOrEqualTo","not","notEqualTo","parseBoolean","strEndsWith","strEqualsIgnoreCase","strMatches","strStartsWith"].includes(o==null?void 0:o.name),ma=o=>["case","property","step"].includes(o==null?void 0:o.name),he=o=>Pr(o)||Or(o)||_a(o)||ma(o),ps=":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",va=ps+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",wa="["+ps+"]["+va+"]*",ya=new RegExp("^"+wa+"$");function ds(o,r){const i=[];let a=r.exec(o);for(;a;){const f=[];f.startIndex=r.lastIndex-a[0].length;const c=a.length;for(let _=0;_<c;_++)f.push(a[_]);i.push(f),a=r.exec(o)}return i}const Ir=function(o){const r=ya.exec(o);return!(r===null||typeof r>"u")};function xa(o){return typeof o<"u"}const Na={allowBooleanAttributes:!1,unpairedTags:[]};function Ta(o,r){r=Object.assign({},Na,r);const i=[];let a=!1,f=!1;o[0]==="\uFEFF"&&(o=o.substr(1));for(let c=0;c<o.length;c++)if(o[c]==="<"&&o[c+1]==="?"){if(c+=2,c=ms(o,c),c.err)return c}else if(o[c]==="<"){let _=c;if(c++,o[c]==="!"){c=vs(o,c);continue}else{let d=!1;o[c]==="/"&&(d=!0,c++);let g="";for(;c<o.length&&o[c]!==">"&&o[c]!==" "&&o[c]!==" "&&o[c]!==` `&&o[c]!=="\r";c++)g+=o[c];if(g=g.trim(),g[g.length-1]==="/"&&(g=g.substring(0,g.length-1),c--),!Pa(g)){let x;return g.trim().length===0?x="Invalid space after '<'.":x="Tag '"+g+"' is an invalid name.",fe("InvalidTag",x,xe(o,c))}const y=Aa(o,c);if(y===!1)return fe("InvalidAttr","Attributes for '"+g+"' have open quote.",xe(o,c));let T=y.value;if(c=y.index,T[T.length-1]==="/"){const x=c-T.length;T=T.substring(0,T.length-1);const F=ws(T,r);if(F===!0)a=!0;else return fe(F.err.code,F.err.msg,xe(o,x+F.err.line))}else if(d)if(y.tagClosed){if(T.trim().length>0)return fe("InvalidTag","Closing tag '"+g+"' can't have attributes or invalid starting.",xe(o,_));if(i.length===0)return fe("InvalidTag","Closing tag '"+g+"' has not been opened.",xe(o,_));{const x=i.pop();if(g!==x.tagName){let F=xe(o,x.tagStartPos);return fe("InvalidTag","Expected closing tag '"+x.tagName+"' (opened in line "+F.line+", col "+F.col+") instead of closing tag '"+g+"'.",xe(o,_))}i.length==0&&(f=!0)}}else return fe("InvalidTag","Closing tag '"+g+"' doesn't have proper closing.",xe(o,c));else{const x=ws(T,r);if(x!==!0)return fe(x.err.code,x.err.msg,xe(o,c-T.length+x.err.line));if(f===!0)return fe("InvalidXml","Multiple possible root nodes found.",xe(o,c));r.unpairedTags.indexOf(g)!==-1||i.push({tagName:g,tagStartPos:_}),a=!0}for(c++;c<o.length;c++)if(o[c]==="<")if(o[c+1]==="!"){c++,c=vs(o,c);continue}else if(o[c+1]==="?"){if(c=ms(o,++c),c.err)return c}else break;else if(o[c]==="&"){const x=ba(o,c);if(x==-1)return fe("InvalidChar","char '&' is not expected.",xe(o,c));c=x}else if(f===!0&&!_s(o[c]))return fe("InvalidXml","Extra text at the end",xe(o,c));o[c]==="<"&&c--}}else{if(_s(o[c]))continue;return fe("InvalidChar","char '"+o[c]+"' is not expected.",xe(o,c))}if(a){if(i.length==1)return fe("InvalidTag","Unclosed tag '"+i[0].tagName+"'.",xe(o,i[0].tagStartPos));if(i.length>0)return fe("InvalidXml","Invalid '"+JSON.stringify(i.map(c=>c.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return fe("InvalidXml","Start tag expected.",1);return!0}function _s(o){return o===" "||o===" "||o===` `||o==="\r"}function ms(o,r){const i=r;for(;r<o.length;r++)if(o[r]=="?"||o[r]==" "){const a=o.substr(i,r-i);if(r>5&&a==="xml")return fe("InvalidXml","XML declaration allowed only at the start of the document.",xe(o,r));if(o[r]=="?"&&o[r+1]==">"){r++;break}else continue}return r}function vs(o,r){if(o.length>r+5&&o[r+1]==="-"&&o[r+2]==="-"){for(r+=3;r<o.length;r++)if(o[r]==="-"&&o[r+1]==="-"&&o[r+2]===">"){r+=2;break}}else if(o.length>r+8&&o[r+1]==="D"&&o[r+2]==="O"&&o[r+3]==="C"&&o[r+4]==="T"&&o[r+5]==="Y"&&o[r+6]==="P"&&o[r+7]==="E"){let i=1;for(r+=8;r<o.length;r++)if(o[r]==="<")i++;else if(o[r]===">"&&(i--,i===0))break}else if(o.length>r+9&&o[r+1]==="["&&o[r+2]==="C"&&o[r+3]==="D"&&o[r+4]==="A"&&o[r+5]==="T"&&o[r+6]==="A"&&o[r+7]==="["){for(r+=8;r<o.length;r++)if(o[r]==="]"&&o[r+1]==="]"&&o[r+2]===">"){r+=2;break}}return r}const Ea='"',Sa="'";function Aa(o,r){let i="",a="",f=!1;for(;r<o.length;r++){if(o[r]===Ea||o[r]===Sa)a===""?a=o[r]:a!==o[r]||(a="");else if(o[r]===">"&&a===""){f=!0;break}i+=o[r]}return a!==""?!1:{value:i,index:r,tagClosed:f}}const Ca=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function ws(o,r){const i=ds(o,Ca),a={};for(let f=0;f<i.length;f++){if(i[f][1].length===0)return fe("InvalidAttr","Attribute '"+i[f][2]+"' has no space in starting.",on(i[f]));if(i[f][3]!==void 0&&i[f][4]===void 0)return fe("InvalidAttr","Attribute '"+i[f][2]+"' is without value.",on(i[f]));if(i[f][3]===void 0&&!r.allowBooleanAttributes)return fe("InvalidAttr","boolean attribute '"+i[f][2]+"' is not allowed.",on(i[f]));const c=i[f][2];if(!Oa(c))return fe("InvalidAttr","Attribute '"+c+"' is an invalid name.",on(i[f]));if(!a.hasOwnProperty(c))a[c]=1;else return fe("InvalidAttr","Attribute '"+c+"' is repeated.",on(i[f]))}return!0}function Fa(o,r){let i=/\d/;for(o[r]==="x"&&(r++,i=/[\da-fA-F]/);r<o.length;r++){if(o[r]===";")return r;if(!o[r].match(i))break}return-1}function ba(o,r){if(r++,o[r]===";")return-1;if(o[r]==="#")return r++,Fa(o,r);let i=0;for(;r<o.length;r++,i++)if(!(o[r].match(/\w/)&&i<20)){if(o[r]===";")break;return-1}return r}function fe(o,r,i){return{err:{code:o,msg:r,line:i.line||i,col:i.col}}}function Oa(o){return Ir(o)}function Pa(o){return Ir(o)}function xe(o,r){const i=o.substring(0,r).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function on(o){return o.startIndex+o[1].length}const Ia={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(o,r){return r},attributeValueProcessor:function(o,r){return r},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(o,r,i){return o},captureMetaData:!1},La=function(o){return Object.assign({},Ia,o)};let Pn;typeof Symbol!="function"?Pn="@@xmlMetadata":Pn=Symbol("XML Node Metadata");class bt{constructor(r){this.tagname=r,this.child=[],this[":@"]={}}add(r,i){r==="__proto__"&&(r="#__proto__"),this.child.push({[r]:i})}addChild(r,i){r.tagname==="__proto__"&&(r.tagname="#__proto__"),r[":@"]&&Object.keys(r[":@"]).length>0?this.child.push({[r.tagname]:r.child,":@":r[":@"]}):this.child.push({[r.tagname]:r.child}),i!==void 0&&(this.child[this.child.length-1][Pn]={startIndex:i})}static getMetaDataSymbol(){return Pn}}function Ra(o,r){const i={};if(o[r+3]==="O"&&o[r+4]==="C"&&o[r+5]==="T"&&o[r+6]==="Y"&&o[r+7]==="P"&&o[r+8]==="E"){r=r+9;let a=1,f=!1,c=!1,_="";for(;r<o.length;r++)if(o[r]==="<"&&!c){if(f&&Ot(o,"!ENTITY",r)){r+=7;let d,g;[d,g,r]=Ma(o,r+1),g.indexOf("&")===-1&&(i[d]={regx:RegExp(`&${d};`,"g"),val:g})}else if(f&&Ot(o,"!ELEMENT",r)){r+=8;const{index:d}=Wa(o,r+1);r=d}else if(f&&Ot(o,"!ATTLIST",r))r+=8;else if(f&&Ot(o,"!NOTATION",r)){r+=9;const{index:d}=Ba(o,r+1);r=d}else if(Ot(o,"!--",r))c=!0;else throw new Error("Invalid DOCTYPE");a++,_=""}else if(o[r]===">"){if(c?o[r-1]==="-"&&o[r-2]==="-"&&(c=!1,a--):a--,a===0)break}else o[r]==="["?f=!0:_+=o[r];if(a!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:i,i:r}}const dt=(o,r)=>{for(;r<o.length&&/\s/.test(o[r]);)r++;return r};function Ma(o,r){r=dt(o,r);let i="";for(;r<o.length&&!/\s/.test(o[r])&&o[r]!=='"'&&o[r]!=="'";)i+=o[r],r++;if(Lr(i),r=dt(o,r),o.substring(r,r+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(o[r]==="%")throw new Error("Parameter entities are not supported");let a="";return[r,a]=In(o,r,"entity"),r--,[i,a,r]}function Ba(o,r){r=dt(o,r);let i="";for(;r<o.length&&!/\s/.test(o[r]);)i+=o[r],r++;Lr(i),r=dt(o,r);const a=o.substring(r,r+6).toUpperCase();if(a!=="SYSTEM"&&a!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${a}"`);r+=a.length,r=dt(o,r);let f=null,c=null;if(a==="PUBLIC")[r,f]=In(o,r,"publicIdentifier"),r=dt(o,r),(o[r]==='"'||o[r]==="'")&&([r,c]=In(o,r,"systemIdentifier"));else if(a==="SYSTEM"&&([r,c]=In(o,r,"systemIdentifier"),!c))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:i,publicIdentifier:f,systemIdentifier:c,index:--r}}function In(o,r,i){let a="";const f=o[r];if(f!=='"'&&f!=="'")throw new Error(`Expected quoted string, found "${f}"`);for(r++;r<o.length&&o[r]!==f;)a+=o[r],r++;if(o[r]!==f)throw new Error(`Unterminated ${i} value`);return r++,[r,a]}function Wa(o,r){r=dt(o,r);let i="";for(;r<o.length&&!/\s/.test(o[r]);)i+=o[r],r++;if(!Lr(i))throw new Error(`Invalid element name: "${i}"`);r=dt(o,r);let a="";if(o[r]==="E"&&Ot(o,"MPTY",r))r+=6;else if(o[r]==="A"&&Ot(o,"NY",r))r+=4;else if(o[r]==="("){for(r++;r<o.length&&o[r]!==")";)a+=o[r],r++;if(o[r]!==")")throw new Error("Unterminated content model")}else throw new Error(`Invalid Element Expression, found "${o[r]}"`);return{elementName:i,contentModel:a.trim(),index:r}}function Ot(o,r,i){for(let a=0;a<r.length;a++)if(r[a]!==o[i+a+1])return!1;return!0}function Lr(o){if(Ir(o))return o;throw new Error(`Invalid entity name ${o}`)}const Ga=/^[-+]?0x[a-fA-F0-9]+$/,ka=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Ua={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function Va(o,r={}){if(r=Object.assign({},Ua,r),!o||typeof o!="string")return o;let i=o.trim();if(r.skipLike!==void 0&&r.skipLike.test(i))return o;if(o==="0")return 0;if(r.hex&&Ga.test(i))return Ka(i,16);if(i.search(/.+[eE].+/)!==-1)return qa(o,i,r);{const a=ka.exec(i);if(a){const f=a[1]||"",c=a[2];let _=Ha(a[3]);const d=f?o[c.length+1]===".":o[c.length]===".";if(!r.leadingZeros&&(c.length>1||c.length===1&&!d))return o;{const g=Number(i),y=String(g);if(g===0)return g;if(y.search(/[eE]/)!==-1)return r.eNotation?g:o;if(i.indexOf(".")!==-1)return y==="0"||y===_||y===`${f}${_}`?g:o;let T=c?_:i;return c?T===y||f+T===y?g:o:T===y||T===f+y?g:o}}else return o}}const $a=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function qa(o,r,i){if(!i.eNotation)return o;const a=r.match($a);if(a){let f=a[1]||"";const c=a[3].indexOf("e")===-1?"E":"e",_=a[2],d=f?o[_.length+1]===c:o[_.length]===c;return _.length>1&&d?o:_.length===1&&(a[3].startsWith(`.${c}`)||a[3][0]===c)?Number(r):i.leadingZeros&&!d?(r=(a[1]||"")+a[3],Number(r)):o}else return o}function Ha(o){return o&&o.indexOf(".")!==-1&&(o=o.replace(/0+$/,""),o==="."?o="0":o[0]==="."?o="0"+o:o[o.length-1]==="."&&(o=o.substring(0,o.length-1))),o}function Ka(o,r){if(parseInt)return parseInt(o,r);if(Number.parseInt)return Number.parseInt(o,r);if(window&&window.parseInt)return window.parseInt(o,r);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function ys(o){return typeof o=="function"?o:Array.isArray(o)?r=>{for(const i of o)if(typeof i=="string"&&r===i||i instanceof RegExp&&i.test(r))return!0}:()=>!1}class Ya{constructor(r){this.options=r,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(i,a)=>String.fromCodePoint(Number.parseInt(a,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(i,a)=>String.fromCodePoint(Number.parseInt(a,16))}},this.addExternalEntities=Xa,this.parseXml=Da,this.parseTextData=Za,this.resolveNameSpace=Ja,this.buildAttributesMap=Qa,this.isItStopNode=nf,this.replaceEntitiesValue=ef,this.readStopNodeData=sf,this.saveTextToParentTag=tf,this.addChild=ja,this.ignoreAttributesFn=ys(this.options.ignoreAttributes)}}function Xa(o){const r=Object.keys(o);for(let i=0;i<r.length;i++){const a=r[i];this.lastEntities[a]={regex:new RegExp("&"+a+";","g"),val:o[a]}}}function Za(o,r,i,a,f,c,_){if(o!==void 0&&(this.options.trimValues&&!a&&(o=o.trim()),o.length>0)){_||(o=this.replaceEntitiesValue(o));const d=this.options.tagValueProcessor(r,o,i,f,c);return d==null?o:typeof d!=typeof o||d!==o?d:this.options.trimValues?Mr(o,this.options.parseTagValue,this.options.numberParseOptions):o.trim()===o?Mr(o,this.options.parseTagValue,this.options.numberParseOptions):o}}function Ja(o){if(this.options.removeNSPrefix){const r=o.split(":"),i=o.charAt(0)==="/"?"/":"";if(r[0]==="xmlns")return"";r.length===2&&(o=i+r[1])}return o}const za=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Qa(o,r,i){if(this.options.ignoreAttributes!==!0&&typeof o=="string"){const a=ds(o,za),f=a.length,c={};for(let _=0;_<f;_++){const d=this.resolveNameSpace(a[_][1]);if(this.ignoreAttributesFn(d,r))continue;let g=a[_][4],y=this.options.attributeNamePrefix+d;if(d.length)if(this.options.transformAttributeName&&(y=this.options.transformAttributeName(y)),y==="__proto__"&&(y="#__proto__"),g!==void 0){this.options.trimValues&&(g=g.trim()),g=this.replaceEntitiesValue(g);const T=this.options.attributeValueProcessor(d,g,r);T==null?c[y]=g:typeof T!=typeof g||T!==g?c[y]=T:c[y]=Mr(g,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(c[y]=!0)}if(!Object.keys(c).length)return;if(this.options.attributesGroupName){const _={};return _[this.options.attributesGroupName]=c,_}return c}}const Da=function(o){o=o.replace(/\r\n?/g,` `);const r=new bt("!xml");let i=r,a="",f="";for(let c=0;c<o.length;c++)if(o[c]==="<")if(o[c+1]==="/"){const d=Pt(o,">",c,"Closing Tag is not closed.");let g=o.substring(c+2,d).trim();if(this.options.removeNSPrefix){const x=g.indexOf(":");x!==-1&&(g=g.substr(x+1))}this.options.transformTagName&&(g=this.options.transformTagName(g)),i&&(a=this.saveTextToParentTag(a,i,f));const y=f.substring(f.lastIndexOf(".")+1);if(g&&this.options.unpairedTags.indexOf(g)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${g}>`);let T=0;y&&this.options.unpairedTags.indexOf(y)!==-1?(T=f.lastIndexOf(".",f.lastIndexOf(".")-1),this.tagsNodeStack.pop()):T=f.lastIndexOf("."),f=f.substring(0,T),i=this.tagsNodeStack.pop(),a="",c=d}else if(o[c+1]==="?"){let d=Rr(o,c,!1,"?>");if(!d)throw new Error("Pi Tag is not closed.");if(a=this.saveTextToParentTag(a,i,f),!(this.options.ignoreDeclaration&&d.tagName==="?xml"||this.options.ignorePiTags)){const g=new bt(d.tagName);g.add(this.options.textNodeName,""),d.tagName!==d.tagExp&&d.attrExpPresent&&(g[":@"]=this.buildAttributesMap(d.tagExp,f,d.tagName)),this.addChild(i,g,f,c)}c=d.closeIndex+1}else if(o.substr(c+1,3)==="!--"){const d=Pt(o,"-->",c+4,"Comment is not closed.");if(this.options.commentPropName){const g=o.substring(c+4,d-2);a=this.saveTextToParentTag(a,i,f),i.add(this.options.commentPropName,[{[this.options.textNodeName]:g}])}c=d}else if(o.substr(c+1,2)==="!D"){const d=Ra(o,c);this.docTypeEntities=d.entities,c=d.i}else if(o.substr(c+1,2)==="!["){const d=Pt(o,"]]>",c,"CDATA is not closed.")-2,g=o.substring(c+9,d);a=this.saveTextToParentTag(a,i,f);let y=this.parseTextData(g,i.tagname,f,!0,!1,!0,!0);y==null&&(y=""),this.options.cdataPropName?i.add(this.options.cdataPropName,[{[this.options.textNodeName]:g}]):i.add(this.options.textNodeName,y),c=d+2}else{let d=Rr(o,c,this.options.removeNSPrefix),g=d.tagName;const y=d.rawTagName;let T=d.tagExp,x=d.attrExpPresent,F=d.closeIndex;this.options.transformTagName&&(g=this.options.transformTagName(g)),i&&a&&i.tagname!=="!xml"&&(a=this.saveTextToParentTag(a,i,f,!1));const I=i;I&&this.options.unpairedTags.indexOf(I.tagname)!==-1&&(i=this.tagsNodeStack.pop(),f=f.substring(0,f.lastIndexOf("."))),g!==r.tagname&&(f+=f?"."+g:g);const k=c;if(this.isItStopNode(this.options.stopNodes,f,g)){let U="";if(T.length>0&&T.lastIndexOf("/")===T.length-1)g[g.length-1]==="/"?(g=g.substr(0,g.length-1),f=f.substr(0,f.length-1),T=g):T=T.substr(0,T.length-1),c=d.closeIndex;else if(this.options.unpairedTags.indexOf(g)!==-1)c=d.closeIndex;else{const V=this.readStopNodeData(o,y,F+1);if(!V)throw new Error(`Unexpected end of ${y}`);c=V.i,U=V.tagContent}const H=new bt(g);g!==T&&x&&(H[":@"]=this.buildAttributesMap(T,f,g)),U&&(U=this.parseTextData(U,g,f,!0,x,!0,!0)),f=f.substr(0,f.lastIndexOf(".")),H.add(this.options.textNodeName,U),this.addChild(i,H,f,k)}else{if(T.length>0&&T.lastIndexOf("/")===T.length-1){g[g.length-1]==="/"?(g=g.substr(0,g.length-1),f=f.substr(0,f.length-1),T=g):T=T.substr(0,T.length-1),this.options.transformTagName&&(g=this.options.transformTagName(g));const U=new bt(g);g!==T&&x&&(U[":@"]=this.buildAttributesMap(T,f,g)),this.addChild(i,U,f,k),f=f.substr(0,f.lastIndexOf("."))}else{const U=new bt(g);this.tagsNodeStack.push(i),g!==T&&x&&(U[":@"]=this.buildAttributesMap(T,f,g)),this.addChild(i,U,f,k),i=U}a="",c=F}}else a+=o[c];return r.child};function ja(o,r,i,a){this.options.captureMetaData||(a=void 0);const f=this.options.updateTag(r.tagname,i,r[":@"]);f===!1||(typeof f=="string"&&(r.tagname=f),o.addChild(r,a))}const ef=function(o){if(this.options.processEntities){for(let r in this.docTypeEntities){const i=this.docTypeEntities[r];o=o.replace(i.regx,i.val)}for(let r in this.lastEntities){const i=this.lastEntities[r];o=o.replace(i.regex,i.val)}if(this.options.htmlEntities)for(let r in this.htmlEntities){const i=this.htmlEntities[r];o=o.replace(i.regex,i.val)}o=o.replace(this.ampEntity.regex,this.ampEntity.val)}return o};function tf(o,r,i,a){return o&&(a===void 0&&(a=r.child.length===0),o=this.parseTextData(o,r.tagname,i,!1,r[":@"]?Object.keys(r[":@"]).length!==0:!1,a),o!==void 0&&o!==""&&r.add(this.options.textNodeName,o),o=""),o}function nf(o,r,i){const a="*."+i;for(const f in o){const c=o[f];if(a===c||r===c)return!0}return!1}function rf(o,r,i=">"){let a,f="";for(let c=r;c<o.length;c++){let _=o[c];if(a)_===a&&(a="");else if(_==='"'||_==="'")a=_;else if(_===i[0])if(i[1]){if(o[c+1]===i[1])return{data:f,index:c}}else return{data:f,index:c};else _===" "&&(_=" ");f+=_}}function Pt(o,r,i,a){const f=o.indexOf(r,i);if(f===-1)throw new Error(a);return f+r.length-1}function Rr(o,r,i,a=">"){const f=rf(o,r+1,a);if(!f)return;let c=f.data;const _=f.index,d=c.search(/\s/);let g=c,y=!0;d!==-1&&(g=c.substring(0,d),c=c.substring(d+1).trimStart());const T=g;if(i){const x=g.indexOf(":");x!==-1&&(g=g.substr(x+1),y=g!==f.data.substr(x+1))}return{tagName:g,tagExp:c,closeIndex:_,attrExpPresent:y,rawTagName:T}}function sf(o,r,i){const a=i;let f=1;for(;i<o.length;i++)if(o[i]==="<")if(o[i+1]==="/"){const c=Pt(o,">",i,`${r} is not closed`);if(o.substring(i+2,c).trim()===r&&(f--,f===0))return{tagContent:o.substring(a,i),i:c};i=c}else if(o[i+1]==="?")i=Pt(o,"?>",i+1,"StopNode is not closed.");else if(o.substr(i+1,3)==="!--")i=Pt(o,"-->",i+3,"StopNode is not closed.");else if(o.substr(i+1,2)==="![")i=Pt(o,"]]>",i,"StopNode is not closed.")-2;else{const c=Rr(o,i,">");c&&((c&&c.tagName)===r&&c.tagExp[c.tagExp.length-1]!=="/"&&f++,i=c.closeIndex)}}function Mr(o,r,i){if(r&&typeof o=="string"){const a=o.trim();return a==="true"?!0:a==="false"?!1:Va(o,i)}else return xa(o)?o:""}const Br=bt.getMetaDataSymbol();function of(o,r){return xs(o,r)}function xs(o,r,i){let a;const f={};for(let c=0;c<o.length;c++){const _=o[c],d=uf(_);let g="";if(i===void 0?g=d:g=i+"."+d,d===r.textNodeName)a===void 0?a=_[d]:a+=""+_[d];else{if(d===void 0)continue;if(_[d]){let y=xs(_[d],r,g);const T=ff(y,r);_[Br]!==void 0&&(y[Br]=_[Br]),_[":@"]?af(y,_[":@"],g,r):Object.keys(y).length===1&&y[r.textNodeName]!==void 0&&!r.alwaysCreateTextNode?y=y[r.textNodeName]:Object.keys(y).length===0&&(r.alwaysCreateTextNode?y[r.textNodeName]="":y=""),f[d]!==void 0&&f.hasOwnProperty(d)?(Array.isArray(f[d])||(f[d]=[f[d]]),f[d].push(y)):r.isArray(d,g,T)?f[d]=[y]:f[d]=y}}}return typeof a=="string"?a.length>0&&(f[r.textNodeName]=a):a!==void 0&&(f[r.textNodeName]=a),f}function uf(o){const r=Object.keys(o);for(let i=0;i<r.length;i++){const a=r[i];if(a!==":@")return a}}function af(o,r,i,a){if(r){const f=Object.keys(r),c=f.length;for(let _=0;_<c;_++){const d=f[_];a.isArray(d,i+"."+d,!0,!0)?o[d]=[r[d]]:o[d]=r[d]}}}function ff(o,r){const{textNodeName:i}=r,a=Object.keys(o).length;return!!(a===0||a===1&&(o[i]||typeof o[i]=="boolean"||o[i]===0))}class lf{constructor(r){this.externalEntities={},this.options=La(r)}parse(r,i){if(typeof r!="string")if(r.toString)r=r.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(i){i===!0&&(i={});const c=Ta(r,i);if(c!==!0)throw Error(`${c.err.msg}:${c.err.line}:${c.err.col}`)}const a=new Ya(this.options);a.addExternalEntities(this.externalEntities);const f=a.parseXml(r);return this.options.preserveOrder||f===void 0?f:of(f,this.options)}addEntity(r,i){if(i.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(r.indexOf("&")!==-1||r.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(i==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[r]=i}static getMetaDataSymbol(){return bt.getMetaDataSymbol()}}const cf=` `;function hf(o,r){let i="";return r.format&&r.indentBy.length>0&&(i=cf),Ns(o,r,"",i)}function Ns(o,r,i,a){let f="",c=!1;for(let _=0;_<o.length;_++){const d=o[_],g=gf(d);if(g===void 0)continue;let y="";if(i.length===0?y=g:y=`${i}.${g}`,g===r.textNodeName){let k=d[g];pf(y,r)||(k=r.tagValueProcessor(g,k),k=Es(k,r)),c&&(f+=a),f+=k,c=!1;continue}else if(g===r.cdataPropName){c&&(f+=a),f+=`<![CDATA[${d[g][0][r.textNodeName]}]]>`,c=!1;continue}else if(g===r.commentPropName){f+=a+`<!--${d[g][0][r.textNodeName]}-->`,c=!0;continue}else if(g[0]==="?"){const k=Ts(d[":@"],r),U=g==="?xml"?"":a;let H=d[g][0][r.textNodeName];H=H.length!==0?" "+H:"",f+=U+`<${g}${H}${k}?>`,c=!0;continue}let T=a;T!==""&&(T+=r.indentBy);const x=Ts(d[":@"],r),F=a+`<${g}${x}`,I=Ns(d[g],r,y,T);r.unpairedTags.indexOf(g)!==-1?r.suppressUnpairedNode?f+=F+">":f+=F+"/>":(!I||I.length===0)&&r.suppressEmptyNode?f+=F+"/>":I&&I.endsWith(">")?f+=F+`>${I}${a}</${g}>`:(f+=F+">",I&&a!==""&&(I.includes("/>")||I.includes("</"))?f+=a+r.indentBy+I+a:f+=I,f+=`</${g}>`),c=!0}return f}function gf(o){const r=Object.keys(o);for(let i=0;i<r.length;i++){const a=r[i];if(o.hasOwnProperty(a)&&a!==":@")return a}}function Ts(o,r){let i="";if(o&&!r.ignoreAttributes)for(let a in o){if(!o.hasOwnProperty(a))continue;let f=r.attributeValueProcessor(a,o[a]);f=Es(f,r),f===!0&&r.suppressBooleanAttributes?i+=` ${a.substr(r.attributeNamePrefix.length)}`:i+=` ${a.substr(r.attributeNamePrefix.length)}="${f}"`}return i}function pf(o,r){o=o.substr(0,o.length-r.textNodeName.length-1);let i=o.substr(o.lastIndexOf(".")+1);for(let a in r.stopNodes)if(r.stopNodes[a]===o||r.stopNodes[a]==="*."+i)return!0;return!1}function Es(o,r){if(o&&o.length>0&&r.processEntities)for(let i=0;i<r.entities.length;i++){const a=r.entities[i];o=o.replace(a.regex,a.val)}return o}const df={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(o,r){return r},attributeValueProcessor:function(o,r){return r},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function _t(o){this.options=Object.assign({},df,o),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=ys(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=vf),this.processTextOrObjNode=_f,this.options.format?(this.indentate=mf,this.tagEndChar=`> `,this.newLine=` `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}_t.prototype.build=function(o){return this.options.preserveOrder?hf(o,this.options):(Array.isArray(o)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(o={[this.options.arrayNodeName]:o}),this.j2x(o,0,[]).val)},_t.prototype.j2x=function(o,r,i){let a="",f="";const c=i.join(".");for(let _ in o)if(Object.prototype.hasOwnProperty.call(o,_))if(typeof o[_]>"u")this.isAttribute(_)&&(f+="");else if(o[_]===null)this.isAttribute(_)||_===this.options.cdataPropName?f+="":_[0]==="?"?f+=this.indentate(r)+"<"+_+"?"+this.tagEndChar:f+=this.indentate(r)+"<"+_+"/"+this.tagEndChar;else if(o[_]instanceof Date)f+=this.buildTextValNode(o[_],_,"",r);else if(typeof o[_]!="object"){const d=this.isAttribute(_);if(d&&!this.ignoreAttributesFn(d,c))a+=this.buildAttrPairStr(d,""+o[_]);else if(!d)if(_===this.options.textNodeName){let g=this.options.tagValueProcessor(_,""+o[_]);f+=this.replaceEntitiesValue(g)}else f+=this.buildTextValNode(o[_],_,"",r)}else if(Array.isArray(o[_])){const d=o[_].length;let g="",y="";for(let T=0;T<d;T++){const x=o[_][T];if(!(typeof x>"u"))if(x===null)_[0]==="?"?f+=this.indentate(r)+"<"+_+"?"+this.tagEndChar:f+=this.indentate(r)+"<"+_+"/"+this.tagEndChar;else if(typeof x=="object")if(this.options.oneListGroup){const F=this.j2x(x,r+1,i.concat(_));g+=F.val,this.options.attributesGroupName&&x.hasOwnProperty(this.options.attributesGroupName)&&(y+=F.attrStr)}else g+=this.processTextOrObjNode(x,_,r,i);else if(this.options.oneListGroup){let F=this.options.tagValueProcessor(_,x);F=this.replaceEntitiesValue(F),g+=F}else g+=this.buildTextValNode(x,_,"",r)}this.options.oneListGroup&&(g=this.buildObjectNode(g,_,y,r)),f+=g}else if(this.options.attributesGroupName&&_===this.options.attributesGroupName){const d=Object.keys(o[_]),g=d.length;for(let y=0;y<g;y++)a+=this.buildAttrPairStr(d[y],""+o[_][d[y]])}else f+=this.processTextOrObjNode(o[_],_,r,i);return{attrStr:a,val:f}},_t.prototype.buildAttrPairStr=function(o,r){return r=this.options.attributeValueProcessor(o,""+r),r=this.replaceEntitiesValue(r),this.options.suppressBooleanAttributes&&r==="true"?" "+o:" "+o+'="'+r+'"'};function _f(o,r,i,a){const f=this.j2x(o,i+1,a.concat(r));return o[this.options.textNodeName]!==void 0&&Object.keys(o).length===1?this.buildTextValNode(o[this.options.textNodeName],r,f.attrStr,i):this.buildObjectNode(f.val,r,f.attrStr,i)}_t.prototype.buildObjectNode=function(o,r,i,a){if(o==="")return r[0]==="?"?this.indentate(a)+"<"+r+i+"?"+this.tagEndChar:this.indentate(a)+"<"+r+i+this.closeTag(r)+this.tagEndChar;{let f="</"+r+this.tagEndChar,c="";return r[0]==="?"&&(c="?",f=""),(i||i==="")&&o.indexOf("<")===-1?this.indentate(a)+"<"+r+i+c+">"+o+f:this.options.commentPropName!==!1&&r===this.options.commentPropName&&c.length===0?this.indentate(a)+`<!--${o}-->`+this.newLine:this.indentate(a)+"<"+r+i+c+this.tagEndChar+o+this.indentate(a)+f}},_t.prototype.closeTag=function(o){let r="";return this.options.unpairedTags.indexOf(o)!==-1?this.options.suppressUnpairedNode||(r="/"):this.options.suppressEmptyNode?r="/":r=`></${o}`,r},_t.prototype.buildTextValNode=function(o,r,i,a){if(this.options.cdataPropName!==!1&&r===this.options.cdataPropName)return this.indentate(a)+`<![CDATA[${o}]]>`+this.newLine;if(this.options.commentPropName!==!1&&r===this.options.commentPropName)return this.indentate(a)+`<!--${o}-->`+this.newLine;if(r[0]==="?")return this.indentate(a)+"<"+r+i+"?"+this.tagEndChar;{let f=this.options.tagValueProcessor(r,o);return f=this.replaceEntitiesValue(f),f===""?this.indentate(a)+"<"+r+i+this.closeTag(r)+this.tagEndChar:this.indentate(a)+"<"+r+i+">"+f+"</"+r+this.tagEndChar}},_t.prototype.replaceEntitiesValue=function(o){if(o&&o.length>0&&this.options.processEntities)for(let r=0;r<this.options.entities.length;r++){const i=this.options.entities[r];o=o.replace(i.regex,i.val)}return o};function mf(o){return this.options.indentBy.repeat(o)}function vf(o){return o.startsWith(this.options.attributeNamePrefix)&&o!==this.options.textNodeName?o.substr(this.attrPrefixLen):!1}var Ln=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},un={exports:{}};/** * @license * Lodash <https://lodash.com/> * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */var wf=un.exports,Ss;function yf(){return Ss||(Ss=1,function(o,r){(function(){var i,a="4.17.21",f=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",_="Expected a function",d="Invalid `variable` option passed into `_.template`",g="__lodash_hash_undefined__",y=500,T="__lodash_placeholder__",x=1,F=2,I=4,k=1,U=2,H=1,V=2,G=4,D=8,Xe=16,We=32,vt=64,Ge=128,an=256,Ur=512,Ef=30,Sf="...",Af=800,Cf=16,Ls=1,Ff=2,bf=3,Bn=1/0,$t=9007199254740991,Of=17976931348623157e292,Wn=NaN,et=4294967295,Pf=et-1,If=et>>>1,Lf=[["ary",Ge],["bind",H],["bindKey",V],["curry",D],["curryRight",Xe],["flip",Ur],["partial",We],["partialRight",vt],["rearg",an]],qt="[object Arguments]",Gn="[object Array]",Rf="[object AsyncFunction]",fn="[object Boolean]",ln="[object Date]",Mf="[object DOMException]",kn="[object Error]",Un="[object Function]",Rs="[object GeneratorFunction]",Ze="[object Map]",cn="[object Number]",Bf="[object Null]",st="[object Object]",Ms="[object Promise]",Wf="[object Proxy]",hn="[object RegExp]",Je="[object Set]",gn="[object String]",Vn="[object Symbol]",Gf="[object Undefined]",pn="[object WeakMap]",kf="[object WeakSet]",dn="[object ArrayBuffer]",Ht="[object DataView]",Vr="[object Float32Array]",$r="[object Float64Array]",qr="[object Int8Array]",Hr="[object Int16Array]",Kr="[object Int32Array]",Yr="[object Uint8Array]",Xr="[object Uint8ClampedArray]",Zr="[object Uint16Array]",Jr="[object Uint32Array]",Uf=/\b__p \+= '';/g,Vf=/\b(__p \+=) '' \+/g,$f=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Bs=/&(?:amp|lt|gt|quot|#39);/g,Ws=/[&<>"']/g,qf=RegExp(Bs.source),Hf=RegExp(Ws.source),Kf=/<%-([\s\S]+?)%>/g,Yf=/<%([\s\S]+?)%>/g,Gs=/<%=([\s\S]+?)%>/g,Xf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zf=/^\w*$/,Jf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zr=/[\\^$.*+?()[\]{}|]/g,zf=RegExp(zr.source),Qr=/^\s+/,Qf=/\s/,Df=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,jf=/\{\n\/\* \[wrapped with (.+)\] \*/,el=/,? & /,tl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,nl=/[()=,{}\[\]\/\s]/,rl=/\\(\\)?/g,il=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ks=/\w*$/,sl=/^[-+]0x[0-9a-f]+$/i,ol=/^0b[01]+$/i,ul=/^\[object .+?Constructor\]$/,al=/^0o[0-7]+$/i,fl=/^(?:0|[1-9]\d*)$/,ll=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,$n=/($^)/,cl=/['\n\r\u2028\u2029\\]/g,qn="\\ud800-\\udfff",hl="\\u0300-\\u036f",gl="\\ufe20-\\ufe2f",pl="\\u20d0-\\u20ff",Us=hl+gl+pl,Vs="\\u2700-\\u27bf",$s="a-z\\xdf-\\xf6\\xf8-\\xff",dl="\\xac\\xb1\\xd7\\xf7",_l="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ml="\\u2000-\\u206f",vl=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",qs="A-Z\\xc0-\\xd6\\xd8-\\xde",Hs="\\ufe0e\\ufe0f",Ks=dl+_l+ml+vl,Dr="['’]",wl="["+qn+"]",Ys="["+Ks+"]",Hn="["+Us+"]",Xs="\\d+",yl="["+Vs+"]",Zs="["+$s+"]",Js="[^"+qn+Ks+Xs+Vs+$s+qs+"]",jr="\\ud83c[\\udffb-\\udfff]",xl="(?:"+Hn+"|"+jr+")",zs="[^"+qn+"]",ei="(?:\\ud83c[\\udde6-\\uddff]){2}",ti="[\\ud800-\\udbff][\\udc00-\\udfff]",Kt="["+qs+"]",Qs="\\u200d",Ds="(?:"+Zs+"|"+Js+")",Nl="(?:"+Kt+"|"+Js+")",js="(?:"+Dr+"(?:d|ll|m|re|s|t|ve))?",eo="(?:"+Dr+"(?:D|LL|M|RE|S|T|VE))?",to=xl+"?",no="["+Hs+"]?",Tl="(?:"+Qs+"(?:"+[zs,ei,ti].join("|")+")"+no+to+")*",El="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ro=no+to+Tl,Al="(?:"+[yl,ei,ti].join("|")+")"+ro,Cl="(?:"+[zs+Hn+"?",Hn,ei,ti,wl].join("|")+")",Fl=RegExp(Dr,"g"),bl=RegExp(Hn,"g"),ni=RegExp(jr+"(?="+jr+")|"+Cl+ro,"g"),Ol=RegExp([Kt+"?"+Zs+"+"+js+"(?="+[Ys,Kt,"$"].join("|")+")",Nl+"+"+eo+"(?="+[Ys,Kt+Ds,"$"].join("|")+")",Kt+"?"+Ds+"+"+js,Kt+"+"+eo,Sl,El,Xs,Al].join("|"),"g"),Pl=RegExp("["+Qs+qn+Us+Hs+"]"),Il=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ll=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rl=-1,se={};se[Vr]=se[$r]=se[qr]=se[Hr]=se[Kr]=se[Yr]=se[Xr]=se[Zr]=se[Jr]=!0,se[qt]=se[Gn]=se[dn]=se[fn]=se[Ht]=se[ln]=se[kn]=se[Un]=se[Ze]=se[cn]=se[st]=se[hn]=se[Je]=se[gn]=se[pn]=!1;var ie={};ie[qt]=ie[Gn]=ie[dn]=ie[Ht]=ie[fn]=ie[ln]=ie[Vr]=ie[$r]=ie[qr]=ie[Hr]=ie[Kr]=ie[Ze]=ie[cn]=ie[st]=ie[hn]=ie[Je]=ie[gn]=ie[Vn]=ie[Yr]=ie[Xr]=ie[Zr]=ie[Jr]=!0,ie[kn]=ie[Un]=ie[pn]=!1;var Ml={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Bl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Wl={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Gl={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},kl=parseFloat,Ul=parseInt,io=typeof Ln=="object"&&Ln&&Ln.Object===Object&&Ln,Vl=typeof self=="object"&&self&&self.Object===Object&&self,_e=io||Vl||Function("return this")(),ri=r&&!r.nodeType&&r,It=ri&&!0&&o&&!o.nodeType&&o,so=It&&It.exports===ri,ii=so&&io.process,ke=function(){try{var v=It&&It.require&&It.require("util").types;return v||ii&&ii.binding&&ii.binding("util")}catch{}}(),oo=ke&&ke.isArrayBuffer,uo=ke&&ke.isDate,ao=ke&&ke.isMap,fo=ke&&ke.isRegExp,lo=ke&&ke.isSet,co=ke&&ke.isTypedArray;function Oe(v,E,N){switch(N.length){case 0:return v.call(E);case 1:return v.call(E,N[0]);case 2:return v.call(E,N[0],N[1]);case 3:return v.call(E,N[0],N[1],N[2])}return v.apply(E,N)}function $l(v,E,N,P){for(var $=-1,j=v==null?0:v.length;++$<j;){var ge=v[$];E(P,ge,N(ge),v)}return P}function Ue(v,E){for(var N=-1,P=v==null?0:v.length;++N<P&&E(v[N],N,v)!==!1;);return v}function ql(v,E){for(var N=v==null?0:v.length;N--&&E(v[N],N,v)!==!1;);return v}function ho(v,E){for(var N=-1,P=v==null?0:v.length;++N<P;)if(!E(v[N],N,v))return!1;return!0}function wt(v,E){for(var N=-1,P=v==null?0:v.length,$=0,j=[];++N<P;){var ge=v[N];E(ge,N,v)&&(j[$++]=ge)}return j}function Kn(v,E){var N=v==null?0:v.length;return!!N&&Yt(v,E,0)>-1}function si(v,E,N){for(var P=-1,$=v==null?0:v.length;++P<$;)if(N(E,v[P]))return!0;return!1}function oe(v,E){for(var N=-1,P=v==null?0:v.length,$=Array(P);++N<P;)$[N]=E(v[N],N,v);return $}function yt(v,E){for(var N=-1,P=E.length,$=v.length;++N<P;)v[$+N]=E[N];return v}function oi(v,E,N,P){var $=-1,j=v==null?0:v.length;for(P&&j&&(N=v[++$]);++$<j;)N=E(N,v[$],$,v);return N}function Hl(v,E,N,P){var $=v==null?0:v.length;for(P&&$&&(N=v[--$]);$--;)N=E(N,v[$],$,v);return N}function ui(v,E){for(var N=-1,P=v==null?0:v.length;++N<P;)if(E(v[N],N,v))return!0;return!1}var Kl=ai("length");function Yl(v){return v.split("")}function Xl(v){return v.match(tl)||[]}function go(v,E,N){var P;return N(v,function($,j,ge){if(E($,j,ge))return P=j,!1}),P}function Yn(v,E,N,P){for(var $=v.length,j=N+(P?1:-1);P?j--:++j<$;)if(E(v[j],j,v))return j;return-1}function Yt(v,E,N){return E===E?sc(v,E,N):Yn(v,po,N)}function Zl(v,E,N,P){for(var $=N-1,j=v.length;++$<j;)if(P(v[$],E))return $;return-1}function po(v){return v!==v}function _o(v,E){var N=v==null?0:v.length;return N?li(v,E)/N:Wn}function ai(v){return function(E){return E==null?i:E[v]}}function fi(v){return function(E){return v==null?i:v[E]}}function mo(v,E,N,P,$){return $(v,function(j,ge,re){N=P?(P=!1,j):E(N,j,ge,re)}),N}function Jl(v,E){var N=v.length;for(v.sort(E);N--;)v[N]=v[N].value;return v}function li(v,E){for(var N,P=-1,$=v.length;++P<$;){var j=E(v[P]);j!==i&&(N=N===i?j:N+j)}return N}function ci(v,E){for(var N=-1,P=Array(v);++N<v;)P[N]=E(N);return P}function zl(v,E){return oe(E,function(N){return[N,v[N]]})}function vo(v){return v&&v.slice(0,No(v)+1).replace(Qr,"")}function Pe(v){return function(E){return v(E)}}function hi(v,E){return oe(E,function(N){return v[N]})}function _n(v,E){return v.has(E)}function wo(v,E){for(var N=-1,P=v.length;++N<P&&Yt(E,v[N],0)>-1;);return N}function yo(v,E){for(var N=v.length;N--&&Yt(E,v[N],0)>-1;);return N}function Ql(v,E){for(var N=v.length,P=0;N--;)v[N]===E&&++P;return P}var Dl=fi(Ml),jl=fi(Bl);function ec(v){return"\\"+Gl[v]}function tc(v,E){return v==null?i:v[E]}function Xt(v){return Pl.test(v)}function nc(v){return Il.test(v)}function rc(v){for(var E,N=[];!(E=v.next()).done;)N.push(E.value);return N}function gi(v){var E=-1,N=Array(v.size);return v.forEach(function(P,$){N[++E]=[$,P]}),N}function xo(v,E){return function(N){return v(E(N))}}function xt(v,E){for(var N=-1,P=v.length,$=0,j=[];++N<P;){var ge=v[N];(ge===E||ge===T)&&(v[N]=T,j[$++]=N)}return j}function Xn(v){var E=-1,N=Array(v.size);return v.forEach(function(P){N[++E]=P}),N}function ic(v){var E=-1,N=Array(v.size);return v.forEach(function(P){N[++E]=[P,P]}),N}function sc(v,E,N){for(var P=N-1,$=v.length;++P<$;)if(v[P]===E)return P;return-1}function oc(v,E,N){for(var P=N+1;P--;)if(v[P]===E)return P;return P}function Zt(v){return Xt(v)?ac(v):Kl(v)}function ze(v){return Xt(v)?fc(v):Yl(v)}function No(v){for(var E=v.length;E--&&Qf.test(v.charAt(E)););return E}var uc=fi(Wl);function ac(v){for(var E=ni.lastIndex=0;ni.test(v);)++E;return E}function fc(v){return v.match(ni)||[]}function lc(v){return v.match(Ol)||[]}var cc=function v(E){E=E==null?_e:Jt.defaults(_e.Object(),E,Jt.pick(_e,Ll));var N=E.Array,P=E.Date,$=E.Error,j=E.Function,ge=E.Math,re=E.Object,pi=E.RegExp,hc=E.String,Ve=E.TypeError,Zn=N.prototype,gc=j.prototype,zt=re.prototype,Jn=E["__core-js_shared__"],zn=gc.toString,ne=zt.hasOwnProperty,pc=0,To=function(){var e=/[^.]+$/.exec(Jn&&Jn.keys&&Jn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Qn=zt.toString,dc=zn.call(re),_c=_e._,mc=pi("^"+zn.call(ne).replace(zr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Dn=so?E.Buffer:i,Nt=E.Symbol,jn=E.Uint8Array,Eo=Dn?Dn.allocUnsafe:i,er=xo(re.getPrototypeOf,re),So=re.create,Ao=zt.propertyIsEnumerable,tr=Zn.splice,Co=Nt?Nt.isConcatSpreadable:i,mn=Nt?Nt.iterator:i,Lt=Nt?Nt.toStringTag:i,nr=function(){try{var e=Gt(re,"defineProperty");return e({},"",{}),e}catch{}}(),vc=E.clearTimeout!==_e.clearTimeout&&E.clearTimeout,wc=P&&P.now!==_e.Date.now&&P.now,yc=E.setTimeout!==_e.setTimeout&&E.setTimeout,rr=ge.ceil,ir=ge.floor,di=re.getOwnPropertySymbols,xc=Dn?Dn.isBuffer:i,Fo=E.isFinite,Nc=Zn.join,Tc=xo(re.keys,re),pe=ge.max,ve=ge.min,Ec=P.now,Sc=E.parseInt,bo=ge.random,Ac=Zn.reverse,_i=Gt(E,"DataView"),vn=Gt(E,"Map"),mi=Gt(E,"Promise"),Qt=Gt(E,"Set"),wn=Gt(E,"WeakMap"),yn=Gt(re,"create"),sr=wn&&new wn,Dt={},Cc=kt(_i),Fc=kt(vn),bc=kt(mi),Oc=kt(Qt),Pc=kt(wn),or=Nt?Nt.prototype:i,xn=or?or.valueOf:i,Oo=or?or.toString:i;function l(e){if(ae(e)&&!q(e)&&!(e instanceof J)){if(e instanceof $e)return e;if(ne.call(e,"__wrapped__"))return Pu(e)}return new $e(e)}var jt=function(){function e(){}return function(t){if(!ue(t))return{};if(So)return So(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function ur(){}function $e(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}l.templateSettings={escape:Kf,evaluate:Yf,interpolate:Gs,variable:"",imports:{_:l}},l.prototype=ur.prototype,l.prototype.constructor=l,$e.prototype=jt(ur.prototype),$e.prototype.constructor=$e;function J(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=et,this.__views__=[]}function Ic(){var e=new J(this.__wrapped__);return e.__actions__=Ae(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ae(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ae(this.__views__),e}function Lc(){if(this.__filtered__){var e=new J(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Rc(){var e=this.__wrapped__.value(),t=this.__dir__,n=q(e),s=t<0,u=n?e.length:0,h=Yh(0,u,this.__views__),p=h.start,m=h.end,w=m-p,S=s?m:p-1,A=this.__iteratees__,C=A.length,b=0,L=ve(w,this.__takeCount__);if(!n||!s&&u==w&&L==w)return eu(e,this.__actions__);var B=[];e:for(;w--&&b<L;){S+=t;for(var Y=-1,W=e[S];++Y<C;){var Z=A[Y],z=Z.iteratee,Re=Z.type,Ee=z(W);if(Re==Ff)W=Ee;else if(!Ee){if(Re==Ls)continue e;break e}}B[b++]=W}return B}J.prototype=jt(ur.prototype),J.prototype.constructor=J;function Rt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}function Mc(){this.__data__=yn?yn(null):{},this.size=0}function Bc(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Wc(e){var t=this.__data__;if(yn){var n=t[e];return n===g?i:n}return ne.call(t,e)?t[e]:i}function Gc(e){var t=this.__data__;return yn?t[e]!==i:ne.call(t,e)}function kc(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=yn&&t===i?g:t,this}Rt.prototype.clear=Mc,Rt.prototype.delete=Bc,Rt.prototype.get=Wc,Rt.prototype.has=Gc,Rt.prototype.set=kc;function ot(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}function Uc(){this.__data__=[],this.size=0}function Vc(e){var t=this.__data__,n=ar(t,e);if(n<0)return!1;var s=t.length-1;return n==s?t.pop():tr.call(t,n,1),--this.size,!0}function $c(e){var t=this.__data__,n=ar(t,e);return n<0?i:t[n][1]}function qc(e){return ar(this.__data__,e)>-1}function Hc(e,t){var n=this.__data__,s=ar(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this}ot.prototype.clear=Uc,ot.prototype.delete=Vc,ot.prototype.get=$c,ot.prototype.has=qc,ot.prototype.set=Hc;function ut(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}function Kc(){this.size=0,this.__data__={hash:new Rt,map:new(vn||ot),string:new Rt}}function Yc(e){var t=yr(this,e).delete(e);return this.size-=t?1:0,t}function Xc(e){return yr(this,e).get(e)}function Zc(e){return yr(this,e).has(e)}function Jc(e,t){var n=yr(this,e),s=n.size;return n.set(e,t),this.size+=n.size==s?0:1,this}ut.prototype.clear=Kc,ut.prototype.delete=Yc,ut.prototype.get=Xc,ut.prototype.has=Zc,ut.prototype.set=Jc;function Mt(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ut;++t<n;)this.add(e[t])}function zc(e){return this.__data__.set(e,g),this}function Qc(e){return this.__data__.has(e)}Mt.prototype.add=Mt.prototype.push=zc,Mt.prototype.has=Qc;function Qe(e){var t=this.__data__=new ot(e);this.size=t.size}function Dc(){this.__data__=new ot,this.size=0}function jc(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function eh(e){return this.__data__.get(e)}function th(e){return this.__data__.has(e)}function nh(e,t){var n=this.__data__;if(n instanceof ot){var s=n.__data__;if(!vn||s.length<f-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new ut(s)}return n.set(e,t),this.size=n.size,this}Qe.prototype.clear=Dc,Qe.prototype.delete=jc,Qe.prototype.get=eh,Qe.prototype.has=th,Qe.prototype.set=nh;function Po(e,t){var n=q(e),s=!n&&Ut(e),u=!n&&!s&&Ct(e),h=!n&&!s&&!u&&rn(e),p=n||s||u||h,m=p?ci(e.length,hc):[],w=m.length;for(var S in e)(t||ne.call(e,S))&&!(p&&(S=="length"||u&&(S=="offset"||S=="parent")||h&&(S=="buffer"||S=="byteLength"||S=="byteOffset")||ct(S,w)))&&m.push(S);return m}function Io(e){var t=e.length;return t?e[Fi(0,t-1)]:i}function rh(e,t){return xr(Ae(e),Bt(t,0,e.length))}function ih(e){return xr(Ae(e))}function vi(e,t,n){(n!==i&&!De(e[t],n)||n===i&&!(t in e))&&at(e,t,n)}function Nn(e,t,n){var s=e[t];(!(ne.call(e,t)&&De(s,n))||n===i&&!(t in e))&&at(e,t,n)}function ar(e,t){for(var n=e.length;n--;)if(De(e[n][0],t))return n;return-1}function sh(e,t,n,s){return Tt(e,function(u,h,p){t(s,u,n(u),p)}),s}function Lo(e,t){return e&&nt(t,de(t),e)}function oh(e,t){return e&&nt(t,Fe(t),e)}function at(e,t,n){t=="__proto__"&&nr?nr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function wi(e,t){for(var n=-1,s=t.length,u=N(s),h=e==null;++n<s;)u[n]=h?i:ji(e,t[n]);return u}function Bt(e,t,n){return e===e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function qe(e,t,n,s,u,h){var p,m=t&x,w=t&F,S=t&I;if(n&&(p=u?n(e,s,u,h):n(e)),p!==i)return p;if(!ue(e))return e;var A=q(e);if(A){if(p=Zh(e),!m)return Ae(e,p)}else{var C=we(e),b=C==Un||C==Rs;if(Ct(e))return ru(e,m);if(C==st||C==qt||b&&!u){if(p=w||b?{}:Nu(e),!m)return w?Wh(e,oh(p,e)):Bh(e,Lo(p,e))}else{if(!ie[C])return u?e:{};p=Jh(e,C,m)}}h||(h=new Qe);var L=h.get(e);if(L)return L;h.set(e,p),Qu(e)?e.forEach(function(W){p.add(qe(W,t,n,W,e,h))}):Ju(e)&&e.forEach(function(W,Z){p.set(Z,qe(W,t,n,Z,e,h))});var B=S?w?ki:Gi:w?Fe:de,Y=A?i:B(e);return Ue(Y||e,function(W,Z){Y&&(Z=W,W=e[Z]),Nn(p,Z,qe(W,t,n,Z,e,h))}),p}function uh(e){var t=de(e);return function(n){return Ro(n,e,t)}}function Ro(e,t,n){var s=n.length;if(e==null)return!s;for(e=re(e);s--;){var u=n[s],h=t[u],p=e[u];if(p===i&&!(u in e)||!h(p))return!1}return!0}function Mo(e,t,n){if(typeof e!="function")throw new Ve(_);return bn(function(){e.apply(i,n)},t)}function Tn(e,t,n,s){var u=-1,h=Kn,p=!0,m=e.length,w=[],S=t.length;if(!m)return w;n&&(t=oe(t,Pe(n))),s?(h=si,p=!1):t.length>=f&&(h=_n,p=!1,t=new Mt(t));e:for(;++u<m;){var A=e[u],C=n==null?A:n(A);if(A=s||A!==0?A:0,p&&C===C){for(var b=S;b--;)if(t[b]===C)continue e;w.push(A)}else h(t,C,s)||w.push(A)}return w}var Tt=au(tt),Bo=au(xi,!0);function ah(e,t){var n=!0;return Tt(e,function(s,u,h){return n=!!t(s,u,h),n}),n}function fr(e,t,n){for(var s=-1,u=e.length;++s<u;){var h=e[s],p=t(h);if(p!=null&&(m===i?p===p&&!Le(p):n(p,m)))var m=p,w=h}return w}function fh(e,t,n,s){var u=e.length;for(n=K(n),n<0&&(n=-n>u?0:u+n),s=s===i||s>u?u:K(s),s<0&&(s+=u),s=n>s?0:ju(s);n<s;)e[n++]=t;return e}function Wo(e,t){var n=[];return Tt(e,function(s,u,h){t(s,u,h)&&n.push(s)}),n}function me(e,t,n,s,u){var h=-1,p=e.length;for(n||(n=Qh),u||(u=[]);++h<p;){var m=e[h];t>0&&n(m)?t>1?me(m,t-1,n,s,u):yt(u,m):s||(u[u.length]=m)}return u}var yi=fu(),Go=fu(!0);function tt(e,t){return e&&yi(e,t,de)}function xi(e,t){return e&&Go(e,t,de)}function lr(e,t){return wt(t,function(n){return ht(e[n])})}function Wt(e,t){t=St(t,e);for(var n=0,s=t.length;e!=null&&n<s;)e=e[rt(t[n++])];return n&&n==s?e:i}function ko(e,t,n){var s=t(e);return q(e)?s:yt(s,n(e))}function Ne(e){return e==null?e===i?Gf:Bf:Lt&&Lt in re(e)?Kh(e):ig(e)}function Ni(e,t){return e>t}function lh(e,t){return e!=null&&ne.call(e,t)}function ch(e,t){return e!=null&&t in re(e)}function hh(e,t,n){return e>=ve(t,n)&&e<pe(t,n)}function Ti(e,t,n){for(var s=n?si:Kn,u=e[0].length,h=e.length,p=h,m=N(h),w=1/0,S=[];p--;){var A=e[p];p&&t&&(A=oe(A,Pe(t))),w=ve(A.length,w),m[p]=!n&&(t||u>=120&&A.length>=120)?new Mt(p&&A):i}A=e[0];var C=-1,b=m[0]