lone-format 0.7.1 → 0.9.0
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.
- package/dist/lone-format.css +1 -1
- package/dist/lone-format.js +8817 -2612
- package/dist/lone-format.umd.cjs +20 -11
- package/package.json +3 -3
package/dist/lone-format.umd.cjs
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=l}else e+=l}return o||this.throwError('Unclosed quote after "'+e+'"'),{type:f.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(f.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,f.isIdentifierPart(e));)this.index++;return{type:f.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){const t=[];let s=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let l=this.code;if(l===e){s=!0,this.index++,e===f.CPAREN_CODE&&o&&o>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}else if(l===f.COMMA_CODE){if(this.index++,o++,o!==t.length){if(e===f.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===f.CBRACK_CODE)for(let a=t.length;a<o;a++)t.push(null)}}else if(t.length!==o&&o!==0)this.throwError("Expected comma");else{const a=this.gobbleExpression();(!a||a.type===f.COMPOUND)&&this.throwError("Expected comma"),t.push(a)}}return s||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(f.CPAREN_CODE);if(this.code===f.CPAREN_CODE)return this.index++,e.length===1?e[0]:e.length?{type:f.SEQUENCE_EXP,expressions:e}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:f.ARRAY_EXP,elements:this.gobbleArguments(f.CBRACK_CODE)}}}const Ye=new qe;Object.assign(f,{hooks:Ye,plugins:new Qe(f),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),f.max_unop_len=f.getMaxKeyLen(f.unary_ops),f.max_binop_len=f.getMaxKeyLen(f.binary_ops);const ae=n=>new f(n).parse(),De=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(f).filter(n=>!De.includes(n)&&ae[n]===void 0).forEach(n=>{ae[n]=f[n]}),ae.Jsep=f;const Ge="ConditionalExpression";var Ze={name:"ternary",init(n){n.hooks.add("after-expression",function(t){if(t.node&&this.code===n.QUMARK_CODE){this.index++;const s=t.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===n.COLON_CODE){this.index++;const l=this.gobbleExpression();if(l||this.throwError("Expected expression"),t.node={type:Ge,test:s,consequent:o,alternate:l},s.operator&&n.binary_ops[s.operator]<=.9){let a=s;for(;a.right.operator&&n.binary_ops[a.right.operator]<=.9;)a=a.right;t.node.test=a.right,a.right=t.node,t.node=s}}else this.throwError("Expected :")}})}};ae.plugins.register(Ze);const ve=47,Je=92;var et={name:"regex",init(n){n.hooks.add("gobble-token",function(t){if(this.code===ve){const s=++this.index;let o=!1;for(;this.index<this.expr.length;){if(this.code===ve&&!o){const l=this.expr.slice(s,this.index);let a="";for(;++this.index<this.expr.length;){const i=this.code;if(i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57)a+=this.char;else break}let d;try{d=new RegExp(l,a)}catch(i){this.throwError(i.message)}return t.node={type:n.LITERAL,value:d,raw:this.expr.slice(s-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===n.OBRACK_CODE?o=!0:o&&this.code===n.CBRACK_CODE&&(o=!1),this.index+=this.code===Je?2:1}this.throwError("Unclosed Regex")}})}};const Ne=43,me={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[Ne,45],assignmentPrecedence:.9,init(n){const e=[n.IDENTIFIER,n.MEMBER_EXP];me.assignmentOperators.forEach(s=>n.addBinaryOp(s,me.assignmentPrecedence,!0)),n.hooks.add("gobble-token",function(o){const l=this.code;me.updateOperators.some(a=>a===l&&a===this.expr.charCodeAt(this.index+1))&&(this.index+=2,o.node={type:"UpdateExpression",operator:l===Ne?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},(!o.node.argument||!e.includes(o.node.argument.type))&&this.throwError(`Unexpected ${o.node.operator}`))}),n.hooks.add("after-token",function(o){if(o.node){const l=this.code;me.updateOperators.some(a=>a===l&&a===this.expr.charCodeAt(this.index+1))&&(e.includes(o.node.type)||this.throwError(`Unexpected ${o.node.operator}`),this.index+=2,o.node={type:"UpdateExpression",operator:l===Ne?"++":"--",argument:o.node,prefix:!1})}}),n.hooks.add("after-expression",function(o){o.node&&t(o.node)});function t(s){me.assignmentOperators.has(s.operator)?(s.type="AssignmentExpression",t(s.left),t(s.right)):s.operator||Object.values(s).forEach(o=>{o&&typeof o=="object"&&t(o)})}}};ae.plugins.register(et,me),ae.addUnaryOp("typeof"),ae.addLiteral("null",null),ae.addLiteral("undefined",void 0);const tt=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__"]),z={evalAst(n,e){switch(n.type){case"BinaryExpression":case"LogicalExpression":return z.evalBinaryExpression(n,e);case"Compound":return z.evalCompound(n,e);case"ConditionalExpression":return z.evalConditionalExpression(n,e);case"Identifier":return z.evalIdentifier(n,e);case"Literal":return z.evalLiteral(n,e);case"MemberExpression":return z.evalMemberExpression(n,e);case"UnaryExpression":return z.evalUnaryExpression(n,e);case"ArrayExpression":return z.evalArrayExpression(n,e);case"CallExpression":return z.evalCallExpression(n,e);case"AssignmentExpression":return z.evalAssignmentExpression(n,e);default:throw SyntaxError("Unexpected expression",n)}},evalBinaryExpression(n,e){return{"||":(s,o)=>s||o(),"&&":(s,o)=>s&&o(),"|":(s,o)=>s|o(),"^":(s,o)=>s^o(),"&":(s,o)=>s&o(),"==":(s,o)=>s==o(),"!=":(s,o)=>s!=o(),"===":(s,o)=>s===o(),"!==":(s,o)=>s!==o(),"<":(s,o)=>s<o(),">":(s,o)=>s>o(),"<=":(s,o)=>s<=o(),">=":(s,o)=>s>=o(),"<<":(s,o)=>s<<o(),">>":(s,o)=>s>>o(),">>>":(s,o)=>s>>>o(),"+":(s,o)=>s+o(),"-":(s,o)=>s-o(),"*":(s,o)=>s*o(),"/":(s,o)=>s/o(),"%":(s,o)=>s%o()}[n.operator](z.evalAst(n.left,e),()=>z.evalAst(n.right,e))},evalCompound(n,e){let t;for(let s=0;s<n.body.length;s++){n.body[s].type==="Identifier"&&["var","let","const"].includes(n.body[s].name)&&n.body[s+1]&&n.body[s+1].type==="AssignmentExpression"&&(s+=1);const o=n.body[s];t=z.evalAst(o,e)}return t},evalConditionalExpression(n,e){return z.evalAst(n.test,e)?z.evalAst(n.consequent,e):z.evalAst(n.alternate,e)},evalIdentifier(n,e){if(Object.hasOwn(e,n.name))return e[n.name];throw ReferenceError(`${n.name} is not defined`)},evalLiteral(n){return n.value},evalMemberExpression(n,e){const t=String(n.computed?z.evalAst(n.property):n.property.name),s=z.evalAst(n.object,e);if(s==null)throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);if(!Object.hasOwn(s,t)&&tt.has(t))throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);const o=s[t];return typeof o=="function"?o.bind(s):o},evalUnaryExpression(n,e){return{"-":s=>-z.evalAst(s,e),"!":s=>!z.evalAst(s,e),"~":s=>~z.evalAst(s,e),"+":s=>+z.evalAst(s,e),typeof:s=>typeof z.evalAst(s,e)}[n.operator](n.argument)},evalArrayExpression(n,e){return n.elements.map(t=>z.evalAst(t,e))},evalCallExpression(n,e){const t=n.arguments.map(o=>z.evalAst(o,e));return z.evalAst(n.callee,e)(...t)},evalAssignmentExpression(n,e){if(n.left.type!=="Identifier")throw SyntaxError("Invalid left-hand side in assignment");const t=n.left.name,s=z.evalAst(n.right,e);return e[t]=s,e[t]}};class nt{constructor(e){this.code=e,this.ast=ae(this.code)}runInNewContext(e){const t=Object.assign(Object.create(null),e);return z.evalAst(this.ast,t)}}function de(n,e){return n=n.slice(),n.push(e),n}function we(n,e){return e=e.slice(),e.unshift(n),e}class rt extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}}function K(n,e,t,s,o){if(!(this instanceof K))try{return new K(n,e,t,s,o)}catch(a){if(!a.avoidNew)throw a;return a.value}typeof n=="string"&&(o=s,s=t,t=e,e=n,n=null);const l=n&&typeof n=="object";if(n=n||{},this.json=n.json||t,this.path=n.path||e,this.resultType=n.resultType||"value",this.flatten=n.flatten||!1,this.wrap=Object.hasOwn(n,"wrap")?n.wrap:!0,this.sandbox=n.sandbox||{},this.eval=n.eval===void 0?"safe":n.eval,this.ignoreEvalErrors=typeof n.ignoreEvalErrors>"u"?!1:n.ignoreEvalErrors,this.parent=n.parent||null,this.parentProperty=n.parentProperty||null,this.callback=n.callback||s||null,this.otherTypeCallback=n.otherTypeCallback||o||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},n.autostart!==!1){const a={path:l?n.path:e};l?"json"in n&&(a.json=n.json):a.json=t;const d=this.evaluate(a);if(!d||typeof d!="object")throw new rt(d);return d}}K.prototype.evaluate=function(n,e,t,s){let o=this.parent,l=this.parentProperty,{flatten:a,wrap:d}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,t=t||this.callback,this.currOtherTypeCallback=s||this.otherTypeCallback,e=e||this.json,n=n||this.path,n&&typeof n=="object"&&!Array.isArray(n)){if(!n.path&&n.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(n,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:e}=n),a=Object.hasOwn(n,"flatten")?n.flatten:a,this.currResultType=Object.hasOwn(n,"resultType")?n.resultType:this.currResultType,this.currSandbox=Object.hasOwn(n,"sandbox")?n.sandbox:this.currSandbox,d=Object.hasOwn(n,"wrap")?n.wrap:d,this.currEval=Object.hasOwn(n,"eval")?n.eval:this.currEval,t=Object.hasOwn(n,"callback")?n.callback:t,this.currOtherTypeCallback=Object.hasOwn(n,"otherTypeCallback")?n.otherTypeCallback:this.currOtherTypeCallback,o=Object.hasOwn(n,"parent")?n.parent:o,l=Object.hasOwn(n,"parentProperty")?n.parentProperty:l,n=n.path}if(o=o||null,l=l||null,Array.isArray(n)&&(n=K.toPathString(n)),!n&&n!==""||!e)return;const i=K.toPathArray(n);i[0]==="$"&&i.length>1&&i.shift(),this._hasParentSelector=null;const c=this._trace(i,e,["$"],o,l,t).filter(function(g){return g&&!g.isParentSelector});return c.length?!d&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce((g,p)=>{const w=this._getPreferredOutput(p);return a&&Array.isArray(w)?g=g.concat(w):g.push(w),g},[]):d?[]:void 0},K.prototype._getPreferredOutput=function(n){const e=this.currResultType;switch(e){case"all":{const t=Array.isArray(n.path)?n.path:K.toPathArray(n.path);return n.pointer=K.toPointer(t),n.path=typeof n.path=="string"?n.path:K.toPathString(n.path),n}case"value":case"parent":case"parentProperty":return n[e];case"path":return K.toPathString(n[e]);case"pointer":return K.toPointer(n.path);default:throw new TypeError("Unknown result type")}},K.prototype._handleCallback=function(n,e,t){if(e){const s=this._getPreferredOutput(n);n.path=typeof n.path=="string"?n.path:K.toPathString(n.path),e(s,t,n)}},K.prototype._trace=function(n,e,t,s,o,l,a,d){let i;if(!n.length)return i={path:t,value:e,parent:s,parentProperty:o,hasArrExpr:a},this._handleCallback(i,l,"value"),i;const c=n[0],g=n.slice(1),p=[];function w(k){Array.isArray(k)?k.forEach(S=>{p.push(S)}):p.push(k)}if((typeof c!="string"||d)&&e&&Object.hasOwn(e,c))w(this._trace(g,e[c],de(t,c),e,c,l,a));else if(c==="*")this._walk(e,k=>{w(this._trace(g,e[k],de(t,k),e,k,l,!0,!0))});else if(c==="..")w(this._trace(g,e,t,s,o,l,a)),this._walk(e,k=>{typeof e[k]=="object"&&w(this._trace(n.slice(),e[k],de(t,k),e,k,l,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:t.slice(0,-1),expr:g,isParentSelector:!0};if(c==="~")return i={path:de(t,c),value:o,parent:s,parentProperty:null},this._handleCallback(i,l,"property"),i;if(c==="$")w(this._trace(g,e,t,null,null,l,a));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(c))w(this._slice(c,g,e,t,s,o,l));else if(c.indexOf("?(")===0){if(this.currEval===!1)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const k=c.replace(/^\?\((.*?)\)$/u,"$1"),S=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(k);S?this._walk(e,$=>{const B=[S[2]],M=S[1]?e[$][S[1]]:e[$];this._trace(B,M,t,s,o,l,!0).length>0&&w(this._trace(g,e[$],de(t,$),e,$,l,!0))}):this._walk(e,$=>{this._eval(k,e[$],$,t,s,o)&&w(this._trace(g,e[$],de(t,$),e,$,l,!0))})}else if(c[0]==="("){if(this.currEval===!1)throw new Error("Eval [(expr)] prevented in JSONPath expression.");w(this._trace(we(this._eval(c,e,t.at(-1),t.slice(0,-1),s,o),g),e,t,s,o,l,a))}else if(c[0]==="@"){let k=!1;const S=c.slice(1,-2);switch(S){case"scalar":(!e||!["object","function"].includes(typeof e))&&(k=!0);break;case"boolean":case"string":case"undefined":case"function":typeof e===S&&(k=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(k=!0);break;case"number":Number.isFinite(e)&&(k=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(k=!0);break;case"object":e&&typeof e===S&&(k=!0);break;case"array":Array.isArray(e)&&(k=!0);break;case"other":k=this.currOtherTypeCallback(e,t,s,o);break;case"null":e===null&&(k=!0);break;default:throw new TypeError("Unknown value type "+S)}if(k)return i={path:t,value:e,parent:s,parentProperty:o},this._handleCallback(i,l,"value"),i}else if(c[0]==="`"&&e&&Object.hasOwn(e,c.slice(1))){const k=c.slice(1);w(this._trace(g,e[k],de(t,k),e,k,l,a,!0))}else if(c.includes(",")){const k=c.split(",");for(const S of k)w(this._trace(we(S,g),e,t,s,o,l,!0))}else!d&&e&&Object.hasOwn(e,c)&&w(this._trace(g,e[c],de(t,c),e,c,l,a,!0))}if(this._hasParentSelector)for(let k=0;k<p.length;k++){const S=p[k];if(S&&S.isParentSelector){const $=this._trace(S.expr,e,S.path,s,o,l,a);if(Array.isArray($)){p[k]=$[0];const B=$.length;for(let M=1;M<B;M++)k++,p.splice(k,0,$[M])}else p[k]=$}}return p},K.prototype._walk=function(n,e){if(Array.isArray(n)){const t=n.length;for(let s=0;s<t;s++)e(s)}else n&&typeof n=="object"&&Object.keys(n).forEach(t=>{e(t)})},K.prototype._slice=function(n,e,t,s,o,l,a){if(!Array.isArray(t))return;const d=t.length,i=n.split(":"),c=i[2]&&Number.parseInt(i[2])||1;let g=i[0]&&Number.parseInt(i[0])||0,p=i[1]&&Number.parseInt(i[1])||d;g=g<0?Math.max(0,g+d):Math.min(d,g),p=p<0?Math.max(0,p+d):Math.min(d,p);const w=[];for(let k=g;k<p;k+=c)this._trace(we(k,e),t,s,o,l,a,!0).forEach($=>{w.push($)});return w},K.prototype._eval=function(n,e,t,s,o,l){this.currSandbox._$_parentProperty=l,this.currSandbox._$_parent=o,this.currSandbox._$_property=t,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;const a=n.includes("@path");a&&(this.currSandbox._$_path=K.toPathString(s.concat([t])));const d=this.currEval+"Script:"+n;if(!K.cache[d]){let i=n.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(a&&(i=i.replaceAll("@path","_$_path")),this.currEval==="safe"||this.currEval===!0||this.currEval===void 0)K.cache[d]=new this.safeVm.Script(i);else if(this.currEval==="native")K.cache[d]=new this.vm.Script(i);else if(typeof this.currEval=="function"&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const c=this.currEval;K.cache[d]=new c(i)}else if(typeof this.currEval=="function")K.cache[d]={runInNewContext:c=>this.currEval(i,c)};else throw new TypeError(`Unknown "eval" property "${this.currEval}"`)}try{return K.cache[d].runInNewContext(this.currSandbox)}catch(i){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+i.message+": "+n)}},K.cache={},K.toPathString=function(n){const e=n,t=e.length;let s="$";for(let o=1;o<t;o++)/^(~|\^|@.*?\(\))$/u.test(e[o])||(s+=/^[0-9*]+$/u.test(e[o])?"["+e[o]+"]":"['"+e[o]+"']");return s},K.toPointer=function(n){const e=n,t=e.length;let s="";for(let o=1;o<t;o++)/^(~|\^|@.*?\(\))$/u.test(e[o])||(s+="/"+e[o].toString().replaceAll("~","~0").replaceAll("/","~1"));return s},K.toPathArray=function(n){const{cache:e}=K;if(e[n])return e[n].concat();const t=[],o=n.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(l,a){return"[#"+(t.push(a)-1)+"]"}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function(l,a){return"['"+a.replaceAll(".","%@%").replaceAll("~","%%@@%%")+"']"}).replaceAll("~",";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replaceAll("%@%",".").replaceAll("%%@@%%","~").replaceAll(/(?:;)?(\^+)(?:;)?/gu,function(l,a){return";"+a.split("").join(";")+";"}).replaceAll(/;;;|;;/gu,";..;").replaceAll(/;$|'?\]|'$/gu,"").split(";").map(function(l){const a=l.match(/#(\d+)/u);return!a||!a[1]?l:t[a[1]]});return e[n]=o,e[n].concat()},K.prototype.safeVm={Script:nt};const ot=function(n,e,t){const s=n.length;for(let o=0;o<s;o++){const l=n[o];t(l)&&e.push(n.splice(o--,1)[0])}};class st{constructor(e){this.code=e}runInNewContext(e){let t=this.code;const s=Object.keys(e),o=[];ot(s,o,c=>typeof e[c]=="function");const l=s.map(c=>e[c]);t=o.reduce((c,g)=>{let p=e[g].toString();return/function/u.test(p)||(p="function "+p),"var "+g+"="+p+";"+c},"")+t,!/(['"])use strict\1/u.test(t)&&!s.includes("arguments")&&(t="var arguments = undefined;"+t),t=t.replace(/;\s*$/u,"");const d=t.lastIndexOf(";"),i=d!==-1?t.slice(0,d+1)+" return "+t.slice(d+1):" return "+t;return new Function(...s,i)(...l)}}K.prototype.vm={Script:st};const lt={class:"json-node"},at={key:0,class:"json-node__container"},it={class:"json-node__line"},ct=["contenteditable","onKeydown"],dt={key:1,class:"json-node__colon"},ut=["title"],ft=["title"],ht={key:4,class:"json-node__comma"},pt={key:0,class:"json-node__children"},mt={class:"json-node__children-content"},gt={class:"json-node__line json-node__closing-bracket"},yt={class:"json-node__bracket"},bt={key:0,class:"json-node__comma"},Et={key:1,class:"json-node__primitive"},_t=["contenteditable","onKeydown"],xt={key:1,class:"json-node__colon"},kt=["title"],Nt=["contenteditable","onKeydown"],wt={key:0,class:"json-node__comma"},At=r.defineComponent({name:"JsonNode",__name:"JsonNode",props:{value:{},keyName:{},level:{},path:{default:""},expanded:{},isLast:{type:Boolean,default:!1},theme:{}},emits:["update:value","toggle-expand","copy","update:key"],setup(n,{emit:e}){r.useCssVars(y=>({"2a18b018":y.level,"58a14b93":y.theme.colors.syntaxKey,"46fe1b3e":y.theme.colors.hoverBackground,fbe2c048:y.theme.colors.syntaxBracket,"4bd524bb":y.theme.colors.collapsedText,"3308d23c":y.theme.colors.collapsedBackground,"36380c60":y.theme.colors.collapsedBackgroundHover,"0892365d":y.theme.colors.syntaxString,"0015b195":y.theme.colors.syntaxNumber,"7db95f5c":y.theme.colors.syntaxBoolean,"88ec825a":y.theme.colors.syntaxNull,"537157f7":y.theme.colors.background,"3cee3331":y.theme.colors.selectionBackground,"81323cee":y.theme.colors.indentLine}));const t=n,s=e,o=r.ref(!1),l=r.ref(!1),a=r.ref(""),d=r.ref(""),i=r.ref("string"),c=r.ref(null),g=r.ref(null),p=y=>y!==null&&typeof y=="object"&&!Array.isArray(y)&&"__protected_number__"in y&&Object.keys(y).length===1,w=y=>p(y)?y.__protected_number__:"",k=r.computed(()=>p(t.value)?!1:t.value!==null&&typeof t.value=="object"),S=r.computed(()=>Array.isArray(t.value)),$=r.computed(()=>t.path?t.path:t.keyName?t.keyName:"root"),B=r.computed(()=>t.expanded.has($.value)),M=r.computed(()=>t.keyName),X=r.computed(()=>S.value?"[":"{"),j=r.computed(()=>S.value?"]":"}"),q=r.computed(()=>{if(!t.value)return"";const u=Object.keys(t.value).length;return S.value?u>0?` ${u} items `:" ":u>0?` ${u} keys `:" "}),re=r.computed(()=>{const y=typeof t.value;return t.value===null?"json-node__value--null":y==="boolean"?"json-node__value--boolean":y==="number"||p(t.value)?"json-node__value--number":y==="string"?"json-node__value--string":""}),J=r.computed(()=>t.value===null?"null":typeof t.value=="boolean"||typeof t.value=="number"?String(t.value):p(t.value)?w(t.value):typeof t.value=="string"?`"${t.value}"`:String(t.value)),D=r.computed(()=>"Double-click to edit"),ne=y=>t.level===0?y:$.value?`${$.value}.${y}`:y,oe=y=>{const u=Object.keys(t.value);return u.indexOf(y)===u.length-1},N=()=>{s("toggle-expand",$.value)},v=()=>{t.level!==0&&(o.value=!0,a.value=t.keyName,r.nextTick(()=>{if(c.value){c.value.focus();const y=document.createRange();y.selectNodeContents(c.value);const u=window.getSelection();u?.removeAllRanges(),u?.addRange(y)}}))},R=()=>{k.value||(l.value=!0,t.value===null?i.value="null":p(t.value)?i.value="protected-number":typeof t.value=="string"?i.value="string":typeof t.value=="number"?i.value="number":typeof t.value=="boolean"&&(i.value="boolean"),p(t.value)?d.value=w(t.value):typeof t.value=="string"?d.value=t.value:d.value=String(t.value),r.nextTick(()=>{if(g.value){g.value.focus();const y=document.createRange();y.selectNodeContents(g.value);const u=window.getSelection();u?.removeAllRanges(),u?.addRange(y)}}))},C=()=>{if(t.level===0||!o.value)return;const y=c.value?.innerText.trim()||"";if(!y){U();return}if(y===t.keyName){o.value=!1;return}o.value=!1,s("update:key",$.value,y)},O=()=>{if(l.value)try{let y;const u=g.value?.innerText.trim()||"";if(i.value==="string")u==="null"?y=null:u==="true"||u==="false"?y=u==="true":y=u;else if(i.value==="protected-number")y={__protected_number__:u};else if(u==="null")y=null;else if(u==="true"||u==="false")y=u==="true";else if(!isNaN(Number(u))&&u!==""){const m=Number(u);!Number.isSafeInteger(m)||u.length>15?y={__protected_number__:u}:y=m}else y=u;s("update:value",$.value,y),l.value=!1}catch(y){console.error("Failed to parse value:",y),l.value=!1}},U=()=>{o.value=!1,a.value=t.keyName},V=()=>{l.value=!1,p(t.value)?d.value=w(t.value):typeof t.value=="string"?d.value=t.value:d.value=String(t.value)};return(y,u)=>{const m=r.resolveComponent("JsonNode",!0);return r.openBlock(),r.createElementBlock("div",lt,[k.value?(r.openBlock(),r.createElementBlock("div",at,[r.createElementVNode("div",it,[y.keyName?(r.openBlock(),r.createElementBlock("span",{key:0,class:"json-node__key",contenteditable:o.value,onDblclick:v,onKeydown:[r.withKeys(r.withModifiers(C,["prevent"]),["enter"]),r.withKeys(U,["escape"])],onBlur:C,ref_key:"keyRef",ref:c,title:"Double-click to edit key"},r.toDisplayString(o.value?a.value:`"${M.value}"`),41,ct)):r.createCommentVNode("",!0),y.keyName?(r.openBlock(),r.createElementBlock("span",dt,": ")):r.createCommentVNode("",!0),r.createElementVNode("span",{class:"json-node__bracket json-node__bracket--clickable",onClick:N,title:B.value?"Click to collapse":"Click to expand"},r.toDisplayString(X.value),9,ut),B.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",{key:2,class:"json-node__collapsed-info",onClick:N,title:`Click to expand ${q.value.trim()}`},r.toDisplayString(q.value),9,ft)),B.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",{key:3,class:"json-node__bracket json-node__bracket--clickable",onClick:N,title:"Click to expand"},r.toDisplayString(j.value),1)),!B.value&&!y.isLast?(r.openBlock(),r.createElementBlock("span",ht,",")):r.createCommentVNode("",!0)]),B.value?(r.openBlock(),r.createElementBlock("div",pt,[r.createElementVNode("div",mt,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,(E,_)=>(r.openBlock(),r.createElementBlock("div",{key:_,class:"json-node__child"},[r.createVNode(m,{value:E,"key-name":S.value?"":String(_),level:y.level+1,path:ne(String(_)),expanded:y.expanded,theme:y.theme,"onUpdate:value":u[0]||(u[0]=(x,b)=>y.$emit("update:value",x,b)),onToggleExpand:u[1]||(u[1]=x=>y.$emit("toggle-expand",x)),onCopy:u[2]||(u[2]=x=>y.$emit("copy",x)),"onUpdate:key":u[3]||(u[3]=(x,b)=>y.$emit("update:key",x,b)),"is-last":oe(String(_))},null,8,["value","key-name","level","path","expanded","theme","is-last"])]))),128))]),r.createElementVNode("div",gt,[r.createElementVNode("span",yt,r.toDisplayString(j.value),1),y.isLast?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",bt,","))])])):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",Et,[y.keyName?(r.openBlock(),r.createElementBlock("span",{key:0,class:"json-node__key",contenteditable:o.value,onDblclick:v,onKeydown:[r.withKeys(r.withModifiers(C,["prevent"]),["enter"]),r.withKeys(U,["escape"])],onBlur:C,ref_key:"keyRef",ref:c,title:"Double-click to edit key"},r.toDisplayString(o.value?a.value:`"${M.value}"`),41,_t)):r.createCommentVNode("",!0),y.keyName?(r.openBlock(),r.createElementBlock("span",xt,": ")):r.createCommentVNode("",!0),r.createElementVNode("span",{class:r.normalizeClass(["json-node__value-wrapper",re.value]),onDblclick:R,title:D.value},[r.createElementVNode("span",{class:"json-node__value",contenteditable:l.value,onKeydown:[r.withKeys(r.withModifiers(O,["prevent"]),["enter"]),r.withKeys(V,["escape"])],onBlur:O,ref_key:"valueRef",ref:g},r.toDisplayString(l.value?d.value:J.value),41,Nt),y.isLast?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",wt,","))],42,kt)]))])}}}),Ee=(n,e)=>{const t=n.__vccOpts||n;for(const[s,o]of e)t[s]=o;return t},Ct=Ee(At,[["__scopeId","data-v-1472a8af"]]),Oe={name:"github-light",colors:{background:"#ffffff",surfaceBackground:"#f6f8fa",border:"#d0d7de",text:"#24292f",textSecondary:"#656d76",buttonBackground:"#f6f8fa",buttonBackgroundHover:"#f3f4f6",buttonBorder:"#d0d7de",buttonText:"#24292f",buttonPrimary:"#2da44e",buttonPrimaryHover:"#2c974b",success:"#1a7f37",successBackground:"#dafbe1",error:"#cf222e",errorBackground:"#ffebe9",syntaxString:"#0a3069",syntaxNumber:"#0969da",syntaxBoolean:"#8250df",syntaxNull:"#656d76",syntaxKey:"#0969da",syntaxBracket:"#24292f",hoverBackground:"#f6f8fa",selectionBackground:"rgba(9, 105, 218, 0.2)",collapsedBackground:"#ddf4ff",collapsedBackgroundHover:"#b6e3ff",collapsedText:"#0969da",indentLine:"#d0d7de"}},Bt={"github-light":Oe,"github-dark":{name:"github-dark",colors:{background:"#0d1117",surfaceBackground:"#161b22",border:"#30363d",text:"#e6edf3",textSecondary:"#7d8590",buttonBackground:"#21262d",buttonBackgroundHover:"#30363d",buttonBorder:"#30363d",buttonText:"#e6edf3",buttonPrimary:"#238636",buttonPrimaryHover:"#2ea043",success:"#3fb950",successBackground:"#0f2419",error:"#f85149",errorBackground:"#381921",syntaxString:"#a5d6ff",syntaxNumber:"#79c0ff",syntaxBoolean:"#d2a8ff",syntaxNull:"#7d8590",syntaxKey:"#79c0ff",syntaxBracket:"#e6edf3",hoverBackground:"#161b22",selectionBackground:"rgba(121, 192, 255, 0.2)",collapsedBackground:"#1c2128",collapsedBackgroundHover:"#2d333b",collapsedText:"#79c0ff",indentLine:"#30363d"}},"min-light":{name:"min-light",colors:{background:"#ffffff",surfaceBackground:"#fafafa",border:"#e5e5e5",text:"#333333",textSecondary:"#888888",buttonBackground:"#f8f8f8",buttonBackgroundHover:"#eeeeee",buttonBorder:"#e0e0e0",buttonText:"#333333",buttonPrimary:"#007acc",buttonPrimaryHover:"#005a9e",success:"#22c55e",successBackground:"#f0fdf4",error:"#ef4444",errorBackground:"#fef2f2",syntaxString:"#22c55e",syntaxNumber:"#3b82f6",syntaxBoolean:"#8b5cf6",syntaxNull:"#6b7280",syntaxKey:"#1f2937",syntaxBracket:"#374151",hoverBackground:"#f9f9f9",selectionBackground:"rgba(59, 130, 246, 0.2)",collapsedBackground:"#e0f2fe",collapsedBackgroundHover:"#bae6fd",collapsedText:"#0284c7",indentLine:"#e5e7eb"}},"slack-ochin":{name:"slack-ochin",colors:{background:"#fefbf6",surfaceBackground:"#faf6f0",border:"#e8d5b7",text:"#4a3b2a",textSecondary:"#8b7355",buttonBackground:"#f4ede4",buttonBackgroundHover:"#efe5d8",buttonBorder:"#e8d5b7",buttonText:"#4a3b2a",buttonPrimary:"#ff6b35",buttonPrimaryHover:"#e55a2b",success:"#ff9500",successBackground:"#fff8f0",error:"#d73502",errorBackground:"#ffeee8",syntaxString:"#d73502",syntaxNumber:"#ff6b35",syntaxBoolean:"#b7472a",syntaxNull:"#8b7355",syntaxKey:"#4a3b2a",syntaxBracket:"#6b5444",hoverBackground:"#f8f2eb",selectionBackground:"rgba(255, 107, 53, 0.2)",collapsedBackground:"#ffe8d6",collapsedBackgroundHover:"#ffd4b0",collapsedText:"#d73502",indentLine:"#e8d5b7"}}};function Tt(n="github-light"){return Bt[n]||Oe}const vt={key:0,class:"json-format__toolbar"},Ot={class:"json-format__actions"},St=["disabled"],$t=["disabled"],Pt=["disabled"],Vt=["disabled"],It={class:"json-format__info"},Rt={key:0,class:"json-format__status json-format__status--success"},Lt={key:1,class:"json-format__status json-format__status--error"},Mt={class:"json-format__content"},jt={key:0,class:"json-format__error"},Kt={key:1,class:"json-format__error"},Ut={key:2,class:"json-format__viewer"},Se=Ee(r.defineComponent({name:"JsonFormat",__name:"index",props:{modelValue:{default:""},readonly:{type:Boolean,default:!1},maxDepth:{default:10},showToolbar:{type:Boolean,default:!0},theme:{default:"github-light"}},emits:["update:modelValue","copy-success","copy-error","expand-all","collapse-all","compress"],setup(n,{expose:e,emit:t}){r.useCssVars(u=>({"820119d0":p.value.colors.border,"7d4c03cc":p.value.colors.background,ec17e1ce:p.value.colors.text,"3b9ec162":p.value.colors.surfaceBackground,"024cf7ea":p.value.colors.buttonBorder,"34566c28":p.value.colors.buttonBackground,"2620a06b":p.value.colors.buttonText,"33a362b0":p.value.colors.buttonBackgroundHover,"308d0204":p.value.colors.buttonPrimary,d77b0cd0:p.value.colors.buttonPrimaryHover,"52643f25":p.value.colors.successBackground,a4bbc2d2:p.value.colors.success,ea95b82c:p.value.colors.errorBackground,"987f74c8":p.value.colors.error}));const s=n,o=t,l=r.ref(null),a=r.ref(""),d=r.ref(new Set),i=r.ref(null),c=r.ref(""),g=r.computed(()=>a.value===""),p=r.computed(()=>Tt(s.theme)),w=r.computed(()=>c.value?null:i.value!==null?i.value:l.value),k=u=>{if(!u.trim()){l.value=null,a.value="",i.value=null,c.value="";return}try{let m=u;const E=/(:\s*|,\s*|\[\s*)-?\d{16,}/.test(m),_=/(:\s*|,\s*|\[\s*)-?\d+\.\d*0+\s*[,}\]\s]*/.test(m);if(!E&&!_)try{l.value=JSON.parse(m),a.value="",i.value=null,c.value="",r.nextTick(()=>{w.value!==null&&D()});return}catch{}m=(b=>{let T="",I=!1,F=!1,W=0;for(;W<b.length;){const ee=b[W];if(I)F?F=!1:ee==="\\"?F=!0:ee==='"'&&(I=!1),T+=ee,W++;else if(ee==='"')I=!0,T+=ee,W++;else{const se=b.slice(W);let te=se.match(/^([:,\[\s]*)(-?\d{16,})(\s*[,\}\]\s]|$)/);if(te){T+=te[1]+'{"__protected_number__":"'+te[2]+'"}'+te[3],W+=te[0].length;continue}if(te=se.match(/^([:,\[\s]*)(-?\d+\.\d*0+)(\s*[,\}\]\s]|$)/),te){T+=te[1]+'{"__protected_number__":"'+te[2]+'"}'+te[3],W+=te[0].length;continue}T+=ee,W++}}return T})(m),l.value=JSON.parse(m),a.value="",i.value=null,c.value="",r.nextTick(()=>{w.value!==null&&D()})}catch(m){a.value=m instanceof Error?m.message:"Unknown parsing error",l.value=null,i.value=null,c.value=""}},S=u=>{if(!u||!u.expression.trim()){X();return}if(!l.value){c.value="No valid JSON data to filter";return}try{let m;if(u.type==="jsonpath")m=K({path:u.expression,json:l.value}),m.length===1&&u.expression.includes("$[")===!1&&!u.expression.endsWith("[*]")?i.value=m[0]:i.value=m;else if(u.type==="js"){const{proxyData:E,indexMap:_}=$(l.value),b=new Function("$",`
|
|
1
|
+
(function(Ye,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(Ye=typeof globalThis<"u"?globalThis:Ye||self,s(Ye.LoneFormat={},Ye.Vue))})(this,function(Ye,s){"use strict";class rr{add(t,r,u){if(typeof arguments[0]!="string")for(let i in arguments[0])this.add(i,arguments[0][i],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(i){this[i]=this[i]||[],r&&this[i][u?"unshift":"push"](r)},this)}run(t,r){this[t]=this[t]||[],this[t].forEach(function(u){u.call(r&&r.context?r.context:r,r)})}}class nr{constructor(t){this.jsep=t,this.registered={}}register(){for(var t=arguments.length,r=new Array(t),u=0;u<t;u++)r[u]=arguments[u];r.forEach(i=>{if(typeof i!="object"||!i.name||!i.init)throw new Error("Invalid JSEP plugin format");this.registered[i.name]||(i.init(this.jsep),this.registered[i.name]=i)})}}class O{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+O.version}static addUnaryOp(t){return O.max_unop_len=Math.max(t.length,O.max_unop_len),O.unary_ops[t]=1,O}static addBinaryOp(t,r,u){return O.max_binop_len=Math.max(t.length,O.max_binop_len),O.binary_ops[t]=r,u?O.right_associative.add(t):O.right_associative.delete(t),O}static addIdentifierChar(t){return O.additional_identifier_chars.add(t),O}static addLiteral(t,r){return O.literals[t]=r,O}static removeUnaryOp(t){return delete O.unary_ops[t],t.length===O.max_unop_len&&(O.max_unop_len=O.getMaxKeyLen(O.unary_ops)),O}static removeAllUnaryOps(){return O.unary_ops={},O.max_unop_len=0,O}static removeIdentifierChar(t){return O.additional_identifier_chars.delete(t),O}static removeBinaryOp(t){return delete O.binary_ops[t],t.length===O.max_binop_len&&(O.max_binop_len=O.getMaxKeyLen(O.binary_ops)),O.right_associative.delete(t),O}static removeAllBinaryOps(){return O.binary_ops={},O.max_binop_len=0,O}static removeLiteral(t){return delete O.literals[t],O}static removeAllLiterals(){return O.literals={},O}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new O(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(r=>r.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return O.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!O.binary_ops[String.fromCharCode(t)]||O.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return O.isIdentifierStart(t)||O.isDecimalDigit(t)}throwError(t){const r=new Error(t+" at character "+this.index);throw r.index=this.index,r.description=t,r}runHook(t,r){if(O.hooks[t]){const u={context:this,node:r};return O.hooks.run(t,u),u.node}return r}searchHook(t){if(O.hooks[t]){const r={context:this};return O.hooks[t].find(function(u){return u.call(r.context,r),r.node}),r.node}}gobbleSpaces(){let t=this.code;for(;t===O.SPACE_CODE||t===O.TAB_CODE||t===O.LF_CODE||t===O.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const t=this.gobbleExpressions(),r=t.length===1?t[0]:{type:O.COMPOUND,body:t};return this.runHook("after-all",r)}gobbleExpressions(t){let r=[],u,i;for(;this.index<this.expr.length;)if(u=this.code,u===O.SEMCOL_CODE||u===O.COMMA_CODE)this.index++;else if(i=this.gobbleExpression())r.push(i);else if(this.index<this.expr.length){if(u===t)break;this.throwError('Unexpected "'+this.char+'"')}return r}gobbleExpression(){const t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,O.max_binop_len),r=t.length;for(;r>0;){if(O.binary_ops.hasOwnProperty(t)&&(!O.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!O.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=r,t;t=t.substr(0,--r)}return!1}gobbleBinaryExpression(){let t,r,u,i,l,p,N,h,m;if(p=this.gobbleToken(),!p||(r=this.gobbleBinaryOp(),!r))return p;for(l={value:r,prec:O.binaryPrecedence(r),right_a:O.right_associative.has(r)},N=this.gobbleToken(),N||this.throwError("Expected expression after "+r),i=[p,l,N];r=this.gobbleBinaryOp();){if(u=O.binaryPrecedence(r),u===0){this.index-=r.length;break}l={value:r,prec:u,right_a:O.right_associative.has(r)},m=r;const B=T=>l.right_a&&T.right_a?u>T.prec:u<=T.prec;for(;i.length>2&&B(i[i.length-2]);)N=i.pop(),r=i.pop().value,p=i.pop(),t={type:O.BINARY_EXP,operator:r,left:p,right:N},i.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+m),i.push(l,t)}for(h=i.length-1,t=i[h];h>1;)t={type:O.BINARY_EXP,operator:i[h-1].value,left:i[h-2],right:t},h-=2;return t}gobbleToken(){let t,r,u,i;if(this.gobbleSpaces(),i=this.searchHook("gobble-token"),i)return this.runHook("after-token",i);if(t=this.code,O.isDecimalDigit(t)||t===O.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===O.SQUOTE_CODE||t===O.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(t===O.OBRACK_CODE)i=this.gobbleArray();else{for(r=this.expr.substr(this.index,O.max_unop_len),u=r.length;u>0;){if(O.unary_ops.hasOwnProperty(r)&&(!O.isIdentifierStart(this.code)||this.index+r.length<this.expr.length&&!O.isIdentifierPart(this.expr.charCodeAt(this.index+r.length)))){this.index+=u;const l=this.gobbleToken();return l||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:O.UNARY_EXP,operator:r,argument:l,prefix:!0})}r=r.substr(0,--u)}O.isIdentifierStart(t)?(i=this.gobbleIdentifier(),O.literals.hasOwnProperty(i.name)?i={type:O.LITERAL,value:O.literals[i.name],raw:i.name}:i.name===O.this_str&&(i={type:O.THIS_EXP})):t===O.OPAREN_CODE&&(i=this.gobbleGroup())}return i?(i=this.gobbleTokenProperty(i),this.runHook("after-token",i)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let r=this.code;for(;r===O.PERIOD_CODE||r===O.OBRACK_CODE||r===O.OPAREN_CODE||r===O.QUMARK_CODE;){let u;if(r===O.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==O.PERIOD_CODE)break;u=!0,this.index+=2,this.gobbleSpaces(),r=this.code}this.index++,r===O.OBRACK_CODE?(t={type:O.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),r=this.code,r!==O.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):r===O.OPAREN_CODE?t={type:O.CALL_EXP,arguments:this.gobbleArguments(O.CPAREN_CODE),callee:t}:(r===O.PERIOD_CODE||u)&&(u&&this.index--,this.gobbleSpaces(),t={type:O.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),u&&(t.optional=!0),this.gobbleSpaces(),r=this.code}return t}gobbleNumericLiteral(){let t="",r,u;for(;O.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===O.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);O.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(r=this.char,r==="e"||r==="E"){for(t+=this.expr.charAt(this.index++),r=this.char,(r==="+"||r==="-")&&(t+=this.expr.charAt(this.index++));O.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);O.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return u=this.code,O.isIdentifierStart(u)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(u===O.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===O.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:O.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="";const r=this.index,u=this.expr.charAt(this.index++);let i=!1;for(;this.index<this.expr.length;){let l=this.expr.charAt(this.index++);if(l===u){i=!0;break}else if(l==="\\")switch(l=this.expr.charAt(this.index++),l){case"n":t+=`
|
|
2
|
+
`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=l}else t+=l}return i||this.throwError('Unclosed quote after "'+t+'"'),{type:O.LITERAL,value:t,raw:this.expr.substring(r,this.index)}}gobbleIdentifier(){let t=this.code,r=this.index;for(O.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,O.isIdentifierPart(t));)this.index++;return{type:O.IDENTIFIER,name:this.expr.slice(r,this.index)}}gobbleArguments(t){const r=[];let u=!1,i=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let l=this.code;if(l===t){u=!0,this.index++,t===O.CPAREN_CODE&&i&&i>=r.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(l===O.COMMA_CODE){if(this.index++,i++,i!==r.length){if(t===O.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===O.CBRACK_CODE)for(let p=r.length;p<i;p++)r.push(null)}}else if(r.length!==i&&i!==0)this.throwError("Expected comma");else{const p=this.gobbleExpression();(!p||p.type===O.COMPOUND)&&this.throwError("Expected comma"),r.push(p)}}return u||this.throwError("Expected "+String.fromCharCode(t)),r}gobbleGroup(){this.index++;let t=this.gobbleExpressions(O.CPAREN_CODE);if(this.code===O.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:O.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:O.ARRAY_EXP,elements:this.gobbleArguments(O.CBRACK_CODE)}}}const or=new rr;Object.assign(O,{hooks:or,plugins:new nr(O),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),O.max_unop_len=O.getMaxKeyLen(O.unary_ops),O.max_binop_len=O.getMaxKeyLen(O.binary_ops);const We=n=>new O(n).parse(),sr=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(O).filter(n=>!sr.includes(n)&&We[n]===void 0).forEach(n=>{We[n]=O[n]}),We.Jsep=O;const ir="ConditionalExpression";var ur={name:"ternary",init(n){n.hooks.add("after-expression",function(r){if(r.node&&this.code===n.QUMARK_CODE){this.index++;const u=r.node,i=this.gobbleExpression();if(i||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===n.COLON_CODE){this.index++;const l=this.gobbleExpression();if(l||this.throwError("Expected expression"),r.node={type:ir,test:u,consequent:i,alternate:l},u.operator&&n.binary_ops[u.operator]<=.9){let p=u;for(;p.right.operator&&n.binary_ops[p.right.operator]<=.9;)p=p.right;r.node.test=p.right,p.right=r.node,r.node=u}}else this.throwError("Expected :")}})}};We.plugins.register(ur);const Ot=47,ar=92;var lr={name:"regex",init(n){n.hooks.add("gobble-token",function(r){if(this.code===Ot){const u=++this.index;let i=!1;for(;this.index<this.expr.length;){if(this.code===Ot&&!i){const l=this.expr.slice(u,this.index);let p="";for(;++this.index<this.expr.length;){const h=this.code;if(h>=97&&h<=122||h>=65&&h<=90||h>=48&&h<=57)p+=this.char;else break}let N;try{N=new RegExp(l,p)}catch(h){this.throwError(h.message)}return r.node={type:n.LITERAL,value:N,raw:this.expr.slice(u-1,this.index)},r.node=this.gobbleTokenProperty(r.node),r.node}this.code===n.OBRACK_CODE?i=!0:i&&this.code===n.CBRACK_CODE&&(i=!1),this.index+=this.code===ar?2:1}this.throwError("Unclosed Regex")}})}};const Nt=43,ct={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[Nt,45],assignmentPrecedence:.9,init(n){const t=[n.IDENTIFIER,n.MEMBER_EXP];ct.assignmentOperators.forEach(u=>n.addBinaryOp(u,ct.assignmentPrecedence,!0)),n.hooks.add("gobble-token",function(i){const l=this.code;ct.updateOperators.some(p=>p===l&&p===this.expr.charCodeAt(this.index+1))&&(this.index+=2,i.node={type:"UpdateExpression",operator:l===Nt?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},(!i.node.argument||!t.includes(i.node.argument.type))&&this.throwError(`Unexpected ${i.node.operator}`))}),n.hooks.add("after-token",function(i){if(i.node){const l=this.code;ct.updateOperators.some(p=>p===l&&p===this.expr.charCodeAt(this.index+1))&&(t.includes(i.node.type)||this.throwError(`Unexpected ${i.node.operator}`),this.index+=2,i.node={type:"UpdateExpression",operator:l===Nt?"++":"--",argument:i.node,prefix:!1})}}),n.hooks.add("after-expression",function(i){i.node&&r(i.node)});function r(u){ct.assignmentOperators.has(u.operator)?(u.type="AssignmentExpression",r(u.left),r(u.right)):u.operator||Object.values(u).forEach(i=>{i&&typeof i=="object"&&r(i)})}}};We.plugins.register(lr,ct),We.addUnaryOp("typeof"),We.addLiteral("null",null),We.addLiteral("undefined",void 0);const cr=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__"]),Be={evalAst(n,t){switch(n.type){case"BinaryExpression":case"LogicalExpression":return Be.evalBinaryExpression(n,t);case"Compound":return Be.evalCompound(n,t);case"ConditionalExpression":return Be.evalConditionalExpression(n,t);case"Identifier":return Be.evalIdentifier(n,t);case"Literal":return Be.evalLiteral(n,t);case"MemberExpression":return Be.evalMemberExpression(n,t);case"UnaryExpression":return Be.evalUnaryExpression(n,t);case"ArrayExpression":return Be.evalArrayExpression(n,t);case"CallExpression":return Be.evalCallExpression(n,t);case"AssignmentExpression":return Be.evalAssignmentExpression(n,t);default:throw SyntaxError("Unexpected expression",n)}},evalBinaryExpression(n,t){return{"||":(u,i)=>u||i(),"&&":(u,i)=>u&&i(),"|":(u,i)=>u|i(),"^":(u,i)=>u^i(),"&":(u,i)=>u&i(),"==":(u,i)=>u==i(),"!=":(u,i)=>u!=i(),"===":(u,i)=>u===i(),"!==":(u,i)=>u!==i(),"<":(u,i)=>u<i(),">":(u,i)=>u>i(),"<=":(u,i)=>u<=i(),">=":(u,i)=>u>=i(),"<<":(u,i)=>u<<i(),">>":(u,i)=>u>>i(),">>>":(u,i)=>u>>>i(),"+":(u,i)=>u+i(),"-":(u,i)=>u-i(),"*":(u,i)=>u*i(),"/":(u,i)=>u/i(),"%":(u,i)=>u%i()}[n.operator](Be.evalAst(n.left,t),()=>Be.evalAst(n.right,t))},evalCompound(n,t){let r;for(let u=0;u<n.body.length;u++){n.body[u].type==="Identifier"&&["var","let","const"].includes(n.body[u].name)&&n.body[u+1]&&n.body[u+1].type==="AssignmentExpression"&&(u+=1);const i=n.body[u];r=Be.evalAst(i,t)}return r},evalConditionalExpression(n,t){return Be.evalAst(n.test,t)?Be.evalAst(n.consequent,t):Be.evalAst(n.alternate,t)},evalIdentifier(n,t){if(Object.hasOwn(t,n.name))return t[n.name];throw ReferenceError(`${n.name} is not defined`)},evalLiteral(n){return n.value},evalMemberExpression(n,t){const r=String(n.computed?Be.evalAst(n.property):n.property.name),u=Be.evalAst(n.object,t);if(u==null)throw TypeError(`Cannot read properties of ${u} (reading '${r}')`);if(!Object.hasOwn(u,r)&&cr.has(r))throw TypeError(`Cannot read properties of ${u} (reading '${r}')`);const i=u[r];return typeof i=="function"?i.bind(u):i},evalUnaryExpression(n,t){return{"-":u=>-Be.evalAst(u,t),"!":u=>!Be.evalAst(u,t),"~":u=>~Be.evalAst(u,t),"+":u=>+Be.evalAst(u,t),typeof:u=>typeof Be.evalAst(u,t)}[n.operator](n.argument)},evalArrayExpression(n,t){return n.elements.map(r=>Be.evalAst(r,t))},evalCallExpression(n,t){const r=n.arguments.map(i=>Be.evalAst(i,t));return Be.evalAst(n.callee,t)(...r)},evalAssignmentExpression(n,t){if(n.left.type!=="Identifier")throw SyntaxError("Invalid left-hand side in assignment");const r=n.left.name,u=Be.evalAst(n.right,t);return t[r]=u,t[r]}};class fr{constructor(t){this.code=t,this.ast=We(this.code)}runInNewContext(t){const r=Object.assign(Object.create(null),t);return Be.evalAst(this.ast,r)}}function et(n,t){return n=n.slice(),n.push(t),n}function Dt(n,t){return t=t.slice(),t.unshift(n),t}class pr extends Error{constructor(t){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=t,this.name="NewError"}}function we(n,t,r,u,i){if(!(this instanceof we))try{return new we(n,t,r,u,i)}catch(p){if(!p.avoidNew)throw p;return p.value}typeof n=="string"&&(i=u,u=r,r=t,t=n,n=null);const l=n&&typeof n=="object";if(n=n||{},this.json=n.json||r,this.path=n.path||t,this.resultType=n.resultType||"value",this.flatten=n.flatten||!1,this.wrap=Object.hasOwn(n,"wrap")?n.wrap:!0,this.sandbox=n.sandbox||{},this.eval=n.eval===void 0?"safe":n.eval,this.ignoreEvalErrors=typeof n.ignoreEvalErrors>"u"?!1:n.ignoreEvalErrors,this.parent=n.parent||null,this.parentProperty=n.parentProperty||null,this.callback=n.callback||u||null,this.otherTypeCallback=n.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},n.autostart!==!1){const p={path:l?n.path:t};l?"json"in n&&(p.json=n.json):p.json=r;const N=this.evaluate(p);if(!N||typeof N!="object")throw new pr(N);return N}}we.prototype.evaluate=function(n,t,r,u){let i=this.parent,l=this.parentProperty,{flatten:p,wrap:N}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=u||this.otherTypeCallback,t=t||this.json,n=n||this.path,n&&typeof n=="object"&&!Array.isArray(n)){if(!n.path&&n.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(n,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=n),p=Object.hasOwn(n,"flatten")?n.flatten:p,this.currResultType=Object.hasOwn(n,"resultType")?n.resultType:this.currResultType,this.currSandbox=Object.hasOwn(n,"sandbox")?n.sandbox:this.currSandbox,N=Object.hasOwn(n,"wrap")?n.wrap:N,this.currEval=Object.hasOwn(n,"eval")?n.eval:this.currEval,r=Object.hasOwn(n,"callback")?n.callback:r,this.currOtherTypeCallback=Object.hasOwn(n,"otherTypeCallback")?n.otherTypeCallback:this.currOtherTypeCallback,i=Object.hasOwn(n,"parent")?n.parent:i,l=Object.hasOwn(n,"parentProperty")?n.parentProperty:l,n=n.path}if(i=i||null,l=l||null,Array.isArray(n)&&(n=we.toPathString(n)),!n&&n!==""||!t)return;const h=we.toPathArray(n);h[0]==="$"&&h.length>1&&h.shift(),this._hasParentSelector=null;const m=this._trace(h,t,["$"],i,l,r).filter(function(B){return B&&!B.isParentSelector});return m.length?!N&&m.length===1&&!m[0].hasArrExpr?this._getPreferredOutput(m[0]):m.reduce((B,T)=>{const U=this._getPreferredOutput(T);return p&&Array.isArray(U)?B=B.concat(U):B.push(U),B},[]):N?[]:void 0},we.prototype._getPreferredOutput=function(n){const t=this.currResultType;switch(t){case"all":{const r=Array.isArray(n.path)?n.path:we.toPathArray(n.path);return n.pointer=we.toPointer(r),n.path=typeof n.path=="string"?n.path:we.toPathString(n.path),n}case"value":case"parent":case"parentProperty":return n[t];case"path":return we.toPathString(n[t]);case"pointer":return we.toPointer(n.path);default:throw new TypeError("Unknown result type")}},we.prototype._handleCallback=function(n,t,r){if(t){const u=this._getPreferredOutput(n);n.path=typeof n.path=="string"?n.path:we.toPathString(n.path),t(u,r,n)}},we.prototype._trace=function(n,t,r,u,i,l,p,N){let h;if(!n.length)return h={path:r,value:t,parent:u,parentProperty:i,hasArrExpr:p},this._handleCallback(h,l,"value"),h;const m=n[0],B=n.slice(1),T=[];function U(V){Array.isArray(V)?V.forEach(ae=>{T.push(ae)}):T.push(V)}if((typeof m!="string"||N)&&t&&Object.hasOwn(t,m))U(this._trace(B,t[m],et(r,m),t,m,l,p));else if(m==="*")this._walk(t,V=>{U(this._trace(B,t[V],et(r,V),t,V,l,!0,!0))});else if(m==="..")U(this._trace(B,t,r,u,i,l,p)),this._walk(t,V=>{typeof t[V]=="object"&&U(this._trace(n.slice(),t[V],et(r,V),t,V,l,!0))});else{if(m==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:B,isParentSelector:!0};if(m==="~")return h={path:et(r,m),value:i,parent:u,parentProperty:null},this._handleCallback(h,l,"property"),h;if(m==="$")U(this._trace(B,t,r,null,null,l,p));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(m))U(this._slice(m,B,t,r,u,i,l));else if(m.indexOf("?(")===0){if(this.currEval===!1)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const V=m.replace(/^\?\((.*?)\)$/u,"$1"),ae=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(V);ae?this._walk(t,le=>{const _=[ae[2]],oe=ae[1]?t[le][ae[1]]:t[le];this._trace(_,oe,r,u,i,l,!0).length>0&&U(this._trace(B,t[le],et(r,le),t,le,l,!0))}):this._walk(t,le=>{this._eval(V,t[le],le,r,u,i)&&U(this._trace(B,t[le],et(r,le),t,le,l,!0))})}else if(m[0]==="("){if(this.currEval===!1)throw new Error("Eval [(expr)] prevented in JSONPath expression.");U(this._trace(Dt(this._eval(m,t,r.at(-1),r.slice(0,-1),u,i),B),t,r,u,i,l,p))}else if(m[0]==="@"){let V=!1;const ae=m.slice(1,-2);switch(ae){case"scalar":(!t||!["object","function"].includes(typeof t))&&(V=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===ae&&(V=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(V=!0);break;case"number":Number.isFinite(t)&&(V=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(V=!0);break;case"object":t&&typeof t===ae&&(V=!0);break;case"array":Array.isArray(t)&&(V=!0);break;case"other":V=this.currOtherTypeCallback(t,r,u,i);break;case"null":t===null&&(V=!0);break;default:throw new TypeError("Unknown value type "+ae)}if(V)return h={path:r,value:t,parent:u,parentProperty:i},this._handleCallback(h,l,"value"),h}else if(m[0]==="`"&&t&&Object.hasOwn(t,m.slice(1))){const V=m.slice(1);U(this._trace(B,t[V],et(r,V),t,V,l,p,!0))}else if(m.includes(",")){const V=m.split(",");for(const ae of V)U(this._trace(Dt(ae,B),t,r,u,i,l,!0))}else!N&&t&&Object.hasOwn(t,m)&&U(this._trace(B,t[m],et(r,m),t,m,l,p,!0))}if(this._hasParentSelector)for(let V=0;V<T.length;V++){const ae=T[V];if(ae&&ae.isParentSelector){const le=this._trace(ae.expr,t,ae.path,u,i,l,p);if(Array.isArray(le)){T[V]=le[0];const _=le.length;for(let oe=1;oe<_;oe++)V++,T.splice(V,0,le[oe])}else T[V]=le}}return T},we.prototype._walk=function(n,t){if(Array.isArray(n)){const r=n.length;for(let u=0;u<r;u++)t(u)}else n&&typeof n=="object"&&Object.keys(n).forEach(r=>{t(r)})},we.prototype._slice=function(n,t,r,u,i,l,p){if(!Array.isArray(r))return;const N=r.length,h=n.split(":"),m=h[2]&&Number.parseInt(h[2])||1;let B=h[0]&&Number.parseInt(h[0])||0,T=h[1]&&Number.parseInt(h[1])||N;B=B<0?Math.max(0,B+N):Math.min(N,B),T=T<0?Math.max(0,T+N):Math.min(N,T);const U=[];for(let V=B;V<T;V+=m)this._trace(Dt(V,t),r,u,i,l,p,!0).forEach(le=>{U.push(le)});return U},we.prototype._eval=function(n,t,r,u,i,l){this.currSandbox._$_parentProperty=l,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;const p=n.includes("@path");p&&(this.currSandbox._$_path=we.toPathString(u.concat([r])));const N=this.currEval+"Script:"+n;if(!we.cache[N]){let h=n.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(p&&(h=h.replaceAll("@path","_$_path")),this.currEval==="safe"||this.currEval===!0||this.currEval===void 0)we.cache[N]=new this.safeVm.Script(h);else if(this.currEval==="native")we.cache[N]=new this.vm.Script(h);else if(typeof this.currEval=="function"&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const m=this.currEval;we.cache[N]=new m(h)}else if(typeof this.currEval=="function")we.cache[N]={runInNewContext:m=>this.currEval(h,m)};else throw new TypeError(`Unknown "eval" property "${this.currEval}"`)}try{return we.cache[N].runInNewContext(this.currSandbox)}catch(h){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+h.message+": "+n)}},we.cache={},we.toPathString=function(n){const t=n,r=t.length;let u="$";for(let i=1;i<r;i++)/^(~|\^|@.*?\(\))$/u.test(t[i])||(u+=/^[0-9*]+$/u.test(t[i])?"["+t[i]+"]":"['"+t[i]+"']");return u},we.toPointer=function(n){const t=n,r=t.length;let u="";for(let i=1;i<r;i++)/^(~|\^|@.*?\(\))$/u.test(t[i])||(u+="/"+t[i].toString().replaceAll("~","~0").replaceAll("/","~1"));return u},we.toPathArray=function(n){const{cache:t}=we;if(t[n])return t[n].concat();const r=[],i=n.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(l,p){return"[#"+(r.push(p)-1)+"]"}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function(l,p){return"['"+p.replaceAll(".","%@%").replaceAll("~","%%@@%%")+"']"}).replaceAll("~",";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replaceAll("%@%",".").replaceAll("%%@@%%","~").replaceAll(/(?:;)?(\^+)(?:;)?/gu,function(l,p){return";"+p.split("").join(";")+";"}).replaceAll(/;;;|;;/gu,";..;").replaceAll(/;$|'?\]|'$/gu,"").split(";").map(function(l){const p=l.match(/#(\d+)/u);return!p||!p[1]?l:r[p[1]]});return t[n]=i,t[n].concat()},we.prototype.safeVm={Script:fr};const dr=function(n,t,r){const u=n.length;for(let i=0;i<u;i++){const l=n[i];r(l)&&t.push(n.splice(i--,1)[0])}};class hr{constructor(t){this.code=t}runInNewContext(t){let r=this.code;const u=Object.keys(t),i=[];dr(u,i,m=>typeof t[m]=="function");const l=u.map(m=>t[m]);r=i.reduce((m,B)=>{let T=t[B].toString();return/function/u.test(T)||(T="function "+T),"var "+B+"="+T+";"+m},"")+r,!/(['"])use strict\1/u.test(r)&&!u.includes("arguments")&&(r="var arguments = undefined;"+r),r=r.replace(/;\s*$/u,"");const N=r.lastIndexOf(";"),h=N!==-1?r.slice(0,N+1)+" return "+r.slice(N+1):" return "+r;return new Function(...u,h)(...l)}}we.prototype.vm={Script:hr};const mr={class:"json-node"},gr={key:0,class:"json-node__container"},Er={class:"json-node__line"},yr=["contenteditable","onKeydown"],Ar={key:1,class:"json-node__colon"},br=["title"],xr=["title"],Nr={key:4,class:"json-node__comma"},Dr={key:0,class:"json-node__children"},vr={class:"json-node__children-content"},Cr={class:"json-node__line json-node__closing-bracket"},wr={class:"json-node__bracket"},Tr={key:0,class:"json-node__comma"},_r={key:1,class:"json-node__primitive"},Br=["contenteditable","onKeydown"],Sr={key:1,class:"json-node__colon"},Or=["title"],kr=["contenteditable","onKeydown"],Rr={key:0,class:"json-node__comma"},Fr=s.defineComponent({name:"JsonNode",__name:"JsonNode",props:{value:{},keyName:{},level:{},path:{default:""},expanded:{},isLast:{type:Boolean,default:!1},theme:{}},emits:["update:value","toggle-expand","copy","update:key"],setup(n,{emit:t}){s.useCssVars(x=>({"2a18b018":x.level,"58a14b93":x.theme.colors.syntaxKey,"46fe1b3e":x.theme.colors.hoverBackground,fbe2c048:x.theme.colors.syntaxBracket,"4bd524bb":x.theme.colors.collapsedText,"3308d23c":x.theme.colors.collapsedBackground,"36380c60":x.theme.colors.collapsedBackgroundHover,"0892365d":x.theme.colors.syntaxString,"0015b195":x.theme.colors.syntaxNumber,"7db95f5c":x.theme.colors.syntaxBoolean,"88ec825a":x.theme.colors.syntaxNull,"537157f7":x.theme.colors.background,"3cee3331":x.theme.colors.selectionBackground,"81323cee":x.theme.colors.indentLine}));const r=n,u=t,i=s.ref(!1),l=s.ref(!1),p=s.ref(""),N=s.ref(""),h=s.ref("string"),m=s.ref(null),B=s.ref(null),T=x=>x!==null&&typeof x=="object"&&!Array.isArray(x)&&"__protected_number__"in x&&Object.keys(x).length===1,U=x=>T(x)?x.__protected_number__:"",V=s.computed(()=>T(r.value)?!1:r.value!==null&&typeof r.value=="object"),ae=s.computed(()=>Array.isArray(r.value)),le=s.computed(()=>r.path?r.path:r.keyName?r.keyName:"root"),_=s.computed(()=>r.expanded.has(le.value)),oe=s.computed(()=>r.keyName),ge=s.computed(()=>ae.value?"[":"{"),re=s.computed(()=>ae.value?"]":"}"),De=s.computed(()=>{if(!r.value)return"";const S=Object.keys(r.value).length;return ae.value?S>0?` ${S} items `:" ":S>0?` ${S} keys `:" "}),Ae=s.computed(()=>{const x=typeof r.value;return r.value===null?"json-node__value--null":x==="boolean"?"json-node__value--boolean":x==="number"||T(r.value)?"json-node__value--number":x==="string"?"json-node__value--string":""}),H=s.computed(()=>r.value===null?"null":typeof r.value=="boolean"||typeof r.value=="number"?String(r.value):T(r.value)?U(r.value):typeof r.value=="string"?`"${r.value}"`:String(r.value)),A=s.computed(()=>"Double-click to edit"),de=x=>r.level===0?x:le.value?`${le.value}.${x}`:x,k=x=>{const S=Object.keys(r.value);return S.indexOf(x)===S.length-1},I=()=>{u("toggle-expand",le.value)},ee=()=>{r.level!==0&&(i.value=!0,p.value=r.keyName,s.nextTick(()=>{if(m.value){m.value.focus();const x=document.createRange();x.selectNodeContents(m.value);const S=window.getSelection();S?.removeAllRanges(),S?.addRange(x)}}))},K=()=>{V.value||(l.value=!0,r.value===null?h.value="null":T(r.value)?h.value="protected-number":typeof r.value=="string"?h.value="string":typeof r.value=="number"?h.value="number":typeof r.value=="boolean"&&(h.value="boolean"),T(r.value)?N.value=U(r.value):typeof r.value=="string"?N.value=r.value:N.value=String(r.value),s.nextTick(()=>{if(B.value){B.value.focus();const x=document.createRange();x.selectNodeContents(B.value);const S=window.getSelection();S?.removeAllRanges(),S?.addRange(x)}}))},q=()=>{if(r.level===0||!i.value)return;const x=m.value?.innerText.trim()||"";if(!x){he();return}if(x===r.keyName){i.value=!1;return}i.value=!1,u("update:key",le.value,x)},pe=()=>{if(l.value)try{let x;const S=B.value?.innerText.trim()||"";if(h.value==="string")S==="null"?x=null:S==="true"||S==="false"?x=S==="true":x=S;else if(h.value==="protected-number")x={__protected_number__:S};else if(S==="null")x=null;else if(S==="true"||S==="false")x=S==="true";else if(!isNaN(Number(S))&&S!==""){const R=Number(S);!Number.isSafeInteger(R)||S.length>15?x={__protected_number__:S}:x=R}else x=S;u("update:value",le.value,x),l.value=!1}catch(x){console.error("Failed to parse value:",x),l.value=!1}},he=()=>{i.value=!1,p.value=r.keyName},F=()=>{l.value=!1,T(r.value)?N.value=U(r.value):typeof r.value=="string"?N.value=r.value:N.value=String(r.value)};return(x,S)=>{const R=s.resolveComponent("JsonNode",!0);return s.openBlock(),s.createElementBlock("div",mr,[V.value?(s.openBlock(),s.createElementBlock("div",gr,[s.createElementVNode("div",Er,[x.keyName?(s.openBlock(),s.createElementBlock("span",{key:0,class:"json-node__key",contenteditable:i.value,onDblclick:ee,onKeydown:[s.withKeys(s.withModifiers(q,["prevent"]),["enter"]),s.withKeys(he,["escape"])],onBlur:q,ref_key:"keyRef",ref:m,title:"Double-click to edit key"},s.toDisplayString(i.value?p.value:`"${oe.value}"`),41,yr)):s.createCommentVNode("",!0),x.keyName?(s.openBlock(),s.createElementBlock("span",Ar,": ")):s.createCommentVNode("",!0),s.createElementVNode("span",{class:"json-node__bracket json-node__bracket--clickable",onClick:I,title:_.value?"Click to collapse":"Click to expand"},s.toDisplayString(ge.value),9,br),_.value?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("span",{key:2,class:"json-node__collapsed-info",onClick:I,title:`Click to expand ${De.value.trim()}`},s.toDisplayString(De.value),9,xr)),_.value?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("span",{key:3,class:"json-node__bracket json-node__bracket--clickable",onClick:I,title:"Click to expand"},s.toDisplayString(re.value),1)),!_.value&&!x.isLast?(s.openBlock(),s.createElementBlock("span",Nr,",")):s.createCommentVNode("",!0)]),_.value?(s.openBlock(),s.createElementBlock("div",Dr,[s.createElementVNode("div",vr,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(x.value,(j,M)=>(s.openBlock(),s.createElementBlock("div",{key:M,class:"json-node__child"},[s.createVNode(R,{value:j,"key-name":ae.value?"":String(M),level:x.level+1,path:de(String(M)),expanded:x.expanded,theme:x.theme,"onUpdate:value":S[0]||(S[0]=(J,D)=>x.$emit("update:value",J,D)),onToggleExpand:S[1]||(S[1]=J=>x.$emit("toggle-expand",J)),onCopy:S[2]||(S[2]=J=>x.$emit("copy",J)),"onUpdate:key":S[3]||(S[3]=(J,D)=>x.$emit("update:key",J,D)),"is-last":k(String(M))},null,8,["value","key-name","level","path","expanded","theme","is-last"])]))),128))]),s.createElementVNode("div",Cr,[s.createElementVNode("span",wr,s.toDisplayString(re.value),1),x.isLast?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("span",Tr,","))])])):s.createCommentVNode("",!0)])):(s.openBlock(),s.createElementBlock("div",_r,[x.keyName?(s.openBlock(),s.createElementBlock("span",{key:0,class:"json-node__key",contenteditable:i.value,onDblclick:ee,onKeydown:[s.withKeys(s.withModifiers(q,["prevent"]),["enter"]),s.withKeys(he,["escape"])],onBlur:q,ref_key:"keyRef",ref:m,title:"Double-click to edit key"},s.toDisplayString(i.value?p.value:`"${oe.value}"`),41,Br)):s.createCommentVNode("",!0),x.keyName?(s.openBlock(),s.createElementBlock("span",Sr,": ")):s.createCommentVNode("",!0),s.createElementVNode("span",{class:s.normalizeClass(["json-node__value-wrapper",Ae.value]),onDblclick:K,title:A.value},[s.createElementVNode("span",{class:"json-node__value",contenteditable:l.value,onKeydown:[s.withKeys(s.withModifiers(pe,["prevent"]),["enter"]),s.withKeys(F,["escape"])],onBlur:pe,ref_key:"valueRef",ref:B},s.toDisplayString(l.value?N.value:H.value),41,kr),x.isLast?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("span",Rr,","))],42,Or)]))])}}}),Et=(n,t)=>{const r=n.__vccOpts||n;for(const[u,i]of t)r[u]=i;return r},Ir=Et(Fr,[["__scopeId","data-v-1472a8af"]]),kt={name:"github-light",colors:{background:"#ffffff",surfaceBackground:"#f6f8fa",border:"#d0d7de",text:"#24292f",textSecondary:"#656d76",buttonBackground:"#f6f8fa",buttonBackgroundHover:"#f3f4f6",buttonBorder:"#d0d7de",buttonText:"#24292f",buttonPrimary:"#2da44e",buttonPrimaryHover:"#2c974b",success:"#1a7f37",successBackground:"#dafbe1",error:"#cf222e",errorBackground:"#ffebe9",syntaxString:"#0a3069",syntaxNumber:"#0969da",syntaxBoolean:"#8250df",syntaxNull:"#656d76",syntaxKey:"#0969da",syntaxBracket:"#24292f",hoverBackground:"#f6f8fa",selectionBackground:"rgba(9, 105, 218, 0.2)",collapsedBackground:"#ddf4ff",collapsedBackgroundHover:"#b6e3ff",collapsedText:"#0969da",indentLine:"#d0d7de"}},Pr={"github-light":kt,"github-dark":{name:"github-dark",colors:{background:"#0d1117",surfaceBackground:"#161b22",border:"#30363d",text:"#e6edf3",textSecondary:"#7d8590",buttonBackground:"#21262d",buttonBackgroundHover:"#30363d",buttonBorder:"#30363d",buttonText:"#e6edf3",buttonPrimary:"#238636",buttonPrimaryHover:"#2ea043",success:"#3fb950",successBackground:"#0f2419",error:"#f85149",errorBackground:"#381921",syntaxString:"#a5d6ff",syntaxNumber:"#79c0ff",syntaxBoolean:"#d2a8ff",syntaxNull:"#7d8590",syntaxKey:"#79c0ff",syntaxBracket:"#e6edf3",hoverBackground:"#161b22",selectionBackground:"rgba(121, 192, 255, 0.2)",collapsedBackground:"#1c2128",collapsedBackgroundHover:"#2d333b",collapsedText:"#79c0ff",indentLine:"#30363d"}},"min-light":{name:"min-light",colors:{background:"#ffffff",surfaceBackground:"#fafafa",border:"#e5e5e5",text:"#333333",textSecondary:"#888888",buttonBackground:"#f8f8f8",buttonBackgroundHover:"#eeeeee",buttonBorder:"#e0e0e0",buttonText:"#333333",buttonPrimary:"#007acc",buttonPrimaryHover:"#005a9e",success:"#22c55e",successBackground:"#f0fdf4",error:"#ef4444",errorBackground:"#fef2f2",syntaxString:"#22c55e",syntaxNumber:"#3b82f6",syntaxBoolean:"#8b5cf6",syntaxNull:"#6b7280",syntaxKey:"#1f2937",syntaxBracket:"#374151",hoverBackground:"#f9f9f9",selectionBackground:"rgba(59, 130, 246, 0.2)",collapsedBackground:"#e0f2fe",collapsedBackgroundHover:"#bae6fd",collapsedText:"#0284c7",indentLine:"#e5e7eb"}},"slack-ochin":{name:"slack-ochin",colors:{background:"#fefbf6",surfaceBackground:"#faf6f0",border:"#e8d5b7",text:"#4a3b2a",textSecondary:"#8b7355",buttonBackground:"#f4ede4",buttonBackgroundHover:"#efe5d8",buttonBorder:"#e8d5b7",buttonText:"#4a3b2a",buttonPrimary:"#ff6b35",buttonPrimaryHover:"#e55a2b",success:"#ff9500",successBackground:"#fff8f0",error:"#d73502",errorBackground:"#ffeee8",syntaxString:"#d73502",syntaxNumber:"#ff6b35",syntaxBoolean:"#b7472a",syntaxNull:"#8b7355",syntaxKey:"#4a3b2a",syntaxBracket:"#6b5444",hoverBackground:"#f8f2eb",selectionBackground:"rgba(255, 107, 53, 0.2)",collapsedBackground:"#ffe8d6",collapsedBackgroundHover:"#ffd4b0",collapsedText:"#d73502",indentLine:"#e8d5b7"}}};function Lr(n="github-light"){return Pr[n]||kt}const Vr={key:0,class:"json-format__toolbar"},Mr={class:"json-format__actions"},Ur=["disabled"],qr=["disabled"],$r=["disabled"],jr=["disabled"],Xr={class:"json-format__info"},Hr={key:0,class:"json-format__status json-format__status--success"},Gr={key:1,class:"json-format__status json-format__status--error"},Kr={class:"json-format__content"},zr={key:0,class:"json-format__error"},Yr={key:1,class:"json-format__error"},Wr={key:2,class:"json-format__viewer"},Rt=Et(s.defineComponent({name:"JsonFormat",__name:"index",props:{modelValue:{default:""},readonly:{type:Boolean,default:!1},maxDepth:{default:10},showToolbar:{type:Boolean,default:!0},theme:{default:"github-light"}},emits:["update:modelValue","copy-success","copy-error","expand-all","collapse-all","compress"],setup(n,{expose:t,emit:r}){s.useCssVars(D=>({"0e2b28fa":U.value.colors.border,f3d81a08:U.value.colors.background,"0af7d57b":U.value.colors.text,"5ee5c82d":U.value.colors.surfaceBackground,ff458768:U.value.colors.buttonBorder,c0efe564:U.value.colors.buttonBackground,"2a4ad566":U.value.colors.buttonText,e48626e4:U.value.colors.buttonBackgroundHover,"748549e2":U.value.colors.buttonPrimary,a39b270c:U.value.colors.buttonPrimaryHover,"61cd2ffa":U.value.colors.successBackground,"43ed24f5":U.value.colors.success,"9c8a2770":U.value.colors.errorBackground,"53354b7a":U.value.colors.error}));const u=n,i=r,l=s.ref(null),p=s.ref(""),N=s.ref(new Set),h=s.ref(null),m=s.ref(""),B=s.ref(!1),T=s.computed(()=>p.value===""),U=s.computed(()=>Lr(u.theme)),V=D=>{if(D==null)return D;if(Array.isArray(D))return D.map(w=>V(w));if(typeof D=="object"){const w={},P=Object.keys(D).sort();for(const L of P)w[L]=V(D[L]);return w}return D},ae=s.computed(()=>{const D=h.value!==null?h.value:l.value;return!D||!B.value?D:V(D)}),le=s.computed(()=>m.value?null:ae.value),_=D=>{if(!D.trim()){l.value=null,p.value="",h.value=null,m.value="";return}try{let w=D;const P=/(:\s*|,\s*|\[\s*)-?\d{16,}/.test(w),L=/(:\s*|,\s*|\[\s*)-?\d+\.\d*0+\s*[,}\]\s]*/.test(w);if(!P&&!L)try{l.value=JSON.parse(w),p.value="",h.value=null,m.value="",s.nextTick(()=>{le.value!==null&&K()});return}catch{}w=(C=>{let ne="",Ee=!1,be=!1,Te=0;for(;Te<C.length;){const ke=C[Te];if(Ee)be?be=!1:ke==="\\"?be=!0:ke==='"'&&(Ee=!1),ne+=ke,Te++;else if(ke==='"')Ee=!0,ne+=ke,Te++;else{const ve=C.slice(Te);let g=ve.match(/^([:,\[\s]*)(-?\d{16,})(\s*[,\}\]\s]|$)/);if(g){ne+=g[1]+'{"__protected_number__":"'+g[2]+'"}'+g[3],Te+=g[0].length;continue}if(g=ve.match(/^([:,\[\s]*)(-?\d+\.\d*0+)(\s*[,\}\]\s]|$)/),g){ne+=g[1]+'{"__protected_number__":"'+g[2]+'"}'+g[3],Te+=g[0].length;continue}ne+=ke,Te++}}return ne})(w),l.value=JSON.parse(w),p.value="",h.value=null,m.value="",s.nextTick(()=>{le.value!==null&&K()})}catch(w){p.value=w instanceof Error?w.message:"Unknown parsing error",l.value=null,h.value=null,m.value=""}},oe=D=>{if(!D||!D.expression.trim()){Ae();return}if(!l.value){m.value="No valid JSON data to filter";return}try{let w;if(D.type==="jsonpath")w=we({path:D.expression,json:l.value}),w.length===1&&D.expression.includes("$[")===!1&&!D.expression.endsWith("[*]")?h.value=w[0]:h.value=w;else if(D.type==="js"){const{proxyData:P,indexMap:L}=ge(l.value),C=new Function("$",`
|
|
3
3
|
try {
|
|
4
|
-
return ${
|
|
4
|
+
return ${D.expression};
|
|
5
5
|
} catch (error) {
|
|
6
6
|
throw new Error('JavaScript expression error: ' + error.message);
|
|
7
7
|
}
|
|
8
|
-
`)(E);m=B(l.value,b,_),i.value=m}else throw new Error(`Unsupported filter type: ${u.type}`);c.value="",r.nextTick(()=>{D()})}catch(m){c.value=m instanceof Error?m.message:"Filter execution error",i.value=null}},$=(u,m="root")=>{const E=new Map,_=(b,T)=>{if(b==null)return b;if(typeof b=="object"&&b.__protected_number__!==void 0){const I=parseFloat(b.__protected_number__);return E.set(I,T),I}if(Array.isArray(b)){const I=b.map((F,W)=>{const ee=`${T}[${W}]`,se=_(F,ee);return E.set(se,ee),se});return E.set(I,T),I}if(typeof b=="object"){const I={};for(const F in b)if(Object.prototype.hasOwnProperty.call(b,F)){const W=T==="root"?F:`${T}.${F}`;I[F]=_(b[F],W)}return E.set(I,T),I}return b};return{proxyData:_(u,m),indexMap:E}},B=(u,m,E)=>{if(m===null||typeof m!="object")return m;if(Array.isArray(m))return m.map(b=>{const T=E.get(b);if(T){const I=M(u,T);if(I!==void 0)return I}return B(u,b,E)});const _=E.get(m);if(_){const b=M(u,_);if(b!==void 0)return b}const x={};for(const b in m)Object.prototype.hasOwnProperty.call(m,b)&&(x[b]=B(u,m[b],E));return x},M=(u,m)=>{if(m==="root")return u;const E=[];let _=m.replace(/^root\.?/,"");const x=/([^\[\].]+)|\[(\d+)\]/g;let b;for(;(b=x.exec(_))!==null;)b[1]?E.push(b[1]):b[2]!==void 0&&E.push(parseInt(b[2]));let T=u;for(const I of E){if(T==null)return;T=T[I]}return T},X=()=>{i.value=null,c.value=""};r.watch(()=>s.modelValue,u=>{k(u)},{immediate:!0});const j=(u,m,E)=>{const _=T=>{if(T===null||typeof T!="object")return T;if(!Array.isArray(T)&&"__protected_number__"in T&&Object.keys(T).length===1)return`__PROTECTED_NUMBER_${T.__protected_number__}_PROTECTED_NUMBER__`;if(Array.isArray(T))return T.map(F=>_(F));const I={};for(const[F,W]of Object.entries(T))I[F]=_(W);return I},x=_(u);return JSON.stringify(x,m,E).replace(/"__PROTECTED_NUMBER_(.+?)_PROTECTED_NUMBER__"/g,"$1")},q=(u,m)=>{if(!s.readonly)try{const E=re(l.value,u,m),_=j(E,null,2);o("update:modelValue",_)}catch(E){console.error("Failed to update JSON:",E)}},re=(u,m,E)=>{if(!m||m==="root")return E;const _=m.split("."),x=O(u,_.slice(0,-1));let b=x;for(let I=0;I<_.length-1;I++){const F=_[I];F!=="root"&&(Array.isArray(b)?b=b[parseInt(F)]:b=b[F])}const T=_[_.length-1];return T==="root"?E:(Array.isArray(b)?b[parseInt(T)]=E:b[T]=E,x)},J=u=>{d.value.has(u)?d.value.delete(u):d.value.add(u)},D=()=>{const u=new Set,m=(E,_="")=>{E!==null&&typeof E=="object"&&(u.add(_||"root"),Array.isArray(E)?E.forEach((x,b)=>{const T=_?`${_}.${b}`:`${b}`;m(x,T)}):Object.keys(E).forEach(x=>{const b=_?`${_}.${x}`:x;m(E[x],b)}))};m(w.value),d.value=u,o("expand-all")},ne=()=>{d.value=new Set(["root"]),o("collapse-all")},oe=async()=>{if(g.value)try{const u=w.value,m=j(u,null,2);await navigator.clipboard.writeText(m),o("copy-success",m)}catch(u){console.error("Failed to copy JSON:",u),o("copy-error",u instanceof Error?u:new Error("Failed to copy JSON"))}},N=()=>{if(g.value)try{const u=w.value,m=j(u);o("update:modelValue",m),o("compress",m)}catch(u){console.error("Failed to compress JSON:",u)}},v=async u=>{try{let m;typeof u=="object"&&u!==null&&!Array.isArray(u)&&"__protected_number__"in u&&Object.keys(u).length===1?m=u.__protected_number__:typeof u=="string"?m=`"${u}"`:m=JSON.stringify(u),await navigator.clipboard.writeText(m)}catch(m){console.error("Failed to copy value:",m)}},R=(u,m)=>{if(!s.readonly)try{const E=C(l.value,u,m),_=j(E,null,2);o("update:modelValue",_),y(u,m)}catch(E){console.error("Failed to rename key:",E)}},C=(u,m,E)=>{if(!m||m==="root")return u;const _=m.split("."),x=O(u,_.slice(0,-1));if(_.length===1){const I=_[0];return x&&typeof x=="object"&&!Array.isArray(x)?U(x,I,E):x}let b=x;for(let I=0;I<_.length-1;I++){const F=_[I];Array.isArray(b)?b=b[parseInt(F)]:b=b[F]}const T=_[_.length-1];if(!Array.isArray(b)&&b&&typeof b=="object"){const I=U(b,T,E),F=_.slice(0,-1);F.length>0&&V(x,F,I)}return x},O=(u,m)=>{if(m.length===0)return u;if(Array.isArray(u)){const E=[...u],_=m[0],x=parseInt(_);return m.length===1||(E[x]=O(u[x],m.slice(1))),E}else if(u&&typeof u=="object"){const E={...u},_=m[0];return m.length===1||(E[_]=O(u[_],m.slice(1))),E}return u},U=(u,m,E)=>{if(!u||typeof u!="object"||Array.isArray(u))return u;const _=Object.keys(u),x={};for(const b of _)b===m?x[E]=u[b]:x[b]=u[b];return x},V=(u,m,E)=>{let _=u;for(let b=0;b<m.length-1;b++){const T=m[b];Array.isArray(_)?_=_[parseInt(T)]:_=_[T]}const x=m[m.length-1];Array.isArray(_)?_[parseInt(x)]=E:_[x]=E},y=(u,m)=>{const E=new Set;d.value.forEach(_=>{if(_===u){const x=u.split(".");x[x.length-1]=m,E.add(x.join("."))}else if(_.startsWith(u+".")){const x=u.split(".");x[x.length-1]=m;const b=x.join("."),T=_.substring(u.length);E.add(b+T)}else E.add(_)}),d.value=E};return e({copyJson:oe,compressSource:N,expandAll:D,collapseAll:ne,toggleExpand:J,updateValue:q,updateKey:R,filter:S,clearFilter:X,isValidJson:()=>g.value,getParsedJson:()=>l.value,getFilteredJson:()=>i.value,getExpandedNodes:()=>d.value,getParseError:()=>a.value,getFilterError:()=>c.value,parseJson:u=>k(u),copyValue:u=>v(u)}),(u,m)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["json-format",`json-format--${p.value.name}`])},[u.showToolbar?(r.openBlock(),r.createElementBlock("div",vt,[r.createElementVNode("div",Ot,[r.createElementVNode("button",{class:"json-format__btn json-format__btn--primary",onClick:oe,disabled:!g.value,title:"Copy JSON"}," 📋 Copy ",8,St),r.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:D,disabled:!g.value,title:"Expand All"}," ⬇️ Expand All ",8,$t),r.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:ne,disabled:!g.value,title:"Collapse All"}," ➡️ Collapse All ",8,Pt),r.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:N,disabled:!g.value,title:"Compress JSON"}," 📦 Compress ",8,Vt)]),r.createElementVNode("div",It,[g.value?(r.openBlock(),r.createElementBlock("span",Rt," ✅ Valid JSON ")):(r.openBlock(),r.createElementBlock("span",Lt," ❌ Invalid JSON "))])])):r.createCommentVNode("",!0),r.createElementVNode("div",Mt,[g.value?c.value?(r.openBlock(),r.createElementBlock("div",Kt,[m[1]||(m[1]=r.createElementVNode("h4",null,"Filter Error:",-1)),r.createElementVNode("pre",null,r.toDisplayString(c.value),1)])):(r.openBlock(),r.createElementBlock("div",Ut,[r.createVNode(Ct,{value:w.value,"key-name":"",level:0,expanded:d.value,"is-last":!0,theme:p.value,"onUpdate:value":q,onToggleExpand:J,onCopy:v,"onUpdate:key":R},null,8,["value","expanded","theme"])])):(r.openBlock(),r.createElementBlock("div",jt,[m[0]||(m[0]=r.createElementVNode("h4",null,"JSON Parse Error:",-1)),r.createElementVNode("pre",null,r.toDisplayString(a.value),1)]))])],2))}}),[["__scopeId","data-v-d3aaf91e"]]),Ft={key:0,class:"xml-node__comment"},zt={key:1,class:"xml-node__cdata"},Xt={key:2,class:"xml-node__element"},Ht={key:0,class:"xml-node__line"},Wt=["contenteditable","onKeydown"],qt=["contenteditable","onDblclick","onKeydown"],Qt=["contenteditable","onDblclick","onKeydown"],Yt=["contenteditable","onKeydown"],Dt={key:1,class:"xml-node__line"},Gt=["contenteditable","onKeydown"],Zt=["contenteditable","onDblclick","onKeydown"],Jt=["contenteditable","onDblclick","onKeydown"],en=["contenteditable","onKeydown"],tn={key:2},nn={key:0,class:"xml-node__line"},rn=["contenteditable","onKeydown"],on=["contenteditable","onDblclick","onKeydown"],sn=["contenteditable","onDblclick","onKeydown"],ln=["title"],an={class:"xml-node__line"},cn=["title"],dn=["contenteditable","onKeydown"],un={key:1},fn=["contenteditable","onKeydown"],hn=["contenteditable","onDblclick","onKeydown"],pn=["contenteditable","onDblclick","onKeydown"],mn=["title"],gn={key:0,class:"xml-node__children"},yn={key:0,class:"xml-node__text"},bn=["contenteditable","onKeydown"],En={key:1,class:"xml-node__line"},_n=Ee(r.defineComponent({__name:"XmlNode",props:{node:{},index:{},level:{default:0},parentPath:{default:""},expanded:{},theme:{}},emits:["toggle-expand","copy","update:tagName","update:attributeName","update:attributeValue","update:textContent","update:cdataContent"],setup(n,{emit:e}){r.useCssVars(h=>({"623698b5":h.theme.colors.indentLine}));const t=n,s=e,o=r.ref(!1),l=r.ref(null),a=r.ref(null),d=r.ref(!1),i=r.ref(!1),c=r.ref(""),g=r.ref(""),p=r.ref(""),w=r.ref(""),k=r.ref(""),S=r.ref(null),$=r.ref(null),B=r.ref(null),M=r.ref(null),X=r.ref(null),j=r.computed(()=>Object.keys(t.node).find(A=>!A.startsWith(":")&&!A.startsWith("#"))||""),q=r.computed(()=>j.value?t.parentPath?`${t.parentPath}.${j.value}[${t.index}]`:`${j.value}[${t.index}]`:""),re=r.computed(()=>t.expanded.has(q.value)),J=r.computed(()=>t.node["#comment"]?"comment":t.node.__cdata?"cdata":j.value?"element":"unknown"),D=r.computed(()=>{const h=t.node[":@"]||{},A={};return Object.keys(h).forEach(Q=>{Q.startsWith("@_")&&(A[Q.substring(2)]=h[Q])}),A}),ne=r.computed(()=>{if(J.value!=="element"||!j.value)return[];const h=t.node[j.value];return Array.isArray(h)?h:[]}),oe=r.computed(()=>ne.value.some(h=>h.__cdata)),N=r.computed(()=>{if(!oe.value)return"";const h=ne.value.find(A=>A.__cdata);if(h&&Array.isArray(h.__cdata)){const A=h.__cdata;if(A.length>0&&A[0]["#text"])return A[0]["#text"]}return""}),v=r.computed(()=>{if(J.value!=="element"||!j.value||oe.value)return"";const h=t.node[j.value];if(!Array.isArray(h))return"";const A=h.find(Q=>Q["#text"]);return A?A["#text"]:""}),R=r.computed(()=>{if(J.value!=="comment")return"";const h=t.node["#comment"];return Array.isArray(h)&&h.length>0&&h[0]["#text"]||""}),C=r.computed(()=>ne.value.some(h=>Object.keys(h).some(Q=>!Q.startsWith("#")&&!Q.startsWith(":")))),O=r.computed(()=>C.value?ne.value.filter(h=>Object.keys(h).some(Q=>!Q.startsWith("#")&&!Q.startsWith(":"))).length:0),U=r.computed(()=>J.value==="element"&&!C.value&&v.value.trim()!==""),V=()=>{C.value&&s("toggle-expand",q.value)},y=(h,A)=>`${q.value}-child-${A}`,u=()=>`${q.value}.${j.value}`,m=()=>{o.value=!0,c.value=j.value,r.nextTick(()=>{if(S.value){S.value.focus();const h=document.createRange();h.selectNodeContents(S.value);const A=window.getSelection();A?.removeAllRanges(),A?.addRange(h)}})},E=h=>{l.value=h,g.value=h,r.nextTick(()=>{if($.value){$.value.focus();const A=document.createRange();A.selectNodeContents($.value);const Q=window.getSelection();Q?.removeAllRanges(),Q?.addRange(A)}})},_=h=>{a.value=h,p.value=D.value[h]||"",r.nextTick(()=>{if(B.value){B.value.focus();const A=document.createRange();A.selectNodeContents(B.value);const Q=window.getSelection();Q?.removeAllRanges(),Q?.addRange(A)}})},x=()=>{d.value=!0,w.value=v.value,r.nextTick(()=>{if(M.value){M.value.focus();const h=document.createRange();h.selectNodeContents(M.value);const A=window.getSelection();A?.removeAllRanges(),A?.addRange(h)}})},b=()=>{if(!o.value)return;const h=S.value?.innerText.trim()||"";if(!h||h===j.value){o.value=!1;return}o.value=!1,s("update:tagName",q.value,j.value,h)},T=()=>{if(!l.value)return;const h=l.value,A=$.value?.innerText.trim()||"";if(!A||A===h){l.value=null;return}l.value=null,s("update:attributeName",q.value,h,A)},I=()=>{if(!a.value)return;const h=a.value,A=B.value?.innerText.trim()||"";a.value=null,s("update:attributeValue",q.value,h,A)},F=()=>{if(!d.value)return;const h=M.value?.innerText||"";if(h===v.value){d.value=!1;return}d.value=!1,s("update:textContent",q.value,h)},W=()=>{o.value=!1,c.value=j.value},ee=()=>{l.value&&(g.value=l.value,l.value=null)},se=()=>{a.value&&(p.value=D.value[a.value]||"",a.value=null)},te=()=>{d.value=!1,w.value=v.value},Kr=()=>{i.value=!0,k.value=N.value,r.nextTick(()=>{if(X.value){X.value.focus();const h=document.createRange();h.selectNodeContents(X.value);const A=window.getSelection();A?.removeAllRanges(),A?.addRange(h)}})},We=()=>{if(!i.value)return;const h=X.value?.innerText||"";if(h===N.value){i.value=!1;return}i.value=!1,s("update:cdataContent",q.value,h)},Ur=()=>{i.value=!1,k.value=N.value},ke=h=>{C.value&&(h.preventDefault(),m())};return(h,A)=>{const Q=r.resolveComponent("XmlNode",!0);return r.openBlock(),r.createElementBlock("div",{class:"xml-node",style:r.normalizeStyle({paddingLeft:h.level>0?"16px":"0"})},[J.value==="comment"?(r.openBlock(),r.createElementBlock("div",Ft,[r.createElementVNode("span",{style:r.normalizeStyle({color:h.theme.colors.xmlComment})}," <!-- "+r.toDisplayString(R.value)+" --> ",5)])):J.value==="cdata"?(r.openBlock(),r.createElementBlock("div",zt,[r.createElementVNode("span",{style:r.normalizeStyle({color:h.theme.colors.xmlCdata})}," <![CDATA["+r.toDisplayString(h.node.__cdata)+"]]> ",5)])):J.value==="element"?(r.openBlock(),r.createElementBlock("div",Xt,[oe.value?(r.openBlock(),r.createElementBlock("div",Ht,[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"<",4),r.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:r.normalizeStyle({color:h.theme.colors.xmlTag}),contenteditable:o.value,onDblclick:m,onContextmenu:ke,onKeydown:[r.withKeys(r.withModifiers(b,["prevent"]),["enter"]),r.withKeys(W,["escape"])],onBlur:b,ref_key:"tagNameRef",ref:S,title:"Double-click to edit tag name"},r.toDisplayString(o.value?c.value:j.value),45,Wt),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(D.value,(Y,P)=>(r.openBlock(),r.createElementBlock("span",{key:P,class:"xml-node__attribute"},[r.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttribute}),contenteditable:l.value===P,onDblclick:L=>E(P),onKeydown:[r.withKeys(r.withModifiers(T,["prevent"]),["enter"]),r.withKeys(ee,["escape"])],onBlur:T,ref_for:!0,ref:L=>{l.value===P&&($.value=L)},title:"Double-click to edit attribute name"},r.toDisplayString(l.value===P?g.value:P),45,qt),r.createElementVNode("span",{class:"xml-node__equals",style:r.normalizeStyle({color:h.theme.colors.xmlEquals})},"=",4),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4),r.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttributeValue}),contenteditable:a.value===P,onDblclick:L=>_(P),onKeydown:[r.withKeys(r.withModifiers(I,["prevent"]),["enter"]),r.withKeys(se,["escape"])],onBlur:I,ref_for:!0,ref:L=>{a.value===P&&(B.value=L)},title:"Double-click to edit attribute value"},r.toDisplayString(a.value===P?p.value:Y),45,Qt),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4)]))),128)),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4),r.createElementVNode("span",{class:"xml-node__cdata",style:r.normalizeStyle({color:h.theme.colors.xmlCdata})},"<![CDATA[",4),r.createElementVNode("span",{class:"xml-node__cdata-content xml-node__cdata-content--editable",style:r.normalizeStyle({color:h.theme.colors.xmlCdata}),contenteditable:i.value,onDblclick:Kr,onKeydown:[r.withKeys(r.withModifiers(We,["prevent"]),["enter"]),r.withKeys(Ur,["escape"])],onBlur:We,ref_key:"cdataContentRef",ref:X,title:"Double-click to edit CDATA content"},r.toDisplayString(i.value?k.value:N.value),45,Yt),r.createElementVNode("span",{class:"xml-node__cdata",style:r.normalizeStyle({color:h.theme.colors.xmlCdata})},"]]>",4),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"</",4),r.createElementVNode("span",{class:"xml-node__tag",style:r.normalizeStyle({color:h.theme.colors.xmlTag})},r.toDisplayString(o.value?c.value:j.value),5),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4)])):U.value?(r.openBlock(),r.createElementBlock("div",Dt,[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"<",4),r.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:r.normalizeStyle({color:h.theme.colors.xmlTag}),contenteditable:o.value,onDblclick:m,onContextmenu:ke,onKeydown:[r.withKeys(r.withModifiers(b,["prevent"]),["enter"]),r.withKeys(W,["escape"])],onBlur:b,ref_key:"tagNameRef",ref:S,title:"Double-click to edit tag name"},r.toDisplayString(o.value?c.value:j.value),45,Gt),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(D.value,(Y,P)=>(r.openBlock(),r.createElementBlock("span",{key:P,class:"xml-node__attribute"},[r.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttribute}),contenteditable:l.value===P,onDblclick:L=>E(P),onKeydown:[r.withKeys(r.withModifiers(T,["prevent"]),["enter"]),r.withKeys(ee,["escape"])],onBlur:T,ref_for:!0,ref:L=>{l.value===P&&($.value=L)},title:"Double-click to edit attribute name"},r.toDisplayString(l.value===P?g.value:P),45,Zt),r.createElementVNode("span",{class:"xml-node__equals",style:r.normalizeStyle({color:h.theme.colors.xmlEquals})},"=",4),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4),r.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttributeValue}),contenteditable:a.value===P,onDblclick:L=>_(P),onKeydown:[r.withKeys(r.withModifiers(I,["prevent"]),["enter"]),r.withKeys(se,["escape"])],onBlur:I,ref_for:!0,ref:L=>{a.value===P&&(B.value=L)},title:"Double-click to edit attribute value"},r.toDisplayString(a.value===P?p.value:Y),45,Jt),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4)]))),128)),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4),r.createElementVNode("span",{class:"xml-node__text-content xml-node__text-content--editable",style:r.normalizeStyle({color:h.theme.colors.xmlText}),contenteditable:d.value,onDblclick:x,onKeydown:[r.withKeys(r.withModifiers(F,["prevent"]),["enter"]),r.withKeys(te,["escape"])],onBlur:F,ref_key:"textContentRef",ref:M,title:"Double-click to edit text content"},r.toDisplayString(d.value?w.value:v.value),45,en),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"</",4),r.createElementVNode("span",{class:"xml-node__tag",style:r.normalizeStyle({color:h.theme.colors.xmlTag})},r.toDisplayString(o.value?c.value:j.value),5),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4)])):(r.openBlock(),r.createElementBlock("div",tn,[!re.value&&C.value?(r.openBlock(),r.createElementBlock("div",nn,[r.createElementVNode("span",{class:"xml-node__clickable-part",onClick:A[0]||(A[0]=Y=>V()),title:"Click to expand"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"<",4),r.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:r.normalizeStyle({color:h.theme.colors.xmlTag}),contenteditable:o.value,onDblclick:r.withModifiers(m,["stop"]),onContextmenu:ke,onKeydown:[r.withKeys(r.withModifiers(b,["prevent"]),["enter"]),r.withKeys(W,["escape"])],onBlur:b,ref_key:"tagNameRef",ref:S,title:"Double-click or right-click to edit tag name"},r.toDisplayString(o.value?c.value:j.value),45,rn)]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(D.value,(Y,P)=>(r.openBlock(),r.createElementBlock("span",{key:P,class:"xml-node__attribute"},[r.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttribute}),contenteditable:l.value===P,onDblclick:L=>E(P),onKeydown:[r.withKeys(r.withModifiers(T,["prevent"]),["enter"]),r.withKeys(ee,["escape"])],onBlur:T,ref_for:!0,ref:L=>{l.value===P&&($.value=L)},title:"Double-click to edit attribute name"},r.toDisplayString(l.value===P?g.value:P),45,on),r.createElementVNode("span",{class:"xml-node__equals",style:r.normalizeStyle({color:h.theme.colors.xmlEquals})},"=",4),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4),r.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttributeValue}),contenteditable:a.value===P,onDblclick:L=>_(P),onKeydown:[r.withKeys(r.withModifiers(I,["prevent"]),["enter"]),r.withKeys(se,["escape"])],onBlur:I,ref_for:!0,ref:L=>{a.value===P&&(B.value=L)},title:"Double-click to edit attribute value"},r.toDisplayString(a.value===P?p.value:Y),45,sn),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4)]))),128)),r.createElementVNode("span",{class:"xml-node__clickable-part",onClick:A[1]||(A[1]=Y=>V()),title:"Click to expand"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4)]),r.createElementVNode("span",{class:"xml-node__collapsed-badge",style:r.normalizeStyle({backgroundColor:h.theme.colors.collapsedBackground,color:h.theme.colors.collapsedText}),onClick:A[2]||(A[2]=Y=>V()),title:`Click to expand ${O.value} child element${O.value>1?"s":""}`},r.toDisplayString(O.value)+" child"+r.toDisplayString(O.value>1?"ren":""),13,ln),r.createElementVNode("span",{class:"xml-node__clickable-part",onClick:A[3]||(A[3]=Y=>V()),title:"Click to expand"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"</",4),r.createElementVNode("span",{class:"xml-node__tag",style:r.normalizeStyle({color:h.theme.colors.xmlTag})},r.toDisplayString(o.value?c.value:j.value),5),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4)])])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",an,[C.value?(r.openBlock(),r.createElementBlock("span",{key:0,class:"xml-node__clickable-part",onClick:A[4]||(A[4]=Y=>V()),title:re.value?"Click to collapse":"Click to expand"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"<",4),r.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:r.normalizeStyle({color:h.theme.colors.xmlTag}),contenteditable:o.value,onDblclick:r.withModifiers(m,["stop"]),onContextmenu:ke,onKeydown:[r.withKeys(r.withModifiers(b,["prevent"]),["enter"]),r.withKeys(W,["escape"])],onBlur:b,ref_key:"tagNameRef",ref:S,title:"Double-click or right-click to edit tag name"},r.toDisplayString(o.value?c.value:j.value),45,dn)],8,cn)):(r.openBlock(),r.createElementBlock("span",un,[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"<",4),r.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:r.normalizeStyle({color:h.theme.colors.xmlTag}),contenteditable:o.value,onDblclick:m,onKeydown:[r.withKeys(r.withModifiers(b,["prevent"]),["enter"]),r.withKeys(W,["escape"])],onBlur:b,ref_key:"tagNameRef",ref:S,title:"Double-click to edit tag name"},r.toDisplayString(o.value?c.value:j.value),45,fn)])),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(D.value,(Y,P)=>(r.openBlock(),r.createElementBlock("span",{key:P,class:"xml-node__attribute"},[r.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttribute}),contenteditable:l.value===P,onDblclick:L=>E(P),onKeydown:[r.withKeys(r.withModifiers(T,["prevent"]),["enter"]),r.withKeys(ee,["escape"])],onBlur:T,ref_for:!0,ref:L=>{l.value===P&&($.value=L)},title:"Double-click to edit attribute name"},r.toDisplayString(l.value===P?g.value:P),45,hn),r.createElementVNode("span",{class:"xml-node__equals",style:r.normalizeStyle({color:h.theme.colors.xmlEquals})},"=",4),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4),r.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttributeValue}),contenteditable:a.value===P,onDblclick:L=>_(P),onKeydown:[r.withKeys(r.withModifiers(I,["prevent"]),["enter"]),r.withKeys(se,["escape"])],onBlur:I,ref_for:!0,ref:L=>{a.value===P&&(B.value=L)},title:"Double-click to edit attribute value"},r.toDisplayString(a.value===P?p.value:Y),45,pn),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4)]))),128)),C.value?(r.openBlock(),r.createElementBlock("span",{key:2,class:"xml-node__clickable-part",onClick:A[5]||(A[5]=Y=>V()),title:re.value?"Click to collapse":"Click to expand"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4)],8,mn)):(r.openBlock(),r.createElementBlock("span",{key:3,class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},r.toDisplayString(C.value?">":"/>"),5))]),re.value&&C.value?(r.openBlock(),r.createElementBlock("div",gn,[ne.value.length===0&&v.value.trim()?(r.openBlock(),r.createElementBlock("div",yn,[r.createElementVNode("span",{class:"xml-node__text-content xml-node__text-content--editable",style:r.normalizeStyle({color:h.theme.colors.xmlText}),contenteditable:d.value,onDblclick:x,onKeydown:[r.withKeys(r.withModifiers(F,["prevent"]),["enter"]),r.withKeys(te,["escape"])],onBlur:F,ref_key:"textContentRef",ref:M,title:"Double-click to edit text content"},r.toDisplayString(d.value?w.value:v.value),45,bn)])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(ne.value,(Y,P)=>(r.openBlock(),r.createBlock(Q,{key:y(Y,P),node:Y,index:P,level:h.level+1,"parent-path":u(),expanded:h.expanded,theme:h.theme,onToggleExpand:A[6]||(A[6]=L=>h.$emit("toggle-expand",L)),onCopy:A[7]||(A[7]=L=>h.$emit("copy",L)),"onUpdate:tagName":A[8]||(A[8]=(L,ce,be)=>h.$emit("update:tagName",L,ce,be)),"onUpdate:attributeName":A[9]||(A[9]=(L,ce,be)=>h.$emit("update:attributeName",L,ce,be)),"onUpdate:attributeValue":A[10]||(A[10]=(L,ce,be)=>h.$emit("update:attributeValue",L,ce,be)),"onUpdate:textContent":A[11]||(A[11]=(L,ce)=>h.$emit("update:textContent",L,ce)),"onUpdate:cdataContent":A[12]||(A[12]=(L,ce)=>h.$emit("update:cdataContent",L,ce))},null,8,["node","index","level","parent-path","expanded","theme"]))),128))])):r.createCommentVNode("",!0),re.value&&C.value?(r.openBlock(),r.createElementBlock("div",En,[r.createElementVNode("span",{class:"xml-node__clickable-part",onClick:A[13]||(A[13]=Y=>V()),title:"Click to collapse"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"</",4),r.createElementVNode("span",{class:"xml-node__tag",style:r.normalizeStyle({color:h.theme.colors.xmlTag})},r.toDisplayString(o.value?c.value:j.value),5),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4)])])):r.createCommentVNode("",!0)],64))]))])):r.createCommentVNode("",!0)],4)}}}),[["__scopeId","data-v-44ac0d91"]]),$e={"github-light":{name:"github-light",colors:{background:"#ffffff",surfaceBackground:"#f6f8fa",border:"#d0d7de",text:"#24292f",textSecondary:"#57606a",buttonBackground:"#f6f8fa",buttonBackgroundHover:"#f3f4f6",buttonBorder:"#d0d7de",buttonText:"#24292f",buttonPrimary:"#1f883d",buttonPrimaryHover:"#1a7f37",success:"#1f883d",successBackground:"#dafbe1",error:"#cf222e",errorBackground:"#ffebe9",xmlTag:"#116329",xmlAttribute:"#0550ae",xmlAttributeValue:"#0a3069",xmlText:"#24292f",xmlComment:"#6e7781",xmlCdata:"#8250df",xmlDeclaration:"#953800",xmlBracket:"#6e7781",xmlEquals:"#6e7781",xmlQuote:"#0550ae",collapsedBackground:"#ddf4ff",collapsedText:"#0969da",indentLine:"#d0d7de"}},"github-dark":{name:"github-dark",colors:{background:"#0d1117",surfaceBackground:"#161b22",border:"#30363d",text:"#c9d1d9",textSecondary:"#8b949e",buttonBackground:"#21262d",buttonBackgroundHover:"#30363d",buttonBorder:"#30363d",buttonText:"#c9d1d9",buttonPrimary:"#238636",buttonPrimaryHover:"#2ea043",success:"#3fb950",successBackground:"#0f2e1c",error:"#f85149",errorBackground:"#3d1319",xmlTag:"#7ee787",xmlAttribute:"#79c0ff",xmlAttributeValue:"#a5d6ff",xmlText:"#c9d1d9",xmlComment:"#8b949e",xmlCdata:"#d2a8ff",xmlDeclaration:"#ffa657",xmlBracket:"#8b949e",xmlEquals:"#8b949e",xmlQuote:"#79c0ff",collapsedBackground:"#1c2d41",collapsedText:"#58a6ff",indentLine:"#30363d"}},"min-light":{name:"min-light",colors:{background:"#ffffff",surfaceBackground:"#fafafa",border:"#e5e5e5",text:"#171717",textSecondary:"#737373",buttonBackground:"#fafafa",buttonBackgroundHover:"#f5f5f5",buttonBorder:"#e5e5e5",buttonText:"#171717",buttonPrimary:"#22c55e",buttonPrimaryHover:"#16a34a",success:"#22c55e",successBackground:"#dcfce7",error:"#ef4444",errorBackground:"#fee2e2",xmlTag:"#16a34a",xmlAttribute:"#2563eb",xmlAttributeValue:"#1e40af",xmlText:"#171717",xmlComment:"#737373",xmlCdata:"#9333ea",xmlDeclaration:"#ea580c",xmlBracket:"#737373",xmlEquals:"#737373",xmlQuote:"#2563eb",collapsedBackground:"#dbeafe",collapsedText:"#1d4ed8",indentLine:"#e5e7eb"}},"slack-ochin":{name:"slack-ochin",colors:{background:"#fef5ed",surfaceBackground:"#fef9f3",border:"#e9dcc9",text:"#3d3c40",textSecondary:"#616061",buttonBackground:"#fef9f3",buttonBackgroundHover:"#f9f0e5",buttonBorder:"#e9dcc9",buttonText:"#3d3c40",buttonPrimary:"#007a5a",buttonPrimaryHover:"#006644",success:"#007a5a",successBackground:"#d1f4e0",error:"#e01e5a",errorBackground:"#ffdbea",xmlTag:"#007a5a",xmlAttribute:"#1264a3",xmlAttributeValue:"#0b4c8c",xmlText:"#3d3c40",xmlComment:"#616061",xmlCdata:"#8b2eff",xmlDeclaration:"#e8912d",xmlBracket:"#616061",xmlEquals:"#616061",xmlQuote:"#1264a3",collapsedBackground:"#d8eaf5",collapsedText:"#0b4c8c",indentLine:"#e8d5b7"}}},xn=n=>$e[n]||$e["github-light"],Pe=":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",kn=Pe+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Nn="["+Pe+"]["+kn+"]*",wn=new RegExp("^"+Nn+"$");function Ve(n,e){const t=[];let s=e.exec(n);for(;s;){const o=[];o.startIndex=e.lastIndex-s[0].length;const l=s.length;for(let a=0;a<l;a++)o.push(s[a]);t.push(o),s=e.exec(n)}return t}const _e=function(n){const e=wn.exec(n);return!(e===null||typeof e>"u")};function An(n){return typeof n<"u"}const Cn={allowBooleanAttributes:!1,unpairedTags:[]};function Ie(n,e){e=Object.assign({},Cn,e);const t=[];let s=!1,o=!1;n[0]==="\uFEFF"&&(n=n.substr(1));for(let l=0;l<n.length;l++)if(n[l]==="<"&&n[l+1]==="?"){if(l+=2,l=Le(n,l),l.err)return l}else if(n[l]==="<"){let a=l;if(l++,n[l]==="!"){l=Me(n,l);continue}else{let d=!1;n[l]==="/"&&(d=!0,l++);let i="";for(;l<n.length&&n[l]!==">"&&n[l]!==" "&&n[l]!==" "&&n[l]!==`
|
|
9
|
-
`&&n[l]!=="\r";l++)i+=n[l];if(i=i.trim(),i[i.length-1]==="/"&&(i=i.substring(0,i.length-1),l--),!Vn(i)){let p;return i.trim().length===0?p="Invalid space after '<'.":p="Tag '"+i+"' is an invalid name.",H("InvalidTag",p,G(n,l))}const c=vn(n,l);if(c===!1)return H("InvalidAttr","Attributes for '"+i+"' have open quote.",G(n,l));let g=c.value;if(l=c.index,g[g.length-1]==="/"){const p=l-g.length;g=g.substring(0,g.length-1);const w=je(g,e);if(w===!0)s=!0;else return H(w.err.code,w.err.msg,G(n,p+w.err.line))}else if(d)if(c.tagClosed){if(g.trim().length>0)return H("InvalidTag","Closing tag '"+i+"' can't have attributes or invalid starting.",G(n,a));if(t.length===0)return H("InvalidTag","Closing tag '"+i+"' has not been opened.",G(n,a));{const p=t.pop();if(i!==p.tagName){let w=G(n,p.tagStartPos);return H("InvalidTag","Expected closing tag '"+p.tagName+"' (opened in line "+w.line+", col "+w.col+") instead of closing tag '"+i+"'.",G(n,a))}t.length==0&&(o=!0)}}else return H("InvalidTag","Closing tag '"+i+"' doesn't have proper closing.",G(n,l));else{const p=je(g,e);if(p!==!0)return H(p.err.code,p.err.msg,G(n,l-g.length+p.err.line));if(o===!0)return H("InvalidXml","Multiple possible root nodes found.",G(n,l));e.unpairedTags.indexOf(i)!==-1||t.push({tagName:i,tagStartPos:a}),s=!0}for(l++;l<n.length;l++)if(n[l]==="<")if(n[l+1]==="!"){l++,l=Me(n,l);continue}else if(n[l+1]==="?"){if(l=Le(n,++l),l.err)return l}else break;else if(n[l]==="&"){const p=$n(n,l);if(p==-1)return H("InvalidChar","char '&' is not expected.",G(n,l));l=p}else if(o===!0&&!Re(n[l]))return H("InvalidXml","Extra text at the end",G(n,l));n[l]==="<"&&l--}}else{if(Re(n[l]))continue;return H("InvalidChar","char '"+n[l]+"' is not expected.",G(n,l))}if(s){if(t.length==1)return H("InvalidTag","Unclosed tag '"+t[0].tagName+"'.",G(n,t[0].tagStartPos));if(t.length>0)return H("InvalidXml","Invalid '"+JSON.stringify(t.map(l=>l.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return H("InvalidXml","Start tag expected.",1);return!0}function Re(n){return n===" "||n===" "||n===`
|
|
10
|
-
`||n==="\r"}function Le(n,e){const t=e;for(;e<n.length;e++)if(n[e]=="?"||n[e]==" "){const s=n.substr(t,e-t);if(e>5&&s==="xml")return H("InvalidXml","XML declaration allowed only at the start of the document.",G(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function Me(n,e){if(n.length>e+5&&n[e+1]==="-"&&n[e+2]==="-"){for(e+=3;e<n.length;e++)if(n[e]==="-"&&n[e+1]==="-"&&n[e+2]===">"){e+=2;break}}else if(n.length>e+8&&n[e+1]==="D"&&n[e+2]==="O"&&n[e+3]==="C"&&n[e+4]==="T"&&n[e+5]==="Y"&&n[e+6]==="P"&&n[e+7]==="E"){let t=1;for(e+=8;e<n.length;e++)if(n[e]==="<")t++;else if(n[e]===">"&&(t--,t===0))break}else if(n.length>e+9&&n[e+1]==="["&&n[e+2]==="C"&&n[e+3]==="D"&&n[e+4]==="A"&&n[e+5]==="T"&&n[e+6]==="A"&&n[e+7]==="["){for(e+=8;e<n.length;e++)if(n[e]==="]"&&n[e+1]==="]"&&n[e+2]===">"){e+=2;break}}return e}const Bn='"',Tn="'";function vn(n,e){let t="",s="",o=!1;for(;e<n.length;e++){if(n[e]===Bn||n[e]===Tn)s===""?s=n[e]:s!==n[e]||(s="");else if(n[e]===">"&&s===""){o=!0;break}t+=n[e]}return s!==""?!1:{value:t,index:e,tagClosed:o}}const On=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function je(n,e){const t=Ve(n,On),s={};for(let o=0;o<t.length;o++){if(t[o][1].length===0)return H("InvalidAttr","Attribute '"+t[o][2]+"' has no space in starting.",ge(t[o]));if(t[o][3]!==void 0&&t[o][4]===void 0)return H("InvalidAttr","Attribute '"+t[o][2]+"' is without value.",ge(t[o]));if(t[o][3]===void 0&&!e.allowBooleanAttributes)return H("InvalidAttr","boolean attribute '"+t[o][2]+"' is not allowed.",ge(t[o]));const l=t[o][2];if(!Pn(l))return H("InvalidAttr","Attribute '"+l+"' is an invalid name.",ge(t[o]));if(!s.hasOwnProperty(l))s[l]=1;else return H("InvalidAttr","Attribute '"+l+"' is repeated.",ge(t[o]))}return!0}function Sn(n,e){let t=/\d/;for(n[e]==="x"&&(e++,t=/[\da-fA-F]/);e<n.length;e++){if(n[e]===";")return e;if(!n[e].match(t))break}return-1}function $n(n,e){if(e++,n[e]===";")return-1;if(n[e]==="#")return e++,Sn(n,e);let t=0;for(;e<n.length;e++,t++)if(!(n[e].match(/\w/)&&t<20)){if(n[e]===";")break;return-1}return e}function H(n,e,t){return{err:{code:n,msg:e,line:t.line||t,col:t.col}}}function Pn(n){return _e(n)}function Vn(n){return _e(n)}function G(n,e){const t=n.substring(0,e).split(/\r?\n/);return{line:t.length,col:t[t.length-1].length+1}}function ge(n){return n.startIndex+n[1].length}const In={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(n,e){return e},attributeValueProcessor:function(n,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n},captureMetaData:!1},Rn=function(n){return Object.assign({},In,n)};let xe;typeof Symbol!="function"?xe="@@xmlMetadata":xe=Symbol("XML Node Metadata");class fe{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e,t){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][xe]={startIndex:t})}static getMetaDataSymbol(){return xe}}class Ln{constructor(e){this.suppressValidationErr=!e}readDocType(e,t){const s={};if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let o=1,l=!1,a=!1,d="";for(;t<e.length;t++)if(e[t]==="<"&&!a){if(l&&he(e,"!ENTITY",t)){t+=7;let i,c;[i,c,t]=this.readEntityExp(e,t+1,this.suppressValidationErr),c.indexOf("&")===-1&&(s[i]={regx:RegExp(`&${i};`,"g"),val:c})}else if(l&&he(e,"!ELEMENT",t)){t+=8;const{index:i}=this.readElementExp(e,t+1);t=i}else if(l&&he(e,"!ATTLIST",t))t+=8;else if(l&&he(e,"!NOTATION",t)){t+=9;const{index:i}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=i}else if(he(e,"!--",t))a=!0;else throw new Error("Invalid DOCTYPE");o++,d=""}else if(e[t]===">"){if(a?e[t-1]==="-"&&e[t-2]==="-"&&(a=!1,o--):o--,o===0)break}else e[t]==="["?l=!0:d+=e[t];if(o!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:s,i:t}}readEntityExp(e,t){t=Z(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t])&&e[t]!=='"'&&e[t]!=="'";)s+=e[t],t++;if(ye(s),t=Z(e,t),!this.suppressValidationErr){if(e.substring(t,t+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[t]==="%")throw new Error("Parameter entities are not supported")}let o="";return[t,o]=this.readIdentifierVal(e,t,"entity"),t--,[s,o,t]}readNotationExp(e,t){t=Z(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;!this.suppressValidationErr&&ye(s),t=Z(e,t);const o=e.substring(t,t+6).toUpperCase();if(!this.suppressValidationErr&&o!=="SYSTEM"&&o!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${o}"`);t+=o.length,t=Z(e,t);let l=null,a=null;if(o==="PUBLIC")[t,l]=this.readIdentifierVal(e,t,"publicIdentifier"),t=Z(e,t),(e[t]==='"'||e[t]==="'")&&([t,a]=this.readIdentifierVal(e,t,"systemIdentifier"));else if(o==="SYSTEM"&&([t,a]=this.readIdentifierVal(e,t,"systemIdentifier"),!this.suppressValidationErr&&!a))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:s,publicIdentifier:l,systemIdentifier:a,index:--t}}readIdentifierVal(e,t,s){let o="";const l=e[t];if(l!=='"'&&l!=="'")throw new Error(`Expected quoted string, found "${l}"`);for(t++;t<e.length&&e[t]!==l;)o+=e[t],t++;if(e[t]!==l)throw new Error(`Unterminated ${s} value`);return t++,[t,o]}readElementExp(e,t){t=Z(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;if(!this.suppressValidationErr&&!_e(s))throw new Error(`Invalid element name: "${s}"`);t=Z(e,t);let o="";if(e[t]==="E"&&he(e,"MPTY",t))t+=4;else if(e[t]==="A"&&he(e,"NY",t))t+=2;else if(e[t]==="("){for(t++;t<e.length&&e[t]!==")";)o+=e[t],t++;if(e[t]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:s,contentModel:o.trim(),index:t}}readAttlistExp(e,t){t=Z(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;ye(s),t=Z(e,t);let o="";for(;t<e.length&&!/\s/.test(e[t]);)o+=e[t],t++;if(!ye(o))throw new Error(`Invalid attribute name: "${o}"`);t=Z(e,t);let l="";if(e.substring(t,t+8).toUpperCase()==="NOTATION"){if(l="NOTATION",t+=8,t=Z(e,t),e[t]!=="(")throw new Error(`Expected '(', found "${e[t]}"`);t++;let d=[];for(;t<e.length&&e[t]!==")";){let i="";for(;t<e.length&&e[t]!=="|"&&e[t]!==")";)i+=e[t],t++;if(i=i.trim(),!ye(i))throw new Error(`Invalid notation name: "${i}"`);d.push(i),e[t]==="|"&&(t++,t=Z(e,t))}if(e[t]!==")")throw new Error("Unterminated list of notations");t++,l+=" ("+d.join("|")+")"}else{for(;t<e.length&&!/\s/.test(e[t]);)l+=e[t],t++;const d=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!d.includes(l.toUpperCase()))throw new Error(`Invalid attribute type: "${l}"`)}t=Z(e,t);let a="";return e.substring(t,t+8).toUpperCase()==="#REQUIRED"?(a="#REQUIRED",t+=8):e.substring(t,t+7).toUpperCase()==="#IMPLIED"?(a="#IMPLIED",t+=7):[t,a]=this.readIdentifierVal(e,t,"ATTLIST"),{elementName:s,attributeName:o,attributeType:l,defaultValue:a,index:t}}}const Z=(n,e)=>{for(;e<n.length&&/\s/.test(n[e]);)e++;return e};function he(n,e,t){for(let s=0;s<e.length;s++)if(e[s]!==n[t+s+1])return!1;return!0}function ye(n){if(_e(n))return n;throw new Error(`Invalid entity name ${n}`)}const Mn=/^[-+]?0x[a-fA-F0-9]+$/,jn=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Kn={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function Un(n,e={}){if(e=Object.assign({},Kn,e),!n||typeof n!="string")return n;let t=n.trim();if(e.skipLike!==void 0&&e.skipLike.test(t))return n;if(n==="0")return 0;if(e.hex&&Mn.test(t))return Hn(t,16);if(t.search(/.+[eE].+/)!==-1)return zn(n,t,e);{const s=jn.exec(t);if(s){const o=s[1]||"",l=s[2];let a=Xn(s[3]);const d=o?n[l.length+1]===".":n[l.length]===".";if(!e.leadingZeros&&(l.length>1||l.length===1&&!d))return n;{const i=Number(t),c=String(i);if(i===0)return i;if(c.search(/[eE]/)!==-1)return e.eNotation?i:n;if(t.indexOf(".")!==-1)return c==="0"||c===a||c===`${o}${a}`?i:n;let g=l?a:t;return l?g===c||o+g===c?i:n:g===c||g===o+c?i:n}}else return n}}const Fn=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function zn(n,e,t){if(!t.eNotation)return n;const s=e.match(Fn);if(s){let o=s[1]||"";const l=s[3].indexOf("e")===-1?"E":"e",a=s[2],d=o?n[a.length+1]===l:n[a.length]===l;return a.length>1&&d?n:a.length===1&&(s[3].startsWith(`.${l}`)||s[3][0]===l)?Number(e):t.leadingZeros&&!d?(e=(s[1]||"")+s[3],Number(e)):n}else return n}function Xn(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substring(0,n.length-1))),n}function Hn(n,e){if(parseInt)return parseInt(n,e);if(Number.parseInt)return Number.parseInt(n,e);if(window&&window.parseInt)return window.parseInt(n,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Ke(n){return typeof n=="function"?n:Array.isArray(n)?e=>{for(const t of n)if(typeof t=="string"&&e===t||t instanceof RegExp&&t.test(e))return!0}:()=>!1}class Wn{constructor(e){this.options=e,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:(t,s)=>String.fromCodePoint(Number.parseInt(s,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,s)=>String.fromCodePoint(Number.parseInt(s,16))}},this.addExternalEntities=qn,this.parseXml=Zn,this.parseTextData=Qn,this.resolveNameSpace=Yn,this.buildAttributesMap=Gn,this.isItStopNode=nr,this.replaceEntitiesValue=er,this.readStopNodeData=or,this.saveTextToParentTag=tr,this.addChild=Jn,this.ignoreAttributesFn=Ke(this.options.ignoreAttributes)}}function qn(n){const e=Object.keys(n);for(let t=0;t<e.length;t++){const s=e[t];this.lastEntities[s]={regex:new RegExp("&"+s+";","g"),val:n[s]}}}function Qn(n,e,t,s,o,l,a){if(n!==void 0&&(this.options.trimValues&&!s&&(n=n.trim()),n.length>0)){a||(n=this.replaceEntitiesValue(n));const d=this.options.tagValueProcessor(e,n,t,o,l);return d==null?n:typeof d!=typeof n||d!==n?d:this.options.trimValues?Ce(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?Ce(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function Yn(n){if(this.options.removeNSPrefix){const e=n.split(":"),t=n.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(n=t+e[1])}return n}const Dn=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Gn(n,e,t){if(this.options.ignoreAttributes!==!0&&typeof n=="string"){const s=Ve(n,Dn),o=s.length,l={};for(let a=0;a<o;a++){const d=this.resolveNameSpace(s[a][1]);if(this.ignoreAttributesFn(d,e))continue;let i=s[a][4],c=this.options.attributeNamePrefix+d;if(d.length)if(this.options.transformAttributeName&&(c=this.options.transformAttributeName(c)),c==="__proto__"&&(c="#__proto__"),i!==void 0){this.options.trimValues&&(i=i.trim()),i=this.replaceEntitiesValue(i);const g=this.options.attributeValueProcessor(d,i,e);g==null?l[c]=i:typeof g!=typeof i||g!==i?l[c]=g:l[c]=Ce(i,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(l[c]=!0)}if(!Object.keys(l).length)return;if(this.options.attributesGroupName){const a={};return a[this.options.attributesGroupName]=l,a}return l}}const Zn=function(n){n=n.replace(/\r\n?/g,`
|
|
11
|
-
`)
|
|
12
|
-
|
|
8
|
+
`)(P);w=re(l.value,C,L),h.value=w}else throw new Error(`Unsupported filter type: ${D.type}`);m.value="",s.nextTick(()=>{K()})}catch(w){m.value=w instanceof Error?w.message:"Filter execution error",h.value=null}},ge=(D,w="root")=>{const P=new Map,L=(C,ne)=>{if(C==null)return C;if(typeof C=="object"&&C.__protected_number__!==void 0){const Ee=parseFloat(C.__protected_number__);return P.set(Ee,ne),Ee}if(Array.isArray(C)){const Ee=C.map((be,Te)=>{const ke=`${ne}[${Te}]`,ve=L(be,ke);return P.set(ve,ke),ve});return P.set(Ee,ne),Ee}if(typeof C=="object"){const Ee={};for(const be in C)if(Object.prototype.hasOwnProperty.call(C,be)){const Te=ne==="root"?be:`${ne}.${be}`;Ee[be]=L(C[be],Te)}return P.set(Ee,ne),Ee}return C};return{proxyData:L(D,w),indexMap:P}},re=(D,w,P)=>{if(w===null||typeof w!="object")return w;if(Array.isArray(w))return w.map(C=>{const ne=P.get(C);if(ne){const Ee=De(D,ne);if(Ee!==void 0)return Ee}return re(D,C,P)});const L=P.get(w);if(L){const C=De(D,L);if(C!==void 0)return C}const W={};for(const C in w)Object.prototype.hasOwnProperty.call(w,C)&&(W[C]=re(D,w[C],P));return W},De=(D,w)=>{if(w==="root")return D;const P=[];let L=w.replace(/^root\.?/,"");const W=/([^\[\].]+)|\[(\d+)\]/g;let C;for(;(C=W.exec(L))!==null;)C[1]?P.push(C[1]):C[2]!==void 0&&P.push(parseInt(C[2]));let ne=D;for(const Ee of P){if(ne==null)return;ne=ne[Ee]}return ne},Ae=()=>{h.value=null,m.value=""},H=()=>{B.value=!0},A=()=>{B.value=!1};s.watch(()=>u.modelValue,D=>{_(D)},{immediate:!0});const de=(D,w,P)=>{const L=ne=>{if(ne===null||typeof ne!="object")return ne;if(!Array.isArray(ne)&&"__protected_number__"in ne&&Object.keys(ne).length===1)return`__PROTECTED_NUMBER_${ne.__protected_number__}_PROTECTED_NUMBER__`;if(Array.isArray(ne))return ne.map(be=>L(be));const Ee={};for(const[be,Te]of Object.entries(ne))Ee[be]=L(Te);return Ee},W=L(D);return JSON.stringify(W,w,P).replace(/"__PROTECTED_NUMBER_(.+?)_PROTECTED_NUMBER__"/g,"$1")},k=(D,w)=>{if(!u.readonly)try{const P=I(l.value,D,w),L=de(P,null,2);i("update:modelValue",L)}catch(P){console.error("Failed to update JSON:",P)}},I=(D,w,P)=>{if(!w||w==="root")return P;const L=w.split("."),W=R(D,L.slice(0,-1));let C=W;for(let Ee=0;Ee<L.length-1;Ee++){const be=L[Ee];be!=="root"&&(Array.isArray(C)?C=C[parseInt(be)]:C=C[be])}const ne=L[L.length-1];return ne==="root"?P:(Array.isArray(C)?C[parseInt(ne)]=P:C[ne]=P,W)},ee=D=>{N.value.has(D)?N.value.delete(D):N.value.add(D)},K=()=>{const D=new Set,w=(P,L="")=>{P!==null&&typeof P=="object"&&(D.add(L||"root"),Array.isArray(P)?P.forEach((W,C)=>{const ne=L?`${L}.${C}`:`${C}`;w(W,ne)}):Object.keys(P).forEach(W=>{const C=L?`${L}.${W}`:W;w(P[W],C)}))};w(le.value),N.value=D,i("expand-all")},q=()=>{N.value=new Set(["root"]),i("collapse-all")},pe=async()=>{if(T.value)try{const D=le.value,w=de(D,null,2);await navigator.clipboard.writeText(w),i("copy-success",w)}catch(D){console.error("Failed to copy JSON:",D),i("copy-error",D instanceof Error?D:new Error("Failed to copy JSON"))}},he=()=>{if(T.value)try{const D=le.value,w=de(D);i("update:modelValue",w),i("compress",w)}catch(D){console.error("Failed to compress JSON:",D)}},F=async D=>{try{let w;typeof D=="object"&&D!==null&&!Array.isArray(D)&&"__protected_number__"in D&&Object.keys(D).length===1?w=D.__protected_number__:typeof D=="string"?w=`"${D}"`:w=JSON.stringify(D),await navigator.clipboard.writeText(w)}catch(w){console.error("Failed to copy value:",w)}},x=(D,w)=>{if(!u.readonly)try{const P=S(l.value,D,w),L=de(P,null,2);i("update:modelValue",L),J(D,w)}catch(P){console.error("Failed to rename key:",P)}},S=(D,w,P)=>{if(!w||w==="root")return D;const L=w.split("."),W=R(D,L.slice(0,-1));if(L.length===1){const Ee=L[0];return W&&typeof W=="object"&&!Array.isArray(W)?j(W,Ee,P):W}let C=W;for(let Ee=0;Ee<L.length-1;Ee++){const be=L[Ee];Array.isArray(C)?C=C[parseInt(be)]:C=C[be]}const ne=L[L.length-1];if(!Array.isArray(C)&&C&&typeof C=="object"){const Ee=j(C,ne,P),be=L.slice(0,-1);be.length>0&&M(W,be,Ee)}return W},R=(D,w)=>{if(w.length===0)return D;if(Array.isArray(D)){const P=[...D],L=w[0],W=parseInt(L);return w.length===1||(P[W]=R(D[W],w.slice(1))),P}else if(D&&typeof D=="object"){const P={...D},L=w[0];return w.length===1||(P[L]=R(D[L],w.slice(1))),P}return D},j=(D,w,P)=>{if(!D||typeof D!="object"||Array.isArray(D))return D;const L=Object.keys(D),W={};for(const C of L)C===w?W[P]=D[C]:W[C]=D[C];return W},M=(D,w,P)=>{let L=D;for(let C=0;C<w.length-1;C++){const ne=w[C];Array.isArray(L)?L=L[parseInt(ne)]:L=L[ne]}const W=w[w.length-1];Array.isArray(L)?L[parseInt(W)]=P:L[W]=P},J=(D,w)=>{const P=new Set;N.value.forEach(L=>{if(L===D){const W=D.split(".");W[W.length-1]=w,P.add(W.join("."))}else if(L.startsWith(D+".")){const W=D.split(".");W[W.length-1]=w;const C=W.join("."),ne=L.substring(D.length);P.add(C+ne)}else P.add(L)}),N.value=P};return t({copyJson:pe,compressSource:he,expandAll:K,collapseAll:q,toggleExpand:ee,updateValue:k,updateKey:x,filter:oe,clearFilter:Ae,sortKeys:H,clearSortKeys:A,isSorted:()=>B.value,isValidJson:()=>T.value,getParsedJson:()=>l.value,getFilteredJson:()=>h.value,getExpandedNodes:()=>N.value,getParseError:()=>p.value,getFilterError:()=>m.value,parseJson:D=>_(D),copyValue:D=>F(D)}),(D,w)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["json-format",`json-format--${U.value.name}`])},[D.showToolbar?(s.openBlock(),s.createElementBlock("div",Vr,[s.createElementVNode("div",Mr,[s.createElementVNode("button",{class:"json-format__btn json-format__btn--primary",onClick:pe,disabled:!T.value,title:"Copy JSON"}," 📋 Copy ",8,Ur),s.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:K,disabled:!T.value,title:"Expand All"}," ⬇️ Expand All ",8,qr),s.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:q,disabled:!T.value,title:"Collapse All"}," ➡️ Collapse All ",8,$r),s.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:he,disabled:!T.value,title:"Compress JSON"}," 📦 Compress ",8,jr)]),s.createElementVNode("div",Xr,[T.value?(s.openBlock(),s.createElementBlock("span",Hr," ✅ Valid JSON ")):(s.openBlock(),s.createElementBlock("span",Gr," ❌ Invalid JSON "))])])):s.createCommentVNode("",!0),s.createElementVNode("div",Kr,[T.value?m.value?(s.openBlock(),s.createElementBlock("div",Yr,[w[1]||(w[1]=s.createElementVNode("h4",null,"Filter Error:",-1)),s.createElementVNode("pre",null,s.toDisplayString(m.value),1)])):(s.openBlock(),s.createElementBlock("div",Wr,[s.createVNode(Ir,{value:le.value,"key-name":"",level:0,expanded:N.value,"is-last":!0,theme:U.value,"onUpdate:value":k,onToggleExpand:ee,onCopy:F,"onUpdate:key":x},null,8,["value","expanded","theme"])])):(s.openBlock(),s.createElementBlock("div",zr,[w[0]||(w[0]=s.createElementVNode("h4",null,"JSON Parse Error:",-1)),s.createElementVNode("pre",null,s.toDisplayString(p.value),1)]))])],2))}}),[["__scopeId","data-v-94157be3"]]);function Qr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var vt={},Ft;function Zr(){return Ft||(Ft=1,function(n){var t=n;(function(r){var u="__namespace",i=function(e){return e==null},l=function(e){return e===u||Number.isInteger(e)&&e>=1&&e<=11},p=function(e){return e&&l(e.nodeType)&&typeof e.nodeName=="string"};function N(e){var o=Array.prototype.slice,f=e.length,y=function(b,Q){return function(){return Q.apply(this,b.concat(o.call(arguments)))}},d=function(){var b=o.call(arguments);return b.length<f?y(b,d):e.apply(this,o.apply(arguments,[0,f]))};return d}var h=function(e,o){for(var f=0;f<o.length;f+=1)e(o[f],f,o)},m=function(e,o,f){var y=o;return h(function(d,b){y=e(y,d,b)},f),y},B=function(e,o){var f=new Array(o.length);return h(function(y,d){f[d]=e(y)},o),f},T=function(e,o){var f=[];return h(function(y,d){e(y,d)&&f.push(y)},o),f},U=function(e,o){for(var f=0;f<e.length;f+=1)if(e[f]===o)return!0;return!1};function V(e){return function(){return e}}function ae(e){return e.toString()}var le=function(e,o){return o.join(e)},_=function(e,o,f){return e+f+o},oe=Array.prototype.concat,ge=function(e,o){var f=new te;f.addArray(e);var y=f.toArray();return o?y.reverse():y},re=32767;function De(e){for(var o=[],f=0;f<e.length;f+=re){var y=e.slice(f,f+re);o=oe.apply(o,y)}return o}function Ae(e,o){for(var f=Object(e),y=1;y<arguments.length;y++){var d=arguments[y];if(d!=null)for(var b in d)Object.prototype.hasOwnProperty.call(d,b)&&(f[b]=d[b])}return f}var H={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NAMESPACE_NODE:u};A.prototype=new Object,A.prototype.constructor=A,A.superclass=Object.prototype;function A(){this.init()}A.prototype.init=function(){this.reduceActions=[],this.reduceActions[3]=function(e){return new pe(e[0],e[2])},this.reduceActions[5]=function(e){return new he(e[0],e[2])},this.reduceActions[7]=function(e){return new F(e[0],e[2])},this.reduceActions[8]=function(e){return new x(e[0],e[2])},this.reduceActions[10]=function(e){return new S(e[0],e[2])},this.reduceActions[11]=function(e){return new R(e[0],e[2])},this.reduceActions[12]=function(e){return new j(e[0],e[2])},this.reduceActions[13]=function(e){return new M(e[0],e[2])},this.reduceActions[15]=function(e){return new J(e[0],e[2])},this.reduceActions[16]=function(e){return new D(e[0],e[2])},this.reduceActions[18]=function(e){return new w(e[0],e[2])},this.reduceActions[19]=function(e){return new P(e[0],e[2])},this.reduceActions[20]=function(e){return new L(e[0],e[2])},this.reduceActions[22]=function(e){return new K(e[1])},this.reduceActions[24]=function(e){return new W(e[0],e[2])},this.reduceActions[25]=function(e){return new C(void 0,void 0,e[0])},this.reduceActions[27]=function(e){return e[0].locationPath=e[2],e[0]},this.reduceActions[28]=function(e){return e[0].locationPath=e[2],e[0].locationPath.steps.unshift(new g(g.DESCENDANTORSELF,$.nodeTest,[])),e[0]},this.reduceActions[29]=function(e){return new C(e[0],[],void 0)},this.reduceActions[30]=function(e){return ue.instance_of(e[0],C)?(e[0].filterPredicates==null&&(e[0].filterPredicates=[]),e[0].filterPredicates.push(e[1]),e[0]):new C(e[0],[e[1]],void 0)},this.reduceActions[32]=function(e){return e[1]},this.reduceActions[33]=function(e){return new X(e[0])},this.reduceActions[34]=function(e){return new z(e[0])},this.reduceActions[36]=function(e){return new ce(e[0],[])},this.reduceActions[37]=function(e){return new ce(e[0],e[2])},this.reduceActions[38]=function(e){return[e[0]]},this.reduceActions[39]=function(e){return e[2].unshift(e[0]),e[2]},this.reduceActions[43]=function(e){return new ve(!0,[])},this.reduceActions[44]=function(e){return e[1].absolute=!0,e[1]},this.reduceActions[46]=function(e){return new ve(!1,[e[0]])},this.reduceActions[47]=function(e){return e[0].steps.push(e[2]),e[0]},this.reduceActions[49]=function(e){return new g(e[0],e[1],[])},this.reduceActions[50]=function(e){return new g(g.CHILD,e[0],[])},this.reduceActions[51]=function(e){return new g(e[0],e[1],e[2])},this.reduceActions[52]=function(e){return new g(g.CHILD,e[0],e[1])},this.reduceActions[54]=function(e){return[e[0]]},this.reduceActions[55]=function(e){return e[1].unshift(e[0]),e[1]},this.reduceActions[56]=function(e){return e[0]=="ancestor"?g.ANCESTOR:e[0]=="ancestor-or-self"?g.ANCESTORORSELF:e[0]=="attribute"?g.ATTRIBUTE:e[0]=="child"?g.CHILD:e[0]=="descendant"?g.DESCENDANT:e[0]=="descendant-or-self"?g.DESCENDANTORSELF:e[0]=="following"?g.FOLLOWING:e[0]=="following-sibling"?g.FOLLOWINGSIBLING:e[0]=="namespace"?g.NAMESPACE:e[0]=="parent"?g.PARENT:e[0]=="preceding"?g.PRECEDING:e[0]=="preceding-sibling"?g.PRECEDINGSIBLING:e[0]=="self"?g.SELF:-1},this.reduceActions[57]=function(e){return g.ATTRIBUTE},this.reduceActions[59]=function(e){return e[0]=="comment"?$.commentTest:e[0]=="text"?$.textTest:e[0]=="processing-instruction"?$.anyPiTest:e[0]=="node"?$.nodeTest:new $(-1,void 0)},this.reduceActions[60]=function(e){return new $.PITest(e[2])},this.reduceActions[61]=function(e){return e[1]},this.reduceActions[63]=function(e){return e[1].absolute=!0,e[1].steps.unshift(new g(g.DESCENDANTORSELF,$.nodeTest,[])),e[1]},this.reduceActions[64]=function(e){return e[0].steps.push(new g(g.DESCENDANTORSELF,$.nodeTest,[])),e[0].steps.push(e[2]),e[0]},this.reduceActions[65]=function(e){return new g(g.SELF,$.nodeTest,[])},this.reduceActions[66]=function(e){return new g(g.PARENT,$.nodeTest,[])},this.reduceActions[67]=function(e){return new _e(e[1])},this.reduceActions[68]=function(e){return $.nameTestAny},this.reduceActions[69]=function(e){return new $.NameTestPrefixAny(e[0].split(":")[0])},this.reduceActions[70]=function(e){return new $.NameTestQName(e[0])}},A.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 "],A.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 "],A.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:;<=>?@ ABqCDEFGH IJ "," "," "],A.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]],A.DOUBLEDOT=2,A.DOUBLECOLON=3,A.DOUBLESLASH=4,A.NOTEQUAL=5,A.LESSTHANOREQUAL=6,A.GREATERTHANOREQUAL=7,A.AND=8,A.OR=9,A.MOD=10,A.DIV=11,A.MULTIPLYOPERATOR=12,A.FUNCTIONNAME=13,A.AXISNAME=14,A.LITERAL=15,A.NUMBER=16,A.ASTERISKNAMETEST=17,A.QNAME=18,A.NCNAMECOLONASTERISK=19,A.NODETYPE=20,A.PROCESSINGINSTRUCTIONWITHLITERAL=21,A.EQUALS=22,A.LESSTHAN=23,A.GREATERTHAN=24,A.PLUS=25,A.MINUS=26,A.BAR=27,A.SLASH=28,A.LEFTPARENTHESIS=29,A.RIGHTPARENTHESIS=30,A.COMMA=31,A.AT=32,A.LEFTBRACKET=33,A.RIGHTBRACKET=34,A.DOT=35,A.DOLLAR=36,A.prototype.tokenize=function(e){for(var o=[],f=[],y=e+"\0",d=0,b=y.charAt(d++);;){for(;b==" "||b==" "||b=="\r"||b==`
|
|
9
|
+
`;)b=y.charAt(d++);if(b=="\0"||d>=y.length)break;if(b=="("){o.push(A.LEFTPARENTHESIS),f.push(b),b=y.charAt(d++);continue}if(b==")"){o.push(A.RIGHTPARENTHESIS),f.push(b),b=y.charAt(d++);continue}if(b=="["){o.push(A.LEFTBRACKET),f.push(b),b=y.charAt(d++);continue}if(b=="]"){o.push(A.RIGHTBRACKET),f.push(b),b=y.charAt(d++);continue}if(b=="@"){o.push(A.AT),f.push(b),b=y.charAt(d++);continue}if(b==","){o.push(A.COMMA),f.push(b),b=y.charAt(d++);continue}if(b=="|"){o.push(A.BAR),f.push(b),b=y.charAt(d++);continue}if(b=="+"){o.push(A.PLUS),f.push(b),b=y.charAt(d++);continue}if(b=="-"){o.push(A.MINUS),f.push(b),b=y.charAt(d++);continue}if(b=="="){o.push(A.EQUALS),f.push(b),b=y.charAt(d++);continue}if(b=="$"){o.push(A.DOLLAR),f.push(b),b=y.charAt(d++);continue}if(b=="."){if(b=y.charAt(d++),b=="."){o.push(A.DOUBLEDOT),f.push(".."),b=y.charAt(d++);continue}if(b>="0"&&b<="9"){var Q="."+b;for(b=y.charAt(d++);b>="0"&&b<="9";)Q+=b,b=y.charAt(d++);o.push(A.NUMBER),f.push(Q);continue}o.push(A.DOT),f.push(".");continue}if(b=="'"||b=='"'){for(var xe=b,Ne="";d<y.length&&(b=y.charAt(d))!==xe;)Ne+=b,d+=1;if(b!==xe)throw Me.fromMessage("Unterminated string literal: "+xe+Ne);d+=1,o.push(A.LITERAL),f.push(Ne),b=y.charAt(d++);continue}if(b>="0"&&b<="9"){var Q=b;for(b=y.charAt(d++);b>="0"&&b<="9";)Q+=b,b=y.charAt(d++);if(b=="."&&y.charAt(d)>="0"&&y.charAt(d)<="9")for(Q+=b,Q+=y.charAt(d++),b=y.charAt(d++);b>="0"&&b<="9";)Q+=b,b=y.charAt(d++);o.push(A.NUMBER),f.push(Q);continue}if(b=="*"){if(o.length>0){var Z=o[o.length-1];if(Z!=A.AT&&Z!=A.DOUBLECOLON&&Z!=A.LEFTPARENTHESIS&&Z!=A.LEFTBRACKET&&Z!=A.AND&&Z!=A.OR&&Z!=A.MOD&&Z!=A.DIV&&Z!=A.MULTIPLYOPERATOR&&Z!=A.SLASH&&Z!=A.DOUBLESLASH&&Z!=A.BAR&&Z!=A.PLUS&&Z!=A.MINUS&&Z!=A.EQUALS&&Z!=A.NOTEQUAL&&Z!=A.LESSTHAN&&Z!=A.LESSTHANOREQUAL&&Z!=A.GREATERTHAN&&Z!=A.GREATERTHANOREQUAL){o.push(A.MULTIPLYOPERATOR),f.push(b),b=y.charAt(d++);continue}}o.push(A.ASTERISKNAMETEST),f.push(b),b=y.charAt(d++);continue}if(b==":"&&y.charAt(d)==":"){o.push(A.DOUBLECOLON),f.push("::"),d++,b=y.charAt(d++);continue}if(b=="/"){if(b=y.charAt(d++),b=="/"){o.push(A.DOUBLESLASH),f.push("//"),b=y.charAt(d++);continue}o.push(A.SLASH),f.push("/");continue}if(b=="!"&&y.charAt(d)=="="){o.push(A.NOTEQUAL),f.push("!="),d++,b=y.charAt(d++);continue}if(b=="<"){if(y.charAt(d)=="="){o.push(A.LESSTHANOREQUAL),f.push("<="),d++,b=y.charAt(d++);continue}o.push(A.LESSTHAN),f.push("<"),b=y.charAt(d++);continue}if(b==">"){if(y.charAt(d)=="="){o.push(A.GREATERTHANOREQUAL),f.push(">="),d++,b=y.charAt(d++);continue}o.push(A.GREATERTHAN),f.push(">"),b=y.charAt(d++);continue}if(b=="_"||ue.isLetter(b.charCodeAt(0))){var ie=b;for(b=y.charAt(d++);ue.isNCNameChar(b.charCodeAt(0));)ie+=b,b=y.charAt(d++);if(o.length>0){var Z=o[o.length-1];if(Z!=A.AT&&Z!=A.DOUBLECOLON&&Z!=A.LEFTPARENTHESIS&&Z!=A.LEFTBRACKET&&Z!=A.AND&&Z!=A.OR&&Z!=A.MOD&&Z!=A.DIV&&Z!=A.MULTIPLYOPERATOR&&Z!=A.SLASH&&Z!=A.DOUBLESLASH&&Z!=A.BAR&&Z!=A.PLUS&&Z!=A.MINUS&&Z!=A.EQUALS&&Z!=A.NOTEQUAL&&Z!=A.LESSTHAN&&Z!=A.LESSTHANOREQUAL&&Z!=A.GREATERTHAN&&Z!=A.GREATERTHANOREQUAL){if(ie=="and"){o.push(A.AND),f.push(ie);continue}if(ie=="or"){o.push(A.OR),f.push(ie);continue}if(ie=="mod"){o.push(A.MOD),f.push(ie);continue}if(ie=="div"){o.push(A.DIV),f.push(ie);continue}}}if(b==":"){if(y.charAt(d)=="*"){o.push(A.NCNAMECOLONASTERISK),f.push(ie+":*"),d++,b=y.charAt(d++);continue}if(y.charAt(d)=="_"||ue.isLetter(y.charCodeAt(d))){for(ie+=":",b=y.charAt(d++);ue.isNCNameChar(b.charCodeAt(0));)ie+=b,b=y.charAt(d++);if(b=="("){o.push(A.FUNCTIONNAME),f.push(ie);continue}o.push(A.QNAME),f.push(ie);continue}if(y.charAt(d)==":"){o.push(A.AXISNAME),f.push(ie);continue}}if(b=="("){if(ie=="comment"||ie=="text"||ie=="node"){o.push(A.NODETYPE),f.push(ie);continue}if(ie=="processing-instruction"){y.charAt(d)==")"?o.push(A.NODETYPE):o.push(A.PROCESSINGINSTRUCTIONWITHLITERAL),f.push(ie);continue}o.push(A.FUNCTIONNAME),f.push(ie);continue}o.push(A.QNAME),f.push(ie);continue}throw new Error("Unexpected character "+b)}return o.push(1),f.push("[EOF]"),[o,f]},A.SHIFT="s",A.REDUCE="r",A.ACCEPT="a",A.prototype.parse=function(Ne){if(!Ne)throw new Error("XPath expression unspecified.");if(typeof Ne!="string")throw new Error("XPath expression must be a string.");var o,f,y=this.tokenize(Ne);if(y!=null){o=y[0],f=y[1];var d=0,b=[],Q=[],xe=[],Ne,Z,ie;for(b.push(0),Q.push(1),xe.push("_S"),Z=o[d],ie=f[d++];;)switch(Ne=b[b.length-1],A.actionTable[Ne].charAt(Z-1)){case A.SHIFT:Q.push(-Z),xe.push(ie),b.push(A.actionTableNumber[Ne].charCodeAt(Z-1)-32),Z=o[d],ie=f[d++];break;case A.REDUCE:for(var Pe=A.productions[A.actionTableNumber[Ne].charCodeAt(Z-1)-32][1],je=[],Se=0;Se<Pe;Se++)Q.pop(),je.unshift(xe.pop()),b.pop();var ze=b[b.length-1];Q.push(A.productions[A.actionTableNumber[Ne].charCodeAt(Z-1)-32][0]),this.reduceActions[A.actionTableNumber[Ne].charCodeAt(Z-1)-32]==null?xe.push(je[0]):xe.push(this.reduceActions[A.actionTableNumber[Ne].charCodeAt(Z-1)-32](je)),b.push(A.gotoTable[ze].charCodeAt(A.productions[A.actionTableNumber[Ne].charCodeAt(Z-1)-32][0]-2)-33);break;case A.ACCEPT:return new de(xe.pop());default:throw new Error("XPath parse error")}}},de.prototype=new Object,de.prototype.constructor=de,de.superclass=Object.prototype;function de(e){this.expression=e}de.prototype.toString=function(){return this.expression.toString()};function k(e,o,f){o in e||(e[o]=f)}de.prototype.evaluate=function(e){var o=e.expressionContextNode;if(!(i(o)||p(o)))throw new Error("Context node does not appear to be a valid DOM node.");return e.contextNode=e.expressionContextNode,e.contextSize=1,e.contextPosition=1,e.isHtml&&(k(e,"caseInsensitive",!0),k(e,"allowAnyNamespaceForNoPrefix",!0)),k(e,"caseInsensitive",!1),this.expression.evaluate(e)},de.XML_NAMESPACE_URI="http://www.w3.org/XML/1998/namespace",de.XMLNS_NAMESPACE_URI="http://www.w3.org/2000/xmlns/",I.prototype=new Object,I.prototype.constructor=I,I.superclass=Object.prototype;function I(){}I.prototype.init=function(){},I.prototype.toString=function(){return"<Expression>"},I.prototype.evaluate=function(e){throw new Error("Could not evaluate expression.")},ee.prototype=new I,ee.prototype.constructor=ee,ee.superclass=I.prototype;function ee(e){arguments.length>0&&this.init(e)}ee.prototype.init=function(e){this.rhs=e},K.prototype=new ee,K.prototype.constructor=K,K.superclass=ee.prototype;function K(e){arguments.length>0&&this.init(e)}K.prototype.init=function(e){K.superclass.init.call(this,e)},K.prototype.evaluate=function(e){return this.rhs.evaluate(e).number().negate()},K.prototype.toString=function(){return"-"+this.rhs.toString()},q.prototype=new I,q.prototype.constructor=q,q.superclass=I.prototype;function q(e,o){arguments.length>0&&this.init(e,o)}q.prototype.init=function(e,o){this.lhs=e,this.rhs=o},pe.prototype=new q,pe.prototype.constructor=pe,pe.superclass=q.prototype;function pe(e,o){arguments.length>0&&this.init(e,o)}pe.prototype.init=function(e,o){pe.superclass.init.call(this,e,o)},pe.prototype.toString=function(){return"("+this.lhs.toString()+" or "+this.rhs.toString()+")"},pe.prototype.evaluate=function(e){var o=this.lhs.evaluate(e).bool();return o.booleanValue()?o:this.rhs.evaluate(e).bool()},he.prototype=new q,he.prototype.constructor=he,he.superclass=q.prototype;function he(e,o){arguments.length>0&&this.init(e,o)}he.prototype.init=function(e,o){he.superclass.init.call(this,e,o)},he.prototype.toString=function(){return"("+this.lhs.toString()+" and "+this.rhs.toString()+")"},he.prototype.evaluate=function(e){var o=this.lhs.evaluate(e).bool();return o.booleanValue()?this.rhs.evaluate(e).bool():o},F.prototype=new q,F.prototype.constructor=F,F.superclass=q.prototype;function F(e,o){arguments.length>0&&this.init(e,o)}F.prototype.init=function(e,o){F.superclass.init.call(this,e,o)},F.prototype.toString=function(){return"("+this.lhs.toString()+" = "+this.rhs.toString()+")"},F.prototype.evaluate=function(e){return this.lhs.evaluate(e).equals(this.rhs.evaluate(e))},x.prototype=new q,x.prototype.constructor=x,x.superclass=q.prototype;function x(e,o){arguments.length>0&&this.init(e,o)}x.prototype.init=function(e,o){x.superclass.init.call(this,e,o)},x.prototype.toString=function(){return"("+this.lhs.toString()+" != "+this.rhs.toString()+")"},x.prototype.evaluate=function(e){return this.lhs.evaluate(e).notequal(this.rhs.evaluate(e))},S.prototype=new q,S.prototype.constructor=S,S.superclass=q.prototype;function S(e,o){arguments.length>0&&this.init(e,o)}S.prototype.init=function(e,o){S.superclass.init.call(this,e,o)},S.prototype.evaluate=function(e){return this.lhs.evaluate(e).lessthan(this.rhs.evaluate(e))},S.prototype.toString=function(){return"("+this.lhs.toString()+" < "+this.rhs.toString()+")"},R.prototype=new q,R.prototype.constructor=R,R.superclass=q.prototype;function R(e,o){arguments.length>0&&this.init(e,o)}R.prototype.init=function(e,o){R.superclass.init.call(this,e,o)},R.prototype.evaluate=function(e){return this.lhs.evaluate(e).greaterthan(this.rhs.evaluate(e))},R.prototype.toString=function(){return"("+this.lhs.toString()+" > "+this.rhs.toString()+")"},j.prototype=new q,j.prototype.constructor=j,j.superclass=q.prototype;function j(e,o){arguments.length>0&&this.init(e,o)}j.prototype.init=function(e,o){j.superclass.init.call(this,e,o)},j.prototype.evaluate=function(e){return this.lhs.evaluate(e).lessthanorequal(this.rhs.evaluate(e))},j.prototype.toString=function(){return"("+this.lhs.toString()+" <= "+this.rhs.toString()+")"},M.prototype=new q,M.prototype.constructor=M,M.superclass=q.prototype;function M(e,o){arguments.length>0&&this.init(e,o)}M.prototype.init=function(e,o){M.superclass.init.call(this,e,o)},M.prototype.evaluate=function(e){return this.lhs.evaluate(e).greaterthanorequal(this.rhs.evaluate(e))},M.prototype.toString=function(){return"("+this.lhs.toString()+" >= "+this.rhs.toString()+")"},J.prototype=new q,J.prototype.constructor=J,J.superclass=q.prototype;function J(e,o){arguments.length>0&&this.init(e,o)}J.prototype.init=function(e,o){J.superclass.init.call(this,e,o)},J.prototype.evaluate=function(e){return this.lhs.evaluate(e).number().plus(this.rhs.evaluate(e).number())},J.prototype.toString=function(){return"("+this.lhs.toString()+" + "+this.rhs.toString()+")"},D.prototype=new q,D.prototype.constructor=D,D.superclass=q.prototype;function D(e,o){arguments.length>0&&this.init(e,o)}D.prototype.init=function(e,o){D.superclass.init.call(this,e,o)},D.prototype.evaluate=function(e){return this.lhs.evaluate(e).number().minus(this.rhs.evaluate(e).number())},D.prototype.toString=function(){return"("+this.lhs.toString()+" - "+this.rhs.toString()+")"},w.prototype=new q,w.prototype.constructor=w,w.superclass=q.prototype;function w(e,o){arguments.length>0&&this.init(e,o)}w.prototype.init=function(e,o){w.superclass.init.call(this,e,o)},w.prototype.evaluate=function(e){return this.lhs.evaluate(e).number().multiply(this.rhs.evaluate(e).number())},w.prototype.toString=function(){return"("+this.lhs.toString()+" * "+this.rhs.toString()+")"},P.prototype=new q,P.prototype.constructor=P,P.superclass=q.prototype;function P(e,o){arguments.length>0&&this.init(e,o)}P.prototype.init=function(e,o){P.superclass.init.call(this,e,o)},P.prototype.evaluate=function(e){return this.lhs.evaluate(e).number().div(this.rhs.evaluate(e).number())},P.prototype.toString=function(){return"("+this.lhs.toString()+" div "+this.rhs.toString()+")"},L.prototype=new q,L.prototype.constructor=L,L.superclass=q.prototype;function L(e,o){arguments.length>0&&this.init(e,o)}L.prototype.init=function(e,o){L.superclass.init.call(this,e,o)},L.prototype.evaluate=function(e){return this.lhs.evaluate(e).number().mod(this.rhs.evaluate(e).number())},L.prototype.toString=function(){return"("+this.lhs.toString()+" mod "+this.rhs.toString()+")"},W.prototype=new q,W.prototype.constructor=W,W.superclass=q.prototype;function W(e,o){arguments.length>0&&this.init(e,o)}W.prototype.init=function(e,o){W.superclass.init.call(this,e,o)},W.prototype.evaluate=function(e){return this.lhs.evaluate(e).nodeset().union(this.rhs.evaluate(e).nodeset())},W.prototype.toString=function(){return B(ae,[this.lhs,this.rhs]).join(" | ")},C.prototype=new I,C.prototype.constructor=C,C.superclass=I.prototype;function C(e,o,f){arguments.length>0&&this.init(e,o,f)}C.prototype.init=function(e,o,f){C.superclass.init.call(this),this.filter=e,this.filterPredicates=o,this.locationPath=f};function ne(e){for(;e&&e.parentNode;)e=e.parentNode;return e}var Ee=function(e,o,f,y){if(e.length===0)return f;var d=o.extend({});return m(function(b,Q){return d.contextSize=b.length,T(function(xe,Ne){return d.contextNode=xe,d.contextPosition=Ne+1,C.predicateMatches(Q,d)},b)},ge(f,y),e)};C.getRoot=function(e,o){var f=o[0];if(f&&f.nodeType===H.DOCUMENT_NODE)return f;if(e.virtualRoot)return e.virtualRoot;if(!f)throw new Error("Context node not found when determining document root.");var y=f.ownerDocument;if(y)return y;for(var d=f;d.parentNode!=null;)d=d.parentNode;return d};var be=function(e){var o=String(e.name);return o==="xmlns"?"":o.substring(0,6)==="xmlns:"?o.substring(6,o.length):null};C.applyStep=function(e,o,f){if(!f)throw new Error("Context node not found when evaluating XPath step: "+e);var y=[];switch(o.contextNode=f,e.axis){case g.ANCESTOR:if(o.contextNode===o.virtualRoot)break;var d;for(o.contextNode.nodeType==H.ATTRIBUTE_NODE?d=C.getOwnerElement(o.contextNode):d=o.contextNode.parentNode;d!=null&&(e.nodeTest.matches(d,o)&&y.push(d),d!==o.virtualRoot);)d=d.parentNode;break;case g.ANCESTORORSELF:for(var d=o.contextNode;d!=null&&(e.nodeTest.matches(d,o)&&y.push(d),d!==o.virtualRoot);d=d.nodeType==H.ATTRIBUTE_NODE?C.getOwnerElement(d):d.parentNode);break;case g.ATTRIBUTE:var b=o.contextNode.attributes;if(b!=null)for(var Q=0;Q<b.length;Q++){var d=b.item(Q);e.nodeTest.matches(d,o)&&y.push(d)}break;case g.CHILD:for(var d=o.contextNode.firstChild;d!=null;d=d.nextSibling)e.nodeTest.matches(d,o)&&y.push(d);break;case g.DESCENDANT:for(var ie=[o.contextNode.firstChild];ie.length>0;)for(var d=ie.pop();d!=null;)e.nodeTest.matches(d,o)&&y.push(d),d.firstChild!=null?(ie.push(d.nextSibling),d=d.firstChild):d=d.nextSibling;break;case g.DESCENDANTORSELF:e.nodeTest.matches(o.contextNode,o)&&y.push(o.contextNode);for(var ie=[o.contextNode.firstChild];ie.length>0;)for(var d=ie.pop();d!=null;)e.nodeTest.matches(d,o)&&y.push(d),d.firstChild!=null?(ie.push(d.nextSibling),d=d.firstChild):d=d.nextSibling;break;case g.FOLLOWING:if(o.contextNode===o.virtualRoot)break;var ie=[];o.contextNode.firstChild!=null?ie.unshift(o.contextNode.firstChild):ie.unshift(o.contextNode.nextSibling);for(var d=o.contextNode.parentNode;d!=null&&d.nodeType!=H.DOCUMENT_NODE&&d!==o.virtualRoot;d=d.parentNode)ie.unshift(d.nextSibling);do for(var d=ie.pop();d!=null;)e.nodeTest.matches(d,o)&&y.push(d),d.firstChild!=null?(ie.push(d.nextSibling),d=d.firstChild):d=d.nextSibling;while(ie.length>0);break;case g.FOLLOWINGSIBLING:if(o.contextNode===o.virtualRoot)break;for(var d=o.contextNode.nextSibling;d!=null;d=d.nextSibling)e.nodeTest.matches(d,o)&&y.push(d);break;case g.NAMESPACE:var xe={};if(o.contextNode.nodeType==H.ELEMENT_NODE){xe.xml=new Ge("xml",null,de.XML_NAMESPACE_URI,o.contextNode);for(var d=o.contextNode;d!=null&&d.nodeType==H.ELEMENT_NODE;d=d.parentNode)for(var Q=0;Q<d.attributes.length;Q++){var Ne=d.attributes.item(Q),Z=be(Ne);Z!=null&&xe[Z]==null&&(xe[Z]=new Ge(Z,Ne,Ne.value,o.contextNode))}for(var Z in xe){var f=xe[Z];e.nodeTest.matches(f,o)&&y.push(f)}}break;case g.PARENT:d=null,o.contextNode!==o.virtualRoot&&(o.contextNode.nodeType==H.ATTRIBUTE_NODE?d=C.getOwnerElement(o.contextNode):d=o.contextNode.parentNode),d!=null&&e.nodeTest.matches(d,o)&&y.push(d);break;case g.PRECEDING:var ie;o.virtualRoot!=null?ie=[o.virtualRoot]:ie=[ne(o.contextNode)];e:for(;ie.length>0;)for(var d=ie.pop();d!=null;){if(d==o.contextNode)break e;e.nodeTest.matches(d,o)&&y.unshift(d),d.firstChild!=null?(ie.push(d.nextSibling),d=d.firstChild):d=d.nextSibling}break;case g.PRECEDINGSIBLING:if(o.contextNode===o.virtualRoot)break;for(var d=o.contextNode.previousSibling;d!=null;d=d.previousSibling)e.nodeTest.matches(d,o)&&y.push(d);break;case g.SELF:e.nodeTest.matches(o.contextNode,o)&&y.push(o.contextNode);break}return y};function Te(e,o,f){return Ee(e.predicates,o,C.applyStep(e,o,f),U(G,e.axis))}function ke(e,o,f){return De(B(Te.bind(null,f,e),o))}C.applySteps=function(e,o,f){return m(ke.bind(null,o),f,e)},C.prototype.applyFilter=function(e,o){if(!this.filter)return{nodes:[e.contextNode]};var f=this.filter.evaluate(e);if(!ue.instance_of(f,te)){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:f}}return{nodes:Ee(this.filterPredicates||[],o,f.toUnsortedArray(),!1)}},C.applyLocationPath=function(e,o,f){if(!e)return f;var y=e.absolute?[C.getRoot(o,f)]:f;return C.applySteps(e.steps,o,y)},C.prototype.evaluate=function(e){var o=Ae(new qe,e),f=this.applyFilter(e,o);if("nonNodes"in f)return f.nonNodes;var y=new te;return y.addArray(C.applyLocationPath(this.locationPath,o,f.nodes)),y},C.predicateMatches=function(e,o){var f=e.evaluate(o);return ue.instance_of(f,z)?o.contextPosition===f.numberValue():f.booleanValue()},C.predicateString=function(e){return _("[","]",e.toString())},C.predicatesString=function(e){return le("",B(C.predicateString,e))},C.prototype.toString=function(){if(this.filter!=null){var e=ae(this.filter);return ue.instance_of(this.filter,X)?_("'","'",e):this.filterPredicates!=null&&this.filterPredicates.length?_("(",")",e)+C.predicatesString(this.filterPredicates):this.locationPath!=null?e+(this.locationPath.absolute?"":"/")+ae(this.locationPath):e}return ae(this.locationPath)},C.getOwnerElement=function(e){if(e.ownerElement)return e.ownerElement;try{if(e.selectSingleNode)return e.selectSingleNode("..")}catch{}for(var o=e.nodeType==H.DOCUMENT_NODE?e:e.ownerDocument,f=o.getElementsByTagName("*"),y=0;y<f.length;y++)for(var d=f.item(y),b=d.attributes,Q=0;Q<b.length;Q++){var xe=b.item(Q);if(xe===e)return d}return null},ve.prototype=new Object,ve.prototype.constructor=ve,ve.superclass=Object.prototype;function ve(e,o){arguments.length>0&&this.init(e,o)}ve.prototype.init=function(e,o){this.absolute=e,this.steps=o},ve.prototype.toString=function(){return(this.absolute?"/":"")+B(ae,this.steps).join("/")},g.prototype=new Object,g.prototype.constructor=g,g.superclass=Object.prototype;function g(e,o,f){arguments.length>0&&this.init(e,o,f)}g.prototype.init=function(e,o,f){this.axis=e,this.nodeTest=o,this.predicates=f},g.prototype.toString=function(){return g.STEPNAMES[this.axis]+"::"+this.nodeTest.toString()+C.predicatesString(this.predicates)},g.ANCESTOR=0,g.ANCESTORORSELF=1,g.ATTRIBUTE=2,g.CHILD=3,g.DESCENDANT=4,g.DESCENDANTORSELF=5,g.FOLLOWING=6,g.FOLLOWINGSIBLING=7,g.NAMESPACE=8,g.PARENT=9,g.PRECEDING=10,g.PRECEDINGSIBLING=11,g.SELF=12,g.STEPNAMES=m(function(e,o){return e[o[0]]=o[1],e},{},[[g.ANCESTOR,"ancestor"],[g.ANCESTORORSELF,"ancestor-or-self"],[g.ATTRIBUTE,"attribute"],[g.CHILD,"child"],[g.DESCENDANT,"descendant"],[g.DESCENDANTORSELF,"descendant-or-self"],[g.FOLLOWING,"following"],[g.FOLLOWINGSIBLING,"following-sibling"],[g.NAMESPACE,"namespace"],[g.PARENT,"parent"],[g.PRECEDING,"preceding"],[g.PRECEDINGSIBLING,"preceding-sibling"],[g.SELF,"self"]]);var G=[g.ANCESTOR,g.ANCESTORORSELF,g.PARENT,g.PRECEDING,g.PRECEDINGSIBLING];$.prototype=new Object,$.prototype.constructor=$,$.superclass=Object.prototype;function $(e,o){arguments.length>0&&this.init(e,o)}$.prototype.init=function(e,o){this.type=e,this.value=o},$.prototype.toString=function(){return"<unknown nodetest type>"},$.prototype.matches=function(e,o){console.warn("unknown node test type")},$.NAMETESTANY=0,$.NAMETESTPREFIXANY=1,$.NAMETESTQNAME=2,$.COMMENT=3,$.TEXT=4,$.PI=5,$.NODE=6,$.isNodeType=function(e){return function(o){return U(e,o.nodeType)}},$.makeNodeTestType=function(e,o,f){var y=f||function(){};return y.prototype=new $(e),y.prototype.constructor=y,Ae(y.prototype,o),y},$.makeNodeTypeTest=function(e,o,f){return new($.makeNodeTestType(e,{matches:$.isNodeType(o),toString:V(f)}))},$.hasPrefix=function(e){return e.prefix||(e.nodeName||e.tagName).indexOf(":")!==-1},$.isElementOrAttribute=$.isNodeType([1,2]),$.nameSpaceMatches=function(e,o,f){var y=f.namespaceURI||"";if(!e)return!y||o.allowAnyNamespaceForNoPrefix&&!$.hasPrefix(f);var d=o.namespaceResolver.getNamespace(e,o.expressionContextNode);if(d==null)throw new Error("Cannot resolve QName "+e);return d===y},$.localNameMatches=function(e,o,f){var y=f.localName||f.nodeName;return o.caseInsensitive?e.toLowerCase()===y.toLowerCase():e===y},$.NameTestPrefixAny=$.makeNodeTestType($.NAMETESTPREFIXANY,{matches:function(e,o){return $.isElementOrAttribute(e)&&$.nameSpaceMatches(this.prefix,o,e)},toString:function(){return this.prefix+":*"}},function(o){this.prefix=o}),$.NameTestQName=$.makeNodeTestType($.NAMETESTQNAME,{matches:function(e,o){return $.isNodeType([H.ELEMENT_NODE,H.ATTRIBUTE_NODE,H.NAMESPACE_NODE])(e)&&$.nameSpaceMatches(this.prefix,o,e)&&$.localNameMatches(this.localName,o,e)},toString:function(){return this.name}},function(o){var f=o.split(":");this.name=o,this.prefix=f.length>1?f[0]:null,this.localName=f[f.length>1?1:0]}),$.PITest=$.makeNodeTestType($.PI,{matches:function(e,o){return $.isNodeType([H.PROCESSING_INSTRUCTION_NODE])(e)&&(e.target||e.nodeName)===this.name},toString:function(){return _('processing-instruction("','")',this.name)}},function(e){this.name=e}),$.nameTestAny=$.makeNodeTypeTest($.NAMETESTANY,[H.ELEMENT_NODE,H.ATTRIBUTE_NODE,H.NAMESPACE_NODE],"*"),$.textTest=$.makeNodeTypeTest($.TEXT,[H.TEXT_NODE,H.CDATA_SECTION_NODE],"text()"),$.commentTest=$.makeNodeTypeTest($.COMMENT,[H.COMMENT_NODE],"comment()"),$.nodeTest=$.makeNodeTypeTest($.NODE,[H.ELEMENT_NODE,H.ATTRIBUTE_NODE,H.TEXT_NODE,H.CDATA_SECTION_NODE,H.PROCESSING_INSTRUCTION_NODE,H.COMMENT_NODE,H.DOCUMENT_NODE],"node()"),$.anyPiTest=$.makeNodeTypeTest($.PI,[H.PROCESSING_INSTRUCTION_NODE],"processing-instruction()"),_e.prototype=new I,_e.prototype.constructor=_e,_e.superclass=I.prototype;function _e(e){arguments.length>0&&this.init(e)}_e.prototype.init=function(e){this.variable=e},_e.prototype.toString=function(){return"$"+this.variable},_e.prototype.evaluate=function(e){var o=ue.resolveQName(this.variable,e.namespaceResolver,e.contextNode,!1);if(o[0]==null)throw new Error("Cannot resolve QName "+fn);var f=e.variableResolver.getVariable(o[1],o[0]);if(!f)throw Me.fromMessage("Undeclared variable: "+this.toString());return f},ce.prototype=new I,ce.prototype.constructor=ce,ce.superclass=I.prototype;function ce(e,o){arguments.length>0&&this.init(e,o)}ce.prototype.init=function(e,o){this.functionName=e,this.arguments=o},ce.prototype.toString=function(){for(var e=this.functionName+"(",o=0;o<this.arguments.length;o++)o>0&&(e+=", "),e+=this.arguments[o].toString();return e+")"},ce.prototype.evaluate=function(e){var o=Ie.getFunctionFromContext(this.functionName,e);if(!o)throw new Error("Unknown function "+this.functionName);var f=[e].concat(this.arguments);return o.apply(e.functionResolver.thisArg,f)};var se=new Object;se.equals=function(e,o){return e.equals(o)},se.notequal=function(e,o){return e.notequal(o)},se.lessthan=function(e,o){return e.lessthan(o)},se.greaterthan=function(e,o){return e.greaterthan(o)},se.lessthanorequal=function(e,o){return e.lessthanorequal(o)},se.greaterthanorequal=function(e,o){return e.greaterthanorequal(o)},X.prototype=new I,X.prototype.constructor=X,X.superclass=I.prototype;function X(e){arguments.length>0&&this.init(e)}X.prototype.init=function(e){this.str=String(e)},X.prototype.toString=function(){return this.str},X.prototype.evaluate=function(e){return this},X.prototype.string=function(){return this},X.prototype.number=function(){return new z(this.str)},X.prototype.bool=function(){return new fe(this.str)},X.prototype.nodeset=function(){throw new Error("Cannot convert string to nodeset")},X.prototype.stringValue=function(){return this.str},X.prototype.numberValue=function(){return this.number().numberValue()},X.prototype.booleanValue=function(){return this.bool().booleanValue()},X.prototype.equals=function(e){return ue.instance_of(e,fe)?this.bool().equals(e):ue.instance_of(e,z)?this.number().equals(e):ue.instance_of(e,te)?e.compareWithString(this,se.equals):new fe(this.str==e.str)},X.prototype.notequal=function(e){return ue.instance_of(e,fe)?this.bool().notequal(e):ue.instance_of(e,z)?this.number().notequal(e):ue.instance_of(e,te)?e.compareWithString(this,se.notequal):new fe(this.str!=e.str)},X.prototype.lessthan=function(e){return this.number().lessthan(e)},X.prototype.greaterthan=function(e){return this.number().greaterthan(e)},X.prototype.lessthanorequal=function(e){return this.number().lessthanorequal(e)},X.prototype.greaterthanorequal=function(e){return this.number().greaterthanorequal(e)},z.prototype=new I,z.prototype.constructor=z,z.superclass=I.prototype;function z(e){arguments.length>0&&this.init(e)}z.prototype.init=function(e){this.num=typeof e=="string"?this.parse(e):Number(e)},z.prototype.numberFormat=/^\s*-?[0-9]*\.?[0-9]+\s*$/,z.prototype.parse=function(e){return this.numberFormat.test(e)?parseFloat(e):Number.NaN};function rt(e){for(var o=e.split("e-"),f=o[0].replace(".",""),y=Number(o[1]),d=0;d<y-1;d+=1)f="0"+f;return"0."+f}function lt(e){for(var o=e.split("e"),f=o[0].replace(".",""),y=Number(o[1]),d=y+1-f.length,b=0;b<d;b+=1)f+="0";return f}z.prototype.toString=function(){var e=this.num.toString();return e.indexOf("e-")!==-1?rt(e):e.indexOf("e")!==-1?lt(e):e},z.prototype.evaluate=function(e){return this},z.prototype.string=function(){return new X(this.toString())},z.prototype.number=function(){return this},z.prototype.bool=function(){return new fe(this.num)},z.prototype.nodeset=function(){throw new Error("Cannot convert number to nodeset")},z.prototype.stringValue=function(){return this.string().stringValue()},z.prototype.numberValue=function(){return this.num},z.prototype.booleanValue=function(){return this.bool().booleanValue()},z.prototype.negate=function(){return new z(-this.num)},z.prototype.equals=function(e){return ue.instance_of(e,fe)?this.bool().equals(e):ue.instance_of(e,X)?this.equals(e.number()):ue.instance_of(e,te)?e.compareWithNumber(this,se.equals):new fe(this.num==e.num)},z.prototype.notequal=function(e){return ue.instance_of(e,fe)?this.bool().notequal(e):ue.instance_of(e,X)?this.notequal(e.number()):ue.instance_of(e,te)?e.compareWithNumber(this,se.notequal):new fe(this.num!=e.num)},z.prototype.lessthan=function(e){return ue.instance_of(e,te)?e.compareWithNumber(this,se.greaterthan):ue.instance_of(e,fe)||ue.instance_of(e,X)?this.lessthan(e.number()):new fe(this.num<e.num)},z.prototype.greaterthan=function(e){return ue.instance_of(e,te)?e.compareWithNumber(this,se.lessthan):ue.instance_of(e,fe)||ue.instance_of(e,X)?this.greaterthan(e.number()):new fe(this.num>e.num)},z.prototype.lessthanorequal=function(e){return ue.instance_of(e,te)?e.compareWithNumber(this,se.greaterthanorequal):ue.instance_of(e,fe)||ue.instance_of(e,X)?this.lessthanorequal(e.number()):new fe(this.num<=e.num)},z.prototype.greaterthanorequal=function(e){return ue.instance_of(e,te)?e.compareWithNumber(this,se.lessthanorequal):ue.instance_of(e,fe)||ue.instance_of(e,X)?this.greaterthanorequal(e.number()):new fe(this.num>=e.num)},z.prototype.plus=function(e){return new z(this.num+e.num)},z.prototype.minus=function(e){return new z(this.num-e.num)},z.prototype.multiply=function(e){return new z(this.num*e.num)},z.prototype.div=function(e){return new z(this.num/e.num)},z.prototype.mod=function(e){return new z(this.num%e.num)},fe.prototype=new I,fe.prototype.constructor=fe,fe.superclass=I.prototype;function fe(e){arguments.length>0&&this.init(e)}fe.prototype.init=function(e){this.b=!!e},fe.prototype.toString=function(){return this.b.toString()},fe.prototype.evaluate=function(e){return this},fe.prototype.string=function(){return new X(this.b)},fe.prototype.number=function(){return new z(this.b)},fe.prototype.bool=function(){return this},fe.prototype.nodeset=function(){throw new Error("Cannot convert boolean to nodeset")},fe.prototype.stringValue=function(){return this.string().stringValue()},fe.prototype.numberValue=function(){return this.number().numberValue()},fe.prototype.booleanValue=function(){return this.b},fe.prototype.not=function(){return new fe(!this.b)},fe.prototype.equals=function(e){return ue.instance_of(e,X)||ue.instance_of(e,z)?this.equals(e.bool()):ue.instance_of(e,te)?e.compareWithBoolean(this,se.equals):new fe(this.b==e.b)},fe.prototype.notequal=function(e){return ue.instance_of(e,X)||ue.instance_of(e,z)?this.notequal(e.bool()):ue.instance_of(e,te)?e.compareWithBoolean(this,se.notequal):new fe(this.b!=e.b)},fe.prototype.lessthan=function(e){return this.number().lessthan(e)},fe.prototype.greaterthan=function(e){return this.number().greaterthan(e)},fe.prototype.lessthanorequal=function(e){return this.number().lessthanorequal(e)},fe.prototype.greaterthanorequal=function(e){return this.number().greaterthanorequal(e)},fe.true_=new fe(!0),fe.false_=new fe(!1),Re.prototype=new Object,Re.prototype.constructor=Re,Re.superclass=Object.prototype;function Re(e){this.init(e)}Re.prototype.init=function(e){this.left=null,this.right=null,this.node=e,this.depth=1},Re.prototype.balance=function(){var e=this.left==null?0:this.left.depth,o=this.right==null?0:this.right.depth;if(e>o+1){var f=this.left.left==null?0:this.left.left.depth,y=this.left.right==null?0:this.left.right.depth;f<y&&this.left.rotateRR(),this.rotateLL()}else if(e+1<o){var d=this.right.right==null?0:this.right.right.depth,b=this.right.left==null?0:this.right.left.depth;b>d&&this.right.rotateLL(),this.rotateRR()}},Re.prototype.rotateLL=function(){var e=this.node,o=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=o,this.right.node=e,this.right.updateInNewLocation(),this.updateInNewLocation()},Re.prototype.rotateRR=function(){var e=this.node,o=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=o,this.left.node=e,this.left.updateInNewLocation(),this.updateInNewLocation()},Re.prototype.updateInNewLocation=function(){this.getDepthFromChildren()},Re.prototype.getDepthFromChildren=function(){this.depth=this.node==null?0:1,this.left!=null&&(this.depth=this.left.depth+1),this.right!=null&&this.depth<=this.right.depth&&(this.depth=this.right.depth+1)};function mt(e,o){if(e===o)return 0;if(e.compareDocumentPosition){var f=e.compareDocumentPosition(o);return f&1||f&10?1:f&20?-1:0}for(var y=0,d=0,b=e;b!=null;b=b.parentNode||b.ownerElement)y++;for(var Q=o;Q!=null;Q=Q.parentNode||Q.ownerElement)d++;if(y>d){for(;y>d;)e=e.parentNode||e.ownerElement,y--;if(e===o)return 1}else if(d>y){for(;d>y;)o=o.parentNode||o.ownerElement,d--;if(e===o)return-1}for(var xe=e.parentNode||e.ownerElement,Ne=o.parentNode||o.ownerElement;xe!==Ne;)e=xe,o=Ne,xe=e.parentNode||e.ownerElement,Ne=o.parentNode||o.ownerElement;var Z=gt(e),ie=gt(o);if(Z&&!ie)return-1;if(!Z&&ie)return 1;if(e.isXPathNamespace){if(e.nodeValue===de.XML_NAMESPACE_URI||!o.isXPathNamespace)return-1;if(o.nodeValue===de.XML_NAMESPACE_URI)return 1}else if(o.isXPathNamespace)return 1;if(xe)for(var Pe=Z?xe.attributes:xe.childNodes,je=Pe.length,Se=e.baseNode||e,ze=o.baseNode||o,He=0;He<je;He+=1){var nt=Pe[He];if(nt===Se)return-1;if(nt===ze)return 1}throw new Error("Unexpected: could not determine node order")}Re.prototype.add=function(e){if(e===this.node)return!1;var o=mt(e,this.node),f=!1;return o==-1?this.left==null?(this.left=new Re(e),f=!0):(f=this.left.add(e),f&&this.balance()):o==1&&(this.right==null?(this.right=new Re(e),f=!0):(f=this.right.add(e),f&&this.balance())),f&&this.getDepthFromChildren(),f},te.prototype=new I,te.prototype.constructor=te,te.superclass=I.prototype;function te(){this.init()}te.prototype.init=function(){this.tree=null,this.nodes=[],this.size=0},te.prototype.toString=function(){var e=this.first();return e==null?"":this.stringForNode(e)},te.prototype.evaluate=function(e){return this},te.prototype.string=function(){return new X(this.toString())},te.prototype.stringValue=function(){return this.toString()},te.prototype.number=function(){return new z(this.string())},te.prototype.numberValue=function(){return Number(this.string())},te.prototype.bool=function(){return new fe(this.booleanValue())},te.prototype.booleanValue=function(){return!!this.size},te.prototype.nodeset=function(){return this},te.prototype.stringForNode=function(e){return e.nodeType==H.DOCUMENT_NODE||e.nodeType==H.ELEMENT_NODE||e.nodeType===H.DOCUMENT_FRAGMENT_NODE?this.stringForContainerNode(e):e.nodeType===H.ATTRIBUTE_NODE?e.value||e.nodeValue:e.isNamespaceNode?e.namespace:e.nodeValue},te.prototype.stringForContainerNode=function(e){for(var o="",f=e.firstChild;f!=null;f=f.nextSibling){var y=f.nodeType;(y===1||y===3||y===4||y===9||y===11)&&(o+=this.stringForNode(f))}return o},te.prototype.buildTree=function(){if(!this.tree&&this.nodes.length){this.tree=new Re(this.nodes[0]);for(var e=1;e<this.nodes.length;e+=1)this.tree.add(this.nodes[e])}return this.tree},te.prototype.first=function(){var e=this.buildTree();if(e==null)return null;for(;e.left!=null;)e=e.left;return e.node},te.prototype.add=function(e){for(var o=0;o<this.nodes.length;o+=1)if(e===this.nodes[o])return;this.tree=null,this.nodes.push(e),this.size+=1},te.prototype.addArray=function(e){var o=this;h(function(f){o.add(f)},e)},te.prototype.toArray=function(){var e=[];return this.toArrayRec(this.buildTree(),e),e},te.prototype.toArrayRec=function(e,o){e!=null&&(this.toArrayRec(e.left,o),o.push(e.node),this.toArrayRec(e.right,o))},te.prototype.toUnsortedArray=function(){return this.nodes.slice()},te.prototype.compareWithString=function(e,o){for(var f=this.toUnsortedArray(),y=0;y<f.length;y++){var d=f[y],b=new X(this.stringForNode(d)),Q=o(b,e);if(Q.booleanValue())return Q}return new fe(!1)},te.prototype.compareWithNumber=function(e,o){for(var f=this.toUnsortedArray(),y=0;y<f.length;y++){var d=f[y],b=new z(this.stringForNode(d)),Q=o(b,e);if(Q.booleanValue())return Q}return new fe(!1)},te.prototype.compareWithBoolean=function(e,o){return o(this.bool(),e)},te.prototype.compareWithNodeSet=function(e,o){for(var f=this.toUnsortedArray(),y=function(xe,Ne){return o(Ne,xe)},d=0;d<f.length;d++){var b=new X(this.stringForNode(f[d])),Q=e.compareWithString(b,y);if(Q.booleanValue())return Q}return new fe(!1)},te.compareWith=N(function(e,o){return ue.instance_of(o,X)?this.compareWithString(o,e):ue.instance_of(o,z)?this.compareWithNumber(o,e):ue.instance_of(o,fe)?this.compareWithBoolean(o,e):this.compareWithNodeSet(o,e)}),te.prototype.equals=te.compareWith(se.equals),te.prototype.notequal=te.compareWith(se.notequal),te.prototype.lessthan=te.compareWith(se.lessthan),te.prototype.greaterthan=te.compareWith(se.greaterthan),te.prototype.lessthanorequal=te.compareWith(se.lessthanorequal),te.prototype.greaterthanorequal=te.compareWith(se.greaterthanorequal),te.prototype.union=function(e){var o=new te;return o.addArray(this.toUnsortedArray()),o.addArray(e.toUnsortedArray()),o},Ge.prototype=new Object,Ge.prototype.constructor=Ge,Ge.superclass=Object.prototype;function Ge(e,o,f,y){this.isXPathNamespace=!0,this.baseNode=o,this.ownerDocument=y.ownerDocument,this.nodeName=e,this.prefix=e,this.localName=e,this.namespaceURI=null,this.nodeValue=f,this.ownerElement=y,this.nodeType=H.NAMESPACE_NODE}Ge.prototype.toString=function(){return'{ "'+this.prefix+'", "'+this.namespaceURI+'" }'},qe.prototype=new Object,qe.prototype.constructor=qe,qe.superclass=Object.prototype;function qe(e,o,f){this.variableResolver=e??new Xe,this.namespaceResolver=o??new $e,this.functionResolver=f??new Ie}qe.prototype.extend=function(e){return Ae(new qe,this,e)},Xe.prototype=new Object,Xe.prototype.constructor=Xe,Xe.superclass=Object.prototype;function Xe(){}Xe.prototype.getVariable=function(e,o){return null},Ie.prototype=new Object,Ie.prototype.constructor=Ie,Ie.superclass=Object.prototype;function Ie(e){this.thisArg=e??me,this.functions=new Object,this.addStandardFunctions()}Ie.prototype.addStandardFunctions=function(){this.functions["{}last"]=me.last,this.functions["{}position"]=me.position,this.functions["{}count"]=me.count,this.functions["{}id"]=me.id,this.functions["{}local-name"]=me.localName,this.functions["{}namespace-uri"]=me.namespaceURI,this.functions["{}name"]=me.name,this.functions["{}string"]=me.string,this.functions["{}concat"]=me.concat,this.functions["{}starts-with"]=me.startsWith,this.functions["{}contains"]=me.contains,this.functions["{}substring-before"]=me.substringBefore,this.functions["{}substring-after"]=me.substringAfter,this.functions["{}substring"]=me.substring,this.functions["{}string-length"]=me.stringLength,this.functions["{}normalize-space"]=me.normalizeSpace,this.functions["{}translate"]=me.translate,this.functions["{}boolean"]=me.boolean_,this.functions["{}not"]=me.not,this.functions["{}true"]=me.true_,this.functions["{}false"]=me.false_,this.functions["{}lang"]=me.lang,this.functions["{}number"]=me.number,this.functions["{}sum"]=me.sum,this.functions["{}floor"]=me.floor,this.functions["{}ceiling"]=me.ceiling,this.functions["{}round"]=me.round},Ie.prototype.addFunction=function(e,o,f){this.functions["{"+e+"}"+o]=f},Ie.getFunctionFromContext=function(e,o){var f=ue.resolveQName(e,o.namespaceResolver,o.contextNode,!1);if(f[0]===null)throw new Error("Cannot resolve QName "+name);return o.functionResolver.getFunction(f[1],f[0])},Ie.prototype.getFunction=function(e,o){return this.functions["{"+o+"}"+e]},$e.prototype=new Object,$e.prototype.constructor=$e,$e.superclass=Object.prototype;function $e(){}$e.prototype.getNamespace=function(e,o){if(e=="xml")return de.XML_NAMESPACE_URI;if(e=="xmlns")return de.XMLNS_NAMESPACE_URI;for(o.nodeType==H.DOCUMENT_NODE?o=o.documentElement:o.nodeType==H.ATTRIBUTE_NODE?o=C.getOwnerElement(o):o.nodeType!=H.ELEMENT_NODE&&(o=o.parentNode);o!=null&&o.nodeType==H.ELEMENT_NODE;){for(var f=o.attributes,y=0;y<f.length;y++){var d=f.item(y),b=d.name||d.nodeName;if(b==="xmlns"&&e===""||b==="xmlns:"+e)return String(d.value||d.nodeValue)}o=o.parentNode}return null};var me=new Object;me.last=function(e){if(arguments.length!=1)throw new Error("Function last expects ()");return new z(e.contextSize)},me.position=function(e){if(arguments.length!=1)throw new Error("Function position expects ()");return new z(e.contextPosition)},me.count=function(){var e=arguments[0],o;if(arguments.length!=2||!ue.instance_of(o=arguments[1].evaluate(e),te))throw new Error("Function count expects (node-set)");return new z(o.size)},me.id=function(){var e=arguments[0],o;if(arguments.length!=2)throw new Error("Function id expects (object)");o=arguments[1].evaluate(e),ue.instance_of(o,te)?o=o.toArray().join(" "):o=o.stringValue();for(var f=o.split(/[\x0d\x0a\x09\x20]+/),y=new te,d=e.contextNode.nodeType==H.DOCUMENT_NODE?e.contextNode:e.contextNode.ownerDocument,b=0;b<f.length;b++){var Q;d.getElementById?Q=d.getElementById(f[b]):Q=ue.getElementById(d,f[b]),Q!=null&&y.add(Q)}return y},me.localName=function(e,o){var f;if(arguments.length==1)f=e.contextNode;else if(arguments.length==2)f=o.evaluate(e).first();else throw new Error("Function local-name expects (node-set?)");return f==null?new X(""):new X(f.localName||f.baseName||f.target||f.nodeName||"")},me.namespaceURI=function(){var e=arguments[0],o;if(arguments.length==1)o=e.contextNode;else if(arguments.length==2)o=arguments[1].evaluate(e).first();else throw new Error("Function namespace-uri expects (node-set?)");return o==null?new X(""):new X(o.namespaceURI||"")},me.name=function(){var e=arguments[0],o;if(arguments.length==1)o=e.contextNode;else if(arguments.length==2)o=arguments[1].evaluate(e).first();else throw new Error("Function name expects (node-set?)");return o==null?new X(""):o.nodeType==H.ELEMENT_NODE?new X(o.nodeName):o.nodeType==H.ATTRIBUTE_NODE?new X(o.name||o.nodeName):o.nodeType===H.PROCESSING_INSTRUCTION_NODE?new X(o.target||o.nodeName):o.localName==null?new X(""):new X(o.localName)},me.string=function(){var e=arguments[0];if(arguments.length==1)return new X(te.prototype.stringForNode(e.contextNode));if(arguments.length==2)return arguments[1].evaluate(e).string();throw new Error("Function string expects (object?)")},me.concat=function(e){if(arguments.length<3)throw new Error("Function concat expects (string, string[, string]*)");for(var o="",f=1;f<arguments.length;f++)o+=arguments[f].evaluate(e).stringValue();return new X(o)},me.startsWith=function(){var e=arguments[0];if(arguments.length!=3)throw new Error("Function startsWith expects (string, string)");var o=arguments[1].evaluate(e).stringValue(),f=arguments[2].evaluate(e).stringValue();return new fe(o.substring(0,f.length)==f)},me.contains=function(){var e=arguments[0];if(arguments.length!=3)throw new Error("Function contains expects (string, string)");var o=arguments[1].evaluate(e).stringValue(),f=arguments[2].evaluate(e).stringValue();return new fe(o.indexOf(f)!==-1)},me.substringBefore=function(){var e=arguments[0];if(arguments.length!=3)throw new Error("Function substring-before expects (string, string)");var o=arguments[1].evaluate(e).stringValue(),f=arguments[2].evaluate(e).stringValue();return new X(o.substring(0,o.indexOf(f)))},me.substringAfter=function(){var e=arguments[0];if(arguments.length!=3)throw new Error("Function substring-after expects (string, string)");var o=arguments[1].evaluate(e).stringValue(),f=arguments[2].evaluate(e).stringValue();if(f.length==0)return new X(o);var y=o.indexOf(f);return y==-1?new X(""):new X(o.substring(y+f.length))},me.substring=function(){var e=arguments[0];if(!(arguments.length==3||arguments.length==4))throw new Error("Function substring expects (string, number, number?)");var o=arguments[1].evaluate(e).stringValue(),f=Math.round(arguments[2].evaluate(e).numberValue())-1,y=arguments.length==4?f+Math.round(arguments[3].evaluate(e).numberValue()):void 0;return new X(o.substring(f,y))},me.stringLength=function(){var e=arguments[0],o;if(arguments.length==1)o=te.prototype.stringForNode(e.contextNode);else if(arguments.length==2)o=arguments[1].evaluate(e).stringValue();else throw new Error("Function string-length expects (string?)");return new z(o.length)},me.normalizeSpace=function(){var e=arguments[0],o;if(arguments.length==1)o=te.prototype.stringForNode(e.contextNode);else if(arguments.length==2)o=arguments[1].evaluate(e).stringValue();else throw new Error("Function normalize-space expects (string?)");for(var f=0,y=o.length-1;ue.isSpace(o.charCodeAt(y));)y--;for(var d="";f<=y&&ue.isSpace(o.charCodeAt(f));)f++;for(;f<=y;)if(ue.isSpace(o.charCodeAt(f)))for(d+=" ";f<=y&&ue.isSpace(o.charCodeAt(f));)f++;else d+=o.charAt(f),f++;return new X(d)},me.translate=function(e,o,f,y){if(arguments.length!=4)throw new Error("Function translate expects (string, string, string)");var d=o.evaluate(e).stringValue(),b=f.evaluate(e).stringValue(),Q=y.evaluate(e).stringValue(),xe=m(function(Z,ie,Pe){return ie in Z||(Z[ie]=Pe>Q.length?"":Q[Pe]),Z},{},b),Ne=le("",B(function(Z){return Z in xe?xe[Z]:Z},d));return new X(Ne)},me.boolean_=function(){var e=arguments[0];if(arguments.length!=2)throw new Error("Function boolean expects (object)");return arguments[1].evaluate(e).bool()},me.not=function(e,o){if(arguments.length!=2)throw new Error("Function not expects (object)");return o.evaluate(e).bool().not()},me.true_=function(){if(arguments.length!=1)throw new Error("Function true expects ()");return fe.true_},me.false_=function(){if(arguments.length!=1)throw new Error("Function false expects ()");return fe.false_},me.lang=function(){var e=arguments[0];if(arguments.length!=2)throw new Error("Function lang expects (string)");for(var o,f=e.contextNode;f!=null&&f.nodeType!=H.DOCUMENT_NODE;f=f.parentNode){var y=f.getAttributeNS(de.XML_NAMESPACE_URI,"lang");if(y!=null){o=String(y);break}}if(o==null)return fe.false_;var d=arguments[1].evaluate(e).stringValue();return new fe(o.substring(0,d.length)==d&&(o.length==d.length||o.charAt(d.length)=="-"))},me.number=function(){var e=arguments[0];if(!(arguments.length==1||arguments.length==2))throw new Error("Function number expects (object?)");return arguments.length==1?new z(te.prototype.stringForNode(e.contextNode)):arguments[1].evaluate(e).number()},me.sum=function(){var e=arguments[0],o;if(arguments.length!=2||!ue.instance_of(o=arguments[1].evaluate(e),te))throw new Error("Function sum expects (node-set)");o=o.toUnsortedArray();for(var f=0,y=0;y<o.length;y++)f+=new z(te.prototype.stringForNode(o[y])).numberValue();return new z(f)},me.floor=function(){var e=arguments[0];if(arguments.length!=2)throw new Error("Function floor expects (number)");return new z(Math.floor(arguments[1].evaluate(e).numberValue()))},me.ceiling=function(){var e=arguments[0];if(arguments.length!=2)throw new Error("Function ceiling expects (number)");return new z(Math.ceil(arguments[1].evaluate(e).numberValue()))},me.round=function(){var e=arguments[0];if(arguments.length!=2)throw new Error("Function round expects (number)");return new z(Math.round(arguments[1].evaluate(e).numberValue()))};var ue=new Object,gt=function(e){return e&&(e.nodeType===H.ATTRIBUTE_NODE||e.ownerElement||e.isXPathNamespace)};ue.splitQName=function(e){var o=e.indexOf(":");return o==-1?[null,e]:[e.substring(0,o),e.substring(o+1)]},ue.resolveQName=function(e,o,f,y){var d=ue.splitQName(e);return d[0]!=null?d[0]=o.getNamespace(d[0],f):y?(d[0]=o.getNamespace("",f),d[0]==null&&(d[0]="")):d[0]="",d},ue.isSpace=function(e){return e==9||e==13||e==10||e==32},ue.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},ue.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||ue.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},ue.coalesceText=function(e){for(var o=e.firstChild;o!=null;o=o.nextSibling)if(o.nodeType==H.TEXT_NODE||o.nodeType==H.CDATA_SECTION_NODE){var f=o.nodeValue,y=o;for(o=o.nextSibling;o!=null&&(o.nodeType==H.TEXT_NODE||o.nodeType==H.CDATA_SECTION_NODE);){f+=o.nodeValue;var d=o;o=o.nextSibling,d.parentNode.removeChild(d)}if(y.nodeType==H.CDATA_SECTION_NODE){var b=y.parentNode;if(y.nextSibling==null)b.removeChild(y),b.appendChild(b.ownerDocument.createTextNode(f));else{var Q=y.nextSibling;b.removeChild(y),b.insertBefore(b.ownerDocument.createTextNode(f),Q)}}else y.nodeValue=f;if(o==null)break}else o.nodeType==H.ELEMENT_NODE&&ue.coalesceText(o)},ue.instance_of=function(e,o){for(;e!=null;){if(e.constructor===o)return!0;if(e===Object)return!1;e=e.constructor.superclass}return!1},ue.getElementById=function(e,o){if(e.nodeType==H.ELEMENT_NODE&&(e.getAttribute("id")==o||e.getAttributeNS(null,"id")==o))return e;for(var f=e.firstChild;f!=null;f=f.nextSibling){var y=ue.getElementById(f,o);if(y!=null)return y}return null};var Me=function(){function e(f,y){var d=y?": "+y.toString():"";switch(f){case o.INVALID_EXPRESSION_ERR:return"Invalid expression"+d;case o.TYPE_ERR:return"Type error"+d}return null}function o(f,y,d){var b=Error.call(this,e(f,y)||d);return b.code=f,b.exception=y,b}return o.prototype=Object.create(Error.prototype),o.prototype.constructor=o,o.superclass=Error,o.prototype.toString=function(){return this.message},o.fromMessage=function(f,y){return new o(null,y,f)},o.INVALID_EXPRESSION_ERR=51,o.TYPE_ERR=52,o}();Fe.prototype={},Fe.prototype.constructor=Fe,Fe.superclass=Object.prototype;function Fe(e,o,f){this.xpath=f.parse(e),this.context=new qe,this.context.namespaceResolver=new Je(o)}Fe.getOwnerDocument=function(e){return e.nodeType===H.DOCUMENT_NODE?e:e.ownerDocument},Fe.detectHtmlDom=function(e){if(!e)return!1;var o=Fe.getOwnerDocument(e);try{return o.implementation.hasFeature("HTML","2.0")}catch{return!0}},Fe.prototype.evaluate=function(e,o,f){this.context.expressionContextNode=e,this.context.caseInsensitive=Fe.detectHtmlDom(e);var y=this.xpath.evaluate(this.context);return new ye(y,o)},Je.prototype={},Je.prototype.constructor=Je,Je.superclass=Object.prototype;function Je(e){this.xpathNSResolver=e}Je.prototype.getNamespace=function(e,o){return this.xpathNSResolver==null?null:this.xpathNSResolver.lookupNamespaceURI(e)},Ke.prototype={},Ke.prototype.constructor=Ke,Ke.superclass=Object.prototype;function Ke(e){this.node=e,this.namespaceResolver=new $e}Ke.prototype.lookupNamespaceURI=function(e){return this.namespaceResolver.getNamespace(e,this.node)},ye.prototype={},ye.prototype.constructor=ye,ye.superclass=Object.prototype;function ye(e,o){switch(o==ye.ANY_TYPE&&(e.constructor===X?o=ye.STRING_TYPE:e.constructor===z?o=ye.NUMBER_TYPE:e.constructor===fe?o=ye.BOOLEAN_TYPE:e.constructor===te&&(o=ye.UNORDERED_NODE_ITERATOR_TYPE)),this.resultType=o,o){case ye.NUMBER_TYPE:this.numberValue=e.numberValue();return;case ye.STRING_TYPE:this.stringValue=e.stringValue();return;case ye.BOOLEAN_TYPE:this.booleanValue=e.booleanValue();return;case ye.ANY_UNORDERED_NODE_TYPE:case ye.FIRST_ORDERED_NODE_TYPE:if(e.constructor===te){this.singleNodeValue=e.first();return}break;case ye.UNORDERED_NODE_ITERATOR_TYPE:case ye.ORDERED_NODE_ITERATOR_TYPE:if(e.constructor===te){this.invalidIteratorState=!1,this.nodes=e.toArray(),this.iteratorIndex=0;return}break;case ye.UNORDERED_NODE_SNAPSHOT_TYPE:case ye.ORDERED_NODE_SNAPSHOT_TYPE:if(e.constructor===te){this.nodes=e.toArray(),this.snapshotLength=this.nodes.length;return}break}throw new Me(Me.TYPE_ERR)}ye.prototype.iterateNext=function(){if(this.resultType!=ye.UNORDERED_NODE_ITERATOR_TYPE&&this.resultType!=ye.ORDERED_NODE_ITERATOR_TYPE)throw new Me(Me.TYPE_ERR);return this.nodes[this.iteratorIndex++]},ye.prototype.snapshotItem=function(e){if(this.resultType!=ye.UNORDERED_NODE_SNAPSHOT_TYPE&&this.resultType!=ye.ORDERED_NODE_SNAPSHOT_TYPE)throw new Me(Me.TYPE_ERR);return this.nodes[e]},ye.ANY_TYPE=0,ye.NUMBER_TYPE=1,ye.STRING_TYPE=2,ye.BOOLEAN_TYPE=3,ye.UNORDERED_NODE_ITERATOR_TYPE=4,ye.ORDERED_NODE_ITERATOR_TYPE=5,ye.UNORDERED_NODE_SNAPSHOT_TYPE=6,ye.ORDERED_NODE_SNAPSHOT_TYPE=7,ye.ANY_UNORDERED_NODE_TYPE=8,ye.FIRST_ORDERED_NODE_TYPE=9;function a(e,o){e.createExpression=function(f,y){try{return new Fe(f,y,o)}catch(d){throw new Me(Me.INVALID_EXPRESSION_ERR,d)}},e.createNSResolver=function(f){return new Ke(f)},e.evaluate=function(f,y,d,b,Q){if(b<0||b>9)throw{code:0,toString:function(){return"Request type not supported"}};return e.createExpression(f,d,o).evaluate(y,b,Q)}}try{var c=!0;try{document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("XPath",null)&&(c=!1)}catch{}c&&a(document,new A)}catch{}a(r,new A),function(){var e=new A,o=new $e,f=new Ie,y=new Xe;function d(Y){return{getNamespace:function(Ce,Ue){var ot=Y(Ce,Ue);return ot||o.getNamespace(Ce,Ue)}}}function b(Y){return d(Y.getNamespace.bind(Y))}function Q(Y){return d(function(Ce){return Y[Ce]})}function xe(Y){return Y&&typeof Y.getNamespace=="function"?b(Y):typeof Y=="function"?d(Y):typeof Y=="object"?Q(Y):o}function Ne(Y){if(Y===null||typeof Y>"u"||Y instanceof X||Y instanceof fe||Y instanceof z||Y instanceof te)return Y;switch(typeof Y){case"string":return new X(Y);case"boolean":return new fe(Y);case"number":return new z(Y)}var Ce=new te;return Ce.addArray([].concat(Y)),Ce}function Z(Y){return function(Ce){var Ue=Array.prototype.slice.call(arguments,1).map(function(cs){return cs.evaluate(Ce)}),ot=Y.apply(this,[].concat(Ce,Ue));return Ne(ot)}}function ie(Y){return{getFunction:function(Ce,Ue){var ot=Y(Ce,Ue);return ot?Z(ot):f.getFunction(Ce,Ue)}}}function Pe(Y){return ie(Y.getFunction.bind(Y))}function je(Y){return ie(function(Ce){return Y[Ce]})}function Se(Y){return Y&&typeof Y.getFunction=="function"?Pe(Y):typeof Y=="function"?ie(Y):typeof Y=="object"?je(Y):f}function ze(Y){return{getVariable:function(Ce,Ue){var ot=Y(Ce,Ue);return Ne(ot)}}}function He(Y){if(Y){if(typeof Y.getVariable=="function")return ze(Y.getVariable.bind(Y));if(typeof Y=="function")return ze(Y);if(typeof Y=="object")return ze(function(Ce){return Y[Ce]})}return y}function nt(Y,Ce,Ue){Y in Ue&&(Ce[Y]=Ue[Y])}function is(Y){var Ce=new qe;return Y?(Ce.namespaceResolver=xe(Y.namespaces),Ce.functionResolver=Se(Y.functions),Ce.variableResolver=He(Y.variables),Ce.expressionContextNode=Y.node,nt("allowAnyNamespaceForNoPrefix",Ce,Y),nt("isHtml",Ce,Y)):Ce.namespaceResolver=o,Ce}function us(Y,Ce){var Ue=is(Ce);return Y.evaluate(Ue)}var as={evaluate:function(Y){return us(this.expression,Y)},evaluateNumber:function(Y){return this.evaluate(Y).numberValue()},evaluateString:function(Y){return this.evaluate(Y).stringValue()},evaluateBoolean:function(Y){return this.evaluate(Y).booleanValue()},evaluateNodeSet:function(Y){return this.evaluate(Y).nodeset()},select:function(Y){return this.evaluateNodeSet(Y).toArray()},select1:function(Y){return this.select(Y)[0]}};function ls(Y){var Ce=e.parse(Y);return Object.create(as,{expression:{value:Ce}})}r.parse=ls}(),Ae(r,{XPath:de,XPathParser:A,XPathResult:ye,Step:g,PathExpr:C,NodeTest:$,LocationPath:ve,OrOperation:pe,AndOperation:he,BarOperation:W,EqualsOperation:F,NotEqualOperation:x,LessThanOperation:S,GreaterThanOperation:R,LessThanOrEqualOperation:j,GreaterThanOrEqualOperation:M,PlusOperation:J,MinusOperation:D,MultiplyOperation:w,DivOperation:P,ModOperation:L,UnaryMinusOperation:K,FunctionCall:ce,VariableReference:_e,XPathContext:qe,XNodeSet:te,XBoolean:fe,XString:X,XNumber:z,NamespaceResolver:$e,FunctionResolver:Ie,VariableResolver:Xe,Utilities:ue}),r.select=function(e,o,f){return r.selectWithResolver(e,o,null,f)},r.useNamespaces=function(e){var o={mappings:e||{},lookupNamespaceURI:function(f){return this.mappings[f]}};return function(f,y,d){return r.selectWithResolver(f,y,o,d)}},r.selectWithResolver=function(e,o,f,y){var d=new Fe(e,f,new A),b=ye.ANY_TYPE,Q=d.evaluate(o,b,null);return Q.resultType==ye.STRING_TYPE?Q=Q.stringValue:Q.resultType==ye.NUMBER_TYPE?Q=Q.numberValue:Q.resultType==ye.BOOLEAN_TYPE?Q=Q.booleanValue:(Q=Q.nodes,y&&(Q=Q[0])),Q},r.select1=function(e,o){return r.select(e,o,!0)};var E=function(e){return Array.isArray(e)&&e.every(p)},v=function(e){return function(o){return p(o)&&o.nodeType===e}};Ae(r,{isNodeLike:p,isArrayOfNodes:E,isElement:v(H.ELEMENT_NODE),isAttribute:v(H.ATTRIBUTE_NODE),isTextNode:v(H.TEXT_NODE),isCDATASection:v(H.CDATA_SECTION_NODE),isProcessingInstruction:v(H.PROCESSING_INSTRUCTION_NODE),isComment:v(H.COMMENT_NODE),isDocumentNode:v(H.DOCUMENT_NODE),isDocumentTypeNode:v(H.DOCUMENT_TYPE_NODE),isDocumentFragment:v(H.DOCUMENT_FRAGMENT_NODE)})})(t)}(vt)),vt}var Jr=Zr();const en=Qr(Jr);var ft={},Qe={},st={},It;function yt(){if(It)return st;It=1;function n(l,p,N){if(N===void 0&&(N=Array.prototype),l&&typeof N.find=="function")return N.find.call(l,p);for(var h=0;h<l.length;h++)if(Object.prototype.hasOwnProperty.call(l,h)){var m=l[h];if(p.call(void 0,m,h,l))return m}}function t(l,p){return p===void 0&&(p=Object),p&&typeof p.freeze=="function"?p.freeze(l):l}function r(l,p){if(l===null||typeof l!="object")throw new TypeError("target is not an object");for(var N in p)Object.prototype.hasOwnProperty.call(p,N)&&(l[N]=p[N]);return l}var u=t({HTML:"text/html",isHTML:function(l){return l===u.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),i=t({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(l){return l===i.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});return st.assign=r,st.find=n,st.freeze=t,st.MIME_TYPE=u,st.NAMESPACE=i,st}var Pt;function Lt(){if(Pt)return Qe;Pt=1;var n=yt(),t=n.find,r=n.NAMESPACE;function u(a){return a!==""}function i(a){return a?a.split(/[\t\n\f\r ]+/).filter(u):[]}function l(a,c){return a.hasOwnProperty(c)||(a[c]=!0),a}function p(a){if(!a)return[];var c=i(a);return Object.keys(c.reduce(l,{}))}function N(a){return function(c){return a&&a.indexOf(c)!==-1}}function h(a,c){for(var E in a)Object.prototype.hasOwnProperty.call(a,E)&&(c[E]=a[E])}function m(a,c){var E=a.prototype;if(!(E instanceof c)){let v=function(){};v.prototype=c.prototype,v=new v,h(E,v),a.prototype=E=v}E.constructor!=a&&(typeof a!="function"&&console.error("unknown Class:"+a),E.constructor=a)}var B={},T=B.ELEMENT_NODE=1,U=B.ATTRIBUTE_NODE=2,V=B.TEXT_NODE=3,ae=B.CDATA_SECTION_NODE=4,le=B.ENTITY_REFERENCE_NODE=5,_=B.ENTITY_NODE=6,oe=B.PROCESSING_INSTRUCTION_NODE=7,ge=B.COMMENT_NODE=8,re=B.DOCUMENT_NODE=9,De=B.DOCUMENT_TYPE_NODE=10,Ae=B.DOCUMENT_FRAGMENT_NODE=11,H=B.NOTATION_NODE=12,A={},de={};A.INDEX_SIZE_ERR=(de[1]="Index size error",1),A.DOMSTRING_SIZE_ERR=(de[2]="DOMString size error",2);var k=A.HIERARCHY_REQUEST_ERR=(de[3]="Hierarchy request error",3);A.WRONG_DOCUMENT_ERR=(de[4]="Wrong document",4),A.INVALID_CHARACTER_ERR=(de[5]="Invalid character",5),A.NO_DATA_ALLOWED_ERR=(de[6]="No data allowed",6),A.NO_MODIFICATION_ALLOWED_ERR=(de[7]="No modification allowed",7);var I=A.NOT_FOUND_ERR=(de[8]="Not found",8);A.NOT_SUPPORTED_ERR=(de[9]="Not supported",9);var ee=A.INUSE_ATTRIBUTE_ERR=(de[10]="Attribute in use",10);A.INVALID_STATE_ERR=(de[11]="Invalid state",11),A.SYNTAX_ERR=(de[12]="Syntax error",12),A.INVALID_MODIFICATION_ERR=(de[13]="Invalid modification",13),A.NAMESPACE_ERR=(de[14]="Invalid namespace",14),A.INVALID_ACCESS_ERR=(de[15]="Invalid access",15);function K(a,c){if(c instanceof Error)var E=c;else E=this,Error.call(this,de[a]),this.message=de[a],Error.captureStackTrace&&Error.captureStackTrace(this,K);return E.code=a,c&&(this.message=this.message+": "+c),E}K.prototype=Error.prototype,h(A,K);function q(){}q.prototype={length:0,item:function(a){return a>=0&&a<this.length?this[a]:null},toString:function(a,c){for(var E=[],v=0;v<this.length;v++)Fe(this[v],E,a,c);return E.join("")},filter:function(a){return Array.prototype.filter.call(this,a)},indexOf:function(a){return Array.prototype.indexOf.call(this,a)}};function pe(a,c){this._node=a,this._refresh=c,he(this)}function he(a){var c=a._node._inc||a._node.ownerDocument._inc;if(a._inc!==c){var E=a._refresh(a._node);if(ye(a,"length",E.length),!a.$$length||E.length<a.$$length)for(var v=E.length;v in a;v++)Object.prototype.hasOwnProperty.call(a,v)&&delete a[v];h(E,a),a._inc=c}}pe.prototype.item=function(a){return he(this),this[a]||null},m(pe,q);function F(){}function x(a,c){for(var E=a.length;E--;)if(a[E]===c)return E}function S(a,c,E,v){if(v?c[x(c,v)]=E:c[c.length++]=E,a){E.ownerElement=a;var e=a.ownerDocument;e&&(v&&L(e,a,v),P(e,a,E))}}function R(a,c,E){var v=x(c,E);if(v>=0){for(var e=c.length-1;v<e;)c[v]=c[++v];if(c.length=e,a){var o=a.ownerDocument;o&&(L(o,a,E),E.ownerElement=null)}}else throw new K(I,new Error(a.tagName+"@"+E))}F.prototype={length:0,item:q.prototype.item,getNamedItem:function(a){for(var c=this.length;c--;){var E=this[c];if(E.nodeName==a)return E}},setNamedItem:function(a){var c=a.ownerElement;if(c&&c!=this._ownerElement)throw new K(ee);var E=this.getNamedItem(a.nodeName);return S(this._ownerElement,this,a,E),E},setNamedItemNS:function(a){var c=a.ownerElement,E;if(c&&c!=this._ownerElement)throw new K(ee);return E=this.getNamedItemNS(a.namespaceURI,a.localName),S(this._ownerElement,this,a,E),E},removeNamedItem:function(a){var c=this.getNamedItem(a);return R(this._ownerElement,this,c),c},removeNamedItemNS:function(a,c){var E=this.getNamedItemNS(a,c);return R(this._ownerElement,this,E),E},getNamedItemNS:function(a,c){for(var E=this.length;E--;){var v=this[E];if(v.localName==c&&v.namespaceURI==a)return v}return null}};function j(){}j.prototype={hasFeature:function(a,c){return!0},createDocument:function(a,c,E){var v=new w;if(v.implementation=this,v.childNodes=new q,v.doctype=E||null,E&&v.appendChild(E),c){var e=v.createElementNS(a,c);v.appendChild(e)}return v},createDocumentType:function(a,c,E){var v=new te;return v.name=a,v.nodeName=a,v.publicId=c||"",v.systemId=E||"",v}};function M(){}M.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(a,c){return ce(this,a,c)},replaceChild:function(a,c){ce(this,a,c,_e),c&&this.removeChild(c)},removeChild:function(a){return C(this,a)},appendChild:function(a){return this.insertBefore(a,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(a){return Ke(this.ownerDocument||this,this,a)},normalize:function(){for(var a=this.firstChild;a;){var c=a.nextSibling;c&&c.nodeType==V&&a.nodeType==V?(this.removeChild(c),a.appendData(c.data)):(a.normalize(),a=c)}},isSupported:function(a,c){return this.ownerDocument.implementation.hasFeature(a,c)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(a){for(var c=this;c;){var E=c._nsMap;if(E){for(var v in E)if(Object.prototype.hasOwnProperty.call(E,v)&&E[v]===a)return v}c=c.nodeType==U?c.ownerDocument:c.parentNode}return null},lookupNamespaceURI:function(a){for(var c=this;c;){var E=c._nsMap;if(E&&Object.prototype.hasOwnProperty.call(E,a))return E[a];c=c.nodeType==U?c.ownerDocument:c.parentNode}return null},isDefaultNamespace:function(a){var c=this.lookupPrefix(a);return c==null}};function J(a){return a=="<"&&"<"||a==">"&&">"||a=="&"&&"&"||a=='"'&&"""||"&#"+a.charCodeAt()+";"}h(B,M),h(B,M.prototype);function D(a,c){if(c(a))return!0;if(a=a.firstChild)do if(D(a,c))return!0;while(a=a.nextSibling)}function w(){this.ownerDocument=this}function P(a,c,E){a&&a._inc++;var v=E.namespaceURI;v===r.XMLNS&&(c._nsMap[E.prefix?E.localName:""]=E.value)}function L(a,c,E,v){a&&a._inc++;var e=E.namespaceURI;e===r.XMLNS&&delete c._nsMap[E.prefix?E.localName:""]}function W(a,c,E){if(a&&a._inc){a._inc++;var v=c.childNodes;if(E)v[v.length++]=E;else{for(var e=c.firstChild,o=0;e;)v[o++]=e,e=e.nextSibling;v.length=o,delete v[v.length]}}}function C(a,c){var E=c.previousSibling,v=c.nextSibling;return E?E.nextSibling=v:a.firstChild=v,v?v.previousSibling=E:a.lastChild=E,c.parentNode=null,c.previousSibling=null,c.nextSibling=null,W(a.ownerDocument,a),c}function ne(a){return a&&(a.nodeType===M.DOCUMENT_NODE||a.nodeType===M.DOCUMENT_FRAGMENT_NODE||a.nodeType===M.ELEMENT_NODE)}function Ee(a){return a&&(Te(a)||ke(a)||be(a)||a.nodeType===M.DOCUMENT_FRAGMENT_NODE||a.nodeType===M.COMMENT_NODE||a.nodeType===M.PROCESSING_INSTRUCTION_NODE)}function be(a){return a&&a.nodeType===M.DOCUMENT_TYPE_NODE}function Te(a){return a&&a.nodeType===M.ELEMENT_NODE}function ke(a){return a&&a.nodeType===M.TEXT_NODE}function ve(a,c){var E=a.childNodes||[];if(t(E,Te)||be(c))return!1;var v=t(E,be);return!(c&&v&&E.indexOf(v)>E.indexOf(c))}function g(a,c){var E=a.childNodes||[];function v(o){return Te(o)&&o!==c}if(t(E,v))return!1;var e=t(E,be);return!(c&&e&&E.indexOf(e)>E.indexOf(c))}function G(a,c,E){if(!ne(a))throw new K(k,"Unexpected parent node type "+a.nodeType);if(E&&E.parentNode!==a)throw new K(I,"child not in parent");if(!Ee(c)||be(c)&&a.nodeType!==M.DOCUMENT_NODE)throw new K(k,"Unexpected node type "+c.nodeType+" for parent node type "+a.nodeType)}function $(a,c,E){var v=a.childNodes||[],e=c.childNodes||[];if(c.nodeType===M.DOCUMENT_FRAGMENT_NODE){var o=e.filter(Te);if(o.length>1||t(e,ke))throw new K(k,"More than one element or text in fragment");if(o.length===1&&!ve(a,E))throw new K(k,"Element in fragment can not be inserted before doctype")}if(Te(c)&&!ve(a,E))throw new K(k,"Only one element can be added and only after doctype");if(be(c)){if(t(v,be))throw new K(k,"Only one doctype is allowed");var f=t(v,Te);if(E&&v.indexOf(f)<v.indexOf(E))throw new K(k,"Doctype can only be inserted before an element");if(!E&&f)throw new K(k,"Doctype can not be appended since element is present")}}function _e(a,c,E){var v=a.childNodes||[],e=c.childNodes||[];if(c.nodeType===M.DOCUMENT_FRAGMENT_NODE){var o=e.filter(Te);if(o.length>1||t(e,ke))throw new K(k,"More than one element or text in fragment");if(o.length===1&&!g(a,E))throw new K(k,"Element in fragment can not be inserted before doctype")}if(Te(c)&&!g(a,E))throw new K(k,"Only one element can be added and only after doctype");if(be(c)){if(t(v,function(d){return be(d)&&d!==E}))throw new K(k,"Only one doctype is allowed");var f=t(v,Te);if(E&&v.indexOf(f)<v.indexOf(E))throw new K(k,"Doctype can only be inserted before an element")}}function ce(a,c,E,v){G(a,c,E),a.nodeType===M.DOCUMENT_NODE&&(v||$)(a,c,E);var e=c.parentNode;if(e&&e.removeChild(c),c.nodeType===Ae){var o=c.firstChild;if(o==null)return c;var f=c.lastChild}else o=f=c;var y=E?E.previousSibling:a.lastChild;o.previousSibling=y,f.nextSibling=E,y?y.nextSibling=o:a.firstChild=o,E==null?a.lastChild=f:E.previousSibling=f;do{o.parentNode=a;var d=a.ownerDocument||a;se(o,d)}while(o!==f&&(o=o.nextSibling));return W(a.ownerDocument||a,a),c.nodeType==Ae&&(c.firstChild=c.lastChild=null),c}function se(a,c){if(a.ownerDocument!==c){if(a.ownerDocument=c,a.nodeType===T&&a.attributes)for(var E=0;E<a.attributes.length;E++){var v=a.attributes.item(E);v&&(v.ownerDocument=c)}for(var e=a.firstChild;e;)se(e,c),e=e.nextSibling}}function X(a,c){c.parentNode&&c.parentNode.removeChild(c),c.parentNode=a,c.previousSibling=a.lastChild,c.nextSibling=null,c.previousSibling?c.previousSibling.nextSibling=c:a.firstChild=c,a.lastChild=c,W(a.ownerDocument,a,c);var E=a.ownerDocument||a;return se(c,E),c}w.prototype={nodeName:"#document",nodeType:re,doctype:null,documentElement:null,_inc:1,insertBefore:function(a,c){if(a.nodeType==Ae){for(var E=a.firstChild;E;){var v=E.nextSibling;this.insertBefore(E,c),E=v}return a}return ce(this,a,c),se(a,this),this.documentElement===null&&a.nodeType===T&&(this.documentElement=a),a},removeChild:function(a){return this.documentElement==a&&(this.documentElement=null),C(this,a)},replaceChild:function(a,c){ce(this,a,c,_e),se(a,this),c&&this.removeChild(c),Te(a)&&(this.documentElement=a)},importNode:function(a,c){return Je(this,a,c)},getElementById:function(a){var c=null;return D(this.documentElement,function(E){if(E.nodeType==T&&E.getAttribute("id")==a)return c=E,!0}),c},getElementsByClassName:function(a){var c=p(a);return new pe(this,function(E){var v=[];return c.length>0&&D(E.documentElement,function(e){if(e!==E&&e.nodeType===T){var o=e.getAttribute("class");if(o){var f=a===o;if(!f){var y=p(o);f=c.every(N(y))}f&&v.push(e)}}}),v})},createElement:function(a){var c=new z;c.ownerDocument=this,c.nodeName=a,c.tagName=a,c.localName=a,c.childNodes=new q;var E=c.attributes=new F;return E._ownerElement=c,c},createDocumentFragment:function(){var a=new Ie;return a.ownerDocument=this,a.childNodes=new q,a},createTextNode:function(a){var c=new fe;return c.ownerDocument=this,c.appendData(a),c},createComment:function(a){var c=new Re;return c.ownerDocument=this,c.appendData(a),c},createCDATASection:function(a){var c=new mt;return c.ownerDocument=this,c.appendData(a),c},createProcessingInstruction:function(a,c){var E=new $e;return E.ownerDocument=this,E.tagName=E.nodeName=E.target=a,E.nodeValue=E.data=c,E},createAttribute:function(a){var c=new rt;return c.ownerDocument=this,c.name=a,c.nodeName=a,c.localName=a,c.specified=!0,c},createEntityReference:function(a){var c=new Xe;return c.ownerDocument=this,c.nodeName=a,c},createElementNS:function(a,c){var E=new z,v=c.split(":"),e=E.attributes=new F;return E.childNodes=new q,E.ownerDocument=this,E.nodeName=c,E.tagName=c,E.namespaceURI=a,v.length==2?(E.prefix=v[0],E.localName=v[1]):E.localName=c,e._ownerElement=E,E},createAttributeNS:function(a,c){var E=new rt,v=c.split(":");return E.ownerDocument=this,E.nodeName=c,E.name=c,E.namespaceURI=a,E.specified=!0,v.length==2?(E.prefix=v[0],E.localName=v[1]):E.localName=c,E}},m(w,M);function z(){this._nsMap={}}z.prototype={nodeType:T,hasAttribute:function(a){return this.getAttributeNode(a)!=null},getAttribute:function(a){var c=this.getAttributeNode(a);return c&&c.value||""},getAttributeNode:function(a){return this.attributes.getNamedItem(a)},setAttribute:function(a,c){var E=this.ownerDocument.createAttribute(a);E.value=E.nodeValue=""+c,this.setAttributeNode(E)},removeAttribute:function(a){var c=this.getAttributeNode(a);c&&this.removeAttributeNode(c)},appendChild:function(a){return a.nodeType===Ae?this.insertBefore(a,null):X(this,a)},setAttributeNode:function(a){return this.attributes.setNamedItem(a)},setAttributeNodeNS:function(a){return this.attributes.setNamedItemNS(a)},removeAttributeNode:function(a){return this.attributes.removeNamedItem(a.nodeName)},removeAttributeNS:function(a,c){var E=this.getAttributeNodeNS(a,c);E&&this.removeAttributeNode(E)},hasAttributeNS:function(a,c){return this.getAttributeNodeNS(a,c)!=null},getAttributeNS:function(a,c){var E=this.getAttributeNodeNS(a,c);return E&&E.value||""},setAttributeNS:function(a,c,E){var v=this.ownerDocument.createAttributeNS(a,c);v.value=v.nodeValue=""+E,this.setAttributeNode(v)},getAttributeNodeNS:function(a,c){return this.attributes.getNamedItemNS(a,c)},getElementsByTagName:function(a){return new pe(this,function(c){var E=[];return D(c,function(v){v!==c&&v.nodeType==T&&(a==="*"||v.tagName==a)&&E.push(v)}),E})},getElementsByTagNameNS:function(a,c){return new pe(this,function(E){var v=[];return D(E,function(e){e!==E&&e.nodeType===T&&(a==="*"||e.namespaceURI===a)&&(c==="*"||e.localName==c)&&v.push(e)}),v})}},w.prototype.getElementsByTagName=z.prototype.getElementsByTagName,w.prototype.getElementsByTagNameNS=z.prototype.getElementsByTagNameNS,m(z,M);function rt(){}rt.prototype.nodeType=U,m(rt,M);function lt(){}lt.prototype={data:"",substringData:function(a,c){return this.data.substring(a,a+c)},appendData:function(a){a=this.data+a,this.nodeValue=this.data=a,this.length=a.length},insertData:function(a,c){this.replaceData(a,0,c)},appendChild:function(a){throw new Error(de[k])},deleteData:function(a,c){this.replaceData(a,c,"")},replaceData:function(a,c,E){var v=this.data.substring(0,a),e=this.data.substring(a+c);E=v+E+e,this.nodeValue=this.data=E,this.length=E.length}},m(lt,M);function fe(){}fe.prototype={nodeName:"#text",nodeType:V,splitText:function(a){var c=this.data,E=c.substring(a);c=c.substring(0,a),this.data=this.nodeValue=c,this.length=c.length;var v=this.ownerDocument.createTextNode(E);return this.parentNode&&this.parentNode.insertBefore(v,this.nextSibling),v}},m(fe,lt);function Re(){}Re.prototype={nodeName:"#comment",nodeType:ge},m(Re,lt);function mt(){}mt.prototype={nodeName:"#cdata-section",nodeType:ae},m(mt,lt);function te(){}te.prototype.nodeType=De,m(te,M);function Ge(){}Ge.prototype.nodeType=H,m(Ge,M);function qe(){}qe.prototype.nodeType=_,m(qe,M);function Xe(){}Xe.prototype.nodeType=le,m(Xe,M);function Ie(){}Ie.prototype.nodeName="#document-fragment",Ie.prototype.nodeType=Ae,m(Ie,M);function $e(){}$e.prototype.nodeType=oe,m($e,M);function me(){}me.prototype.serializeToString=function(a,c,E){return ue.call(a,c,E)},M.prototype.toString=ue;function ue(a,c){var E=[],v=this.nodeType==9&&this.documentElement||this,e=v.prefix,o=v.namespaceURI;if(o&&e==null){var e=v.lookupPrefix(o);if(e==null)var f=[{namespace:o,prefix:null}]}return Fe(this,E,a,c,f),E.join("")}function gt(a,c,E){var v=a.prefix||"",e=a.namespaceURI;if(!e||v==="xml"&&e===r.XML||e===r.XMLNS)return!1;for(var o=E.length;o--;){var f=E[o];if(f.prefix===v)return f.namespace!==e}return!0}function Me(a,c,E){a.push(" ",c,'="',E.replace(/[<>&"\t\n\r]/g,J),'"')}function Fe(a,c,E,v,e){if(e||(e=[]),v)if(a=v(a),a){if(typeof a=="string"){c.push(a);return}}else return;switch(a.nodeType){case T:var o=a.attributes,f=o.length,Se=a.firstChild,y=a.tagName;E=r.isHTML(a.namespaceURI)||E;var d=y;if(!E&&!a.prefix&&a.namespaceURI){for(var b,Q=0;Q<o.length;Q++)if(o.item(Q).name==="xmlns"){b=o.item(Q).value;break}if(!b)for(var xe=e.length-1;xe>=0;xe--){var Ne=e[xe];if(Ne.prefix===""&&Ne.namespace===a.namespaceURI){b=Ne.namespace;break}}if(b!==a.namespaceURI)for(var xe=e.length-1;xe>=0;xe--){var Ne=e[xe];if(Ne.namespace===a.namespaceURI){Ne.prefix&&(d=Ne.prefix+":"+y);break}}}c.push("<",d);for(var Z=0;Z<f;Z++){var ie=o.item(Z);ie.prefix=="xmlns"?e.push({prefix:ie.localName,namespace:ie.value}):ie.nodeName=="xmlns"&&e.push({prefix:"",namespace:ie.value})}for(var Z=0;Z<f;Z++){var ie=o.item(Z);if(gt(ie,E,e)){var Pe=ie.prefix||"",je=ie.namespaceURI;Me(c,Pe?"xmlns:"+Pe:"xmlns",je),e.push({prefix:Pe,namespace:je})}Fe(ie,c,E,v,e)}if(y===d&>(a,E,e)){var Pe=a.prefix||"",je=a.namespaceURI;Me(c,Pe?"xmlns:"+Pe:"xmlns",je),e.push({prefix:Pe,namespace:je})}if(Se||E&&!/^(?:meta|link|img|br|hr|input)$/i.test(y)){if(c.push(">"),E&&/^script$/i.test(y))for(;Se;)Se.data?c.push(Se.data):Fe(Se,c,E,v,e.slice()),Se=Se.nextSibling;else for(;Se;)Fe(Se,c,E,v,e.slice()),Se=Se.nextSibling;c.push("</",d,">")}else c.push("/>");return;case re:case Ae:for(var Se=a.firstChild;Se;)Fe(Se,c,E,v,e.slice()),Se=Se.nextSibling;return;case U:return Me(c,a.name,a.value);case V:return c.push(a.data.replace(/[<&>]/g,J));case ae:return c.push("<![CDATA[",a.data,"]]>");case ge:return c.push("<!--",a.data,"-->");case De:var ze=a.publicId,He=a.systemId;if(c.push("<!DOCTYPE ",a.name),ze)c.push(" PUBLIC ",ze),He&&He!="."&&c.push(" ",He),c.push(">");else if(He&&He!=".")c.push(" SYSTEM ",He,">");else{var nt=a.internalSubset;nt&&c.push(" [",nt,"]"),c.push(">")}return;case oe:return c.push("<?",a.target," ",a.data,"?>");case le:return c.push("&",a.nodeName,";");default:c.push("??",a.nodeName)}}function Je(a,c,E){var v;switch(c.nodeType){case T:v=c.cloneNode(!1),v.ownerDocument=a;case Ae:break;case U:E=!0;break}if(v||(v=c.cloneNode(!1)),v.ownerDocument=a,v.parentNode=null,E)for(var e=c.firstChild;e;)v.appendChild(Je(a,e,E)),e=e.nextSibling;return v}function Ke(a,c,E){var v=new c.constructor;for(var e in c)if(Object.prototype.hasOwnProperty.call(c,e)){var o=c[e];typeof o!="object"&&o!=v[e]&&(v[e]=o)}switch(c.childNodes&&(v.childNodes=new q),v.ownerDocument=a,v.nodeType){case T:var f=c.attributes,y=v.attributes=new F,d=f.length;y._ownerElement=v;for(var b=0;b<d;b++)v.setAttributeNode(Ke(a,f.item(b),!0));break;case U:E=!0}if(E)for(var Q=c.firstChild;Q;)v.appendChild(Ke(a,Q,E)),Q=Q.nextSibling;return v}function ye(a,c,E){a[c]=E}try{if(Object.defineProperty){let a=function(c){switch(c.nodeType){case T:case Ae:var E=[];for(c=c.firstChild;c;)c.nodeType!==7&&c.nodeType!==8&&E.push(a(c)),c=c.nextSibling;return E.join("");default:return c.nodeValue}};Object.defineProperty(pe.prototype,"length",{get:function(){return he(this),this.$$length}}),Object.defineProperty(M.prototype,"textContent",{get:function(){return a(this)},set:function(c){switch(this.nodeType){case T:case Ae:for(;this.firstChild;)this.removeChild(this.firstChild);(c||String(c))&&this.appendChild(this.ownerDocument.createTextNode(c));break;default:this.data=c,this.value=c,this.nodeValue=c}}}),ye=function(c,E,v){c["$$"+E]=v}}}catch{}return Qe.DocumentType=te,Qe.DOMException=K,Qe.DOMImplementation=j,Qe.Element=z,Qe.Node=M,Qe.NodeList=q,Qe.XMLSerializer=me,Qe}var pt={},Ct={},Vt;function tn(){return Vt||(Vt=1,function(n){var t=yt().freeze;n.XML_ENTITIES=t({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),n.HTML_ENTITIES=t({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:`
|
|
10
|
+
`,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:" ",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:""}),n.entityMap=n.HTML_ENTITIES}(Ct)),Ct}var At={},Mt;function rn(){if(Mt)return At;Mt=1;var n=yt().NAMESPACE,t=/[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]/,r=new RegExp("[\\-\\.0-9"+t.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),u=new RegExp("^"+t.source+r.source+"*(?::"+t.source+r.source+"*)?$"),i=0,l=1,p=2,N=3,h=4,m=5,B=6,T=7;function U(k,I){this.message=k,this.locator=I,Error.captureStackTrace&&Error.captureStackTrace(this,U)}U.prototype=new Error,U.prototype.name=U.name;function V(){}V.prototype={parse:function(k,I,ee){var K=this.domBuilder;K.startDocument(),De(I,I={}),ae(k,I,ee,K,this.errorHandler),K.endDocument()}};function ae(k,I,ee,K,q){function pe(X){if(X>65535){X-=65536;var z=55296+(X>>10),rt=56320+(X&1023);return String.fromCharCode(z,rt)}else return String.fromCharCode(X)}function he(X){var z=X.slice(1,-1);return Object.hasOwnProperty.call(ee,z)?ee[z]:z.charAt(0)==="#"?pe(parseInt(z.substr(1).replace("x","0x"))):(q.error("entity not found:"+X),X)}function F(X){if(X>w){var z=k.substring(w,X).replace(/&#?\w+;/g,he);M&&x(w),K.characters(z,0,X-w),w=X}}function x(X,z){for(;X>=R&&(z=j.exec(k));)S=z.index,R=S+z[0].length,M.lineNumber++;M.columnNumber=X-S+1}for(var S=0,R=0,j=/.*(?:\r\n?|\n)|.*$/g,M=K.locator,J=[{currentNSMap:I}],D={},w=0;;){try{var P=k.indexOf("<",w);if(P<0){if(!k.substr(w).match(/^\s*$/)){var L=K.doc,W=L.createTextNode(k.substr(w));L.appendChild(W),K.currentElement=W}return}switch(P>w&&F(P),k.charAt(P+1)){case"/":var G=k.indexOf(">",P+3),C=k.substring(P+2,G).replace(/[ \t\n\r]+$/g,""),ne=J.pop();G<0?(C=k.substring(P+2).replace(/[\s<].*/,""),q.error("end tag name: "+C+" is not complete:"+ne.tagName),G=P+1+C.length):C.match(/\s</)&&(C=C.replace(/[\s<].*/,""),q.error("end tag name: "+C+" maybe not complete"),G=P+1+C.length);var Ee=ne.localNSMap,be=ne.tagName==C,Te=be||ne.tagName&&ne.tagName.toLowerCase()==C.toLowerCase();if(Te){if(K.endElement(ne.uri,ne.localName,C),Ee)for(var ke in Ee)Object.prototype.hasOwnProperty.call(Ee,ke)&&K.endPrefixMapping(ke);be||q.fatalError("end tag name: "+C+" is not match the current start tagName:"+ne.tagName)}else J.push(ne);G++;break;case"?":M&&x(P),G=H(k,P,K);break;case"!":M&&x(P),G=Ae(k,P,K,q);break;default:M&&x(P);var ve=new A,g=J[J.length-1].currentNSMap,G=_(k,P,ve,g,he,q),$=ve.length;if(!ve.closed&&re(k,G,ve.tagName,D)&&(ve.closed=!0,ee.nbsp||q.warning("unclosed xml attribute")),M&&$){for(var _e=le(M,{}),ce=0;ce<$;ce++){var se=ve[ce];x(se.offset),se.locator=le(M,{})}K.locator=_e,oe(ve,K,g)&&J.push(ve),K.locator=M}else oe(ve,K,g)&&J.push(ve);n.isHTML(ve.uri)&&!ve.closed?G=ge(k,G,ve.tagName,he,K):G++}}catch(X){if(X instanceof U)throw X;q.error("element parse error: "+X),G=-1}G>w?w=G:F(Math.max(P,w)+1)}}function le(k,I){return I.lineNumber=k.lineNumber,I.columnNumber=k.columnNumber,I}function _(k,I,ee,K,q,pe){function he(M,J,D){ee.attributeNames.hasOwnProperty(M)&&pe.fatalError("Attribute "+M+" redefined"),ee.addValue(M,J.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,q),D)}for(var F,x,S=++I,R=i;;){var j=k.charAt(S);switch(j){case"=":if(R===l)F=k.slice(I,S),R=N;else if(R===p)R=N;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(R===N||R===l)if(R===l&&(pe.warning('attribute value must after "="'),F=k.slice(I,S)),I=S+1,S=k.indexOf(j,I),S>0)x=k.slice(I,S),he(F,x,I-1),R=m;else throw new Error("attribute value no end '"+j+"' match");else if(R==h)x=k.slice(I,S),he(F,x,I),pe.warning('attribute "'+F+'" missed start quot('+j+")!!"),I=S+1,R=m;else throw new Error('attribute value must after "="');break;case"/":switch(R){case i:ee.setTagName(k.slice(I,S));case m:case B:case T:R=T,ee.closed=!0;case h:case l:break;case p:ee.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return pe.error("unexpected end of input"),R==i&&ee.setTagName(k.slice(I,S)),S;case">":switch(R){case i:ee.setTagName(k.slice(I,S));case m:case B:case T:break;case h:case l:x=k.slice(I,S),x.slice(-1)==="/"&&(ee.closed=!0,x=x.slice(0,-1));case p:R===p&&(x=F),R==h?(pe.warning('attribute "'+x+'" missed quot(")!'),he(F,x,I)):((!n.isHTML(K[""])||!x.match(/^(?:disabled|checked|selected)$/i))&&pe.warning('attribute "'+x+'" missed value!! "'+x+'" instead!!'),he(x,x,I));break;case N:throw new Error("attribute value missed!!")}return S;case"":j=" ";default:if(j<=" ")switch(R){case i:ee.setTagName(k.slice(I,S)),R=B;break;case l:F=k.slice(I,S),R=p;break;case h:var x=k.slice(I,S);pe.warning('attribute "'+x+'" missed quot(")!!'),he(F,x,I);case m:R=B;break}else switch(R){case p:ee.tagName,(!n.isHTML(K[""])||!F.match(/^(?:disabled|checked|selected)$/i))&&pe.warning('attribute "'+F+'" missed value!! "'+F+'" instead2!!'),he(F,F,I),I=S,R=l;break;case m:pe.warning('attribute space is required"'+F+'"!!');case B:R=l,I=S;break;case N:R=h,I=S;break;case T:throw new Error("elements closed character '/' and '>' must be connected to")}}S++}}function oe(k,I,ee){for(var K=k.tagName,q=null,j=k.length;j--;){var pe=k[j],he=pe.qName,F=pe.value,M=he.indexOf(":");if(M>0)var x=pe.prefix=he.slice(0,M),S=he.slice(M+1),R=x==="xmlns"&&S;else S=he,x=null,R=he==="xmlns"&&"";pe.localName=S,R!==!1&&(q==null&&(q={},De(ee,ee={})),ee[R]=q[R]=F,pe.uri=n.XMLNS,I.startPrefixMapping(R,F))}for(var j=k.length;j--;){pe=k[j];var x=pe.prefix;x&&(x==="xml"&&(pe.uri=n.XML),x!=="xmlns"&&(pe.uri=ee[x||""]))}var M=K.indexOf(":");M>0?(x=k.prefix=K.slice(0,M),S=k.localName=K.slice(M+1)):(x=null,S=k.localName=K);var J=k.uri=ee[x||""];if(I.startElement(J,S,K,k),k.closed){if(I.endElement(J,S,K),q)for(x in q)Object.prototype.hasOwnProperty.call(q,x)&&I.endPrefixMapping(x)}else return k.currentNSMap=ee,k.localNSMap=q,!0}function ge(k,I,ee,K,q){if(/^(?:script|textarea)$/i.test(ee)){var pe=k.indexOf("</"+ee+">",I),he=k.substring(I+1,pe);if(/[&<]/.test(he))return/^script$/i.test(ee)?(q.characters(he,0,he.length),pe):(he=he.replace(/&#?\w+;/g,K),q.characters(he,0,he.length),pe)}return I+1}function re(k,I,ee,K){var q=K[ee];return q==null&&(q=k.lastIndexOf("</"+ee+">"),q<I&&(q=k.lastIndexOf("</"+ee)),K[ee]=q),q<I}function De(k,I){for(var ee in k)Object.prototype.hasOwnProperty.call(k,ee)&&(I[ee]=k[ee])}function Ae(k,I,ee,K){var q=k.charAt(I+2);switch(q){case"-":if(k.charAt(I+3)==="-"){var pe=k.indexOf("-->",I+4);return pe>I?(ee.comment(k,I+4,pe-I-4),pe+3):(K.error("Unclosed comment"),-1)}else return-1;default:if(k.substr(I+3,6)=="CDATA["){var pe=k.indexOf("]]>",I+9);return ee.startCDATA(),ee.characters(k,I+9,pe-I-9),ee.endCDATA(),pe+3}var he=de(k,I),F=he.length;if(F>1&&/!doctype/i.test(he[0][0])){var x=he[1][0],S=!1,R=!1;F>3&&(/^public$/i.test(he[2][0])?(S=he[3][0],R=F>4&&he[4][0]):/^system$/i.test(he[2][0])&&(R=he[3][0]));var j=he[F-1];return ee.startDTD(x,S,R),ee.endDTD(),j.index+j[0].length}}return-1}function H(k,I,ee){var K=k.indexOf("?>",I);if(K){var q=k.substring(I,K).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return q?(q[0].length,ee.processingInstruction(q[1],q[2]),K+2):-1}return-1}function A(){this.attributeNames={}}A.prototype={setTagName:function(k){if(!u.test(k))throw new Error("invalid tagName:"+k);this.tagName=k},addValue:function(k,I,ee){if(!u.test(k))throw new Error("invalid attribute:"+k);this.attributeNames[k]=this.length,this[this.length++]={qName:k,value:I,offset:ee}},length:0,getLocalName:function(k){return this[k].localName},getLocator:function(k){return this[k].locator},getQName:function(k){return this[k].qName},getURI:function(k){return this[k].uri},getValue:function(k){return this[k].value}};function de(k,I){var ee,K=[],q=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(q.lastIndex=I,q.exec(k);ee=q.exec(k);)if(K.push(ee),ee[1])return K}return At.XMLReader=V,At.ParseError=U,At}var Ut;function nn(){if(Ut)return pt;Ut=1;var n=yt(),t=Lt(),r=tn(),u=rn(),i=t.DOMImplementation,l=n.NAMESPACE,p=u.ParseError,N=u.XMLReader;function h(_){return _.replace(/\r[\n\u0085]/g,`
|
|
11
|
+
`).replace(/[\r\u0085\u2028]/g,`
|
|
12
|
+
`)}function m(_){this.options=_||{locator:{}}}m.prototype.parseFromString=function(_,oe){var ge=this.options,re=new N,De=ge.domBuilder||new T,Ae=ge.errorHandler,H=ge.locator,A=ge.xmlns||{},de=/\/x?html?$/.test(oe),k=de?r.HTML_ENTITIES:r.XML_ENTITIES;H&&De.setDocumentLocator(H),re.errorHandler=B(Ae,De,H),re.domBuilder=ge.domBuilder||De,de&&(A[""]=l.HTML),A.xml=A.xml||l.XML;var I=ge.normalizeLineEndings||h;return _&&typeof _=="string"?re.parse(I(_),A,k):re.errorHandler.error("invalid doc source"),De.doc};function B(_,oe,ge){if(!_){if(oe instanceof T)return oe;_=oe}var re={},De=_ instanceof Function;ge=ge||{};function Ae(H){var A=_[H];!A&&De&&(A=_.length==2?function(de){_(H,de)}:_),re[H]=A&&function(de){A("[xmldom "+H+"] "+de+V(ge))}||function(){}}return Ae("warning"),Ae("error"),Ae("fatalError"),re}function T(){this.cdata=!1}function U(_,oe){oe.lineNumber=_.lineNumber,oe.columnNumber=_.columnNumber}T.prototype={startDocument:function(){this.doc=new i().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(_,oe,ge,re){var De=this.doc,Ae=De.createElementNS(_,ge||oe),H=re.length;le(this,Ae),this.currentElement=Ae,this.locator&&U(this.locator,Ae);for(var A=0;A<H;A++){var _=re.getURI(A),de=re.getValue(A),ge=re.getQName(A),k=De.createAttributeNS(_,ge);this.locator&&U(re.getLocator(A),k),k.value=k.nodeValue=de,Ae.setAttributeNode(k)}},endElement:function(_,oe,ge){var re=this.currentElement;re.tagName,this.currentElement=re.parentNode},startPrefixMapping:function(_,oe){},endPrefixMapping:function(_){},processingInstruction:function(_,oe){var ge=this.doc.createProcessingInstruction(_,oe);this.locator&&U(this.locator,ge),le(this,ge)},ignorableWhitespace:function(_,oe,ge){},characters:function(_,oe,ge){if(_=ae.apply(this,arguments),_){if(this.cdata)var re=this.doc.createCDATASection(_);else var re=this.doc.createTextNode(_);this.currentElement?this.currentElement.appendChild(re):/^\s*$/.test(_)&&this.doc.appendChild(re),this.locator&&U(this.locator,re)}},skippedEntity:function(_){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(_){(this.locator=_)&&(_.lineNumber=0)},comment:function(_,oe,ge){_=ae.apply(this,arguments);var re=this.doc.createComment(_);this.locator&&U(this.locator,re),le(this,re)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(_,oe,ge){var re=this.doc.implementation;if(re&&re.createDocumentType){var De=re.createDocumentType(_,oe,ge);this.locator&&U(this.locator,De),le(this,De),this.doc.doctype=De}},warning:function(_){console.warn("[xmldom warning] "+_,V(this.locator))},error:function(_){console.error("[xmldom error] "+_,V(this.locator))},fatalError:function(_){throw new p(_,this.locator)}};function V(_){if(_)return`
|
|
13
|
+
@`+(_.systemId||"")+"#[line:"+_.lineNumber+",col:"+_.columnNumber+"]"}function ae(_,oe,ge){return typeof _=="string"?_.substr(oe,ge):_.length>=oe+ge||oe?new java.lang.String(_,oe,ge)+"":_}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(_){T.prototype[_]=function(){return null}});function le(_,oe){_.currentElement?_.currentElement.appendChild(oe):_.doc.appendChild(oe)}return pt.__DOMHandler=T,pt.normalizeLineEndings=h,pt.DOMParser=m,pt}var qt;function on(){if(qt)return ft;qt=1;var n=Lt();return ft.DOMImplementation=n.DOMImplementation,ft.XMLSerializer=n.XMLSerializer,ft.DOMParser=nn().DOMParser,ft}var $t=on();const sn={key:0,class:"xml-node__comment"},un={key:1,class:"xml-node__cdata"},an={key:2,class:"xml-node__element"},ln={key:0,class:"xml-node__line"},cn=["contenteditable","onKeydown"],pn=["contenteditable","onDblclick","onKeydown"],dn=["contenteditable","onDblclick","onKeydown"],hn=["contenteditable","onKeydown"],mn={key:1,class:"xml-node__line"},gn=["contenteditable","onKeydown"],En=["contenteditable","onDblclick","onKeydown"],yn=["contenteditable","onDblclick","onKeydown"],An=["contenteditable","onKeydown"],bn={key:2},xn={key:0,class:"xml-node__line"},Nn=["contenteditable","onKeydown"],Dn=["contenteditable","onDblclick","onKeydown"],vn=["contenteditable","onDblclick","onKeydown"],Cn=["title"],wn={class:"xml-node__line"},Tn=["title"],_n=["contenteditable","onKeydown"],Bn={key:1},Sn=["contenteditable","onKeydown"],On=["contenteditable","onDblclick","onKeydown"],kn=["contenteditable","onDblclick","onKeydown"],Rn=["title"],Fn={key:0,class:"xml-node__children"},In={key:0,class:"xml-node__text"},Pn=["contenteditable","onKeydown"],Ln={key:1,class:"xml-node__line"},Vn=Et(s.defineComponent({__name:"XmlNode",props:{node:{},index:{},level:{default:0},parentPath:{default:""},expanded:{},theme:{}},emits:["toggle-expand","copy","update:tagName","update:attributeName","update:attributeValue","update:textContent","update:cdataContent"],setup(n,{emit:t}){s.useCssVars(g=>({"623698b5":g.theme.colors.indentLine}));const r=n,u=t,i=s.ref(!1),l=s.ref(null),p=s.ref(null),N=s.ref(!1),h=s.ref(!1),m=s.ref(""),B=s.ref(""),T=s.ref(""),U=s.ref(""),V=s.ref(""),ae=s.ref(null),le=s.ref(null),_=s.ref(null),oe=s.ref(null),ge=s.ref(null),re=s.computed(()=>Object.keys(r.node).find(G=>!G.startsWith(":")&&!G.startsWith("#"))||""),De=s.computed(()=>re.value?r.parentPath?`${r.parentPath}.${re.value}[${r.index}]`:`${re.value}[${r.index}]`:""),Ae=s.computed(()=>r.expanded.has(De.value)),H=s.computed(()=>r.node["#comment"]?"comment":r.node.__cdata?"cdata":re.value?"element":"unknown"),A=s.computed(()=>{const g=r.node[":@"]||{},G={};return Object.keys(g).forEach($=>{$.startsWith("@_")&&(G[$.substring(2)]=g[$])}),G}),de=s.computed(()=>{if(H.value!=="element"||!re.value)return[];const g=r.node[re.value];return Array.isArray(g)?g:[]}),k=s.computed(()=>de.value.some(g=>g.__cdata)),I=s.computed(()=>{if(!k.value)return"";const g=de.value.find(G=>G.__cdata);if(g&&Array.isArray(g.__cdata)){const G=g.__cdata;if(G.length>0&&G[0]["#text"])return G[0]["#text"]}return""}),ee=s.computed(()=>{if(H.value!=="element"||!re.value||k.value)return"";const g=r.node[re.value];if(!Array.isArray(g))return"";const G=g.find($=>$["#text"]);return G?G["#text"]:""}),K=s.computed(()=>{if(H.value!=="comment")return"";const g=r.node["#comment"];return Array.isArray(g)&&g.length>0&&g[0]["#text"]||""}),q=s.computed(()=>de.value.some(g=>Object.keys(g).some($=>!$.startsWith("#")&&!$.startsWith(":")))),pe=s.computed(()=>q.value?de.value.filter(g=>Object.keys(g).some($=>!$.startsWith("#")&&!$.startsWith(":"))).length:0),he=s.computed(()=>H.value==="element"&&!q.value&&ee.value.trim()!==""),F=()=>{q.value&&u("toggle-expand",De.value)},x=(g,G)=>`${De.value}-child-${G}`,S=()=>`${De.value}.${re.value}`,R=()=>{i.value=!0,m.value=re.value,s.nextTick(()=>{if(ae.value){ae.value.focus();const g=document.createRange();g.selectNodeContents(ae.value);const G=window.getSelection();G?.removeAllRanges(),G?.addRange(g)}})},j=g=>{l.value=g,B.value=g,s.nextTick(()=>{if(le.value){le.value.focus();const G=document.createRange();G.selectNodeContents(le.value);const $=window.getSelection();$?.removeAllRanges(),$?.addRange(G)}})},M=g=>{p.value=g,T.value=A.value[g]||"",s.nextTick(()=>{if(_.value){_.value.focus();const G=document.createRange();G.selectNodeContents(_.value);const $=window.getSelection();$?.removeAllRanges(),$?.addRange(G)}})},J=()=>{N.value=!0,U.value=ee.value,s.nextTick(()=>{if(oe.value){oe.value.focus();const g=document.createRange();g.selectNodeContents(oe.value);const G=window.getSelection();G?.removeAllRanges(),G?.addRange(g)}})},D=()=>{if(!i.value)return;const g=ae.value?.innerText.trim()||"";if(!g||g===re.value){i.value=!1;return}i.value=!1,u("update:tagName",De.value,re.value,g)},w=()=>{if(!l.value)return;const g=l.value,G=le.value?.innerText.trim()||"";if(!G||G===g){l.value=null;return}l.value=null,u("update:attributeName",De.value,g,G)},P=()=>{if(!p.value)return;const g=p.value,G=_.value?.innerText.trim()||"";p.value=null,u("update:attributeValue",De.value,g,G)},L=()=>{if(!N.value)return;const g=oe.value?.innerText||"";if(g===ee.value){N.value=!1;return}N.value=!1,u("update:textContent",De.value,g)},W=()=>{i.value=!1,m.value=re.value},C=()=>{l.value&&(B.value=l.value,l.value=null)},ne=()=>{p.value&&(T.value=A.value[p.value]||"",p.value=null)},Ee=()=>{N.value=!1,U.value=ee.value},be=()=>{h.value=!0,V.value=I.value,s.nextTick(()=>{if(ge.value){ge.value.focus();const g=document.createRange();g.selectNodeContents(ge.value);const G=window.getSelection();G?.removeAllRanges(),G?.addRange(g)}})},Te=()=>{if(!h.value)return;const g=ge.value?.innerText||"";if(g===I.value){h.value=!1;return}h.value=!1,u("update:cdataContent",De.value,g)},ke=()=>{h.value=!1,V.value=I.value},ve=g=>{q.value&&(g.preventDefault(),R())};return(g,G)=>{const $=s.resolveComponent("XmlNode",!0);return s.openBlock(),s.createElementBlock("div",{class:"xml-node",style:s.normalizeStyle({paddingLeft:g.level>0?"16px":"0"})},[H.value==="comment"?(s.openBlock(),s.createElementBlock("div",sn,[s.createElementVNode("span",{style:s.normalizeStyle({color:g.theme.colors.xmlComment})}," <!-- "+s.toDisplayString(K.value)+" --> ",5)])):H.value==="cdata"?(s.openBlock(),s.createElementBlock("div",un,[s.createElementVNode("span",{style:s.normalizeStyle({color:g.theme.colors.xmlCdata})}," <![CDATA["+s.toDisplayString(g.node.__cdata)+"]]> ",5)])):H.value==="element"?(s.openBlock(),s.createElementBlock("div",an,[k.value?(s.openBlock(),s.createElementBlock("div",ln,[s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},"<",4),s.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:s.normalizeStyle({color:g.theme.colors.xmlTag}),contenteditable:i.value,onDblclick:R,onContextmenu:ve,onKeydown:[s.withKeys(s.withModifiers(D,["prevent"]),["enter"]),s.withKeys(W,["escape"])],onBlur:D,ref_key:"tagNameRef",ref:ae,title:"Double-click to edit tag name"},s.toDisplayString(i.value?m.value:re.value),45,cn),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(A.value,(_e,ce)=>(s.openBlock(),s.createElementBlock("span",{key:ce,class:"xml-node__attribute"},[s.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:s.normalizeStyle({color:g.theme.colors.xmlAttribute}),contenteditable:l.value===ce,onDblclick:se=>j(ce),onKeydown:[s.withKeys(s.withModifiers(w,["prevent"]),["enter"]),s.withKeys(C,["escape"])],onBlur:w,ref_for:!0,ref:se=>{l.value===ce&&(le.value=se)},title:"Double-click to edit attribute name"},s.toDisplayString(l.value===ce?B.value:ce),45,pn),s.createElementVNode("span",{class:"xml-node__equals",style:s.normalizeStyle({color:g.theme.colors.xmlEquals})},"=",4),s.createElementVNode("span",{class:"xml-node__quote",style:s.normalizeStyle({color:g.theme.colors.xmlQuote})},'"',4),s.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:s.normalizeStyle({color:g.theme.colors.xmlAttributeValue}),contenteditable:p.value===ce,onDblclick:se=>M(ce),onKeydown:[s.withKeys(s.withModifiers(P,["prevent"]),["enter"]),s.withKeys(ne,["escape"])],onBlur:P,ref_for:!0,ref:se=>{p.value===ce&&(_.value=se)},title:"Double-click to edit attribute value"},s.toDisplayString(p.value===ce?T.value:_e),45,dn),s.createElementVNode("span",{class:"xml-node__quote",style:s.normalizeStyle({color:g.theme.colors.xmlQuote})},'"',4)]))),128)),s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},">",4),s.createElementVNode("span",{class:"xml-node__cdata",style:s.normalizeStyle({color:g.theme.colors.xmlCdata})},"<![CDATA[",4),s.createElementVNode("span",{class:"xml-node__cdata-content xml-node__cdata-content--editable",style:s.normalizeStyle({color:g.theme.colors.xmlCdata}),contenteditable:h.value,onDblclick:be,onKeydown:[s.withKeys(s.withModifiers(Te,["prevent"]),["enter"]),s.withKeys(ke,["escape"])],onBlur:Te,ref_key:"cdataContentRef",ref:ge,title:"Double-click to edit CDATA content"},s.toDisplayString(h.value?V.value:I.value),45,hn),s.createElementVNode("span",{class:"xml-node__cdata",style:s.normalizeStyle({color:g.theme.colors.xmlCdata})},"]]>",4),s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},"</",4),s.createElementVNode("span",{class:"xml-node__tag",style:s.normalizeStyle({color:g.theme.colors.xmlTag})},s.toDisplayString(i.value?m.value:re.value),5),s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},">",4)])):he.value?(s.openBlock(),s.createElementBlock("div",mn,[s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},"<",4),s.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:s.normalizeStyle({color:g.theme.colors.xmlTag}),contenteditable:i.value,onDblclick:R,onContextmenu:ve,onKeydown:[s.withKeys(s.withModifiers(D,["prevent"]),["enter"]),s.withKeys(W,["escape"])],onBlur:D,ref_key:"tagNameRef",ref:ae,title:"Double-click to edit tag name"},s.toDisplayString(i.value?m.value:re.value),45,gn),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(A.value,(_e,ce)=>(s.openBlock(),s.createElementBlock("span",{key:ce,class:"xml-node__attribute"},[s.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:s.normalizeStyle({color:g.theme.colors.xmlAttribute}),contenteditable:l.value===ce,onDblclick:se=>j(ce),onKeydown:[s.withKeys(s.withModifiers(w,["prevent"]),["enter"]),s.withKeys(C,["escape"])],onBlur:w,ref_for:!0,ref:se=>{l.value===ce&&(le.value=se)},title:"Double-click to edit attribute name"},s.toDisplayString(l.value===ce?B.value:ce),45,En),s.createElementVNode("span",{class:"xml-node__equals",style:s.normalizeStyle({color:g.theme.colors.xmlEquals})},"=",4),s.createElementVNode("span",{class:"xml-node__quote",style:s.normalizeStyle({color:g.theme.colors.xmlQuote})},'"',4),s.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:s.normalizeStyle({color:g.theme.colors.xmlAttributeValue}),contenteditable:p.value===ce,onDblclick:se=>M(ce),onKeydown:[s.withKeys(s.withModifiers(P,["prevent"]),["enter"]),s.withKeys(ne,["escape"])],onBlur:P,ref_for:!0,ref:se=>{p.value===ce&&(_.value=se)},title:"Double-click to edit attribute value"},s.toDisplayString(p.value===ce?T.value:_e),45,yn),s.createElementVNode("span",{class:"xml-node__quote",style:s.normalizeStyle({color:g.theme.colors.xmlQuote})},'"',4)]))),128)),s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},">",4),s.createElementVNode("span",{class:"xml-node__text-content xml-node__text-content--editable",style:s.normalizeStyle({color:g.theme.colors.xmlText}),contenteditable:N.value,onDblclick:J,onKeydown:[s.withKeys(s.withModifiers(L,["prevent"]),["enter"]),s.withKeys(Ee,["escape"])],onBlur:L,ref_key:"textContentRef",ref:oe,title:"Double-click to edit text content"},s.toDisplayString(N.value?U.value:ee.value),45,An),s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},"</",4),s.createElementVNode("span",{class:"xml-node__tag",style:s.normalizeStyle({color:g.theme.colors.xmlTag})},s.toDisplayString(i.value?m.value:re.value),5),s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},">",4)])):(s.openBlock(),s.createElementBlock("div",bn,[!Ae.value&&q.value?(s.openBlock(),s.createElementBlock("div",xn,[s.createElementVNode("span",{class:"xml-node__clickable-part",onClick:G[0]||(G[0]=_e=>F()),title:"Click to expand"},[s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},"<",4),s.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:s.normalizeStyle({color:g.theme.colors.xmlTag}),contenteditable:i.value,onDblclick:s.withModifiers(R,["stop"]),onContextmenu:ve,onKeydown:[s.withKeys(s.withModifiers(D,["prevent"]),["enter"]),s.withKeys(W,["escape"])],onBlur:D,ref_key:"tagNameRef",ref:ae,title:"Double-click or right-click to edit tag name"},s.toDisplayString(i.value?m.value:re.value),45,Nn)]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(A.value,(_e,ce)=>(s.openBlock(),s.createElementBlock("span",{key:ce,class:"xml-node__attribute"},[s.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:s.normalizeStyle({color:g.theme.colors.xmlAttribute}),contenteditable:l.value===ce,onDblclick:se=>j(ce),onKeydown:[s.withKeys(s.withModifiers(w,["prevent"]),["enter"]),s.withKeys(C,["escape"])],onBlur:w,ref_for:!0,ref:se=>{l.value===ce&&(le.value=se)},title:"Double-click to edit attribute name"},s.toDisplayString(l.value===ce?B.value:ce),45,Dn),s.createElementVNode("span",{class:"xml-node__equals",style:s.normalizeStyle({color:g.theme.colors.xmlEquals})},"=",4),s.createElementVNode("span",{class:"xml-node__quote",style:s.normalizeStyle({color:g.theme.colors.xmlQuote})},'"',4),s.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:s.normalizeStyle({color:g.theme.colors.xmlAttributeValue}),contenteditable:p.value===ce,onDblclick:se=>M(ce),onKeydown:[s.withKeys(s.withModifiers(P,["prevent"]),["enter"]),s.withKeys(ne,["escape"])],onBlur:P,ref_for:!0,ref:se=>{p.value===ce&&(_.value=se)},title:"Double-click to edit attribute value"},s.toDisplayString(p.value===ce?T.value:_e),45,vn),s.createElementVNode("span",{class:"xml-node__quote",style:s.normalizeStyle({color:g.theme.colors.xmlQuote})},'"',4)]))),128)),s.createElementVNode("span",{class:"xml-node__clickable-part",onClick:G[1]||(G[1]=_e=>F()),title:"Click to expand"},[s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},">",4)]),s.createElementVNode("span",{class:"xml-node__collapsed-badge",style:s.normalizeStyle({backgroundColor:g.theme.colors.collapsedBackground,color:g.theme.colors.collapsedText}),onClick:G[2]||(G[2]=_e=>F()),title:`Click to expand ${pe.value} child element${pe.value>1?"s":""}`},s.toDisplayString(pe.value)+" child"+s.toDisplayString(pe.value>1?"ren":""),13,Cn),s.createElementVNode("span",{class:"xml-node__clickable-part",onClick:G[3]||(G[3]=_e=>F()),title:"Click to expand"},[s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},"</",4),s.createElementVNode("span",{class:"xml-node__tag",style:s.normalizeStyle({color:g.theme.colors.xmlTag})},s.toDisplayString(i.value?m.value:re.value),5),s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},">",4)])])):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("div",wn,[q.value?(s.openBlock(),s.createElementBlock("span",{key:0,class:"xml-node__clickable-part",onClick:G[4]||(G[4]=_e=>F()),title:Ae.value?"Click to collapse":"Click to expand"},[s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},"<",4),s.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:s.normalizeStyle({color:g.theme.colors.xmlTag}),contenteditable:i.value,onDblclick:s.withModifiers(R,["stop"]),onContextmenu:ve,onKeydown:[s.withKeys(s.withModifiers(D,["prevent"]),["enter"]),s.withKeys(W,["escape"])],onBlur:D,ref_key:"tagNameRef",ref:ae,title:"Double-click or right-click to edit tag name"},s.toDisplayString(i.value?m.value:re.value),45,_n)],8,Tn)):(s.openBlock(),s.createElementBlock("span",Bn,[s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},"<",4),s.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:s.normalizeStyle({color:g.theme.colors.xmlTag}),contenteditable:i.value,onDblclick:R,onKeydown:[s.withKeys(s.withModifiers(D,["prevent"]),["enter"]),s.withKeys(W,["escape"])],onBlur:D,ref_key:"tagNameRef",ref:ae,title:"Double-click to edit tag name"},s.toDisplayString(i.value?m.value:re.value),45,Sn)])),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(A.value,(_e,ce)=>(s.openBlock(),s.createElementBlock("span",{key:ce,class:"xml-node__attribute"},[s.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:s.normalizeStyle({color:g.theme.colors.xmlAttribute}),contenteditable:l.value===ce,onDblclick:se=>j(ce),onKeydown:[s.withKeys(s.withModifiers(w,["prevent"]),["enter"]),s.withKeys(C,["escape"])],onBlur:w,ref_for:!0,ref:se=>{l.value===ce&&(le.value=se)},title:"Double-click to edit attribute name"},s.toDisplayString(l.value===ce?B.value:ce),45,On),s.createElementVNode("span",{class:"xml-node__equals",style:s.normalizeStyle({color:g.theme.colors.xmlEquals})},"=",4),s.createElementVNode("span",{class:"xml-node__quote",style:s.normalizeStyle({color:g.theme.colors.xmlQuote})},'"',4),s.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:s.normalizeStyle({color:g.theme.colors.xmlAttributeValue}),contenteditable:p.value===ce,onDblclick:se=>M(ce),onKeydown:[s.withKeys(s.withModifiers(P,["prevent"]),["enter"]),s.withKeys(ne,["escape"])],onBlur:P,ref_for:!0,ref:se=>{p.value===ce&&(_.value=se)},title:"Double-click to edit attribute value"},s.toDisplayString(p.value===ce?T.value:_e),45,kn),s.createElementVNode("span",{class:"xml-node__quote",style:s.normalizeStyle({color:g.theme.colors.xmlQuote})},'"',4)]))),128)),q.value?(s.openBlock(),s.createElementBlock("span",{key:2,class:"xml-node__clickable-part",onClick:G[5]||(G[5]=_e=>F()),title:Ae.value?"Click to collapse":"Click to expand"},[s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},">",4)],8,Rn)):(s.openBlock(),s.createElementBlock("span",{key:3,class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},s.toDisplayString(q.value?">":"/>"),5))]),Ae.value&&q.value?(s.openBlock(),s.createElementBlock("div",Fn,[de.value.length===0&&ee.value.trim()?(s.openBlock(),s.createElementBlock("div",In,[s.createElementVNode("span",{class:"xml-node__text-content xml-node__text-content--editable",style:s.normalizeStyle({color:g.theme.colors.xmlText}),contenteditable:N.value,onDblclick:J,onKeydown:[s.withKeys(s.withModifiers(L,["prevent"]),["enter"]),s.withKeys(Ee,["escape"])],onBlur:L,ref_key:"textContentRef",ref:oe,title:"Double-click to edit text content"},s.toDisplayString(N.value?U.value:ee.value),45,Pn)])):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(de.value,(_e,ce)=>(s.openBlock(),s.createBlock($,{key:x(_e,ce),node:_e,index:ce,level:g.level+1,"parent-path":S(),expanded:g.expanded,theme:g.theme,onToggleExpand:G[6]||(G[6]=se=>g.$emit("toggle-expand",se)),onCopy:G[7]||(G[7]=se=>g.$emit("copy",se)),"onUpdate:tagName":G[8]||(G[8]=(se,X,z)=>g.$emit("update:tagName",se,X,z)),"onUpdate:attributeName":G[9]||(G[9]=(se,X,z)=>g.$emit("update:attributeName",se,X,z)),"onUpdate:attributeValue":G[10]||(G[10]=(se,X,z)=>g.$emit("update:attributeValue",se,X,z)),"onUpdate:textContent":G[11]||(G[11]=(se,X)=>g.$emit("update:textContent",se,X)),"onUpdate:cdataContent":G[12]||(G[12]=(se,X)=>g.$emit("update:cdataContent",se,X))},null,8,["node","index","level","parent-path","expanded","theme"]))),128))])):s.createCommentVNode("",!0),Ae.value&&q.value?(s.openBlock(),s.createElementBlock("div",Ln,[s.createElementVNode("span",{class:"xml-node__clickable-part",onClick:G[13]||(G[13]=_e=>F()),title:"Click to collapse"},[s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},"</",4),s.createElementVNode("span",{class:"xml-node__tag",style:s.normalizeStyle({color:g.theme.colors.xmlTag})},s.toDisplayString(i.value?m.value:re.value),5),s.createElementVNode("span",{class:"xml-node__bracket",style:s.normalizeStyle({color:g.theme.colors.xmlBracket})},">",4)])])):s.createCommentVNode("",!0)],64))]))])):s.createCommentVNode("",!0)],4)}}}),[["__scopeId","data-v-44ac0d91"]]),jt={"github-light":{name:"github-light",colors:{background:"#ffffff",surfaceBackground:"#f6f8fa",border:"#d0d7de",text:"#24292f",textSecondary:"#57606a",buttonBackground:"#f6f8fa",buttonBackgroundHover:"#f3f4f6",buttonBorder:"#d0d7de",buttonText:"#24292f",buttonPrimary:"#1f883d",buttonPrimaryHover:"#1a7f37",success:"#1f883d",successBackground:"#dafbe1",error:"#cf222e",errorBackground:"#ffebe9",xmlTag:"#116329",xmlAttribute:"#0550ae",xmlAttributeValue:"#0a3069",xmlText:"#24292f",xmlComment:"#6e7781",xmlCdata:"#8250df",xmlDeclaration:"#953800",xmlBracket:"#6e7781",xmlEquals:"#6e7781",xmlQuote:"#0550ae",collapsedBackground:"#ddf4ff",collapsedText:"#0969da",indentLine:"#d0d7de"}},"github-dark":{name:"github-dark",colors:{background:"#0d1117",surfaceBackground:"#161b22",border:"#30363d",text:"#c9d1d9",textSecondary:"#8b949e",buttonBackground:"#21262d",buttonBackgroundHover:"#30363d",buttonBorder:"#30363d",buttonText:"#c9d1d9",buttonPrimary:"#238636",buttonPrimaryHover:"#2ea043",success:"#3fb950",successBackground:"#0f2e1c",error:"#f85149",errorBackground:"#3d1319",xmlTag:"#7ee787",xmlAttribute:"#79c0ff",xmlAttributeValue:"#a5d6ff",xmlText:"#c9d1d9",xmlComment:"#8b949e",xmlCdata:"#d2a8ff",xmlDeclaration:"#ffa657",xmlBracket:"#8b949e",xmlEquals:"#8b949e",xmlQuote:"#79c0ff",collapsedBackground:"#1c2d41",collapsedText:"#58a6ff",indentLine:"#30363d"}},"min-light":{name:"min-light",colors:{background:"#ffffff",surfaceBackground:"#fafafa",border:"#e5e5e5",text:"#171717",textSecondary:"#737373",buttonBackground:"#fafafa",buttonBackgroundHover:"#f5f5f5",buttonBorder:"#e5e5e5",buttonText:"#171717",buttonPrimary:"#22c55e",buttonPrimaryHover:"#16a34a",success:"#22c55e",successBackground:"#dcfce7",error:"#ef4444",errorBackground:"#fee2e2",xmlTag:"#16a34a",xmlAttribute:"#2563eb",xmlAttributeValue:"#1e40af",xmlText:"#171717",xmlComment:"#737373",xmlCdata:"#9333ea",xmlDeclaration:"#ea580c",xmlBracket:"#737373",xmlEquals:"#737373",xmlQuote:"#2563eb",collapsedBackground:"#dbeafe",collapsedText:"#1d4ed8",indentLine:"#e5e7eb"}},"slack-ochin":{name:"slack-ochin",colors:{background:"#fef5ed",surfaceBackground:"#fef9f3",border:"#e9dcc9",text:"#3d3c40",textSecondary:"#616061",buttonBackground:"#fef9f3",buttonBackgroundHover:"#f9f0e5",buttonBorder:"#e9dcc9",buttonText:"#3d3c40",buttonPrimary:"#007a5a",buttonPrimaryHover:"#006644",success:"#007a5a",successBackground:"#d1f4e0",error:"#e01e5a",errorBackground:"#ffdbea",xmlTag:"#007a5a",xmlAttribute:"#1264a3",xmlAttributeValue:"#0b4c8c",xmlText:"#3d3c40",xmlComment:"#616061",xmlCdata:"#8b2eff",xmlDeclaration:"#e8912d",xmlBracket:"#616061",xmlEquals:"#616061",xmlQuote:"#1264a3",collapsedBackground:"#d8eaf5",collapsedText:"#0b4c8c",indentLine:"#e8d5b7"}}},Mn=n=>jt[n]||jt["github-light"],Xt=":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",Un=Xt+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",qn="["+Xt+"]["+Un+"]*",$n=new RegExp("^"+qn+"$");function Ht(n,t){const r=[];let u=t.exec(n);for(;u;){const i=[];i.startIndex=t.lastIndex-u[0].length;const l=u.length;for(let p=0;p<l;p++)i.push(u[p]);r.push(i),u=t.exec(n)}return r}const bt=function(n){const t=$n.exec(n);return!(t===null||typeof t>"u")};function jn(n){return typeof n<"u"}const Xn={allowBooleanAttributes:!1,unpairedTags:[]};function Gt(n,t){t=Object.assign({},Xn,t);const r=[];let u=!1,i=!1;n[0]==="\uFEFF"&&(n=n.substr(1));for(let l=0;l<n.length;l++)if(n[l]==="<"&&n[l+1]==="?"){if(l+=2,l=zt(n,l),l.err)return l}else if(n[l]==="<"){let p=l;if(l++,n[l]==="!"){l=Yt(n,l);continue}else{let N=!1;n[l]==="/"&&(N=!0,l++);let h="";for(;l<n.length&&n[l]!==">"&&n[l]!==" "&&n[l]!==" "&&n[l]!==`
|
|
14
|
+
`&&n[l]!=="\r";l++)h+=n[l];if(h=h.trim(),h[h.length-1]==="/"&&(h=h.substring(0,h.length-1),l--),!Zn(h)){let T;return h.trim().length===0?T="Invalid space after '<'.":T="Tag '"+h+"' is an invalid name.",Oe("InvalidTag",T,Le(n,l))}const m=Kn(n,l);if(m===!1)return Oe("InvalidAttr","Attributes for '"+h+"' have open quote.",Le(n,l));let B=m.value;if(l=m.index,B[B.length-1]==="/"){const T=l-B.length;B=B.substring(0,B.length-1);const U=Wt(B,t);if(U===!0)u=!0;else return Oe(U.err.code,U.err.msg,Le(n,T+U.err.line))}else if(N)if(m.tagClosed){if(B.trim().length>0)return Oe("InvalidTag","Closing tag '"+h+"' can't have attributes or invalid starting.",Le(n,p));if(r.length===0)return Oe("InvalidTag","Closing tag '"+h+"' has not been opened.",Le(n,p));{const T=r.pop();if(h!==T.tagName){let U=Le(n,T.tagStartPos);return Oe("InvalidTag","Expected closing tag '"+T.tagName+"' (opened in line "+U.line+", col "+U.col+") instead of closing tag '"+h+"'.",Le(n,p))}r.length==0&&(i=!0)}}else return Oe("InvalidTag","Closing tag '"+h+"' doesn't have proper closing.",Le(n,l));else{const T=Wt(B,t);if(T!==!0)return Oe(T.err.code,T.err.msg,Le(n,l-B.length+T.err.line));if(i===!0)return Oe("InvalidXml","Multiple possible root nodes found.",Le(n,l));t.unpairedTags.indexOf(h)!==-1||r.push({tagName:h,tagStartPos:p}),u=!0}for(l++;l<n.length;l++)if(n[l]==="<")if(n[l+1]==="!"){l++,l=Yt(n,l);continue}else if(n[l+1]==="?"){if(l=zt(n,++l),l.err)return l}else break;else if(n[l]==="&"){const T=Wn(n,l);if(T==-1)return Oe("InvalidChar","char '&' is not expected.",Le(n,l));l=T}else if(i===!0&&!Kt(n[l]))return Oe("InvalidXml","Extra text at the end",Le(n,l));n[l]==="<"&&l--}}else{if(Kt(n[l]))continue;return Oe("InvalidChar","char '"+n[l]+"' is not expected.",Le(n,l))}if(u){if(r.length==1)return Oe("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",Le(n,r[0].tagStartPos));if(r.length>0)return Oe("InvalidXml","Invalid '"+JSON.stringify(r.map(l=>l.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Oe("InvalidXml","Start tag expected.",1);return!0}function Kt(n){return n===" "||n===" "||n===`
|
|
15
|
+
`||n==="\r"}function zt(n,t){const r=t;for(;t<n.length;t++)if(n[t]=="?"||n[t]==" "){const u=n.substr(r,t-r);if(t>5&&u==="xml")return Oe("InvalidXml","XML declaration allowed only at the start of the document.",Le(n,t));if(n[t]=="?"&&n[t+1]==">"){t++;break}else continue}return t}function Yt(n,t){if(n.length>t+5&&n[t+1]==="-"&&n[t+2]==="-"){for(t+=3;t<n.length;t++)if(n[t]==="-"&&n[t+1]==="-"&&n[t+2]===">"){t+=2;break}}else if(n.length>t+8&&n[t+1]==="D"&&n[t+2]==="O"&&n[t+3]==="C"&&n[t+4]==="T"&&n[t+5]==="Y"&&n[t+6]==="P"&&n[t+7]==="E"){let r=1;for(t+=8;t<n.length;t++)if(n[t]==="<")r++;else if(n[t]===">"&&(r--,r===0))break}else if(n.length>t+9&&n[t+1]==="["&&n[t+2]==="C"&&n[t+3]==="D"&&n[t+4]==="A"&&n[t+5]==="T"&&n[t+6]==="A"&&n[t+7]==="["){for(t+=8;t<n.length;t++)if(n[t]==="]"&&n[t+1]==="]"&&n[t+2]===">"){t+=2;break}}return t}const Hn='"',Gn="'";function Kn(n,t){let r="",u="",i=!1;for(;t<n.length;t++){if(n[t]===Hn||n[t]===Gn)u===""?u=n[t]:u!==n[t]||(u="");else if(n[t]===">"&&u===""){i=!0;break}r+=n[t]}return u!==""?!1:{value:r,index:t,tagClosed:i}}const zn=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Wt(n,t){const r=Ht(n,zn),u={};for(let i=0;i<r.length;i++){if(r[i][1].length===0)return Oe("InvalidAttr","Attribute '"+r[i][2]+"' has no space in starting.",dt(r[i]));if(r[i][3]!==void 0&&r[i][4]===void 0)return Oe("InvalidAttr","Attribute '"+r[i][2]+"' is without value.",dt(r[i]));if(r[i][3]===void 0&&!t.allowBooleanAttributes)return Oe("InvalidAttr","boolean attribute '"+r[i][2]+"' is not allowed.",dt(r[i]));const l=r[i][2];if(!Qn(l))return Oe("InvalidAttr","Attribute '"+l+"' is an invalid name.",dt(r[i]));if(!u.hasOwnProperty(l))u[l]=1;else return Oe("InvalidAttr","Attribute '"+l+"' is repeated.",dt(r[i]))}return!0}function Yn(n,t){let r=/\d/;for(n[t]==="x"&&(t++,r=/[\da-fA-F]/);t<n.length;t++){if(n[t]===";")return t;if(!n[t].match(r))break}return-1}function Wn(n,t){if(t++,n[t]===";")return-1;if(n[t]==="#")return t++,Yn(n,t);let r=0;for(;t<n.length;t++,r++)if(!(n[t].match(/\w/)&&r<20)){if(n[t]===";")break;return-1}return t}function Oe(n,t,r){return{err:{code:n,msg:t,line:r.line||r,col:r.col}}}function Qn(n){return bt(n)}function Zn(n){return bt(n)}function Le(n,t){const r=n.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function dt(n){return n.startIndex+n[1].length}const Jn={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(n,t){return t},attributeValueProcessor:function(n,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,t,r){return n},captureMetaData:!1},eo=function(n){return Object.assign({},Jn,n)};let xt;typeof Symbol!="function"?xt="@@xmlMetadata":xt=Symbol("XML Node Metadata");class it{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,r){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:r})}addChild(t,r){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),r!==void 0&&(this.child[this.child.length-1][xt]={startIndex:r})}static getMetaDataSymbol(){return xt}}class to{constructor(t){this.suppressValidationErr=!t}readDocType(t,r){const u={};if(t[r+3]==="O"&&t[r+4]==="C"&&t[r+5]==="T"&&t[r+6]==="Y"&&t[r+7]==="P"&&t[r+8]==="E"){r=r+9;let i=1,l=!1,p=!1,N="";for(;r<t.length;r++)if(t[r]==="<"&&!p){if(l&&ut(t,"!ENTITY",r)){r+=7;let h,m;[h,m,r]=this.readEntityExp(t,r+1,this.suppressValidationErr),m.indexOf("&")===-1&&(u[h]={regx:RegExp(`&${h};`,"g"),val:m})}else if(l&&ut(t,"!ELEMENT",r)){r+=8;const{index:h}=this.readElementExp(t,r+1);r=h}else if(l&&ut(t,"!ATTLIST",r))r+=8;else if(l&&ut(t,"!NOTATION",r)){r+=9;const{index:h}=this.readNotationExp(t,r+1,this.suppressValidationErr);r=h}else if(ut(t,"!--",r))p=!0;else throw new Error("Invalid DOCTYPE");i++,N=""}else if(t[r]===">"){if(p?t[r-1]==="-"&&t[r-2]==="-"&&(p=!1,i--):i--,i===0)break}else t[r]==="["?l=!0:N+=t[r];if(i!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:u,i:r}}readEntityExp(t,r){r=Ve(t,r);let u="";for(;r<t.length&&!/\s/.test(t[r])&&t[r]!=='"'&&t[r]!=="'";)u+=t[r],r++;if(ht(u),r=Ve(t,r),!this.suppressValidationErr){if(t.substring(r,r+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(t[r]==="%")throw new Error("Parameter entities are not supported")}let i="";return[r,i]=this.readIdentifierVal(t,r,"entity"),r--,[u,i,r]}readNotationExp(t,r){r=Ve(t,r);let u="";for(;r<t.length&&!/\s/.test(t[r]);)u+=t[r],r++;!this.suppressValidationErr&&ht(u),r=Ve(t,r);const i=t.substring(r,r+6).toUpperCase();if(!this.suppressValidationErr&&i!=="SYSTEM"&&i!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${i}"`);r+=i.length,r=Ve(t,r);let l=null,p=null;if(i==="PUBLIC")[r,l]=this.readIdentifierVal(t,r,"publicIdentifier"),r=Ve(t,r),(t[r]==='"'||t[r]==="'")&&([r,p]=this.readIdentifierVal(t,r,"systemIdentifier"));else if(i==="SYSTEM"&&([r,p]=this.readIdentifierVal(t,r,"systemIdentifier"),!this.suppressValidationErr&&!p))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:u,publicIdentifier:l,systemIdentifier:p,index:--r}}readIdentifierVal(t,r,u){let i="";const l=t[r];if(l!=='"'&&l!=="'")throw new Error(`Expected quoted string, found "${l}"`);for(r++;r<t.length&&t[r]!==l;)i+=t[r],r++;if(t[r]!==l)throw new Error(`Unterminated ${u} value`);return r++,[r,i]}readElementExp(t,r){r=Ve(t,r);let u="";for(;r<t.length&&!/\s/.test(t[r]);)u+=t[r],r++;if(!this.suppressValidationErr&&!bt(u))throw new Error(`Invalid element name: "${u}"`);r=Ve(t,r);let i="";if(t[r]==="E"&&ut(t,"MPTY",r))r+=4;else if(t[r]==="A"&&ut(t,"NY",r))r+=2;else if(t[r]==="("){for(r++;r<t.length&&t[r]!==")";)i+=t[r],r++;if(t[r]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[r]}"`);return{elementName:u,contentModel:i.trim(),index:r}}readAttlistExp(t,r){r=Ve(t,r);let u="";for(;r<t.length&&!/\s/.test(t[r]);)u+=t[r],r++;ht(u),r=Ve(t,r);let i="";for(;r<t.length&&!/\s/.test(t[r]);)i+=t[r],r++;if(!ht(i))throw new Error(`Invalid attribute name: "${i}"`);r=Ve(t,r);let l="";if(t.substring(r,r+8).toUpperCase()==="NOTATION"){if(l="NOTATION",r+=8,r=Ve(t,r),t[r]!=="(")throw new Error(`Expected '(', found "${t[r]}"`);r++;let N=[];for(;r<t.length&&t[r]!==")";){let h="";for(;r<t.length&&t[r]!=="|"&&t[r]!==")";)h+=t[r],r++;if(h=h.trim(),!ht(h))throw new Error(`Invalid notation name: "${h}"`);N.push(h),t[r]==="|"&&(r++,r=Ve(t,r))}if(t[r]!==")")throw new Error("Unterminated list of notations");r++,l+=" ("+N.join("|")+")"}else{for(;r<t.length&&!/\s/.test(t[r]);)l+=t[r],r++;const N=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!N.includes(l.toUpperCase()))throw new Error(`Invalid attribute type: "${l}"`)}r=Ve(t,r);let p="";return t.substring(r,r+8).toUpperCase()==="#REQUIRED"?(p="#REQUIRED",r+=8):t.substring(r,r+7).toUpperCase()==="#IMPLIED"?(p="#IMPLIED",r+=7):[r,p]=this.readIdentifierVal(t,r,"ATTLIST"),{elementName:u,attributeName:i,attributeType:l,defaultValue:p,index:r}}}const Ve=(n,t)=>{for(;t<n.length&&/\s/.test(n[t]);)t++;return t};function ut(n,t,r){for(let u=0;u<t.length;u++)if(t[u]!==n[r+u+1])return!1;return!0}function ht(n){if(bt(n))return n;throw new Error(`Invalid entity name ${n}`)}const ro=/^[-+]?0x[a-fA-F0-9]+$/,no=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,oo={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function so(n,t={}){if(t=Object.assign({},oo,t),!n||typeof n!="string")return n;let r=n.trim();if(t.skipLike!==void 0&&t.skipLike.test(r))return n;if(n==="0")return 0;if(t.hex&&ro.test(r))return lo(r,16);if(r.search(/.+[eE].+/)!==-1)return uo(n,r,t);{const u=no.exec(r);if(u){const i=u[1]||"",l=u[2];let p=ao(u[3]);const N=i?n[l.length+1]===".":n[l.length]===".";if(!t.leadingZeros&&(l.length>1||l.length===1&&!N))return n;{const h=Number(r),m=String(h);if(h===0)return h;if(m.search(/[eE]/)!==-1)return t.eNotation?h:n;if(r.indexOf(".")!==-1)return m==="0"||m===p||m===`${i}${p}`?h:n;let B=l?p:r;return l?B===m||i+B===m?h:n:B===m||B===i+m?h:n}}else return n}}const io=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function uo(n,t,r){if(!r.eNotation)return n;const u=t.match(io);if(u){let i=u[1]||"";const l=u[3].indexOf("e")===-1?"E":"e",p=u[2],N=i?n[p.length+1]===l:n[p.length]===l;return p.length>1&&N?n:p.length===1&&(u[3].startsWith(`.${l}`)||u[3][0]===l)?Number(t):r.leadingZeros&&!N?(t=(u[1]||"")+u[3],Number(t)):n}else return n}function ao(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substring(0,n.length-1))),n}function lo(n,t){if(parseInt)return parseInt(n,t);if(Number.parseInt)return Number.parseInt(n,t);if(window&&window.parseInt)return window.parseInt(n,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Qt(n){return typeof n=="function"?n:Array.isArray(n)?t=>{for(const r of n)if(typeof r=="string"&&t===r||r instanceof RegExp&&r.test(t))return!0}:()=>!1}class co{constructor(t){this.options=t,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:(r,u)=>String.fromCodePoint(Number.parseInt(u,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(r,u)=>String.fromCodePoint(Number.parseInt(u,16))}},this.addExternalEntities=fo,this.parseXml=Eo,this.parseTextData=po,this.resolveNameSpace=ho,this.buildAttributesMap=go,this.isItStopNode=xo,this.replaceEntitiesValue=Ao,this.readStopNodeData=Do,this.saveTextToParentTag=bo,this.addChild=yo,this.ignoreAttributesFn=Qt(this.options.ignoreAttributes)}}function fo(n){const t=Object.keys(n);for(let r=0;r<t.length;r++){const u=t[r];this.lastEntities[u]={regex:new RegExp("&"+u+";","g"),val:n[u]}}}function po(n,t,r,u,i,l,p){if(n!==void 0&&(this.options.trimValues&&!u&&(n=n.trim()),n.length>0)){p||(n=this.replaceEntitiesValue(n));const N=this.options.tagValueProcessor(t,n,r,i,l);return N==null?n:typeof N!=typeof n||N!==n?N:this.options.trimValues?Tt(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?Tt(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function ho(n){if(this.options.removeNSPrefix){const t=n.split(":"),r=n.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(n=r+t[1])}return n}const mo=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function go(n,t,r){if(this.options.ignoreAttributes!==!0&&typeof n=="string"){const u=Ht(n,mo),i=u.length,l={};for(let p=0;p<i;p++){const N=this.resolveNameSpace(u[p][1]);if(this.ignoreAttributesFn(N,t))continue;let h=u[p][4],m=this.options.attributeNamePrefix+N;if(N.length)if(this.options.transformAttributeName&&(m=this.options.transformAttributeName(m)),m==="__proto__"&&(m="#__proto__"),h!==void 0){this.options.trimValues&&(h=h.trim()),h=this.replaceEntitiesValue(h);const B=this.options.attributeValueProcessor(N,h,t);B==null?l[m]=h:typeof B!=typeof h||B!==h?l[m]=B:l[m]=Tt(h,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(l[m]=!0)}if(!Object.keys(l).length)return;if(this.options.attributesGroupName){const p={};return p[this.options.attributesGroupName]=l,p}return l}}const Eo=function(n){n=n.replace(/\r\n?/g,`
|
|
16
|
+
`);const t=new it("!xml");let r=t,u="",i="";const l=new to(this.options.processEntities);for(let p=0;p<n.length;p++)if(n[p]==="<")if(n[p+1]==="/"){const h=at(n,">",p,"Closing Tag is not closed.");let m=n.substring(p+2,h).trim();if(this.options.removeNSPrefix){const U=m.indexOf(":");U!==-1&&(m=m.substr(U+1))}this.options.transformTagName&&(m=this.options.transformTagName(m)),r&&(u=this.saveTextToParentTag(u,r,i));const B=i.substring(i.lastIndexOf(".")+1);if(m&&this.options.unpairedTags.indexOf(m)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${m}>`);let T=0;B&&this.options.unpairedTags.indexOf(B)!==-1?(T=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):T=i.lastIndexOf("."),i=i.substring(0,T),r=this.tagsNodeStack.pop(),u="",p=h}else if(n[p+1]==="?"){let h=wt(n,p,!1,"?>");if(!h)throw new Error("Pi Tag is not closed.");if(u=this.saveTextToParentTag(u,r,i),!(this.options.ignoreDeclaration&&h.tagName==="?xml"||this.options.ignorePiTags)){const m=new it(h.tagName);m.add(this.options.textNodeName,""),h.tagName!==h.tagExp&&h.attrExpPresent&&(m[":@"]=this.buildAttributesMap(h.tagExp,i,h.tagName)),this.addChild(r,m,i,p)}p=h.closeIndex+1}else if(n.substr(p+1,3)==="!--"){const h=at(n,"-->",p+4,"Comment is not closed.");if(this.options.commentPropName){const m=n.substring(p+4,h-2);u=this.saveTextToParentTag(u,r,i),r.add(this.options.commentPropName,[{[this.options.textNodeName]:m}])}p=h}else if(n.substr(p+1,2)==="!D"){const h=l.readDocType(n,p);this.docTypeEntities=h.entities,p=h.i}else if(n.substr(p+1,2)==="!["){const h=at(n,"]]>",p,"CDATA is not closed.")-2,m=n.substring(p+9,h);u=this.saveTextToParentTag(u,r,i);let B=this.parseTextData(m,r.tagname,i,!0,!1,!0,!0);B==null&&(B=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[{[this.options.textNodeName]:m}]):r.add(this.options.textNodeName,B),p=h+2}else{let h=wt(n,p,this.options.removeNSPrefix),m=h.tagName;const B=h.rawTagName;let T=h.tagExp,U=h.attrExpPresent,V=h.closeIndex;this.options.transformTagName&&(m=this.options.transformTagName(m)),r&&u&&r.tagname!=="!xml"&&(u=this.saveTextToParentTag(u,r,i,!1));const ae=r;ae&&this.options.unpairedTags.indexOf(ae.tagname)!==-1&&(r=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),m!==t.tagname&&(i+=i?"."+m:m);const le=p;if(this.isItStopNode(this.options.stopNodes,i,m)){let _="";if(T.length>0&&T.lastIndexOf("/")===T.length-1)m[m.length-1]==="/"?(m=m.substr(0,m.length-1),i=i.substr(0,i.length-1),T=m):T=T.substr(0,T.length-1),p=h.closeIndex;else if(this.options.unpairedTags.indexOf(m)!==-1)p=h.closeIndex;else{const ge=this.readStopNodeData(n,B,V+1);if(!ge)throw new Error(`Unexpected end of ${B}`);p=ge.i,_=ge.tagContent}const oe=new it(m);m!==T&&U&&(oe[":@"]=this.buildAttributesMap(T,i,m)),_&&(_=this.parseTextData(_,m,i,!0,U,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),oe.add(this.options.textNodeName,_),this.addChild(r,oe,i,le)}else{if(T.length>0&&T.lastIndexOf("/")===T.length-1){m[m.length-1]==="/"?(m=m.substr(0,m.length-1),i=i.substr(0,i.length-1),T=m):T=T.substr(0,T.length-1),this.options.transformTagName&&(m=this.options.transformTagName(m));const _=new it(m);m!==T&&U&&(_[":@"]=this.buildAttributesMap(T,i,m)),this.addChild(r,_,i,le),i=i.substr(0,i.lastIndexOf("."))}else{const _=new it(m);this.tagsNodeStack.push(r),m!==T&&U&&(_[":@"]=this.buildAttributesMap(T,i,m)),this.addChild(r,_,i,le),r=_}u="",p=V}}else u+=n[p];return t.child};function yo(n,t,r,u){this.options.captureMetaData||(u=void 0);const i=this.options.updateTag(t.tagname,r,t[":@"]);i===!1||(typeof i=="string"&&(t.tagname=i),n.addChild(t,u))}const Ao=function(n){if(this.options.processEntities){for(let t in this.docTypeEntities){const r=this.docTypeEntities[t];n=n.replace(r.regx,r.val)}for(let t in this.lastEntities){const r=this.lastEntities[t];n=n.replace(r.regex,r.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const r=this.htmlEntities[t];n=n.replace(r.regex,r.val)}n=n.replace(this.ampEntity.regex,this.ampEntity.val)}return n};function bo(n,t,r,u){return n&&(u===void 0&&(u=t.child.length===0),n=this.parseTextData(n,t.tagname,r,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,u),n!==void 0&&n!==""&&t.add(this.options.textNodeName,n),n=""),n}function xo(n,t,r){const u="*."+r;for(const i in n){const l=n[i];if(u===l||t===l)return!0}return!1}function No(n,t,r=">"){let u,i="";for(let l=t;l<n.length;l++){let p=n[l];if(u)p===u&&(u="");else if(p==='"'||p==="'")u=p;else if(p===r[0])if(r[1]){if(n[l+1]===r[1])return{data:i,index:l}}else return{data:i,index:l};else p===" "&&(p=" ");i+=p}}function at(n,t,r,u){const i=n.indexOf(t,r);if(i===-1)throw new Error(u);return i+t.length-1}function wt(n,t,r,u=">"){const i=No(n,t+1,u);if(!i)return;let l=i.data;const p=i.index,N=l.search(/\s/);let h=l,m=!0;N!==-1&&(h=l.substring(0,N),l=l.substring(N+1).trimStart());const B=h;if(r){const T=h.indexOf(":");T!==-1&&(h=h.substr(T+1),m=h!==i.data.substr(T+1))}return{tagName:h,tagExp:l,closeIndex:p,attrExpPresent:m,rawTagName:B}}function Do(n,t,r){const u=r;let i=1;for(;r<n.length;r++)if(n[r]==="<")if(n[r+1]==="/"){const l=at(n,">",r,`${t} is not closed`);if(n.substring(r+2,l).trim()===t&&(i--,i===0))return{tagContent:n.substring(u,r),i:l};r=l}else if(n[r+1]==="?")r=at(n,"?>",r+1,"StopNode is not closed.");else if(n.substr(r+1,3)==="!--")r=at(n,"-->",r+3,"StopNode is not closed.");else if(n.substr(r+1,2)==="![")r=at(n,"]]>",r,"StopNode is not closed.")-2;else{const l=wt(n,r,">");l&&((l&&l.tagName)===t&&l.tagExp[l.tagExp.length-1]!=="/"&&i++,r=l.closeIndex)}}function Tt(n,t,r){if(t&&typeof n=="string"){const u=n.trim();return u==="true"?!0:u==="false"?!1:so(n,r)}else return jn(n)?n:""}const _t=it.getMetaDataSymbol();function vo(n,t){return Zt(n,t)}function Zt(n,t,r){let u;const i={};for(let l=0;l<n.length;l++){const p=n[l],N=Co(p);let h="";if(r===void 0?h=N:h=r+"."+N,N===t.textNodeName)u===void 0?u=p[N]:u+=""+p[N];else{if(N===void 0)continue;if(p[N]){let m=Zt(p[N],t,h);const B=To(m,t);p[_t]!==void 0&&(m[_t]=p[_t]),p[":@"]?wo(m,p[":@"],h,t):Object.keys(m).length===1&&m[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?m=m[t.textNodeName]:Object.keys(m).length===0&&(t.alwaysCreateTextNode?m[t.textNodeName]="":m=""),i[N]!==void 0&&i.hasOwnProperty(N)?(Array.isArray(i[N])||(i[N]=[i[N]]),i[N].push(m)):t.isArray(N,h,B)?i[N]=[m]:i[N]=m}}}return typeof u=="string"?u.length>0&&(i[t.textNodeName]=u):u!==void 0&&(i[t.textNodeName]=u),i}function Co(n){const t=Object.keys(n);for(let r=0;r<t.length;r++){const u=t[r];if(u!==":@")return u}}function wo(n,t,r,u){if(t){const i=Object.keys(t),l=i.length;for(let p=0;p<l;p++){const N=i[p];u.isArray(N,r+"."+N,!0,!0)?n[N]=[t[N]]:n[N]=t[N]}}}function To(n,t){const{textNodeName:r}=t,u=Object.keys(n).length;return!!(u===0||u===1&&(n[r]||typeof n[r]=="boolean"||n[r]===0))}class _o{constructor(t){this.externalEntities={},this.options=eo(t)}parse(t,r){if(typeof t!="string"&&t.toString)t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(r){r===!0&&(r={});const l=Gt(t,r);if(l!==!0)throw Error(`${l.err.msg}:${l.err.line}:${l.err.col}`)}const u=new co(this.options);u.addExternalEntities(this.externalEntities);const i=u.parseXml(t);return this.options.preserveOrder||i===void 0?i:vo(i,this.options)}addEntity(t,r){if(r.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(r==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=r}static getMetaDataSymbol(){return it.getMetaDataSymbol()}}const Bo=`
|
|
17
|
+
`;function So(n,t){let r="";return t.format&&t.indentBy.length>0&&(r=Bo),Jt(n,t,"",r)}function Jt(n,t,r,u){let i="",l=!1;for(let p=0;p<n.length;p++){const N=n[p],h=Oo(N);if(h===void 0)continue;let m="";if(r.length===0?m=h:m=`${r}.${h}`,h===t.textNodeName){let ae=N[h];ko(m,t)||(ae=t.tagValueProcessor(h,ae),ae=tr(ae,t)),l&&(i+=u),i+=ae,l=!1;continue}else if(h===t.cdataPropName){l&&(i+=u),i+=`<![CDATA[${N[h][0][t.textNodeName]}]]>`,l=!1;continue}else if(h===t.commentPropName){i+=u+`<!--${N[h][0][t.textNodeName]}-->`,l=!0;continue}else if(h[0]==="?"){const ae=er(N[":@"],t),le=h==="?xml"?"":u;let _=N[h][0][t.textNodeName];_=_.length!==0?" "+_:"",i+=le+`<${h}${_}${ae}?>`,l=!0;continue}let B=u;B!==""&&(B+=t.indentBy);const T=er(N[":@"],t),U=u+`<${h}${T}`,V=Jt(N[h],t,m,B);t.unpairedTags.indexOf(h)!==-1?t.suppressUnpairedNode?i+=U+">":i+=U+"/>":(!V||V.length===0)&&t.suppressEmptyNode?i+=U+"/>":V&&V.endsWith(">")?i+=U+`>${V}${u}</${h}>`:(i+=U+">",V&&u!==""&&(V.includes("/>")||V.includes("</"))?i+=u+t.indentBy+V+u:i+=V,i+=`</${h}>`),l=!0}return i}function Oo(n){const t=Object.keys(n);for(let r=0;r<t.length;r++){const u=t[r];if(n.hasOwnProperty(u)&&u!==":@")return u}}function er(n,t){let r="";if(n&&!t.ignoreAttributes)for(let u in n){if(!n.hasOwnProperty(u))continue;let i=t.attributeValueProcessor(u,n[u]);i=tr(i,t),i===!0&&t.suppressBooleanAttributes?r+=` ${u.substr(t.attributeNamePrefix.length)}`:r+=` ${u.substr(t.attributeNamePrefix.length)}="${i}"`}return r}function ko(n,t){n=n.substr(0,n.length-t.textNodeName.length-1);let r=n.substr(n.lastIndexOf(".")+1);for(let u in t.stopNodes)if(t.stopNodes[u]===n||t.stopNodes[u]==="*."+r)return!0;return!1}function tr(n,t){if(n&&n.length>0&&t.processEntities)for(let r=0;r<t.entities.length;r++){const u=t.entities[r];n=n.replace(u.regex,u.val)}return n}const Ro={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(n,t){return t},attributeValueProcessor:function(n,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function tt(n){this.options=Object.assign({},Ro,n),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Qt(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Po),this.processTextOrObjNode=Fo,this.options.format?(this.indentate=Io,this.tagEndChar=`>
|
|
13
18
|
`,this.newLine=`
|
|
14
|
-
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}
|
|
15
|
-
`+
|
|
16
|
-
`:"";let d="";for(const i of n){if(i["?xml"]){const B=i[":@"]||{},M=Object.entries(B).map(([X,j])=>`${X.startsWith("@_")?X.substring(2):X}="${j}"`).join(" ");d+=`<?xml ${M}?>${a}`;continue}if(i["#comment"]){const B=i["#comment"];if(Array.isArray(B)&&B.length>0){const M=B[0]["#text"]||B[0];d+=`${l}<!--${M}-->${a}`}continue}const c=Object.keys(i).find(B=>!B.startsWith(":")&&!B.startsWith("#")&&!B.startsWith("__"));if(!c)continue;const g=i[c],p=i[":@"]||{},w=Object.entries(p).map(([B,M])=>`${B.startsWith("@_")?B.substring(2):B}="${M}"`).join(" "),k=w?" "+w:"";if(!Array.isArray(g)||g.length===0){d+=`${l}<${c}${k}/>${a}`;continue}const S=g.length===1&&g[0]["#text"]!==void 0;if(g.some(B=>B.__cdata)){const B=g.find(M=>M.__cdata);if(B){const M=B.__cdata[0]["#text"]||"";d+=`${l}<${c}${k}><![CDATA[${M}]]></${c}>${a}`}}else if(S){const B=g[0]["#text"];d+=`${l}<${c}${k}>${B}</${c}>${a}`}else d+=`${l}<${c}${k}>${a}`,d+=ie(g,{indent:t,level:s+1,format:o}),d+=`${l}</${c}>${a}`}return d},wr={key:0,class:"xml-format__toolbar"},Ar={class:"xml-format__actions"},Cr=["disabled"],Br=["disabled"],Tr=["disabled"],vr=["disabled"],Or=["disabled"],Sr={class:"xml-format__info"},$r={key:0,class:"xml-format__status xml-format__status--success"},Pr={key:1,class:"xml-format__status xml-format__status--error"},Vr={class:"xml-format__content"},Ir={key:0,class:"xml-format__error"},Rr={key:1,class:"xml-format__viewer"},Lr=Ee(r.defineComponent({__name:"index",props:{modelValue:{default:""},readonly:{type:Boolean,default:!1},maxDepth:{default:10},showToolbar:{type:Boolean,default:!0},theme:{default:"github-light"},showComments:{type:Boolean,default:!0},showCdata:{type:Boolean,default:!0},preserveWhitespace:{type:Boolean,default:!1}},emits:["update:modelValue","copy-success","copy-error","expand-all","collapse-all","compress","format"],setup(n,{expose:e,emit:t}){r.useCssVars(N=>({dafdfa5a:c.value.colors.border,"54718f56":c.value.colors.background,"5e7c5194":c.value.colors.text,"5e337cb4":c.value.colors.surfaceBackground,"9f56e136":c.value.colors.buttonBorder,e203a832:c.value.colors.buttonBackground,"3a8ddaa6":c.value.colors.buttonText,"0e7f0595":c.value.colors.buttonBackgroundHover,"437859e9":c.value.colors.buttonPrimary,cec96e5a:c.value.colors.buttonPrimaryHover,"4a52863c":c.value.colors.success,"6331c6ec":c.value.colors.successBackground,70405281:c.value.colors.error,dfabd2e2:c.value.colors.errorBackground}));const s=n,o=t,l=r.ref(null),a=r.ref(""),d=r.ref(new Set),i=r.computed(()=>a.value===""),c=r.computed(()=>xn(s.theme)),g=r.computed(()=>!l.value||!Array.isArray(l.value)?[]:l.value.map((N,v)=>({node:N,originalIndex:v})).filter(N=>!N.node["?xml"])),p=r.computed(()=>{if(!l.value||!Array.isArray(l.value))return null;const N=l.value.find(C=>C["?xml"]);if(!N||!N[":@"])return null;const v=N[":@"],R=[];return v["@_version"]&&R.push(`version="${v["@_version"]}"`),v["@_encoding"]&&R.push(`encoding="${v["@_encoding"]}"`),v["@_standalone"]&&R.push(`standalone="${v["@_standalone"]}"`),R.length>0?`<?xml ${R.join(" ")}?>`:null}),w=r.computed(()=>g.value),k=N=>{if(!N||!N.trim()){a.value="",l.value=null;return}try{const v=xr(N);if(!v.valid){a.value=v.error||"Invalid XML",l.value=null;return}l.value=He(N),a.value="",r.nextTick(()=>{$()})}catch(v){a.value=v instanceof Error?v.message:"Unknown parse error",l.value=null}},S=N=>{d.value.has(N)?d.value.delete(N):d.value.add(N)},$=()=>{const N=new Set,v=(R,C="")=>{Array.isArray(R)&&R.forEach((O,U)=>{const V=Object.keys(O).find(m=>!m.startsWith(":")&&!m.startsWith("#"));if(!V)return;const y=C?`${C}.${V}[${U}]`:`${V}[${U}]`;N.add(y);const u=O[V];Array.isArray(u)&&v(u,y+"."+V)})};g.value.forEach(({node:R,originalIndex:C})=>{const O=Object.keys(R).find(U=>!U.startsWith(":")&&!U.startsWith("#"));if(O){const U=`${O}[${C}]`;N.add(U);const V=R[O];Array.isArray(V)&&v(V,U+"."+O)}}),d.value=N,o("expand-all")},B=()=>{d.value.clear(),o("collapse-all")},M=async()=>{if(!(!i.value||!l.value))try{const N=Array.isArray(l.value)?ie(l.value,{indent:" "}):Te(l.value,{format:!0,indentBy:" "});await navigator.clipboard.writeText(N),o("copy-success",N)}catch(N){const v=N instanceof Error?N:new Error("Copy failed");o("copy-error",v),console.error("Failed to copy XML:",N)}},X=()=>{if(!(!i.value||!l.value))try{const N=kr(l.value);o("update:modelValue",N),o("compress",N)}catch(N){console.error("Failed to compress XML:",N)}},j=()=>{if(i.value)try{const N=Nr(s.modelValue,{format:!0,indentBy:" "});o("update:modelValue",N),o("format",N)}catch(N){console.error("Failed to format XML:",N)}},q=async N=>{try{const v=typeof N=="string"?N:JSON.stringify(N,null,2);await navigator.clipboard.writeText(v),o("copy-success",v)}catch(v){const R=v instanceof Error?v:new Error("Copy failed");o("copy-error",R),console.error("Failed to copy value:",v)}},re=(N,v,R)=>{if(!(!l.value||!Array.isArray(l.value)))try{const C=N.split(/\./).filter(Boolean);let O=l.value;for(let V=0;V<C.length;V++){const y=C[V],u=y.match(/^(.+?)\[(\d+)\]$/);if(u){const m=u[1],E=parseInt(u[2]);if(V===C.length-1){if(Array.isArray(O)&&O[E]){const _=O[E];if(_[v]){const x=_[v];delete _[v],_[R]=x}}}else Array.isArray(O)&&O[E]&&(O=O[E])}else O[y]&&(O=O[y])}const U=ie(l.value,{indent:" "});o("update:modelValue",U)}catch(C){console.error("Failed to update tag name:",C)}},J=(N,v,R)=>{if(!(!l.value||!Array.isArray(l.value)))try{const C=N.split(/\./).filter(Boolean);let O=l.value;for(let V=0;V<C.length;V++){const y=C[V],u=y.match(/^(.+?)\[(\d+)\]$/);if(u){const m=u[1],E=parseInt(u[2]);if(V===C.length-1){if(Array.isArray(O)&&O[E]){const x=O[E][":@"];if(x&&x[`@_${v}`]!==void 0){const b=x[`@_${v}`];delete x[`@_${v}`],x[`@_${R}`]=b}}}else Array.isArray(O)&&O[E]&&(O=O[E])}else O[y]&&(O=O[y])}const U=ie(l.value,{indent:" "});o("update:modelValue",U)}catch(C){console.error("Failed to update attribute name:",C)}},D=(N,v,R)=>{if(!(!l.value||!Array.isArray(l.value)))try{const C=N.split(/\./).filter(Boolean);let O=l.value;for(let V=0;V<C.length;V++){const y=C[V],u=y.match(/^(.+?)\[(\d+)\]$/);if(u){const m=u[1],E=parseInt(u[2]);if(V===C.length-1){if(Array.isArray(O)&&O[E]){const x=O[E][":@"];x&&x[`@_${v}`]!==void 0&&(x[`@_${v}`]=R)}}else Array.isArray(O)&&O[E]&&(O=O[E])}else O[y]&&(O=O[y])}const U=ie(l.value,{indent:" "});o("update:modelValue",U)}catch(C){console.error("Failed to update attribute value:",C)}},ne=(N,v)=>{if(!(!l.value||!Array.isArray(l.value)))try{const R=N.split(/\./).filter(Boolean);let C=l.value,O="";for(let V=0;V<R.length;V++){const y=R[V],u=y.match(/^(.+?)\[(\d+)\]$/);if(u){const m=u[1],E=parseInt(u[2]);if(V===R.length-1){if(Array.isArray(C)&&C[E]){const _=C[E];if(O=Object.keys(_).find(x=>!x.startsWith(":")&&!x.startsWith("#"))||"",O&&Array.isArray(_[O])){const x=_[O],b=x.findIndex(T=>T["#text"]!==void 0);b!==-1?x[b]["#text"]=v:x.push({"#text":v})}}}else Array.isArray(C)&&C[E]&&(C=C[E])}else C[y]&&(C=C[y])}const U=ie(l.value,{indent:" "});o("update:modelValue",U)}catch(R){console.error("Failed to update text content:",R)}},oe=(N,v)=>{if(!(!l.value||!Array.isArray(l.value)))try{const R=N.split(/\./).filter(Boolean);let C=l.value;for(let U=0;U<R.length;U++){const V=R[U],y=V.match(/^(.+?)\[(\d+)\]$/);if(y){const u=y[1],m=parseInt(y[2]);if(U===R.length-1){if(Array.isArray(C)&&C[m]){const E=C[m],_=Object.keys(E).find(x=>!x.startsWith(":")&&!x.startsWith("#"));if(_&&Array.isArray(E[_])){const x=E[_],b=x.findIndex(T=>T.__cdata!==void 0);if(b!==-1){const T=x[b];Array.isArray(T.__cdata)&&T.__cdata[0]&&(T.__cdata[0]["#text"]=v)}else x.push({__cdata:[{"#text":v}]})}}}else Array.isArray(C)&&C[m]&&(C=C[m])}else C[V]&&(C=C[V])}const O=ie(l.value,{indent:" "});o("update:modelValue",O)}catch(R){console.error("Failed to update CDATA content:",R)}};return r.watch(()=>s.modelValue,N=>{k(N)},{immediate:!0}),e({copyXml:M,compressSource:X,formatSource:j,expandAll:$,collapseAll:B,toggleExpand:S,isValidXml:()=>i.value,getParsedXml:()=>l.value,getExpandedNodes:()=>d.value,getParseError:()=>a.value,parseXmlString:N=>k(N),copyValue:N=>q(N)}),(N,v)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["xml-format",`xml-format--${c.value.name}`])},[N.showToolbar?(r.openBlock(),r.createElementBlock("div",wr,[r.createElementVNode("div",Ar,[r.createElementVNode("button",{class:"xml-format__btn xml-format__btn--primary",onClick:M,disabled:!i.value,title:"Copy XML"}," 📋 Copy ",8,Cr),r.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:$,disabled:!i.value,title:"Expand All"}," ⬇️ Expand All ",8,Br),r.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:B,disabled:!i.value,title:"Collapse All"}," ➡️ Collapse All ",8,Tr),r.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:X,disabled:!i.value,title:"Compress XML"}," 📦 Compress ",8,vr),r.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:j,disabled:!i.value,title:"Format XML"}," ✨ Format ",8,Or)]),r.createElementVNode("div",Sr,[i.value?(r.openBlock(),r.createElementBlock("span",$r," ✅ Valid XML ")):(r.openBlock(),r.createElementBlock("span",Pr," ❌ Invalid XML "))])])):r.createCommentVNode("",!0),r.createElementVNode("div",Vr,[i.value?(r.openBlock(),r.createElementBlock("div",Rr,[p.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"xml-declaration",style:r.normalizeStyle({color:c.value.colors.xmlDeclaration})},r.toDisplayString(p.value),5)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,(R,C)=>(r.openBlock(),r.createBlock(_n,{key:C,node:R.node,index:R.originalIndex,level:0,expanded:d.value,theme:c.value,onToggleExpand:S,onCopy:q,"onUpdate:tagName":re,"onUpdate:attributeName":J,"onUpdate:attributeValue":D,"onUpdate:textContent":ne,"onUpdate:cdataContent":oe},null,8,["node","index","expanded","theme"]))),128))])):(r.openBlock(),r.createElementBlock("div",Ir,[v[0]||(v[0]=r.createElementVNode("h4",null,"XML Parse Error:",-1)),r.createElementVNode("pre",null,r.toDisplayString(a.value),1)]))])],2))}}),[["__scopeId","data-v-078198c5"]]),Mr=[Se],jr={install:n=>{Mr.forEach(e=>{const t=e.name||e.__name||"UnknownComponent";n.component(t,e)})}};le.JsonFormat=Se,le.XmlFormat=Lr,le.default=jr,Object.defineProperties(le,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
19
|
+
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}tt.prototype.build=function(n){return this.options.preserveOrder?So(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0,[]).val)},tt.prototype.j2x=function(n,t,r){let u="",i="";const l=r.join(".");for(let p in n)if(Object.prototype.hasOwnProperty.call(n,p))if(typeof n[p]>"u")this.isAttribute(p)&&(i+="");else if(n[p]===null)this.isAttribute(p)||p===this.options.cdataPropName?i+="":p[0]==="?"?i+=this.indentate(t)+"<"+p+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+p+"/"+this.tagEndChar;else if(n[p]instanceof Date)i+=this.buildTextValNode(n[p],p,"",t);else if(typeof n[p]!="object"){const N=this.isAttribute(p);if(N&&!this.ignoreAttributesFn(N,l))u+=this.buildAttrPairStr(N,""+n[p]);else if(!N)if(p===this.options.textNodeName){let h=this.options.tagValueProcessor(p,""+n[p]);i+=this.replaceEntitiesValue(h)}else i+=this.buildTextValNode(n[p],p,"",t)}else if(Array.isArray(n[p])){const N=n[p].length;let h="",m="";for(let B=0;B<N;B++){const T=n[p][B];if(!(typeof T>"u"))if(T===null)p[0]==="?"?i+=this.indentate(t)+"<"+p+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+p+"/"+this.tagEndChar;else if(typeof T=="object")if(this.options.oneListGroup){const U=this.j2x(T,t+1,r.concat(p));h+=U.val,this.options.attributesGroupName&&T.hasOwnProperty(this.options.attributesGroupName)&&(m+=U.attrStr)}else h+=this.processTextOrObjNode(T,p,t,r);else if(this.options.oneListGroup){let U=this.options.tagValueProcessor(p,T);U=this.replaceEntitiesValue(U),h+=U}else h+=this.buildTextValNode(T,p,"",t)}this.options.oneListGroup&&(h=this.buildObjectNode(h,p,m,t)),i+=h}else if(this.options.attributesGroupName&&p===this.options.attributesGroupName){const N=Object.keys(n[p]),h=N.length;for(let m=0;m<h;m++)u+=this.buildAttrPairStr(N[m],""+n[p][N[m]])}else i+=this.processTextOrObjNode(n[p],p,t,r);return{attrStr:u,val:i}},tt.prototype.buildAttrPairStr=function(n,t){return t=this.options.attributeValueProcessor(n,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&t==="true"?" "+n:" "+n+'="'+t+'"'};function Fo(n,t,r,u){const i=this.j2x(n,r+1,u.concat(t));return n[this.options.textNodeName]!==void 0&&Object.keys(n).length===1?this.buildTextValNode(n[this.options.textNodeName],t,i.attrStr,r):this.buildObjectNode(i.val,t,i.attrStr,r)}tt.prototype.buildObjectNode=function(n,t,r,u){if(n==="")return t[0]==="?"?this.indentate(u)+"<"+t+r+"?"+this.tagEndChar:this.indentate(u)+"<"+t+r+this.closeTag(t)+this.tagEndChar;{let i="</"+t+this.tagEndChar,l="";return t[0]==="?"&&(l="?",i=""),(r||r==="")&&n.indexOf("<")===-1?this.indentate(u)+"<"+t+r+l+">"+n+i:this.options.commentPropName!==!1&&t===this.options.commentPropName&&l.length===0?this.indentate(u)+`<!--${n}-->`+this.newLine:this.indentate(u)+"<"+t+r+l+this.tagEndChar+n+this.indentate(u)+i}},tt.prototype.closeTag=function(n){let t="";return this.options.unpairedTags.indexOf(n)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`></${n}`,t},tt.prototype.buildTextValNode=function(n,t,r,u){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(u)+`<![CDATA[${n}]]>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(u)+`<!--${n}-->`+this.newLine;if(t[0]==="?")return this.indentate(u)+"<"+t+r+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(t,n);return i=this.replaceEntitiesValue(i),i===""?this.indentate(u)+"<"+t+r+this.closeTag(t)+this.tagEndChar:this.indentate(u)+"<"+t+r+">"+i+"</"+t+this.tagEndChar}},tt.prototype.replaceEntitiesValue=function(n){if(n&&n.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const r=this.options.entities[t];n=n.replace(r.regex,r.val)}return n};function Io(n){return this.options.indentBy.repeat(n)}function Po(n){return n.startsWith(this.options.attributeNamePrefix)&&n!==this.options.textNodeName?n.substr(this.attrPrefixLen):!1}const Lo={validate:Gt},Vo={ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:"#text",ignoreDeclaration:!1,commentPropName:"#comment",cdataPropName:"__cdata",preserveOrder:!0,parseAttributeValue:!1,trimValues:!0,parseTagValue:!1,processEntities:!0,htmlEntities:!1,ignoreNameSpace:!1,allowBooleanAttributes:!0,unpairedTags:[],stopNodes:[],alwaysCreateTextNode:!1},Mo={ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:"#text",format:!0,indentBy:" ",suppressEmptyNode:!1,suppressBooleanAttributes:!1,suppressUnpairedNode:!1},Uo=n=>{try{const t=Lo.validate(n,{allowBooleanAttributes:!0});return t===!0?{valid:!0}:{valid:!1,error:`Line ${t.err.line}: ${t.err.msg}`}}catch(t){return{valid:!1,error:t instanceof Error?t.message:"Unknown validation error"}}},Bt=(n,t)=>{try{return new _o({...Vo,...t}).parse(n)}catch(r){throw new Error(`XML 解析失败: ${r instanceof Error?r.message:"Unknown error"}`)}},St=(n,t)=>{try{let u=new tt({...Mo,format:t?.format??!0,indentBy:t?.indentBy??" "}).build(n);return t?.showDeclaration!==!1&&!u.startsWith("<?xml")&&(u=`<?xml version="1.0" encoding="UTF-8"?>
|
|
20
|
+
`+u),u}catch(r){throw new Error(`XML 构建失败: ${r instanceof Error?r.message:"Unknown error"}`)}},qo=n=>Array.isArray(n)?Ze(n,{format:!1}):St(n,{format:!1,showDeclaration:!1}),$o=(n,t)=>{const r=Bt(n);return Array.isArray(r)?Ze(r,{indent:t?.indentBy}):St(r,t)},Ze=(n,t={})=>{const r=t.indent!==void 0?t.indent:" ",u=t.level||0,i=t.format!==!1,l=i?r.repeat(u):"",p=i?`
|
|
21
|
+
`:"";let N="";for(const h of n){if(h["?xml"]){const _=h[":@"]||{},oe=Object.entries(_).map(([ge,re])=>`${ge.startsWith("@_")?ge.substring(2):ge}="${re}"`).join(" ");N+=`<?xml ${oe}?>${p}`;continue}if(h["#comment"]){const _=h["#comment"];if(Array.isArray(_)&&_.length>0){const oe=_[0]["#text"]||_[0];N+=`${l}<!--${oe}-->${p}`}continue}const m=Object.keys(h).find(_=>!_.startsWith(":")&&!_.startsWith("#")&&!_.startsWith("__"));if(!m)continue;const B=h[m],T=h[":@"]||{},U=Object.entries(T).map(([_,oe])=>`${_.startsWith("@_")?_.substring(2):_}="${oe}"`).join(" "),V=U?" "+U:"";if(!Array.isArray(B)||B.length===0){N+=`${l}<${m}${V}/>${p}`;continue}const ae=B.length===1&&B[0]["#text"]!==void 0;if(B.some(_=>_.__cdata)){const _=B.find(oe=>oe.__cdata);if(_){const oe=_.__cdata[0]["#text"]||"";N+=`${l}<${m}${V}><![CDATA[${oe}]]></${m}>${p}`}}else if(ae){const _=B[0]["#text"];N+=`${l}<${m}${V}>${_}</${m}>${p}`}else N+=`${l}<${m}${V}>${p}`,N+=Ze(B,{indent:r,level:u+1,format:i}),N+=`${l}</${m}>${p}`}return N},jo={key:0,class:"xml-format__toolbar"},Xo={class:"xml-format__actions"},Ho=["disabled"],Go=["disabled"],Ko=["disabled"],zo=["disabled"],Yo=["disabled"],Wo={class:"xml-format__info"},Qo={key:0,class:"xml-format__status xml-format__status--success"},Zo={key:1,class:"xml-format__status xml-format__status--error"},Jo={class:"xml-format__content"},es={key:0,class:"xml-format__error"},ts={key:1,class:"xml-format__error"},rs={key:2,class:"xml-format__viewer"},ns=Et(s.defineComponent({__name:"index",props:{modelValue:{default:""},readonly:{type:Boolean,default:!1},maxDepth:{default:10},showToolbar:{type:Boolean,default:!0},theme:{default:"github-light"},showComments:{type:Boolean,default:!0},showCdata:{type:Boolean,default:!0},preserveWhitespace:{type:Boolean,default:!1}},emits:["update:modelValue","copy-success","copy-error","expand-all","collapse-all","compress","format"],setup(n,{expose:t,emit:r}){s.useCssVars(F=>({"0fcb236c":V.value.colors.border,"696d646e":V.value.colors.background,"04d7c46d":V.value.colors.text,"5c81327b":V.value.colors.surfaceBackground,"19bfcd84":V.value.colors.buttonBorder,"0acf2140":V.value.colors.buttonBackground,"6397f282":V.value.colors.buttonText,"1fde7fdc":V.value.colors.buttonBackgroundHover,"5a1e0b30":V.value.colors.buttonPrimary,"64044bec":V.value.colors.buttonPrimaryHover,"764c78c3":V.value.colors.success,"66965b5e":V.value.colors.successBackground,d5598a70:V.value.colors.error,d7aedbd4:V.value.colors.errorBackground}));const u=n,i=r,l=s.ref(null),p=s.ref(""),N=s.ref(new Set),h=s.ref(null),m=s.ref(""),B=s.ref(""),T=s.computed(()=>p.value===""),U=s.computed(()=>m.value?null:h.value!==null?h.value:l.value),V=s.computed(()=>Mn(u.theme)),ae=s.computed(()=>{const F=U.value;return!F||!Array.isArray(F)?[]:F.map((x,S)=>({node:x,originalIndex:S})).filter(x=>!x.node["?xml"])}),le=s.computed(()=>{const F=U.value;if(!F||!Array.isArray(F))return null;const x=F.find(j=>j["?xml"]);if(!x||!x[":@"])return null;const S=x[":@"],R=[];return S["@_version"]&&R.push(`version="${S["@_version"]}"`),S["@_encoding"]&&R.push(`encoding="${S["@_encoding"]}"`),S["@_standalone"]&&R.push(`standalone="${S["@_standalone"]}"`),R.length>0?`<?xml ${R.join(" ")}?>`:null}),_=s.computed(()=>ae.value),oe=F=>{if(!F||!F.trim()){p.value="",l.value=null,B.value="",h.value=null,m.value="";return}try{const x=Uo(F);if(!x.valid){p.value=x.error||"Invalid XML",l.value=null,B.value="";return}B.value=F,l.value=Bt(F),p.value="",h.value=null,m.value="",s.nextTick(()=>{re()})}catch(x){p.value=x instanceof Error?x.message:"Unknown parse error",l.value=null,B.value="",h.value=null,m.value=""}},ge=F=>{N.value.has(F)?N.value.delete(F):N.value.add(F)},re=()=>{const F=new Set,x=(S,R="")=>{Array.isArray(S)&&S.forEach((j,M)=>{const J=Object.keys(j).find(P=>!P.startsWith(":")&&!P.startsWith("#"));if(!J)return;const D=R?`${R}.${J}[${M}]`:`${J}[${M}]`;F.add(D);const w=j[J];Array.isArray(w)&&x(w,D+"."+J)})};ae.value.forEach(({node:S,originalIndex:R})=>{const j=Object.keys(S).find(M=>!M.startsWith(":")&&!M.startsWith("#"));if(j){const M=`${j}[${R}]`;F.add(M);const J=S[j];Array.isArray(J)&&x(J,M+"."+j)}}),N.value=F,i("expand-all")},De=()=>{N.value.clear(),i("collapse-all")},Ae=async()=>{if(!(!T.value||!l.value))try{const F=Array.isArray(l.value)?Ze(l.value,{indent:" "}):St(l.value,{format:!0,indentBy:" "});await navigator.clipboard.writeText(F),i("copy-success",F)}catch(F){const x=F instanceof Error?F:new Error("Copy failed");i("copy-error",x),console.error("Failed to copy XML:",F)}},H=()=>{if(!(!T.value||!l.value))try{const F=qo(l.value);i("update:modelValue",F),i("compress",F)}catch(F){console.error("Failed to compress XML:",F)}},A=()=>{if(T.value)try{const F=$o(u.modelValue,{format:!0,indentBy:" "});i("update:modelValue",F),i("format",F)}catch(F){console.error("Failed to format XML:",F)}},de=F=>{if(!F||!F.expression.trim()){k();return}if(!l.value||!B.value){m.value="No valid XML data to filter";return}try{const S=new $t.DOMParser().parseFromString(B.value,"text/xml"),R=en.select(F.expression,S);if(!R||Array.isArray(R)&&R.length===0){h.value=[],m.value="";return}const j=new $t.XMLSerializer;let M="";Array.isArray(R)?(M=`<result>
|
|
22
|
+
`,R.forEach(J=>{J.nodeType===1?M+=" "+j.serializeToString(J)+`
|
|
23
|
+
`:J.nodeType===2?M+=` <attribute name="${J.name}" value="${J.value}"/>
|
|
24
|
+
`:J.nodeType===3&&(M+=` <text>${J.nodeValue}</text>
|
|
25
|
+
`)}),M+="</result>"):M=j.serializeToString(R),h.value=Bt(M),m.value="",s.nextTick(()=>{re()})}catch(x){m.value=x instanceof Error?x.message:"Filter execution error",h.value=null}},k=()=>{h.value=null,m.value="",s.nextTick(()=>{re()})},I=async F=>{try{const x=typeof F=="string"?F:JSON.stringify(F,null,2);await navigator.clipboard.writeText(x),i("copy-success",x)}catch(x){const S=x instanceof Error?x:new Error("Copy failed");i("copy-error",S),console.error("Failed to copy value:",x)}},ee=(F,x,S)=>{if(!(!l.value||!Array.isArray(l.value)))try{const R=F.split(/\./).filter(Boolean);let j=l.value;for(let J=0;J<R.length;J++){const D=R[J],w=D.match(/^(.+?)\[(\d+)\]$/);if(w){const P=w[1],L=parseInt(w[2]);if(J===R.length-1){if(Array.isArray(j)&&j[L]){const W=j[L];if(W[x]){const C=W[x];delete W[x],W[S]=C}}}else Array.isArray(j)&&j[L]&&(j=j[L])}else j[D]&&(j=j[D])}const M=Ze(l.value,{indent:" "});i("update:modelValue",M)}catch(R){console.error("Failed to update tag name:",R)}},K=(F,x,S)=>{if(!(!l.value||!Array.isArray(l.value)))try{const R=F.split(/\./).filter(Boolean);let j=l.value;for(let J=0;J<R.length;J++){const D=R[J],w=D.match(/^(.+?)\[(\d+)\]$/);if(w){const P=w[1],L=parseInt(w[2]);if(J===R.length-1){if(Array.isArray(j)&&j[L]){const C=j[L][":@"];if(C&&C[`@_${x}`]!==void 0){const ne=C[`@_${x}`];delete C[`@_${x}`],C[`@_${S}`]=ne}}}else Array.isArray(j)&&j[L]&&(j=j[L])}else j[D]&&(j=j[D])}const M=Ze(l.value,{indent:" "});i("update:modelValue",M)}catch(R){console.error("Failed to update attribute name:",R)}},q=(F,x,S)=>{if(!(!l.value||!Array.isArray(l.value)))try{const R=F.split(/\./).filter(Boolean);let j=l.value;for(let J=0;J<R.length;J++){const D=R[J],w=D.match(/^(.+?)\[(\d+)\]$/);if(w){const P=w[1],L=parseInt(w[2]);if(J===R.length-1){if(Array.isArray(j)&&j[L]){const C=j[L][":@"];C&&C[`@_${x}`]!==void 0&&(C[`@_${x}`]=S)}}else Array.isArray(j)&&j[L]&&(j=j[L])}else j[D]&&(j=j[D])}const M=Ze(l.value,{indent:" "});i("update:modelValue",M)}catch(R){console.error("Failed to update attribute value:",R)}},pe=(F,x)=>{if(!(!l.value||!Array.isArray(l.value)))try{const S=F.split(/\./).filter(Boolean);let R=l.value,j="";for(let J=0;J<S.length;J++){const D=S[J],w=D.match(/^(.+?)\[(\d+)\]$/);if(w){const P=w[1],L=parseInt(w[2]);if(J===S.length-1){if(Array.isArray(R)&&R[L]){const W=R[L];if(j=Object.keys(W).find(C=>!C.startsWith(":")&&!C.startsWith("#"))||"",j&&Array.isArray(W[j])){const C=W[j],ne=C.findIndex(Ee=>Ee["#text"]!==void 0);ne!==-1?C[ne]["#text"]=x:C.push({"#text":x})}}}else Array.isArray(R)&&R[L]&&(R=R[L])}else R[D]&&(R=R[D])}const M=Ze(l.value,{indent:" "});i("update:modelValue",M)}catch(S){console.error("Failed to update text content:",S)}},he=(F,x)=>{if(!(!l.value||!Array.isArray(l.value)))try{const S=F.split(/\./).filter(Boolean);let R=l.value;for(let M=0;M<S.length;M++){const J=S[M],D=J.match(/^(.+?)\[(\d+)\]$/);if(D){const w=D[1],P=parseInt(D[2]);if(M===S.length-1){if(Array.isArray(R)&&R[P]){const L=R[P],W=Object.keys(L).find(C=>!C.startsWith(":")&&!C.startsWith("#"));if(W&&Array.isArray(L[W])){const C=L[W],ne=C.findIndex(Ee=>Ee.__cdata!==void 0);if(ne!==-1){const Ee=C[ne];Array.isArray(Ee.__cdata)&&Ee.__cdata[0]&&(Ee.__cdata[0]["#text"]=x)}else C.push({__cdata:[{"#text":x}]})}}}else Array.isArray(R)&&R[P]&&(R=R[P])}else R[J]&&(R=R[J])}const j=Ze(l.value,{indent:" "});i("update:modelValue",j)}catch(S){console.error("Failed to update CDATA content:",S)}};return s.watch(()=>u.modelValue,F=>{oe(F)},{immediate:!0}),t({copyXml:Ae,compressSource:H,formatSource:A,expandAll:re,collapseAll:De,toggleExpand:ge,filter:de,clearFilter:k,isValidXml:()=>T.value,getParsedXml:()=>l.value,getFilteredXml:()=>h.value,getExpandedNodes:()=>N.value,getParseError:()=>p.value,getFilterError:()=>m.value,parseXmlString:F=>oe(F),copyValue:F=>I(F)}),(F,x)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["xml-format",`xml-format--${V.value.name}`])},[F.showToolbar?(s.openBlock(),s.createElementBlock("div",jo,[s.createElementVNode("div",Xo,[s.createElementVNode("button",{class:"xml-format__btn xml-format__btn--primary",onClick:Ae,disabled:!T.value,title:"Copy XML"}," 📋 Copy ",8,Ho),s.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:re,disabled:!T.value,title:"Expand All"}," ⬇️ Expand All ",8,Go),s.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:De,disabled:!T.value,title:"Collapse All"}," ➡️ Collapse All ",8,Ko),s.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:H,disabled:!T.value,title:"Compress XML"}," 📦 Compress ",8,zo),s.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:A,disabled:!T.value,title:"Format XML"}," ✨ Format ",8,Yo)]),s.createElementVNode("div",Wo,[T.value?(s.openBlock(),s.createElementBlock("span",Qo," ✅ Valid XML ")):(s.openBlock(),s.createElementBlock("span",Zo," ❌ Invalid XML "))])])):s.createCommentVNode("",!0),s.createElementVNode("div",Jo,[T.value?m.value?(s.openBlock(),s.createElementBlock("div",ts,[x[1]||(x[1]=s.createElementVNode("h4",null,"Filter Error:",-1)),s.createElementVNode("pre",null,s.toDisplayString(m.value),1)])):(s.openBlock(),s.createElementBlock("div",rs,[le.value?(s.openBlock(),s.createElementBlock("div",{key:0,class:"xml-declaration",style:s.normalizeStyle({color:V.value.colors.xmlDeclaration})},s.toDisplayString(le.value),5)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(_.value,(S,R)=>(s.openBlock(),s.createBlock(Vn,{key:R,node:S.node,index:S.originalIndex,level:0,expanded:N.value,theme:V.value,onToggleExpand:ge,onCopy:I,"onUpdate:tagName":ee,"onUpdate:attributeName":K,"onUpdate:attributeValue":q,"onUpdate:textContent":pe,"onUpdate:cdataContent":he},null,8,["node","index","expanded","theme"]))),128))])):(s.openBlock(),s.createElementBlock("div",es,[x[0]||(x[0]=s.createElementVNode("h4",null,"XML Parse Error:",-1)),s.createElementVNode("pre",null,s.toDisplayString(p.value),1)]))])],2))}}),[["__scopeId","data-v-b32c0437"]]),os=[Rt],ss={install:n=>{os.forEach(t=>{const r=t.name||t.__name||"UnknownComponent";n.component(r,t)})}};Ye.JsonFormat=Rt,Ye.XmlFormat=ns,Ye.default=ss,Object.defineProperties(Ye,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|