nv-basic-bw 1.0.14 → 1.0.16

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.
@@ -1,8 +1,8 @@
1
- var nvbasicbw=(()=>{var o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var k=o((Uf,sr)=>{var Zl=Symbol("empty"),Fe=Symbol("unknown"),Xs=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null,zs=/^[\-\+]?[0-9]+$/,Us=/^\+?[0-9]+$/,ec=/^[\-\+]?0[bB][0-1]+$/,tc=/^[\-\+]?0[oO][0-7]+$/,Js=/^[\-\+]?0[xX][0-9a-fA-F]+$/,sc=e=>zs.test(e)||Js.test(e),Ws={"0b":2,"0o":8,"0x":16,2:"0b",8:"0o",16:"0x"},rc=/^[\-\+]?[0-9]+n$/,nc=/^[\-\+]?0[bB][0-1]+n$/,ic=/^[\-\+]?0[oO][0-7]+n$/,lc=/^[\-\+]?0[xX][0-9a-fA-F]+n$/,Vs=e=>rc.test(e)||nc.test(e)||ic.test(e)||lc.test(e),ue={Integer:6,Float:7,BigInt:8,PosInfinity:9,NegInfinity:10,NaN:11,6:"Integer",7:"Float",8:"BigInt",9:"PosInfinity",10:"NegInfinity",11:"NaN"},Ks=(e,t=!1)=>{let r={value:void 0,type:void 0};return e==="+Infinity"||e==="Infinity"?(r.value=1/0,r.type=ue.PosInfinity):e==="-Infinity"?(r.value=-1/0,r.type=ue.NegInfinity):(e==="NaN"||e==="+NaN"||e==="-NaN")&&(r.value=NaN,r.type=ue.NaN),t?r:r.value},cc=e=>{let t,r,n;e[0]==="+"||e[0]==="-"?(t=e[0],r=Ws[e.slice(1,3).join("").toLowerCase()],n=e.slice(3).join("").toLowerCase()):(t="+",r=Ws[e.slice(0,2).join("").toLowerCase()],n=e.slice(2).join("").toLowerCase());let i=parseInt(n,r);return t==="+"?+i:-i},Qs=e=>{let t=Array.from(e);if(zs.test(e))return parseInt(e);if(ec.test(e)||tc.test(e)||Js.test(e))return cc(t)},ac=e=>{let t=e.be.sign+e.be.bd+e.be.dot+e.be.ad,r=e.ae.sign+e.ae.bd+e.ae.dot+e.ae.ad,n;if(!(t==="+"||t==="-"||r==="+"||r==="-")){if(r!=="")if(e.ae.dot==="."){let i=parseFloat(t),l=parseFloat(r);n=i*10**l}else n=parseFloat(t+"e"+r);else n=parseFloat(t);return n}},_c=(e,t)=>e.length===0||t==="."||t==="-."||t==="+."||t==="+"||t==="-",uc=()=>({be:{sign:"",bd:"",dot:"",ad:""},ae:{sign:"",bd:"",dot:"",ad:""},state:"init"}),Gs=(e,t,r,n)=>((e[r]==="-"||e[r]==="+")&&(t[n].sign=e[r],r=r+1),[e,r]),oc=(e,t,r,n)=>{if(t.state=n+"bd",e[r]===".")t[n].bd="0",t[n].dot=".",t.state=n+"ad";else if(Us.test(e[r]))t[n].bd=e[r];else return[!0,r];return[!1,r+1]},Hs=(e,t,r,n)=>{let i;for(i=r;i<e.length;i++)if(e[i]==="."){if(t[n].dot===".")return[!0,i];t[n].dot=".",t.state=n+"ad"}else{if(e[i]==="e"||e[i]==="E")return n==="ae"?[!0,i]:(t.state="aebd",[!1,i+1]);if(Us.test(e[i]))t.state===n+"bd"?t[n].bd=t[n].bd+e[i]:t[n].ad=t[n].ad+e[i];else return[!0,i]}return[!1,i+1]},Zs=e=>{let t=uc(),r=Array.from(e);if(_c(r,e))return;let n=0,i=!1;if([r,n]=Gs(r,t,n,"be"),[i,n]=oc(r,t,n,"be"),!i&&([i,n]=Hs(r,t,n,"be"),!i&&([r,n]=Gs(r,t,n,"ae"),[i,n]=Hs(r,t,n,"ae"),!i)))return ac(t)},er=(e,t=!1)=>{let r={value:void 0,type:void 0};if(Vs(e))r.value=BigInt(e.substr(0,e.length-1)),r.type=ue.BigInt;else{let n=Qs(e);n!==void 0?(r.value=n,r.type=ue.Integer):(n=Zs(e),n!==void 0?(r.value=n,r.type=ue.Float):(n=Ks(e,t=!0),n.value!==void 0&&(r=n)))}return t?r:r.value},fc=(e,t=!0)=>{if(typeof e=="string")return e;if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="number")return e.toString();if(typeof e=="bigint")return e.toString()+"n";if(typeof e=="symbol")return e.description;if(Xs()&&e[Symbol.for("nodejs.util.inspect.custom")])return e[Symbol.for("nodejs.util.inspect.custom")]();{let r=function(n){if(typeof n.toString=="function")return n.toString()};try{return t?s=JSON.stringify(e):s=JSON.stringify(e,null,4),typeof s=="string"?s:r(e)}catch{return r(e)}}},Ye={UndefinedLiteral:0,NullLiteral:1,FalseLiteral:3,TrueLiteral:4,StringLiteral:12},hc={only_value:!0,with_value:!0,with_type:!1,unknown_as_string:!1};function tr(e,t={only_value:!0,with_value:!0,with_type:!1,unknown_as_string:!1}){let r=JSON.parse(JSON.stringify(hc));Object.assign(r,t);let{only_value:n,with_value:i,with_type:l,unknown_as_string:c}=r,a={value:Fe,type:Fe};if(e==="undefined")a.value=void 0,a.type=Ye.UndefinedLiteral;else if(e==="null")a.value=null,a.type=Ye.NullLiteral;else if(e==="false")a.value=!1,a.type=Ye.FalseLiteral;else if(e==="true")a.value=!0,a.type=Ye.TrueLiteral;else{let _=er(e,!0);_.type===void 0?c?(a.value=e,a.type=Ye.StringLiteral):(a.value=e,a.type=Fe):(a.value=_.value,a.type=_.type)}return n?a.value:(l||delete a.type,i||delete a.value,a)}tr.unknown=Fe;var dc={UndefinedLiteral:0,NullLiteral:1,BooleanLiteral:{_self:2,FalseLiteral:3,TrueLiteral:4},NumericLiteral:{_self:5,Integer:6,Float:7,BigInt:8,PosInfinity:9,NegInfinity:10,NaN:11},StringLiteral:12,ArrayExpression:{_self:13,element:14},ObjectExpression:{_self:15,property:16},_Ref:17,CommentLine:{_self:18,tt:19,k:20,bv:21,av:22},CommentBlock:{_self:23,tt:24,k:25,bv:26,av:27}};sr.exports={TYPE_DICT:dc,isNode:Xs,empty:Zl,unknown:Fe,is_bigint_str:Vs,is_jsint_str:sc,NUM_TYPE_DICT:ue,parse_abnormal_num:Ks,parse_int:Qs,parse_float:Zs,parse_num:er,parse0:tr,to_str:fc}});var lr=o((Jf,ir)=>{var Me={backSpace:8,tab:9,lineFeed:10,lineTab:11,formFeed:12,carriageReturn:13,shiftOut:14,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,nonBreakingSpace:160,oghamSpaceMark:5760,enQuad:8192,emQuad:8193,enSpace:8194,emSpace:8195,threePerEmSpace:8196,fourPerEmSpace:8197,sixPerEmSpace:8198,figureSpace:8199,punctuationSpace:8200,thinSpace:8201,hairSpace:8202,lineSeparator:8232,paragraphSeparator:8233,narrowNoBreakSpace:8239,mediumMathematicalSpace:8287,ideographicSpace:12288,zeroWidthNoBreakSpace:65279};function pc(e){let t=Object.entries(e),r=new Map;return t.forEach(n=>r.set(n[1],n[0])),r}var It=pc(Me);function gc(e){let t=Object.entries(e);return t=t.map(r=>[r[0],String.fromCharCode(r[1])]),Object.fromEntries(t)}var mc=gc(Me),rr=e=>55296<=e&&e<=56319,bc=e=>56320<=e&&e<=57343,yc=(e,t)=>(e-55296)*1024+(t-56320)+65536,nr=e=>e<=65535,$c=e=>!nr(e),vc=e=>{if(e<=65535)return[e,null];{e=e-65536;let t=[null,null];return t[0]=(e>>10)+55296,t[1]=e%1024+56320,t}},wc=(e,t)=>rr(e)?t+2:t+1;ir.exports={CODE_DICT:Me,CH_DICT:mc,CODE_NAME_MP:It,cd2ch:e=>String.fromCharCode(e),ch2cd:e=>e.codePointAt(0),cd2n:e=>It.get(e),n2cd:e=>String.fromCharCode(Me[e]),n2ch:e=>Me[e],ch2n:e=>It.get(e.codePointAt(0)),is_high_code:rr,is_low_code:bc,get_code_point_from_high_low:yc,get_high_low_from_code_point:vc,is_length1_code_point:nr,is_length2_code_point:$c,_next_code_index:wc}});var we=o((Vf,x)=>{var{CODE_DICT:h,CH_DICT:m}=lr(),cr=/\r\n?|[\n\u2028\u2029]/;x.exports.line_break_regexp=cr;x.exports.line_break_regexp_g=new RegExp(cr.source,"g");function ar(e){switch(e){case h.lineFeed:case h.carriageReturn:case h.lineSeparator:case h.paragraphSeparator:return!0;default:return!1}}function _r(e){switch(e){case m.lineFeed:case m.carriageReturn:case m.lineSeparator:case m.paragraphSeparator:return!0;default:return!1}}var Dt=[h.lineFeed,h.carriageReturn,h.lineSeparator,h.paragraphSeparator],ur=Dt.map(e=>String.fromCharCode(e));x.exports.NL_CODE_ARR=Dt;x.exports.NL_CH_ARR=ur;x.exports.is_nl_code=ar;x.exports.is_nl=_r;x.exports.skip_white_space_regexp=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function or(e){switch(e){case 9:case 11:case 12:case h.space:case h.nonBreakingSpace:case h.oghamSpaceMark:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}x.exports.is_non_nl_ws_code=or;function fr(e){switch(e){case m.tab:case m.lineTab:case m.formFeed:case m.space:case m.nonBreakingSpace:case m.oghamSpaceMark:case m.enQuad:case m.emQuad:case m.enSpace:case m.emSpace:case m.threePerEmSpace:case m.fourPerEmSpace:case m.sixPerEmSpace:case m.figureSpace:case m.punctuationSpace:case m.thinSpace:case m.hairSpace:case m.narrowNoBreakSpace:case m.mediumMathematicalSpace:case m.ideographicSpace:case m.zeroWidthNoBreakSpace:return!0;default:return!1}}x.exports.is_non_nl_ws=fr;var Lt=[h.tab,h.lineTab,h.formFeed,h.space,h.nonBreakingSpace,h.oghamSpaceMark,h.enQuad,h.emQuad,h.enSpace,h.emSpace,h.threePerEmSpace,h.fourPerEmSpace,h.sixPerEmSpace,h.figureSpace,h.punctuationSpace,h.thinSpace,h.hairSpace,h.narrowNoBreakSpace,h.mediumMathematicalSpace,h.ideographicSpace,h.zeroWidthNoBreakSpace];x.exports.NON_NL_WS_CODE_ARR=Lt;var hr=Lt.map(e=>String.fromCharCode(e));x.exports.NON_NL_WS_CH_ARR=hr;function kc(e){return or(e)||ar(e)}function ve(e){return fr(e)||_r(e)}x.exports.is_ws_code=kc;x.exports.is_ws=ve;x.exports.WS_CHCODE_ARR=Dt.concat(Lt);x.exports.WS_CH_ARR=ur.concat(hr);var Q={init:0,executing:1,succ:2,eof:3};x.exports.STATE_DICT=Q;function xc(e,t=new Set){let r={g:e,rslt:"",state:Q.init},n=r.g.next().value;if(n===void 0)return r.state=Q.eof,r;for(;n!==void 0&&(ve(n)||t.has(n));)n=r.g.next().value;for(;n!==void 0&&!ve(n)&&!t.has(n);)r.rslt=r.rslt+n,n=r.g.next().value;return n===void 0?r.state=Q.eof:(ve(n)||t.has(n))&&(r.state=Q.succ),r}function Tc(e,t=0,r=new Set){let n={arr:e,pos:t,rslt:"",state:Q.init};for(let l=n.pos;l<e.length;l++){let c=e[l];if(ve(c)||r.has(c))n.pos=n.pos+1;else break}let i=n.pos;for(let l=n.pos;l<e.length;l++){let c=e[l];if(!ve(c)&&!r.has(c))n.pos=n.pos+1;else break}return n.pos===e.length?n.state=Q.eof:n.state=Q.succ,n.rslt=e.slice(i,n.pos).join(""),n}x.exports.from_generator=xc;x.exports.from_charr=Tc});var Z=o((Kf,yr)=>{var{WS_CH_ARR:dr,NON_NL_WS_CH_ARR:Sc,NL_CH_ARR:Ec}=we();function Cc(e){return Array.from(e).length}var qc="\u200C",pr="\u200D",Ac=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function Ot(e,t,...r){let n=function(){return t(this,...r)};Ac()?e.prototype[Symbol.for("nodejs.util.inspect.custom")]=n:e.prototype.repr=n}var B={tmpl_quote:new Error("tmpl_quote: ` cant be deleted"),reserved:new Error(" [/,*,#,&,`,\\,] and whitespaces are reserved"),inuse:new Error("in using"),char:new Error("must be a char"),pair:new Error("left block must be different with right"),cant_be_empty:new Error("can NOT be empty")},nt=Symbol("get_pair_lmp"),Nc=Symbol("add_pair_reserved"),We=class{#t;#e=new Map;#s=new Map;constructor(t){this.#t=t}get[nt](){return this.#e}get size(){return this.#e.size}[Nc](t,r){if(t===r)throw B.pair;this.#e.set(t,r),this.#s.set(r,t)}add(t,r){if(this.#t.validate(t),this.#t.validate(r),t===r)throw B.pair;this.#e.set(t,r),this.#s.set(r,t)}ldelete(t){if(this.size<2)throw B.cant_be_empty;{let r=this.#e.get(t);this.#e.delete(t),this.#s.delete(r)}}rdelete(t){if(this.size<2)throw B.cant_be_empty;{let r=this.#s.get(t);this.#s.delete(t),this.#e.delete(r)}}lhas(t){return this.#e.has(t)}rhas(t){return this.#s.has(t)}has(t){return this.lhas(t)||this.rhas(t)}getl(t){return this.#s.get(t)}getr(t){return this.#e.get(t)}[Symbol.iterator](){return this.#e[Symbol.iterator]()}};function Ic(e){return new Map(e[nt])}Ot(We,Ic);var gr=Symbol("get_single_set"),mr=Symbol("add_single_reserved"),ke=class{#t;#e=new Set;constructor(t){this.#t=t}get[gr](){return this.#e}[mr](t){this.#e.add(t)}add(t){this.#t.validate(t),this.#e.add(t)}delete(t){if(this.size<2)throw B.cant_be_empty;if(t==="`")throw B.tmpl_quote;this.#e.delete(t)}has(t){return this.#e.has(t)}[Symbol.iterator](){return this.#e[Symbol.iterator]()}};function Dc(e){return new Set(e[gr])}Ot(ke,Dc);var it=class{#t;#e;#s;#r;#n;#i=!1;constructor(){this.#t=new We(this),this.#t.add("[","]"),this.#t.add("(",")"),this.#t.add("<",">"),this.#t.add("\uFF08","\uFF09"),this.#t.add("\u2018","\u2019"),this.#e=new We(this),this.#e.add("{","}"),this.#e.add("\u3010","\u3011"),this.#e.add("\u300A","\u300B"),this.#e.add("\u201C","\u201D"),this.#s=new ke(this),this.#s.add('"'),this.#s.add("'"),this.#s.add("\xB7"),this.#s[mr]("`"),this.#r=new ke(this),this.#r.add(","),this.#r.add("\uFF0C"),this.#r.add(";"),this.#r.add("\uFF1B"),this.#r.add("\u3002"),this.#r.add("\u3001"),this.#n=new ke(this),this.#n.add(":"),this.#n.add("\uFF1A"),this.#n.add("="),this.#i=!0}get reserved(){return["/","*","#","&","`","\\"].concat(dr)}get inuse(){let t=new Set;if(this.#i){for(let r of this.#s)t.add(r);for(let r of this.#r)t.add(r);for(let r of this.#n)t.add(r);for(let r of this.#t[nt])t.add(r);for(let r of this.#e[nt])t.add(r)}return t}validate(t){if(typeof t!="string"||Cc(t)!==1)throw B.char;if(this.reserved.includes(t))throw B.reserved;if(Array.from(this.inuse).flat().includes(t))throw B.inuse;return t}get esc(){return"\\"}get slash(){return"/"}get line_comment(){return"//"}get asterisk(){return"*"}get blk_comments(){return["/*","*/"]}get hash(){return"#"}get ref(){return"&"}get tmpl_quote(){return"`"}get nl(){return Ec}get non_nl_ws(){return Sc}get ws(){return dr}get array_blks(){return this.#t}get fst_ary_blks(){return Array.from(this.#t)[0]}get obj_blks(){return this.#e}get fst_obj_blks(){return Array.from(this.#e)[0]}get quotes(){return this.#s}get fst_quote(){return Array.from(this.#s)[0]}get commas(){return this.#r}get fst_comma(){return Array.from(this.#r)[0]}get colons(){return this.#n}get fst_colon(){return Array.from(this.#n)[0]}},lt=class{constructor(t){this.reserved=t.reserved}get[Symbol.toStringTag](){return"reserved"}};Object.defineProperty(lt,"name",{value:pr});var ct=class{constructor(t){this.esc=t.esc,this.hash=t.hash,this.ref=t.ref,this.tmpl_quote=t.tmpl_quote,this.slash=t.slash,this.asterisk=t.asterisk,this.line_comment=t.line_comment,this.blk_comments=t.blk_comments,this.nl=t.nl,this.non_nl_ws=t.non_nl_ws}get[Symbol.toStringTag](){return"fixed"}};Object.defineProperty(ct,"name",{value:pr});var at=class{constructor(t){this.obj_blks=t.obj_blks,this.array_blks=t.array_blks,this.quotes=t.quotes,this.commas=t.commas,this.colons=t.colons}get[Symbol.toStringTag](){return"configurable-if-not-reserved"}};Object.defineProperty(at,"name",{value:qc});function Lc(e){return[new ct(e),new at(e),new lt(e)]}Ot(it,Lc);var br=new it;br.ERROR_DICT=B;yr.exports=br});var vr=o((Qf,$r)=>{function*Oc(e){for(let t of e)yield t;e=null}$r.exports.sync_gen_from_str=Oc});var N=o((Zf,xr)=>{var wr={bk:{_self:0,eof:{_self:1,lc:2,blkc:3,hash:{_self:4,naked:5,quote:6},ref:{_self:7,naked:8,quote:9}}},k:{_self:10,eof:{_self:11,lc:12,blkc:13,hash:{_self:14,naked:15,quote:16},ref:{_self:17,naked:18,quote:19}}},ak:{_self:20,eof:{_self:21,lc:22,blkc:23,hash:{_self:24,naked:25,quote:26},ref:{_self:27,naked:28,quote:29}}},bv:{_self:30,eof:{_self:31,lc:32,blkc:33,hash:{_self:34,naked:35,quote:36},ref:{_self:37,naked:38,quote:39}}},v:{_self:40,eof:{_self:41,lc:42,blkc:43,hash:{_self:44,naked:45,quote:46},ref:{_self:47,naked:48,quote:49}}},av:{_self:50,eof:{_self:51,lc:52,blkc:53,hash:{_self:54,naked:55,quote:56},ref:{_self:57,naked:58,quote:59}}}};function C(e){return e instanceof Object?e._self:e}function Rc(e){return e+1}function Pc(e){return e+2}function jc(e){return e+3}function Bc(e){return e+6}function Yc(e){return e+5}function Fc(e){return e+9}function Mc(e){return e+8}function kr(e){return e%10!==0}var Wc={backslash:0,lcmt:1,blkcmt:2,quote:3,naked:4},Gc={handling:0,handled:1};function Hc(e,t,r){let n=wr;return e.$has_yield_sign()||kr(r)||t===C(n.av)&&r===C(n.bv)||t===C(n.av)&&r===C(n.bk)||t===C(n.av)&&r===C(n.k)||t===C(n.av)&&r===C(n.v)||t===C(n.av)&&r===C(n.ak)||t===C(n.v)&&r===C(n.bv)||t===C(n.v)&&r===C(n.bk)}xr.exports={STATE_DICT:wr,gtv:C,get_main_eofv_with_code:Rc,get_lcmt_eofv_with_code:Pc,get_blkcmt_eofv_with_code:jc,get_hash_quote_eofv_with_code:Bc,get_hash_naked_eofv_with_code:Yc,get_ref_quote_eofv_with_code:Fc,get_ref_naked_eofv_with_code:Mc,LEFTED_TYPE:Wc,AVND_CACHE_STATE_DICT:Gc,is_eofv:kr,is_should_yield:Hc}});var Wt=o((eh,Or)=>{var{is_nl:Er}=we(),Cr=(e,t,r=" ",n=!1)=>{let i=e.length;return i<=t?r.repeat(t-i)+e:n?e.substr(i-t):e},_t=(e,t,r,n="0",i=!1)=>{let l=e.toString(t);return Cr(l,r,n,i)},Xc=/^[0-7]$/,zc=/^[0-9a-fA-F]$/,oe=e=>Xc.test(e),z=e=>zc.test(e),ut={b:"\b",f:"\f",n:`
2
- `,r:"\r",t:" ",v:"\v"},qr={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\\":"\\\\"};function Uc(e){return qr[e]}function Ar(e){return ut[e]}function Jc(e){if(e.length>1)return;let t=e.charCodeAt(0);if(t>=0&&t<=255)return"\\x"+_t(t,16,2)}function Vc(e){e=Array.from(e);let t=e[0],r=e[1];if(z(t)&&z(r)){let n=parseInt("0x"+t+r);return String.fromCharCode(n)}}function Kc(e){if(e.length>1)return;let t=e.charCodeAt(0);if(t>=0&&t<=255)return"\\u"+_t(t,16,4)}function Qc(e){e=Array.from(e);let t=e[0],r=e[1],n=e[2],i=e[3];if(z(t)&&z(r)&&z(n)&&z(i)){let l=parseInt("0x"+t+r+n+i);return String.fromCharCode(l)}}function Zc(e){if(e.length>1)return;let t=e.charCodeAt(0);if(t>=0&&t<=255)return"\\"+_t(t,8,3)}function ea(e){let t="";e=Array.from(e);let r=e[0];if(oe(r)){t=t+r;let n=e[1];if(oe(n)){t=t+n;let l=e[2];oe(l)&&(t=t+l)}let i=parseInt(t,8);return String.fromCharCode(i)}}var d={init:0,executing:1,succ:2,eof:3,backslash:4,x:5,u:6,o:7};function*ta(e){let t=Array.from(e);for(let r of t)yield r}function*Tr(e,t){yield*t,yield*e}function Nr(e,t,r,n,i=!1){if(typeof t=="string"){let c=t;t=a=>a===c}if(typeof(r==="string")&&r.length>0){let c=ta(r);e=Tr(e,c)}else e=Tr(e,r);let l={state:d.init,end:t,esc:n,g:e,curr:"",ch:e.next().value,offset:0};return l.ch!==void 0&&(l.offset=l.offset+1),i&&(l.rslt=""),l}function Rt(e){return e.ch===void 0||e.end(e.ch)&&e.state!==d.backslash||e.state===d.x||e.state===d.u||e.state===d.o}function Pt(e,t=!1){return e.ch===e.esc?(e.state=d.backslash,e.curr=""):(e.state=d.executing,t&&(e.rslt=e.rslt+e.ch),e.curr=e.ch),e.ch=e.g.next().value,e.ch!==void 0&&(e.offset=e.offset+1),e}function Sr(e,t,r,n,i,l,c){return c===!0?n===Ir?(e.state=d.x,e.ch="\\x"+t.join(""),e):n===Dr?(e.state=d.u,e.ch="\\u"+t.join(""),e):(n===Lr&&(e.state=d.o,e.ch="\\"+t.join("")),e):i?(e.curr=t.join(""),l&&(e.rslt=e.rslt+e.curr),e.state=d.executing,e.ch=r,e):(e.curr=n(t),l&&(e.rslt=e.rslt+e.curr),e.state=d.executing,e.ch=r,e)}function sa(e,t,r,n,i){return e.curr=n(t),i&&(e.rslt=e.rslt+e.curr),e.state=d.executing,e.ch=e.g.next().value,e.ch!==void 0&&(e.offset=e.offset+1),e}function ot(e,t,r,n,i=!0,l=!1,c=void 0,a=!1){let _;if(c!==void 0?_=c:(_=e.g.next().value,_!==void 0&&(e.offset=e.offset+1)),_===void 0)return e;let u=0,f=[],g;if(l?g=!0:g=r(_),g)u=u+1,f.push(_);else return e.state=d.executing,e.ch=_,e;for(;u<t;){if(_=e.g.next().value,_===void 0)return Sr(e,f,_,n,i,a,tail=!0);if(e.offset=e.offset+1,g=r(_),g)u=u+1,f.push(_);else return Sr(e,f,_,n,i,a,tail=!1)}return sa(e,f,_,n,a)}function Ir(e){let t=parseInt("0x"+e[0]+e[1]);return String.fromCharCode(t)}function Dr(e){let t=parseInt("0x"+e[0]+e[1]+e[2]+e[3]);return String.fromCharCode(t)}function Lr(e){let t=parseInt(e.join(""),8);return String.fromCharCode(t)}function jt(e,t=!1){return e.curr=Ar(e.ch),t&&(e.rslt=e.rslt+e.curr),e.state=d.executing,e.ch=e.g.next().value,e.ch!==void 0&&(e.offset=e.offset+1),e}function Bt(e,t=!1){return ot(e,2,z,Ir,!0,!1,void 0,t)}function Yt(e,t=!1){return ot(e,4,z,Dr,!0,!1,void 0,t)}function Ft(e,t=!1){return ot(e,3,oe,Lr,!1,!0,e.ch,t)}function Mt(e,t=!1){return e.curr=e.ch,t&&(e.rslt=e.rslt+e.ch),e.state=d.executing,e.ch=e.g.next().value,e.ch!==void 0&&(e.offset=e.offset+1),e}function ra(e,t=i=>i==='"',r="",n="\\"){let i=Nr(e,t,r,n,!0);for(i.state=d.executing;!Rt(i);)i.state===d.executing?Pt(i,!0):i.state===d.backslash&&(Er(i.ch)?(i.ch=i.g.next().value,i.ch!==void 0&&(i.offset=i.offset+1),i.state=d.executing):i.ch in ut?jt(i,!0):i.ch==="x"?Bt(i,!0):i.ch==="u"?Yt(i,!0):oe(i.ch)?Ft(i,!0):Mt(i,!0));return typeof i.ch=="string"&&i.end(i.ch)?(i.state=d.succ,i.ch=""):i.state===d.backslash?i.ch=i.esc:i.ch===void 0&&(i.state=d.eof,i.ch=""),i}function*na(e){let t=e;for(t.state=d.executing;!Rt(t);)t.state===d.executing?(Pt(t,!1),t.curr!==""&&(yield t.curr)):t.state===d.backslash&&(Er(t.ch)?(t.state=d.executing,t.ch=t.g.next().value,t.ch!==void 0&&(t.offset=t.offset+1)):t.ch in ut?(jt(t,!1),t.curr!==""&&(yield t.curr)):t.ch==="x"?(Bt(t,!1),t.curr!==""&&(yield t.curr)):t.ch==="u"?(Yt(t,!1),t.curr!==""&&(yield t.curr)):oe(t.ch)?(Ft(t,!1),t.curr!==""&&(yield t.curr)):(Mt(t,!1),t.curr!==""&&(yield t.curr)));return typeof t.ch=="string"&&t.end(t.ch)?(t.state=d.succ,t.ch=""):t.state===d.backslash?(t.ch=t.esc,yield t.curr):t.ch===void 0&&(t.state=d.eof,t.ch=""),t}Or.exports={CHAR_UNESC_DICT:ut,CHAR_ESC_DICT:qr,escc:Uc,unescc:Ar,escx:Jc,unescx:Vc,escu:Kc,unescu:Qc,esco:Zc,unesco:ea,STATE_DICT:d,from_generator:ra,init:Nr,handle_executing:Pt,is_terminated:Rt,handle_escc:jt,esc_handle_engine:ot,handle_escx:Bt,handle_escu:Yt,handle_esco:Ft,handle_esc_other:Mt,gen:na,prepend:Cr,prepend_num:_t,is_odigit_ch:oe,is_hdigit_ch:z}});var Gr=o((th,Wr)=>{var{is_nl:ia}=we(),xe=Wt(),Rr={line_comment:0,blk_comment:1},ee={init:0,executing:1,succ:2,eof:3,asterisk:4};function Pr(e){return{state:ee.init,g:e,rslt:"",ch:"",offset:0}}function jr(e,t){return e.state=ee.eof,e.rslt=e.rslt+t.rslt,e.ch="",e}function Br(e,t){return e.state=ee.succ,e.rslt=e.rslt+t.rslt,e.ch="",e}function Yr(e,t){return e.state=ee.executing,e.rslt=e.rslt+t.rslt,e.ch=t.ch,e}function Fr(e,t=""){let r=Pr(e);r.state=ee.executing;let n=xe.from_generator(r.g,ia,t);return r.offset=n.offset+r.offset,r.g=n.g,n.state===xe.STATE_DICT.eof?jr(r,n):n.state===xe.STATE_DICT.succ?Br(r,n):Yr(r,n)}function Mr(e,t=""){let r=Pr(e);r.state=ee.executing;let n;for(;;){if(n=xe.from_generator(r.g,"*",t),r.offset=r.offset+n.offset,r.g=n.g,n.state===xe.STATE_DICT.eof)return jr(r,n);if(n.state===xe.STATE_DICT.succ){let i=r.g.next().value;if(i!==void 0&&(r.offset=r.offset+1),i==="/")return Br(r,n);if(i!==void 0)r.rslt=r.rslt+n.rslt+"*",t=i,r.offset=r.offset-1;else return r.rslt=r.rslt+n.rslt,r.ch="*",r.state=ee.asterisk,r}else return Yr(r,n)}return r}function la(e,t,r=""){return t===Rr.line_comment?Fr(e,r):Mr(e,r)}Wr.exports={TYPE_DICT:Rr,STATE_DICT:ee,lc_from_generator:Fr,blk_from_generator:Mr,from_generator:la}});var Gt=o((sh,Hr)=>{function ca(e){if(globalThis.document===void 0){let i=globalThis.require("fs").readFileSync(e).toString();return JSON.parse(i)}else return}function aa(e,t){if(globalThis.document===void 0){let n=globalThis.require("fs"),i=JSON.stringify(t);n.writeFileSync(e,i)}else return}function _a(e){return parseInt(e).toString()===e}Hr.exports={rjson:ca,wjson:aa,is_int_str:_a}});var Ht=o((rh,Xr)=>{var ua=()=>Math.random()*9007199254740992;function oa(e,t){return Array.from({length:t-e}).map((r,n)=>n+e)}function fa(e,t){return t.filter((r,n)=>e.includes(n))}function ha(e){return Object.entries(e).length===0}function da(e){return Object.entries(e).map(n=>n[1])}function pa(e){return Object.entries(e).map(n=>n[0])}function ga(e){return Object.entries(e).length}function ma(e,t){for(let r in e)t(r,e[r]);return e}function ba(e,t){for(let r in e)e[r]=t(r,e[r]);return e}function ya(e,t){for(let r in t)e[r]=t[r];return e}function $a(e,t){for(let r in t)!(r in e)&&(e[r]=t[r]);return e}function va(e,t,r){return r=r.filter(n=>n[e]!==t),r}function wa(e,t,r){return r.findIndex(i=>i[e]===t)}function ka(e){return JSON.parse(JSON.stringify(e))}function xa(e,t){for(let r=0;r<e.length;r++){lyr=e[r];for(let n=0;n<lyr.length;n++)e[r][n]=t(e[r][n],r,n)}return e}function Ta(e){let t=e[0]!=="_",r=e[0]!=="$";return t&&r}Xr.exports={gen_guid:ua,range:oa,seqs_slct:fa,dict_length:ga,is_empty_dict:ha,dict_values:da,dict_keys:pa,dict_map:ba,dict_foreach:ma,dict_plus:ya,dict_update:$a,dtb_kv_rm:va,dtb_kv_get_seq:wa,dcp:ka,mat_map:xa,is_cu_property:Ta}});var ns=o((nh,yn)=>{var v=Ht();function Ut(e){if(v.is_empty_dict(e))return 0;{let t=v.dict_keys(e);return Math.max(...t)+1}}function Ge(e){return e!=null}function Ur(e,t){return e._id=e._id+t,e._tree=e._tree+t,Ge(e._fstch)&&(e._fstch=e._fstch+t),Ge(e._lsib)&&(e._lsib=e._lsib+t),Ge(e._rsib)&&(e._rsib=e._rsib+t),Ge(e._parent)&&(e._parent=e._parent+t),e}function fe(e,t){let r=Ut(e);for(let n in t){let i=Ur(t[n],r);t[i._id]=i,delete t[n]}return t}function Sa(e=0){let t=e;return{_id:t,_fstch:null,_lsib:null,_rsib:null,_parent:null,_tree:t}}function Ea(e,t=0){return{_id:Ut(e)+t,_fstch:null,_lsib:void 0,_rsib:void 0,_parent:void 0,_tree:void 0}}function Jr(e){return e._tree!==void 0}function te(e){let t=e._tree!==void 0,r=e._tree===e._id;return t&&r}function Jt(e){return e._lsib===null}function Vt(e){return e._rsib===null}function Y(e){return e._fstch===null}function Vr(e,t){if(te(e))return!0;{let n=w(e,t);return M(n,t).length===1}}function Ue(e){return te(e)||!Jr(e)}function ft(e,t,r){if(!Ue(t))return console.log("only root or uninited could be prepend"),e;let n=Y(e);if(t._tree=e._tree,t._lsib=null,n)t._rsib=null,t._parent=e._id;else{let i=r[e._fstch];i._lsib=void 0,t._rsib=i._id,t._parent=void 0}return e._fstch=t._id,r[t._id]=t,e}function Kt(e,t,r){if(!Ue(t))return console.log("only root or uninited could be append"),e;let n=Y(e);if(t._tree=e._tree,t._rsib=null,n)e._fstch=t._id,t._lsib=null;else{let i=de(e,r);i._parent=void 0,i._rsib=t._id,t._lsib=void 0}return t._parent=e._id,r[t._id]=t,e}function Qt(e,t,r){if(!Ue(t))return console.log("only root or uninited could be add"),e;if(te(e))return console.log("cant addrsib to root"),e;let n=Vt(e);return t._tree=e._tree,n?(t._parent=e._parent,e._parent=void 0,t._rsib=null):(t._rsib=e._rsib,t._parent=void 0),e._rsib=t._id,t._lsib=void 0,r[t._id]=t,e}function Kr(e,t,r){if(!Ue(t))return console.log("only root or uninited could be add"),e;if(te(e))return console.log("cant addlsib to root"),e;let n=Jt(e);if(t._tree=e._tree,n){let i=w(e,r);e._lsib=void 0,t._lsib=null,i._fstch=t._id}else{let i=F(e,r);i._rsib=t._id,t._lsib=void 0}return t._rsib=e._id,t._parent=void 0,r[t._id]=t,e}function Qr(e,t,r,n){let i=M(t,n),l=i.length;if(l===0)return ft(t,r,n);if(e<=l&&e>=0){if(e===0)return ft(t,r,n);if(e===l)return Kt(t,r,n);{let a=i[e-1];return Qt(a,r,n)}}else return console.log("not in range!!"),t}function Te(e,t){for(let r in t)t[r]._tree=e._tree}function Ca(e,t,r){r=fe(t,r);let n=v.dict_keys(r)[0],i=re(r[n],r);return e=ft(e,i,t),Te(e,r),v.dict_plus(t,r),e}function qa(e,t,r){r=fe(t,r);let n=v.dict_keys(r)[0],i=re(r[n],r);return e=Kt(e,i,t),Te(e,r),v.dict_plus(t,r),e}function Aa(e,t,r){r=fe(t,r);let n=v.dict_keys(r)[0],i=re(r[n],r);return e=Qt(e,i,t),Te(e,r),v.dict_plus(t,r),e}function Na(e,t,r){r=fe(t,r);let n=v.dict_keys(r)[0],i=re(r[n],r);return e=Kr(e,i,t),Te(e,r),v.dict_plus(t,r),e}function Ia(e,t,r,n){n=fe(r,n);let i=v.dict_keys(n)[0],l=re(n[i],n);return t=Qr(e,t,l,r),Te(t,n),v.dict_plus(r,n),t}function He(e,t){let r=W(e,t),n=r[0]._id;return r.forEach(i=>{i._tree=n}),r}function Xe(e,t){let r={};return e.map(n=>{let i=n._id;r[i]=n,delete t[i]}),r}function Zr(e){return e._fstch=null,e}function ze(e){return e._lsib=null,e._rsib=null,e._parent=null,e}function Se(e,t){if(te(e))return[e,t];if(Vr(e,t)){let n=t[e._parent];Zr(n);let i=He(e,t),l=Xe(i,t);return ze(e),[e,l]}else if(Jt(e)){let n=R(e,t);n._lsib=null;let i=w(e,t);i._fstch=e._rsib;let l=He(e,t),c=Xe(l,t);return ze(e),[e,c]}else if(Vt(e)){let n=F(e,t);n._rsib=e._rsib,n._parent=e._parent;let i=He(e,t),l=Xe(i,t);return ze(e),[e,l]}else{let n=F(e,t);n._rsib=e._rsib;let i=He(e,t),l=Xe(i,t);return ze(e),[e,l]}}function Da(e,t){let r=he(e,t);return r===null?[e,t]:Se(r,t)}function La(e,t){let r=de(e,t);return r===null?[e,t]:Se(r,t)}function Oa(e,t,r){let n=en(e,t,r);return n===null?[t,r]:Se(n,r)}function Ra(e,t,...r){let n=tn(e,t,...whiches);for(let i=0;i<n.length;i++)Se(n[i],t);return[e,t]}function Pa(e,t){let r=M(e,t);for(let n=0;n<r.length;n++)Se(r[n],t);return t}function he(e,t){return e._fstch===null?null:t[e._fstch]}function M(e,t){let r=[],n=he(e,t);for(;n!==null;)r.push(n),n=R(n,t);return r}function de(e,t){let r=M(e,t);return r.length===0?null:r[r.length-1]}function en(e,t,r){let n=M(t,r);return n.length===0||e>n.length-1||e<0?null:n[e]}function tn(e,t,...r){let n=M(e,t),i=[];if(n.length!==0)for(let l=0;l<r.length;l++){let c=r[l];c>n.length-1||c<0||i.push(n[c])}return i}function sn(e,t,r=!1){let n=e,i=R(e,t);for(;i!==null;)n=i,i=R(i,t);return r||n._id!==e._id?n:null}function ja(e,t){let r=se(e,t,!0),n=v.dtb_kv_get_seq("_id",e._id,r),i=[];if(r.length!==0)for(let l=0;l<r.length;l++)l<n&&i.push(r[l]);return i}function Ba(e,t){let r=se(e,t,!0),n=v.dtb_kv_get_seq("_id",e._id,r),i=[];if(r.length!==0)for(let l=0;l<r.length;l++)l>n&&i.push(r[l]);return i}function se(e,t,r=!1){let n=w(e,t),i;return n!==null?i=M(n,t):i=[e],r||(i=v.dtb_kv_rm("_id",e._id,i)),i}function Ya(e,t,r=!1){let n=se(e,t,!0);return r?n[0]:n[0]._id===e._id?null:n[0]}function Fa(e,t,r){let n=se(t,r,!0),i=n.length;return e<=i-1&&e>=0?n[e]:null}function Ma(e,t,...r){let n=se(e,t,!0),i=[];if(n.length!==0)for(let l=0;l<r.length;l++){let c=r[l];c>n.length-1||c<0||i.push(n[c])}return i}function Wa(e,t){let r=se(e,t,!0);return v.dtb_kv_get_seq("_id",e._id,r)}function F(e,t){let r=se(e,t,!0),n=v.dtb_kv_get_seq("_id",e._id,r);return n===0?null:r[n-1]}function R(e,t){return e._rsib===null?null:t[e._rsib]}function S(e,t){return ht(e,t,!0).length-1}function rn(e,t){let r=S(e,t),i=W(e,t).map(c=>S(c,t));return Math.max(...i)-r+1}function Ga(e,t){return Y(e)?null:S(e,t)+1}function Ha(e,t){if(Y(e))return null;{let n=S(e,t),l=W(e,t).map(a=>S(a,t));return Math.max(...l)}}function Xa(e,t,r){let n=S(t,r);return rn(t,r)<=e?null:n+e}function nn(e,t){let r=re(e,t),n=W(r,t),i=S(e,t);return n.filter(c=>S(c,t)===i)}function Xt(e,t){let r=nn(e,t);return v.dtb_kv_get_seq("_id",e._id,r)}function za(e,t){return W(e,t).length}function re(e,t){let r=e,n=w(e,t);for(;n!==null;)r=n,n=w(n,t);return r}function w(e,t){let r;if(te(e))r=null;else{let n=sn(e,t,!0);r=t[n._parent]}return r}function ht(e,t,r=!1){let n=[],i=w(e,t);for(;i!==null;)n.push(i),i=w(i,t);return r&&n.unshift(e),n}function Ua(e,t,r){let n=ht(t,r,!0),i=n.length;return e<i&&e>=0?n[e]:null}function Ja(e,t,...r){let n=ht(e,t,!0),i=[];if(n.length!==0)for(let l=0;l<r.length;l++){let c=r[l];c>n.length-1||c<0||i.push(n[c])}return i}function ln(e,t){let r=w(e,t);for(;r!==null;){let n=R(r,t);if(n!==null)return n;r=w(r,t)}return null}function cn(e,t){let r=he(e,t);if(r!==null)return r;{let n=R(e,t);return n!==null?n:ln(e,t)}}function an(e,t){let r=e,n=de(e,t);for(;n!==null;)r=n,n=de(n,t);return r}function Va(e,t){if(te(e))return null;if(Y(e)){let n=F(e,t);return n!==null?n:w(e,t)}else{let n=F(e,t);return n!==null?Y(n)?n:an(n,t):w(e,t)}}function W(e,t){let r=S(e,t),n=[];for(;e!==null&&(n.push(e),e=cn(e,t),!(e!==null&&S(e,t)<=r)););return n}function Zt(e,t){let r=e,n=he(e,t);for(;n!==null;)r=n,n=he(n,t);return r}function _n(e,t){let r=R(e,t);return r===null?w(e,t):Zt(r,t)}function un(e,t){let r=w(e,t);for(;r!==null;){let n=F(r,t);if(n!==null)return n;r=w(r,t)}return null}function Ka(e,t){if(Y(e)){let n=F(e,t);return n===null?un(e,t):n}else return de(e,t)}function on(e,t){let r=[],n=Zt(e,t);for(;n!==null&&(r.push(n),n._id!==e._id);)n=_n(n,t);return r}function zt(e){v.dict_foreach(e,(t,r)=>{e[t]._$visited=!1})}function fn(e,t){let r=e._$visited;if(Y(e))if(r){let i=R(e,t);return i===null?w(e,t):i}else return e._$visited=!0,e;else if(r){let i=R(e,t);return i===null?w(e,t):i}else return e._$visited=!0,he(e,t)}function Qa(e,t,r){if(Y(t)){if(e)return t;{let i=F(t,r);return i===null?w(t,r):i}}else{if(e)return de(t,r);{let i=F(t,r);return i===null?w(t,r):i}}}function hn(e,t){return t._$visited&&e===t._id}function dn(e,t,r=!1,n=!0){let i=[];zt(t);let l=e._id;for(;!hn(l,e);)r?i.push(v.dcp(e)):i.push(e),e=fn(e,t);return r?i.push(v.dcp(e)):i.push(e),n&&zt(t),i}function Za(e,t){let r={};r._depth=S(e,t),r._breadth=Xt(e,t);let n=w(e,t);return r._pbreadth=n===null?null:Xt(n,t),r._id=e._id,r}function zr(e){let t={};return t.ele={},t.nd=e,t.ele._id=e._id,t.ele._children=[],t}function es(e,t){let r=[],n=e[0],i=[zr(n)];for(i[0].ele._pbreadth=null;i.length>0;){let l=[];for(let a=0;a<i.length;a++){i[a].ele._breadth=a,i[a].ele._depth=r.length;let _=M(i[a].nd,t);_=_.map(u=>zr(u)),_.forEach((u,f)=>{u.ele._pbreadth=i[a].ele._breadth,i[a].ele._children.push([r.length+1,l.length+f])}),l=l.concat(_)}let c=i.map(a=>a.ele);r.push(c),i=l}return r}function pn(e,t){return on(e[0],t)}function gn(e,t,r=!1,n=!0){return dn(e[0],t,r,n)}function e_(e,t){let r=ts(e,t);return es(r,t)}function ts(e,t){let r=e[e.length-1];return W(r,t)}function t_(e,t,r=!1,n=!0){let i=ts(e,t);return gn(i,t,r,n)}function s_(e,t){let r=ss(e,t);return es(r,t)}function ss(e,t){let r=e[0];return W(r,t)}function r_(e,t){let r=ss(e,t);return pn(r,t)}function rs(e,t,r=!1){let n=W(e,t);return r||n.splice(0,1),n}function n_(e,t){return M(e,t)}function i_(e,t){let r=rs(e,t,!1),n=sdfs.map(l=>S(l,t)),i=Math.max(...n);return r=r.filter(l=>S(l,t)===i),r}function mn(e,t,r){let n=S(t,r),i=rs(t,r,!1),l=sdfs.map(c=>S(c,r));return i=i.filter(c=>S(c,r)===n+e),i}function l_(e,t,...r){let n=r.map(i=>mn(i,e,t));return n=Array.prototype.concat(...n),n}function bn(e){let t=v.dict_keys(e)[0],r=e[t];return re(r,e)}function c_(e){let t=bn(e);return W(t,e)}yn.exports={calc_next_id:Ut,update_nodes_ids:fe,creat_root:Sa,creat_nd:Ea,is_inited:Jr,is_root:te,is_fstch:Jt,is_lstch:Vt,is_leaf:Y,is_lonely:Vr,is_id:Ge,is_connectable:Ue,prepend_child:ft,append_child:Kt,insert_child:Qr,add_rsib:Qt,add_lsib:Kr,get_fstch:he,get_rsib:R,get_children:M,get_lstch:de,get_which_child:en,get_some_children:tn,get_fstsib:Ya,get_lstsib:sn,get_preceding_sibs:ja,get_following_sibs:Ba,get_sibs:se,get_which_sib:Fa,get_some_sibs:Ma,get_sibseq:Wa,get_lsib:F,get_rsib:R,get_lyr:nn,get_breadth:Xt,get_count:za,get_depth:S,get_height:rn,get_fst_lyr_des_depth:Ga,get_lst_lyr_des_depth:Ha,get_which_lyr_des_depth:Xa,get_root:re,get_parent:w,get_ances:ht,get_which_ance:Ua,get_some_ances:Ja,get_rsib_of_fst_ance_having_rsib:ln,get_sdfs_next:cn,get_drmost_des:an,get_sdfs_prev:Va,get_sdfs:W,get_lsib_of_fst_ance_having_lsib:un,get_dlmost_des:Zt,get_edfs_next:_n,get_edfs_prev:Ka,get_edfs:on,clear_$visited:zt,get_sedfs_next:fn,is_sedfs_traverse_finished:hn,get_sedfs_prev:Qa,get_sedfs:dn,get_deses:rs,get_fst_lyr_deses:n_,get_lst_lyr_deses:i_,get_which_lyr_deses:mn,get_some_lyrs_deses:l_,nd2ele:Za,sdfs2mat:es,sdfs2edfs:pn,sdfs2sedfs:gn,edfs2mat:e_,edfs2sdfs:ts,edfs2sedfs:t_,sedfs2mat:s_,sedfs2sdfs:ss,sedfs2edfs:r_,update_disconnected_nodes:He,update_orig_nodes:Xe,leafize:Zr,rootize:ze,disconnect:Se,rm_fstch:Da,rm_lstch:La,rm_which:Oa,rm_some:Ra,rm_all:Pa,update_treeid:Te,update_one_nodeid:Ur,update_nodes_ids:fe,prepend_child_tree:Ca,append_child_tree:qa,add_rsib_tree:Aa,add_lsib_tree:Na,insert_child_tree:Ia,get_root_via_tree:bn,tree2sdfs:c_}});var xn=o((ih,kn)=>{function $n(e="E"){class t extends Event{#t;constructor(n,i){super(n),this.#t=i}get data(){return this.#t}set data(n){this.#t=n}}return t}var vn=$n();function wn(e="ET"){class t extends EventTarget{#t=new Map;addEventListener(n,i){super.addEventListener(n,i),this.#t.set(n,i)}ls(){return this.#t}removeEventListener(n){super.removeEventListener(n),this.#t.delete(n)}dispatch(n,i){let l=new vn(n,i);return this.dispatchEvent(l),l}}return t}var a_=wn();kn.exports={creat_event_cls:$n,E:vn,creat_event_target_cls:wn,ET:a_}});var ti=o((lh,ei)=>{var jn=Gt(),Ve=Ht(),pe=ns(),{ET:Tn}=xn(),__=["_fstch","_lsib","_rsib","_parent","_tree"];function Bn(e){return e._tree!==void 0}function is(e){return e._tree===e}function u_(e){return e._lsib===null}function o_(e){return e._rsib===null}function f_(e){return e._fstch===null}function h_(e){return e.$sibs(!0).length===1}function $t(e){return is(e)||!Bn(e)}function Sn(e){let t=e._fstch,r=t;for(;t!==null;)r=t,t=t._rsib;return r}function En(e,t){let r=0,n=t._fstch;for(;;){if(r===e)return n;if(n===null)return n;n=n._rsib,r=r+1}}function Cn(e,...t){let r=[],n=0,i=e._fstch;for(;;){if(t.includes(n))r.push(i);else if(i===null)return r;i=i._rsib,n=n+1}}function ls(e){let t=[],r=0,n=e._fstch;for(;;){if(n===null)return t;t.push(n),n=n._rsib,r=r+1}}function d_(e){let t=0,r=e._fstch;for(;;){if(r===null)return t;r=r._rsib,t=t+1}}function Yn(e,t=!1){let r=e._rsib,n=e;for(;r!==null;)n=r,r=r._rsib;return t||n!==e?n:null}function vt(e,t=!1){let r=cs(e);if(r===null)return t?e:null;{let n=r._fstch;return t||n!==e?n:null}}function p_(e){let t=vt(e,!1);if(t===null)return null;{let r=t;for(;;){if(r._rsib===e)return r;r=r._rsib}}}function us(e){let t=[],n=vt(e,!0);for(;n!==null;){if(n===e)return t;t.push(n),n=n._rsib}}function Fn(e){let t=[],r=e._rsib;for(;r!==null;)t.push(r),r=r._rsib;return t}function Mn(e,t=!1){let r=us(e),n=Fn(e),i=[e],l;return t?l=r.concat(i,n):l=r.concat(n),l}function g_(e,t){let r=vt(t,!0),n=0;for(;;){if(r===null)return null;if(n==e)return r;r=r._rsib,n=n+1}}function m_(e,...t){return Mn(e,!0).filter((i,l)=>t.includes(l))}function qn(e){return us(e).length}function b_(e,t=!1){return e.$sibs(t).length}function cs(e){return Yn(e,!0)._parent}function y_(e){let t=e,r=e;for(;t!==null;)r=t,t=t.$parent();return r}function $_(e,t){let r=0,n=t;for(;n!==null;){if(r===e)return n;n=n.$parent(),r=r+1}return null}function bt(e,t=!1){let r=[],n=e;for(t&&r.push(n),n=n.$parent();n!==null;)r.push(n),n=n.$parent();return r}function v_(e,...t){return bt(e,!0).filter((i,l)=>t.includes(l))}function w_(e,t=!1){return bt(e,t).length}function k_(e){let t=e.$parent();return t===null?null:t.$lsib()}function x_(e){let t=e.$parent();return t===null?null:t.$rsib()}function T_(e){let t=e.$luncle();return e.$is_fstch()?t===null?null:t.$lstch():null}function S_(e){let t=e.$runcle();return e.$is_lstch()?t===null?null:t.$fstch():null}function E_(e){let r=e.$root().$sdfs(),n=e.$depth();return r.filter(l=>l.$depth()===n)}function C_(e){let t=e.$parent();return t===null?null:t.$breadth()}function q_(e){return e.$lyr().indexOf(e)}function A_(e){let t=e.$sdfs();return t=t.filter(r=>r.$is_leaf()),t.length}function N_(e){let r=e.$root().$edfs(),n;if(e.$is_leaf())n=r.indexOf(e);else{let i=e.$dlmost_des();n=r.indexOf(i)}return r=r.slice(0,n+1),offset=r.filter(i=>i.$is_leaf()).length-1,offset}function An(e,t=!1){let r=Gn(e),n=me(e),i=n.indexOf(r);return t?n.slice(0,i+1):n.slice(1,i+1)}function I_(e){let t=e.$deses(!1),r=t.map(i=>i.$depth()),n=Math.max(...r);return t=t.filter(i=>i.$depth()===n),t}function D_(e,t){let r=t.$depth(),n=t.$deses(!1),i=n.map(l=>l.$depth());return n=n.filter(l=>l.$depth()===r+e),n}function L_(e,...t){let r=e.$depth(),n=t.map(c=>c+r),i=e.$deses(!1),l=i.map(c=>c.$depth());return i=i.filter(c=>n.includes(c.$depth())),i}function as(e,t){if(!$t(t))return console.log("only root or uninited could be prepend"),t;let r=e.$is_leaf();if(t._tree=e._tree,t._lsib=null,r)t._rsib=null,t._parent=e;else{let n=e._fstch;n._lsib=void 0,t._rsib=n,t._parent=void 0}return e._fstch=t,t}function _s(e,t){if(!$t(t))return console.log("only root or uninited could be append"),t;let r=e.$is_leaf();if(t._tree=e._tree,t._rsib=null,r)e._fstch=t,t._lsib=null;else{let n=e.$lstch();n._parent=void 0,n._rsib=t,t._lsib=void 0}return t._parent=e,t}function Wn(e,t){if(!$t(t))return console.log("only root or uninited could be add"),t;if(e.$is_root())return console.log("cant addrsib to root"),e;let r=e.$is_lstch();return t._tree=e._tree,r?(t._parent=e._parent,e._parent=void 0,t._rsib=null):(t._rsib=e._rsib,t._parent=void 0),e._rsib=t,t._lsib=void 0,t}function O_(e,t){if(!$t(t))return console.log("only root or uninited could be add"),t;if(e.$is_root())return console.log("cant addlsib to root"),e;let r=e.$is_fstch();if(t._tree=e._tree,r){let n=e.$parent();e._lsib=void 0,t._lsib=null,n._fstch=t}else{let n=e.$lsib();n._rsib=t,t._lsib=void 0}return t._rsib=e,t._parent=void 0,t}function Nn(e,t,r){let n=ls(t),i=n.length;if(i===0)r=as(t,r);else if(!(e<=i&&e>=0))console.log("not in range!!");else if(e===0)r=as(t,r);else if(e===i)r=_s(t,r);else{let c=n[e-1];r=Wn(c,r)}return r}function R_(e){let t=e.$parent();for(;t!==null;){let r=t.$rsib();if(r!==null)return r;t=t.$parent()}return null}function P_(e){let t=e.$fstch();if(t!==null)return t;{let r=e.$rsib();return r!==null?r:e.$rsib_of_fst_ance_having_rsib()}}function Gn(e){let t=e,r=e.$lstch();for(;r!==null;)t=r,r=r.$lstch();return t}function j_(e){if(e.$is_root())return null;if(e.$is_leaf()){let r=e.$lsib();return r!==null?r:e.$parent()}else{let r=e.$lsib();return r!==null?r.$is_leaf()?r:r.$drmost_des():e.$parent()}}function me(e){let t=e.$depth();if(e===null)return[];{let r=[e];for(e=e.$sdfs_next();e!==null&&e.$depth()>t;)r.push(e),e=e.$sdfs_next();return r}}function B_(e){let t=e,r=e.$fstch();for(;r!==null;)t=r,r=r.$fstch();return t}function Y_(e){let t=e.$rsib();return t===null?e.$parent():t.$dlmost_des()}function F_(e){let t=e.$parent();for(;t!==null;){let r=t.$lsib();if(r!==null)return r;t=t.$parent()}return null}function M_(e){if(e.$is_leaf()){let r=e.$lsib();return r===null?e.$lsib_of_fst_ance_having_lsib():r}else return e.$lstch()}function W_(e){let t=[],r=e.$dlmost_des();for(;r!==null&&(t.push(r),r!==e);)r=r.$edfs_next();return t}function Hn(e){let t=e.$visited;if(e.$is_leaf())if(t){let n=e.$rsib();return n===null?e.$parent():n}else return e.$visited=!0,e;else if(t){let n=e.$rsib();return n===null?e.$parent():n}else return e.$visited=!0,e.$fstch()}function G_(e,t){if(t.$is_leaf()){if(e)return t;{let n=t.$lsib();return n===null?t.$parent():n}}else{if(e)return t.$lstch();{let n=t.$lsib();return n===null?t.$parent():n}}}function H_(e){e.$sdfs().forEach(r=>{delete r.$visited})}function X_(e,t){return t.$visited&&e===t}function In(e){H_(e);let t=[],r=new Set,n=e;for(;!X_(n,e);)r.has(e)?e.$close_at=t.length:(e.$open_at=t.length,r.add(e)),t.push(e),e=Hn(e);return n.$close_at=t.length,t.push(n),t.forEach(i=>{delete i.$visited}),t}function z_(e){return e._fstch=null,e}function dt(e){return e._lsib=null,e._rsib=null,e._parent=null,e}function pt(e){let t=e.$sdfs();return t.forEach(r=>{r._tree=t[0]}),t}function ge(e){if(e.$is_root())return e;if(e.$is_lonely()){let r=e.$parent();z_(r);let n=pt(e);return dt(e),e}else if(e.$is_fstch()){let r=e.$rsib();r._lsib=null;let n=e.$parent();n._fstch=e._rsib;let i=pt(e);return dt(e),e}else if(e.$is_lstch()){let r=e.$lsib();r._rsib=e._rsib,r._parent=e._parent;let n=pt(e);return dt(e),e}else{let r=e.$lsib();r._rsib=e._rsib;let n=pt(e);return dt(e),e}}function Dn(e){let t={};return t._nd=e,t._children=[],t}function Ln(e){let t=[],r=e[0],n=[Dn(r)];for(n[0]._pbreadth=null;n.length>0;){let i=[];for(let c=0;c<n.length;c++){n[c]._breadth=c,n[c]._depth=t.length;let a=n[c]._nd.$children();a=a.map(_=>Dn(_)),a.forEach((_,u)=>{_._pbreadth=n[c]._breadth,n[c]._children.push([t.length+1,i.length+u])}),i=i.concat(a)}let l=n;t.push(l),n=i}return t}function On(e,t="_children"){let r=e._nd,n={};n[t]=[],n.$guid=r.$guid;for(let i in r)Ve.is_cu_property(i)&&(n[i]=r[i]);return n}function U_(e,t="_children"){let r=e[0][0],n=On(r,t),i=[{d:n,ele:r}];for(;i.length>0;){let l=[];for(let c=0;c<i.length;c++){let a=i[c],_=a.d,u=a.ele,g=a.ele._children.map($=>e[$[0]][$[1]]);for(let $=0;$<g.length;$++){let A=g[$],j=On(A,t);_[t].push(j);let Ql={d:j,ele:A};l.push(Ql)}}i=l}return n}function Rn(e,t="_children"){let r=new U;e.$guid!==void 0&&(r.$guid=e.$guid);for(let n in e)Ve.is_cu_property(n)&&t!==n&&(r[n]=e[n]);return r}function J_(e,t="_children"){let r=Rn(e,t),n=[{d:e,nd:r}];for(;n.length>0;){let i=[];for(let l=0;l<n.length;l++){let c=n[l].d,a=n[l].nd,_=c[t]===void 0?[]:c[t];for(let u=0;u<_.length;u++){let f=_[u],g=Rn(f,t);a.$append_child(g);let $={d:f,nd:g};i.push($)}}n=i}return r}function V_(e){let t=["_fstch","_lsib","_rsib","_parent","_tree","$guid","_guid","_id","$open_at","$close_at"];e._fstch=void 0,e._lsib=void 0,e._rsib=void 0,e._parent=void 0,e._tree=void 0,e.$guid=void 0,e._guid=void 0,e._id=void 0,e.$open_at=void 0,e.$close_at=void 0;for(let r of t)Object.defineProperty(e,r,{enumerable:!1})}function K_(e,t,r){let n=e.$depth();return" ".repeat(n)+"["+r.indexOf(e)+"] : "+e.$guid}function Q_(e,t){let r=e.$depth(),n=" ".repeat(r),i="";return t===e.$open_at&&(i=n+"<"+e._id+" : "+e.$guid+">"),t===e.$close_at&&(i=n+"</"+e._id+" : "+e.$guid+">"),i}var Z_=["$fstch","$rsib","$parent"];function eu(e){if(e.$fstch()!==null)return["$fstch"];if(e.$rsib()!==null)return["$rsib"];{let n=[],i=e.$parent();for(;i!==null;)if(n.push("$parent"),i.$rsib()!==null){n.push("$rsib");break}else i=i.$parent();return n}}function tu(e){return e.$sdfs().map(n=>n.$sdfs_next_action_for_srch())}var Xn={$fstch:"$append_child",$rsib:"$add_rsib",$parent:"$parent"};function su(e,t){for(let r=0;r<t.length;r++){let n=Xn[t[r]];e=e[n]()}return e}function ru(e){let t=new U,r=t;for(let n=0;n<e.length;n++){let i=e[n];r=su(r,i)}return t}function nu(e,t,r){if(r&&(t=t.$clone()),!e.$is_root())if(e.$is_lonely()){let n=e.$parent();e.$disconn(),n.$append_child(t)}else if(e.$is_lstch()){let n=e.$lsib();e.$disconn(),n.$add_rsib(t)}else{let n=e.$rsib();e.$disconn(),n.$add_lsib(t)}return t}var D=class{#t=null;#e={with_id:!1,with_et:!1};constructor(t=!1,r=!1){V_(this),this._fstch=null,this.#e.with_id=t,this.#e.with_et=r,t&&(this.$guid=Ve.gen_guid()),r&&(this.#t=new Tn)}get opt(){return this.#e}enable_et(){this.#t=new Tn}disable_et(){this.#t=null}get et(){return this.#t}regis_recv_from_handler(t){let r=function(n){t(n.data.src,n.data.msg)};this.et.addEventListener("$msg__",r)}send_to(t,r){t.et.dispatch("$msg__",{src:this,msg:r})}$is_inited(){return Bn(this)}$is_root(){return is(this)}$is_fstch(){return u_(this)}$is_lstch(){return o_(this)}$is_leaf(){return f_(this)}$is_lonely(){return h_(this)}$fstch(){return this._fstch}$lstch(){return Sn(this)}$which_child(t){return En(t,this)}$some_children(...t){return Cn(this,...t)}$children(){return ls(this)}$children_count(){return d_(this)}$rsib(){return this._rsib}$lsib(){return p_(this)}$fstsib(t=!1){return vt(this,t)}$lstsib(t=!1){return Yn(this,t)}$psibs(){return us(this)}$fsibs(){return Fn(this)}$which_sib(t){return g_(t,this)}$some_sibs(...t){return m_(this,...t)}$sibseq(){return qn(this)}$sibs(t=!1){return Mn(this,t)}$sibs_count(t=!1){return b_(this,t)}$parent(){return cs(this)}$root(){return y_(this)}$ances(t=!1){return bt(this,t)}$which_ance(t){return $_(t,this)}$some_ances(...t){return v_(this,...t)}$ances_count(t=!1){return w_(this,t)}$prepend_child(t){return t=t===void 0?new D(this.#e.with_id,this.#e.with_et):t,as(this,t)}$insert_child(t,r){return r=r===void 0?new D(this.#e.with_id,this.#e.with_et):r,Nn(t,this,r)}$append_child(t){return t=t===void 0?new D(this.#e.with_id,this.#e.with_et):t,_s(this,t)}$clone(){if(is(this)){let t=mt(this);return yt(t)}else{let t=qn(this),r=cs(this);ge(this);let n=mt(this),i=yt(n);return Nn(t,r,this),i}}$append_children(t,r){let n=[];for(let i=0;i<t;i++){let l=r===void 0?new D(this.#e.with_id,this.#e.with_et):r.$clone();l=_s(this,l),n.push(l)}return n}$add_rsib(t){return t=t===void 0?new D(this.#e.with_id,this.#e.with_et):t,Wn(this,t)}$add_lsib(t){return t=t===void 0?new D(this.#e.with_id,this.#e.with_et):t,O_(this,t)}$rsib_of_fst_ance_having_rsib(){return R_(this)}$sdfs_next(){return P_(this)}$drmost_des(){return Gn(this)}$sdfs_prev(){return j_(this)}$sdfs(){return me(this)}$dlmost_des(){return B_(this)}$edfs_next(){return Y_(this)}$lsib_of_fst_ance_having_lsib(){return F_(this)}$edfs_prev(){return M_(this)}$edfs(){return W_(this)}$offset(){return N_(this)}$sedfs_next(){return Hn(this)}$sedfs_prev(t){return G_(this)}$sedfs(){return In(this)}$deses(t=!1){return An(this,t)}$lst_lyr_deses(){return I_(this)}$which_lyr_deses(t){return D_(t,this)}$some_lyrs_deses(...t){return L_(this,...t)}$count(t=!0){return An(this,t).length}$depth(t=!1){return bt(this,t).length}$height(){let t=this.$depth(),n=this.$sdfs().map(l=>l.$depth());return Math.max(...n)-t+1}$pbreadth(){return C_(this)}$breadth(){return q_(this)}$width(){return A_(this)}$lyr(){return E_(this)}$lcin(){return T_(this)}$rcin(){return S_(this)}$luncle(){return k_(this)}$runcle(){return x_(this)}$sdfs_repr(t=K_,r=!1){let n=this.$root(),i=me(n),a=me(this).map((_,u)=>t(_,u,i)).join(`
3
- `);if(console.log(a),r)return a}$sedfs_repr(t=Q_,r=!1){let n=this.$root();zn(n);let c=In(this).map((a,_)=>t(a,_)).join(`
4
- `);if(console.log(c),r)return c}$disconn(){return ge(this)}$rm_fstch(){let t=this._fstch;return ge(t)}$rm_lstch(){let t=Sn(this);return ge(t)}$rm_which(t){let r=En(t,this);return ge(r)}$rm_some_children(...t){return Cn(this,...t).map(n=>ge(n))}$rm_all_children(){return ls(this).map(r=>ge(r))}$dump(){if(this.$is_root())return mt(this);console.log("only root !!!")}$dump2file(t){if(this.$is_root()){let r=mt(this);jn.wjson(t,r)}else console.log("only root !!!")}$sdfs2mat(){return Ln(me(this))}$nest_dict(t="_children"){let r=Ln(me(this));return U_(r,t)}$index(){return this.$sibseq()}$sdfs_index(){return this.$root().$sdfs().indexOf(this)}$sdfs_leafs(){return this.$root().$sdfs().filter(i=>i.$is_leaf())}$sdfs_nonleafs(){return this.$root().$sdfs().filter(i=>!i.$is_leaf())}$sdfs_leaf_index(){return this.$sdfs_leafs().indexOf(this)}$sdfs_nonleaf_index(){return this.$sdfs_nonleafs().indexOf(this)}$sdfs_next_action_for_srch(){return eu(this)}$sdfs_srch_action_list(){return tu(this)}$get_node_with_action(t){let r=this;for(let n=0;n<t.length;n++)r=r[t[n]]();return r}$replace_with(t,r=!0){return nu(this,t,r)}[Symbol.iterator](){return this.$sdfs()[Symbol.iterator]()}get[Symbol.toStringTag](){return this.$guid?this.$guid.substr(0,8):"<empty>"}};Object.defineProperty(D,"name",{value:"\u200D"});function zn(e){let t=me(e);return t.forEach((r,n)=>{r._id=n}),t}function iu(e){let t=new U;return t._id=e._id,t.$guid=e._guid,t}function Pn(e,t){for(;t._id!==e;)t=t._parent;return t}function Je(e,t){let r=Un(t);for(let n of r)e[n]=t[n];return e}function yt(e){let t=Ve.dict_keys(e)[0],r=pe.get_root(e[t],e),n=iu(r);n=Je(n,r);let i=n,l=r,c=pe.get_sdfs_next(l,e),a;for(;c!==null;)if(l._fstch===c._id)a=i.$prepend_child(),a._id=c._id,a.$guid=c._guid,a=Je(a,c),i=a,l=c,c=pe.get_sdfs_next(l,e);else if(l._rsib===c._id)a=i.$add_rsib(),a._id=c._id,a.$guid=c._guid,a=Je(a,c),i=a,l=c,c=pe.get_sdfs_next(l,e);else if(c._parent!==null&&c._parent!==void 0){let _=c._parent;i=Pn(_,i),a=i.$append_child(),a._id=c._id,a.$guid=c._guid,a=Je(a,c),i=a,l=c,c=pe.get_sdfs_next(l,e)}else if(c._parent===void 0){let u=pe.get_parent(c,e)._id;i=Pn(u,i),a=i.$append_child(),a._id=c._id,a.$guid=c._guid,a=Je(a,c),i=a,l=c,c=pe.get_sdfs_next(l,e)}else console.log("Impossible",i,l,c);return n}function gt(e,t){return e[t]===null?null:e[t]===void 0?void 0:e[t]._id}function Un(e){return Ve.dict_keys(e).filter(n=>!__.includes(n))}function lu(e,t){let r=Un(e);for(let n of r)t[n]=e[n];return t}function mt(e){let t=zn(e),r=e._id,n={};return t.forEach((i,l)=>{let c={};c._tree=r,c._fstch=gt(i,"_fstch"),c._lsib=gt(i,"_lsib"),c._rsib=gt(i,"_rsib"),c._parent=gt(i,"_parent"),c._id=i._id,c._guid=i.$guid,c=lu(i,c),n[i._id]=c}),n}var U=class extends D{constructor(t=!0,r=!0){super(t,r),this._fstch=null,this._lsib=null,this._rsib=null,this._parent=null,this._tree=this}$is_parent_of(t){return t.$parent()===this}$is_root_of(t){return t.$root()===this}$is_descendant_of(t){return t.$deses(!1).indexOf(this)>=0}$is_inclusive_descendant_of(t){return t.$deses(!0).indexOf(this)>=0}$is_ancestor_of(t){return t.$ances(!1).indexOf(this)>=0}$is_inclusive_ancestor_of(t){return t.$ances(!0).indexOf(this)>=0}$is_sibling_of(t){return t.$sibs(!1).indexOf(this)>=0}$is_inclusive_siblings_of(t){return t.$sibs(!0).indexOf(this)>=0}$is_preceding_of(t){let r=t.$sdfs(),n=r.indexOf(t),i=r.indexof(this);return i>=0&&i<n}$is_following_of(t){let r=t.$sdfs(),n=r.indexOf(t);return r.indexof(this)>n}$is_first_child_of(t){return this===t.$fstch()}$is_child_of(t){return t.$children().indexOf(this)>=0}$is_last_child_of(t){return this===t.$lstch()}$is_previous_sibling_of(t){return this===t.$lsib()}$is_next_sibling_of(t){return this===t.$rsib()}};Object.defineProperty(U,"name",{value:"\u200D"});function Jn(e){if(typeof e=="string"){let t=jn.rjson(e);return yt(t)}else return typeof e=="object"?yt(e):new U}function cu(e,t="_children"){return J_(e,t)}function au(e){let t=e.$dump();return Jn(ndict)}function os(e,t,...r){let n=t(e,...r);return n=new Buffer.from(n).toString("base64"),n}function Vn(e){let t=e.$ances(!0).map(r=>r.$children().length);return t=t.join("-"),t}function Kn(e){return e.$pbreadth()+"-"+e.$breadth()+"-"+e.$depth()}function Qn(e,t,...r){let n=Vn(e);return t&&(out=os(e,t,...r),n=n+"@"+out),n}function Zn(e,t,...r){let n=Kn(e);return t&&(out=os(e,t,...r),n=n+"@"+out),n}function fs(e,t,r,n,i,...l){let c=r.$sdfs(),a=n.$sdfs();if(c.length!==a.length)return!1;{let _=c.map(f=>t(f,i,...l)),u=a.map(f=>t(f,i,...l));e&&(_.sort(),u.sort());for(let f=0;f<_.length;f++){let g=_[f],$=u[f];if(g!==$)return!1}}return!0}function _u(e,t,r,...n){return fs(!1,Zn,e,t,r,...n)}function uu(e,t,r,...n){return fs(!0,Qn,e,t,r,...n)}ei.exports={SDFS_NEXT_BUILD_ACTION_DICT:Xn,build_from_srch_action_list:ru,SDFS_NEXT_SRCH_ACTIONS:Z_,RESERVED_EVENT_TYPES:["$msg__"],Node:D,Tree:U,Root:U,load:Jn,load_from_nest_dict:cu,clone:au,get_cu_sign:os,get_internal_sign_ignore_order:Vn,get_internal_sign_keep_order:Kn,get_sign_keep_order:Zn,struct_eq:fs,struct_eq_keep_order:_u,get_sign_ignore_order:Qn,struct_eq_ignore_order:uu}});var hs=o((ch,si)=>{var ou=ti(),fu=ns(),hu=Gt();si.exports={ndfunc:fu,ndcls:ou,ndutil:hu}});var xt=o((gh,ni)=>{var E=k(),du=hs(),{Root:pu}=hs().ndcls,{TYPE_DICT:ah,isNode:_h,empty:p,is_bigint_str:uh,is_jsint_str:oh,NUM_TYPE_DICT:fh,parse_abnormal_num:hh,parse_int:dh,parse_float:ph,parse_num:gu,to_str:kt}=k(),L=class extends pu{constructor(t=p){super(!1,!1),this.key=t,this.value=p,this.type=p,this.chtype=p,this.hashes=new Set,this.kcmt=[],this.bvcmt=[],this.avcmt=[]}kto_str(){return this.key===p?p:JSON.stringify(this.key)}is_undefined(){return this.type===E.TYPE_DICT.UndefinedLiteral}is_null(){return this.type===E.TYPE_DICT.NullLiteral}is_boolean(){return this.type>=2&&this.type<=4}is_false(){return this.type===3}is_true(){return this.type===4}is_numerical(){return nd.type>=5&&nd.type<=11}is_int(){return this.type===6}is_float(){return this.type===7}is_bigint(){return this.type===8}is_infi(){return this.type===9||this.type===10}is_pos_infi(){return this.type===9}is_neg_infi(){return this.type===10}is_nan(){return this.type===11}is_str(){return this.type===12}is_ary(){return this.type===13}is_ele(){return this.chtype===14}is_dict(){return this.type===15}is_prop(){return this.chtype===16}is_ref(){return this.type===17}is_leaf(){return!this.is_ary()&&!this.is_dict()}is_cmt(){return this.is_lcmt()||this.is_blcmt()}is_lcmt(){return this.type>=18&&this.type<=22}is_blcmt(){return this.type>=23&&this.type<=27}is_ttcmt(){return this.type===19||this.type===24}is_kcmt(){return this.type===20||this.type===25}is_bvcmt(){return this.type===21||this.type===26}is_avcmt(){return this.type===22||this.type===27}is_prim(){return this.is_leaf()&&!is_cmt()}},ds=class extends L{constructor(t=p){super(t),this.value=void 0,this.type=E.TYPE_DICT.UndefinedLiteral}vto_rawstr(){return kt(this.value)}},ps=class extends L{constructor(t=p){super(t),this.value=null,this.type=E.TYPE_DICT.NullLiteral}vto_rawstr(){return kt(this.value)}},gs=class extends L{constructor(t,r=p){super(r),t==="true"&&(this.value=!0,this.type=E.TYPE_DICT.BooleanLiteral.TrueLiteral),t==="false"&&(this.value=!1,this.type=E.TYPE_DICT.BooleanLiteral.FalseLiteral)}vto_rawstr(){return kt(this.value)}},ms=class extends L{constructor(t,r=p){if(super(r),typeof t=="string"){let n=gu(t,!0);this.value=n.value,this.type=n.type}else this.value=t.value,this.type=t.type}vto_rawstr(){let t=kt(this.value);return this.type===E.TYPE_DICT.NumericLiteral.Float&&!t.includes(".")&&(t=t+"."),t}};function Ke(e){return e=JSON.stringify(e),e.substr(1,e.length-2)}var bs=class extends L{constructor(t,r=p){super(r),this.value=t,this.type=E.TYPE_DICT.StringLiteral}vto_rawstr(){return Ke(this.value)}};function mu(e){e instanceof wt?e.type=E.TYPE_DICT.CommentLine.tt:e.type=E.TYPE_DICT.CommentBlock.tt}function bu(e,t){return{lsib:e.$lsib(),data:t}}function ri(e,t){mu(t);let r=bu(e,t);return e.ttcmt.push(r),r}var ys=class extends L{constructor(t=p){super(t),this.value=[],this.type=E.TYPE_DICT.ArrayExpression._self,this.open=p,this.close=p,this.ttcmt=[]}is_inited(){return this.open===p&&this.close===p}is_opened(){return this.open!==p&&this.close===p}is_closed(){return this.open!==p&&this.close!==p}append_child(t){return t.chtype=E.TYPE_DICT.ArrayExpression.element,t.is_ref()?this.value.push(t.value.value):this.value.push(t.value),this.$append_child(t)}append_ttcmt(t){return ri(this,t)}},$s=class extends L{constructor(t=p){super(t),this.value={},this.type=E.TYPE_DICT.ObjectExpression._self,this.open=p,this.close=p,this.ttcmt=[]}is_inited(){return this.open===p&&this.close===p}is_opened(){return this.open!==p&&this.close===p}is_closed(){return this.open!==p&&this.close!==p}append_child(t){return t.chtype=E.TYPE_DICT.ObjectExpression.property,t.is_ref()?this.value[t.key]=t.value.value:this.value[t.key]=t.value,this.$append_child(t)}append_ttcmt(t){return ri(this,t)}},vs=class extends L{constructor(t,r=p){super(r),this.value=t,this.type=E.TYPE_DICT._Ref}vto_rawstr(){if(this.value.is_leaf())return this.value.vto_rawstr();if(this.value.key!==p)return'&"'+Ke(this.value.key)+'"';for(let t of this.value.hashes)return'&"'+Ke(t)+'"'}},wt=class extends L{constructor(t){super(),this.value=t,this.type=E.TYPE_DICT.CommentLine._self}vto_rawstr(t=`
5
- `){return"//"+Ke(this.value)+t}},ws=class extends L{constructor(t){super(),this.value=t,this.type=E.TYPE_DICT.CommentBlock._self}vto_rawstr(){return"/*"+Ke(this.value)+"*/"}};ni.exports={UndefinedLiteral:ds,NullLiteral:ps,BooleanLiteral:gs,NumericLiteral:ms,StringLiteral:bs,ArrayExpression:ys,ObjectExpression:$s,_Ref:vs,CommentLine:wt,CommentBlock:ws,_ndtree:du}});var oi=o((mh,ui)=>{var{empty:Ts}=k(),{UndefinedLiteral:ii,NullLiteral:li,BooleanLiteral:ci,NumericLiteral:ai,StringLiteral:ks,ArrayExpression:yu,ObjectExpression:$u,CommentLine:vu,CommentBlock:wu,_Ref:xs}=xt();function ku(e,t){let r=Ts,n=e;for(;n!==null;){if(n.key===t){r=n;break}else if(n.hashes.has(t)){r=n;break}else if(n.$sibseq().toString()===t){r=n;break}n=n.$sdfs_prev()}return r!==null?r:Ts}function _i(e,t){return e instanceof ii?new ii("undefined",t):e instanceof li?new li("null",t):e instanceof ci?new ci(e.vto_rawstr(),t):e instanceof ai?new ai(e.vto_rawstr(),t):e instanceof ks?new ks(e.value,t):e instanceof vu||e instanceof wu?new ks(e.value,t):e instanceof yu?new xs(e,t):e instanceof $u?new xs(e,t):e instanceof xs?(e=e.value,_i(e,t)):Ts}ui.exports={find_refnd_with_hash:ku,clone:_i}});var ki=o((bh,be)=>{var xu=Array,Tu=k(),{empty:y,parse0:Su}=k(),Ze=class extends xu{get lst(){return this[this.length-1]}set lst(t){this[this.length-1]=t}get top(){return this[this.length-1]}set top(t){this[this.length-1]=t}get fst(){return this[0]}set fst(t){this[0]=t}get bot(){return this[0]}set bot(t){this[0]=t}*gen_from_lst(){for(let t=this.length-1;t>-1;t--)yield this[t]}};function*Eu(e){for(let t of e)yield t;e=null}function*Cu(e,t){yield*t,yield*e}var et=Wt(),Ss=we(),Ce=Gr(),{UndefinedLiteral:qu,NullLiteral:Au,BooleanLiteral:fi,NumericLiteral:Nu,StringLiteral:hi,CommentLine:Qe,CommentBlock:Iu,ArrayExpression:Es,ObjectExpression:Du}=xt(),H=N(),di=H.gtv,ne=H.STATE_DICT,Cs=H.LEFTED_TYPE,Ee=H.AVND_CACHE_STATE_DICT,G=k(),b=Z(),pi=oi();function*vi(e){for(;e.length>0;)yield e.pop()}function gi(e){let t;return e.__is_sync_mode()?t=et.from_generator(e.g,e.ch_cache.curr):t=et.from_generator(vi(e.unshift_cache),e.ch_cache.curr),t}function mi(e,t,r){e.lefted.type=Cs.quote,e.lefted.data={rslt:t.rslt,lefted:t.ch,state:t.state,quote:r},e.state=H.get_main_eofv_with_code(e.state)}function wi(e,t,r){e.lefted.type=r,e.lefted.data={rslt:t.rslt,lefted:t.ch,state:t.state}}function Lu(e,t,r){return wi(e,t,r),e.state=H.get_lcmt_eofv_with_code(e.state),e}function Ou(e,t,r){return wi(e,t,r),e.state=H.get_blkcmt_eofv_with_code(e.state),e}function Ru(e,t){let r;return e.__is_sync_mode()?r=t(e.g,e.ch_cache.curr):r=t(vi(e.unshift_cache),e.ch_cache.curr),r}function bi(e,t,r,n){let i=Ru(e,r);return i.state!==Ce.STATE_DICT.succ?((t===Qe?Lu:Ou)(e,i,n),y):new t(i.rslt)}function yi(e,t){let r=new t(e.str_cache.k);return e.$set_avnd_cache(r),e.$mv_key_to_nd(r),e.$mv_kcmt_to_kcmt(),e.$mv_bvcmt_to_bvcmt(),r.open=e.ch_cache.curr,e.stack.lst.append_child(r),e.stack.push(r),t===Es?e.state=ne.bv:e.state=ne.bk,e}var qs=Symbol("root_lblk_ch"),$i=Symbol("root_rblk_ch"),qe=class{#t=di(ne.bv);#e=new Ze;constructor(t,r=" "){if(r!==y){let i=Eu(r);t=Cu(t,i)}this.g=t,this.lefted={type:y,data:y},this.ch_cache={tmp:y,curr:y},this.str_cache={k:y,v:y,maybe_vquote:y},this.cmt_cache={kcmt:[],bvcmt:[],avcmt:[]};let n=new Es;this.stack.push(n),n.open=qs,this.avnd_cache={state:Ee.handling,data:n},this.unshift_cache=new Ze,this.mode="sync"}__use_sync_mode(){this.mode="sync"}__use_async_mode(){this.mode="async"}__is_sync_mode(){return this.mode==="sync"}__is_async_mode(){return this.mode==="async"}__unshift_g(t){t=t??this.ch_cache.curr;for(let r of t)this.unshift_cache.unshift(r)}$has_yield_sign(){return this.avnd_cache.state===Ee.handled}$set_yield_sign(){this.avnd_cache.state=Ee.handled}$clear_yield_sign(){this.avnd_cache.state=Ee.handling}get state(){return this.#t}set state(t){this.#t=di(t)}get stack(){return this.#e}$next_ch(){return this.unshift_cache.length>0?this.ch_cache.curr=this.unshift_cache.pop():this.ch_cache.curr=this.g.next().value,this.ch_cache.curr}$is_currch_eof(){return this.ch_cache.curr===void 0}$handle_main_eof(){return this.state=H.get_main_eofv_with_code(this.state),this}$is_currch_comma(){return b.commas.has(this.ch_cache.curr)}$is_currch_colon(){return b.colons.has(this.ch_cache.curr)}$is_currch_ws(){return Ss.is_ws(this.ch_cache.curr)}$is_currch_quote(){return b.quotes.has(this.ch_cache.curr)}$is_currch_slash(){return this.ch_cache.curr===b.slash}$is_currch_asterisk(){return this.ch_cache.curr===b.asterisk}$is_currch_ary_lblk(){return b.array_blks.lhas(this.ch_cache.curr)}$is_currch_obj_lblk(){return b.obj_blks.lhas(this.ch_cache.curr)}$is_currch_lblk(){return this.$is_currch_ary_lblk()||this.$is_currch_obj_lblk()}$is_currch_ary_rblk(){return b.array_blks.rhas(this.ch_cache.curr)}$is_currch_obj_rblk(){return b.obj_blks.rhas(this.ch_cache.curr)}$is_currch_rblk(){return this.$is_currch_ary_rblk()||this.$is_currch_obj_rblk()}$is_currch_hash(){return b.hash===this.ch_cache.curr}$is_currch_ref(){return b.ref===this.ch_cache.curr}$mv_avcmt_to_avcmt(){let t=this.avnd_cache.data;t.avcmt=this.cmt_cache.avcmt,this.cmt_cache.avcmt=[]}$change_state_when_end_av(t=y,r=y){return this.stack.lst.is_ary()?t===y?this.state=ne.bv:(this.state=ne.v,this.str_cache.v=t,r===y||(this.str_cache.maybe_vquote=r)):t===y?this.state=ne.bk:(this.state=ne.k,this.str_cache.k=t),this.state}$vcache_to_nd(){let t=this.str_cache.v,r;if(this.str_cache.maybe_vquote===y){let n=Su(t,{only_value:!1,with_value:!0,with_type:!0,unknown_as_string:!0});n.type===G.TYPE_DICT.UndefinedLiteral?r=new qu(this.str_cache.k):n.type===G.TYPE_DICT.NullLiteral?r=new Au(this.str_cache.k):n.type===G.TYPE_DICT.BooleanLiteral.TrueLiteral?r=new fi("true",this.str_cache.k):n.type===G.TYPE_DICT.BooleanLiteral.FalseLiteral?r=new fi("false",this.str_cache.k):n.type===G.TYPE_DICT.StringLiteral?r=new hi(n.value,this.str_cache.k):r=new Nu(n,this.str_cache.k)}else r=new hi(t,this.str_cache.k);return this.str_cache.v=y,this.str_cache.maybe_vquote=y,r}$mv_kcmt_to_kcmt(){let t=this.avnd_cache.data;t.kcmt=this.cmt_cache.kcmt,this.cmt_cache.kcmt=[]}$mv_bvcmt_to_bvcmt(){let t=this.avnd_cache.data;t.bvcmt=this.cmt_cache.bvcmt,this.cmt_cache.bvcmt=[]}$mv_key_to_nd(){let t=this.avnd_cache.data;return t.key=this.str_cache.k,this.str_cache.k=y,t.key}$set_avnd_cache(t,r=Ee.handling){return this.avnd_cache.data=t,this.avnd_cache.state=r,this.avnd_cache}$setup_leafnd(){let t=this.$vcache_to_nd();this.$set_avnd_cache(t,Ee.handling),this.$mv_key_to_nd(),this.$mv_kcmt_to_kcmt(),this.$mv_bvcmt_to_bvcmt(),this.$mv_avcmt_to_avcmt(),this.stack.lst.append_child(t)}$handle_quote(t){let r=gi(this);return r.state!==et.STATE_DICT.succ?(mi(this,r,t),y):r.rslt}$abandon_key_when_end_bv(){this.cmt_cache.kcmt=[],this.cmt_cache.bvcmt=[],this.str_cache.k=y}$refresh_key(t=y){t===y?this.str_cache.k=this.ch_cache.curr:this.str_cache.k=t,this.cmt_cache.kcmt=[]}$handle_lcmt(){return bi(this,Qe,Ce.lc_from_generator,Cs.lcmt)}$handle_blkcmt(){return bi(this,Iu,Ce.blk_from_generator,Cs.blkcmt)}$push_kcmt(t){t.type=Ce instanceof Qe?G.TYPE_DICT.CommentLine.k:G.TYPE_DICT.CommentBlock.k,this.cmt_cache.kcmt.push(t)}$push_bvcmt(t){let r=t instanceof Qe?"CommentLine":"CommentBlock";t.type=G.TYPE_DICT[r].bv,this.cmt_cache.bvcmt.push(t)}$push_avcmt(t){t.type=Ce instanceof Qe?G.TYPE_DICT.CommentLine.k:G.TYPE_DICT.CommentBlock.k,this.cmt_cache.avcmt.push(t)}$mv_avcmt_to_ttcmt(t){t=t??this.avnd_cache.data.$parent();for(let r of this.cmt_cache.avcmt)t.$append_child(r);this.cmt_cache.avcmt=[]}$open_nonleaf_nd(){if(b.array_blks.lhas(this.ch_cache.curr))return yi(this,Es);if(b.obj_blks.lhas(this.ch_cache.curr))return yi(this,Du)}$is_rblk_match(){let t=this.stack.lst,r=t.is_ary()?"array_blks":"obj_blks";return b[r].getl(this.ch_cache.curr)===t.open}$close_nonleaf_nd(){let t=this.stack.lst;t.close=this.ch_cache.curr,this.$set_avnd_cache(t),this.stack.pop(),this.state=ne.av}$get_hash_or_ref(t="#"){let r=y,n=this.$next_ch(),i="";for(;!Ss.is_ws(n)&&!b.commas.has(n)&&!b.colons.has(n)&&!b.array_blks.has(n)&&!b.obj_blks.has(n)&&n!==b.hash&&n!==b.ref&&n!==b.slash;)if(b.quotes.has(n)){let l=gi(this);if(l.state!==et.STATE_DICT.succ)return mi(this,l,this.ch_cache.curr),t===b.hash?this.state=H.get_hash_quote_eofv_with_code(this.state):this.state=H.get_ref_quote_eofv_with_code(this.state),r;i=i+l.rslt,n=this.$next_ch()}else{if(n===void 0)return $handle_main_eof(),r;i=i+n,n=this.$next_ch()}return this.__unshift_g(n),r=i,r}$is_hash_of_pnd(){return this.stack.lst.$children().length===0}$find_ref(t){let r=this.stack.lst,n=r.$lstch();return n===null&&(n=r),pi.find_refnd_with_hash(n,t)}$add_ref_to_parent(t){let r=this.stack.lst,n=pi.clone(t,this.str_cache.k);this.$set_avnd_cache(n),this.$mv_key_to_nd(n),this.$mv_kcmt_to_kcmt(),this.$mv_bvcmt_to_bvcmt(),r.append_child(n)}};qe[qs]=qs;qe[$i]=$i;qe.MODES=["sync","async"];be.exports=qe;be.exports.Stack=Ze;be.exports._type_util=Tu;be.exports._esc=et;be.exports._cmt=Ce;be.exports._ws=Ss});var Ei=o((yh,Si)=>{var{empty:xi}=k(),Ti=N(),Ae=Ti.gtv,X=Ti.STATE_DICT;function Pu(e){let t=e.state;return t===Ae(X.bk)||(t===Ae(X.k)||t===Ae(X.ak)?(e.str_cache.k=xi,e.state=X.bk):t===Ae(X.bv)?(e.$abandon_key_when_end_bv(),e.stack.lst.is_ary()?e.state=X.bv:e.state=X.bk):t===Ae(X.v)?(e.$setup_leafnd(),e.$change_state_when_end_av()):t===Ae(X.av)&&(e.$mv_avcmt_to_avcmt(),e.$change_state_when_end_av())),e}Si.exports=Pu});var Ai=o((vh,qi)=>{var{empty:$h}=k(),Ci=N(),Ne=Ci.gtv,ie=Ci.STATE_DICT;function ju(e){let t=e.state;return t===Ne(ie.bk)||(t===Ne(ie.k)||t===Ne(ie.ak)?e.state=ie.bv:t===Ne(ie.bv)||(t===Ne(ie.v)?(e.$setup_leafnd(),e.$change_state_when_end_av()):t===Ne(ie.av)&&(e.$mv_avcmt_to_avcmt(),e.$change_state_when_end_av()))),e}qi.exports=ju});var As=o((kh,Ii)=>{var{empty:wh}=k(),Ni=N(),Ie=Ni.gtv,le=Ni.STATE_DICT;function Bu(e){let t=e.state;return t===Ie(le.bk)||(t===Ie(le.k)?e.state=le.ak:t===Ie(le.ak)||t===Ie(le.bv)||(t===Ie(le.v)?(e.$setup_leafnd(),e.state=le.av):Ie(le.av))),e}Ii.exports=Bu});var Ri=o((xh,Oi)=>{var{empty:Di}=k(),Li=N(),De=Li.gtv,J=Li.STATE_DICT;function Yu(e,t){let r=e.state,n=e.$handle_quote(t);return n===Di||(r===De(J.bk)?(e.str_cache.k=n,e.state=J.k):r===De(J.k)?e.str_cache.k=e.str_cache.k+n:r===De(J.ak)?(e.$refresh_key(n),e.state=J.k):r===De(J.bv)?(e.str_cache.maybe_vquote=t,e.str_cache.v=n,e.state=J.v):r===De(J.v)?(e.str_cache.v=e.str_cache.v+n,e.str_cache.maybe_vquote=Di):r===De(J.av)&&(e.$mv_avcmt_to_avcmt(),e.$change_state_when_end_av(n,t))),e}Oi.exports=Yu});var Yi=o((Th,Bi)=>{var{empty:Pi}=k(),Ns=N(),O=Ns.gtv,T=Ns.STATE_DICT,Fu=Ns.LEFTED_TYPE,ye=Z();function ji(e,t){let r=e.state,n=e[t]();if(n!==Pi){let i=e.stack.lst;if(r===O(T.bk))i.append_ttcmt(n);else if(r===O(T.k))e.$push_kcmt(n),e.state=T.ak;else if(r===O(T.ak))e.$push_kcmt(n);else if(r===O(T.bv))i.is_ary()?i.append_ttcmt(n):i.is_dict()&&e.$push_bvcmt(n);else if(r===O(T.v))e.$setup_leafnd(),e.state=T.av;else if(r===O(T.av)){let l=e.stack.lst;l.is_ary()?(l.append_ttcmt(n),e.state=T.bv):l.is_dict()&&e.$push_avcmt(n)}}return e}function Mu(e){return ji(e,"$handle_lcmt")}function Wu(e){return ji(e,"$handle_blkcmt")}function Gu(e){let t=e.state;t===O(T.bk)?(e.__unshift_g(e.ch_cache.curr),e.str_cache.k=ye.slash,e.state=T.k):t===O(T.k)?(e.__unshift_g(e.ch_cache.curr),e.str_cache.k=e.str_cache.k+ye.slash):t===O(T.ak)?(e.__unshift_g(e.ch_cache.curr),e.$refresh_key(ye.slash),e.state=T.k):t===O(T.bv)?(e.__unshift_g(e.ch_cache.curr),e.str_cache.v=ye.slash,e.state=T.v):t===O(T.v)?(e.__unshift_g(e.ch_cache.curr),e.str_cache.v=e.str_cache.v+ye.slash,e.str_cache.maybe_vquote=Pi):t===O(T.av)&&(e.$mv_avcmt_to_avcmt(),e.$change_state_when_end_av(ye.slash))}function Hu(e){let t=e.state,r=e.$next_ch();return e.$is_currch_eof()?(e.lefted.data=ye.slash,e.lefted.type=Fu.backslash,e.$handle_main_eof()):e.$is_currch_slash()?Mu(e):e.$is_currch_asterisk()?Wu(e):Gu(e),e}Bi.exports=Hu});var Wi=o((Eh,Mi)=>{var{empty:Sh}=k(),Fi=N(),Le=Fi.gtv,ce=Fi.STATE_DICT;function Xu(e){let t=e.state;return t===Le(ce.bk)?(e.str_cache.k=e.ch_cache.curr,e.state=ce.k):t===Le(ce.k)?e.str_cache.k=e.str_cache.k+e.ch_cache.curr:t===Le(ce.ak)?(e.$refresh_key(),e.state=ce.k):t===Le(ce.bv)?e.$open_nonleaf_nd():t===Le(ce.v)?(e.$setup_leafnd(),e.$change_state_when_end_av(),e.__unshift_g(e.ch_cache.curr)):t===Le(ce.av)&&(e.$mv_avcmt_to_avcmt(),e.$change_state_when_end_av(),e.__unshift_g(e.ch_cache.curr)),e}Mi.exports=Xu});var zi=o((Ch,Xi)=>{var{empty:Gi}=k(),Hi=N(),Oe=Hi.gtv,$e=Hi.STATE_DICT,zu=As();function Uu(e){let t=e.state;return t===Oe($e.bk)?e.$close_nonleaf_nd():t===Oe($e.k)?(e.str_cache.k=Gi,e.$close_nonleaf_nd()):t===Oe($e.ak)?(e.$refresh_key(),e.str_cache.k=Gi,e.$close_nonleaf_nd()):t===Oe($e.bv)?(e.$abandon_key_when_end_bv(),e.$close_nonleaf_nd()):t===Oe($e.v)?(e.$setup_leafnd(),e.state=$e.av,e.__unshift_g(e.ch_cache.curr)):t===Oe($e.av)&&(e.$has_yield_sign()?(e.$clear_yield_sign(),e.$close_nonleaf_nd()):(e.$mv_avcmt_to_avcmt(),e.$set_yield_sign(),e.__unshift_g(e.ch_cache.curr))),e}function Ju(e){return e.$is_rblk_match()?Uu(e):zu(e),e}Xi.exports=Ju});var Ki=o((qh,Vi)=>{var{empty:Vu}=k(),Ji=N(),Re=Ji.gtv,ae=Ji.STATE_DICT,Ku=Z(),{CommentLine:Ui}=xt();function Qu(e){let t=e.state,r=e.$get_hash_or_ref(Ku.hash);if(r!==Vu){let n=e.stack.lst;if(t===Re(ae.bk))e.$is_hash_of_pnd()&&n.hashes.add(r);else if(t===Re(ae.k)){let i=new Ui(r);e.$push_kcmt(i),e.state=ae.ak}else if(t===Re(ae.ak)){let i=new Ui(r);e.$push_kcmt(i)}else t===Re(ae.bv)?e.$is_hash_of_pnd()&&n.is_ary()&&n.hashes.add(r):t===Re(ae.v)?(e.$setup_leafnd(),e.avnd_cache.data.hashes.add(r),e.state=ae.av):t===Re(ae.av)&&e.avnd_cache.data.hashes.add(r)}return e}Vi.exports=Qu});var el=o((Ah,Zi)=>{var{empty:Is}=k(),Qi=N(),Pe=Qi.gtv,I=Qi.STATE_DICT,Zu=Z();function eo(e){let t=e.state,r=e.$get_hash_or_ref(Zu.ref);if(r!==Is){let n=e.$find_ref(r);if(n!==Is){let i=e.stack.lst;t===Pe(I.bk)||t===Pe(I.k)||t===Pe(I.ak)?(e.$refresh_key(n.vto_rawstr()),e.state=I.ak):t===Pe(I.bv)?(e.$add_ref_to_parent(n),e.state=I.av):t===Pe(I.v)?(e.str_cache.maybe_vquote=Is,e.$setup_leafnd(),e.state=I.av):t===Pe(I.av)&&(e.$has_yield_sign()?(e.$clear_yield_sign(),i.is_ary()?(e.$add_ref_to_parent(n),e.state=I.av):i.is_dict()&&(e.str_cache.k=n.vto_rawstr(),e.state=I.ak)):(e.$mv_avcmt_to_avcmt(),e.$set_yield_sign()))}}return e}Zi.exports=eo});var rl=o((Nh,sl)=>{var{empty:to}=k(),tl=N(),je=tl.gtv,V=tl.STATE_DICT;function so(e){let t=e.state;return t===je(V.bk)?(e.str_cache.k=e.ch_cache.curr,e.state=V.k):t===je(V.k)?e.str_cache.k=e.str_cache.k+e.ch_cache.curr:t===je(V.ak)?(e.$refresh_key(),e.state=V.k):t===je(V.bv)?(e.str_cache.v=e.ch_cache.curr,e.state=V.v):t===je(V.v)?(e.str_cache.v=e.str_cache.v+e.ch_cache.curr,e.str_cache.maybe_vquote=to):t===je(V.av)&&(e.$mv_avcmt_to_avcmt(),e.$change_state_when_end_av(),e.__unshift_g(e.ch_cache.curr)),e}sl.exports=so});var al=o((Ih,cl)=>{var{empty:ro}=k(),no=ki(),io=Ei(),lo=Ai(),co=As(),ao=Ri(),_o=Yi(),uo=Wi(),oo=zi(),fo=Ki(),ho=el(),po=rl(),ll=N(),nl=ll.gtv,il=ll.STATE_DICT,go=Z();function*mo(e,t=ro){let r=new no(e,t);for(;;)if(r.$next_ch(),r.$is_currch_eof()){r.$handle_main_eof(),yield r;break}else r.$is_currch_comma()?(io(r),yield r):r.$is_currch_colon()?(lo(r),yield r):r.$is_currch_ws()?(co(r),yield r):r.$is_currch_quote()?(ao(r,r.ch_cache.curr),yield r):r.$is_currch_slash()?(_o(r),yield r):r.$is_currch_lblk()?(uo(r),yield r):r.$is_currch_rblk()?(oo(r),yield r):r.$is_currch_hash()?(fo(r),yield r):r.$is_currch_ref()?r.state===nl(il.av)||r.state===nl(il.v)?r.__unshift_g(go.fst_comma+r.ch_cache.curr):(ho(r),yield r):(po(r),yield r)}cl.exports=mo});var hl=o((Dh,fl)=>{var{sync_gen_from_str:Ds}=vr(),{is_should_yield:Ls}=N(),P=Z(),{is_nl:bo,is_ws:_l}=we(),Os=al(),yo={enable_ref:!1,encoding:"utf8"};function ul(e,t={enable_ref:!1}){let r=Os(e),n=r.next().value,i=n.avnd_cache.data.$root(),l=n.state;for(let c of r){let a=c.state;if(Ls(n,l,a)&&!t.enable_ref){let _=n.avnd_cache.data;_.$disconn(),_=null}l=a}return i}function $o(e,t={enable_ref:!1}){let r=Ds(e);return ul(r,t)}function*ol(e,t={enable_ref:!1,encoding:"utf8"}){let r=Os(e),n=r.next().value,i=n.state;for(let l of r){let c=l.state;if(Ls(n,i,c)&&!t.enable_ref){let a=n.avnd_cache.data;yield a,a.$disconn(),a=null}i=c}}function*vo(e,t={enable_ref:!1,encoding:"utf8"}){let r=Ds(e);yield*ol(r,t)}function wo(){return{d:void 0,ppg:void 0,prev:void 0,curr:void 0,can_send:!1,data:"",state:"init",label:"",pstate:""}}function ko(e){let t=Ds(""),r=Os(t," "),n=r.next().value;n.__use_async_mode();let i=wo();return i.rt=n.avnd_cache.data,i.prev=n.state,i.ppg=r,i.d=n,i}function xo(e,t){return e.data=e.data+t,e.state==="init"?t===P.slash?e.state="slash":P.quotes.has(t)?(e.label=t,e.state="quote"):t===P.hash?e.state="hash":t===P.ref?e.state="ref":e.can_send=!0:e.state==="quote"?t==="\\"?(e.state="esc",e.pstate="quote"):t===e.label&&(e.pstate!==""?(e.state=e.pstate,e.pstate=""):e.can_send=!0):e.state==="slash"?t===P.slash?e.state="lcmt":t===P.asterisk?e.state="blkcmt":P.quotes.has(t)?(e.label=t,e.state="quote"):e.can_send=!0:e.state==="lcmt"?t==="\\"?(e.state="esc",e.pstate="lcmt"):bo(t)&&(e.can_send=!0):e.state==="blkcmt"?t==="\\"?(e.state="esc",e.pstate="blkcmt"):t===P.asterisk&&(e.state="asterisk"):e.state==="asterisk"?t==="\\"?(e.state="esc",e.pstate="blkcmt"):t===P.slash&&(e.can_send=!0):e.state==="hash"?_l(t)?e.can_send=!0:P.quotes.has(t)&&(e.state="quote",e.pstate="hash"):e.state==="ref"?_l(t)?e.can_send=!0:P.quotes.has(t)&&(e.state="quote",e.pstate="ref"):e.state==="esc"?(e.state=e.pstate,e.pstate=""):console.log("impossible"),e}async function*To(e,t){for(let r of e)xo(t,r),t.can_send&&(yield t,t.data="",t.state="init",t.label="",t.can_send=!1)}async function*So(e){let t=ko(e);for await(let r of e)yield*To(r,t);yield t}function Eo(e){let t=e.d.unshift_cache;t.forEach(r=>{e.prev=e.curr,e.d=e.ppg.next().value,e.curr=e.d.state}),t=null}async function*Co(e,t){if(e.d.__unshift_g(e.data),e.prev=e.curr,e.d=e.ppg.next().value,e.curr=e.d.state,Ls(e.d,e.prev,e.curr)&&!t.enable_ref){let r=e.d.avnd_cache.data;yield r,r.$disconn(),r=null}}async function*qo(e,t={enable_ref:!1,encoding:"utf8"}){e=So(e);let r;for await(r of e)Eo(r),yield*Co(r,t);yield r.rt}fl.exports={OPT_DICT:yo,parse_from_generator:ul,parse_from_str:$o,gen_from_generator:ol,gen_from_str:vo,agen_from_generator:qo}});var Tt=o((Lh,st)=>{var{empty:Ao}=k(),No=Z(),tt=hl();function Rs(e){return e.length===1?e[0]:e}function Io(){for(let e in tt){let t;e.startsWith("gen_")?t=function*(r,n={enable_ref:!1,encoding:"utf8"}){let i=tt[e](r,n);for(let l of i)l=Rs(l),yield[l.key,l.value]}:e.startsWith("agen_")?t=async function*(r,n={enable_ref:!1,encoding:"utf8"}){let i=tt[e](r,n);for await(let l of i)l=Rs(l),yield[l.key,l.value]}:t=function(r,n={enable_ref:!1,encoding:"utf8"}){let i=tt[e](r,n).value;return Rs(i)},Object.defineProperty(t,"name",{value:e}),st.exports[e]=t}st.exports.OPT_DICT=tt.OPT_DICT}Io();st.exports.CFG=No;st.exports.empty=Ao});var Be=o((Oh,dl)=>{var Do=e=>e.constructor.name==="AsyncFunction",Lo=e=>typeof e!="string"||(e=e.trim(),e==="")?!1:!!(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("ws://")||e.startsWith("wss://")||e.startsWith("//")||e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||/^(data|blob|file|wasm):/i.test(e)),Oo=e=>e.startsWith("http://")||e.startsWith("https://")||e.startsWith("ws://")||e.startsWith("wss://")||/^(data|blob|file|wasm):/i.test(e)?e:e.startsWith("//")||e.startsWith("/")||e.startsWith("./")||e.startsWith("../")?e.startsWith("//")?window.location.protocol+e:e.startsWith("/")?window.location.origin+e:new URL(e,window.location.href).href:e,Ro=()=>new Date().toISOString().replace(/[:.]/g,"-"),Po=/^(.*?)=["]?(.*)["]?$/,jo=(e=document.cookie)=>{let t=e.split("; "),r={};for(let n of t){let i=Po.exec(n);r[i[1]]=i[2]}return r};dl.exports={is_async:Do,is_url:Lo,fullfill_url:Oo,creat_dt_prefix:Ro,get_ck:jo}});var Ps=o((Rh,ml)=>{var{is_async:_e}=Be(),Bo=e=>{let t=0;for(;e&&e.parentNode;)e=e.parentNode,t++;return t},Yo=(e,t)=>{if(t>0){let r=1;for(;;){let n=e.parentNode;if(r===t)return n;e=n,++r}}else return e},Fo=e=>{for(;e.parentNode;)e=e.parentNode;return e},K=e=>e.firstChild===null||e.firstChild===void 0,St=(e,t=K)=>{let r=0;for(;!t(e);)e=e.lastChild,++r;return[e,r]},Et=(e,t=K)=>{let r=0;for(;!t(e);)e=e.firstChild,++r;return[e,r]},pl=(e,t)=>{if(e.nextSibling)return[e.nextSibling,t];let r=e.parentNode,n=t;for(;r;){if(n-=1,r.nextSibling)return[r.nextSibling,n];r=r.parentNode}return[null,-1]},Mo=async(e,t=(n,i)=>{},r=K)=>{let[n,i]=St(e,r),l=e,c=_e(t),a=0;for(;;){let _=!1;if(c?_=await t(l,a):_=t(l,a),_||l===n)return;if(!r(l))++a,l=l.firstChild;else{let u=pl(l,a);if(l=u[0],l)a=u[1];else break}}},gl=(e,t)=>{if(e.prevSibling)return[e.prevSibling,t];let r=e.parentNode,n=t;for(;r;){if(n-=1,r.prevSibling)return[r.prevSibling,n];r=r.parentNode}return[null,-1]},Wo=async(e,t=(n,i)=>{},r=K)=>{let[n,i]=Et(e,r),l=e,c=_e(t),a=0;for(;;){let _=!1;if(c?_=await t(l,a):_=t(l,a),_||l===n)return;if(!r(l))++a,l=l.lastChild;else{let u=gl(l,a);if(l=u[0],l)a=u[1];else break}}},Go=async(e,t=(n,i)=>{},r=K)=>{let[n,i]=Et(e,r),l=_e(t);for(;;){let c=!1;if(l?c=await t(n,i):c=t(n,i),c||n===e)return;{let a=n.nextSibling;if(a){let _=Et(a,r);i+=_[1],n=_[0]}else{let _=n.parentNode;if(_)--i,n=_;else break}}}},Ho=async(e,t=(n,i)=>{},r=K)=>{let[n,i]=St(e,r),l=_e(t);for(;;){let c=!1;if(l?c=await t(n,i):c=t(n,i),c||n===e)return;{let a=n.prevSibling;if(a){let _=St(a,r);i+=_[1],n=_[0]}else{let _=n.parentNode;if(_)--i,n=_;else break}}}},Xo=async(e,t=(i,l)=>{},r=(i,l)=>{},n=K)=>{let i=e,l="open",c={open:[r,_e(r)],clos:[t,_e(t)]},a=0;for(;;){let _=!1,[u,f]=c[l];if(l==="open"){if(f?_=await u(i,a):_=u(i,a),_)return;n(i)?l="clos":(i=i.firstChild,++a)}else{let g,$,A,j=i.nextSibling;if(j?(A="open",g=j,$=a):(A="clos",g=i.parentNode,$=a-1),f?_=await u(i,a):_=u(i,a),_)return;if(i!==e)l=A,i=g,a=$;else break}}},zo=async(e,t=(i,l)=>{},r=(i,l)=>{},n=K)=>{let i=e,l="open",c={open:[r,_e(r)],clos:[t,_e(t)]},a=0;for(;;){let _=!1,[u,f]=c[l];if(l==="open"){if(f?_=await u(i,a):_=u(i,a),_)return;n(i)?l="clos":(i=i.lastChild,++a)}else{let g,$,A,j=i.prevSibling;if(j?(A="open",g=j,$=a):(A="clos",g=i.parentNode,$=a-1),f?_=await u(i,a):_=u(i,a),_)return;if(i!==e)l=A,i=g,a=$;else break}}};ml.exports={get_depth:Bo,get_ance:Yo,get_rt:Fo,is_topo_leaf:K,get_drmost:St,get_dlmost:Et,find_rb_of_fst_ance_has_rb:pl,editonly_sdfs_for_each:Mo,find_lb_of_fst_ance_has_lb:gl,editonly_rsdfs_for_each:Wo,editonly_edfs_for_each:Go,editonly_redfs_for_each:Ho,visit:Xo,rvisit:zo}});var yl=o((Ph,bl)=>{var Uo=new Set(["html","head","body","title","meta","link","base","style","header","footer","nav","main","section","article","aside","h1","h2","h3","h4","h5","h6","address","p","hr","pre","blockquote","ol","ul","li","dl","dt","dd","figure","figcaption","div","a","em","strong","small","s","cite","q","dfn","abbr","ruby","rt","rp","data","time","code","var","samp","kbd","sub","sup","i","b","u","mark","bdi","bdo","span","br","wbr","ins","del","img","iframe","embed","object","param","video","audio","source","track","picture","map","area","canvas","svg","table","caption","colgroup","col","thead","tbody","tfoot","tr","th","td","form","label","input","button","select","datalist","optgroup","option","textarea","output","progress","meter","fieldset","legend","details","summary","dialog","script","noscript","template","slot"]),Jo=new Set(["class","rel","sandbox","allow","headers","aria-describedby","aria-labelledby"]);bl.exports={TAGS:Uo,NEED_TO_SP_ATTR_NMS:Jo}});var Tl=o((jh,xl)=>{var{TAGS:Vo,NEED_TO_SP_ATTR_NMS:Ko}=yl(),{is_url:$l,fullfill_url:Qo}=Be(),{editonly_sdfs_for_each:q,is_topo_leaf:Bs}=Ps(),vl=(e,t)=>{let r=[e];for(let n of t){let i=[];for(let l of r){let c=l.children;for(let a=0;a<c.length;a++){let _=c[a];_.tagName.toLowerCase()===n&&i.push(_)}}if(i.length===0)return[];r=i}return r},wl=(e,t)=>{let r=[],n=t.length;function i(l,c){let a=c;l.nodeType===1&&l.tagName.toLowerCase()===t[c]&&(a=c+1,a===n&&r.push(l));let _=l.children;if(_)for(let u=0;u<_.length;u++)i(_[u],a)}return i(e,0),r},js=async(e,t,r=Bs)=>{let n=[];return await q(e,async(i,l)=>{if(i.tagName){if(t.test(i.tagName))n.push(i);else if(i.attributes){for(let c of i.attributes)if(t.test(c.name)){n.push(i);break}}}},r),n},Zo=async(e,t=Bs)=>{let r=new Set,n=new Set,i=new Set,l=new Set,c=new Set;return await q(e,async(a,_)=>{if(a.nodeType===Node.ELEMENT_NODE){if(r.add(a.tagName.toLowerCase()),a.attributes)for(let u of a.attributes)if(n.add(u.name.toLowerCase()),Ko.has(u.name.toLowerCase())){let f=u.value.split(/[ ]+/g);for(let g of f)i.add(g)}else i.add(u.value)}else a.nodeType===Node.TEXT_NODE?l.add(a.nodeValue):a.nodeType===Node.COMMENT_NODE&&c.add(a.nodeValue)},t),{tags:Array.from(r),keys:Array.from(n),vals:Array.from(i),txts:Array.from(l),cmts:Array.from(c)}},kl=async(e,t,r=Bs)=>{if(typeof t=="string")if(t[0]==="#"){let n=[];return await q(e,async(i,l)=>{if(i.tagName){let c=t.slice(1),a=i.getAttribute("id");c===a&&n.push(i)}},r),n}else if(t[0]==="."){let n=[];return await q(e,async(i,l)=>{if(i.tagName){let c=t.slice(1);i.getAttribute("class").split(/[ ]+/g).map(_=>_.toLowerCase()).includes(c)&&n.push(i)}},r),n}else if(t[0]==="`"){let n=[];return await q(e,async(i,l)=>{if(i.nodeType===Node.TEXT_NODE){let c=t.slice(1);node.nodeValue.includes(c)&&n.push(i)}},r),n}else if(t[0]==="!"){let n=[];return await q(e,async(i,l)=>{if(i.nodeType===Node.ELEMENT_NODE&&typeof i.click=="function"){let c=i.tagName.toLowerCase();["html","head","meta","link","style","script"].includes(c)||c.includes(t.slice(1).toLowerCase())&&n.push(i)}},r),n}else if(t[0]==="@"){let n=[];return await q(e,async(i,l)=>{if(i.tagName&&i.attributes)for(let c of i.attributes){let _=c.value.split(/[ ]+/g),u=t.slice(1);for(let f of _)if($l(f)&&f.includes(u)){n.push(i);break}}},r),n}else if(t[0]==="-"){let n={};return await q(e,async(i,l)=>{if(i.tagName&&i.attributes){for(let c of i.attributes)if(c.name.startsWith("data-")){let a=c.name.slice(5);if(a.includes(t.slice(1))){let _=c.value;try{_=JSON.parse(_)}catch{}n[a]?n[a].push(_):n[a]=[_]}}}},r),n}else{if(t[0]==="*")return Zo(e,r);if(t[0]==="&"){let n=[];return await q(e,async(i,l)=>{if(i.tagName&&i.attributes)for(let c of i.attributes){let _=c.value.split(/[ ]+/g),u=t.slice(1);for(let f of _)$l(f)&&f.includes(u)&&n.push(Qo(f))}},r),n}else if(t.slice(0,2)==="//"){let n=[];return await q(e,async(i,l)=>{if(i.nodeType===Node.COMMENT_NODE){let c=t.slice(2);node.nodeValue.toLowerCase().includes(c.toLowerCase())&&n.push(i)}},r),n}else if(t.slice(0,2)==="?:"){let n=[];return await q(e,async(i,l)=>{if(i.tagName&&i.attributes){for(let c of i.attributes)if(t.slice(2).toLowerCase()===c.name.toLowerCase()){n.push(i);break}}},r),n}else if(t.slice(0,2)===":?"){let n=[];return await q(e,async(i,l)=>{if(i.tagName&&i.attributes){for(let c of i.attributes)if(c.value.includes(t.slice(2))){n.push(i);break}}},r),n}else if(t[0]==="/"){let n=t.split("/").filter(l=>l!==""),i=vl(document,n);return i.length===0?await js(e,new RegExp(t),r):i}else if(t.includes("/")){let n=t.split("/").filter(i=>i!=="");return wl(document,n)}else{let n=[];return await q(e,async(i,l)=>{(i.tagName?i.tagName.toLowerCase()===t.toLowerCase():!1)&&n.push(i)},r),n}}else{if(t instanceof RegExp)return await js(e,t,r);{let n=[];return is_async(t)?await q(e,async(i,l)=>{await t(i,l)&&n.push(i)},r):await q(e,async(i,l)=>{t(i,l)&&n.push(i)},r),n}}},ef=new Proxy(document,{get(e,t,r){return Vo.has(t.toLowerCase())||t[0]==="*"||t[0]==="&"||t[0]==="-"||t[0]==="#"||t[0]==="."||t[0]==="?"||t[0]===":"||t[0]==="@"||t[0]==="!"||t.includes("/")?kl(document,t):Reflect.get(e,t,r)}});xl.exports={plget:vl,plinget:wl,filter_on_tag_or_attr_key_with_rgx:js,filter:kl,$:ef}});var Ct=o((Bh,Sl)=>{var tf=Tt(),sf=(e,t=!1)=>{let r=e.split("-");for(let n=1;n<r.length;++n)r[n]=r[n].charAt(0).toUpperCase()+r[n].slice(1);return t&&(r[0]=r[0].charAt(0).toUpperCase()+r[0].slice(1)),r.join("")},rf=e=>e.replace(/-/g,"_"),nf=(e,t)=>typeof e=="string"?(e=e.trim().toLowerCase(),e==="false"||e==="0"||e==="no"||e==="off"||e==="fls"||e==="f"||e==="null"||e==="nul"||e==="none"||e==="nu"||e==="n"?!1:e==="true"||e==="1"||e==="yes"||e==="on"||e==="tru"||e==="t"||e==="y"?!0:e===""||e==="undefined"||e==="un"||e==="default"||e==="dflt"?!!t:!!e):e===void 0?!!t:!!e,lf=e=>{let t=e.replace(/[^0-9.-]/g,"");return parseFloat(t)},cf=e=>tf.parse_from_str(e+" ");Sl.exports={dash_to_camel:sf,dash_to_snake:rf,attr_value_to_bool:nf,css_str_to_num:lf,parse_json_input:cf}});var Nl=o((Yh,Al)=>{var El=()=>new Promise(e=>{requestAnimationFrame(()=>{e()})}),af=async e=>{for(let t=0;t<e;++t)await El()},_f=async(e=0)=>new Promise(t=>{setTimeout(()=>{t()},e)}),qt=class{timers={};run(t,r,n=300){this.timers[t]&&clearTimeout(this.timers[t]),this.timers[t]=setTimeout(async()=>{await r(),delete this.timers[t]},n)}cancel(t){this.timers[t]&&(clearTimeout(this.timers[t]),delete this.timers[t])}},Cl=()=>new qt,ql=Cl(),uf=(e,t,r=300)=>{ql.run(e,t,r)},of=e=>{ql.cancel(e)};Al.exports={wait_for_layout_ready:El,wait_for_n_raf:af,wait:_f,SimpleDebounce:qt,creat_simple_debounce:Cl,simple_debounce:uf,cancel_simple_debounce:of}});var Ll=o((Fh,Dl)=>{var{dash_to_camel:At}=Ct(),Il=(e,t,r=!1)=>{let n=At(t,r)+"Element";e.constructor.prototype.hasOwnProperty(n)||Object.defineProperty(e.constructor.prototype,n,{get:function(){let i=this.shadowRoot;return i?i.querySelector(`.${t}`):null}})},ff=(e,t)=>{for(let r of t)Il(e,r,!1)},hf=e=>{for(let t in DYN_CLSES){{let n="all"+At(t,!0)+"Elements";e.constructor.prototype.hasOwnProperty(n)||Object.defineProperty(e.constructor.prototype,n,{get:function(){let i=this.shadowRoot;return i?i.querySelectorAll(`.${t}`):null}})}let r=DYN_CLSES[t];for(let n of r){let i=At(n,!0),l="get"+At(t,!0)+"ElementBy"+i;e.constructor.prototype.hasOwnProperty(l)||(e.constructor.prototype[l]=function(c){let a=this.shadowRoot;return a?a.querySelector(`.${t}[${n}="${c}"]`):null})}}};Dl.exports={add_one_fixed_element_getter:Il,add_fixed_element_getters:ff,add_dyn_element_getters:hf}});var Rl=o((Mh,Ol)=>{var df=Tt(),{dash_to_snake:pf,css_str_to_num:gf}=Ct(),mf=(e,t)=>{let r=Object.keys(t);for(let n of ATTRS_KEYS){let i=pf(n),l=t[n],c=l.type;e.prototype.hasOwnProperty(i)||(c==="boolean"?Object.defineProperty(e.prototype,i,{get:function(){return attr_value_to_bool(this.getAttribute(n),l.default)},set:function(a){this.setAttribute(n,a?"true":"false")}}):c==="number"?Object.defineProperty(e.prototype,i,{get:function(){let a=this.getAttribute(n);return a?Number(a):l.default},set:function(a){this.setAttribute(n,String(a))}}):Array.isArray(c)&&c.includes("cssnum")&&c.includes("number")?Object.defineProperty(e.prototype,i,{get:function(){return gf(this.getAttribute(n))},set:function(a){isNaN(Number(a))?this.setAttribute(n,a):this.setAttribute(n,String(a)+"px")}}):c==="json"?Object.defineProperty(e.prototype,i,{get:function(){let a=this.getAttribute(n);return a?df.parse_from_str(a):l.default},set:function(a){this.setAttribute(n,JSON.stringify(a))}}):Object.defineProperty(e.prototype,i,{get:function(){return this.getAttribute(n)||l.default},set:function(a){this.setAttribute(n,a)}}))}};Ol.exports={add_attr_accessors_to_cls:mf}});var jl=o((Wh,Pl)=>{var Ys=class{css=`
1
+ var nvbasicbw=(()=>{var f=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var x=f((nh,ar)=>{var ia=Symbol("empty"),Me=Symbol("unknown"),Ks=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Qs=/^[\-\+]?[0-9]+$/,Zs=/^\+?[0-9]+$/,la=/^[\-\+]?0[bB][0-1]+$/,aa=/^[\-\+]?0[oO][0-7]+$/,er=/^[\-\+]?0[xX][0-9a-fA-F]+$/,ca=e=>Qs.test(e)||er.test(e),zs={"0b":2,"0o":8,"0x":16,2:"0b",8:"0o",16:"0x"},oa=/^[\-\+]?[0-9]+n$/,ua=/^[\-\+]?0[bB][0-1]+n$/,_a=/^[\-\+]?0[oO][0-7]+n$/,fa=/^[\-\+]?0[xX][0-9a-fA-F]+n$/,tr=e=>oa.test(e)||ua.test(e)||_a.test(e)||fa.test(e),ue={Integer:6,Float:7,BigInt:8,PosInfinity:9,NegInfinity:10,NaN:11,6:"Integer",7:"Float",8:"BigInt",9:"PosInfinity",10:"NegInfinity",11:"NaN"},sr=(e,t=!1)=>{let r={value:void 0,type:void 0};return e==="+Infinity"||e==="Infinity"?(r.value=1/0,r.type=ue.PosInfinity):e==="-Infinity"?(r.value=-1/0,r.type=ue.NegInfinity):(e==="NaN"||e==="+NaN"||e==="-NaN")&&(r.value=NaN,r.type=ue.NaN),t?r:r.value},ha=e=>{let t,r,n;e[0]==="+"||e[0]==="-"?(t=e[0],r=zs[e.slice(1,3).join("").toLowerCase()],n=e.slice(3).join("").toLowerCase()):(t="+",r=zs[e.slice(0,2).join("").toLowerCase()],n=e.slice(2).join("").toLowerCase());let i=parseInt(n,r);return t==="+"?+i:-i},rr=e=>{let t=Array.from(e);if(Qs.test(e))return parseInt(e);if(la.test(e)||aa.test(e)||er.test(e))return ha(t)},da=e=>{let t=e.be.sign+e.be.bd+e.be.dot+e.be.ad,r=e.ae.sign+e.ae.bd+e.ae.dot+e.ae.ad,n;if(!(t==="+"||t==="-"||r==="+"||r==="-")){if(r!=="")if(e.ae.dot==="."){let i=parseFloat(t),l=parseFloat(r);n=i*10**l}else n=parseFloat(t+"e"+r);else n=parseFloat(t);return n}},pa=(e,t)=>e.length===0||t==="."||t==="-."||t==="+."||t==="+"||t==="-",ga=()=>({be:{sign:"",bd:"",dot:"",ad:""},ae:{sign:"",bd:"",dot:"",ad:""},state:"init"}),Js=(e,t,r,n)=>((e[r]==="-"||e[r]==="+")&&(t[n].sign=e[r],r=r+1),[e,r]),ma=(e,t,r,n)=>{if(t.state=n+"bd",e[r]===".")t[n].bd="0",t[n].dot=".",t.state=n+"ad";else if(Zs.test(e[r]))t[n].bd=e[r];else return[!0,r];return[!1,r+1]},Vs=(e,t,r,n)=>{let i;for(i=r;i<e.length;i++)if(e[i]==="."){if(t[n].dot===".")return[!0,i];t[n].dot=".",t.state=n+"ad"}else{if(e[i]==="e"||e[i]==="E")return n==="ae"?[!0,i]:(t.state="aebd",[!1,i+1]);if(Zs.test(e[i]))t.state===n+"bd"?t[n].bd=t[n].bd+e[i]:t[n].ad=t[n].ad+e[i];else return[!0,i]}return[!1,i+1]},nr=e=>{let t=ga(),r=Array.from(e);if(pa(r,e))return;let n=0,i=!1;if([r,n]=Js(r,t,n,"be"),[i,n]=ma(r,t,n,"be"),!i&&([i,n]=Vs(r,t,n,"be"),!i&&([r,n]=Js(r,t,n,"ae"),[i,n]=Vs(r,t,n,"ae"),!i)))return da(t)},ir=(e,t=!1)=>{let r={value:void 0,type:void 0};if(tr(e))r.value=BigInt(e.substr(0,e.length-1)),r.type=ue.BigInt;else{let n=rr(e);n!==void 0?(r.value=n,r.type=ue.Integer):(n=nr(e),n!==void 0?(r.value=n,r.type=ue.Float):(n=sr(e,t=!0),n.value!==void 0&&(r=n)))}return t?r:r.value},ba=(e,t=!0)=>{if(typeof e=="string")return e;if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="number")return e.toString();if(typeof e=="bigint")return e.toString()+"n";if(typeof e=="symbol")return e.description;if(Ks()&&e[Symbol.for("nodejs.util.inspect.custom")])return e[Symbol.for("nodejs.util.inspect.custom")]();{let r=function(n){if(typeof n.toString=="function")return n.toString()};try{return t?s=JSON.stringify(e):s=JSON.stringify(e,null,4),typeof s=="string"?s:r(e)}catch{return r(e)}}},Fe={UndefinedLiteral:0,NullLiteral:1,FalseLiteral:3,TrueLiteral:4,StringLiteral:12},ya={only_value:!0,with_value:!0,with_type:!1,unknown_as_string:!1};function lr(e,t={only_value:!0,with_value:!0,with_type:!1,unknown_as_string:!1}){let r=JSON.parse(JSON.stringify(ya));Object.assign(r,t);let{only_value:n,with_value:i,with_type:l,unknown_as_string:a}=r,c={value:Me,type:Me};if(e==="undefined")c.value=void 0,c.type=Fe.UndefinedLiteral;else if(e==="null")c.value=null,c.type=Fe.NullLiteral;else if(e==="false")c.value=!1,c.type=Fe.FalseLiteral;else if(e==="true")c.value=!0,c.type=Fe.TrueLiteral;else{let o=ir(e,!0);o.type===void 0?a?(c.value=e,c.type=Fe.StringLiteral):(c.value=e,c.type=Me):(c.value=o.value,c.type=o.type)}return n?c.value:(l||delete c.type,i||delete c.value,c)}lr.unknown=Me;var $a={UndefinedLiteral:0,NullLiteral:1,BooleanLiteral:{_self:2,FalseLiteral:3,TrueLiteral:4},NumericLiteral:{_self:5,Integer:6,Float:7,BigInt:8,PosInfinity:9,NegInfinity:10,NaN:11},StringLiteral:12,ArrayExpression:{_self:13,element:14},ObjectExpression:{_self:15,property:16},_Ref:17,CommentLine:{_self:18,tt:19,k:20,bv:21,av:22},CommentBlock:{_self:23,tt:24,k:25,bv:26,av:27}};ar.exports={TYPE_DICT:$a,isNode:Ks,empty:ia,unknown:Me,is_bigint_str:tr,is_jsint_str:ca,NUM_TYPE_DICT:ue,parse_abnormal_num:sr,parse_int:rr,parse_float:nr,parse_num:ir,parse0:lr,to_str:ba}});var _r=f((ih,ur)=>{var Ye={backSpace:8,tab:9,lineFeed:10,lineTab:11,formFeed:12,carriageReturn:13,shiftOut:14,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,nonBreakingSpace:160,oghamSpaceMark:5760,enQuad:8192,emQuad:8193,enSpace:8194,emSpace:8195,threePerEmSpace:8196,fourPerEmSpace:8197,sixPerEmSpace:8198,figureSpace:8199,punctuationSpace:8200,thinSpace:8201,hairSpace:8202,lineSeparator:8232,paragraphSeparator:8233,narrowNoBreakSpace:8239,mediumMathematicalSpace:8287,ideographicSpace:12288,zeroWidthNoBreakSpace:65279};function wa(e){let t=Object.entries(e),r=new Map;return t.forEach(n=>r.set(n[1],n[0])),r}var Ot=wa(Ye);function va(e){let t=Object.entries(e);return t=t.map(r=>[r[0],String.fromCharCode(r[1])]),Object.fromEntries(t)}var ka=va(Ye),cr=e=>55296<=e&&e<=56319,xa=e=>56320<=e&&e<=57343,Ta=(e,t)=>(e-55296)*1024+(t-56320)+65536,or=e=>e<=65535,Sa=e=>!or(e),Ea=e=>{if(e<=65535)return[e,null];{e=e-65536;let t=[null,null];return t[0]=(e>>10)+55296,t[1]=e%1024+56320,t}},Ca=(e,t)=>cr(e)?t+2:t+1;ur.exports={CODE_DICT:Ye,CH_DICT:ka,CODE_NAME_MP:Ot,cd2ch:e=>String.fromCharCode(e),ch2cd:e=>e.codePointAt(0),cd2n:e=>Ot.get(e),n2cd:e=>String.fromCharCode(Ye[e]),n2ch:e=>Ye[e],ch2n:e=>Ot.get(e.codePointAt(0)),is_high_code:cr,is_low_code:xa,get_code_point_from_high_low:Ta,get_high_low_from_code_point:Ea,is_length1_code_point:or,is_length2_code_point:Sa,_next_code_index:Ca}});var ve=f((lh,T)=>{var{CODE_DICT:d,CH_DICT:b}=_r(),fr=/\r\n?|[\n\u2028\u2029]/;T.exports.line_break_regexp=fr;T.exports.line_break_regexp_g=new RegExp(fr.source,"g");function hr(e){switch(e){case d.lineFeed:case d.carriageReturn:case d.lineSeparator:case d.paragraphSeparator:return!0;default:return!1}}function dr(e){switch(e){case b.lineFeed:case b.carriageReturn:case b.lineSeparator:case b.paragraphSeparator:return!0;default:return!1}}var Lt=[d.lineFeed,d.carriageReturn,d.lineSeparator,d.paragraphSeparator],pr=Lt.map(e=>String.fromCharCode(e));T.exports.NL_CODE_ARR=Lt;T.exports.NL_CH_ARR=pr;T.exports.is_nl_code=hr;T.exports.is_nl=dr;T.exports.skip_white_space_regexp=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function gr(e){switch(e){case 9:case 11:case 12:case d.space:case d.nonBreakingSpace:case d.oghamSpaceMark:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}T.exports.is_non_nl_ws_code=gr;function mr(e){switch(e){case b.tab:case b.lineTab:case b.formFeed:case b.space:case b.nonBreakingSpace:case b.oghamSpaceMark:case b.enQuad:case b.emQuad:case b.enSpace:case b.emSpace:case b.threePerEmSpace:case b.fourPerEmSpace:case b.sixPerEmSpace:case b.figureSpace:case b.punctuationSpace:case b.thinSpace:case b.hairSpace:case b.narrowNoBreakSpace:case b.mediumMathematicalSpace:case b.ideographicSpace:case b.zeroWidthNoBreakSpace:return!0;default:return!1}}T.exports.is_non_nl_ws=mr;var Rt=[d.tab,d.lineTab,d.formFeed,d.space,d.nonBreakingSpace,d.oghamSpaceMark,d.enQuad,d.emQuad,d.enSpace,d.emSpace,d.threePerEmSpace,d.fourPerEmSpace,d.sixPerEmSpace,d.figureSpace,d.punctuationSpace,d.thinSpace,d.hairSpace,d.narrowNoBreakSpace,d.mediumMathematicalSpace,d.ideographicSpace,d.zeroWidthNoBreakSpace];T.exports.NON_NL_WS_CODE_ARR=Rt;var br=Rt.map(e=>String.fromCharCode(e));T.exports.NON_NL_WS_CH_ARR=br;function qa(e){return gr(e)||hr(e)}function we(e){return mr(e)||dr(e)}T.exports.is_ws_code=qa;T.exports.is_ws=we;T.exports.WS_CHCODE_ARR=Lt.concat(Rt);T.exports.WS_CH_ARR=pr.concat(br);var Q={init:0,executing:1,succ:2,eof:3};T.exports.STATE_DICT=Q;function Aa(e,t=new Set){let r={g:e,rslt:"",state:Q.init},n=r.g.next().value;if(n===void 0)return r.state=Q.eof,r;for(;n!==void 0&&(we(n)||t.has(n));)n=r.g.next().value;for(;n!==void 0&&!we(n)&&!t.has(n);)r.rslt=r.rslt+n,n=r.g.next().value;return n===void 0?r.state=Q.eof:(we(n)||t.has(n))&&(r.state=Q.succ),r}function Na(e,t=0,r=new Set){let n={arr:e,pos:t,rslt:"",state:Q.init};for(let l=n.pos;l<e.length;l++){let a=e[l];if(we(a)||r.has(a))n.pos=n.pos+1;else break}let i=n.pos;for(let l=n.pos;l<e.length;l++){let a=e[l];if(!we(a)&&!r.has(a))n.pos=n.pos+1;else break}return n.pos===e.length?n.state=Q.eof:n.state=Q.succ,n.rslt=e.slice(i,n.pos).join(""),n}T.exports.from_generator=Aa;T.exports.from_charr=Na});var Z=f((ah,xr)=>{var{WS_CH_ARR:yr,NON_NL_WS_CH_ARR:Ia,NL_CH_ARR:Da}=ve();function Oa(e){return Array.from(e).length}var La="\u200C",$r="\u200D",Ra=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function Pt(e,t,...r){let n=function(){return t(this,...r)};Ra()?e.prototype[Symbol.for("nodejs.util.inspect.custom")]=n:e.prototype.repr=n}var B={tmpl_quote:new Error("tmpl_quote: ` cant be deleted"),reserved:new Error(" [/,*,#,&,`,\\,] and whitespaces are reserved"),inuse:new Error("in using"),char:new Error("must be a char"),pair:new Error("left block must be different with right"),cant_be_empty:new Error("can NOT be empty")},nt=Symbol("get_pair_lmp"),Pa=Symbol("add_pair_reserved"),We=class{#t;#e=new Map;#s=new Map;constructor(t){this.#t=t}get[nt](){return this.#e}get size(){return this.#e.size}[Pa](t,r){if(t===r)throw B.pair;this.#e.set(t,r),this.#s.set(r,t)}add(t,r){if(this.#t.validate(t),this.#t.validate(r),t===r)throw B.pair;this.#e.set(t,r),this.#s.set(r,t)}ldelete(t){if(this.size<2)throw B.cant_be_empty;{let r=this.#e.get(t);this.#e.delete(t),this.#s.delete(r)}}rdelete(t){if(this.size<2)throw B.cant_be_empty;{let r=this.#s.get(t);this.#s.delete(t),this.#e.delete(r)}}lhas(t){return this.#e.has(t)}rhas(t){return this.#s.has(t)}has(t){return this.lhas(t)||this.rhas(t)}getl(t){return this.#s.get(t)}getr(t){return this.#e.get(t)}[Symbol.iterator](){return this.#e[Symbol.iterator]()}};function ja(e){return new Map(e[nt])}Pt(We,ja);var wr=Symbol("get_single_set"),vr=Symbol("add_single_reserved"),ke=class{#t;#e=new Set;constructor(t){this.#t=t}get[wr](){return this.#e}[vr](t){this.#e.add(t)}add(t){this.#t.validate(t),this.#e.add(t)}delete(t){if(this.size<2)throw B.cant_be_empty;if(t==="`")throw B.tmpl_quote;this.#e.delete(t)}has(t){return this.#e.has(t)}[Symbol.iterator](){return this.#e[Symbol.iterator]()}};function Ba(e){return new Set(e[wr])}Pt(ke,Ba);var it=class{#t;#e;#s;#r;#n;#i=!1;constructor(){this.#t=new We(this),this.#t.add("[","]"),this.#t.add("(",")"),this.#t.add("<",">"),this.#t.add("\uFF08","\uFF09"),this.#t.add("\u2018","\u2019"),this.#e=new We(this),this.#e.add("{","}"),this.#e.add("\u3010","\u3011"),this.#e.add("\u300A","\u300B"),this.#e.add("\u201C","\u201D"),this.#s=new ke(this),this.#s.add('"'),this.#s.add("'"),this.#s.add("\xB7"),this.#s[vr]("`"),this.#r=new ke(this),this.#r.add(","),this.#r.add("\uFF0C"),this.#r.add(";"),this.#r.add("\uFF1B"),this.#r.add("\u3002"),this.#r.add("\u3001"),this.#n=new ke(this),this.#n.add(":"),this.#n.add("\uFF1A"),this.#n.add("="),this.#i=!0}get reserved(){return["/","*","#","&","`","\\"].concat(yr)}get inuse(){let t=new Set;if(this.#i){for(let r of this.#s)t.add(r);for(let r of this.#r)t.add(r);for(let r of this.#n)t.add(r);for(let r of this.#t[nt])t.add(r);for(let r of this.#e[nt])t.add(r)}return t}validate(t){if(typeof t!="string"||Oa(t)!==1)throw B.char;if(this.reserved.includes(t))throw B.reserved;if(Array.from(this.inuse).flat().includes(t))throw B.inuse;return t}get esc(){return"\\"}get slash(){return"/"}get line_comment(){return"//"}get asterisk(){return"*"}get blk_comments(){return["/*","*/"]}get hash(){return"#"}get ref(){return"&"}get tmpl_quote(){return"`"}get nl(){return Da}get non_nl_ws(){return Ia}get ws(){return yr}get array_blks(){return this.#t}get fst_ary_blks(){return Array.from(this.#t)[0]}get obj_blks(){return this.#e}get fst_obj_blks(){return Array.from(this.#e)[0]}get quotes(){return this.#s}get fst_quote(){return Array.from(this.#s)[0]}get commas(){return this.#r}get fst_comma(){return Array.from(this.#r)[0]}get colons(){return this.#n}get fst_colon(){return Array.from(this.#n)[0]}},lt=class{constructor(t){this.reserved=t.reserved}get[Symbol.toStringTag](){return"reserved"}};Object.defineProperty(lt,"name",{value:$r});var at=class{constructor(t){this.esc=t.esc,this.hash=t.hash,this.ref=t.ref,this.tmpl_quote=t.tmpl_quote,this.slash=t.slash,this.asterisk=t.asterisk,this.line_comment=t.line_comment,this.blk_comments=t.blk_comments,this.nl=t.nl,this.non_nl_ws=t.non_nl_ws}get[Symbol.toStringTag](){return"fixed"}};Object.defineProperty(at,"name",{value:$r});var ct=class{constructor(t){this.obj_blks=t.obj_blks,this.array_blks=t.array_blks,this.quotes=t.quotes,this.commas=t.commas,this.colons=t.colons}get[Symbol.toStringTag](){return"configurable-if-not-reserved"}};Object.defineProperty(ct,"name",{value:La});function Fa(e){return[new at(e),new ct(e),new lt(e)]}Pt(it,Fa);var kr=new it;kr.ERROR_DICT=B;xr.exports=kr});var Sr=f((ch,Tr)=>{function*Ma(e){for(let t of e)yield t;e=null}Tr.exports.sync_gen_from_str=Ma});var I=f((oh,qr)=>{var Er={bk:{_self:0,eof:{_self:1,lc:2,blkc:3,hash:{_self:4,naked:5,quote:6},ref:{_self:7,naked:8,quote:9}}},k:{_self:10,eof:{_self:11,lc:12,blkc:13,hash:{_self:14,naked:15,quote:16},ref:{_self:17,naked:18,quote:19}}},ak:{_self:20,eof:{_self:21,lc:22,blkc:23,hash:{_self:24,naked:25,quote:26},ref:{_self:27,naked:28,quote:29}}},bv:{_self:30,eof:{_self:31,lc:32,blkc:33,hash:{_self:34,naked:35,quote:36},ref:{_self:37,naked:38,quote:39}}},v:{_self:40,eof:{_self:41,lc:42,blkc:43,hash:{_self:44,naked:45,quote:46},ref:{_self:47,naked:48,quote:49}}},av:{_self:50,eof:{_self:51,lc:52,blkc:53,hash:{_self:54,naked:55,quote:56},ref:{_self:57,naked:58,quote:59}}}};function A(e){return e instanceof Object?e._self:e}function Ya(e){return e+1}function Wa(e){return e+2}function Ha(e){return e+3}function Ga(e){return e+6}function Ua(e){return e+5}function Xa(e){return e+9}function za(e){return e+8}function Cr(e){return e%10!==0}var Ja={backslash:0,lcmt:1,blkcmt:2,quote:3,naked:4},Va={handling:0,handled:1};function Ka(e,t,r){let n=Er;return e.$has_yield_sign()||Cr(r)||t===A(n.av)&&r===A(n.bv)||t===A(n.av)&&r===A(n.bk)||t===A(n.av)&&r===A(n.k)||t===A(n.av)&&r===A(n.v)||t===A(n.av)&&r===A(n.ak)||t===A(n.v)&&r===A(n.bv)||t===A(n.v)&&r===A(n.bk)}qr.exports={STATE_DICT:Er,gtv:A,get_main_eofv_with_code:Ya,get_lcmt_eofv_with_code:Wa,get_blkcmt_eofv_with_code:Ha,get_hash_quote_eofv_with_code:Ga,get_hash_naked_eofv_with_code:Ua,get_ref_quote_eofv_with_code:Xa,get_ref_naked_eofv_with_code:za,LEFTED_TYPE:Ja,AVND_CACHE_STATE_DICT:Va,is_eofv:Cr,is_should_yield:Ka}});var Gt=f((uh,Fr)=>{var{is_nl:Ir}=ve(),Dr=(e,t,r=" ",n=!1)=>{let i=e.length;return i<=t?r.repeat(t-i)+e:n?e.substr(i-t):e},ot=(e,t,r,n="0",i=!1)=>{let l=e.toString(t);return Dr(l,r,n,i)},Qa=/^[0-7]$/,Za=/^[0-9a-fA-F]$/,_e=e=>Qa.test(e),X=e=>Za.test(e),ut={b:"\b",f:"\f",n:`
2
+ `,r:"\r",t:" ",v:"\v"},Or={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\\":"\\\\"};function ec(e){return Or[e]}function Lr(e){return ut[e]}function tc(e){if(e.length>1)return;let t=e.charCodeAt(0);if(t>=0&&t<=255)return"\\x"+ot(t,16,2)}function sc(e){e=Array.from(e);let t=e[0],r=e[1];if(X(t)&&X(r)){let n=parseInt("0x"+t+r);return String.fromCharCode(n)}}function rc(e){if(e.length>1)return;let t=e.charCodeAt(0);if(t>=0&&t<=255)return"\\u"+ot(t,16,4)}function nc(e){e=Array.from(e);let t=e[0],r=e[1],n=e[2],i=e[3];if(X(t)&&X(r)&&X(n)&&X(i)){let l=parseInt("0x"+t+r+n+i);return String.fromCharCode(l)}}function ic(e){if(e.length>1)return;let t=e.charCodeAt(0);if(t>=0&&t<=255)return"\\"+ot(t,8,3)}function lc(e){let t="";e=Array.from(e);let r=e[0];if(_e(r)){t=t+r;let n=e[1];if(_e(n)){t=t+n;let l=e[2];_e(l)&&(t=t+l)}let i=parseInt(t,8);return String.fromCharCode(i)}}var p={init:0,executing:1,succ:2,eof:3,backslash:4,x:5,u:6,o:7};function*ac(e){let t=Array.from(e);for(let r of t)yield r}function*Ar(e,t){yield*t,yield*e}function Rr(e,t,r,n,i=!1){if(typeof t=="string"){let a=t;t=c=>c===a}if(typeof(r==="string")&&r.length>0){let a=ac(r);e=Ar(e,a)}else e=Ar(e,r);let l={state:p.init,end:t,esc:n,g:e,curr:"",ch:e.next().value,offset:0};return l.ch!==void 0&&(l.offset=l.offset+1),i&&(l.rslt=""),l}function jt(e){return e.ch===void 0||e.end(e.ch)&&e.state!==p.backslash||e.state===p.x||e.state===p.u||e.state===p.o}function Bt(e,t=!1){return e.ch===e.esc?(e.state=p.backslash,e.curr=""):(e.state=p.executing,t&&(e.rslt=e.rslt+e.ch),e.curr=e.ch),e.ch=e.g.next().value,e.ch!==void 0&&(e.offset=e.offset+1),e}function Nr(e,t,r,n,i,l,a){return a===!0?n===Pr?(e.state=p.x,e.ch="\\x"+t.join(""),e):n===jr?(e.state=p.u,e.ch="\\u"+t.join(""),e):(n===Br&&(e.state=p.o,e.ch="\\"+t.join("")),e):i?(e.curr=t.join(""),l&&(e.rslt=e.rslt+e.curr),e.state=p.executing,e.ch=r,e):(e.curr=n(t),l&&(e.rslt=e.rslt+e.curr),e.state=p.executing,e.ch=r,e)}function cc(e,t,r,n,i){return e.curr=n(t),i&&(e.rslt=e.rslt+e.curr),e.state=p.executing,e.ch=e.g.next().value,e.ch!==void 0&&(e.offset=e.offset+1),e}function _t(e,t,r,n,i=!0,l=!1,a=void 0,c=!1){let o;if(a!==void 0?o=a:(o=e.g.next().value,o!==void 0&&(e.offset=e.offset+1)),o===void 0)return e;let u=0,_=[],h;if(l?h=!0:h=r(o),h)u=u+1,_.push(o);else return e.state=p.executing,e.ch=o,e;for(;u<t;){if(o=e.g.next().value,o===void 0)return Nr(e,_,o,n,i,c,tail=!0);if(e.offset=e.offset+1,h=r(o),h)u=u+1,_.push(o);else return Nr(e,_,o,n,i,c,tail=!1)}return cc(e,_,o,n,c)}function Pr(e){let t=parseInt("0x"+e[0]+e[1]);return String.fromCharCode(t)}function jr(e){let t=parseInt("0x"+e[0]+e[1]+e[2]+e[3]);return String.fromCharCode(t)}function Br(e){let t=parseInt(e.join(""),8);return String.fromCharCode(t)}function Ft(e,t=!1){return e.curr=Lr(e.ch),t&&(e.rslt=e.rslt+e.curr),e.state=p.executing,e.ch=e.g.next().value,e.ch!==void 0&&(e.offset=e.offset+1),e}function Mt(e,t=!1){return _t(e,2,X,Pr,!0,!1,void 0,t)}function Yt(e,t=!1){return _t(e,4,X,jr,!0,!1,void 0,t)}function Wt(e,t=!1){return _t(e,3,_e,Br,!1,!0,e.ch,t)}function Ht(e,t=!1){return e.curr=e.ch,t&&(e.rslt=e.rslt+e.ch),e.state=p.executing,e.ch=e.g.next().value,e.ch!==void 0&&(e.offset=e.offset+1),e}function oc(e,t=i=>i==='"',r="",n="\\"){let i=Rr(e,t,r,n,!0);for(i.state=p.executing;!jt(i);)i.state===p.executing?Bt(i,!0):i.state===p.backslash&&(Ir(i.ch)?(i.ch=i.g.next().value,i.ch!==void 0&&(i.offset=i.offset+1),i.state=p.executing):i.ch in ut?Ft(i,!0):i.ch==="x"?Mt(i,!0):i.ch==="u"?Yt(i,!0):_e(i.ch)?Wt(i,!0):Ht(i,!0));return typeof i.ch=="string"&&i.end(i.ch)?(i.state=p.succ,i.ch=""):i.state===p.backslash?i.ch=i.esc:i.ch===void 0&&(i.state=p.eof,i.ch=""),i}function*uc(e){let t=e;for(t.state=p.executing;!jt(t);)t.state===p.executing?(Bt(t,!1),t.curr!==""&&(yield t.curr)):t.state===p.backslash&&(Ir(t.ch)?(t.state=p.executing,t.ch=t.g.next().value,t.ch!==void 0&&(t.offset=t.offset+1)):t.ch in ut?(Ft(t,!1),t.curr!==""&&(yield t.curr)):t.ch==="x"?(Mt(t,!1),t.curr!==""&&(yield t.curr)):t.ch==="u"?(Yt(t,!1),t.curr!==""&&(yield t.curr)):_e(t.ch)?(Wt(t,!1),t.curr!==""&&(yield t.curr)):(Ht(t,!1),t.curr!==""&&(yield t.curr)));return typeof t.ch=="string"&&t.end(t.ch)?(t.state=p.succ,t.ch=""):t.state===p.backslash?(t.ch=t.esc,yield t.curr):t.ch===void 0&&(t.state=p.eof,t.ch=""),t}Fr.exports={CHAR_UNESC_DICT:ut,CHAR_ESC_DICT:Or,escc:ec,unescc:Lr,escx:tc,unescx:sc,escu:rc,unescu:nc,esco:ic,unesco:lc,STATE_DICT:p,from_generator:oc,init:Rr,handle_executing:Bt,is_terminated:jt,handle_escc:Ft,esc_handle_engine:_t,handle_escx:Mt,handle_escu:Yt,handle_esco:Wt,handle_esc_other:Ht,gen:uc,prepend:Dr,prepend_num:ot,is_odigit_ch:_e,is_hdigit_ch:X}});var Jr=f((_h,zr)=>{var{is_nl:_c}=ve(),xe=Gt(),Mr={line_comment:0,blk_comment:1},ee={init:0,executing:1,succ:2,eof:3,asterisk:4};function Yr(e){return{state:ee.init,g:e,rslt:"",ch:"",offset:0}}function Wr(e,t){return e.state=ee.eof,e.rslt=e.rslt+t.rslt,e.ch="",e}function Hr(e,t){return e.state=ee.succ,e.rslt=e.rslt+t.rslt,e.ch="",e}function Gr(e,t){return e.state=ee.executing,e.rslt=e.rslt+t.rslt,e.ch=t.ch,e}function Ur(e,t=""){let r=Yr(e);r.state=ee.executing;let n=xe.from_generator(r.g,_c,t);return r.offset=n.offset+r.offset,r.g=n.g,n.state===xe.STATE_DICT.eof?Wr(r,n):n.state===xe.STATE_DICT.succ?Hr(r,n):Gr(r,n)}function Xr(e,t=""){let r=Yr(e);r.state=ee.executing;let n;for(;;){if(n=xe.from_generator(r.g,"*",t),r.offset=r.offset+n.offset,r.g=n.g,n.state===xe.STATE_DICT.eof)return Wr(r,n);if(n.state===xe.STATE_DICT.succ){let i=r.g.next().value;if(i!==void 0&&(r.offset=r.offset+1),i==="/")return Hr(r,n);if(i!==void 0)r.rslt=r.rslt+n.rslt+"*",t=i,r.offset=r.offset-1;else return r.rslt=r.rslt+n.rslt,r.ch="*",r.state=ee.asterisk,r}else return Gr(r,n)}return r}function fc(e,t,r=""){return t===Mr.line_comment?Ur(e,r):Xr(e,r)}zr.exports={TYPE_DICT:Mr,STATE_DICT:ee,lc_from_generator:Ur,blk_from_generator:Xr,from_generator:fc}});var Ut=f((fh,Vr)=>{function hc(e){if(globalThis.document===void 0){let i=globalThis.require("fs").readFileSync(e).toString();return JSON.parse(i)}else return}function dc(e,t){if(globalThis.document===void 0){let n=globalThis.require("fs"),i=JSON.stringify(t);n.writeFileSync(e,i)}else return}function pc(e){return parseInt(e).toString()===e}Vr.exports={rjson:hc,wjson:dc,is_int_str:pc}});var Xt=f((hh,Kr)=>{var gc=()=>Math.random()*9007199254740992;function mc(e,t){return Array.from({length:t-e}).map((r,n)=>n+e)}function bc(e,t){return t.filter((r,n)=>e.includes(n))}function yc(e){return Object.entries(e).length===0}function $c(e){return Object.entries(e).map(n=>n[1])}function wc(e){return Object.entries(e).map(n=>n[0])}function vc(e){return Object.entries(e).length}function kc(e,t){for(let r in e)t(r,e[r]);return e}function xc(e,t){for(let r in e)e[r]=t(r,e[r]);return e}function Tc(e,t){for(let r in t)e[r]=t[r];return e}function Sc(e,t){for(let r in t)!(r in e)&&(e[r]=t[r]);return e}function Ec(e,t,r){return r=r.filter(n=>n[e]!==t),r}function Cc(e,t,r){return r.findIndex(i=>i[e]===t)}function qc(e){return JSON.parse(JSON.stringify(e))}function Ac(e,t){for(let r=0;r<e.length;r++){lyr=e[r];for(let n=0;n<lyr.length;n++)e[r][n]=t(e[r][n],r,n)}return e}function Nc(e){let t=e[0]!=="_",r=e[0]!=="$";return t&&r}Kr.exports={gen_guid:gc,range:mc,seqs_slct:bc,dict_length:vc,is_empty_dict:yc,dict_values:$c,dict_keys:wc,dict_map:xc,dict_foreach:kc,dict_plus:Tc,dict_update:Sc,dtb_kv_rm:Ec,dtb_kv_get_seq:Cc,dcp:qc,mat_map:Ac,is_cu_property:Nc}});var ls=f((dh,xn)=>{var v=Xt();function Vt(e){if(v.is_empty_dict(e))return 0;{let t=v.dict_keys(e);return Math.max(...t)+1}}function He(e){return e!=null}function Zr(e,t){return e._id=e._id+t,e._tree=e._tree+t,He(e._fstch)&&(e._fstch=e._fstch+t),He(e._lsib)&&(e._lsib=e._lsib+t),He(e._rsib)&&(e._rsib=e._rsib+t),He(e._parent)&&(e._parent=e._parent+t),e}function fe(e,t){let r=Vt(e);for(let n in t){let i=Zr(t[n],r);t[i._id]=i,delete t[n]}return t}function Ic(e=0){let t=e;return{_id:t,_fstch:null,_lsib:null,_rsib:null,_parent:null,_tree:t}}function Dc(e,t=0){return{_id:Vt(e)+t,_fstch:null,_lsib:void 0,_rsib:void 0,_parent:void 0,_tree:void 0}}function en(e){return e._tree!==void 0}function te(e){let t=e._tree!==void 0,r=e._tree===e._id;return t&&r}function Kt(e){return e._lsib===null}function Qt(e){return e._rsib===null}function F(e){return e._fstch===null}function tn(e,t){if(te(e))return!0;{let n=k(e,t);return Y(n,t).length===1}}function ze(e){return te(e)||!en(e)}function ft(e,t,r){if(!ze(t))return console.log("only root or uninited could be prepend"),e;let n=F(e);if(t._tree=e._tree,t._lsib=null,n)t._rsib=null,t._parent=e._id;else{let i=r[e._fstch];i._lsib=void 0,t._rsib=i._id,t._parent=void 0}return e._fstch=t._id,r[t._id]=t,e}function Zt(e,t,r){if(!ze(t))return console.log("only root or uninited could be append"),e;let n=F(e);if(t._tree=e._tree,t._rsib=null,n)e._fstch=t._id,t._lsib=null;else{let i=de(e,r);i._parent=void 0,i._rsib=t._id,t._lsib=void 0}return t._parent=e._id,r[t._id]=t,e}function es(e,t,r){if(!ze(t))return console.log("only root or uninited could be add"),e;if(te(e))return console.log("cant addrsib to root"),e;let n=Qt(e);return t._tree=e._tree,n?(t._parent=e._parent,e._parent=void 0,t._rsib=null):(t._rsib=e._rsib,t._parent=void 0),e._rsib=t._id,t._lsib=void 0,r[t._id]=t,e}function sn(e,t,r){if(!ze(t))return console.log("only root or uninited could be add"),e;if(te(e))return console.log("cant addlsib to root"),e;let n=Kt(e);if(t._tree=e._tree,n){let i=k(e,r);e._lsib=void 0,t._lsib=null,i._fstch=t._id}else{let i=M(e,r);i._rsib=t._id,t._lsib=void 0}return t._rsib=e._id,t._parent=void 0,r[t._id]=t,e}function rn(e,t,r,n){let i=Y(t,n),l=i.length;if(l===0)return ft(t,r,n);if(e<=l&&e>=0){if(e===0)return ft(t,r,n);if(e===l)return Zt(t,r,n);{let c=i[e-1];return es(c,r,n)}}else return console.log("not in range!!"),t}function Te(e,t){for(let r in t)t[r]._tree=e._tree}function Oc(e,t,r){r=fe(t,r);let n=v.dict_keys(r)[0],i=re(r[n],r);return e=ft(e,i,t),Te(e,r),v.dict_plus(t,r),e}function Lc(e,t,r){r=fe(t,r);let n=v.dict_keys(r)[0],i=re(r[n],r);return e=Zt(e,i,t),Te(e,r),v.dict_plus(t,r),e}function Rc(e,t,r){r=fe(t,r);let n=v.dict_keys(r)[0],i=re(r[n],r);return e=es(e,i,t),Te(e,r),v.dict_plus(t,r),e}function Pc(e,t,r){r=fe(t,r);let n=v.dict_keys(r)[0],i=re(r[n],r);return e=sn(e,i,t),Te(e,r),v.dict_plus(t,r),e}function jc(e,t,r,n){n=fe(r,n);let i=v.dict_keys(n)[0],l=re(n[i],n);return t=rn(e,t,l,r),Te(t,n),v.dict_plus(r,n),t}function Ge(e,t){let r=W(e,t),n=r[0]._id;return r.forEach(i=>{i._tree=n}),r}function Ue(e,t){let r={};return e.map(n=>{let i=n._id;r[i]=n,delete t[i]}),r}function nn(e){return e._fstch=null,e}function Xe(e){return e._lsib=null,e._rsib=null,e._parent=null,e}function Se(e,t){if(te(e))return[e,t];if(tn(e,t)){let n=t[e._parent];nn(n);let i=Ge(e,t),l=Ue(i,t);return Xe(e),[e,l]}else if(Kt(e)){let n=P(e,t);n._lsib=null;let i=k(e,t);i._fstch=e._rsib;let l=Ge(e,t),a=Ue(l,t);return Xe(e),[e,a]}else if(Qt(e)){let n=M(e,t);n._rsib=e._rsib,n._parent=e._parent;let i=Ge(e,t),l=Ue(i,t);return Xe(e),[e,l]}else{let n=M(e,t);n._rsib=e._rsib;let i=Ge(e,t),l=Ue(i,t);return Xe(e),[e,l]}}function Bc(e,t){let r=he(e,t);return r===null?[e,t]:Se(r,t)}function Fc(e,t){let r=de(e,t);return r===null?[e,t]:Se(r,t)}function Mc(e,t,r){let n=ln(e,t,r);return n===null?[t,r]:Se(n,r)}function Yc(e,t,...r){let n=an(e,t,...whiches);for(let i=0;i<n.length;i++)Se(n[i],t);return[e,t]}function Wc(e,t){let r=Y(e,t);for(let n=0;n<r.length;n++)Se(r[n],t);return t}function he(e,t){return e._fstch===null?null:t[e._fstch]}function Y(e,t){let r=[],n=he(e,t);for(;n!==null;)r.push(n),n=P(n,t);return r}function de(e,t){let r=Y(e,t);return r.length===0?null:r[r.length-1]}function ln(e,t,r){let n=Y(t,r);return n.length===0||e>n.length-1||e<0?null:n[e]}function an(e,t,...r){let n=Y(e,t),i=[];if(n.length!==0)for(let l=0;l<r.length;l++){let a=r[l];a>n.length-1||a<0||i.push(n[a])}return i}function cn(e,t,r=!1){let n=e,i=P(e,t);for(;i!==null;)n=i,i=P(i,t);return r||n._id!==e._id?n:null}function Hc(e,t){let r=se(e,t,!0),n=v.dtb_kv_get_seq("_id",e._id,r),i=[];if(r.length!==0)for(let l=0;l<r.length;l++)l<n&&i.push(r[l]);return i}function Gc(e,t){let r=se(e,t,!0),n=v.dtb_kv_get_seq("_id",e._id,r),i=[];if(r.length!==0)for(let l=0;l<r.length;l++)l>n&&i.push(r[l]);return i}function se(e,t,r=!1){let n=k(e,t),i;return n!==null?i=Y(n,t):i=[e],r||(i=v.dtb_kv_rm("_id",e._id,i)),i}function Uc(e,t,r=!1){let n=se(e,t,!0);return r?n[0]:n[0]._id===e._id?null:n[0]}function Xc(e,t,r){let n=se(t,r,!0),i=n.length;return e<=i-1&&e>=0?n[e]:null}function zc(e,t,...r){let n=se(e,t,!0),i=[];if(n.length!==0)for(let l=0;l<r.length;l++){let a=r[l];a>n.length-1||a<0||i.push(n[a])}return i}function Jc(e,t){let r=se(e,t,!0);return v.dtb_kv_get_seq("_id",e._id,r)}function M(e,t){let r=se(e,t,!0),n=v.dtb_kv_get_seq("_id",e._id,r);return n===0?null:r[n-1]}function P(e,t){return e._rsib===null?null:t[e._rsib]}function C(e,t){return ht(e,t,!0).length-1}function on(e,t){let r=C(e,t),i=W(e,t).map(a=>C(a,t));return Math.max(...i)-r+1}function Vc(e,t){return F(e)?null:C(e,t)+1}function Kc(e,t){if(F(e))return null;{let n=C(e,t),l=W(e,t).map(c=>C(c,t));return Math.max(...l)}}function Qc(e,t,r){let n=C(t,r);return on(t,r)<=e?null:n+e}function un(e,t){let r=re(e,t),n=W(r,t),i=C(e,t);return n.filter(a=>C(a,t)===i)}function zt(e,t){let r=un(e,t);return v.dtb_kv_get_seq("_id",e._id,r)}function Zc(e,t){return W(e,t).length}function re(e,t){let r=e,n=k(e,t);for(;n!==null;)r=n,n=k(n,t);return r}function k(e,t){let r;if(te(e))r=null;else{let n=cn(e,t,!0);r=t[n._parent]}return r}function ht(e,t,r=!1){let n=[],i=k(e,t);for(;i!==null;)n.push(i),i=k(i,t);return r&&n.unshift(e),n}function eo(e,t,r){let n=ht(t,r,!0),i=n.length;return e<i&&e>=0?n[e]:null}function to(e,t,...r){let n=ht(e,t,!0),i=[];if(n.length!==0)for(let l=0;l<r.length;l++){let a=r[l];a>n.length-1||a<0||i.push(n[a])}return i}function _n(e,t){let r=k(e,t);for(;r!==null;){let n=P(r,t);if(n!==null)return n;r=k(r,t)}return null}function fn(e,t){let r=he(e,t);if(r!==null)return r;{let n=P(e,t);return n!==null?n:_n(e,t)}}function hn(e,t){let r=e,n=de(e,t);for(;n!==null;)r=n,n=de(n,t);return r}function so(e,t){if(te(e))return null;if(F(e)){let n=M(e,t);return n!==null?n:k(e,t)}else{let n=M(e,t);return n!==null?F(n)?n:hn(n,t):k(e,t)}}function W(e,t){let r=C(e,t),n=[];for(;e!==null&&(n.push(e),e=fn(e,t),!(e!==null&&C(e,t)<=r)););return n}function ts(e,t){let r=e,n=he(e,t);for(;n!==null;)r=n,n=he(n,t);return r}function dn(e,t){let r=P(e,t);return r===null?k(e,t):ts(r,t)}function pn(e,t){let r=k(e,t);for(;r!==null;){let n=M(r,t);if(n!==null)return n;r=k(r,t)}return null}function ro(e,t){if(F(e)){let n=M(e,t);return n===null?pn(e,t):n}else return de(e,t)}function gn(e,t){let r=[],n=ts(e,t);for(;n!==null&&(r.push(n),n._id!==e._id);)n=dn(n,t);return r}function Jt(e){v.dict_foreach(e,(t,r)=>{e[t]._$visited=!1})}function mn(e,t){let r=e._$visited;if(F(e))if(r){let i=P(e,t);return i===null?k(e,t):i}else return e._$visited=!0,e;else if(r){let i=P(e,t);return i===null?k(e,t):i}else return e._$visited=!0,he(e,t)}function no(e,t,r){if(F(t)){if(e)return t;{let i=M(t,r);return i===null?k(t,r):i}}else{if(e)return de(t,r);{let i=M(t,r);return i===null?k(t,r):i}}}function bn(e,t){return t._$visited&&e===t._id}function yn(e,t,r=!1,n=!0){let i=[];Jt(t);let l=e._id;for(;!bn(l,e);)r?i.push(v.dcp(e)):i.push(e),e=mn(e,t);return r?i.push(v.dcp(e)):i.push(e),n&&Jt(t),i}function io(e,t){let r={};r._depth=C(e,t),r._breadth=zt(e,t);let n=k(e,t);return r._pbreadth=n===null?null:zt(n,t),r._id=e._id,r}function Qr(e){let t={};return t.ele={},t.nd=e,t.ele._id=e._id,t.ele._children=[],t}function ss(e,t){let r=[],n=e[0],i=[Qr(n)];for(i[0].ele._pbreadth=null;i.length>0;){let l=[];for(let c=0;c<i.length;c++){i[c].ele._breadth=c,i[c].ele._depth=r.length;let o=Y(i[c].nd,t);o=o.map(u=>Qr(u)),o.forEach((u,_)=>{u.ele._pbreadth=i[c].ele._breadth,i[c].ele._children.push([r.length+1,l.length+_])}),l=l.concat(o)}let a=i.map(c=>c.ele);r.push(a),i=l}return r}function $n(e,t){return gn(e[0],t)}function wn(e,t,r=!1,n=!0){return yn(e[0],t,r,n)}function lo(e,t){let r=rs(e,t);return ss(r,t)}function rs(e,t){let r=e[e.length-1];return W(r,t)}function ao(e,t,r=!1,n=!0){let i=rs(e,t);return wn(i,t,r,n)}function co(e,t){let r=ns(e,t);return ss(r,t)}function ns(e,t){let r=e[0];return W(r,t)}function oo(e,t){let r=ns(e,t);return $n(r,t)}function is(e,t,r=!1){let n=W(e,t);return r||n.splice(0,1),n}function uo(e,t){return Y(e,t)}function _o(e,t){let r=is(e,t,!1),n=sdfs.map(l=>C(l,t)),i=Math.max(...n);return r=r.filter(l=>C(l,t)===i),r}function vn(e,t,r){let n=C(t,r),i=is(t,r,!1),l=sdfs.map(a=>C(a,r));return i=i.filter(a=>C(a,r)===n+e),i}function fo(e,t,...r){let n=r.map(i=>vn(i,e,t));return n=Array.prototype.concat(...n),n}function kn(e){let t=v.dict_keys(e)[0],r=e[t];return re(r,e)}function ho(e){let t=kn(e);return W(t,e)}xn.exports={calc_next_id:Vt,update_nodes_ids:fe,creat_root:Ic,creat_nd:Dc,is_inited:en,is_root:te,is_fstch:Kt,is_lstch:Qt,is_leaf:F,is_lonely:tn,is_id:He,is_connectable:ze,prepend_child:ft,append_child:Zt,insert_child:rn,add_rsib:es,add_lsib:sn,get_fstch:he,get_rsib:P,get_children:Y,get_lstch:de,get_which_child:ln,get_some_children:an,get_fstsib:Uc,get_lstsib:cn,get_preceding_sibs:Hc,get_following_sibs:Gc,get_sibs:se,get_which_sib:Xc,get_some_sibs:zc,get_sibseq:Jc,get_lsib:M,get_rsib:P,get_lyr:un,get_breadth:zt,get_count:Zc,get_depth:C,get_height:on,get_fst_lyr_des_depth:Vc,get_lst_lyr_des_depth:Kc,get_which_lyr_des_depth:Qc,get_root:re,get_parent:k,get_ances:ht,get_which_ance:eo,get_some_ances:to,get_rsib_of_fst_ance_having_rsib:_n,get_sdfs_next:fn,get_drmost_des:hn,get_sdfs_prev:so,get_sdfs:W,get_lsib_of_fst_ance_having_lsib:pn,get_dlmost_des:ts,get_edfs_next:dn,get_edfs_prev:ro,get_edfs:gn,clear_$visited:Jt,get_sedfs_next:mn,is_sedfs_traverse_finished:bn,get_sedfs_prev:no,get_sedfs:yn,get_deses:is,get_fst_lyr_deses:uo,get_lst_lyr_deses:_o,get_which_lyr_deses:vn,get_some_lyrs_deses:fo,nd2ele:io,sdfs2mat:ss,sdfs2edfs:$n,sdfs2sedfs:wn,edfs2mat:lo,edfs2sdfs:rs,edfs2sedfs:ao,sedfs2mat:co,sedfs2sdfs:ns,sedfs2edfs:oo,update_disconnected_nodes:Ge,update_orig_nodes:Ue,leafize:nn,rootize:Xe,disconnect:Se,rm_fstch:Bc,rm_lstch:Fc,rm_which:Mc,rm_some:Yc,rm_all:Wc,update_treeid:Te,update_one_nodeid:Zr,update_nodes_ids:fe,prepend_child_tree:Oc,append_child_tree:Lc,add_rsib_tree:Rc,add_lsib_tree:Pc,insert_child_tree:jc,get_root_via_tree:kn,tree2sdfs:ho}});var qn=f((ph,Cn)=>{function Tn(e="E"){class t extends Event{#t;constructor(n,i){super(n),this.#t=i}get data(){return this.#t}set data(n){this.#t=n}}return t}var Sn=Tn();function En(e="ET"){class t extends EventTarget{#t=new Map;addEventListener(n,i){super.addEventListener(n,i),this.#t.set(n,i)}ls(){return this.#t}removeEventListener(n){super.removeEventListener(n),this.#t.delete(n)}dispatch(n,i){let l=new Sn(n,i);return this.dispatchEvent(l),l}}return t}var po=En();Cn.exports={creat_event_cls:Tn,E:Sn,creat_event_target_cls:En,ET:po}});var li=f((gh,ii)=>{var Wn=Ut(),Ve=Xt(),pe=ls(),{ET:An}=qn(),go=["_fstch","_lsib","_rsib","_parent","_tree"];function Hn(e){return e._tree!==void 0}function as(e){return e._tree===e}function mo(e){return e._lsib===null}function bo(e){return e._rsib===null}function yo(e){return e._fstch===null}function $o(e){return e.$sibs(!0).length===1}function $t(e){return as(e)||!Hn(e)}function Nn(e){let t=e._fstch,r=t;for(;t!==null;)r=t,t=t._rsib;return r}function In(e,t){let r=0,n=t._fstch;for(;;){if(r===e)return n;if(n===null)return n;n=n._rsib,r=r+1}}function Dn(e,...t){let r=[],n=0,i=e._fstch;for(;;){if(t.includes(n))r.push(i);else if(i===null)return r;i=i._rsib,n=n+1}}function cs(e){let t=[],r=0,n=e._fstch;for(;;){if(n===null)return t;t.push(n),n=n._rsib,r=r+1}}function wo(e){let t=0,r=e._fstch;for(;;){if(r===null)return t;r=r._rsib,t=t+1}}function Gn(e,t=!1){let r=e._rsib,n=e;for(;r!==null;)n=r,r=r._rsib;return t||n!==e?n:null}function wt(e,t=!1){let r=os(e);if(r===null)return t?e:null;{let n=r._fstch;return t||n!==e?n:null}}function vo(e){let t=wt(e,!1);if(t===null)return null;{let r=t;for(;;){if(r._rsib===e)return r;r=r._rsib}}}function fs(e){let t=[],n=wt(e,!0);for(;n!==null;){if(n===e)return t;t.push(n),n=n._rsib}}function Un(e){let t=[],r=e._rsib;for(;r!==null;)t.push(r),r=r._rsib;return t}function Xn(e,t=!1){let r=fs(e),n=Un(e),i=[e],l;return t?l=r.concat(i,n):l=r.concat(n),l}function ko(e,t){let r=wt(t,!0),n=0;for(;;){if(r===null)return null;if(n==e)return r;r=r._rsib,n=n+1}}function xo(e,...t){return Xn(e,!0).filter((i,l)=>t.includes(l))}function On(e){return fs(e).length}function To(e,t=!1){return e.$sibs(t).length}function os(e){return Gn(e,!0)._parent}function So(e){let t=e,r=e;for(;t!==null;)r=t,t=t.$parent();return r}function Eo(e,t){let r=0,n=t;for(;n!==null;){if(r===e)return n;n=n.$parent(),r=r+1}return null}function bt(e,t=!1){let r=[],n=e;for(t&&r.push(n),n=n.$parent();n!==null;)r.push(n),n=n.$parent();return r}function Co(e,...t){return bt(e,!0).filter((i,l)=>t.includes(l))}function qo(e,t=!1){return bt(e,t).length}function Ao(e){let t=e.$parent();return t===null?null:t.$lsib()}function No(e){let t=e.$parent();return t===null?null:t.$rsib()}function Io(e){let t=e.$luncle();return e.$is_fstch()?t===null?null:t.$lstch():null}function Do(e){let t=e.$runcle();return e.$is_lstch()?t===null?null:t.$fstch():null}function Oo(e){let r=e.$root().$sdfs(),n=e.$depth();return r.filter(l=>l.$depth()===n)}function Lo(e){let t=e.$parent();return t===null?null:t.$breadth()}function Ro(e){return e.$lyr().indexOf(e)}function Po(e){let t=e.$sdfs();return t=t.filter(r=>r.$is_leaf()),t.length}function jo(e){let r=e.$root().$edfs(),n;if(e.$is_leaf())n=r.indexOf(e);else{let i=e.$dlmost_des();n=r.indexOf(i)}return r=r.slice(0,n+1),offset=r.filter(i=>i.$is_leaf()).length-1,offset}function Ln(e,t=!1){let r=Jn(e),n=me(e),i=n.indexOf(r);return t?n.slice(0,i+1):n.slice(1,i+1)}function Bo(e){let t=e.$deses(!1),r=t.map(i=>i.$depth()),n=Math.max(...r);return t=t.filter(i=>i.$depth()===n),t}function Fo(e,t){let r=t.$depth(),n=t.$deses(!1),i=n.map(l=>l.$depth());return n=n.filter(l=>l.$depth()===r+e),n}function Mo(e,...t){let r=e.$depth(),n=t.map(a=>a+r),i=e.$deses(!1),l=i.map(a=>a.$depth());return i=i.filter(a=>n.includes(a.$depth())),i}function us(e,t){if(!$t(t))return console.log("only root or uninited could be prepend"),t;let r=e.$is_leaf();if(t._tree=e._tree,t._lsib=null,r)t._rsib=null,t._parent=e;else{let n=e._fstch;n._lsib=void 0,t._rsib=n,t._parent=void 0}return e._fstch=t,t}function _s(e,t){if(!$t(t))return console.log("only root or uninited could be append"),t;let r=e.$is_leaf();if(t._tree=e._tree,t._rsib=null,r)e._fstch=t,t._lsib=null;else{let n=e.$lstch();n._parent=void 0,n._rsib=t,t._lsib=void 0}return t._parent=e,t}function zn(e,t){if(!$t(t))return console.log("only root or uninited could be add"),t;if(e.$is_root())return console.log("cant addrsib to root"),e;let r=e.$is_lstch();return t._tree=e._tree,r?(t._parent=e._parent,e._parent=void 0,t._rsib=null):(t._rsib=e._rsib,t._parent=void 0),e._rsib=t,t._lsib=void 0,t}function Yo(e,t){if(!$t(t))return console.log("only root or uninited could be add"),t;if(e.$is_root())return console.log("cant addlsib to root"),e;let r=e.$is_fstch();if(t._tree=e._tree,r){let n=e.$parent();e._lsib=void 0,t._lsib=null,n._fstch=t}else{let n=e.$lsib();n._rsib=t,t._lsib=void 0}return t._rsib=e,t._parent=void 0,t}function Rn(e,t,r){let n=cs(t),i=n.length;if(i===0)r=us(t,r);else if(!(e<=i&&e>=0))console.log("not in range!!");else if(e===0)r=us(t,r);else if(e===i)r=_s(t,r);else{let a=n[e-1];r=zn(a,r)}return r}function Wo(e){let t=e.$parent();for(;t!==null;){let r=t.$rsib();if(r!==null)return r;t=t.$parent()}return null}function Ho(e){let t=e.$fstch();if(t!==null)return t;{let r=e.$rsib();return r!==null?r:e.$rsib_of_fst_ance_having_rsib()}}function Jn(e){let t=e,r=e.$lstch();for(;r!==null;)t=r,r=r.$lstch();return t}function Go(e){if(e.$is_root())return null;if(e.$is_leaf()){let r=e.$lsib();return r!==null?r:e.$parent()}else{let r=e.$lsib();return r!==null?r.$is_leaf()?r:r.$drmost_des():e.$parent()}}function me(e){let t=e.$depth();if(e===null)return[];{let r=[e];for(e=e.$sdfs_next();e!==null&&e.$depth()>t;)r.push(e),e=e.$sdfs_next();return r}}function Uo(e){let t=e,r=e.$fstch();for(;r!==null;)t=r,r=r.$fstch();return t}function Xo(e){let t=e.$rsib();return t===null?e.$parent():t.$dlmost_des()}function zo(e){let t=e.$parent();for(;t!==null;){let r=t.$lsib();if(r!==null)return r;t=t.$parent()}return null}function Jo(e){if(e.$is_leaf()){let r=e.$lsib();return r===null?e.$lsib_of_fst_ance_having_lsib():r}else return e.$lstch()}function Vo(e){let t=[],r=e.$dlmost_des();for(;r!==null&&(t.push(r),r!==e);)r=r.$edfs_next();return t}function Vn(e){let t=e.$visited;if(e.$is_leaf())if(t){let n=e.$rsib();return n===null?e.$parent():n}else return e.$visited=!0,e;else if(t){let n=e.$rsib();return n===null?e.$parent():n}else return e.$visited=!0,e.$fstch()}function Ko(e,t){if(t.$is_leaf()){if(e)return t;{let n=t.$lsib();return n===null?t.$parent():n}}else{if(e)return t.$lstch();{let n=t.$lsib();return n===null?t.$parent():n}}}function Qo(e){e.$sdfs().forEach(r=>{delete r.$visited})}function Zo(e,t){return t.$visited&&e===t}function Pn(e){Qo(e);let t=[],r=new Set,n=e;for(;!Zo(n,e);)r.has(e)?e.$close_at=t.length:(e.$open_at=t.length,r.add(e)),t.push(e),e=Vn(e);return n.$close_at=t.length,t.push(n),t.forEach(i=>{delete i.$visited}),t}function eu(e){return e._fstch=null,e}function dt(e){return e._lsib=null,e._rsib=null,e._parent=null,e}function pt(e){let t=e.$sdfs();return t.forEach(r=>{r._tree=t[0]}),t}function ge(e){if(e.$is_root())return e;if(e.$is_lonely()){let r=e.$parent();eu(r);let n=pt(e);return dt(e),e}else if(e.$is_fstch()){let r=e.$rsib();r._lsib=null;let n=e.$parent();n._fstch=e._rsib;let i=pt(e);return dt(e),e}else if(e.$is_lstch()){let r=e.$lsib();r._rsib=e._rsib,r._parent=e._parent;let n=pt(e);return dt(e),e}else{let r=e.$lsib();r._rsib=e._rsib;let n=pt(e);return dt(e),e}}function jn(e){let t={};return t._nd=e,t._children=[],t}function Bn(e){let t=[],r=e[0],n=[jn(r)];for(n[0]._pbreadth=null;n.length>0;){let i=[];for(let a=0;a<n.length;a++){n[a]._breadth=a,n[a]._depth=t.length;let c=n[a]._nd.$children();c=c.map(o=>jn(o)),c.forEach((o,u)=>{o._pbreadth=n[a]._breadth,n[a]._children.push([t.length+1,i.length+u])}),i=i.concat(c)}let l=n;t.push(l),n=i}return t}function Fn(e,t="_children"){let r=e._nd,n={};n[t]=[],n.$guid=r.$guid;for(let i in r)Ve.is_cu_property(i)&&(n[i]=r[i]);return n}function tu(e,t="_children"){let r=e[0][0],n=Fn(r,t),i=[{d:n,ele:r}];for(;i.length>0;){let l=[];for(let a=0;a<i.length;a++){let c=i[a],o=c.d,u=c.ele,h=c.ele._children.map(m=>e[m[0]][m[1]]);for(let m=0;m<h.length;m++){let y=h[m],E=Fn(y,t);o[t].push(E);let Gs={d:E,ele:y};l.push(Gs)}}i=l}return n}function Mn(e,t="_children"){let r=new z;e.$guid!==void 0&&(r.$guid=e.$guid);for(let n in e)Ve.is_cu_property(n)&&t!==n&&(r[n]=e[n]);return r}function su(e,t="_children"){let r=Mn(e,t),n=[{d:e,nd:r}];for(;n.length>0;){let i=[];for(let l=0;l<n.length;l++){let a=n[l].d,c=n[l].nd,o=a[t]===void 0?[]:a[t];for(let u=0;u<o.length;u++){let _=o[u],h=Mn(_,t);c.$append_child(h);let m={d:_,nd:h};i.push(m)}}n=i}return r}function ru(e){let t=["_fstch","_lsib","_rsib","_parent","_tree","$guid","_guid","_id","$open_at","$close_at"];e._fstch=void 0,e._lsib=void 0,e._rsib=void 0,e._parent=void 0,e._tree=void 0,e.$guid=void 0,e._guid=void 0,e._id=void 0,e.$open_at=void 0,e.$close_at=void 0;for(let r of t)Object.defineProperty(e,r,{enumerable:!1})}function nu(e,t,r){let n=e.$depth();return" ".repeat(n)+"["+r.indexOf(e)+"] : "+e.$guid}function iu(e,t){let r=e.$depth(),n=" ".repeat(r),i="";return t===e.$open_at&&(i=n+"<"+e._id+" : "+e.$guid+">"),t===e.$close_at&&(i=n+"</"+e._id+" : "+e.$guid+">"),i}var lu=["$fstch","$rsib","$parent"];function au(e){if(e.$fstch()!==null)return["$fstch"];if(e.$rsib()!==null)return["$rsib"];{let n=[],i=e.$parent();for(;i!==null;)if(n.push("$parent"),i.$rsib()!==null){n.push("$rsib");break}else i=i.$parent();return n}}function cu(e){return e.$sdfs().map(n=>n.$sdfs_next_action_for_srch())}var Kn={$fstch:"$append_child",$rsib:"$add_rsib",$parent:"$parent"};function ou(e,t){for(let r=0;r<t.length;r++){let n=Kn[t[r]];e=e[n]()}return e}function uu(e){let t=new z,r=t;for(let n=0;n<e.length;n++){let i=e[n];r=ou(r,i)}return t}function _u(e,t,r){if(r&&(t=t.$clone()),!e.$is_root())if(e.$is_lonely()){let n=e.$parent();e.$disconn(),n.$append_child(t)}else if(e.$is_lstch()){let n=e.$lsib();e.$disconn(),n.$add_rsib(t)}else{let n=e.$rsib();e.$disconn(),n.$add_lsib(t)}return t}var O=class{#t=null;#e={with_id:!1,with_et:!1};constructor(t=!1,r=!1){ru(this),this._fstch=null,this.#e.with_id=t,this.#e.with_et=r,t&&(this.$guid=Ve.gen_guid()),r&&(this.#t=new An)}get opt(){return this.#e}enable_et(){this.#t=new An}disable_et(){this.#t=null}get et(){return this.#t}regis_recv_from_handler(t){let r=function(n){t(n.data.src,n.data.msg)};this.et.addEventListener("$msg__",r)}send_to(t,r){t.et.dispatch("$msg__",{src:this,msg:r})}$is_inited(){return Hn(this)}$is_root(){return as(this)}$is_fstch(){return mo(this)}$is_lstch(){return bo(this)}$is_leaf(){return yo(this)}$is_lonely(){return $o(this)}$fstch(){return this._fstch}$lstch(){return Nn(this)}$which_child(t){return In(t,this)}$some_children(...t){return Dn(this,...t)}$children(){return cs(this)}$children_count(){return wo(this)}$rsib(){return this._rsib}$lsib(){return vo(this)}$fstsib(t=!1){return wt(this,t)}$lstsib(t=!1){return Gn(this,t)}$psibs(){return fs(this)}$fsibs(){return Un(this)}$which_sib(t){return ko(t,this)}$some_sibs(...t){return xo(this,...t)}$sibseq(){return On(this)}$sibs(t=!1){return Xn(this,t)}$sibs_count(t=!1){return To(this,t)}$parent(){return os(this)}$root(){return So(this)}$ances(t=!1){return bt(this,t)}$which_ance(t){return Eo(t,this)}$some_ances(...t){return Co(this,...t)}$ances_count(t=!1){return qo(this,t)}$prepend_child(t){return t=t===void 0?new O(this.#e.with_id,this.#e.with_et):t,us(this,t)}$insert_child(t,r){return r=r===void 0?new O(this.#e.with_id,this.#e.with_et):r,Rn(t,this,r)}$append_child(t){return t=t===void 0?new O(this.#e.with_id,this.#e.with_et):t,_s(this,t)}$clone(){if(as(this)){let t=mt(this);return yt(t)}else{let t=On(this),r=os(this);ge(this);let n=mt(this),i=yt(n);return Rn(t,r,this),i}}$append_children(t,r){let n=[];for(let i=0;i<t;i++){let l=r===void 0?new O(this.#e.with_id,this.#e.with_et):r.$clone();l=_s(this,l),n.push(l)}return n}$add_rsib(t){return t=t===void 0?new O(this.#e.with_id,this.#e.with_et):t,zn(this,t)}$add_lsib(t){return t=t===void 0?new O(this.#e.with_id,this.#e.with_et):t,Yo(this,t)}$rsib_of_fst_ance_having_rsib(){return Wo(this)}$sdfs_next(){return Ho(this)}$drmost_des(){return Jn(this)}$sdfs_prev(){return Go(this)}$sdfs(){return me(this)}$dlmost_des(){return Uo(this)}$edfs_next(){return Xo(this)}$lsib_of_fst_ance_having_lsib(){return zo(this)}$edfs_prev(){return Jo(this)}$edfs(){return Vo(this)}$offset(){return jo(this)}$sedfs_next(){return Vn(this)}$sedfs_prev(t){return Ko(this)}$sedfs(){return Pn(this)}$deses(t=!1){return Ln(this,t)}$lst_lyr_deses(){return Bo(this)}$which_lyr_deses(t){return Fo(t,this)}$some_lyrs_deses(...t){return Mo(this,...t)}$count(t=!0){return Ln(this,t).length}$depth(t=!1){return bt(this,t).length}$height(){let t=this.$depth(),n=this.$sdfs().map(l=>l.$depth());return Math.max(...n)-t+1}$pbreadth(){return Lo(this)}$breadth(){return Ro(this)}$width(){return Po(this)}$lyr(){return Oo(this)}$lcin(){return Io(this)}$rcin(){return Do(this)}$luncle(){return Ao(this)}$runcle(){return No(this)}$sdfs_repr(t=nu,r=!1){let n=this.$root(),i=me(n),c=me(this).map((o,u)=>t(o,u,i)).join(`
3
+ `);if(console.log(c),r)return c}$sedfs_repr(t=iu,r=!1){let n=this.$root();Qn(n);let a=Pn(this).map((c,o)=>t(c,o)).join(`
4
+ `);if(console.log(a),r)return a}$disconn(){return ge(this)}$rm_fstch(){let t=this._fstch;return ge(t)}$rm_lstch(){let t=Nn(this);return ge(t)}$rm_which(t){let r=In(t,this);return ge(r)}$rm_some_children(...t){return Dn(this,...t).map(n=>ge(n))}$rm_all_children(){return cs(this).map(r=>ge(r))}$dump(){if(this.$is_root())return mt(this);console.log("only root !!!")}$dump2file(t){if(this.$is_root()){let r=mt(this);Wn.wjson(t,r)}else console.log("only root !!!")}$sdfs2mat(){return Bn(me(this))}$nest_dict(t="_children"){let r=Bn(me(this));return tu(r,t)}$index(){return this.$sibseq()}$sdfs_index(){return this.$root().$sdfs().indexOf(this)}$sdfs_leafs(){return this.$root().$sdfs().filter(i=>i.$is_leaf())}$sdfs_nonleafs(){return this.$root().$sdfs().filter(i=>!i.$is_leaf())}$sdfs_leaf_index(){return this.$sdfs_leafs().indexOf(this)}$sdfs_nonleaf_index(){return this.$sdfs_nonleafs().indexOf(this)}$sdfs_next_action_for_srch(){return au(this)}$sdfs_srch_action_list(){return cu(this)}$get_node_with_action(t){let r=this;for(let n=0;n<t.length;n++)r=r[t[n]]();return r}$replace_with(t,r=!0){return _u(this,t,r)}[Symbol.iterator](){return this.$sdfs()[Symbol.iterator]()}get[Symbol.toStringTag](){return this.$guid?this.$guid.substr(0,8):"<empty>"}};Object.defineProperty(O,"name",{value:"\u200D"});function Qn(e){let t=me(e);return t.forEach((r,n)=>{r._id=n}),t}function fu(e){let t=new z;return t._id=e._id,t.$guid=e._guid,t}function Yn(e,t){for(;t._id!==e;)t=t._parent;return t}function Je(e,t){let r=Zn(t);for(let n of r)e[n]=t[n];return e}function yt(e){let t=Ve.dict_keys(e)[0],r=pe.get_root(e[t],e),n=fu(r);n=Je(n,r);let i=n,l=r,a=pe.get_sdfs_next(l,e),c;for(;a!==null;)if(l._fstch===a._id)c=i.$prepend_child(),c._id=a._id,c.$guid=a._guid,c=Je(c,a),i=c,l=a,a=pe.get_sdfs_next(l,e);else if(l._rsib===a._id)c=i.$add_rsib(),c._id=a._id,c.$guid=a._guid,c=Je(c,a),i=c,l=a,a=pe.get_sdfs_next(l,e);else if(a._parent!==null&&a._parent!==void 0){let o=a._parent;i=Yn(o,i),c=i.$append_child(),c._id=a._id,c.$guid=a._guid,c=Je(c,a),i=c,l=a,a=pe.get_sdfs_next(l,e)}else if(a._parent===void 0){let u=pe.get_parent(a,e)._id;i=Yn(u,i),c=i.$append_child(),c._id=a._id,c.$guid=a._guid,c=Je(c,a),i=c,l=a,a=pe.get_sdfs_next(l,e)}else console.log("Impossible",i,l,a);return n}function gt(e,t){return e[t]===null?null:e[t]===void 0?void 0:e[t]._id}function Zn(e){return Ve.dict_keys(e).filter(n=>!go.includes(n))}function hu(e,t){let r=Zn(e);for(let n of r)t[n]=e[n];return t}function mt(e){let t=Qn(e),r=e._id,n={};return t.forEach((i,l)=>{let a={};a._tree=r,a._fstch=gt(i,"_fstch"),a._lsib=gt(i,"_lsib"),a._rsib=gt(i,"_rsib"),a._parent=gt(i,"_parent"),a._id=i._id,a._guid=i.$guid,a=hu(i,a),n[i._id]=a}),n}var z=class extends O{constructor(t=!0,r=!0){super(t,r),this._fstch=null,this._lsib=null,this._rsib=null,this._parent=null,this._tree=this}$is_parent_of(t){return t.$parent()===this}$is_root_of(t){return t.$root()===this}$is_descendant_of(t){return t.$deses(!1).indexOf(this)>=0}$is_inclusive_descendant_of(t){return t.$deses(!0).indexOf(this)>=0}$is_ancestor_of(t){return t.$ances(!1).indexOf(this)>=0}$is_inclusive_ancestor_of(t){return t.$ances(!0).indexOf(this)>=0}$is_sibling_of(t){return t.$sibs(!1).indexOf(this)>=0}$is_inclusive_siblings_of(t){return t.$sibs(!0).indexOf(this)>=0}$is_preceding_of(t){let r=t.$sdfs(),n=r.indexOf(t),i=r.indexof(this);return i>=0&&i<n}$is_following_of(t){let r=t.$sdfs(),n=r.indexOf(t);return r.indexof(this)>n}$is_first_child_of(t){return this===t.$fstch()}$is_child_of(t){return t.$children().indexOf(this)>=0}$is_last_child_of(t){return this===t.$lstch()}$is_previous_sibling_of(t){return this===t.$lsib()}$is_next_sibling_of(t){return this===t.$rsib()}};Object.defineProperty(z,"name",{value:"\u200D"});function ei(e){if(typeof e=="string"){let t=Wn.rjson(e);return yt(t)}else return typeof e=="object"?yt(e):new z}function du(e,t="_children"){return su(e,t)}function pu(e){let t=e.$dump();return ei(ndict)}function hs(e,t,...r){let n=t(e,...r);return n=new Buffer.from(n).toString("base64"),n}function ti(e){let t=e.$ances(!0).map(r=>r.$children().length);return t=t.join("-"),t}function si(e){return e.$pbreadth()+"-"+e.$breadth()+"-"+e.$depth()}function ri(e,t,...r){let n=ti(e);return t&&(out=hs(e,t,...r),n=n+"@"+out),n}function ni(e,t,...r){let n=si(e);return t&&(out=hs(e,t,...r),n=n+"@"+out),n}function ds(e,t,r,n,i,...l){let a=r.$sdfs(),c=n.$sdfs();if(a.length!==c.length)return!1;{let o=a.map(_=>t(_,i,...l)),u=c.map(_=>t(_,i,...l));e&&(o.sort(),u.sort());for(let _=0;_<o.length;_++){let h=o[_],m=u[_];if(h!==m)return!1}}return!0}function gu(e,t,r,...n){return ds(!1,ni,e,t,r,...n)}function mu(e,t,r,...n){return ds(!0,ri,e,t,r,...n)}ii.exports={SDFS_NEXT_BUILD_ACTION_DICT:Kn,build_from_srch_action_list:uu,SDFS_NEXT_SRCH_ACTIONS:lu,RESERVED_EVENT_TYPES:["$msg__"],Node:O,Tree:z,Root:z,load:ei,load_from_nest_dict:du,clone:pu,get_cu_sign:hs,get_internal_sign_ignore_order:ti,get_internal_sign_keep_order:si,get_sign_keep_order:ni,struct_eq:ds,struct_eq_keep_order:gu,get_sign_ignore_order:ri,struct_eq_ignore_order:mu}});var ps=f((mh,ai)=>{var bu=li(),yu=ls(),$u=Ut();ai.exports={ndfunc:yu,ndcls:bu,ndutil:$u}});var xt=f((Sh,oi)=>{var q=x(),wu=ps(),{Root:vu}=ps().ndcls,{TYPE_DICT:bh,isNode:yh,empty:g,is_bigint_str:$h,is_jsint_str:wh,NUM_TYPE_DICT:vh,parse_abnormal_num:kh,parse_int:xh,parse_float:Th,parse_num:ku,to_str:kt}=x(),L=class extends vu{constructor(t=g){super(!1,!1),this.key=t,this.value=g,this.type=g,this.chtype=g,this.hashes=new Set,this.kcmt=[],this.bvcmt=[],this.avcmt=[]}kto_str(){return this.key===g?g:JSON.stringify(this.key)}is_undefined(){return this.type===q.TYPE_DICT.UndefinedLiteral}is_null(){return this.type===q.TYPE_DICT.NullLiteral}is_boolean(){return this.type>=2&&this.type<=4}is_false(){return this.type===3}is_true(){return this.type===4}is_numerical(){return nd.type>=5&&nd.type<=11}is_int(){return this.type===6}is_float(){return this.type===7}is_bigint(){return this.type===8}is_infi(){return this.type===9||this.type===10}is_pos_infi(){return this.type===9}is_neg_infi(){return this.type===10}is_nan(){return this.type===11}is_str(){return this.type===12}is_ary(){return this.type===13}is_ele(){return this.chtype===14}is_dict(){return this.type===15}is_prop(){return this.chtype===16}is_ref(){return this.type===17}is_leaf(){return!this.is_ary()&&!this.is_dict()}is_cmt(){return this.is_lcmt()||this.is_blcmt()}is_lcmt(){return this.type>=18&&this.type<=22}is_blcmt(){return this.type>=23&&this.type<=27}is_ttcmt(){return this.type===19||this.type===24}is_kcmt(){return this.type===20||this.type===25}is_bvcmt(){return this.type===21||this.type===26}is_avcmt(){return this.type===22||this.type===27}is_prim(){return this.is_leaf()&&!is_cmt()}},gs=class extends L{constructor(t=g){super(t),this.value=void 0,this.type=q.TYPE_DICT.UndefinedLiteral}vto_rawstr(){return kt(this.value)}},ms=class extends L{constructor(t=g){super(t),this.value=null,this.type=q.TYPE_DICT.NullLiteral}vto_rawstr(){return kt(this.value)}},bs=class extends L{constructor(t,r=g){super(r),t==="true"&&(this.value=!0,this.type=q.TYPE_DICT.BooleanLiteral.TrueLiteral),t==="false"&&(this.value=!1,this.type=q.TYPE_DICT.BooleanLiteral.FalseLiteral)}vto_rawstr(){return kt(this.value)}},ys=class extends L{constructor(t,r=g){if(super(r),typeof t=="string"){let n=ku(t,!0);this.value=n.value,this.type=n.type}else this.value=t.value,this.type=t.type}vto_rawstr(){let t=kt(this.value);return this.type===q.TYPE_DICT.NumericLiteral.Float&&!t.includes(".")&&(t=t+"."),t}};function Ke(e){return e=JSON.stringify(e),e.substr(1,e.length-2)}var $s=class extends L{constructor(t,r=g){super(r),this.value=t,this.type=q.TYPE_DICT.StringLiteral}vto_rawstr(){return Ke(this.value)}};function xu(e){e instanceof vt?e.type=q.TYPE_DICT.CommentLine.tt:e.type=q.TYPE_DICT.CommentBlock.tt}function Tu(e,t){return{lsib:e.$lsib(),data:t}}function ci(e,t){xu(t);let r=Tu(e,t);return e.ttcmt.push(r),r}var ws=class extends L{constructor(t=g){super(t),this.value=[],this.type=q.TYPE_DICT.ArrayExpression._self,this.open=g,this.close=g,this.ttcmt=[]}is_inited(){return this.open===g&&this.close===g}is_opened(){return this.open!==g&&this.close===g}is_closed(){return this.open!==g&&this.close!==g}append_child(t){return t.chtype=q.TYPE_DICT.ArrayExpression.element,t.is_ref()?this.value.push(t.value.value):this.value.push(t.value),this.$append_child(t)}append_ttcmt(t){return ci(this,t)}},vs=class extends L{constructor(t=g){super(t),this.value={},this.type=q.TYPE_DICT.ObjectExpression._self,this.open=g,this.close=g,this.ttcmt=[]}is_inited(){return this.open===g&&this.close===g}is_opened(){return this.open!==g&&this.close===g}is_closed(){return this.open!==g&&this.close!==g}append_child(t){return t.chtype=q.TYPE_DICT.ObjectExpression.property,t.is_ref()?this.value[t.key]=t.value.value:this.value[t.key]=t.value,this.$append_child(t)}append_ttcmt(t){return ci(this,t)}},ks=class extends L{constructor(t,r=g){super(r),this.value=t,this.type=q.TYPE_DICT._Ref}vto_rawstr(){if(this.value.is_leaf())return this.value.vto_rawstr();if(this.value.key!==g)return'&"'+Ke(this.value.key)+'"';for(let t of this.value.hashes)return'&"'+Ke(t)+'"'}},vt=class extends L{constructor(t){super(),this.value=t,this.type=q.TYPE_DICT.CommentLine._self}vto_rawstr(t=`
5
+ `){return"//"+Ke(this.value)+t}},xs=class extends L{constructor(t){super(),this.value=t,this.type=q.TYPE_DICT.CommentBlock._self}vto_rawstr(){return"/*"+Ke(this.value)+"*/"}};oi.exports={UndefinedLiteral:gs,NullLiteral:ms,BooleanLiteral:bs,NumericLiteral:ys,StringLiteral:$s,ArrayExpression:ws,ObjectExpression:vs,_Ref:ks,CommentLine:vt,CommentBlock:xs,_ndtree:wu}});var gi=f((Eh,pi)=>{var{empty:Es}=x(),{UndefinedLiteral:ui,NullLiteral:_i,BooleanLiteral:fi,NumericLiteral:hi,StringLiteral:Ts,ArrayExpression:Su,ObjectExpression:Eu,CommentLine:Cu,CommentBlock:qu,_Ref:Ss}=xt();function Au(e,t){let r=Es,n=e;for(;n!==null;){if(n.key===t){r=n;break}else if(n.hashes.has(t)){r=n;break}else if(n.$sibseq().toString()===t){r=n;break}n=n.$sdfs_prev()}return r!==null?r:Es}function di(e,t){return e instanceof ui?new ui("undefined",t):e instanceof _i?new _i("null",t):e instanceof fi?new fi(e.vto_rawstr(),t):e instanceof hi?new hi(e.vto_rawstr(),t):e instanceof Ts?new Ts(e.value,t):e instanceof Cu||e instanceof qu?new Ts(e.value,t):e instanceof Su?new Ss(e,t):e instanceof Eu?new Ss(e,t):e instanceof Ss?(e=e.value,di(e,t)):Es}pi.exports={find_refnd_with_hash:Au,clone:di}});var Ci=f((Ch,be)=>{var Nu=Array,Iu=x(),{empty:w,parse0:Du}=x(),Ze=class extends Nu{get lst(){return this[this.length-1]}set lst(t){this[this.length-1]=t}get top(){return this[this.length-1]}set top(t){this[this.length-1]=t}get fst(){return this[0]}set fst(t){this[0]=t}get bot(){return this[0]}set bot(t){this[0]=t}*gen_from_lst(){for(let t=this.length-1;t>-1;t--)yield this[t]}};function*Ou(e){for(let t of e)yield t;e=null}function*Lu(e,t){yield*t,yield*e}var et=Gt(),Cs=ve(),Ce=Jr(),{UndefinedLiteral:Ru,NullLiteral:Pu,BooleanLiteral:mi,NumericLiteral:ju,StringLiteral:bi,CommentLine:Qe,CommentBlock:Bu,ArrayExpression:qs,ObjectExpression:Fu}=xt(),G=I(),yi=G.gtv,ne=G.STATE_DICT,As=G.LEFTED_TYPE,Ee=G.AVND_CACHE_STATE_DICT,H=x(),$=Z(),$i=gi();function*Si(e){for(;e.length>0;)yield e.pop()}function wi(e){let t;return e.__is_sync_mode()?t=et.from_generator(e.g,e.ch_cache.curr):t=et.from_generator(Si(e.unshift_cache),e.ch_cache.curr),t}function vi(e,t,r){e.lefted.type=As.quote,e.lefted.data={rslt:t.rslt,lefted:t.ch,state:t.state,quote:r},e.state=G.get_main_eofv_with_code(e.state)}function Ei(e,t,r){e.lefted.type=r,e.lefted.data={rslt:t.rslt,lefted:t.ch,state:t.state}}function Mu(e,t,r){return Ei(e,t,r),e.state=G.get_lcmt_eofv_with_code(e.state),e}function Yu(e,t,r){return Ei(e,t,r),e.state=G.get_blkcmt_eofv_with_code(e.state),e}function Wu(e,t){let r;return e.__is_sync_mode()?r=t(e.g,e.ch_cache.curr):r=t(Si(e.unshift_cache),e.ch_cache.curr),r}function ki(e,t,r,n){let i=Wu(e,r);return i.state!==Ce.STATE_DICT.succ?((t===Qe?Mu:Yu)(e,i,n),w):new t(i.rslt)}function xi(e,t){let r=new t(e.str_cache.k);return e.$set_avnd_cache(r),e.$mv_key_to_nd(r),e.$mv_kcmt_to_kcmt(),e.$mv_bvcmt_to_bvcmt(),r.open=e.ch_cache.curr,e.stack.lst.append_child(r),e.stack.push(r),t===qs?e.state=ne.bv:e.state=ne.bk,e}var Ns=Symbol("root_lblk_ch"),Ti=Symbol("root_rblk_ch"),qe=class{#t=yi(ne.bv);#e=new Ze;constructor(t,r=" "){if(r!==w){let i=Ou(r);t=Lu(t,i)}this.g=t,this.lefted={type:w,data:w},this.ch_cache={tmp:w,curr:w},this.str_cache={k:w,v:w,maybe_vquote:w},this.cmt_cache={kcmt:[],bvcmt:[],avcmt:[]};let n=new qs;this.stack.push(n),n.open=Ns,this.avnd_cache={state:Ee.handling,data:n},this.unshift_cache=new Ze,this.mode="sync"}__use_sync_mode(){this.mode="sync"}__use_async_mode(){this.mode="async"}__is_sync_mode(){return this.mode==="sync"}__is_async_mode(){return this.mode==="async"}__unshift_g(t){t=t??this.ch_cache.curr;for(let r of t)this.unshift_cache.unshift(r)}$has_yield_sign(){return this.avnd_cache.state===Ee.handled}$set_yield_sign(){this.avnd_cache.state=Ee.handled}$clear_yield_sign(){this.avnd_cache.state=Ee.handling}get state(){return this.#t}set state(t){this.#t=yi(t)}get stack(){return this.#e}$next_ch(){return this.unshift_cache.length>0?this.ch_cache.curr=this.unshift_cache.pop():this.ch_cache.curr=this.g.next().value,this.ch_cache.curr}$is_currch_eof(){return this.ch_cache.curr===void 0}$handle_main_eof(){return this.state=G.get_main_eofv_with_code(this.state),this}$is_currch_comma(){return $.commas.has(this.ch_cache.curr)}$is_currch_colon(){return $.colons.has(this.ch_cache.curr)}$is_currch_ws(){return Cs.is_ws(this.ch_cache.curr)}$is_currch_quote(){return $.quotes.has(this.ch_cache.curr)}$is_currch_slash(){return this.ch_cache.curr===$.slash}$is_currch_asterisk(){return this.ch_cache.curr===$.asterisk}$is_currch_ary_lblk(){return $.array_blks.lhas(this.ch_cache.curr)}$is_currch_obj_lblk(){return $.obj_blks.lhas(this.ch_cache.curr)}$is_currch_lblk(){return this.$is_currch_ary_lblk()||this.$is_currch_obj_lblk()}$is_currch_ary_rblk(){return $.array_blks.rhas(this.ch_cache.curr)}$is_currch_obj_rblk(){return $.obj_blks.rhas(this.ch_cache.curr)}$is_currch_rblk(){return this.$is_currch_ary_rblk()||this.$is_currch_obj_rblk()}$is_currch_hash(){return $.hash===this.ch_cache.curr}$is_currch_ref(){return $.ref===this.ch_cache.curr}$mv_avcmt_to_avcmt(){let t=this.avnd_cache.data;t.avcmt=this.cmt_cache.avcmt,this.cmt_cache.avcmt=[]}$change_state_when_end_av(t=w,r=w){return this.stack.lst.is_ary()?t===w?this.state=ne.bv:(this.state=ne.v,this.str_cache.v=t,r===w||(this.str_cache.maybe_vquote=r)):t===w?this.state=ne.bk:(this.state=ne.k,this.str_cache.k=t),this.state}$vcache_to_nd(){let t=this.str_cache.v,r;if(this.str_cache.maybe_vquote===w){let n=Du(t,{only_value:!1,with_value:!0,with_type:!0,unknown_as_string:!0});n.type===H.TYPE_DICT.UndefinedLiteral?r=new Ru(this.str_cache.k):n.type===H.TYPE_DICT.NullLiteral?r=new Pu(this.str_cache.k):n.type===H.TYPE_DICT.BooleanLiteral.TrueLiteral?r=new mi("true",this.str_cache.k):n.type===H.TYPE_DICT.BooleanLiteral.FalseLiteral?r=new mi("false",this.str_cache.k):n.type===H.TYPE_DICT.StringLiteral?r=new bi(n.value,this.str_cache.k):r=new ju(n,this.str_cache.k)}else r=new bi(t,this.str_cache.k);return this.str_cache.v=w,this.str_cache.maybe_vquote=w,r}$mv_kcmt_to_kcmt(){let t=this.avnd_cache.data;t.kcmt=this.cmt_cache.kcmt,this.cmt_cache.kcmt=[]}$mv_bvcmt_to_bvcmt(){let t=this.avnd_cache.data;t.bvcmt=this.cmt_cache.bvcmt,this.cmt_cache.bvcmt=[]}$mv_key_to_nd(){let t=this.avnd_cache.data;return t.key=this.str_cache.k,this.str_cache.k=w,t.key}$set_avnd_cache(t,r=Ee.handling){return this.avnd_cache.data=t,this.avnd_cache.state=r,this.avnd_cache}$setup_leafnd(){let t=this.$vcache_to_nd();this.$set_avnd_cache(t,Ee.handling),this.$mv_key_to_nd(),this.$mv_kcmt_to_kcmt(),this.$mv_bvcmt_to_bvcmt(),this.$mv_avcmt_to_avcmt(),this.stack.lst.append_child(t)}$handle_quote(t){let r=wi(this);return r.state!==et.STATE_DICT.succ?(vi(this,r,t),w):r.rslt}$abandon_key_when_end_bv(){this.cmt_cache.kcmt=[],this.cmt_cache.bvcmt=[],this.str_cache.k=w}$refresh_key(t=w){t===w?this.str_cache.k=this.ch_cache.curr:this.str_cache.k=t,this.cmt_cache.kcmt=[]}$handle_lcmt(){return ki(this,Qe,Ce.lc_from_generator,As.lcmt)}$handle_blkcmt(){return ki(this,Bu,Ce.blk_from_generator,As.blkcmt)}$push_kcmt(t){t.type=Ce instanceof Qe?H.TYPE_DICT.CommentLine.k:H.TYPE_DICT.CommentBlock.k,this.cmt_cache.kcmt.push(t)}$push_bvcmt(t){let r=t instanceof Qe?"CommentLine":"CommentBlock";t.type=H.TYPE_DICT[r].bv,this.cmt_cache.bvcmt.push(t)}$push_avcmt(t){t.type=Ce instanceof Qe?H.TYPE_DICT.CommentLine.k:H.TYPE_DICT.CommentBlock.k,this.cmt_cache.avcmt.push(t)}$mv_avcmt_to_ttcmt(t){t=t??this.avnd_cache.data.$parent();for(let r of this.cmt_cache.avcmt)t.$append_child(r);this.cmt_cache.avcmt=[]}$open_nonleaf_nd(){if($.array_blks.lhas(this.ch_cache.curr))return xi(this,qs);if($.obj_blks.lhas(this.ch_cache.curr))return xi(this,Fu)}$is_rblk_match(){let t=this.stack.lst,r=t.is_ary()?"array_blks":"obj_blks";return $[r].getl(this.ch_cache.curr)===t.open}$close_nonleaf_nd(){let t=this.stack.lst;t.close=this.ch_cache.curr,this.$set_avnd_cache(t),this.stack.pop(),this.state=ne.av}$get_hash_or_ref(t="#"){let r=w,n=this.$next_ch(),i="";for(;!Cs.is_ws(n)&&!$.commas.has(n)&&!$.colons.has(n)&&!$.array_blks.has(n)&&!$.obj_blks.has(n)&&n!==$.hash&&n!==$.ref&&n!==$.slash;)if($.quotes.has(n)){let l=wi(this);if(l.state!==et.STATE_DICT.succ)return vi(this,l,this.ch_cache.curr),t===$.hash?this.state=G.get_hash_quote_eofv_with_code(this.state):this.state=G.get_ref_quote_eofv_with_code(this.state),r;i=i+l.rslt,n=this.$next_ch()}else{if(n===void 0)return $handle_main_eof(),r;i=i+n,n=this.$next_ch()}return this.__unshift_g(n),r=i,r}$is_hash_of_pnd(){return this.stack.lst.$children().length===0}$find_ref(t){let r=this.stack.lst,n=r.$lstch();return n===null&&(n=r),$i.find_refnd_with_hash(n,t)}$add_ref_to_parent(t){let r=this.stack.lst,n=$i.clone(t,this.str_cache.k);this.$set_avnd_cache(n),this.$mv_key_to_nd(n),this.$mv_kcmt_to_kcmt(),this.$mv_bvcmt_to_bvcmt(),r.append_child(n)}};qe[Ns]=Ns;qe[Ti]=Ti;qe.MODES=["sync","async"];be.exports=qe;be.exports.Stack=Ze;be.exports._type_util=Iu;be.exports._esc=et;be.exports._cmt=Ce;be.exports._ws=Cs});var Ii=f((qh,Ni)=>{var{empty:qi}=x(),Ai=I(),Ae=Ai.gtv,U=Ai.STATE_DICT;function Hu(e){let t=e.state;return t===Ae(U.bk)||(t===Ae(U.k)||t===Ae(U.ak)?(e.str_cache.k=qi,e.state=U.bk):t===Ae(U.bv)?(e.$abandon_key_when_end_bv(),e.stack.lst.is_ary()?e.state=U.bv:e.state=U.bk):t===Ae(U.v)?(e.$setup_leafnd(),e.$change_state_when_end_av()):t===Ae(U.av)&&(e.$mv_avcmt_to_avcmt(),e.$change_state_when_end_av())),e}Ni.exports=Hu});var Li=f((Nh,Oi)=>{var{empty:Ah}=x(),Di=I(),Ne=Di.gtv,ie=Di.STATE_DICT;function Gu(e){let t=e.state;return t===Ne(ie.bk)||(t===Ne(ie.k)||t===Ne(ie.ak)?e.state=ie.bv:t===Ne(ie.bv)||(t===Ne(ie.v)?(e.$setup_leafnd(),e.$change_state_when_end_av()):t===Ne(ie.av)&&(e.$mv_avcmt_to_avcmt(),e.$change_state_when_end_av()))),e}Oi.exports=Gu});var Is=f((Dh,Pi)=>{var{empty:Ih}=x(),Ri=I(),Ie=Ri.gtv,le=Ri.STATE_DICT;function Uu(e){let t=e.state;return t===Ie(le.bk)||(t===Ie(le.k)?e.state=le.ak:t===Ie(le.ak)||t===Ie(le.bv)||(t===Ie(le.v)?(e.$setup_leafnd(),e.state=le.av):Ie(le.av))),e}Pi.exports=Uu});var Mi=f((Oh,Fi)=>{var{empty:ji}=x(),Bi=I(),De=Bi.gtv,J=Bi.STATE_DICT;function Xu(e,t){let r=e.state,n=e.$handle_quote(t);return n===ji||(r===De(J.bk)?(e.str_cache.k=n,e.state=J.k):r===De(J.k)?e.str_cache.k=e.str_cache.k+n:r===De(J.ak)?(e.$refresh_key(n),e.state=J.k):r===De(J.bv)?(e.str_cache.maybe_vquote=t,e.str_cache.v=n,e.state=J.v):r===De(J.v)?(e.str_cache.v=e.str_cache.v+n,e.str_cache.maybe_vquote=ji):r===De(J.av)&&(e.$mv_avcmt_to_avcmt(),e.$change_state_when_end_av(n,t))),e}Fi.exports=Xu});var Gi=f((Lh,Hi)=>{var{empty:Yi}=x(),Ds=I(),R=Ds.gtv,S=Ds.STATE_DICT,zu=Ds.LEFTED_TYPE,ye=Z();function Wi(e,t){let r=e.state,n=e[t]();if(n!==Yi){let i=e.stack.lst;if(r===R(S.bk))i.append_ttcmt(n);else if(r===R(S.k))e.$push_kcmt(n),e.state=S.ak;else if(r===R(S.ak))e.$push_kcmt(n);else if(r===R(S.bv))i.is_ary()?i.append_ttcmt(n):i.is_dict()&&e.$push_bvcmt(n);else if(r===R(S.v))e.$setup_leafnd(),e.state=S.av;else if(r===R(S.av)){let l=e.stack.lst;l.is_ary()?(l.append_ttcmt(n),e.state=S.bv):l.is_dict()&&e.$push_avcmt(n)}}return e}function Ju(e){return Wi(e,"$handle_lcmt")}function Vu(e){return Wi(e,"$handle_blkcmt")}function Ku(e){let t=e.state;t===R(S.bk)?(e.__unshift_g(e.ch_cache.curr),e.str_cache.k=ye.slash,e.state=S.k):t===R(S.k)?(e.__unshift_g(e.ch_cache.curr),e.str_cache.k=e.str_cache.k+ye.slash):t===R(S.ak)?(e.__unshift_g(e.ch_cache.curr),e.$refresh_key(ye.slash),e.state=S.k):t===R(S.bv)?(e.__unshift_g(e.ch_cache.curr),e.str_cache.v=ye.slash,e.state=S.v):t===R(S.v)?(e.__unshift_g(e.ch_cache.curr),e.str_cache.v=e.str_cache.v+ye.slash,e.str_cache.maybe_vquote=Yi):t===R(S.av)&&(e.$mv_avcmt_to_avcmt(),e.$change_state_when_end_av(ye.slash))}function Qu(e){let t=e.state,r=e.$next_ch();return e.$is_currch_eof()?(e.lefted.data=ye.slash,e.lefted.type=zu.backslash,e.$handle_main_eof()):e.$is_currch_slash()?Ju(e):e.$is_currch_asterisk()?Vu(e):Ku(e),e}Hi.exports=Qu});var zi=f((Ph,Xi)=>{var{empty:Rh}=x(),Ui=I(),Oe=Ui.gtv,ae=Ui.STATE_DICT;function Zu(e){let t=e.state;return t===Oe(ae.bk)?(e.str_cache.k=e.ch_cache.curr,e.state=ae.k):t===Oe(ae.k)?e.str_cache.k=e.str_cache.k+e.ch_cache.curr:t===Oe(ae.ak)?(e.$refresh_key(),e.state=ae.k):t===Oe(ae.bv)?e.$open_nonleaf_nd():t===Oe(ae.v)?(e.$setup_leafnd(),e.$change_state_when_end_av(),e.__unshift_g(e.ch_cache.curr)):t===Oe(ae.av)&&(e.$mv_avcmt_to_avcmt(),e.$change_state_when_end_av(),e.__unshift_g(e.ch_cache.curr)),e}Xi.exports=Zu});var Qi=f((jh,Ki)=>{var{empty:Ji}=x(),Vi=I(),Le=Vi.gtv,$e=Vi.STATE_DICT,e_=Is();function t_(e){let t=e.state;return t===Le($e.bk)?e.$close_nonleaf_nd():t===Le($e.k)?(e.str_cache.k=Ji,e.$close_nonleaf_nd()):t===Le($e.ak)?(e.$refresh_key(),e.str_cache.k=Ji,e.$close_nonleaf_nd()):t===Le($e.bv)?(e.$abandon_key_when_end_bv(),e.$close_nonleaf_nd()):t===Le($e.v)?(e.$setup_leafnd(),e.state=$e.av,e.__unshift_g(e.ch_cache.curr)):t===Le($e.av)&&(e.$has_yield_sign()?(e.$clear_yield_sign(),e.$close_nonleaf_nd()):(e.$mv_avcmt_to_avcmt(),e.$set_yield_sign(),e.__unshift_g(e.ch_cache.curr))),e}function s_(e){return e.$is_rblk_match()?t_(e):e_(e),e}Ki.exports=s_});var sl=f((Bh,tl)=>{var{empty:r_}=x(),el=I(),Re=el.gtv,ce=el.STATE_DICT,n_=Z(),{CommentLine:Zi}=xt();function i_(e){let t=e.state,r=e.$get_hash_or_ref(n_.hash);if(r!==r_){let n=e.stack.lst;if(t===Re(ce.bk))e.$is_hash_of_pnd()&&n.hashes.add(r);else if(t===Re(ce.k)){let i=new Zi(r);e.$push_kcmt(i),e.state=ce.ak}else if(t===Re(ce.ak)){let i=new Zi(r);e.$push_kcmt(i)}else t===Re(ce.bv)?e.$is_hash_of_pnd()&&n.is_ary()&&n.hashes.add(r):t===Re(ce.v)?(e.$setup_leafnd(),e.avnd_cache.data.hashes.add(r),e.state=ce.av):t===Re(ce.av)&&e.avnd_cache.data.hashes.add(r)}return e}tl.exports=i_});var il=f((Fh,nl)=>{var{empty:Os}=x(),rl=I(),Pe=rl.gtv,D=rl.STATE_DICT,l_=Z();function a_(e){let t=e.state,r=e.$get_hash_or_ref(l_.ref);if(r!==Os){let n=e.$find_ref(r);if(n!==Os){let i=e.stack.lst;t===Pe(D.bk)||t===Pe(D.k)||t===Pe(D.ak)?(e.$refresh_key(n.vto_rawstr()),e.state=D.ak):t===Pe(D.bv)?(e.$add_ref_to_parent(n),e.state=D.av):t===Pe(D.v)?(e.str_cache.maybe_vquote=Os,e.$setup_leafnd(),e.state=D.av):t===Pe(D.av)&&(e.$has_yield_sign()?(e.$clear_yield_sign(),i.is_ary()?(e.$add_ref_to_parent(n),e.state=D.av):i.is_dict()&&(e.str_cache.k=n.vto_rawstr(),e.state=D.ak)):(e.$mv_avcmt_to_avcmt(),e.$set_yield_sign()))}}return e}nl.exports=a_});var cl=f((Mh,al)=>{var{empty:c_}=x(),ll=I(),je=ll.gtv,V=ll.STATE_DICT;function o_(e){let t=e.state;return t===je(V.bk)?(e.str_cache.k=e.ch_cache.curr,e.state=V.k):t===je(V.k)?e.str_cache.k=e.str_cache.k+e.ch_cache.curr:t===je(V.ak)?(e.$refresh_key(),e.state=V.k):t===je(V.bv)?(e.str_cache.v=e.ch_cache.curr,e.state=V.v):t===je(V.v)?(e.str_cache.v=e.str_cache.v+e.ch_cache.curr,e.str_cache.maybe_vquote=c_):t===je(V.av)&&(e.$mv_avcmt_to_avcmt(),e.$change_state_when_end_av(),e.__unshift_g(e.ch_cache.curr)),e}al.exports=o_});var hl=f((Yh,fl)=>{var{empty:u_}=x(),__=Ci(),f_=Ii(),h_=Li(),d_=Is(),p_=Mi(),g_=Gi(),m_=zi(),b_=Qi(),y_=sl(),$_=il(),w_=cl(),_l=I(),ol=_l.gtv,ul=_l.STATE_DICT,v_=Z();function*k_(e,t=u_){let r=new __(e,t);for(;;)if(r.$next_ch(),r.$is_currch_eof()){r.$handle_main_eof(),yield r;break}else r.$is_currch_comma()?(f_(r),yield r):r.$is_currch_colon()?(h_(r),yield r):r.$is_currch_ws()?(d_(r),yield r):r.$is_currch_quote()?(p_(r,r.ch_cache.curr),yield r):r.$is_currch_slash()?(g_(r),yield r):r.$is_currch_lblk()?(m_(r),yield r):r.$is_currch_rblk()?(b_(r),yield r):r.$is_currch_hash()?(y_(r),yield r):r.$is_currch_ref()?r.state===ol(ul.av)||r.state===ol(ul.v)?r.__unshift_g(v_.fst_comma+r.ch_cache.curr):($_(r),yield r):(w_(r),yield r)}fl.exports=k_});var bl=f((Wh,ml)=>{var{sync_gen_from_str:Ls}=Sr(),{is_should_yield:Rs}=I(),j=Z(),{is_nl:x_,is_ws:dl}=ve(),Ps=hl(),T_={enable_ref:!1,encoding:"utf8"};function pl(e,t={enable_ref:!1}){let r=Ps(e),n=r.next().value,i=n.avnd_cache.data.$root(),l=n.state;for(let a of r){let c=a.state;if(Rs(n,l,c)&&!t.enable_ref){let o=n.avnd_cache.data;o.$disconn(),o=null}l=c}return i}function S_(e,t={enable_ref:!1}){let r=Ls(e);return pl(r,t)}function*gl(e,t={enable_ref:!1,encoding:"utf8"}){let r=Ps(e),n=r.next().value,i=n.state;for(let l of r){let a=l.state;if(Rs(n,i,a)&&!t.enable_ref){let c=n.avnd_cache.data;yield c,c.$disconn(),c=null}i=a}}function*E_(e,t={enable_ref:!1,encoding:"utf8"}){let r=Ls(e);yield*gl(r,t)}function C_(){return{d:void 0,ppg:void 0,prev:void 0,curr:void 0,can_send:!1,data:"",state:"init",label:"",pstate:""}}function q_(e){let t=Ls(""),r=Ps(t," "),n=r.next().value;n.__use_async_mode();let i=C_();return i.rt=n.avnd_cache.data,i.prev=n.state,i.ppg=r,i.d=n,i}function A_(e,t){return e.data=e.data+t,e.state==="init"?t===j.slash?e.state="slash":j.quotes.has(t)?(e.label=t,e.state="quote"):t===j.hash?e.state="hash":t===j.ref?e.state="ref":e.can_send=!0:e.state==="quote"?t==="\\"?(e.state="esc",e.pstate="quote"):t===e.label&&(e.pstate!==""?(e.state=e.pstate,e.pstate=""):e.can_send=!0):e.state==="slash"?t===j.slash?e.state="lcmt":t===j.asterisk?e.state="blkcmt":j.quotes.has(t)?(e.label=t,e.state="quote"):e.can_send=!0:e.state==="lcmt"?t==="\\"?(e.state="esc",e.pstate="lcmt"):x_(t)&&(e.can_send=!0):e.state==="blkcmt"?t==="\\"?(e.state="esc",e.pstate="blkcmt"):t===j.asterisk&&(e.state="asterisk"):e.state==="asterisk"?t==="\\"?(e.state="esc",e.pstate="blkcmt"):t===j.slash&&(e.can_send=!0):e.state==="hash"?dl(t)?e.can_send=!0:j.quotes.has(t)&&(e.state="quote",e.pstate="hash"):e.state==="ref"?dl(t)?e.can_send=!0:j.quotes.has(t)&&(e.state="quote",e.pstate="ref"):e.state==="esc"?(e.state=e.pstate,e.pstate=""):console.log("impossible"),e}async function*N_(e,t){for(let r of e)A_(t,r),t.can_send&&(yield t,t.data="",t.state="init",t.label="",t.can_send=!1)}async function*I_(e){let t=q_(e);for await(let r of e)yield*N_(r,t);yield t}function D_(e){let t=e.d.unshift_cache;t.forEach(r=>{e.prev=e.curr,e.d=e.ppg.next().value,e.curr=e.d.state}),t=null}async function*O_(e,t){if(e.d.__unshift_g(e.data),e.prev=e.curr,e.d=e.ppg.next().value,e.curr=e.d.state,Rs(e.d,e.prev,e.curr)&&!t.enable_ref){let r=e.d.avnd_cache.data;yield r,r.$disconn(),r=null}}async function*L_(e,t={enable_ref:!1,encoding:"utf8"}){e=I_(e);let r;for await(r of e)D_(r),yield*O_(r,t);yield r.rt}ml.exports={OPT_DICT:T_,parse_from_generator:pl,parse_from_str:S_,gen_from_generator:gl,gen_from_str:E_,agen_from_generator:L_}});var Tt=f((Hh,st)=>{var{empty:R_}=x(),P_=Z(),tt=bl();function js(e){return e.length===1?e[0]:e}function j_(){for(let e in tt){let t;e.startsWith("gen_")?t=function*(r,n={enable_ref:!1,encoding:"utf8"}){let i=tt[e](r,n);for(let l of i)l=js(l),yield[l.key,l.value]}:e.startsWith("agen_")?t=async function*(r,n={enable_ref:!1,encoding:"utf8"}){let i=tt[e](r,n);for await(let l of i)l=js(l),yield[l.key,l.value]}:t=function(r,n={enable_ref:!1,encoding:"utf8"}){let i=tt[e](r,n).value;return js(i)},Object.defineProperty(t,"name",{value:e}),st.exports[e]=t}st.exports.OPT_DICT=tt.OPT_DICT}j_();st.exports.CFG=P_;st.exports.empty=R_});var Be=f((Gh,yl)=>{var B_=e=>e.constructor.name==="AsyncFunction",F_=e=>typeof e!="string"||(e=e.trim(),e==="")?!1:!!(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("ws://")||e.startsWith("wss://")||e.startsWith("//")||e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||/^(data|blob|file|wasm):/i.test(e)),M_=e=>e.startsWith("http://")||e.startsWith("https://")||e.startsWith("ws://")||e.startsWith("wss://")||/^(data|blob|file|wasm):/i.test(e)?e:e.startsWith("//")||e.startsWith("/")||e.startsWith("./")||e.startsWith("../")?e.startsWith("//")?window.location.protocol+e:e.startsWith("/")?window.location.origin+e:new URL(e,window.location.href).href:e,Y_=()=>new Date().toISOString().replace(/[:.]/g,"-"),W_=/^(.*?)=["]?(.*)["]?$/,H_=(e=document.cookie)=>{let t=e.split("; "),r={};for(let n of t){let i=W_.exec(n);r[i[1]]=i[2]}return r};yl.exports={is_async:B_,is_url:F_,fullfill_url:M_,creat_dt_prefix:Y_,get_ck:H_}});var Ct=f((Uh,vl)=>{var{is_async:oe}=Be(),G_=e=>{let t=0;for(;e&&e.parentNode;)e=e.parentNode,t++;return t},U_=(e,t)=>{if(t>0){let r=1;for(;;){let n=e.parentNode;if(r===t)return n;e=n,++r}}else return e},X_=e=>{for(;e.parentNode;)e=e.parentNode;return e},K=e=>e.firstChild===null||e.firstChild===void 0,St=(e,t=K)=>{let r=0;for(;!t(e);)e=e.lastChild,++r;return[e,r]},Et=(e,t=K)=>{let r=0;for(;!t(e);)e=e.firstChild,++r;return[e,r]},$l=(e,t)=>{if(e.nextSibling)return[e.nextSibling,t];let r=e.parentNode,n=t;for(;r;){if(n-=1,r.nextSibling)return[r.nextSibling,n];r=r.parentNode}return[null,-1]},z_=async(e,t=(n,i)=>{},r=K)=>{let[n,i]=St(e,r),l=e,a=oe(t),c=0;for(;;){let o=!1;if(a?o=await t(l,c):o=t(l,c),o||l===n)return;if(!r(l))++c,l=l.firstChild;else{let u=$l(l,c);if(l=u[0],l)c=u[1];else break}}},wl=(e,t)=>{if(e.prevSibling)return[e.prevSibling,t];let r=e.parentNode,n=t;for(;r;){if(n-=1,r.prevSibling)return[r.prevSibling,n];r=r.parentNode}return[null,-1]},J_=async(e,t=(n,i)=>{},r=K)=>{let[n,i]=Et(e,r),l=e,a=oe(t),c=0;for(;;){let o=!1;if(a?o=await t(l,c):o=t(l,c),o||l===n)return;if(!r(l))++c,l=l.lastChild;else{let u=wl(l,c);if(l=u[0],l)c=u[1];else break}}},V_=async(e,t=(n,i)=>{},r=K)=>{let[n,i]=Et(e,r),l=oe(t);for(;;){let a=!1;if(l?a=await t(n,i):a=t(n,i),a||n===e)return;{let c=n.nextSibling;if(c){let o=Et(c,r);i+=o[1],n=o[0]}else{let o=n.parentNode;if(o)--i,n=o;else break}}}},K_=async(e,t=(n,i)=>{},r=K)=>{let[n,i]=St(e,r),l=oe(t);for(;;){let a=!1;if(l?a=await t(n,i):a=t(n,i),a||n===e)return;{let c=n.prevSibling;if(c){let o=St(c,r);i+=o[1],n=o[0]}else{let o=n.parentNode;if(o)--i,n=o;else break}}}},Q_=async(e,t=(i,l)=>{},r=(i,l)=>{},n=K)=>{let i=e,l="open",a={open:[r,oe(r)],clos:[t,oe(t)]},c=0;for(;;){let o=!1,[u,_]=a[l];if(l==="open"){if(_?o=await u(i,c):o=u(i,c),o)return;n(i)?l="clos":(i=i.firstChild,++c)}else{let h,m,y,E=i.nextSibling;if(E?(y="open",h=E,m=c):(y="clos",h=i.parentNode,m=c-1),_?o=await u(i,c):o=u(i,c),o)return;if(i!==e)l=y,i=h,c=m;else break}}},Z_=async(e,t=(i,l)=>{},r=(i,l)=>{},n=K)=>{let i=e,l="open",a={open:[r,oe(r)],clos:[t,oe(t)]},c=0;for(;;){let o=!1,[u,_]=a[l];if(l==="open"){if(_?o=await u(i,c):o=u(i,c),o)return;n(i)?l="clos":(i=i.lastChild,++c)}else{let h,m,y,E=i.prevSibling;if(E?(y="open",h=E,m=c):(y="clos",h=i.parentNode,m=c-1),_?o=await u(i,c):o=u(i,c),o)return;if(i!==e)l=y,i=h,c=m;else break}}};vl.exports={get_depth:G_,get_ance:U_,get_rt:X_,is_topo_leaf:K,get_drmost:St,get_dlmost:Et,find_rb_of_fst_ance_has_rb:$l,editonly_sdfs_for_each:z_,find_lb_of_fst_ance_has_lb:wl,editonly_rsdfs_for_each:J_,editonly_edfs_for_each:V_,editonly_redfs_for_each:K_,visit:Q_,rvisit:Z_}});var xl=f((Xh,kl)=>{var ef=new Set(["html","head","body","title","meta","link","base","style","header","footer","nav","main","section","article","aside","h1","h2","h3","h4","h5","h6","address","p","hr","pre","blockquote","ol","ul","li","dl","dt","dd","figure","figcaption","div","a","em","strong","small","s","cite","q","dfn","abbr","ruby","rt","rp","data","time","code","var","samp","kbd","sub","sup","i","b","u","mark","bdi","bdo","span","br","wbr","ins","del","img","iframe","embed","object","param","video","audio","source","track","picture","map","area","canvas","svg","table","caption","colgroup","col","thead","tbody","tfoot","tr","th","td","form","label","input","button","select","datalist","optgroup","option","textarea","output","progress","meter","fieldset","legend","details","summary","dialog","script","noscript","template","slot"]),tf=new Set(["class","rel","sandbox","allow","headers","aria-describedby","aria-labelledby"]);kl.exports={TAGS:ef,NEED_TO_SP_ATTR_NMS:tf}});var Al=f((zh,ql)=>{var{TAGS:sf,NEED_TO_SP_ATTR_NMS:rf}=xl(),{is_url:Tl,fullfill_url:nf}=Be(),{editonly_sdfs_for_each:N,is_topo_leaf:Fs}=Ct(),Sl=(e,t)=>{let r=[e];for(let n of t){let i=[];for(let l of r){let a=l.children;for(let c=0;c<a.length;c++){let o=a[c];o.tagName.toLowerCase()===n&&i.push(o)}}if(i.length===0)return[];r=i}return r},El=(e,t)=>{let r=[],n=t.length;function i(l,a){let c=a;l.nodeType===1&&l.tagName.toLowerCase()===t[a]&&(c=a+1,c===n&&r.push(l));let o=l.children;if(o)for(let u=0;u<o.length;u++)i(o[u],c)}return i(e,0),r},Bs=async(e,t,r=Fs)=>{let n=[];return await N(e,async(i,l)=>{if(i.tagName){if(t.test(i.tagName))n.push(i);else if(i.attributes){for(let a of i.attributes)if(t.test(a.name)){n.push(i);break}}}},r),n},lf=async(e,t=Fs)=>{let r=new Set,n=new Set,i=new Set,l=new Set,a=new Set;return await N(e,async(c,o)=>{if(c.nodeType===Node.ELEMENT_NODE){if(r.add(c.tagName.toLowerCase()),c.attributes)for(let u of c.attributes)if(n.add(u.name.toLowerCase()),rf.has(u.name.toLowerCase())){let _=u.value.split(/[ ]+/g);for(let h of _)i.add(h)}else i.add(u.value)}else c.nodeType===Node.TEXT_NODE?l.add(c.nodeValue):c.nodeType===Node.COMMENT_NODE&&a.add(c.nodeValue)},t),{tags:Array.from(r),keys:Array.from(n),vals:Array.from(i),txts:Array.from(l),cmts:Array.from(a)}},Cl=async(e,t,r=Fs)=>{if(typeof t=="string")if(t[0]==="#"){let n=[];return await N(e,async(i,l)=>{if(i.tagName){let a=t.slice(1),c=i.getAttribute("id");a===c&&n.push(i)}},r),n}else if(t[0]==="."){let n=[];return await N(e,async(i,l)=>{if(i.tagName){let a=t.slice(1);i.getAttribute("class").split(/[ ]+/g).map(o=>o.toLowerCase()).includes(a)&&n.push(i)}},r),n}else if(t[0]==="`"){let n=[];return await N(e,async(i,l)=>{if(i.nodeType===Node.TEXT_NODE){let a=t.slice(1);node.nodeValue.includes(a)&&n.push(i)}},r),n}else if(t[0]==="!"){let n=[];return await N(e,async(i,l)=>{if(i.nodeType===Node.ELEMENT_NODE&&typeof i.click=="function"){let a=i.tagName.toLowerCase();["html","head","meta","link","style","script"].includes(a)||a.includes(t.slice(1).toLowerCase())&&n.push(i)}},r),n}else if(t[0]==="@"){let n=[];return await N(e,async(i,l)=>{if(i.tagName&&i.attributes)for(let a of i.attributes){let o=a.value.split(/[ ]+/g),u=t.slice(1);for(let _ of o)if(Tl(_)&&_.includes(u)){n.push(i);break}}},r),n}else if(t[0]==="-"){let n={};return await N(e,async(i,l)=>{if(i.tagName&&i.attributes){for(let a of i.attributes)if(a.name.startsWith("data-")){let c=a.name.slice(5);if(c.includes(t.slice(1))){let o=a.value;try{o=JSON.parse(o)}catch{}n[c]?n[c].push(o):n[c]=[o]}}}},r),n}else{if(t[0]==="*")return lf(e,r);if(t[0]==="&"){let n=[];return await N(e,async(i,l)=>{if(i.tagName&&i.attributes)for(let a of i.attributes){let o=a.value.split(/[ ]+/g),u=t.slice(1);for(let _ of o)Tl(_)&&_.includes(u)&&n.push(nf(_))}},r),n}else if(t.slice(0,2)==="//"){let n=[];return await N(e,async(i,l)=>{if(i.nodeType===Node.COMMENT_NODE){let a=t.slice(2);node.nodeValue.toLowerCase().includes(a.toLowerCase())&&n.push(i)}},r),n}else if(t.slice(0,2)==="?:"){let n=[];return await N(e,async(i,l)=>{if(i.tagName&&i.attributes){for(let a of i.attributes)if(t.slice(2).toLowerCase()===a.name.toLowerCase()){n.push(i);break}}},r),n}else if(t.slice(0,2)===":?"){let n=[];return await N(e,async(i,l)=>{if(i.tagName&&i.attributes){for(let a of i.attributes)if(a.value.includes(t.slice(2))){n.push(i);break}}},r),n}else if(t[0]==="/"){let n=t.split("/").filter(l=>l!==""),i=Sl(document,n);return i.length===0?await Bs(e,new RegExp(t),r):i}else if(t.includes("/")){let n=t.split("/").filter(i=>i!=="");return El(document,n)}else{let n=[];return await N(e,async(i,l)=>{(i.tagName?i.tagName.toLowerCase()===t.toLowerCase():!1)&&n.push(i)},r),n}}else{if(t instanceof RegExp)return await Bs(e,t,r);{let n=[];return is_async(t)?await N(e,async(i,l)=>{await t(i,l)&&n.push(i)},r):await N(e,async(i,l)=>{t(i,l)&&n.push(i)},r),n}}},af=new Proxy(document,{get(e,t,r){return sf.has(t.toLowerCase())||t[0]==="*"||t[0]==="&"||t[0]==="-"||t[0]==="#"||t[0]==="."||t[0]==="?"||t[0]===":"||t[0]==="@"||t[0]==="!"||t.includes("/")?Cl(document,t):Reflect.get(e,t,r)}});ql.exports={plget:Sl,plinget:El,filter_on_tag_or_attr_key_with_rgx:Bs,filter:Cl,$:af}});var qt=f((Jh,Nl)=>{var cf=Tt(),of=(e,t=!1)=>{let r=e.split("-");for(let n=1;n<r.length;++n)r[n]=r[n].charAt(0).toUpperCase()+r[n].slice(1);return t&&(r[0]=r[0].charAt(0).toUpperCase()+r[0].slice(1)),r.join("")},uf=e=>e.replace(/-/g,"_"),_f=(e,t)=>typeof e=="string"?(e=e.trim().toLowerCase(),e==="false"||e==="0"||e==="no"||e==="off"||e==="fls"||e==="f"||e==="null"||e==="nul"||e==="none"||e==="nu"||e==="n"?!1:e==="true"||e==="1"||e==="yes"||e==="on"||e==="tru"||e==="t"||e==="y"?!0:e===""||e==="undefined"||e==="un"||e==="default"||e==="dflt"?!!t:!!e):e===void 0?!!t:!!e,ff=e=>{let t=e.replace(/[^0-9.-]/g,"");return parseFloat(t)},hf=e=>cf.parse_from_str(e+" ");Nl.exports={dash_to_camel:of,dash_to_snake:uf,attr_value_to_bool:_f,css_str_to_num:ff,parse_json_input:hf}});var Rl=f((Vh,Ll)=>{var Il=()=>new Promise(e=>{requestAnimationFrame(()=>{e()})}),df=async e=>{for(let t=0;t<e;++t)await Il()},pf=async(e=0)=>new Promise(t=>{setTimeout(()=>{t()},e)}),At=class{timers={};run(t,r,n=300){this.timers[t]&&clearTimeout(this.timers[t]),this.timers[t]=setTimeout(async()=>{await r(),delete this.timers[t]},n)}cancel(t){this.timers[t]&&(clearTimeout(this.timers[t]),delete this.timers[t])}},Dl=()=>new At,Ol=Dl(),gf=(e,t,r=300)=>{Ol.run(e,t,r)},mf=e=>{Ol.cancel(e)};Ll.exports={wait_for_layout_ready:Il,wait_for_n_raf:df,wait:pf,SimpleDebounce:At,creat_simple_debounce:Dl,simple_debounce:gf,cancel_simple_debounce:mf}});var Bl=f((Kh,jl)=>{var{dash_to_camel:Nt}=qt(),Pl=(e,t,r=!1)=>{let n=Nt(t,r)+"Element";e.constructor.prototype.hasOwnProperty(n)||Object.defineProperty(e.constructor.prototype,n,{get:function(){let i=this.shadowRoot;return i?i.querySelector(`.${t}`):null}})},bf=(e,t)=>{for(let r of t)Pl(e,r,!1)},yf=e=>{for(let t in DYN_CLSES){{let n="all"+Nt(t,!0)+"Elements";e.constructor.prototype.hasOwnProperty(n)||Object.defineProperty(e.constructor.prototype,n,{get:function(){let i=this.shadowRoot;return i?i.querySelectorAll(`.${t}`):null}})}let r=DYN_CLSES[t];for(let n of r){let i=Nt(n,!0),l="get"+Nt(t,!0)+"ElementBy"+i;e.constructor.prototype.hasOwnProperty(l)||(e.constructor.prototype[l]=function(a){let c=this.shadowRoot;return c?c.querySelector(`.${t}[${n}="${a}"]`):null})}}};jl.exports={add_one_fixed_element_getter:Pl,add_fixed_element_getters:bf,add_dyn_element_getters:yf}});var Ml=f((Qh,Fl)=>{var $f=Tt(),{dash_to_snake:wf,css_str_to_num:vf}=qt(),kf=(e,t)=>{let r=Object.keys(t);for(let n of ATTRS_KEYS){let i=wf(n),l=t[n],a=l.type;e.prototype.hasOwnProperty(i)||(a==="boolean"?Object.defineProperty(e.prototype,i,{get:function(){return attr_value_to_bool(this.getAttribute(n),l.default)},set:function(c){this.setAttribute(n,c?"true":"false")}}):a==="number"?Object.defineProperty(e.prototype,i,{get:function(){let c=this.getAttribute(n);return c?Number(c):l.default},set:function(c){this.setAttribute(n,String(c))}}):Array.isArray(a)&&a.includes("cssnum")&&a.includes("number")?Object.defineProperty(e.prototype,i,{get:function(){return vf(this.getAttribute(n))},set:function(c){isNaN(Number(c))?this.setAttribute(n,c):this.setAttribute(n,String(c)+"px")}}):a==="json"?Object.defineProperty(e.prototype,i,{get:function(){let c=this.getAttribute(n);return c?$f.parse_from_str(c):l.default},set:function(c){this.setAttribute(n,JSON.stringify(c))}}):Object.defineProperty(e.prototype,i,{get:function(){return this.getAttribute(n)||l.default},set:function(c){this.setAttribute(n,c)}}))}};Fl.exports={add_attr_accessors_to_cls:kf}});var Wl=f((Zh,Yl)=>{var Ms=class{css=`
6
6
  position: fixed;
7
7
  top: 0;
8
8
  left: 0;
@@ -12,19 +12,19 @@ var nvbasicbw=(()=>{var o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports
12
12
  border: none;
13
13
  margin: 0;
14
14
  padding: 0;
15
- `;is_ok(t,r,n){return t.style[r]=`${n}px`,t.getBoundingClientRect()[r]===n}find_upbound(t,r){let n=1;for(;this.is_ok(t,r,n);)n*=2;return n}mx(t,r){t.style.cssText=this.css,document.body.appendChild(t);let n=this.find_upbound(t,r),i=Math.floor(n/2);for(;i+1<n;){let l=Math.floor((i+n)/2);this.is_ok(t,r,l)?i=l:n=l}return document.body.removeChild(t),i}},rt=()=>{let e=document.createElement("div"),t=new Ys,r=t.mx(e,"width"),n=t.mx(e,"height");return[r,n]},bf=(e,t)=>{let[r,n]=rt(),i=document.createElement(e);return i.style.width=`${r}px`,i.style.height=`${t}px`,i},yf=(e,t)=>{let[r,n]=rt(),i=document.createElement(e);return i.style.width=`${t}px`,i.style.height=`${n}px`,i},$f=e=>{let[t,r]=rt(),n=document.createElement(e);return n.style.width=`${t}px`,n.style.height=`${r}px`,n},vf=(e,t="height")=>{let[r,n]=rt();return Math.floor(r/e)};Pl.exports={find_mx_wh:rt,creat_mxw_ele:bf,creat_mxh_ele:yf,creat_mxwh_ele:$f,calc_mx_cnt:vf}});var Fs=o((Gh,Fl)=>{var{fullfill_url:Bl}=Be(),wf=async()=>{let e=document.querySelectorAll("script"),t=[];for(let i of e)if(i.src)t.push(fetch(i.src).then(l=>l.ok?l.text():"").catch(()=>""));else{let l=i.textContent;l.trim()&&t.push(Promise.resolve(l))}return`<script>
15
+ `;is_ok(t,r,n){return t.style[r]=`${n}px`,t.getBoundingClientRect()[r]===n}find_upbound(t,r){let n=1;for(;this.is_ok(t,r,n);)n*=2;return n}mx(t,r){t.style.cssText=this.css,document.body.appendChild(t);let n=this.find_upbound(t,r),i=Math.floor(n/2);for(;i+1<n;){let l=Math.floor((i+n)/2);this.is_ok(t,r,l)?i=l:n=l}return document.body.removeChild(t),i}},rt=()=>{let e=document.createElement("div"),t=new Ms,r=t.mx(e,"width"),n=t.mx(e,"height");return[r,n]},xf=(e,t)=>{let[r,n]=rt(),i=document.createElement(e);return i.style.width=`${r}px`,i.style.height=`${t}px`,i},Tf=(e,t)=>{let[r,n]=rt(),i=document.createElement(e);return i.style.width=`${t}px`,i.style.height=`${n}px`,i},Sf=e=>{let[t,r]=rt(),n=document.createElement(e);return n.style.width=`${t}px`,n.style.height=`${r}px`,n},Ef=(e,t="height")=>{let[r,n]=rt();return Math.floor(r/e)};Yl.exports={find_mx_wh:rt,creat_mxw_ele:xf,creat_mxh_ele:Tf,creat_mxwh_ele:Sf,calc_mx_cnt:Ef}});var Ys=f((ed,Ul)=>{var{fullfill_url:Hl}=Be(),Cf=async()=>{let e=document.querySelectorAll("script"),t=[];for(let i of e)if(i.src)t.push(fetch(i.src).then(l=>l.ok?l.text():"").catch(()=>""));else{let l=i.textContent;l.trim()&&t.push(Promise.resolve(l))}return`<script>
16
16
  ${(await Promise.all(t)).filter(i=>i).join(`
17
17
 
18
18
  `)}
19
- <\/script>`},kf=async()=>{let e="";for(let t of document.querySelectorAll('link[rel="stylesheet"]'))if(t.href)try{e+=await(await fetch(t.href)).text()+`
19
+ <\/script>`},qf=async()=>{let e="";for(let t of document.querySelectorAll('link[rel="stylesheet"]'))if(t.href)try{e+=await(await fetch(t.href)).text()+`
20
20
  `}catch{}for(let t of document.querySelectorAll("style"))e+=t.outerHtml+`
21
- `;return e},xf=(e=document)=>{let t=new Set;return e.querySelectorAll("img[src]").forEach(r=>{t.add(Bl(r.getAttribute("src")))}),e.querySelectorAll("img[srcset]").forEach(r=>{let n=r.getAttribute("srcset");if(n)for(let i of n.split(",")){let[l]=i.trim().split(/\s+/);l&&t.add(Bl(l))}}),e.querySelectorAll("svg").forEach(r=>{let n=new XMLSerializer().serializeToString(r),i=new Blob([n],{type:"image/svg+xml"}),l=URL.createObjectURL(i);t.add([l,".svg"])}),e.querySelectorAll("*").forEach(r=>{let n=getComputedStyle(r).backgroundImage;if(!n||n==="none")return;let i=n.match(/url\(["']?(.*?)["']?\)/);i&&i[1]&&t.add(i[1])}),Array.from(t).filter(Boolean)},Yl=(e,t)=>{if(e instanceof CSSStyleRule){let r=e.style;for(let n=0;n<r.length;n++){let i=r[n];if(i.startsWith("--")){let l=r.getPropertyValue(i).trim();l&&(t[i]=l)}}}else if(e instanceof CSSMediaRule||e instanceof CSSSupportsRule||e instanceof CSSKeyframesRule){let r=e.cssRules||e.rules;if(r)for(let n=0;n<r.length;n++)Yl(r[n],t)}else if(e instanceof CSSFontFaceRule){let r=e.style;for(let n=0;n<r.length;n++){let i=r[n];if(i.startsWith("--")){let l=r.getPropertyValue(i).trim();l&&(t[i]=l)}}}},Tf=()=>{let e={},t=document.styleSheets;for(let r=0;r<t.length;r++){let n=t[r],i="";n.href?i=n.href:n.ownerNode?n.ownerNode.tagName==="STYLE"?i="inline-style":n.ownerNode.tagName==="LINK"?i=n.ownerNode.href||"external-stylesheet":i="unknown":i="unknown",e[i]||(e[i]={});try{let l=n.cssRules||n.rules;if(!l)continue;for(let c=0;c<l.length;c++){let a=l[c];Yl(a,e[i])}}catch(l){console.warn(`\u65E0\u6CD5\u8BBF\u95EE\u6837\u5F0F\u8868 ${i} \u7684\u89C4\u5219:`,l)}}return e};Fl.exports={get_all_scripts:wf,get_all_csses:kf,collect_img_like_urls:xf,get_all_css_vars:Tf}});var Ms=o((Hh,Hl)=>{var Ml={success:"#38a169",error:"#e53e3e",warning:"#d69e2e",loading:"#3182ce",info:"#667eea"},Sf=e=>`
21
+ `;return e},Af=(e=document,t=r=>!0)=>{let r=new Set;return e.querySelectorAll("img[src]").forEach(n=>{t(n)&&r.add(Hl(n.getAttribute("src")))}),e.querySelectorAll("img[srcset]").forEach(n=>{if(t(n)){let i=n.getAttribute("srcset");if(!i)return;for(let l of i.split(",")){let[a]=l.trim().split(/\s+/);a&&r.add(Hl(a))}}}),e.querySelectorAll("svg").forEach(n=>{if(t(n)){let i=new XMLSerializer().serializeToString(n),l=new Blob([i],{type:"image/svg+xml"}),a=URL.createObjectURL(l);r.add([a,".svg"])}}),e.querySelectorAll("*").forEach(n=>{if(t(n)){let i=getComputedStyle(n).backgroundImage;if(!i||i==="none")return;let l=i.match(/url\(["']?(.*?)["']?\)/);l&&l[1]&&r.add(l[1])}}),Array.from(r).filter(Boolean)},Gl=(e,t)=>{if(e instanceof CSSStyleRule){let r=e.style;for(let n=0;n<r.length;n++){let i=r[n];if(i.startsWith("--")){let l=r.getPropertyValue(i).trim();l&&(t[i]=l)}}}else if(e instanceof CSSMediaRule||e instanceof CSSSupportsRule||e instanceof CSSKeyframesRule){let r=e.cssRules||e.rules;if(r)for(let n=0;n<r.length;n++)Gl(r[n],t)}else if(e instanceof CSSFontFaceRule){let r=e.style;for(let n=0;n<r.length;n++){let i=r[n];if(i.startsWith("--")){let l=r.getPropertyValue(i).trim();l&&(t[i]=l)}}}},Nf=()=>{let e={},t=document.styleSheets;for(let r=0;r<t.length;r++){let n=t[r],i="";n.href?i=n.href:n.ownerNode?n.ownerNode.tagName==="STYLE"?i="inline-style":n.ownerNode.tagName==="LINK"?i=n.ownerNode.href||"external-stylesheet":i="unknown":i="unknown",e[i]||(e[i]={});try{let l=n.cssRules||n.rules;if(!l)continue;for(let a=0;a<l.length;a++){let c=l[a];Gl(c,e[i])}}catch(l){console.warn(`\u65E0\u6CD5\u8BBF\u95EE\u6837\u5F0F\u8868 ${i} \u7684\u89C4\u5219:`,l)}}return e};Ul.exports={get_all_scripts:Cf,get_all_csses:qf,collect_img_like_urls:Af,get_all_css_vars:Nf}});var Hs=f((td,Kl)=>{var Xl={success:"#38a169",error:"#e53e3e",warning:"#d69e2e",loading:"#3182ce",info:"#667eea"},If=e=>`
22
22
  position: fixed;
23
23
  top: 50%;
24
24
  left: 50%;
25
25
  width: 300px;
26
26
  height:80px;
27
- background: ${Ml[e]||Ml.info};
27
+ background: ${Xl[e]||Xl.info};
28
28
  color: white;
29
29
  padding: 12px 20px;
30
30
  border-radius: 8px;
@@ -36,4 +36,4 @@ ${(await Promise.all(t)).filter(i=>i).join(`
36
36
  align-items: center;
37
37
  justify-content: center;
38
38
  font-size: 16px; /* \u5B57\u4F53\u53D8\u5927 */
39
- `,Ef=(e,t)=>{let r=document.createElement("div");return r.style.cssText=Sf(e),r.textContent=t,document.body.appendChild(r),r},Nt=class{tasks={};del(t){let r=this.tasks[t];if(!r)return;let{init_timer:n,duration_timer:i,ele:l}=r;clearTimeout(n),clearTimeout(i),l&&document.body.contains(l)&&document.body.removeChild(l),delete this.tasks[t]}add(t,r,n="error",i=1e3,l=100){this.del(t);let c={};this.tasks[t]=c,c.init_timer=setTimeout(()=>{c.ele=Ef(n,r),c.duration_timer=setTimeout(()=>{this.del(t)},i)},l)}},Wl=()=>new Nt,Gl=Wl(),Cf=(e,t,r="error",n=1e3,i=100)=>{Gl.add(e,t,r,n,i)},qf=e=>{Gl.del(e)},Af=async(e,t=async(n,i)=>{console.log(n)},r=99999)=>{let n=`${Date.now()}_${Math.floor(Math.random()*1e4)}`,i=`confirm-overlay-${n}`,l=`confirm-dialog-${n}`,c=document.createElement("div");c.className=i,Object.assign(c.style,{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:String(r)});let a=document.createElement("div");a.className=l,Object.assign(a.style,{backgroundColor:"white",borderRadius:"8px",padding:"20px",width:"300px",boxShadow:"0 5px 15px rgba(0, 0, 0, 0.3)",fontFamily:"Arial, sans-serif"});let _=document.createElement("h3");_.textContent=e,_.style.margin="0 0 20px 0",_.style.color="#333",_.style.fontSize="18px";let u=document.createElement("div");u.style.display="flex",u.style.justifyContent="flex-end",u.style.gap="10px";let f=document.createElement("button");f.textContent="\u53D6\u6D88",Object.assign(f.style,{padding:"8px 16px",backgroundColor:"#f5f5f5",border:"1px solid #ddd",borderRadius:"4px",cursor:"pointer",fontSize:"14px"});let g=document.createElement("button");g.textContent="\u786E\u8BA4",Object.assign(g.style,{padding:"8px 16px",backgroundColor:"#3498db",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"14px"});let $=async A=>{try{await t(A,a)}catch(j){console.error("Dialog callback error:",j)}finally{a.remove(),c.remove()}};return f.addEventListener("click",()=>$(!1)),g.addEventListener("click",()=>$(!0)),c.addEventListener("click",A=>{A.target===c&&$(!1)}),u.appendChild(f),u.appendChild(g),a.appendChild(_),a.appendChild(u),c.appendChild(a),document.body.appendChild(c),a};Hl.exports={SimpleAlert:Nt,creat_simple_alert:Wl,simple_alert:Cf,cancel_simple_alert:qf,simple_confirm_cancel:Af}});var Vl=o((Xh,Jl)=>{var{creat_dt_prefix:Xl}=Be(),{simple_alert:Nf}=Ms(),{collect_img_like_urls:If}=Fs(),zl=async(e,t,r)=>{if(!r)try{r=await window.showDirectoryPicker()}catch(n){return[!1,String(n.stack)]}try{let i=await(await r.getFileHandle(t,{create:!0})).createWritable();return await i.write(e),await i.close(),[!0,null]}catch(n){return[!1,String(n.stack)]}},Ul=async(e,t,r,n)=>{if(r)Array.isArray(e)&&(e=e[0]);else if(Array.isArray(e))r=Xl()+"_inline"+e[1],e=e[0];else{let l=new URL(e).pathname.split("/");r=Xl()+"_"+l[l.length-1]}if(!t)try{dir=await window.showDirectoryPicker()}catch(i){n&&n.fails.push([e,String(i.stack)])}try{let l=await(await fetch(e)).blob(),[c,a]=await zl(l,r,t);n&&(c?n.succs.push(e):n.fails.push([e,String(a)]))}catch(i){n&&n.fails.push([e,String(i.stack)])}},Df=async(e=t=>!0)=>{let t=[],r=[],n=await window.showDirectoryPicker(),i=If(document),l=Array.from(new Set(i));for(let c of l)await Ul(c,n,void 0,{succs:t,fails:r});return Nf("dnld_img_like",JSON.stringify({succs:t,fails:r},null,2),"success"),{succs:t,fails:r}};Jl.exports={save_blob:zl,fetch_save:Ul,dnld_img_like:Df}});var Xf=o((zh,Kl)=>{var Lf=Tt(),Of=Be(),Rf=Ps(),Pf=Tl(),jf=Ct(),Bf=Nl(),Yf=Ll(),Ff=Rl(),Mf=jl(),Wf=Fs(),Gf=Ms(),Hf=Vl();Kl.exports={_ison:Lf,_util:Of,_nd:Rf,_ele:Pf,_attr:jf,_wait:Bf,_ele_getter:Yf,_cls_accessor:Ff,_limit:Mf,_code:Wf,_ui:Gf,_dnld:Hf}});return Xf();})();
39
+ `,Df=(e,t)=>{let r=document.createElement("div");return r.style.cssText=If(e),r.textContent=t,document.body.appendChild(r),r},It=class{tasks={};del(t){let r=this.tasks[t];if(!r)return;let{init_timer:n,duration_timer:i,ele:l}=r;clearTimeout(n),clearTimeout(i),l&&document.body.contains(l)&&document.body.removeChild(l),delete this.tasks[t]}add(t,r,n="error",i=1e3,l=100){this.del(t);let a={};this.tasks[t]=a,a.init_timer=setTimeout(()=>{a.ele=Df(n,r),a.duration_timer=setTimeout(()=>{this.del(t)},i)},l)}},zl=()=>new It,Jl=zl(),Of=(e,t,r="error",n=1e3,i=100)=>{Jl.add(e,t,r,n,i)},Lf=e=>{Jl.del(e)},Rf=async(e,t=async(n,i)=>{console.log(n)},r=99999)=>{let n=`${Date.now()}_${Math.floor(Math.random()*1e4)}`,i=`confirm-overlay-${n}`,l=`confirm-dialog-${n}`,a=document.createElement("div");a.className=i,Object.assign(a.style,{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:String(r)});let c=document.createElement("div");c.className=l,Object.assign(c.style,{backgroundColor:"white",borderRadius:"8px",padding:"20px",width:"300px",boxShadow:"0 5px 15px rgba(0, 0, 0, 0.3)",fontFamily:"Arial, sans-serif"});let o=document.createElement("h3");o.textContent=e,o.style.margin="0 0 20px 0",o.style.color="#333",o.style.fontSize="18px";let u=document.createElement("div");u.style.display="flex",u.style.justifyContent="flex-end",u.style.gap="10px";let _=document.createElement("button");_.textContent="\u53D6\u6D88",Object.assign(_.style,{padding:"8px 16px",backgroundColor:"#f5f5f5",border:"1px solid #ddd",borderRadius:"4px",cursor:"pointer",fontSize:"14px"});let h=document.createElement("button");h.textContent="\u786E\u8BA4",Object.assign(h.style,{padding:"8px 16px",backgroundColor:"#3498db",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"14px"});let m=async y=>{try{await t(y,c)}catch(E){console.error("Dialog callback error:",E)}finally{c.remove(),a.remove()}};return _.addEventListener("click",()=>m(!1)),h.addEventListener("click",()=>m(!0)),a.addEventListener("click",y=>{y.target===a&&m(!1)}),u.appendChild(_),u.appendChild(h),c.appendChild(o),c.appendChild(u),a.appendChild(c),document.body.appendChild(a),c},Vl=async e=>{let t=document.createElement("div");Object.assign(t.style,{position:"fixed",inset:"0",backgroundColor:"rgba(0,0,0,0.85)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:"100000",backdropFilter:"blur(4px)",overflow:"hidden"});let r=await e,n=r instanceof HTMLElement?r:new Image;typeof r=="string"&&(n.src=r),Object.assign(n.style,{maxWidth:"90%",maxHeight:"90%",objectFit:"contain",border:"1px solid #555",boxShadow:"0 8px 30px rgba(0,0,0,0.5)",backgroundColor:"#fff"});let i=document.createElement("div");Object.assign(i.style,{position:"fixed",top:"30px",right:"30px",display:"flex",height:"40px",background:"#222",borderRadius:"20px",boxShadow:"0 4px 15px rgba(0,0,0,0.8)",zIndex:"100001",overflow:"hidden",border:"1px solid #444"});let l=document.createElement("div");l.innerHTML="\u283F",Object.assign(l.style,{padding:"0 15px",cursor:"move",backgroundColor:"#333",height:"100%",display:"flex",alignItems:"center",color:"#888"});let a=document.createElement("div");a.innerText="\u4FDD\u5B58\u622A\u56FE",Object.assign(a.style,{padding:"0 15px",cursor:"pointer",height:"100%",display:"flex",alignItems:"center",fontSize:"13px",fontWeight:"bold",backgroundColor:"#2f54eb",color:"#fff",borderRight:"1px solid #444"}),a.onclick=async()=>{let _=await window.showSaveFilePicker({suggestedName:`screenshot_${new Date().getTime()}.png`,types:[{description:"PNG Image",accept:{"image/png":[".png"]}}]}),m=await(await fetch(n.src)).blob(),y=await _.createWritable();await y.write(m),await y.close()};let c=document.createElement("div");c.innerText="\u5173\u95ED",Object.assign(c.style,{padding:"0 15px",cursor:"pointer",height:"100%",display:"flex",alignItems:"center",fontSize:"13px",fontWeight:"bold",backgroundColor:"#ff4d4f",color:"#fff"}),c.onclick=()=>{t.remove(),i.remove(),window.onmousemove=null,window.onmouseup=null};let o=!1,u={x:0,y:0};l.onmousedown=_=>{o=!0,u.x=_.clientX-i.offsetLeft,u.y=_.clientY-i.offsetTop},window.onmousemove=_=>{o&&(i.style.left=_.clientX-u.x+"px",i.style.top=_.clientY-u.y+"px",i.style.right="auto")},window.onmouseup=()=>o=!1,i.append(l,a,c),t.appendChild(n),document.body.append(t,i)},Ws=async(e,t)=>{if(t==="b64")return e.toDataURL("image/png");let r=await new Promise(n=>e.toBlob(n,"image/png"));switch(t){case"url":return URL.createObjectURL(r);case"u8a":return new Uint8Array(await r.arrayBuffer());case"ab":return await r.arrayBuffer();case"img":return new Promise((n,i)=>{let l=new Image,a=URL.createObjectURL(r);l.onload=()=>{URL.revokeObjectURL(a),n(l)},l.onerror=i,l.src=a,l.crossOrigin="anonymous"});default:return r}},Pf=async(e,t=void 0)=>{if(!e||!(e instanceof HTMLElement)){console.error("\u65E0\u6548\u7684\u5143\u7D20\u5BF9\u8C61");return}let r=e.style.outline,n=e.style.transition;try{e.style.transition="outline 0.2s ease",e.style.outline="4px solid #2f54eb",e.style.outlineOffset="2px",e.scrollIntoView({block:"center",behavior:"instant"});let i=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},preferCurrentTab:!0}),l=document.createElement("video");l.srcObject=i,await l.play();let a=l.videoWidth/window.innerWidth,c=l.videoHeight/window.innerHeight,o=e.getBoundingClientRect(),u=document.createElement("canvas");if(u.width=o.width*a,u.height=o.height*c,u.getContext("2d").drawImage(l,o.left*a,o.top*c,o.width*a,o.height*c,0,0,u.width,u.height),i.getTracks().forEach(h=>h.stop()),e.style.outline=r,e.style.transition=n,t===void 0){let h=await Ws(u,"img");Vl(h);return}return await Ws(u,t)}catch(i){e.style.outline=r,e.style.transition=n,i.name==="NotAllowedError"?console.warn("\u7528\u6237\u53D6\u6D88\u4E86\u5C4F\u5E55\u5171\u4EAB\u6388\u6743\u6216\u6743\u9650\u88AB\u62D2\u7EDD"):i.name==="NotFoundError"?console.error("\u672A\u627E\u5230\u53EF\u7528\u7684\u5A92\u4F53\u6D41\u6E90"):console.error("\u622A\u56FE\u53D1\u751F\u610F\u5916\u9519\u8BEF:",i)}};Kl.exports={SimpleAlert:It,creat_simple_alert:zl,simple_alert:Of,cancel_simple_alert:Lf,simple_confirm_cancel:Rf,show_img_modal:Vl,convert_canvas:Ws,ele2img:Pf}});var sa=f((sd,ta)=>{var{creat_dt_prefix:Ql}=Be(),{simple_alert:jf}=Hs(),{collect_img_like_urls:Bf}=Ys(),{visit:Ff}=Ct(),Zl=async(e,t,r)=>{if(!r)try{r=await window.showDirectoryPicker()}catch(n){return[!1,String(n.stack)]}try{let i=await(await r.getFileHandle(t,{create:!0})).createWritable();return await i.write(e),await i.close(),[!0,null]}catch(n){return[!1,String(n.stack)]}},ea=async(e,t,r,n)=>{if(r)Array.isArray(e)&&(e=e[0]);else if(Array.isArray(e))r=Ql()+"_inline"+e[1],e=e[0];else{let l=new URL(e).pathname.split("/");r=Ql()+"_"+l[l.length-1]}if(!t)try{dir=await window.showDirectoryPicker()}catch(i){n&&n.fails.push([e,String(i.stack)])}try{let l=await(await fetch(e)).blob(),[a,c]=await Zl(l,r,t);n&&(a?n.succs.push(e):n.fails.push([e,String(c)]))}catch(i){n&&n.fails.push([e,String(i.stack)])}},Mf=async(e=t=>!0)=>{let t=[],r=[],n=await window.showDirectoryPicker(),i=Bf(document,e),l=Array.from(new Set(i));for(let a of l)await ea(a,n,void 0,{succs:t,fails:r});return jf("dnld_img_like",JSON.stringify({succs:t,fails:r},null,2),"success"),{succs:t,fails:r}},Yf=async(e=document.body,t=100,r=100,n=i=>!0)=>{try{let i=await window.showDirectoryPicker(),l=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},preferCurrentTab:!0}),a=document.createElement("video");a.srcObject=l,await a.play();let c=a.videoWidth/window.innerWidth,o=a.videoHeight/window.innerHeight,u=[];await Ff(e,(_,h)=>{_.nodeType===1&&_.offsetWidth>=t&&_.offsetHeight>=r&&n(_)&&u.push({el:_,depth:h})},(_,h)=>{}),console.log(`[Scanner] \u5F00\u59CB\u81EA\u52A8\u4FDD\u5B58 ${u.length} \u5F20\u56FE\u7247\u5230\u76EE\u5F55...`);for(let _=0;_<u.length;_++){let{el:h,depth:m}=u[_];h.scrollIntoView({block:"center",behavior:"instant"}),await new Promise(Dt=>setTimeout(Dt,100));let y=h.getBoundingClientRect(),E=document.createElement("canvas");E.width=y.width*c,E.height=y.height*o,E.getContext("2d").drawImage(a,y.left*c,y.top*o,y.width*c,y.height*o,0,0,E.width,E.height);let Us=`dep${m}_${h.tagName.toLowerCase()}_${_}.png`,na=await new Promise(Dt=>E.toBlob(Dt,"image/png")),Xs=await(await i.getFileHandle(Us,{create:!0})).createWritable();await Xs.write(na),await Xs.close(),console.log(`\u5DF2\u81EA\u52A8\u5199\u5165: ${Us}`)}l.getTracks().forEach(_=>_.stop()),console.log("\u6279\u91CF\u4FDD\u5B58\u4EFB\u52A1\u5B8C\u6210\uFF01")}catch(i){if(i.name==="AbortError")return;console.error("\u6279\u91CF\u4FDD\u5B58\u5931\u8D25:",i)}};ta.exports={save_blob:Zl,fetch_save:ea,dnld_img_like:Mf,take_photo_for_all_eles:Yf}});var th=f((rd,ra)=>{var Wf=Tt(),Hf=Be(),Gf=Ct(),Uf=Al(),Xf=qt(),zf=Rl(),Jf=Bl(),Vf=Ml(),Kf=Wl(),Qf=Ys(),Zf=Hs(),eh=sa();ra.exports={_ison:Wf,_util:Hf,_nd:Gf,_ele:Uf,_attr:Xf,_wait:zf,_ele_getter:Jf,_cls_accessor:Vf,_limit:Kf,_code:Qf,_ui:Zf,_dnld:eh}});return th();})();