@zyui/components 0.0.127 → 0.0.128

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Yge=Object.defineProperty;var Kge=(o,s,i)=>s in o?Yge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i;var zc=(o,s,i)=>Kge(o,typeof s!="symbol"?s+"":s,i);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("vue"),On=require("element-plus"),Xge="0.0.127";var Jge=Object.defineProperty,Qge=(o,s,i)=>s in o?Jge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i,Bee=(o,s,i)=>Qge(o,typeof s!="symbol"?s+"":s,i);function Lce(o,s){return function(){return o.apply(s,arguments)}}const{toString:ehe}=Object.prototype,{getPrototypeOf:Zne}=Object,eU=(o=>s=>{const i=ehe.call(s);return o[i]||(o[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Rh=o=>(o=o.toLowerCase(),s=>eU(s)===o),tU=o=>s=>typeof s===o,{isArray:w4}=Array,sB=tU("undefined");function the(o){return o!==null&&!sB(o)&&o.constructor!==null&&!sB(o.constructor)&&wp(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const Vce=Rh("ArrayBuffer");function nhe(o){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(o):s=o&&o.buffer&&Vce(o.buffer),s}const ohe=tU("string"),wp=tU("function"),Hce=tU("number"),nU=o=>o!==null&&typeof o=="object",she=o=>o===!0||o===!1,KH=o=>{if(eU(o)!=="object")return!1;const s=Zne(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)},rhe=Rh("Date"),ahe=Rh("File"),ihe=Rh("Blob"),lhe=Rh("FileList"),che=o=>nU(o)&&wp(o.pipe),uhe=o=>{let s;return o&&(typeof FormData=="function"&&o instanceof FormData||wp(o.append)&&((s=eU(o))==="formdata"||s==="object"&&wp(o.toString)&&o.toString()==="[object FormData]"))},dhe=Rh("URLSearchParams"),[fhe,mhe,phe,ghe]=["ReadableStream","Request","Response","Headers"].map(Rh),hhe=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function yB(o,s,{allOwnKeys:i=!1}={}){if(o===null||typeof o>"u")return;let u,m;if(typeof o!="object"&&(o=[o]),w4(o))for(u=0,m=o.length;u<m;u++)s.call(null,o[u],u,o);else{const h=i?Object.getOwnPropertyNames(o):Object.keys(o),b=h.length;let C;for(u=0;u<b;u++)C=h[u],s.call(null,o[C],C,o)}}function zce(o,s){s=s.toLowerCase();const i=Object.keys(o);let u=i.length,m;for(;u-- >0;)if(m=i[u],s===m.toLowerCase())return m;return null}const gE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Uce=o=>!sB(o)&&o!==gE;function Zte(){const{caseless:o}=Uce(this)&&this||{},s={},i=(u,m)=>{const h=o&&zce(s,m)||m;KH(s[h])&&KH(u)?s[h]=Zte(s[h],u):KH(u)?s[h]=Zte({},u):w4(u)?s[h]=u.slice():s[h]=u};for(let u=0,m=arguments.length;u<m;u++)arguments[u]&&yB(arguments[u],i);return s}const vhe=(o,s,i,{allOwnKeys:u}={})=>(yB(s,(m,h)=>{i&&wp(m)?o[h]=Lce(m,i):o[h]=m},{allOwnKeys:u}),o),bhe=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),yhe=(o,s,i,u)=>{o.prototype=Object.create(s.prototype,u),o.prototype.constructor=o,Object.defineProperty(o,"super",{value:s.prototype}),i&&Object.assign(o.prototype,i)},whe=(o,s,i,u)=>{let m,h,b;const C={};if(s=s||{},o==null)return s;do{for(m=Object.getOwnPropertyNames(o),h=m.length;h-- >0;)b=m[h],(!u||u(b,o,s))&&!C[b]&&(s[b]=o[b],C[b]=!0);o=i!==!1&&Zne(o)}while(o&&(!i||i(o,s))&&o!==Object.prototype);return s},Che=(o,s,i)=>{o=String(o),(i===void 0||i>o.length)&&(i=o.length),i-=s.length;const u=o.indexOf(s,i);return u!==-1&&u===i},She=o=>{if(!o)return null;if(w4(o))return o;let s=o.length;if(!Hce(s))return null;const i=new Array(s);for(;s-- >0;)i[s]=o[s];return i},xhe=(o=>s=>o&&s instanceof o)(typeof Uint8Array<"u"&&Zne(Uint8Array)),Ehe=(o,s)=>{const i=(o&&o[Symbol.iterator]).call(o);let u;for(;(u=i.next())&&!u.done;){const m=u.value;s.call(o,m[0],m[1])}},_he=(o,s)=>{let i;const u=[];for(;(i=o.exec(s))!==null;)u.push(i);return u},khe=Rh("HTMLFormElement"),The=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,i,u){return i.toUpperCase()+u}),Ure=(({hasOwnProperty:o})=>(s,i)=>o.call(s,i))(Object.prototype),Ahe=Rh("RegExp"),jce=(o,s)=>{const i=Object.getOwnPropertyDescriptors(o),u={};yB(i,(m,h)=>{let b;(b=s(m,h,o))!==!1&&(u[h]=b||m)}),Object.defineProperties(o,u)},Nhe=o=>{jce(o,(s,i)=>{if(wp(o)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const u=o[i];if(wp(u)){if(s.enumerable=!1,"writable"in s){s.writable=!1;return}s.set||(s.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},Ohe=(o,s)=>{const i={},u=m=>{m.forEach(h=>{i[h]=!0})};return w4(o)?u(o):u(String(o).split(s)),i},$he=()=>{},Dhe=(o,s)=>o!=null&&Number.isFinite(o=+o)?o:s,Ree="abcdefghijklmnopqrstuvwxyz",jre="0123456789",Wce={DIGIT:jre,ALPHA:Ree,ALPHA_DIGIT:Ree+Ree.toUpperCase()+jre},Mhe=(o=16,s=Wce.ALPHA_DIGIT)=>{let i="";const{length:u}=s;for(;o--;)i+=s[Math.random()*u|0];return i};function Bhe(o){return!!(o&&wp(o.append)&&o[Symbol.toStringTag]==="FormData"&&o[Symbol.iterator])}const Rhe=o=>{const s=new Array(10),i=(u,m)=>{if(nU(u)){if(s.indexOf(u)>=0)return;if(!("toJSON"in u)){s[m]=u;const h=w4(u)?[]:{};return yB(u,(b,C)=>{const S=i(b,m+1);!sB(S)&&(h[C]=S)}),s[m]=void 0,h}}return u};return i(o,0)},Ihe=Rh("AsyncFunction"),Phe=o=>o&&(nU(o)||wp(o))&&wp(o.then)&&wp(o.catch),Zce=((o,s)=>o?setImmediate:s?((i,u)=>(gE.addEventListener("message",({source:m,data:h})=>{m===gE&&h===i&&u.length&&u.shift()()},!1),m=>{u.push(m),gE.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",wp(gE.postMessage)),Fhe=typeof queueMicrotask<"u"?queueMicrotask.bind(gE):typeof process<"u"&&process.nextTick||Zce,Ln={isArray:w4,isArrayBuffer:Vce,isBuffer:the,isFormData:uhe,isArrayBufferView:nhe,isString:ohe,isNumber:Hce,isBoolean:she,isObject:nU,isPlainObject:KH,isReadableStream:fhe,isRequest:mhe,isResponse:phe,isHeaders:ghe,isUndefined:sB,isDate:rhe,isFile:ahe,isBlob:ihe,isRegExp:Ahe,isFunction:wp,isStream:che,isURLSearchParams:dhe,isTypedArray:xhe,isFileList:lhe,forEach:yB,merge:Zte,extend:vhe,trim:hhe,stripBOM:bhe,inherits:yhe,toFlatObject:whe,kindOf:eU,kindOfTest:Rh,endsWith:Che,toArray:She,forEachEntry:Ehe,matchAll:_he,isHTMLForm:khe,hasOwnProperty:Ure,hasOwnProp:Ure,reduceDescriptors:jce,freezeMethods:Nhe,toObjectSet:Ohe,toCamelCase:The,noop:$he,toFiniteNumber:Dhe,findKey:zce,global:gE,isContextDefined:Uce,ALPHABET:Wce,generateString:Mhe,isSpecCompliantForm:Bhe,toJSONObject:Rhe,isAsyncFn:Ihe,isThenable:Phe,setImmediate:Zce,asap:Fhe};function kr(o,s,i,u,m){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=o,this.name="AxiosError",s&&(this.code=s),i&&(this.config=i),u&&(this.request=u),m&&(this.response=m,this.status=m.status?m.status:null)}Ln.inherits(kr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ln.toJSONObject(this.config),code:this.code,status:this.status}}});const Gce=kr.prototype,qce={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(o=>{qce[o]={value:o}});Object.defineProperties(kr,qce);Object.defineProperty(Gce,"isAxiosError",{value:!0});kr.from=(o,s,i,u,m,h)=>{const b=Object.create(Gce);return Ln.toFlatObject(o,b,function(C){return C!==Error.prototype},C=>C!=="isAxiosError"),kr.call(b,o.message,s,i,u,m),b.cause=o,b.name=o.name,h&&Object.assign(b,h),b};const Lhe=null;function Gte(o){return Ln.isPlainObject(o)||Ln.isArray(o)}function Yce(o){return Ln.endsWith(o,"[]")?o.slice(0,-2):o}function Wre(o,s,i){return o?o.concat(s).map(function(u,m){return u=Yce(u),!i&&m?"["+u+"]":u}).join(i?".":""):s}function Vhe(o){return Ln.isArray(o)&&!o.some(Gte)}const Hhe=Ln.toFlatObject(Ln,{},null,function(o){return/^is[A-Z]/.test(o)});function oU(o,s,i){if(!Ln.isObject(o))throw new TypeError("target must be an object");s=s||new FormData,i=Ln.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(I,W){return!Ln.isUndefined(W[I])});const u=i.metaTokens,m=i.visitor||_,h=i.dots,b=i.indexes,C=(i.Blob||typeof Blob<"u"&&Blob)&&Ln.isSpecCompliantForm(s);if(!Ln.isFunction(m))throw new TypeError("visitor must be a function");function S(I){if(I===null)return"";if(Ln.isDate(I))return I.toISOString();if(!C&&Ln.isBlob(I))throw new kr("Blob is not supported. Use a Buffer instead.");return Ln.isArrayBuffer(I)||Ln.isTypedArray(I)?C&&typeof Blob=="function"?new Blob([I]):Buffer.from(I):I}function _(I,W,G){let Q=I;if(I&&!G&&typeof I=="object"){if(Ln.endsWith(W,"{}"))W=u?W:W.slice(0,-2),I=JSON.stringify(I);else if(Ln.isArray(I)&&Vhe(I)||(Ln.isFileList(I)||Ln.endsWith(W,"[]"))&&(Q=Ln.toArray(I)))return W=Yce(W),Q.forEach(function(q,Z){!(Ln.isUndefined(q)||q===null)&&s.append(b===!0?Wre([W],Z,h):b===null?W:W+"[]",S(q))}),!1}return Gte(I)?!0:(s.append(Wre(G,W,h),S(I)),!1)}const N=[],O=Object.assign(Hhe,{defaultVisitor:_,convertValue:S,isVisitable:Gte});function R(I,W){if(!Ln.isUndefined(I)){if(N.indexOf(I)!==-1)throw Error("Circular reference detected in "+W.join("."));N.push(I),Ln.forEach(I,function(G,Q){(!(Ln.isUndefined(G)||G===null)&&m.call(s,G,Ln.isString(Q)?Q.trim():Q,W,O))===!0&&R(G,W?W.concat(Q):[Q])}),N.pop()}}if(!Ln.isObject(o))throw new TypeError("data must be an object");return R(o),s}function Zre(o){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Gne(o,s){this._pairs=[],o&&oU(o,this,s)}const Kce=Gne.prototype;Kce.append=function(o,s){this._pairs.push([o,s])};Kce.toString=function(o){const s=o?function(i){return o.call(this,i,Zre)}:Zre;return this._pairs.map(function(i){return s(i[0])+"="+s(i[1])},"").join("&")};function zhe(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Xce(o,s,i){if(!s)return o;const u=i&&i.encode||zhe;Ln.isFunction(i)&&(i={serialize:i});const m=i&&i.serialize;let h;if(m?h=m(s,i):h=Ln.isURLSearchParams(s)?s.toString():new Gne(s,i).toString(u),h){const b=o.indexOf("#");b!==-1&&(o=o.slice(0,b)),o+=(o.indexOf("?")===-1?"?":"&")+h}return o}let Gre=class{constructor(){this.handlers=[]}use(s,i,u){return this.handlers.push({fulfilled:s,rejected:i,synchronous:u?u.synchronous:!1,runWhen:u?u.runWhen:null}),this.handlers.length-1}eject(s){this.handlers[s]&&(this.handlers[s]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(s){Ln.forEach(this.handlers,function(i){i!==null&&s(i)})}};const Jce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Uhe=typeof URLSearchParams<"u"?URLSearchParams:Gne,jhe=typeof FormData<"u"?FormData:null,Whe=typeof Blob<"u"?Blob:null,Zhe={isBrowser:!0,classes:{URLSearchParams:Uhe,FormData:jhe,Blob:Whe},protocols:["http","https","file","blob","url","data"]},qne=typeof window<"u"&&typeof document<"u",qte=typeof navigator=="object"&&navigator||void 0,Ghe=qne&&(!qte||["ReactNative","NativeScript","NS"].indexOf(qte.product)<0),qhe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Yhe=qne&&window.location.href||"http://localhost",Khe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:qne,hasStandardBrowserEnv:Ghe,hasStandardBrowserWebWorkerEnv:qhe,navigator:qte,origin:Yhe},Symbol.toStringTag,{value:"Module"})),Kd={...Khe,...Zhe};function Xhe(o,s){return oU(o,new Kd.classes.URLSearchParams,Object.assign({visitor:function(i,u,m,h){return Kd.isNode&&Ln.isBuffer(i)?(this.append(u,i.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},s))}function Jhe(o){return Ln.matchAll(/\w+|\[(\w*)]/g,o).map(s=>s[0]==="[]"?"":s[1]||s[0])}function Qhe(o){const s={},i=Object.keys(o);let u;const m=i.length;let h;for(u=0;u<m;u++)h=i[u],s[h]=o[h];return s}function Qce(o){function s(i,u,m,h){let b=i[h++];if(b==="__proto__")return!0;const C=Number.isFinite(+b),S=h>=i.length;return b=!b&&Ln.isArray(m)?m.length:b,S?(Ln.hasOwnProp(m,b)?m[b]=[m[b],u]:m[b]=u,!C):((!m[b]||!Ln.isObject(m[b]))&&(m[b]=[]),s(i,u,m[b],h)&&Ln.isArray(m[b])&&(m[b]=Qhe(m[b])),!C)}if(Ln.isFormData(o)&&Ln.isFunction(o.entries)){const i={};return Ln.forEachEntry(o,(u,m)=>{s(Jhe(u),m,i,0)}),i}return null}function e1e(o,s,i){if(Ln.isString(o))try{return(s||JSON.parse)(o),Ln.trim(o)}catch(u){if(u.name!=="SyntaxError")throw u}return(0,JSON.stringify)(o)}const wB={transitional:Jce,adapter:["xhr","http","fetch"],transformRequest:[function(o,s){const i=s.getContentType()||"",u=i.indexOf("application/json")>-1,m=Ln.isObject(o);if(m&&Ln.isHTMLForm(o)&&(o=new FormData(o)),Ln.isFormData(o))return u?JSON.stringify(Qce(o)):o;if(Ln.isArrayBuffer(o)||Ln.isBuffer(o)||Ln.isStream(o)||Ln.isFile(o)||Ln.isBlob(o)||Ln.isReadableStream(o))return o;if(Ln.isArrayBufferView(o))return o.buffer;if(Ln.isURLSearchParams(o))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),o.toString();let h;if(m){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Xhe(o,this.formSerializer).toString();if((h=Ln.isFileList(o))||i.indexOf("multipart/form-data")>-1){const b=this.env&&this.env.FormData;return oU(h?{"files[]":o}:o,b&&new b,this.formSerializer)}}return m||u?(s.setContentType("application/json",!1),e1e(o)):o}],transformResponse:[function(o){const s=this.transitional||wB.transitional,i=s&&s.forcedJSONParsing,u=this.responseType==="json";if(Ln.isResponse(o)||Ln.isReadableStream(o))return o;if(o&&Ln.isString(o)&&(i&&!this.responseType||u)){const m=!(s&&s.silentJSONParsing)&&u;try{return JSON.parse(o)}catch(h){if(m)throw h.name==="SyntaxError"?kr.from(h,kr.ERR_BAD_RESPONSE,this,null,this.response):h}}return o}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Kd.classes.FormData,Blob:Kd.classes.Blob},validateStatus:function(o){return o>=200&&o<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ln.forEach(["delete","get","head","post","put","patch"],o=>{wB.headers[o]={}});const t1e=Ln.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),n1e=o=>{const s={};let i,u,m;return o&&o.split(`
1
+ "use strict";var Yge=Object.defineProperty;var Kge=(o,s,i)=>s in o?Yge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i;var zc=(o,s,i)=>Kge(o,typeof s!="symbol"?s+"":s,i);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("vue"),On=require("element-plus"),Xge="0.0.128";var Jge=Object.defineProperty,Qge=(o,s,i)=>s in o?Jge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i,Bee=(o,s,i)=>Qge(o,typeof s!="symbol"?s+"":s,i);function Lce(o,s){return function(){return o.apply(s,arguments)}}const{toString:ehe}=Object.prototype,{getPrototypeOf:Zne}=Object,eU=(o=>s=>{const i=ehe.call(s);return o[i]||(o[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Rh=o=>(o=o.toLowerCase(),s=>eU(s)===o),tU=o=>s=>typeof s===o,{isArray:w4}=Array,sB=tU("undefined");function the(o){return o!==null&&!sB(o)&&o.constructor!==null&&!sB(o.constructor)&&wp(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const Vce=Rh("ArrayBuffer");function nhe(o){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(o):s=o&&o.buffer&&Vce(o.buffer),s}const ohe=tU("string"),wp=tU("function"),Hce=tU("number"),nU=o=>o!==null&&typeof o=="object",she=o=>o===!0||o===!1,KH=o=>{if(eU(o)!=="object")return!1;const s=Zne(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)},rhe=Rh("Date"),ahe=Rh("File"),ihe=Rh("Blob"),lhe=Rh("FileList"),che=o=>nU(o)&&wp(o.pipe),uhe=o=>{let s;return o&&(typeof FormData=="function"&&o instanceof FormData||wp(o.append)&&((s=eU(o))==="formdata"||s==="object"&&wp(o.toString)&&o.toString()==="[object FormData]"))},dhe=Rh("URLSearchParams"),[fhe,mhe,phe,ghe]=["ReadableStream","Request","Response","Headers"].map(Rh),hhe=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function yB(o,s,{allOwnKeys:i=!1}={}){if(o===null||typeof o>"u")return;let u,m;if(typeof o!="object"&&(o=[o]),w4(o))for(u=0,m=o.length;u<m;u++)s.call(null,o[u],u,o);else{const h=i?Object.getOwnPropertyNames(o):Object.keys(o),b=h.length;let C;for(u=0;u<b;u++)C=h[u],s.call(null,o[C],C,o)}}function zce(o,s){s=s.toLowerCase();const i=Object.keys(o);let u=i.length,m;for(;u-- >0;)if(m=i[u],s===m.toLowerCase())return m;return null}const gE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Uce=o=>!sB(o)&&o!==gE;function Zte(){const{caseless:o}=Uce(this)&&this||{},s={},i=(u,m)=>{const h=o&&zce(s,m)||m;KH(s[h])&&KH(u)?s[h]=Zte(s[h],u):KH(u)?s[h]=Zte({},u):w4(u)?s[h]=u.slice():s[h]=u};for(let u=0,m=arguments.length;u<m;u++)arguments[u]&&yB(arguments[u],i);return s}const vhe=(o,s,i,{allOwnKeys:u}={})=>(yB(s,(m,h)=>{i&&wp(m)?o[h]=Lce(m,i):o[h]=m},{allOwnKeys:u}),o),bhe=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),yhe=(o,s,i,u)=>{o.prototype=Object.create(s.prototype,u),o.prototype.constructor=o,Object.defineProperty(o,"super",{value:s.prototype}),i&&Object.assign(o.prototype,i)},whe=(o,s,i,u)=>{let m,h,b;const C={};if(s=s||{},o==null)return s;do{for(m=Object.getOwnPropertyNames(o),h=m.length;h-- >0;)b=m[h],(!u||u(b,o,s))&&!C[b]&&(s[b]=o[b],C[b]=!0);o=i!==!1&&Zne(o)}while(o&&(!i||i(o,s))&&o!==Object.prototype);return s},Che=(o,s,i)=>{o=String(o),(i===void 0||i>o.length)&&(i=o.length),i-=s.length;const u=o.indexOf(s,i);return u!==-1&&u===i},She=o=>{if(!o)return null;if(w4(o))return o;let s=o.length;if(!Hce(s))return null;const i=new Array(s);for(;s-- >0;)i[s]=o[s];return i},xhe=(o=>s=>o&&s instanceof o)(typeof Uint8Array<"u"&&Zne(Uint8Array)),Ehe=(o,s)=>{const i=(o&&o[Symbol.iterator]).call(o);let u;for(;(u=i.next())&&!u.done;){const m=u.value;s.call(o,m[0],m[1])}},_he=(o,s)=>{let i;const u=[];for(;(i=o.exec(s))!==null;)u.push(i);return u},khe=Rh("HTMLFormElement"),The=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,i,u){return i.toUpperCase()+u}),Ure=(({hasOwnProperty:o})=>(s,i)=>o.call(s,i))(Object.prototype),Ahe=Rh("RegExp"),jce=(o,s)=>{const i=Object.getOwnPropertyDescriptors(o),u={};yB(i,(m,h)=>{let b;(b=s(m,h,o))!==!1&&(u[h]=b||m)}),Object.defineProperties(o,u)},Nhe=o=>{jce(o,(s,i)=>{if(wp(o)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const u=o[i];if(wp(u)){if(s.enumerable=!1,"writable"in s){s.writable=!1;return}s.set||(s.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},Ohe=(o,s)=>{const i={},u=m=>{m.forEach(h=>{i[h]=!0})};return w4(o)?u(o):u(String(o).split(s)),i},$he=()=>{},Dhe=(o,s)=>o!=null&&Number.isFinite(o=+o)?o:s,Ree="abcdefghijklmnopqrstuvwxyz",jre="0123456789",Wce={DIGIT:jre,ALPHA:Ree,ALPHA_DIGIT:Ree+Ree.toUpperCase()+jre},Mhe=(o=16,s=Wce.ALPHA_DIGIT)=>{let i="";const{length:u}=s;for(;o--;)i+=s[Math.random()*u|0];return i};function Bhe(o){return!!(o&&wp(o.append)&&o[Symbol.toStringTag]==="FormData"&&o[Symbol.iterator])}const Rhe=o=>{const s=new Array(10),i=(u,m)=>{if(nU(u)){if(s.indexOf(u)>=0)return;if(!("toJSON"in u)){s[m]=u;const h=w4(u)?[]:{};return yB(u,(b,C)=>{const S=i(b,m+1);!sB(S)&&(h[C]=S)}),s[m]=void 0,h}}return u};return i(o,0)},Ihe=Rh("AsyncFunction"),Phe=o=>o&&(nU(o)||wp(o))&&wp(o.then)&&wp(o.catch),Zce=((o,s)=>o?setImmediate:s?((i,u)=>(gE.addEventListener("message",({source:m,data:h})=>{m===gE&&h===i&&u.length&&u.shift()()},!1),m=>{u.push(m),gE.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",wp(gE.postMessage)),Fhe=typeof queueMicrotask<"u"?queueMicrotask.bind(gE):typeof process<"u"&&process.nextTick||Zce,Ln={isArray:w4,isArrayBuffer:Vce,isBuffer:the,isFormData:uhe,isArrayBufferView:nhe,isString:ohe,isNumber:Hce,isBoolean:she,isObject:nU,isPlainObject:KH,isReadableStream:fhe,isRequest:mhe,isResponse:phe,isHeaders:ghe,isUndefined:sB,isDate:rhe,isFile:ahe,isBlob:ihe,isRegExp:Ahe,isFunction:wp,isStream:che,isURLSearchParams:dhe,isTypedArray:xhe,isFileList:lhe,forEach:yB,merge:Zte,extend:vhe,trim:hhe,stripBOM:bhe,inherits:yhe,toFlatObject:whe,kindOf:eU,kindOfTest:Rh,endsWith:Che,toArray:She,forEachEntry:Ehe,matchAll:_he,isHTMLForm:khe,hasOwnProperty:Ure,hasOwnProp:Ure,reduceDescriptors:jce,freezeMethods:Nhe,toObjectSet:Ohe,toCamelCase:The,noop:$he,toFiniteNumber:Dhe,findKey:zce,global:gE,isContextDefined:Uce,ALPHABET:Wce,generateString:Mhe,isSpecCompliantForm:Bhe,toJSONObject:Rhe,isAsyncFn:Ihe,isThenable:Phe,setImmediate:Zce,asap:Fhe};function kr(o,s,i,u,m){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=o,this.name="AxiosError",s&&(this.code=s),i&&(this.config=i),u&&(this.request=u),m&&(this.response=m,this.status=m.status?m.status:null)}Ln.inherits(kr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ln.toJSONObject(this.config),code:this.code,status:this.status}}});const Gce=kr.prototype,qce={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(o=>{qce[o]={value:o}});Object.defineProperties(kr,qce);Object.defineProperty(Gce,"isAxiosError",{value:!0});kr.from=(o,s,i,u,m,h)=>{const b=Object.create(Gce);return Ln.toFlatObject(o,b,function(C){return C!==Error.prototype},C=>C!=="isAxiosError"),kr.call(b,o.message,s,i,u,m),b.cause=o,b.name=o.name,h&&Object.assign(b,h),b};const Lhe=null;function Gte(o){return Ln.isPlainObject(o)||Ln.isArray(o)}function Yce(o){return Ln.endsWith(o,"[]")?o.slice(0,-2):o}function Wre(o,s,i){return o?o.concat(s).map(function(u,m){return u=Yce(u),!i&&m?"["+u+"]":u}).join(i?".":""):s}function Vhe(o){return Ln.isArray(o)&&!o.some(Gte)}const Hhe=Ln.toFlatObject(Ln,{},null,function(o){return/^is[A-Z]/.test(o)});function oU(o,s,i){if(!Ln.isObject(o))throw new TypeError("target must be an object");s=s||new FormData,i=Ln.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(I,W){return!Ln.isUndefined(W[I])});const u=i.metaTokens,m=i.visitor||_,h=i.dots,b=i.indexes,C=(i.Blob||typeof Blob<"u"&&Blob)&&Ln.isSpecCompliantForm(s);if(!Ln.isFunction(m))throw new TypeError("visitor must be a function");function S(I){if(I===null)return"";if(Ln.isDate(I))return I.toISOString();if(!C&&Ln.isBlob(I))throw new kr("Blob is not supported. Use a Buffer instead.");return Ln.isArrayBuffer(I)||Ln.isTypedArray(I)?C&&typeof Blob=="function"?new Blob([I]):Buffer.from(I):I}function _(I,W,G){let Q=I;if(I&&!G&&typeof I=="object"){if(Ln.endsWith(W,"{}"))W=u?W:W.slice(0,-2),I=JSON.stringify(I);else if(Ln.isArray(I)&&Vhe(I)||(Ln.isFileList(I)||Ln.endsWith(W,"[]"))&&(Q=Ln.toArray(I)))return W=Yce(W),Q.forEach(function(q,Z){!(Ln.isUndefined(q)||q===null)&&s.append(b===!0?Wre([W],Z,h):b===null?W:W+"[]",S(q))}),!1}return Gte(I)?!0:(s.append(Wre(G,W,h),S(I)),!1)}const N=[],O=Object.assign(Hhe,{defaultVisitor:_,convertValue:S,isVisitable:Gte});function R(I,W){if(!Ln.isUndefined(I)){if(N.indexOf(I)!==-1)throw Error("Circular reference detected in "+W.join("."));N.push(I),Ln.forEach(I,function(G,Q){(!(Ln.isUndefined(G)||G===null)&&m.call(s,G,Ln.isString(Q)?Q.trim():Q,W,O))===!0&&R(G,W?W.concat(Q):[Q])}),N.pop()}}if(!Ln.isObject(o))throw new TypeError("data must be an object");return R(o),s}function Zre(o){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Gne(o,s){this._pairs=[],o&&oU(o,this,s)}const Kce=Gne.prototype;Kce.append=function(o,s){this._pairs.push([o,s])};Kce.toString=function(o){const s=o?function(i){return o.call(this,i,Zre)}:Zre;return this._pairs.map(function(i){return s(i[0])+"="+s(i[1])},"").join("&")};function zhe(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Xce(o,s,i){if(!s)return o;const u=i&&i.encode||zhe;Ln.isFunction(i)&&(i={serialize:i});const m=i&&i.serialize;let h;if(m?h=m(s,i):h=Ln.isURLSearchParams(s)?s.toString():new Gne(s,i).toString(u),h){const b=o.indexOf("#");b!==-1&&(o=o.slice(0,b)),o+=(o.indexOf("?")===-1?"?":"&")+h}return o}let Gre=class{constructor(){this.handlers=[]}use(s,i,u){return this.handlers.push({fulfilled:s,rejected:i,synchronous:u?u.synchronous:!1,runWhen:u?u.runWhen:null}),this.handlers.length-1}eject(s){this.handlers[s]&&(this.handlers[s]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(s){Ln.forEach(this.handlers,function(i){i!==null&&s(i)})}};const Jce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Uhe=typeof URLSearchParams<"u"?URLSearchParams:Gne,jhe=typeof FormData<"u"?FormData:null,Whe=typeof Blob<"u"?Blob:null,Zhe={isBrowser:!0,classes:{URLSearchParams:Uhe,FormData:jhe,Blob:Whe},protocols:["http","https","file","blob","url","data"]},qne=typeof window<"u"&&typeof document<"u",qte=typeof navigator=="object"&&navigator||void 0,Ghe=qne&&(!qte||["ReactNative","NativeScript","NS"].indexOf(qte.product)<0),qhe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Yhe=qne&&window.location.href||"http://localhost",Khe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:qne,hasStandardBrowserEnv:Ghe,hasStandardBrowserWebWorkerEnv:qhe,navigator:qte,origin:Yhe},Symbol.toStringTag,{value:"Module"})),Kd={...Khe,...Zhe};function Xhe(o,s){return oU(o,new Kd.classes.URLSearchParams,Object.assign({visitor:function(i,u,m,h){return Kd.isNode&&Ln.isBuffer(i)?(this.append(u,i.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},s))}function Jhe(o){return Ln.matchAll(/\w+|\[(\w*)]/g,o).map(s=>s[0]==="[]"?"":s[1]||s[0])}function Qhe(o){const s={},i=Object.keys(o);let u;const m=i.length;let h;for(u=0;u<m;u++)h=i[u],s[h]=o[h];return s}function Qce(o){function s(i,u,m,h){let b=i[h++];if(b==="__proto__")return!0;const C=Number.isFinite(+b),S=h>=i.length;return b=!b&&Ln.isArray(m)?m.length:b,S?(Ln.hasOwnProp(m,b)?m[b]=[m[b],u]:m[b]=u,!C):((!m[b]||!Ln.isObject(m[b]))&&(m[b]=[]),s(i,u,m[b],h)&&Ln.isArray(m[b])&&(m[b]=Qhe(m[b])),!C)}if(Ln.isFormData(o)&&Ln.isFunction(o.entries)){const i={};return Ln.forEachEntry(o,(u,m)=>{s(Jhe(u),m,i,0)}),i}return null}function e1e(o,s,i){if(Ln.isString(o))try{return(s||JSON.parse)(o),Ln.trim(o)}catch(u){if(u.name!=="SyntaxError")throw u}return(0,JSON.stringify)(o)}const wB={transitional:Jce,adapter:["xhr","http","fetch"],transformRequest:[function(o,s){const i=s.getContentType()||"",u=i.indexOf("application/json")>-1,m=Ln.isObject(o);if(m&&Ln.isHTMLForm(o)&&(o=new FormData(o)),Ln.isFormData(o))return u?JSON.stringify(Qce(o)):o;if(Ln.isArrayBuffer(o)||Ln.isBuffer(o)||Ln.isStream(o)||Ln.isFile(o)||Ln.isBlob(o)||Ln.isReadableStream(o))return o;if(Ln.isArrayBufferView(o))return o.buffer;if(Ln.isURLSearchParams(o))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),o.toString();let h;if(m){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Xhe(o,this.formSerializer).toString();if((h=Ln.isFileList(o))||i.indexOf("multipart/form-data")>-1){const b=this.env&&this.env.FormData;return oU(h?{"files[]":o}:o,b&&new b,this.formSerializer)}}return m||u?(s.setContentType("application/json",!1),e1e(o)):o}],transformResponse:[function(o){const s=this.transitional||wB.transitional,i=s&&s.forcedJSONParsing,u=this.responseType==="json";if(Ln.isResponse(o)||Ln.isReadableStream(o))return o;if(o&&Ln.isString(o)&&(i&&!this.responseType||u)){const m=!(s&&s.silentJSONParsing)&&u;try{return JSON.parse(o)}catch(h){if(m)throw h.name==="SyntaxError"?kr.from(h,kr.ERR_BAD_RESPONSE,this,null,this.response):h}}return o}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Kd.classes.FormData,Blob:Kd.classes.Blob},validateStatus:function(o){return o>=200&&o<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ln.forEach(["delete","get","head","post","put","patch"],o=>{wB.headers[o]={}});const t1e=Ln.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),n1e=o=>{const s={};let i,u,m;return o&&o.split(`
2
2
  `).forEach(function(h){m=h.indexOf(":"),i=h.substring(0,m).trim().toLowerCase(),u=h.substring(m+1).trim(),!(!i||s[i]&&t1e[i])&&(i==="set-cookie"?s[i]?s[i].push(u):s[i]=[u]:s[i]=s[i]?s[i]+", "+u:u)}),s},qre=Symbol("internals");function D6(o){return o&&String(o).trim().toLowerCase()}function XH(o){return o===!1||o==null?o:Ln.isArray(o)?o.map(XH):String(o)}function o1e(o){const s=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let u;for(;u=i.exec(o);)s[u[1]]=u[2];return s}const s1e=o=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim());function Iee(o,s,i,u,m){if(Ln.isFunction(u))return u.call(this,s,i);if(m&&(s=i),!!Ln.isString(s)){if(Ln.isString(u))return s.indexOf(u)!==-1;if(Ln.isRegExp(u))return u.test(s)}}function r1e(o){return o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(s,i,u)=>i.toUpperCase()+u)}function a1e(o,s){const i=Ln.toCamelCase(" "+s);["get","set","has"].forEach(u=>{Object.defineProperty(o,u+i,{value:function(m,h,b){return this[u].call(this,s,m,h,b)},configurable:!0})})}let xm=class{constructor(s){s&&this.set(s)}set(s,i,u){const m=this;function h(C,S,_){const N=D6(S);if(!N)throw new Error("header name must be a non-empty string");const O=Ln.findKey(m,N);(!O||m[O]===void 0||_===!0||_===void 0&&m[O]!==!1)&&(m[O||S]=XH(C))}const b=(C,S)=>Ln.forEach(C,(_,N)=>h(_,N,S));if(Ln.isPlainObject(s)||s instanceof this.constructor)b(s,i);else if(Ln.isString(s)&&(s=s.trim())&&!s1e(s))b(n1e(s),i);else if(Ln.isHeaders(s))for(const[C,S]of s.entries())h(S,C,u);else s!=null&&h(i,s,u);return this}get(s,i){if(s=D6(s),s){const u=Ln.findKey(this,s);if(u){const m=this[u];if(!i)return m;if(i===!0)return o1e(m);if(Ln.isFunction(i))return i.call(this,m,u);if(Ln.isRegExp(i))return i.exec(m);throw new TypeError("parser must be boolean|regexp|function")}}}has(s,i){if(s=D6(s),s){const u=Ln.findKey(this,s);return!!(u&&this[u]!==void 0&&(!i||Iee(this,this[u],u,i)))}return!1}delete(s,i){const u=this;let m=!1;function h(b){if(b=D6(b),b){const C=Ln.findKey(u,b);C&&(!i||Iee(u,u[C],C,i))&&(delete u[C],m=!0)}}return Ln.isArray(s)?s.forEach(h):h(s),m}clear(s){const i=Object.keys(this);let u=i.length,m=!1;for(;u--;){const h=i[u];(!s||Iee(this,this[h],h,s,!0))&&(delete this[h],m=!0)}return m}normalize(s){const i=this,u={};return Ln.forEach(this,(m,h)=>{const b=Ln.findKey(u,h);if(b){i[b]=XH(m),delete i[h];return}const C=s?r1e(h):String(h).trim();C!==h&&delete i[h],i[C]=XH(m),u[C]=!0}),this}concat(...s){return this.constructor.concat(this,...s)}toJSON(s){const i=Object.create(null);return Ln.forEach(this,(u,m)=>{u!=null&&u!==!1&&(i[m]=s&&Ln.isArray(u)?u.join(", "):u)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([s,i])=>s+": "+i).join(`
3
3
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(s){return s instanceof this?s:new this(s)}static concat(s,...i){const u=new this(s);return i.forEach(m=>u.set(m)),u}static accessor(s){const i=(this[qre]=this[qre]={accessors:{}}).accessors,u=this.prototype;function m(h){const b=D6(h);i[b]||(a1e(u,h),i[b]=!0)}return Ln.isArray(s)?s.forEach(m):m(s),this}};xm.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ln.reduceDescriptors(xm.prototype,({value:o},s)=>{let i=s[0].toUpperCase()+s.slice(1);return{get:()=>o,set(u){this[i]=u}}});Ln.freezeMethods(xm);function Pee(o,s){const i=this||wB,u=s||i,m=xm.from(u.headers);let h=u.data;return Ln.forEach(o,function(b){h=b.call(i,h,m.normalize(),s?s.status:void 0)}),m.normalize(),h}function eue(o){return!!(o&&o.__CANCEL__)}function C4(o,s,i){kr.call(this,o??"canceled",kr.ERR_CANCELED,s,i),this.name="CanceledError"}Ln.inherits(C4,kr,{__CANCEL__:!0});function tue(o,s,i){const u=i.config.validateStatus;!i.status||!u||u(i.status)?o(i):s(new kr("Request failed with status code "+i.status,[kr.ERR_BAD_REQUEST,kr.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function i1e(o){const s=/^([-+\w]{1,25})(:?\/\/|:)/.exec(o);return s&&s[1]||""}function l1e(o,s){o=o||10;const i=new Array(o),u=new Array(o);let m=0,h=0,b;return s=s!==void 0?s:1e3,function(C){const S=Date.now(),_=u[h];b||(b=S),i[m]=C,u[m]=S;let N=h,O=0;for(;N!==m;)O+=i[N++],N=N%o;if(m=(m+1)%o,m===h&&(h=(h+1)%o),S-b<s)return;const R=_&&S-_;return R?Math.round(O*1e3/R):void 0}}function c1e(o,s){let i=0,u=1e3/s,m,h;const b=(C,S=Date.now())=>{i=S,m=null,h&&(clearTimeout(h),h=null),o.apply(null,C)};return[(...C)=>{const S=Date.now(),_=S-i;_>=u?b(C,S):(m=C,h||(h=setTimeout(()=>{h=null,b(m)},u-_)))},()=>m&&b(m)]}const gz=(o,s,i=3)=>{let u=0;const m=l1e(50,250);return c1e(h=>{const b=h.loaded,C=h.lengthComputable?h.total:void 0,S=b-u,_=m(S),N=b<=C;u=b;const O={loaded:b,total:C,progress:C?b/C:void 0,bytes:S,rate:_||void 0,estimated:_&&C&&N?(C-b)/_:void 0,event:h,lengthComputable:C!=null,[s?"download":"upload"]:!0};o(O)},i)},Yre=(o,s)=>{const i=o!=null;return[u=>s[0]({lengthComputable:i,total:o,loaded:u}),s[1]]},Kre=o=>(...s)=>Ln.asap(()=>o(...s)),u1e=Kd.hasStandardBrowserEnv?((o,s)=>i=>(i=new URL(i,Kd.origin),o.protocol===i.protocol&&o.host===i.host&&(s||o.port===i.port)))(new URL(Kd.origin),Kd.navigator&&/(msie|trident)/i.test(Kd.navigator.userAgent)):()=>!0,d1e=Kd.hasStandardBrowserEnv?{write(o,s,i,u,m,h){const b=[o+"="+encodeURIComponent(s)];Ln.isNumber(i)&&b.push("expires="+new Date(i).toGMTString()),Ln.isString(u)&&b.push("path="+u),Ln.isString(m)&&b.push("domain="+m),h===!0&&b.push("secure"),document.cookie=b.join("; ")},read(o){const s=document.cookie.match(new RegExp("(^|;\\s*)("+o+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove(o){this.write(o,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function f1e(o){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}function m1e(o,s){return s?o.replace(/\/?\/$/,"")+"/"+s.replace(/^\/+/,""):o}function nue(o,s){return o&&!f1e(s)?m1e(o,s):s}const Xre=o=>o instanceof xm?{...o}:o;function TE(o,s){s=s||{};const i={};function u(_,N,O,R){return Ln.isPlainObject(_)&&Ln.isPlainObject(N)?Ln.merge.call({caseless:R},_,N):Ln.isPlainObject(N)?Ln.merge({},N):Ln.isArray(N)?N.slice():N}function m(_,N,O,R){if(Ln.isUndefined(N)){if(!Ln.isUndefined(_))return u(void 0,_,O,R)}else return u(_,N,O,R)}function h(_,N){if(!Ln.isUndefined(N))return u(void 0,N)}function b(_,N){if(Ln.isUndefined(N)){if(!Ln.isUndefined(_))return u(void 0,_)}else return u(void 0,N)}function C(_,N,O){if(O in s)return u(_,N);if(O in o)return u(void 0,_)}const S={url:h,method:h,data:h,baseURL:b,transformRequest:b,transformResponse:b,paramsSerializer:b,timeout:b,timeoutMessage:b,withCredentials:b,withXSRFToken:b,adapter:b,responseType:b,xsrfCookieName:b,xsrfHeaderName:b,onUploadProgress:b,onDownloadProgress:b,decompress:b,maxContentLength:b,maxBodyLength:b,beforeRedirect:b,transport:b,httpAgent:b,httpsAgent:b,cancelToken:b,socketPath:b,responseEncoding:b,validateStatus:C,headers:(_,N,O)=>m(Xre(_),Xre(N),O,!0)};return Ln.forEach(Object.keys(Object.assign({},o,s)),function(_){const N=S[_]||m,O=N(o[_],s[_],_);Ln.isUndefined(O)&&N!==C||(i[_]=O)}),i}const oue=o=>{const s=TE({},o);let{data:i,withXSRFToken:u,xsrfHeaderName:m,xsrfCookieName:h,headers:b,auth:C}=s;s.headers=b=xm.from(b),s.url=Xce(nue(s.baseURL,s.url),o.params,o.paramsSerializer),C&&b.set("Authorization","Basic "+btoa((C.username||"")+":"+(C.password?unescape(encodeURIComponent(C.password)):"")));let S;if(Ln.isFormData(i)){if(Kd.hasStandardBrowserEnv||Kd.hasStandardBrowserWebWorkerEnv)b.setContentType(void 0);else if((S=b.getContentType())!==!1){const[_,...N]=S?S.split(";").map(O=>O.trim()).filter(Boolean):[];b.setContentType([_||"multipart/form-data",...N].join("; "))}}if(Kd.hasStandardBrowserEnv&&(u&&Ln.isFunction(u)&&(u=u(s)),u||u!==!1&&u1e(s.url))){const _=m&&h&&d1e.read(h);_&&b.set(m,_)}return s},p1e=typeof XMLHttpRequest<"u",g1e=p1e&&function(o){return new Promise(function(s,i){const u=oue(o);let m=u.data;const h=xm.from(u.headers).normalize();let{responseType:b,onUploadProgress:C,onDownloadProgress:S}=u,_,N,O,R,I;function W(){R&&R(),I&&I(),u.cancelToken&&u.cancelToken.unsubscribe(_),u.signal&&u.signal.removeEventListener("abort",_)}let G=new XMLHttpRequest;G.open(u.method.toUpperCase(),u.url,!0),G.timeout=u.timeout;function Q(){if(!G)return;const Z=xm.from("getAllResponseHeaders"in G&&G.getAllResponseHeaders()),L={data:!b||b==="text"||b==="json"?G.responseText:G.response,status:G.status,statusText:G.statusText,headers:Z,config:o,request:G};tue(function(pe){s(pe),W()},function(pe){i(pe),W()},L),G=null}"onloadend"in G?G.onloadend=Q:G.onreadystatechange=function(){!G||G.readyState!==4||G.status===0&&!(G.responseURL&&G.responseURL.indexOf("file:")===0)||setTimeout(Q)},G.onabort=function(){G&&(i(new kr("Request aborted",kr.ECONNABORTED,o,G)),G=null)},G.onerror=function(){i(new kr("Network Error",kr.ERR_NETWORK,o,G)),G=null},G.ontimeout=function(){let Z=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded";const L=u.transitional||Jce;u.timeoutErrorMessage&&(Z=u.timeoutErrorMessage),i(new kr(Z,L.clarifyTimeoutError?kr.ETIMEDOUT:kr.ECONNABORTED,o,G)),G=null},m===void 0&&h.setContentType(null),"setRequestHeader"in G&&Ln.forEach(h.toJSON(),function(Z,L){G.setRequestHeader(L,Z)}),Ln.isUndefined(u.withCredentials)||(G.withCredentials=!!u.withCredentials),b&&b!=="json"&&(G.responseType=u.responseType),S&&([O,I]=gz(S,!0),G.addEventListener("progress",O)),C&&G.upload&&([N,R]=gz(C),G.upload.addEventListener("progress",N),G.upload.addEventListener("loadend",R)),(u.cancelToken||u.signal)&&(_=Z=>{G&&(i(!Z||Z.type?new C4(null,o,G):Z),G.abort(),G=null)},u.cancelToken&&u.cancelToken.subscribe(_),u.signal&&(u.signal.aborted?_():u.signal.addEventListener("abort",_)));const q=i1e(u.url);if(q&&Kd.protocols.indexOf(q)===-1){i(new kr("Unsupported protocol "+q+":",kr.ERR_BAD_REQUEST,o));return}G.send(m||null)})},h1e=(o,s)=>{const{length:i}=o=o?o.filter(Boolean):[];if(s||i){let u=new AbortController,m;const h=function(_){if(!m){m=!0,C();const N=_ instanceof Error?_:this.reason;u.abort(N instanceof kr?N:new C4(N instanceof Error?N.message:N))}};let b=s&&setTimeout(()=>{b=null,h(new kr(`timeout ${s} of ms exceeded`,kr.ETIMEDOUT))},s);const C=()=>{o&&(b&&clearTimeout(b),b=null,o.forEach(_=>{_.unsubscribe?_.unsubscribe(h):_.removeEventListener("abort",h)}),o=null)};o.forEach(_=>_.addEventListener("abort",h));const{signal:S}=u;return S.unsubscribe=()=>Ln.asap(C),S}},v1e=function*(o,s){let i=o.byteLength;if(i<s){yield o;return}let u=0,m;for(;u<i;)m=u+s,yield o.slice(u,m),u=m},b1e=async function*(o,s){for await(const i of y1e(o))yield*v1e(i,s)},y1e=async function*(o){if(o[Symbol.asyncIterator]){yield*o;return}const s=o.getReader();try{for(;;){const{done:i,value:u}=await s.read();if(i)break;yield u}}finally{await s.cancel()}},Jre=(o,s,i,u)=>{const m=b1e(o,s);let h=0,b,C=S=>{b||(b=!0,u&&u(S))};return new ReadableStream({async pull(S){try{const{done:_,value:N}=await m.next();if(_){C(),S.close();return}let O=N.byteLength;if(i){let R=h+=O;i(R)}S.enqueue(new Uint8Array(N))}catch(_){throw C(_),_}},cancel(S){return C(S),m.return()}},{highWaterMark:2})},sU=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",sue=sU&&typeof ReadableStream=="function",w1e=sU&&(typeof TextEncoder=="function"?(o=>s=>o.encode(s))(new TextEncoder):async o=>new Uint8Array(await new Response(o).arrayBuffer())),rue=(o,...s)=>{try{return!!o(...s)}catch{return!1}},C1e=sue&&rue(()=>{let o=!1;const s=new Request(Kd.origin,{body:new ReadableStream,method:"POST",get duplex(){return o=!0,"half"}}).headers.has("Content-Type");return o&&!s}),Qre=64*1024,Yte=sue&&rue(()=>Ln.isReadableStream(new Response("").body)),hz={stream:Yte&&(o=>o.body)};sU&&(o=>{["text","arrayBuffer","blob","formData","stream"].forEach(s=>{!hz[s]&&(hz[s]=Ln.isFunction(o[s])?i=>i[s]():(i,u)=>{throw new kr(`Response type '${s}' is not supported`,kr.ERR_NOT_SUPPORT,u)})})})(new Response);const S1e=async o=>{if(o==null)return 0;if(Ln.isBlob(o))return o.size;if(Ln.isSpecCompliantForm(o))return(await new Request(Kd.origin,{method:"POST",body:o}).arrayBuffer()).byteLength;if(Ln.isArrayBufferView(o)||Ln.isArrayBuffer(o))return o.byteLength;if(Ln.isURLSearchParams(o)&&(o=o+""),Ln.isString(o))return(await w1e(o)).byteLength},x1e=async(o,s)=>Ln.toFiniteNumber(o.getContentLength())??S1e(s),E1e=sU&&(async o=>{let{url:s,method:i,data:u,signal:m,cancelToken:h,timeout:b,onDownloadProgress:C,onUploadProgress:S,responseType:_,headers:N,withCredentials:O="same-origin",fetchOptions:R}=oue(o);_=_?(_+"").toLowerCase():"text";let I=h1e([m,h&&h.toAbortSignal()],b),W;const G=I&&I.unsubscribe&&(()=>{I.unsubscribe()});let Q;try{if(S&&C1e&&i!=="get"&&i!=="head"&&(Q=await x1e(N,u))!==0){let Ke=new Request(s,{method:"POST",body:u,duplex:"half"}),Be;if(Ln.isFormData(u)&&(Be=Ke.headers.get("content-type"))&&N.setContentType(Be),Ke.body){const[Y,ke]=Yre(Q,gz(Kre(S)));u=Jre(Ke.body,Qre,Y,ke)}}Ln.isString(O)||(O=O?"include":"omit");const q="credentials"in Request.prototype;W=new Request(s,{...R,signal:I,method:i.toUpperCase(),headers:N.normalize().toJSON(),body:u,duplex:"half",credentials:q?O:void 0});let Z=await fetch(W);const L=Yte&&(_==="stream"||_==="response");if(Yte&&(C||L&&G)){const Ke={};["status","statusText","headers"].forEach(et=>{Ke[et]=Z[et]});const Be=Ln.toFiniteNumber(Z.headers.get("content-length")),[Y,ke]=C&&Yre(Be,gz(Kre(C),!0))||[];Z=new Response(Jre(Z.body,Qre,Y,()=>{ke&&ke(),G&&G()}),Ke)}_=_||"text";let pe=await hz[Ln.findKey(hz,_)||"text"](Z,o);return!L&&G&&G(),await new Promise((Ke,Be)=>{tue(Ke,Be,{data:pe,headers:xm.from(Z.headers),status:Z.status,statusText:Z.statusText,config:o,request:W})})}catch(q){throw G&&G(),q&&q.name==="TypeError"&&/fetch/i.test(q.message)?Object.assign(new kr("Network Error",kr.ERR_NETWORK,o,W),{cause:q.cause||q}):kr.from(q,q&&q.code,o,W)}}),Kte={http:Lhe,xhr:g1e,fetch:E1e};Ln.forEach(Kte,(o,s)=>{if(o){try{Object.defineProperty(o,"name",{value:s})}catch{}Object.defineProperty(o,"adapterName",{value:s})}});const eae=o=>`- ${o}`,_1e=o=>Ln.isFunction(o)||o===null||o===!1,aue={getAdapter:o=>{o=Ln.isArray(o)?o:[o];const{length:s}=o;let i,u;const m={};for(let h=0;h<s;h++){i=o[h];let b;if(u=i,!_1e(i)&&(u=Kte[(b=String(i)).toLowerCase()],u===void 0))throw new kr(`Unknown adapter '${b}'`);if(u)break;m[b||"#"+h]=u}if(!u){const h=Object.entries(m).map(([C,S])=>`adapter ${C} `+(S===!1?"is not supported by the environment":"is not available in the build"));let b=s?h.length>1?`since :
4
4
  `+h.map(eae).join(`
@@ -123,7 +123,7 @@ Required: `+j.join(", "));return ar[In].apply(null,Yo)},log:ar=>{console.log(ar,
123
123
  * Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
124
124
  *
125
125
  * Version: 7.9.1-173
126
- */(function(){const o=$e=>qe=>($t=>{const Mt=typeof $t;return $t===null?"null":Mt==="object"&&Array.isArray($t)?"array":Mt==="object"&&(gn=yn=$t,(Ot=String).prototype.isPrototypeOf(gn)||((_t=yn.constructor)===null||_t===void 0?void 0:_t.name)===Ot.name)?"string":Mt;var gn,yn,Ot,_t})(qe)===$e,s=$e=>qe=>typeof qe===$e,i=o("string"),u=o("array"),m=s("boolean"),h=$e=>$e===void 0,b=$e=>!(qe=>qe==null)($e),C=s("function"),S=s("number"),_=$e=>()=>$e,N=$e=>$e,O=_(!1),R=_(!0);class I{constructor(qe,$t){this.tag=qe,this.value=$t}static some(qe){return new I(!0,qe)}static none(){return I.singletonNone}fold(qe,$t){return this.tag?$t(this.value):qe()}isSome(){return this.tag}isNone(){return!this.tag}map(qe){return this.tag?I.some(qe(this.value)):I.none()}bind(qe){return this.tag?qe(this.value):I.none()}exists(qe){return this.tag&&qe(this.value)}forall(qe){return!this.tag||qe(this.value)}filter(qe){return!this.tag||qe(this.value)?this:I.none()}getOr(qe){return this.tag?this.value:qe}or(qe){return this.tag?this:qe}getOrThunk(qe){return this.tag?this.value:qe()}orThunk(qe){return this.tag?this:qe()}getOrDie(qe){if(this.tag)return this.value;throw new Error(qe??"Called getOrDie on None")}static from(qe){return b(qe)?I.some(qe):I.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(qe){this.tag&&qe(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}I.singletonNone=new I(!1);const W=Array.prototype.indexOf,G=Array.prototype.push,Q=($e,qe)=>(($t,Mt)=>W.call($t,Mt))($e,qe)>-1,q=($e,qe)=>{for(let $t=0,Mt=$e.length;$t<Mt;$t++)if(qe($e[$t],$t))return!0;return!1},Z=($e,qe)=>{const $t=$e.length,Mt=new Array($t);for(let gn=0;gn<$t;gn++){const yn=$e[gn];Mt[gn]=qe(yn,gn)}return Mt},L=($e,qe)=>{const $t=[];for(let Mt=0,gn=$e.length;Mt<gn;Mt++){const yn=$e[Mt];qe(yn,Mt)&&$t.push(yn)}return $t},pe=($e,qe)=>(($t,Mt,gn)=>{for(let yn=0,Ot=$t.length;yn<Ot;yn++){const _t=$t[yn];if(Mt(_t,yn))return I.some(_t);if(gn(_t,yn))break}return I.none()})($e,qe,O),Ke=($e,qe)=>($t=>{const Mt=[];for(let gn=0,yn=$t.length;gn<yn;++gn){if(!u($t[gn]))throw new Error("Arr.flatten item "+gn+" was not an array, input: "+$t);G.apply(Mt,$t[gn])}return Mt})(Z($e,qe)),Be=Object.keys,Y=Object.hasOwnProperty,ke=($e,qe)=>{const $t=Be($e);for(let Mt=0,gn=$t.length;Mt<gn;Mt++){const yn=$t[Mt];qe($e[yn],yn)}},et=($e,qe)=>{const $t={};return ke($e,(Mt,gn)=>{const yn=qe(Mt,gn);$t[yn.k]=yn.v}),$t},je=$e=>(qe,$t)=>{$e[$t]=qe},Ce=$e=>((qe,$t)=>{const Mt=[];return ke(qe,(gn,yn)=>{Mt.push($t(gn,yn))}),Mt})($e,N),ce=($e,qe)=>Dt($e,qe)?I.from($e[qe]):I.none(),Dt=($e,qe)=>Y.call($e,qe),me=$e=>{let qe=$e;return{get:()=>qe,set:$t=>{qe=$t}}},be=($e,qe,$t=0,Mt)=>{const gn=$e.indexOf(qe,$t);return gn!==-1&&(!!h(Mt)||gn+qe.length<=Mt)},$=$e=>parseInt($e,10),_e=($e,qe)=>{const $t=$e-qe;return $t===0?0:$t>0?1:-1},le=($e,qe,$t)=>({major:$e,minor:qe,patch:$t}),He=$e=>{const qe=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec($e);return qe?le($(qe[1]),$(qe[2]),$(qe[3])):le(0,0,0)},Ge=()=>fe(0,0),fe=($e,qe)=>({major:$e,minor:qe}),Ue={nu:fe,detect:($e,qe)=>{const $t=String(qe).toLowerCase();return $e.length===0?Ge():((Mt,gn)=>{const yn=((_t,Xe)=>{for(let tt=0;tt<_t.length;tt++){const jt=_t[tt];if(jt.test(Xe))return jt}})(Mt,gn);if(!yn)return{major:0,minor:0};const Ot=_t=>Number(gn.replace(yn,"$"+_t));return fe(Ot(1),Ot(2))})($e,$t)},unknown:Ge},yt=($e,qe)=>{const $t=String(qe).toLowerCase();return pe($e,Mt=>Mt.search($t))},Ve=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,pt=$e=>qe=>be(qe,$e),Ie=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:$e=>be($e,"edge/")&&be($e,"chrome")&&be($e,"safari")&&be($e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ve],search:$e=>be($e,"chrome")&&!be($e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:$e=>be($e,"msie")||be($e,"trident")},{name:"Opera",versionRegexes:[Ve,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:pt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:pt("firefox")},{name:"Safari",versionRegexes:[Ve,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:$e=>(be($e,"safari")||be($e,"mobile/"))&&be($e,"applewebkit")}],mt=[{name:"Windows",search:pt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:$e=>be($e,"iphone")||be($e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:pt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:pt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:pt("linux"),versionRegexes:[]},{name:"Solaris",search:pt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:pt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:pt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],oe={browsers:_(Ie),oses:_(mt)},mn=$e=>{const qe=$e.current,$t=$e.version,Mt=gn=>()=>qe===gn;return{current:qe,version:$t,isEdge:Mt("Edge"),isChromium:Mt("Chromium"),isIE:Mt("IE"),isOpera:Mt("Opera"),isFirefox:Mt("Firefox"),isSafari:Mt("Safari")}},gt=()=>mn({current:void 0,version:Ue.unknown()}),St=mn,Wt=$e=>{const qe=$e.current,$t=$e.version,Mt=gn=>()=>qe===gn;return{current:qe,version:$t,isWindows:Mt("Windows"),isiOS:Mt("iOS"),isAndroid:Mt("Android"),isMacOS:Mt("macOS"),isLinux:Mt("Linux"),isSolaris:Mt("Solaris"),isFreeBSD:Mt("FreeBSD"),isChromeOS:Mt("ChromeOS")}},Et=()=>Wt({current:void 0,version:Ue.unknown()}),te=Wt,ie=($e,qe,$t)=>{const Mt=oe.browsers(),gn=oe.oses(),yn=qe.bind(Xe=>((tt,jt)=>((nn,Dn)=>{for(let jn=0;jn<nn.length;jn++){const Yn=Dn(nn[jn]);if(Yn.isSome())return Yn}return I.none()})(jt.brands,nn=>{const Dn=nn.brand.toLowerCase();return pe(tt,jn=>{var Yn;return Dn===((Yn=jn.brand)===null||Yn===void 0?void 0:Yn.toLowerCase())}).map(jn=>({current:jn.name,version:Ue.nu(parseInt(nn.version,10),0)}))}))(Mt,Xe)).orThunk(()=>((Xe,tt)=>yt(Xe,tt).map(jt=>{const nn=Ue.detect(jt.versionRegexes,tt);return{current:jt.name,version:nn}}))(Mt,$e)).fold(gt,St),Ot=((Xe,tt)=>yt(Xe,tt).map(jt=>{const nn=Ue.detect(jt.versionRegexes,tt);return{current:jt.name,version:nn}}))(gn,$e).fold(Et,te),_t=((Xe,tt,jt,nn)=>{const Dn=Xe.isiOS()&&/ipad/i.test(jt)===!0,jn=Xe.isiOS()&&!Dn,Yn=Xe.isiOS()||Xe.isAndroid(),Wn=Yn||nn("(pointer:coarse)"),go=Dn||!jn&&Yn&&nn("(min-device-width:768px)"),ko=jn||Yn&&!go,qo=tt.isSafari()&&Xe.isiOS()&&/safari/i.test(jt)===!1,Ms=!ko&&!go&&!qo;return{isiPad:_(Dn),isiPhone:_(jn),isTablet:_(go),isPhone:_(ko),isTouch:_(Wn),isAndroid:Xe.isAndroid,isiOS:Xe.isiOS,isWebView:_(qo),isDesktop:_(Ms)}})(Ot,yn,$e,$t);return{browser:yn,os:Ot,deviceType:_t}},de=$e=>window.matchMedia($e).matches;let X=($e=>{let qe,$t=!1;return(...Mt)=>($t||($t=!0,qe=$e.apply(null,Mt)),qe)})(()=>ie(window.navigator.userAgent,I.from(window.navigator.userAgentData),de));const Se=()=>X(),Pe=$e=>{if($e==null)throw new Error("Node cannot be null or undefined");return{dom:$e}},Fe=Pe,vt=($e,qe)=>$e.dom===qe.dom,Qe=($e,qe)=>{const $t=$e.dom;if($t.nodeType!==1)return!1;{const Mt=$t;if(Mt.matches!==void 0)return Mt.matches(qe);if(Mt.msMatchesSelector!==void 0)return Mt.msMatchesSelector(qe);if(Mt.webkitMatchesSelector!==void 0)return Mt.webkitMatchesSelector(qe);if(Mt.mozMatchesSelector!==void 0)return Mt.mozMatchesSelector(qe);throw new Error("Browser lacks native selectors")}},wt=$e=>qe=>($t=>$t.dom.nodeType)(qe)===$e,Ft=wt(1),bn=wt(3),Tt=wt(11),Ht=$e=>Fe($e.dom.host),vn=($e,qe,$t)=>{((Mt,gn,yn)=>{if(!(i(yn)||m(yn)||S(yn)))throw console.error("Invalid call to Attribute.set. Key ",gn,":: Value ",yn,":: Element ",Mt),new Error("Attribute value was not simple");Mt.setAttribute(gn,yn+"")})($e.dom,qe,$t)},kn=($e,qe)=>{const $t=$e.dom.getAttribute(qe);return $t===null?void 0:$t},Eo=($e,qe)=>{$e.dom.removeAttribute(qe)},to=$e=>{const qe=bn($e)?$e.dom.parentNode:$e.dom;if(qe==null||qe.ownerDocument===null)return!1;const $t=qe.ownerDocument;return(yn=>{const Ot=(Xe=>Fe(Xe.dom.getRootNode()))(yn);return Tt(_t=Ot)&&b(_t.dom.host)?I.some(Ot):I.none();var _t})(Fe(qe)).fold(()=>$t.body.contains(qe),(Mt=to,gn=Ht,yn=>Mt(gn(yn))));var Mt,gn},It=($e,qe)=>{const $t=$e.dom,Mt=window.getComputedStyle($t).getPropertyValue(qe);return Mt!==""||to($e)?Mt:dn($t,qe)},dn=($e,qe)=>($t=>$t.style!==void 0&&C($t.style.getPropertyValue))($e)?$e.style.getPropertyValue(qe):"",an=($e,qe)=>{const $t=kn($e,qe);return $t===void 0||$t===""?[]:$t.split(" ")},Bn=($e,qe,$t)=>{let Mt=$e.dom;const gn=C($t)?$t:O;for(;Mt.parentNode;){Mt=Mt.parentNode;const yn=Fe(Mt);if(qe(yn))return I.some(yn);if(gn(yn))break}return I.none()},_o=($e,qe,$t)=>((Mt,gn,yn,Ot,_t)=>Ot(yn)?I.some(yn):C(_t)&&_t(yn)?I.none():gn(yn,Ot,_t))(0,Bn,$e,qe,$t),Do=$e=>$e.dom.classList!==void 0,ms=$e=>an($e,"class"),Co=($e,qe)=>{Do($e)?$e.dom.classList.remove(qe):(($t,Mt)=>{((gn,yn,Ot)=>{const _t=L(an(gn,yn),Xe=>Xe!==Ot);_t.length>0?vn(gn,yn,_t.join(" ")):Eo(gn,yn)})($t,"class",Mt)})($e,qe),($t=>{(Do($t)?$t.dom.classList:ms($t)).length===0&&Eo($t,"class")})($e)},Is=($e,qe)=>{$e.dispatch("FormatPainterToggle",{state:qe})};var pn,Lo,js,Hs;(function($e){$e.Retrival="Retrieval",$e.Application="Application"})(pn||(pn={})),function($e){$e.ListSchema="ListSchema",$e.SubstitutionSchema="SubstitionSchema"}(Lo||(Lo={})),function($e){$e.InsertUnorderedList="InsertUnorderedList",$e.InsertOrderedList="InsertOrderedList",$e.InsertDefinitionList="InsertDefinitionList"}(js||(js={})),function($e){$e.Table="Table",$e.Unspecified="Unspecified"}(Hs||(Hs={}));const Tr=$e=>{var qe,$t;qe=Fe($e.getBody()),$t="tox-cursor-format-painter",Do(qe)?qe.dom.classList.add($t):((Mt,gn)=>{((yn,Ot,_t)=>{const Xe=an(yn,Ot).concat([_t]);vn(yn,Ot,Xe.join(" "))})(Mt,"class",gn)})(qe,$t)},vr=($e,qe)=>{($t=>{Co(Fe($t.getBody()),"tox-cursor-format-painter")})($e),qe.set(pn.Retrival),Is($e,!1)},_s={formatpainter_checklist:{selector:"ul",classes:"tox-checklist"},formatpainter_liststyletype:{selector:"ul,ol",styles:{listStyleType:"%value"}},formatpainter_borderstyle:{selector:"td,th",styles:{borderTopStyle:"%valueTop",borderRightStyle:"%valueRight",borderBottomStyle:"%valueBottom",borderLeftStyle:"%valueLeft"},remove_similar:!0},formatpainter_bordercolor:{selector:"td,th",styles:{borderTopColor:"%valueTop",borderRightColor:"%valueRight",borderBottomColor:"%valueBottom",borderLeftColor:"%valueLeft"},remove_similar:!0},formatpainter_backgroundcolor:{selector:"td,th",styles:{backgroundColor:"%value"},remove_similar:!0},formatpainter_removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*:not(tr,td,th,table)",attributes:["style","class"],split:!1,expand:!1,deep:!0}],formatpainter_legacy_font:{inline:"font",attributes:{size:"%value"}}},br=($e,qe)=>ce(qe,"selector").exists($t=>{const Mt=$e.getBody(),gn=$e.selection.getStart(),yn=$e.dom.getParents(gn,R,Mt),Ot=$e.selection.getSelectedBlocks();return $e.dom.is([...yn,...Ot],$t)}),Dr=$e=>$e.length>1&&$e.charAt(0)==="%",ps=($e,qe)=>ce($e,qe).filter($t=>!u($t)),po=$e=>Qe($e,"OL,UL,DL"),Ds=$e=>Qe($e,"LI,DT,DD"),Nt=$e=>$e.replace(/([A-Z])/g,qe=>`-${qe[0].toLowerCase()}`),Gt=($e,qe,$t)=>{const Mt=$e.formatter,gn=((Xe,tt)=>q(Xe.formatter.get(tt),jt=>((nn,Dn)=>Dt(Dn,"inline")&&!br(nn,Dn))(Xe,jt)))($e,$t.formatName),yn=((Xe,tt,jt)=>q(tt.get(jt),nn=>((Dn,jn)=>Dt(jn,"block")||br(Dn,jn))(Xe,nn)))($e,Mt,$t.formatName),Ot=(_t=$t.formatName,Q(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"],_t));var _t;(qe.table&&Ot||gn||qe.block&&yn&&!Ot)&&Mt.apply($t.formatName,$t.substitutedVariables)},Un=$e=>{const qe=$e.selection,$t=qe.getRng(),Mt=Fe($e.getBody()),gn=(_t=>L(_t.selection.getSelectedBlocks().map(Fe),Ds))($e),yn=$t.collapsed&&gn.length,Ot=gn.length&&!((_t,Xe)=>{const tt=jn=>vt(jn,Xe);return(jt=_o(Fe(_t.getStart()),po,tt),nn=_o(Fe(_t.getEnd()),po,tt),Dn=(jn,Yn)=>vt(jn,Yn),jt.isSome()&&nn.isSome()?I.some(Dn(jt.getOrDie(),nn.getOrDie())):I.none()).getOr(!1);var jt,nn,Dn})(qe,Mt);return gn.length>1||yn||Ot},uo=$e=>$e.options.get("formatpainter_ignored_formats"),Fo=($e,qe)=>{return qe==="class"?(gn=>Do(gn)?(yn=>{const Ot=yn.dom.classList,_t=new Array(Ot.length);for(let Xe=0;Xe<Ot.length;Xe++){const tt=Ot.item(Xe);tt!==null&&(_t[Xe]=tt)}return _t})(gn):ms(gn))($e).filter(gn=>!/^(mce-.*)/.test(gn)).join(" "):($t=$e,Mt=qe,I.from(kn($t,Mt))).getOr("");var $t,Mt},ss=$e=>((qe,$t)=>{const Mt={},gn={};return((yn,Ot,_t,Xe)=>{ke(yn,(tt,jt)=>{(Ot(tt,jt)?_t:Xe)(tt,jt)})})(qe,$t,je(Mt),je(gn)),{t:Mt,f:gn}})($e,qe=>{return($t=qe).length>1&&$t.charAt(0)==="%";var $t}).t,ur=($e,qe)=>($t=>{const Mt=uo($t);return Be($t.formatter.get()).filter(gn=>!Q(Mt,gn))})($e).filter($t=>{const Mt=((gn,yn)=>q(gn.formatter.get(yn),Ot=>(_t=>{const Xe=ps(_t,"styles").exists(jt=>q(Ce(jt),Dr)),tt=ps(_t,"attributes").exists(jt=>q(Ce(jt),Dr));return Xe||tt})(Ot)))($e,$t);return $e.formatter.matchNode(qe.dom,$t,{},Mt)}),dr=($e,qe)=>{const $t=Z($e.dom.getParents(qe,R),Fe);return Ke(L($t,Ft),Mt=>Ke(ur($e,Mt),gn=>((yn,Ot,_t)=>{return(Xe=yn.get(Ot),(tt=>0<tt.length?I.some(tt[0]):I.none())(Xe)).bind(tt=>((jt,nn)=>{const Dn=ps(jt,"styles").map(Wn=>{return go=nn,ko=ss(Wn),et(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:It(go,Nt(Ms))}));var go,ko}),jn=ps(jt,"attributes").map(Wn=>{return go=nn,ko=ss(Wn),et(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:Fo(go,Ms)}));var go,ko}),Yn={...Dn.getOr({}),...jn.getOr({})};return Ce(Yn).every(Wn=>Wn!=="")?I.some(Yn):I.none()})(tt,_t)).map(tt=>({kind:Lo.SubstitutionSchema,formatName:Ot,substitutedVariables:tt}));var Xe})($e.formatter,gn,Mt).toArray()))},or=$e=>(qe=>pe(Ce(js),$t=>qe.queryCommandState($t)))($e).map(qe=>({kind:Lo.ListSchema,command:qe})),at=($e,qe)=>$e.getParent(qe,"TABLE")?Hs.Table:Hs.Unspecified,ot=($e,qe,$t)=>{$e.addCommand("mceToggleFormatPainter",()=>{((Mt,gn)=>{gn.get()===pn.Application?vr(Mt,gn):((yn,Ot)=>{const _t=Se(),Xe=me(!1);Tr(yn),Ot.set(pn.Application),Is(yn,!0),yn.execCommand("mceRetrieveFormats");const tt=()=>{yn.execCommand("mcePaintFormats"),vr(yn,Ot)},jt=()=>{Ot.get()===pn.Application&&tt(),Yn()},nn=Wn=>{Ot.get()===pn.Application&&(Wn.type==="touchcancel"&&_t.os.isAndroid()?yn.once("contextmenu",tt):Xe.get()?tt():yn.once("selectionchange",tt)),Yn()},Dn=Wn=>{Wn.keyCode===27&&(vr(yn,Ot),Yn())},jn=Wn=>{Xe.set(Wn.type==="touchmove")};yn.on("click",jt),yn.on("touchstart touchmove",jn),yn.on("touchend touchcancel",nn),yn.on("keydown",Dn);const Yn=()=>{yn.off("click",jt),yn.off("touchstart touchmove",jn),yn.off("touchend touchcancel",nn),yn.off("keydown",Dn)}})(Mt,gn)})($e,qe)}),$e.addCommand("mcePaintFormats",()=>{$e.selection.isEditable()&&$e.undoManager.transact(()=>{((Mt,gn)=>{((Ot,_t)=>{Ot.formatter.remove("formatpainter_removeformat"),_t===Hs.Table&&(Xe=>{for(let jt=0,nn=Xe.length;jt<nn;jt++)tt=Xe[jt],Ot.formatter.remove(tt);var tt})(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"]),Un(Ot)&&Ot.execCommand("RemoveList")})(Mt,gn.context);const yn=(Ot=>{const _t=Ot.selection.getStart(),Xe=Ot.selection.getRng().collapsed,tt=Ot.dom.select("td[data-mce-selected]").length>0,jt=!!Ot.dom.getParent(_t,"TABLE");return{inline:!0,table:Xe&&jt||tt,block:Xe||(nn=Ot.selection,nn.getSelectedBlocks().length>1)||tt};var nn})(Mt);gn.schemas.forEach(Ot=>{switch(Ot.kind){case Lo.ListSchema:((_t,Xe,tt)=>{tt.block&&_t.execCommand(Xe.command)})(Mt,Ot,yn);break;case Lo.SubstitutionSchema:Gt(Mt,yn,Ot)}})})($e,$t.get())})}),$e.addCommand("mceRetrieveFormats",()=>{$t.set((Mt=>{const gn=Mt.dom,yn=Mt.selection.getStart();return{schemas:[...or(Mt).toArray(),...dr(Mt,yn)],context:at(gn,yn)}})($e))})};tinymce.PluginManager.add("formatpainter",$e=>{if(((Mt,gn)=>!!Mt&&((yn,Ot)=>{const _t=_e(yn.major,Ot.major);if(_t!==0)return _t;const Xe=_e(yn.minor,Ot.minor);if(Xe!==0)return Xe;const tt=_e(yn.patch,Ot.patch);return tt!==0?tt:0})((yn=>He((Ot=>[Ot.majorVersion,Ot.minorVersion].join(".").split(".").slice(0,3).join("."))(yn)))(Mt),He(gn))===-1)(tinymce,"6.0.0"))return void window.console.error("The format painter plugin requires at least version 6.0.0 of TinyMCE.");const qe=me(pn.Retrival),$t=me({schemas:[],context:Hs.Unspecified});(Mt=>{(0,Mt.options.register)("formatpainter_ignored_formats",{processor:"string[]",default:"link,address,removeformat,formatpainter_removeformat".split(",")})})($e),(Mt=>{Mt.on("PreInit",()=>{ke(_s,(gn,yn)=>{Mt.formatter.get(yn)||Mt.formatter.register(yn,gn)})})})($e),ot($e,qe,$t),(Mt=>{Mt.ui.registry.addToggleButton("formatpainter",{active:!1,icon:"format-painter",tooltip:"Format painter",onAction:()=>Mt.execCommand("mceToggleFormatPainter"),onSetup:gn=>{const yn=Ot=>{gn.setActive(Ot.state)};return Mt.on("FormatPainterToggle",yn),()=>Mt.off("FormatPainterToggle",yn)}})})($e),((Mt,gn)=>{Mt.ui.registry.addToggleMenuItem("formatpainter",{active:!1,icon:"format-painter",text:"Format painter",onAction:()=>Mt.execCommand("mceToggleFormatPainter"),onSetup:yn=>{const Ot=_t=>{yn.setActive(_t.state)};return yn.setActive(gn.get()===pn.Application),Mt.on("FormatPainterToggle",Ot),()=>Mt.off("FormatPainterToggle",Ot)}})})($e,qe),(Mt=>{Mt.addShortcut("Meta+alt+C","",()=>{Mt.execCommand("mceRetrieveFormats")}),Mt.addShortcut("Meta+alt+V","",()=>{Mt.execCommand("mcePaintFormats")})})($e)})})();const Efe=["accordion","advlist","anchor","autolink","autosave","charmap","code","codesample","directionality","importcss","insertdatetime","link","lists","image","media","nonbreaking","pagebreak","preview","quickbars","save","searchreplace","table","visualblocks","fullscreen","visualchars","wordcount","pasteprocess","formatpainter"],a6e="undo redo h1 h2 h3 bold italic underline strikethrough subscript superscript fontsize fontFamily lineheight forecolor backcolor alignleft aligncenter alignright alignjustify pagebreak bullist numlist outdent indent blockquotelink unlink image code removeformat formatpainter fullscreen preview ",_fe="file edit insert table tools help",i6e={menu:{pagesize:{title:"页面大小",items:s6e},orientation:{title:"页面方向",items:r6e}},menubar:_fe+" pagesize orientation",pagesize:"A4",orientation:"portrait",plugins:[...Efe,"pagesize"]},l6e={license_key:"gpl",skin:!1,content_css:["css/content.css","css/reset.css"],promotion:!1,menubar:_fe,cleanup:!0,branding:!1,language:"zh_CN",plugins:Efe,toolbar:a6e,fontsize_formats:"12px 14px 16px 18px 20px 22px 24px 28px 32px 36px 48px 56px 72px",font_formats:"微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;",lineheight_formats:"0.5 0.8 1 1.2 1.5 1.75 2 2.5 3 4 5",elementpath:!1,paste_data_images:!0,object_resizing:!0,toolbar_mode:"wrap",images_upload_handler:o=>new Promise((s,i)=>{const u=new FormData;u.append("files",o.blob(),o.filename()),fetch(`${process.env.NODE_ENV==="development"?"/api":""}/ajax/uploaddoc`,{method:"POST",body:u}).then(m=>m.json()).then(m=>{m.status===1?s(m.file_url):i(`上传失败: ${m.message}`)}).catch(m=>{i(`上传出错: ${m.message}`)})})},c6e={name:"ProEditor",components:{Editor:FMe},props:{modelValue:{type:String,default:""},pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},hasPagesize:{type:Boolean,default:!1},placeholder:{type:String,default:"请输入内容"},width:{type:[Number,String],default:"100%"},height:{type:Number,default:400}},setup(o,{emit:s}){Em(o.modelValue);const i=d.ref(null),u=d.reactive({myInit:h(l6e),contentValue:o.modelValue,timeout:null});d.onMounted(()=>{K6.init({license_key:"gpl"}),K6.activeEditor.on("pagesizechange",b=>{(o==null?void 0:o.pagesize)!==b.size&&s("update:pagesize",b.size)}),K6.activeEditor.on("orientationchange",b=>{(o==null?void 0:o.orientation)!==b.orientation&&s("update:orientation",b.orientation)})}),d.watch(()=>u.contentValue,()=>{m(()=>{s("update:modelValue",u.contentValue)})}),d.watch(()=>o.orientation,()=>{var b,C;i.value&&((C=(b=i.value)==null?void 0:b.getEditor)==null||C.call(b).fire("orientationchange",{orientation:o.orientation}))}),d.watch(()=>o.pagesize,()=>{var b,C;i.value&&((C=(b=i.value)==null?void 0:b.getEditor)==null||C.call(b).fire("pagesizechange",{size:o.pagesize}))}),d.watch(()=>o.modelValue,b=>{!dB(b)&&b!==u.contentValue&&(u.contentValue=b)}),d.watch(()=>o.height,b=>{var C,S,_,N,O,R,I,W;i.value&&((W=(N=(_=(S=(C=i.value)==null?void 0:C.getEditor)==null?void 0:S.call(C))==null?void 0:_.dom)==null?void 0:N.setStyle)==null||W.call(N,(I=(R=(O=i.value)==null?void 0:O.getEditor)==null?void 0:R.call(O))==null?void 0:I.editorContainer,"height",b+"px"))});function m(b,C=400){u.timeout!==null&&clearTimeout(u.timeout),u.timeout=setTimeout(b,C)}function h(b){var O;o!=null&&o.height&&(b.height=o.height),o!=null&&o.width&&(b.width=o.width);const{placeholder:C,pagesize:S,orientation:_}=o,N=`${location==null?void 0:location.origin}/${dB(window==null?void 0:window.zyuiAssetsPath)?"assets/":window==null?void 0:window.zyuiAssetsPath}`;return b={...b,content_css:(O=b==null?void 0:b.content_css)==null?void 0:O.map(R=>R.includes("http")?R:`${N}${R}`),placeholder:C,...o.hasPagesize?{...i6e,pagesize:S,orientation:_}:{}},b}return{...d.toRefs(u),editorRef:i,customer:h,debounce:m}}},u6e={class:"my-tinymce"};function d6e(o,s,i,u,m,h){const b=d.resolveComponent("Editor");return d.openBlock(),d.createElementBlock("div",u6e,[d.createVNode(b,{modelValue:o.contentValue,"onUpdate:modelValue":s[0]||(s[0]=C=>o.contentValue=C),init:o.myInit,ref:"editorRef"},null,8,["modelValue","init"])])}const kfe=Ja(c6e,[["render",d6e]]),f6e={name:"ShadowDomWrap",setup(o,{emit:s,expose:i}){const u=d.ref(null),m=d.ref(),h=d.ref(!1),b=Ih(),C=_=>{if(_.target.closest(".context-menu")||!u.value)return;const O=u.value.contains(_.target);!O&&h.value?(h.value=!1,s("onBlur")):O&&!h.value&&(h.value=!0,s("onFocus"))},S=_=>{h.value=!0,s("onFocus"),_.stopPropagation()};return d.onMounted(()=>{var R,I,W,G,Q;m.value=(R=u.value)==null?void 0:R.attachShadow({mode:"open"}),document.addEventListener("click",C);const _=dB(window==null?void 0:window.zyuiAssetsPath)?"assets/":window==null?void 0:window.zyuiAssetsPath,N=document.createElement("link");N.rel="stylesheet",N.href=`${location==null?void 0:location.origin}/${_}css/index.min.css`,(I=m.value)==null||I.appendChild(N);const O=document.createElement("link");O.rel="stylesheet",O.href=`${location==null?void 0:location.origin}/${_}css/reset.css`,(W=m.value)==null||W.appendChild(O),(G=b==null?void 0:b.cssConfig)!=null&&G.links&&b.cssConfig.links.forEach(q=>{var L;const Z=document.createElement("link");Z.rel="stylesheet",Z.href=q,(L=m.value)==null||L.appendChild(Z)}),(Q=b==null?void 0:b.cssConfig)!=null&&Q.styles&&b.cssConfig.styles.forEach(q=>{var L;const Z=document.createElement("style");Z.textContent=q,(L=m.value)==null||L.appendChild(Z)})}),d.onUnmounted(()=>{document.removeEventListener("click",C)}),i({focus:()=>{h.value=!0},getInnerHTML:()=>{var _;return((_=m.value)==null?void 0:_.innerHTML)||""}}),{shadowHost:u,shadowRoot:m,handleClick:S}}};function m6e(o,s,i,u,m,h){return d.openBlock(),d.createElementBlock("div",{ref:"shadowHost",class:"shadow-host",onClick:s[0]||(s[0]=d.withModifiers((...b)=>u.handleClick&&u.handleClick(...b),["stop"]))},[u.shadowRoot?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:u.shadowRoot},[d.renderSlot(o.$slots,"default")],8,["to"])):d.createCommentVNode("",!0)],512)}const RB=Ja(f6e,[["render",m6e]]),p6e=["innerHTML"],Tfe=d.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=d.useModel(o,"modelValue");return(i,u)=>(d.openBlock(),d.createBlock(RB,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,p6e)]),_:1}))}}),Afe=Symbol("nodesUI"),ef=()=>{const o=d.inject(Afe);if(!o)throw new Error("NodesUI context not found");return o};function $U(o){if(!o||!o.ownerDocument)return null;const s=[];let i=o;for(;i&&i.nodeType===Node.ELEMENT_NODE;){let u=i.nodeName.toLowerCase();if(i.parentElement){const h=Array.from(i.parentElement.children).filter(b=>b.nodeName.toLowerCase()===i.nodeName.toLowerCase());if(h.length>1){const b=h.indexOf(i)+1;u+=`:nth-of-type(${b})`}}if(s.unshift(u),i=i.parentElement,i&&(i.nodeName.toLowerCase()==="body"||i.nodeName.toLowerCase()==="html"))break}return s.length?s.join(" > "):null}function g6e(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(`#${CSS.escape(o)}`)}catch(i){return console.error("nodePath query error:",i),null}}function h6e(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(o)}catch(i){return console.error("nodePath query error:",i),null}}const WA=o=>o!=null&&o.id?o==null?void 0:o.id:o.nodePath+(o!=null&&o.textNodeIndex?`-${o==null?void 0:o.textNodeIndex}`:"")+(o!=null&&o.startOffset?`-${o==null?void 0:o.startOffset}`:"")+(o!=null&&o.subNodeSort?`-${o==null?void 0:o.subNodeSort}`:""),Nfe=o=>{if(o.nodeType===Node.TEXT_NODE)return o;let s=null;for(let i=o.childNodes.length-1;i>=0;i--){const u=o.childNodes[i],m=Nfe(u);if(m){s=m;break}}return s},v6e=(o,s,i)=>{var b,C,S;const u=i==null?void 0:i.getRootNode(),m=(b=u==null?void 0:u.getSelection)==null?void 0:b.call(u),h=h6e(o.nodePath,i);if(m&&s&&h){const _=document.createRange(),N=(o==null?void 0:o.textNodeIndex)||0,O=h.childNodes[N]||h;let R,I;if(O.nodeType===Node.TEXT_NODE)R=O,I=Math.min(o.startOffset||0,((C=O.textContent)==null?void 0:C.length)||0);else{const W=Nfe(O);W?(R=W,I=((S=W.textContent)==null?void 0:S.length)||0):(R=O,I=0)}_.setStart(R,I),_.setEnd(R,I),_.insertNode(s),_.setStartAfter(s),_.collapse(!0),m.removeAllRanges(),m.addRange(_)}},b6e=(o,s)=>{s!=null&&s.id&&(o.id=s==null?void 0:s.id),(s==null?void 0:s.nodePath)!==void 0&&o.setAttribute("data-nodePath",s.nodePath),(s==null?void 0:s.textNodeIndex)!==void 0&&s.textNodeIndex>=0&&o.setAttribute("data-textNodeIndex",s.textNodeIndex.toString()),s.startOffset!==void 0&&s.startOffset>=0&&o.setAttribute("data-startOffset",s.startOffset.toString()),(s==null?void 0:s.subNodeSort)!==void 0&&s.subNodeSort>=0&&o.setAttribute("data-subNodeSort",s.subNodeSort.toString()),(s==null?void 0:s.groupKey)!==void 0&&o.setAttribute("data-groupKey",s.groupKey)},y6e=o=>{const s=o.closest("TD"),i=o.closest(".node-item");let u=null;if(i?u=i:s&&s.classList.contains("node-item-td")&&(u=s),!u)return null;const m=u||o;let h=m==null?void 0:m.getAttribute("data-nodePath");if(h||(h=$U(m)),(m==null?void 0:m.getAttribute("selectable"))==="false")return null;const b={element:m,nodePath:h},C=m==null?void 0:m.getAttribute("data-textNodeIndex");C&&(b.textNodeIndex=Number(C));const S=m==null?void 0:m.getAttribute("data-startOffset");S&&(b.startOffset=Number(S));const _=m==null?void 0:m.getAttribute("data-subNodeSort");_&&(b.subNodeSort=Number(_));const N=m==null?void 0:m.getAttribute("data-groupKey");N&&(b.groupKey=N);const O=m==null?void 0:m.getAttribute("id");return O&&(b.id=O),b},Ofe=o=>Nxe(o,s=>d.toValue(s.nodes).map(i=>({...i,color:s.color,activated:s==null?void 0:s.activated,dataGroupKey:s.id}))),Mz=(o,s)=>{const i=o.startsWith("#")?o.slice(1):o;let u,m,h;if(i.length===3)u=parseInt(i[0]+i[0],16),m=parseInt(i[1]+i[1],16),h=parseInt(i[2]+i[2],16);else if(i.length===6)u=parseInt(i.substring(0,2),16),m=parseInt(i.substring(2,4),16),h=parseInt(i.substring(4,6),16);else return console.warn("Invalid color format:",o),`rgba(0, 0, 0, ${s})`;return`rgba(${u}, ${m}, ${h}, ${s})`},w6e=o=>{var S;const{element:s}=o;if(!s)return null;if(!wne(o))return{showTextType:"input"};const i=s.closest("tr"),u=Array.from(i.parentElement.children).indexOf(i),m=Array.from(i.children).indexOf(s.closest("td")||s.closest("th")),h=s.closest("table"),b=((S=s.closest("body"))==null?void 0:S.querySelectorAll("table"))||[];return{showTextType:"cell",tableIndex:Array.from(b).indexOf(h)+1,colIndex:m,rowIndex:u}},C6e=(o,s)=>{var m,h;let i=1;const u=(m=o==null?void 0:o.map(b=>s==null?void 0:s.find(C=>(C==null?void 0:C.id)===(b==null?void 0:b.id))))==null?void 0:m.filter(Boolean);return(u==null?void 0:u.length)>0?(h=u==null?void 0:u.map(C=>{const S=w6e(C);return S?(S==null?void 0:S.showTextType)==="input"?{...C,...S,inputIndex:i++}:{...C,...S}:null}))==null?void 0:h.filter(Boolean):[]};function S6e(o){if(!o||o.length===0)return[];const s=[...o].sort((m,h)=>m.rowIndex!==h.rowIndex?m.rowIndex-h.rowIndex:m.colIndex-h.colIndex),i=[],u=new Set;for(const m of s){if(u.has(m))continue;const h=[];let b=0,C=0;for(let S=m.colIndex;s.find(N=>N.rowIndex===m.rowIndex&&N.colIndex===S&&!u.has(N));S++)C++;if(C!==0){b=C;for(let S=m.rowIndex;;S++){let _=0;const N=[];for(let O=m.colIndex;O<m.colIndex+b;O++){const R=s.find(I=>I.rowIndex===S&&I.colIndex===O&&!u.has(I));if(R)_++,N.push(R);else break}if(_===b)h.push(...N);else break}h.length>0&&(i.push([...h]),h.forEach(S=>u.add(S)))}}return i}function x6e(o){if(!o||o.length===0)return{min:null,max:null};let s=o[0],i=o[0];for(const u of o)(u.colIndex<s.colIndex||u.colIndex===s.colIndex&&u.rowIndex<s.rowIndex)&&(s=u),(u.colIndex>i.colIndex||u.colIndex===i.colIndex&&u.rowIndex>i.rowIndex)&&(i=u);return{min:s,max:i}}const $fe=(o,s)=>{var _;const i=C6e(o,s||[]),u=[],m=[];(_=d.toValue(i))==null||_.forEach(N=>{(N==null?void 0:N.showTextType)==="input"?u.push(N):m.push(N)});const h=Dxe(m,"tableIndex"),b=Object.entries(h).map(([N,O])=>({tableIndex:Number(N),nodes:O})),C=pde(b==null?void 0:b.map(N=>S6e(N==null?void 0:N.nodes))),S=(C==null?void 0:C.map(N=>x6e(N)))||[];return[...u,...S]},r4=o=>{function s(i){let u="";for(;i>=0;)u=String.fromCharCode(65+i%26)+u,i=Math.floor(i/26)-1;return u}return(o==null?void 0:o.colIndex)>=0&&(o==null?void 0:o.rowIndex)>=0?`${s(o==null?void 0:o.colIndex)}${o==null?void 0:o.rowIndex}`:""},E6e=(o,s)=>{const i=$fe(o,s||[]),u=[];return i==null||i.forEach(m=>{var h,b;(m==null?void 0:m.showTextType)==="input"?u.push(`填写${m==null?void 0:m.inputIndex}`):u.push(((h=m==null?void 0:m.min)==null?void 0:h.id)===((b=m==null?void 0:m.max)==null?void 0:b.id)?r4(m==null?void 0:m.min):`${r4(m==null?void 0:m.min)}:${r4(m==null?void 0:m.max)}`)}),u==null?void 0:u.join(",")},wne=o=>{if(!(o!=null&&o.nodePath))return!1;const s=o.nodePath.split(" > "),i=s[s.length-1];return(i==null?void 0:i.startsWith("td"))&&!(o!=null&&o.startOffset)},_6e=o=>{var i;return(i=ta(o))==null?void 0:i.map(u=>(u==null||delete u.element,u))},k6e=o=>{o.querySelectorAll("p").forEach(i=>{var u;i.classList.contains("empty")&&i.classList.remove("empty"),((u=i.innerText)==null?void 0:u.trim())===""&&i.classList.add("empty")})},T6e={key:0,class:"td-node"},A6e={key:1},N6e=d.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,i=d.computed(()=>{var m,h,b,C,S;return(h=(m=s==null?void 0:s.node)==null?void 0:m.props)!=null&&h.alias?(C=(b=s==null?void 0:s.node)==null?void 0:b.props)==null?void 0:C.alias:(S=s==null?void 0:s.node)==null?void 0:S.label}),u=d.computed(()=>{var m,h;return((h=(m=s==null?void 0:s.node)==null?void 0:m.element)==null?void 0:h.tagName)==="TD"});return(m,h)=>u.value?(d.openBlock(),d.createElementBlock("span",T6e,d.toDisplayString(i.value),1)):(d.openBlock(),d.createElementBlock("span",A6e,d.toDisplayString(i.value),1))}}),Dfe=Symbol("nodesEditor"),j0=()=>{const o=d.inject(Dfe);if(!o)throw new Error("NodesEditor context not found");return o},DU=d.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,{currentNodes:i}=ef(),{nodes:u,renderType:m,disabledNodes:h}=j0(),b=d.computed(()=>{var O;return(O=s.node)!=null&&O.id?u.value.some(R=>R.id===s.node.id):!1}),C=d.computed(()=>{var O;if(!((O=s.node)!=null&&O.element))return!1;try{return s.node.element.parentNode!==null}catch(R){return console.warn("Element validation failed:",R),!1}}),S=d.computed(()=>{var I,W;const O=(I=h==null?void 0:h.value)==null?void 0:I.some(G=>{var Q;return(G==null?void 0:G.id)===((Q=s==null?void 0:s.node)==null?void 0:Q.id)}),R=(W=d.toValue(i))==null?void 0:W.find(G=>{var Q;return(G==null?void 0:G.id)===((Q=s==null?void 0:s.node)==null?void 0:Q.id)});return{...s==null?void 0:s.node,...R,disabled:O}}),_=O=>{var I;let R="";if(d.toValue(O==null?void 0:O.activated)&&(R="normal"),O!=null&&O.disabled&&(R="disabled"),(I=s==null?void 0:s.node)!=null&&I.element)switch(R){case"normal":s.node.element.style.setProperty("--node-color",(O==null?void 0:O.color)||"#409eff"),s.node.element.style.setProperty("--node-bg-color",Mz((O==null?void 0:O.color)||"#409eff",.1)),s.node.element.setAttribute("data-dataGroupKey",O==null?void 0:O.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("activated");break;case"disabled":s.node.element.style.setProperty("--node-color",(O==null?void 0:O.color)||"#F56C6C"),s.node.element.style.setProperty("--node-bg-color",Mz((O==null?void 0:O.color)||"#F56C6C",.1)),s.node.element.setAttribute("data-dataGroupKey",O==null?void 0:O.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("disabled");break;default:N();break}},N=()=>{var O,R,I,W,G;(O=s==null?void 0:s.node)!=null&&O.element&&((R=s.node.element)==null||R.removeAttribute("data-dataGroupKey"),(I=s.node.element)==null||I.removeAttribute("selectable"),(W=s.node.element)==null||W.classList.remove("activated"),(G=s.node.element)==null||G.classList.remove("disabled"))};return d.watch(()=>S,()=>{const O=d.toValue(S);O!=null&&O.id?_(O):N()},{immediate:!0,deep:!0}),(O,R)=>{var I;return(I=O.node)!=null&&I.element&&C.value&&b.value?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:O.node.element},[d.createElementVNode("div",{class:d.normalizeClass(["node-item-render",`node-item-${d.unref(m)}`])},[d.renderSlot(O.$slots,"default",{node:O.node},()=>[d.createVNode(N6e,{node:O.node},null,8,["node"])])],2)],8,["to"])):d.createCommentVNode("",!0)}}});function O6e(){const o=d.ref(!1),s=u=>{u.key==="Control"&&(o.value=!0)},i=u=>{u.key==="Control"&&(o.value=!1)};return d.onMounted(()=>{window.addEventListener("keydown",s),window.addEventListener("keyup",i)}),d.onUnmounted(()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",i)}),o}function Mfe(){const{selectedNodes:o,setSelectedNodes:s,containerRef:i}=ef(),{editorId:u,nodes:m,disabledNodes:h}=j0(),b=d.ref(!1),C=d.ref({x:0,y:0}),S=d.ref({x:0,y:0}),_=d.ref({left:0,top:0,width:0,height:0}),N=d.ref(null),O=Y=>{const ke=Y.closest(".node-item-td")||Y.closest(".node-item");if(ke!==null){let et=[];if(ke.classList.contains("node-selected"))return;const je=ke.getAttribute("id");if(je&&m.value){const Ce=m.value.find(ce=>ce.id===je);Ce&&(et=[Ce])}et=L(et),s(et)}},R=Y=>{var Ce;if(Y.button===2&&O(Y==null?void 0:Y.target),Y.button!==0||(b.value=!0,!N.value))return;const ke=(Ce=i==null?void 0:i.value)==null?void 0:Ce.getBoundingClientRect();if(!ke)return;const et=Y.clientX-(ke==null?void 0:ke.left),je=Y.clientY-(ke==null?void 0:ke.top);C.value={x:et,y:je},S.value={x:et,y:je},q(Y),pe(),N.value.style.display="block",window.addEventListener("mousemove",I),window.addEventListener("wheel",W),window.addEventListener("mouseup",G)},I=dte(Y=>{var ke;if(b.value){const et=(ke=i==null?void 0:i.value)==null?void 0:ke.getBoundingClientRect();if(!et)return;const je=Y.clientX-(et==null?void 0:et.left),Ce=Y.clientY-(et==null?void 0:et.top);S.value={x:je,y:Ce},pe()}},16),W=dte(Y=>{b.value&&setTimeout(()=>{var Ce;const ke=(Ce=i==null?void 0:i.value)==null?void 0:Ce.getBoundingClientRect();if(!ke)return;const et=Y.clientX-(ke==null?void 0:ke.left),je=Y.clientY-(ke==null?void 0:ke.top);S.value={x:et,y:je},pe()},0)},16),G=Y=>{Y.button===0&&(b.value=!1,N.value&&(pe(),N.value.style.display="none",window.removeEventListener("mousemove",I),window.removeEventListener("wheel",W),window.removeEventListener("mouseup",G)))},Q=O6e(),q=Y=>{var et,je;let ke=[];if(Y.button===0&&(Y!=null&&Y.target)){const Ce=((et=Y==null?void 0:Y.target)==null?void 0:et.closest(".node-item-td"))||((je=Y==null?void 0:Y.target)==null?void 0:je.closest(".node-item"));if(Ce!==null){const ce=Ce.getAttribute("id");if(ce&&m.value){const Dt=m.value.find(me=>me.id===ce);Dt&&(Q.value?o.value.some(me=>WA(me)===WA(Dt))?ke=o.value.filter(be=>WA(be)!==WA(Dt)):ke=[...o.value,Dt]:Dt&&(ke=[Dt]))}}ke=L(ke),s(ke)}},Z=()=>{var Dt;if(!i.value||!(_.value.width>3||_.value.height>3))return;let Y=[];const ke=(Dt=i==null?void 0:i.value)==null?void 0:Dt.getBoundingClientRect(),et=_.value.left+(ke==null?void 0:ke.left),je=_.value.top+(ke==null?void 0:ke.top),Ce={left:_.value.left+(ke==null?void 0:ke.left),right:et+_.value.width,top:_.value.top+(ke==null?void 0:ke.top),bottom:je+_.value.height};if(i.value.querySelectorAll("*").forEach(me=>{const be=me.getBoundingClientRect();if(!Ce)return;const $={left:be.left,right:be.right,top:be.top,bottom:be.bottom};if($.right>Ce.left&&$.left<Ce.right&&$.bottom>Ce.top&&$.top<Ce.bottom){const _e=me.getAttribute("id");if(_e&&m.value){const le=m.value.find(He=>He.id===_e);le&&(Y=[...Y,le])}}}),Y=L(Y),Q.value){const me=new Set(o.value.map($=>WA($))),be=Y.filter($=>!me.has(WA($)));s([...o.value,...be])}else s(Y)},L=Y=>{let ke=[];if(Y.length>0&&(ke=[...Y]),h&&h.value&&h.value.length>0){const et=new Set(h.value.map(je=>je.id).filter(Boolean));ke=ke.filter(je=>je.id?!et.has(je.id):!0)}return ke},pe=dte(()=>{if(!N.value||!i.value)return;const{x:Y,y:ke}=C.value,{x:et,y:je}=S.value,Ce=Math.min(Y,et),ce=Math.min(ke,je),Dt=Math.abs(Y-et),me=Math.abs(ke-je);_.value={left:Ce,top:ce,width:Dt,height:me}},16),Ke=Y=>{if(!N.value)return;const{left:ke,top:et,width:je,height:Ce}=d.toValue(Y);N.value.style.left=`${ke}px`,N.value.style.top=`${et}px`,N.value.style.width=`${je}px`,N.value.style.height=`${Ce}px`},Be=()=>{if(!i.value)return;i.value.addEventListener("mousedown",R);const Y=document.getElementById(`select_area_${u}`);if(Y){N.value=Y;return}const ke=document.createElement("div");ke.id=`select_area_${u}`,ke.style.position="absolute",ke.style.border="1px solid #1677ff",ke.style.backgroundColor="rgba(22, 119, 255, 0.05)",ke.style.pointerEvents="none",ke.style.display="none",i.value.appendChild(ke),N.value=ke};return d.watch(_,(Y,ke)=>{na(Y,ke)||(Ke(Y),b.value&&Z())},{deep:!0}),d.watch(()=>i.value,Y=>{d.toValue(Y)&&Be()},{immediate:!0}),d.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",R)}),{isSelecting:b,selectionBox:N}}function Boe(){const{selectedNodes:o,containerRef:s}=ef(),i=()=>{var m;(m=d.toValue(s))==null||m.querySelectorAll(".node-selected").forEach(h=>{h.classList.remove("node-selected")})},u=m=>{m.forEach(h=>{h.classList.add("node-selected")})};d.watch(()=>o,()=>{i(),setTimeout(()=>{var h,b;const m=(b=(h=d.toValue(o))==null?void 0:h.map(C=>{var S;return(S=s.value)==null?void 0:S.querySelector(`[id="${C.id}"]`)}))==null?void 0:b.filter(Boolean);u(m)},0)},{deep:!0})}const IB=()=>{const{nodes:o,updateNodes:s}=j0();return{nodes:o,addNode:C=>{const _=(Array.isArray(C)?C:[C]).map(O=>({...O,id:O.id||m2()})),N=[...o.value,..._];s(N)},removeNode:async C=>{const S=Array.isArray(C)?C:[C],_=o.value.filter(N=>!S.includes(N==null?void 0:N.id));s(_)},editNodes:C=>{const S=Array.isArray(C)?C:[C],_=m2(),N=S.map(R=>{const I={...R};let W=R==null?void 0:R.id;return W||(W=m2(),I.id=W),I!=null&&I.groupKey||(I.groupKey=_),I}),O=[...o.value];N.forEach(R=>{const I=O.findIndex(W=>W.id===R.id);I!==-1?O[I]=R:O.push(R)}),s(O)},insertNodeAt:(C,S)=>{const _=[...o.value];_.splice(S,0,C),s(_)},moveNode:(C,S)=>{const _=[...o.value],[N]=_.splice(C,1);_.splice(S,0,N),s(_)},updateNodes:s}};function $6e(){const{removeNode:o}=IB(),{containerRef:s}=ef(),i=d.ref(null),u=h=>{var G,Q;if(h.target instanceof Element&&(h.target.closest(".node-item")||h.target.closest(".node-item-td")||h.target.closest(".disabeld-edit")))return;const b=h.target;if(b===s.value)return;const S=((G=s.value)==null?void 0:G.getRootNode()).getSelection(),_=(Q=s.value)==null?void 0:Q.querySelectorAll('[contenteditable="true"]');_==null||_.forEach(q=>{q.setAttribute("contenteditable","false")});const N=b.textContent||"",O=b.innerHTML||"";i.value=b,b.setAttribute("contenteditable","true"),b.focus();const R=new MutationObserver(()=>{b.textContent!==N&&(b.innerHTML=O)});R.observe(b,{characterData:!0,childList:!0,subtree:!0});const I=q=>{q.preventDefault()};b.addEventListener("input",I),b.addEventListener("paste",I),b.addEventListener("drop",I),b.addEventListener("keydown",q=>{var Z,L,pe,Ke;if(((Z=document.activeElement)==null?void 0:Z.shadowRoot)===((L=s.value)==null?void 0:L.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(q.key)){if(q.key==="Backspace"||q.key==="Delete"){const Be=S==null?void 0:S.getRangeAt(0);if(b.blur(),(Be==null?void 0:Be.startOffset)===0){const Y=Be.startContainer;if(Y.nodeType===Node.TEXT_NODE){const ke=Y.previousSibling;if(ke&&ke.nodeType===Node.ELEMENT_NODE&&ke.classList.contains("node-item")){const et=ke.getAttribute("id");et&&o(et),(pe=Y.parentElement)==null||pe.normalize();return}}else if(Y.nodeType===Node.ELEMENT_NODE){const ke=Y.previousSibling;if(ke&&ke.nodeType===Node.ELEMENT_NODE&&ke.classList.contains("node-item")){const et=ke.getAttribute("id");et&&o(et),(Ke=Y.parentElement)==null||Ke.normalize();return}}}}q.preventDefault()}});const W=()=>{b==null||b.normalize(),R.disconnect(),b.removeEventListener("input",I),b.removeEventListener("paste",I),b.removeEventListener("drop",I),b.removeEventListener("blur",W),b.setAttribute("contenteditable","false")};b.addEventListener("blur",W)},m=()=>{var h;(h=s.value)==null||h.addEventListener("dblclick",u)};return d.watch(s,h=>{h&&m()},{immediate:!0}),d.onUnmounted(()=>{var h;(h=s.value)==null||h.removeEventListener("dblclick",u)}),{}}function D6e(){const{containerRef:o,focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}=ef(),h=_=>{var O;const N=_==null?void 0:_.getSelection();try{if((O=s.value)==null||O.normalize(),N){const I=function(){var ke,et;const G=_.getSelection();if(G.rangeCount===0)return null;const Q=G.getRangeAt(0),q=Q.startContainer;let Z=0,L=-1,pe=0,Ke=[];const Be=q.nodeType===Node.TEXT_NODE?q.parentNode:q;s.value=Be;const Y=Array.from(Be.childNodes);if(q.nodeType===Node.TEXT_NODE){Z=Q.startOffset,L=-1;for(let be=0;be<Y.length;be++)if(Y[be]===q){L=be;break}Ke=Y.slice(0,L);const je=[];let Ce=!1;for(let be=0;be<Ke.length;be++){const $=Ke[be];if((ke=$==null?void 0:$.classList)!=null&&ke.contains("node-item")){Ce=!0;continue}else if($.nodeType===Node.TEXT_NODE){const _e=je==null?void 0:je[je.length-1];Ce&&typeof _e=="string"?je[je.length-1]=_e+($==null?void 0:$.data):je.push($==null?void 0:$.data),Ce=!1}else je.push($),Ce=!1}const ce=Ke==null?void 0:Ke[Ke.length-1],Dt=je==null?void 0:je[je.length-1];pe=je==null?void 0:je.filter(be=>{var $;return!(($=be==null?void 0:be.classList)!=null&&$.contains("node-item"))}).length,(et=ce==null?void 0:ce.classList)!=null&&et.contains("node-item")&&typeof Dt=="string"&&pe--;const me=je==null?void 0:je[je.length-1];typeof me=="string"&&(Z+=(me==null?void 0:me.length)||0)}else{const je=Y==null?void 0:Y.filter(Ce=>{var ce;return(ce=Ce==null?void 0:Ce.classList)==null?void 0:ce.contains("node-item")}).length;Z=Q.startOffset-je}return{currentIndex:Math.max(pe,0),previousElements:Ke,startOffset:Math.max(Z,0)}}();return u.value=(I==null?void 0:I.currentIndex)||0,(I==null?void 0:I.startOffset)||0}}catch(R){console.error(R)}return 0},b=()=>{var N;const _=(N=o.value)==null?void 0:N.getRootNode();i.value=h(_)},C=_=>{var I;const N=_.target;if(N===o.value)return;s.value=N;const O=(I=o.value)==null?void 0:I.getRootNode();i.value=h(O),N.addEventListener("click",b),N.addEventListener("keyup",W=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(W.key)&&b()});const R=()=>{N.removeEventListener("click",b),N.removeEventListener("keyup",b),N.removeEventListener("blur",R),setTimeout(()=>{s.value=null,u.value=0,i.value=-1},300)};N.addEventListener("blur",R)},S=()=>{var _;(_=o.value)==null||_.addEventListener("focus",C,!0)};return d.watch(o,_=>{_&&S()},{immediate:!0}),d.onUnmounted(()=>{var _;(_=o.value)==null||_.removeEventListener("focus",C,!0)}),{focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}}function M6e(o){const s=o.value===null?[]:[JSON.parse(JSON.stringify(o.value))],i=d.ref(s),u=d.ref(0),m=d.ref(!1),h=d.computed(()=>i.value[u.value]),b=()=>{u.value>0&&(m.value=!0,u.value--,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},C=()=>{u.value<i.value.length-1&&(m.value=!0,u.value++,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},S=_=>{(_.ctrlKey||_.metaKey)&&_.key==="z"?(_.preventDefault(),b()):(_.ctrlKey||_.metaKey)&&_.key==="y"&&(_.preventDefault(),C())};return d.onMounted(()=>{window.addEventListener("keydown",S)}),d.onUnmounted(()=>{window.removeEventListener("keydown",S)}),d.watch(o,d2(_=>{_&&!m.value&&(i.value.splice(u.value+1),i.value.push(JSON.parse(JSON.stringify(_))),u.value++),m.value&&(m.value=!1)},300),{deep:!0}),{current:h,undo:b,redo:C}}var Bfe={exports:{}};(function(o,s){(function(i,u){o.exports=u()})(vE,function(){var i=1e3,u=6e4,m=36e5,h="millisecond",b="second",C="minute",S="hour",_="day",N="week",O="month",R="quarter",I="year",W="date",G="Invalid Date",Q=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,q=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,Z={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(me){var be=["th","st","nd","rd"],$=me%100;return"["+me+(be[($-20)%10]||be[$]||be[0])+"]"}},L=function(me,be,$){var _e=String(me);return!_e||_e.length>=be?me:""+Array(be+1-_e.length).join($)+me},pe={s:L,z:function(me){var be=-me.utcOffset(),$=Math.abs(be),_e=Math.floor($/60),le=$%60;return(be<=0?"+":"-")+L(_e,2,"0")+":"+L(le,2,"0")},m:function me(be,$){if(be.date()<$.date())return-me($,be);var _e=12*($.year()-be.year())+($.month()-be.month()),le=be.clone().add(_e,O),He=$-le<0,Ge=be.clone().add(_e+(He?-1:1),O);return+(-(_e+($-le)/(He?le-Ge:Ge-le))||0)},a:function(me){return me<0?Math.ceil(me)||0:Math.floor(me)},p:function(me){return{M:O,y:I,w:N,d:_,D:W,h:S,m:C,s:b,ms:h,Q:R}[me]||String(me||"").toLowerCase().replace(/s$/,"")},u:function(me){return me===void 0}},Ke="en",Be={};Be[Ke]=Z;var Y="$isDayjsObject",ke=function(me){return me instanceof ce||!(!me||!me[Y])},et=function me(be,$,_e){var le;if(!be)return Ke;if(typeof be=="string"){var He=be.toLowerCase();Be[He]&&(le=He),$&&(Be[He]=$,le=He);var Ge=be.split("-");if(!le&&Ge.length>1)return me(Ge[0])}else{var fe=be.name;Be[fe]=be,le=fe}return!_e&&le&&(Ke=le),le||!_e&&Ke},je=function(me,be){if(ke(me))return me.clone();var $=typeof be=="object"?be:{};return $.date=me,$.args=arguments,new ce($)},Ce=pe;Ce.l=et,Ce.i=ke,Ce.w=function(me,be){return je(me,{locale:be.$L,utc:be.$u,x:be.$x,$offset:be.$offset})};var ce=function(){function me($){this.$L=et($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[Y]=!0}var be=me.prototype;return be.parse=function($){this.$d=function(_e){var le=_e.date,He=_e.utc;if(le===null)return new Date(NaN);if(Ce.u(le))return new Date;if(le instanceof Date)return new Date(le);if(typeof le=="string"&&!/Z$/i.test(le)){var Ge=le.match(Q);if(Ge){var fe=Ge[2]-1||0,Ue=(Ge[7]||"0").substring(0,3);return He?new Date(Date.UTC(Ge[1],fe,Ge[3]||1,Ge[4]||0,Ge[5]||0,Ge[6]||0,Ue)):new Date(Ge[1],fe,Ge[3]||1,Ge[4]||0,Ge[5]||0,Ge[6]||0,Ue)}}return new Date(le)}($),this.init()},be.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},be.$utils=function(){return Ce},be.isValid=function(){return this.$d.toString()!==G},be.isSame=function($,_e){var le=je($);return this.startOf(_e)<=le&&le<=this.endOf(_e)},be.isAfter=function($,_e){return je($)<this.startOf(_e)},be.isBefore=function($,_e){return this.endOf(_e)<je($)},be.$g=function($,_e,le){return Ce.u($)?this[_e]:this.set(le,$)},be.unix=function(){return Math.floor(this.valueOf()/1e3)},be.valueOf=function(){return this.$d.getTime()},be.startOf=function($,_e){var le=this,He=!!Ce.u(_e)||_e,Ge=Ce.p($),fe=function(mn,gt){var St=Ce.w(le.$u?Date.UTC(le.$y,gt,mn):new Date(le.$y,gt,mn),le);return He?St:St.endOf(_)},Ue=function(mn,gt){return Ce.w(le.toDate()[mn].apply(le.toDate("s"),(He?[0,0,0,0]:[23,59,59,999]).slice(gt)),le)},yt=this.$W,Ve=this.$M,pt=this.$D,Ie="set"+(this.$u?"UTC":"");switch(Ge){case I:return He?fe(1,0):fe(31,11);case O:return He?fe(1,Ve):fe(0,Ve+1);case N:var mt=this.$locale().weekStart||0,oe=(yt<mt?yt+7:yt)-mt;return fe(He?pt-oe:pt+(6-oe),Ve);case _:case W:return Ue(Ie+"Hours",0);case S:return Ue(Ie+"Minutes",1);case C:return Ue(Ie+"Seconds",2);case b:return Ue(Ie+"Milliseconds",3);default:return this.clone()}},be.endOf=function($){return this.startOf($,!1)},be.$set=function($,_e){var le,He=Ce.p($),Ge="set"+(this.$u?"UTC":""),fe=(le={},le[_]=Ge+"Date",le[W]=Ge+"Date",le[O]=Ge+"Month",le[I]=Ge+"FullYear",le[S]=Ge+"Hours",le[C]=Ge+"Minutes",le[b]=Ge+"Seconds",le[h]=Ge+"Milliseconds",le)[He],Ue=He===_?this.$D+(_e-this.$W):_e;if(He===O||He===I){var yt=this.clone().set(W,1);yt.$d[fe](Ue),yt.init(),this.$d=yt.set(W,Math.min(this.$D,yt.daysInMonth())).$d}else fe&&this.$d[fe](Ue);return this.init(),this},be.set=function($,_e){return this.clone().$set($,_e)},be.get=function($){return this[Ce.p($)]()},be.add=function($,_e){var le,He=this;$=Number($);var Ge=Ce.p(_e),fe=function(Ve){var pt=je(He);return Ce.w(pt.date(pt.date()+Math.round(Ve*$)),He)};if(Ge===O)return this.set(O,this.$M+$);if(Ge===I)return this.set(I,this.$y+$);if(Ge===_)return fe(1);if(Ge===N)return fe(7);var Ue=(le={},le[C]=u,le[S]=m,le[b]=i,le)[Ge]||1,yt=this.$d.getTime()+$*Ue;return Ce.w(yt,this)},be.subtract=function($,_e){return this.add(-1*$,_e)},be.format=function($){var _e=this,le=this.$locale();if(!this.isValid())return le.invalidDate||G;var He=$||"YYYY-MM-DDTHH:mm:ssZ",Ge=Ce.z(this),fe=this.$H,Ue=this.$m,yt=this.$M,Ve=le.weekdays,pt=le.months,Ie=le.meridiem,mt=function(gt,St,Wt,Et){return gt&&(gt[St]||gt(_e,He))||Wt[St].slice(0,Et)},oe=function(gt){return Ce.s(fe%12||12,gt,"0")},mn=Ie||function(gt,St,Wt){var Et=gt<12?"AM":"PM";return Wt?Et.toLowerCase():Et};return He.replace(q,function(gt,St){return St||function(Wt){switch(Wt){case"YY":return String(_e.$y).slice(-2);case"YYYY":return Ce.s(_e.$y,4,"0");case"M":return yt+1;case"MM":return Ce.s(yt+1,2,"0");case"MMM":return mt(le.monthsShort,yt,pt,3);case"MMMM":return mt(pt,yt);case"D":return _e.$D;case"DD":return Ce.s(_e.$D,2,"0");case"d":return String(_e.$W);case"dd":return mt(le.weekdaysMin,_e.$W,Ve,2);case"ddd":return mt(le.weekdaysShort,_e.$W,Ve,3);case"dddd":return Ve[_e.$W];case"H":return String(fe);case"HH":return Ce.s(fe,2,"0");case"h":return oe(1);case"hh":return oe(2);case"a":return mn(fe,Ue,!0);case"A":return mn(fe,Ue,!1);case"m":return String(Ue);case"mm":return Ce.s(Ue,2,"0");case"s":return String(_e.$s);case"ss":return Ce.s(_e.$s,2,"0");case"SSS":return Ce.s(_e.$ms,3,"0");case"Z":return Ge}return null}(gt)||Ge.replace(":","")})},be.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},be.diff=function($,_e,le){var He,Ge=this,fe=Ce.p(_e),Ue=je($),yt=(Ue.utcOffset()-this.utcOffset())*u,Ve=this-Ue,pt=function(){return Ce.m(Ge,Ue)};switch(fe){case I:He=pt()/12;break;case O:He=pt();break;case R:He=pt()/3;break;case N:He=(Ve-yt)/6048e5;break;case _:He=(Ve-yt)/864e5;break;case S:He=Ve/m;break;case C:He=Ve/u;break;case b:He=Ve/i;break;default:He=Ve}return le?He:Ce.a(He)},be.daysInMonth=function(){return this.endOf(O).$D},be.$locale=function(){return Be[this.$L]},be.locale=function($,_e){if(!$)return this.$L;var le=this.clone(),He=et($,_e,!0);return He&&(le.$L=He),le},be.clone=function(){return Ce.w(this.$d,this)},be.toDate=function(){return new Date(this.valueOf())},be.toJSON=function(){return this.isValid()?this.toISOString():null},be.toISOString=function(){return this.$d.toISOString()},be.toString=function(){return this.$d.toUTCString()},me}(),Dt=ce.prototype;return je.prototype=Dt,[["$ms",h],["$s",b],["$m",C],["$H",S],["$W",_],["$M",O],["$y",I],["$D",W]].forEach(function(me){Dt[me[1]]=function(be){return this.$g(be,me[0],me[1])}}),je.extend=function(me,be){return me.$i||(me(be,ce,je),me.$i=!0),je},je.locale=et,je.isDayjs=ke,je.unix=function(me){return je(1e3*me)},je.en=Be[Ke],je.Ls=Be,je.p={},je})})(Bfe);var B6e=Bfe.exports;const Rfe=S4(B6e);function R6e(){const{modelValue:o,inputTypes:s}=j0(),{nodes:i,updateNodes:u}=IB(),m=C=>{if(!C||typeof C!="string")return[];const _=new DOMParser().parseFromString(C,"text/html");return Array.from(_.querySelectorAll("td")).filter(R=>{var I;return!((I=R.textContent)!=null&&I.trim())})},h=async C=>{var N,O;const S=await((O=(N=s==null?void 0:s.find(R=>{var I;return((I=R.value)==null?void 0:I.toLowerCase())==="text"}))==null?void 0:N.getDefaultProps)==null?void 0:O.call(N))||{},_=C.map(R=>{let I=R==null?void 0:R.id;return I||(I=m2()),{id:I,nodeType:"Text",label:"文本",props:{...S},...R}});return u(_),_},b=()=>{var W;const C=m(d.toValue(o)),S=Rfe().valueOf(),_=d.toValue(i),N=_.filter(G=>wne(G)),O=_.filter(G=>!wne(G)),I=[...(W=C.map(G=>({nodePath:$U(G),startOffset:0,subNodeSort:0,insertTime:S})))==null?void 0:W.map(G=>{const Q=N==null?void 0:N.find(q=>q.nodePath===G.nodePath&&!(q!=null&&q.startOffset));return{...G,...Q}}),...O];return h(I)};return d.onMounted(()=>{b()}),b}function I6e(){const{selectedNodes:o,containerRef:s,isFocused:i}=ef(),{removeNode:u}=IB(),m=d.ref(null),h=S=>{if(i.value&&(S.key==="Delete"||S.key==="Backspace")){const _=[];d.toValue(o).length>0&&(d.toValue(o).forEach(N=>{var O,R,I;if(((O=N==null?void 0:N.element)==null?void 0:O.tagName)==="TD"){const W=(R=N==null?void 0:N.element)==null?void 0:R.getAttribute("id");W&&_.push(W)}else{const W=(I=N==null?void 0:N.element)==null?void 0:I.getAttribute("id");W&&_.push(W)}}),o.value=[],(_==null?void 0:_.length)>0&&u(_))}},b=S=>{var _;(_=d.toValue(s))!=null&&_.contains(S.target)?m.value=S.target:m.value=null},C=()=>{s.value&&(window.addEventListener("keydown",h),s.value.addEventListener("mousedown",b))};d.watch(()=>s.value,S=>{d.toValue(S)&&C()},{immediate:!0}),d.onUnmounted(()=>{s.value&&(window.removeEventListener("keydown",h),s.value.removeEventListener("mousedown",b))})}function MU(){const{nodes:o}=j0(),{containerRef:s,renderNodes:i,uiReady:u}=ef(),{removeNode:m}=IB(),h=()=>{var C;i.value=[...((C=o.value)==null?void 0:C.map(S=>{var N;const _=(N=s.value)==null?void 0:N.querySelector(`[id="${S.id}"]`);return{...S,element:_}}))||[]].filter(S=>!!(S!=null&&S.element))},b=d2(C=>{d.nextTick(()=>{var S;m((S=C==null?void 0:C.map(_=>_==null?void 0:_.id))==null?void 0:S.filter(Boolean))})},500);d.watch(()=>[i.value,u],()=>{if(d.toValue(u)){const C=Txe(o.value,i.value,"id");b(C)}},{immediate:!0,deep:!0}),d.watch(()=>[o.value,s.value,u],()=>{d.toValue(u)&&d.nextTick(()=>{h()})},{immediate:!0,deep:!0})}const Cne=d.ref({});function BU(o){return d.computed(()=>{var s;return(s=Cne.value)==null?void 0:s[o]})}function Roe(){const o=j0(),s=ef();d.onMounted(()=>{const{editorId:i}=o;i&&(Cne.value[i]=d.ref({...o,...s}))}),d.onUnmounted(()=>{const{editorId:i}=o;i&&(Cne.value[i]=null)})}const P6e=d.defineComponent({__name:"NodesEditUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"edit"}},setup(o,{expose:s}){const{nodes:i}=j0(),{uiReady:u,renderNodes:m}=ef();Roe(),M6e(i),Mfe(),Boe(),I6e(),D6e(),$6e();const h=R6e();return MU(),s({initNodes:h}),(b,C)=>d.unref(u)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(m),S=>(d.openBlock(),d.createBlock(DU,{key:S==null?void 0:S.id,node:S},{default:d.withCtx(_=>[d.renderSlot(b.$slots,"nodeItem",{node:_==null?void 0:_.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),lle=d.defineComponent({__name:"NodesPreviewUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return Roe(),MU(),Boe(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock(DU,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),F6e=d.defineComponent({__name:"NodesEnterUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return MU(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock(DU,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),L6e=d.defineComponent({__name:"NodesSelectUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"select"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return Roe(),Mfe(),Boe(),MU(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock(DU,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),l2=d.ref({});function Ife(o){return d.computed(()=>(l2.value[o]||(l2.value[o]=d.ref([])),l2.value[o]))}function V6e(o){const{editorId:s}=o,i=d.ref(!1);d.onMounted(()=>{l2.value[s]||(l2.value[s]=d.ref([]));const u=l2.value[s].findIndex(m=>m.id===o.id);u!==-1&&l2.value[s].splice(u,1),i.value=!0,l2.value[s].push({...o,isMounted:i})}),d.onUnmounted(()=>{i.value=!1})}const H6e=d.defineComponent({__name:"NodesProvider",props:d.mergeModels({nodes:{type:Array,default:()=>[]},renderType:{type:String,default:"preview"},inputTypes:{type:Array,default:()=>[]},editorId:{type:String,default:""},disabledNodes:{type:Array,default:()=>[]}},{formData:{},formDataModifiers:{},nodes:{},nodesModifiers:{},modelValue:{},modelModifiers:{}}),emits:["update:formData","update:nodes","update:modelValue"],setup(o){const s=o,i=d.useModel(o,"formData"),u=d.useModel(o,"nodes"),m=d.useModel(o,"modelValue"),h=Ife(s==null?void 0:s.editorId),b=d.computed(()=>{var O,R,I;const N=[...Ofe(((I=(R=(O=d.toValue(h))==null?void 0:O.filter(W=>d.toValue(W==null?void 0:W.activated)))==null?void 0:R.filter(W=>d.toValue(W.isMounted)))==null?void 0:I.filter(W=>d.toValue(W==null?void 0:W.isOccupy)))||[]),...s.disabledNodes||[]];return Yxe(N,"id")}),C=d.computed(()=>d.toValue(s.renderType)),S=_=>{na(u.value,_)||(u.value=_)};return d.provide(Dfe,{modelValue:m,renderType:C,inputTypes:s.inputTypes,editorId:s==null?void 0:s.editorId,nodes:u,disabledNodes:b,updateNodes:S,formData:i}),(_,N)=>d.renderSlot(_.$slots,"default")}}),z6e=d.defineComponent({__name:"NodesUIProvider",props:{nodes:{type:Array,default:()=>[]},selectedNodes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},editorId:{type:String,default:""},htmlRenderRef:{type:Object,default:()=>{}}},emits:["onSelectedNodes","update:selectedNodes"],setup(o,{expose:s,emit:i}){const u=o,m=i,h=d.ref(null),b=d.ref(null),C=d.ref([]),S=d.ref(null),_=d.ref(-1),N=d.ref(0),O=d.ref(0),R=Ife(u==null?void 0:u.editorId),I=d.ref(!1),W=d.ref(!1),G=d.computed(()=>u.htmlRenderRef),Q=d.computed({get:()=>(u.selectedNodes||[]).map(Ke=>{var ke;let Be=(ke=u==null?void 0:u.nodes)==null?void 0:ke.find(et=>(et==null?void 0:et.id)===(Ke==null?void 0:Ke.id)),Y=Ke!=null&&Ke.element?Ke==null?void 0:Ke.element:g6e(Ke==null?void 0:Ke.id,h.value);return{...Be||{},...Ke,element:Y}}),set:Ke=>{const Be=Ke.map(({element:Y,...ke})=>{var je;return{...((je=u==null?void 0:u.nodes)==null?void 0:je.find(Ce=>(Ce==null?void 0:Ce.id)===(ke==null?void 0:ke.id)))||{},...ke}});m("update:selectedNodes",Be)}}),q=d.computed(()=>{var Y,ke,et;const Ke=(ke=(Y=d.toValue(R))==null?void 0:Y.filter(je=>d.toValue(je==null?void 0:je.activated)))==null?void 0:ke.filter(je=>d.toValue(je.isMounted)),Be=((et=d.toValue(u==null?void 0:u.nodesGroups)||[])==null?void 0:et.map(je=>({...je||{},activated:!0})))||[];return Ofe([...Be,...Ke])}),Z=d.ref([]),L=Ke=>{var ke;const Be=Ke.map(({...et})=>{var Dt;let je=(Dt=C.value)==null?void 0:Dt.find(me=>(me==null?void 0:me.id)===(et==null?void 0:et.id));const{element:Ce,...ce}={...je||{},...et};return ce}),Y=(ke=Q.value)==null?void 0:ke.map(({element:et,...je})=>je);na(Be,Y)||(Q.value=Be,m("onSelectedNodes",Be))},pe=d.computed(()=>d.toValue(u==null?void 0:u.nodesGroups));return s({setSelectedNodes:L}),d.provide(Afe,{containerRef:h,htmlRenderRef:G,contextMenuRef:b,focusedElement:S,currentRenderNodes:Z,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:q,selectedNodes:Q,setSelectedNodes:L,renderNodes:C,uiReady:I,isFocused:W,nodesGroups:pe}),(Ke,Be)=>d.renderSlot(Ke.$slots,"default")}}),U6e=["onClick"],j6e={key:0,class:"icon"},W6e={key:1,class:"arrow"},Z6e=["onClick"],G6e={key:0,class:"icon"},q6e=d.defineComponent({__name:"index",props:d.mergeModels({style:{},direction:{}},{show:{type:Boolean},showModifiers:{}}),emits:d.mergeModels(["select"],["update:show"]),setup(o,{emit:s}){const i=o,{contextMenuRef:u,selectedNodes:m,setSelectedNodes:h,focusedElement:b,cursorPosition:C,focusedNodeIndex:S,preNodeNumber:_}=ef(),{inputTypes:N}=j0(),O=d.useModel(o,"show"),R=d.ref(!1),I=()=>{R.value=!1},W=d.ref({focusedElement:null,cursorPosition:0,focusedNodeIndex:0,preNodeNumber:0});d.watch(()=>[O,i==null?void 0:i.style],()=>{d.toValue(O)&&(R.value=!1,d.nextTick(()=>{R.value=!!d.toValue(O),W.value={focusedElement:d.toValue(b),cursorPosition:d.toValue(C),focusedNodeIndex:d.toValue(S),preNodeNumber:d.toValue(_)}}))},{immediate:!0,deep:!0});const{editNodes:G}=IB(),Q=async Y=>{var ke,et;if(d.toValue(W).focusedElement&&!Ixe(d.toValue(C))){const je=$U(d.toValue(W).focusedElement),Ce=d.toValue(W).cursorPosition,ce=(d.toValue(W).preNodeNumber||0)+1,Dt=y6e(d.toValue(W).focusedElement),me=Rfe().valueOf();if(je&&!dB(Ce)&&Ce>=0){const be=await((ke=Y==null?void 0:Y.getDefaultProps)==null?void 0:ke.call(Y))||{};G({...Dt,label:Y==null?void 0:Y.label,nodePath:je,startOffset:Ce,subNodeSort:ce,textNodeIndex:d.toValue(S)||0,nodeType:Y==null?void 0:Y.value,insertTime:me,props:be})}}else if(m){const je=d.toValue(m);if(je!=null&&je.length){const Ce=await((et=Y==null?void 0:Y.getDefaultProps)==null?void 0:et.call(Y))||{},ce=je==null?void 0:je.map(Dt=>({...Dt,label:Y==null?void 0:Y.label,element:Dt==null?void 0:Dt.element,nodePath:Dt==null?void 0:Dt.nodePath,nodeType:Y==null?void 0:Y.value,props:Ce}));G(ce),h(ce)}}O.value=!1},q=d.computed(()=>{const Y=[],ke=[];return d.toValue(N).forEach(et=>{et.groupName==="system"?ke.push({...et,handler:()=>{Q(et)}}):Y.push({...et,handler:()=>{Q(et)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:Y},{label:"插入记录标识",icon:"i-bi:flag",children:ke}].filter(et=>{var je;return(je=et==null?void 0:et.children)==null?void 0:je.length})}),Z=s,L=(Y,ke)=>{Y.preventDefault(),ke!=null&&ke.handler&&ke.handler(),ke!=null&&ke.value&&(Z("select",ke==null?void 0:ke.value),R.value=!1)},pe=d.computed(()=>{var et,je;const Y=d.toValue(m)||[];if(!Array.isArray(Y)||Y.length===0)return null;const ke=((et=Y[0])==null?void 0:et.nodeType)??null;for(let Ce=1;Ce<Y.length;Ce++)if(((je=Y[Ce])==null?void 0:je.nodeType)!==ke)return null;return ke}),Ke=Y=>Y==null?"":String(Y).toLowerCase(),Be=Y=>Ke(pe.value)===Ke(Y);return(Y,ke)=>(d.openBlock(),d.createBlock(d.unref(On.ElPopover),{visible:R.value,"popper-style":"padding:0px;"},{reference:d.withCtx(()=>[d.withDirectives(d.createElementVNode("div",{class:"popover-point",style:d.normalizeStyle({...Y.style}),ref_key:"contextMenuRef",ref:u},null,4),[[d.unref(On.ClickOutside),I]])]),default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"contextMenuRef",ref:u,class:"context-menu"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(q.value,et=>(d.openBlock(),d.createElementBlock("div",{key:et==null?void 0:et.label,class:"menu-item"},[d.createElementVNode("div",{class:"menu-item-content",onClick:je=>L(je,et)},[et!=null&&et.icon?(d.openBlock(),d.createElementBlock("div",j6e,[d.createElementVNode("div",{class:d.normalizeClass(et==null?void 0:et.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(et.label)+" ",1),et!=null&&et.children?(d.openBlock(),d.createElementBlock("span",W6e,"›")):d.createCommentVNode("",!0)],8,U6e),et!=null&&et.children?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["submenu",{"submenu-bottom":Y.direction==="bottom"}])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(et.children,je=>(d.openBlock(),d.createElementBlock("div",{key:je.action,class:d.normalizeClass(["menu-item",{active:Be(je.value)}]),onClick:Ce=>L(Ce,je)},[je!=null&&je.icon?(d.openBlock(),d.createElementBlock("div",G6e,[d.createElementVNode("div",{class:d.normalizeClass(je==null?void 0:je.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(je.label),1)],10,Z6e))),128))],2)):d.createCommentVNode("",!0)]))),128))],512)]),_:1},8,["visible"]))}}),Y6e=Ja(q6e,[["__scopeId","data-v-24001f4f"]]);function K6e(o){const{headerHeight:s,hasContextMenu:i}=o,{contextMenuRef:u}=ef(),m=d.ref(!1),h=d.ref("top"),b=d.ref({left:"0px",top:"0px"}),C=_=>{d.toValue(i)&&(_.preventDefault(),m.value=!0,d.nextTick(()=>{const O=_.currentTarget.getBoundingClientRect(),R=_.clientX-O.left,I=_.clientY-O.top,W=u==null?void 0:u.value,G=Array.from((W==null?void 0:W.querySelectorAll(".submenu"))||[]).reduce((Q,q)=>Math.max(Q,q.offsetHeight||0),0)||400;O.height-I<G?h.value="bottom":h.value="top",b.value={left:`${R}px`,top:`${I+d.toValue(s)}px`}}))},S=_=>{_.button===0&&(m.value=!1)};return d.onMounted(()=>{document.addEventListener("mousedown",S)}),d.onUnmounted(()=>{document.removeEventListener("mousedown",S)}),{showContextMenu:m,contextMenuStyle:b,onContextMenu:C,closeContextMenu:S,direction:h}}function Pfe(o){return{all:o=o||new Map,on:function(s,i){var u=o.get(s);u?u.push(i):o.set(s,[i])},off:function(s,i){var u=o.get(s);u&&(i?u.splice(u.indexOf(i)>>>0,1):o.set(s,[]))},emit:function(s,i){var u=o.get(s);u&&u.slice().map(function(m){m(i)}),(u=o.get("*"))&&u.slice().map(function(m){m(s,i)})}}}const Sne=Pfe(),Ffe=(...o)=>{const s=o[0],i=o[1];d.onMounted(()=>{Sne.on(s,i)}),d.onBeforeUnmount(()=>{Sne.off(s)})},Ioe=()=>(...s)=>{Sne.emit(...s)};let rE=null;function X6e(o){const{onSelected:s}={},{selectedNodes:i,uiReady:u,setSelectedNodes:m}=ef(),h=d.ref("multiple"),b=(S="select")=>{var N,O;let _=[];h.value==="single"?(N=i.value)!=null&&N[0]&&_.push((O=i.value)==null?void 0:O[0]):_=ta(i.value),rE==null||rE({data:_,type:S}),S==="blur"&&(rE=null,h.value="multiple"),m(_)};return d.watch(()=>i,()=>{u.value&&(b(),s==null||s(d.toValue(i)))},{deep:!0}),Ffe("selectNodes",S=>{const{data:_,callback:N=null,mode:O="multiple"}=S;h.value=O,setTimeout(()=>{m(d.toValue(_)),rE=N},100)}),{onBlur:()=>{rE&&(b("blur"),rE=null,m([]))}}}const Bz={A3:{width:297,height:420},A4:{width:210,height:297},A5:{width:148,height:210},B3:{width:353,height:500},B4:{width:257,height:364},B5:{width:176,height:250}},J6e={class:"relative"},Q6e={class:"header-container"},eBe=["innerHTML"],tBe={style:{overflow:"hidden"}},nBe=["innerHTML"],oBe=d.defineComponent({__name:"index",props:{headerHtml:{type:String,default:""},footerHtml:{type:String,default:""},pagesize:{type:String,default:"A4"}},emits:["onUiReady"],setup(o,{expose:s,emit:i}){const u=d.ref(),{containerRef:m,uiReady:h,isFocused:b}=ef(),{nodes:C,modelValue:S,renderType:_,updateNodes:N}=j0(),O=d.computed(()=>d.toValue(_)==="edit"),R=o,I=i,W=()=>{I("onUiReady",{containerRef:m})},{height:G}=gMe(u),Q=d.computed(()=>R.headerHtml?R.headerHtml.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(_e,le,He)=>{const Ge=He.replace(/([^{}]+)\{/g,(fe,Ue)=>{const yt=Ue.trim();return yt&&!yt.includes(".header-container")?`.header-container ${yt} {`:fe});return`<style${le}>${Ge}</style>`}):""),q=d.computed(()=>{const _e=Bz[R.pagesize]||Bz.A4,le=(window.devicePixelRatio||1)*96;return`${_e.height*le/25.4-d.toValue(G)}px`}),{showContextMenu:Z,contextMenuStyle:L,onContextMenu:pe,direction:Ke}=K6e({headerHeight:G,hasContextMenu:O}),Be=d.ref(null),Y=d.computed(()=>{var _e;return(_e=d.toValue(C))==null?void 0:_e.map(le=>{const{nodePath:He,id:Ge,nodeType:fe}=le;return{nodePath:He,id:Ge,nodeType:fe}})}),ke=_e=>{const le=document.createElement("div");return le.innerHTML=_e||"",le.querySelectorAll(".node-item").forEach(Ge=>{(Ge.getAttribute("id")||"")&&Ge.remove()}),le.normalize(),le.innerHTML},et=_e=>{var fe;const le=(fe=m.value)==null?void 0:fe.querySelector(`[id="${_e==null?void 0:_e.id}"]`);if(le)return le;let He=null;const Ge=document.createElement("span");return Ge.setAttribute("contenteditable","false"),Ge.classList.add("node-item"),He=Ge,v6e(_e,He,m.value),He&&b6e(He,_e),He},je=()=>{const _e=C.value||[],le=zxe(_e,[He=>He.nodePath,He=>He.textNodeIndex||-1,He=>(He==null?void 0:He.startOffset)??-1,He=>He.subNodeSort||-1,He=>(He==null?void 0:He.insertTime)||-1],["asc","desc","desc","desc","desc"]);le==null||le.forEach(He=>{et(He)})},Ce=()=>{Be.value&&(h.value=!1,d.nextTick(()=>{if(Be.value){const _e=ke(d.toValue(S));Be.value.innerHTML=_e,je(),h.value=!0,S.value=Be.value.innerHTML,d.nextTick(()=>{W(),setTimeout(()=>{d.toValue(m)&&k6e(d.toValue(m))},10)})}}))},ce=_e=>{const le=document.createElement("html"),He=document.createElement("body");le.appendChild(He),He.innerHTML=_e||"";const Ge=[];return He.querySelectorAll(".node-item").forEach(Ue=>{const yt=Ue.getAttribute("id")||"",Ve=$U(Ue==null?void 0:Ue.parentElement)||"";Ge.push({nodePath:Ve,id:yt})}),Ge};d.watch(()=>S,()=>{var He;const _e=ce(d.toValue(S)),le=Y.value.map(Ge=>{const{nodePath:fe}=(_e==null?void 0:_e.find(Ue=>(Ue==null?void 0:Ue.id)===(Ge==null?void 0:Ge.id)))||{};return fe?{...Ge,nodePath:fe}:Ge});na(le,Y.value)?Ce():N((He=d.toValue(C))==null?void 0:He.map(Ge=>{const{nodePath:fe}=(le==null?void 0:le.find(Ue=>(Ue==null?void 0:Ue.id)===(Ge==null?void 0:Ge.id)))||{};return fe?{...Ge,nodePath:fe}:Ge}))},{deep:!0,immediate:!0}),d.watch(()=>Be,()=>{Ce()},{deep:!0,immediate:!0}),d.watch(()=>[...Y.value],(_e,le)=>{na(le,_e)||Ce()},{deep:!0,immediate:!0});const Dt=d.ref(),me=()=>{b.value=!0},{onBlur:be}=X6e(),$=()=>{b.value=!1,be()};return s({renderHtml:Ce,getInnerHTML:()=>{var _e,le;return((le=(_e=Dt.value)==null?void 0:_e.getInnerHTML)==null?void 0:le.call(_e))||""},getContainerHTML:()=>{var _e;return((_e=m.value)==null?void 0:_e.innerHTML)||""}}),(_e,le)=>(d.openBlock(),d.createElementBlock("div",J6e,[d.createVNode(RB,{onOnBlur:$,onOnFocus:me,ref_key:"shadowDomRef",ref:Dt},{default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"headerRef",ref:u,style:{overflow:"hidden"}},[d.createElementVNode("div",Q6e,[d.createElementVNode("div",{innerHTML:Q.value,class:"disabeld-edit docHeaderHtml",onClick:me},null,8,eBe)])],512),d.createElementVNode("html",{class:d.normalizeClass(["nodes-editor",`nodes-editor-${d.unref(_)}`]),ref_key:"containerRef",ref:m,style:d.normalizeStyle([{position:"relative"},{position:"relative",minHeight:q.value}]),onContextmenu:le[0]||(le[0]=d.withModifiers((...He)=>d.unref(pe)&&d.unref(pe)(...He),["prevent"]))},[d.createElementVNode("body",{ref_key:"bodyRef",ref:Be},null,512),d.createElementVNode("div",tBe,[d.createElementVNode("div",{innerHTML:R==null?void 0:R.footerHtml,class:"disabeld-edit docFooterHtml",onClick:me},null,8,nBe)])],38)]),_:1},512),O.value?(d.openBlock(),d.createBlock(Y6e,{key:0,show:d.unref(Z),"onUpdate:show":le[1]||(le[1]=He=>d.isRef(Z)?Z.value=He:null),style:d.normalizeStyle(d.unref(L)),direction:d.unref(Ke)},null,8,["show","style","direction"])):d.createCommentVNode("",!0)]))}}),sBe=d.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},style:{type:Object,default:()=>({})},pagesizeWrapStyle:{type:Object,default:()=>({})}},setup(o){const s=o,i=d.computed(()=>{const u=Bz[s.pagesize]||Bz.A4;let{width:m,height:h}=u;s.orientation==="landscape"&&([m,h]=[h,m]);const b=(window.devicePixelRatio||1)*96;return m*b/25.4});return(u,m)=>(d.openBlock(),d.createElementBlock("div",{class:"pagesize",style:d.normalizeStyle(s==null?void 0:s.pagesizeWrapStyle)},[d.createElementVNode("div",{style:d.normalizeStyle({width:`${i.value}px`,...o.style}),class:"pagesize-content"},[d.renderSlot(u.$slots,"default",{},void 0,!0)],4)],4))}}),rBe=Ja(sBe,[["__scopeId","data-v-1f48410e"]]),Lfe=d.defineComponent({__name:"index",props:d.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},renderType:{type:String,default:"preview"},formData:{type:Object,default:()=>({})},inputTypes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},id:{type:String,default:""},disabledNodes:{type:Array,default:()=>[]},headerHtml:{type:String,default:""},footerHtml:{type:String,default:""},pagesizeStyle:{type:Object,default:()=>({})},pagesizeWrapStyle:{type:Object,default:()=>({})}},{selectedNodes:{default:[]},selectedNodesModifiers:{}}),emits:d.mergeModels(["update:modelValue","update:nodes","update:formData","onSelectedNodes","onUiReady"],["update:selectedNodes"]),setup(o,{expose:s,emit:i}){const u=o,m=i,h=d.useModel(o,"selectedNodes");Em(u.formData);const b=d.ref(),C=d.ref(null),S=Q=>{m("onUiReady",Q)},_=d.ref(),N=d.computed(()=>d.toValue(u.renderType)),O=d.computed(()=>{switch(d.toValue(N)){case"edit":return P6e;case"select":return L6e;case"preview":return lle;case"enter":return F6e;default:return lle}}),R=Q=>{m("update:nodes",Q)},I=Q=>{m("update:modelValue",Q)},W=Q=>{m("update:formData",Q)},G=Q=>{m("onSelectedNodes",Q)};return s({formRef:{validate:()=>{var Q,q,Z;return(Z=(q=(Q=b.value)==null?void 0:Q.formRef)==null?void 0:q.validate)==null?void 0:Z.call(q)}},setSelectedNodes:Q=>{var q,Z;(Z=(q=_.value)==null?void 0:q.setSelectedNodes)==null||Z.call(q,Q)},initNodes:()=>{var Q,q;return(q=(Q=b.value)==null?void 0:Q.initNodes)==null?void 0:q.call(Q)},getInnerHTML:()=>{var Q,q;return((q=(Q=C.value)==null?void 0:Q.getInnerHTML)==null?void 0:q.call(Q))||""},getContainerHTML:()=>{var Q,q;return((q=(Q=C.value)==null?void 0:Q.getContainerHTML)==null?void 0:q.call(Q))||""}}),(Q,q)=>(d.openBlock(),d.createBlock(rBe,{pagesize:o.pagesize,orientation:u==null?void 0:u.orientation,style:d.normalizeStyle(o.pagesizeStyle),pagesizeWrapStyle:o.pagesizeWrapStyle},{default:d.withCtx(()=>[d.createVNode(z6e,{ref_key:"UIRef",ref:_,nodes:o.nodes,"onUpdate:nodes":R,selectedNodes:h.value,"onUpdate:selectedNodes":q[0]||(q[0]=Z=>h.value=Z),onOnSelectedNodes:G,nodesGroups:o.nodesGroups,editorId:u==null?void 0:u.id,htmlRenderRef:C.value},{default:d.withCtx(()=>[d.createVNode(H6e,{renderType:N.value,"model-value":o.modelValue,"onUpdate:modelValue":I,nodes:o.nodes,"onUpdate:nodes":R,formData:o.formData,"onUpdate:formData":W,inputTypes:o.inputTypes,editorId:u==null?void 0:u.id,disabledNodes:o.disabledNodes},{default:d.withCtx(()=>[d.createVNode(oBe,{ref_key:"htmlRenderRef",ref:C,headerHtml:o.headerHtml,footerHtml:o.footerHtml,pagesize:u==null?void 0:u.pagesize,onOnUiReady:S},null,8,["headerHtml","footerHtml","pagesize"]),(d.openBlock(),d.createBlock(d.resolveDynamicComponent(O.value),{renderType:N.value,pagesize:o.pagesize,ref_key:"contentRef",ref:b},{nodeItem:d.withCtx(Z=>[d.renderSlot(Q.$slots,"nodeItem",{node:Z==null?void 0:Z.node})]),_:3},8,["renderType","pagesize"]))]),_:3},8,["renderType","model-value","nodes","formData","inputTypes","editorId","disabledNodes"])]),_:3},8,["nodes","selectedNodes","nodesGroups","editorId","htmlRenderRef"])]),_:3},8,["pagesize","orientation","style","pagesizeWrapStyle"]))}}),aBe={class:"nodes-text"},iBe={key:0,class:"node-text-input"},lBe={key:1,class:"node-text-td"},cBe={key:0,class:"node-text-table-index"},uBe=d.defineComponent({__name:"index",props:d.mergeModels({editorId:{type:String,default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=d.useModel(o,"modelValue"),u=BU(s==null?void 0:s.editorId),m=d.computed(()=>{var b;return $fe(i.value,((b=d.toValue(u))==null?void 0:b.renderNodes)||[])}),h=d.computed(()=>{var b;return((b=d.toValue(m))==null?void 0:b.length)>0?!d.toValue(m).some(S=>{var _,N;return((_=S==null?void 0:S.min)==null?void 0:_.tableIndex)>1||((N=S==null?void 0:S.max)==null?void 0:N.tableIndex)>1}):!0});return(b,C)=>(d.openBlock(),d.createElementBlock("div",aBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.value,(S,_)=>{var N,O,R,I,W,G,Q,q,Z;return d.openBlock(),d.createElementBlock("div",{key:_,class:"node-text-item"},[(S==null?void 0:S.showTextType)==="input"?(d.openBlock(),d.createElementBlock("span",iBe,d.toDisplayString((N=S==null?void 0:S.props)!=null&&N.alias?(O=S==null?void 0:S.props)==null?void 0:O.alias:`填写${S==null?void 0:S.inputIndex}`),1)):(d.openBlock(),d.createElementBlock("span",lBe,[h.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("span",cBe,d.toDisplayString(`表${(R=S==null?void 0:S.min)==null?void 0:R.tableIndex}.`),1)),d.createTextVNode(" "+d.toDisplayString(((I=S==null?void 0:S.min)==null?void 0:I.id)===((W=S==null?void 0:S.max)==null?void 0:W.id)?(Q=(G=S==null?void 0:S.min)==null?void 0:G.props)!=null&&Q.alias?(Z=(q=S==null?void 0:S.min)==null?void 0:q.props)==null?void 0:Z.alias:d.unref(r4)(S==null?void 0:S.min):`${d.unref(r4)(S==null?void 0:S.min)}:${d.unref(r4)(S==null?void 0:S.max)}`),1)]))])}),128))]))}}),cle=Ja(uBe,[["__scopeId","data-v-73a2b2dc"]]);function Poe(o){const{nodes:s,mode:i="multiple"}=o,u=d.ref(!1),m=Ioe();return{isSelecting:u,selectNodes:()=>{if(u.value)return!1;u.value=!0,m("selectNodes",{data:ta(d.toValue(s)),mode:i,callback:({data:b,type:C})=>{s.value=_6e(ta(d.toValue(b))),C==="blur"&&(u.value=!1)}})}}}const ZA=["#409EFF","#b36c2d","#7548ff","#5233b3","#649ee5","#aac4ed","#f9ce57","#ae74e8"],BH=d.ref(0),aE=new Map,dBe={key:0,class:"node-select-small gap-x-2"},fBe={key:1,class:"text-[#999]"},mBe={key:1,class:"node-select"},pBe={class:"flex py-2 px-2 justify-between items-center noder-select-header"},gBe={class:"flex gap-2"},hBe={key:1},vBe={class:"flex gap-1"},bBe=d.defineComponent({__name:"index",props:d.mergeModels({mode:{type:String,default:"multiple"},color:{type:String},id:{type:String,default:""},editorId:{type:String,default:""},size:{type:String,default:"default"},label:{type:String,default:"点击选择"},isOccupy:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=d.ref((aE==null?void 0:aE[s==null?void 0:s.id])||0),u=d.ref((s==null?void 0:s.id)||m2()),m=d.useModel(o,"modelValue");Em(m);const{selectNodes:h,isSelecting:b}=Poe({nodes:m,mode:s.mode}),C=()=>{m.value=[]},S=d.computed(()=>s.color||(ZA==null?void 0:ZA[d.toValue(i)%(ZA==null?void 0:ZA.length)])||"#409eff");d.onMounted(()=>{dB(aE==null?void 0:aE[s==null?void 0:s.id])&&(s!=null&&s.id)&&(aE[s==null?void 0:s.id]=BH.value,i.value=BH.value,BH.value=BH.value+1)});const _=d.computed(()=>s.isOccupy),N=d.computed(()=>!d.toValue(b));return V6e({id:u.value,editorId:s.editorId,nodes:m,activated:N,color:S,isOccupy:_}),(O,R)=>{var I,W;return s.size==="small"?(d.openBlock(),d.createElementBlock("div",dBe,[d.createElementVNode("div",{style:d.normalizeStyle({"--node-color":S.value}),class:"node-color cursor-pointer"},null,4),d.createElementVNode("div",null,d.toDisplayString(s.label),1),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(d.unref(b)?{color:"#409eff"}:{}),onClick:R[0]||(R[0]=(...G)=>d.unref(h)&&d.unref(h)(...G))},R[6]||(R[6]=[d.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer"},null,-1)]),4)),!s.disabled&&((I=m.value)==null?void 0:I.length)>0?(d.openBlock(),d.createElementBlock("div",{key:1,class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})):d.createCommentVNode("",!0),d.createElementVNode("div",{class:"flex items-center flex-wrap gap-1 cursor-pointer",onClick:R[2]||(R[2]=()=>{s!=null&&s.disabled||d.unref(h)()})},[((W=m.value)==null?void 0:W.length)>0?(d.openBlock(),d.createBlock(cle,{key:0,modelValue:m.value,"onUpdate:modelValue":R[1]||(R[1]=G=>m.value=G),editorId:o.editorId},null,8,["modelValue","editorId"])):(d.openBlock(),d.createElementBlock("div",fBe,"未设置"))])])):(d.openBlock(),d.createElementBlock("div",mBe,[d.createElementVNode("div",pBe,[d.createElementVNode("div",gBe,[d.createElementVNode("div",{style:d.normalizeStyle({"--node-color":S.value}),class:"node-color cursor-pointer"},null,4),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(d.unref(b)?{color:"#409eff"}:{})},[d.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer",onClick:R[3]||(R[3]=(...G)=>d.unref(h)&&d.unref(h)(...G))})],4)),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",hBe,[d.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})]))]),d.createElementVNode("div",vBe,[R[9]||(R[9]=d.createElementVNode("div",{class:"color-[#999]"},"Ctrl+左键多选",-1)),d.createElementVNode("div",null,[d.createVNode(d.unref(On.ElTooltip),{placement:"right",effect:"dark"},{content:d.withCtx(()=>R[7]||(R[7]=[d.createElementVNode("strong",null,"选择位置",-1),d.createTextVNode(" :点击输入框(选中状态为蓝色),再点击左侧表格可选择填写位置范围。 "),d.createElementVNode("br",null,null,-1),d.createElementVNode("strong",null,"编辑位置",-1),d.createTextVNode(" :使用橡皮擦工具清除后重新选择。 "),d.createElementVNode("br",null,null,-1)])),default:d.withCtx(()=>[R[8]||(R[8]=d.createElementVNode("div",{class:"flex flex-center"},[d.createElementVNode("div",{class:"i-bi:info-circle-fill mr-2"}),d.createTextVNode(" 使用帮助 ")],-1))]),_:1})])])]),d.createElementVNode("div",{class:d.normalizeClass(["min-h-[42px] px-2 py-1",{"shadow-[0_0_0_2px_#409eff]":d.unref(b)}]),onClick:R[5]||(R[5]=()=>{s!=null&&s.disabled||d.unref(h)()})},[d.createVNode(cle,{modelValue:m.value,"onUpdate:modelValue":R[4]||(R[4]=G=>m.value=G),editorId:o.editorId},null,8,["modelValue","editorId"])],2)]))}}}),Vfe=Ja(bBe,[["__scopeId","data-v-9af34714"]]);function yBe(o){if(!o.startsWith("="))return[];const s=[];let i=1;for(o.startsWith("=")&&s.push({type:"startOperator",value:"="});i<o.length;){const u=o[i];if(/\s/.test(u)){i++;continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];if(i<o.length&&o[i]===":"){i++;let h="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)h+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)h+=o[i++];s.push({type:"range",value:`${m}:${h}`});continue}else{s.push({type:"cell",value:m});continue}}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(/[A-Za-z]/.test(u)){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];if(["AVERAGE","AVEDEV","SUM","IF","COUNT","MAX","MIN","SQRT"].includes(m.toUpperCase())&&o[i]==="("){s.push({type:"function",value:m});continue}i-=m.length}if(/\d/.test(u)){let m="";for(;i<o.length&&(/\d/.test(o[i])||o[i]===".");)m+=o[i++];s.push({type:"number",value:m});continue}if(u==='"'){let m="";for(m+=u,i++;i<o.length&&o[i]!=='"';)m+=o[i++];m+=u,i++,s.push({type:"string",value:m});continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(u===":"){s.push({type:"operator",value:":"}),i++;continue}if(/[+\-*/=><]/.test(u)){s.push({type:"operator",value:u}),i++;continue}if(/[()]/.test(u)){s.push({type:"paren",value:u}),i++;continue}if(u===","){s.push({type:"separator",value:","}),i++;continue}i++}return s}function wBe(o,s){const i=[];let u=0;for(;u<o.length;){let m=!1;for(const h of s){const b=h.value;if(o.startsWith(b,u)){i.push({type:h.type,value:b,...h.cellValue?{cellValue:h.cellValue}:{}}),u+=b.length,m=!0;break}}m||(i.push({type:"plain",value:o[u]}),u++)}return i}function CBe(o){const s=BU(o.editorId),i=(b,C)=>{const S=[],_=Math.min(b.colIndex,C.colIndex),N=Math.max(b.colIndex,C.colIndex),O=Math.min(b.rowIndex,C.rowIndex),R=Math.max(b.rowIndex,C.rowIndex);for(let I=O;I<=R;I++)for(let W=_;W<=N;W++)S.push({colIndex:W,rowIndex:I});return S},u=b=>{var N;const C=b.includes(":");let S=[];if(C){const[O,R]=b.split(":").map(I=>h(I));S=i(O,R)}else S=[h(b)];return m(S,d.toValue((N=d.toValue(s))==null?void 0:N.nodes))},m=(b,C)=>C==null?void 0:C.filter(S=>{const _=S.nodePath.split(" > ");let N=1,O=1;return _.forEach(R=>{if(R.startsWith("tr")){const I=R.match(/tr(?::nth-of-type\((\d+)\))?/);I&&I[1]&&(N=parseInt(I[1]))}else if(R.startsWith("td")){const I=R.match(/td(?::nth-of-type\((\d+)\))?/);I&&(O=I[1]?parseInt(I[1]):1)}}),b.some(R=>N===R.rowIndex+1&&O===R.colIndex+1)}),h=b=>{if(!b)return{colIndex:-1,rowIndex:-1};const C=b.match(/^([A-Za-z]+)(\d+)$/);if(!C)return{colIndex:-1,rowIndex:-1};const S=C[1].toUpperCase(),_=parseInt(C[2]);let N=0;for(let O=0;O<S.length;O++)N=N*26+(S.charCodeAt(O)-64);return{colIndex:N-1,rowIndex:_}};return{getCellValue:u}}const ule=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function SBe(o,s,i){const u=d.ref(null),m=d.ref(null);function h(){return o.value&&o.value.textContent||""}d.onMounted(()=>{o.value&&(u.value=()=>{const C=h();s.value=C},m.value=()=>{const C=h();s.value=C},o.value.addEventListener("input",u.value),o.value.addEventListener("blur",m.value))}),d.onUnmounted(()=>{o.value&&(u.value&&o.value.removeEventListener("input",u.value),m.value&&o.value.removeEventListener("blur",m.value))});const b=C=>{var S,_,N,O;if(C>=0){const R=window.getSelection();if(R){const I=R.getRangeAt(0),W=((S=I.startContainer)==null?void 0:S.nodeName)==="#text"?I.startContainer:(N=(_=I.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],G=Math.min(C,((O=W.textContent)==null?void 0:O.length)||0);I.setStart(W,G)}}};return d.watch(()=>[s,o],()=>{var C;o.value&&(na((C=o.value)==null?void 0:C.textContent,d.toValue(s))||(o.value.textContent=d.toValue(s),b(d.toValue(i))))},{deep:!0,immediate:!0}),{getFormulaContent:h}}function Foe(o){const{element:s,onFocus:i,onBlur:u}=o,m=d.ref(!1),h=()=>{m.value=!0,i==null||i()},b=()=>{m.value=!1,u==null||u()};return d.onMounted(()=>{var C,S;d.toValue(s)&&((C=d.toValue(s))==null||C.addEventListener("focus",h),(S=d.toValue(s))==null||S.addEventListener("blur",b))}),d.onUnmounted(()=>{var C,S;d.toValue(s)&&((C=d.toValue(s))==null||C.removeEventListener("focus",h),(S=d.toValue(s))==null||S.removeEventListener("blur",b))}),m}function xBe(o){const{element:s,showStr:i,editorId:u}=o,m=BU(u),h=Foe({element:s}),b=d.computed(()=>{var C;return(C=i==null?void 0:i.value)==null?void 0:C.filter(S=>["range","cell"].includes(S.type))});return d.watch(()=>h,()=>{var S,_,N,O,R,I;const C=W=>{var G;W.preventDefault(),(G=d.toValue(s))==null||G.focus()};d.toValue(h)?((S=d.toValue(m))==null||S.containerRef.addEventListener("click",C),(_=d.toValue(m))==null||_.containerRef.addEventListener("mousedown",C),(N=document.querySelectorAll(".select-function"))==null||N.forEach(W=>{W.addEventListener("click",C),W.addEventListener("mousedown",C)})):((O=d.toValue(m))==null||O.containerRef.removeEventListener("click",C),(R=d.toValue(m))==null||R.containerRef.removeEventListener("mousedown",C),(I=document.querySelectorAll(".select-function"))==null||I.forEach(W=>{W.removeEventListener("click",C),W.removeEventListener("mousedown",C)}))},{deep:!0}),d.watch(()=>[h,b],()=>{var C,S,_,N,O;if((C=d.toValue(m))!=null&&C.containerRef&&((N=(_=(S=d.toValue(m))==null?void 0:S.containerRef)==null?void 0:_.querySelectorAll(".node-formula-cell"))==null||N.forEach(R=>{R.classList.remove("node-formula-cell")}),d.toValue(h))){let R=[];(O=b.value)!=null&&O.length&&(b.value.forEach(I=>{var W;R=[...R,...((W=I==null?void 0:I.cellValue)==null?void 0:W.map(G=>({color:I==null?void 0:I.color,backgroundColor:Mz((I==null?void 0:I.color)||"#000",.1),element:G==null?void 0:G.element})))||[]]}),R.forEach(I=>{var W;I!=null&&I.element&&((W=I==null?void 0:I.element)==null||W.classList.add("node-formula-cell"),I==null||I.element.style.setProperty("--formula-node-color",I==null?void 0:I.color),I==null||I.element.style.setProperty("--formula-node-bg-color",I==null?void 0:I.backgroundColor))}))}},{deep:!0}),h}const EBe=o=>{const{element:s}=o,i=d.ref(-1),u=C=>{const S=C==null?void 0:C.getSelection();try{if(S)return S.getRangeAt(0).startOffset}catch{}return 0},m=()=>{var S;const C=(S=s.value)==null?void 0:S.getRootNode();i.value=u(C)},h=C=>{var O;const S=C.target,_=(O=s.value)==null?void 0:O.getRootNode();i.value=u(_),S.addEventListener("click",m),S.addEventListener("keyup",R=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(R.key)&&m()});const N=()=>{S.removeEventListener("click",m),S.removeEventListener("keyup",m),S.removeEventListener("blur",N),setTimeout(()=>{i.value=-1},300)};S.addEventListener("blur",N)},b=()=>{var C;(C=s.value)==null||C.addEventListener("focus",h,!0)};return d.watch(s,C=>{C&&b()},{immediate:!0}),d.onUnmounted(()=>{var C;(C=s.value)==null||C.removeEventListener("focus",h,!0)}),{startOffset:i}};function _Be(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const kBe=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},TBe=o=>{const{startOffset:s,showStr:i,value:u,editorId:m,currentItemIndex:h,currentItem:b,element:C}=o,S=BU(m),_=d.ref(-1),N=d.ref(0),O=Foe({element:C}),R=d.ref(!1),I=Ioe(),W=G=>{var Q,q;if(d.toValue(R)&&d.toValue(O)&&!na((Q=d.toValue(b))==null?void 0:Q.cellValue,G)){const Z=E6e(G,((q=d.toValue(S))==null?void 0:q.nodes)||"");let L=Z;Z&&(d.toValue(N)===0&&(L+=","),d.toValue(_)>=0&&(u.value=_Be(d.toValue(u),d.toValue(_),d.toValue(N),L),N.value=Z.length))}};d.watch(()=>h,()=>{var G,Q,q,Z,L,pe;if((G=S.value)==null||G.setSelectedNodes([]),["range","cell"].includes((Q=d.toValue(b))==null?void 0:Q.type))return _.value=kBe(i.value,h.value),N.value=(Z=(q=d.toValue(b))==null?void 0:q.value)==null?void 0:Z.length,R.value=!0,I("selectNodes",{data:(L=d.toValue(b))==null?void 0:L.cellValue,mode:"multiple",callback:({data:Ke})=>{W(Ke)}}),!1;if([",","(","="].includes((pe=d.toValue(b))==null?void 0:pe.value))return _.value=d.toValue(s),R.value=!0,N.value=0,I("selectNodes",{data:[],mode:"multiple",callback:({data:Ke})=>{W(Ke)}}),!1;R.value=!1,_.value=-1},{immediate:!0,deep:!0})},ABe=o=>{const{startOffset:s,showStr:i}=o,u=d.ref(-1);d.watch(()=>s,()=>{var h;if(d.toValue(s)<=0)u.value=-1;else{let b=0;for(let C=0;C<i.value.length;C++){const S=i.value[C];if(b+=(h=S==null?void 0:S.value)==null?void 0:h.length,b>=d.toValue(s)){u.value=C;break}}}},{deep:!0,immediate:!0});const m=d.computed(()=>{var h;return(h=d.toValue(i))==null?void 0:h[d.toValue(u)]});return{currentItemIndex:u,currentItem:m}};function NBe(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const OBe=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},$Be=o=>{const{startOffset:s,showStr:i,value:u,currentItemIndex:m,currentItem:h,element:b}=o,C=d.ref(-1),S=d.ref(0),_=Foe({element:b}),N=d.ref(!1),O=Ioe(),R=I=>{var W;if(d.toValue(N)&&d.toValue(_)&&!na((W=d.toValue(h))==null?void 0:W.value,I)){const G=I,Q=G;G&&d.toValue(C)>=0&&(u.value=NBe(d.toValue(u),d.toValue(C),d.toValue(S),Q),S.value=G.length)}};d.watch(()=>m,()=>{var I,W,G,Q,q;if(["function"].includes((I=d.toValue(h))==null?void 0:I.type))return C.value=OBe(i.value,m.value),S.value=(G=(W=d.toValue(h))==null?void 0:W.value)==null?void 0:G.length,N.value=!0,O("selectFunction",{data:(Q=d.toValue(h))==null?void 0:Q.value,callback:({data:Z})=>{R(Z)}}),!1;if([",","(","="].includes((q=d.toValue(h))==null?void 0:q.value))return C.value=d.toValue(s),N.value=!0,S.value=0,O("selectFunction",{data:"",callback:({data:Z})=>{R(Z)}}),!1;N.value=!1,C.value=-1},{immediate:!0,deep:!0})},DBe={class:"node-formula"},MBe={class:"node-formula-show"},BBe=d.defineComponent({__name:"index",props:d.mergeModels({id:{type:String,default:""},editorId:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,{getCellValue:i}=CBe({editorId:s==null?void 0:s.editorId}),u=d.useModel(o,"modelValue"),m=d.ref(),{startOffset:h}=EBe({element:m});SBe(m,u,h);const b=d.computed(()=>{const N=yBe(u.value);return N==null?void 0:N.map(R=>R.type==="cell"||R.type==="range"?{cellValue:i(R.value),...R}:R)}),C=d.computed(()=>{const N=wBe(u.value,b.value);let O=-1;return N.map(I=>(I==null?void 0:I.type)==="cell"||(I==null?void 0:I.type)==="range"?(O++,{...I,color:ule[O%ule.length]}):(I==null?void 0:I.type)==="function"?{...I,color:"#0318ff"}:I)});xBe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:S,currentItem:_}=ABe({element:m,startOffset:h,value:u,showStr:C});return TBe({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:S,currentItem:_}),$Be({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:S,currentItem:_}),(N,O)=>(d.openBlock(),d.createElementBlock("div",DBe,[d.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),d.createElementVNode("div",MBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(C.value,(R,I)=>(d.openBlock(),d.createElementBlock("span",{key:I,class:d.normalizeClass(["node-formula-item",`node-formula-item-type-${R==null?void 0:R.type}`,I===d.unref(S)?"node-formula-item-active":""]),style:d.normalizeStyle({"--text-color":(R==null?void 0:R.color)||"#000","--bg-color":d.unref(Mz)((R==null?void 0:R.color)||"#000",.1)})},d.toDisplayString(R.value),7))),128))])]))}}),Hfe=Ja(BBe,[["__scopeId","data-v-f4b96eb4"]]),RBe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],IBe={class:"select-function"},PBe=["onClick"],FBe={class:"function-item"},LBe={class:"function-item-desc"},VBe=d.defineComponent({__name:"index",props:d.mergeModels({id:{type:String,default:""},functionList:{type:Array,default:()=>[]}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o;let i=null;const u=d.computed(()=>{var b;return((b=s.functionList)==null?void 0:b.length)>0?s.functionList:RBe}),m=d.useModel(o,"modelValue"),h=b=>{m.value=b,i==null||i({data:b})};return Ffe("selectFunction",({data:b,callback:C})=>{i=C,m.value=b}),(b,C)=>(d.openBlock(),d.createElementBlock("div",IBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(S,_)=>(d.openBlock(),d.createElementBlock("div",{key:_},[d.createElementVNode("div",{onClick:()=>{h(S.value)},class:d.normalizeClass(["function-item-wrapper",{active:m.value===S.value}])},[d.createElementVNode("div",FBe,d.toDisplayString(S.value),1),d.createElementVNode("div",LBe,d.toDisplayString(S.label),1)],10,PBe)]))),128))]))}}),zfe=Ja(VBe,[["__scopeId","data-v-6e079ff0"]]),HBe=["innerHTML"],Ufe=d.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=d.useModel(o,"modelValue");return(i,u)=>(d.openBlock(),d.createBlock(RB,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,HBe)]),_:1}))}});function RU(o){return d.getCurrentScope()?(d.onScopeDispose(o),!0):!1}function B0(o){return typeof o=="function"?o():d.unref(o)}const zBe=typeof window<"u"&&typeof document<"u",UBe=o=>typeof o<"u",jBe=Object.prototype.toString,WBe=o=>jBe.call(o)==="[object Object]",ZBe=()=>{};function GBe(o,s){function i(...u){return new Promise((m,h)=>{Promise.resolve(o(()=>s.apply(this,u),{fn:s,thisArg:this,args:u})).then(m).catch(h)})}return i}const jfe=o=>o();function qBe(o=jfe){const s=d.ref(!0);function i(){s.value=!1}function u(){s.value=!0}const m=(...h)=>{s.value&&o(...h)};return{isActive:d.readonly(s),pause:i,resume:u,eventFilter:m}}function dle(o,s=!1,i="Timeout"){return new Promise((u,m)=>{setTimeout(s?()=>m(i):u,o)})}function YBe(o,s,i={}){const{eventFilter:u=jfe,...m}=i;return d.watch(o,GBe(u,s),m)}function GA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:S}=qBe(u);return{stop:YBe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:S}}function KBe(o,s={}){if(!d.isRef(o))return d.toRefs(o);const i=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const u in o.value)i[u]=d.customRef(()=>({get(){return o.value[u]},set(m){var h;if((h=B0(s.replaceRef))!=null?h:!0)if(Array.isArray(o.value)){const C=[...o.value];C[u]=m,o.value=C}else{const C={...o.value,[u]:m};Object.setPrototypeOf(C,Object.getPrototypeOf(o.value)),o.value=C}else o.value[u]=m}}));return i}function xne(o,s=!1){function i(O,{flush:R="sync",deep:I=!1,timeout:W,throwOnTimeout:G}={}){let Q=null;const Z=[new Promise(L=>{Q=d.watch(o,pe=>{O(pe)!==s&&(Q==null||Q(),L(pe))},{flush:R,deep:I,immediate:!0})})];return W!=null&&Z.push(dle(W,G).then(()=>B0(o)).finally(()=>Q==null?void 0:Q())),Promise.race(Z)}function u(O,R){if(!d.isRef(O))return i(pe=>pe===O,R);const{flush:I="sync",deep:W=!1,timeout:G,throwOnTimeout:Q}=R??{};let q=null;const L=[new Promise(pe=>{q=d.watch([o,O],([Ke,Be])=>{s!==(Ke===Be)&&(q==null||q(),pe(Ke))},{flush:I,deep:W,immediate:!0})})];return G!=null&&L.push(dle(G,Q).then(()=>B0(o)).finally(()=>(q==null||q(),B0(o)))),Promise.race(L)}function m(O){return i(R=>!!R,O)}function h(O){return u(null,O)}function b(O){return u(void 0,O)}function C(O){return i(Number.isNaN,O)}function S(O,R){return i(I=>{const W=Array.from(I);return W.includes(O)||W.includes(B0(O))},R)}function _(O){return N(1,O)}function N(O=1,R){let I=-1;return i(()=>(I+=1,I>=O),R)}return Array.isArray(B0(o))?{toMatch:i,toContains:S,changed:_,changedTimes:N,get not(){return xne(o,!s)}}:{toMatch:i,toBe:u,toBeTruthy:m,toBeNull:h,toBeNaN:C,toBeUndefined:b,changed:_,changedTimes:N,get not(){return xne(o,!s)}}}function Ene(o){return xne(o)}function XBe(o){var s;const i=B0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const Wfe=zBe?window:void 0;function Zfe(...o){let s,i,u,m;if(typeof o[0]=="string"||Array.isArray(o[0])?([i,u,m]=o,s=Wfe):[s,i,u,m]=o,!s)return ZBe;Array.isArray(i)||(i=[i]),Array.isArray(u)||(u=[u]);const h=[],b=()=>{h.forEach(N=>N()),h.length=0},C=(N,O,R,I)=>(N.addEventListener(O,R,I),()=>N.removeEventListener(O,R,I)),S=d.watch(()=>[XBe(s),B0(m)],([N,O])=>{if(b(),!N)return;const R=WBe(O)?{...O}:O;h.push(...i.flatMap(I=>u.map(W=>C(N,I,W,R))))},{immediate:!0,flush:"post"}),_=()=>{S(),b()};return RU(_),_}function JBe(o){return typeof o=="function"?o:typeof o=="string"?s=>s.key===o:Array.isArray(o)?s=>o.includes(s.key):()=>!0}function fle(...o){let s,i,u={};o.length===3?(s=o[0],i=o[1],u=o[2]):o.length===2?typeof o[1]=="object"?(s=!0,i=o[0],u=o[1]):(s=o[0],i=o[1]):(s=!0,i=o[0]);const{target:m=Wfe,eventName:h="keydown",passive:b=!1,dedupe:C=!1}=u,S=JBe(s);return Zfe(m,h,N=>{N.repeat&&B0(C)||S(N)&&i(N)},b)}function QBe(o){return JSON.parse(JSON.stringify(o))}function vte(o,s,i,u={}){var m,h,b;const{clone:C=!1,passive:S=!1,eventName:_,deep:N=!1,defaultValue:O,shouldEmit:R}=u,I=d.getCurrentInstance(),W=i||(I==null?void 0:I.emit)||((m=I==null?void 0:I.$emit)==null?void 0:m.bind(I))||((b=(h=I==null?void 0:I.proxy)==null?void 0:h.$emit)==null?void 0:b.bind(I==null?void 0:I.proxy));let G=_;s||(s="modelValue"),G=G||`update:${s.toString()}`;const Q=L=>C?typeof C=="function"?C(L):QBe(L):L,q=()=>UBe(o[s])?Q(o[s]):O,Z=L=>{R?R(L)&&W(G,L):W(G,L)};if(S){const L=q(),pe=d.ref(L);let Ke=!1;return d.watch(()=>o[s],Be=>{Ke||(Ke=!0,pe.value=Q(Be),d.nextTick(()=>Ke=!1))}),d.watch(pe,Be=>{!Ke&&(Be!==o[s]||N)&&Z(Be)},{deep:N}),pe}else return d.computed({get(){return q()},set(L){Z(L)}})}var eRe={value:()=>{}};function IU(){for(var o=0,s=arguments.length,i={},u;o<s;++o){if(!(u=arguments[o]+"")||u in i||/[\s.]/.test(u))throw new Error("illegal type: "+u);i[u]=[]}return new az(i)}function az(o){this._=o}function tRe(o,s){return o.trim().split(/^|\s+/).map(function(i){var u="",m=i.indexOf(".");if(m>=0&&(u=i.slice(m+1),i=i.slice(0,m)),i&&!s.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:u}})}az.prototype=IU.prototype={constructor:az,on:function(o,s){var i=this._,u=tRe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=nRe(i[m],o.name)))return m;return}if(s!=null&&typeof s!="function")throw new Error("invalid callback: "+s);for(;++h<b;)if(m=(o=u[h]).type)i[m]=mle(i[m],o.name,s);else if(s==null)for(m in i)i[m]=mle(i[m],o.name,null);return this},copy:function(){var o={},s=this._;for(var i in s)o[i]=s[i].slice();return new az(o)},call:function(o,s){if((m=arguments.length-2)>0)for(var i=new Array(m),u=0,m,h;u<m;++u)i[u]=arguments[u+2];if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(h=this._[o],u=0,m=h.length;u<m;++u)h[u].value.apply(s,i)},apply:function(o,s,i){if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(var u=this._[o],m=0,h=u.length;m<h;++m)u[m].value.apply(s,i)}};function nRe(o,s){for(var i=0,u=o.length,m;i<u;++i)if((m=o[i]).name===s)return m.value}function mle(o,s,i){for(var u=0,m=o.length;u<m;++u)if(o[u].name===s){o[u]=eRe,o=o.slice(0,u).concat(o.slice(u+1));break}return i!=null&&o.push({name:s,value:i}),o}var _ne="http://www.w3.org/1999/xhtml";const ple={svg:"http://www.w3.org/2000/svg",xhtml:_ne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function PU(o){var s=o+="",i=s.indexOf(":");return i>=0&&(s=o.slice(0,i))!=="xmlns"&&(o=o.slice(i+1)),ple.hasOwnProperty(s)?{space:ple[s],local:o}:o}function oRe(o){return function(){var s=this.ownerDocument,i=this.namespaceURI;return i===_ne&&s.documentElement.namespaceURI===_ne?s.createElement(o):s.createElementNS(i,o)}}function sRe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Gfe(o){var s=PU(o);return(s.local?sRe:oRe)(s)}function rRe(){}function Loe(o){return o==null?rRe:function(){return this.querySelector(o)}}function aRe(o){typeof o!="function"&&(o=Loe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=new Array(b),S,_,N=0;N<b;++N)(S=h[N])&&(_=o.call(S,S.__data__,N,h))&&("__data__"in S&&(_.__data__=S.__data__),C[N]=_);return new Sp(u,this._parents)}function iRe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function lRe(){return[]}function qfe(o){return o==null?lRe:function(){return this.querySelectorAll(o)}}function cRe(o){return function(){return iRe(o.apply(this,arguments))}}function uRe(o){typeof o=="function"?o=cRe(o):o=qfe(o);for(var s=this._groups,i=s.length,u=[],m=[],h=0;h<i;++h)for(var b=s[h],C=b.length,S,_=0;_<C;++_)(S=b[_])&&(u.push(o.call(S,S.__data__,_,b)),m.push(S));return new Sp(u,m)}function Yfe(o){return function(){return this.matches(o)}}function Kfe(o){return function(s){return s.matches(o)}}var dRe=Array.prototype.find;function fRe(o){return function(){return dRe.call(this.children,o)}}function mRe(){return this.firstElementChild}function pRe(o){return this.select(o==null?mRe:fRe(typeof o=="function"?o:Kfe(o)))}var gRe=Array.prototype.filter;function hRe(){return Array.from(this.children)}function vRe(o){return function(){return gRe.call(this.children,o)}}function bRe(o){return this.selectAll(o==null?hRe:vRe(typeof o=="function"?o:Kfe(o)))}function yRe(o){typeof o!="function"&&(o=Yfe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],S,_=0;_<b;++_)(S=h[_])&&o.call(S,S.__data__,_,h)&&C.push(S);return new Sp(u,this._parents)}function Xfe(o){return new Array(o.length)}function wRe(){return new Sp(this._enter||this._groups.map(Xfe),this._parents)}function Rz(o,s){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=s}Rz.prototype={constructor:Rz,appendChild:function(o){return this._parent.insertBefore(o,this._next)},insertBefore:function(o,s){return this._parent.insertBefore(o,s)},querySelector:function(o){return this._parent.querySelector(o)},querySelectorAll:function(o){return this._parent.querySelectorAll(o)}};function CRe(o){return function(){return o}}function SRe(o,s,i,u,m,h){for(var b=0,C,S=s.length,_=h.length;b<_;++b)(C=s[b])?(C.__data__=h[b],u[b]=C):i[b]=new Rz(o,h[b]);for(;b<S;++b)(C=s[b])&&(m[b]=C)}function xRe(o,s,i,u,m,h,b){var C,S,_=new Map,N=s.length,O=h.length,R=new Array(N),I;for(C=0;C<N;++C)(S=s[C])&&(R[C]=I=b.call(S,S.__data__,C,s)+"",_.has(I)?m[C]=S:_.set(I,S));for(C=0;C<O;++C)I=b.call(o,h[C],C,h)+"",(S=_.get(I))?(u[C]=S,S.__data__=h[C],_.delete(I)):i[C]=new Rz(o,h[C]);for(C=0;C<N;++C)(S=s[C])&&_.get(R[C])===S&&(m[C]=S)}function ERe(o){return o.__data__}function _Re(o,s){if(!arguments.length)return Array.from(this,ERe);var i=s?xRe:SRe,u=this._parents,m=this._groups;typeof o!="function"&&(o=CRe(o));for(var h=m.length,b=new Array(h),C=new Array(h),S=new Array(h),_=0;_<h;++_){var N=u[_],O=m[_],R=O.length,I=kRe(o.call(N,N&&N.__data__,_,u)),W=I.length,G=C[_]=new Array(W),Q=b[_]=new Array(W),q=S[_]=new Array(R);i(N,O,G,Q,q,I,s);for(var Z=0,L=0,pe,Ke;Z<W;++Z)if(pe=G[Z]){for(Z>=L&&(L=Z+1);!(Ke=Q[L])&&++L<W;);pe._next=Ke||null}}return b=new Sp(b,u),b._enter=C,b._exit=S,b}function kRe(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function TRe(){return new Sp(this._exit||this._groups.map(Xfe),this._parents)}function ARe(o,s,i){var u=this.enter(),m=this,h=this.exit();return typeof o=="function"?(u=o(u),u&&(u=u.selection())):u=u.append(o+""),s!=null&&(m=s(m),m&&(m=m.selection())),i==null?h.remove():i(h),u&&m?u.merge(m).order():m}function NRe(o){for(var s=o.selection?o.selection():o,i=this._groups,u=s._groups,m=i.length,h=u.length,b=Math.min(m,h),C=new Array(m),S=0;S<b;++S)for(var _=i[S],N=u[S],O=_.length,R=C[S]=new Array(O),I,W=0;W<O;++W)(I=_[W]||N[W])&&(R[W]=I);for(;S<m;++S)C[S]=i[S];return new Sp(C,this._parents)}function ORe(){for(var o=this._groups,s=-1,i=o.length;++s<i;)for(var u=o[s],m=u.length-1,h=u[m],b;--m>=0;)(b=u[m])&&(h&&b.compareDocumentPosition(h)^4&&h.parentNode.insertBefore(b,h),h=b);return this}function $Re(o){o||(o=DRe);function s(O,R){return O&&R?o(O.__data__,R.__data__):!O-!R}for(var i=this._groups,u=i.length,m=new Array(u),h=0;h<u;++h){for(var b=i[h],C=b.length,S=m[h]=new Array(C),_,N=0;N<C;++N)(_=b[N])&&(S[N]=_);S.sort(s)}return new Sp(m,this._parents).order()}function DRe(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function MRe(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function BRe(){return Array.from(this)}function RRe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length;m<h;++m){var b=u[m];if(b)return b}return null}function IRe(){let o=0;for(const s of this)++o;return o}function PRe(){return!this.node()}function FRe(o){for(var s=this._groups,i=0,u=s.length;i<u;++i)for(var m=s[i],h=0,b=m.length,C;h<b;++h)(C=m[h])&&o.call(C,C.__data__,h,m);return this}function LRe(o){return function(){this.removeAttribute(o)}}function VRe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function HRe(o,s){return function(){this.setAttribute(o,s)}}function zRe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function URe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function jRe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttributeNS(o.space,o.local):this.setAttributeNS(o.space,o.local,i)}}function WRe(o,s){var i=PU(o);if(arguments.length<2){var u=this.node();return i.local?u.getAttributeNS(i.space,i.local):u.getAttribute(i)}return this.each((s==null?i.local?VRe:LRe:typeof s=="function"?i.local?jRe:URe:i.local?zRe:HRe)(i,s))}function Jfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function ZRe(o){return function(){this.style.removeProperty(o)}}function GRe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function qRe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function YRe(o,s,i){return arguments.length>1?this.each((s==null?ZRe:typeof s=="function"?qRe:GRe)(o,s,i??"")):g4(this.node(),o)}function g4(o,s){return o.style.getPropertyValue(s)||Jfe(o).getComputedStyle(o,null).getPropertyValue(s)}function KRe(o){return function(){delete this[o]}}function XRe(o,s){return function(){this[o]=s}}function JRe(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function QRe(o,s){return arguments.length>1?this.each((s==null?KRe:typeof s=="function"?JRe:XRe)(o,s)):this.node()[o]}function Qfe(o){return o.trim().split(/^|\s+/)}function Voe(o){return o.classList||new eme(o)}function eme(o){this._node=o,this._names=Qfe(o.getAttribute("class")||"")}eme.prototype={add:function(o){var s=this._names.indexOf(o);s<0&&(this._names.push(o),this._node.setAttribute("class",this._names.join(" ")))},remove:function(o){var s=this._names.indexOf(o);s>=0&&(this._names.splice(s,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(o){return this._names.indexOf(o)>=0}};function tme(o,s){for(var i=Voe(o),u=-1,m=s.length;++u<m;)i.add(s[u])}function nme(o,s){for(var i=Voe(o),u=-1,m=s.length;++u<m;)i.remove(s[u])}function eIe(o){return function(){tme(this,o)}}function tIe(o){return function(){nme(this,o)}}function nIe(o,s){return function(){(s.apply(this,arguments)?tme:nme)(this,o)}}function oIe(o,s){var i=Qfe(o+"");if(arguments.length<2){for(var u=Voe(this.node()),m=-1,h=i.length;++m<h;)if(!u.contains(i[m]))return!1;return!0}return this.each((typeof s=="function"?nIe:s?eIe:tIe)(i,s))}function sIe(){this.textContent=""}function rIe(o){return function(){this.textContent=o}}function aIe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function iIe(o){return arguments.length?this.each(o==null?sIe:(typeof o=="function"?aIe:rIe)(o)):this.node().textContent}function lIe(){this.innerHTML=""}function cIe(o){return function(){this.innerHTML=o}}function uIe(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function dIe(o){return arguments.length?this.each(o==null?lIe:(typeof o=="function"?uIe:cIe)(o)):this.node().innerHTML}function fIe(){this.nextSibling&&this.parentNode.appendChild(this)}function mIe(){return this.each(fIe)}function pIe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function gIe(){return this.each(pIe)}function hIe(o){var s=typeof o=="function"?o:Gfe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function vIe(){return null}function bIe(o,s){var i=typeof o=="function"?o:Gfe(o),u=s==null?vIe:typeof s=="function"?s:Loe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function yIe(){var o=this.parentNode;o&&o.removeChild(this)}function wIe(){return this.each(yIe)}function CIe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function SIe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function xIe(o){return this.select(o?SIe:CIe)}function EIe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function _Ie(o){return function(s){o.call(this,s,this.__data__)}}function kIe(o){return o.trim().split(/^|\s+/).map(function(s){var i="",u=s.indexOf(".");return u>=0&&(i=s.slice(u+1),s=s.slice(0,u)),{type:s,name:i}})}function TIe(o){return function(){var s=this.__on;if(s){for(var i=0,u=-1,m=s.length,h;i<m;++i)h=s[i],(!o.type||h.type===o.type)&&h.name===o.name?this.removeEventListener(h.type,h.listener,h.options):s[++u]=h;++u?s.length=u:delete this.__on}}}function AIe(o,s,i){return function(){var u=this.__on,m,h=_Ie(s);if(u){for(var b=0,C=u.length;b<C;++b)if((m=u[b]).type===o.type&&m.name===o.name){this.removeEventListener(m.type,m.listener,m.options),this.addEventListener(m.type,m.listener=h,m.options=i),m.value=s;return}}this.addEventListener(o.type,h,i),m={type:o.type,name:o.name,value:s,listener:h,options:i},u?u.push(m):this.__on=[m]}}function NIe(o,s,i){var u=kIe(o+""),m,h=u.length,b;if(arguments.length<2){var C=this.node().__on;if(C){for(var S=0,_=C.length,N;S<_;++S)for(m=0,N=C[S];m<h;++m)if((b=u[m]).type===N.type&&b.name===N.name)return N.value}return}for(C=s?AIe:TIe,m=0;m<h;++m)this.each(C(u[m],s,i));return this}function ome(o,s,i){var u=Jfe(o),m=u.CustomEvent;typeof m=="function"?m=new m(s,i):(m=u.document.createEvent("Event"),i?(m.initEvent(s,i.bubbles,i.cancelable),m.detail=i.detail):m.initEvent(s,!1,!1)),o.dispatchEvent(m)}function OIe(o,s){return function(){return ome(this,o,s)}}function $Ie(o,s){return function(){return ome(this,o,s.apply(this,arguments))}}function DIe(o,s){return this.each((typeof s=="function"?$Ie:OIe)(o,s))}function*MIe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length,b;m<h;++m)(b=u[m])&&(yield b)}var sme=[null];function Sp(o,s){this._groups=o,this._parents=s}function PB(){return new Sp([[document.documentElement]],sme)}function BIe(){return this}Sp.prototype=PB.prototype={constructor:Sp,select:aRe,selectAll:uRe,selectChild:pRe,selectChildren:bRe,filter:yRe,data:_Re,enter:wRe,exit:TRe,join:ARe,merge:NRe,selection:BIe,order:ORe,sort:$Re,call:MRe,nodes:BRe,node:RRe,size:IRe,empty:PRe,each:FRe,attr:WRe,style:YRe,property:QRe,classed:oIe,text:iIe,html:dIe,raise:mIe,lower:gIe,append:hIe,insert:bIe,remove:wIe,clone:xIe,datum:EIe,on:NIe,dispatch:DIe,[Symbol.iterator]:MIe};function Mh(o){return typeof o=="string"?new Sp([[document.querySelector(o)]],[document.documentElement]):new Sp([[o]],sme)}function RIe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Ov(o,s){if(o=RIe(o),s===void 0&&(s=o.currentTarget),s){var i=s.ownerSVGElement||s;if(i.createSVGPoint){var u=i.createSVGPoint();return u.x=o.clientX,u.y=o.clientY,u=u.matrixTransform(s.getScreenCTM().inverse()),[u.x,u.y]}if(s.getBoundingClientRect){var m=s.getBoundingClientRect();return[o.clientX-m.left-s.clientLeft,o.clientY-m.top-s.clientTop]}}return[o.pageX,o.pageY]}const IIe={passive:!1},fB={capture:!0,passive:!1};function bte(o){o.stopImmediatePropagation()}function a4(o){o.preventDefault(),o.stopImmediatePropagation()}function rme(o){var s=o.document.documentElement,i=Mh(o).on("dragstart.drag",a4,fB);"onselectstart"in s?i.on("selectstart.drag",a4,fB):(s.__noselect=s.style.MozUserSelect,s.style.MozUserSelect="none")}function ame(o,s){var i=o.document.documentElement,u=Mh(o).on("dragstart.drag",null);s&&(u.on("click.drag",a4,fB),setTimeout(function(){u.on("click.drag",null)},0)),"onselectstart"in i?u.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const RH=o=>()=>o;function kne(o,{sourceEvent:s,subject:i,target:u,identifier:m,active:h,x:b,y:C,dx:S,dy:_,dispatch:N}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:u,enumerable:!0,configurable:!0},identifier:{value:m,enumerable:!0,configurable:!0},active:{value:h,enumerable:!0,configurable:!0},x:{value:b,enumerable:!0,configurable:!0},y:{value:C,enumerable:!0,configurable:!0},dx:{value:S,enumerable:!0,configurable:!0},dy:{value:_,enumerable:!0,configurable:!0},_:{value:N}})}kne.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function PIe(o){return!o.ctrlKey&&!o.button}function FIe(){return this.parentNode}function LIe(o,s){return s??{x:o.x,y:o.y}}function VIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function HIe(){var o=PIe,s=FIe,i=LIe,u=VIe,m={},h=IU("start","drag","end"),b=0,C,S,_,N,O=0;function R(pe){pe.on("mousedown.drag",I).filter(u).on("touchstart.drag",Q).on("touchmove.drag",q,IIe).on("touchend.drag touchcancel.drag",Z).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function I(pe,Ke){if(!(N||!o.call(this,pe,Ke))){var Be=L(this,s.call(this,pe,Ke),pe,Ke,"mouse");Be&&(Mh(pe.view).on("mousemove.drag",W,fB).on("mouseup.drag",G,fB),rme(pe.view),bte(pe),_=!1,C=pe.clientX,S=pe.clientY,Be("start",pe))}}function W(pe){if(a4(pe),!_){var Ke=pe.clientX-C,Be=pe.clientY-S;_=Ke*Ke+Be*Be>O}m.mouse("drag",pe)}function G(pe){Mh(pe.view).on("mousemove.drag mouseup.drag",null),ame(pe.view,_),a4(pe),m.mouse("end",pe)}function Q(pe,Ke){if(o.call(this,pe,Ke)){var Be=pe.changedTouches,Y=s.call(this,pe,Ke),ke=Be.length,et,je;for(et=0;et<ke;++et)(je=L(this,Y,pe,Ke,Be[et].identifier,Be[et]))&&(bte(pe),je("start",pe,Be[et]))}}function q(pe){var Ke=pe.changedTouches,Be=Ke.length,Y,ke;for(Y=0;Y<Be;++Y)(ke=m[Ke[Y].identifier])&&(a4(pe),ke("drag",pe,Ke[Y]))}function Z(pe){var Ke=pe.changedTouches,Be=Ke.length,Y,ke;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),Y=0;Y<Be;++Y)(ke=m[Ke[Y].identifier])&&(bte(pe),ke("end",pe,Ke[Y]))}function L(pe,Ke,Be,Y,ke,et){var je=h.copy(),Ce=Ov(et||Be,Ke),ce,Dt,me;if((me=i.call(pe,new kne("beforestart",{sourceEvent:Be,target:R,identifier:ke,active:b,x:Ce[0],y:Ce[1],dx:0,dy:0,dispatch:je}),Y))!=null)return ce=me.x-Ce[0]||0,Dt=me.y-Ce[1]||0,function be($,_e,le){var He=Ce,Ge;switch($){case"start":m[ke]=be,Ge=b++;break;case"end":delete m[ke],--b;case"drag":Ce=Ov(le||_e,Ke),Ge=b;break}je.call($,pe,new kne($,{sourceEvent:_e,subject:me,target:R,identifier:ke,active:Ge,x:Ce[0]+ce,y:Ce[1]+Dt,dx:Ce[0]-He[0],dy:Ce[1]-He[1],dispatch:je}),Y)}}return R.filter=function(pe){return arguments.length?(o=typeof pe=="function"?pe:RH(!!pe),R):o},R.container=function(pe){return arguments.length?(s=typeof pe=="function"?pe:RH(pe),R):s},R.subject=function(pe){return arguments.length?(i=typeof pe=="function"?pe:RH(pe),R):i},R.touchable=function(pe){return arguments.length?(u=typeof pe=="function"?pe:RH(!!pe),R):u},R.on=function(){var pe=h.on.apply(h,arguments);return pe===h?R:pe},R.clickDistance=function(pe){return arguments.length?(O=(pe=+pe)*pe,R):Math.sqrt(O)},R}function Hoe(o,s,i){o.prototype=s.prototype=i,i.constructor=o}function ime(o,s){var i=Object.create(o.prototype);for(var u in s)i[u]=s[u];return i}function FB(){}var mB=.7,Iz=1/mB,i4="\\s*([+-]?\\d+)\\s*",pB="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zIe=/^#([0-9a-f]{3,8})$/,UIe=new RegExp(`^rgb\\(${i4},${i4},${i4}\\)$`),jIe=new RegExp(`^rgb\\(${Mv},${Mv},${Mv}\\)$`),WIe=new RegExp(`^rgba\\(${i4},${i4},${i4},${pB}\\)$`),ZIe=new RegExp(`^rgba\\(${Mv},${Mv},${Mv},${pB}\\)$`),GIe=new RegExp(`^hsl\\(${pB},${Mv},${Mv}\\)$`),qIe=new RegExp(`^hsla\\(${pB},${Mv},${Mv},${pB}\\)$`),gle={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Hoe(FB,gB,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:hle,formatHex:hle,formatHex8:YIe,formatHsl:KIe,formatRgb:vle,toString:vle});function hle(){return this.rgb().formatHex()}function YIe(){return this.rgb().formatHex8()}function KIe(){return lme(this).formatHsl()}function vle(){return this.rgb().formatRgb()}function gB(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=zIe.exec(o))?(i=s[1].length,s=parseInt(s[1],16),i===6?ble(s):i===3?new Sm(s>>8&15|s>>4&240,s>>4&15|s&240,(s&15)<<4|s&15,1):i===8?IH(s>>24&255,s>>16&255,s>>8&255,(s&255)/255):i===4?IH(s>>12&15|s>>8&240,s>>8&15|s>>4&240,s>>4&15|s&240,((s&15)<<4|s&15)/255):null):(s=UIe.exec(o))?new Sm(s[1],s[2],s[3],1):(s=jIe.exec(o))?new Sm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=WIe.exec(o))?IH(s[1],s[2],s[3],s[4]):(s=ZIe.exec(o))?IH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=GIe.exec(o))?Cle(s[1],s[2]/100,s[3]/100,1):(s=qIe.exec(o))?Cle(s[1],s[2]/100,s[3]/100,s[4]):gle.hasOwnProperty(o)?ble(gle[o]):o==="transparent"?new Sm(NaN,NaN,NaN,0):null}function ble(o){return new Sm(o>>16&255,o>>8&255,o&255,1)}function IH(o,s,i,u){return u<=0&&(o=s=i=NaN),new Sm(o,s,i,u)}function XIe(o){return o instanceof FB||(o=gB(o)),o?(o=o.rgb(),new Sm(o.r,o.g,o.b,o.opacity)):new Sm}function Tne(o,s,i,u){return arguments.length===1?XIe(o):new Sm(o,s,i,u??1)}function Sm(o,s,i,u){this.r=+o,this.g=+s,this.b=+i,this.opacity=+u}Hoe(Sm,Tne,ime(FB,{brighter(o){return o=o==null?Iz:Math.pow(Iz,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},darker(o){return o=o==null?mB:Math.pow(mB,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},rgb(){return this},clamp(){return new Sm(_E(this.r),_E(this.g),_E(this.b),Pz(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yle,formatHex:yle,formatHex8:JIe,formatRgb:wle,toString:wle}));function yle(){return`#${bE(this.r)}${bE(this.g)}${bE(this.b)}`}function JIe(){return`#${bE(this.r)}${bE(this.g)}${bE(this.b)}${bE((isNaN(this.opacity)?1:this.opacity)*255)}`}function wle(){const o=Pz(this.opacity);return`${o===1?"rgb(":"rgba("}${_E(this.r)}, ${_E(this.g)}, ${_E(this.b)}${o===1?")":`, ${o})`}`}function Pz(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function _E(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function bE(o){return o=_E(o),(o<16?"0":"")+o.toString(16)}function Cle(o,s,i,u){return u<=0?o=s=i=NaN:i<=0||i>=1?o=s=NaN:s<=0&&(o=NaN),new Bh(o,s,i,u)}function lme(o){if(o instanceof Bh)return new Bh(o.h,o.s,o.l,o.opacity);if(o instanceof FB||(o=gB(o)),!o)return new Bh;if(o instanceof Bh)return o;o=o.rgb();var s=o.r/255,i=o.g/255,u=o.b/255,m=Math.min(s,i,u),h=Math.max(s,i,u),b=NaN,C=h-m,S=(h+m)/2;return C?(s===h?b=(i-u)/C+(i<u)*6:i===h?b=(u-s)/C+2:b=(s-i)/C+4,C/=S<.5?h+m:2-h-m,b*=60):C=S>0&&S<1?0:b,new Bh(b,C,S,o.opacity)}function QIe(o,s,i,u){return arguments.length===1?lme(o):new Bh(o,s,i,u??1)}function Bh(o,s,i,u){this.h=+o,this.s=+s,this.l=+i,this.opacity=+u}Hoe(Bh,QIe,ime(FB,{brighter(o){return o=o==null?Iz:Math.pow(Iz,o),new Bh(this.h,this.s,this.l*o,this.opacity)},darker(o){return o=o==null?mB:Math.pow(mB,o),new Bh(this.h,this.s,this.l*o,this.opacity)},rgb(){var o=this.h%360+(this.h<0)*360,s=isNaN(o)||isNaN(this.s)?0:this.s,i=this.l,u=i+(i<.5?i:1-i)*s,m=2*i-u;return new Sm(yte(o>=240?o-240:o+120,m,u),yte(o,m,u),yte(o<120?o+240:o-120,m,u),this.opacity)},clamp(){return new Bh(Sle(this.h),PH(this.s),PH(this.l),Pz(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const o=Pz(this.opacity);return`${o===1?"hsl(":"hsla("}${Sle(this.h)}, ${PH(this.s)*100}%, ${PH(this.l)*100}%${o===1?")":`, ${o})`}`}}));function Sle(o){return o=(o||0)%360,o<0?o+360:o}function PH(o){return Math.max(0,Math.min(1,o||0))}function yte(o,s,i){return(o<60?s+(i-s)*o/60:o<180?i:o<240?s+(i-s)*(240-o)/60:s)*255}const cme=o=>()=>o;function ePe(o,s){return function(i){return o+i*s}}function tPe(o,s,i){return o=Math.pow(o,i),s=Math.pow(s,i)-o,i=1/i,function(u){return Math.pow(o+u*s,i)}}function nPe(o){return(o=+o)==1?ume:function(s,i){return i-s?tPe(s,i,o):cme(isNaN(s)?i:s)}}function ume(o,s){var i=s-o;return i?ePe(o,i):cme(isNaN(o)?s:o)}const xle=function o(s){var i=nPe(s);function u(m,h){var b=i((m=Tne(m)).r,(h=Tne(h)).r),C=i(m.g,h.g),S=i(m.b,h.b),_=ume(m.opacity,h.opacity);return function(N){return m.r=b(N),m.g=C(N),m.b=S(N),m.opacity=_(N),m+""}}return u.gamma=o,u}(1);function r2(o,s){return o=+o,s=+s,function(i){return o*(1-i)+s*i}}var Ane=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wte=new RegExp(Ane.source,"g");function oPe(o){return function(){return o}}function sPe(o){return function(s){return o(s)+""}}function rPe(o,s){var i=Ane.lastIndex=wte.lastIndex=0,u,m,h,b=-1,C=[],S=[];for(o=o+"",s=s+"";(u=Ane.exec(o))&&(m=wte.exec(s));)(h=m.index)>i&&(h=s.slice(i,h),C[b]?C[b]+=h:C[++b]=h),(u=u[0])===(m=m[0])?C[b]?C[b]+=m:C[++b]=m:(C[++b]=null,S.push({i:b,x:r2(u,m)})),i=wte.lastIndex;return i<s.length&&(h=s.slice(i),C[b]?C[b]+=h:C[++b]=h),C.length<2?S[0]?sPe(S[0].x):oPe(s):(s=S.length,function(_){for(var N=0,O;N<s;++N)C[(O=S[N]).i]=O.x(_);return C.join("")})}var Ele=180/Math.PI,Nne={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dme(o,s,i,u,m,h){var b,C,S;return(b=Math.sqrt(o*o+s*s))&&(o/=b,s/=b),(S=o*i+s*u)&&(i-=o*S,u-=s*S),(C=Math.sqrt(i*i+u*u))&&(i/=C,u/=C,S/=C),o*u<s*i&&(o=-o,s=-s,S=-S,b=-b),{translateX:m,translateY:h,rotate:Math.atan2(s,o)*Ele,skewX:Math.atan(S)*Ele,scaleX:b,scaleY:C}}var FH;function aPe(o){const s=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return s.isIdentity?Nne:dme(s.a,s.b,s.c,s.d,s.e,s.f)}function iPe(o){return o==null||(FH||(FH=document.createElementNS("http://www.w3.org/2000/svg","g")),FH.setAttribute("transform",o),!(o=FH.transform.baseVal.consolidate()))?Nne:(o=o.matrix,dme(o.a,o.b,o.c,o.d,o.e,o.f))}function fme(o,s,i,u){function m(_){return _.length?_.pop()+" ":""}function h(_,N,O,R,I,W){if(_!==O||N!==R){var G=I.push("translate(",null,s,null,i);W.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,R)})}else(O||R)&&I.push("translate("+O+s+R+i)}function b(_,N,O,R){_!==N?(_-N>180?N+=360:N-_>180&&(_+=360),R.push({i:O.push(m(O)+"rotate(",null,u)-2,x:r2(_,N)})):N&&O.push(m(O)+"rotate("+N+u)}function C(_,N,O,R){_!==N?R.push({i:O.push(m(O)+"skewX(",null,u)-2,x:r2(_,N)}):N&&O.push(m(O)+"skewX("+N+u)}function S(_,N,O,R,I,W){if(_!==O||N!==R){var G=I.push(m(I)+"scale(",null,",",null,")");W.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,R)})}else(O!==1||R!==1)&&I.push(m(I)+"scale("+O+","+R+")")}return function(_,N){var O=[],R=[];return _=o(_),N=o(N),h(_.translateX,_.translateY,N.translateX,N.translateY,O,R),b(_.rotate,N.rotate,O,R),C(_.skewX,N.skewX,O,R),S(_.scaleX,_.scaleY,N.scaleX,N.scaleY,O,R),_=N=null,function(I){for(var W=-1,G=R.length,Q;++W<G;)O[(Q=R[W]).i]=Q.x(I);return O.join("")}}}var lPe=fme(aPe,"px, ","px)","deg)"),cPe=fme(iPe,", ",")",")"),uPe=1e-12;function _le(o){return((o=Math.exp(o))+1/o)/2}function dPe(o){return((o=Math.exp(o))-1/o)/2}function fPe(o){return((o=Math.exp(2*o))-1)/(o+1)}const mPe=function o(s,i,u){function m(h,b){var C=h[0],S=h[1],_=h[2],N=b[0],O=b[1],R=b[2],I=N-C,W=O-S,G=I*I+W*W,Q,q;if(G<uPe)q=Math.log(R/_)/s,Q=function(Y){return[C+Y*I,S+Y*W,_*Math.exp(s*Y*q)]};else{var Z=Math.sqrt(G),L=(R*R-_*_+u*G)/(2*_*i*Z),pe=(R*R-_*_-u*G)/(2*R*i*Z),Ke=Math.log(Math.sqrt(L*L+1)-L),Be=Math.log(Math.sqrt(pe*pe+1)-pe);q=(Be-Ke)/s,Q=function(Y){var ke=Y*q,et=_le(Ke),je=_/(i*Z)*(et*fPe(s*ke+Ke)-dPe(Ke));return[C+je*I,S+je*W,_*et/_le(s*ke+Ke)]}}return Q.duration=q*1e3*s/Math.SQRT2,Q}return m.rho=function(h){var b=Math.max(.001,+h),C=b*b,S=C*C;return o(b,C,S)},m}(Math.SQRT2,2,4);var h4=0,L6=0,I6=0,mme=1e3,Fz,V6,Lz=0,$E=0,FU=0,hB=typeof performance=="object"&&performance.now?performance:Date,pme=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(o){setTimeout(o,17)};function zoe(){return $E||(pme(pPe),$E=hB.now()+FU)}function pPe(){$E=0}function Vz(){this._call=this._time=this._next=null}Vz.prototype=gme.prototype={constructor:Vz,restart:function(o,s,i){if(typeof o!="function")throw new TypeError("callback is not a function");i=(i==null?zoe():+i)+(s==null?0:+s),!this._next&&V6!==this&&(V6?V6._next=this:Fz=this,V6=this),this._call=o,this._time=i,One()},stop:function(){this._call&&(this._call=null,this._time=1/0,One())}};function gme(o,s,i){var u=new Vz;return u.restart(o,s,i),u}function gPe(){zoe(),++h4;for(var o=Fz,s;o;)(s=$E-o._time)>=0&&o._call.call(void 0,s),o=o._next;--h4}function kle(){$E=(Lz=hB.now())+FU,h4=L6=0;try{gPe()}finally{h4=0,vPe(),$E=0}}function hPe(){var o=hB.now(),s=o-Lz;s>mme&&(FU-=s,Lz=o)}function vPe(){for(var o,s=Fz,i,u=1/0;s;)s._call?(u>s._time&&(u=s._time),o=s,s=s._next):(i=s._next,s._next=null,s=o?o._next=i:Fz=i);V6=o,One(u)}function One(o){if(!h4){L6&&(L6=clearTimeout(L6));var s=o-$E;s>24?(o<1/0&&(L6=setTimeout(kle,o-hB.now()-FU)),I6&&(I6=clearInterval(I6))):(I6||(Lz=hB.now(),I6=setInterval(hPe,mme)),h4=1,pme(kle))}}function Tle(o,s,i){var u=new Vz;return s=s==null?0:+s,u.restart(m=>{u.stop(),o(m+s)},s,i),u}var bPe=IU("start","end","cancel","interrupt"),yPe=[],hme=0,Ale=1,$ne=2,iz=3,Nle=4,Dne=5,lz=6;function LU(o,s,i,u,m,h){var b=o.__transition;if(!b)o.__transition={};else if(i in b)return;wPe(o,i,{name:s,index:u,group:m,on:bPe,tween:yPe,time:h.time,delay:h.delay,duration:h.duration,ease:h.ease,timer:null,state:hme})}function Uoe(o,s){var i=Fh(o,s);if(i.state>hme)throw new Error("too late; already scheduled");return i}function Fv(o,s){var i=Fh(o,s);if(i.state>iz)throw new Error("too late; already running");return i}function Fh(o,s){var i=o.__transition;if(!i||!(i=i[s]))throw new Error("transition not found");return i}function wPe(o,s,i){var u=o.__transition,m;u[s]=i,i.timer=gme(h,0,i.time);function h(_){i.state=Ale,i.timer.restart(b,i.delay,i.time),i.delay<=_&&b(_-i.delay)}function b(_){var N,O,R,I;if(i.state!==Ale)return S();for(N in u)if(I=u[N],I.name===i.name){if(I.state===iz)return Tle(b);I.state===Nle?(I.state=lz,I.timer.stop(),I.on.call("interrupt",o,o.__data__,I.index,I.group),delete u[N]):+N<s&&(I.state=lz,I.timer.stop(),I.on.call("cancel",o,o.__data__,I.index,I.group),delete u[N])}if(Tle(function(){i.state===iz&&(i.state=Nle,i.timer.restart(C,i.delay,i.time),C(_))}),i.state=$ne,i.on.call("start",o,o.__data__,i.index,i.group),i.state===$ne){for(i.state=iz,m=new Array(R=i.tween.length),N=0,O=-1;N<R;++N)(I=i.tween[N].value.call(o,o.__data__,i.index,i.group))&&(m[++O]=I);m.length=O+1}}function C(_){for(var N=_<i.duration?i.ease.call(null,_/i.duration):(i.timer.restart(S),i.state=Dne,1),O=-1,R=m.length;++O<R;)m[O].call(o,N);i.state===Dne&&(i.on.call("end",o,o.__data__,i.index,i.group),S())}function S(){i.state=lz,i.timer.stop(),delete u[s];for(var _ in u)return;delete o.__transition}}function cz(o,s){var i=o.__transition,u,m,h=!0,b;if(i){s=s==null?null:s+"";for(b in i){if((u=i[b]).name!==s){h=!1;continue}m=u.state>$ne&&u.state<Dne,u.state=lz,u.timer.stop(),u.on.call(m?"interrupt":"cancel",o,o.__data__,u.index,u.group),delete i[b]}h&&delete o.__transition}}function CPe(o){return this.each(function(){cz(this,o)})}function SPe(o,s){var i,u;return function(){var m=Fv(this,o),h=m.tween;if(h!==i){u=i=h;for(var b=0,C=u.length;b<C;++b)if(u[b].name===s){u=u.slice(),u.splice(b,1);break}}m.tween=u}}function xPe(o,s,i){var u,m;if(typeof i!="function")throw new Error;return function(){var h=Fv(this,o),b=h.tween;if(b!==u){m=(u=b).slice();for(var C={name:s,value:i},S=0,_=m.length;S<_;++S)if(m[S].name===s){m[S]=C;break}S===_&&m.push(C)}h.tween=m}}function EPe(o,s){var i=this._id;if(o+="",arguments.length<2){for(var u=Fh(this.node(),i).tween,m=0,h=u.length,b;m<h;++m)if((b=u[m]).name===o)return b.value;return null}return this.each((s==null?SPe:xPe)(i,o,s))}function joe(o,s,i){var u=o._id;return o.each(function(){var m=Fv(this,u);(m.value||(m.value={}))[s]=i.apply(this,arguments)}),function(m){return Fh(m,u).value[s]}}function vme(o,s){var i;return(typeof s=="number"?r2:s instanceof gB?xle:(i=gB(s))?(s=i,xle):rPe)(o,s)}function _Pe(o){return function(){this.removeAttribute(o)}}function kPe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function TPe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttribute(o);return b===m?null:b===u?h:h=s(u=b,i)}}function APe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttributeNS(o.space,o.local);return b===m?null:b===u?h:h=s(u=b,i)}}function NPe(o,s,i){var u,m,h;return function(){var b,C=i(this),S;return C==null?void this.removeAttribute(o):(b=this.getAttribute(o),S=C+"",b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C)))}}function OPe(o,s,i){var u,m,h;return function(){var b,C=i(this),S;return C==null?void this.removeAttributeNS(o.space,o.local):(b=this.getAttributeNS(o.space,o.local),S=C+"",b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C)))}}function $Pe(o,s){var i=PU(o),u=i==="transform"?cPe:vme;return this.attrTween(o,typeof s=="function"?(i.local?OPe:NPe)(i,u,joe(this,"attr."+o,s)):s==null?(i.local?kPe:_Pe)(i):(i.local?APe:TPe)(i,u,s))}function DPe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function MPe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function BPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&MPe(o,h)),i}return m._value=s,m}function RPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&DPe(o,h)),i}return m._value=s,m}function IPe(o,s){var i="attr."+o;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(s==null)return this.tween(i,null);if(typeof s!="function")throw new Error;var u=PU(o);return this.tween(i,(u.local?BPe:RPe)(u,s))}function PPe(o,s){return function(){Uoe(this,o).delay=+s.apply(this,arguments)}}function FPe(o,s){return s=+s,function(){Uoe(this,o).delay=s}}function LPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?PPe:FPe)(s,o)):Fh(this.node(),s).delay}function VPe(o,s){return function(){Fv(this,o).duration=+s.apply(this,arguments)}}function HPe(o,s){return s=+s,function(){Fv(this,o).duration=s}}function zPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?VPe:HPe)(s,o)):Fh(this.node(),s).duration}function UPe(o,s){if(typeof s!="function")throw new Error;return function(){Fv(this,o).ease=s}}function jPe(o){var s=this._id;return arguments.length?this.each(UPe(s,o)):Fh(this.node(),s).ease}function WPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Fv(this,o).ease=i}}function ZPe(o){if(typeof o!="function")throw new Error;return this.each(WPe(this._id,o))}function GPe(o){typeof o!="function"&&(o=Yfe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],S,_=0;_<b;++_)(S=h[_])&&o.call(S,S.__data__,_,h)&&C.push(S);return new V0(u,this._parents,this._name,this._id)}function qPe(o){if(o._id!==this._id)throw new Error;for(var s=this._groups,i=o._groups,u=s.length,m=i.length,h=Math.min(u,m),b=new Array(u),C=0;C<h;++C)for(var S=s[C],_=i[C],N=S.length,O=b[C]=new Array(N),R,I=0;I<N;++I)(R=S[I]||_[I])&&(O[I]=R);for(;C<u;++C)b[C]=s[C];return new V0(b,this._parents,this._name,this._id)}function YPe(o){return(o+"").trim().split(/^|\s+/).every(function(s){var i=s.indexOf(".");return i>=0&&(s=s.slice(0,i)),!s||s==="start"})}function KPe(o,s,i){var u,m,h=YPe(s)?Uoe:Fv;return function(){var b=h(this,o),C=b.on;C!==u&&(m=(u=C).copy()).on(s,i),b.on=m}}function XPe(o,s){var i=this._id;return arguments.length<2?Fh(this.node(),i).on.on(o):this.each(KPe(i,o,s))}function JPe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function QPe(){return this.on("end.remove",JPe(this._id))}function e8e(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Loe(o));for(var u=this._groups,m=u.length,h=new Array(m),b=0;b<m;++b)for(var C=u[b],S=C.length,_=h[b]=new Array(S),N,O,R=0;R<S;++R)(N=C[R])&&(O=o.call(N,N.__data__,R,C))&&("__data__"in N&&(O.__data__=N.__data__),_[R]=O,LU(_[R],s,i,R,_,Fh(N,i)));return new V0(h,this._parents,s,i)}function t8e(o){var s=this._name,i=this._id;typeof o!="function"&&(o=qfe(o));for(var u=this._groups,m=u.length,h=[],b=[],C=0;C<m;++C)for(var S=u[C],_=S.length,N,O=0;O<_;++O)if(N=S[O]){for(var R=o.call(N,N.__data__,O,S),I,W=Fh(N,i),G=0,Q=R.length;G<Q;++G)(I=R[G])&&LU(I,s,i,G,R,W);h.push(R),b.push(N)}return new V0(h,b,s,i)}var n8e=PB.prototype.constructor;function o8e(){return new n8e(this._groups,this._parents)}function s8e(o,s){var i,u,m;return function(){var h=g4(this,o),b=(this.style.removeProperty(o),g4(this,o));return h===b?null:h===i&&b===u?m:m=s(i=h,u=b)}}function bme(o){return function(){this.style.removeProperty(o)}}function r8e(o,s,i){var u,m=i+"",h;return function(){var b=g4(this,o);return b===m?null:b===u?h:h=s(u=b,i)}}function a8e(o,s,i){var u,m,h;return function(){var b=g4(this,o),C=i(this),S=C+"";return C==null&&(S=C=(this.style.removeProperty(o),g4(this,o))),b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C))}}function i8e(o,s){var i,u,m,h="style."+s,b="end."+h,C;return function(){var S=Fv(this,o),_=S.on,N=S.value[h]==null?C||(C=bme(s)):void 0;(_!==i||m!==N)&&(u=(i=_).copy()).on(b,m=N),S.on=u}}function l8e(o,s,i){var u=(o+="")=="transform"?lPe:vme;return s==null?this.styleTween(o,s8e(o,u)).on("end.style."+o,bme(o)):typeof s=="function"?this.styleTween(o,a8e(o,u,joe(this,"style."+o,s))).each(i8e(this._id,o)):this.styleTween(o,r8e(o,u,s),i).on("end.style."+o,null)}function c8e(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function u8e(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&c8e(o,b,i)),u}return h._value=s,h}function d8e(o,s,i){var u="style."+(o+="");if(arguments.length<2)return(u=this.tween(u))&&u._value;if(s==null)return this.tween(u,null);if(typeof s!="function")throw new Error;return this.tween(u,u8e(o,s,i??""))}function f8e(o){return function(){this.textContent=o}}function m8e(o){return function(){var s=o(this);this.textContent=s??""}}function p8e(o){return this.tween("text",typeof o=="function"?m8e(joe(this,"text",o)):f8e(o==null?"":o+""))}function g8e(o){return function(s){this.textContent=o.call(this,s)}}function h8e(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&g8e(m)),s}return u._value=o,u}function v8e(o){var s="text";if(arguments.length<1)return(s=this.tween(s))&&s._value;if(o==null)return this.tween(s,null);if(typeof o!="function")throw new Error;return this.tween(s,h8e(o))}function b8e(){for(var o=this._name,s=this._id,i=yme(),u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,S,_=0;_<C;++_)if(S=b[_]){var N=Fh(S,s);LU(S,o,i,_,b,{time:N.time+N.delay+N.duration,delay:0,duration:N.duration,ease:N.ease})}return new V0(u,this._parents,o,i)}function y8e(){var o,s,i=this,u=i._id,m=i.size();return new Promise(function(h,b){var C={value:b},S={value:function(){--m===0&&h()}};i.each(function(){var _=Fv(this,u),N=_.on;N!==o&&(s=(o=N).copy(),s._.cancel.push(C),s._.interrupt.push(C),s._.end.push(S)),_.on=s}),m===0&&h()})}var w8e=0;function V0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function yme(){return++w8e}var $0=PB.prototype;V0.prototype={constructor:V0,select:e8e,selectAll:t8e,selectChild:$0.selectChild,selectChildren:$0.selectChildren,filter:GPe,merge:qPe,selection:o8e,transition:b8e,call:$0.call,nodes:$0.nodes,node:$0.node,size:$0.size,empty:$0.empty,each:$0.each,on:XPe,attr:$Pe,attrTween:IPe,style:l8e,styleTween:d8e,text:p8e,textTween:v8e,remove:QPe,tween:EPe,delay:LPe,duration:zPe,ease:jPe,easeVarying:ZPe,end:y8e,[Symbol.iterator]:$0[Symbol.iterator]};function C8e(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var S8e={time:null,delay:0,duration:250,ease:C8e};function x8e(o,s){for(var i;!(i=o.__transition)||!(i=i[s]);)if(!(o=o.parentNode))throw new Error(`transition ${s} not found`);return i}function E8e(o){var s,i;o instanceof V0?(s=o._id,o=o._name):(s=yme(),(i=S8e).time=zoe(),o=o==null?null:o+"");for(var u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,S,_=0;_<C;++_)(S=b[_])&&LU(S,o,s,_,b,i||x8e(S,s));return new V0(u,this._parents,o,s)}PB.prototype.interrupt=CPe;PB.prototype.transition=E8e;const LH=o=>()=>o;function _8e(o,{sourceEvent:s,target:i,transform:u,dispatch:m}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:u,enumerable:!0,configurable:!0},_:{value:m}})}function I0(o,s,i){this.k=o,this.x=s,this.y=i}I0.prototype={constructor:I0,scale:function(o){return o===1?this:new I0(this.k*o,this.x,this.y)},translate:function(o,s){return o===0&s===0?this:new I0(this.k,this.x+this.k*o,this.y+this.k*s)},apply:function(o){return[o[0]*this.k+this.x,o[1]*this.k+this.y]},applyX:function(o){return o*this.k+this.x},applyY:function(o){return o*this.k+this.y},invert:function(o){return[(o[0]-this.x)/this.k,(o[1]-this.y)/this.k]},invertX:function(o){return(o-this.x)/this.k},invertY:function(o){return(o-this.y)/this.k},rescaleX:function(o){return o.copy().domain(o.range().map(this.invertX,this).map(o.invert,o))},rescaleY:function(o){return o.copy().domain(o.range().map(this.invertY,this).map(o.invert,o))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var v4=new I0(1,0,0);I0.prototype;function Cte(o){o.stopImmediatePropagation()}function P6(o){o.preventDefault(),o.stopImmediatePropagation()}function k8e(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function T8e(){var o=this;return o instanceof SVGElement?(o=o.ownerSVGElement||o,o.hasAttribute("viewBox")?(o=o.viewBox.baseVal,[[o.x,o.y],[o.x+o.width,o.y+o.height]]):[[0,0],[o.width.baseVal.value,o.height.baseVal.value]]):[[0,0],[o.clientWidth,o.clientHeight]]}function Ole(){return this.__zoom||v4}function A8e(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function N8e(){return navigator.maxTouchPoints||"ontouchstart"in this}function O8e(o,s,i){var u=o.invertX(s[0][0])-i[0][0],m=o.invertX(s[1][0])-i[1][0],h=o.invertY(s[0][1])-i[0][1],b=o.invertY(s[1][1])-i[1][1];return o.translate(m>u?(u+m)/2:Math.min(0,u)||Math.max(0,m),b>h?(h+b)/2:Math.min(0,h)||Math.max(0,b))}function $8e(){var o=k8e,s=T8e,i=O8e,u=A8e,m=N8e,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,S=mPe,_=IU("start","zoom","end"),N,O,R,I=500,W=150,G=0,Q=10;function q(me){me.property("__zoom",Ole).on("wheel.zoom",ke,{passive:!1}).on("mousedown.zoom",et).on("dblclick.zoom",je).filter(m).on("touchstart.zoom",Ce).on("touchmove.zoom",ce).on("touchend.zoom touchcancel.zoom",Dt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}q.transform=function(me,be,$,_e){var le=me.selection?me.selection():me;le.property("__zoom",Ole),me!==le?Ke(me,be,$,_e):le.interrupt().each(function(){Be(this,arguments).event(_e).start().zoom(null,typeof be=="function"?be.apply(this,arguments):be).end()})},q.scaleBy=function(me,be,$,_e){q.scaleTo(me,function(){var le=this.__zoom.k,He=typeof be=="function"?be.apply(this,arguments):be;return le*He},$,_e)},q.scaleTo=function(me,be,$,_e){q.transform(me,function(){var le=s.apply(this,arguments),He=this.__zoom,Ge=$==null?pe(le):typeof $=="function"?$.apply(this,arguments):$,fe=He.invert(Ge),Ue=typeof be=="function"?be.apply(this,arguments):be;return i(L(Z(He,Ue),Ge,fe),le,b)},$,_e)},q.translateBy=function(me,be,$,_e){q.transform(me,function(){return i(this.__zoom.translate(typeof be=="function"?be.apply(this,arguments):be,typeof $=="function"?$.apply(this,arguments):$),s.apply(this,arguments),b)},null,_e)},q.translateTo=function(me,be,$,_e,le){q.transform(me,function(){var He=s.apply(this,arguments),Ge=this.__zoom,fe=_e==null?pe(He):typeof _e=="function"?_e.apply(this,arguments):_e;return i(v4.translate(fe[0],fe[1]).scale(Ge.k).translate(typeof be=="function"?-be.apply(this,arguments):-be,typeof $=="function"?-$.apply(this,arguments):-$),He,b)},_e,le)};function Z(me,be){return be=Math.max(h[0],Math.min(h[1],be)),be===me.k?me:new I0(be,me.x,me.y)}function L(me,be,$){var _e=be[0]-$[0]*me.k,le=be[1]-$[1]*me.k;return _e===me.x&&le===me.y?me:new I0(me.k,_e,le)}function pe(me){return[(+me[0][0]+ +me[1][0])/2,(+me[0][1]+ +me[1][1])/2]}function Ke(me,be,$,_e){me.on("start.zoom",function(){Be(this,arguments).event(_e).start()}).on("interrupt.zoom end.zoom",function(){Be(this,arguments).event(_e).end()}).tween("zoom",function(){var le=this,He=arguments,Ge=Be(le,He).event(_e),fe=s.apply(le,He),Ue=$==null?pe(fe):typeof $=="function"?$.apply(le,He):$,yt=Math.max(fe[1][0]-fe[0][0],fe[1][1]-fe[0][1]),Ve=le.__zoom,pt=typeof be=="function"?be.apply(le,He):be,Ie=S(Ve.invert(Ue).concat(yt/Ve.k),pt.invert(Ue).concat(yt/pt.k));return function(mt){if(mt===1)mt=pt;else{var oe=Ie(mt),mn=yt/oe[2];mt=new I0(mn,Ue[0]-oe[0]*mn,Ue[1]-oe[1]*mn)}Ge.zoom(null,mt)}})}function Be(me,be,$){return!$&&me.__zooming||new Y(me,be)}function Y(me,be){this.that=me,this.args=be,this.active=0,this.sourceEvent=null,this.extent=s.apply(me,be),this.taps=0}Y.prototype={event:function(me){return me&&(this.sourceEvent=me),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(me,be){return this.mouse&&me!=="mouse"&&(this.mouse[1]=be.invert(this.mouse[0])),this.touch0&&me!=="touch"&&(this.touch0[1]=be.invert(this.touch0[0])),this.touch1&&me!=="touch"&&(this.touch1[1]=be.invert(this.touch1[0])),this.that.__zoom=be,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(me){var be=Mh(this.that).datum();_.call(me,this.that,new _8e(me,{sourceEvent:this.sourceEvent,target:q,type:me,transform:this.that.__zoom,dispatch:_}),be)}};function ke(me,...be){if(!o.apply(this,arguments))return;var $=Be(this,be).event(me),_e=this.__zoom,le=Math.max(h[0],Math.min(h[1],_e.k*Math.pow(2,u.apply(this,arguments)))),He=Ov(me);if($.wheel)($.mouse[0][0]!==He[0]||$.mouse[0][1]!==He[1])&&($.mouse[1]=_e.invert($.mouse[0]=He)),clearTimeout($.wheel);else{if(_e.k===le)return;$.mouse=[He,_e.invert(He)],cz(this),$.start()}P6(me),$.wheel=setTimeout(Ge,W),$.zoom("mouse",i(L(Z(_e,le),$.mouse[0],$.mouse[1]),$.extent,b));function Ge(){$.wheel=null,$.end()}}function et(me,...be){if(R||!o.apply(this,arguments))return;var $=me.currentTarget,_e=Be(this,be,!0).event(me),le=Mh(me.view).on("mousemove.zoom",Ue,!0).on("mouseup.zoom",yt,!0),He=Ov(me,$),Ge=me.clientX,fe=me.clientY;rme(me.view),Cte(me),_e.mouse=[He,this.__zoom.invert(He)],cz(this),_e.start();function Ue(Ve){if(P6(Ve),!_e.moved){var pt=Ve.clientX-Ge,Ie=Ve.clientY-fe;_e.moved=pt*pt+Ie*Ie>G}_e.event(Ve).zoom("mouse",i(L(_e.that.__zoom,_e.mouse[0]=Ov(Ve,$),_e.mouse[1]),_e.extent,b))}function yt(Ve){le.on("mousemove.zoom mouseup.zoom",null),ame(Ve.view,_e.moved),P6(Ve),_e.event(Ve).end()}}function je(me,...be){if(o.apply(this,arguments)){var $=this.__zoom,_e=Ov(me.changedTouches?me.changedTouches[0]:me,this),le=$.invert(_e),He=$.k*(me.shiftKey?.5:2),Ge=i(L(Z($,He),_e,le),s.apply(this,be),b);P6(me),C>0?Mh(this).transition().duration(C).call(Ke,Ge,_e,me):Mh(this).call(q.transform,Ge,_e,me)}}function Ce(me,...be){if(o.apply(this,arguments)){var $=me.touches,_e=$.length,le=Be(this,be,me.changedTouches.length===_e).event(me),He,Ge,fe,Ue;for(Cte(me),Ge=0;Ge<_e;++Ge)fe=$[Ge],Ue=Ov(fe,this),Ue=[Ue,this.__zoom.invert(Ue),fe.identifier],le.touch0?!le.touch1&&le.touch0[2]!==Ue[2]&&(le.touch1=Ue,le.taps=0):(le.touch0=Ue,He=!0,le.taps=1+!!N);N&&(N=clearTimeout(N)),He&&(le.taps<2&&(O=Ue[0],N=setTimeout(function(){N=null},I)),cz(this),le.start())}}function ce(me,...be){if(this.__zooming){var $=Be(this,be).event(me),_e=me.changedTouches,le=_e.length,He,Ge,fe,Ue;for(P6(me),He=0;He<le;++He)Ge=_e[He],fe=Ov(Ge,this),$.touch0&&$.touch0[2]===Ge.identifier?$.touch0[0]=fe:$.touch1&&$.touch1[2]===Ge.identifier&&($.touch1[0]=fe);if(Ge=$.that.__zoom,$.touch1){var yt=$.touch0[0],Ve=$.touch0[1],pt=$.touch1[0],Ie=$.touch1[1],mt=(mt=pt[0]-yt[0])*mt+(mt=pt[1]-yt[1])*mt,oe=(oe=Ie[0]-Ve[0])*oe+(oe=Ie[1]-Ve[1])*oe;Ge=Z(Ge,Math.sqrt(mt/oe)),fe=[(yt[0]+pt[0])/2,(yt[1]+pt[1])/2],Ue=[(Ve[0]+Ie[0])/2,(Ve[1]+Ie[1])/2]}else if($.touch0)fe=$.touch0[0],Ue=$.touch0[1];else return;$.zoom("touch",i(L(Ge,fe,Ue),$.extent,b))}}function Dt(me,...be){if(this.__zooming){var $=Be(this,be).event(me),_e=me.changedTouches,le=_e.length,He,Ge;for(Cte(me),R&&clearTimeout(R),R=setTimeout(function(){R=null},I),He=0;He<le;++He)Ge=_e[He],$.touch0&&$.touch0[2]===Ge.identifier?delete $.touch0:$.touch1&&$.touch1[2]===Ge.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(Ge=Ov(Ge,this),Math.hypot(O[0]-Ge[0],O[1]-Ge[1])<Q)){var fe=Mh(this).on("dblclick.zoom");fe&&fe.apply(this,arguments)}}}return q.wheelDelta=function(me){return arguments.length?(u=typeof me=="function"?me:LH(+me),q):u},q.filter=function(me){return arguments.length?(o=typeof me=="function"?me:LH(!!me),q):o},q.touchable=function(me){return arguments.length?(m=typeof me=="function"?me:LH(!!me),q):m},q.extent=function(me){return arguments.length?(s=typeof me=="function"?me:LH([[+me[0][0],+me[0][1]],[+me[1][0],+me[1][1]]]),q):s},q.scaleExtent=function(me){return arguments.length?(h[0]=+me[0],h[1]=+me[1],q):[h[0],h[1]]},q.translateExtent=function(me){return arguments.length?(b[0][0]=+me[0][0],b[1][0]=+me[1][0],b[0][1]=+me[0][1],b[1][1]=+me[1][1],q):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},q.constrain=function(me){return arguments.length?(i=me,q):i},q.duration=function(me){return arguments.length?(C=+me,q):C},q.interpolate=function(me){return arguments.length?(S=me,q):S},q.on=function(){var me=_.on.apply(_,arguments);return me===_?q:me},q.clickDistance=function(me){return arguments.length?(G=(me=+me)*me,q):Math.sqrt(G)},q.tapDistance=function(me){return arguments.length?(Q=+me,q):Q},q}var is=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(is||{}),Woe=(o=>(o.Partial="partial",o.Full="full",o))(Woe||{}),mE=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(mE||{}),b2=(o=>(o.Strict="strict",o.Loose="loose",o))(b2||{}),Hz=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(Hz||{}),X6=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(X6||{}),wme=(o=>(o.TopLeft="top-left",o.TopCenter="top-center",o.TopRight="top-right",o.BottomLeft="bottom-left",o.BottomCenter="bottom-center",o.BottomRight="bottom-right",o))(wme||{});const D8e=["INPUT","SELECT","TEXTAREA"];function Mne(o){var s,i;const u=((i=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:i[0])||o.target,m=typeof(u==null?void 0:u.hasAttribute)=="function"?u.hasAttribute("contenteditable"):!1,h=typeof(u==null?void 0:u.closest)=="function"?u.closest(".nokey"):null;return D8e.includes(u==null?void 0:u.nodeName)||m||!!h}function M8e(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function $le(o,s,i,u){const m=s.replace("+",`
126
+ */(function(){const o=$e=>qe=>($t=>{const Mt=typeof $t;return $t===null?"null":Mt==="object"&&Array.isArray($t)?"array":Mt==="object"&&(gn=yn=$t,(Ot=String).prototype.isPrototypeOf(gn)||((_t=yn.constructor)===null||_t===void 0?void 0:_t.name)===Ot.name)?"string":Mt;var gn,yn,Ot,_t})(qe)===$e,s=$e=>qe=>typeof qe===$e,i=o("string"),u=o("array"),m=s("boolean"),h=$e=>$e===void 0,b=$e=>!(qe=>qe==null)($e),C=s("function"),S=s("number"),_=$e=>()=>$e,N=$e=>$e,O=_(!1),R=_(!0);class I{constructor(qe,$t){this.tag=qe,this.value=$t}static some(qe){return new I(!0,qe)}static none(){return I.singletonNone}fold(qe,$t){return this.tag?$t(this.value):qe()}isSome(){return this.tag}isNone(){return!this.tag}map(qe){return this.tag?I.some(qe(this.value)):I.none()}bind(qe){return this.tag?qe(this.value):I.none()}exists(qe){return this.tag&&qe(this.value)}forall(qe){return!this.tag||qe(this.value)}filter(qe){return!this.tag||qe(this.value)?this:I.none()}getOr(qe){return this.tag?this.value:qe}or(qe){return this.tag?this:qe}getOrThunk(qe){return this.tag?this.value:qe()}orThunk(qe){return this.tag?this:qe()}getOrDie(qe){if(this.tag)return this.value;throw new Error(qe??"Called getOrDie on None")}static from(qe){return b(qe)?I.some(qe):I.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(qe){this.tag&&qe(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}I.singletonNone=new I(!1);const W=Array.prototype.indexOf,G=Array.prototype.push,Q=($e,qe)=>(($t,Mt)=>W.call($t,Mt))($e,qe)>-1,q=($e,qe)=>{for(let $t=0,Mt=$e.length;$t<Mt;$t++)if(qe($e[$t],$t))return!0;return!1},Z=($e,qe)=>{const $t=$e.length,Mt=new Array($t);for(let gn=0;gn<$t;gn++){const yn=$e[gn];Mt[gn]=qe(yn,gn)}return Mt},L=($e,qe)=>{const $t=[];for(let Mt=0,gn=$e.length;Mt<gn;Mt++){const yn=$e[Mt];qe(yn,Mt)&&$t.push(yn)}return $t},pe=($e,qe)=>(($t,Mt,gn)=>{for(let yn=0,Ot=$t.length;yn<Ot;yn++){const _t=$t[yn];if(Mt(_t,yn))return I.some(_t);if(gn(_t,yn))break}return I.none()})($e,qe,O),Ke=($e,qe)=>($t=>{const Mt=[];for(let gn=0,yn=$t.length;gn<yn;++gn){if(!u($t[gn]))throw new Error("Arr.flatten item "+gn+" was not an array, input: "+$t);G.apply(Mt,$t[gn])}return Mt})(Z($e,qe)),Be=Object.keys,Y=Object.hasOwnProperty,ke=($e,qe)=>{const $t=Be($e);for(let Mt=0,gn=$t.length;Mt<gn;Mt++){const yn=$t[Mt];qe($e[yn],yn)}},et=($e,qe)=>{const $t={};return ke($e,(Mt,gn)=>{const yn=qe(Mt,gn);$t[yn.k]=yn.v}),$t},je=$e=>(qe,$t)=>{$e[$t]=qe},Ce=$e=>((qe,$t)=>{const Mt=[];return ke(qe,(gn,yn)=>{Mt.push($t(gn,yn))}),Mt})($e,N),ce=($e,qe)=>Dt($e,qe)?I.from($e[qe]):I.none(),Dt=($e,qe)=>Y.call($e,qe),me=$e=>{let qe=$e;return{get:()=>qe,set:$t=>{qe=$t}}},be=($e,qe,$t=0,Mt)=>{const gn=$e.indexOf(qe,$t);return gn!==-1&&(!!h(Mt)||gn+qe.length<=Mt)},$=$e=>parseInt($e,10),_e=($e,qe)=>{const $t=$e-qe;return $t===0?0:$t>0?1:-1},le=($e,qe,$t)=>({major:$e,minor:qe,patch:$t}),He=$e=>{const qe=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec($e);return qe?le($(qe[1]),$(qe[2]),$(qe[3])):le(0,0,0)},Ge=()=>fe(0,0),fe=($e,qe)=>({major:$e,minor:qe}),Ue={nu:fe,detect:($e,qe)=>{const $t=String(qe).toLowerCase();return $e.length===0?Ge():((Mt,gn)=>{const yn=((_t,Xe)=>{for(let tt=0;tt<_t.length;tt++){const jt=_t[tt];if(jt.test(Xe))return jt}})(Mt,gn);if(!yn)return{major:0,minor:0};const Ot=_t=>Number(gn.replace(yn,"$"+_t));return fe(Ot(1),Ot(2))})($e,$t)},unknown:Ge},yt=($e,qe)=>{const $t=String(qe).toLowerCase();return pe($e,Mt=>Mt.search($t))},Ve=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,pt=$e=>qe=>be(qe,$e),Ie=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:$e=>be($e,"edge/")&&be($e,"chrome")&&be($e,"safari")&&be($e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ve],search:$e=>be($e,"chrome")&&!be($e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:$e=>be($e,"msie")||be($e,"trident")},{name:"Opera",versionRegexes:[Ve,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:pt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:pt("firefox")},{name:"Safari",versionRegexes:[Ve,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:$e=>(be($e,"safari")||be($e,"mobile/"))&&be($e,"applewebkit")}],mt=[{name:"Windows",search:pt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:$e=>be($e,"iphone")||be($e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:pt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:pt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:pt("linux"),versionRegexes:[]},{name:"Solaris",search:pt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:pt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:pt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],oe={browsers:_(Ie),oses:_(mt)},mn=$e=>{const qe=$e.current,$t=$e.version,Mt=gn=>()=>qe===gn;return{current:qe,version:$t,isEdge:Mt("Edge"),isChromium:Mt("Chromium"),isIE:Mt("IE"),isOpera:Mt("Opera"),isFirefox:Mt("Firefox"),isSafari:Mt("Safari")}},gt=()=>mn({current:void 0,version:Ue.unknown()}),St=mn,Wt=$e=>{const qe=$e.current,$t=$e.version,Mt=gn=>()=>qe===gn;return{current:qe,version:$t,isWindows:Mt("Windows"),isiOS:Mt("iOS"),isAndroid:Mt("Android"),isMacOS:Mt("macOS"),isLinux:Mt("Linux"),isSolaris:Mt("Solaris"),isFreeBSD:Mt("FreeBSD"),isChromeOS:Mt("ChromeOS")}},Et=()=>Wt({current:void 0,version:Ue.unknown()}),te=Wt,ie=($e,qe,$t)=>{const Mt=oe.browsers(),gn=oe.oses(),yn=qe.bind(Xe=>((tt,jt)=>((nn,Dn)=>{for(let jn=0;jn<nn.length;jn++){const Yn=Dn(nn[jn]);if(Yn.isSome())return Yn}return I.none()})(jt.brands,nn=>{const Dn=nn.brand.toLowerCase();return pe(tt,jn=>{var Yn;return Dn===((Yn=jn.brand)===null||Yn===void 0?void 0:Yn.toLowerCase())}).map(jn=>({current:jn.name,version:Ue.nu(parseInt(nn.version,10),0)}))}))(Mt,Xe)).orThunk(()=>((Xe,tt)=>yt(Xe,tt).map(jt=>{const nn=Ue.detect(jt.versionRegexes,tt);return{current:jt.name,version:nn}}))(Mt,$e)).fold(gt,St),Ot=((Xe,tt)=>yt(Xe,tt).map(jt=>{const nn=Ue.detect(jt.versionRegexes,tt);return{current:jt.name,version:nn}}))(gn,$e).fold(Et,te),_t=((Xe,tt,jt,nn)=>{const Dn=Xe.isiOS()&&/ipad/i.test(jt)===!0,jn=Xe.isiOS()&&!Dn,Yn=Xe.isiOS()||Xe.isAndroid(),Wn=Yn||nn("(pointer:coarse)"),go=Dn||!jn&&Yn&&nn("(min-device-width:768px)"),ko=jn||Yn&&!go,qo=tt.isSafari()&&Xe.isiOS()&&/safari/i.test(jt)===!1,Ms=!ko&&!go&&!qo;return{isiPad:_(Dn),isiPhone:_(jn),isTablet:_(go),isPhone:_(ko),isTouch:_(Wn),isAndroid:Xe.isAndroid,isiOS:Xe.isiOS,isWebView:_(qo),isDesktop:_(Ms)}})(Ot,yn,$e,$t);return{browser:yn,os:Ot,deviceType:_t}},de=$e=>window.matchMedia($e).matches;let X=($e=>{let qe,$t=!1;return(...Mt)=>($t||($t=!0,qe=$e.apply(null,Mt)),qe)})(()=>ie(window.navigator.userAgent,I.from(window.navigator.userAgentData),de));const Se=()=>X(),Pe=$e=>{if($e==null)throw new Error("Node cannot be null or undefined");return{dom:$e}},Fe=Pe,vt=($e,qe)=>$e.dom===qe.dom,Qe=($e,qe)=>{const $t=$e.dom;if($t.nodeType!==1)return!1;{const Mt=$t;if(Mt.matches!==void 0)return Mt.matches(qe);if(Mt.msMatchesSelector!==void 0)return Mt.msMatchesSelector(qe);if(Mt.webkitMatchesSelector!==void 0)return Mt.webkitMatchesSelector(qe);if(Mt.mozMatchesSelector!==void 0)return Mt.mozMatchesSelector(qe);throw new Error("Browser lacks native selectors")}},wt=$e=>qe=>($t=>$t.dom.nodeType)(qe)===$e,Ft=wt(1),bn=wt(3),Tt=wt(11),Ht=$e=>Fe($e.dom.host),vn=($e,qe,$t)=>{((Mt,gn,yn)=>{if(!(i(yn)||m(yn)||S(yn)))throw console.error("Invalid call to Attribute.set. Key ",gn,":: Value ",yn,":: Element ",Mt),new Error("Attribute value was not simple");Mt.setAttribute(gn,yn+"")})($e.dom,qe,$t)},kn=($e,qe)=>{const $t=$e.dom.getAttribute(qe);return $t===null?void 0:$t},Eo=($e,qe)=>{$e.dom.removeAttribute(qe)},to=$e=>{const qe=bn($e)?$e.dom.parentNode:$e.dom;if(qe==null||qe.ownerDocument===null)return!1;const $t=qe.ownerDocument;return(yn=>{const Ot=(Xe=>Fe(Xe.dom.getRootNode()))(yn);return Tt(_t=Ot)&&b(_t.dom.host)?I.some(Ot):I.none();var _t})(Fe(qe)).fold(()=>$t.body.contains(qe),(Mt=to,gn=Ht,yn=>Mt(gn(yn))));var Mt,gn},It=($e,qe)=>{const $t=$e.dom,Mt=window.getComputedStyle($t).getPropertyValue(qe);return Mt!==""||to($e)?Mt:dn($t,qe)},dn=($e,qe)=>($t=>$t.style!==void 0&&C($t.style.getPropertyValue))($e)?$e.style.getPropertyValue(qe):"",an=($e,qe)=>{const $t=kn($e,qe);return $t===void 0||$t===""?[]:$t.split(" ")},Bn=($e,qe,$t)=>{let Mt=$e.dom;const gn=C($t)?$t:O;for(;Mt.parentNode;){Mt=Mt.parentNode;const yn=Fe(Mt);if(qe(yn))return I.some(yn);if(gn(yn))break}return I.none()},_o=($e,qe,$t)=>((Mt,gn,yn,Ot,_t)=>Ot(yn)?I.some(yn):C(_t)&&_t(yn)?I.none():gn(yn,Ot,_t))(0,Bn,$e,qe,$t),Do=$e=>$e.dom.classList!==void 0,ms=$e=>an($e,"class"),Co=($e,qe)=>{Do($e)?$e.dom.classList.remove(qe):(($t,Mt)=>{((gn,yn,Ot)=>{const _t=L(an(gn,yn),Xe=>Xe!==Ot);_t.length>0?vn(gn,yn,_t.join(" ")):Eo(gn,yn)})($t,"class",Mt)})($e,qe),($t=>{(Do($t)?$t.dom.classList:ms($t)).length===0&&Eo($t,"class")})($e)},Is=($e,qe)=>{$e.dispatch("FormatPainterToggle",{state:qe})};var pn,Lo,js,Hs;(function($e){$e.Retrival="Retrieval",$e.Application="Application"})(pn||(pn={})),function($e){$e.ListSchema="ListSchema",$e.SubstitutionSchema="SubstitionSchema"}(Lo||(Lo={})),function($e){$e.InsertUnorderedList="InsertUnorderedList",$e.InsertOrderedList="InsertOrderedList",$e.InsertDefinitionList="InsertDefinitionList"}(js||(js={})),function($e){$e.Table="Table",$e.Unspecified="Unspecified"}(Hs||(Hs={}));const Tr=$e=>{var qe,$t;qe=Fe($e.getBody()),$t="tox-cursor-format-painter",Do(qe)?qe.dom.classList.add($t):((Mt,gn)=>{((yn,Ot,_t)=>{const Xe=an(yn,Ot).concat([_t]);vn(yn,Ot,Xe.join(" "))})(Mt,"class",gn)})(qe,$t)},vr=($e,qe)=>{($t=>{Co(Fe($t.getBody()),"tox-cursor-format-painter")})($e),qe.set(pn.Retrival),Is($e,!1)},_s={formatpainter_checklist:{selector:"ul",classes:"tox-checklist"},formatpainter_liststyletype:{selector:"ul,ol",styles:{listStyleType:"%value"}},formatpainter_borderstyle:{selector:"td,th",styles:{borderTopStyle:"%valueTop",borderRightStyle:"%valueRight",borderBottomStyle:"%valueBottom",borderLeftStyle:"%valueLeft"},remove_similar:!0},formatpainter_bordercolor:{selector:"td,th",styles:{borderTopColor:"%valueTop",borderRightColor:"%valueRight",borderBottomColor:"%valueBottom",borderLeftColor:"%valueLeft"},remove_similar:!0},formatpainter_backgroundcolor:{selector:"td,th",styles:{backgroundColor:"%value"},remove_similar:!0},formatpainter_removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*:not(tr,td,th,table)",attributes:["style","class"],split:!1,expand:!1,deep:!0}],formatpainter_legacy_font:{inline:"font",attributes:{size:"%value"}}},br=($e,qe)=>ce(qe,"selector").exists($t=>{const Mt=$e.getBody(),gn=$e.selection.getStart(),yn=$e.dom.getParents(gn,R,Mt),Ot=$e.selection.getSelectedBlocks();return $e.dom.is([...yn,...Ot],$t)}),Dr=$e=>$e.length>1&&$e.charAt(0)==="%",ps=($e,qe)=>ce($e,qe).filter($t=>!u($t)),po=$e=>Qe($e,"OL,UL,DL"),Ds=$e=>Qe($e,"LI,DT,DD"),Nt=$e=>$e.replace(/([A-Z])/g,qe=>`-${qe[0].toLowerCase()}`),Gt=($e,qe,$t)=>{const Mt=$e.formatter,gn=((Xe,tt)=>q(Xe.formatter.get(tt),jt=>((nn,Dn)=>Dt(Dn,"inline")&&!br(nn,Dn))(Xe,jt)))($e,$t.formatName),yn=((Xe,tt,jt)=>q(tt.get(jt),nn=>((Dn,jn)=>Dt(jn,"block")||br(Dn,jn))(Xe,nn)))($e,Mt,$t.formatName),Ot=(_t=$t.formatName,Q(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"],_t));var _t;(qe.table&&Ot||gn||qe.block&&yn&&!Ot)&&Mt.apply($t.formatName,$t.substitutedVariables)},Un=$e=>{const qe=$e.selection,$t=qe.getRng(),Mt=Fe($e.getBody()),gn=(_t=>L(_t.selection.getSelectedBlocks().map(Fe),Ds))($e),yn=$t.collapsed&&gn.length,Ot=gn.length&&!((_t,Xe)=>{const tt=jn=>vt(jn,Xe);return(jt=_o(Fe(_t.getStart()),po,tt),nn=_o(Fe(_t.getEnd()),po,tt),Dn=(jn,Yn)=>vt(jn,Yn),jt.isSome()&&nn.isSome()?I.some(Dn(jt.getOrDie(),nn.getOrDie())):I.none()).getOr(!1);var jt,nn,Dn})(qe,Mt);return gn.length>1||yn||Ot},uo=$e=>$e.options.get("formatpainter_ignored_formats"),Fo=($e,qe)=>{return qe==="class"?(gn=>Do(gn)?(yn=>{const Ot=yn.dom.classList,_t=new Array(Ot.length);for(let Xe=0;Xe<Ot.length;Xe++){const tt=Ot.item(Xe);tt!==null&&(_t[Xe]=tt)}return _t})(gn):ms(gn))($e).filter(gn=>!/^(mce-.*)/.test(gn)).join(" "):($t=$e,Mt=qe,I.from(kn($t,Mt))).getOr("");var $t,Mt},ss=$e=>((qe,$t)=>{const Mt={},gn={};return((yn,Ot,_t,Xe)=>{ke(yn,(tt,jt)=>{(Ot(tt,jt)?_t:Xe)(tt,jt)})})(qe,$t,je(Mt),je(gn)),{t:Mt,f:gn}})($e,qe=>{return($t=qe).length>1&&$t.charAt(0)==="%";var $t}).t,ur=($e,qe)=>($t=>{const Mt=uo($t);return Be($t.formatter.get()).filter(gn=>!Q(Mt,gn))})($e).filter($t=>{const Mt=((gn,yn)=>q(gn.formatter.get(yn),Ot=>(_t=>{const Xe=ps(_t,"styles").exists(jt=>q(Ce(jt),Dr)),tt=ps(_t,"attributes").exists(jt=>q(Ce(jt),Dr));return Xe||tt})(Ot)))($e,$t);return $e.formatter.matchNode(qe.dom,$t,{},Mt)}),dr=($e,qe)=>{const $t=Z($e.dom.getParents(qe,R),Fe);return Ke(L($t,Ft),Mt=>Ke(ur($e,Mt),gn=>((yn,Ot,_t)=>{return(Xe=yn.get(Ot),(tt=>0<tt.length?I.some(tt[0]):I.none())(Xe)).bind(tt=>((jt,nn)=>{const Dn=ps(jt,"styles").map(Wn=>{return go=nn,ko=ss(Wn),et(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:It(go,Nt(Ms))}));var go,ko}),jn=ps(jt,"attributes").map(Wn=>{return go=nn,ko=ss(Wn),et(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:Fo(go,Ms)}));var go,ko}),Yn={...Dn.getOr({}),...jn.getOr({})};return Ce(Yn).every(Wn=>Wn!=="")?I.some(Yn):I.none()})(tt,_t)).map(tt=>({kind:Lo.SubstitutionSchema,formatName:Ot,substitutedVariables:tt}));var Xe})($e.formatter,gn,Mt).toArray()))},or=$e=>(qe=>pe(Ce(js),$t=>qe.queryCommandState($t)))($e).map(qe=>({kind:Lo.ListSchema,command:qe})),at=($e,qe)=>$e.getParent(qe,"TABLE")?Hs.Table:Hs.Unspecified,ot=($e,qe,$t)=>{$e.addCommand("mceToggleFormatPainter",()=>{((Mt,gn)=>{gn.get()===pn.Application?vr(Mt,gn):((yn,Ot)=>{const _t=Se(),Xe=me(!1);Tr(yn),Ot.set(pn.Application),Is(yn,!0),yn.execCommand("mceRetrieveFormats");const tt=()=>{yn.execCommand("mcePaintFormats"),vr(yn,Ot)},jt=()=>{Ot.get()===pn.Application&&tt(),Yn()},nn=Wn=>{Ot.get()===pn.Application&&(Wn.type==="touchcancel"&&_t.os.isAndroid()?yn.once("contextmenu",tt):Xe.get()?tt():yn.once("selectionchange",tt)),Yn()},Dn=Wn=>{Wn.keyCode===27&&(vr(yn,Ot),Yn())},jn=Wn=>{Xe.set(Wn.type==="touchmove")};yn.on("click",jt),yn.on("touchstart touchmove",jn),yn.on("touchend touchcancel",nn),yn.on("keydown",Dn);const Yn=()=>{yn.off("click",jt),yn.off("touchstart touchmove",jn),yn.off("touchend touchcancel",nn),yn.off("keydown",Dn)}})(Mt,gn)})($e,qe)}),$e.addCommand("mcePaintFormats",()=>{$e.selection.isEditable()&&$e.undoManager.transact(()=>{((Mt,gn)=>{((Ot,_t)=>{Ot.formatter.remove("formatpainter_removeformat"),_t===Hs.Table&&(Xe=>{for(let jt=0,nn=Xe.length;jt<nn;jt++)tt=Xe[jt],Ot.formatter.remove(tt);var tt})(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"]),Un(Ot)&&Ot.execCommand("RemoveList")})(Mt,gn.context);const yn=(Ot=>{const _t=Ot.selection.getStart(),Xe=Ot.selection.getRng().collapsed,tt=Ot.dom.select("td[data-mce-selected]").length>0,jt=!!Ot.dom.getParent(_t,"TABLE");return{inline:!0,table:Xe&&jt||tt,block:Xe||(nn=Ot.selection,nn.getSelectedBlocks().length>1)||tt};var nn})(Mt);gn.schemas.forEach(Ot=>{switch(Ot.kind){case Lo.ListSchema:((_t,Xe,tt)=>{tt.block&&_t.execCommand(Xe.command)})(Mt,Ot,yn);break;case Lo.SubstitutionSchema:Gt(Mt,yn,Ot)}})})($e,$t.get())})}),$e.addCommand("mceRetrieveFormats",()=>{$t.set((Mt=>{const gn=Mt.dom,yn=Mt.selection.getStart();return{schemas:[...or(Mt).toArray(),...dr(Mt,yn)],context:at(gn,yn)}})($e))})};tinymce.PluginManager.add("formatpainter",$e=>{if(((Mt,gn)=>!!Mt&&((yn,Ot)=>{const _t=_e(yn.major,Ot.major);if(_t!==0)return _t;const Xe=_e(yn.minor,Ot.minor);if(Xe!==0)return Xe;const tt=_e(yn.patch,Ot.patch);return tt!==0?tt:0})((yn=>He((Ot=>[Ot.majorVersion,Ot.minorVersion].join(".").split(".").slice(0,3).join("."))(yn)))(Mt),He(gn))===-1)(tinymce,"6.0.0"))return void window.console.error("The format painter plugin requires at least version 6.0.0 of TinyMCE.");const qe=me(pn.Retrival),$t=me({schemas:[],context:Hs.Unspecified});(Mt=>{(0,Mt.options.register)("formatpainter_ignored_formats",{processor:"string[]",default:"link,address,removeformat,formatpainter_removeformat".split(",")})})($e),(Mt=>{Mt.on("PreInit",()=>{ke(_s,(gn,yn)=>{Mt.formatter.get(yn)||Mt.formatter.register(yn,gn)})})})($e),ot($e,qe,$t),(Mt=>{Mt.ui.registry.addToggleButton("formatpainter",{active:!1,icon:"format-painter",tooltip:"Format painter",onAction:()=>Mt.execCommand("mceToggleFormatPainter"),onSetup:gn=>{const yn=Ot=>{gn.setActive(Ot.state)};return Mt.on("FormatPainterToggle",yn),()=>Mt.off("FormatPainterToggle",yn)}})})($e),((Mt,gn)=>{Mt.ui.registry.addToggleMenuItem("formatpainter",{active:!1,icon:"format-painter",text:"Format painter",onAction:()=>Mt.execCommand("mceToggleFormatPainter"),onSetup:yn=>{const Ot=_t=>{yn.setActive(_t.state)};return yn.setActive(gn.get()===pn.Application),Mt.on("FormatPainterToggle",Ot),()=>Mt.off("FormatPainterToggle",Ot)}})})($e,qe),(Mt=>{Mt.addShortcut("Meta+alt+C","",()=>{Mt.execCommand("mceRetrieveFormats")}),Mt.addShortcut("Meta+alt+V","",()=>{Mt.execCommand("mcePaintFormats")})})($e)})})();const Efe=["accordion","advlist","anchor","autolink","autosave","charmap","code","codesample","directionality","importcss","insertdatetime","link","lists","image","media","nonbreaking","pagebreak","preview","quickbars","save","searchreplace","table","visualblocks","fullscreen","visualchars","wordcount","pasteprocess","formatpainter"],a6e="undo redo h1 h2 h3 bold italic underline strikethrough subscript superscript fontsize fontFamily lineheight forecolor backcolor alignleft aligncenter alignright alignjustify pagebreak bullist numlist outdent indent blockquotelink unlink image code removeformat formatpainter fullscreen preview ",_fe="file edit insert table tools help",i6e={menu:{pagesize:{title:"页面大小",items:s6e},orientation:{title:"页面方向",items:r6e}},menubar:_fe+" pagesize orientation",pagesize:"A4",orientation:"portrait",plugins:[...Efe,"pagesize"]},l6e={license_key:"gpl",skin:!1,content_css:["css/content.css","css/reset.css"],promotion:!1,menubar:_fe,cleanup:!0,branding:!1,language:"zh_CN",plugins:Efe,toolbar:a6e,fontsize_formats:"12px 14px 16px 18px 20px 22px 24px 28px 32px 36px 48px 56px 72px",font_formats:"微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;",lineheight_formats:"0.5 0.8 1 1.2 1.5 1.75 2 2.5 3 4 5",elementpath:!1,paste_data_images:!0,object_resizing:!0,toolbar_mode:"wrap",images_upload_handler:o=>new Promise((s,i)=>{const u=new FormData;u.append("files",o.blob(),o.filename()),fetch(`${process.env.NODE_ENV==="development"?"/api":""}/ajax/uploaddoc`,{method:"POST",body:u}).then(m=>m.json()).then(m=>{m.status===1?s(m.file_url):i(`上传失败: ${m.message}`)}).catch(m=>{i(`上传出错: ${m.message}`)})})},c6e={name:"ProEditor",components:{Editor:FMe},props:{modelValue:{type:String,default:""},pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},hasPagesize:{type:Boolean,default:!1},placeholder:{type:String,default:"请输入内容"},width:{type:[Number,String],default:"100%"},height:{type:Number,default:400}},setup(o,{emit:s}){Em(o.modelValue);const i=d.ref(null),u=d.reactive({myInit:h(l6e),contentValue:o.modelValue,timeout:null});d.onMounted(()=>{K6.init({license_key:"gpl"}),K6.activeEditor.on("pagesizechange",b=>{(o==null?void 0:o.pagesize)!==b.size&&s("update:pagesize",b.size)}),K6.activeEditor.on("orientationchange",b=>{(o==null?void 0:o.orientation)!==b.orientation&&s("update:orientation",b.orientation)})}),d.watch(()=>u.contentValue,()=>{m(()=>{s("update:modelValue",u.contentValue)})}),d.watch(()=>o.orientation,()=>{var b,C;i.value&&((C=(b=i.value)==null?void 0:b.getEditor)==null||C.call(b).fire("orientationchange",{orientation:o.orientation}))}),d.watch(()=>o.pagesize,()=>{var b,C;i.value&&((C=(b=i.value)==null?void 0:b.getEditor)==null||C.call(b).fire("pagesizechange",{size:o.pagesize}))}),d.watch(()=>o.modelValue,b=>{!dB(b)&&b!==u.contentValue&&(u.contentValue=b)}),d.watch(()=>o.height,b=>{var C,S,_,N,O,R,I,W;i.value&&((W=(N=(_=(S=(C=i.value)==null?void 0:C.getEditor)==null?void 0:S.call(C))==null?void 0:_.dom)==null?void 0:N.setStyle)==null||W.call(N,(I=(R=(O=i.value)==null?void 0:O.getEditor)==null?void 0:R.call(O))==null?void 0:I.editorContainer,"height",b+"px"))});function m(b,C=400){u.timeout!==null&&clearTimeout(u.timeout),u.timeout=setTimeout(b,C)}function h(b){var O;o!=null&&o.height&&(b.height=o.height),o!=null&&o.width&&(b.width=o.width);const{placeholder:C,pagesize:S,orientation:_}=o,N=`${location==null?void 0:location.origin}/${dB(window==null?void 0:window.zyuiAssetsPath)?"assets/":window==null?void 0:window.zyuiAssetsPath}`;return b={...b,content_css:(O=b==null?void 0:b.content_css)==null?void 0:O.map(R=>R.includes("http")?R:`${N}${R}`),placeholder:C,...o.hasPagesize?{...i6e,pagesize:S,orientation:_}:{}},b}return{...d.toRefs(u),editorRef:i,customer:h,debounce:m}}},u6e={class:"my-tinymce"};function d6e(o,s,i,u,m,h){const b=d.resolveComponent("Editor");return d.openBlock(),d.createElementBlock("div",u6e,[d.createVNode(b,{modelValue:o.contentValue,"onUpdate:modelValue":s[0]||(s[0]=C=>o.contentValue=C),init:o.myInit,ref:"editorRef"},null,8,["modelValue","init"])])}const kfe=Ja(c6e,[["render",d6e]]),f6e={name:"ShadowDomWrap",setup(o,{emit:s,expose:i}){const u=d.ref(null),m=d.ref(),h=d.ref(!1),b=Ih(),C=_=>{if(_.target.closest(".context-menu")||!u.value)return;const O=u.value.contains(_.target);!O&&h.value?(h.value=!1,s("onBlur")):O&&!h.value&&(h.value=!0,s("onFocus"))},S=_=>{h.value=!0,s("onFocus"),_.stopPropagation()};return d.onMounted(()=>{var R,I,W,G,Q;m.value=(R=u.value)==null?void 0:R.attachShadow({mode:"open"}),document.addEventListener("click",C);const _=dB(window==null?void 0:window.zyuiAssetsPath)?"assets/":window==null?void 0:window.zyuiAssetsPath,N=document.createElement("link");N.rel="stylesheet",N.href=`${location==null?void 0:location.origin}/${_}css/index.min.css`,(I=m.value)==null||I.appendChild(N);const O=document.createElement("link");O.rel="stylesheet",O.href=`${location==null?void 0:location.origin}/${_}css/reset.css`,(W=m.value)==null||W.appendChild(O),(G=b==null?void 0:b.cssConfig)!=null&&G.links&&b.cssConfig.links.forEach(q=>{var L;const Z=document.createElement("link");Z.rel="stylesheet",Z.href=q,(L=m.value)==null||L.appendChild(Z)}),(Q=b==null?void 0:b.cssConfig)!=null&&Q.styles&&b.cssConfig.styles.forEach(q=>{var L;const Z=document.createElement("style");Z.textContent=q,(L=m.value)==null||L.appendChild(Z)})}),d.onUnmounted(()=>{document.removeEventListener("click",C)}),i({focus:()=>{h.value=!0},getInnerHTML:()=>{var _;return((_=m.value)==null?void 0:_.innerHTML)||""}}),{shadowHost:u,shadowRoot:m,handleClick:S}}};function m6e(o,s,i,u,m,h){return d.openBlock(),d.createElementBlock("div",{ref:"shadowHost",class:"shadow-host",onClick:s[0]||(s[0]=d.withModifiers((...b)=>u.handleClick&&u.handleClick(...b),["stop"]))},[u.shadowRoot?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:u.shadowRoot},[d.renderSlot(o.$slots,"default")],8,["to"])):d.createCommentVNode("",!0)],512)}const RB=Ja(f6e,[["render",m6e]]),p6e=["innerHTML"],Tfe=d.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=d.useModel(o,"modelValue");return(i,u)=>(d.openBlock(),d.createBlock(RB,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,p6e)]),_:1}))}}),Afe=Symbol("nodesUI"),ef=()=>{const o=d.inject(Afe);if(!o)throw new Error("NodesUI context not found");return o};function $U(o){if(!o||!o.ownerDocument)return null;const s=[];let i=o;for(;i&&i.nodeType===Node.ELEMENT_NODE;){let u=i.nodeName.toLowerCase();if(i.parentElement){const h=Array.from(i.parentElement.children).filter(b=>b.nodeName.toLowerCase()===i.nodeName.toLowerCase());if(h.length>1){const b=h.indexOf(i)+1;u+=`:nth-of-type(${b})`}}if(s.unshift(u),i=i.parentElement,i&&(i.nodeName.toLowerCase()==="body"||i.nodeName.toLowerCase()==="html"))break}return s.length?s.join(" > "):null}function g6e(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(`#${CSS.escape(o)}`)}catch(i){return console.error("nodePath query error:",i),null}}function h6e(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(o)}catch(i){return console.error("nodePath query error:",i),null}}const WA=o=>o!=null&&o.id?o==null?void 0:o.id:o.nodePath+(o!=null&&o.textNodeIndex?`-${o==null?void 0:o.textNodeIndex}`:"")+(o!=null&&o.startOffset?`-${o==null?void 0:o.startOffset}`:"")+(o!=null&&o.subNodeSort?`-${o==null?void 0:o.subNodeSort}`:""),Nfe=o=>{if(o.nodeType===Node.TEXT_NODE)return o;let s=null;for(let i=o.childNodes.length-1;i>=0;i--){const u=o.childNodes[i],m=Nfe(u);if(m){s=m;break}}return s},v6e=(o,s,i)=>{var b,C,S;const u=i==null?void 0:i.getRootNode(),m=(b=u==null?void 0:u.getSelection)==null?void 0:b.call(u),h=h6e(o.nodePath,i);if(m&&s&&h){const _=document.createRange(),N=(o==null?void 0:o.textNodeIndex)||0,O=h.childNodes[N]||h;let R,I;if(O.nodeType===Node.TEXT_NODE)R=O,I=Math.min(o.startOffset||0,((C=O.textContent)==null?void 0:C.length)||0);else{const W=Nfe(O);W?(R=W,I=((S=W.textContent)==null?void 0:S.length)||0):(R=O,I=0)}_.setStart(R,I),_.setEnd(R,I),_.insertNode(s),_.setStartAfter(s),_.collapse(!0),m.removeAllRanges(),m.addRange(_)}},b6e=(o,s)=>{s!=null&&s.id&&(o.id=s==null?void 0:s.id),(s==null?void 0:s.nodePath)!==void 0&&o.setAttribute("data-nodePath",s.nodePath),(s==null?void 0:s.textNodeIndex)!==void 0&&s.textNodeIndex>=0&&o.setAttribute("data-textNodeIndex",s.textNodeIndex.toString()),s.startOffset!==void 0&&s.startOffset>=0&&o.setAttribute("data-startOffset",s.startOffset.toString()),(s==null?void 0:s.subNodeSort)!==void 0&&s.subNodeSort>=0&&o.setAttribute("data-subNodeSort",s.subNodeSort.toString()),(s==null?void 0:s.groupKey)!==void 0&&o.setAttribute("data-groupKey",s.groupKey)},y6e=o=>{const s=o.closest("TD"),i=o.closest(".node-item");let u=null;if(i?u=i:s&&s.classList.contains("node-item-td")&&(u=s),!u)return null;const m=u||o;let h=m==null?void 0:m.getAttribute("data-nodePath");if(h||(h=$U(m)),(m==null?void 0:m.getAttribute("selectable"))==="false")return null;const b={element:m,nodePath:h},C=m==null?void 0:m.getAttribute("data-textNodeIndex");C&&(b.textNodeIndex=Number(C));const S=m==null?void 0:m.getAttribute("data-startOffset");S&&(b.startOffset=Number(S));const _=m==null?void 0:m.getAttribute("data-subNodeSort");_&&(b.subNodeSort=Number(_));const N=m==null?void 0:m.getAttribute("data-groupKey");N&&(b.groupKey=N);const O=m==null?void 0:m.getAttribute("id");return O&&(b.id=O),b},Ofe=o=>Nxe(o,s=>d.toValue(s.nodes).map(i=>({...i,color:s.color,activated:s==null?void 0:s.activated,dataGroupKey:s.id}))),Mz=(o,s)=>{const i=o.startsWith("#")?o.slice(1):o;let u,m,h;if(i.length===3)u=parseInt(i[0]+i[0],16),m=parseInt(i[1]+i[1],16),h=parseInt(i[2]+i[2],16);else if(i.length===6)u=parseInt(i.substring(0,2),16),m=parseInt(i.substring(2,4),16),h=parseInt(i.substring(4,6),16);else return console.warn("Invalid color format:",o),`rgba(0, 0, 0, ${s})`;return`rgba(${u}, ${m}, ${h}, ${s})`},w6e=o=>{var S;const{element:s}=o;if(!s)return null;if(!wne(o))return{showTextType:"input"};const i=s.closest("tr"),u=Array.from(i.parentElement.children).indexOf(i),m=Array.from(i.children).indexOf(s.closest("td")||s.closest("th")),h=s.closest("table"),b=((S=s.closest("body"))==null?void 0:S.querySelectorAll("table"))||[];return{showTextType:"cell",tableIndex:Array.from(b).indexOf(h)+1,colIndex:m,rowIndex:u}},C6e=(o,s)=>{var m,h;let i=1;const u=(m=o==null?void 0:o.map(b=>s==null?void 0:s.find(C=>(C==null?void 0:C.id)===(b==null?void 0:b.id))))==null?void 0:m.filter(Boolean);return(u==null?void 0:u.length)>0?(h=u==null?void 0:u.map(C=>{const S=w6e(C);return S?(S==null?void 0:S.showTextType)==="input"?{...C,...S,inputIndex:i++}:{...C,...S}:null}))==null?void 0:h.filter(Boolean):[]};function S6e(o){if(!o||o.length===0)return[];const s=[...o].sort((m,h)=>m.rowIndex!==h.rowIndex?m.rowIndex-h.rowIndex:m.colIndex-h.colIndex),i=[],u=new Set;for(const m of s){if(u.has(m))continue;const h=[];let b=0,C=0;for(let S=m.colIndex;s.find(N=>N.rowIndex===m.rowIndex&&N.colIndex===S&&!u.has(N));S++)C++;if(C!==0){b=C;for(let S=m.rowIndex;;S++){let _=0;const N=[];for(let O=m.colIndex;O<m.colIndex+b;O++){const R=s.find(I=>I.rowIndex===S&&I.colIndex===O&&!u.has(I));if(R)_++,N.push(R);else break}if(_===b)h.push(...N);else break}h.length>0&&(i.push([...h]),h.forEach(S=>u.add(S)))}}return i}function x6e(o){if(!o||o.length===0)return{min:null,max:null};let s=o[0],i=o[0];for(const u of o)(u.colIndex<s.colIndex||u.colIndex===s.colIndex&&u.rowIndex<s.rowIndex)&&(s=u),(u.colIndex>i.colIndex||u.colIndex===i.colIndex&&u.rowIndex>i.rowIndex)&&(i=u);return{min:s,max:i}}const $fe=(o,s)=>{var _;const i=C6e(o,s||[]),u=[],m=[];(_=d.toValue(i))==null||_.forEach(N=>{(N==null?void 0:N.showTextType)==="input"?u.push(N):m.push(N)});const h=Dxe(m,"tableIndex"),b=Object.entries(h).map(([N,O])=>({tableIndex:Number(N),nodes:O})),C=pde(b==null?void 0:b.map(N=>S6e(N==null?void 0:N.nodes))),S=(C==null?void 0:C.map(N=>x6e(N)))||[];return[...u,...S]},r4=o=>{function s(i){let u="";for(;i>=0;)u=String.fromCharCode(65+i%26)+u,i=Math.floor(i/26)-1;return u}return(o==null?void 0:o.colIndex)>=0&&(o==null?void 0:o.rowIndex)>=0?`${s(o==null?void 0:o.colIndex)}${o==null?void 0:o.rowIndex}`:""},E6e=(o,s)=>{const i=$fe(o,s||[]),u=[];return i==null||i.forEach(m=>{var h,b;(m==null?void 0:m.showTextType)==="input"?u.push(`填写${m==null?void 0:m.inputIndex}`):u.push(((h=m==null?void 0:m.min)==null?void 0:h.id)===((b=m==null?void 0:m.max)==null?void 0:b.id)?r4(m==null?void 0:m.min):`${r4(m==null?void 0:m.min)}:${r4(m==null?void 0:m.max)}`)}),u==null?void 0:u.join(",")},wne=o=>{if(!(o!=null&&o.nodePath))return!1;const s=o.nodePath.split(" > "),i=s[s.length-1];return(i==null?void 0:i.startsWith("td"))&&!(o!=null&&o.startOffset)},_6e=o=>{var i;return(i=ta(o))==null?void 0:i.map(u=>(u==null||delete u.element,u))},k6e=o=>{o.querySelectorAll("p").forEach(i=>{var u;i.classList.contains("empty")&&i.classList.remove("empty"),((u=i.innerText)==null?void 0:u.trim())===""&&i.classList.add("empty")})},T6e={key:0,class:"td-node"},A6e={key:1},N6e=d.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,i=d.computed(()=>{var m,h,b,C,S;return(h=(m=s==null?void 0:s.node)==null?void 0:m.props)!=null&&h.alias?(C=(b=s==null?void 0:s.node)==null?void 0:b.props)==null?void 0:C.alias:(S=s==null?void 0:s.node)==null?void 0:S.label}),u=d.computed(()=>{var m,h;return((h=(m=s==null?void 0:s.node)==null?void 0:m.element)==null?void 0:h.tagName)==="TD"});return(m,h)=>u.value?(d.openBlock(),d.createElementBlock("span",T6e,d.toDisplayString(i.value),1)):(d.openBlock(),d.createElementBlock("span",A6e,d.toDisplayString(i.value),1))}}),Dfe=Symbol("nodesEditor"),j0=()=>{const o=d.inject(Dfe);if(!o)throw new Error("NodesEditor context not found");return o},DU=d.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,{currentNodes:i}=ef(),{nodes:u,renderType:m,disabledNodes:h}=j0(),b=d.computed(()=>{var O;return(O=s.node)!=null&&O.id?u.value.some(R=>R.id===s.node.id):!1}),C=d.computed(()=>{var O;if(!((O=s.node)!=null&&O.element))return!1;try{return s.node.element.parentNode!==null}catch(R){return console.warn("Element validation failed:",R),!1}}),S=d.computed(()=>{var I,W;const O=(I=h==null?void 0:h.value)==null?void 0:I.some(G=>{var Q;return(G==null?void 0:G.id)===((Q=s==null?void 0:s.node)==null?void 0:Q.id)}),R=(W=d.toValue(i))==null?void 0:W.find(G=>{var Q;return(G==null?void 0:G.id)===((Q=s==null?void 0:s.node)==null?void 0:Q.id)});return{...s==null?void 0:s.node,...R,disabled:O}}),_=O=>{var I;let R="";if(d.toValue(O==null?void 0:O.activated)&&(R="normal"),O!=null&&O.disabled&&(R="disabled"),N(),(I=s==null?void 0:s.node)!=null&&I.element)switch(R){case"normal":s.node.element.style.setProperty("--node-color",(O==null?void 0:O.color)||"#409eff"),s.node.element.style.setProperty("--node-bg-color",Mz((O==null?void 0:O.color)||"#409eff",.1)),s.node.element.setAttribute("data-dataGroupKey",O==null?void 0:O.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("activated");break;case"disabled":s.node.element.style.setProperty("--node-color",(O==null?void 0:O.color)||"#F56C6C"),s.node.element.style.setProperty("--node-bg-color",Mz((O==null?void 0:O.color)||"#F56C6C",.1)),s.node.element.setAttribute("data-dataGroupKey",O==null?void 0:O.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("disabled");break;default:N();break}},N=()=>{var O,R,I,W,G;(O=s==null?void 0:s.node)!=null&&O.element&&((R=s.node.element)==null||R.removeAttribute("data-dataGroupKey"),(I=s.node.element)==null||I.removeAttribute("selectable"),(W=s.node.element)==null||W.classList.remove("activated"),(G=s.node.element)==null||G.classList.remove("disabled"))};return d.watch(()=>S,()=>{const O=d.toValue(S);O!=null&&O.id?_(O):N()},{immediate:!0,deep:!0}),(O,R)=>{var I;return(I=O.node)!=null&&I.element&&C.value&&b.value?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:O.node.element},[d.createElementVNode("div",{class:d.normalizeClass(["node-item-render",`node-item-${d.unref(m)}`])},[d.renderSlot(O.$slots,"default",{node:O.node},()=>[d.createVNode(N6e,{node:O.node},null,8,["node"])])],2)],8,["to"])):d.createCommentVNode("",!0)}}});function O6e(){const o=d.ref(!1),s=u=>{u.key==="Control"&&(o.value=!0)},i=u=>{u.key==="Control"&&(o.value=!1)};return d.onMounted(()=>{window.addEventListener("keydown",s),window.addEventListener("keyup",i)}),d.onUnmounted(()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",i)}),o}function Mfe(){const{selectedNodes:o,setSelectedNodes:s,containerRef:i}=ef(),{editorId:u,nodes:m,disabledNodes:h}=j0(),b=d.ref(!1),C=d.ref({x:0,y:0}),S=d.ref({x:0,y:0}),_=d.ref({left:0,top:0,width:0,height:0}),N=d.ref(null),O=Y=>{const ke=Y.closest(".node-item-td")||Y.closest(".node-item");if(ke!==null){let et=[];if(ke.classList.contains("node-selected"))return;const je=ke.getAttribute("id");if(je&&m.value){const Ce=m.value.find(ce=>ce.id===je);Ce&&(et=[Ce])}et=L(et),s(et)}},R=Y=>{var Ce;if(Y.button===2&&O(Y==null?void 0:Y.target),Y.button!==0||(b.value=!0,!N.value))return;const ke=(Ce=i==null?void 0:i.value)==null?void 0:Ce.getBoundingClientRect();if(!ke)return;const et=Y.clientX-(ke==null?void 0:ke.left),je=Y.clientY-(ke==null?void 0:ke.top);C.value={x:et,y:je},S.value={x:et,y:je},q(Y),pe(),N.value.style.display="block",window.addEventListener("mousemove",I),window.addEventListener("wheel",W),window.addEventListener("mouseup",G)},I=dte(Y=>{var ke;if(b.value){const et=(ke=i==null?void 0:i.value)==null?void 0:ke.getBoundingClientRect();if(!et)return;const je=Y.clientX-(et==null?void 0:et.left),Ce=Y.clientY-(et==null?void 0:et.top);S.value={x:je,y:Ce},pe()}},16),W=dte(Y=>{b.value&&setTimeout(()=>{var Ce;const ke=(Ce=i==null?void 0:i.value)==null?void 0:Ce.getBoundingClientRect();if(!ke)return;const et=Y.clientX-(ke==null?void 0:ke.left),je=Y.clientY-(ke==null?void 0:ke.top);S.value={x:et,y:je},pe()},0)},16),G=Y=>{Y.button===0&&(b.value=!1,N.value&&(pe(),N.value.style.display="none",window.removeEventListener("mousemove",I),window.removeEventListener("wheel",W),window.removeEventListener("mouseup",G)))},Q=O6e(),q=Y=>{var et,je;let ke=[];if(Y.button===0&&(Y!=null&&Y.target)){const Ce=((et=Y==null?void 0:Y.target)==null?void 0:et.closest(".node-item-td"))||((je=Y==null?void 0:Y.target)==null?void 0:je.closest(".node-item"));if(Ce!==null){const ce=Ce.getAttribute("id");if(ce&&m.value){const Dt=m.value.find(me=>me.id===ce);Dt&&(Q.value?o.value.some(me=>WA(me)===WA(Dt))?ke=o.value.filter(be=>WA(be)!==WA(Dt)):ke=[...o.value,Dt]:Dt&&(ke=[Dt]))}}ke=L(ke),s(ke)}},Z=()=>{var Dt;if(!i.value||!(_.value.width>3||_.value.height>3))return;let Y=[];const ke=(Dt=i==null?void 0:i.value)==null?void 0:Dt.getBoundingClientRect(),et=_.value.left+(ke==null?void 0:ke.left),je=_.value.top+(ke==null?void 0:ke.top),Ce={left:_.value.left+(ke==null?void 0:ke.left),right:et+_.value.width,top:_.value.top+(ke==null?void 0:ke.top),bottom:je+_.value.height};if(i.value.querySelectorAll("*").forEach(me=>{const be=me.getBoundingClientRect();if(!Ce)return;const $={left:be.left,right:be.right,top:be.top,bottom:be.bottom};if($.right>Ce.left&&$.left<Ce.right&&$.bottom>Ce.top&&$.top<Ce.bottom){const _e=me.getAttribute("id");if(_e&&m.value){const le=m.value.find(He=>He.id===_e);le&&(Y=[...Y,le])}}}),Y=L(Y),Q.value){const me=new Set(o.value.map($=>WA($))),be=Y.filter($=>!me.has(WA($)));s([...o.value,...be])}else s(Y)},L=Y=>{let ke=[];if(Y.length>0&&(ke=[...Y]),h&&h.value&&h.value.length>0){const et=new Set(h.value.map(je=>je.id).filter(Boolean));ke=ke.filter(je=>je.id?!et.has(je.id):!0)}return ke},pe=dte(()=>{if(!N.value||!i.value)return;const{x:Y,y:ke}=C.value,{x:et,y:je}=S.value,Ce=Math.min(Y,et),ce=Math.min(ke,je),Dt=Math.abs(Y-et),me=Math.abs(ke-je);_.value={left:Ce,top:ce,width:Dt,height:me}},16),Ke=Y=>{if(!N.value)return;const{left:ke,top:et,width:je,height:Ce}=d.toValue(Y);N.value.style.left=`${ke}px`,N.value.style.top=`${et}px`,N.value.style.width=`${je}px`,N.value.style.height=`${Ce}px`},Be=()=>{if(!i.value)return;i.value.addEventListener("mousedown",R);const Y=document.getElementById(`select_area_${u}`);if(Y){N.value=Y;return}const ke=document.createElement("div");ke.id=`select_area_${u}`,ke.style.position="absolute",ke.style.border="1px solid #1677ff",ke.style.backgroundColor="rgba(22, 119, 255, 0.05)",ke.style.pointerEvents="none",ke.style.display="none",i.value.appendChild(ke),N.value=ke};return d.watch(_,(Y,ke)=>{na(Y,ke)||(Ke(Y),b.value&&Z())},{deep:!0}),d.watch(()=>i.value,Y=>{d.toValue(Y)&&Be()},{immediate:!0}),d.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",R)}),{isSelecting:b,selectionBox:N}}function Boe(){const{selectedNodes:o,containerRef:s}=ef(),i=()=>{var m;(m=d.toValue(s))==null||m.querySelectorAll(".node-selected").forEach(h=>{h.classList.remove("node-selected")})},u=m=>{m.forEach(h=>{h.classList.add("node-selected")})};d.watch(()=>o,()=>{i(),setTimeout(()=>{var h,b;const m=(b=(h=d.toValue(o))==null?void 0:h.map(C=>{var S;return(S=s.value)==null?void 0:S.querySelector(`[id="${C.id}"]`)}))==null?void 0:b.filter(Boolean);u(m)},0)},{deep:!0})}const IB=()=>{const{nodes:o,updateNodes:s}=j0();return{nodes:o,addNode:C=>{const _=(Array.isArray(C)?C:[C]).map(O=>({...O,id:O.id||m2()})),N=[...o.value,..._];s(N)},removeNode:async C=>{const S=Array.isArray(C)?C:[C],_=o.value.filter(N=>!S.includes(N==null?void 0:N.id));s(_)},editNodes:C=>{const S=Array.isArray(C)?C:[C],_=m2(),N=S.map(R=>{const I={...R};let W=R==null?void 0:R.id;return W||(W=m2(),I.id=W),I!=null&&I.groupKey||(I.groupKey=_),I}),O=[...o.value];N.forEach(R=>{const I=O.findIndex(W=>W.id===R.id);I!==-1?O[I]=R:O.push(R)}),s(O)},insertNodeAt:(C,S)=>{const _=[...o.value];_.splice(S,0,C),s(_)},moveNode:(C,S)=>{const _=[...o.value],[N]=_.splice(C,1);_.splice(S,0,N),s(_)},updateNodes:s}};function $6e(){const{removeNode:o}=IB(),{containerRef:s}=ef(),i=d.ref(null),u=h=>{var G,Q;if(h.target instanceof Element&&(h.target.closest(".node-item")||h.target.closest(".node-item-td")||h.target.closest(".disabeld-edit")))return;const b=h.target;if(b===s.value)return;const S=((G=s.value)==null?void 0:G.getRootNode()).getSelection(),_=(Q=s.value)==null?void 0:Q.querySelectorAll('[contenteditable="true"]');_==null||_.forEach(q=>{q.setAttribute("contenteditable","false")});const N=b.textContent||"",O=b.innerHTML||"";i.value=b,b.setAttribute("contenteditable","true"),b.focus();const R=new MutationObserver(()=>{b.textContent!==N&&(b.innerHTML=O)});R.observe(b,{characterData:!0,childList:!0,subtree:!0});const I=q=>{q.preventDefault()};b.addEventListener("input",I),b.addEventListener("paste",I),b.addEventListener("drop",I),b.addEventListener("keydown",q=>{var Z,L,pe,Ke;if(((Z=document.activeElement)==null?void 0:Z.shadowRoot)===((L=s.value)==null?void 0:L.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(q.key)){if(q.key==="Backspace"||q.key==="Delete"){const Be=S==null?void 0:S.getRangeAt(0);if(b.blur(),(Be==null?void 0:Be.startOffset)===0){const Y=Be.startContainer;if(Y.nodeType===Node.TEXT_NODE){const ke=Y.previousSibling;if(ke&&ke.nodeType===Node.ELEMENT_NODE&&ke.classList.contains("node-item")){const et=ke.getAttribute("id");et&&o(et),(pe=Y.parentElement)==null||pe.normalize();return}}else if(Y.nodeType===Node.ELEMENT_NODE){const ke=Y.previousSibling;if(ke&&ke.nodeType===Node.ELEMENT_NODE&&ke.classList.contains("node-item")){const et=ke.getAttribute("id");et&&o(et),(Ke=Y.parentElement)==null||Ke.normalize();return}}}}q.preventDefault()}});const W=()=>{b==null||b.normalize(),R.disconnect(),b.removeEventListener("input",I),b.removeEventListener("paste",I),b.removeEventListener("drop",I),b.removeEventListener("blur",W),b.setAttribute("contenteditable","false")};b.addEventListener("blur",W)},m=()=>{var h;(h=s.value)==null||h.addEventListener("dblclick",u)};return d.watch(s,h=>{h&&m()},{immediate:!0}),d.onUnmounted(()=>{var h;(h=s.value)==null||h.removeEventListener("dblclick",u)}),{}}function D6e(){const{containerRef:o,focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}=ef(),h=_=>{var O;const N=_==null?void 0:_.getSelection();try{if((O=s.value)==null||O.normalize(),N){const I=function(){var ke,et;const G=_.getSelection();if(G.rangeCount===0)return null;const Q=G.getRangeAt(0),q=Q.startContainer;let Z=0,L=-1,pe=0,Ke=[];const Be=q.nodeType===Node.TEXT_NODE?q.parentNode:q;s.value=Be;const Y=Array.from(Be.childNodes);if(q.nodeType===Node.TEXT_NODE){Z=Q.startOffset,L=-1;for(let be=0;be<Y.length;be++)if(Y[be]===q){L=be;break}Ke=Y.slice(0,L);const je=[];let Ce=!1;for(let be=0;be<Ke.length;be++){const $=Ke[be];if((ke=$==null?void 0:$.classList)!=null&&ke.contains("node-item")){Ce=!0;continue}else if($.nodeType===Node.TEXT_NODE){const _e=je==null?void 0:je[je.length-1];Ce&&typeof _e=="string"?je[je.length-1]=_e+($==null?void 0:$.data):je.push($==null?void 0:$.data),Ce=!1}else je.push($),Ce=!1}const ce=Ke==null?void 0:Ke[Ke.length-1],Dt=je==null?void 0:je[je.length-1];pe=je==null?void 0:je.filter(be=>{var $;return!(($=be==null?void 0:be.classList)!=null&&$.contains("node-item"))}).length,(et=ce==null?void 0:ce.classList)!=null&&et.contains("node-item")&&typeof Dt=="string"&&pe--;const me=je==null?void 0:je[je.length-1];typeof me=="string"&&(Z+=(me==null?void 0:me.length)||0)}else{const je=Y==null?void 0:Y.filter(Ce=>{var ce;return(ce=Ce==null?void 0:Ce.classList)==null?void 0:ce.contains("node-item")}).length;Z=Q.startOffset-je}return{currentIndex:Math.max(pe,0),previousElements:Ke,startOffset:Math.max(Z,0)}}();return u.value=(I==null?void 0:I.currentIndex)||0,(I==null?void 0:I.startOffset)||0}}catch(R){console.error(R)}return 0},b=()=>{var N;const _=(N=o.value)==null?void 0:N.getRootNode();i.value=h(_)},C=_=>{var I;const N=_.target;if(N===o.value)return;s.value=N;const O=(I=o.value)==null?void 0:I.getRootNode();i.value=h(O),N.addEventListener("click",b),N.addEventListener("keyup",W=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(W.key)&&b()});const R=()=>{N.removeEventListener("click",b),N.removeEventListener("keyup",b),N.removeEventListener("blur",R),setTimeout(()=>{s.value=null,u.value=0,i.value=-1},300)};N.addEventListener("blur",R)},S=()=>{var _;(_=o.value)==null||_.addEventListener("focus",C,!0)};return d.watch(o,_=>{_&&S()},{immediate:!0}),d.onUnmounted(()=>{var _;(_=o.value)==null||_.removeEventListener("focus",C,!0)}),{focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}}function M6e(o){const s=o.value===null?[]:[JSON.parse(JSON.stringify(o.value))],i=d.ref(s),u=d.ref(0),m=d.ref(!1),h=d.computed(()=>i.value[u.value]),b=()=>{u.value>0&&(m.value=!0,u.value--,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},C=()=>{u.value<i.value.length-1&&(m.value=!0,u.value++,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},S=_=>{(_.ctrlKey||_.metaKey)&&_.key==="z"?(_.preventDefault(),b()):(_.ctrlKey||_.metaKey)&&_.key==="y"&&(_.preventDefault(),C())};return d.onMounted(()=>{window.addEventListener("keydown",S)}),d.onUnmounted(()=>{window.removeEventListener("keydown",S)}),d.watch(o,d2(_=>{_&&!m.value&&(i.value.splice(u.value+1),i.value.push(JSON.parse(JSON.stringify(_))),u.value++),m.value&&(m.value=!1)},300),{deep:!0}),{current:h,undo:b,redo:C}}var Bfe={exports:{}};(function(o,s){(function(i,u){o.exports=u()})(vE,function(){var i=1e3,u=6e4,m=36e5,h="millisecond",b="second",C="minute",S="hour",_="day",N="week",O="month",R="quarter",I="year",W="date",G="Invalid Date",Q=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,q=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,Z={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(me){var be=["th","st","nd","rd"],$=me%100;return"["+me+(be[($-20)%10]||be[$]||be[0])+"]"}},L=function(me,be,$){var _e=String(me);return!_e||_e.length>=be?me:""+Array(be+1-_e.length).join($)+me},pe={s:L,z:function(me){var be=-me.utcOffset(),$=Math.abs(be),_e=Math.floor($/60),le=$%60;return(be<=0?"+":"-")+L(_e,2,"0")+":"+L(le,2,"0")},m:function me(be,$){if(be.date()<$.date())return-me($,be);var _e=12*($.year()-be.year())+($.month()-be.month()),le=be.clone().add(_e,O),He=$-le<0,Ge=be.clone().add(_e+(He?-1:1),O);return+(-(_e+($-le)/(He?le-Ge:Ge-le))||0)},a:function(me){return me<0?Math.ceil(me)||0:Math.floor(me)},p:function(me){return{M:O,y:I,w:N,d:_,D:W,h:S,m:C,s:b,ms:h,Q:R}[me]||String(me||"").toLowerCase().replace(/s$/,"")},u:function(me){return me===void 0}},Ke="en",Be={};Be[Ke]=Z;var Y="$isDayjsObject",ke=function(me){return me instanceof ce||!(!me||!me[Y])},et=function me(be,$,_e){var le;if(!be)return Ke;if(typeof be=="string"){var He=be.toLowerCase();Be[He]&&(le=He),$&&(Be[He]=$,le=He);var Ge=be.split("-");if(!le&&Ge.length>1)return me(Ge[0])}else{var fe=be.name;Be[fe]=be,le=fe}return!_e&&le&&(Ke=le),le||!_e&&Ke},je=function(me,be){if(ke(me))return me.clone();var $=typeof be=="object"?be:{};return $.date=me,$.args=arguments,new ce($)},Ce=pe;Ce.l=et,Ce.i=ke,Ce.w=function(me,be){return je(me,{locale:be.$L,utc:be.$u,x:be.$x,$offset:be.$offset})};var ce=function(){function me($){this.$L=et($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[Y]=!0}var be=me.prototype;return be.parse=function($){this.$d=function(_e){var le=_e.date,He=_e.utc;if(le===null)return new Date(NaN);if(Ce.u(le))return new Date;if(le instanceof Date)return new Date(le);if(typeof le=="string"&&!/Z$/i.test(le)){var Ge=le.match(Q);if(Ge){var fe=Ge[2]-1||0,Ue=(Ge[7]||"0").substring(0,3);return He?new Date(Date.UTC(Ge[1],fe,Ge[3]||1,Ge[4]||0,Ge[5]||0,Ge[6]||0,Ue)):new Date(Ge[1],fe,Ge[3]||1,Ge[4]||0,Ge[5]||0,Ge[6]||0,Ue)}}return new Date(le)}($),this.init()},be.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},be.$utils=function(){return Ce},be.isValid=function(){return this.$d.toString()!==G},be.isSame=function($,_e){var le=je($);return this.startOf(_e)<=le&&le<=this.endOf(_e)},be.isAfter=function($,_e){return je($)<this.startOf(_e)},be.isBefore=function($,_e){return this.endOf(_e)<je($)},be.$g=function($,_e,le){return Ce.u($)?this[_e]:this.set(le,$)},be.unix=function(){return Math.floor(this.valueOf()/1e3)},be.valueOf=function(){return this.$d.getTime()},be.startOf=function($,_e){var le=this,He=!!Ce.u(_e)||_e,Ge=Ce.p($),fe=function(mn,gt){var St=Ce.w(le.$u?Date.UTC(le.$y,gt,mn):new Date(le.$y,gt,mn),le);return He?St:St.endOf(_)},Ue=function(mn,gt){return Ce.w(le.toDate()[mn].apply(le.toDate("s"),(He?[0,0,0,0]:[23,59,59,999]).slice(gt)),le)},yt=this.$W,Ve=this.$M,pt=this.$D,Ie="set"+(this.$u?"UTC":"");switch(Ge){case I:return He?fe(1,0):fe(31,11);case O:return He?fe(1,Ve):fe(0,Ve+1);case N:var mt=this.$locale().weekStart||0,oe=(yt<mt?yt+7:yt)-mt;return fe(He?pt-oe:pt+(6-oe),Ve);case _:case W:return Ue(Ie+"Hours",0);case S:return Ue(Ie+"Minutes",1);case C:return Ue(Ie+"Seconds",2);case b:return Ue(Ie+"Milliseconds",3);default:return this.clone()}},be.endOf=function($){return this.startOf($,!1)},be.$set=function($,_e){var le,He=Ce.p($),Ge="set"+(this.$u?"UTC":""),fe=(le={},le[_]=Ge+"Date",le[W]=Ge+"Date",le[O]=Ge+"Month",le[I]=Ge+"FullYear",le[S]=Ge+"Hours",le[C]=Ge+"Minutes",le[b]=Ge+"Seconds",le[h]=Ge+"Milliseconds",le)[He],Ue=He===_?this.$D+(_e-this.$W):_e;if(He===O||He===I){var yt=this.clone().set(W,1);yt.$d[fe](Ue),yt.init(),this.$d=yt.set(W,Math.min(this.$D,yt.daysInMonth())).$d}else fe&&this.$d[fe](Ue);return this.init(),this},be.set=function($,_e){return this.clone().$set($,_e)},be.get=function($){return this[Ce.p($)]()},be.add=function($,_e){var le,He=this;$=Number($);var Ge=Ce.p(_e),fe=function(Ve){var pt=je(He);return Ce.w(pt.date(pt.date()+Math.round(Ve*$)),He)};if(Ge===O)return this.set(O,this.$M+$);if(Ge===I)return this.set(I,this.$y+$);if(Ge===_)return fe(1);if(Ge===N)return fe(7);var Ue=(le={},le[C]=u,le[S]=m,le[b]=i,le)[Ge]||1,yt=this.$d.getTime()+$*Ue;return Ce.w(yt,this)},be.subtract=function($,_e){return this.add(-1*$,_e)},be.format=function($){var _e=this,le=this.$locale();if(!this.isValid())return le.invalidDate||G;var He=$||"YYYY-MM-DDTHH:mm:ssZ",Ge=Ce.z(this),fe=this.$H,Ue=this.$m,yt=this.$M,Ve=le.weekdays,pt=le.months,Ie=le.meridiem,mt=function(gt,St,Wt,Et){return gt&&(gt[St]||gt(_e,He))||Wt[St].slice(0,Et)},oe=function(gt){return Ce.s(fe%12||12,gt,"0")},mn=Ie||function(gt,St,Wt){var Et=gt<12?"AM":"PM";return Wt?Et.toLowerCase():Et};return He.replace(q,function(gt,St){return St||function(Wt){switch(Wt){case"YY":return String(_e.$y).slice(-2);case"YYYY":return Ce.s(_e.$y,4,"0");case"M":return yt+1;case"MM":return Ce.s(yt+1,2,"0");case"MMM":return mt(le.monthsShort,yt,pt,3);case"MMMM":return mt(pt,yt);case"D":return _e.$D;case"DD":return Ce.s(_e.$D,2,"0");case"d":return String(_e.$W);case"dd":return mt(le.weekdaysMin,_e.$W,Ve,2);case"ddd":return mt(le.weekdaysShort,_e.$W,Ve,3);case"dddd":return Ve[_e.$W];case"H":return String(fe);case"HH":return Ce.s(fe,2,"0");case"h":return oe(1);case"hh":return oe(2);case"a":return mn(fe,Ue,!0);case"A":return mn(fe,Ue,!1);case"m":return String(Ue);case"mm":return Ce.s(Ue,2,"0");case"s":return String(_e.$s);case"ss":return Ce.s(_e.$s,2,"0");case"SSS":return Ce.s(_e.$ms,3,"0");case"Z":return Ge}return null}(gt)||Ge.replace(":","")})},be.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},be.diff=function($,_e,le){var He,Ge=this,fe=Ce.p(_e),Ue=je($),yt=(Ue.utcOffset()-this.utcOffset())*u,Ve=this-Ue,pt=function(){return Ce.m(Ge,Ue)};switch(fe){case I:He=pt()/12;break;case O:He=pt();break;case R:He=pt()/3;break;case N:He=(Ve-yt)/6048e5;break;case _:He=(Ve-yt)/864e5;break;case S:He=Ve/m;break;case C:He=Ve/u;break;case b:He=Ve/i;break;default:He=Ve}return le?He:Ce.a(He)},be.daysInMonth=function(){return this.endOf(O).$D},be.$locale=function(){return Be[this.$L]},be.locale=function($,_e){if(!$)return this.$L;var le=this.clone(),He=et($,_e,!0);return He&&(le.$L=He),le},be.clone=function(){return Ce.w(this.$d,this)},be.toDate=function(){return new Date(this.valueOf())},be.toJSON=function(){return this.isValid()?this.toISOString():null},be.toISOString=function(){return this.$d.toISOString()},be.toString=function(){return this.$d.toUTCString()},me}(),Dt=ce.prototype;return je.prototype=Dt,[["$ms",h],["$s",b],["$m",C],["$H",S],["$W",_],["$M",O],["$y",I],["$D",W]].forEach(function(me){Dt[me[1]]=function(be){return this.$g(be,me[0],me[1])}}),je.extend=function(me,be){return me.$i||(me(be,ce,je),me.$i=!0),je},je.locale=et,je.isDayjs=ke,je.unix=function(me){return je(1e3*me)},je.en=Be[Ke],je.Ls=Be,je.p={},je})})(Bfe);var B6e=Bfe.exports;const Rfe=S4(B6e);function R6e(){const{modelValue:o,inputTypes:s}=j0(),{nodes:i,updateNodes:u}=IB(),m=C=>{if(!C||typeof C!="string")return[];const _=new DOMParser().parseFromString(C,"text/html");return Array.from(_.querySelectorAll("td")).filter(R=>{var I;return!((I=R.textContent)!=null&&I.trim())})},h=async C=>{var N,O;const S=await((O=(N=s==null?void 0:s.find(R=>{var I;return((I=R.value)==null?void 0:I.toLowerCase())==="text"}))==null?void 0:N.getDefaultProps)==null?void 0:O.call(N))||{},_=C.map(R=>{let I=R==null?void 0:R.id;return I||(I=m2()),{id:I,nodeType:"Text",label:"文本",props:{...S},...R}});return u(_),_},b=()=>{var W;const C=m(d.toValue(o)),S=Rfe().valueOf(),_=d.toValue(i),N=_.filter(G=>wne(G)),O=_.filter(G=>!wne(G)),I=[...(W=C.map(G=>({nodePath:$U(G),startOffset:0,subNodeSort:0,insertTime:S})))==null?void 0:W.map(G=>{const Q=N==null?void 0:N.find(q=>q.nodePath===G.nodePath&&!(q!=null&&q.startOffset));return{...G,...Q}}),...O];return h(I)};return d.onMounted(()=>{b()}),b}function I6e(){const{selectedNodes:o,containerRef:s,isFocused:i}=ef(),{removeNode:u}=IB(),m=d.ref(null),h=S=>{if(i.value&&(S.key==="Delete"||S.key==="Backspace")){const _=[];d.toValue(o).length>0&&(d.toValue(o).forEach(N=>{var O,R,I;if(((O=N==null?void 0:N.element)==null?void 0:O.tagName)==="TD"){const W=(R=N==null?void 0:N.element)==null?void 0:R.getAttribute("id");W&&_.push(W)}else{const W=(I=N==null?void 0:N.element)==null?void 0:I.getAttribute("id");W&&_.push(W)}}),o.value=[],(_==null?void 0:_.length)>0&&u(_))}},b=S=>{var _;(_=d.toValue(s))!=null&&_.contains(S.target)?m.value=S.target:m.value=null},C=()=>{s.value&&(window.addEventListener("keydown",h),s.value.addEventListener("mousedown",b))};d.watch(()=>s.value,S=>{d.toValue(S)&&C()},{immediate:!0}),d.onUnmounted(()=>{s.value&&(window.removeEventListener("keydown",h),s.value.removeEventListener("mousedown",b))})}function MU(){const{nodes:o}=j0(),{containerRef:s,renderNodes:i,uiReady:u}=ef(),{removeNode:m}=IB(),h=()=>{var C;i.value=[...((C=o.value)==null?void 0:C.map(S=>{var N;const _=(N=s.value)==null?void 0:N.querySelector(`[id="${S.id}"]`);return{...S,element:_}}))||[]].filter(S=>!!(S!=null&&S.element))},b=d2(C=>{d.nextTick(()=>{var S;m((S=C==null?void 0:C.map(_=>_==null?void 0:_.id))==null?void 0:S.filter(Boolean))})},500);d.watch(()=>[i.value,u],()=>{if(d.toValue(u)){const C=Txe(o.value,i.value,"id");b(C)}},{immediate:!0,deep:!0}),d.watch(()=>[o.value,s.value,u],()=>{d.toValue(u)&&d.nextTick(()=>{h()})},{immediate:!0,deep:!0})}const Cne=d.ref({});function BU(o){return d.computed(()=>{var s;return(s=Cne.value)==null?void 0:s[o]})}function Roe(){const o=j0(),s=ef();d.onMounted(()=>{const{editorId:i}=o;i&&(Cne.value[i]=d.ref({...o,...s}))}),d.onUnmounted(()=>{const{editorId:i}=o;i&&(Cne.value[i]=null)})}const P6e=d.defineComponent({__name:"NodesEditUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"edit"}},setup(o,{expose:s}){const{nodes:i}=j0(),{uiReady:u,renderNodes:m}=ef();Roe(),M6e(i),Mfe(),Boe(),I6e(),D6e(),$6e();const h=R6e();return MU(),s({initNodes:h}),(b,C)=>d.unref(u)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(m),S=>(d.openBlock(),d.createBlock(DU,{key:S==null?void 0:S.id,node:S},{default:d.withCtx(_=>[d.renderSlot(b.$slots,"nodeItem",{node:_==null?void 0:_.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),lle=d.defineComponent({__name:"NodesPreviewUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return Roe(),MU(),Boe(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock(DU,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),F6e=d.defineComponent({__name:"NodesEnterUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return MU(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock(DU,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),L6e=d.defineComponent({__name:"NodesSelectUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"select"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return Roe(),Mfe(),Boe(),MU(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock(DU,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),l2=d.ref({});function Ife(o){return d.computed(()=>(l2.value[o]||(l2.value[o]=d.ref([])),l2.value[o]))}function V6e(o){const{editorId:s}=o,i=d.ref(!1);d.onMounted(()=>{l2.value[s]||(l2.value[s]=d.ref([]));const u=l2.value[s].findIndex(m=>m.id===o.id);u!==-1&&l2.value[s].splice(u,1),i.value=!0,l2.value[s].push({...o,isMounted:i})}),d.onUnmounted(()=>{i.value=!1})}const H6e=d.defineComponent({__name:"NodesProvider",props:d.mergeModels({nodes:{type:Array,default:()=>[]},renderType:{type:String,default:"preview"},inputTypes:{type:Array,default:()=>[]},editorId:{type:String,default:""},disabledNodes:{type:Array,default:()=>[]}},{formData:{},formDataModifiers:{},nodes:{},nodesModifiers:{},modelValue:{},modelModifiers:{}}),emits:["update:formData","update:nodes","update:modelValue"],setup(o){const s=o,i=d.useModel(o,"formData"),u=d.useModel(o,"nodes"),m=d.useModel(o,"modelValue"),h=Ife(s==null?void 0:s.editorId),b=d.computed(()=>{var O,R,I;const N=[...Ofe(((I=(R=(O=d.toValue(h))==null?void 0:O.filter(W=>d.toValue(W==null?void 0:W.activated)))==null?void 0:R.filter(W=>d.toValue(W.isMounted)))==null?void 0:I.filter(W=>d.toValue(W==null?void 0:W.isOccupy)))||[]),...s.disabledNodes||[]];return Yxe(N,"id")}),C=d.computed(()=>d.toValue(s.renderType)),S=_=>{na(u.value,_)||(u.value=_)};return d.provide(Dfe,{modelValue:m,renderType:C,inputTypes:s.inputTypes,editorId:s==null?void 0:s.editorId,nodes:u,disabledNodes:b,updateNodes:S,formData:i}),(_,N)=>d.renderSlot(_.$slots,"default")}}),z6e=d.defineComponent({__name:"NodesUIProvider",props:{nodes:{type:Array,default:()=>[]},selectedNodes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},editorId:{type:String,default:""},htmlRenderRef:{type:Object,default:()=>{}}},emits:["onSelectedNodes","update:selectedNodes"],setup(o,{expose:s,emit:i}){const u=o,m=i,h=d.ref(null),b=d.ref(null),C=d.ref([]),S=d.ref(null),_=d.ref(-1),N=d.ref(0),O=d.ref(0),R=Ife(u==null?void 0:u.editorId),I=d.ref(!1),W=d.ref(!1),G=d.computed(()=>u.htmlRenderRef),Q=d.computed({get:()=>(u.selectedNodes||[]).map(Ke=>{var ke;let Be=(ke=u==null?void 0:u.nodes)==null?void 0:ke.find(et=>(et==null?void 0:et.id)===(Ke==null?void 0:Ke.id)),Y=Ke!=null&&Ke.element?Ke==null?void 0:Ke.element:g6e(Ke==null?void 0:Ke.id,h.value);return{...Be||{},...Ke,element:Y}}),set:Ke=>{const Be=Ke.map(({element:Y,...ke})=>{var je;return{...((je=u==null?void 0:u.nodes)==null?void 0:je.find(Ce=>(Ce==null?void 0:Ce.id)===(ke==null?void 0:ke.id)))||{},...ke}});m("update:selectedNodes",Be)}}),q=d.computed(()=>{var Y,ke,et;const Ke=(ke=(Y=d.toValue(R))==null?void 0:Y.filter(je=>d.toValue(je==null?void 0:je.activated)))==null?void 0:ke.filter(je=>d.toValue(je.isMounted)),Be=((et=d.toValue(u==null?void 0:u.nodesGroups)||[])==null?void 0:et.map(je=>({...je||{},activated:!0})))||[];return Ofe([...Be,...Ke])}),Z=d.ref([]),L=Ke=>{var ke;const Be=Ke.map(({...et})=>{var Dt;let je=(Dt=C.value)==null?void 0:Dt.find(me=>(me==null?void 0:me.id)===(et==null?void 0:et.id));const{element:Ce,...ce}={...je||{},...et};return ce}),Y=(ke=Q.value)==null?void 0:ke.map(({element:et,...je})=>je);na(Be,Y)||(Q.value=Be,m("onSelectedNodes",Be))},pe=d.computed(()=>d.toValue(u==null?void 0:u.nodesGroups));return s({setSelectedNodes:L}),d.provide(Afe,{containerRef:h,htmlRenderRef:G,contextMenuRef:b,focusedElement:S,currentRenderNodes:Z,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:q,selectedNodes:Q,setSelectedNodes:L,renderNodes:C,uiReady:I,isFocused:W,nodesGroups:pe}),(Ke,Be)=>d.renderSlot(Ke.$slots,"default")}}),U6e=["onClick"],j6e={key:0,class:"icon"},W6e={key:1,class:"arrow"},Z6e=["onClick"],G6e={key:0,class:"icon"},q6e=d.defineComponent({__name:"index",props:d.mergeModels({style:{},direction:{}},{show:{type:Boolean},showModifiers:{}}),emits:d.mergeModels(["select"],["update:show"]),setup(o,{emit:s}){const i=o,{contextMenuRef:u,selectedNodes:m,setSelectedNodes:h,focusedElement:b,cursorPosition:C,focusedNodeIndex:S,preNodeNumber:_}=ef(),{inputTypes:N}=j0(),O=d.useModel(o,"show"),R=d.ref(!1),I=()=>{R.value=!1},W=d.ref({focusedElement:null,cursorPosition:0,focusedNodeIndex:0,preNodeNumber:0});d.watch(()=>[O,i==null?void 0:i.style],()=>{d.toValue(O)&&(R.value=!1,d.nextTick(()=>{R.value=!!d.toValue(O),W.value={focusedElement:d.toValue(b),cursorPosition:d.toValue(C),focusedNodeIndex:d.toValue(S),preNodeNumber:d.toValue(_)}}))},{immediate:!0,deep:!0});const{editNodes:G}=IB(),Q=async Y=>{var ke,et;if(d.toValue(W).focusedElement&&!Ixe(d.toValue(C))){const je=$U(d.toValue(W).focusedElement),Ce=d.toValue(W).cursorPosition,ce=(d.toValue(W).preNodeNumber||0)+1,Dt=y6e(d.toValue(W).focusedElement),me=Rfe().valueOf();if(je&&!dB(Ce)&&Ce>=0){const be=await((ke=Y==null?void 0:Y.getDefaultProps)==null?void 0:ke.call(Y))||{};G({...Dt,label:Y==null?void 0:Y.label,nodePath:je,startOffset:Ce,subNodeSort:ce,textNodeIndex:d.toValue(S)||0,nodeType:Y==null?void 0:Y.value,insertTime:me,props:be})}}else if(m){const je=d.toValue(m);if(je!=null&&je.length){const Ce=await((et=Y==null?void 0:Y.getDefaultProps)==null?void 0:et.call(Y))||{},ce=je==null?void 0:je.map(Dt=>({...Dt,label:Y==null?void 0:Y.label,element:Dt==null?void 0:Dt.element,nodePath:Dt==null?void 0:Dt.nodePath,nodeType:Y==null?void 0:Y.value,props:Ce}));G(ce),h(ce)}}O.value=!1},q=d.computed(()=>{const Y=[],ke=[];return d.toValue(N).forEach(et=>{et.groupName==="system"?ke.push({...et,handler:()=>{Q(et)}}):Y.push({...et,handler:()=>{Q(et)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:Y},{label:"插入记录标识",icon:"i-bi:flag",children:ke}].filter(et=>{var je;return(je=et==null?void 0:et.children)==null?void 0:je.length})}),Z=s,L=(Y,ke)=>{Y.preventDefault(),ke!=null&&ke.handler&&ke.handler(),ke!=null&&ke.value&&(Z("select",ke==null?void 0:ke.value),R.value=!1)},pe=d.computed(()=>{var et,je;const Y=d.toValue(m)||[];if(!Array.isArray(Y)||Y.length===0)return null;const ke=((et=Y[0])==null?void 0:et.nodeType)??null;for(let Ce=1;Ce<Y.length;Ce++)if(((je=Y[Ce])==null?void 0:je.nodeType)!==ke)return null;return ke}),Ke=Y=>Y==null?"":String(Y).toLowerCase(),Be=Y=>Ke(pe.value)===Ke(Y);return(Y,ke)=>(d.openBlock(),d.createBlock(d.unref(On.ElPopover),{visible:R.value,"popper-style":"padding:0px;"},{reference:d.withCtx(()=>[d.withDirectives(d.createElementVNode("div",{class:"popover-point",style:d.normalizeStyle({...Y.style}),ref_key:"contextMenuRef",ref:u},null,4),[[d.unref(On.ClickOutside),I]])]),default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"contextMenuRef",ref:u,class:"context-menu"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(q.value,et=>(d.openBlock(),d.createElementBlock("div",{key:et==null?void 0:et.label,class:"menu-item"},[d.createElementVNode("div",{class:"menu-item-content",onClick:je=>L(je,et)},[et!=null&&et.icon?(d.openBlock(),d.createElementBlock("div",j6e,[d.createElementVNode("div",{class:d.normalizeClass(et==null?void 0:et.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(et.label)+" ",1),et!=null&&et.children?(d.openBlock(),d.createElementBlock("span",W6e,"›")):d.createCommentVNode("",!0)],8,U6e),et!=null&&et.children?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["submenu",{"submenu-bottom":Y.direction==="bottom"}])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(et.children,je=>(d.openBlock(),d.createElementBlock("div",{key:je.action,class:d.normalizeClass(["menu-item",{active:Be(je.value)}]),onClick:Ce=>L(Ce,je)},[je!=null&&je.icon?(d.openBlock(),d.createElementBlock("div",G6e,[d.createElementVNode("div",{class:d.normalizeClass(je==null?void 0:je.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(je.label),1)],10,Z6e))),128))],2)):d.createCommentVNode("",!0)]))),128))],512)]),_:1},8,["visible"]))}}),Y6e=Ja(q6e,[["__scopeId","data-v-24001f4f"]]);function K6e(o){const{headerHeight:s,hasContextMenu:i}=o,{contextMenuRef:u}=ef(),m=d.ref(!1),h=d.ref("top"),b=d.ref({left:"0px",top:"0px"}),C=_=>{d.toValue(i)&&(_.preventDefault(),m.value=!0,d.nextTick(()=>{const O=_.currentTarget.getBoundingClientRect(),R=_.clientX-O.left,I=_.clientY-O.top,W=u==null?void 0:u.value,G=Array.from((W==null?void 0:W.querySelectorAll(".submenu"))||[]).reduce((Q,q)=>Math.max(Q,q.offsetHeight||0),0)||400;O.height-I<G?h.value="bottom":h.value="top",b.value={left:`${R}px`,top:`${I+d.toValue(s)}px`}}))},S=_=>{_.button===0&&(m.value=!1)};return d.onMounted(()=>{document.addEventListener("mousedown",S)}),d.onUnmounted(()=>{document.removeEventListener("mousedown",S)}),{showContextMenu:m,contextMenuStyle:b,onContextMenu:C,closeContextMenu:S,direction:h}}function Pfe(o){return{all:o=o||new Map,on:function(s,i){var u=o.get(s);u?u.push(i):o.set(s,[i])},off:function(s,i){var u=o.get(s);u&&(i?u.splice(u.indexOf(i)>>>0,1):o.set(s,[]))},emit:function(s,i){var u=o.get(s);u&&u.slice().map(function(m){m(i)}),(u=o.get("*"))&&u.slice().map(function(m){m(s,i)})}}}const Sne=Pfe(),Ffe=(...o)=>{const s=o[0],i=o[1];d.onMounted(()=>{Sne.on(s,i)}),d.onBeforeUnmount(()=>{Sne.off(s)})},Ioe=()=>(...s)=>{Sne.emit(...s)};let rE=null;function X6e(o){const{onSelected:s}={},{selectedNodes:i,uiReady:u,setSelectedNodes:m}=ef(),h=d.ref("multiple"),b=(S="select")=>{var N,O;let _=[];h.value==="single"?(N=i.value)!=null&&N[0]&&_.push((O=i.value)==null?void 0:O[0]):_=ta(i.value),rE==null||rE({data:_,type:S}),S==="blur"&&(rE=null,h.value="multiple"),m(_)};return d.watch(()=>i,()=>{u.value&&(b(),s==null||s(d.toValue(i)))},{deep:!0}),Ffe("selectNodes",S=>{const{data:_,callback:N=null,mode:O="multiple"}=S;h.value=O,setTimeout(()=>{m(d.toValue(_)),rE=N},100)}),{onBlur:()=>{rE&&(b("blur"),rE=null,m([]))}}}const Bz={A3:{width:297,height:420},A4:{width:210,height:297},A5:{width:148,height:210},B3:{width:353,height:500},B4:{width:257,height:364},B5:{width:176,height:250}},J6e={class:"relative"},Q6e={class:"header-container"},eBe=["innerHTML"],tBe={style:{overflow:"hidden"}},nBe=["innerHTML"],oBe=d.defineComponent({__name:"index",props:{headerHtml:{type:String,default:""},footerHtml:{type:String,default:""},pagesize:{type:String,default:"A4"}},emits:["onUiReady"],setup(o,{expose:s,emit:i}){const u=d.ref(),{containerRef:m,uiReady:h,isFocused:b}=ef(),{nodes:C,modelValue:S,renderType:_,updateNodes:N}=j0(),O=d.computed(()=>d.toValue(_)==="edit"),R=o,I=i,W=()=>{I("onUiReady",{containerRef:m})},{height:G}=gMe(u),Q=d.computed(()=>R.headerHtml?R.headerHtml.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(_e,le,He)=>{const Ge=He.replace(/([^{}]+)\{/g,(fe,Ue)=>{const yt=Ue.trim();return yt&&!yt.includes(".header-container")?`.header-container ${yt} {`:fe});return`<style${le}>${Ge}</style>`}):""),q=d.computed(()=>{const _e=Bz[R.pagesize]||Bz.A4,le=(window.devicePixelRatio||1)*96;return`${_e.height*le/25.4-d.toValue(G)}px`}),{showContextMenu:Z,contextMenuStyle:L,onContextMenu:pe,direction:Ke}=K6e({headerHeight:G,hasContextMenu:O}),Be=d.ref(null),Y=d.computed(()=>{var _e;return(_e=d.toValue(C))==null?void 0:_e.map(le=>{const{nodePath:He,id:Ge,nodeType:fe}=le;return{nodePath:He,id:Ge,nodeType:fe}})}),ke=_e=>{const le=document.createElement("div");return le.innerHTML=_e||"",le.querySelectorAll(".node-item").forEach(Ge=>{(Ge.getAttribute("id")||"")&&Ge.remove()}),le.normalize(),le.innerHTML},et=_e=>{var fe;const le=(fe=m.value)==null?void 0:fe.querySelector(`[id="${_e==null?void 0:_e.id}"]`);if(le)return le;let He=null;const Ge=document.createElement("span");return Ge.setAttribute("contenteditable","false"),Ge.classList.add("node-item"),He=Ge,v6e(_e,He,m.value),He&&b6e(He,_e),He},je=()=>{const _e=C.value||[],le=zxe(_e,[He=>He.nodePath,He=>He.textNodeIndex||-1,He=>(He==null?void 0:He.startOffset)??-1,He=>He.subNodeSort||-1,He=>(He==null?void 0:He.insertTime)||-1],["asc","desc","desc","desc","desc"]);le==null||le.forEach(He=>{et(He)})},Ce=()=>{Be.value&&(h.value=!1,d.nextTick(()=>{if(Be.value){const _e=ke(d.toValue(S));Be.value.innerHTML=_e,je(),h.value=!0,S.value=Be.value.innerHTML,d.nextTick(()=>{W(),setTimeout(()=>{d.toValue(m)&&k6e(d.toValue(m))},10)})}}))},ce=_e=>{const le=document.createElement("html"),He=document.createElement("body");le.appendChild(He),He.innerHTML=_e||"";const Ge=[];return He.querySelectorAll(".node-item").forEach(Ue=>{const yt=Ue.getAttribute("id")||"",Ve=$U(Ue==null?void 0:Ue.parentElement)||"";Ge.push({nodePath:Ve,id:yt})}),Ge};d.watch(()=>S,()=>{var He;const _e=ce(d.toValue(S)),le=Y.value.map(Ge=>{const{nodePath:fe}=(_e==null?void 0:_e.find(Ue=>(Ue==null?void 0:Ue.id)===(Ge==null?void 0:Ge.id)))||{};return fe?{...Ge,nodePath:fe}:Ge});na(le,Y.value)?Ce():N((He=d.toValue(C))==null?void 0:He.map(Ge=>{const{nodePath:fe}=(le==null?void 0:le.find(Ue=>(Ue==null?void 0:Ue.id)===(Ge==null?void 0:Ge.id)))||{};return fe?{...Ge,nodePath:fe}:Ge}))},{deep:!0,immediate:!0}),d.watch(()=>Be,()=>{Ce()},{deep:!0,immediate:!0}),d.watch(()=>[...Y.value],(_e,le)=>{na(le,_e)||Ce()},{deep:!0,immediate:!0});const Dt=d.ref(),me=()=>{b.value=!0},{onBlur:be}=X6e(),$=()=>{b.value=!1,be()};return s({renderHtml:Ce,getInnerHTML:()=>{var _e,le;return((le=(_e=Dt.value)==null?void 0:_e.getInnerHTML)==null?void 0:le.call(_e))||""},getContainerHTML:()=>{var _e;return((_e=m.value)==null?void 0:_e.innerHTML)||""}}),(_e,le)=>(d.openBlock(),d.createElementBlock("div",J6e,[d.createVNode(RB,{onOnBlur:$,onOnFocus:me,ref_key:"shadowDomRef",ref:Dt},{default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"headerRef",ref:u,style:{overflow:"hidden"}},[d.createElementVNode("div",Q6e,[d.createElementVNode("div",{innerHTML:Q.value,class:"disabeld-edit docHeaderHtml",onClick:me},null,8,eBe)])],512),d.createElementVNode("html",{class:d.normalizeClass(["nodes-editor",`nodes-editor-${d.unref(_)}`]),ref_key:"containerRef",ref:m,style:d.normalizeStyle([{position:"relative"},{position:"relative",minHeight:q.value}]),onContextmenu:le[0]||(le[0]=d.withModifiers((...He)=>d.unref(pe)&&d.unref(pe)(...He),["prevent"]))},[d.createElementVNode("body",{ref_key:"bodyRef",ref:Be},null,512),d.createElementVNode("div",tBe,[d.createElementVNode("div",{innerHTML:R==null?void 0:R.footerHtml,class:"disabeld-edit docFooterHtml",onClick:me},null,8,nBe)])],38)]),_:1},512),O.value?(d.openBlock(),d.createBlock(Y6e,{key:0,show:d.unref(Z),"onUpdate:show":le[1]||(le[1]=He=>d.isRef(Z)?Z.value=He:null),style:d.normalizeStyle(d.unref(L)),direction:d.unref(Ke)},null,8,["show","style","direction"])):d.createCommentVNode("",!0)]))}}),sBe=d.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},style:{type:Object,default:()=>({})},pagesizeWrapStyle:{type:Object,default:()=>({})}},setup(o){const s=o,i=d.computed(()=>{const u=Bz[s.pagesize]||Bz.A4;let{width:m,height:h}=u;s.orientation==="landscape"&&([m,h]=[h,m]);const b=(window.devicePixelRatio||1)*96;return m*b/25.4});return(u,m)=>(d.openBlock(),d.createElementBlock("div",{class:"pagesize",style:d.normalizeStyle(s==null?void 0:s.pagesizeWrapStyle)},[d.createElementVNode("div",{style:d.normalizeStyle({width:`${i.value}px`,...o.style}),class:"pagesize-content"},[d.renderSlot(u.$slots,"default",{},void 0,!0)],4)],4))}}),rBe=Ja(sBe,[["__scopeId","data-v-1f48410e"]]),Lfe=d.defineComponent({__name:"index",props:d.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},renderType:{type:String,default:"preview"},formData:{type:Object,default:()=>({})},inputTypes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},id:{type:String,default:""},disabledNodes:{type:Array,default:()=>[]},headerHtml:{type:String,default:""},footerHtml:{type:String,default:""},pagesizeStyle:{type:Object,default:()=>({})},pagesizeWrapStyle:{type:Object,default:()=>({})}},{selectedNodes:{default:[]},selectedNodesModifiers:{}}),emits:d.mergeModels(["update:modelValue","update:nodes","update:formData","onSelectedNodes","onUiReady"],["update:selectedNodes"]),setup(o,{expose:s,emit:i}){const u=o,m=i,h=d.useModel(o,"selectedNodes");Em(u.formData);const b=d.ref(),C=d.ref(null),S=Q=>{m("onUiReady",Q)},_=d.ref(),N=d.computed(()=>d.toValue(u.renderType)),O=d.computed(()=>{switch(d.toValue(N)){case"edit":return P6e;case"select":return L6e;case"preview":return lle;case"enter":return F6e;default:return lle}}),R=Q=>{m("update:nodes",Q)},I=Q=>{m("update:modelValue",Q)},W=Q=>{m("update:formData",Q)},G=Q=>{m("onSelectedNodes",Q)};return s({formRef:{validate:()=>{var Q,q,Z;return(Z=(q=(Q=b.value)==null?void 0:Q.formRef)==null?void 0:q.validate)==null?void 0:Z.call(q)}},setSelectedNodes:Q=>{var q,Z;(Z=(q=_.value)==null?void 0:q.setSelectedNodes)==null||Z.call(q,Q)},initNodes:()=>{var Q,q;return(q=(Q=b.value)==null?void 0:Q.initNodes)==null?void 0:q.call(Q)},getInnerHTML:()=>{var Q,q;return((q=(Q=C.value)==null?void 0:Q.getInnerHTML)==null?void 0:q.call(Q))||""},getContainerHTML:()=>{var Q,q;return((q=(Q=C.value)==null?void 0:Q.getContainerHTML)==null?void 0:q.call(Q))||""}}),(Q,q)=>(d.openBlock(),d.createBlock(rBe,{pagesize:o.pagesize,orientation:u==null?void 0:u.orientation,style:d.normalizeStyle(o.pagesizeStyle),pagesizeWrapStyle:o.pagesizeWrapStyle},{default:d.withCtx(()=>[d.createVNode(z6e,{ref_key:"UIRef",ref:_,nodes:o.nodes,"onUpdate:nodes":R,selectedNodes:h.value,"onUpdate:selectedNodes":q[0]||(q[0]=Z=>h.value=Z),onOnSelectedNodes:G,nodesGroups:o.nodesGroups,editorId:u==null?void 0:u.id,htmlRenderRef:C.value},{default:d.withCtx(()=>[d.createVNode(H6e,{renderType:N.value,"model-value":o.modelValue,"onUpdate:modelValue":I,nodes:o.nodes,"onUpdate:nodes":R,formData:o.formData,"onUpdate:formData":W,inputTypes:o.inputTypes,editorId:u==null?void 0:u.id,disabledNodes:o.disabledNodes},{default:d.withCtx(()=>[d.createVNode(oBe,{ref_key:"htmlRenderRef",ref:C,headerHtml:o.headerHtml,footerHtml:o.footerHtml,pagesize:u==null?void 0:u.pagesize,onOnUiReady:S},null,8,["headerHtml","footerHtml","pagesize"]),(d.openBlock(),d.createBlock(d.resolveDynamicComponent(O.value),{renderType:N.value,pagesize:o.pagesize,ref_key:"contentRef",ref:b},{nodeItem:d.withCtx(Z=>[d.renderSlot(Q.$slots,"nodeItem",{node:Z==null?void 0:Z.node})]),_:3},8,["renderType","pagesize"]))]),_:3},8,["renderType","model-value","nodes","formData","inputTypes","editorId","disabledNodes"])]),_:3},8,["nodes","selectedNodes","nodesGroups","editorId","htmlRenderRef"])]),_:3},8,["pagesize","orientation","style","pagesizeWrapStyle"]))}}),aBe={class:"nodes-text"},iBe={key:0,class:"node-text-input"},lBe={key:1,class:"node-text-td"},cBe={key:0,class:"node-text-table-index"},uBe=d.defineComponent({__name:"index",props:d.mergeModels({editorId:{type:String,default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=d.useModel(o,"modelValue"),u=BU(s==null?void 0:s.editorId),m=d.computed(()=>{var b;return $fe(i.value,((b=d.toValue(u))==null?void 0:b.renderNodes)||[])}),h=d.computed(()=>{var b;return((b=d.toValue(m))==null?void 0:b.length)>0?!d.toValue(m).some(S=>{var _,N;return((_=S==null?void 0:S.min)==null?void 0:_.tableIndex)>1||((N=S==null?void 0:S.max)==null?void 0:N.tableIndex)>1}):!0});return(b,C)=>(d.openBlock(),d.createElementBlock("div",aBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.value,(S,_)=>{var N,O,R,I,W,G,Q,q,Z;return d.openBlock(),d.createElementBlock("div",{key:_,class:"node-text-item"},[(S==null?void 0:S.showTextType)==="input"?(d.openBlock(),d.createElementBlock("span",iBe,d.toDisplayString((N=S==null?void 0:S.props)!=null&&N.alias?(O=S==null?void 0:S.props)==null?void 0:O.alias:`填写${S==null?void 0:S.inputIndex}`),1)):(d.openBlock(),d.createElementBlock("span",lBe,[h.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("span",cBe,d.toDisplayString(`表${(R=S==null?void 0:S.min)==null?void 0:R.tableIndex}.`),1)),d.createTextVNode(" "+d.toDisplayString(((I=S==null?void 0:S.min)==null?void 0:I.id)===((W=S==null?void 0:S.max)==null?void 0:W.id)?(Q=(G=S==null?void 0:S.min)==null?void 0:G.props)!=null&&Q.alias?(Z=(q=S==null?void 0:S.min)==null?void 0:q.props)==null?void 0:Z.alias:d.unref(r4)(S==null?void 0:S.min):`${d.unref(r4)(S==null?void 0:S.min)}:${d.unref(r4)(S==null?void 0:S.max)}`),1)]))])}),128))]))}}),cle=Ja(uBe,[["__scopeId","data-v-73a2b2dc"]]);function Poe(o){const{nodes:s,mode:i="multiple"}=o,u=d.ref(!1),m=Ioe();return{isSelecting:u,selectNodes:()=>{if(u.value)return!1;u.value=!0,m("selectNodes",{data:ta(d.toValue(s)),mode:i,callback:({data:b,type:C})=>{s.value=_6e(ta(d.toValue(b))),C==="blur"&&(u.value=!1)}})}}}const ZA=["#409EFF","#b36c2d","#7548ff","#5233b3","#649ee5","#aac4ed","#f9ce57","#ae74e8"],BH=d.ref(0),aE=new Map,dBe={key:0,class:"node-select-small gap-x-2"},fBe={key:1,class:"text-[#999]"},mBe={key:1,class:"node-select"},pBe={class:"flex py-2 px-2 justify-between items-center noder-select-header"},gBe={class:"flex gap-2"},hBe={key:1},vBe={class:"flex gap-1"},bBe=d.defineComponent({__name:"index",props:d.mergeModels({mode:{type:String,default:"multiple"},color:{type:String},id:{type:String,default:""},editorId:{type:String,default:""},size:{type:String,default:"default"},label:{type:String,default:"点击选择"},isOccupy:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=d.ref((aE==null?void 0:aE[s==null?void 0:s.id])||0),u=d.ref((s==null?void 0:s.id)||m2()),m=d.useModel(o,"modelValue");Em(m);const{selectNodes:h,isSelecting:b}=Poe({nodes:m,mode:s.mode}),C=()=>{m.value=[]},S=d.computed(()=>s.color||(ZA==null?void 0:ZA[d.toValue(i)%(ZA==null?void 0:ZA.length)])||"#409eff");d.onMounted(()=>{dB(aE==null?void 0:aE[s==null?void 0:s.id])&&(s!=null&&s.id)&&(aE[s==null?void 0:s.id]=BH.value,i.value=BH.value,BH.value=BH.value+1)});const _=d.computed(()=>s.isOccupy),N=d.computed(()=>!d.toValue(b));return V6e({id:u.value,editorId:s.editorId,nodes:m,activated:N,color:S,isOccupy:_}),(O,R)=>{var I,W;return s.size==="small"?(d.openBlock(),d.createElementBlock("div",dBe,[d.createElementVNode("div",{style:d.normalizeStyle({"--node-color":S.value}),class:"node-color cursor-pointer"},null,4),d.createElementVNode("div",null,d.toDisplayString(s.label),1),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(d.unref(b)?{color:"#409eff"}:{}),onClick:R[0]||(R[0]=(...G)=>d.unref(h)&&d.unref(h)(...G))},R[6]||(R[6]=[d.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer"},null,-1)]),4)),!s.disabled&&((I=m.value)==null?void 0:I.length)>0?(d.openBlock(),d.createElementBlock("div",{key:1,class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})):d.createCommentVNode("",!0),d.createElementVNode("div",{class:"flex items-center flex-wrap gap-1 cursor-pointer",onClick:R[2]||(R[2]=()=>{s!=null&&s.disabled||d.unref(h)()})},[((W=m.value)==null?void 0:W.length)>0?(d.openBlock(),d.createBlock(cle,{key:0,modelValue:m.value,"onUpdate:modelValue":R[1]||(R[1]=G=>m.value=G),editorId:o.editorId},null,8,["modelValue","editorId"])):(d.openBlock(),d.createElementBlock("div",fBe,"未设置"))])])):(d.openBlock(),d.createElementBlock("div",mBe,[d.createElementVNode("div",pBe,[d.createElementVNode("div",gBe,[d.createElementVNode("div",{style:d.normalizeStyle({"--node-color":S.value}),class:"node-color cursor-pointer"},null,4),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(d.unref(b)?{color:"#409eff"}:{})},[d.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer",onClick:R[3]||(R[3]=(...G)=>d.unref(h)&&d.unref(h)(...G))})],4)),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",hBe,[d.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})]))]),d.createElementVNode("div",vBe,[R[9]||(R[9]=d.createElementVNode("div",{class:"color-[#999]"},"Ctrl+左键多选",-1)),d.createElementVNode("div",null,[d.createVNode(d.unref(On.ElTooltip),{placement:"right",effect:"dark"},{content:d.withCtx(()=>R[7]||(R[7]=[d.createElementVNode("strong",null,"选择位置",-1),d.createTextVNode(" :点击输入框(选中状态为蓝色),再点击左侧表格可选择填写位置范围。 "),d.createElementVNode("br",null,null,-1),d.createElementVNode("strong",null,"编辑位置",-1),d.createTextVNode(" :使用橡皮擦工具清除后重新选择。 "),d.createElementVNode("br",null,null,-1)])),default:d.withCtx(()=>[R[8]||(R[8]=d.createElementVNode("div",{class:"flex flex-center"},[d.createElementVNode("div",{class:"i-bi:info-circle-fill mr-2"}),d.createTextVNode(" 使用帮助 ")],-1))]),_:1})])])]),d.createElementVNode("div",{class:d.normalizeClass(["min-h-[42px] px-2 py-1",{"shadow-[0_0_0_2px_#409eff]":d.unref(b)}]),onClick:R[5]||(R[5]=()=>{s!=null&&s.disabled||d.unref(h)()})},[d.createVNode(cle,{modelValue:m.value,"onUpdate:modelValue":R[4]||(R[4]=G=>m.value=G),editorId:o.editorId},null,8,["modelValue","editorId"])],2)]))}}}),Vfe=Ja(bBe,[["__scopeId","data-v-9af34714"]]);function yBe(o){if(!o.startsWith("="))return[];const s=[];let i=1;for(o.startsWith("=")&&s.push({type:"startOperator",value:"="});i<o.length;){const u=o[i];if(/\s/.test(u)){i++;continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];if(i<o.length&&o[i]===":"){i++;let h="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)h+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)h+=o[i++];s.push({type:"range",value:`${m}:${h}`});continue}else{s.push({type:"cell",value:m});continue}}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(/[A-Za-z]/.test(u)){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];if(["AVERAGE","AVEDEV","SUM","IF","COUNT","MAX","MIN","SQRT"].includes(m.toUpperCase())&&o[i]==="("){s.push({type:"function",value:m});continue}i-=m.length}if(/\d/.test(u)){let m="";for(;i<o.length&&(/\d/.test(o[i])||o[i]===".");)m+=o[i++];s.push({type:"number",value:m});continue}if(u==='"'){let m="";for(m+=u,i++;i<o.length&&o[i]!=='"';)m+=o[i++];m+=u,i++,s.push({type:"string",value:m});continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(u===":"){s.push({type:"operator",value:":"}),i++;continue}if(/[+\-*/=><]/.test(u)){s.push({type:"operator",value:u}),i++;continue}if(/[()]/.test(u)){s.push({type:"paren",value:u}),i++;continue}if(u===","){s.push({type:"separator",value:","}),i++;continue}i++}return s}function wBe(o,s){const i=[];let u=0;for(;u<o.length;){let m=!1;for(const h of s){const b=h.value;if(o.startsWith(b,u)){i.push({type:h.type,value:b,...h.cellValue?{cellValue:h.cellValue}:{}}),u+=b.length,m=!0;break}}m||(i.push({type:"plain",value:o[u]}),u++)}return i}function CBe(o){const s=BU(o.editorId),i=(b,C)=>{const S=[],_=Math.min(b.colIndex,C.colIndex),N=Math.max(b.colIndex,C.colIndex),O=Math.min(b.rowIndex,C.rowIndex),R=Math.max(b.rowIndex,C.rowIndex);for(let I=O;I<=R;I++)for(let W=_;W<=N;W++)S.push({colIndex:W,rowIndex:I});return S},u=b=>{var N;const C=b.includes(":");let S=[];if(C){const[O,R]=b.split(":").map(I=>h(I));S=i(O,R)}else S=[h(b)];return m(S,d.toValue((N=d.toValue(s))==null?void 0:N.nodes))},m=(b,C)=>C==null?void 0:C.filter(S=>{const _=S.nodePath.split(" > ");let N=1,O=1;return _.forEach(R=>{if(R.startsWith("tr")){const I=R.match(/tr(?::nth-of-type\((\d+)\))?/);I&&I[1]&&(N=parseInt(I[1]))}else if(R.startsWith("td")){const I=R.match(/td(?::nth-of-type\((\d+)\))?/);I&&(O=I[1]?parseInt(I[1]):1)}}),b.some(R=>N===R.rowIndex+1&&O===R.colIndex+1)}),h=b=>{if(!b)return{colIndex:-1,rowIndex:-1};const C=b.match(/^([A-Za-z]+)(\d+)$/);if(!C)return{colIndex:-1,rowIndex:-1};const S=C[1].toUpperCase(),_=parseInt(C[2]);let N=0;for(let O=0;O<S.length;O++)N=N*26+(S.charCodeAt(O)-64);return{colIndex:N-1,rowIndex:_}};return{getCellValue:u}}const ule=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function SBe(o,s,i){const u=d.ref(null),m=d.ref(null);function h(){return o.value&&o.value.textContent||""}d.onMounted(()=>{o.value&&(u.value=()=>{const C=h();s.value=C},m.value=()=>{const C=h();s.value=C},o.value.addEventListener("input",u.value),o.value.addEventListener("blur",m.value))}),d.onUnmounted(()=>{o.value&&(u.value&&o.value.removeEventListener("input",u.value),m.value&&o.value.removeEventListener("blur",m.value))});const b=C=>{var S,_,N,O;if(C>=0){const R=window.getSelection();if(R){const I=R.getRangeAt(0),W=((S=I.startContainer)==null?void 0:S.nodeName)==="#text"?I.startContainer:(N=(_=I.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],G=Math.min(C,((O=W.textContent)==null?void 0:O.length)||0);I.setStart(W,G)}}};return d.watch(()=>[s,o],()=>{var C;o.value&&(na((C=o.value)==null?void 0:C.textContent,d.toValue(s))||(o.value.textContent=d.toValue(s),b(d.toValue(i))))},{deep:!0,immediate:!0}),{getFormulaContent:h}}function Foe(o){const{element:s,onFocus:i,onBlur:u}=o,m=d.ref(!1),h=()=>{m.value=!0,i==null||i()},b=()=>{m.value=!1,u==null||u()};return d.onMounted(()=>{var C,S;d.toValue(s)&&((C=d.toValue(s))==null||C.addEventListener("focus",h),(S=d.toValue(s))==null||S.addEventListener("blur",b))}),d.onUnmounted(()=>{var C,S;d.toValue(s)&&((C=d.toValue(s))==null||C.removeEventListener("focus",h),(S=d.toValue(s))==null||S.removeEventListener("blur",b))}),m}function xBe(o){const{element:s,showStr:i,editorId:u}=o,m=BU(u),h=Foe({element:s}),b=d.computed(()=>{var C;return(C=i==null?void 0:i.value)==null?void 0:C.filter(S=>["range","cell"].includes(S.type))});return d.watch(()=>h,()=>{var S,_,N,O,R,I;const C=W=>{var G;W.preventDefault(),(G=d.toValue(s))==null||G.focus()};d.toValue(h)?((S=d.toValue(m))==null||S.containerRef.addEventListener("click",C),(_=d.toValue(m))==null||_.containerRef.addEventListener("mousedown",C),(N=document.querySelectorAll(".select-function"))==null||N.forEach(W=>{W.addEventListener("click",C),W.addEventListener("mousedown",C)})):((O=d.toValue(m))==null||O.containerRef.removeEventListener("click",C),(R=d.toValue(m))==null||R.containerRef.removeEventListener("mousedown",C),(I=document.querySelectorAll(".select-function"))==null||I.forEach(W=>{W.removeEventListener("click",C),W.removeEventListener("mousedown",C)}))},{deep:!0}),d.watch(()=>[h,b],()=>{var C,S,_,N,O;if((C=d.toValue(m))!=null&&C.containerRef&&((N=(_=(S=d.toValue(m))==null?void 0:S.containerRef)==null?void 0:_.querySelectorAll(".node-formula-cell"))==null||N.forEach(R=>{R.classList.remove("node-formula-cell")}),d.toValue(h))){let R=[];(O=b.value)!=null&&O.length&&(b.value.forEach(I=>{var W;R=[...R,...((W=I==null?void 0:I.cellValue)==null?void 0:W.map(G=>({color:I==null?void 0:I.color,backgroundColor:Mz((I==null?void 0:I.color)||"#000",.1),element:G==null?void 0:G.element})))||[]]}),R.forEach(I=>{var W;I!=null&&I.element&&((W=I==null?void 0:I.element)==null||W.classList.add("node-formula-cell"),I==null||I.element.style.setProperty("--formula-node-color",I==null?void 0:I.color),I==null||I.element.style.setProperty("--formula-node-bg-color",I==null?void 0:I.backgroundColor))}))}},{deep:!0}),h}const EBe=o=>{const{element:s}=o,i=d.ref(-1),u=C=>{const S=C==null?void 0:C.getSelection();try{if(S)return S.getRangeAt(0).startOffset}catch{}return 0},m=()=>{var S;const C=(S=s.value)==null?void 0:S.getRootNode();i.value=u(C)},h=C=>{var O;const S=C.target,_=(O=s.value)==null?void 0:O.getRootNode();i.value=u(_),S.addEventListener("click",m),S.addEventListener("keyup",R=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(R.key)&&m()});const N=()=>{S.removeEventListener("click",m),S.removeEventListener("keyup",m),S.removeEventListener("blur",N),setTimeout(()=>{i.value=-1},300)};S.addEventListener("blur",N)},b=()=>{var C;(C=s.value)==null||C.addEventListener("focus",h,!0)};return d.watch(s,C=>{C&&b()},{immediate:!0}),d.onUnmounted(()=>{var C;(C=s.value)==null||C.removeEventListener("focus",h,!0)}),{startOffset:i}};function _Be(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const kBe=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},TBe=o=>{const{startOffset:s,showStr:i,value:u,editorId:m,currentItemIndex:h,currentItem:b,element:C}=o,S=BU(m),_=d.ref(-1),N=d.ref(0),O=Foe({element:C}),R=d.ref(!1),I=Ioe(),W=G=>{var Q,q;if(d.toValue(R)&&d.toValue(O)&&!na((Q=d.toValue(b))==null?void 0:Q.cellValue,G)){const Z=E6e(G,((q=d.toValue(S))==null?void 0:q.nodes)||"");let L=Z;Z&&(d.toValue(N)===0&&(L+=","),d.toValue(_)>=0&&(u.value=_Be(d.toValue(u),d.toValue(_),d.toValue(N),L),N.value=Z.length))}};d.watch(()=>h,()=>{var G,Q,q,Z,L,pe;if((G=S.value)==null||G.setSelectedNodes([]),["range","cell"].includes((Q=d.toValue(b))==null?void 0:Q.type))return _.value=kBe(i.value,h.value),N.value=(Z=(q=d.toValue(b))==null?void 0:q.value)==null?void 0:Z.length,R.value=!0,I("selectNodes",{data:(L=d.toValue(b))==null?void 0:L.cellValue,mode:"multiple",callback:({data:Ke})=>{W(Ke)}}),!1;if([",","(","="].includes((pe=d.toValue(b))==null?void 0:pe.value))return _.value=d.toValue(s),R.value=!0,N.value=0,I("selectNodes",{data:[],mode:"multiple",callback:({data:Ke})=>{W(Ke)}}),!1;R.value=!1,_.value=-1},{immediate:!0,deep:!0})},ABe=o=>{const{startOffset:s,showStr:i}=o,u=d.ref(-1);d.watch(()=>s,()=>{var h;if(d.toValue(s)<=0)u.value=-1;else{let b=0;for(let C=0;C<i.value.length;C++){const S=i.value[C];if(b+=(h=S==null?void 0:S.value)==null?void 0:h.length,b>=d.toValue(s)){u.value=C;break}}}},{deep:!0,immediate:!0});const m=d.computed(()=>{var h;return(h=d.toValue(i))==null?void 0:h[d.toValue(u)]});return{currentItemIndex:u,currentItem:m}};function NBe(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const OBe=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},$Be=o=>{const{startOffset:s,showStr:i,value:u,currentItemIndex:m,currentItem:h,element:b}=o,C=d.ref(-1),S=d.ref(0),_=Foe({element:b}),N=d.ref(!1),O=Ioe(),R=I=>{var W;if(d.toValue(N)&&d.toValue(_)&&!na((W=d.toValue(h))==null?void 0:W.value,I)){const G=I,Q=G;G&&d.toValue(C)>=0&&(u.value=NBe(d.toValue(u),d.toValue(C),d.toValue(S),Q),S.value=G.length)}};d.watch(()=>m,()=>{var I,W,G,Q,q;if(["function"].includes((I=d.toValue(h))==null?void 0:I.type))return C.value=OBe(i.value,m.value),S.value=(G=(W=d.toValue(h))==null?void 0:W.value)==null?void 0:G.length,N.value=!0,O("selectFunction",{data:(Q=d.toValue(h))==null?void 0:Q.value,callback:({data:Z})=>{R(Z)}}),!1;if([",","(","="].includes((q=d.toValue(h))==null?void 0:q.value))return C.value=d.toValue(s),N.value=!0,S.value=0,O("selectFunction",{data:"",callback:({data:Z})=>{R(Z)}}),!1;N.value=!1,C.value=-1},{immediate:!0,deep:!0})},DBe={class:"node-formula"},MBe={class:"node-formula-show"},BBe=d.defineComponent({__name:"index",props:d.mergeModels({id:{type:String,default:""},editorId:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,{getCellValue:i}=CBe({editorId:s==null?void 0:s.editorId}),u=d.useModel(o,"modelValue"),m=d.ref(),{startOffset:h}=EBe({element:m});SBe(m,u,h);const b=d.computed(()=>{const N=yBe(u.value);return N==null?void 0:N.map(R=>R.type==="cell"||R.type==="range"?{cellValue:i(R.value),...R}:R)}),C=d.computed(()=>{const N=wBe(u.value,b.value);let O=-1;return N.map(I=>(I==null?void 0:I.type)==="cell"||(I==null?void 0:I.type)==="range"?(O++,{...I,color:ule[O%ule.length]}):(I==null?void 0:I.type)==="function"?{...I,color:"#0318ff"}:I)});xBe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:S,currentItem:_}=ABe({element:m,startOffset:h,value:u,showStr:C});return TBe({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:S,currentItem:_}),$Be({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:S,currentItem:_}),(N,O)=>(d.openBlock(),d.createElementBlock("div",DBe,[d.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),d.createElementVNode("div",MBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(C.value,(R,I)=>(d.openBlock(),d.createElementBlock("span",{key:I,class:d.normalizeClass(["node-formula-item",`node-formula-item-type-${R==null?void 0:R.type}`,I===d.unref(S)?"node-formula-item-active":""]),style:d.normalizeStyle({"--text-color":(R==null?void 0:R.color)||"#000","--bg-color":d.unref(Mz)((R==null?void 0:R.color)||"#000",.1)})},d.toDisplayString(R.value),7))),128))])]))}}),Hfe=Ja(BBe,[["__scopeId","data-v-f4b96eb4"]]),RBe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],IBe={class:"select-function"},PBe=["onClick"],FBe={class:"function-item"},LBe={class:"function-item-desc"},VBe=d.defineComponent({__name:"index",props:d.mergeModels({id:{type:String,default:""},functionList:{type:Array,default:()=>[]}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o;let i=null;const u=d.computed(()=>{var b;return((b=s.functionList)==null?void 0:b.length)>0?s.functionList:RBe}),m=d.useModel(o,"modelValue"),h=b=>{m.value=b,i==null||i({data:b})};return Ffe("selectFunction",({data:b,callback:C})=>{i=C,m.value=b}),(b,C)=>(d.openBlock(),d.createElementBlock("div",IBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(S,_)=>(d.openBlock(),d.createElementBlock("div",{key:_},[d.createElementVNode("div",{onClick:()=>{h(S.value)},class:d.normalizeClass(["function-item-wrapper",{active:m.value===S.value}])},[d.createElementVNode("div",FBe,d.toDisplayString(S.value),1),d.createElementVNode("div",LBe,d.toDisplayString(S.label),1)],10,PBe)]))),128))]))}}),zfe=Ja(VBe,[["__scopeId","data-v-6e079ff0"]]),HBe=["innerHTML"],Ufe=d.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=d.useModel(o,"modelValue");return(i,u)=>(d.openBlock(),d.createBlock(RB,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,HBe)]),_:1}))}});function RU(o){return d.getCurrentScope()?(d.onScopeDispose(o),!0):!1}function B0(o){return typeof o=="function"?o():d.unref(o)}const zBe=typeof window<"u"&&typeof document<"u",UBe=o=>typeof o<"u",jBe=Object.prototype.toString,WBe=o=>jBe.call(o)==="[object Object]",ZBe=()=>{};function GBe(o,s){function i(...u){return new Promise((m,h)=>{Promise.resolve(o(()=>s.apply(this,u),{fn:s,thisArg:this,args:u})).then(m).catch(h)})}return i}const jfe=o=>o();function qBe(o=jfe){const s=d.ref(!0);function i(){s.value=!1}function u(){s.value=!0}const m=(...h)=>{s.value&&o(...h)};return{isActive:d.readonly(s),pause:i,resume:u,eventFilter:m}}function dle(o,s=!1,i="Timeout"){return new Promise((u,m)=>{setTimeout(s?()=>m(i):u,o)})}function YBe(o,s,i={}){const{eventFilter:u=jfe,...m}=i;return d.watch(o,GBe(u,s),m)}function GA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:S}=qBe(u);return{stop:YBe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:S}}function KBe(o,s={}){if(!d.isRef(o))return d.toRefs(o);const i=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const u in o.value)i[u]=d.customRef(()=>({get(){return o.value[u]},set(m){var h;if((h=B0(s.replaceRef))!=null?h:!0)if(Array.isArray(o.value)){const C=[...o.value];C[u]=m,o.value=C}else{const C={...o.value,[u]:m};Object.setPrototypeOf(C,Object.getPrototypeOf(o.value)),o.value=C}else o.value[u]=m}}));return i}function xne(o,s=!1){function i(O,{flush:R="sync",deep:I=!1,timeout:W,throwOnTimeout:G}={}){let Q=null;const Z=[new Promise(L=>{Q=d.watch(o,pe=>{O(pe)!==s&&(Q==null||Q(),L(pe))},{flush:R,deep:I,immediate:!0})})];return W!=null&&Z.push(dle(W,G).then(()=>B0(o)).finally(()=>Q==null?void 0:Q())),Promise.race(Z)}function u(O,R){if(!d.isRef(O))return i(pe=>pe===O,R);const{flush:I="sync",deep:W=!1,timeout:G,throwOnTimeout:Q}=R??{};let q=null;const L=[new Promise(pe=>{q=d.watch([o,O],([Ke,Be])=>{s!==(Ke===Be)&&(q==null||q(),pe(Ke))},{flush:I,deep:W,immediate:!0})})];return G!=null&&L.push(dle(G,Q).then(()=>B0(o)).finally(()=>(q==null||q(),B0(o)))),Promise.race(L)}function m(O){return i(R=>!!R,O)}function h(O){return u(null,O)}function b(O){return u(void 0,O)}function C(O){return i(Number.isNaN,O)}function S(O,R){return i(I=>{const W=Array.from(I);return W.includes(O)||W.includes(B0(O))},R)}function _(O){return N(1,O)}function N(O=1,R){let I=-1;return i(()=>(I+=1,I>=O),R)}return Array.isArray(B0(o))?{toMatch:i,toContains:S,changed:_,changedTimes:N,get not(){return xne(o,!s)}}:{toMatch:i,toBe:u,toBeTruthy:m,toBeNull:h,toBeNaN:C,toBeUndefined:b,changed:_,changedTimes:N,get not(){return xne(o,!s)}}}function Ene(o){return xne(o)}function XBe(o){var s;const i=B0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const Wfe=zBe?window:void 0;function Zfe(...o){let s,i,u,m;if(typeof o[0]=="string"||Array.isArray(o[0])?([i,u,m]=o,s=Wfe):[s,i,u,m]=o,!s)return ZBe;Array.isArray(i)||(i=[i]),Array.isArray(u)||(u=[u]);const h=[],b=()=>{h.forEach(N=>N()),h.length=0},C=(N,O,R,I)=>(N.addEventListener(O,R,I),()=>N.removeEventListener(O,R,I)),S=d.watch(()=>[XBe(s),B0(m)],([N,O])=>{if(b(),!N)return;const R=WBe(O)?{...O}:O;h.push(...i.flatMap(I=>u.map(W=>C(N,I,W,R))))},{immediate:!0,flush:"post"}),_=()=>{S(),b()};return RU(_),_}function JBe(o){return typeof o=="function"?o:typeof o=="string"?s=>s.key===o:Array.isArray(o)?s=>o.includes(s.key):()=>!0}function fle(...o){let s,i,u={};o.length===3?(s=o[0],i=o[1],u=o[2]):o.length===2?typeof o[1]=="object"?(s=!0,i=o[0],u=o[1]):(s=o[0],i=o[1]):(s=!0,i=o[0]);const{target:m=Wfe,eventName:h="keydown",passive:b=!1,dedupe:C=!1}=u,S=JBe(s);return Zfe(m,h,N=>{N.repeat&&B0(C)||S(N)&&i(N)},b)}function QBe(o){return JSON.parse(JSON.stringify(o))}function vte(o,s,i,u={}){var m,h,b;const{clone:C=!1,passive:S=!1,eventName:_,deep:N=!1,defaultValue:O,shouldEmit:R}=u,I=d.getCurrentInstance(),W=i||(I==null?void 0:I.emit)||((m=I==null?void 0:I.$emit)==null?void 0:m.bind(I))||((b=(h=I==null?void 0:I.proxy)==null?void 0:h.$emit)==null?void 0:b.bind(I==null?void 0:I.proxy));let G=_;s||(s="modelValue"),G=G||`update:${s.toString()}`;const Q=L=>C?typeof C=="function"?C(L):QBe(L):L,q=()=>UBe(o[s])?Q(o[s]):O,Z=L=>{R?R(L)&&W(G,L):W(G,L)};if(S){const L=q(),pe=d.ref(L);let Ke=!1;return d.watch(()=>o[s],Be=>{Ke||(Ke=!0,pe.value=Q(Be),d.nextTick(()=>Ke=!1))}),d.watch(pe,Be=>{!Ke&&(Be!==o[s]||N)&&Z(Be)},{deep:N}),pe}else return d.computed({get(){return q()},set(L){Z(L)}})}var eRe={value:()=>{}};function IU(){for(var o=0,s=arguments.length,i={},u;o<s;++o){if(!(u=arguments[o]+"")||u in i||/[\s.]/.test(u))throw new Error("illegal type: "+u);i[u]=[]}return new az(i)}function az(o){this._=o}function tRe(o,s){return o.trim().split(/^|\s+/).map(function(i){var u="",m=i.indexOf(".");if(m>=0&&(u=i.slice(m+1),i=i.slice(0,m)),i&&!s.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:u}})}az.prototype=IU.prototype={constructor:az,on:function(o,s){var i=this._,u=tRe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=nRe(i[m],o.name)))return m;return}if(s!=null&&typeof s!="function")throw new Error("invalid callback: "+s);for(;++h<b;)if(m=(o=u[h]).type)i[m]=mle(i[m],o.name,s);else if(s==null)for(m in i)i[m]=mle(i[m],o.name,null);return this},copy:function(){var o={},s=this._;for(var i in s)o[i]=s[i].slice();return new az(o)},call:function(o,s){if((m=arguments.length-2)>0)for(var i=new Array(m),u=0,m,h;u<m;++u)i[u]=arguments[u+2];if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(h=this._[o],u=0,m=h.length;u<m;++u)h[u].value.apply(s,i)},apply:function(o,s,i){if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(var u=this._[o],m=0,h=u.length;m<h;++m)u[m].value.apply(s,i)}};function nRe(o,s){for(var i=0,u=o.length,m;i<u;++i)if((m=o[i]).name===s)return m.value}function mle(o,s,i){for(var u=0,m=o.length;u<m;++u)if(o[u].name===s){o[u]=eRe,o=o.slice(0,u).concat(o.slice(u+1));break}return i!=null&&o.push({name:s,value:i}),o}var _ne="http://www.w3.org/1999/xhtml";const ple={svg:"http://www.w3.org/2000/svg",xhtml:_ne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function PU(o){var s=o+="",i=s.indexOf(":");return i>=0&&(s=o.slice(0,i))!=="xmlns"&&(o=o.slice(i+1)),ple.hasOwnProperty(s)?{space:ple[s],local:o}:o}function oRe(o){return function(){var s=this.ownerDocument,i=this.namespaceURI;return i===_ne&&s.documentElement.namespaceURI===_ne?s.createElement(o):s.createElementNS(i,o)}}function sRe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Gfe(o){var s=PU(o);return(s.local?sRe:oRe)(s)}function rRe(){}function Loe(o){return o==null?rRe:function(){return this.querySelector(o)}}function aRe(o){typeof o!="function"&&(o=Loe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=new Array(b),S,_,N=0;N<b;++N)(S=h[N])&&(_=o.call(S,S.__data__,N,h))&&("__data__"in S&&(_.__data__=S.__data__),C[N]=_);return new Sp(u,this._parents)}function iRe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function lRe(){return[]}function qfe(o){return o==null?lRe:function(){return this.querySelectorAll(o)}}function cRe(o){return function(){return iRe(o.apply(this,arguments))}}function uRe(o){typeof o=="function"?o=cRe(o):o=qfe(o);for(var s=this._groups,i=s.length,u=[],m=[],h=0;h<i;++h)for(var b=s[h],C=b.length,S,_=0;_<C;++_)(S=b[_])&&(u.push(o.call(S,S.__data__,_,b)),m.push(S));return new Sp(u,m)}function Yfe(o){return function(){return this.matches(o)}}function Kfe(o){return function(s){return s.matches(o)}}var dRe=Array.prototype.find;function fRe(o){return function(){return dRe.call(this.children,o)}}function mRe(){return this.firstElementChild}function pRe(o){return this.select(o==null?mRe:fRe(typeof o=="function"?o:Kfe(o)))}var gRe=Array.prototype.filter;function hRe(){return Array.from(this.children)}function vRe(o){return function(){return gRe.call(this.children,o)}}function bRe(o){return this.selectAll(o==null?hRe:vRe(typeof o=="function"?o:Kfe(o)))}function yRe(o){typeof o!="function"&&(o=Yfe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],S,_=0;_<b;++_)(S=h[_])&&o.call(S,S.__data__,_,h)&&C.push(S);return new Sp(u,this._parents)}function Xfe(o){return new Array(o.length)}function wRe(){return new Sp(this._enter||this._groups.map(Xfe),this._parents)}function Rz(o,s){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=s}Rz.prototype={constructor:Rz,appendChild:function(o){return this._parent.insertBefore(o,this._next)},insertBefore:function(o,s){return this._parent.insertBefore(o,s)},querySelector:function(o){return this._parent.querySelector(o)},querySelectorAll:function(o){return this._parent.querySelectorAll(o)}};function CRe(o){return function(){return o}}function SRe(o,s,i,u,m,h){for(var b=0,C,S=s.length,_=h.length;b<_;++b)(C=s[b])?(C.__data__=h[b],u[b]=C):i[b]=new Rz(o,h[b]);for(;b<S;++b)(C=s[b])&&(m[b]=C)}function xRe(o,s,i,u,m,h,b){var C,S,_=new Map,N=s.length,O=h.length,R=new Array(N),I;for(C=0;C<N;++C)(S=s[C])&&(R[C]=I=b.call(S,S.__data__,C,s)+"",_.has(I)?m[C]=S:_.set(I,S));for(C=0;C<O;++C)I=b.call(o,h[C],C,h)+"",(S=_.get(I))?(u[C]=S,S.__data__=h[C],_.delete(I)):i[C]=new Rz(o,h[C]);for(C=0;C<N;++C)(S=s[C])&&_.get(R[C])===S&&(m[C]=S)}function ERe(o){return o.__data__}function _Re(o,s){if(!arguments.length)return Array.from(this,ERe);var i=s?xRe:SRe,u=this._parents,m=this._groups;typeof o!="function"&&(o=CRe(o));for(var h=m.length,b=new Array(h),C=new Array(h),S=new Array(h),_=0;_<h;++_){var N=u[_],O=m[_],R=O.length,I=kRe(o.call(N,N&&N.__data__,_,u)),W=I.length,G=C[_]=new Array(W),Q=b[_]=new Array(W),q=S[_]=new Array(R);i(N,O,G,Q,q,I,s);for(var Z=0,L=0,pe,Ke;Z<W;++Z)if(pe=G[Z]){for(Z>=L&&(L=Z+1);!(Ke=Q[L])&&++L<W;);pe._next=Ke||null}}return b=new Sp(b,u),b._enter=C,b._exit=S,b}function kRe(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function TRe(){return new Sp(this._exit||this._groups.map(Xfe),this._parents)}function ARe(o,s,i){var u=this.enter(),m=this,h=this.exit();return typeof o=="function"?(u=o(u),u&&(u=u.selection())):u=u.append(o+""),s!=null&&(m=s(m),m&&(m=m.selection())),i==null?h.remove():i(h),u&&m?u.merge(m).order():m}function NRe(o){for(var s=o.selection?o.selection():o,i=this._groups,u=s._groups,m=i.length,h=u.length,b=Math.min(m,h),C=new Array(m),S=0;S<b;++S)for(var _=i[S],N=u[S],O=_.length,R=C[S]=new Array(O),I,W=0;W<O;++W)(I=_[W]||N[W])&&(R[W]=I);for(;S<m;++S)C[S]=i[S];return new Sp(C,this._parents)}function ORe(){for(var o=this._groups,s=-1,i=o.length;++s<i;)for(var u=o[s],m=u.length-1,h=u[m],b;--m>=0;)(b=u[m])&&(h&&b.compareDocumentPosition(h)^4&&h.parentNode.insertBefore(b,h),h=b);return this}function $Re(o){o||(o=DRe);function s(O,R){return O&&R?o(O.__data__,R.__data__):!O-!R}for(var i=this._groups,u=i.length,m=new Array(u),h=0;h<u;++h){for(var b=i[h],C=b.length,S=m[h]=new Array(C),_,N=0;N<C;++N)(_=b[N])&&(S[N]=_);S.sort(s)}return new Sp(m,this._parents).order()}function DRe(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function MRe(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function BRe(){return Array.from(this)}function RRe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length;m<h;++m){var b=u[m];if(b)return b}return null}function IRe(){let o=0;for(const s of this)++o;return o}function PRe(){return!this.node()}function FRe(o){for(var s=this._groups,i=0,u=s.length;i<u;++i)for(var m=s[i],h=0,b=m.length,C;h<b;++h)(C=m[h])&&o.call(C,C.__data__,h,m);return this}function LRe(o){return function(){this.removeAttribute(o)}}function VRe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function HRe(o,s){return function(){this.setAttribute(o,s)}}function zRe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function URe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function jRe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttributeNS(o.space,o.local):this.setAttributeNS(o.space,o.local,i)}}function WRe(o,s){var i=PU(o);if(arguments.length<2){var u=this.node();return i.local?u.getAttributeNS(i.space,i.local):u.getAttribute(i)}return this.each((s==null?i.local?VRe:LRe:typeof s=="function"?i.local?jRe:URe:i.local?zRe:HRe)(i,s))}function Jfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function ZRe(o){return function(){this.style.removeProperty(o)}}function GRe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function qRe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function YRe(o,s,i){return arguments.length>1?this.each((s==null?ZRe:typeof s=="function"?qRe:GRe)(o,s,i??"")):g4(this.node(),o)}function g4(o,s){return o.style.getPropertyValue(s)||Jfe(o).getComputedStyle(o,null).getPropertyValue(s)}function KRe(o){return function(){delete this[o]}}function XRe(o,s){return function(){this[o]=s}}function JRe(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function QRe(o,s){return arguments.length>1?this.each((s==null?KRe:typeof s=="function"?JRe:XRe)(o,s)):this.node()[o]}function Qfe(o){return o.trim().split(/^|\s+/)}function Voe(o){return o.classList||new eme(o)}function eme(o){this._node=o,this._names=Qfe(o.getAttribute("class")||"")}eme.prototype={add:function(o){var s=this._names.indexOf(o);s<0&&(this._names.push(o),this._node.setAttribute("class",this._names.join(" ")))},remove:function(o){var s=this._names.indexOf(o);s>=0&&(this._names.splice(s,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(o){return this._names.indexOf(o)>=0}};function tme(o,s){for(var i=Voe(o),u=-1,m=s.length;++u<m;)i.add(s[u])}function nme(o,s){for(var i=Voe(o),u=-1,m=s.length;++u<m;)i.remove(s[u])}function eIe(o){return function(){tme(this,o)}}function tIe(o){return function(){nme(this,o)}}function nIe(o,s){return function(){(s.apply(this,arguments)?tme:nme)(this,o)}}function oIe(o,s){var i=Qfe(o+"");if(arguments.length<2){for(var u=Voe(this.node()),m=-1,h=i.length;++m<h;)if(!u.contains(i[m]))return!1;return!0}return this.each((typeof s=="function"?nIe:s?eIe:tIe)(i,s))}function sIe(){this.textContent=""}function rIe(o){return function(){this.textContent=o}}function aIe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function iIe(o){return arguments.length?this.each(o==null?sIe:(typeof o=="function"?aIe:rIe)(o)):this.node().textContent}function lIe(){this.innerHTML=""}function cIe(o){return function(){this.innerHTML=o}}function uIe(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function dIe(o){return arguments.length?this.each(o==null?lIe:(typeof o=="function"?uIe:cIe)(o)):this.node().innerHTML}function fIe(){this.nextSibling&&this.parentNode.appendChild(this)}function mIe(){return this.each(fIe)}function pIe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function gIe(){return this.each(pIe)}function hIe(o){var s=typeof o=="function"?o:Gfe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function vIe(){return null}function bIe(o,s){var i=typeof o=="function"?o:Gfe(o),u=s==null?vIe:typeof s=="function"?s:Loe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function yIe(){var o=this.parentNode;o&&o.removeChild(this)}function wIe(){return this.each(yIe)}function CIe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function SIe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function xIe(o){return this.select(o?SIe:CIe)}function EIe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function _Ie(o){return function(s){o.call(this,s,this.__data__)}}function kIe(o){return o.trim().split(/^|\s+/).map(function(s){var i="",u=s.indexOf(".");return u>=0&&(i=s.slice(u+1),s=s.slice(0,u)),{type:s,name:i}})}function TIe(o){return function(){var s=this.__on;if(s){for(var i=0,u=-1,m=s.length,h;i<m;++i)h=s[i],(!o.type||h.type===o.type)&&h.name===o.name?this.removeEventListener(h.type,h.listener,h.options):s[++u]=h;++u?s.length=u:delete this.__on}}}function AIe(o,s,i){return function(){var u=this.__on,m,h=_Ie(s);if(u){for(var b=0,C=u.length;b<C;++b)if((m=u[b]).type===o.type&&m.name===o.name){this.removeEventListener(m.type,m.listener,m.options),this.addEventListener(m.type,m.listener=h,m.options=i),m.value=s;return}}this.addEventListener(o.type,h,i),m={type:o.type,name:o.name,value:s,listener:h,options:i},u?u.push(m):this.__on=[m]}}function NIe(o,s,i){var u=kIe(o+""),m,h=u.length,b;if(arguments.length<2){var C=this.node().__on;if(C){for(var S=0,_=C.length,N;S<_;++S)for(m=0,N=C[S];m<h;++m)if((b=u[m]).type===N.type&&b.name===N.name)return N.value}return}for(C=s?AIe:TIe,m=0;m<h;++m)this.each(C(u[m],s,i));return this}function ome(o,s,i){var u=Jfe(o),m=u.CustomEvent;typeof m=="function"?m=new m(s,i):(m=u.document.createEvent("Event"),i?(m.initEvent(s,i.bubbles,i.cancelable),m.detail=i.detail):m.initEvent(s,!1,!1)),o.dispatchEvent(m)}function OIe(o,s){return function(){return ome(this,o,s)}}function $Ie(o,s){return function(){return ome(this,o,s.apply(this,arguments))}}function DIe(o,s){return this.each((typeof s=="function"?$Ie:OIe)(o,s))}function*MIe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length,b;m<h;++m)(b=u[m])&&(yield b)}var sme=[null];function Sp(o,s){this._groups=o,this._parents=s}function PB(){return new Sp([[document.documentElement]],sme)}function BIe(){return this}Sp.prototype=PB.prototype={constructor:Sp,select:aRe,selectAll:uRe,selectChild:pRe,selectChildren:bRe,filter:yRe,data:_Re,enter:wRe,exit:TRe,join:ARe,merge:NRe,selection:BIe,order:ORe,sort:$Re,call:MRe,nodes:BRe,node:RRe,size:IRe,empty:PRe,each:FRe,attr:WRe,style:YRe,property:QRe,classed:oIe,text:iIe,html:dIe,raise:mIe,lower:gIe,append:hIe,insert:bIe,remove:wIe,clone:xIe,datum:EIe,on:NIe,dispatch:DIe,[Symbol.iterator]:MIe};function Mh(o){return typeof o=="string"?new Sp([[document.querySelector(o)]],[document.documentElement]):new Sp([[o]],sme)}function RIe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Ov(o,s){if(o=RIe(o),s===void 0&&(s=o.currentTarget),s){var i=s.ownerSVGElement||s;if(i.createSVGPoint){var u=i.createSVGPoint();return u.x=o.clientX,u.y=o.clientY,u=u.matrixTransform(s.getScreenCTM().inverse()),[u.x,u.y]}if(s.getBoundingClientRect){var m=s.getBoundingClientRect();return[o.clientX-m.left-s.clientLeft,o.clientY-m.top-s.clientTop]}}return[o.pageX,o.pageY]}const IIe={passive:!1},fB={capture:!0,passive:!1};function bte(o){o.stopImmediatePropagation()}function a4(o){o.preventDefault(),o.stopImmediatePropagation()}function rme(o){var s=o.document.documentElement,i=Mh(o).on("dragstart.drag",a4,fB);"onselectstart"in s?i.on("selectstart.drag",a4,fB):(s.__noselect=s.style.MozUserSelect,s.style.MozUserSelect="none")}function ame(o,s){var i=o.document.documentElement,u=Mh(o).on("dragstart.drag",null);s&&(u.on("click.drag",a4,fB),setTimeout(function(){u.on("click.drag",null)},0)),"onselectstart"in i?u.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const RH=o=>()=>o;function kne(o,{sourceEvent:s,subject:i,target:u,identifier:m,active:h,x:b,y:C,dx:S,dy:_,dispatch:N}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:u,enumerable:!0,configurable:!0},identifier:{value:m,enumerable:!0,configurable:!0},active:{value:h,enumerable:!0,configurable:!0},x:{value:b,enumerable:!0,configurable:!0},y:{value:C,enumerable:!0,configurable:!0},dx:{value:S,enumerable:!0,configurable:!0},dy:{value:_,enumerable:!0,configurable:!0},_:{value:N}})}kne.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function PIe(o){return!o.ctrlKey&&!o.button}function FIe(){return this.parentNode}function LIe(o,s){return s??{x:o.x,y:o.y}}function VIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function HIe(){var o=PIe,s=FIe,i=LIe,u=VIe,m={},h=IU("start","drag","end"),b=0,C,S,_,N,O=0;function R(pe){pe.on("mousedown.drag",I).filter(u).on("touchstart.drag",Q).on("touchmove.drag",q,IIe).on("touchend.drag touchcancel.drag",Z).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function I(pe,Ke){if(!(N||!o.call(this,pe,Ke))){var Be=L(this,s.call(this,pe,Ke),pe,Ke,"mouse");Be&&(Mh(pe.view).on("mousemove.drag",W,fB).on("mouseup.drag",G,fB),rme(pe.view),bte(pe),_=!1,C=pe.clientX,S=pe.clientY,Be("start",pe))}}function W(pe){if(a4(pe),!_){var Ke=pe.clientX-C,Be=pe.clientY-S;_=Ke*Ke+Be*Be>O}m.mouse("drag",pe)}function G(pe){Mh(pe.view).on("mousemove.drag mouseup.drag",null),ame(pe.view,_),a4(pe),m.mouse("end",pe)}function Q(pe,Ke){if(o.call(this,pe,Ke)){var Be=pe.changedTouches,Y=s.call(this,pe,Ke),ke=Be.length,et,je;for(et=0;et<ke;++et)(je=L(this,Y,pe,Ke,Be[et].identifier,Be[et]))&&(bte(pe),je("start",pe,Be[et]))}}function q(pe){var Ke=pe.changedTouches,Be=Ke.length,Y,ke;for(Y=0;Y<Be;++Y)(ke=m[Ke[Y].identifier])&&(a4(pe),ke("drag",pe,Ke[Y]))}function Z(pe){var Ke=pe.changedTouches,Be=Ke.length,Y,ke;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),Y=0;Y<Be;++Y)(ke=m[Ke[Y].identifier])&&(bte(pe),ke("end",pe,Ke[Y]))}function L(pe,Ke,Be,Y,ke,et){var je=h.copy(),Ce=Ov(et||Be,Ke),ce,Dt,me;if((me=i.call(pe,new kne("beforestart",{sourceEvent:Be,target:R,identifier:ke,active:b,x:Ce[0],y:Ce[1],dx:0,dy:0,dispatch:je}),Y))!=null)return ce=me.x-Ce[0]||0,Dt=me.y-Ce[1]||0,function be($,_e,le){var He=Ce,Ge;switch($){case"start":m[ke]=be,Ge=b++;break;case"end":delete m[ke],--b;case"drag":Ce=Ov(le||_e,Ke),Ge=b;break}je.call($,pe,new kne($,{sourceEvent:_e,subject:me,target:R,identifier:ke,active:Ge,x:Ce[0]+ce,y:Ce[1]+Dt,dx:Ce[0]-He[0],dy:Ce[1]-He[1],dispatch:je}),Y)}}return R.filter=function(pe){return arguments.length?(o=typeof pe=="function"?pe:RH(!!pe),R):o},R.container=function(pe){return arguments.length?(s=typeof pe=="function"?pe:RH(pe),R):s},R.subject=function(pe){return arguments.length?(i=typeof pe=="function"?pe:RH(pe),R):i},R.touchable=function(pe){return arguments.length?(u=typeof pe=="function"?pe:RH(!!pe),R):u},R.on=function(){var pe=h.on.apply(h,arguments);return pe===h?R:pe},R.clickDistance=function(pe){return arguments.length?(O=(pe=+pe)*pe,R):Math.sqrt(O)},R}function Hoe(o,s,i){o.prototype=s.prototype=i,i.constructor=o}function ime(o,s){var i=Object.create(o.prototype);for(var u in s)i[u]=s[u];return i}function FB(){}var mB=.7,Iz=1/mB,i4="\\s*([+-]?\\d+)\\s*",pB="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zIe=/^#([0-9a-f]{3,8})$/,UIe=new RegExp(`^rgb\\(${i4},${i4},${i4}\\)$`),jIe=new RegExp(`^rgb\\(${Mv},${Mv},${Mv}\\)$`),WIe=new RegExp(`^rgba\\(${i4},${i4},${i4},${pB}\\)$`),ZIe=new RegExp(`^rgba\\(${Mv},${Mv},${Mv},${pB}\\)$`),GIe=new RegExp(`^hsl\\(${pB},${Mv},${Mv}\\)$`),qIe=new RegExp(`^hsla\\(${pB},${Mv},${Mv},${pB}\\)$`),gle={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Hoe(FB,gB,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:hle,formatHex:hle,formatHex8:YIe,formatHsl:KIe,formatRgb:vle,toString:vle});function hle(){return this.rgb().formatHex()}function YIe(){return this.rgb().formatHex8()}function KIe(){return lme(this).formatHsl()}function vle(){return this.rgb().formatRgb()}function gB(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=zIe.exec(o))?(i=s[1].length,s=parseInt(s[1],16),i===6?ble(s):i===3?new Sm(s>>8&15|s>>4&240,s>>4&15|s&240,(s&15)<<4|s&15,1):i===8?IH(s>>24&255,s>>16&255,s>>8&255,(s&255)/255):i===4?IH(s>>12&15|s>>8&240,s>>8&15|s>>4&240,s>>4&15|s&240,((s&15)<<4|s&15)/255):null):(s=UIe.exec(o))?new Sm(s[1],s[2],s[3],1):(s=jIe.exec(o))?new Sm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=WIe.exec(o))?IH(s[1],s[2],s[3],s[4]):(s=ZIe.exec(o))?IH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=GIe.exec(o))?Cle(s[1],s[2]/100,s[3]/100,1):(s=qIe.exec(o))?Cle(s[1],s[2]/100,s[3]/100,s[4]):gle.hasOwnProperty(o)?ble(gle[o]):o==="transparent"?new Sm(NaN,NaN,NaN,0):null}function ble(o){return new Sm(o>>16&255,o>>8&255,o&255,1)}function IH(o,s,i,u){return u<=0&&(o=s=i=NaN),new Sm(o,s,i,u)}function XIe(o){return o instanceof FB||(o=gB(o)),o?(o=o.rgb(),new Sm(o.r,o.g,o.b,o.opacity)):new Sm}function Tne(o,s,i,u){return arguments.length===1?XIe(o):new Sm(o,s,i,u??1)}function Sm(o,s,i,u){this.r=+o,this.g=+s,this.b=+i,this.opacity=+u}Hoe(Sm,Tne,ime(FB,{brighter(o){return o=o==null?Iz:Math.pow(Iz,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},darker(o){return o=o==null?mB:Math.pow(mB,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},rgb(){return this},clamp(){return new Sm(_E(this.r),_E(this.g),_E(this.b),Pz(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yle,formatHex:yle,formatHex8:JIe,formatRgb:wle,toString:wle}));function yle(){return`#${bE(this.r)}${bE(this.g)}${bE(this.b)}`}function JIe(){return`#${bE(this.r)}${bE(this.g)}${bE(this.b)}${bE((isNaN(this.opacity)?1:this.opacity)*255)}`}function wle(){const o=Pz(this.opacity);return`${o===1?"rgb(":"rgba("}${_E(this.r)}, ${_E(this.g)}, ${_E(this.b)}${o===1?")":`, ${o})`}`}function Pz(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function _E(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function bE(o){return o=_E(o),(o<16?"0":"")+o.toString(16)}function Cle(o,s,i,u){return u<=0?o=s=i=NaN:i<=0||i>=1?o=s=NaN:s<=0&&(o=NaN),new Bh(o,s,i,u)}function lme(o){if(o instanceof Bh)return new Bh(o.h,o.s,o.l,o.opacity);if(o instanceof FB||(o=gB(o)),!o)return new Bh;if(o instanceof Bh)return o;o=o.rgb();var s=o.r/255,i=o.g/255,u=o.b/255,m=Math.min(s,i,u),h=Math.max(s,i,u),b=NaN,C=h-m,S=(h+m)/2;return C?(s===h?b=(i-u)/C+(i<u)*6:i===h?b=(u-s)/C+2:b=(s-i)/C+4,C/=S<.5?h+m:2-h-m,b*=60):C=S>0&&S<1?0:b,new Bh(b,C,S,o.opacity)}function QIe(o,s,i,u){return arguments.length===1?lme(o):new Bh(o,s,i,u??1)}function Bh(o,s,i,u){this.h=+o,this.s=+s,this.l=+i,this.opacity=+u}Hoe(Bh,QIe,ime(FB,{brighter(o){return o=o==null?Iz:Math.pow(Iz,o),new Bh(this.h,this.s,this.l*o,this.opacity)},darker(o){return o=o==null?mB:Math.pow(mB,o),new Bh(this.h,this.s,this.l*o,this.opacity)},rgb(){var o=this.h%360+(this.h<0)*360,s=isNaN(o)||isNaN(this.s)?0:this.s,i=this.l,u=i+(i<.5?i:1-i)*s,m=2*i-u;return new Sm(yte(o>=240?o-240:o+120,m,u),yte(o,m,u),yte(o<120?o+240:o-120,m,u),this.opacity)},clamp(){return new Bh(Sle(this.h),PH(this.s),PH(this.l),Pz(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const o=Pz(this.opacity);return`${o===1?"hsl(":"hsla("}${Sle(this.h)}, ${PH(this.s)*100}%, ${PH(this.l)*100}%${o===1?")":`, ${o})`}`}}));function Sle(o){return o=(o||0)%360,o<0?o+360:o}function PH(o){return Math.max(0,Math.min(1,o||0))}function yte(o,s,i){return(o<60?s+(i-s)*o/60:o<180?i:o<240?s+(i-s)*(240-o)/60:s)*255}const cme=o=>()=>o;function ePe(o,s){return function(i){return o+i*s}}function tPe(o,s,i){return o=Math.pow(o,i),s=Math.pow(s,i)-o,i=1/i,function(u){return Math.pow(o+u*s,i)}}function nPe(o){return(o=+o)==1?ume:function(s,i){return i-s?tPe(s,i,o):cme(isNaN(s)?i:s)}}function ume(o,s){var i=s-o;return i?ePe(o,i):cme(isNaN(o)?s:o)}const xle=function o(s){var i=nPe(s);function u(m,h){var b=i((m=Tne(m)).r,(h=Tne(h)).r),C=i(m.g,h.g),S=i(m.b,h.b),_=ume(m.opacity,h.opacity);return function(N){return m.r=b(N),m.g=C(N),m.b=S(N),m.opacity=_(N),m+""}}return u.gamma=o,u}(1);function r2(o,s){return o=+o,s=+s,function(i){return o*(1-i)+s*i}}var Ane=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wte=new RegExp(Ane.source,"g");function oPe(o){return function(){return o}}function sPe(o){return function(s){return o(s)+""}}function rPe(o,s){var i=Ane.lastIndex=wte.lastIndex=0,u,m,h,b=-1,C=[],S=[];for(o=o+"",s=s+"";(u=Ane.exec(o))&&(m=wte.exec(s));)(h=m.index)>i&&(h=s.slice(i,h),C[b]?C[b]+=h:C[++b]=h),(u=u[0])===(m=m[0])?C[b]?C[b]+=m:C[++b]=m:(C[++b]=null,S.push({i:b,x:r2(u,m)})),i=wte.lastIndex;return i<s.length&&(h=s.slice(i),C[b]?C[b]+=h:C[++b]=h),C.length<2?S[0]?sPe(S[0].x):oPe(s):(s=S.length,function(_){for(var N=0,O;N<s;++N)C[(O=S[N]).i]=O.x(_);return C.join("")})}var Ele=180/Math.PI,Nne={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dme(o,s,i,u,m,h){var b,C,S;return(b=Math.sqrt(o*o+s*s))&&(o/=b,s/=b),(S=o*i+s*u)&&(i-=o*S,u-=s*S),(C=Math.sqrt(i*i+u*u))&&(i/=C,u/=C,S/=C),o*u<s*i&&(o=-o,s=-s,S=-S,b=-b),{translateX:m,translateY:h,rotate:Math.atan2(s,o)*Ele,skewX:Math.atan(S)*Ele,scaleX:b,scaleY:C}}var FH;function aPe(o){const s=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return s.isIdentity?Nne:dme(s.a,s.b,s.c,s.d,s.e,s.f)}function iPe(o){return o==null||(FH||(FH=document.createElementNS("http://www.w3.org/2000/svg","g")),FH.setAttribute("transform",o),!(o=FH.transform.baseVal.consolidate()))?Nne:(o=o.matrix,dme(o.a,o.b,o.c,o.d,o.e,o.f))}function fme(o,s,i,u){function m(_){return _.length?_.pop()+" ":""}function h(_,N,O,R,I,W){if(_!==O||N!==R){var G=I.push("translate(",null,s,null,i);W.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,R)})}else(O||R)&&I.push("translate("+O+s+R+i)}function b(_,N,O,R){_!==N?(_-N>180?N+=360:N-_>180&&(_+=360),R.push({i:O.push(m(O)+"rotate(",null,u)-2,x:r2(_,N)})):N&&O.push(m(O)+"rotate("+N+u)}function C(_,N,O,R){_!==N?R.push({i:O.push(m(O)+"skewX(",null,u)-2,x:r2(_,N)}):N&&O.push(m(O)+"skewX("+N+u)}function S(_,N,O,R,I,W){if(_!==O||N!==R){var G=I.push(m(I)+"scale(",null,",",null,")");W.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,R)})}else(O!==1||R!==1)&&I.push(m(I)+"scale("+O+","+R+")")}return function(_,N){var O=[],R=[];return _=o(_),N=o(N),h(_.translateX,_.translateY,N.translateX,N.translateY,O,R),b(_.rotate,N.rotate,O,R),C(_.skewX,N.skewX,O,R),S(_.scaleX,_.scaleY,N.scaleX,N.scaleY,O,R),_=N=null,function(I){for(var W=-1,G=R.length,Q;++W<G;)O[(Q=R[W]).i]=Q.x(I);return O.join("")}}}var lPe=fme(aPe,"px, ","px)","deg)"),cPe=fme(iPe,", ",")",")"),uPe=1e-12;function _le(o){return((o=Math.exp(o))+1/o)/2}function dPe(o){return((o=Math.exp(o))-1/o)/2}function fPe(o){return((o=Math.exp(2*o))-1)/(o+1)}const mPe=function o(s,i,u){function m(h,b){var C=h[0],S=h[1],_=h[2],N=b[0],O=b[1],R=b[2],I=N-C,W=O-S,G=I*I+W*W,Q,q;if(G<uPe)q=Math.log(R/_)/s,Q=function(Y){return[C+Y*I,S+Y*W,_*Math.exp(s*Y*q)]};else{var Z=Math.sqrt(G),L=(R*R-_*_+u*G)/(2*_*i*Z),pe=(R*R-_*_-u*G)/(2*R*i*Z),Ke=Math.log(Math.sqrt(L*L+1)-L),Be=Math.log(Math.sqrt(pe*pe+1)-pe);q=(Be-Ke)/s,Q=function(Y){var ke=Y*q,et=_le(Ke),je=_/(i*Z)*(et*fPe(s*ke+Ke)-dPe(Ke));return[C+je*I,S+je*W,_*et/_le(s*ke+Ke)]}}return Q.duration=q*1e3*s/Math.SQRT2,Q}return m.rho=function(h){var b=Math.max(.001,+h),C=b*b,S=C*C;return o(b,C,S)},m}(Math.SQRT2,2,4);var h4=0,L6=0,I6=0,mme=1e3,Fz,V6,Lz=0,$E=0,FU=0,hB=typeof performance=="object"&&performance.now?performance:Date,pme=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(o){setTimeout(o,17)};function zoe(){return $E||(pme(pPe),$E=hB.now()+FU)}function pPe(){$E=0}function Vz(){this._call=this._time=this._next=null}Vz.prototype=gme.prototype={constructor:Vz,restart:function(o,s,i){if(typeof o!="function")throw new TypeError("callback is not a function");i=(i==null?zoe():+i)+(s==null?0:+s),!this._next&&V6!==this&&(V6?V6._next=this:Fz=this,V6=this),this._call=o,this._time=i,One()},stop:function(){this._call&&(this._call=null,this._time=1/0,One())}};function gme(o,s,i){var u=new Vz;return u.restart(o,s,i),u}function gPe(){zoe(),++h4;for(var o=Fz,s;o;)(s=$E-o._time)>=0&&o._call.call(void 0,s),o=o._next;--h4}function kle(){$E=(Lz=hB.now())+FU,h4=L6=0;try{gPe()}finally{h4=0,vPe(),$E=0}}function hPe(){var o=hB.now(),s=o-Lz;s>mme&&(FU-=s,Lz=o)}function vPe(){for(var o,s=Fz,i,u=1/0;s;)s._call?(u>s._time&&(u=s._time),o=s,s=s._next):(i=s._next,s._next=null,s=o?o._next=i:Fz=i);V6=o,One(u)}function One(o){if(!h4){L6&&(L6=clearTimeout(L6));var s=o-$E;s>24?(o<1/0&&(L6=setTimeout(kle,o-hB.now()-FU)),I6&&(I6=clearInterval(I6))):(I6||(Lz=hB.now(),I6=setInterval(hPe,mme)),h4=1,pme(kle))}}function Tle(o,s,i){var u=new Vz;return s=s==null?0:+s,u.restart(m=>{u.stop(),o(m+s)},s,i),u}var bPe=IU("start","end","cancel","interrupt"),yPe=[],hme=0,Ale=1,$ne=2,iz=3,Nle=4,Dne=5,lz=6;function LU(o,s,i,u,m,h){var b=o.__transition;if(!b)o.__transition={};else if(i in b)return;wPe(o,i,{name:s,index:u,group:m,on:bPe,tween:yPe,time:h.time,delay:h.delay,duration:h.duration,ease:h.ease,timer:null,state:hme})}function Uoe(o,s){var i=Fh(o,s);if(i.state>hme)throw new Error("too late; already scheduled");return i}function Fv(o,s){var i=Fh(o,s);if(i.state>iz)throw new Error("too late; already running");return i}function Fh(o,s){var i=o.__transition;if(!i||!(i=i[s]))throw new Error("transition not found");return i}function wPe(o,s,i){var u=o.__transition,m;u[s]=i,i.timer=gme(h,0,i.time);function h(_){i.state=Ale,i.timer.restart(b,i.delay,i.time),i.delay<=_&&b(_-i.delay)}function b(_){var N,O,R,I;if(i.state!==Ale)return S();for(N in u)if(I=u[N],I.name===i.name){if(I.state===iz)return Tle(b);I.state===Nle?(I.state=lz,I.timer.stop(),I.on.call("interrupt",o,o.__data__,I.index,I.group),delete u[N]):+N<s&&(I.state=lz,I.timer.stop(),I.on.call("cancel",o,o.__data__,I.index,I.group),delete u[N])}if(Tle(function(){i.state===iz&&(i.state=Nle,i.timer.restart(C,i.delay,i.time),C(_))}),i.state=$ne,i.on.call("start",o,o.__data__,i.index,i.group),i.state===$ne){for(i.state=iz,m=new Array(R=i.tween.length),N=0,O=-1;N<R;++N)(I=i.tween[N].value.call(o,o.__data__,i.index,i.group))&&(m[++O]=I);m.length=O+1}}function C(_){for(var N=_<i.duration?i.ease.call(null,_/i.duration):(i.timer.restart(S),i.state=Dne,1),O=-1,R=m.length;++O<R;)m[O].call(o,N);i.state===Dne&&(i.on.call("end",o,o.__data__,i.index,i.group),S())}function S(){i.state=lz,i.timer.stop(),delete u[s];for(var _ in u)return;delete o.__transition}}function cz(o,s){var i=o.__transition,u,m,h=!0,b;if(i){s=s==null?null:s+"";for(b in i){if((u=i[b]).name!==s){h=!1;continue}m=u.state>$ne&&u.state<Dne,u.state=lz,u.timer.stop(),u.on.call(m?"interrupt":"cancel",o,o.__data__,u.index,u.group),delete i[b]}h&&delete o.__transition}}function CPe(o){return this.each(function(){cz(this,o)})}function SPe(o,s){var i,u;return function(){var m=Fv(this,o),h=m.tween;if(h!==i){u=i=h;for(var b=0,C=u.length;b<C;++b)if(u[b].name===s){u=u.slice(),u.splice(b,1);break}}m.tween=u}}function xPe(o,s,i){var u,m;if(typeof i!="function")throw new Error;return function(){var h=Fv(this,o),b=h.tween;if(b!==u){m=(u=b).slice();for(var C={name:s,value:i},S=0,_=m.length;S<_;++S)if(m[S].name===s){m[S]=C;break}S===_&&m.push(C)}h.tween=m}}function EPe(o,s){var i=this._id;if(o+="",arguments.length<2){for(var u=Fh(this.node(),i).tween,m=0,h=u.length,b;m<h;++m)if((b=u[m]).name===o)return b.value;return null}return this.each((s==null?SPe:xPe)(i,o,s))}function joe(o,s,i){var u=o._id;return o.each(function(){var m=Fv(this,u);(m.value||(m.value={}))[s]=i.apply(this,arguments)}),function(m){return Fh(m,u).value[s]}}function vme(o,s){var i;return(typeof s=="number"?r2:s instanceof gB?xle:(i=gB(s))?(s=i,xle):rPe)(o,s)}function _Pe(o){return function(){this.removeAttribute(o)}}function kPe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function TPe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttribute(o);return b===m?null:b===u?h:h=s(u=b,i)}}function APe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttributeNS(o.space,o.local);return b===m?null:b===u?h:h=s(u=b,i)}}function NPe(o,s,i){var u,m,h;return function(){var b,C=i(this),S;return C==null?void this.removeAttribute(o):(b=this.getAttribute(o),S=C+"",b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C)))}}function OPe(o,s,i){var u,m,h;return function(){var b,C=i(this),S;return C==null?void this.removeAttributeNS(o.space,o.local):(b=this.getAttributeNS(o.space,o.local),S=C+"",b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C)))}}function $Pe(o,s){var i=PU(o),u=i==="transform"?cPe:vme;return this.attrTween(o,typeof s=="function"?(i.local?OPe:NPe)(i,u,joe(this,"attr."+o,s)):s==null?(i.local?kPe:_Pe)(i):(i.local?APe:TPe)(i,u,s))}function DPe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function MPe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function BPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&MPe(o,h)),i}return m._value=s,m}function RPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&DPe(o,h)),i}return m._value=s,m}function IPe(o,s){var i="attr."+o;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(s==null)return this.tween(i,null);if(typeof s!="function")throw new Error;var u=PU(o);return this.tween(i,(u.local?BPe:RPe)(u,s))}function PPe(o,s){return function(){Uoe(this,o).delay=+s.apply(this,arguments)}}function FPe(o,s){return s=+s,function(){Uoe(this,o).delay=s}}function LPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?PPe:FPe)(s,o)):Fh(this.node(),s).delay}function VPe(o,s){return function(){Fv(this,o).duration=+s.apply(this,arguments)}}function HPe(o,s){return s=+s,function(){Fv(this,o).duration=s}}function zPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?VPe:HPe)(s,o)):Fh(this.node(),s).duration}function UPe(o,s){if(typeof s!="function")throw new Error;return function(){Fv(this,o).ease=s}}function jPe(o){var s=this._id;return arguments.length?this.each(UPe(s,o)):Fh(this.node(),s).ease}function WPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Fv(this,o).ease=i}}function ZPe(o){if(typeof o!="function")throw new Error;return this.each(WPe(this._id,o))}function GPe(o){typeof o!="function"&&(o=Yfe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],S,_=0;_<b;++_)(S=h[_])&&o.call(S,S.__data__,_,h)&&C.push(S);return new V0(u,this._parents,this._name,this._id)}function qPe(o){if(o._id!==this._id)throw new Error;for(var s=this._groups,i=o._groups,u=s.length,m=i.length,h=Math.min(u,m),b=new Array(u),C=0;C<h;++C)for(var S=s[C],_=i[C],N=S.length,O=b[C]=new Array(N),R,I=0;I<N;++I)(R=S[I]||_[I])&&(O[I]=R);for(;C<u;++C)b[C]=s[C];return new V0(b,this._parents,this._name,this._id)}function YPe(o){return(o+"").trim().split(/^|\s+/).every(function(s){var i=s.indexOf(".");return i>=0&&(s=s.slice(0,i)),!s||s==="start"})}function KPe(o,s,i){var u,m,h=YPe(s)?Uoe:Fv;return function(){var b=h(this,o),C=b.on;C!==u&&(m=(u=C).copy()).on(s,i),b.on=m}}function XPe(o,s){var i=this._id;return arguments.length<2?Fh(this.node(),i).on.on(o):this.each(KPe(i,o,s))}function JPe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function QPe(){return this.on("end.remove",JPe(this._id))}function e8e(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Loe(o));for(var u=this._groups,m=u.length,h=new Array(m),b=0;b<m;++b)for(var C=u[b],S=C.length,_=h[b]=new Array(S),N,O,R=0;R<S;++R)(N=C[R])&&(O=o.call(N,N.__data__,R,C))&&("__data__"in N&&(O.__data__=N.__data__),_[R]=O,LU(_[R],s,i,R,_,Fh(N,i)));return new V0(h,this._parents,s,i)}function t8e(o){var s=this._name,i=this._id;typeof o!="function"&&(o=qfe(o));for(var u=this._groups,m=u.length,h=[],b=[],C=0;C<m;++C)for(var S=u[C],_=S.length,N,O=0;O<_;++O)if(N=S[O]){for(var R=o.call(N,N.__data__,O,S),I,W=Fh(N,i),G=0,Q=R.length;G<Q;++G)(I=R[G])&&LU(I,s,i,G,R,W);h.push(R),b.push(N)}return new V0(h,b,s,i)}var n8e=PB.prototype.constructor;function o8e(){return new n8e(this._groups,this._parents)}function s8e(o,s){var i,u,m;return function(){var h=g4(this,o),b=(this.style.removeProperty(o),g4(this,o));return h===b?null:h===i&&b===u?m:m=s(i=h,u=b)}}function bme(o){return function(){this.style.removeProperty(o)}}function r8e(o,s,i){var u,m=i+"",h;return function(){var b=g4(this,o);return b===m?null:b===u?h:h=s(u=b,i)}}function a8e(o,s,i){var u,m,h;return function(){var b=g4(this,o),C=i(this),S=C+"";return C==null&&(S=C=(this.style.removeProperty(o),g4(this,o))),b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C))}}function i8e(o,s){var i,u,m,h="style."+s,b="end."+h,C;return function(){var S=Fv(this,o),_=S.on,N=S.value[h]==null?C||(C=bme(s)):void 0;(_!==i||m!==N)&&(u=(i=_).copy()).on(b,m=N),S.on=u}}function l8e(o,s,i){var u=(o+="")=="transform"?lPe:vme;return s==null?this.styleTween(o,s8e(o,u)).on("end.style."+o,bme(o)):typeof s=="function"?this.styleTween(o,a8e(o,u,joe(this,"style."+o,s))).each(i8e(this._id,o)):this.styleTween(o,r8e(o,u,s),i).on("end.style."+o,null)}function c8e(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function u8e(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&c8e(o,b,i)),u}return h._value=s,h}function d8e(o,s,i){var u="style."+(o+="");if(arguments.length<2)return(u=this.tween(u))&&u._value;if(s==null)return this.tween(u,null);if(typeof s!="function")throw new Error;return this.tween(u,u8e(o,s,i??""))}function f8e(o){return function(){this.textContent=o}}function m8e(o){return function(){var s=o(this);this.textContent=s??""}}function p8e(o){return this.tween("text",typeof o=="function"?m8e(joe(this,"text",o)):f8e(o==null?"":o+""))}function g8e(o){return function(s){this.textContent=o.call(this,s)}}function h8e(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&g8e(m)),s}return u._value=o,u}function v8e(o){var s="text";if(arguments.length<1)return(s=this.tween(s))&&s._value;if(o==null)return this.tween(s,null);if(typeof o!="function")throw new Error;return this.tween(s,h8e(o))}function b8e(){for(var o=this._name,s=this._id,i=yme(),u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,S,_=0;_<C;++_)if(S=b[_]){var N=Fh(S,s);LU(S,o,i,_,b,{time:N.time+N.delay+N.duration,delay:0,duration:N.duration,ease:N.ease})}return new V0(u,this._parents,o,i)}function y8e(){var o,s,i=this,u=i._id,m=i.size();return new Promise(function(h,b){var C={value:b},S={value:function(){--m===0&&h()}};i.each(function(){var _=Fv(this,u),N=_.on;N!==o&&(s=(o=N).copy(),s._.cancel.push(C),s._.interrupt.push(C),s._.end.push(S)),_.on=s}),m===0&&h()})}var w8e=0;function V0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function yme(){return++w8e}var $0=PB.prototype;V0.prototype={constructor:V0,select:e8e,selectAll:t8e,selectChild:$0.selectChild,selectChildren:$0.selectChildren,filter:GPe,merge:qPe,selection:o8e,transition:b8e,call:$0.call,nodes:$0.nodes,node:$0.node,size:$0.size,empty:$0.empty,each:$0.each,on:XPe,attr:$Pe,attrTween:IPe,style:l8e,styleTween:d8e,text:p8e,textTween:v8e,remove:QPe,tween:EPe,delay:LPe,duration:zPe,ease:jPe,easeVarying:ZPe,end:y8e,[Symbol.iterator]:$0[Symbol.iterator]};function C8e(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var S8e={time:null,delay:0,duration:250,ease:C8e};function x8e(o,s){for(var i;!(i=o.__transition)||!(i=i[s]);)if(!(o=o.parentNode))throw new Error(`transition ${s} not found`);return i}function E8e(o){var s,i;o instanceof V0?(s=o._id,o=o._name):(s=yme(),(i=S8e).time=zoe(),o=o==null?null:o+"");for(var u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,S,_=0;_<C;++_)(S=b[_])&&LU(S,o,s,_,b,i||x8e(S,s));return new V0(u,this._parents,o,s)}PB.prototype.interrupt=CPe;PB.prototype.transition=E8e;const LH=o=>()=>o;function _8e(o,{sourceEvent:s,target:i,transform:u,dispatch:m}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:u,enumerable:!0,configurable:!0},_:{value:m}})}function I0(o,s,i){this.k=o,this.x=s,this.y=i}I0.prototype={constructor:I0,scale:function(o){return o===1?this:new I0(this.k*o,this.x,this.y)},translate:function(o,s){return o===0&s===0?this:new I0(this.k,this.x+this.k*o,this.y+this.k*s)},apply:function(o){return[o[0]*this.k+this.x,o[1]*this.k+this.y]},applyX:function(o){return o*this.k+this.x},applyY:function(o){return o*this.k+this.y},invert:function(o){return[(o[0]-this.x)/this.k,(o[1]-this.y)/this.k]},invertX:function(o){return(o-this.x)/this.k},invertY:function(o){return(o-this.y)/this.k},rescaleX:function(o){return o.copy().domain(o.range().map(this.invertX,this).map(o.invert,o))},rescaleY:function(o){return o.copy().domain(o.range().map(this.invertY,this).map(o.invert,o))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var v4=new I0(1,0,0);I0.prototype;function Cte(o){o.stopImmediatePropagation()}function P6(o){o.preventDefault(),o.stopImmediatePropagation()}function k8e(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function T8e(){var o=this;return o instanceof SVGElement?(o=o.ownerSVGElement||o,o.hasAttribute("viewBox")?(o=o.viewBox.baseVal,[[o.x,o.y],[o.x+o.width,o.y+o.height]]):[[0,0],[o.width.baseVal.value,o.height.baseVal.value]]):[[0,0],[o.clientWidth,o.clientHeight]]}function Ole(){return this.__zoom||v4}function A8e(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function N8e(){return navigator.maxTouchPoints||"ontouchstart"in this}function O8e(o,s,i){var u=o.invertX(s[0][0])-i[0][0],m=o.invertX(s[1][0])-i[1][0],h=o.invertY(s[0][1])-i[0][1],b=o.invertY(s[1][1])-i[1][1];return o.translate(m>u?(u+m)/2:Math.min(0,u)||Math.max(0,m),b>h?(h+b)/2:Math.min(0,h)||Math.max(0,b))}function $8e(){var o=k8e,s=T8e,i=O8e,u=A8e,m=N8e,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,S=mPe,_=IU("start","zoom","end"),N,O,R,I=500,W=150,G=0,Q=10;function q(me){me.property("__zoom",Ole).on("wheel.zoom",ke,{passive:!1}).on("mousedown.zoom",et).on("dblclick.zoom",je).filter(m).on("touchstart.zoom",Ce).on("touchmove.zoom",ce).on("touchend.zoom touchcancel.zoom",Dt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}q.transform=function(me,be,$,_e){var le=me.selection?me.selection():me;le.property("__zoom",Ole),me!==le?Ke(me,be,$,_e):le.interrupt().each(function(){Be(this,arguments).event(_e).start().zoom(null,typeof be=="function"?be.apply(this,arguments):be).end()})},q.scaleBy=function(me,be,$,_e){q.scaleTo(me,function(){var le=this.__zoom.k,He=typeof be=="function"?be.apply(this,arguments):be;return le*He},$,_e)},q.scaleTo=function(me,be,$,_e){q.transform(me,function(){var le=s.apply(this,arguments),He=this.__zoom,Ge=$==null?pe(le):typeof $=="function"?$.apply(this,arguments):$,fe=He.invert(Ge),Ue=typeof be=="function"?be.apply(this,arguments):be;return i(L(Z(He,Ue),Ge,fe),le,b)},$,_e)},q.translateBy=function(me,be,$,_e){q.transform(me,function(){return i(this.__zoom.translate(typeof be=="function"?be.apply(this,arguments):be,typeof $=="function"?$.apply(this,arguments):$),s.apply(this,arguments),b)},null,_e)},q.translateTo=function(me,be,$,_e,le){q.transform(me,function(){var He=s.apply(this,arguments),Ge=this.__zoom,fe=_e==null?pe(He):typeof _e=="function"?_e.apply(this,arguments):_e;return i(v4.translate(fe[0],fe[1]).scale(Ge.k).translate(typeof be=="function"?-be.apply(this,arguments):-be,typeof $=="function"?-$.apply(this,arguments):-$),He,b)},_e,le)};function Z(me,be){return be=Math.max(h[0],Math.min(h[1],be)),be===me.k?me:new I0(be,me.x,me.y)}function L(me,be,$){var _e=be[0]-$[0]*me.k,le=be[1]-$[1]*me.k;return _e===me.x&&le===me.y?me:new I0(me.k,_e,le)}function pe(me){return[(+me[0][0]+ +me[1][0])/2,(+me[0][1]+ +me[1][1])/2]}function Ke(me,be,$,_e){me.on("start.zoom",function(){Be(this,arguments).event(_e).start()}).on("interrupt.zoom end.zoom",function(){Be(this,arguments).event(_e).end()}).tween("zoom",function(){var le=this,He=arguments,Ge=Be(le,He).event(_e),fe=s.apply(le,He),Ue=$==null?pe(fe):typeof $=="function"?$.apply(le,He):$,yt=Math.max(fe[1][0]-fe[0][0],fe[1][1]-fe[0][1]),Ve=le.__zoom,pt=typeof be=="function"?be.apply(le,He):be,Ie=S(Ve.invert(Ue).concat(yt/Ve.k),pt.invert(Ue).concat(yt/pt.k));return function(mt){if(mt===1)mt=pt;else{var oe=Ie(mt),mn=yt/oe[2];mt=new I0(mn,Ue[0]-oe[0]*mn,Ue[1]-oe[1]*mn)}Ge.zoom(null,mt)}})}function Be(me,be,$){return!$&&me.__zooming||new Y(me,be)}function Y(me,be){this.that=me,this.args=be,this.active=0,this.sourceEvent=null,this.extent=s.apply(me,be),this.taps=0}Y.prototype={event:function(me){return me&&(this.sourceEvent=me),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(me,be){return this.mouse&&me!=="mouse"&&(this.mouse[1]=be.invert(this.mouse[0])),this.touch0&&me!=="touch"&&(this.touch0[1]=be.invert(this.touch0[0])),this.touch1&&me!=="touch"&&(this.touch1[1]=be.invert(this.touch1[0])),this.that.__zoom=be,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(me){var be=Mh(this.that).datum();_.call(me,this.that,new _8e(me,{sourceEvent:this.sourceEvent,target:q,type:me,transform:this.that.__zoom,dispatch:_}),be)}};function ke(me,...be){if(!o.apply(this,arguments))return;var $=Be(this,be).event(me),_e=this.__zoom,le=Math.max(h[0],Math.min(h[1],_e.k*Math.pow(2,u.apply(this,arguments)))),He=Ov(me);if($.wheel)($.mouse[0][0]!==He[0]||$.mouse[0][1]!==He[1])&&($.mouse[1]=_e.invert($.mouse[0]=He)),clearTimeout($.wheel);else{if(_e.k===le)return;$.mouse=[He,_e.invert(He)],cz(this),$.start()}P6(me),$.wheel=setTimeout(Ge,W),$.zoom("mouse",i(L(Z(_e,le),$.mouse[0],$.mouse[1]),$.extent,b));function Ge(){$.wheel=null,$.end()}}function et(me,...be){if(R||!o.apply(this,arguments))return;var $=me.currentTarget,_e=Be(this,be,!0).event(me),le=Mh(me.view).on("mousemove.zoom",Ue,!0).on("mouseup.zoom",yt,!0),He=Ov(me,$),Ge=me.clientX,fe=me.clientY;rme(me.view),Cte(me),_e.mouse=[He,this.__zoom.invert(He)],cz(this),_e.start();function Ue(Ve){if(P6(Ve),!_e.moved){var pt=Ve.clientX-Ge,Ie=Ve.clientY-fe;_e.moved=pt*pt+Ie*Ie>G}_e.event(Ve).zoom("mouse",i(L(_e.that.__zoom,_e.mouse[0]=Ov(Ve,$),_e.mouse[1]),_e.extent,b))}function yt(Ve){le.on("mousemove.zoom mouseup.zoom",null),ame(Ve.view,_e.moved),P6(Ve),_e.event(Ve).end()}}function je(me,...be){if(o.apply(this,arguments)){var $=this.__zoom,_e=Ov(me.changedTouches?me.changedTouches[0]:me,this),le=$.invert(_e),He=$.k*(me.shiftKey?.5:2),Ge=i(L(Z($,He),_e,le),s.apply(this,be),b);P6(me),C>0?Mh(this).transition().duration(C).call(Ke,Ge,_e,me):Mh(this).call(q.transform,Ge,_e,me)}}function Ce(me,...be){if(o.apply(this,arguments)){var $=me.touches,_e=$.length,le=Be(this,be,me.changedTouches.length===_e).event(me),He,Ge,fe,Ue;for(Cte(me),Ge=0;Ge<_e;++Ge)fe=$[Ge],Ue=Ov(fe,this),Ue=[Ue,this.__zoom.invert(Ue),fe.identifier],le.touch0?!le.touch1&&le.touch0[2]!==Ue[2]&&(le.touch1=Ue,le.taps=0):(le.touch0=Ue,He=!0,le.taps=1+!!N);N&&(N=clearTimeout(N)),He&&(le.taps<2&&(O=Ue[0],N=setTimeout(function(){N=null},I)),cz(this),le.start())}}function ce(me,...be){if(this.__zooming){var $=Be(this,be).event(me),_e=me.changedTouches,le=_e.length,He,Ge,fe,Ue;for(P6(me),He=0;He<le;++He)Ge=_e[He],fe=Ov(Ge,this),$.touch0&&$.touch0[2]===Ge.identifier?$.touch0[0]=fe:$.touch1&&$.touch1[2]===Ge.identifier&&($.touch1[0]=fe);if(Ge=$.that.__zoom,$.touch1){var yt=$.touch0[0],Ve=$.touch0[1],pt=$.touch1[0],Ie=$.touch1[1],mt=(mt=pt[0]-yt[0])*mt+(mt=pt[1]-yt[1])*mt,oe=(oe=Ie[0]-Ve[0])*oe+(oe=Ie[1]-Ve[1])*oe;Ge=Z(Ge,Math.sqrt(mt/oe)),fe=[(yt[0]+pt[0])/2,(yt[1]+pt[1])/2],Ue=[(Ve[0]+Ie[0])/2,(Ve[1]+Ie[1])/2]}else if($.touch0)fe=$.touch0[0],Ue=$.touch0[1];else return;$.zoom("touch",i(L(Ge,fe,Ue),$.extent,b))}}function Dt(me,...be){if(this.__zooming){var $=Be(this,be).event(me),_e=me.changedTouches,le=_e.length,He,Ge;for(Cte(me),R&&clearTimeout(R),R=setTimeout(function(){R=null},I),He=0;He<le;++He)Ge=_e[He],$.touch0&&$.touch0[2]===Ge.identifier?delete $.touch0:$.touch1&&$.touch1[2]===Ge.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(Ge=Ov(Ge,this),Math.hypot(O[0]-Ge[0],O[1]-Ge[1])<Q)){var fe=Mh(this).on("dblclick.zoom");fe&&fe.apply(this,arguments)}}}return q.wheelDelta=function(me){return arguments.length?(u=typeof me=="function"?me:LH(+me),q):u},q.filter=function(me){return arguments.length?(o=typeof me=="function"?me:LH(!!me),q):o},q.touchable=function(me){return arguments.length?(m=typeof me=="function"?me:LH(!!me),q):m},q.extent=function(me){return arguments.length?(s=typeof me=="function"?me:LH([[+me[0][0],+me[0][1]],[+me[1][0],+me[1][1]]]),q):s},q.scaleExtent=function(me){return arguments.length?(h[0]=+me[0],h[1]=+me[1],q):[h[0],h[1]]},q.translateExtent=function(me){return arguments.length?(b[0][0]=+me[0][0],b[1][0]=+me[1][0],b[0][1]=+me[0][1],b[1][1]=+me[1][1],q):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},q.constrain=function(me){return arguments.length?(i=me,q):i},q.duration=function(me){return arguments.length?(C=+me,q):C},q.interpolate=function(me){return arguments.length?(S=me,q):S},q.on=function(){var me=_.on.apply(_,arguments);return me===_?q:me},q.clickDistance=function(me){return arguments.length?(G=(me=+me)*me,q):Math.sqrt(G)},q.tapDistance=function(me){return arguments.length?(Q=+me,q):Q},q}var is=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(is||{}),Woe=(o=>(o.Partial="partial",o.Full="full",o))(Woe||{}),mE=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(mE||{}),b2=(o=>(o.Strict="strict",o.Loose="loose",o))(b2||{}),Hz=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(Hz||{}),X6=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(X6||{}),wme=(o=>(o.TopLeft="top-left",o.TopCenter="top-center",o.TopRight="top-right",o.BottomLeft="bottom-left",o.BottomCenter="bottom-center",o.BottomRight="bottom-right",o))(wme||{});const D8e=["INPUT","SELECT","TEXTAREA"];function Mne(o){var s,i;const u=((i=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:i[0])||o.target,m=typeof(u==null?void 0:u.hasAttribute)=="function"?u.hasAttribute("contenteditable"):!1,h=typeof(u==null?void 0:u.closest)=="function"?u.closest(".nokey"):null;return D8e.includes(u==null?void 0:u.nodeName)||m||!!h}function M8e(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function $le(o,s,i,u){const m=s.replace("+",`
127
127
  `).replace(`
128
128
 
129
129
  `,`
package/es/index.mjs CHANGED
@@ -3,7 +3,7 @@ var Ppe = (o, s, i) => s in o ? Ipe(o, s, { enumerable: !0, configurable: !0, wr
3
3
  var fu = (o, s, i) => Ppe(o, typeof s != "symbol" ? s + "" : s, i);
4
4
  import { defineComponent as Ko, reactive as d$, provide as Jm, inject as Qm, ref as dn, watch as Wo, toValue as ht, computed as $n, openBlock as ct, createElementBlock as on, createElementVNode as Vt, mergeModels as ca, useModel as fr, Fragment as er, renderList as ta, createVNode as fn, unref as Ne, withCtx as xn, createCommentVNode as Po, toDisplayString as Ss, createTextVNode as Fs, createBlock as Co, withDirectives as KU, mergeProps as cm, resolveComponent as Z4, isRef as op, onUnmounted as ud, watchEffect as Bue, onMounted as Ii, onBeforeUnmount as f$, nextTick as qc, toRefs as nC, getCurrentScope as Zoe, onScopeDispose as LR, renderSlot as Fr, normalizeStyle as tl, onActivated as Bpe, onDeactivated as Fpe, h as qa, withModifiers as oC, Teleport as Goe, normalizeClass as ci, resolveDynamicComponent as J_, createPropsRestProxy as Lpe, toRef as li, effectScope as Fue, getCurrentInstance as sC, useSlots as Hpe, onBeforeMount as Vpe, useAttrs as zpe, isMemoSame as Upe, customRef as jpe, markRaw as HR, readonly as Wpe, createStaticVNode as Zpe, createSlots as Lue, normalizeProps as Gpe, guardReactiveProps as qpe, withKeys as gI } from "vue";
5
5
  import { ElImage as by, ElIcon as Kg, ElPopover as SE, ElForm as rC, ElFormItem as Ym, ElInput as Jg, ElButton as Fu, ElScrollbar as XU, ElLoadingDirective as qoe, ElSelect as gE, ElOption as hE, ElDialog as JU, ElTabs as Hue, ElTabPane as Vue, useFormItem as Ype, ClickOutside as Kpe, ElTooltip as QU, ElTable as Xpe, ElTableColumn as _z, ElCheckbox as yy, ElMessageBox as Jpe, ElRadioGroup as zue, ElRadio as X2, ElTree as Uue } from "element-plus";
6
- const Qpe = "0.0.127";
6
+ const Qpe = "0.0.128";
7
7
  var e1e = Object.defineProperty, t1e = (o, s, i) => s in o ? e1e(o, s, { enumerable: !0, configurable: !0, writable: !0, value: i }) : o[s] = i, Rte = (o, s, i) => t1e(o, typeof s != "symbol" ? s + "" : s, i);
8
8
  function jue(o, s) {
9
9
  return function() {
@@ -68472,7 +68472,7 @@ const Dme = (o, s) => {
68472
68472
  }), _ = ($) => {
68473
68473
  var I;
68474
68474
  let R = "";
68475
- if (ht($ == null ? void 0 : $.activated) && (R = "normal"), $ != null && $.disabled && (R = "disabled"), (I = s == null ? void 0 : s.node) != null && I.element)
68475
+ if (ht($ == null ? void 0 : $.activated) && (R = "normal"), $ != null && $.disabled && (R = "disabled"), A(), (I = s == null ? void 0 : s.node) != null && I.element)
68476
68476
  switch (R) {
68477
68477
  case "normal":
68478
68478
  s.node.element.style.setProperty("--node-color", ($ == null ? void 0 : $.color) || "#409eff"), s.node.element.style.setProperty(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyui/components",
3
- "version": "0.0.127",
3
+ "version": "0.0.128",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.mjs",
6
6
  "types": "./es/index.d.ts",