dmx-admin-ui 1.2.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chart-pMtPOqau.js +384 -0
- package/dist/dmx-admin-ui-dev.css +1 -0
- package/dist/group-DvVjK71m.js +133 -0
- package/dist/group-table-DqWxXK71.js +139 -0
- package/dist/group-tabs-DwdpscKQ.js +114 -0
- package/dist/index-CuoBjxHd.js +18858 -0
- package/dist/index.js +7 -0
- package/dist/index.umd.cjs +43 -0
- package/dist/js/Sortable.min.js +2 -0
- package/dist/js/axios.min.js +1 -0
- package/dist/js/cos-js-sdk-v5.min.js +1 -0
- package/dist/js/design.js +4 -0
- package/dist/js/echarts.min.js +45 -0
- package/dist/js/echarts.min.lite.js +1 -0
- package/dist/js/regions.min.js +1 -0
- package/dist/wavy-lines.svg +25 -0
- package/package.json +22 -0
- package/types/admin.d.ts +68 -0
- package/types/global.d.ts +38 -0
- package/types/index.d.ts +48 -0
- package/types/vite.d.ts +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// @unocss-include
|
|
2
|
+
(function(ut,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue"),require("es-toolkit"),require("element-plus"),require("alova"),require("@alova/adapter-xhr"),require("number-precision"),require("echarts")):typeof define=="function"&&define.amd?define(["exports","vue","es-toolkit","element-plus","alova","@alova/adapter-xhr","number-precision","echarts"],s):(ut=typeof globalThis<"u"?globalThis:ut||self,s(ut.AdminUi={},ut.vue,ut.esToolkit,ut.elementPlus,ut.alova,ut.adapterXhr,ut.np,ut.echarts))})(this,(function(ut,s,yo,De,sr,td,nd,rd){"use strict";function od(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return n.default=t,Object.freeze(n)}const bo=od(rd);function Tn(t){return t==="__proto__"}function Ds(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}function Co(t){return typeof t=="string"||typeof t=="symbol"?t:Object.is(t?.valueOf?.(),-0)?"-0":String(t)}function ws(t){if(t==null)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(ws).join(",");const n=String(t);return n==="0"&&Object.is(Number(t),-0)?"-0":n}function vo(t){if(Array.isArray(t))return t.map(Co);if(typeof t=="symbol")return[t];t=ws(t);const n=[],r=t.length;if(r===0)return n;let o=0,i="",a="",l=!1;for(t.charCodeAt(0)===46&&(n.push(""),o++);o<r;){const c=t[o];a?c==="\\"&&o+1<r?(o++,i+=t[o]):c===a?a="":i+=c:l?c==='"'||c==="'"?a=c:c==="]"?(l=!1,n.push(i),i=""):i+=c:c==="["?(l=!0,i&&(n.push(i),i="")):c==="."?i&&(n.push(i),i=""):i+=c,o++}return i&&n.push(i),n}function Yt(t,n,r){if(t==null)return r;switch(typeof n){case"string":{if(Tn(n))return r;const o=t[n];return o===void 0?Ds(n)?Yt(t,vo(n),r):r:o}case"number":case"symbol":{typeof n=="number"&&(n=Co(n));const o=t[n];return o===void 0?r:o}default:{if(Array.isArray(n))return id(t,n,r);if(Object.is(n?.valueOf(),-0)?n="-0":n=String(n),Tn(n))return r;const o=t[n];return o===void 0?r:o}}}function id(t,n,r){if(n.length===0)return r;let o=t;for(let i=0;i<n.length;i++){if(o==null||Tn(n[i]))return r;o=o[n[i]]}return o===void 0?r:o}function Bs(t){return t!==null&&(typeof t=="object"||typeof t=="function")}function Do(t){return t==null||typeof t!="object"&&typeof t!="function"}function sd(t,n){return t===n||Number.isNaN(t)&&Number.isNaN(n)}function xs(t){return Object.getOwnPropertySymbols(t).filter(n=>Object.prototype.propertyIsEnumerable.call(t,n))}function ks(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const ad="[object RegExp]",Es="[object String]",_s="[object Number]",As="[object Boolean]",Ns="[object Arguments]",ld="[object Symbol]",cd="[object Date]",ud="[object Map]",dd="[object Set]",fd="[object Array]",pd="[object ArrayBuffer]",hd="[object Object]",md="[object DataView]",gd="[object Uint8Array]",yd="[object Uint8ClampedArray]",bd="[object Uint16Array]",Cd="[object Uint32Array]",vd="[object Int8Array]",Dd="[object Int16Array]",wd="[object Int32Array]",Bd="[object Float32Array]",xd="[object Float64Array]";function wo(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function kd(t,n){return un(t,void 0,t,new Map,n)}function un(t,n,r,o=new Map,i=void 0){const a=i?.(t,n,r,o);if(a!==void 0)return a;if(Do(t))return t;if(o.has(t))return o.get(t);if(Array.isArray(t)){const l=new Array(t.length);o.set(t,l);for(let c=0;c<t.length;c++)l[c]=un(t[c],c,r,o,i);return Object.hasOwn(t,"index")&&(l.index=t.index),Object.hasOwn(t,"input")&&(l.input=t.input),l}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const l=new RegExp(t.source,t.flags);return l.lastIndex=t.lastIndex,l}if(t instanceof Map){const l=new Map;o.set(t,l);for(const[c,u]of t)l.set(c,un(u,c,r,o,i));return l}if(t instanceof Set){const l=new Set;o.set(t,l);for(const c of t)l.add(un(c,void 0,r,o,i));return l}if(typeof Buffer<"u"&&Buffer.isBuffer(t))return t.subarray();if(wo(t)){const l=new(Object.getPrototypeOf(t)).constructor(t.length);o.set(t,l);for(let c=0;c<t.length;c++)l[c]=un(t[c],c,r,o,i);return l}if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){const l=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return o.set(t,l),Vt(l,t,r,o,i),l}if(typeof File<"u"&&t instanceof File){const l=new File([t],t.name,{type:t.type});return o.set(t,l),Vt(l,t,r,o,i),l}if(typeof Blob<"u"&&t instanceof Blob){const l=new Blob([t],{type:t.type});return o.set(t,l),Vt(l,t,r,o,i),l}if(t instanceof Error){const l=new t.constructor;return o.set(t,l),l.message=t.message,l.name=t.name,l.stack=t.stack,l.cause=t.cause,Vt(l,t,r,o,i),l}if(t instanceof Boolean){const l=new Boolean(t.valueOf());return o.set(t,l),Vt(l,t,r,o,i),l}if(t instanceof Number){const l=new Number(t.valueOf());return o.set(t,l),Vt(l,t,r,o,i),l}if(t instanceof String){const l=new String(t.valueOf());return o.set(t,l),Vt(l,t,r,o,i),l}if(typeof t=="object"&&Ed(t)){const l=Object.create(Object.getPrototypeOf(t));return o.set(t,l),Vt(l,t,r,o,i),l}return t}function Vt(t,n,r=t,o,i){const a=[...Object.keys(n),...xs(n)];for(let l=0;l<a.length;l++){const c=a[l],u=Object.getOwnPropertyDescriptor(t,c);(u==null||u.writable)&&(t[c]=un(n[c],c,r,o,i))}}function Ed(t){switch(ks(t)){case Ns:case fd:case pd:case md:case As:case cd:case Bd:case xd:case vd:case Dd:case wd:case ud:case _s:case hd:case ad:case dd:case Es:case ld:case gd:case yd:case bd:case Cd:return!0;default:return!1}}function _d(t,n){return kd(t,(r,o,i,a)=>{if(typeof t=="object")switch(Object.prototype.toString.call(t)){case _s:case Es:case As:{const l=new t.constructor(t?.valueOf());return Vt(l,t),l}case Ns:{const l={};return Vt(l,t),l.length=t.length,l[Symbol.iterator]=t[Symbol.iterator],l}default:return}})}function Ss(t){return _d(t)}const Ad=/^(?:0|[1-9]\d*)$/;function Fs(t,n=Number.MAX_SAFE_INTEGER){switch(typeof t){case"number":return Number.isInteger(t)&&t>=0&&t<n;case"symbol":return!1;case"string":return Ad.test(t)}}function Bo(t){return t!==null&&typeof t=="object"&&ks(t)==="[object Arguments]"}function Nd(t,n){let r;if(Array.isArray(n)?r=n:typeof n=="string"&&Ds(n)&&t?.[n]==null?r=vo(n):r=[n],r.length===0)return!1;let o=t;for(let i=0;i<r.length;i++){const a=r[i];if((o==null||!Object.hasOwn(o,a))&&!((Array.isArray(o)||Bo(o))&&Fs(a)&&a<o.length))return!1;o=o[a]}return!0}function Vs(t){return typeof t=="object"&&t!==null}function Sd(t){return typeof t=="symbol"||t instanceof Symbol}const Fd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vd=/^\w*$/;function Od(t,n){return Array.isArray(t)?!1:typeof t=="number"||typeof t=="boolean"||t==null||Sd(t)?!0:typeof t=="string"&&(Vd.test(t)||!Fd.test(t))||n!=null&&Object.hasOwn(n,t)}const Td=(t,n,r)=>{const o=t[n];(!(Object.hasOwn(t,n)&&sd(o,r))||r===void 0&&!(n in t))&&(t[n]=r)};function jd(t,n,r,o){if(t==null&&!Bs(t))return t;let i;Od(n,t)?i=[n]:Array.isArray(n)?i=n:i=vo(n);const a=r(Yt(t,i));let l=t;for(let c=0;c<i.length&&l!=null;c++){const u=Co(i[c]);if(Tn(u))continue;let d;if(c===i.length-1)d=a;else{const f=l[u],p=o?.(f,u,t);d=p!==void 0?p:Bs(f)?f:Fs(i[c+1])?[]:{}}Td(l,u,d),l=l[u]}return t}function dn(t,n,r){return jd(t,n,()=>r,()=>{})}function Ld(){}function Pd(t){return wo(t)}function Md(t){if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const r=t[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.writable?!1:t.toString()===`[object ${r}]`}let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n}function zd(t){if(Do(t))return t;if(Array.isArray(t)||wo(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const n=Object.getPrototypeOf(t),r=n.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const o=new r(t);return o.lastIndex=t.lastIndex,o}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){const o=new r(t.message);return o.stack=t.stack,o.name=t.name,o.cause=t.cause,o}if(typeof File<"u"&&t instanceof File)return new r([t],t.name,{type:t.type,lastModified:t.lastModified});if(typeof t=="object"){const o=Object.create(n);return Object.assign(o,t)}return t}function $d(t,...n){const r=n.slice(0,-1),o=n[n.length-1];let i=t;for(let a=0;a<r.length;a++){const l=r[a];i=ar(i,l,o,new Map)}return i}function ar(t,n,r,o){if(Do(t)&&(t=Object(t)),n==null||typeof n!="object")return t;if(o.has(n))return zd(o.get(n));if(o.set(n,t),Array.isArray(n)){n=n.slice();for(let a=0;a<n.length;a++)n[a]=n[a]??void 0}const i=[...Object.keys(n),...xs(n)];for(let a=0;a<i.length;a++){const l=i[a];if(Tn(l))continue;let c=n[l],u=t[l];if(Bo(c)&&(c={...c}),Bo(u)&&(u={...u}),typeof Buffer<"u"&&Buffer.isBuffer(c)&&(c=Ss(c)),Array.isArray(c))if(typeof u=="object"&&u!=null){const f=[],p=Reflect.ownKeys(u);for(let h=0;h<p.length;h++){const m=p[h];f[m]=u[m]}u=f}else u=[];const d=r(u,c,l,t,n,o);d!==void 0?t[l]=d:Array.isArray(c)||Vs(u)&&Vs(c)?t[l]=ar(u,c,r,o):u==null&&Md(c)?t[l]=ar({},c,r,o):u==null&&Pd(c)?t[l]=Ss(c):(u===void 0||c!==void 0)&&(t[l]=c)}return t}function xo(t,...n){return $d(t,...n,Ld)}const Id=(t,n="pid",r="id")=>{const o={},i={};t.forEach(d=>{i[d[r]]=d,o[d[n]]?o[d[n]].push(d[r]):o[d[n]]=[d[r]]});let a=[];const l=function(d,f){return i[d]?.[n]&&(f.push(i[d][n]),l(i[d][n],f)),f},c=function(d,f){const p=o[d];return p&&(f.push(...p),p.forEach(h=>{if(o[h])return c(h,f)})),f};function u(d){const f=i[d];f&&(a.push(f),(o[d]||[]).forEach(p=>{u(p)}))}(o[0]||[]).forEach(d=>{u(d)});for(let d=0;d<a.length;d++)a[d].pid?a[d].treePid=l(a[d].id,[]):a[d].treePid=[],a[d]._child=o[a[d].id]??[],a[d]._isParent=!!a[d]._child.length,a[d]._childs=c(a[d].id,[]);return a};reactive({table:{},limit:10,page:1,pageSizes:[],tree:!1}),reactive({limit:10,page:1});function Rd(t){const n={title:"数据列表",pageSizes:[10,15,30,50,100],pk:"id",page:1,limit:15,...globalThis._plugins?.table??{},...t};return n.tree&&!t.page&&(n.page=0),n}async function Hd(t){const n=(g,y=!0,v=!1)=>{if(!g||!g.data)return{msg:g?.msg||"暂无数据",data:[],count:0};let D=g.data;v&&(D=Id(D));const w=Object.keys(f);for(var C=0;C<D.length;C++)w.length>0&&w.forEach(B=>{D[C][B]=f[B](D[C][B])}),D[C].ROW_ON=!!D[C].ROW_ON||!1,D[C].ROW_KEY=D[C].ROW_KEY||D[C][p]||Math.random();return{data:D,count:g.count}},{limit:o,sort:i,where:a,page:l,url:c,data:u,cache:d,cellFmt:f,pk:p}=t;let h=null;const m={page:l,limit:o,where:a,sort:i};if(c){const{data:g=void 0,msg:y}=await $req.post(c,m,void 0,Number(d&&!0));if(!g)return{msg:y,data:[],count:0};h=g,h.msg=y}else typeof u=="function"?h=await u(m):u&&(h={data:u,count:u.length});return n(h,!1,t.tree)}const Ud=(t,n="数据",r={},o=null)=>{let i="";a(1);function a(l,c=[0,0,0]){l!=1&&(c[0]-c[1],l*c[1]-c[1]+1),$req.post(t,{where:r,page:l,id:c[2]}).then(function(u){u.code==0?typeof u.data[1]=="object"?(o&&u.data[1].forEach(d=>{o(d)}),$a.csv.export(u.data[0],u.data[1],(u.data[2]||n)+".csv")):(i=i+u.data[1],u.data[3]?a(Number(l)+1,u.data[3]):($a.csv.export(u.data[0],i,(u.data[2]||n)+".csv","text"),i="")):$msg.error(u.msg)})}},oe=(t,n)=>{const r=t.__vccOpts||t;for(const[o,i]of n)r[o]=i;return r},Wd={emits:["change"],props:{init:Object,disabled:Boolean,count:Number},data(){return{page:1,limit:10}},created(){this.page=this.init.page,this.limit=this.init.limit},watch:{limit:{handler(t){this.$emit("change","limit",t)}},page:{handler(t){this.$emit("change","page",t)}}}},qd={class:"table-footer"},Kd={key:0};function Jd(t,n,r,o,i,a){const l=s.resolveComponent("el-pagination");return s.openBlock(),s.createElementBlock("div",qd,[s.createElementVNode("div",null,[s.renderSlot(t.$slots,"left")]),r.init.page?(s.openBlock(),s.createElementBlock("div",Kd,[s.createVNode(l,{layout:"total,sizes,prev,pager,next,jumper",disabled:r.disabled,background:"",total:r.count,"current-page":i.page,"onUpdate:currentPage":n[0]||(n[0]=c=>i.page=c),"page-sizes":r.init.pageSizes,pageSize:i.limit,"onUpdate:pageSize":n[1]||(n[1]=c=>i.limit=c)},null,8,["disabled","total","current-page","page-sizes","pageSize"])])):s.createCommentVNode("",!0)])}const Gd=oe(Wd,[["render",Jd]]),Yd={key:0,class:"table-tool-footer"},Zd={class:"color-primary"},Xd={__name:"tableBatch",props:{checkAllChange:Function,batch:Array,tabs:Array,tabsIndex:Number,table:Object},setup(t){const{checkData:n,uniApi:r,config:o,pk:i}=inject("table"),a=l=>{const c=n.value.map(u=>u[i]);if(l.action=="del"){if(!o?.del?.url)return $msg.warning("del.url undefined");r(c,{},o.del.url)}else typeof l.action=="object"?r(c,l.action.data,l.action.api||l.action.url):typeof l.action=="function"?l.action(c,tableData.value,n.value):$msg.error("action undefined")};return(l,c)=>{const u=s.resolveComponent("el-link"),d=s.resolveComponent("el-button"),f=s.resolveComponent("el-popconfirm");return s.unref(n).length>0&&t.batch&&(t.tabs&&t.batch[0].constructor===Array?t.batch[t.tabsIndex].length:t.batch.length)?(s.openBlock(),s.createElementBlock("div",Yd,[s.createElementVNode("div",null,[c[2]||(c[2]=s.createTextVNode(" 已选择 ",-1)),s.createElementVNode("span",Zd,s.toDisplayString(s.unref(n).length),1),c[3]||(c[3]=s.createTextVNode(" 条数据 ",-1)),s.createVNode(u,{type:"primary",onClick:c[0]||(c[0]=p=>t.checkAllChange(!1))},{default:s.withCtx(()=>[...c[1]||(c[1]=[s.createTextVNode("取消选择",-1)])]),_:1})]),s.createElementVNode("div",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.tabs&&t.batch&&t.batch[0].constructor===Array?t.batch[t.tabsIndex]:t.batch,p=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[p.confirm?(s.openBlock(),s.createBlock(f,{key:0,title:`确定要将选中的数据${p.title}吗`,onConfirm:h=>a(p)},{reference:s.withCtx(()=>[s.createVNode(d,{type:"primary"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(p.title),1)]),_:2},1024)]),_:2},1032,["title","onConfirm"])):(s.openBlock(),s.createBlock(d,{key:1,type:"primary",onClick:h=>a(p)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(p.title),1)]),_:2},1032,["onClick"]))],64))),256))])])):s.createCommentVNode("",!0)}}},Qd={key:1,style:{"margin-bottom":"-12px","margin-top":"-6px"},id:"table-form-header"},ef={class:"overflow-hidden"},tf={class:"dialog-footer"},nf=s.defineComponent({__name:"tableDialog",setup(t,{expose:n}){const r=inject("table"),o=ref(!1),i=ref({}),a=ref($config?.form?.btnText??"提交"),l=ref(0),c=useTemplateRef("formRef"),u=()=>{r.rowsIndex=-1};function d(h){i.value=h,l.value=(h.title||"")+(h.data.ROW_KEY||h.data.id||0),h?.confirmButton?.text&&(a.value=h.confirmButton.text),c.value?.setData(h.data,!0),o.value=!0}const f=()=>{c.value.fnSubmit()};function p(){o.value=!1}return n({show:d,close:p}),(h,m)=>{const g=s.resolveComponent("admin-form"),y=s.resolveComponent("el-scrollbar"),v=s.resolveComponent("el-button"),D=s.resolveComponent("el-dialog");return s.openBlock(),s.createBlock(D,{fullscreen:!!s.unref(i).fullscreen,"align-center":"","append-to-body":"",modelValue:s.unref(o),"onUpdate:modelValue":m[1]||(m[1]=w=>s.isRef(o)?o.value=w:null),"z-index":99,width:s.unref(i)?.width||"50%",onClose:u},{header:s.withCtx(()=>[s.unref(i).title!=="tabs"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(s.unref(i).title||"-"),1)],64)):(s.openBlock(),s.createElementBlock("div",Qd))]),footer:s.withCtx(()=>[s.createElementVNode("span",tf,[s.renderSlot(h.$slots,"form-bottom",{form:s.unref(i).form,data:s.unref(i).data},()=>[s.createVNode(v,{onClick:m[0]||(m[0]=w=>p())},{default:s.withCtx(()=>[...m[2]||(m[2]=[s.createTextVNode("取消",-1)])]),_:1}),s.createVNode(v,{type:"primary",onClick:f},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(a)),1)]),_:1})])])]),default:s.withCtx(()=>[s.createElementVNode("div",ef,[s.createVNode(y,{height:"100%","max-height":"70vh"},{default:s.withCtx(()=>[s.unref(i).form?(s.openBlock(),s.createBlock(g,{data:s.unref(i).data,key:s.unref(l),ref_key:"formRef",ref:c,onSubmit:s.unref(r).dialogSubmit,beforeSubmit:s.unref(i).form.beforeSubmit,onChange:s.unref(i).form.change,onEnd:s.unref(i).form.end,init:s.unref(i).form,slot:s.unref(i).slot},null,8,["data","onSubmit","beforeSubmit","onChange","onEnd","init","slot"])):s.createCommentVNode("",!0)]),_:1})])]),_:3},8,["fullscreen","modelValue","width"])}}}),rf={key:0,class:"cate-search bg-main pl pb mb-xs"},of={class:"flex-center pt"},sf={class:"label px-sm"},af=s.defineComponent({__name:"tableNav",setup(t){const n=ref({}),{init:r,navChange:o}=inject("table");return(i,a)=>{const l=s.resolveComponent("el-radio-button"),c=s.resolveComponent("el-radio-group");return s.unref(r).cate?(s.openBlock(),s.createElementBlock("div",rf,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(r).cate.cols,u=>(s.openBlock(),s.createElementBlock("div",of,[s.createElementVNode("div",sf,s.toDisplayString(u.title),1),s.createVNode(c,{size:"small",modelValue:s.unref(n)[u.field],"onUpdate:modelValue":d=>s.unref(n)[u.field]=d,onChange:s.unref(o)},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(u.cols,(d,f)=>(s.openBlock(),s.createBlock(l,{value:f},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(d),1)]),_:2},1032,["value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),256))])):s.createCommentVNode("",!0)}}}),lf={name:"admin-table-tool",props:{init:Array,length:{type:Number,default:3}},emits:["change"],computed(){this.init||(this.init=[])},methods:{click(t,n){this.$emit("change",{index:n,...t})}}},cf={style:{cursor:"pointer",color:"#0D84FF"},class:"flex"},uf={style:{"text-align":"center"}},df=["onClick"];function ff(t,n,r,o,i,a){const l=s.resolveComponent("el-link"),c=s.resolveComponent("el-popconfirm"),u=s.resolveComponent("el-divider"),d=s.resolveComponent("el-dropdown-item"),f=s.resolveComponent("el-dropdown-menu"),p=s.resolveComponent("el-dropdown");return s.openBlock(),s.createElementBlock(s.Fragment,null,[r.init?.length?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(r.init||[],(h,m)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[m<r.length&&r.init.length<=r.length||m<r.length-1&&r.init.length>r.length?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[h.confirm?(s.openBlock(),s.createBlock(c,{key:0,title:typeof h.confirm=="string"?h.confirm:"确认要执行"+h.title+"操作吗",onConfirm:g=>a.click(h,m)},{reference:s.withCtx(()=>[s.createVNode(l,{type:"primary"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(h.title),1)]),_:2},1024)]),_:2},1032,["title","onConfirm"])):(s.openBlock(),s.createBlock(l,{key:1,type:"primary",onClick:g=>a.click(h,m)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(h.title),1)]),_:2},1032,["onClick"]))],64)):s.createCommentVNode("",!0),m<r.init.length-1&&m<r.length-1?(s.openBlock(),s.createBlock(u,{key:1,direction:"vertical"})):s.createCommentVNode("",!0)],64))),256)):s.createCommentVNode("",!0),r.init?.length>r.length?(s.openBlock(),s.createBlock(p,{key:1},{dropdown:s.withCtx(()=>[s.createVNode(f,null,{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.init,(h,m)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[m>r.length-2?(s.openBlock(),s.createBlock(d,{key:0},{default:s.withCtx(()=>[h.confirm?(s.openBlock(),s.createBlock(c,{key:0,title:typeof h.confirm=="string"?h.confirm:"确认要执行"+h.title+"操作吗",onConfirm:g=>a.click(h,m)},{reference:s.withCtx(()=>[s.createElementVNode("div",uf,s.toDisplayString(h.title),1)]),_:2},1032,["title","onConfirm"])):(s.openBlock(),s.createElementBlock("div",{key:1,style:{"text-align":"center"},onClick:g=>a.click(h,m)},s.toDisplayString(h.title),9,df))]),_:2},1024)):s.createCommentVNode("",!0)],64))),256))]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",cf,[s.createVNode(l,{type:"primary"},{default:s.withCtx(()=>[...n[0]||(n[0]=[s.createTextVNode("更多",-1)])]),_:1}),n[1]||(n[1]=s.createElementVNode("i",{class:"i-ri-arrow-down-s-line"},null,-1))])]),_:1})):s.createCommentVNode("",!0)],64)}const pf=oe(lf,[["render",ff]]),hf={props:{init:{type:Object,default:()=>{}},data:{type:Object,default:()=>{}}},data(){return{pk:"",titleName:"",imgName:""}},created(){const{pk:t="id",titleName:n="title",imgName:r="img"}=this.init;this.pk=t,this.titleName=n,this.imgName=r}},mf={class:"flex py-sm line-height-13 max-w-200px"},gf={class:"flex-col ml-sm flex-1 overflow-hidden"},yf={class:"font-md line-1"},bf={style:{color:"#F56C6C"}},Cf={key:1,class:"flex-col ml-sm"},vf={class:"font-md op-70"};function Df(t,n,r,o,i,a){const l=s.resolveComponent("a-image");return s.openBlock(),s.createElementBlock("div",mf,[i.pk&&r.data&&r.data[i.pk]?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[r.data[i.imgName]?(s.openBlock(),s.createBlock(l,{key:0,width:"36px",height:"36px",borderRadius:"36px",src:r.data[i.imgName],preview:!1,class:"img"},null,8,["src"])):s.createCommentVNode("",!0),s.createElementVNode("div",gf,[s.createElementVNode("div",yf,s.toDisplayString(r.data[i.titleName]),1),s.createElementVNode("div",bf,"ID:"+s.toDisplayString(r.data[i.pk]),1)])],64)):(s.openBlock(),s.createElementBlock("div",Cf,[s.createElementVNode("div",vf,s.toDisplayString(r.init?.error||"数据不存在"),1)]))])}const Os=oe(hf,[["render",Df]]),wf={components:{Tool:pf,imgInfo:Os},props:{prop:Object,index:Number,colIndex:Number,item:Object,modelValue:{type:null}},inject:["table"],watch:{item:{handler(t){this.init.format&&this.setValue(t[this.init.field])}},modelValue(t){this.setValue(t)}},data(){return{key:0,init:{},loading:!1,component:null,type:"",toolBtns:[],switchProps:null,value:null}},computed:{formatValue(){let t=[];if(this.init.type==="status")return t=["--","info"],this.init.cols?t=this.init.cols[this.value]:this.value==0?t=["否","info"]:t=["是","primary"],t}},created(){const t=$config?.table?.shortcuts?.[this.prop.type];t?this.init=$a.object.deepMerge(t,this.prop,{type:t.type}):this.init=this.prop;let{type:n,component:r}=this.init;r?this.component=markRaw(r):typeof r=="string"&&(this.component=r),typeof n=="function"?this.type=n(this.item):this.type=n,this.setValue(this.modelValue),this.type==="switch"&&this.calculateSwitchProps()},methods:{calculateSwitchProps(){!this.init.cols&&[0,1,!0,!1].indexOf(this.value)>-1?this.switchProps={inactiveValue:this.init.cols?.[0]??(yo.isBoolean(this.value)?!1:0),activeValue:this.init.cols?.[1]??(yo.isBoolean(this.value)?!0:1),inactiveText:this.init.cols?.[2]??"否",activeText:this.init.cols?.[3]??"是",inlinePrompt:!0,disabled:!!this.init.disabled}:this.switchProps=null},setValue(t){typeof this.init.format=="function"?this.value=this.init.format(t,this.item):this.value=t},async doSwitch(t){this.loading=!1,await this.table.cellEdit({value:t},this.index,this.init)===!1&&(this.value=this.modelValue),this.loading=!1}}},Bf={key:1,class:"pl"},xf={key:1},kf={key:0,class:"tags"},Ef={key:0,class:"table-goods flex py-xs"},_f={class:"flex-col ml-sm flex-1 overflow-hidden",style:{}},Af={class:"line-1"},Nf={class:"text-color-regular"},Sf={class:"color-danger"};function Ff(t,n,r,o,i,a){const l=s.resolveComponent("a-text-edit"),c=s.resolveComponent("el-checkbox"),u=s.resolveComponent("el-switch"),d=s.resolveComponent("tool"),f=s.resolveComponent("a-image"),p=s.resolveComponent("el-badge"),h=s.resolveComponent("el-tag"),m=s.resolveComponent("a-text-status"),g=s.resolveComponent("img-info"),y=s.resolveComponent("el-link"),v=s.resolveComponent("a-cate-text"),D=s.resolveComponent("a-time"),w=s.resolveComponent("a-region-text");return!i.type&&!i.component?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[i.init.edit?(s.openBlock(),s.createBlock(l,{key:0,onSave:n[0]||(n[0]=C=>{a.table.cellEdit(C,r.index,i.init)}),text:i.value},null,8,["text"])):a.table.init.tree&&r.colIndex===(a.table.init.treeIndex||0)&&(!r.item.pid||a.table.fnTreeShow(r.index)>=0)?(s.openBlock(),s.createElementBlock("div",{key:1,class:"flex items-center line-height",onClick:n[1]||(n[1]=C=>a.table.fnTreeOn(r.index))},[s.createElementVNode("span",{style:s.normalizeStyle("padding-left:"+r.item.treePid.length*18+"px")},null,4),r.item._isParent?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["font-xl click size-5",a.table.treeOn.value.indexOf(r.item.id)>-1?"i-ri-arrow-down-s-fill":"i-ri-arrow-right-s-fill"])},null,2)):(s.openBlock(),s.createElementBlock("span",Bf)),s.createTextVNode(" "+s.toDisplayString(i.value),1)])):(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[s.createTextVNode(s.toDisplayString(i.value),1)],64))],64)):i.type==="checkbox"?(s.openBlock(),s.createBlock(c,{key:1,value:r.index,checked:r.item.ROW_ON,modelValue:r.item.ROW_ON,"onUpdate:modelValue":n[2]||(n[2]=C=>r.item.ROW_ON=C)},null,8,["value","checked","modelValue"])):i.type==="switch"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[i.switchProps?(s.openBlock(),s.createBlock(u,s.mergeProps({key:0,loading:i.loading,modelValue:i.value,"onUpdate:modelValue":n[3]||(n[3]=C=>i.value=C)},i.switchProps,{onChange:a.doSwitch}),null,16,["loading","modelValue","onChange"])):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(i.value),1)],64))],64)):i.type==="tool"?(s.openBlock(),s.createBlock(d,{key:3,onChange:n[4]||(n[4]=C=>{a.table.rowAction(C,r.index,i.init)}),length:i.init.maxLength||3,init:a.table.getCellTool(i.init,r.item)},null,8,["length","init"])):i.type==="img"||i.type==="image"?(s.openBlock(),s.createBlock(f,{key:4,src:i.value,preview:!!i.init.preview,width:i.init.width||"40px",height:i.init.height||"40px",fit:"scale-down"},null,8,["src","preview","width","height"])):i.type==="imgs"||i.type==="images"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:5},[typeof i.value=="object"&&i.value?.length?(s.openBlock(),s.createBlock(p,{key:0,hidden:i.value?.length<=1,"badge-class":"imgs-badge",type:"primary",value:i.value?.length},{default:s.withCtx(()=>[s.createVNode(f,{src:i.value[0],preview:i.value,width:i.init.width||"40px",height:i.init.height||"40px",fit:"scale-down"},null,8,["src","preview","width","height"])]),_:1},8,["hidden","value"])):(s.openBlock(),s.createElementBlock("span",xf,"无"))],64)):i.type==="text"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:6},[i.init.cols?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(i.init.textClass)},s.toDisplayString(i.init.cols[i.value]||i.init.default),3)):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(i.init.textClass)},s.toDisplayString(i.value||i.init.default),3))],64)):i.type==="tags"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:7},[i.value||i.value===0?(s.openBlock(),s.createElementBlock("div",kf,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(typeof i.value=="object"?i.value:(i.value+"").split(","),C=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[i.init.cols?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[i.init.cols[C]?(s.openBlock(),s.createBlock(h,{key:0,type:i.init.tagsType??"primary",size:"small"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.init.cols[C]),1)]),_:2},1032,["type"])):s.createCommentVNode("",!0)],64)):(s.openBlock(),s.createBlock(h,{key:1,type:i.init.tagsType??"primary",size:"small"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(C),1)]),_:2},1032,["type"]))],64))),256))])):s.createCommentVNode("",!0)],64)):i.type==="status"?(s.openBlock(),s.createBlock(m,{key:8,status:a.formatValue[1]},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(a.formatValue[0]),1)]),_:1},8,["status"])):i.type==="img-info"?(s.openBlock(),s.createBlock(g,{key:9,init:i.init.init,data:r.item[i.init.field]},null,8,["init","data"])):i.type==="goods"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:10},[i.value&&typeof i.value=="object"?(s.openBlock(),s.createElementBlock("div",Ef,[s.createVNode(f,{height:"60px",width:"60px",lazy:"",fit:"cover",preview:!1,src:i.value.head_img},null,8,["src"]),s.createElementVNode("div",_f,[s.createElementVNode("div",Af,s.toDisplayString(i.value.title),1),s.createElementVNode("div",Nf,"价格:"+s.toDisplayString(i.value.price),1),s.createElementVNode("div",Sf,"商品ID:"+s.toDisplayString(i.value.id),1)])])):s.createCommentVNode("",!0)],64)):i.type==="link"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:11},[i.init.on?(s.openBlock(),s.createBlock(y,{key:0,type:"primary"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.value),1)]),_:1})):(s.openBlock(),s.createBlock(y,{key:1,type:"primary",onClick:n[5]||(n[5]=C=>t.$go.to(i.init.url,r.item))},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.value),1)]),_:1}))],64)):i.type==="cate"?(s.openBlock(),s.createBlock(v,{key:12,modelValue:i.value,"onUpdate:modelValue":n[6]||(n[6]=C=>i.value=C),format:i.init.format,"show-num":i.init.showNum,type:i.init.cateType,color:i.init.cateColor,url:i.init.url},null,8,["modelValue","format","show-num","type","color","url"])):i.type==="times"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:13},[i.value&&i.value.constructor===Array?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(D,{date:i.value[0]},null,8,["date"]),n[8]||(n[8]=s.createTextVNode("~ ",-1)),s.createVNode(D,{date:i.value[1]},null,8,["date"])],64)):s.createCommentVNode("",!0)],64)):i.type==="time"?(s.openBlock(),s.createBlock(D,{key:i.value,format:i.init.format,date:i.value},null,8,["format","date"])):i.type==="region"?(s.openBlock(),s.createBlock(w,{key:15,code:i.value},null,8,["code"])):i.type==="index"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:16},[s.createTextVNode(s.toDisplayString(r.index+1),1)],64)):i.component?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(i.component),{key:17,modelValue:i.value,"onUpdate:modelValue":n[7]||(n[7]=C=>i.value=C)},null,8,["modelValue"])):s.createCommentVNode("",!0)}const Vf=oe(wf,[["render",Ff]]),Of={class:"table-main table-fixed border-collapse",cellspacing:"0",cellpadding:"0"},Tf=["width"],jf={key:0},Lf={class:"cell line-1"},Pf={key:0},Mf=["onClick"],zf={class:"sort"},$f={key:0,class:"text-3 pl-sm",style:{color:"var(--el-color-info)"}},If={key:0,class:"cols-tool"},Rf=["colspan"],Hf={class:"cols-tool-main"},Uf=["onClick"],Wf={__name:"main",props:{height:String,data:Array,init:Object},setup(t){const{onSort:n,sort:r,cellClick:o,tableData:i,checkData:a,fnTreeShow:l}=s.inject("table"),c=s.ref(-1),u=p=>{i.value.map(h=>{h.ROW_ON=p})},d=s.ref(),f={};return t.init.cols.forEach(p=>{p.type=="switch"&&(f[p.field]=h=>Number(h)||0)}),d.value=t.init.cols,s.watch(()=>i,(p={},h={})=>{console.log("watch tableData")}),(p,h)=>{const m=s.resolveComponent("el-checkbox"),g=s.resolveComponent("el-scrollbar");return s.openBlock(),s.createBlock(g,{"max-height":t.height},{default:s.withCtx(()=>[s.createElementVNode("table",Of,[s.createElementVNode("colgroup",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(d.value,y=>(s.openBlock(),s.createElementBlock("col",{width:y.width},null,8,Tf))),256))]),t.init.header!==!1?(s.openBlock(),s.createElementBlock("thead",jf,[s.createElementVNode("tr",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(d.value,y=>(s.openBlock(),s.createElementBlock("th",{class:s.normalizeClass([y.fixed?"fixed-"+y.fixed:""])},[s.createElementVNode("div",Lf,[y.type=="checkbox"?(s.openBlock(),s.createElementBlock("div",Pf,[(s.openBlock(),s.createBlock(m,{style:{height:"20px"},key:"all"+s.unref(a).length,indeterminate:s.unref(a).length!=s.unref(i).length&&s.unref(a).length!=0,checked:s.unref(a).length>0,onChange:u},null,8,["indeterminate","checked"]))])):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[y.sort?(s.openBlock(),s.createElementBlock("div",{key:0,style:s.normalizeStyle({justifyContent:y.type=="tool"?"center":"left"}),class:"click",onClick:v=>s.unref(n)(y.field)},[s.createElementVNode("span",null,s.toDisplayString(y.title),1),s.createElementVNode("span",zf,[s.createElementVNode("i",{class:s.normalizeClass(["i-ri-arrow-up-s-fill",{"color-primary!":s.unref(r)[y.field]=="asc"}])},null,2),s.createElementVNode("i",{class:s.normalizeClass(["i-ri-arrow-down-s-fill",{"color-primary!":s.unref(r)[y.field]=="desc"}])},null,2)])],12,Mf)):(s.openBlock(),s.createElementBlock("div",{key:1,style:s.normalizeStyle({justifyContent:y.type=="tool"?"center":"left"})},[s.createElementVNode("span",null,[s.createTextVNode(s.toDisplayString(y.title)+" ",1),y.subTitle?(s.openBlock(),s.createElementBlock("span",$f,s.toDisplayString(y.subTitle),1)):s.createCommentVNode("",!0)])],4))],64))])],2))),256))])])):s.createCommentVNode("",!0),s.createElementVNode("tbody",{class:s.normalizeClass(t.init.class)},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(i),(y,v)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:y.ROW_KEY},[p.$slots.colsTool?(s.openBlock(),s.createElementBlock("tr",If,[s.createElementVNode("td",{colspan:d.value.length},[s.createElementVNode("div",Hf,[s.renderSlot(p.$slots,"colsTool",{key:v,row:y})])],8,Rf)])):s.createCommentVNode("",!0),s.createElementVNode("tr",{class:s.normalizeClass(["tr",{hover:c.value==v,isTool:t.init.colsTool}])},[!t.init.tree||t.init.tree&&(!y.pid||s.unref(l)(v)>=0)?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(d.value,(D,w)=>(s.openBlock(),s.createElementBlock("td",{class:s.normalizeClass([D.fixed?"fixed-"+D.fixed:""])},[s.createElementVNode("div",{class:s.normalizeClass(["cell",[D.class,D.on?"pointer":""]]),style:s.normalizeStyle({justifyContent:D.type=="tool"?"center":"start",color:D.color,fontWeight:D.fontWeight}),onClick:C=>s.unref(o)(D,v)},[D.slot===!0?s.renderSlot(p.$slots,"cols."+D.field,{key:v,row:y}):D.slot&&typeof D.slot=="string"?s.renderSlot(p.$slots,D.slot,{key:v,row:y}):(s.openBlock(),s.createBlock(Vf,{key:2,prop:D,item:y,colIndex:w,index:v,"model-value":s.unref(Yt)(y,D.field)},null,8,["prop","item","colIndex","index","model-value"]))],14,Uf)],2))),256)):s.createCommentVNode("",!0)],2)],64))),128))],2)])]),_:3},8,["max-height"])}}},qf=s.defineComponent({__name:"tableTabs",props:{modelValue:Number},setup(t){const n=ref(t.modelValue),{init:r,tabsChange:o,toolAction:i}=inject("table");return(a,l)=>{const c=s.resolveComponent("el-radio-button"),u=s.resolveComponent("el-radio-group"),d=s.resolveComponent("el-button");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.unref(r).tabs?(s.openBlock(),s.createBlock(u,{key:0,class:"mr table-el-radio-group",onChange:s.unref(o),modelValue:s.unref(n),"onUpdate:modelValue":l[0]||(l[0]=f=>s.isRef(n)?n.value=f:null)},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(r).tabs,(f,p)=>(s.openBlock(),s.createBlock(c,{value:p},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(f.title),1)]),_:2},1032,["value"]))),256))]),_:1},8,["onChange","modelValue"])):s.createCommentVNode("",!0),s.unref(r).tools?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(s.unref(r).tools,f=>(s.openBlock(),s.createBlock(d,{type:f.type??"primary",onClick:p=>s.unref(i)(f)},{default:s.withCtx(()=>[f.icon||f.action==="add"?(s.openBlock(),s.createElementBlock("i",{key:0,class:s.normalizeClass(f.icon||{add:"i-ri-add-line"}[f.action])},null,2)):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(f.title||{add:"添加"}[f.action]),1)]),_:2},1032,["type","onClick"]))),256)):s.createCommentVNode("",!0)],64)}}}),Kf={emits:["change"],props:{init:Object,data:Object},watch:{show(){this.resize(window.innerWidth)}},data(){return{span:{sm:24,md:12,lg:8,xl:6},sum:0,formData:{},changeData:{},offset:0,cols:[],limit:3,spread:!1,keyTime:0,right:!0}},created(){if(this.init?.span&&(this.span=this.init.span),!this.init?.cols)return;this.cols=this.init.cols;let t={};this.init.spread&&(this.spread=!0),this.cols.forEach(n=>{this.data&&this.data[n.field]?t[n.field]=this.data[n.field]:t[n.field]=n.value||"",t[n.field]||(n.type=="dates"||n.type=="datetimes"||n.type=="input-select"?t[n.field]=[]:t[n.field]="")}),this.formData=t},mounted(){this.sum=this.init.cols.length,this.resize(window.innerWidth),window.onresize=()=>{this.resize(window.innerWidth)}},methods:{onChange(t,n){t&&typeof t=="object"&&t.isJoin&&(n=t.field,t=t.data),this.changeData[n]=t},fnSearch(){this.$emit("change",this.changeData)},resetFields(){this.keyTime++;let t={};this.cols.forEach(function(n){n.type=="dates"||n.type=="datetimes"?t[n.field]=[]:t[n.field]=""}),this.changeData={},this.formData=t,this.$emit("change",{})},resize(t){if(this.right=!1,t>=1920)this.limit=3;else if(t>1200)this.limit=2;else if(t>992)this.limit=1;else{this.limit=1,this.right=!0;return}this.sum<=this.limit||t<992?this.offset=0:this.offset=24/(this.limit+1)*this.limit-this.sum%(this.limit+1)*24/(this.limit+1),this.offset!=0&&(this.right=!0)}}},Jf={key:1,class:"flex-col text-right line-height"},Gf={class:"op-70 text-3 pt-xs line-2"},Yf={class:""};function Zf(t,n,r,o,i,a){const l=s.resolveComponent("a-inputs"),c=s.resolveComponent("el-form-item"),u=s.resolveComponent("el-col"),d=s.resolveComponent("el-button"),f=s.resolveComponent("el-link"),p=s.resolveComponent("el-row"),h=s.resolveComponent("el-form");return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["admin-search",r.init.class])},[i.sum>0&&i.formData?(s.openBlock(),s.createBlock(h,{key:0,size:r.init.size,ref:"search",model:i.formData},{default:s.withCtx(()=>[s.createVNode(p,s.mergeProps({gutter:r.init.gutter??20},r.init.row),{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.cols,(m,g)=>s.withDirectives((s.openBlock(),s.createBlock(u,s.mergeProps({ref_for:!0},m?.span??i.span),{default:s.withCtx(()=>[s.createVNode(c,{"label-width":m.title?r.init.labelWidth||m.labelWidth||90:20,prop:m.field,class:s.normalizeClass(m.class)},{label:s.withCtx(()=>[m.subTitle?(s.openBlock(),s.createElementBlock("div",Jf,[s.createElementVNode("span",null,s.toDisplayString(m.title),1),s.createElementVNode("span",Gf,s.toDisplayString(m.subTitle),1)])):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(m.title),1)],64))]),default:s.withCtx(()=>[(s.openBlock(),s.createBlock(l,{size:r.init.size,style:{width:"100%"},index:g,key:m.field+"-"+g+"-"+i.keyTime,modelValue:i.formData[m.field],"onUpdate:modelValue":y=>i.formData[m.field]=y,prop:m,onChange:y=>a.onChange(y,m.field)},null,8,["size","index","modelValue","onUpdate:modelValue","prop","onChange"]))]),_:2},1032,["label-width","prop","class"])]),_:2},1040)),[[s.vShow,g<i.limit||i.spread]])),256)),s.createVNode(u,s.mergeProps(r.init.btn?.span??i.span,{offset:i.spread?i.offset:0}),{default:s.withCtx(()=>[s.createElementVNode("div",{class:s.normalizeClass(["flex w-full items-center mb-4.5",[{"justify-end":(i.spread||i.limit===1)&&i.right},r.init.btn?.class]])},[r.init?.btn?.reset!==!1?(s.openBlock(),s.createBlock(d,{key:0,onClick:n[0]||(n[0]=m=>a.resetFields())},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(r.init?.btn?.reset??"重置"),1)]),_:1})):s.createCommentVNode("",!0),s.createVNode(d,{type:"primary",onClick:n[1]||(n[1]=m=>a.fnSearch())},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(r.init.btn?.text??"查询"),1)]),_:1}),s.withDirectives(s.createElementVNode("div",Yf,[s.withDirectives(s.createVNode(f,{class:"ml",onClick:n[2]||(n[2]=m=>i.spread=!i.spread),type:"primary"},{default:s.withCtx(()=>[...n[4]||(n[4]=[s.createElementVNode("span",{class:"flex items-center"},[s.createTextVNode("更多查询"),s.createElementVNode("i",{class:"i-ri-arrow-down-s-line text-4"})],-1)])]),_:1},512),[[s.vShow,!i.spread]]),s.withDirectives(s.createVNode(f,{class:"ml",onClick:n[3]||(n[3]=m=>i.spread=!i.spread),type:"primary"},{default:s.withCtx(()=>[...n[5]||(n[5]=[s.createElementVNode("span",{class:"flex items-center"},[s.createTextVNode("收起"),s.createElementVNode("i",{class:"i-ri-arrow-up-s-line"})],-1)])]),_:1},512),[[s.vShow,i.spread]])],512),[[s.vShow,i.sum>i.limit]])],2)]),_:1},16,["offset"])]),_:1},16,["gutter"])]),_:1},8,["size","model"])):s.createCommentVNode("",!0)],2)}const Ts=oe(Kf,[["render",Zf]]),ko={table:{}},Xf={class:"admin-table-page"},Qf={key:1,class:"mb bg-main h-19"},ep={class:"admin-table rounded-md"},tp={key:0,class:"table-header"},np={key:0,class:"left flex-1"},rp={key:1,class:"left"},op={class:"right flex"},ip={key:3,class:"table-no-data"},sp=s.defineComponent({__name:"table",props:{init:Object},emits:["change"],setup(t,{expose:n,emit:r}){const o=E=>{const P={};for(const Y in E)if(Object.hasOwnProperty.call(E,Y)){const I=E[Y];Y.indexOf(".")>-1?dn(P,Y,I):P[Y]=I}return P},i=r,a=t,{proxy:l}=getCurrentInstance(),c=Object.keys(l.$slots).filter(E=>["title","footer"].indexOf(E)===-1&&E.indexOf("form.")===-1),u=Rd(a.init);let{url:d="",title:f,success:p,sort:h={},pk:m,batch:g=null,tabs:y=null,cache:v}=u;const D={page:u.page,limit:u.limit};u.add&&!u.add?.title&&(u.add.title="添加"),u.edit&&!u.edit?.title&&(u.edit.title="编辑");let w=u.search?100:0;w=w+(f!==!1||l.$slots.title?52:0),w=w+(u.page||l.$slots.footer?56:0),w=w+(u.cate?60:0);const C=`calc(var(--main-height) - 24px - ${w}px)`,B=ref(0),k=ref({}),_=ref(u.where),x=ref(!0),N=ref([]),T=ref(0),M=ref("暂无数据"),R=ref(0),z=ref({}),W=ref(null),Q=(E,P)=>{D[E]=P,G()},q=E=>{B.value=E,k.value=y[E].where,N.value=[],D.page=1,G()},J=E=>{i("change",{type:"nav",data:E}),G("nav")},X=(E,P=!1)=>{P&&R.value++,z.value=E,D.page=1,G("search")},ie=E=>{X(E)},re=u.name,ne=ko.table[re];if(ne&&(D.page=ne.page||D.page,D.limit=ne.limit||D.limit,h=ne.sort||h,z.value=ne.searchWhere||z.value,_.value=ne.where||_.value,B.value=ne.tabsIndex||0),onBeforeUnmount(()=>{if(re){const E=re===!0?d:re;if(!E)return;ko.table[E]={page:D.page,limit:D.limit,sort:h.value,searchWhere:z.value,where:_.value,tabsIndex:B.value}}}),l.$route.query){const E=$go.query(l.$route.query);z.value=E.where||{},B.value=E.tabs||0}y&&(k.value=y[B.value].where),h=ref(h);const se=ref(-1),G=async(E="init",P=!1)=>{x.value=!0;const Y={...k.value,..._.value,...z.value},{data:I,count:he,msg:Ie}=await Hd({where:Y,page:D.page,limit:D.limit,sort:h.value,data:u.data,url:d,cache:v,cellFmt:mt,pk:m,tree:u.tree});if(p&&p({data:I,count:he,msg:Ie}),Ie)return x.value=!1,M.value=Ie;N.value=I,T.value=he,x.value=!1},Le=(E=!0)=>N.value,ke=(E=!0)=>{G("reload",E)},Me=E=>E.indexOf("http")>-1||typeof E=="function"||E.indexOf("/")>-1?E:u.url+"/"+E,Pe=(E,P={},Y="")=>{if(Y=Y||u?.edit?.url,!Y)return $msg.warning("url 未定义");if(E&&(P[m]=E),u.apiBefore&&typeof u.apiBefore=="function"){const I=u.apiBefore(Y,P);if(I===!1)return;if(typeof I=="string")return $msg.error(I);typeof I=="object"&&(P=I)}$req.post(Me(Y),P,"处理中").then(I=>{I.code==0?(u.apiSuccess&&typeof u.apiSuccess=="function"&&u.apiSuccess("uniApi",P,Y),u.refresh!==!1&&G(),$msg.success(I.msg)):$msg.error(I.msg)})},Ve=(E,P=!1)=>{if(P!==!1)return h.value={},h.value[E]=P,G();h.value[E]?h.value[E]==="asc"&&(P="desc"):P="asc",h.value={},P&&(h.value[E]=P),G()},Ce=computed(()=>N.value.filter(function(E){return E.ROW_ON})),xe=E=>{i("change",{type:"selection",data:E}),N.value.map(P=>{P.ROW_ON=E})},Ue=(E,P)=>{typeof E.on=="function"?E.on(N.value[P],P):typeof E.on=="string"?Ee({action:E.on},P):Ee({action:E.on},P)},lt=(E,P=-1,Y="")=>{P===-1&&(P=se.value),P!==-1&&(N.value[P]={...N.value[P],...E},Y&&$msg.success(Y),se.value=-1)},et=(E,P,Y)=>{const I=Y.field;let he=Yt(N.value[P],I);if(!Nd(N.value[P],I))return!1;let Ie=Me(u.edit.url);Y.edit&&typeof Y.edit=="string"?Ie=Y.edit:Y.type=="switch"&&Y.url&&(Ie=Y.url);const rt=u.edit?.data??{};if(u.edit?.fields&&u.edit.fields.forEach(ee=>{rt[ee]=N.value[P][ee]}),rt[m]=N.value[P][m],rt[I]=Y.valueformat?Y.valueformat(E.value):E.value,typeof Ie=="function")return Ie(rt,P);let H=$loading("修改中");$req.post(Ie,o(rt)).then(ee=>{H.close(),ee.code==0?(N.value[P]=dn(N.value[P],I,E.value),$msg.success("修改成功"),u.apiSuccess&&u.apiSuccess("cellEdit",P,rt),u.editUpdateTable&&G()):(N.value[P]=dn(N.value[P],I,he),$msg.error(ee.msg))})},ze=ref([]),tt=E=>{const P=N.value[E].treePid,Y=ze.value;return P.filter(function(he){return Y.indexOf(he)!==-1}).length-P.length},nt=E=>{if(!N.value[E]._isParent)return;const P=N.value[E].id,Y=ze.value.indexOf(P);Y>-1?ze.value.splice(Y,1):ze.value.push(P)},We=ref(),$e=ref(),mt={};if(u.cols||(u.cols=[]),u.cols.forEach(E=>{E.type=="checkbox"&&!E.width&&(E.width=40)}),g&&g.map(E=>{E.action==="del"&&(E.title=E.title||"删除",E.confirm===void 0&&(E.confirm=!0))}),y&&g){let E=[];y.forEach((P,Y)=>{E[Y]=g.filter(I=>I.tab===Y||typeof I.tab=="object"&&I.tab.indexOf(Y)>-1||!I.hasOwnProperty("tab"))}),g=E}const Et=(E,P)=>{if(typeof E.btn=="function")return E.btn(P);let Y=E.btn.filter(I=>I.tab===void 0||I.tab===B.value||typeof I.tab=="object"&&I.tab.indexOf(B.value)>-1);return Y?.map(I=>{!I.title&&typeof I.action=="string"&&(I.title={del:"删除",edit:"编辑",detail:"详情"}[I.action]||"",I.action==="del"&&I.confirm===void 0&&(I.confirm="确定要删除本条数据吗"))}),Y},gt={};async function Bt(E){gt[E.url]?gt[E.url].push(E):gt[E.url]=[E]}u.cols?.forEach(async E=>{E.type=="cate"&&E.url&&Bt(E)}),u.search?.cols&&u.search.cols.forEach(async E=>{["selects","select"].indexOf(E.type)>-1&&typeof E.url=="string"&&Bt(E)}),u.add?.cols&&u.add.cols.forEach(async E=>{["selects","select"].indexOf(E.type)>-1&&typeof E.url=="string"&&Bt(E)}),u.edit?.cols&&u.edit.cols.forEach(async E=>{["selects","select"].indexOf(E.type)>-1&&typeof E.url=="string"&&Bt(E)});const pe=Object.keys(gt);pe?.length?pe.forEach(async(E,P)=>{let Y=await $req.post(E);gt[E].forEach(I=>{I.url=Y.data}),P===pe.length-1&&(We.value=u.search,G())}):(We.value=u.search,G());const le=ref({}),ge=(E,P,Y)=>{Y.cols.forEach(I=>{if(I.slot&&typeof I.slot!="function"){let he=typeof I.slot=="string"?I.slot:"form.cols."+I.field;l.$slots[he]&&(I.slot=l.$slots[he])}}),Y.url=Me(Y.url),le.value={title:Y.title,width:Y.width,data:E,confirmButton:Y.confirmButton,form:{...Y,width:"100%",confirmButton:!1}},se.value=P,W.value.show(le.value)},Ae=E=>{const{res:P,data:Y}=E;W.value.close();const I=le.value,he=N.value;P.code==0&&(I.form.success?I.form.success(Y,P.data):u.apiSuccess&&typeof u.apiSuccess=="function"&&u.apiSuccess("dialogSubmit",Y),se.value>-1&&!u.tree&&!I.form.updateTable?he[se.value]=xo(he[se.value],Y,{ROW_KEY:Math.random()}):u.refresh!==!1&&G(),se.value=-1)},yt=async E=>{if(E.confirm){let P=E.confirm;if(typeof P=="function"){if(P()!==!0)return}else if(typeof P!="string"&&(P="确定要执行"+E.title+"操作?"),await $confirm(P)!="confirm")return}if(E.action=="add"){let P={};u.add?.data&&typeof u.add?.data=="function"?P=u.add.data():u.add?.data&&typeof u.add?.data=="object"&&(P=u.add.data),ge(P,-1,{...u.edit,...u.add})}else if(typeof E.action=="object"&&E.action.type=="csv")Ud(E.action.url,E.action.name||"数据",E.action.where||{},E.action.format||null);else if(typeof E.action=="object"&&E.action.api){E.action.data||(E.action.data={});const P={...k.value,..._.value,...z.value,...E.action.data};Pe(0,P,E.action.api)}else typeof E.action=="object"?ge({},-1,E.action):typeof E.action=="function"&&E.action()},Ee=async(E,P,Y={})=>{let I=N.value;if(!(Y.before&&Y.before(I[P],E)===!1))if(typeof E.action=="string")if(E.action=="edit")ge(I[P],P,u.edit);else if(E.action=="del"){if(!u?.del?.url)return $msg.warning("del.url 未定义");let he={};u?.tree&&(he={child:[...I[P]._child],childs:[...I[P]._childs]}),Pe(I[P][m],he,u.del.url)}else if(E.action.indexOf("/")>-1){const he=E.action.split("?"),Ie={},rt=I[P];he[1]?(E.action=he[0],he[1].split(",").forEach(ee=>{Ie[ee]=rt[ee]})):Ie[m]=rt[m],$go.to(E.action,Ie)}else $msg.error("error");else if(typeof E.action=="object"&&E.action.api)typeof E.action.api!="string"&&(E.action.api=u.edit.url),Pe(I[P][m],E.action.data,E.action.api);else if(typeof E.action=="object"&&typeof E.action.form=="function"){const he=await E.action.form(I[P],P);if(he.form)return ge(he.data,P,he.form);ge(I[P],P,he)}else typeof E.action=="object"?ge(I[P],P,E.action):typeof E.action=="function"&&E.action(I[P],P)},Oe=ref(!1),Xe=(E=!0)=>{Oe.value=E};watch(()=>l.$route.query,E=>{const P=l.$route.path;We.value={...We.value,spread:$e.value?.spread},z.value=$go.query(E,"where"),D.page=ko.table[P+"_page"]||1,R.value++,G()});const Te={getData:Le,search:X,init:u,treeOn:ze,cellEdit:et,cellClick:Ue,rowEdit:lt,onSort:Ve,sort:h,fnTreeShow:tt,fnTreeOn:nt,setPageStatus:Xe,checkAllChange:xe,navChange:J,tabsChange:q,tableData:N,checkData:Ce,reload:ke,dialogForm:ge,dialogSubmit:Ae,getCellTool:Et,rowAction:Ee,toolAction:yt,uniApi:Pe,pk:m};return provide("table",Te),n(Te),(E,P)=>{const Y=s.resolveComponent("el-empty"),I=s.resolveDirective("loading");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(nf,{ref_key:"dialogRef",ref:W},null,512),s.createElementVNode("div",Xf,[s.unref(u).cate?(s.openBlock(),s.createBlock(af,{key:0})):s.createCommentVNode("",!0),s.unref(u).search&&!s.unref(We)?(s.openBlock(),s.createElementBlock("div",Qf)):s.createCommentVNode("",!0),s.unref(We)?(s.openBlock(),s.createBlock(Ts,{ref_key:"searchRef",ref:$e,key:s.unref(R),init:s.unref(We),data:s.unref(z),onChange:ie,class:s.normalizeClass(["mb bg-main pt-lg pr-lg rounded-md",s.unref(u).serachClass])},null,8,["init","data","class"])):s.createCommentVNode("",!0),s.createElementVNode("div",ep,[s.unref(u).title!==!1?(s.openBlock(),s.createElementBlock("div",tp,[E.$slots.title?(s.openBlock(),s.createElementBlock("div",np,[s.renderSlot(E.$slots,"title")])):(s.openBlock(),s.createElementBlock("div",rp,s.toDisplayString(s.unref(f)),1)),s.createElementVNode("div",op,[s.createVNode(qf,{modelValue:s.unref(B),"onUpdate:modelValue":P[0]||(P[0]=he=>s.isRef(B)?B.value=he:null)},null,8,["modelValue"])])])):s.createCommentVNode("",!0),E.$slots.default?s.renderSlot(E.$slots,"default",{key:1,data:s.unref(N),height:C}):s.withDirectives((s.openBlock(),s.createBlock(Wf,{key:2,init:t.init,data:s.unref(N),height:C},s.createSlots({_:2},[s.renderList(s.unref(c),he=>({name:he,fn:s.withCtx(({row:Ie,key:rt})=>[s.renderSlot(E.$slots,he,{key:rt,row:Ie})])}))]),1032,["init","data"])),[[I,s.unref(x)]]),!s.unref(u).hideEmpty&&s.unref(N).length==0&&!s.unref(x)?(s.openBlock(),s.createElementBlock("div",ip,[s.createVNode(Y,{"image-size":120,description:s.unref(M)},null,8,["description"])])):s.createCommentVNode("",!0),D.page||E.$slots.footer?(s.openBlock(),s.createBlock(Gd,{key:4,onChange:Q,disabled:s.unref(Oe),count:s.unref(T),init:{page:s.unref(u).page,limit:s.unref(u).limit,pageSizes:s.unref(u).pageSizes}},{left:s.withCtx(()=>[s.renderSlot(E.$slots,"footer",{data:s.unref(N)})]),_:3},8,["disabled","count","init"])):s.createCommentVNode("",!0)]),s.createVNode(Xd,{checkAllChange:xe,batch:s.unref(u).batch,tabs:s.unref(y),"tabs-index":s.unref(B),"check-data":s.unref(Ce)},null,8,["batch","tabs","tabs-index","check-data"])])],64)}}}),ap={name:"input-select",emits:["update:modelValue"],props:{size:{type:String,default:""},group:{type:[Array,Boolean],default:!1},options:{type:Array,default:()=>[[">","大于"],["<","小于"],["=","等于"],["between","范围"]]}},data(){return{placeholder:"输入",value:"",value2:"",value3:[],groupValue:""}},created(){this.value2=this.options[0],this.groupValue=this.group[0],this.$watch("value2",()=>{this.change()}),this.$watch("groupValue",()=>{this.change()})},methods:{change(t){console.log("change",this.value2),this.group?this.$emit("update:modelValue",[this.groupValue[0],this.value2[0],this.value2[0]=="between"?this.value3:this.value]):this.$emit("update:modelValue",[this.value2[0],this.value2[0]=="between"?this.value3:this.value])}}},lp={class:"input-with-select flex pr"},cp={class:"flex justify-center pl",title:"下拉选择"},up={class:"flex justify-center pl",title:"下拉选择"},dp={key:0,class:"flex pr-sm"};function fp(t,n,r,o,i,a){const l=s.resolveComponent("el-dropdown-item"),c=s.resolveComponent("el-dropdown-menu"),u=s.resolveComponent("el-dropdown"),d=s.resolveComponent("el-input");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(d,{class:s.normalizeClass(["input-with-select",i.value2[0]==="between"?"input-with-select-in":""]),modelValue:i.value,"onUpdate:modelValue":n[4]||(n[4]=f=>i.value=f),placeholder:i.placeholder,onChange:a.change,clearable:""},{prepend:s.withCtx(()=>[s.createElementVNode("div",lp,[r.group?(s.openBlock(),s.createBlock(u,{key:0,trigger:"click",onCommand:n[0]||(n[0]=f=>{this.groupValue=f})},{dropdown:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.group,f=>(s.openBlock(),s.createBlock(l,{command:f},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(f[1]),1)]),_:2},1032,["command"]))),256))]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("div",cp,[s.createElementVNode("span",null,s.toDisplayString(i.groupValue[1]),1),n[5]||(n[5]=s.createElementVNode("i",{class:"i-ri-arrow-down-s-line font-xl op-70"},null,-1))])]),_:1})):s.createCommentVNode("",!0),s.createVNode(u,{trigger:"click",onCommand:n[1]||(n[1]=f=>{this.value2=f})},{dropdown:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.options,f=>(s.openBlock(),s.createBlock(l,{command:f},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(f[1]),1)]),_:2},1032,["command"]))),256))]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("div",up,[s.createElementVNode("span",null,s.toDisplayString(i.value2[1]),1),n[6]||(n[6]=s.createElementVNode("i",{class:"i-ri-arrow-down-s-line font-xl op-70"},null,-1))])]),_:1})])]),append:s.withCtx(()=>[i.value2[0]==="between"?(s.openBlock(),s.createElementBlock("div",dp,[s.createVNode(d,{size:r.size,placeholder:"输入",modelValue:i.value3[0],"onUpdate:modelValue":n[2]||(n[2]=f=>i.value3[0]=f),onChange:a.change},null,8,["size","modelValue","onChange"]),n[7]||(n[7]=s.createElementVNode("span",{class:"px-sm"},"~",-1)),s.createVNode(d,{size:r.size,placeholder:"输入",modelValue:i.value3[1],"onUpdate:modelValue":n[3]||(n[3]=f=>i.value3[1]=f),onChange:a.change},null,8,["size","modelValue","onChange"])])):s.createCommentVNode("",!0)]),_:1},8,["class","modelValue","placeholder","onChange"])])}const pp=oe(ap,[["render",fp]]),hp={props:{placeholder:String,size:{type:String,default:""},modelValue:String,list:{type:[Array,Object],default:()=>[]}},data(){return{value:"",lists:[]}},created(){if(this.value=this.modelValue,Array.isArray(this.list))this.list.forEach(t=>{this.lists.push({value:t})});else if(this.list)for(let t in this.list)this.lists.push({label:this.list[t],value:t});this.$watch("value",function(t){this.$emit("update:modelValue",t)})},methods:{querySearch(t,n){const r=i=>a=>a.value.toLowerCase().indexOf(i.toLowerCase())===0,o=t?this.lists.filter(r(t)):this.lists;n(o)}}},mp={class:""},gp={key:0,class:"pl-sm"};function yp(t,n,r,o,i,a){const l=s.resolveComponent("el-autocomplete");return s.openBlock(),s.createBlock(l,{modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=c=>i.value=c),"fetch-suggestions":a.querySearch,placeholder:r.placeholder||"输入"},{default:s.withCtx(({item:c})=>[s.createElementVNode("span",mp,s.toDisplayString(c.value),1),c.label?(s.openBlock(),s.createElementBlock("span",gp,s.toDisplayString(c.label),1)):s.createCommentVNode("",!0)]),_:1},8,["modelValue","fetch-suggestions","placeholder"])}const bp=oe(hp,[["render",yp]]);function js(t){return t?(typeof t!="string"&&(t=URL.createObjectURL(t)),new Promise((n,r)=>{const o=document.createElement("video");o.src=t,o.setAttribute("crossOrigin","Anonymous");function i(){o.addEventListener("error",function(){n(null)}),o.addEventListener("loadedmetadata",function(){setTimeout(()=>{try{const a=o.videoWidth<750?1:750/o.videoWidth;o.width=parseInt(o.videoWidth*a),o.height=parseInt(o.videoHeight*a),o.currentTime=0,o.addEventListener("seeked",function(){const l=document.createElement("canvas");l.width=o.width,l.height=o.height,l.getContext("2d").drawImage(o,0,0,l.width,l.height),l.toBlob(u=>{const d=new File([u],"video.jpg");o.img=d,n({width:o.videoWidth,height:o.videoHeight,img:d,duration:parseInt(o.duration)})},"image/jpg")},{once:!0})}catch{n(null)}},100)})}window.WeixinJSBridge&&/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)?window.WeixinJSBridge.invoke("getNetworkType",{},()=>{o.muted=!0,o.playsInline=!0,o["webkit-playsinline"]=!0,i(),o.play().then(()=>o.pause())}):i()})):Promise.reject("Please upload a video file.")}function Cp(t,n,r){return new Promise((o,i)=>{try{setTimeout(()=>{const a=[];for(let l=0;r>0;r--)a.push(t.slice(l,l+n)),l+=n;o(a)},0)}catch{i(new Error("文件切块发生错误"))}})}function vp(t){return t>1024?t/1024>1024?t/(1024*1024)>1024?(t/(1024*1024*1024)).toFixed(2)+"GB":(t/(1024*1024)).toFixed(2)+"MB":(t/1024).toFixed(2)+"KB":t.toFixed(2)+"B"}const Ls={},Dp={props:{accept:"",type:"",cate:{type:[Number,String],default:0},limit:{type:[Number,String],default:1}},data(){return{file:null,maxSize:1024*1024*1024,multiUploadSize:11*1024*1024,eachSize:10*1024*1024,progress:0,showProgress:!1,eachProgress:0,hashMd5:"",totalSize:0,loadedSize:0,successList:[]}},methods:{beforeUpload(t){if(t.type.indexOf(this.type)==-1)return $msg.error("文件格式错误"),!1;if(t.size>this.maxSize)return $msg.error(`文件不能大于${vp(this.maxSize)}`),!1},onExceed(t){t.length>this.limit&&$msg.error(`最多可以选择${this.limit}个文件`)},async httpRequest(t){const{multiUploadSize:n,splitUpload:r,singleUpload:o}=this,{file:i}=t;this.file=i;const a=i.size>n?r:o;try{await a(i),this.$refs.upload.clearFiles()}catch(l){$msg.error(l),this.$refs.upload.clearFiles(),this.showProgress=!1,this.progress=0}},onUploadProgress(t,n){let r=n.get("uid")+"-"+n.get("chunk"),o=Ls[r]||0;this.loadedSize=this.loadedSize+t.loaded-o,Ls[r]=t.loaded,this.progress=parseInt(this.loadedSize/this.totalSize*100),this.progress=this.progress>100?100:this.progress},async singleUpload(t){this.totalSize=t.size,this.showProgress=!0;let n=await this.postFile({file:t,uid:t.uid,name:t.name,fullSize:t.size,chunk:0,chunks:1});if(n.code==0)this.doSuccess(n);else return $msg.error(t.name+":上传失败")},splitUpload(t){return this.totalSize=this.totalSize+t.size,new Promise(async(n,r)=>{try{const o=this,{eachSize:i}=this,a=Math.ceil(t.size/i),l=await Cp(t,i,a);this.showProgress=!0;let c=0;for(let u=0;u<l.length;u++)if(Number(c)===u){if(this.successList.indexOf(u)==-1){let d=await this.postFile({chunked:!0,chunk:u,chunks:a,eachSize:i,uid:t.uid,name:t.name,fileName:t.name,fullSize:t.size,md5:o.hashMd5,file:l[u]});if(d.code==1)return this.doSuccess(d),n();if(d.code==0&&d?.data?.url)return this.doSuccess(d),n();if(d.code==0&&d?.data?.md5)o.hashMd5=d.data.md5;else return this.showProgress=!1,this.progress=0,r(d.msg)}c++}}catch(o){r(o.message)}})},postFile(t){const n=new FormData;return n.append("cate",this.cate),n.append("type",this.type),n.append("file",t.file),n.append("chunk",t.chunk),n.append("name",t.name),n.append("uid",t.uid),n.append("chunks",t.chunks),n.append("fullSize",t.fullSize),t.chunk>0&&n.append("md5",t.md5),$req.upload("upload/doChunk",n,this.onUploadProgress)},async doSuccess(t){if(this.showProgress=!1,this.progress=0,this.file?.type?.startsWith("video")){const n=await this.doVideoExt(t.data);n&&(t.data.extend=n)}this.$emit("success",t.data)},validateFile(t){return t.cate=this.cate,t.type=this.type,$req.post("upload/doChunks",t).then(n=>{n&&n.code==0?this.doSuccess(n):$msg.error(n.msg)})},async doVideoExt(t){const n=this.file,r=await js(n);if(!r)return null;const o=new FormData;o.append("file",r.img),o.append("id",t.id),o.append("url",t.url),o.append("height",r.height),o.append("width",r.width),o.append("size",n.size),o.append("duration",r.duration);const i=await $req.upload("upload/doVideoExt",o);return this.file=null,i.code==0?i.data:null}}},wp={class:"flex-col justify-center w-full"},Bp={class:""},xp={class:""};function kp(t,n,r,o,i,a){const l=s.resolveComponent("el-upload"),c=s.resolveComponent("el-progress"),u=s.resolveComponent("el-dialog");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(l,{class:"flex items-center",ref:"upload",onExceed:a.onExceed,"show-file-list":!1,accept:r.accept,multiple:r.limit!=1,"before-upload":a.beforeUpload,"http-request":a.httpRequest,limit:r.limit,action:"/",disabled:i.showProgress},{default:s.withCtx(()=>[s.renderSlot(t.$slots,"default",{},void 0,!0)]),_:3},8,["onExceed","accept","multiple","before-upload","http-request","limit","disabled"]),s.createVNode(u,{"show-close":!1,"close-on-click-modal":!1,title:"正在上传",modelValue:i.showProgress,"onUpdate:modelValue":n[0]||(n[0]=d=>i.showProgress=d),width:"50%"},{default:s.withCtx(()=>[i.showProgress?(s.openBlock(),s.createBlock(c,{key:0,type:"circle",percentage:i.progress,class:"progress"},{default:s.withCtx(({percentage:d})=>[s.createElementVNode("div",wp,[s.createElementVNode("span",Bp,s.toDisplayString(d)+"%",1),s.createElementVNode("span",xp,s.toDisplayString(d==100?"验证文件":"上传中"),1)])]),_:1},8,["percentage"])):s.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}const Ps=oe(Dp,[["render",kp],["__scopeId","data-v-02e2034c"]]),Ep={props:{type:{type:String,default:""},cate:{type:Number,default:0}},data(){return{cateCount:0,loading:!0,limit:50,page:1,cateId:0,cates:[]}},created(){this.cate&&(this.cateId=this.cate),$req.post($config.apis.media_box.cate,{type:this.type,limit:this.limit}).then(t=>{t.code==0&&t.data&&(console.log(t),this.cates=t.data,this.cateCount=t.count,this.loading=!1)})},methods:{cateEdit(t,n){$prompt(!1,"修改分组",{inputValue:n.title}).then(r=>{r.value!=n.title&&r.value&&$req.post($config.apis.media_box.cateEdit,{id:n.id,title:r.value}).then(o=>{o.code==0?(this.cates[t].title=r.value,this.$msg.success("修改成功")):this.$msg.error(o.msg)})})},cateDel(t,n){let r=this;this.$confirm(`确定要删除分组[${n.title}]吗?`,"删除分组").then(o=>{r.$req.post($config.apis.media_box.cateDel,{id:n.id}).then(i=>{i.code==0?(r.cates.splice(t,1),r.$msg.success("删除成功")):r.$msg.error(i.msg)})})},cateAdd(){$prompt(!1,"添加分组").then(t=>{t.value&&$req.post($config.apis.media_box.cateAdd,{title:t.value,type:this.type}).then(n=>{n.code==0?(this.cates.push(n.data),$msg.success("添加成功")):$msg.error(n.msg)})})},cateTab(t){this.cateId=t,this.$emit("change",t)},addCount(t=1){const n=this.cateId;this.cates.forEach(r=>{(r.id==n||r.id==0)&&(r.count=r.count+t)})},cateChange(t){this.cates=[],$req.post($config.apis.media_box.cate,{type:this.type,page:t,limit:this.limit}).then(n=>{n.code==0&&n.data&&(this.cates=n.data,this.cateCount=n.count)})}}},_p={class:"dir-list"},Ap={class:"title"},Np={key:0,style:{"margin-left":"-10px","margin-bottom":"10px"}},Sp={class:"item"},Fp=["onClick"],Vp={class:"left"},Op={key:0,class:"tool"},Tp=["onClick"],jp=["onClick"];function Lp(t,n,r,o,i,a){const l=s.resolveComponent("el-pagination"),c=s.resolveComponent("el-tag"),u=s.resolveComponent("el-scrollbar"),d=s.resolveDirective("loading");return s.openBlock(),s.createElementBlock("div",_p,[s.createElementVNode("div",Ap,[n[2]||(n[2]=s.createElementVNode("span",{class:"flex items-center"},[s.createElementVNode("i",{class:"i-ri-folders-line",style:{"padding-right":"4px"}}),s.createTextVNode("分组")],-1)),s.createElementVNode("span",{class:"flex",onClick:n[0]||(n[0]=f=>a.cateAdd())},[...n[1]||(n[1]=[s.createElementVNode("i",{class:"i-ri-add-line"},null,-1)])])]),i.cateCount>i.limit?(s.openBlock(),s.createElementBlock("div",Np,[s.createVNode(l,{small:"",layout:"prev,pager,next","pager-count":5,total:i.cateCount,"page-size":i.limit,onCurrentChange:a.cateChange},null,8,["total","page-size","onCurrentChange"])])):s.createCommentVNode("",!0),s.withDirectives((s.openBlock(),s.createBlock(u,{style:{height:"500px"}},{default:s.withCtx(()=>[s.createElementVNode("div",Sp,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.cates,(f,p)=>(s.openBlock(),s.createElementBlock("div",{onClick:h=>a.cateTab(f.id),class:s.normalizeClass(i.cateId==f.id?"on":"")},[s.createElementVNode("span",Vp,[s.createTextVNode(s.toDisplayString(f.title),1),f.is_sys==1?(s.openBlock(),s.createBlock(c,{key:0,size:"small"},{default:s.withCtx(()=>[...n[3]||(n[3]=[s.createTextVNode("系统",-1)])]),_:1})):s.createCommentVNode("",!0)]),s.createElementVNode("span",{class:s.normalizeClass("count"+f.is_sys)},s.toDisplayString(f.count),3),f.is_sys==0?(s.openBlock(),s.createElementBlock("span",Op,[s.createElementVNode("span",{onClick:h=>a.cateEdit(p,f)},"编辑",8,Tp),s.createElementVNode("span",{onClick:h=>a.cateDel(p,f)},"删除",8,jp)])):s.createCommentVNode("",!0)],10,Fp))),256))])]),_:1})),[[d,i.loading]])])}const Pp={name:"media-box",components:{BigUpload:Ps,FileMenu:oe(Ep,[["render",Lp],["__scopeId","data-v-8d65218d"]])},props:{type:String,sum:{type:Number,default:1},cate:{type:Number,default:0}},data(){return{showImageViewer:!1,fileType:"video",videoShow:!1,videoUrl:"",videoBg:"",imageList:[],action:!1,limit:24,count:0,page:1,cateId:0,name:"",list:[],onList:[],onImgs:[]}},computed:{accept(){return this.fileType+"/*"},typeName(){return{video:"视频",audio:"音频",image:"图片",file:"文件"}[this.fileType]},canSum(){return this.action?20:this.sum}},created(){this.cate&&(this.cateId=this.cate),this.type&&(this.fileType=this.type),this.getList()},methods:{async command(t){if(t==="url"){const{value:n}=await this.$prompt(!1,`输入${this.typeName}链接`,{inputValue:"",inputPattern:/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})(\/[\S]*)*\/?$/i,inputErrorMessage:"链接格式错误"});n&&await this.doAdd(n)}},async doAdd(t){const n=new FormData;if(this.fileType==="video"){const o=await js(t);if(o)n.append("img",o.img),n.append("height",o.height),n.append("width",o.width),n.append("duration",o.duration);else return $msg.error("视频格式错误或视频不支持在你的网站播放")}n.append("url",t),n.append("type",this.fileType),n.append("dir",this.cateId),n.append("size",0);const r=await $req.upload("upload/doAdd",n);if(r.code==0)this.list.unshift(r.data),this.$refs.fileMenu.addCount(),this.$msg.success(data.name+":上传成功");else return null},openFile(t){t.type=="image"?this.viewImg(t.url):this.videoPlay(t.url)},viewImg(t){this.imageList=[$fileUrl(t)],this.showImageViewer=!0},videoPlay(t=""){this.videoShow=!0,this.videoUrl=t},getDetail(){const t=this.onList;return this.list.filter(n=>t.indexOf(n.id)>-1)},getData(){if(this.action)return"请退出管理模式,再选择"+this.typeName;let t=JSON.parse(JSON.stringify(this.onImgs));return this.fnCancelCheck(),t},menuChange(t){this.cateId=t,this.name="",this.getList()},pageChange(t){this.page=t,this.getList()},getList(){$req.post($config.apis.media_box.list,{page:this.page,limit:24,dir:this.cateId,type:this.fileType,name:this.name}).then(t=>{t.data?.data&&(t=t.data),this.name&&(!t.data||t.data.length==0)&&$msg.info("没有搜索结果"),this.list=t.data,this.count=t.count})},fnAction(){this.action=!this.action,this.action||this.fnCancelCheck()},fnCancelCheck(){this.onList=[],this.onImgs=[],this.action=!1},doName(t,n){let r=this;this.$prompt(!1,"重命名",{inputValue:n.name}).then(o=>{o.value!=n.name&&o.value&&$req.post($config.apis.media_box.edit,{id:n.id,name:o.value}).then(i=>{i.code==0?(r.list[t].name=o.value,r.$msg.success(i.msg)):r.$msg.error(i.msg)})})},doDel(t,n){$req.post($config.apis.media_box.del,{id:n.id}).then(r=>{r.code==0?(this.list.splice(t,1),this.$refs.fileMenu.addCount(-1),$msg.success(r.msg)):$msg.error(r.msg)})},doDels(){let t=this;if(this.onList.length==0)return this.$msg.error("请选择"+typeName);$req.post($config.apis.media_box.del,{id:this.onList}).then(n=>{n.code==0?(t.onList.forEach(r=>{let o=t.list.findIndex(i=>i.id==r);t.list.splice(o,1)}),t.$refs.fileMenu.addCount(-this.onList.length),t.onList=[],t.onImgs=[],$msg.success(n.msg)):$msg.error(n.msg)})},doSearch(){$prompt(!1,"搜索"+this.typeName,{inputPlaceholder:"输入文件名称或关键词",confirmButtonText:"搜索"}).then(t=>{t.value&&t.value&&(this.name=t.value,this.getList())})},getCheck(t){return this.onList.indexOf(t)>-1},fnCheck(t,n,r){if(t){if(this.canSum<=this.onList.length)return this.$msg.error(`最多可以选择${this.sum}个${this.typeName}`);this.onList.push(n),this.onImgs.push(r)}else $a.array.remove(this.onList,n),$a.array.remove(this.onImgs,r)},onSuccess(t){t?(this.list.unshift(t),this.$refs.fileMenu.addCount(),this.$msg.success(t.name+":上传成功")):this.$msg.error(t.name+"上传失败:"+e.msg)}}},Mp=["src"],zp={class:"dialog-footer"},$p={class:"imgs-top flex justify-between pb-sm"},Ip={class:"flex text-3"},Rp={key:1,class:"ml-xl flex"},Hp={class:"flex"},Up={class:"mr"},Wp={key:0,class:"mr"},qp={class:"mr"},Kp={class:"flex items-center"},Jp={class:"file-box-body"},Gp={class:"list"},Yp={key:0,class:"no-file"},Zp={class:"add"},Xp={key:0,class:"number"},Qp={class:"box-bg"},eh=["onClick"],th={key:0,class:"i-ri-eye-line"},nh={key:1,class:"i-ri-play-fill"},rh={key:4,class:"type-name"},oh={key:0,class:"i-ri-link pr-xs2"},ih=["title","onClick"],sh={class:"pages"};function ah(t,n,r,o,i,a){const l=s.resolveComponent("el-button"),c=s.resolveComponent("el-dialog"),u=s.resolveComponent("el-text"),d=s.resolveComponent("BigUpload"),f=s.resolveComponent("el-dropdown-item"),p=s.resolveComponent("el-dropdown-menu"),h=s.resolveComponent("el-dropdown"),m=s.resolveComponent("file-menu"),g=s.resolveComponent("el-link"),y=s.resolveComponent("el-checkbox"),v=s.resolveComponent("a-image"),D=s.resolveComponent("el-col"),w=s.resolveComponent("el-row"),C=s.resolveComponent("el-pagination"),B=s.resolveComponent("el-image-viewer");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",null,[s.createVNode(c,{modelValue:i.videoShow,"onUpdate:modelValue":n[1]||(n[1]=k=>i.videoShow=k),title:a.typeName,width:"600px",top:"15vh"},{footer:s.withCtx(()=>[s.createElementVNode("span",zp,[s.createVNode(l,{size:"small",onClick:n[0]||(n[0]=k=>i.videoShow=!1)},{default:s.withCtx(()=>[...n[5]||(n[5]=[s.createTextVNode("关闭",-1)])]),_:1})])]),default:s.withCtx(()=>[i.videoUrl&&i.videoShow?(s.openBlock(),s.createElementBlock("video",{key:0,src:t.$fileUrl(i.videoUrl),controls:"",style:s.normalizeStyle(`height:${{video:"400px",audio:"100px"}[this.fileType]};width: 100%;`)},null,12,Mp)):s.createCommentVNode("",!0)]),_:1},8,["modelValue","title"]),s.createElementVNode("div",$p,[s.createElementVNode("div",Ip,[n[8]||(n[8]=s.createTextVNode(" 已选择",-1)),s.createVNode(u,{class:"px-xs",type:"primary"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.onList.length),1)]),_:1}),s.createTextVNode("个 最多可选择"+s.toDisplayString(a.canSum)+"个 ",1),i.onList.length?(s.openBlock(),s.createBlock(u,{key:0,class:"pl-xs",size:"small",type:"primary",onClick:n[2]||(n[2]=k=>a.fnCancelCheck())},{default:s.withCtx(()=>[...n[6]||(n[6]=[s.createTextVNode("取消选择",-1)])]),_:1})):s.createCommentVNode("",!0),i.name?(s.openBlock(),s.createElementBlock("div",Rp,[s.createElementVNode("span",null,"搜索关键词:"+s.toDisplayString(i.name),1),s.createVNode(u,{class:"pl-xs",type:"primary",size:"small",onClick:n[3]||(n[3]=k=>a.menuChange(i.cateId))},{default:s.withCtx(()=>[...n[7]||(n[7]=[s.createTextVNode("返回",-1)])]),_:1})])):s.createCommentVNode("",!0)]),s.createElementVNode("div",Hp,[s.createElementVNode("div",Up,[s.createVNode(l,{type:"",onClick:a.fnAction},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.action?"退出管理":"管理"),1)]),_:1},8,["onClick"])]),i.action?(s.openBlock(),s.createElementBlock("div",Wp,[s.createVNode(l,{type:i.onImgs.length==0?"":"danger",disabled:i.onImgs.length==0,onClick:a.doDels},{default:s.withCtx(()=>[...n[9]||(n[9]=[s.createTextVNode("批量删除",-1)])]),_:1},8,["type","disabled","onClick"])])):s.createCommentVNode("",!0),s.createElementVNode("div",qp,[s.createVNode(l,{onClick:a.doSearch,type:"primary"},{default:s.withCtx(()=>[...n[10]||(n[10]=[s.createElementVNode("span",{class:"flex"},[s.createElementVNode("i",{class:"i-ri-search-line"}),s.createElementVNode("span",null,"搜索")],-1)])]),_:1},8,["onClick"])]),s.createVNode(h,{"split-button":"",type:"primary",onCommand:a.command},{dropdown:s.withCtx(()=>[s.createVNode(p,null,{default:s.withCtx(()=>[s.createVNode(f,{command:"url"},{default:s.withCtx(()=>[s.createTextVNode("通过链接添加"+s.toDisplayString(a.typeName),1)]),_:1})]),_:1})]),default:s.withCtx(()=>[s.createVNode(d,{accept:a.accept,type:i.fileType,cate:i.cateId,onSuccess:a.onSuccess,limit:r.sum},{default:s.withCtx(()=>[s.createElementVNode("span",Kp,[n[11]||(n[11]=s.createElementVNode("i",{class:"i-ri-upload-cloud-2-line"},null,-1)),s.createElementVNode("span",null,"上传"+s.toDisplayString(a.typeName),1)])]),_:1},8,["accept","type","cate","onSuccess","limit"])]),_:1},8,["onCommand"])])]),s.createElementVNode("div",Jp,[s.createVNode(m,{class:"bg-main-100",ref:"fileMenu",type:r.type,cate:i.cateId,onChange:a.menuChange},null,8,["type","cate","onChange"]),s.createElementVNode("div",Gp,[i.list.length==0?(s.openBlock(),s.createElementBlock("div",Yp,[n[13]||(n[13]=s.createElementVNode("div",{class:"op-50"},[s.createElementVNode("i",{class:"i-ri-folder-upload-line size-20"})],-1)),s.createElementVNode("div",Zp,[s.createElementVNode("span",null,"暂无"+s.toDisplayString(a.typeName)+",",1),s.createVNode(d,{accept:a.accept,type:i.fileType,cate:i.cateId,onSuccess:a.onSuccess,limit:r.sum},{default:s.withCtx(()=>[s.createVNode(g,{type:"primary"},{default:s.withCtx(()=>[...n[12]||(n[12]=[s.createTextVNode("点击添加",-1)])]),_:1})]),_:1},8,["accept","type","cate","onSuccess","limit"])])])):s.createCommentVNode("",!0),s.createVNode(w,{gutter:12},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.list,(k,_)=>(s.openBlock(),s.createBlock(D,{span:4},{default:s.withCtx(()=>[s.createElementVNode("div",{class:s.normalizeClass(["item",i.onList.indexOf(k.id)>-1?"on":""]),style:{"background-color":"url #f5f7fa"}},[(s.openBlock(),s.createBlock(y,{disabled:i.onList.length>=a.canSum&&!a.getCheck(k.id),key:i.onList.length+""+k.id,checked:a.getCheck(k.id),onChange:x=>{this.fnCheck(x,k.id,k.url)},class:"check"},null,8,["disabled","checked","onChange"])),i.onList.indexOf(k.id)>-1?(s.openBlock(),s.createElementBlock("div",Xp,s.toDisplayString(i.onList.indexOf(k.id)+1),1)):s.createCommentVNode("",!0),s.createElementVNode("div",Qp,[s.createElementVNode("i",{class:s.normalizeClass({video:"ri-movie-2-line",audio:"ri-disc-line"}[i.fileType])},null,2)]),i.fileType=="video"&&k?.extend?.img?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(["img",{mask:i.action}])},[s.createVNode(v,{src:k.extend.img},null,8,["src"])],2)):i.fileType=="image"?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(["img",{mask:i.action}])},[(s.openBlock(),s.createBlock(v,{src:k.url,key:k.id,process:"100"},null,8,["src"]))],2)):s.createCommentVNode("",!0),i.onList.indexOf(k.id)==-1?(s.openBlock(),s.createElementBlock("div",{key:3,onClick:x=>a.openFile(k),class:"view",title:"播放"},[k.type=="image"?(s.openBlock(),s.createElementBlock("i",th)):(s.openBlock(),s.createElementBlock("i",nh))],8,eh)):s.createCommentVNode("",!0),k.file_type?(s.openBlock(),s.createElementBlock("div",rh,[k.url?.startsWith("http")?(s.openBlock(),s.createElementBlock("span",oh)):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(k.file_type),1)])):s.createCommentVNode("",!0),s.createElementVNode("div",{class:"name line-1",title:k.name,onClick:x=>a.doName(_,k)},[s.createElementVNode("span",null,s.toDisplayString(k.name||"未命名"),1)],8,ih)],2)]),_:2},1024))),256))]),_:1})])]),s.createElementVNode("div",sh,[s.createVNode(C,{background:"",layout:"total,prev, pager,next",total:i.count,"page-size":i.limit,onCurrentChange:a.pageChange},null,8,["total","page-size","onCurrentChange"])])]),i.showImageViewer?(s.openBlock(),s.createBlock(B,{key:0,onClose:n[4]||(n[4]=k=>i.showImageViewer=!1),"url-list":i.imageList},null,8,["url-list"])):s.createCommentVNode("",!0)],64)}const lr=oe(Pp,[["render",ah],["__scopeId","data-v-b3f1b2c2"]]),lh={components:{imgBox:lr},props:{size:{type:[Number,String],default:0},limit:{type:Number,default:5},cateId:{type:Number,default:0},tips:String,modelValue:Array|String,disabled:Boolean},data(){return{_disabled:!1,style:{width:"100px",height:"100px"},imgShow:!1,list:[]}},created(){if(this._disabled=this.$parent.disabled?!0:this.disabled,this.size){let t=this.size;typeof t=="string"&&(t={small:60,mini:40}[t]||100),t&&(this.style={width:t+"px",height:t+"px",fontSize:t+"px"})}this.modelValue&&(this.list=this.modelValue),this.$watch("list",function(t){this.$emit("update:modelValue",t)},{deep:!0})},methods:{del(t){this.list.splice(t,1)},add(){let t=this.$refs.imgbox.getData();if(typeof t=="string")return this.$msg.error(t);if(t.length==0)return this.$msg.error("请选择图片");this.list=this.list.concat(t),this.imgShow=!1}}},ch={class:"dialog-footer"},uh={class:"input-imgs"},dh=["onClick"],fh={class:"text-12px pt-xs op-50"},ph={key:0,class:"pl-sm color-primary"};function hh(t,n,r,o,i,a){const l=s.resolveComponent("img-box"),c=s.resolveComponent("el-button"),u=s.resolveComponent("el-dialog"),d=s.resolveComponent("a-image"),f=s.resolveComponent("a-draggable");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(u,{modelValue:i.imgShow,"onUpdate:modelValue":n[1]||(n[1]=p=>i.imgShow=p),title:"选择图片",width:"1080px",top:"5vh"},{footer:s.withCtx(()=>[s.createElementVNode("span",ch,[s.createVNode(c,{onClick:n[0]||(n[0]=p=>i.imgShow=!1)},{default:s.withCtx(()=>[...n[3]||(n[3]=[s.createTextVNode("取消",-1)])]),_:1}),s.createVNode(c,{type:"primary",onClick:a.add},{default:s.withCtx(()=>[...n[4]||(n[4]=[s.createTextVNode("确认",-1)])]),_:1},8,["onClick"])])]),default:s.withCtx(()=>[s.createVNode(l,{ref:"imgbox",type:"image",sum:r.limit-i.list.length,cate:r.cateId},null,8,["sum","cate"])]),_:1},8,["modelValue"]),s.createElementVNode("div",uh,[s.createVNode(f,{disabled:i._disabled,class:"list flex flex-wrap gap-sm",list:i.list,filter:".add"},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.list,(p,h)=>(s.openBlock(),s.createElementBlock("div",{class:"item",style:s.normalizeStyle(i.style),key:p},[s.createVNode(d,{preview:i.list,index:h,fit:"contain",src:p,process:"100"},null,8,["preview","index","src"]),s.withDirectives(s.createElementVNode("div",{class:"del",onClick:m=>a.del(h)},[...n[5]||(n[5]=[s.createElementVNode("i",{class:"i-ri-close-line"},null,-1)])],8,dh),[[s.vShow,!i._disabled]])],4))),128)),i.list.length<r.limit?s.withDirectives((s.openBlock(),s.createElementBlock("div",{key:0,class:"flex flex-col justify-center items-center text-100px size-100px add",style:s.normalizeStyle(i.style),onClick:n[2]||(n[2]=p=>i.imgShow=!0)},[...n[6]||(n[6]=[s.createElementVNode("i",{class:"i-ri-image-add-line"},null,-1),s.createElementVNode("span",null,"添加图片",-1)])],4)),[[s.vShow,!i._disabled]]):s.createCommentVNode("",!0)]),_:1},8,["disabled","list"]),s.withDirectives(s.createElementVNode("div",fh,[s.createTextVNode("拖拽可调整图片顺序,最多可上传"+s.toDisplayString(r.limit)+"张",1),r.tips?(s.openBlock(),s.createElementBlock("span",ph,"("+s.toDisplayString(r.tips)+")",1)):s.createCommentVNode("",!0)],512),[[s.vShow,!i._disabled]])])],64)}const Ms=oe(lh,[["render",hh],["__scopeId","data-v-8f11d9a0"]]),mh={emits:["clear","update:modelValue"],props:{btn:{type:Object,default:()=>({})},placeholder:{type:String,default:"输入"},readonly:Boolean,disabled:{type:[String,Boolean,Number],default:!1},clearable:{type:Boolean,default:!1},icon:{type:String,default:""},size:{type:String,default:""},props:Object,modelValue:{type:[String,Boolean,Number,Array],default:""}},data(){return{value:""}},watch:{modelValue(t){this.value=t}},created(){this.value=this.modelValue},methods:{async doClick(){if(this.disabled)return;const t=await this.btn.click(this.value);t!==void 0&&(this.value=t,this.$emit("update:modelValue",this.value))},async setValue(t){this.disabled||(this.value=t,this.$emit("update:modelValue",t))},async doClear(){this.$emit("clear"),this.$emit("update:modelValue",null)}}},gh={class:"input-button"};function yh(t,n,r,o,i,a){const l=s.resolveComponent("el-input"),c=s.resolveComponent("el-button");return s.openBlock(),s.createElementBlock("div",gh,[s.createVNode(l,s.mergeProps({clearable:r.clearable,onClear:a.doClear},r.props,{readonly:r.readonly,onChange:n[1]||(n[1]=u=>t.$emit("update:modelValue",u)),modelValue:i.value,"onUpdate:modelValue":n[2]||(n[2]=u=>i.value=u),placeholder:r.placeholder,disabled:!!r.disabled}),{prefix:s.withCtx(()=>[s.createElementVNode("i",{class:s.normalizeClass(r.icon)},null,2)]),suffix:s.withCtx(()=>[i.value&&r.readonly&&r.clearable?(s.openBlock(),s.createElementBlock("i",{key:0,onClick:n[0]||(n[0]=s.withModifiers(u=>a.doClear(),["stop"])),class:"i-ri-delete-bin-7-line font-md hover:color-red",title:"清空输入框"})):s.createCommentVNode("",!0)]),_:1},16,["clearable","onClear","readonly","modelValue","placeholder","disabled"]),s.createVNode(c,{class:"h-full",disabled:!!r.disabled,type:"primary",onClick:n[3]||(n[3]=u=>a.doClick())},{default:s.withCtx(()=>[r.btn.icon?(s.openBlock(),s.createElementBlock("i",{key:0,class:s.normalizeClass(["mr-xs",r.btn.icon])},null,2)):s.createCommentVNode("",!0),s.createTextVNode(" "+s.toDisplayString(r.btn.text),1)]),_:1},8,["disabled"])])}const Eo=oe(mh,[["render",yh]]),bh={emits:["update:modelValue"],props:{modelValue:String},data(){return{list:[],url:""}},created(){this.url=this.modelValue,this.list=$config.urlBox.default},methods:{fnClick(t){this.url=t.url,this.$emit("update:modelValue",this.url)}}},Ch={class:"list"},vh={class:"py"},Dh=["onClick"];function wh(t,n,r,o,i,a){const l=s.resolveComponent("el-col"),c=s.resolveComponent("el-row");return s.openBlock(),s.createElementBlock("div",Ch,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.list,(u,d)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",vh,s.toDisplayString(u.title),1),s.createVNode(c,{gutter:12},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(u.list,(f,p)=>(s.openBlock(),s.createBlock(l,{span:4},{default:s.withCtx(()=>[s.createElementVNode("div",{class:s.normalizeClass(["item p-sm",i.url==f.url?"on":""]),onClick:h=>a.fnClick(f)},[n[0]||(n[0]=s.createElementVNode("i",{class:"i-ri-link"},null,-1)),s.createTextVNode(" "+s.toDisplayString(f.title),1)],10,Dh)]),_:2},1024))),256))]),_:2},1024)],64))),256))])}const Bh=oe(bh,[["render",wh],["__scopeId","data-v-bf3f41e0"]]),xh={emits:["update:modelValue"],props:{modelValue:String},data(){return{cateId:"goods",table:{},url:""}},watch:{url(t){this.$emit("update:modelValue",t)}},created(){this.url=this.modelValue,this.table={url:"admin.admin/goods",title:!1,limit:10,serachClass:"w-600px mx-auto pl-100px pt-md! pb-0!",search:{span:{span:12},gutter:0,btn:{text:"搜索",align:"right",reset:!1},cols:[{field:"title",placeholder:"输入商品标题或ID"}]},cols:[{field:"title",title:"商品标题"},{field:"id",title:"商品ID",width:200},{field:"action",title:"选择",width:150,slot:!0}]}},methods:{fnClick(t){this.curr=t.url,this.url=[this.cateId,t.url,t.title]},getData(){return this.url},fnDir(t){this.cateId=t}}},kh={style:{"--main-height":"calc(75vh + 36px)"}};function Eh(t,n,r,o,i,a){const l=s.resolveComponent("el-button"),c=s.resolveComponent("admin-table");return s.openBlock(),s.createElementBlock("div",kh,[s.createVNode(c,{init:i.table},{"cols.action":s.withCtx(({row:u})=>[i.url==`${i.cateId}┆┊${u.id}┆┊${u.title}`?(s.openBlock(),s.createBlock(l,{key:0,size:"small",type:"primary",disabled:""},{default:s.withCtx(()=>[...n[0]||(n[0]=[s.createTextVNode("已选",-1)])]),_:1})):(s.openBlock(),s.createBlock(l,{key:1,size:"small",type:"primary",onClick:d=>i.url=`${i.cateId}┆┊${u.id}┆┊${u.title}`},{default:s.withCtx(()=>[...n[1]||(n[1]=[s.createTextVNode("选择",-1)])]),_:1},8,["onClick"]))]),_:1},8,["init"])])}const _h=oe(xh,[["render",Eh]]),Ah={emits:["update:modelValue"],props:{modelValue:String},data(){return{cateId:"goodsCate",table:{},url:""}},watch:{url(t){this.$emit("update:modelValue",t)}},created(){this.url=this.modelValue,this.table={url:"admin.admin/goodsCate",title:!1,page:!1,tree:!0,cols:[{field:"title",title:"分类名称"},{field:"id",title:"分类ID",width:300},{field:"action",title:"选择",width:150,slot:!0}]}},methods:{fnClick(t){this.curr=t.url,this.url=[this.cateId,t.url,t.title]},getData(){return this.url},fnDir(t){this.cateId=t}}};function Nh(t,n,r,o,i,a){const l=s.resolveComponent("el-button"),c=s.resolveComponent("admin-table");return s.openBlock(),s.createBlock(c,{init:i.table},{"cols.action":s.withCtx(({row:u})=>[i.url==`${i.cateId}┆┊${u.id}┆┊${u.title}`?(s.openBlock(),s.createBlock(l,{key:0,size:"small",type:"primary",disabled:""},{default:s.withCtx(()=>[...n[0]||(n[0]=[s.createTextVNode("已选",-1)])]),_:1})):(s.openBlock(),s.createBlock(l,{key:1,size:"small",type:"primary",onClick:d=>i.url=`${i.cateId}┆┊${u.id}┆┊${u.title}`},{default:s.withCtx(()=>[...n[1]||(n[1]=[s.createTextVNode("选择",-1)])]),_:1},8,["onClick"]))]),_:1},8,["init"])}const Sh=oe(Ah,[["render",Nh]]),Fh={emits:["update:modelValue"],props:{modelValue:String},data(){return{cateId:"article",table:{},url:""}},watch:{url(t){this.$emit("update:modelValue",t)}},created(){this.url=this.modelValue,this.table={url:"admin.admin/article",title:!1,limit:10,serachClass:"w-600px mx-auto pl-100px pt-md! pb-0!",search:{span:{span:12},gutter:0,btn:{text:"搜索",align:"right",reset:!1},cols:[{field:"title",placeholder:"输入文章标题或关键词"}]},cols:[{field:"title",title:"文章标题"},{field:"id",title:"文章ID",width:200},{field:"action",title:"选择",width:150,slot:!0}]}},methods:{fnClick(t){this.curr=t.url,this.url=[this.cateId,t.url,t.title]},getData(){return this.url},fnDir(t){this.cateId=t}}},Vh={style:{"--main-height":"calc(75vh + 36px)"}};function Oh(t,n,r,o,i,a){const l=s.resolveComponent("el-button"),c=s.resolveComponent("admin-table");return s.openBlock(),s.createElementBlock("div",Vh,[s.createVNode(c,{init:i.table},{"cols.action":s.withCtx(({row:u})=>[i.url==`${i.cateId}┆┊${u.id}┆┊${u.title}`?(s.openBlock(),s.createBlock(l,{key:0,size:"small",type:"primary",disabled:""},{default:s.withCtx(()=>[...n[0]||(n[0]=[s.createTextVNode("已选",-1)])]),_:1})):(s.openBlock(),s.createBlock(l,{key:1,size:"small",type:"primary",onClick:d=>i.url=`${i.cateId}┆┊${u.id}┆┊${u.title}`},{default:s.withCtx(()=>[...n[1]||(n[1]=[s.createTextVNode("选择",-1)])]),_:1},8,["onClick"]))]),_:1},8,["init"])])}const Th=oe(Fh,[["render",Oh]]),jh={props:{modelValue:String|Array,url:String|Array},data(){return{value:""}},created(){typeof this.modelValue=="string"&&this.modelValue.indexOf("┆┊")===-1&&(this.value=this.modelValue)},methods:{update(t){this.$emit("update:modelValue",this.value)}}},Lh={class:"pxl mxl flex justify-center"},Ph={style:{width:"500px"}};function Mh(t,n,r,o,i,a){const l=s.resolveComponent("el-input");return s.openBlock(),s.createElementBlock("div",Lh,[s.createElementVNode("div",Ph,[s.createVNode(l,{placeholder:"输入链接",modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=c=>i.value=c),onInput:a.update},{prefix:s.withCtx(()=>[...n[1]||(n[1]=[s.createElementVNode("i",{class:"i-ri-link-m",style:{color:"#D9D9D9"}},null,-1)])]),_:1},8,["modelValue","onInput"])])])}const zh={name:"url-box",emits:["change"],components:{Base:Bh,Goods:_h,GoodsCate:Sh,Article:Th,Diy:oe(jh,[["render",Mh]])},data(){return{cateId:"Base",cate:[],cateHistory:["Base"],url:""}},watch:{url(t,n){this.$emit("change",t)}},created(){const t=[{title:"预设页面",id:"Base",show:$config.urlBox?.default},{title:"商品分类",id:"GoodsCate",show:$config.urlBox?.goodsCate!==!1},{title:"商品链接",id:"Goods",show:$config.urlBox?.goods!==!1},{title:"文章链接",id:"Article",show:$config.urlBox?.article!==!1},{title:"自定义链接",id:"Diy",show:$config.urlBox?.diy!==!1}];this.cate=t.filter(n=>n.show)},methods:{url2str(t){let n="";if(t&&(typeof t=="string"&&t.indexOf("┆┊")>-1?t=t.split("┆┊"):n=t),t&&typeof t=="object"){let r=t[0];r=="goods"?n="[商品]"+t[2]:r=="goodsCate"?n="[商品分类]"+t[2]:r=="article"?n="[文章]"+t[2]:t[2]=="base"&&(n=t[2])}return n},getData(){return this.url},doTab(t){this.cateId=this.cate[t.index].id,this.cateHistory.indexOf(this.cateId)===-1&&this.cateHistory.push(this.cateId)}}},$h={class:""},Ih={class:"pl-xs"};function Rh(t,n,r,o,i,a){const l=s.resolveComponent("el-tab-pane"),c=s.resolveComponent("el-tabs");return s.openBlock(),s.createElementBlock("div",$h,[s.createVNode(c,{"tab-position":"left",onTabClick:a.doTab,style:{height:"100%"}},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.cate,(u,d)=>(s.openBlock(),s.createBlock(l,{label:u.title},{default:s.withCtx(()=>[s.createElementVNode("div",Ih,[i.cateHistory.indexOf(u.id)>-1?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(u.id),{key:0,modelValue:i.url,"onUpdate:modelValue":n[0]||(n[0]=f=>i.url=f)},null,8,["modelValue"])):s.createCommentVNode("",!0)])]),_:2},1032,["label"]))),256))]),_:1},8,["onTabClick"])])}const zs=oe(zh,[["render",Rh]]),Hh={components:{inputButton:Eo,urlBox:zs},props:{modelValue:String},data(){return{show:!1,value:null}},computed:{url(){return this.url2str(this.value)}},created(){this.modelValue&&(this.value=this.modelValue)},methods:{close(){this.show=!1},change(t){this.value=t},url2str(t){let n="";if(t&&(typeof t=="string"&&t.indexOf("┆┊")>-1?t=t.split("┆┊"):n=t),t&&typeof t=="object"){let r=t[0];r=="goods"?n="[商品]"+t[2]:r=="goodsCate"?n="[商品分类]"+t[2]:r=="article"?n="[文章]"+t[2]:t[2]=="base"&&(n=t[2])}return n},update(){this.$emit("update:modelValue",this.value)},getData(){let t=this.$refs.urlbox.getData();t&&(this.value=t,this.update()),this.show=!1}}},Uh={style:{height:"75vh"}},Wh={class:"dialog-footer flex justify-end"},qh={key:0,class:"pr"};function Kh(t,n,r,o,i,a){const l=s.resolveComponent("url-box"),c=s.resolveComponent("el-text"),u=s.resolveComponent("el-button"),d=s.resolveComponent("el-dialog"),f=s.resolveComponent("input-button");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(d,{modelValue:i.show,"onUpdate:modelValue":n[1]||(n[1]=p=>i.show=p),title:"选择链接",width:"1080px",top:"5vh","append-to-body":""},{footer:s.withCtx(()=>[s.createElementVNode("div",Wh,[a.url?(s.openBlock(),s.createElementBlock("div",qh,[s.createVNode(c,{size:"small",class:"pr-xs"},{default:s.withCtx(()=>[...n[3]||(n[3]=[s.createTextVNode("已选链接:",-1)])]),_:1}),s.createVNode(c,{size:"small",type:"primary"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(a.url),1)]),_:1})])):s.createCommentVNode("",!0),s.createVNode(u,{size:"small",onClick:n[0]||(n[0]=p=>a.close())},{default:s.withCtx(()=>[...n[4]||(n[4]=[s.createTextVNode("取消",-1)])]),_:1}),s.createVNode(u,{size:"small",type:"primary",onClick:a.getData},{default:s.withCtx(()=>[...n[5]||(n[5]=[s.createTextVNode("确认选择",-1)])]),_:1},8,["onClick"])])]),default:s.withCtx(()=>[s.createElementVNode("div",Uh,[s.createVNode(l,{ref:"urlbox",onChange:a.change,style:{height:"100%"}},null,8,["onChange"])])]),_:1},8,["modelValue"]),(s.openBlock(),s.createBlock(f,{clearable:"",readonly:"",onClear:n[2]||(n[2]=p=>{i.value="",a.update()}),key:a.url,"model-value":a.url,icon:"i-ri-link-m",placeholder:"选择链接",btn:{text:"选择链接",click:()=>{i.show=!0}}},null,8,["model-value","btn"]))],64)}const Jh=oe(Hh,[["render",Kh]]),Gh={components:{mediaBox:lr,BigUpload:Ps},props:{type:String,modelValue:String,size:"",options:{type:Object,default:()=>({})},cate:{type:Number,default:0},limit:1},data(){return{fileType:"image",show:!1,value:""}},computed:{accept(){return this.fileType+"/*"},typeName(){return{video:"视频",audio:"音频",image:"图片",file:"文件"}[this.fileType]}},created(){this.value=this.modelValue,console.log(this),this.type&&(this.fileType=this.type)},methods:{onSuccess(t){t?(this.value=t.url,this.update(),this.$msg.success(t.name+":上传成功")):this.$msg.error(t.name+"上传失败:"+e.msg)},fndel(){this.value="",this.update()},update(){this.$emit("update:modelValue",this.value),this.$emit("change",this.value)},getFile(){let t=this.$refs.fileBox.getData();if(typeof t=="string")return this.$msg.error(t);if(t.length==0)return this.$msg.error("请选择"+this.typeName);this.value=t[0],this.show=!1,this.update()}}},Yh={class:"dialog-footer"},Zh={key:2,class:"i-ri-image-add-line size-30%"},Xh={class:"input-button"},Qh={key:0,class:"mt x-flex"},e0={key:0,controls:"",style:{height:"160px",width:"240px"}},t0=["src"],n0={key:1,controls:"",class:"h-60px w-240px"},r0=["src"],o0={key:2};function i0(t,n,r,o,i,a){const l=s.resolveComponent("media-box"),c=s.resolveComponent("el-button"),u=s.resolveComponent("el-dialog"),d=s.resolveComponent("a-image"),f=s.resolveComponent("el-input"),p=s.resolveComponent("BigUpload");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(u,{modelValue:i.show,"onUpdate:modelValue":n[1]||(n[1]=h=>i.show=h),title:"选择"+a.typeName,width:"1080px",top:"5vh"},{footer:s.withCtx(()=>[s.createElementVNode("span",Yh,[s.createVNode(c,{size:"small",onClick:n[0]||(n[0]=h=>i.show=!1)},{default:s.withCtx(()=>[...n[7]||(n[7]=[s.createTextVNode("取消",-1)])]),_:1}),s.createVNode(c,{size:"small",type:"primary",onClick:a.getFile},{default:s.withCtx(()=>[...n[8]||(n[8]=[s.createTextVNode("确认",-1)])]),_:1},8,["onClick"])])]),default:s.withCtx(()=>[s.createVNode(l,{type:i.fileType,sum:r.limit,cate:r.cate,ref:"fileBox"},null,8,["type","sum","cate"])]),_:1},8,["modelValue","title"]),r.options?.plain?(s.openBlock(),s.createElementBlock("div",{key:0,class:"input-img-add group",style:s.normalizeStyle({width:r.options.width,height:r.options.height||r.options.width}),onClick:n[3]||(n[3]=h=>i.show=!0)},[i.value?(s.openBlock(),s.createElementBlock("div",{key:0,class:"group-hover:flex hidden pos-absolute z-10 -top-3 -right-3 bg-primary rounded-full size-5 justify-center items-center hover:bg-red-6",title:"删除",onClick:n[2]||(n[2]=s.withModifiers((...h)=>a.fndel&&a.fndel(...h),["stop"]))},[...n[9]||(n[9]=[s.createElementVNode("i",{class:"i-ri-close-line bg-white"},null,-1)])])):s.createCommentVNode("",!0),i.value?(s.openBlock(),s.createBlock(d,{key:1,style:s.normalizeStyle({width:r.options.width,height:r.options.height||r.options.width}),fit:"contain",src:i.value},null,8,["style","src"])):(s.openBlock(),s.createElementBlock("i",Zh))],4)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("div",Xh,[s.createVNode(f,{clearable:"",readonly:"",modelValue:i.value,"onUpdate:modelValue":n[5]||(n[5]=h=>i.value=h),placeholder:"选择"+a.typeName},{prefix:s.withCtx(()=>[s.createElementVNode("i",{class:s.normalizeClass(["line-height font-lg",{video:"ri-vidicon-line",audio:"ri-disc-line",image:"ri-image-line"}[i.fileType]]),style:{color:"#d9d9d9"}},null,2)]),suffix:s.withCtx(()=>[i.value?(s.openBlock(),s.createElementBlock("i",{key:0,onClick:n[4]||(n[4]=s.withModifiers(h=>i.value=null,["stop"])),class:"i-ri-delete-bin-7-line font-md hover:color-red",title:"清空输入框"})):s.createCommentVNode("",!0)]),_:1},8,["modelValue","placeholder"]),r.options.direct?(s.openBlock(),s.createBlock(p,{key:0,accept:a.accept,type:i.fileType,cate:-1,limit:r.limit,onSuccess:a.onSuccess},{default:s.withCtx(()=>[s.createVNode(c,{style:{"margin-left":"-2px"},type:"primary"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.value?"更换":"选择")+s.toDisplayString(a.typeName),1)]),_:1})]),_:1},8,["accept","type","limit","onSuccess"])):(s.openBlock(),s.createBlock(c,{key:1,style:{"margin-left":"-2px"},type:"primary",onClick:n[6]||(n[6]=h=>i.show=!0)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.value?"更换":"选择")+s.toDisplayString(a.typeName),1)]),_:1}))]),i.value?(s.openBlock(),s.createElementBlock("div",Qh,[i.fileType=="video"?(s.openBlock(),s.createElementBlock("video",e0,[s.createElementVNode("source",{src:t.$fileUrl(i.value)},null,8,t0),s.createTextVNode(" 浏览器不支持此"+s.toDisplayString(a.typeName),1)])):i.fileType=="audio"?(s.openBlock(),s.createElementBlock("audio",n0,[s.createElementVNode("source",{src:t.$fileUrl(i.value)},null,8,r0),s.createTextVNode(" 浏览器不支持此"+s.toDisplayString(a.typeName),1)])):(s.openBlock(),s.createElementBlock("div",o0,[s.createVNode(d,{class:"img-grid-bg",src:i.value,css:"max-height:120px;max-width: 120px;"},null,8,["src"])]))])):s.createCommentVNode("",!0)],64))],64)}const s0=oe(Gh,[["render",i0]]);let _o=!1;const a0={name:"input-file",props:{modelValue:String,isSystem:{type:[String,Number,Boolean],default:!1},size:"",disabled:Boolean,url:{type:String,default:""},accept:{type:String,default:""},filename:{type:String,default:""}},data(){return{show:!1,value:"",percent:0,action:"",headers:{jwt:this.$cache.get("admin_jwt")}}},created(){this.value=this.modelValue,this.url?this.action=DMX.apiUrl+this.url:this.action=DMX.apiUrl+`admin.upload/upFile?name=${this.filename}&system=`+(this.isSystem?1:0)},methods:{onSuccess(t,n,r){this.$refs.upload.clearFiles(),_o.close(),t.code==0?(this.value=t.data,this.$emit("update:modelValue",this.value),this.$msg.success("上传成功")):this.$msg.error(t.msg)},beforeUpload(t){_o=this.$loading("上传中")},onError(t){return _o.close(),this.$msg.error("上传失败")},onProgress(t){this.percent=parseInt(t.percent)}}},l0={class:"input-button"},c0={key:0,class:"mt-sm"};function u0(t,n,r,o,i,a){const l=s.resolveComponent("el-input"),c=s.resolveComponent("el-button"),u=s.resolveComponent("el-upload"),d=s.resolveComponent("el-progress");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",l0,[s.createVNode(l,{modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=f=>i.value=f),placeholder:"选择文件",readonly:""},{prefix:s.withCtx(()=>[...n[1]||(n[1]=[s.createElementVNode("i",{class:"i-ri-file-line",style:{color:"#d9d9d9"}},null,-1)])]),_:1},8,["modelValue"]),s.createVNode(u,{action:i.action,headers:i.headers,"on-success":a.onSuccess,onProgress:a.onProgress,"on-error":a.onError,accept:r.accept,"before-upload":a.beforeUpload,"show-file-list":!1,ref:"upload"},{default:s.withCtx(()=>[s.createVNode(c,{type:"primary"},{default:s.withCtx(()=>[...n[2]||(n[2]=[s.createTextVNode("选择文件",-1)])]),_:1})]),_:1},8,["action","headers","on-success","onProgress","on-error","accept","before-upload"])]),i.percent!=0&&i.percent!=100?(s.openBlock(),s.createElementBlock("div",c0,[s.createVNode(d,{percentage:i.percent},null,8,["percentage"])])):s.createCommentVNode("",!0)],64)}const d0=oe(a0,[["render",u0]]),f0={name:"input-md5",props:{type:{type:[Number,String],default:0},length:{type:[Number,String],default:32},disabled:{type:[String,Boolean],default:!1},modelValue:String},data(){return{value:""}},created(){this.value=this.modelValue,this.$watch("value",(t,n)=>{this.$emit("update:modelValue",this.value)})},methods:{getKey(){const t=[];let n=[];const r=this.type+"";r==0||r==""?n.push("0123456789abcdefghijklmnopqrstuvwxyz_-!@"):(r.indexOf("1")>-1&&n.push("0123456789"),r.indexOf("2")>-1&&n.push("abcdefghijklmnopqrstuvwxyz"),r.indexOf("3")>-1&&n.push("_-!@")),n=n.join();for(let o=0;o<this.length;o++)t[o]=n.substr(Math.floor(Math.random()*n.length),1);return t.join("")},doMd5(){return this.getKey()}}};function p0(t,n,r,o,i,a){const l=s.resolveComponent("input-button");return s.openBlock(),s.createBlock(l,{modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=c=>i.value=c),clearable:"",icon:"i-ri-key-2-line",disabled:!!r.disabled,onClear:n[1]||(n[1]=c=>i.value=""),btn:{text:"随机生成",click:a.doMd5}},null,8,["modelValue","disabled","btn"])}const h0=oe(f0,[["render",p0]]),m0={emits:["change"],props:{init:{type:Object,default:()=>({})},modelValue:String|Array},data(){return{pk:"id",url:"",btn:{text:"搜索"},placeholder:"搜索",current:0,error:"没有搜索结果~",errorStatus:!1,value:"",list:[],onItems:{}}},created(){const{pk:t="id",titleName:n="title",imgName:r="img",url:o=""}=this.init;this.pk=t,this.url=o,this.titleName=n,this.imgName=r},methods:{getData(){return{value:this.current,detail:this.onItems}},fnClick(t){this.current=t[this.pk],this.onItems=t,this.$emit("change",{value:this.current,detail:this.onItems})},search(){if(!this.value)return this.$msg.info("请输入搜索内容");this.current=this.id=0,this.errorStatus=!1,this.getList()},getList(){if(!this.url)return $msg.error("no url");$req.post(this.url,{where:{[this.titleName]:this.value}}).then(t=>{t.code==0&&t.data.length>0?this.list=t.data:(this.$msg.info(t.msg||"没有相关搜索结果"),this.errorStatus=!0)})}}},g0={class:"search-box"},y0={key:0,class:"search-box-no-msg"},b0={class:"search-box-list max-w-800px x-flex gap-sm flex-wrap mx-auto"},C0=["onClick"],v0={class:"flex psm"},D0={class:"flex-col flex-1"},w0={key:0,class:"line-clamp-2"},B0={class:"color-error pt-xs"};function x0(t,n,r,o,i,a){const l=s.resolveComponent("input-button"),c=s.resolveComponent("a-image"),u=s.resolveComponent("el-scrollbar");return s.openBlock(),s.createElementBlock("div",g0,[s.createVNode(u,{class:"overflow-x-hidden w-full",height:"100%"},{default:s.withCtx(()=>[s.createElementVNode("div",{class:s.normalizeClass(["search-box-search","search-box-search-"+i.list.length])},[s.createVNode(l,{modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=d=>i.value=d),props:{clearable:!0},icon:"i-ri-search-line",placeholder:r.init.placeholder2??"选择",btn:{text:i.btn.text,click:d=>{d&&a.search()}}},null,8,["modelValue","placeholder","btn"])],2),i.errorStatus?(s.openBlock(),s.createElementBlock("div",y0,s.toDisplayString(i.error),1)):s.createCommentVNode("",!0),s.createElementVNode("div",b0,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.list,(d,f)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["item w-[calc(50%-var(--spacing-sm))] line-height-12",i.current==d[i.pk]?"on":""]),onClick:p=>a.fnClick(d)},[s.renderSlot(t.$slots,"item",{item:d},()=>[s.createElementVNode("div",v0,[d[t.imgName]?(s.openBlock(),s.createBlock(c,{key:0,class:"size-40px mr-sm",lazy:"",fit:"cover",preview:!1,src:d[t.imgName]},null,8,["src"])):s.createCommentVNode("",!0),s.createElementVNode("div",D0,[d[t.titleName]?(s.openBlock(),s.createElementBlock("span",w0,s.toDisplayString(d[t.titleName]),1)):s.createCommentVNode("",!0),s.createElementVNode("span",B0,"ID:"+s.toDisplayString(d[i.pk]),1)])])],!0)],10,C0))),256))])]),_:3})])}const k0={components:{inBox:oe(m0,[["render",x0],["__scopeId","data-v-eaec75a1"]])},emits:["change","update:modelValue"],props:{data:Object,size:"",init:{type:Object,default:()=>({})},modelValue:String|Number},data(){return{pk:"",titleName:"",imgName:"",show:!1,icon:"",value:null,showValue:null,showData:null}},computed:{btnText(){let t="选择";return this.value&&(t="更换"),t+this.init.name}},created(){this.modelValue&&(this.showValue=this.value=this.modelValue);const{pk:t="id",titleName:n="title",imgName:r="img",icon:o="ri-git-commit-line"}=this.init;this.pk=t,this.icon=o,this.titleName=n,this.imgName=r,this.init.join&&this.data[this.init.join]&&(this.showData=this.data[this.init.join])},methods:{close(){this.show=!1},change(t){this.showValue=t.value},btnClick(t){this.show=!0},clear(){this.value=null,this.showData=null,this.$emit("update:modelValue",null),this.show=!1},getData(){let t=this.$refs.inBox.getData();if(t.value)this.value=t.value,this.$emit("update:modelValue",t.value),this.init.join&&(this.showData=t.detail,this.$emit("change",t.detail,this.init.join)),this.show=!1;else return this.$msg.info("没有选择数据")}}},E0={class:"h-60vh w-full"},_0={class:"dialog-footer flex justify-end"},A0={key:0,class:"pr"},N0={key:0,class:"mt-sm"},S0={class:"flex-inline line-height-none border rounded-xs pd"},F0={key:0,class:"mr"},V0={class:"flex-col"},O0={key:0,class:"line-clamp-2 pb-sm"},T0={key:1,class:"color-error"};function j0(t,n,r,o,i,a){const l=s.resolveComponent("inBox"),c=s.resolveComponent("el-text"),u=s.resolveComponent("el-button"),d=s.resolveComponent("el-dialog"),f=s.resolveComponent("input-button"),p=s.resolveComponent("a-image");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(d,{modelValue:i.show,"onUpdate:modelValue":n[1]||(n[1]=h=>i.show=h),title:"搜索"+r.init.name,width:"60%",top:"10vh"},{footer:s.withCtx(()=>[s.createElementVNode("div",_0,[i.showValue?(s.openBlock(),s.createElementBlock("div",A0,[s.createVNode(c,{size:"small",class:"pr-xs"},{default:s.withCtx(()=>[s.createTextVNode("当前选择的"+s.toDisplayString(r.init.name)+":",1)]),_:1}),s.createVNode(c,{size:"small",type:"primary"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.showValue),1)]),_:1})])):s.createCommentVNode("",!0),s.createVNode(u,{size:"small",type:"primary",onClick:a.getData},{default:s.withCtx(()=>[...n[3]||(n[3]=[s.createTextVNode("确认选择",-1)])]),_:1},8,["onClick"])])]),default:s.withCtx(()=>[s.createElementVNode("div",E0,[s.createVNode(l,{ref:"inBox",modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=h=>i.value=h),init:r.init,onChange:a.change,class:"h-60vh w-full"},{item:s.withCtx(({item:h})=>[s.renderSlot(t.$slots,"item",{item:h})]),_:3},8,["modelValue","init","onChange"])])]),_:3},8,["modelValue","title"]),(s.openBlock(),s.createBlock(f,{readonly:"",clearable:"",key:i.value,modelValue:i.value,"onUpdate:modelValue":n[2]||(n[2]=h=>i.value=h),icon:i.icon,placeholder:r.init.placeholder??"选择",btn:{text:a.btnText,click:a.btnClick},onClear:a.clear},null,8,["modelValue","icon","placeholder","btn","onClear"])),r.init.join&&i.showData?(s.openBlock(),s.createElementBlock("div",N0,[s.renderSlot(t.$slots,"info",{data:i.showData},()=>[s.createElementVNode("div",S0,[i.showData[i.imgName]?(s.openBlock(),s.createElementBlock("div",F0,[s.createVNode(p,{class:"size-36px",fit:"cover",preview:!1,src:i.showData[i.imgName]},null,8,["src"])])):s.createCommentVNode("",!0),s.createElementVNode("div",V0,[i.showData[i.titleName]?(s.openBlock(),s.createElementBlock("div",O0,s.toDisplayString(i.showData[i.titleName]),1)):s.createCommentVNode("",!0),i.showData[i.pk]?(s.openBlock(),s.createElementBlock("div",T0,"ID:"+s.toDisplayString(i.showData[i.pk]),1)):s.createCommentVNode("",!0)])])])])):s.createCommentVNode("",!0)],64)}const $s=oe(k0,[["render",j0]]);var Ao;typeof global>"u"?("ActiveXObject"in window&&console.error(`抱歉,wangEditor V5+ 版本开始,不在支持 IE 浏览器
|
|
3
|
+
Sorry, wangEditor V5+ versions do not support IE browser.`),Is(),Rs()):global&&(!((Ao=global.navigator)===null||Ao===void 0)&&Ao.userAgent.match("QQBrowser"))&&(Is(),Rs());function Is(){typeof globalThis>"u"&&(window.globalThis=window)}function Rs(){typeof AggregateError>"u"&&(window.AggregateError=function(t,n){var r=new Error(n);return r.errors=t,r})}if(typeof global=="object"){var L0=Object.getOwnPropertyDescriptor(global,"window");global.window&&!L0.set||(global.window=global,global.requestAnimationFrame=function(){},global.navigator={userAgent:""},global.location={hostname:"0.0.0.0",port:0,protocol:"http:"},global.btoa=function(){},global.crypto={getRandomValues:function(t){return nodeCrypto.randomFillSync(t)}}),global.document!=null&&global.document.getElementsByTagName==null&&(global.document.getElementsByTagName=function(){return[]})}function Hs(t){return Object.prototype.toString.call(t)==="[object Object]"}function Qe(t){var n,r;return Hs(t)!==!1&&((n=t.constructor)===void 0||Hs(r=n.prototype)!==!1&&r.hasOwnProperty("isPrototypeOf")!==!1)}function _t(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map((function(i){return"'"+i+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Zt(t){return!!t&&!!t[vt]}function Xt(t){return!!t&&((function(n){if(!n||typeof n!="object")return!1;var r=Object.getPrototypeOf(n);if(r===null)return!0;var o=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return o===Object||typeof o=="function"&&Function.toString.call(o)===R0})(t)||Array.isArray(t)||!!t[Qs]||!!t.constructor[Qs]||So(t)||Fo(t))}function jn(t,n,r){r===void 0&&(r=!1),fn(t)===0?(r?Object.keys:Ho)(t).forEach((function(o){r&&typeof o=="symbol"||n(o,t[o],t)})):t.forEach((function(o,i){return n(i,o,t)}))}function fn(t){var n=t[vt];return n?n.i>3?n.i-4:n.i:Array.isArray(t)?1:So(t)?2:Fo(t)?3:0}function No(t,n){return fn(t)===2?t.has(n):Object.prototype.hasOwnProperty.call(t,n)}function Us(t,n,r){var o=fn(t);o===2?t.set(n,r):o===3?(t.delete(n),t.add(r)):t[n]=r}function So(t){return $0&&t instanceof Map}function Fo(t){return I0&&t instanceof Set}function Qt(t){return t.o||t.t}function Vo(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var n=H0(t);delete n[vt];for(var r=Ho(n),o=0;o<r.length;o++){var i=r[o],a=n[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(n[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),n)}function Oo(t,n){return n===void 0&&(n=!1),To(t)||Zt(t)||!Xt(t)||(fn(t)>1&&(t.set=t.add=t.clear=t.delete=P0),Object.freeze(t),n&&jn(t,(function(r,o){return Oo(o,!0)}),!0)),t}function P0(){_t(2)}function To(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Pt(t){var n=U0[t];return n||_t(18,t),n}function Ws(){return Ln}function jo(t,n){n&&(Pt("Patches"),t.u=[],t.s=[],t.v=n)}function cr(t){Lo(t),t.p.forEach(M0),t.p=null}function Lo(t){t===Ln&&(Ln=t.l)}function qs(t){return Ln={p:[],l:Ln,h:t,m:!0,_:0}}function M0(t){var n=t[vt];n.i===0||n.i===1?n.j():n.O=!0}function Po(t,n){n._=n.p.length;var r=n.p[0],o=t!==void 0&&t!==r;return n.h.g||Pt("ES5").S(n,t,o),o?(r[vt].P&&(cr(n),_t(4)),Xt(t)&&(t=ur(n,t),n.l||dr(n,t)),n.u&&Pt("Patches").M(r[vt],t,n.u,n.s)):t=ur(n,r,[]),cr(n),n.u&&n.v(n.u,n.s),t!==Xs?t:void 0}function ur(t,n,r){if(To(n))return n;var o=n[vt];if(!o)return jn(n,(function(a,l){return Ks(t,o,n,a,l,r)}),!0),n;if(o.A!==t)return n;if(!o.P)return dr(t,o.t,!0),o.t;if(!o.I){o.I=!0,o.A._--;var i=o.i===4||o.i===5?o.o=Vo(o.k):o.o;jn(o.i===3?new Set(i):i,(function(a,l){return Ks(t,o,i,a,l,r)})),dr(t,i,!1),r&&t.u&&Pt("Patches").R(o,r,t.u,t.s)}return o.o}function Ks(t,n,r,o,i,a){if(Zt(i)){var l=ur(t,i,a&&n&&n.i!==3&&!No(n.D,o)?a.concat(o):void 0);if(Us(r,o,l),!Zt(l))return;t.m=!1}if(Xt(i)&&!To(i)){if(!t.h.F&&t._<1)return;ur(t,i),n&&n.A.l||dr(t,i)}}function dr(t,n,r){r===void 0&&(r=!1),t.h.F&&t.m&&Oo(n,r)}function Mo(t,n){var r=t[vt];return(r?Qt(r):t)[n]}function Js(t,n){if(n in t)for(var r=Object.getPrototypeOf(t);r;){var o=Object.getOwnPropertyDescriptor(r,n);if(o)return o;r=Object.getPrototypeOf(r)}}function zo(t){t.P||(t.P=!0,t.l&&zo(t.l))}function $o(t){t.o||(t.o=Vo(t.t))}function Io(t,n,r){var o=So(n)?Pt("MapSet").N(n,r):Fo(n)?Pt("MapSet").T(n,r):t.g?(function(i,a){var l=Array.isArray(i),c={i:l?1:0,A:a?a.A:Ws(),P:!1,I:!1,D:{},l:a,t:i,k:null,o:null,j:null,C:!1},u=c,d=fr;l&&(u=[c],d=pr);var f=Proxy.revocable(u,d),p=f.revoke,h=f.proxy;return c.k=h,c.j=p,h})(n,r):Pt("ES5").J(n,r);return(r?r.A:Ws()).p.push(o),o}function z0(t){return Zt(t)||_t(22,t),(function n(r){if(!Xt(r))return r;var o,i=r[vt],a=fn(r);if(i){if(!i.P&&(i.i<4||!Pt("ES5").K(i)))return i.t;i.I=!0,o=Gs(r,a),i.I=!1}else o=Gs(r,a);return jn(o,(function(l,c){i&&(function(u,d){return fn(u)===2?u.get(d):u[d]})(i.t,l)===c||Us(o,l,n(c))})),a===3?new Set(o):o})(t)}function Gs(t,n){switch(n){case 2:return new Map(t);case 3:return Array.from(t)}return Vo(t)}var Ys,Ln,Ro=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",$0=typeof Map<"u",I0=typeof Set<"u",Zs=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Xs=Ro?Symbol.for("immer-nothing"):((Ys={})["immer-nothing"]=!0,Ys),Qs=Ro?Symbol.for("immer-draftable"):"__$immer_draftable",vt=Ro?Symbol.for("immer-state"):"__$immer_state",R0=""+Object.prototype.constructor,Ho=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,H0=Object.getOwnPropertyDescriptors||function(t){var n={};return Ho(t).forEach((function(r){n[r]=Object.getOwnPropertyDescriptor(t,r)})),n},U0={},fr={get:function(t,n){if(n===vt)return t;var r=Qt(t);if(!No(r,n))return(function(i,a,l){var c,u=Js(a,l);return u?"value"in u?u.value:(c=u.get)===null||c===void 0?void 0:c.call(i.k):void 0})(t,r,n);var o=r[n];return t.I||!Xt(o)?o:o===Mo(t.t,n)?($o(t),t.o[n]=Io(t.A.h,o,t)):o},has:function(t,n){return n in Qt(t)},ownKeys:function(t){return Reflect.ownKeys(Qt(t))},set:function(t,n,r){var o=Js(Qt(t),n);if(o?.set)return o.set.call(t.k,r),!0;if(!t.P){var i=Mo(Qt(t),n),a=i?.[vt];if(a&&a.t===r)return t.o[n]=r,t.D[n]=!1,!0;if((function(l,c){return l===c?l!==0||1/l==1/c:l!=l&&c!=c})(r,i)&&(r!==void 0||No(t.t,n)))return!0;$o(t),zo(t)}return t.o[n]===r&&typeof r!="number"&&(r!==void 0||n in t.o)||(t.o[n]=r,t.D[n]=!0,!0)},deleteProperty:function(t,n){return Mo(t.t,n)!==void 0||n in t.t?(t.D[n]=!1,$o(t),zo(t)):delete t.D[n],t.o&&delete t.o[n],!0},getOwnPropertyDescriptor:function(t,n){var r=Qt(t),o=Reflect.getOwnPropertyDescriptor(r,n);return o&&{writable:!0,configurable:t.i!==1||n!=="length",enumerable:o.enumerable,value:r[n]}},defineProperty:function(){_t(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){_t(12)}},pr={};jn(fr,(function(t,n){pr[t]=function(){return arguments[0]=arguments[0][0],n.apply(this,arguments)}})),pr.deleteProperty=function(t,n){return fr.deleteProperty.call(this,t[0],n)},pr.set=function(t,n,r){return fr.set.call(this,t[0],n,r,t[0])};var W0=(function(){function t(r){var o=this;this.g=Zs,this.F=!0,this.produce=function(i,a,l){if(typeof i=="function"&&typeof a!="function"){var c=a;a=i;var u=o;return function(m){var g=this;m===void 0&&(m=c);for(var y=arguments.length,v=Array(y>1?y-1:0),D=1;D<y;D++)v[D-1]=arguments[D];return u.produce(m,(function(w){var C;return(C=a).call.apply(C,[g,w].concat(v))}))}}var d;if(typeof a!="function"&&_t(6),l!==void 0&&typeof l!="function"&&_t(7),Xt(i)){var f=qs(o),p=Io(o,i,void 0),h=!0;try{d=a(p),h=!1}finally{h?cr(f):Lo(f)}return typeof Promise<"u"&&d instanceof Promise?d.then((function(m){return jo(f,l),Po(m,f)}),(function(m){throw cr(f),m})):(jo(f,l),Po(d,f))}if(!i||typeof i!="object")return(d=a(i))===Xs?void 0:(d===void 0&&(d=i),o.F&&Oo(d,!0),d);_t(21,i)},this.produceWithPatches=function(i,a){return typeof i=="function"?function(u){for(var d=arguments.length,f=Array(d>1?d-1:0),p=1;p<d;p++)f[p-1]=arguments[p];return o.produceWithPatches(u,(function(h){return i.apply(void 0,[h].concat(f))}))}:[o.produce(i,a,(function(u,d){l=u,c=d})),l,c];var l,c},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var n=t.prototype;return n.createDraft=function(r){Xt(r)||_t(8),Zt(r)&&(r=z0(r));var o=qs(this),i=Io(this,r,void 0);return i[vt].C=!0,Lo(o),i},n.finishDraft=function(r,o){var i=(r&&r[vt]).A;return jo(i,o),Po(void 0,i)},n.setAutoFreeze=function(r){this.F=r},n.setUseProxies=function(r){r&&!Zs&&_t(20),this.g=r},n.applyPatches=function(r,o){var i;for(i=o.length-1;i>=0;i--){var a=o[i];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}i>-1&&(o=o.slice(i+1));var l=Pt("Patches").$;return Zt(r)?l(r,o):this.produce(r,(function(c){return l(c,o)}))},t})(),Dt=new W0,hr=Dt.produce;Dt.produceWithPatches.bind(Dt),Dt.setAutoFreeze.bind(Dt),Dt.setUseProxies.bind(Dt),Dt.applyPatches.bind(Dt);var ea=Dt.createDraft.bind(Dt),ta=Dt.finishDraft.bind(Dt);function Ot(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var mr=new WeakMap,Pn=new WeakMap,na=new WeakMap,ra=new WeakMap,oa=new WeakMap,ia=new WeakMap;function sa(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),r.push.apply(r,o)}return r}function gr(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?sa(Object(r),!0).forEach((function(o){Ot(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sa(Object(r)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))}))}return t}var q0=()=>{var t={children:[],operations:[],selection:null,marks:null,isInline:()=>!1,isVoid:()=>!1,onChange:()=>{},apply:n=>{for(var r of b.pathRefs(t))w1.transform(r,n);for(var o of b.pointRefs(t))B1.transform(o,n);for(var i of b.rangeRefs(t))k1.transform(i,n);var a=new Set,l=[],c=h=>{if(h){var m=h.join(",");a.has(m)||(a.add(m),l.push(h))}},u=mr.get(t)||[],d=K0(n);for(var f of u)c(A.transform(f,n));for(var p of d)c(p);mr.set(t,l),O.transform(t,n),t.operations.push(n),b.normalize(t),n.type==="set_selection"&&(t.marks=null),Pn.get(t)||(Pn.set(t,!0),Promise.resolve().then((()=>{Pn.set(t,!1),t.onChange(),t.operations=[]})))},addMark:(n,r)=>{var{selection:o}=t;if(o)if(j.isExpanded(o))O.setNodes(t,{[n]:r},{match:K.isText,split:!0});else{var i=gr(gr({},b.marks(t)||{}),{},{[n]:r});t.marks=i,Pn.get(t)||t.onChange()}},deleteBackward:n=>{var{selection:r}=t;r&&j.isCollapsed(r)&&O.delete(t,{unit:n,reverse:!0})},deleteForward:n=>{var{selection:r}=t;r&&j.isCollapsed(r)&&O.delete(t,{unit:n})},deleteFragment:n=>{var{selection:r}=t;r&&j.isExpanded(r)&&O.delete(t,{reverse:n==="backward"})},getFragment:()=>{var{selection:n}=t;return n?U.fragment(t,n):[]},insertBreak:()=>{O.splitNodes(t,{always:!0})},insertFragment:n=>{O.insertFragment(t,n)},insertNode:n=>{O.insertNodes(t,n)},insertText:n=>{var{selection:r,marks:o}=t;if(r){if(o){var i=gr({text:n},o);O.insertNodes(t,i)}else O.insertText(t,n);t.marks=null}},normalizeNode:n=>{var[r,o]=n;if(!K.isText(r))if(te.isElement(r)&&r.children.length===0)O.insertNodes(t,{text:""},{at:o.concat(0),voids:!0});else for(var i=!b.isEditor(r)&&te.isElement(r)&&(t.isInline(r)||r.children.length===0||K.isText(r.children[0])||t.isInline(r.children[0])),a=0,l=0;l<r.children.length;l++,a++){var c=U.get(t,o);if(!K.isText(c)){var u=r.children[l],d=c.children[a-1],f=l===r.children.length-1;(K.isText(u)||te.isElement(u)&&t.isInline(u))!==i?(O.removeNodes(t,{at:o.concat(a),voids:!0}),a--):te.isElement(u)?t.isInline(u)&&(d!=null&&K.isText(d)?f&&(O.insertNodes(t,{text:""},{at:o.concat(a+1),voids:!0}),a++):(O.insertNodes(t,{text:""},{at:o.concat(a),voids:!0}),a++)):d!=null&&K.isText(d)&&(K.equals(u,d,{loose:!0})?(O.mergeNodes(t,{at:o.concat(a),voids:!0}),a--):d.text===""?(O.removeNodes(t,{at:o.concat(a-1),voids:!0}),a--):u.text===""&&(O.removeNodes(t,{at:o.concat(a),voids:!0}),a--))}}},removeMark:n=>{var{selection:r}=t;if(r)if(j.isExpanded(r))O.unsetNodes(t,n,{match:K.isText,split:!0});else{var o=gr({},b.marks(t)||{});delete o[n],t.marks=o,Pn.get(t)||t.onChange()}}};return t},K0=t=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":var{path:n}=t;return A.levels(n);case"insert_node":var{node:r,path:o}=t,i=A.levels(o),a=K.isText(r)?[]:Array.from(U.nodes(r),(B=>{var[,k]=B;return o.concat(k)}));return[...i,...a];case"merge_node":var{path:l}=t;return[...A.ancestors(l),A.previous(l)];case"move_node":var{path:c,newPath:u}=t;if(A.equals(c,u))return[];var d=[],f=[];for(var p of A.ancestors(c)){var h=A.transform(p,t);d.push(h)}for(var m of A.ancestors(u)){var g=A.transform(m,t);f.push(g)}var y=f[f.length-1],v=u[u.length-1],D=y.concat(v);return[...d,...f,D];case"remove_node":var{path:w}=t;return[...A.ancestors(w)];case"split_node":var{path:C}=t;return[...A.levels(C),A.next(C)];default:return[]}};function Mt(t,n){if(t==null)return{};var r,o,i=(function(l,c){if(l==null)return{};var u,d,f={},p=Object.keys(l);for(d=0;d<p.length;d++)u=p[d],c.indexOf(u)>=0||(f[u]=l[u]);return f})(t,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(o=0;o<a.length;o++)r=a[o],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}var fe,Uo=function(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=!n,o=n?X0(t):t,i=fe.None,a=fe.None,l=0,c=null;for(var u of o){var d=u.codePointAt(0);if(!d)break;var f=u1(u,d);if([i,a]=r?[a,f]:[f,i],pn(i,fe.ZWJ)&&pn(a,fe.ExtPict)&&!h1(r?t.substring(0,l):t.substring(0,t.length-l))||pn(i,fe.RI)&&pn(a,fe.RI)&&!(c=c!==null?!c:!!r||g1(t.substring(0,t.length-l)))||i!==fe.None&&a!==fe.None&&f1(i,a))break;l+=u.length}return l||1},J0=/\s/,G0=/[\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,Y0=/['\u2018\u2019]/,Wo=(t,n,r)=>{if(r){var o=t.length-n;return[t.slice(o,t.length),t.slice(0,o)]}return[t.slice(0,n),t.slice(n)]},Z0=function t(n,r){var o=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(J0.test(n))return!1;if(Y0.test(n)){var i=Uo(r,o),[a,l]=Wo(r,i,o);if(t(a,l,o))return!0}return!G0.test(n)},X0=function*(t){for(var n=t.length-1,r=0;r<t.length;r++){var o=t.charAt(n-r);if(e1(o.charCodeAt(0))){var i=t.charAt(n-r-1);if(Q0(i.charCodeAt(0))){yield i+o,r++;continue}}yield o}},Q0=t=>t>=55296&&t<=56319,e1=t=>t>=56320&&t<=57343;(function(t){t[t.None=0]="None",t[t.Extend=1]="Extend",t[t.ZWJ=2]="ZWJ",t[t.RI=4]="RI",t[t.Prepend=8]="Prepend",t[t.SpacingMark=16]="SpacingMark",t[t.L=32]="L",t[t.V=64]="V",t[t.T=128]="T",t[t.LV=256]="LV",t[t.LVT=512]="LVT",t[t.ExtPict=1024]="ExtPict",t[t.Any=2048]="Any"})(fe||(fe={}));var t1=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1AC0\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,n1=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,r1=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,o1=/^[\u1100-\u115F\uA960-\uA97C]$/,i1=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,s1=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,a1=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,l1=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,c1=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,u1=(t,n)=>{var r=fe.Any;return t.search(t1)!==-1&&(r|=fe.Extend),n===8205&&(r|=fe.ZWJ),n>=127462&&n<=127487&&(r|=fe.RI),t.search(n1)!==-1&&(r|=fe.Prepend),t.search(r1)!==-1&&(r|=fe.SpacingMark),t.search(o1)!==-1&&(r|=fe.L),t.search(i1)!==-1&&(r|=fe.V),t.search(s1)!==-1&&(r|=fe.T),t.search(a1)!==-1&&(r|=fe.LV),t.search(l1)!==-1&&(r|=fe.LVT),t.search(c1)!==-1&&(r|=fe.ExtPict),r};function pn(t,n){return!!(t&n)}var d1=[[fe.L,fe.L|fe.V|fe.LV|fe.LVT],[fe.LV|fe.V,fe.V|fe.T],[fe.LVT|fe.T,fe.T],[fe.Any,fe.Extend|fe.ZWJ],[fe.Any,fe.SpacingMark],[fe.Prepend,fe.Any],[fe.ZWJ,fe.ExtPict],[fe.RI,fe.RI]];function f1(t,n){return d1.findIndex((r=>pn(t,r[0])&&pn(n,r[1])))===-1}var p1=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1AC0\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,h1=t=>t.search(p1)!==-1,m1=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,g1=t=>{var n=t.match(m1);return n!==null&&n[0].length/2%2==1},aa=t=>Qe(t)&&U.isNodeList(t.children)&&!b.isEditor(t),te={isAncestor:t=>Qe(t)&&U.isNodeList(t.children),isElement:aa,isElementList:t=>Array.isArray(t)&&t.every((n=>te.isElement(n))),isElementProps:t=>t.children!==void 0,isElementType:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"type";return aa(t)&&t[r]===n},matches(t,n){for(var r in n)if(r!=="children"&&t[r]!==n[r])return!1;return!0}},y1=["text"],b1=["text"];function la(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),r.push.apply(r,o)}return r}function hn(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?la(Object(r),!0).forEach((function(o){Ot(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):la(Object(r)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))}))}return t}var ca=new WeakMap,b={above(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{voids:r=!1,mode:o="lowest",at:i=t.selection,match:a}=n;if(i){var l=b.path(t,i),c=o==="lowest";for(var[u,d]of b.levels(t,{at:l,voids:r,match:a,reverse:c}))if(!K.isText(u)&&!A.equals(l,d))return[u,d]}},addMark(t,n,r){t.addMark(n,r)},after(t,n){var r,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i={anchor:b.point(t,n,{edge:"end"}),focus:b.end(t,[])},{distance:a=1}=o,l=0;for(var c of b.positions(t,hn(hn({},o),{},{at:i}))){if(l>a)break;l!==0&&(r=c),l++}return r},before(t,n){var r,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i={anchor:b.start(t,[]),focus:b.point(t,n,{edge:"start"})},{distance:a=1}=o,l=0;for(var c of b.positions(t,hn(hn({},o),{},{at:i,reverse:!0}))){if(l>a)break;l!==0&&(r=c),l++}return r},deleteBackward(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:r="character"}=n;t.deleteBackward(r)},deleteForward(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:r="character"}=n;t.deleteForward(r)},deleteFragment(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{direction:r="forward"}=n;t.deleteFragment(r)},edges:(t,n)=>[b.start(t,n),b.end(t,n)],end:(t,n)=>b.point(t,n,{edge:"end"}),first(t,n){var r=b.path(t,n,{edge:"start"});return b.node(t,r)},fragment(t,n){var r=b.range(t,n);return U.fragment(t,r)},hasBlocks:(t,n)=>n.children.some((r=>b.isBlock(t,r))),hasInlines:(t,n)=>n.children.some((r=>K.isText(r)||b.isInline(t,r))),hasTexts:(t,n)=>n.children.every((r=>K.isText(r))),insertBreak(t){t.insertBreak()},insertFragment(t,n){t.insertFragment(n)},insertNode(t,n){t.insertNode(n)},insertText(t,n){t.insertText(n)},isBlock:(t,n)=>te.isElement(n)&&!t.isInline(n),isEditor(t){if(!Qe(t))return!1;var n=ca.get(t);if(n!==void 0)return n;var r=typeof t.addMark=="function"&&typeof t.apply=="function"&&typeof t.deleteBackward=="function"&&typeof t.deleteForward=="function"&&typeof t.deleteFragment=="function"&&typeof t.insertBreak=="function"&&typeof t.insertFragment=="function"&&typeof t.insertNode=="function"&&typeof t.insertText=="function"&&typeof t.isInline=="function"&&typeof t.isVoid=="function"&&typeof t.normalizeNode=="function"&&typeof t.onChange=="function"&&typeof t.removeMark=="function"&&(t.marks===null||Qe(t.marks))&&(t.selection===null||j.isRange(t.selection))&&U.isNodeList(t.children)&&Wt.isOperationList(t.operations);return ca.set(t,r),r},isEnd(t,n,r){var o=b.end(t,r);return ye.equals(n,o)},isEdge:(t,n,r)=>b.isStart(t,n,r)||b.isEnd(t,n,r),isEmpty(t,n){var{children:r}=n,[o]=r;return r.length===0||r.length===1&&K.isText(o)&&o.text===""&&!t.isVoid(n)},isInline:(t,n)=>te.isElement(n)&&t.isInline(n),isNormalizing(t){var n=na.get(t);return n===void 0||n},isStart(t,n,r){if(n.offset!==0)return!1;var o=b.start(t,r);return ye.equals(n,o)},isVoid:(t,n)=>te.isElement(n)&&t.isVoid(n),last(t,n){var r=b.path(t,n,{edge:"end"});return b.node(t,r)},leaf(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=b.path(t,n,r);return[U.leaf(t,o),o]},*levels(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:r=t.selection,reverse:o=!1,voids:i=!1}=n,{match:a}=n;if(a==null&&(a=()=>!0),r){var l=[],c=b.path(t,r);for(var[u,d]of U.levels(t,c))if(a(u,d)&&(l.push([u,d]),!i&&b.isVoid(t,u)))break;o&&l.reverse(),yield*l}},marks(t){var{marks:n,selection:r}=t;if(!r)return null;if(n)return n;if(j.isExpanded(r)){var[o]=b.nodes(t,{match:K.isText});if(o){var[i]=o;return Mt(i,y1)}return{}}var{anchor:a}=r,{path:l}=a,[c]=b.leaf(t,l);if(a.offset===0){var u=b.previous(t,{at:l,match:K.isText}),d=b.above(t,{match:m=>b.isBlock(t,m)});if(u&&d){var[f,p]=u,[,h]=d;A.isAncestor(h,p)&&(c=f)}}return Mt(c,b1)},next(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:o=!1}=n,{match:i,at:a=t.selection}=n;if(a){var l=b.after(t,a,{voids:o});if(l){var[,c]=b.last(t,[]),u=[l.path,c];if(A.isPath(a)&&a.length===0)throw new Error("Cannot get the next node from the root node!");if(i==null)if(A.isPath(a)){var[d]=b.parent(t,a);i=p=>d.children.includes(p)}else i=()=>!0;var[f]=b.nodes(t,{at:u,match:i,mode:r,voids:o});return f}}},node(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=b.path(t,n,r);return[U.get(t,o),o]},*nodes(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:r=t.selection,mode:o="all",universal:i=!1,reverse:a=!1,voids:l=!1}=n,{match:c}=n;if(c||(c=()=>!0),r){var u,d;if(C1.isSpan(r))u=r[0],d=r[1];else{var f=b.path(t,r,{edge:"start"}),p=b.path(t,r,{edge:"end"});u=a?p:f,d=a?f:p}var h,m=U.nodes(t,{reverse:a,from:u,to:d,pass:C=>{var[B]=C;return!l&&b.isVoid(t,B)}}),g=[];for(var[y,v]of m){var D=h&&A.compare(v,h[1])===0;if(o!=="highest"||!D){if(c(y,v))if(o==="lowest"&&D)h=[y,v];else{var w=o==="lowest"?h:[y,v];w&&(i?g.push(w):yield w),h=[y,v]}else if(i&&!D&&K.isText(y))return}}o==="lowest"&&h&&(i?g.push(h):yield h),i&&(yield*g)}},normalize(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{force:r=!1}=n,o=a=>mr.get(a)||[];if(b.isNormalizing(t)){if(r){var i=Array.from(U.nodes(t),(a=>{var[,l]=a;return l}));mr.set(t,i)}o(t).length!==0&&b.withoutNormalizing(t,(()=>{for(var a of o(t))if(U.has(t,a)){var l=b.node(t,a),[c,u]=l;te.isElement(c)&&c.children.length===0&&t.normalizeNode(l)}for(var d=42*o(t).length,f=0;o(t).length!==0;){if(f>d)throw new Error(`
|
|
4
|
+
Could not completely normalize the editor after `.concat(d,` iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state.
|
|
5
|
+
`));var p=o(t).pop();if(U.has(t,p)){var h=b.node(t,p);t.normalizeNode(h)}f++}}))}},parent(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=b.path(t,n,r),i=A.parent(o);return b.node(t,i)},path(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{depth:o,edge:i}=r;if(A.isPath(n)){if(i==="start"){var[,a]=U.first(t,n);n=a}else if(i==="end"){var[,l]=U.last(t,n);n=l}}return j.isRange(n)&&(n=i==="start"?j.start(n):i==="end"?j.end(n):A.common(n.anchor.path,n.focus.path)),ye.isPoint(n)&&(n=n.path),o!=null&&(n=n.slice(0,o)),n},hasPath:(t,n)=>U.has(t,n),pathRef(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:o="forward"}=r,i={current:n,affinity:o,unref(){var{current:a}=i;return b.pathRefs(t).delete(i),i.current=null,a}};return b.pathRefs(t).add(i),i},pathRefs(t){var n=ra.get(t);return n||(n=new Set,ra.set(t,n)),n},point(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:o="start"}=r;if(A.isPath(n)){var i;if(o==="end"){var[,a]=U.last(t,n);i=a}else{var[,l]=U.first(t,n);i=l}var c=U.get(t,i);if(!K.isText(c))throw new Error("Cannot get the ".concat(o," point in the node at path [").concat(n,"] because it has no ").concat(o," text node."));return{path:i,offset:o==="end"?c.text.length:0}}if(j.isRange(n)){var[u,d]=j.edges(n);return o==="start"?u:d}return n},pointRef(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:o="forward"}=r,i={current:n,affinity:o,unref(){var{current:a}=i;return b.pointRefs(t).delete(i),i.current=null,a}};return b.pointRefs(t).add(i),i},pointRefs(t){var n=oa.get(t);return n||(n=new Set,oa.set(t,n)),n},*positions(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{at:r=t.selection,unit:o="offset",reverse:i=!1,voids:a=!1}=n;if(r){var l=b.range(t,r),[c,u]=j.edges(l),d=i?u:c,f=!1,p="",h=0,m=0,g=0;for(var[y,v]of b.nodes(t,{at:r,reverse:i,voids:a})){if(te.isElement(y)){if(!a&&t.isVoid(y)){yield b.start(t,v);continue}if(t.isInline(y))continue;if(b.hasInlines(t,y)){var D=A.isAncestor(v,u.path)?u:b.end(t,v),w=A.isAncestor(v,c.path)?c:b.start(t,v);p=b.string(t,{anchor:w,focus:D},{voids:a}),f=!0}}if(K.isText(y)){var C=A.equals(v,d.path);for(C?(m=i?d.offset:y.text.length-d.offset,g=d.offset):(m=y.text.length,g=i?m:0),(C||f||o==="offset")&&(yield{path:v,offset:g},f=!1);;){if(h===0){if(p==="")break;h=B(p,o,i),p=Wo(p,h,i)[1]}if(g=i?g-h:g+h,(m-=h)<0){h=-m;break}h=0,yield{path:v,offset:g}}}}}function B(k,_,x){return _==="character"?Uo(k,x):_==="word"?(function(N){for(var T=arguments.length>1&&arguments[1]!==void 0&&arguments[1],M=0,R=!1;N.length>0;){var z=Uo(N,T),[W,Q]=Wo(N,z,T);if(Z0(W,Q,T))R=!0,M+=z;else{if(R)break;M+=z}N=Q}return M})(k,x):_==="line"||_==="block"?k.length:1}},previous(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:o=!1}=n,{match:i,at:a=t.selection}=n;if(a){var l=b.before(t,a,{voids:o});if(l){var[,c]=b.first(t,[]),u=[l.path,c];if(A.isPath(a)&&a.length===0)throw new Error("Cannot get the previous node from the root node!");if(i==null)if(A.isPath(a)){var[d]=b.parent(t,a);i=p=>d.children.includes(p)}else i=()=>!0;var[f]=b.nodes(t,{reverse:!0,at:u,match:i,mode:r,voids:o});return f}}},range:(t,n,r)=>j.isRange(n)&&!r?n:{anchor:b.start(t,n),focus:b.end(t,r||n)},rangeRef(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:o="forward"}=r,i={current:n,affinity:o,unref(){var{current:a}=i;return b.rangeRefs(t).delete(i),i.current=null,a}};return b.rangeRefs(t).add(i),i},rangeRefs(t){var n=ia.get(t);return n||(n=new Set,ia.set(t,n)),n},removeMark(t,n){t.removeMark(n)},setNormalizing(t,n){na.set(t,n)},start:(t,n)=>b.point(t,n,{edge:"start"}),string(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:o=!1}=r,i=b.range(t,n),[a,l]=j.edges(i),c="";for(var[u,d]of b.nodes(t,{at:i,match:K.isText,voids:o})){var f=u.text;A.equals(d,l.path)&&(f=f.slice(0,l.offset)),A.equals(d,a.path)&&(f=f.slice(a.offset)),c+=f}return c},unhangRange(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:o=!1}=r,[i,a]=j.edges(n);if(i.offset!==0||a.offset!==0||j.isCollapsed(n))return n;var l=b.above(t,{at:a,match:h=>b.isBlock(t,h)}),c=l?l[1]:[],u={anchor:b.start(t,[]),focus:a},d=!0;for(var[f,p]of b.nodes(t,{at:u,match:K.isText,reverse:!0,voids:o}))if(d)d=!1;else if(f.text!==""||A.isBefore(p,c)){a={path:p,offset:f.text.length};break}return{anchor:i,focus:a}},void(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return b.above(t,hn(hn({},n),{},{match:r=>b.isVoid(t,r)}))},withoutNormalizing(t,n){var r=b.isNormalizing(t);b.setNormalizing(t,!1);try{n()}finally{b.setNormalizing(t,r)}b.normalize(t)}},C1={isSpan:t=>Array.isArray(t)&&t.length===2&&t.every(A.isPath)},v1=["children"],D1=["text"],ua=new WeakMap,U={ancestor(t,n){var r=U.get(t,n);if(K.isText(r))throw new Error("Cannot get the ancestor node at path [".concat(n,"] because it refers to a text node instead: ").concat(r));return r},*ancestors(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};for(var o of A.ancestors(n,r)){var i=[U.ancestor(t,o),o];yield i}},child(t,n){if(K.isText(t))throw new Error("Cannot get the child of a text node: ".concat(JSON.stringify(t)));var r=t.children[n];if(r==null)throw new Error("Cannot get child at index `".concat(n,"` in node: ").concat(JSON.stringify(t)));return r},*children(t,n){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{reverse:o=!1}=r,i=U.ancestor(t,n),{children:a}=i,l=o?a.length-1:0;o?l>=0:l<a.length;){var c=U.child(i,l),u=n.concat(l);yield[c,u],l=o?l-1:l+1}},common(t,n,r){var o=A.common(n,r);return[U.get(t,o),o]},descendant(t,n){var r=U.get(t,n);if(b.isEditor(r))throw new Error("Cannot get the descendant node at path [".concat(n,"] because it refers to the root editor node instead: ").concat(r));return r},*descendants(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var[r,o]of U.nodes(t,n))o.length!==0&&(yield[r,o])},*elements(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var[r,o]of U.nodes(t,n))te.isElement(r)&&(yield[r,o])},extractProps:t=>te.isAncestor(t)?Mt(t,v1):Mt(t,D1),first(t,n){for(var r=n.slice(),o=U.get(t,r);o&&!K.isText(o)&&o.children.length!==0;)o=o.children[0],r.push(0);return[o,r]},fragment(t,n){if(K.isText(t))throw new Error("Cannot get a fragment starting from a root text node: ".concat(JSON.stringify(t)));var r=hr({children:t.children},(o=>{var[i,a]=j.edges(n),l=U.nodes(o,{reverse:!0,pass:h=>{var[,m]=h;return!j.includes(n,m)}});for(var[,c]of l){if(!j.includes(n,c)){var u=U.parent(o,c),d=c[c.length-1];u.children.splice(d,1)}if(A.equals(c,a.path)){var f=U.leaf(o,c);f.text=f.text.slice(0,a.offset)}if(A.equals(c,i.path)){var p=U.leaf(o,c);p.text=p.text.slice(i.offset)}}b.isEditor(o)&&(o.selection=null)}));return r.children},get(t,n){for(var r=t,o=0;o<n.length;o++){var i=n[o];if(K.isText(r)||!r.children[i])throw new Error("Cannot find a descendant at path [".concat(n,"] in node: ").concat(JSON.stringify(t)));r=r.children[i]}return r},has(t,n){for(var r=t,o=0;o<n.length;o++){var i=n[o];if(K.isText(r)||!r.children[i])return!1;r=r.children[i]}return!0},isNode:t=>K.isText(t)||te.isElement(t)||b.isEditor(t),isNodeList(t){if(!Array.isArray(t))return!1;var n=ua.get(t);if(n!==void 0)return n;var r=t.every((o=>U.isNode(o)));return ua.set(t,r),r},last(t,n){for(var r=n.slice(),o=U.get(t,r);o&&!K.isText(o)&&o.children.length!==0;){var i=o.children.length-1;o=o.children[i],r.push(i)}return[o,r]},leaf(t,n){var r=U.get(t,n);if(!K.isText(r))throw new Error("Cannot get the leaf node at path [".concat(n,"] because it refers to a non-leaf node: ").concat(r));return r},*levels(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};for(var o of A.levels(n,r)){var i=U.get(t,o);yield[i,o]}},matches:(t,n)=>te.isElement(t)&&te.isElementProps(n)&&te.matches(t,n)||K.isText(t)&&K.isTextProps(n)&&K.matches(t,n),*nodes(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{pass:r,reverse:o=!1}=n,{from:i=[],to:a}=n,l=new Set,c=[],u=t;!a||!(o?A.isBefore(c,a):A.isAfter(c,a));)if(l.has(u)||(yield[u,c]),l.has(u)||K.isText(u)||u.children.length===0||r!=null&&r([u,c])!==!1){if(c.length===0)break;if(!o){var d=A.next(c);if(U.has(t,d)){c=d,u=U.get(t,c);continue}}o&&c[c.length-1]!==0?(c=A.previous(c),u=U.get(t,c)):(c=A.parent(c),u=U.get(t,c),l.add(u))}else{l.add(u);var f=o?u.children.length-1:0;A.isAncestor(c,i)&&(f=i[c.length]),c=c.concat(f),u=U.get(t,c)}},parent(t,n){var r=A.parent(n),o=U.get(t,r);if(K.isText(o))throw new Error("Cannot get the parent of path [".concat(n,"] because it does not exist in the root."));return o},string:t=>K.isText(t)?t.text:t.children.map(U.string).join(""),*texts(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var[r,o]of U.nodes(t,n))K.isText(r)&&(yield[r,o])}};function da(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),r.push.apply(r,o)}return r}function qe(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?da(Object(r),!0).forEach((function(o){Ot(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):da(Object(r)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))}))}return t}var Wt={isNodeOperation:t=>Wt.isOperation(t)&&t.type.endsWith("_node"),isOperation(t){if(!Qe(t))return!1;switch(t.type){case"insert_node":case"remove_node":return A.isPath(t.path)&&U.isNode(t.node);case"insert_text":case"remove_text":return typeof t.offset=="number"&&typeof t.text=="string"&&A.isPath(t.path);case"merge_node":return typeof t.position=="number"&&A.isPath(t.path)&&Qe(t.properties);case"move_node":return A.isPath(t.path)&&A.isPath(t.newPath);case"set_node":return A.isPath(t.path)&&Qe(t.properties)&&Qe(t.newProperties);case"set_selection":return t.properties===null&&j.isRange(t.newProperties)||t.newProperties===null&&j.isRange(t.properties)||Qe(t.properties)&&Qe(t.newProperties);case"split_node":return A.isPath(t.path)&&typeof t.position=="number"&&Qe(t.properties);default:return!1}},isOperationList:t=>Array.isArray(t)&&t.every((n=>Wt.isOperation(n))),isSelectionOperation:t=>Wt.isOperation(t)&&t.type.endsWith("_selection"),isTextOperation:t=>Wt.isOperation(t)&&t.type.endsWith("_text"),inverse(t){switch(t.type){case"insert_node":return qe(qe({},t),{},{type:"remove_node"});case"insert_text":return qe(qe({},t),{},{type:"remove_text"});case"merge_node":return qe(qe({},t),{},{type:"split_node",path:A.previous(t.path)});case"move_node":var{newPath:n,path:r}=t;if(A.equals(n,r))return t;if(A.isSibling(r,n))return qe(qe({},t),{},{path:n,newPath:r});var o=A.transform(r,t),i=A.transform(A.next(r),t);return qe(qe({},t),{},{path:o,newPath:i});case"remove_node":return qe(qe({},t),{},{type:"insert_node"});case"remove_text":return qe(qe({},t),{},{type:"insert_text"});case"set_node":var{properties:a,newProperties:l}=t;return qe(qe({},t),{},{properties:l,newProperties:a});case"set_selection":var{properties:c,newProperties:u}=t;return qe(qe({},t),{},c==null?{properties:u,newProperties:null}:u==null?{properties:null,newProperties:c}:{properties:u,newProperties:c});case"split_node":return qe(qe({},t),{},{type:"merge_node",path:A.next(t.path)})}}},A={ancestors(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=n,o=A.levels(t,n);return o=r?o.slice(1):o.slice(0,-1)},common(t,n){for(var r=[],o=0;o<t.length&&o<n.length;o++){var i=t[o];if(i!==n[o])break;r.push(i)}return r},compare(t,n){for(var r=Math.min(t.length,n.length),o=0;o<r;o++){if(t[o]<n[o])return-1;if(t[o]>n[o])return 1}return 0},endsAfter(t,n){var r=t.length-1,o=t.slice(0,r),i=n.slice(0,r),a=t[r],l=n[r];return A.equals(o,i)&&a>l},endsAt(t,n){var r=t.length,o=t.slice(0,r),i=n.slice(0,r);return A.equals(o,i)},endsBefore(t,n){var r=t.length-1,o=t.slice(0,r),i=n.slice(0,r),a=t[r],l=n[r];return A.equals(o,i)&&a<l},equals:(t,n)=>t.length===n.length&&t.every(((r,o)=>r===n[o])),hasPrevious:t=>t[t.length-1]>0,isAfter:(t,n)=>A.compare(t,n)===1,isAncestor:(t,n)=>t.length<n.length&&A.compare(t,n)===0,isBefore:(t,n)=>A.compare(t,n)===-1,isChild:(t,n)=>t.length===n.length+1&&A.compare(t,n)===0,isCommon:(t,n)=>t.length<=n.length&&A.compare(t,n)===0,isDescendant:(t,n)=>t.length>n.length&&A.compare(t,n)===0,isParent:(t,n)=>t.length+1===n.length&&A.compare(t,n)===0,isPath:t=>Array.isArray(t)&&(t.length===0||typeof t[0]=="number"),isSibling(t,n){if(t.length!==n.length)return!1;var r=t.slice(0,-1),o=n.slice(0,-1);return t[t.length-1]!==n[n.length-1]&&A.equals(r,o)},levels(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=n,o=[],i=0;i<=t.length;i++)o.push(t.slice(0,i));return r&&o.reverse(),o},next(t){if(t.length===0)throw new Error("Cannot get the next path of a root path [".concat(t,"], because it has no next index."));var n=t[t.length-1];return t.slice(0,-1).concat(n+1)},parent(t){if(t.length===0)throw new Error("Cannot get the parent path of the root path [".concat(t,"]."));return t.slice(0,-1)},previous(t){if(t.length===0)throw new Error("Cannot get the previous path of a root path [".concat(t,"], because it has no previous index."));var n=t[t.length-1];if(n<=0)throw new Error("Cannot get the previous path of a first child path [".concat(t,"] because it would result in a negative index."));return t.slice(0,-1).concat(n-1)},relative(t,n){if(!A.isAncestor(n,t)&&!A.equals(t,n))throw new Error("Cannot get the relative path of [".concat(t,"] inside ancestor [").concat(n,"], because it is not above or equal to the path."));return t.slice(n.length)},transform(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return hr(t,(o=>{var{affinity:i="forward"}=r;if(t&&t?.length!==0){if(o===null)return null;switch(n.type){case"insert_node":var{path:a}=n;(A.equals(a,o)||A.endsBefore(a,o)||A.isAncestor(a,o))&&(o[a.length-1]+=1);break;case"remove_node":var{path:l}=n;if(A.equals(l,o)||A.isAncestor(l,o))return null;A.endsBefore(l,o)&&(o[l.length-1]-=1);break;case"merge_node":var{path:c,position:u}=n;A.equals(c,o)||A.endsBefore(c,o)?o[c.length-1]-=1:A.isAncestor(c,o)&&(o[c.length-1]-=1,o[c.length]+=u);break;case"split_node":var{path:d,position:f}=n;if(A.equals(d,o)){if(i==="forward")o[o.length-1]+=1;else if(i!=="backward")return null}else A.endsBefore(d,o)?o[d.length-1]+=1:A.isAncestor(d,o)&&t[d.length]>=f&&(o[d.length-1]+=1,o[d.length]-=f);break;case"move_node":var{path:p,newPath:h}=n;if(A.equals(p,h))return;if(A.isAncestor(p,o)||A.equals(p,o)){var m=h.slice();return A.endsBefore(p,h)&&p.length<h.length&&(m[p.length-1]-=1),m.concat(o.slice(p.length))}A.isSibling(p,h)&&(A.isAncestor(h,o)||A.equals(h,o))?A.endsBefore(p,o)?o[p.length-1]-=1:o[p.length-1]+=1:A.endsBefore(h,o)||A.equals(h,o)||A.isAncestor(h,o)?(A.endsBefore(p,o)&&(o[p.length-1]-=1),o[h.length-1]+=1):A.endsBefore(p,o)&&(A.equals(h,o)&&(o[h.length-1]+=1),o[p.length-1]-=1)}}}))}},w1={transform(t,n){var{current:r,affinity:o}=t;if(r!=null){var i=A.transform(r,n,{affinity:o});t.current=i,i==null&&t.unref()}}};function fa(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),r.push.apply(r,o)}return r}function pa(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?fa(Object(r),!0).forEach((function(o){Ot(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fa(Object(r)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))}))}return t}var ye={compare(t,n){var r=A.compare(t.path,n.path);return r===0?t.offset<n.offset?-1:t.offset>n.offset?1:0:r},isAfter:(t,n)=>ye.compare(t,n)===1,isBefore:(t,n)=>ye.compare(t,n)===-1,equals:(t,n)=>t.offset===n.offset&&A.equals(t.path,n.path),isPoint:t=>Qe(t)&&typeof t.offset=="number"&&A.isPath(t.path),transform(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return hr(t,(o=>{if(o===null)return null;var{affinity:i="forward"}=r,{path:a,offset:l}=o;switch(n.type){case"insert_node":case"move_node":o.path=A.transform(a,n,r);break;case"insert_text":A.equals(n.path,a)&&n.offset<=l&&(o.offset+=n.text.length);break;case"merge_node":A.equals(n.path,a)&&(o.offset+=n.position),o.path=A.transform(a,n,r);break;case"remove_text":A.equals(n.path,a)&&n.offset<=l&&(o.offset-=Math.min(l-n.offset,n.text.length));break;case"remove_node":if(A.equals(n.path,a)||A.isAncestor(n.path,a))return null;o.path=A.transform(a,n,r);break;case"split_node":if(A.equals(n.path,a)){if(n.position===l&&i==null)return null;(n.position<l||n.position===l&&i==="forward")&&(o.offset-=n.position,o.path=A.transform(a,n,pa(pa({},r),{},{affinity:"forward"})))}else o.path=A.transform(a,n,r)}}))}},B1={transform(t,n){var{current:r,affinity:o}=t;if(r!=null){var i=ye.transform(r,n,{affinity:o});t.current=i,i==null&&t.unref()}}},x1=["anchor","focus"];function ha(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),r.push.apply(r,o)}return r}var j={edges(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=n,{anchor:o,focus:i}=t;return j.isBackward(t)===r?[o,i]:[i,o]},end(t){var[,n]=j.edges(t);return n},equals:(t,n)=>ye.equals(t.anchor,n.anchor)&&ye.equals(t.focus,n.focus),includes(t,n){if(j.isRange(n)){if(j.includes(t,n.anchor)||j.includes(t,n.focus))return!0;var[r,o]=j.edges(t),[i,a]=j.edges(n);return ye.isBefore(r,i)&&ye.isAfter(o,a)}var[l,c]=j.edges(t),u=!1,d=!1;return ye.isPoint(n)?(u=ye.compare(n,l)>=0,d=ye.compare(n,c)<=0):(u=A.compare(n,l.path)>=0,d=A.compare(n,c.path)<=0),u&&d},intersection(t,n){var r=Mt(t,x1),[o,i]=j.edges(t),[a,l]=j.edges(n),c=ye.isBefore(o,a)?a:o,u=ye.isBefore(i,l)?i:l;return ye.isBefore(u,c)?null:(function(d){for(var f=1;f<arguments.length;f++){var p=arguments[f]!=null?arguments[f]:{};f%2?ha(Object(p),!0).forEach((function(h){Ot(d,h,p[h])})):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(p)):ha(Object(p)).forEach((function(h){Object.defineProperty(d,h,Object.getOwnPropertyDescriptor(p,h))}))}return d})({anchor:c,focus:u},r)},isBackward(t){var{anchor:n,focus:r}=t;return ye.isAfter(n,r)},isCollapsed(t){var{anchor:n,focus:r}=t;return ye.equals(n,r)},isExpanded:t=>!j.isCollapsed(t),isForward:t=>!j.isBackward(t),isRange:t=>Qe(t)&&ye.isPoint(t.anchor)&&ye.isPoint(t.focus),*points(t){yield[t.anchor,"anchor"],yield[t.focus,"focus"]},start(t){var[n]=j.edges(t);return n},transform(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return hr(t,(o=>{if(o===null)return null;var i,a,{affinity:l="inward"}=r;if(l==="inward"){var c=j.isCollapsed(o);j.isForward(o)?(i="forward",a=c?i:"backward"):(i="backward",a=c?i:"forward")}else l==="outward"?j.isForward(o)?(i="backward",a="forward"):(i="forward",a="backward"):(i=l,a=l);var u=ye.transform(o.anchor,n,{affinity:i}),d=ye.transform(o.focus,n,{affinity:a});if(!u||!d)return null;o.anchor=u,o.focus=d}))}},k1={transform(t,n){var{current:r,affinity:o}=t;if(r!=null){var i=j.transform(r,n,{affinity:o});t.current=i,i==null&&t.unref()}}},ma=(t,n)=>{for(var r in t){var o=t[r],i=n[r];if(Qe(o)&&Qe(i)){if(!ma(o,i))return!1}else if(Array.isArray(o)&&Array.isArray(i)){if(o.length!==i.length)return!1;for(var a=0;a<o.length;a++)if(o[a]!==i[a])return!1}else if(o!==i)return!1}for(var l in n)if(t[l]===void 0&&n[l]!==void 0)return!1;return!0},E1=["text"],_1=["anchor","focus"];function ga(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),r.push.apply(r,o)}return r}function zt(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?ga(Object(r),!0).forEach((function(o){Ot(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ga(Object(r)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))}))}return t}var K={equals(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{loose:o=!1}=r;function i(a){return Mt(a,E1)}return ma(o?i(t):t,o?i(n):n)},isText:t=>Qe(t)&&typeof t.text=="string",isTextList:t=>Array.isArray(t)&&t.every((n=>K.isText(n))),isTextProps:t=>t.text!==void 0,matches(t,n){for(var r in n)if(r!=="text"&&(!t.hasOwnProperty(r)||t[r]!==n[r]))return!1;return!0},decorations(t,n){var r=[zt({},t)];for(var o of n){var i=Mt(o,_1),[a,l]=j.edges(o),c=[],u=0;for(var d of r){var{length:f}=d.text,p=u;if(u+=f,a.offset<=p&&l.offset>=u)Object.assign(d,i),c.push(d);else if(a.offset!==l.offset&&(a.offset===u||l.offset===p)||a.offset>u||l.offset<p||l.offset===p&&p!==0)c.push(d);else{var h=d,m=void 0,g=void 0;if(l.offset<u){var y=l.offset-p;g=zt(zt({},h),{},{text:h.text.slice(y)}),h=zt(zt({},h),{},{text:h.text.slice(0,y)})}if(a.offset>p){var v=a.offset-p;m=zt(zt({},h),{},{text:h.text.slice(0,v)}),h=zt(zt({},h),{},{text:h.text.slice(v)})}Object.assign(h,i),m&&c.push(m),c.push(h),g&&c.push(g)}}r=c}return r}};function ya(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),r.push.apply(r,o)}return r}function Mn(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?ya(Object(r),!0).forEach((function(o){Ot(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ya(Object(r)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))}))}return t}var A1={transform(t,n){t.children=ea(t.children);var r=t.selection&&ea(t.selection);try{r=((o,i,a)=>{switch(a.type){case"insert_node":var{path:l,node:c}=a,u=U.parent(o,l),d=l[l.length-1];if(d>u.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(l,"] because the destination is past the end of the node."));if(u.children.splice(d,0,c),i)for(var[f,p]of j.points(i))i[p]=ye.transform(f,a);break;case"insert_text":var{path:h,offset:m,text:g}=a;if(g.length===0)break;var y=U.leaf(o,h),v=y.text.slice(0,m),D=y.text.slice(m);if(y.text=v+g+D,i)for(var[w,C]of j.points(i))i[C]=ye.transform(w,a);break;case"merge_node":var{path:B}=a,k=U.get(o,B),_=A.previous(B),x=U.get(o,_),N=U.parent(o,B),T=B[B.length-1];if(K.isText(k)&&K.isText(x))x.text+=k.text;else{if(K.isText(k)||K.isText(x))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(B,"] to nodes of different interfaces: ").concat(k," ").concat(x));x.children.push(...k.children)}if(N.children.splice(T,1),i)for(var[M,R]of j.points(i))i[R]=ye.transform(M,a);break;case"move_node":var{path:z,newPath:W}=a;if(A.isAncestor(z,W))throw new Error("Cannot move a path [".concat(z,"] to new path [").concat(W,"] because the destination is inside itself."));var Q=U.get(o,z),q=U.parent(o,z),J=z[z.length-1];q.children.splice(J,1);var X=A.transform(z,a),ie=U.get(o,A.parent(X)),re=X[X.length-1];if(ie.children.splice(re,0,Q),i)for(var[ne,se]of j.points(i))i[se]=ye.transform(ne,a);break;case"remove_node":var{path:G}=a,Le=G[G.length-1];if(U.parent(o,G).children.splice(Le,1),i)for(var[ke,Me]of j.points(i)){var Pe=ye.transform(ke,a);if(i!=null&&Pe!=null)i[Me]=Pe;else{var Ve=void 0,Ce=void 0;for(var[xe,Ue]of U.texts(o)){if(A.compare(Ue,G)!==-1){Ce=[xe,Ue];break}Ve=[xe,Ue]}var lt=!1;Ve&&Ce&&(lt=A.equals(Ce[1],G)?!A.hasPrevious(Ce[1]):A.common(Ve[1],G).length<A.common(Ce[1],G).length),Ve&&!lt?(ke.path=Ve[1],ke.offset=Ve[0].text.length):Ce?(ke.path=Ce[1],ke.offset=0):i=null}}break;case"remove_text":var{path:et,offset:ze,text:tt}=a;if(tt.length===0)break;var nt=U.leaf(o,et),We=nt.text.slice(0,ze),$e=nt.text.slice(ze+tt.length);if(nt.text=We+$e,i)for(var[mt,Et]of j.points(i))i[Et]=ye.transform(mt,a);break;case"set_node":var{path:gt,properties:Bt,newProperties:pe}=a;if(gt.length===0)throw new Error("Cannot set properties on the root node!");var le=U.get(o,gt);for(var ge in pe){if(ge==="children"||ge==="text")throw new Error('Cannot set the "'.concat(ge,'" property of nodes!'));var Ae=pe[ge];Ae==null?delete le[ge]:le[ge]=Ae}for(var yt in Bt)pe.hasOwnProperty(yt)||delete le[yt];break;case"set_selection":var{newProperties:Ee}=a;if(Ee==null)i=Ee;else{if(i==null){if(!j.isRange(Ee))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(JSON.stringify(Ee)," when there is no current selection."));i=Mn({},Ee)}for(var Oe in Ee){var Xe=Ee[Oe];if(Xe==null){if(Oe==="anchor"||Oe==="focus")throw new Error('Cannot remove the "'.concat(Oe,'" selection property'));delete i[Oe]}else i[Oe]=Xe}}break;case"split_node":var{path:Te,position:E,properties:P}=a;if(Te.length===0)throw new Error('Cannot apply a "split_node" operation at path ['.concat(Te,"] because the root node cannot be split."));var Y,I=U.get(o,Te),he=U.parent(o,Te),Ie=Te[Te.length-1];if(K.isText(I)){var rt=I.text.slice(0,E),H=I.text.slice(E);I.text=rt,Y=Mn(Mn({},P),{},{text:H})}else{var ee=I.children.slice(0,E),ce=I.children.slice(E);I.children=ee,Y=Mn(Mn({},P),{},{children:ce})}if(he.children.splice(Ie+1,0,Y),i)for(var[be,Ne]of j.points(i))i[Ne]=ye.transform(be,a)}return i})(t,r,n)}finally{t.children=ta(t.children),t.selection=r?Zt(r)?ta(r):r:null}}},N1=["text"],S1=["children"];function ba(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),r.push.apply(r,o)}return r}function Ca(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?ba(Object(r),!0).forEach((function(o){Ot(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ba(Object(r)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))}))}return t}var F1={insertNodes(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};b.withoutNormalizing(t,(()=>{var{hanging:o=!1,voids:i=!1,mode:a="lowest"}=r,{at:l,match:c,select:u}=r;if(U.isNode(n)&&(n=[n]),n.length!==0){var[d]=n;if(l||(l=t.selection?t.selection:t.children.length>0?b.end(t,[]):[0],u=!0),u==null&&(u=!1),j.isRange(l))if(o||(l=b.unhangRange(t,l)),j.isCollapsed(l))l=l.anchor;else{var[,f]=j.edges(l),p=b.pointRef(t,f);O.delete(t,{at:l}),l=p.unref()}if(ye.isPoint(l)){c==null&&(c=K.isText(d)?_=>K.isText(_):t.isInline(d)?_=>K.isText(_)||b.isInline(t,_):_=>b.isBlock(t,_));var[h]=b.nodes(t,{at:l.path,match:c,mode:a,voids:i});if(!h)return;var[,m]=h,g=b.pathRef(t,m),y=b.isEnd(t,l,m);O.splitNodes(t,{at:l,match:c,mode:a,voids:i});var v=g.unref();l=y?A.next(v):v}var D=A.parent(l),w=l[l.length-1];if(i||!b.void(t,{at:D})){for(var C of n){var B=D.concat(w);w++,t.apply({type:"insert_node",path:B,node:C}),l=A.next(l)}if(l=A.previous(l),u){var k=b.end(t,l);k&&O.select(t,k)}}}}))},liftNodes(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b.withoutNormalizing(t,(()=>{var{at:r=t.selection,mode:o="lowest",voids:i=!1}=n,{match:a}=n;if(a==null&&(a=A.isPath(r)?mn(t,r):C=>b.isBlock(t,C)),r){var l=b.nodes(t,{at:r,match:a,mode:o,voids:i}),c=Array.from(l,(C=>{var[,B]=C;return b.pathRef(t,B)}));for(var u of c){var d=u.unref();if(d.length<2)throw new Error("Cannot lift node at a path [".concat(d,"] because it has a depth of less than `2`."));var f=b.node(t,A.parent(d)),[p,h]=f,m=d[d.length-1],{length:g}=p.children;if(g===1){var y=A.next(h);O.moveNodes(t,{at:d,to:y,voids:i}),O.removeNodes(t,{at:h,voids:i})}else if(m===0)O.moveNodes(t,{at:d,to:h,voids:i});else if(m===g-1){var v=A.next(h);O.moveNodes(t,{at:d,to:v,voids:i})}else{var D=A.next(d),w=A.next(h);O.splitNodes(t,{at:D,voids:i}),O.moveNodes(t,{at:d,to:w,voids:i})}}}}))},mergeNodes(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b.withoutNormalizing(t,(()=>{var{match:r,at:o=t.selection}=n,{hanging:i=!1,voids:a=!1,mode:l="lowest"}=n;if(o){if(r==null)if(A.isPath(o)){var[c]=b.parent(t,o);r=T=>c.children.includes(T)}else r=T=>b.isBlock(t,T);if(!i&&j.isRange(o)&&(o=b.unhangRange(t,o)),j.isRange(o))if(j.isCollapsed(o))o=o.anchor;else{var[,u]=j.edges(o),d=b.pointRef(t,u);O.delete(t,{at:o}),o=d.unref(),n.at==null&&O.select(t,o)}var[f]=b.nodes(t,{at:o,match:r,voids:a,mode:l}),p=b.previous(t,{at:o,match:r,voids:a,mode:l});if(f&&p){var[h,m]=f,[g,y]=p;if(m.length!==0&&y.length!==0){var v,D,w=A.next(y),C=A.common(m,y),B=A.isSibling(m,y),k=Array.from(b.levels(t,{at:m}),(T=>{var[M]=T;return M})).slice(C.length).slice(0,-1),_=b.above(t,{at:m,mode:"highest",match:T=>k.includes(T)&&va(t,T)}),x=_&&b.pathRef(t,_[1]);if(K.isText(h)&&K.isText(g)){var N=Mt(h,N1);D=g.text.length,v=N}else{if(!te.isElement(h)||!te.isElement(g))throw new Error("Cannot merge the node at path [".concat(m,"] with the previous sibling because it is not the same kind: ").concat(JSON.stringify(h)," ").concat(JSON.stringify(g)));N=Mt(h,S1),D=g.children.length,v=N}B||O.moveNodes(t,{at:m,to:w,voids:a}),x&&O.removeNodes(t,{at:x.current,voids:a}),te.isElement(g)&&b.isEmpty(t,g)||K.isText(g)&&g.text===""&&y[y.length-1]!==0?O.removeNodes(t,{at:y,voids:a}):t.apply({type:"merge_node",path:w,position:D,properties:v}),x&&x.unref()}}}}))},moveNodes(t,n){b.withoutNormalizing(t,(()=>{var{to:r,at:o=t.selection,mode:i="lowest",voids:a=!1}=n,{match:l}=n;if(o){l==null&&(l=A.isPath(o)?mn(t,o):m=>b.isBlock(t,m));var c=b.pathRef(t,r),u=b.nodes(t,{at:o,match:l,mode:i,voids:a}),d=Array.from(u,(m=>{var[,g]=m;return b.pathRef(t,g)}));for(var f of d){var p=f.unref(),h=c.current;p.length!==0&&t.apply({type:"move_node",path:p,newPath:h}),c.current&&A.isSibling(h,p)&&A.isAfter(h,p)&&(c.current=A.next(c.current))}c.unref()}}))},removeNodes(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b.withoutNormalizing(t,(()=>{var{hanging:r=!1,voids:o=!1,mode:i="lowest"}=n,{at:a=t.selection,match:l}=n;if(a){l==null&&(l=A.isPath(a)?mn(t,a):h=>b.isBlock(t,h)),!r&&j.isRange(a)&&(a=b.unhangRange(t,a));var c=b.nodes(t,{at:a,match:l,mode:i,voids:o}),u=Array.from(c,(h=>{var[,m]=h;return b.pathRef(t,m)}));for(var d of u){var f=d.unref();if(f){var[p]=b.node(t,f);t.apply({type:"remove_node",path:f,node:p})}}}}))},setNodes(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};b.withoutNormalizing(t,(()=>{var{match:o,at:i=t.selection}=r,{hanging:a=!1,mode:l="lowest",split:c=!1,voids:u=!1}=r;if(i){if(o==null&&(o=A.isPath(i)?mn(t,i):k=>b.isBlock(t,k)),!a&&j.isRange(i)&&(i=b.unhangRange(t,i)),c&&j.isRange(i)){if(j.isCollapsed(i)&&b.leaf(t,i.anchor)[0].text.length>0)return;var d=b.rangeRef(t,i,{affinity:"inward"}),[f,p]=j.edges(i),h=l==="lowest"?"lowest":"highest",m=b.isEnd(t,p,p.path);O.splitNodes(t,{at:p,match:o,mode:h,voids:u,always:!m});var g=b.isStart(t,f,f.path);O.splitNodes(t,{at:f,match:o,mode:h,voids:u,always:!g}),i=d.unref(),r.at==null&&O.select(t,i)}for(var[y,v]of b.nodes(t,{at:i,match:o,mode:l,voids:u})){var D={},w={};if(v.length!==0){var C=!1;for(var B in n)B!=="children"&&B!=="text"&&n[B]!==y[B]&&(C=!0,y.hasOwnProperty(B)&&(D[B]=y[B]),n[B]!=null&&(w[B]=n[B]));C&&t.apply({type:"set_node",path:v,properties:D,newProperties:w})}}}}))},splitNodes(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b.withoutNormalizing(t,(()=>{var{mode:r="lowest",voids:o=!1}=n,{match:i,at:a=t.selection,height:l=0,always:c=!1}=n;if(i==null&&(i=Q=>b.isBlock(t,Q)),j.isRange(a)&&(a=V1(t,a)),A.isPath(a)){var u=a,d=b.point(t,u),[f]=b.parent(t,u);i=Q=>Q===f,l=d.path.length-u.length+1,a=d,c=!0}if(a){var p=b.pointRef(t,a,{affinity:"backward"}),[h]=b.nodes(t,{at:a,match:i,mode:r,voids:o});if(h){var m=b.void(t,{at:a,mode:"highest"});if(!o&&m){var[g,y]=m;if(te.isElement(g)&&t.isInline(g)){var v=b.after(t,y);if(!v){var D=A.next(y);O.insertNodes(t,{text:""},{at:D,voids:o}),v=b.point(t,D)}a=v,c=!0}l=a.path.length-y.length+1,c=!0}var w=b.pointRef(t,a),C=a.path.length-l,[,B]=h,k=a.path.slice(0,C),_=l===0?a.offset:a.path[C]+0;for(var[x,N]of b.levels(t,{at:k,reverse:!0,voids:o})){var T=!1;if(N.length<B.length||N.length===0||!o&&b.isVoid(t,x))break;var M=p.current,R=b.isEnd(t,M,N);if(c||!p||!b.isEdge(t,M,N)){T=!0;var z=U.extractProps(x);t.apply({type:"split_node",path:N,position:_,properties:z})}_=N[N.length-1]+(T||R?1:0)}if(n.at==null){var W=w.current||b.end(t,[]);O.select(t,W)}p.unref(),w.unref()}}}))},unsetNodes(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Array.isArray(n)||(n=[n]);var o={};for(var i of n)o[i]=null;O.setNodes(t,o,r)},unwrapNodes(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b.withoutNormalizing(t,(()=>{var{mode:r="lowest",split:o=!1,voids:i=!1}=n,{at:a=t.selection,match:l}=n;if(a){l==null&&(l=A.isPath(a)?mn(t,a):h=>b.isBlock(t,h)),A.isPath(a)&&(a=b.range(t,a));var c=j.isRange(a)?b.rangeRef(t,a):null,u=b.nodes(t,{at:a,match:l,mode:r,voids:i}),d=Array.from(u,(h=>{var[,m]=h;return b.pathRef(t,m)})).reverse(),f=function(h){var m=h.unref(),[g]=b.node(t,m),y=b.range(t,m);o&&c&&(y=j.intersection(c.current,y)),O.liftNodes(t,{at:y,match:v=>te.isAncestor(g)&&g.children.includes(v),voids:i})};for(var p of d)f(p);c&&c.unref()}}))},wrapNodes(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};b.withoutNormalizing(t,(()=>{var{mode:o="lowest",split:i=!1,voids:a=!1}=r,{match:l,at:c=t.selection}=r;if(c){if(l==null&&(l=A.isPath(c)?mn(t,c):t.isInline(n)?v=>b.isInline(t,v)||K.isText(v):v=>b.isBlock(t,v)),i&&j.isRange(c)){var[u,d]=j.edges(c),f=b.rangeRef(t,c,{affinity:"inward"});O.splitNodes(t,{at:d,match:l,voids:a}),O.splitNodes(t,{at:u,match:l,voids:a}),c=f.unref(),r.at==null&&O.select(t,c)}var p=Array.from(b.nodes(t,{at:c,match:t.isInline(n)?v=>b.isBlock(t,v):v=>b.isEditor(v),mode:"lowest",voids:a}));for(var[,h]of p){var m=j.isRange(c)?j.intersection(c,b.range(t,h)):c;if(m){var g=Array.from(b.nodes(t,{at:m,match:l,mode:o,voids:a}));if(g.length>0){var y=(function(){var[v]=g,D=g[g.length-1],[,w]=v,[,C]=D;if(w.length===0&&C.length===0)return"continue";var B=A.equals(w,C)?A.parent(w):A.common(w,C),k=b.range(t,w,C),_=b.node(t,B),[x]=_,N=B.length+1,T=A.next(C.slice(0,N)),M=Ca(Ca({},n),{},{children:[]});O.insertNodes(t,M,{at:T,voids:a}),O.moveNodes(t,{at:k,match:R=>te.isAncestor(x)&&x.children.includes(R),to:T.concat(0),voids:a})})();if(y==="continue")continue}}}}}))}},va=(t,n)=>{if(te.isElement(n)){var r=n;return!!b.isVoid(t,n)||r.children.length===1&&va(t,r.children[0])}return!b.isEditor(n)},V1=(t,n)=>{if(j.isCollapsed(n))return n.anchor;var[,r]=j.edges(n),o=b.pointRef(t,r);return O.delete(t,{at:n}),o.unref()},mn=(t,n)=>{var[r]=b.node(t,n);return o=>o===r};function Da(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),r.push.apply(r,o)}return r}function wa(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Da(Object(r),!0).forEach((function(o){Ot(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Da(Object(r)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))}))}return t}var O1={collapse(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{edge:r="anchor"}=n,{selection:o}=t;if(o){if(r==="anchor")O.select(t,o.anchor);else if(r==="focus")O.select(t,o.focus);else if(r==="start"){var[i]=j.edges(o);O.select(t,i)}else if(r==="end"){var[,a]=j.edges(o);O.select(t,a)}}},deselect(t){var{selection:n}=t;n&&t.apply({type:"set_selection",properties:n,newProperties:null})},move(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=t,{distance:o=1,unit:i="character",reverse:a=!1}=n,{edge:l=null}=n;if(r){l==="start"&&(l=j.isBackward(r)?"focus":"anchor"),l==="end"&&(l=j.isBackward(r)?"anchor":"focus");var{anchor:c,focus:u}=r,d={distance:o,unit:i},f={};if(l==null||l==="anchor"){var p=a?b.before(t,c,d):b.after(t,c,d);p&&(f.anchor=p)}if(l==null||l==="focus"){var h=a?b.before(t,u,d):b.after(t,u,d);h&&(f.focus=h)}O.setSelection(t,f)}},select(t,n){var{selection:r}=t;if(n=b.range(t,n),r)O.setSelection(t,n);else{if(!j.isRange(n))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(JSON.stringify(n)));t.apply({type:"set_selection",properties:r,newProperties:n})}},setPoint(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:o}=t,{edge:i="both"}=r;if(o){i==="start"&&(i=j.isBackward(o)?"focus":"anchor"),i==="end"&&(i=j.isBackward(o)?"anchor":"focus");var{anchor:a,focus:l}=o,c=i==="anchor"?a:l;O.setSelection(t,{[i==="anchor"?"anchor":"focus"]:wa(wa({},c),n)})}},setSelection(t,n){var{selection:r}=t,o={},i={};if(r){for(var a in n)(a==="anchor"&&n.anchor!=null&&!ye.equals(n.anchor,r.anchor)||a==="focus"&&n.focus!=null&&!ye.equals(n.focus,r.focus)||a!=="anchor"&&a!=="focus"&&n[a]!==r[a])&&(o[a]=r[a],i[a]=n[a]);Object.keys(o).length>0&&t.apply({type:"set_selection",properties:o,newProperties:i})}}},T1={delete(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b.withoutNormalizing(t,(()=>{var{reverse:r=!1,unit:o="character",distance:i=1,voids:a=!1}=n,{at:l=t.selection,hanging:c=!1}=n;if(l){if(j.isRange(l)&&j.isCollapsed(l)&&(l=l.anchor),ye.isPoint(l)){var u=b.void(t,{at:l,mode:"highest"});if(!a&&u){var[,d]=u;l=d}else{var f={unit:o,distance:i};l={anchor:l,focus:r?b.before(t,l,f)||b.start(t,[]):b.after(t,l,f)||b.end(t,[])},c=!0}}if(A.isPath(l))O.removeNodes(t,{at:l,voids:a});else if(!j.isCollapsed(l)){if(!c){var[,p]=j.edges(l),h=b.end(t,[]);ye.equals(p,h)||(l=b.unhangRange(t,l,{voids:a}))}var[m,g]=j.edges(l),y=b.above(t,{match:Ce=>b.isBlock(t,Ce),at:m,voids:a}),v=b.above(t,{match:Ce=>b.isBlock(t,Ce),at:g,voids:a}),D=y&&v&&!A.equals(y[1],v[1]),w=A.equals(m.path,g.path),C=a?null:b.void(t,{at:m,mode:"highest"}),B=a?null:b.void(t,{at:g,mode:"highest"});if(C){var k=b.before(t,m);k&&y&&A.isAncestor(y[1],k.path)&&(m=k)}if(B){var _=b.after(t,g);_&&v&&A.isAncestor(v[1],_.path)&&(g=_)}var x,N=[];for(var T of b.nodes(t,{at:l,voids:a})){var[M,R]=T;x&&A.compare(R,x)===0||(!a&&b.isVoid(t,M)||!A.isCommon(R,m.path)&&!A.isCommon(R,g.path))&&(N.push(T),x=R)}var z=Array.from(N,(Ce=>{var[,xe]=Ce;return b.pathRef(t,xe)})),W=b.pointRef(t,m),Q=b.pointRef(t,g);if(!w&&!C){var q=W.current,[J]=b.leaf(t,q),{path:X}=q,{offset:ie}=m,re=J.text.slice(ie);re.length>0&&t.apply({type:"remove_text",path:X,offset:ie,text:re})}for(var ne of z){var se=ne.unref();O.removeNodes(t,{at:se,voids:a})}if(!B){var G=Q.current,[Le]=b.leaf(t,G),{path:ke}=G,Me=w?m.offset:0,Pe=Le.text.slice(Me,g.offset);Pe.length>0&&t.apply({type:"remove_text",path:ke,offset:Me,text:Pe})}!w&&D&&Q.current&&W.current&&O.mergeNodes(t,{at:Q.current,hanging:!0,voids:a});var Ve=r?W.unref()||Q.unref():Q.unref()||W.unref();n.at==null&&Ve&&O.select(t,Ve)}}}))},insertFragment(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};b.withoutNormalizing(t,(()=>{var{hanging:o=!1,voids:i=!1}=r,{at:a=t.selection}=r;if(n.length&&a){if(j.isRange(a))if(o||(a=b.unhangRange(t,a)),j.isCollapsed(a))a=a.anchor;else{var[,l]=j.edges(a);if(!i&&b.void(t,{at:l}))return;var c=b.pointRef(t,l);O.delete(t,{at:a}),a=c.unref()}else A.isPath(a)&&(a=b.start(t,a));if(i||!b.void(t,{at:a})){var u=b.above(t,{at:a,match:G=>b.isInline(t,G),mode:"highest",voids:i});if(u){var[,d]=u;b.isEnd(t,a,d)?a=b.after(t,d):b.isStart(t,a,d)&&(a=b.before(t,d))}var f=b.above(t,{match:G=>b.isBlock(t,G),at:a,voids:i}),[,p]=f,h=b.isStart(t,a,p),m=b.isEnd(t,a,p),g=h&&m,y=!h||h&&m,v=!m,[,D]=U.first({children:n},[]),[,w]=U.last({children:n},[]),C=[],B=G=>{var[Le,ke]=G;return ke.length!==0&&(!!g||!(y&&A.isAncestor(ke,D)&&te.isElement(Le)&&!t.isVoid(Le)&&!t.isInline(Le))&&!(v&&A.isAncestor(ke,w)&&te.isElement(Le)&&!t.isVoid(Le)&&!t.isInline(Le)))};for(var k of U.nodes({children:n},{pass:B}))B(k)&&C.push(k);var _=[],x=[],N=[],T=!0,M=!1;for(var[R]of C)te.isElement(R)&&!t.isInline(R)?(T=!1,M=!0,x.push(R)):T?_.push(R):N.push(R);var[z]=b.nodes(t,{at:a,match:G=>K.isText(G)||b.isInline(t,G),mode:"highest",voids:i}),[,W]=z,Q=b.isStart(t,a,W),q=b.isEnd(t,a,W),J=b.pathRef(t,m?A.next(p):p),X=b.pathRef(t,q?A.next(W):W),ie=b.pathRef(t,p);O.splitNodes(t,{at:a,match:G=>M?b.isBlock(t,G):K.isText(G)||b.isInline(t,G),mode:M?"lowest":"highest",voids:i});var re=b.pathRef(t,!Q||Q&&q?A.next(W):W);if(O.insertNodes(t,_,{at:re.current,match:G=>K.isText(G)||b.isInline(t,G),mode:"highest",voids:i}),g&&x.length&&O.delete(t,{at:ie.unref(),voids:i}),O.insertNodes(t,x,{at:J.current,match:G=>b.isBlock(t,G),mode:"lowest",voids:i}),O.insertNodes(t,N,{at:X.current,match:G=>K.isText(G)||b.isInline(t,G),mode:"highest",voids:i}),!r.at){var ne;ne=N.length>0?A.previous(X.current):x.length>0?A.previous(J.current):A.previous(re.current);var se=b.end(t,ne);O.select(t,se)}re.unref(),J.unref(),X.unref()}}}))},insertText(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};b.withoutNormalizing(t,(()=>{var{voids:o=!1}=r,{at:i=t.selection}=r;if(i){if(A.isPath(i)&&(i=b.range(t,i)),j.isRange(i))if(j.isCollapsed(i))i=i.anchor;else{var a=j.end(i);if(!o&&b.void(t,{at:a}))return;var l=b.pointRef(t,a);O.delete(t,{at:i,voids:o}),i=l.unref(),O.setSelection(t,{anchor:i,focus:i})}if(o||!b.void(t,{at:i})){var{path:c,offset:u}=i;n.length>0&&t.apply({type:"insert_text",path:c,offset:u,text:n})}}}))}};function Ba(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),r.push.apply(r,o)}return r}function yr(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Ba(Object(r),!0).forEach((function(o){Ot(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ba(Object(r)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))}))}return t}var O=yr(yr(yr(yr({},A1),F1),O1),T1),j1={isHistory:t=>Qe(t)&&Array.isArray(t.redos)&&Array.isArray(t.undos)&&(t.redos.length===0||Wt.isOperationList(t.redos[0].operations))&&(t.undos.length===0||Wt.isOperationList(t.undos[0].operations))},qo=new WeakMap,zn=new WeakMap,en={isHistoryEditor:t=>j1.isHistory(t.history)&&b.isEditor(t),isMerging:t=>zn.get(t),isSaving:t=>qo.get(t),redo(t){t.redo()},undo(t){t.undo()},withMerging(t,n){var r=en.isMerging(t);zn.set(t,!0),n(),zn.set(t,r)},withoutMerging(t,n){var r=en.isMerging(t);zn.set(t,!1),n(),zn.set(t,r)},withoutSaving(t,n){var r=en.isSaving(t);qo.set(t,!1),n(),qo.set(t,r)}},L1=t=>{var n=t,{apply:r}=n;return n.history={undos:[],redos:[]},n.redo=()=>{var{history:o}=n,{redos:i}=o;if(i.length>0){var a=i[i.length-1];a.selectionBefore&&O.setSelection(n,a.selectionBefore),en.withoutSaving(n,(()=>{b.withoutNormalizing(n,(()=>{for(var l of a.operations)n.apply(l)}))})),o.redos.pop(),n.writeHistory("undos",a)}},n.undo=()=>{var{history:o}=n,{undos:i}=o;if(i.length>0){var a=i[i.length-1];en.withoutSaving(n,(()=>{b.withoutNormalizing(n,(()=>{var l=a.operations.map(Wt.inverse).reverse();for(var c of l)n.apply(c);a.selectionBefore&&O.setSelection(n,a.selectionBefore)}))})),n.writeHistory("redos",a),o.undos.pop()}},n.apply=o=>{var{operations:i,history:a}=n,{undos:l}=a,c=l[l.length-1],u=c&&c.operations[c.operations.length-1],d=en.isSaving(n),f=en.isMerging(n);if(d==null&&(d=M1(o)),d){if(f==null&&(f=c!=null&&(i.length!==0||P1(o,u))),c&&f)c.operations.push(o);else{var p={operations:[o],selectionBefore:n.selection};n.writeHistory("undos",p)}for(;l.length>100;)l.shift();a.redos=[]}r(o)},n.writeHistory=(o,i)=>{n.history[o].push(i)},n},P1=(t,n)=>!(!n||t.type!=="insert_text"||n.type!=="insert_text"||t.offset!==n.offset+n.text.length||!A.equals(t.path,n.path))||!(!n||t.type!=="remove_text"||n.type!=="remove_text"||t.offset+t.text.length!==n.offset||!A.equals(t.path,n.path)),M1=(t,n)=>t.type!=="set_selection",Ko=function(t,n){return Ko=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},Ko(t,n)};function ve(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}Ko(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}var me=function(){return me=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++)for(var i in n=arguments[r])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t},me.apply(this,arguments)};function gn(t,n,r,o){return new(r||(r=Promise))((function(i,a){function l(d){try{u(o.next(d))}catch(f){a(f)}}function c(d){try{u(o.throw(d))}catch(f){a(f)}}function u(d){var f;d.done?i(d.value):(f=d.value,f instanceof r?f:new r((function(p){p(f)}))).then(l,c)}u((o=o.apply(t,[])).next())}))}function yn(t,n){var r,o,i,a,l={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(u){return function(d){return(function(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(l=0)),l;)try{if(r=1,o&&(i=2&f[0]?o.return:f[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,f[1])).done)return i;switch(o=0,i&&(f=[2&f[0],i.value]),f[0]){case 0:case 1:i=f;break;case 4:return l.label++,{value:f[1],done:!1};case 5:l.label++,o=f[1],f=[0];continue;case 7:f=l.ops.pop(),l.trys.pop();continue;default:if(i=l.trys,!((i=i.length>0&&i[i.length-1])||f[0]!==6&&f[0]!==2)){l=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){l.label=f[1];break}if(f[0]===6&&l.label<i[1]){l.label=i[1],i=f;break}if(i&&l.label<i[2]){l.label=i[2],l.ops.push(f);break}i[2]&&l.ops.pop(),l.trys.pop();continue}f=n.call(t,l)}catch(p){f=[6,p],o=0}finally{r=i=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}})([u,d])}}}function st(t){var n=typeof Symbol=="function"&&Symbol.iterator,r=n&&t[n],o=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function $(t,n){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var o,i,a=r.call(t),l=[];try{for(;(n===void 0||n-- >0)&&!(o=a.next()).done;)l.push(o.value)}catch(c){i={error:c}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return l}function Be(t,n,r){if(arguments.length===2)for(var o,i=0,a=n.length;i<a;i++)!o&&i in n||(o||(o=Array.prototype.slice.call(n,0,i)),o[i]=n[i]);return t.concat(o||Array.prototype.slice.call(n))}typeof SuppressedError=="function"&&SuppressedError;var Ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xa,Jo={exports:{}},ka,Ea,z1=(xa||(xa=1,(function(t,n){var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",a="[object Boolean]",l="[object Date]",c="[object Function]",u="[object GeneratorFunction]",d="[object Map]",f="[object Number]",p="[object Object]",h="[object Promise]",m="[object RegExp]",g="[object Set]",y="[object String]",v="[object Symbol]",D="[object WeakMap]",w="[object ArrayBuffer]",C="[object DataView]",B="[object Float32Array]",k="[object Float64Array]",_="[object Int8Array]",x="[object Int16Array]",N="[object Int32Array]",T="[object Uint8Array]",M="[object Uint8ClampedArray]",R="[object Uint16Array]",z="[object Uint32Array]",W=/\w*$/,Q=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,J={};J[i]=J["[object Array]"]=J[w]=J[C]=J[a]=J[l]=J[B]=J[k]=J[_]=J[x]=J[N]=J[d]=J[f]=J[p]=J[m]=J[g]=J[y]=J[v]=J[T]=J[M]=J[R]=J[z]=!0,J["[object Error]"]=J[c]=J[D]=!1;var X=typeof Ke=="object"&&Ke&&Ke.Object===Object&&Ke,ie=typeof self=="object"&&self&&self.Object===Object&&self,re=X||ie||Function("return this")(),ne=n&&!n.nodeType&&n,se=ne&&t&&!t.nodeType&&t,G=se&&se.exports===ne;function Le(S,L){return S.set(L[0],L[1]),S}function ke(S,L){return S.add(L),S}function Me(S,L,Z,ue){for(var ot=-1,bt=S?S.length:0;++ot<bt;)Z=L(Z,S[ot],ot,S);return Z}function Pe(S){var L=!1;if(S!=null&&typeof S.toString!="function")try{L=!!(S+"")}catch{}return L}function Ve(S){var L=-1,Z=Array(S.size);return S.forEach((function(ue,ot){Z[++L]=[ot,ue]})),Z}function Ce(S,L){return function(Z){return S(L(Z))}}function xe(S){var L=-1,Z=Array(S.size);return S.forEach((function(ue){Z[++L]=ue})),Z}var Ue,lt=Array.prototype,et=Function.prototype,ze=Object.prototype,tt=re["__core-js_shared__"],nt=(Ue=/[^.]+$/.exec(tt&&tt.keys&&tt.keys.IE_PROTO||""))?"Symbol(src)_1."+Ue:"",We=et.toString,$e=ze.hasOwnProperty,mt=ze.toString,Et=RegExp("^"+We.call($e).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gt=G?re.Buffer:void 0,Bt=re.Symbol,pe=re.Uint8Array,le=Ce(Object.getPrototypeOf,Object),ge=Object.create,Ae=ze.propertyIsEnumerable,yt=lt.splice,Ee=Object.getOwnPropertySymbols,Oe=gt?gt.isBuffer:void 0,Xe=Ce(Object.keys,Object),Te=Vn(re,"DataView"),E=Vn(re,"Map"),P=Vn(re,"Promise"),Y=Vn(re,"Set"),I=Vn(re,"WeakMap"),he=Vn(Object,"create"),Ie=cn(Te),rt=cn(E),H=cn(P),ee=cn(Y),ce=cn(I),be=Bt?Bt.prototype:void 0,Ne=be?be.valueOf:void 0;function Re(S){var L=-1,Z=S?S.length:0;for(this.clear();++L<Z;){var ue=S[L];this.set(ue[0],ue[1])}}function Ge(S){var L=-1,Z=S?S.length:0;for(this.clear();++L<Z;){var ue=S[L];this.set(ue[0],ue[1])}}function St(S){var L=-1,Z=S?S.length:0;for(this.clear();++L<Z;){var ue=S[L];this.set(ue[0],ue[1])}}function Lt(S){this.__data__=new Ge(S)}function po(S,L){var Z=Cs(S)||(function(it){return(function(ct){return(function(Rt){return!!Rt&&typeof Rt=="object"})(ct)&&Yu(ct)})(it)&&$e.call(it,"callee")&&(!Ae.call(it,"callee")||mt.call(it)==i)})(S)?(function(it,ct){for(var Rt=-1,Ht=Array(it);++Rt<it;)Ht[Rt]=ct(Rt);return Ht})(S.length,String):[],ue=Z.length,ot=!!ue;for(var bt in S)!$e.call(S,bt)||ot&&(bt=="length"||y5(bt,ue))||Z.push(bt);return Z}function Wu(S,L,Z){var ue=S[L];$e.call(S,L)&&Gu(ue,Z)&&(Z!==void 0||L in S)||(S[L]=Z)}function ho(S,L){for(var Z=S.length;Z--;)if(Gu(S[Z][0],L))return Z;return-1}function ys(S,L,Z,ue,ot,bt,it){var ct;if(ue&&(ct=bt?ue(S,ot,bt,it):ue(S)),ct!==void 0)return ct;if(!go(S))return S;var Rt=Cs(S);if(Rt){if(ct=(function(de){var we=de.length,Ye=de.constructor(we);return we&&typeof de[0]=="string"&&$e.call(de,"index")&&(Ye.index=de.index,Ye.input=de.input),Ye})(S),!L)return(function(de,we){var Ye=-1,Ft=de.length;for(we||(we=Array(Ft));++Ye<Ft;)we[Ye]=de[Ye];return we})(S,ct)}else{var Ht=ln(S),Xu=Ht==c||Ht==u;if(b5(S))return(function(de,we){if(we)return de.slice();var Ye=new de.constructor(de.length);return de.copy(Ye),Ye})(S,L);if(Ht==p||Ht==i||Xu&&!bt){if(Pe(S))return bt?S:{};if(ct=(function(de){return typeof de.constructor!="function"||Ju(de)?{}:go(we=le(de))?ge(we):{};var we})(Xu?{}:S),!L)return(function(de,we){return qu(de,Ku(de),we)})(S,(function(de,we){return de&&qu(we,vs(we),de)})(ct,S))}else{if(!J[Ht])return bt?S:{};ct=(function(de,we,Ye,Ft){var or,On=de.constructor;switch(we){case w:return bs(de);case a:case l:return new On(+de);case C:return(function(_e,Ct){var Ut=Ct?bs(_e.buffer):_e.buffer;return new _e.constructor(Ut,_e.byteOffset,_e.byteLength)})(de,Ft);case B:case k:case _:case x:case N:case T:case M:case R:case z:return(function(_e,Ct){var Ut=Ct?bs(_e.buffer):_e.buffer;return new _e.constructor(Ut,_e.byteOffset,_e.length)})(de,Ft);case d:return(function(_e,Ct,Ut){var ir=Ct?Ut(Ve(_e),!0):Ve(_e);return Me(ir,Le,new _e.constructor)})(de,Ft,Ye);case f:case y:return new On(de);case m:return(function(_e){var Ct=new _e.constructor(_e.source,W.exec(_e));return Ct.lastIndex=_e.lastIndex,Ct})(de);case g:return(function(_e,Ct,Ut){var ir=Ct?Ut(xe(_e),!0):xe(_e);return Me(ir,ke,new _e.constructor)})(de,Ft,Ye);case v:return or=de,Ne?Object(Ne.call(or)):{}}})(S,Ht,ys,L)}}it||(it=new Lt);var Qu=it.get(S);if(Qu)return Qu;if(it.set(S,ct),!Rt)var ed=Z?(function(de){return(function(we,Ye,Ft){var or=Ye(we);return Cs(we)?or:(function(On,_e){for(var Ct=-1,Ut=_e.length,ir=On.length;++Ct<Ut;)On[ir+Ct]=_e[Ct];return On})(or,Ft(we))})(de,vs,Ku)})(S):vs(S);return(function(de,we){for(var Ye=-1,Ft=de?de.length:0;++Ye<Ft&&we(de[Ye],Ye,de)!==!1;);})(ed||S,(function(de,we){ed&&(de=S[we=de]),Wu(ct,we,ys(de,L,Z,ue,we,S,it))})),ct}function g5(S){return!(!go(S)||(L=S,nt&&nt in L))&&(Zu(S)||Pe(S)?Et:Q).test(cn(S));var L}function bs(S){var L=new S.constructor(S.byteLength);return new pe(L).set(new pe(S)),L}function qu(S,L,Z,ue){Z||(Z={});for(var ot=-1,bt=L.length;++ot<bt;){var it=L[ot];Wu(Z,it,S[it])}return Z}function mo(S,L){var Z,ue,ot=S.__data__;return((ue=typeof(Z=L))=="string"||ue=="number"||ue=="symbol"||ue=="boolean"?Z!=="__proto__":Z===null)?ot[typeof L=="string"?"string":"hash"]:ot.map}function Vn(S,L){var Z=(function(ue,ot){return ue?.[ot]})(S,L);return g5(Z)?Z:void 0}Re.prototype.clear=function(){this.__data__=he?he(null):{}},Re.prototype.delete=function(S){return this.has(S)&&delete this.__data__[S]},Re.prototype.get=function(S){var L=this.__data__;if(he){var Z=L[S];return Z===r?void 0:Z}return $e.call(L,S)?L[S]:void 0},Re.prototype.has=function(S){var L=this.__data__;return he?L[S]!==void 0:$e.call(L,S)},Re.prototype.set=function(S,L){return this.__data__[S]=he&&L===void 0?r:L,this},Ge.prototype.clear=function(){this.__data__=[]},Ge.prototype.delete=function(S){var L=this.__data__,Z=ho(L,S);return!(Z<0||(Z==L.length-1?L.pop():yt.call(L,Z,1),0))},Ge.prototype.get=function(S){var L=this.__data__,Z=ho(L,S);return Z<0?void 0:L[Z][1]},Ge.prototype.has=function(S){return ho(this.__data__,S)>-1},Ge.prototype.set=function(S,L){var Z=this.__data__,ue=ho(Z,S);return ue<0?Z.push([S,L]):Z[ue][1]=L,this},St.prototype.clear=function(){this.__data__={hash:new Re,map:new(E||Ge),string:new Re}},St.prototype.delete=function(S){return mo(this,S).delete(S)},St.prototype.get=function(S){return mo(this,S).get(S)},St.prototype.has=function(S){return mo(this,S).has(S)},St.prototype.set=function(S,L){return mo(this,S).set(S,L),this},Lt.prototype.clear=function(){this.__data__=new Ge},Lt.prototype.delete=function(S){return this.__data__.delete(S)},Lt.prototype.get=function(S){return this.__data__.get(S)},Lt.prototype.has=function(S){return this.__data__.has(S)},Lt.prototype.set=function(S,L){var Z=this.__data__;if(Z instanceof Ge){var ue=Z.__data__;if(!E||ue.length<199)return ue.push([S,L]),this;Z=this.__data__=new St(ue)}return Z.set(S,L),this};var Ku=Ee?Ce(Ee,Object):function(){return[]},ln=function(S){return mt.call(S)};function y5(S,L){return!!(L=L??o)&&(typeof S=="number"||q.test(S))&&S>-1&&S%1==0&&S<L}function Ju(S){var L=S&&S.constructor;return S===(typeof L=="function"&&L.prototype||ze)}function cn(S){if(S!=null){try{return We.call(S)}catch{}try{return S+""}catch{}}return""}function Gu(S,L){return S===L||S!=S&&L!=L}(Te&&ln(new Te(new ArrayBuffer(1)))!=C||E&&ln(new E)!=d||P&&ln(P.resolve())!=h||Y&&ln(new Y)!=g||I&&ln(new I)!=D)&&(ln=function(S){var L=mt.call(S),Z=L==p?S.constructor:void 0,ue=Z?cn(Z):void 0;if(ue)switch(ue){case Ie:return C;case rt:return d;case H:return h;case ee:return g;case ce:return D}return L});var Cs=Array.isArray;function Yu(S){return S!=null&&(function(L){return typeof L=="number"&&L>-1&&L%1==0&&L<=o})(S.length)&&!Zu(S)}var b5=Oe||function(){return!1};function Zu(S){var L=go(S)?mt.call(S):"";return L==c||L==u}function go(S){var L=typeof S;return!!S&&(L=="object"||L=="function")}function vs(S){return Yu(S)?po(S):(function(L){if(!Ju(L))return Xe(L);var Z=[];for(var ue in Object(L))$e.call(L,ue)&&ue!="constructor"&&Z.push(ue);return Z})(S)}t.exports=function(S){return ys(S,!0,!0)}})(Jo,Jo.exports)),Jo.exports),_a=qt(z1),$1=(function(){if(Ea)return ka;Ea=1;var t=9007199254740991,n="[object Arguments]",r="[object Function]",o="[object GeneratorFunction]",i=/^(?:0|[1-9]\d*)$/;function a(x,N){for(var T=-1,M=x?x.length:0;++T<M&&N(x[T],T,x)!==!1;);return x}var l,c,u=Object.prototype,d=u.hasOwnProperty,f=u.toString,p=u.propertyIsEnumerable,h=(l=Object.keys,c=Object,function(x){return l(c(x))});function m(x,N){var T=C(x)||(function(W){return(function(Q){return(function(q){return!!q&&typeof q=="object"})(Q)&&B(Q)})(W)&&d.call(W,"callee")&&(!p.call(W,"callee")||f.call(W)==n)})(x)?(function(W,Q){for(var q=-1,J=Array(W);++q<W;)J[q]=Q(q);return J})(x.length,String):[],M=T.length,R=!!M;for(var z in x)!d.call(x,z)||R&&(z=="length"||w(z,M))||T.push(z);return T}var g,y=(g=function(x,N){return x&&v(x,N,k)},function(x,N){if(x==null)return x;if(!B(x))return g(x,N);for(var T=x.length,M=-1,R=Object(x);++M<T&&N(R[M],M,R)!==!1;);return x}),v=function(x,N,T){for(var M=-1,R=Object(x),z=T(x),W=z.length;W--;){var Q=z[++M];if(N(R[Q],Q,R)===!1)break}return x};function D(x){if(T=(N=x)&&N.constructor,M=typeof T=="function"&&T.prototype||u,N!==M)return h(x);var N,T,M,R=[];for(var z in Object(x))d.call(x,z)&&z!="constructor"&&R.push(z);return R}function w(x,N){return!!(N=N??t)&&(typeof x=="number"||i.test(x))&&x>-1&&x%1==0&&x<N}var C=Array.isArray;function B(x){return x!=null&&(function(N){return typeof N=="number"&&N>-1&&N%1==0&&N<=t})(x.length)&&!(function(N){var T=(function(M){var R=typeof M;return!!M&&(R=="object"||R=="function")})(N)?f.call(N):"";return T==r||T==o})(x)}function k(x){return B(x)?m(x):D(x)}function _(x){return x}return ka=function(x,N){return(C(x)?a:y)(x,typeof N=="function"?N:_)}})(),Aa=qt($1),Na={},dt={CREATED:"created",DESTROYED:"destroyed",CHANGE:"change",SCROLL:"scroll",FULLSCREEN:"fullscreen",UNFULLSCREEN:"unFullScreen"},$n={};function I1(t,n){var r=t.key,o=t.factory,i=t.config,a=me(me({},i),n||{});if($n[r]!=null)throw new Error("Duplicated key '".concat(r,"' in menu items"));$n[r]=o,(function(l,c){c!=null&&(Na[l]=c)})(r,a)}var Go=new WeakMap,Yo=new WeakMap,Zo=new WeakMap,br=new WeakMap,Xo=new WeakMap,Cr=new WeakMap,Qo=new WeakMap,ei=new WeakMap,vr=new WeakMap,Sa=new WeakMap,Fa=new WeakMap,Va=new WeakMap,Oa=new WeakMap,In=new WeakMap,bn=new WeakMap,ti=new WeakMap,Dr=new WeakMap,ni=new WeakMap,wr=new WeakMap,Br=new WeakMap,Ta=new WeakMap,tn=new WeakMap,ri=new WeakMap,ja=new WeakMap,oi=new WeakMap,R1=function(t){var n=t;return n.getAllMenuKeys=function(){var r=[];for(var o in $n)r.push(o);return r},n.getConfig=function(){var r=Sa.get(n);if(r==null)throw new Error("Can not get editor config");return r},n.getMenuConfig=function(r){var o=n.getConfig().MENU_CONF;return(o===void 0?{}:o)[r]||{}},n.alert=function(r,o){o===void 0&&(o="info");var i=n.getConfig().customAlert;i&&i(r,o)},n},La=new Set(["doctype","!doctype","meta","script","style","link","frame","iframe","title","svg"]);function Pa(t){return t!==null&&typeof t=="object"&&"constructor"in t&&t.constructor===Object}function ii(t,n){t===void 0&&(t={}),n===void 0&&(n={}),Object.keys(n).forEach((function(r){t[r]===void 0?t[r]=n[r]:Pa(n[r])&&Pa(t[r])&&Object.keys(n[r]).length>0&&ii(t[r],n[r])}))}var Ma={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Rn(){var t=typeof document<"u"?document:{};return ii(t,Ma),t}var H1={document:Ma,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(t){return typeof setTimeout>"u"?(t(),null):setTimeout(t,0)},cancelAnimationFrame:function(t){typeof setTimeout<"u"&&clearTimeout(t)}};function nn(){var t=typeof window<"u"?window:{};return ii(t,H1),t}function si(t){return si=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},si(t)}function xr(t,n){return xr=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},xr(t,n)}function ai(t,n,r){return ai=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})()?Reflect.construct:function(o,i,a){var l=[null];l.push.apply(l,i);var c=new(Function.bind.apply(o,l));return a&&xr(c,a.prototype),c},ai.apply(null,arguments)}function li(t){var n=typeof Map=="function"?new Map:void 0;return li=function(r){if(r===null||!(function(i){return Function.toString.call(i).indexOf("[native code]")!==-1})(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(n!==void 0){if(n.has(r))return n.get(r);n.set(r,o)}function o(){return ai(r,arguments,si(this).constructor)}return o.prototype=Object.create(r.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),xr(o,r)},li(t)}var Kt=(function(t){var n,r;function o(i){var a,l,c;return a=t.call.apply(t,[this].concat(i))||this,l=(function(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u})(a),c=l.__proto__,Object.defineProperty(l,"__proto__",{get:function(){return c},set:function(u){c.__proto__=u}}),a}return r=t,(n=o).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,o})(li(Array));function kr(t){t===void 0&&(t=[]);var n=[];return t.forEach((function(r){Array.isArray(r)?n.push.apply(n,kr(r)):n.push(r)})),n}function za(t,n){return Array.prototype.filter.call(t,n)}function V(t,n){var r=nn(),o=Rn(),i=[];if(!n&&t instanceof Kt)return t;if(!t)return new Kt(i);if(typeof t=="string"){var a=t.trim();if(a.indexOf("<")>=0&&a.indexOf(">")>=0){var l="div";a.indexOf("<li")===0&&(l="ul"),a.indexOf("<tr")===0&&(l="tbody"),a.indexOf("<td")!==0&&a.indexOf("<th")!==0||(l="tr"),a.indexOf("<tbody")===0&&(l="table"),a.indexOf("<option")===0&&(l="select");var c=o.createElement(l);c.innerHTML=a;for(var u=0;u<c.childNodes.length;u+=1)i.push(c.childNodes[u])}else i=(function(d,f){if(typeof d!="string")return[d];for(var p=[],h=f.querySelectorAll(d),m=0;m<h.length;m+=1)p.push(h[m]);return p})(t.trim(),n||o)}else if(t.nodeType||t===r||t===o)i.push(t);else if(Array.isArray(t)){if(t instanceof Kt)return t;i=t}return new Kt((function(d){for(var f=[],p=0;p<d.length;p+=1)f.indexOf(d[p])===-1&&f.push(d[p]);return f})(i))}function Er(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=kr(n.map((function(i){return i.split(" ")})));return this.forEach((function(i){var a;(a=i.classList).add.apply(a,o)})),this}function _r(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=kr(n.map((function(i){return i.split(" ")})));return this.forEach((function(i){var a;(a=i.classList).remove.apply(a,o)})),this}function Ar(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=kr(n.map((function(i){return i.split(" ")})));return za(this,(function(i){return o.filter((function(a){return i.classList.contains(a)})).length>0})).length>0}function Cn(t,n){if(arguments.length===1&&typeof t=="string")return this[0]?this[0].getAttribute(t):void 0;for(var r=0;r<this.length;r+=1)if(arguments.length===2)this[r].setAttribute(t,n);else for(var o in t)this[r][o]=t[o],this[r].setAttribute(o,t[o]);return this}function Nr(t){for(var n=0;n<this.length;n+=1)this[n].removeAttribute(t);return this}function Sr(){var t=this[0];if(t){var n,r={};if(t.dataset)for(var o in t.dataset)r[o]=t.dataset[o];else for(var i=0;i<t.attributes.length;i+=1){var a=t.attributes[i];a.name.indexOf("data-")>=0&&(r[n=a.name.split("data-")[1],n.toLowerCase().replace(/-(.)/g,(function(c,u){return u.toUpperCase()}))]=a.value)}for(var l in r)r[l]==="false"?r[l]=!1:r[l]==="true"?r[l]=!0:parseFloat(r[l])===1*r[l]&&(r[l]*=1);return r}}function Fr(t){if(t===void 0){var n=this[0];if(!n)return;if(n.multiple&&n.nodeName.toLowerCase()==="select"){for(var r=[],o=0;o<n.selectedOptions.length;o+=1)r.push(n.selectedOptions[o].value);return r}return n.value}for(var i=0;i<this.length;i+=1){var a=this[i];if(Array.isArray(t)&&a.multiple&&a.nodeName.toLowerCase()==="select")for(var l=0;l<a.options.length;l+=1)a.options[l].selected=t.indexOf(a.options[l].value)>=0;else a.value=t}return this}function Vr(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0],i=n[1],a=n[2],l=n[3];function c(y){var v=y.target;if(v){var D=y.target.dom7EventData||[];if(D.indexOf(y)<0&&D.unshift(y),V(v).is(i))a.apply(v,D);else for(var w=V(v).parents(),C=0;C<w.length;C+=1)V(w[C]).is(i)&&a.apply(w[C],D)}}function u(y){var v=y&&y.target&&y.target.dom7EventData||[];v.indexOf(y)<0&&v.unshift(y),a.apply(this,v)}typeof n[1]=="function"&&(o=n[0],a=n[1],l=n[2],i=void 0),l||(l=!1);for(var d,f=o.split(" "),p=0;p<this.length;p+=1){var h=this[p];if(i)for(d=0;d<f.length;d+=1){var m=f[d];h.dom7LiveListeners||(h.dom7LiveListeners={}),h.dom7LiveListeners[m]||(h.dom7LiveListeners[m]=[]),h.dom7LiveListeners[m].push({listener:a,proxyListener:c}),h.addEventListener(m,c,l)}else for(d=0;d<f.length;d+=1){var g=f[d];h.dom7Listeners||(h.dom7Listeners={}),h.dom7Listeners[g]||(h.dom7Listeners[g]=[]),h.dom7Listeners[g].push({listener:a,proxyListener:u}),h.addEventListener(g,u,l)}}return this}function Ia(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0],i=n[1],a=n[2],l=n[3];typeof n[1]=="function"&&(o=n[0],a=n[1],l=n[2],i=void 0),l||(l=!1);for(var c=o.split(" "),u=0;u<c.length;u+=1)for(var d=c[u],f=0;f<this.length;f+=1){var p=this[f],h=void 0;if(!i&&p.dom7Listeners?h=p.dom7Listeners[d]:i&&p.dom7LiveListeners&&(h=p.dom7LiveListeners[d]),h&&h.length)for(var m=h.length-1;m>=0;m-=1){var g=h[m];a&&g.listener===a||a&&g.listener&&g.listener.dom7proxy&&g.listener.dom7proxy===a?(p.removeEventListener(d,g.proxyListener,l),h.splice(m,1)):a||(p.removeEventListener(d,g.proxyListener,l),h.splice(m,1))}}return this}function Or(){var t=nn();return this[0]===t?t.innerWidth:this.length>0?parseFloat(this.css("width")):null}function Tr(){var t=nn();return this[0]===t?t.innerHeight:this.length>0?parseFloat(this.css("height")):null}function Ra(){if(this.length>0){var t=nn(),n=Rn(),r=this[0],o=r.getBoundingClientRect(),i=n.body,a=r.clientTop||i.clientTop||0,l=r.clientLeft||i.clientLeft||0,c=r===t?t.scrollY:r.scrollTop,u=r===t?t.scrollX:r.scrollLeft;return{top:o.top+c-a,left:o.left+u-l}}return null}function jr(){for(var t=0;t<this.length;t+=1)this[t].style.display="none";return this}function Lr(){for(var t=nn(),n=0;n<this.length;n+=1){var r=this[n];r.style.display==="none"&&(r.style.display=""),t.getComputedStyle(r,null).getPropertyValue("display")==="none"&&(r.style.display="block")}return this}function Pr(t,n){var r,o=nn();if(arguments.length===1){if(typeof t!="string"){for(r=0;r<this.length;r+=1)for(var i in t)this[r].style[i]=t[i];return this}if(this[0])return o.getComputedStyle(this[0],null).getPropertyValue(t)}if(arguments.length===2&&typeof t=="string"){for(r=0;r<this.length;r+=1)this[r].style[t]=n;return this}return this}function Ha(t){return t?(this.forEach((function(n,r){t.apply(n,[n,r])})),this):this}function Ua(t){return V(za(this,t))}function Mr(t){if(t===void 0)return this[0]?this[0].innerHTML:null;for(var n=0;n<this.length;n+=1)this[n].innerHTML=t;return this}function zr(t){if(t===void 0)return this[0]?this[0].textContent.trim():null;for(var n=0;n<this.length;n+=1)this[n].textContent=t;return this}function Wa(t){var n,r,o=nn(),i=Rn(),a=this[0];if(!a||t===void 0)return!1;if(typeof t=="string"){if(a.matches)return a.matches(t);if(a.webkitMatchesSelector)return a.webkitMatchesSelector(t);if(a.msMatchesSelector)return a.msMatchesSelector(t);for(n=V(t),r=0;r<n.length;r+=1)if(n[r]===a)return!0;return!1}if(t===i)return a===i;if(t===o)return a===o;if(t.nodeType||t instanceof Kt){for(n=t.nodeType?[t]:t,r=0;r<n.length;r+=1)if(n[r]===a)return!0;return!1}return!1}function vn(){for(var t,n=Rn(),r=0;r<arguments.length;r+=1){t=r<0||arguments.length<=r?void 0:arguments[r];for(var o=0;o<this.length;o+=1)if(typeof t=="string"){var i=n.createElement("div");for(i.innerHTML=t;i.firstChild;)this[o].appendChild(i.firstChild)}else if(t instanceof Kt)for(var a=0;a<t.length;a+=1)this[o].appendChild(t[a]);else this[o].appendChild(t)}return this}function qa(t){var n,r,o=Rn();for(n=0;n<this.length;n+=1)if(typeof t=="string"){var i=o.createElement("div");for(i.innerHTML=t,r=i.childNodes.length-1;r>=0;r-=1)this[n].insertBefore(i.childNodes[r],this[n].childNodes[0])}else if(t instanceof Kt)for(r=0;r<t.length;r+=1)this[n].insertBefore(t[r],this[n].childNodes[0]);else this[n].insertBefore(t,this[n].childNodes[0]);return this}function $r(t){for(var n=[],r=0;r<this.length;r+=1)this[r].parentNode!==null&&(t?V(this[r].parentNode).is(t)&&n.push(this[r].parentNode):n.push(this[r].parentNode));return V(n)}function Ir(t){for(var n=[],r=0;r<this.length;r+=1)for(var o=this[r].parentNode;o;)t?V(o).is(t)&&n.push(o):n.push(o),o=o.parentNode;return V(n)}function Rr(t){for(var n=[],r=0;r<this.length;r+=1)for(var o=this[r].querySelectorAll(t),i=0;i<o.length;i+=1)n.push(o[i]);return V(n)}function Hr(t){for(var n=[],r=0;r<this.length;r+=1)for(var o=this[r].children,i=0;i<o.length;i+=1)t&&!V(o[i]).is(t)||n.push(o[i]);return V(n)}function Ur(){for(var t=0;t<this.length;t+=1)this[t].parentNode&&this[t].parentNode.removeChild(this[t]);return this}function Wr(){for(var t=0;t<this.length;t+=1){var n=this[t];if(n.nodeType===1){for(var r=0;r<n.childNodes.length;r+=1)n.childNodes[r].parentNode&&n.childNodes[r].parentNode.removeChild(n.childNodes[r]);n.textContent=""}}return this}V.fn=Kt.prototype;var U1="resize scroll".split(" "),Dn,qr=(Dn="focus",function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n[0]===void 0){for(var o=0;o<this.length;o+=1)U1.indexOf(Dn)<0&&(Dn in this[o]?this[o][Dn]():V(this[o]).trigger(Dn));return this}return this.on.apply(this,[Dn].concat(n))});const W1=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];let q1=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((n,r)=>n+=(r&=63)<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r>62?"-":"_"),"");function xt(t){Promise.resolve().then(t)}var Tt,Hn=function(t){return Object.prototype.toString.call(t)};Pr&&(V.fn.css=Pr),vn&&(V.fn.append=vn),Er&&(V.fn.addClass=Er),_r&&(V.fn.removeClass=_r),Ar&&(V.fn.hasClass=Ar),Vr&&(V.fn.on=Vr),qr&&(V.fn.focus=qr),Cn&&(V.fn.attr=Cn),Nr&&(V.fn.removeAttr=Nr),jr&&(V.fn.hide=jr),Lr&&(V.fn.show=Lr),Ra&&(V.fn.offset=Ra),Or&&(V.fn.width=Or),Tr&&(V.fn.height=Tr),$r&&(V.fn.parent=$r),Ir&&(V.fn.parents=Ir),Wa&&(V.fn.is=Wa),Sr&&(V.fn.dataset=Sr),Fr&&(V.fn.val=Fr),zr&&(V.fn.text=zr),Mr&&(V.fn.html=Mr),Hr&&(V.fn.children=Hr),Ur&&(V.fn.remove=Ur),Rr&&(V.fn.find=Rr),Ha&&(V.fn.each=Ha),Wr&&(V.fn.empty=Wr),(function(t){t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(Tt||(Tt={}));var K1=/\[object HTML([A-Z][a-z]*)*Element\]/,rn=function(t){return t!=null&&typeof t.nodeType=="number"},Ka=function(t){return rn(t)&&t.nodeType===Tt.COMMENT_NODE},ft=function(t){return rn(t)&&t.nodeType===Tt.ELEMENT_NODE},Ja=function(t){return Hn(t)==="[object Selection]"},$t=function(t){return rn(t)&&t.nodeType===Tt.TEXT_NODE},ci=function(t){var n,r,o;return(n=window&&window.document.getElementById(t))!==null&&n!==void 0?n:window&&((o=(r=window.document.activeElement)===null||r===void 0?void 0:r.shadowRoot)===null||o===void 0?void 0:o.getElementById(t))||null},Ga=function(t,n,r){for(var o=t.childNodes,i=o[n],a=n,l=!1,c=!1;(Ka(i)||ft(i)&&i.childNodes.length===0||ft(i)&&i.getAttribute("contenteditable")==="false")&&(!l||!c);)a>=o.length?(l=!0,a=n-1,r="backward"):a<0?(c=!0,a=n+1,r="forward"):(i=o[a],n=a,a+=r==="forward"?1:-1);return[i,n]},J1=function(t,n,r){return $(Ga(t,n,r),1)[0]},Ya=function(t){var n,r,o="";if($t(t)&&t.nodeValue)return t.nodeValue;if(ft(t)){try{for(var i=st(Array.from(t.childNodes)),a=i.next();!a.done;a=i.next()){var l=a.value;o+=Ya(l)}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}var c=getComputedStyle(t).getPropertyValue("display");c!=="block"&&c!=="list"&&c!=="table-row"&&t.tagName!=="BR"||(o+=`
|
|
6
|
+
`)}return o};function Za(t,n){if(r=t,!K1.test(Hn(r))||t.dataset.slateVoid!=="true")for(var r,o=t.childNodes,i=o.length;i-=1;){var a=o[i],l=a.nodeType;$t(a)?n(a,t):[Tt.ELEMENT_NODE,Tt.DOCUMENT_NODE,Tt.DOCUMENT_FRAGMENT_NODE].includes(l)&&Za(a,n)}}function Xa(t){if(t.length===0)return"";var n=t[0];return n.nodeType!==Tt.ELEMENT_NODE?"":n.tagName.toLowerCase()}var G1=new RegExp(" ","g");function Qa(t){return t.replace(G1," ")}var el=["span","b","strong","i","em","s","strike","u","font","sub","sup"],tl=[],Kr=[],Jr={};function nl(t,n){var r=t.length;if(r){var o=t[r-1];if(K.isText(o)){var i=Object.keys(o);if(i.length===1&&i[0]==="text")return o.text+=n,!0}}return!1}function Y1(t,n,r){return{type:"paragraph",children:[{text:V(t).text().replace(/\s+/gm," ")}]}}function ui(t,n){var r=(function(a,l){var c=[];if(a.attr("data-w-e-is-void")!=null)return c;var u=a[0].childNodes;return u.length===1&&u[0].nodeName==="BR"?(c.push({text:""}),c):(u.forEach((function(d){if(ft(d)){if(d.nodeName==="BR")return void(nl(c,`
|
|
7
|
+
`)||c.push({text:`
|
|
8
|
+
`}));var f=Wn(V(d),l);Array.isArray(f)?f.forEach((function(h){return c.push(h)})):c.push(f)}else if($t(d)){var p=d.textContent||"";if(p.trim()===""&&p.indexOf(`
|
|
9
|
+
`)>=0)return;p&&(p=Qa(p),nl(c,p)||c.push({text:p}))}})),c)})(t,n),o=(function(a){for(var l in Jr)if(a[0].matches(l))return Jr[l];return Y1})(t),i=o(t[0],r,n);return Array.isArray(i)||(i=[i]),i.forEach((function(a){b.isVoid(n,a)||(r.length===0&&(a.children=[{text:t.text().replace(/\s+/gm," ")}]),Kr.forEach((function(l){a=l(t[0],a,n)})))})),i}function Un(t,n){t.parents("pre").length===0&&(t[0].innerHTML=t[0].innerHTML.replace(/\s+/gm," ").replace(/<br>/g,`
|
|
10
|
+
`));var r=t[0].textContent||"";r=(function(i){return i.replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™").replace(/"/g,'"')})(r);var o={text:r=Qa(r)};return Kr.forEach((function(i){o=i(t[0],o,n)})),o}function Wn(t,n){tl.forEach((function(a){var l=a.selector,c=a.preParseHtml;t[0].matches(l)&&(t=V(c(t[0])))}));var r=Xa(t);if(r==="span"){if(t.attr("data-w-e-type"))return ui(t,n);if(t[0].childNodes.length>1){var o=t[0].childNodes,i=(function(a,l){var c={text:""};return Kr.forEach((function(u){c=u(a[0],c,l)})),c})(V(t[0]),n);return Array.from(o).flatMap((function(a){var l=(function(c,u,d){var f=c[0];if(ft(f)){var p=Wn(c,d);return Array.isArray(p)?p.map((function(m){return me(me({},u),m)})):[me(me({},u),p)]}if(Ka(f))return null;var h=$t(f)?{text:f.textContent||""}:Un(c,d);return[me(me({},u),h)]})(V(a),i,n);return l||[]}))}return Un(t,n)}return r==="code"?Xa(t.parent())==="pre"?ui(t,n):Un(t,n):el.includes(r)?t[0].childNodes.length>0&&t[0].childNodes[0].nodeType!==3?(o=t[0].childNodes,me(me({},Wn(V(o[0]),n)),Un(t,n))):Un(t,n):ui(t,n)}function rl(t,n,r){var o=V(r);return!!o.attr(n)||(o.attr(n,"true"),t.on(dt.DESTROYED,(function(){o.removeAttr(n)})),!1)}function ol(t,n){n===void 0&&(n="");var r=[];n===""&&(n="<p><br></p>"),n.indexOf("<")!==0&&(n=n.split(/\n/).map((function(i){return"<p>".concat(i,"</p>")})).join(""));var o=V("<div>".concat(n,"</div>"));return Array.from(o.children()).forEach((function(i){var a=Wn(V(i),t);Array.isArray(a)?a.forEach((function(l){return r.push(l)})):r.push(a)})),r}function il(t,n){return"w-e-element-".concat(t,"-").concat(n)}var di=[],fi,sl,al={};function Z1(t,n,r){var o=r.isInline(t)?"span":"div";return"<".concat(o,">").concat(n,"</").concat(o,">")}function X1(t,n){var r=t.type,o=r===void 0?"":r,i=t.children,a=i===void 0?[]:i,l=b.isVoid(n,t),c="";l||(c=a.map((function(y){return ul(y,n)})).join(""));var u=(function(y){return al[y]||Z1})(o),d=u(t,c,n),f="";if(f=typeof d=="string"?d:d.html||"",l||di.forEach((function(y){return f=y(t,f)})),typeof d=="string")return f;var p=d.prefix,h=p===void 0?"":p,m=d.suffix,g=m===void 0?"":m;return h&&(f=h+f),g&&(f+=g),f}var Q1=(function(){if(sl)return fi;sl=1;var t=9007199254740991,n="[object Arguments]",r="[object Function]",o="[object GeneratorFunction]",i="[object Map]",a="[object Promise]",l="[object Set]",c="[object String]",u="[object WeakMap]",d="[object DataView]",f=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,h="\\ud800-\\udfff",m="\\u0300-\\u036f\\ufe20-\\ufe23",g="\\u20d0-\\u20f0",y="\\ufe0e\\ufe0f",v="["+h+"]",D="["+m+g+"]",w="\\ud83c[\\udffb-\\udfff]",C="[^"+h+"]",B="(?:\\ud83c[\\udde6-\\uddff]){2}",k="[\\ud800-\\udbff][\\udc00-\\udfff]",_="\\u200d",x="(?:"+D+"|"+w+")?",N="["+y+"]?",T=N+x+("(?:"+_+"(?:"+[C,B,k].join("|")+")"+N+x+")*"),M="(?:"+[C+D+"?",D,B,k,v].join("|")+")",R=RegExp(w+"(?="+w+")|"+M+T,"g"),z=RegExp("["+_+h+m+g+y+"]"),W=typeof Ke=="object"&&Ke&&Ke.Object===Object&&Ke,Q=typeof self=="object"&&self&&self.Object===Object&&self,q=W||Q||Function("return this")();function J(H,ee){return(function(ce,be){for(var Ne=-1,Re=ce?ce.length:0,Ge=Array(Re);++Ne<Re;)Ge[Ne]=be(ce[Ne],Ne,ce);return Ge})(ee,(function(ce){return H[ce]}))}function X(H){var ee=-1,ce=Array(H.size);return H.forEach((function(be,Ne){ce[++ee]=[Ne,be]})),ce}function ie(H){var ee=-1,ce=Array(H.size);return H.forEach((function(be){ce[++ee]=be})),ce}function re(H){return(function(ee){return z.test(ee)})(H)?(function(ee){return ee.match(R)||[]})(H):(function(ee){return ee.split("")})(H)}var ne,se,G,Le=Function.prototype,ke=Object.prototype,Me=q["__core-js_shared__"],Pe=(ne=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||""))?"Symbol(src)_1."+ne:"",Ve=Le.toString,Ce=ke.hasOwnProperty,xe=ke.toString,Ue=RegExp("^"+Ve.call(Ce).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),lt=q.Symbol,et=lt?lt.iterator:void 0,ze=ke.propertyIsEnumerable,tt=(se=Object.keys,G=Object,function(H){return se(G(H))}),nt=Oe(q,"DataView"),We=Oe(q,"Map"),$e=Oe(q,"Promise"),mt=Oe(q,"Set"),Et=Oe(q,"WeakMap"),gt=E(nt),Bt=E(We),pe=E($e),le=E(mt),ge=E(Et);function Ae(H,ee){var ce=P(H)||(function(Ge){return(function(St){return Ie(St)&&Y(St)})(Ge)&&Ce.call(Ge,"callee")&&(!ze.call(Ge,"callee")||xe.call(Ge)==n)})(H)?(function(Ge,St){for(var Lt=-1,po=Array(Ge);++Lt<Ge;)po[Lt]=St(Lt);return po})(H.length,String):[],be=ce.length,Ne=!!be;for(var Re in H)!Ce.call(H,Re)||Ne&&(Re=="length"||Te(Re,be))||ce.push(Re);return ce}function yt(H){if(!he(H)||(function(ce){return!!Pe&&Pe in ce})(H))return!1;var ee=I(H)||(function(ce){var be=!1;if(ce!=null&&typeof ce.toString!="function")try{be=!!(ce+"")}catch{}return be})(H)?Ue:f;return ee.test(E(H))}function Ee(H){if(ce=(ee=H)&&ee.constructor,be=typeof ce=="function"&&ce.prototype||ke,ee!==be)return tt(H);var ee,ce,be,Ne=[];for(var Re in Object(H))Ce.call(H,Re)&&Re!="constructor"&&Ne.push(Re);return Ne}function Oe(H,ee){var ce=(function(be,Ne){return be?.[Ne]})(H,ee);return yt(ce)?ce:void 0}var Xe=function(H){return xe.call(H)};function Te(H,ee){return!!(ee=ee??t)&&(typeof H=="number"||p.test(H))&&H>-1&&H%1==0&&H<ee}function E(H){if(H!=null){try{return Ve.call(H)}catch{}try{return H+""}catch{}}return""}(nt&&Xe(new nt(new ArrayBuffer(1)))!=d||We&&Xe(new We)!=i||$e&&Xe($e.resolve())!=a||mt&&Xe(new mt)!=l||Et&&Xe(new Et)!=u)&&(Xe=function(H){var ee=xe.call(H),ce=ee=="[object Object]"?H.constructor:void 0,be=ce?E(ce):void 0;if(be)switch(be){case gt:return d;case Bt:return i;case pe:return a;case le:return l;case ge:return u}return ee});var P=Array.isArray;function Y(H){return H!=null&&(function(ee){return typeof ee=="number"&&ee>-1&&ee%1==0&&ee<=t})(H.length)&&!I(H)}function I(H){var ee=he(H)?xe.call(H):"";return ee==r||ee==o}function he(H){var ee=typeof H;return!!H&&(ee=="object"||ee=="function")}function Ie(H){return!!H&&typeof H=="object"}function rt(H){return H?J(H,(function(ee){return Y(ee)?Ae(ee):Ee(ee)})(H)):[]}return fi=function(H){if(!H)return[];if(Y(H))return(function(ce){return typeof ce=="string"||!P(ce)&&Ie(ce)&&xe.call(ce)==c})(H)?re(H):(function(ce,be){var Ne=-1,Re=ce.length;for(be||(be=Array(Re));++Ne<Re;)be[Ne]=ce[Ne];return be})(H);if(et&&H[et])return(function(ce){for(var be,Ne=[];!(be=ce.next()).done;)Ne.push(be.value);return Ne})(H[et]());var ee=Xe(H);return(ee==i?X:ee==l?ie:rt)(H)},fi})(),ll=qt(Q1),em=0,cl=function(){this.id="".concat(em++)},pi=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),qn=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),wn=typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),tm=typeof navigator<"u"&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),nm=typeof navigator<"u"&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),hi=typeof navigator<"u"&&/Chrome/i.test(navigator.userAgent),Kn=!nm&&!tm&&typeof globalThis<"u"&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges=="function",F={getWindow:function(t){var n=Ta.get(t);if(!n)throw new Error("Unable to find a host window element for this editor");return n},findKey:function(t,n){var r=Br.get(n);return r||(r=new cl,Br.set(n,r)),r},setNewKey:function(t){var n=new cl;Br.set(t,n)},findPath:function(t,n){for(var r=[],o=n;;){var i=bn.get(o);if(i==null){if(b.isEditor(o))return r;break}var a=In.get(o);if(a==null)break;r.unshift(a),o=i}throw new Error("Unable to find the path for Slate node: ".concat(JSON.stringify(n)))},findDocumentOrShadowRoot:function(t){if(t.isDestroyed)return window.document;var n=F.toDOMNode(t,t),r=n.getRootNode();return Hn(r)!=="[object HTMLDocument]"&&!(function(o){return Hn(o)==="[object ShadowRoot]"})(r)||Reflect.get(r,"getSelection")==null?n.ownerDocument:r},getParentNode:function(t,n){return bn.get(n)||null},getParentsNodes:function(t,n){for(var r=[],o=n;o!==t&&o!=null;){var i=F.getParentNode(t,o);if(i==null)break;r.push(i),o=i}return r},getTopNode:function(t,n){var r=[F.findPath(t,n)[0]];return U.get(t,r)},toDOMNode:function(t,n){var r;if(b.isEditor(n))r=ti.get(t);else{var o=F.findKey(t,n);r=ni.get(o)}if(!r)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(JSON.stringify(n)));return r},hasDOMNode:function(t,n,r){r===void 0&&(r={});var o,i=r.editable,a=i!==void 0&&i,l=F.toDOMNode(t,t);try{o=ft(n)?n:n.parentElement}catch(c){if(c instanceof Error&&!c.message.includes('Permission denied to access property "nodeType"'))throw c}return!!o&&(o.closest("[data-slate-editor]")===l&&(!a||o.isContentEditable||!!o.getAttribute("data-slate-zero-width"))||!!o.getAttribute("data-slate-string"))},toDOMRange:function(t,n){var r=n.anchor,o=n.focus,i=j.isBackward(n),a=F.toDOMPoint(t,r),l=j.isCollapsed(n)?a:F.toDOMPoint(t,o),c=F.getWindow(t).document.createRange(),u=$(i?l:a,2),d=u[0],f=u[1],p=$(i?a:l,2),h=p[0],m=p[1],g=!!(ft(d)?d:d.parentElement).getAttribute("data-slate-zero-width"),y=!!(ft(h)?h:h.parentElement).getAttribute("data-slate-zero-width");return c.setStart(d,g?1:f),c.setEnd(h,y?1:m),c},toDOMPoint:function(t,n){var r,o,i,a=$(b.node(t,n.path),1)[0],l=F.toDOMNode(t,a);b.void(t,{at:n})&&(n={path:n.path,offset:0});var c=Array.from(l.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),u=0;try{for(var d=st(c),f=d.next();!f.done;f=d.next()){var p=f.value,h=p.childNodes[0];if(h!=null&&h.textContent!=null){var m=h.textContent.length,g=p.getAttribute("data-slate-length"),y=u+(g==null?m:parseInt(g,10));if(n.offset<=y){i=[h,Math.min(m,Math.max(0,n.offset-u))];break}u=y}}}catch(v){r={error:v}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}if(!i)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(JSON.stringify(n)));return i},toSlateNode:function(t,n){var r=ft(n)?n:n.parentElement;r&&!r.hasAttribute("data-slate-node")&&(r=r.closest("[data-slate-node]"));var o=r?Dr.get(r):null;if(!o)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(r));return o},findEventRange:function(t,n){"nativeEvent"in n&&(n=n.nativeEvent);var r=n.clientX,o=n.clientY,i=n.target;if(r==null||o==null)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(n));var a,l=F.toSlateNode(t,n.target),c=F.findPath(t,l);if(b.isVoid(t,l)){var u=i.getBoundingClientRect(),d=t.isInline(l)?r-u.left<u.left+u.width-r:o-u.top<u.top+u.height-o,f=b.point(t,c,{edge:d?"start":"end"}),p=d?b.before(t,f):b.after(t,f);if(p)return b.range(t,p)}var h=this.getWindow(t).document;if(h.caretRangeFromPoint)a=h.caretRangeFromPoint(r,o);else{var m=h.caretPositionFromPoint(r,o);m&&((a=h.createRange()).setStart(m.offsetNode,m.offset),a.setEnd(m.offsetNode,m.offset))}if(!a)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(n));return F.toSlateRange(t,a,{exactMatch:!1,suppressThrow:!1})},toSlateRange:function(t,n,r){var o,i,a,l,c,u=r.exactMatch,d=r.suppressThrow;if((Ja(n)?n.anchorNode:n.startContainer)&&(Ja(n)?(o=n.anchorNode,i=n.anchorOffset,a=n.focusNode,l=n.focusOffset,c=hi&&window.document.activeElement&&window.document.activeElement.shadowRoot?n.anchorNode===n.focusNode&&n.anchorOffset===n.focusOffset:n.isCollapsed):(o=n.startContainer,i=n.startOffset,a=n.endContainer,l=n.endOffset,c=n.collapsed)),o==null||a==null||i==null||l==null)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(n));var f=F.toSlatePoint(t,[o,i],{exactMatch:u,suppressThrow:d});if(!f)return null;var p=c?f:F.toSlatePoint(t,[a,l],{exactMatch:u,suppressThrow:d});if(!p)return null;var h={anchor:f,focus:p};return j.isExpanded(h)&&j.isForward(h)&&ft(a)&&b.void(t,{at:h.focus,mode:"highest"})&&(h=b.unhangRange(t,h,{voids:!0})),h},toSlatePoint:function(t,n,r){var o,i=r.exactMatch,a=r.suppressThrow,l=$(i?n:(function(C){var B,k=$(C,2),_=k[0],x=k[1];if(ft(_)&&_.childNodes.length){var N=x===_.childNodes.length,T=N?x-1:x;for(_=(B=$(Ga(_,T,N?"backward":"forward"),2))[0],N=(T=B[1])<x;ft(_)&&_.childNodes.length;){var M=N?_.childNodes.length-1:0;_=J1(_,M,N?"backward":"forward")}x=N&&_.textContent!=null?_.textContent.length:0}return[_,x]})(n),2),c=l[0],u=l[1],d=c.parentNode,f=null,p=0;if(d){var h=d.closest('[data-slate-void="true"]'),m=d.closest("[data-slate-leaf]"),g=null,y=F.getWindow(t);if(m&&y.document.createRange){f=m.closest('[data-slate-node="text"]');var v=y.document.createRange();v.setStart(f,0),v.setEnd(c,u);var D=v.cloneContents();Be(Be([],$(ll(D.querySelectorAll("[data-slate-zero-width]"))),!1),$(ll(D.querySelectorAll("[contenteditable=false]"))),!1).forEach((function(C){C.parentNode.removeChild(C)})),p=D.textContent.length,g=f}else h&&((m=h.querySelector("[data-slate-leaf]"))?(f=m.closest('[data-slate-node="text"]'),p=(g=m).textContent.length,g.querySelectorAll("[data-slate-zero-width]").forEach((function(C){p-=C.textContent.length}))):p=1);g&&p===g.textContent.length&&(d.hasAttribute("data-slate-zero-width")||qn&&(!((o=g.textContent)===null||o===void 0)&&o.endsWith(`
|
|
11
|
+
`)))&&(p-=1)}if(!f){if(a)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(n))}var w=F.toSlateNode(t,f);return{path:F.findPath(t,w),offset:p}},hasRange:function(t,n){var r=n.anchor,o=n.focus;return b.hasPath(t,r.path)&&b.hasPath(t,o.path)},getNodeType:function(t){return te.isElement(t)?t.type:""},checkNodeType:function(t,n){return this.getNodeType(t)===n},getNodesStr:function(t){return t.map((function(n){return U.string(n)})).join("")},getSelectedElems:function(t){var n,r,o=[],i=b.nodes(t,{universal:!0});try{for(var a=st(i),l=a.next();!l.done;l=a.next()){var c=$(l.value,1)[0];te.isElement(c)&&o.push(c)}}catch(u){n={error:u}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o},getSelectedNodeByType:function(t,n){var r=this,o=$(b.nodes(t,{match:function(a){return r.checkNodeType(a,n)},universal:!0}),1),i=o[0];return i==null?null:i[0]},getSelectedTextNode:function(t){var n=$(b.nodes(t,{match:function(o){return K.isText(o)},universal:!0}),1),r=n[0];return r==null?null:r[0]},isNodeSelected:function(t,n){var r=$(b.nodes(t,{match:function(i){return i===n},universal:!0}),1),o=r[0];return o!=null&&$(o,1)[0]===n},isSelectionAtLineEnd:function(t,n){var r=t.selection;return!!r&&(b.isEnd(t,r.anchor,n)||b.isEnd(t,r.focus,n))},getTextarea:function(t){var n=Go.get(t);if(n==null)throw new Error("Cannot find textarea instance by editor");return n},getToolbar:function(t){return br.get(t)||null},getHoverbar:function(t){return Cr.get(t)||null},normalizeContent:function(t){t.children.forEach((function(n,r){t.normalizeNode([n,[r]])}))},getLeftLengthOfMaxLength:function(t){var n=t.getConfig(),r=n.maxLength,o=n.onMaxLength;if(typeof r!="number"||r<=0)return 1/0;var i=r-t.getText().replace(/\r|\n|(\r\n)|(\n\r)/g,"").length;return i<=0&&o&&o(t),i},cleanExposedTexNodeInSelectionBlock:function(t){var n,r,o,i,a=F.getTextarea(t).$textArea,l=a?.[0].childNodes;if(l)try{for(var c=st(Array.from(l)),u=c.next();!u.done;u=c.next()){var d=u.value;if(!$t(d))break;d.remove()}}catch(y){n={error:y}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}var f=b.nodes(t,{match:function(y){return!(!te.isElement(y)||t.isInline(y))},universal:!0});try{for(var p=st(f),h=p.next();!h.done;h=p.next()){var m=h.value;if(m!=null){var g=m[0];Za(F.toDOMNode(t,g),(function(y,v){var D=V(v);D.attr("data-slate-string")||D.attr("data-slate-zero-width")||D.attr("data-w-e-reserve")||v.removeChild(y)}))}}}catch(y){o={error:y}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}},isLastNode:function(t,n){var r=t.children||[];return r[r.length-1]===n},genEmptyParagraph:function(){return{type:"paragraph",children:[{text:""}]}},isSelectedVoidNode:function(t){var n,r,o=b.nodes(t,{match:function(c){return t.isVoid(c)}}),i=0;try{for(var a=st(o),l=a.next();!l.done;l=a.next())l.value&&(i+=1)}catch(c){n={error:c}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i>0},isSelectedEmptyParagraph:function(t){var n=t.selection;if(n==null||j.isExpanded(n))return!1;var r=F.getSelectedNodeByType(t,"paragraph");if(r===null)return!1;var o=r.children;return o.length===1&&(o[0].text===""||void 0)},isEmptyPath:function(t,n){var r=b.node(t,n);if(r==null)return!1;var o=$(r,1)[0].children;return o.length===1&&o[0].text===""}};function ul(t,n){return te.isElement(t)?X1(t,n):(function(r,o){var i=r.text;if(i==null)throw new Error("Current node is not slate Text ".concat(JSON.stringify(r)));var a=i;a=(function(u){return u.replace(/ {2}/g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™")})(a);var l=F.getParentsNodes(o,r).some((function(u){return F.getNodeType(u)==="pre"}));if(l||(a=a.replace(/\n\r|\r\n|\r|\n/g,"<br>")),l&&(a=a.replace(/ /g," ")),a===""){var c=F.getParentNode(null,r);if(!c||c.children.length!==0)return a;a="<br>"}return di.forEach((function(u){return a=u(r,a)})),a})(t,n)}var dl=function(t,n){var r=(n.top+n.bottom)/2;return t.top<=r&&t.bottom>=r},fl=function(t,n,r){var o=F.toDOMRange(t,n).getBoundingClientRect(),i=F.toDOMRange(t,r).getBoundingClientRect();return dl(o,i)&&dl(i,o)};function pl(t,n){t.isInline(n)?(t.insertNode(n),n.type==="link"&&t.insertFragment([{text:""}])):O.insertNodes(t,n,{mode:"highest"})}var hl,ml,gl,yl,bl,Cl,vl,Dl,wl,Bl,xl,kl,El,_l,Al,Nl,mi,Sl,Fl,Vl,Ol,Tl,jl,Ll,gi,Pl,Ml,zl,yi,$l,Il,Rl,bi,Hl,Ul,Wl,ql,Kl,Jl,Gl,rm=function(t){var n=t,r=n.onChange,o=n.insertText,i=n.apply,a=n.deleteBackward;return n.insertText=function(l){n.getConfig().readOnly||o(l)},n.apply=function(l){var c,u,d,f,p,h,m,g,y=[];switch(l.type){case"insert_text":case"remove_text":case"set_node":try{for(var v=st(b.levels(n,{at:l.path})),D=v.next();!D.done;D=v.next()){var w=$(D.value,2),C=w[0],B=w[1],k=F.findKey(n,C);y.push([B,k])}}catch(q){c={error:q}}finally{try{D&&!D.done&&(u=v.return)&&u.call(v)}finally{if(c)throw c.error}}break;case"insert_node":case"remove_node":case"merge_node":case"split_node":try{for(var _=st(b.levels(n,{at:A.parent(l.path)})),x=_.next();!x.done;x=_.next()){var N=$(x.value,2);C=N[0],B=N[1],k=F.findKey(n,C),y.push([B,k])}}catch(q){d={error:q}}finally{try{x&&!x.done&&(f=_.return)&&f.call(_)}finally{if(d)throw d.error}}break;case"move_node":try{for(var T=st(b.levels(n,{at:A.common(A.parent(l.path),A.parent(l.newPath))})),M=T.next();!M.done;M=T.next()){var R=$(M.value,2);C=R[0],B=R[1],k=F.findKey(n,C),y.push([B,k])}}catch(q){p={error:q}}finally{try{M&&!M.done&&(h=T.return)&&h.call(T)}finally{if(p)throw p.error}}}i(l);try{for(var z=st(y),W=z.next();!W.done;W=z.next()){var Q=$(W.value,2);B=Q[0],k=Q[1],C=$(b.node(n,B),1)[0],Br.set(C,k)}}catch(q){m={error:q}}finally{try{W&&!W.done&&(g=z.return)&&g.call(z)}finally{if(m)throw m.error}}},n.deleteBackward=function(l){if(l!=="line")return a(l);if(t.selection&&j.isCollapsed(t.selection)){var c=b.above(t,{match:function(p){return b.isBlock(t,p)},at:t.selection});if(c){var u=$(c,2)[1],d=b.range(t,u,t.selection.anchor),f=(function(p,h){var m=b.range(p,j.end(h)),g=Array.from(b.positions(p,{at:h})),y=0,v=g.length,D=Math.floor(v/2);if(fl(p,b.range(p,g[y]),m))return b.range(p,g[y],m);if(g.length<2)return b.range(p,g[g.length-1],m);for(;D!==g.length&&D!==y;)fl(p,b.range(p,g[D]),m)?v=D:y=D,D=Math.floor((y+v)/2);return b.range(p,g[v],m)})(n,d);j.isCollapsed(f)||O.delete(t,{at:f})}}},n.onChange=function(){var l=n.selection;l!=null&&ri.set(n,l),n.emit("change"),r()},n.handleTab=function(){n.insertText(" ")},n.getHtml=function(){var l=n.children;return(l===void 0?[]:l).map((function(c){return ul(c,n)})).join("")},n.getText=function(){var l=n.children;return(l===void 0?[]:l).map((function(c){return U.string(c)})).join(`
|
|
12
|
+
`)},n.getSelectionText=function(){var l=n.selection;return l==null?"":b.string(t,l)},n.getElemsByType=function(l,c){var u,d;c===void 0&&(c=!1);var f=[],p=b.nodes(n,{at:[],universal:!0});try{for(var h=st(p),m=h.next();!m.done;m=h.next()){var g=$(m.value,1)[0];if(te.isElement(g)&&(c?g.type.indexOf(l)>=0:g.type===l)){var y=F.findKey(n,g),v=il(g.type,y.id);f.push(me(me({},g),{id:v}))}}}catch(D){u={error:D}}finally{try{m&&!m.done&&(d=h.return)&&d.call(h)}finally{if(u)throw u.error}}return f},n.getElemsByTypePrefix=function(l){return n.getElemsByType(l,!0)},n.isEmpty=function(){var l=n.children,c=l===void 0?[]:l;if(c.length>1)return!1;var u=c[0];if(u==null)return!0;if(!te.isElement(u)||u.type!=="paragraph")return!1;var d=u.children,f=d===void 0?[]:d;if(f.length>1)return!1;var p=f[0];return p==null||K.isText(p)&&p.text===""},n.clear=function(){O.delete(n,{at:{anchor:b.start(n,[]),focus:b.end(n,[])}}),n.children.length===0&&O.insertNodes(n,[{type:"paragraph",children:[{text:""}]}])},n.getParentNode=function(l){return F.getParentNode(n,l)},n.dangerouslyInsertHtml=function(l,c){if(l===void 0&&(l=""),c===void 0&&(c=!1),l){var u=document.createElement("div");u.innerHTML=l;var d=Array.from(u.childNodes);if(d=d.filter((function(m){var g=m.nodeName;return!!$t(m)||!!ft(m)&&!La.has(g.toLowerCase())})),d.length!==0){var f=n.selection;if(f!=null){var p=null;F.isSelectedEmptyParagraph(n)&&!c&&(p=[f.focus.path[0]]),u.setAttribute("hidden","true"),document.body.appendChild(u);var h=0;d.forEach((function(m,g){var y=m.nodeName,v=m.textContent,D=v===void 0?"":v;if($t(m)){if(!D||!D.trim())return;n.insertNode({text:D})}else if(y!=="BR"){var w=m,C=!1;if(el.includes(y.toLowerCase()))C=!0;else for(var B in Jr)if(w.matches(B)){C=!0;break}if(C){var k=Wn(V(w),n);return Array.isArray(k)?(k.forEach((function(x){return pl(n,x)})),h+=1):(pl(n,k),h+=1),void(F.isSelectedVoidNode(n)&&n.move(1))}var _=window.getComputedStyle(w).display;!F.isSelectedEmptyParagraph(n)&&_.indexOf("inline")<0&&(g>=1&&(function(x){return"matches"in x&&/^[ou]l$/i.test(x.tagName)&&!x.hasAttribute("data-w-e-type")})(d[g-1])&&n.insertBreak(),n.insertBreak()),n.dangerouslyInsertHtml(w.innerHTML,!0)}else n.insertText(`
|
|
13
|
+
`)})),h&&p&&F.isEmptyPath(n,p)&&O.removeNodes(n,{at:p}),u.remove()}}}},n.setHtml=function(l){l===void 0&&(l="");var c=n.isDisabled(),u=n.isFocused(),d=JSON.stringify(n.selection);n.enable(),n.focus(),n.clear();var f=ol(n,l??"");if(O.insertFragment(n,f),u||(n.deselect(),n.blur()),c&&(n.deselect(),n.disable()),n.isFocused())try{n.select(JSON.parse(d))}catch{n.select(b.start(n,[]))}},n},om=1,im=function(t){var n=t;return n.id="wangEditor-".concat(om++),n.isDestroyed=!1,n.isFullScreen=!1,n.focus=function(r){if(F.toDOMNode(n,n).focus({preventScroll:!0}),tn.set(n,!0),r){var o=b.end(n,[]);O.select(n,o)}else{var i=ri.get(n);i?O.select(n,i):O.select(n,b.start(n,[]))}},n.isFocused=function(){return!!tn.get(n)},n.blur=function(){F.toDOMNode(n,n).blur(),O.deselect(n),tn.set(n,!1)},n.updateView=function(){F.getTextarea(n).changeViewState();var r=F.getToolbar(n);r&&r.changeToolbarState();var o=F.getHoverbar(n);o&&o.changeHoverbarState()},n.destroy=function(){if(!n.isDestroyed){var r=F.getTextarea(n);r.destroy(),Go.delete(n),Yo.delete(r);var o=F.getToolbar(n);o&&(o.destroy(),br.delete(n),Zo.delete(o));var i=F.getHoverbar(n);i&&(i.destroy(),Cr.delete(n),Xo.delete(i)),n.isDestroyed=!0,n.emit("destroyed")}},n.scrollToElem=function(r){if(!n.getConfig().scroll){var o="编辑器禁用了 scroll ,编辑器内容无法滚动,请自行实现该功能";return o+=`
|
|
14
|
+
You has disabled editor scroll, please do this yourself`,void console.warn(o)}var i=V("#".concat(r));if(i.length!==0){var a=i[0];if(!F.hasDOMNode(n,a))return o="Element (found by id is '".concat(r,"') is not in editor DOM"),o+=`
|
|
15
|
+
通过 id '`.concat(r,"' 找到的 element 不在 editor DOM 之内"),void console.error(o,a);var l=F.getTextarea(n),c=l.$textAreaContainer,u=l.$scroll,d=i.offset().top,f=c.offset().top;u[0].scrollBy({top:d-f,behavior:"smooth"})}},n.showProgressBar=function(r){r<1||F.getTextarea(n).changeProgress(r)},n.hidePanelOrModal=function(){var r=ei.get(n);r?.forEach((function(o){return o.hide()}))},n.enable=function(){n.getConfig().readOnly=!1,n.updateView()},n.disable=function(){n.getConfig().readOnly=!0,n.updateView()},n.isDisabled=function(){return n.getConfig().readOnly},n.toDOMNode=function(r){return F.toDOMNode(n,r)},n.fullScreen=function(){if(!n.isFullScreen){var r=null,o=F.getToolbar(n);o&&(r=o.$box);var i=F.getTextarea(n).$box.parent();if(r&&r.parent()[0]!==i[0])throw new Error(`Can not set full screen, cause toolbar DOM parent is not equal to textarea DOM parent
|
|
16
|
+
不能设置全屏,因为 toolbar DOM 父节点和 textarea DOM 父节点不一致`);i.addClass("w-e-full-screen-container");var a=i.css("z-index");i.attr("data-z-index",a.toString()),n.isFullScreen=!0,n.emit("fullScreen")}},n.unFullScreen=function(){if(n.isFullScreen){var r=F.getTextarea(n).$box.parent();setTimeout((function(){r.removeClass("w-e-full-screen-container"),n.isFullScreen=!1,n.emit("unFullScreen")}),200)}},n.getEditableContainer=function(){return F.getTextarea(n).$textAreaContainer[0]},n},Ci={exports:{}},vi={exports:{}};function Yl(){return ml?hl:(ml=1,hl=function(t){return t!=null})}function sm(){if(Cl)return bl;Cl=1;var t=(function(){if(yl)return gl;yl=1;var n=Yl(),r={object:!0,function:!0,undefined:!0};return gl=function(o){return!!n(o)&&hasOwnProperty.call(r,typeof o)}})();return bl=function(n){if(!t(n))return!1;try{return!!n.constructor&&n.constructor.prototype===n}catch{return!1}}}function am(){if(Bl)return wl;Bl=1;var t=(function(){if(Dl)return vl;Dl=1;var o=sm();return vl=function(i){if(typeof i!="function"||!hasOwnProperty.call(i,"length"))return!1;try{if(typeof i.length!="number"||typeof i.call!="function"||typeof i.apply!="function")return!1}catch{return!1}return!o(i)}})(),n=/^\s*class[\s{/}]/,r=Function.prototype.toString;return wl=function(o){return!!t(o)&&!n.test(r.call(o))}}function Di(){if(Sl)return mi;Sl=1;var t=(Nl?Al:(Nl=1,Al=function(){}))();return mi=function(n){return n!==t&&n!==null},mi}function lm(){return Tl||(Tl=1,Ol=(_l?El:(_l=1,El=function(){try{return Object.keys("primitive"),!0}catch{return!1}}))()?Object.keys:(function(){if(Vl)return Fl;Vl=1;var t=Di(),n=Object.keys;return Fl=function(r){return n(t(r)?Object(r):r)}})()),Ol}function cm(){if(Pl)return gi;Pl=1;var t=lm(),n=(function(){if(Ll)return jl;Ll=1;var o=Di();return jl=function(i){if(!o(i))throw new TypeError("Cannot use null or undefined");return i}})(),r=Math.max;return gi=function(o,i){var a,l,c,u=r(arguments.length,2);for(o=Object(n(o)),c=function(d){try{o[d]=i[d]}catch(f){a||(a=f)}},l=1;l<u;++l)t(i=arguments[l]).forEach(c);if(a!==void 0)throw a;return o},gi}function um(){return zl?Ml:(zl=1,Ml=(kl||(kl=1,xl=function(){var t,n=Object.assign;return typeof n=="function"&&(n(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}),xl)()?Object.assign:cm())}function dm(){return Wl||(Wl=1,Ul=(function(){if(Rl)return Il;Rl=1;var t="razdwatrzy";return Il=function(){return typeof t.contains=="function"&&t.contains("dwa")===!0&&t.contains("foo")===!1}})()()?String.prototype.contains:(function(){if(Hl)return bi;Hl=1;var t=String.prototype.indexOf;return bi=function(n){return t.call(this,n,arguments[1])>-1},bi})()),Ul}function fm(){if(ql)return vi.exports;ql=1;var t=Yl(),n=am(),r=um(),o=(function(){if($l)return yi;$l=1;var l=Di(),c=Array.prototype.forEach,u=Object.create;return yi=function(d){var f=u(null);return c.call(arguments,(function(p){l(p)&&(function(h,m){var g;for(g in h)m[g]=h[g]})(Object(p),f)})),f},yi})(),i=dm(),a=vi.exports=function(l,c){var u,d,f,p,h;return arguments.length<2||typeof l!="string"?(p=c,c=l,l=null):p=arguments[2],t(l)?(u=i.call(l,"c"),d=i.call(l,"e"),f=i.call(l,"w")):(u=f=!0,d=!1),h={value:c,configurable:u,enumerable:d,writable:f},p?r(o(p),h):h};return a.gs=function(l,c,u){var d,f,p,h;return typeof l!="string"?(p=u,u=c,c=l,l=null):p=arguments[3],t(c)?n(c)?t(u)?n(u)||(p=u,u=void 0):u=void 0:(p=c,c=u=void 0):c=void 0,t(l)?(d=i.call(l,"c"),f=i.call(l,"e")):(d=!0,f=!1),h={get:c,set:u,configurable:d,enumerable:f},p?r(o(p),h):h},vi.exports}var pm=(Gl||(Gl=1,(function(t,n){var r,o,i,a,l,c,u,d=fm(),f=(Jl||(Jl=1,Kl=function(w){if(typeof w!="function")throw new TypeError(w+" is not a function");return w}),Kl),p=Function.prototype.apply,h=Function.prototype.call,m=Object.create,g=Object.defineProperty,y=Object.defineProperties,v=Object.prototype.hasOwnProperty,D={configurable:!0,enumerable:!1,writable:!0};o=function(w,C){var B,k;return f(C),k=this,r.call(this,w,B=function(){i.call(k,w,B),p.call(C,this,arguments)}),B.__eeOnceListener__=C,this},i=function(w,C){var B,k,_,x;if(f(C),!v.call(this,"__ee__"))return this;if(!(B=this.__ee__)[w])return this;if(typeof(k=B[w])=="object")for(x=0;_=k[x];++x)_!==C&&_.__eeOnceListener__!==C||(k.length===2?B[w]=k[x?0:1]:k.splice(x,1));else k!==C&&k.__eeOnceListener__!==C||delete B[w];return this},a=function(w){var C,B,k,_,x;if(v.call(this,"__ee__")&&(_=this.__ee__[w]))if(typeof _=="object"){for(B=arguments.length,x=new Array(B-1),C=1;C<B;++C)x[C-1]=arguments[C];for(_=_.slice(),C=0;k=_[C];++C)p.call(k,this,x)}else switch(arguments.length){case 1:h.call(_,this);break;case 2:h.call(_,this,arguments[1]);break;case 3:h.call(_,this,arguments[1],arguments[2]);break;default:for(B=arguments.length,x=new Array(B-1),C=1;C<B;++C)x[C-1]=arguments[C];p.call(_,this,x)}},l={on:r=function(w,C){var B;return f(C),v.call(this,"__ee__")?B=this.__ee__:(B=D.value=m(null),g(this,"__ee__",D),D.value=null),B[w]?typeof B[w]=="object"?B[w].push(C):B[w]=[B[w],C]:B[w]=C,this},once:o,off:i,emit:a},c={on:d(r),once:d(o),off:d(i),emit:d(a)},u=y({},c),t.exports=n=function(w){return w==null?m(u):y(Object(w),c)},n.methods=l})(Ci,Ci.exports)),Ci.exports),hm=qt(pm);function Gr(t){var n=ja.get(t);return n==null&&(n=hm(),ja.set(t,n)),n}var Yr=new WeakMap;function Zl(t,n){var r=Yr.get(t);r==null&&(r=new Set,Yr.set(t,r)),r.add(n)}var mm=function(t){var n=t;return n.on=function(r,o){var i=Gr(n);if(i.on(r,o),r==="destroyed"&&Zl(n,o),r!=="destroyed"){var a=function(){return i.off(r,o)};i.on("destroyed",a),Zl(n,a)}},n.once=function(r,o){Gr(n).once(r,o)},n.off=function(r,o){Gr(n).off(r,o)},n.emit=function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];var a=Gr(n);if(a.emit.apply(a,Be([r],$(o),!1)),r==="destroyed"){var l=(function(c){return Yr.get(c)||new Set})(n);l.forEach((function(c){return a.off("destroyed",c)})),(function(c){Yr.set(c,new Set)})(n)}},n};function gm(t){return gn(this,void 0,void 0,(function(){var n,r,o;return yn(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,fetch(t)];case 1:if(!(n=i.sent()).ok)throw new Error("Failed to fetch blob URL");return[4,n.blob()];case 2:return r=i.sent(),[2,new Promise((function(a,l){var c=new FileReader;c.onloadend=function(){a(c.result)},c.onerror=function(){l(new Error("Failed to read blob as data URL"))},c.readAsDataURL(r)}))];case 3:return o=i.sent(),console.error(o),[2,null];case 4:return[2]}}))}))}var ym=function(t){var n=t;return n.setFragmentData=function(r){var o=n.selection;if(o){var i=$(j.edges(o),2),a=i[0],l=i[1],c=b.void(n,{at:a.path}),u=b.void(n,{at:l.path});if(!j.isCollapsed(o)||c){var d=F.toDOMRange(n,o),f=d.cloneContents(),p=f.childNodes[0];if(f.childNodes.forEach((function(B){B.textContent&&B.textContent.trim()!==""&&(p=B)})),u){var h=$(u,1)[0],m=d.cloneRange(),g=F.toDOMNode(n,h);m.setEndAfter(g),f=m.cloneContents()}if(c&&(p=f.querySelector("[data-slate-spacer]")),Array.from(f.querySelectorAll("[data-slate-zero-width]")).forEach((function(B){var k=B.getAttribute("data-slate-zero-width")==="n";B.textContent=k?`
|
|
17
|
+
`:""})),$t(p)){var y=p.ownerDocument.createElement("span");y.style.whiteSpace="pre",y.appendChild(p),f.appendChild(y),p=y}var v=n.getFragment(),D=JSON.stringify(v),w=window.btoa(encodeURIComponent(D));p.setAttribute("data-slate-fragment",w),r.setData("application/x-slate-fragment",w);var C=f.ownerDocument.createElement("div");return C.appendChild(f),C.setAttribute("hidden","true"),f.ownerDocument.body.appendChild(C),r.setData("text/html",C.innerHTML),r.setData("text/plain",Ya(C)),f.ownerDocument.body.removeChild(C),r}}},n.insertData=function(r){return gn(void 0,void 0,void 0,(function(){var o,i,a,l,c,u,d,f,p,h,m,g,y,v,D;return yn(this,(function(w){switch(w.label){case 0:return(o=r.getData("application/x-slate-fragment"))?(i=decodeURIComponent(window.atob(o)),a=JSON.parse(i),n.insertFragment(a),[2]):(l=r.getData("text/plain"),c=r.getData("text/html"),wn?(u=(function(C){var B=C.match(/<img[^>]*src=["'](blob:[^"']+)["'][^>]*>/i);return B?B[1]:null})(c),u?[4,gm(u)]:[3,2]):[3,2]);case 1:(d=w.sent())&&(c='<img src="'.concat(d,'" alt="image.png">'),URL.revokeObjectURL(u)),w.label=2;case 2:if(c)return n.dangerouslyInsertHtml(c),[2];if(f=F.getLeftLengthOfMaxLength(n),l){p=l.split(/\n\r|\r\n|\r|\n/),h=!1;try{for(m=st(p),g=m.next();!g.done;g=m.next())y=g.value,h&&f>0&&O.splitNodes(n,{always:!0}),n.insertText(y),h=!0}catch(C){v={error:C}}finally{try{g&&!g.done&&(D=m.return)&&D.call(m)}finally{if(v)throw v.error}}}return[2]}}))}))},n},bm=function(t){var n=t,r=n.insertText,o=n.insertNode,i=n.insertFragment,a=n.dangerouslyInsertHtml;return n.insertText=function(l){if(n.getConfig().maxLength){var c=F.getLeftLengthOfMaxLength(n);c<=0||(c<l.length?r(l.slice(0,c)):r(l))}else r(l)},n.insertNode=function(l){if(n.getConfig().maxLength){var c=F.getLeftLengthOfMaxLength(n);c<=0||c<U.string(l).length||o(l)}else o(l)},n.insertFragment=function(l){if(n.getConfig().maxLength){if(l.length>0){var c=l[0];if(F.getLeftLengthOfMaxLength(n)<U.string(c).length)return;i([c]);for(var u=1;u<l.length;u+=1)n.insertNode(l[u])}}else i(l)},n.dangerouslyInsertHtml=function(l,c){if(l===void 0&&(l=""),c===void 0&&(c=!1),l)if(n.getConfig().maxLength){var u=F.getLeftLengthOfMaxLength(n);if(!(u<=0)){var d=document.createElement("div");d.innerHTML=l,u<Array.from(d.childNodes).reduce((function(f,p){var h=p.nodeName;return p?$t(p)?f+(p.textContent||""):ft(p)?La.has(h.toLowerCase())?f:f+(p.textContent||""):f:f}),"").length||a(l,c)}}else a(l,c)},n};function wi(t){var n=F.getTextarea(t).$textAreaContainer,r=n.width(),o=n.height(),i=n.offset();return{top:i.top,left:i.left,width:r,height:o}}function Bi(t){var n={top:"0",left:"0"},r=t.selection;if(r==null)return n;var o=wi(t);if(o==null)return n;var i=o.top,a=o.left,l=o.width,c=o.height,u=F.toDOMRange(t,r),d=u.getClientRects?u.getClientRects()[0]:null;if(d==null)return n;var f=d.height,p={},h=d.top-i,m=d.left-a;if(m>l/2){var g=l-m;p.right="".concat(g+5,"px")}else p.left="".concat(m+5,"px");if(h>c/2){var y=c-h;p.bottom="".concat(y+5,"px")}else{var v=h+f;v<0&&(v=0),p.top="".concat(v+5,"px")}return p}function xi(t,n,r){r===void 0&&(r="modal");var o={top:"0",left:"0"};if(t.selection==null)return o;var i=te.isElement(n)&&t.isVoid(n),a=te.isElement(n)&&t.isInline(n),l=wr.get(n);if(l==null)return o;var c=l.getBoundingClientRect(),u=c.top,d=c.left,f=c.height,p=c.width;if(i){var h=(function(x){var N=[];N.push(x);for(var T=0;N.length>0;){var M=N.pop();if(M==null||(T+=1)>1e4)break;var R=M.nodeName;if(M.nodeType===Tt.ELEMENT_NODE){var z=R.toLowerCase();if(W1.includes(z)||z==="iframe"||z==="video")return M;var W=M.children||[],Q=W.length;if(Q)for(var q=Q-1;q>=0;q-=1)N.push(W[q])}}return null})(l);if(h!=null){var m=h.getBoundingClientRect();u=m.top,f=m.height}}var g=wi(t);if(g==null)return o;var y=g.top,v=g.left,D=g.width,w=g.height,C={},B=u-y,k=d-v;if(r==="bar")return C.left="".concat(k,"px"),B>40?C.bottom="".concat(w-B+5,"px"):C.top="".concat(B+f+5,"px"),C;if(r==="modal"){if(i?a?k>(D-p)/2?C.right="".concat(D-k+5,"px"):C.left="".concat(k+p+5,"px"):C.left="20px":C.left="".concat(k,"px"),i)(_=B)<0&&(_=0),C.top="".concat(_,"px");else if(B>(w-f)/2)C.bottom="".concat(w-B+5,"px");else{var _;(_=B+f)<0&&(_=0),C.top="".concat(_+5,"px")}return C}throw new Error("type '".concat(r,"' is invalid"))}function ki(t,n){xt((function(){var r=wi(t);if(r!=null){var o,i=r.top,a=r.left,l=r.width,c=r.height,u=n.offset(),d=u.top,f=u.left,p=n.width(),h=n.height(),m=d-i,g=f-a,y=n.attr("style");if(y.indexOf("top")>=0&&(o=m+h-c)>0){var v=n.css("top"),D=parseInt(v.toString(),10)-o;D<0&&(D=0),n.css("top","".concat(D,"px"))}if(y.indexOf("bottom")>=0&&d<0){var w=n.css("bottom"),C=parseInt(w.toString(),10)-Math.abs(d);n.css("bottom","".concat(C,"px"))}if(y.indexOf("left")>=0&&(o=g+p-l)>0){var B=n.css("left"),k=parseInt(B.toString(),10)-o;k<0&&(k=0),n.css("left","".concat(k,"px"))}if(y.indexOf("right")>=0&&f<0){var _=n.css("right"),x=parseInt(_.toString(),10)-Math.abs(f);n.css("right","".concat(x,"px"))}}}))}var Ei,Xl,Cm=function(t){var n=t;return n.select=function(r){O.select(n,r)},n.deselect=function(){var r=n.selection,o=F.findDocumentOrShadowRoot(n).getSelection();o&&o.rangeCount>0&&o.removeAllRanges(),r&&O.deselect(t)},n.move=function(r,o){o===void 0&&(o=!1),r&&(r<0||O.move(t,{distance:r,unit:"character",reverse:o}))},n.moveReverse=function(r){n.move(r,!0)},n.restoreSelection=function(){var r=ri.get(n);r!=null&&(n.focus(),O.select(n,r))},n.getSelectionPosition=function(){return Bi(n)},n.getNodePosition=function(r){return xi(n,r)},n.isSelectedAll=function(){var r=n.selection;if(r==null)return!1;var o=$(j.edges(r),2),i=o[0],a=o[1],l=$(b.edges(n,[]),2),c=l[0],u=l[1];return!(!ye.equals(i,c)||!ye.equals(a,u))},n.selectAll=function(){var r=b.start(n,[]),o=b.end(n,[]);O.select(n,{anchor:r,focus:o})},n},vm=(function(){if(Xl)return Ei;Xl=1;var t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt,c=typeof Ke=="object"&&Ke&&Ke.Object===Object&&Ke,u=typeof self=="object"&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),f=Object.prototype.toString,p=Math.max,h=Math.min,m=function(){return d.Date.now()};function g(v){var D=typeof v;return!!v&&(D=="object"||D=="function")}function y(v){if(typeof v=="number")return v;if((function(C){return typeof C=="symbol"||(function(B){return!!B&&typeof B=="object"})(C)&&f.call(C)==n})(v))return t;if(g(v)){var D=typeof v.valueOf=="function"?v.valueOf():v;v=g(D)?D+"":D}if(typeof v!="string")return v===0?v:+v;v=v.replace(r,"");var w=i.test(v);return w||a.test(v)?l(v.slice(2),w?2:8):o.test(v)?t:+v}return Ei=function(v,D,w){var C,B,k,_,x,N,T=0,M=!1,R=!1,z=!0;if(typeof v!="function")throw new TypeError("Expected a function");function W(ie){var re=C,ne=B;return C=B=void 0,T=ie,_=v.apply(ne,re)}function Q(ie){var re=ie-N;return N===void 0||re>=D||re<0||R&&ie-T>=k}function q(){var ie=m();if(Q(ie))return J(ie);x=setTimeout(q,(function(re){var ne=D-(re-N);return R?h(ne,k-(re-T)):ne})(ie))}function J(ie){return x=void 0,z&&C?W(ie):(C=B=void 0,_)}function X(){var ie=m(),re=Q(ie);if(C=arguments,B=this,N=ie,re){if(x===void 0)return(function(ne){return T=ne,x=setTimeout(q,D),M?W(ne):_})(N);if(R)return x=setTimeout(q,D),W(N)}return x===void 0&&(x=setTimeout(q,D)),_}return D=y(D)||0,g(w)&&(M=!!w.leading,k=(R="maxWait"in w)?p(y(w.maxWait)||0,D):k,z="trailing"in w?!!w.trailing:z),X.cancel=function(){x!==void 0&&clearTimeout(x),T=0,C=N=B=x=void 0},X.flush=function(){return x===void 0?_:J(m())},X},Ei})(),Ql=qt(vm);const Dm={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,n){console&&console[t]&&console[t].apply(console,n)}};class Zr{constructor(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(n,r)}init(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||Dm,this.options=r,this.debug=r.debug}log(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"log","",!0)}warn(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"warn","",!0)}error(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"error","")}deprecate(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(n,r,o,i){return i&&!this.debug?null:(typeof n[0]=="string"&&(n[0]=`${o}${this.prefix} ${n[0]}`),this.logger[r](n))}create(n){return new Zr(this.logger,{prefix:`${this.prefix}:${n}:`,...this.options})}clone(n){return(n=n||this.options).prefix=n.prefix||this.prefix,new Zr(this.logger,n)}}var jt=new Zr;class Xr{constructor(){this.observers={}}on(n,r){return n.split(" ").forEach((o=>{this.observers[o]||(this.observers[o]=new Map);const i=this.observers[o].get(r)||0;this.observers[o].set(r,i+1)})),this}off(n,r){this.observers[n]&&(r?this.observers[n].delete(r):delete this.observers[n])}emit(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];this.observers[n]&&Array.from(this.observers[n].entries()).forEach((a=>{let[l,c]=a;for(let u=0;u<c;u++)l(...o)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((a=>{let[l,c]=a;for(let u=0;u<c;u++)l.apply(l,[n,...o])}))}}const Jn=()=>{let t,n;const r=new Promise(((o,i)=>{t=o,n=i}));return r.resolve=t,r.reject=n,r},ec=t=>t==null?"":""+t,wm=/###/g,tc=t=>t&&t.indexOf("###")>-1?t.replace(wm,"."):t,nc=t=>!t||typeof t=="string",Gn=(t,n,r)=>{const o=typeof n!="string"?n:n.split(".");let i=0;for(;i<o.length-1;){if(nc(t))return{};const a=tc(o[i]);!t[a]&&r&&(t[a]=new r),t=Object.prototype.hasOwnProperty.call(t,a)?t[a]:{},++i}return nc(t)?{}:{obj:t,k:tc(o[i])}},rc=(t,n,r)=>{const{obj:o,k:i}=Gn(t,n,Object);if(o!==void 0||n.length===1)return void(o[i]=r);let a=n[n.length-1],l=n.slice(0,n.length-1),c=Gn(t,l,Object);for(;c.obj===void 0&&l.length;)a=`${l[l.length-1]}.${a}`,l=l.slice(0,l.length-1),c=Gn(t,l,Object),c&&c.obj&&c.obj[`${c.k}.${a}`]!==void 0&&(c.obj=void 0);c.obj[`${c.k}.${a}`]=r},Qr=(t,n)=>{const{obj:r,k:o}=Gn(t,n);if(r)return r[o]},oc=(t,n,r)=>{for(const o in n)o!=="__proto__"&&o!=="constructor"&&(o in t?typeof t[o]=="string"||t[o]instanceof String||typeof n[o]=="string"||n[o]instanceof String?r&&(t[o]=n[o]):oc(t[o],n[o],r):t[o]=n[o]);return t},Bn=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Bm={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const xm=t=>typeof t=="string"?t.replace(/[&<>"'\/]/g,(n=>Bm[n])):t,km=[" ",",","?","!",";"],Em=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}(20),_i=function(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[n])return t[n];const o=n.split(r);let i=t;for(let a=0;a<o.length;){if(!i||typeof i!="object")return;let l,c="";for(let u=a;u<o.length;++u)if(u!==a&&(c+=r),c+=o[u],l=i[c],l!==void 0){if(["string","number","boolean"].indexOf(typeof l)>-1&&u<o.length-1)continue;a+=u-a+1;break}i=l}return i},eo=t=>t&&t.indexOf("_")>0?t.replace("_","-"):t;class ic extends Xr{constructor(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=n||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(n){this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}removeNamespaces(n){const r=this.options.ns.indexOf(n);r>-1&&this.options.ns.splice(r,1)}getResource(n,r,o){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,l=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;n.indexOf(".")>-1?c=n.split("."):(c=[n,r],o&&(Array.isArray(o)?c.push(...o):typeof o=="string"&&a?c.push(...o.split(a)):c.push(o)));const u=Qr(this.data,c);return!u&&!r&&!o&&n.indexOf(".")>-1&&(n=c[0],r=c[1],o=c.slice(2).join(".")),u||!l||typeof o!="string"?u:_i(this.data&&this.data[n]&&this.data[n][r],o,a)}addResource(n,r,o,i){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let c=[n,r];o&&(c=c.concat(l?o.split(l):o)),n.indexOf(".")>-1&&(c=n.split("."),i=r,r=c[1]),this.addNamespaces(r),rc(this.data,c,i),a.silent||this.emit("added",n,r,o,i)}addResources(n,r,o){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in o)(typeof o[a]=="string"||Array.isArray(o[a]))&&this.addResource(n,r,a,o[a],{silent:!0});i.silent||this.emit("added",n,r,o)}addResourceBundle(n,r,o,i,a){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},c=[n,r];n.indexOf(".")>-1&&(c=n.split("."),i=o,o=r,r=c[1]),this.addNamespaces(r);let u=Qr(this.data,c)||{};l.skipCopy||(o=JSON.parse(JSON.stringify(o))),i?oc(u,o,a):u={...u,...o},rc(this.data,c,u),l.silent||this.emit("added",n,r,o)}removeResourceBundle(n,r){this.hasResourceBundle(n,r)&&delete this.data[n][r],this.removeNamespaces(r),this.emit("removed",n,r)}hasResourceBundle(n,r){return this.getResource(n,r)!==void 0}getResourceBundle(n,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(n,r)}:this.getResource(n,r)}getDataByLanguage(n){return this.data[n]}hasLanguageSomeTranslations(n){const r=this.getDataByLanguage(n);return!!(r&&Object.keys(r)||[]).find((o=>r[o]&&Object.keys(r[o]).length>0))}toJSON(){return this.data}}var sc={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,n,r,o,i){return t.forEach((a=>{this.processors[a]&&(n=this.processors[a].process(n,r,o,i))})),n}};const ac={};class to extends Xr{constructor(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),((o,i,a)=>{o.forEach((l=>{i[l]&&(a[l]=i[l])}))})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=jt.create("translator")}changeLanguage(n){n&&(this.language=n)}exists(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(n==null)return!1;const o=this.resolve(n,r);return o&&o.res!==void 0}extractFromKey(n,r){let o=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const l=o&&n.indexOf(o)>-1,c=!(this.options.userDefinedKeySeparator||r.keySeparator||this.options.userDefinedNsSeparator||r.nsSeparator||((u,d,f)=>{d=d||"",f=f||"";const p=km.filter((g=>d.indexOf(g)<0&&f.indexOf(g)<0));if(p.length===0)return!0;const h=Em.getRegExp(`(${p.map((g=>g==="?"?"\\?":g)).join("|")})`);let m=!h.test(u);if(!m){const g=u.indexOf(f);g>0&&!h.test(u.substring(0,g))&&(m=!0)}return m})(n,o,i));if(l&&!c){const u=n.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:n,namespaces:a};const d=n.split(o);(o!==i||o===i&&this.options.ns.indexOf(d[0])>-1)&&(a=d.shift()),n=d.join(i)}return typeof a=="string"&&(a=[a]),{key:n,namespaces:a}}translate(n,r,o){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),n==null)return"";Array.isArray(n)||(n=[String(n)]);const i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(n[n.length-1],r),u=c[c.length-1],d=r.lng||this.language,f=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&d.toLowerCase()==="cimode"){if(f){const w=r.nsSeparator||this.options.nsSeparator;return i?{res:`${u}${w}${l}`,usedKey:l,exactUsedKey:l,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:`${u}${w}${l}`}return i?{res:l,usedKey:l,exactUsedKey:l,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:l}const p=this.resolve(n,r);let h=p&&p.res;const m=p&&p.usedKey||l,g=p&&p.exactUsedKey||l,y=Object.prototype.toString.apply(h),v=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject;if(D&&h&&typeof h!="string"&&typeof h!="boolean"&&typeof h!="number"&&["[object Number]","[object Function]","[object RegExp]"].indexOf(y)<0&&(typeof v!="string"||!Array.isArray(h))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const w=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,h,{...r,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return i?(p.res=w,p.usedParams=this.getUsedParamsDetails(r),p):w}if(a){const w=Array.isArray(h),C=w?[]:{},B=w?g:m;for(const k in h)if(Object.prototype.hasOwnProperty.call(h,k)){const _=`${B}${a}${k}`;C[k]=this.translate(_,{...r,joinArrays:!1,ns:c}),C[k]===_&&(C[k]=h[k])}h=C}}else if(D&&typeof v=="string"&&Array.isArray(h))h=h.join(v),h&&(h=this.extendTranslation(h,n,r,o));else{let w=!1,C=!1;const B=r.count!==void 0&&typeof r.count!="string",k=to.hasDefaultValue(r),_=B?this.pluralResolver.getSuffix(d,r.count,r):"",x=r.ordinal&&B?this.pluralResolver.getSuffix(d,r.count,{ordinal:!1}):"",N=B&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),T=N&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${_}`]||r[`defaultValue${x}`]||r.defaultValue;!this.isValidLookup(h)&&k&&(w=!0,h=T),this.isValidLookup(h)||(C=!0,h=l);const M=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&C?void 0:h,R=k&&T!==h&&this.options.updateMissing;if(C||w||R){if(this.logger.log(R?"updateKey":"missingKey",d,u,l,R?T:h),a){const q=this.resolve(l,{...r,keySeparator:!1});q&&q.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let z=[];const W=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&W&&W[0])for(let q=0;q<W.length;q++)z.push(W[q]);else this.options.saveMissingTo==="all"?z=this.languageUtils.toResolveHierarchy(r.lng||this.language):z.push(r.lng||this.language);const Q=(q,J,X)=>{const ie=k&&X!==h?X:M;this.options.missingKeyHandler?this.options.missingKeyHandler(q,u,J,ie,R,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(q,u,J,ie,R,r),this.emit("missingKey",q,u,J,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&B?z.forEach((q=>{const J=this.pluralResolver.getSuffixes(q,r);N&&r[`defaultValue${this.options.pluralSeparator}zero`]&&J.indexOf(`${this.options.pluralSeparator}zero`)<0&&J.push(`${this.options.pluralSeparator}zero`),J.forEach((X=>{Q([q],l+X,r[`defaultValue${X}`]||T)}))})):Q(z,l,T))}h=this.extendTranslation(h,n,r,p,o),C&&h===l&&this.options.appendNamespaceToMissingKey&&(h=`${u}:${l}`),(C||w)&&this.options.parseMissingKeyHandler&&(h=this.options.compatibilityAPI!=="v1"?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${l}`:l,w?h:void 0):this.options.parseMissingKeyHandler(h))}return i?(p.res=h,p.usedParams=this.getUsedParamsDetails(r),p):h}extendTranslation(n,r,o,i,a){var l=this;if(this.i18nFormat&&this.i18nFormat.parse)n=this.i18nFormat.parse(n,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const d=typeof n=="string"&&(o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const h=n.match(this.interpolator.nestingRegexp);f=h&&h.length}let p=o.replace&&typeof o.replace!="string"?o.replace:o;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),n=this.interpolator.interpolate(n,p,o.lng||this.language||i.usedLng,o),d){const h=n.match(this.interpolator.nestingRegexp);f<(h&&h.length)&&(o.nest=!1)}!o.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(o.lng=this.language||i.usedLng),o.nest!==!1&&(n=this.interpolator.nest(n,(function(){for(var h=arguments.length,m=new Array(h),g=0;g<h;g++)m[g]=arguments[g];return a&&a[0]===m[0]&&!o.context?(l.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${r[0]}`),null):l.translate(...m,r)}),o)),o.interpolation&&this.interpolator.reset()}const c=o.postProcess||this.options.postProcess,u=typeof c=="string"?[c]:c;return n!=null&&u&&u.length&&o.applyPostProcessor!==!1&&(n=sc.handle(u,n,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(o)},...o}:o,this)),n}resolve(n){let r,o,i,a,l,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return typeof n=="string"&&(n=[n]),n.forEach((u=>{if(this.isValidLookup(r))return;const d=this.extractFromKey(u,c),f=d.key;o=f;let p=d.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const h=c.count!==void 0&&typeof c.count!="string",m=h&&!c.ordinal&&c.count===0&&this.pluralResolver.shouldUseIntlApi(),g=c.context!==void 0&&(typeof c.context=="string"||typeof c.context=="number")&&c.context!=="",y=c.lngs?c.lngs:this.languageUtils.toResolveHierarchy(c.lng||this.language,c.fallbackLng);p.forEach((v=>{this.isValidLookup(r)||(l=v,!ac[`${y[0]}-${v}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(ac[`${y[0]}-${v}`]=!0,this.logger.warn(`key "${o}" for languages "${y.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach((D=>{if(this.isValidLookup(r))return;a=D;const w=[f];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(w,f,D,v,c);else{let B;h&&(B=this.pluralResolver.getSuffix(D,c.count,c));const k=`${this.options.pluralSeparator}zero`,_=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(w.push(f+B),c.ordinal&&B.indexOf(_)===0&&w.push(f+B.replace(_,this.options.pluralSeparator)),m&&w.push(f+k)),g){const x=`${f}${this.options.contextSeparator}${c.context}`;w.push(x),h&&(w.push(x+B),c.ordinal&&B.indexOf(_)===0&&w.push(x+B.replace(_,this.options.pluralSeparator)),m&&w.push(x+k))}}let C;for(;C=w.pop();)this.isValidLookup(r)||(i=C,r=this.getResource(D,v,C,c))})))}))})),{res:r,usedKey:o,exactUsedKey:i,usedLng:a,usedNS:l}}isValidLookup(n){return!(n===void 0||!this.options.returnNull&&n===null||!this.options.returnEmptyString&&n==="")}getResource(n,r,o){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(n,r,o,i):this.resourceStore.getResource(n,r,o,i)}getUsedParamsDetails(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=n.replace&&typeof n.replace!="string";let i=o?n.replace:n;if(o&&n.count!==void 0&&(i.count=n.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!o){i={...i};for(const a of r)delete i[a]}return i}static hasDefaultValue(n){const r="defaultValue";for(const o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&r===o.substring(0,12)&&n[o]!==void 0)return!0;return!1}}const Ai=t=>t.charAt(0).toUpperCase()+t.slice(1);class lc{constructor(n){this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=jt.create("languageUtils")}getScriptPartFromCode(n){if(!(n=eo(n))||n.indexOf("-")<0)return null;const r=n.split("-");return r.length===2?null:(r.pop(),r[r.length-1].toLowerCase()==="x"?null:this.formatLanguageCode(r.join("-")))}getLanguagePartFromCode(n){if(!(n=eo(n))||n.indexOf("-")<0)return n;const r=n.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(n){if(typeof n=="string"&&n.indexOf("-")>-1){const r=["hans","hant","latn","cyrl","cans","mong","arab"];let o=n.split("-");return this.options.lowerCaseLng?o=o.map((i=>i.toLowerCase())):o.length===2?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Ai(o[1].toLowerCase()))):o.length===3&&(o[0]=o[0].toLowerCase(),o[1].length===2&&(o[1]=o[1].toUpperCase()),o[0]!=="sgn"&&o[2].length===2&&(o[2]=o[2].toUpperCase()),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Ai(o[1].toLowerCase())),r.indexOf(o[2].toLowerCase())>-1&&(o[2]=Ai(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}isSupportedCode(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}getBestMatchFromCodes(n){if(!n)return null;let r;return n.forEach((o=>{if(r)return;const i=this.formatLanguageCode(o);this.options.supportedLngs&&!this.isSupportedCode(i)||(r=i)})),!r&&this.options.supportedLngs&&n.forEach((o=>{if(r)return;const i=this.getLanguagePartFromCode(o);if(this.isSupportedCode(i))return r=i;r=this.options.supportedLngs.find((a=>a===i?a:a.indexOf("-")<0&&i.indexOf("-")<0?void 0:a.indexOf("-")>0&&i.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===i||a.indexOf(i)===0&&i.length>1?a:void 0))})),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Array.isArray(n))return n;if(!r)return n.default||[];let o=n[r];return o||(o=n[this.getScriptPartFromCode(r)]),o||(o=n[this.formatLanguageCode(r)]),o||(o=n[this.getLanguagePartFromCode(r)]),o||(o=n.default),o||[]}toResolveHierarchy(n,r){const o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),i=[],a=l=>{l&&(this.isSupportedCode(l)?i.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return typeof n=="string"&&(n.indexOf("-")>-1||n.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),o.forEach((l=>{i.indexOf(l)<0&&a(this.formatLanguageCode(l))})),i}}let _m=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Am={1:t=>+(t>1),2:t=>+(t!=1),3:t=>0,4:t=>t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,5:t=>t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5,6:t=>t==1?0:t>=2&&t<=4?1:2,7:t=>t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,8:t=>t==1?0:t==2?1:t!=8&&t!=11?2:3,9:t=>+(t>=2),10:t=>t==1?0:t==2?1:t<7?2:t<11?3:4,11:t=>t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3,12:t=>+(t%10!=1||t%100==11),13:t=>+(t!==0),14:t=>t==1?0:t==2?1:t==3?2:3,15:t=>t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2,16:t=>t%10==1&&t%100!=11?0:t!==0?1:2,17:t=>t==1||t%10==1&&t%100!=11?0:1,18:t=>t==0?0:t==1?1:2,19:t=>t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3,20:t=>t==1?0:t==0||t%100>0&&t%100<20?1:2,21:t=>t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0,22:t=>t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3};const Nm=["v1","v2","v3"],Sm=["v4"],cc={zero:0,one:1,two:2,few:3,many:4,other:5};class Fm{constructor(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=n,this.options=r,this.logger=jt.create("pluralResolver"),this.options.compatibilityJSON&&!Sm.includes(this.options.compatibilityJSON)||typeof Intl<"u"&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(()=>{const o={};return _m.forEach((i=>{i.lngs.forEach((a=>{o[a]={numbers:i.nr,plurals:Am[i.fc]}}))})),o})(),this.pluralRulesCache={}}addRule(n,r){this.rules[n]=r}clearCache(){this.pluralRulesCache={}}getRule(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const o=eo(n==="dev"?"en":n),i=r.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:o,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];const l=new Intl.PluralRules(o,{type:i});return this.pluralRulesCache[a]=l,l}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}needsPlural(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o=this.getRule(n,r);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}getPluralFormsOfKey(n,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,o).map((i=>`${r}${i}`))}getSuffixes(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o=this.getRule(n,r);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(((i,a)=>cc[i]-cc[a])).map((i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`)):o.numbers.map((i=>this.getSuffix(n,i,r))):[]}getSuffix(n,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(n,o);return i?this.shouldUseIntlApi()?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:this.getSuffixRetroCompatible(i,r):(this.logger.warn(`no plural rule found for: ${n}`),"")}getSuffixRetroCompatible(n,r){const o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r));let i=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const a=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}shouldUseIntlApi(){return!Nm.includes(this.options.compatibilityJSON)}}const uc=function(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],a=((l,c,u)=>{const d=Qr(l,u);return d!==void 0?d:Qr(c,u)})(t,n,r);return!a&&i&&typeof r=="string"&&(a=_i(t,r,o),a===void 0&&(a=_i(n,r,o))),a},Ni=t=>t.replace(/\$/g,"$$$$");class Vm{constructor(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=jt.create("interpolator"),this.options=n,this.format=n.interpolation&&n.interpolation.format||(r=>r),this.init(n)}init(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});const{escape:r,escapeValue:o,useRawValueToEscape:i,prefix:a,prefixEscaped:l,suffix:c,suffixEscaped:u,formatSeparator:d,unescapeSuffix:f,unescapePrefix:p,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:g,nestingSuffixEscaped:y,nestingOptionsSeparator:v,maxReplaces:D,alwaysFormat:w}=n.interpolation;this.escape=r!==void 0?r:xm,this.escapeValue=o===void 0||o,this.useRawValueToEscape=i!==void 0&&i,this.prefix=a?Bn(a):l||"{{",this.suffix=c?Bn(c):u||"}}",this.formatSeparator=d||",",this.unescapePrefix=f?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=h?Bn(h):m||Bn("$t("),this.nestingSuffix=g?Bn(g):y||Bn(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=D||1e3,this.alwaysFormat=w!==void 0&&w,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const n=(r,o)=>r&&r.source===o?(r.lastIndex=0,r):new RegExp(o,"g");this.regexp=n(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=n(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=n(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(n,r,o,i){let a,l,c;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=m=>{if(m.indexOf(this.formatSeparator)<0){const D=uc(r,u,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(D,void 0,o,{...i,...r,interpolationkey:m}):D}const g=m.split(this.formatSeparator),y=g.shift().trim(),v=g.join(this.formatSeparator).trim();return this.format(uc(r,u,y,this.options.keySeparator,this.options.ignoreJSONStructure),v,o,{...i,...r,interpolationkey:y})};this.resetRegExp();const f=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,p=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>Ni(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?Ni(this.escape(m)):Ni(m)}].forEach((m=>{for(c=0;a=m.regex.exec(n);){const g=a[1].trim();if(l=d(g),l===void 0)if(typeof f=="function"){const v=f(n,a,i);l=typeof v=="string"?v:""}else if(i&&Object.prototype.hasOwnProperty.call(i,g))l="";else{if(p){l=a[0];continue}this.logger.warn(`missed to pass in variable ${g} for interpolating ${n}`),l=""}else typeof l=="string"||this.useRawValueToEscape||(l=ec(l));const y=m.safeValue(l);if(n=n.replace(a[0],y),p?(m.regex.lastIndex+=l.length,m.regex.lastIndex-=a[0].length):m.regex.lastIndex=0,c++,c>=this.maxReplaces)break}})),n}nest(n,r){let o,i,a,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const c=(u,d)=>{const f=this.nestingOptionsSeparator;if(u.indexOf(f)<0)return u;const p=u.split(new RegExp(`${f}[ ]*{`));let h=`{${p[1]}`;u=p[0],h=this.interpolate(h,a);const m=h.match(/'/g),g=h.match(/"/g);(m&&m.length%2==0&&!g||g.length%2!=0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),d&&(a={...d,...a})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,y),`${u}${f}${h}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,u};for(;o=this.nestingRegexp.exec(n);){let u=[];a={...l},a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let d=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const f=o[1].split(this.formatSeparator).map((p=>p.trim()));o[1]=f.shift(),u=f,d=!0}if(i=r(c.call(this,o[1].trim(),a),a),i&&o[0]===n&&typeof i!="string")return i;typeof i!="string"&&(i=ec(i)),i||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${n}`),i=""),d&&(i=u.reduce(((f,p)=>this.format(f,p,l.lng,{...l,interpolationkey:o[1].trim()})),i.trim())),n=n.replace(o[0],i),this.regexp.lastIndex=0}return n}}const xn=t=>{const n={};return(r,o,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const l=o+JSON.stringify(a);let c=n[l];return c||(c=t(eo(o),i),n[l]=c),c(r)}};class Om{constructor(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=jt.create("formatter"),this.options=n,this.formats={number:xn(((r,o)=>{const i=new Intl.NumberFormat(r,{...o});return a=>i.format(a)})),currency:xn(((r,o)=>{const i=new Intl.NumberFormat(r,{...o,style:"currency"});return a=>i.format(a)})),datetime:xn(((r,o)=>{const i=new Intl.DateTimeFormat(r,{...o});return a=>i.format(a)})),relativetime:xn(((r,o)=>{const i=new Intl.RelativeTimeFormat(r,{...o});return a=>i.format(a,o.range||"day")})),list:xn(((r,o)=>{const i=new Intl.ListFormat(r,{...o});return a=>i.format(a)}))},this.init(n)}init(n){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(n,r){this.formats[n.toLowerCase().trim()]=r}addCached(n,r){this.formats[n.toLowerCase().trim()]=xn(r)}format(n,r,o){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=r.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find((c=>c.indexOf(")")>-1))){const c=a.findIndex((u=>u.indexOf(")")>-1));a[0]=[a[0],...a.splice(1,c)].join(this.formatSeparator)}return a.reduce(((c,u)=>{const{formatName:d,formatOptions:f}=(p=>{let h=p.toLowerCase().trim();const m={};if(p.indexOf("(")>-1){const g=p.split("(");h=g[0].toLowerCase().trim();const y=g[1].substring(0,g[1].length-1);h==="currency"&&y.indexOf(":")<0?m.currency||(m.currency=y.trim()):h==="relativetime"&&y.indexOf(":")<0?m.range||(m.range=y.trim()):y.split(";").forEach((v=>{if(v){const[D,...w]=v.split(":"),C=w.join(":").trim().replace(/^'+|'+$/g,""),B=D.trim();m[B]||(m[B]=C),C==="false"&&(m[B]=!1),C==="true"&&(m[B]=!0),isNaN(C)||(m[B]=parseInt(C,10))}}))}return{formatName:h,formatOptions:m}})(u);if(this.formats[d]){let p=c;try{const h=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},m=h.locale||h.lng||i.locale||i.lng||o;p=this.formats[d](c,m,{...f,...i,...h})}catch(h){this.logger.warn(h)}return p}return this.logger.warn(`there was no format function for ${d}`),c}),n)}}class Tm extends Xr{constructor(n,r,o){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=n,this.store=r,this.services=o,this.languageUtils=o.languageUtils,this.options=i,this.logger=jt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(o,i.backend,i)}queueLoad(n,r,o,i){const a={},l={},c={},u={};return n.forEach((d=>{let f=!0;r.forEach((p=>{const h=`${d}|${p}`;!o.reload&&this.store.hasResourceBundle(d,p)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?l[h]===void 0&&(l[h]=!0):(this.state[h]=1,f=!1,l[h]===void 0&&(l[h]=!0),a[h]===void 0&&(a[h]=!0),u[p]===void 0&&(u[p]=!0)))})),f||(c[d]=!0)})),(Object.keys(a).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(l),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(u)}}loaded(n,r,o){const i=n.split("|"),a=i[0],l=i[1];r&&this.emit("failedLoading",a,l,r),!r&&o&&this.store.addResourceBundle(a,l,o,void 0,void 0,{skipCopy:!0}),this.state[n]=r?-1:2,r&&o&&(this.state[n]=0);const c={};this.queue.forEach((u=>{((d,f,p)=>{const{obj:h,k:m}=Gn(d,f,Object);h[m]=h[m]||[],h[m].push(p)})(u.loaded,[a],l),((d,f)=>{d.pending[f]!==void 0&&(delete d.pending[f],d.pendingCount--)})(u,n),r&&u.errors.push(r),u.pendingCount!==0||u.done||(Object.keys(u.loaded).forEach((d=>{c[d]||(c[d]={});const f=u.loaded[d];f.length&&f.forEach((p=>{c[d][p]===void 0&&(c[d][p]=!0)}))})),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())})),this.emit("loaded",c),this.queue=this.queue.filter((u=>!u.done))}read(n,r,o){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,l=arguments.length>5?arguments[5]:void 0;if(!n.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:n,ns:r,fcName:o,tried:i,wait:a,callback:l});this.readingCalls++;const c=(d,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}d&&f&&i<this.maxRetries?setTimeout((()=>{this.read.call(this,n,r,o,i+1,2*a,l)}),a):l(d,f)},u=this.backend[o].bind(this.backend);if(u.length!==2)return u(n,r,c);try{const d=u(n,r);d&&typeof d.then=="function"?d.then((f=>c(null,f))).catch(c):c(null,d)}catch(d){c(d)}}prepareLoading(n,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();typeof n=="string"&&(n=this.languageUtils.toResolveHierarchy(n)),typeof r=="string"&&(r=[r]);const a=this.queueLoad(n,r,o,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach((l=>{this.loadOne(l)}))}load(n,r,o){this.prepareLoading(n,r,{},o)}reload(n,r,o){this.prepareLoading(n,r,{reload:!0},o)}loadOne(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const o=n.split("|"),i=o[0],a=o[1];this.read(i,a,"read",void 0,void 0,((l,c)=>{l&&this.logger.warn(`${r}loading namespace ${a} for language ${i} failed`,l),!l&&c&&this.logger.log(`${r}loaded namespace ${a} for language ${i}`,c),this.loaded(n,l,c)}))}saveMissing(n,r,o,i,a){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r))this.logger.warn(`did not save key "${o}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(o!=null&&o!==""){if(this.backend&&this.backend.create){const u={...l,isUpdate:a},d=this.backend.create.bind(this.backend);if(d.length<6)try{let f;f=d.length===5?d(n,r,o,i,u):d(n,r,o,i),f&&typeof f.then=="function"?f.then((p=>c(null,p))).catch(c):c(null,f)}catch(f){c(f)}else d(n,r,o,i,c,u)}n&&n[0]&&this.store.addResource(n[0],r,o,i)}}}const dc=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let n={};if(typeof t[1]=="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach((o=>{n[o]=r[o]}))}return n},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),fc=t=>(typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),no=()=>{};class Yn extends Xr{constructor(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;var o;if(super(),this.options=fc(n),this.services={},this.logger=jt,this.modules={external:[]},o=this,Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach((i=>{typeof o[i]=="function"&&(o[i]=o[i].bind(o))})),r&&!this.isInitialized&&!n.isClone){if(!this.options.initImmediate)return this.init(n,r),this;setTimeout((()=>{this.init(n,r)}),0)}}init(){var n=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof r=="function"&&(o=r,r={}),!r.defaultNS&&r.defaultNS!==!1&&r.ns&&(typeof r.ns=="string"?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const i=dc();this.options={...i,...this.options,...fc(r)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);const a=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){let u;this.modules.logger?jt.init(a(this.modules.logger),this.options):jt.init(null,this.options),this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=Om);const d=new lc(this.options);this.store=new ic(this.options.resources,this.options);const f=this.services;f.logger=jt,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new Fm(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!u||this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format||(f.formatter=a(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Vm(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Tm(a(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(function(p){for(var h=arguments.length,m=new Array(h>1?h-1:0),g=1;g<h;g++)m[g-1]=arguments[g];n.emit(p,...m)})),this.modules.languageDetector&&(f.languageDetector=a(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=a(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new to(this.services,this.options),this.translator.on("*",(function(p){for(var h=arguments.length,m=new Array(h>1?h-1:0),g=1;g<h;g++)m[g-1]=arguments[g];n.emit(p,...m)})),this.modules.external.forEach((p=>{p.init&&p.init(this)}))}if(this.format=this.options.interpolation.format,o||(o=no),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((u=>{this[u]=function(){return n.store[u](...arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((u=>{this[u]=function(){return n.store[u](...arguments),n}}));const l=Jn(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),o(d,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),l}loadResources(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:no;const o=typeof n=="string"?n:this.language;if(typeof n=="function"&&(r=n),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const i=[],a=l=>{l&&l!=="cimode"&&this.services.languageUtils.toResolveHierarchy(l).forEach((c=>{c!=="cimode"&&i.indexOf(c)<0&&i.push(c)}))};o?a(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((l=>a(l))),this.options.preload&&this.options.preload.forEach((l=>a(l))),this.services.backendConnector.load(i,this.options.ns,(l=>{l||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),r(l)}))}else r(null)}reloadResources(n,r,o){const i=Jn();return typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=void 0),n||(n=this.languages),r||(r=this.options.ns),o||(o=no),this.services.backendConnector.reload(n,r,(a=>{i.resolve(),o(a)})),i}use(n){if(!n)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!n.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return n.type==="backend"&&(this.modules.backend=n),(n.type==="logger"||n.log&&n.warn&&n.error)&&(this.modules.logger=n),n.type==="languageDetector"&&(this.modules.languageDetector=n),n.type==="i18nFormat"&&(this.modules.i18nFormat=n),n.type==="postProcessor"&&sc.addPostProcessor(n),n.type==="formatter"&&(this.modules.formatter=n),n.type==="3rdParty"&&this.modules.external.push(n),this}setResolvedLanguage(n){if(n&&this.languages&&!(["cimode","dev"].indexOf(n)>-1))for(let r=0;r<this.languages.length;r++){const o=this.languages[r];if(!(["cimode","dev"].indexOf(o)>-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}}changeLanguage(n,r){var o=this;this.isLanguageChangingTo=n;const i=Jn();this.emit("languageChanging",n);const a=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},l=(u,d)=>{d?(a(d),this.translator.changeLanguage(d),this.isLanguageChangingTo=void 0,this.emit("languageChanged",d),this.logger.log("languageChanged",d)):this.isLanguageChangingTo=void 0,i.resolve((function(){return o.t(...arguments)})),r&&r(u,(function(){return o.t(...arguments)}))},c=u=>{n||u||!this.services.languageDetector||(u=[]);const d=typeof u=="string"?u:this.services.languageUtils.getBestMatchFromCodes(u);d&&(this.language||a(d),this.translator.language||this.translator.changeLanguage(d),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(d)),this.loadResources(d,(f=>{l(f,d)}))};return n||!this.services.languageDetector||this.services.languageDetector.async?!n&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(n):c(this.services.languageDetector.detect()),i}getFixedT(n,r,o){var i=this;const a=function(l,c){let u;if(typeof c!="object"){for(var d=arguments.length,f=new Array(d>2?d-2:0),p=2;p<d;p++)f[p-2]=arguments[p];u=i.options.overloadTranslationOptionHandler([l,c].concat(f))}else u={...c};u.lng=u.lng||a.lng,u.lngs=u.lngs||a.lngs,u.ns=u.ns||a.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||o||a.keyPrefix);const h=i.options.keySeparator||".";let m;return m=u.keyPrefix&&Array.isArray(l)?l.map((g=>`${u.keyPrefix}${h}${g}`)):u.keyPrefix?`${u.keyPrefix}${h}${l}`:l,i.t(m,u)};return typeof n=="string"?a.lng=n:a.lngs=n,a.ns=r,a.keyPrefix=o,a}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(n){this.options.defaultNS=n}hasLoadedNamespace(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const o=r.lng||this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,a=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;const l=(c,u)=>{const d=this.services.backendConnector.state[`${c}|${u}`];return d===-1||d===0||d===2};if(r.precheck){const c=r.precheck(this,l);if(c!==void 0)return c}return!!this.hasResourceBundle(o,n)||!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!l(o,n)||i&&!l(a,n))}loadNamespaces(n,r){const o=Jn();return this.options.ns?(typeof n=="string"&&(n=[n]),n.forEach((i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)})),this.loadResources((i=>{o.resolve(),r&&r(i)})),o):(r&&r(),Promise.resolve())}loadLanguages(n,r){const o=Jn();typeof n=="string"&&(n=[n]);const i=this.options.preload||[],a=n.filter((l=>i.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l)));return a.length?(this.options.preload=i.concat(a),this.loadResources((l=>{o.resolve(),r&&r(l)})),o):(r&&r(),Promise.resolve())}dir(n){if(n||(n=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!n)return"rtl";const r=this.services&&this.services.languageUtils||new lc(dc());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(r.getLanguagePartFromCode(n))>-1||n.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new Yn(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:no;const o=n.forkResourceStore;o&&delete n.forkResourceStore;const i={...this.options,...n,isClone:!0},a=new Yn(i);return n.debug===void 0&&n.prefix===void 0||(a.logger=a.logger.clone(n)),["store","services","language"].forEach((l=>{a[l]=this[l]})),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},o&&(a.store=new ic(this.store.data,i),a.services.resourceStore=a.store),a.translator=new to(a.services,i),a.translator.on("*",(function(l){for(var c=arguments.length,u=new Array(c>1?c-1:0),d=1;d<c;d++)u[d-1]=arguments[d];a.emit(l,...u)})),a.init(i,r),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const He=Yn.createInstance();He.createInstance=Yn.createInstance,He.createInstance,He.dir,He.init,He.loadResources,He.reloadResources,He.use,He.changeLanguage,He.getFixedT,He.t,He.exists,He.setDefaultNamespace,He.hasLoadedNamespace,He.loadNamespaces,He.loadLanguages;function kn(t,n){He.addResourceBundle(t,"translation",n,!0,!0)}function pc(t){return He.on("languageChanged",t),function(){return He.off("languageChanged",t)}}He.init({lng:"zh-CN",resources:{}});var ae=He.t.bind(He);function ro(t){if(t.removeAttr){t.removeAttr("width"),t.removeAttr("height"),t.removeAttr("fill"),t.removeAttr("class"),t.removeAttr("t"),t.removeAttr("p-id");var n=t.children();n.length&&ro(n)}}function Si(){return V('<svg viewBox="0 0 1024 1024"><path d="M498.7 655.8l-197.6-268c-8.1-10.9-0.3-26.4 13.3-26.4h395.2c13.6 0 21.4 15.4 13.3 26.4l-197.6 268c-6.6 9-20 9-26.6 0z"></path></svg>')}function hc(){return V('<div class="w-e-bar-divider"></div>')}function Fi(t,n,r,o,i){if(o===void 0&&(o=""),i===void 0&&(i=!1),n){if(o){var a=pi?"cmd":"ctrl";o=o.replace("mod",a)}if(i)o&&(t.attr("data-tooltip",o),t.addClass("w-e-menu-tooltip-v5"),t.addClass("tooltip-right"));else{var l=o?"".concat(r,`
|
|
18
|
+
`).concat(o):r;t.attr("data-tooltip",l),t.addClass("w-e-menu-tooltip-v5")}}}var Vi=(function(){function t(n,r,o){o===void 0&&(o=!1);var i=this;this.$elem=V('<div class="w-e-bar-item"></div>'),this.$button=V('<button type="button"></button>'),this.disabled=!1,this.menu=r;var a=r.tag,l=r.width;if(a!=="button")throw new Error("Invalid tag '".concat(a,"', expected 'button'"));var c=r.title,u=r.hotkey,d=u===void 0?"":u,f=r.iconSvg,p=f===void 0?"":f,h=this.$button;if(p){var m=V(p);ro(m),h.append(m)}else h.text(c);Fi(h,p,c,d,o),o&&p&&h.append(V('<span class="title">'.concat(c,"</span>"))),l&&h.css("width","".concat(l,"px")),h.attr("data-menu-key",n),this.$elem.append(h),xt((function(){return i.init()}))}return t.prototype.init=function(){var n=this;this.setActive(),this.setDisabled(),this.$button.on("click",(function(r){r.preventDefault(),pt(n).hidePanelOrModal(),n.disabled||(n.exec(),n.onButtonClick())}))},t.prototype.exec=function(){var n=pt(this),r=this.menu,o=r.getValue(n);this.setIcon(),this.setTooltip(),r.exec(n,o)},t.prototype.setActive=function(){var n=pt(this),r=this.$button,o="active";this.menu.isActive(n)?r.addClass(o):r.removeClass(o)},t.prototype.setDisabled=function(){var n=pt(this),r=this.$button,o=this.menu.isDisabled(n);(n.selection==null||n.isDisabled())&&(o=!0),this.menu.alwaysEnable&&(o=!1);var i="disabled";o?r.addClass(i):r.removeClass(i),this.disabled=o},t.prototype.setIcon=function(){var n=pt(this),r=this.$button;if(this.menu.getIcon){var o=this.menu.getIcon(n);if(o){r.find("svg").remove();var i=V(o);ro(i),r.append(i)}}},t.prototype.setTooltip=function(){var n=pt(this),r=this.$button;if(this.menu.getTitle){var o=this.menu.getTitle(n),i=this.menu.iconSvg;o&&i&&Fi(r,i,o)}},t.prototype.changeMenuState=function(){this.setActive(),this.setDisabled()},t})(),jm=(function(t){function n(r,o,i){return i===void 0&&(i=!1),t.call(this,r,o,i)||this}return ve(n,t),n.prototype.onButtonClick=function(){},n})(Vi),Oi=(function(){function t(n){this.isShow=!1,this.showTime=0,this.record(n)}return t.prototype.record=function(n){var r=ei.get(n);r==null&&(r=new Set,ei.set(n,r)),r.add(this),vr.set(this,n)},t.prototype.renderContent=function(n){var r=this.$elem;r.empty(),r.append(n);var o=this.genSelfElem();o&&r.append(o)},t.prototype.appendTo=function(n){var r=this.$elem;n.append(r)},t.prototype.show=function(){if(!this.isShow){this.showTime=Date.now(),this.$elem.show(),this.isShow=!0;var n=vr.get(this);n&&n.emit("modalOrPanelShow",this)}},t.prototype.hide=function(){if(this.isShow&&!(Date.now()-this.showTime<200)){this.$elem.hide(),this.isShow=!1;var n=vr.get(this);n&&n.emit("modalOrPanelHide")}},t})(),Lm=(function(t){function n(r){var o=t.call(this,r)||this;return o.type="dropPanel",o.$elem=V('<div class="w-e-drop-panel"></div>'),o}return ve(n,t),n.prototype.genSelfElem=function(){return null},n})(Oi),Pm=(function(t){function n(r,o,i){i===void 0&&(i=!1);var a=t.call(this,r,o,i)||this;if(a.dropPanel=null,a.menu=o,o.showDropPanel){var l=Si();a.$button.append(l)}return a}return ve(n,t),n.prototype.onButtonClick=function(){this.menu.showDropPanel&&this.handleDropPanel()},n.prototype.handleDropPanel=function(){var r=this.menu;if(r.getPanelContentElem!=null){var o=pt(this);if(this.dropPanel==null){var i=new Lm(o),a=r.getPanelContentElem(o);i.renderContent(a),i.appendTo(this.$elem),i.show(),this.dropPanel=i}else{var l=this.dropPanel;l.isShow?l.hide():(a=r.getPanelContentElem(o),l.renderContent(a),l.show())}var c=this.dropPanel;if(c.isShow){var u=this.$elem,d=u.offset().left,f=u.parents(".w-e-bar");d-f.offset().left>=f.width()/2?c.$elem.css({left:"none",right:"0"}):c.$elem.css({left:"0",right:"none"})}}},n})(Vi),Mm=(function(t){function n(r,o){o===void 0&&(o=0);var i=t.call(this,r)||this;i.type="modal",i.$elem=V('<div class="w-e-modal"></div>'),i.width=0,o&&(i.width=o);var a=i.$elem;return a.on("click",(function(l){return l.stopPropagation()})),a.on("keyup",(function(l){l.code==="Escape"&&(i.hide(),r.restoreSelection())})),i}return ve(n,t),n.prototype.genSelfElem=function(){var r=this,o=V('<span class="btn-close">'.concat('<svg viewBox="0 0 1024 1024"><path d="M1024 896.1024l-128 128L512 640 128 1024 0 896 384 512 0 128 128 0 512 384 896.1024 0l128 128L640 512z"></path></svg>',"</span>")),i=vr.get(this);return o.on("click",(function(){r.hide(),i?.restoreSelection()})),o},n.prototype.setStyle=function(r){var o=this.width,i=this.$elem;i.attr("style",""),o&&i.css("width","".concat(o,"px")),i.css(r)},n})(Oi);function Ti(t,n,r){var o=V('<label class="babel-container"></label>');o.append("<span>".concat(t,"</span>"));var i=V('<input type="text" id="'.concat(n,'" placeholder="').concat("",'">'));return o.append(i),[o[0],i[0]]}function mc(t,n){var r=V('<div class="button-container"></div>'),o=V('<button type="button" id="'.concat(t,'">').concat(n,"</button>"));return r.append(o),[r[0],o[0]]}var zm=(function(t){function n(r,o,i){i===void 0&&(i=!1);var a=t.call(this,r,o,i)||this;return a.$body=V("body"),a.modal=null,a.menu=o,a}return ve(n,t),n.prototype.onButtonClick=function(){this.menu.showModal&&this.handleModal()},n.prototype.getPosition=function(){var r=pt(this),o=this.menu.getModalPositionNode(r);return te.isElement(o)?xi(r,o,"modal"):Bi(r)},n.prototype.handleModal=function(){var r=pt(this),o=this.menu;if(this.modal==null){var i=new Mm(r,o.modalWidth);this.renderAndShowModal(i,!0),this.modal=i}else(i=this.modal).isShow?i.hide():this.renderAndShowModal(i,!1)},n.prototype.renderAndShowModal=function(r,o){o===void 0&&(o=!1);var i=pt(this),a=this.menu;if(a.getModalContentElem!=null){var l=F.getTextarea(i),c=F.getToolbar(i),u=(c?.getConfig()||{}).modalAppendToBody,d=a.getModalContentElem(i);if(r.renderContent(d),u)r.setStyle({left:"0",right:"0"});else{var f=this.getPosition();r.setStyle(f)}o&&(u?r.appendTo(this.$body):r.appendTo(l.$textAreaContainer)),r.show(),u||ki(i,r.$elem),setTimeout((function(){i.blur()}))}},n})(Vi),$m=(function(t){function n(r,o){var i=t.call(this,r)||this;return i.type="selectList",i.$elem=V('<div class="w-e-select-list"></div>'),o&&i.$elem.css("width","".concat(o,"px")),i.$elem.on("click",(function(a){a.stopPropagation()})),i}return ve(n,t),n.prototype.renderList=function(r){var o=this.$elem;o.empty();var i=V("<ul></ul>");r.forEach((function(a){var l=a.value,c=a.text,u=a.selected,d=a.styleForRenderMenuList,f=V('<li data-value="'.concat(l,'"></li>'));if(d&&f.css(d),u){var p=V('<svg viewBox="0 0 1446 1024"><path d="M574.116299 786.736392 1238.811249 48.517862C1272.390222 11.224635 1329.414799 7.827718 1366.75664 41.450462 1403.840015 74.840484 1406.731043 132.084741 1373.10189 169.433699L655.118888 966.834607C653.072421 969.716875 650.835807 972.514337 648.407938 975.210759 615.017957 1012.29409 558.292155 1015.652019 521.195664 982.250188L72.778218 578.493306C35.910826 545.297758 32.859041 488.584019 66.481825 451.242134 99.871807 414.158803 156.597563 410.800834 193.694055 444.202665L574.116299 786.736392Z"></path></svg>');f.append(p),f.addClass("selected")}f.append(V('<span data-value="'.concat(l,'">').concat(c,"</span>"))),f.attr("title",c),i.append(f)})),o.append(i)},n.prototype.genSelfElem=function(){return null},n})(Oi),Im=(function(){function t(n,r,o){o===void 0&&(o=!1);var i=this;this.$elem=V('<div class="w-e-bar-item"></div>'),this.$button=V('<button type="button" class="select-button"></button>'),this.disabled=!1,this.selectList=null;var a=r.tag,l=r.title,c=r.width,u=r.iconSvg,d=u===void 0?"":u,f=r.hotkey,p=f===void 0?"":f;if(a!=="select")throw new Error("Invalid tag '".concat(a,"', expected 'select'"));var h=this.$button;c&&h.css("width","".concat(c,"px")),h.attr("data-menu-key",n),Fi(h,d,l,p,o),this.$elem.append(h),this.menu=r,xt((function(){return i.init()}))}return t.prototype.init=function(){var n=this;this.setSelectedValue(),this.$button.on("click",(function(r){r.preventDefault(),pt(n).hidePanelOrModal(),n.trigger()}))},t.prototype.trigger=function(){var n=this,r=pt(this);if(!r.isDisabled()&&!this.disabled){var o=this.menu;if(this.selectList==null){this.selectList=new $m(r,o.selectPanelWidth);var i=this.selectList,a=o.getOptions(r);i.renderList(a),i.appendTo(this.$elem),i.show(),i.$elem.on("click","li",(function(l){var c=l.target;if(c!=null){l.preventDefault();var u=V(c).attr("data-value");n.onChange(u)}}))}else(i=this.selectList).isShow?i.hide():(a=o.getOptions(r),i.renderList(a),i.show())}},t.prototype.onChange=function(n){var r=pt(this),o=this.menu;o.exec&&o.exec(r,n)},t.prototype.setSelectedValue=function(){var n=pt(this),r=this.menu,o=r.getValue(n),i=(function(c,u){for(var d=c.length,f="",p=0;p<d;p++){var h=c[p];if(h.value===u){f=h.text;break}}return f})(r.getOptions(n),o.toString()),a=this.$button,l=Si();a.empty(),a.text(i),a.append(l)},t.prototype.setDisabled=function(){var n=pt(this),r=this.menu.isDisabled(n),o=this.$button;(n.selection==null||n.isDisabled())&&(r=!0);var i="disabled";r?o.addClass(i):o.removeClass(i),this.disabled=r},t.prototype.changeMenuState=function(){this.setSelectedValue(),this.setDisabled()},t})(),gc=(function(){function t(n){this.$elem=V('<div class="w-e-bar-item w-e-bar-item-group"></div>'),this.$container=V('<div class="w-e-bar-item-menus-container"></div>'),this.$button=V('<button type="button"></button>');var r=n.key,o=n.iconSvg,i=n.title,a=this.$elem,l=this.$button;if(o){var c=V(o);ro(c),l.append(c)}else l.text(i);l.attr("data-menu-key",r);var u=Si();l.append(u),a.append(l);var d=this.$container;a.append(d);var f=this.createObserver();this.observe(f)}return t.prototype.appendBarItem=function(n){var r=n.$elem;this.$container.append(r)},t.prototype.observe=function(n){var r=this.$container;n.observe(r[0],{childList:!0,subtree:!0,attributes:!0})},t.prototype.createObserver=function(){var n=this,r=this.$container,o=this.$button,i=new MutationObserver((function(){var a=r.find("button"),l=a.length;if(l!==0){var c=0;a.each((function(u){V(u).hasClass("disabled")&&c++})),i.disconnect(),c===l?o.addClass("disabled"):o.removeClass("disabled"),n.observe(i)}}));return i},t})(),yc=new WeakMap;function pt(t){var n=Qo.get(t);if(n==null)throw new Error("Can not get editor instance");return n}function bc(t,n,r){r===void 0&&(r=!1);var o=yc.get(n);if(o)return o;var i=n.tag;if(i==="button"){var a=n.showDropPanel,l=n.showModal;o=a?new Pm(t,n,r):l?new zm(t,n,r):new jm(t,n,r)}if(i==="select"&&(o=new Im(t,n,r)),o==null)throw new Error("Invalid tag in menu ".concat(JSON.stringify(n)));return yc.set(n,o),o}function Rm(t,n){var r=t.selection;return r!=null&&!j.isCollapsed(r)&&!F.getSelectedElems(t).some((function(o){if(t.isVoid(o))return!0;var i=o.type;return!!["pre","code","table"].includes(i)}))&&!!K.isText(n)}var Cc,vc,Hm=(function(){function t(){var n=this;this.$elem=V('<div class="w-e-bar w-e-bar-hidden w-e-hover-bar"></div>'),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null,this.isShow=!1,this.lngListen=function(){},this.changeHoverbarState=Ql((function(){var r=n.isShow,o=n.getSelectedNodeAndMenuKeys()||{},i=o.node,a=i===void 0?null:i,l=o.menuKeys,c=l===void 0?[]:l;a!=null&&n.changeItemsState(),!(a&&te.isElement(a)&&r&&n.isSamePath(a,n.prevSelectedNode))&&(n.hideAndClean(),a!=null&&(n.registerItems(c),n.setPosition(a),n.show()),n.prevSelectedNode=a)}),200),xt((function(){var r=n.getEditorInstance(),o=n.$elem;o.on("mousedown",(function(a){return a.preventDefault()}),{passive:!1}),F.getTextarea(r).$textAreaContainer.append(o),r.on(dt.CHANGE,n.changeHoverbarState);var i=n.hideAndClean.bind(n);r.on(dt.SCROLL,i),r.on(dt.FULLSCREEN,i),r.on(dt.UNFULLSCREEN,i)})),this.lngListen=pc((function(){n.menus={},n.hideAndClean(),n.getEditorInstance().deselect()}))}return t.prototype.getMenus=function(){return this.menus},t.prototype.hideAndClean=function(){var n=this.$elem;n.removeClass("w-e-bar-show").addClass("w-e-bar-hidden"),this.hoverbarItems=[],n.empty(),this.isShow=!1},t.prototype.checkPositionBottom=function(){var n=this.$elem,r=!1,o=typeof window<"u"?window.innerHeight:null;o&&o>=360&&o-n[0].getBoundingClientRect().bottom<360&&(r=!0),r?n.addClass("w-e-bar-bottom"):n.removeClass("w-e-bar-bottom")},t.prototype.show=function(){this.$elem.removeClass("w-e-bar-hidden").addClass("w-e-bar-show"),this.isShow=!0,this.checkPositionBottom()},t.prototype.changeItemsState=function(){var n=this;xt((function(){n.hoverbarItems.forEach((function(r){r.changeMenuState()}))}))},t.prototype.registerItems=function(n){var r=this,o=this.$elem;n.forEach((function(i){if(i!=="|")r.registerSingleItem(i);else{var a=hc();o.append(a)}}))},t.prototype.registerSingleItem=function(n){var r=this.getEditorInstance(),o=this.menus,i=o[n];if(i==null){var a=$n[n];if(a==null)throw new Error("Not found menu item factory by key '".concat(n,"'"));if(typeof a!="function")throw new Error("Menu item factory (key='".concat(n,"') is not a function"));i=a(),o[n]=i}var l=r.getMenuConfig(n);l&&l.iconSvg!==void 0&&(i.iconSvg=l.iconSvg);var c=bc(n,i);this.hoverbarItems.push(c),Qo.set(c,r),this.$elem.append(c.$elem)},t.prototype.setPosition=function(n){var r=this.getEditorInstance(),o=this.$elem;if(o.attr("style",""),te.isElement(n)){var i=xi(r,n,"bar");return o.css(i),void ki(r,o)}if(K.isText(n))return i=Bi(r),o.css(i),void ki(r,o);throw new Error("hoverbar.setPosition error, current selected node is not elem nor text")},t.prototype.getSelectedNodeAndMenuKeys=function(){var n=this.getEditorInstance();if(n.selection==null)return null;var r=this.getHoverbarKeysConf(),o=null,i=[],a=function(c){var u=r[c],d=u.match,f=u.menuKeys,p=f===void 0?[]:f,h=d||function(y,v){return F.checkNodeType(v,c)},m=$(b.nodes(n,{match:function(y){return h(n,y)},universal:!0}),1),g=m[0];if(g!=null)return o=g[0],i=p,"break"};for(var l in r)if(a(l)==="break")break;return o==null||i.length===0?null:{node:o,menuKeys:i}},t.prototype.getEditorInstance=function(){var n=Xo.get(this);if(n==null)throw new Error("Can not get editor instance");return n},t.prototype.getHoverbarKeysConf=function(){var n=this.getEditorInstance().getConfig().hoverbarKeys,r=n===void 0?{}:n,o=r.text;return o&&o.match==null&&(o.match=Rm),r},t.prototype.isSamePath=function(n,r){if(n==null||r==null)return!1;var o=F.findPath(null,n),i=F.findPath(null,r);return A.equals(o,i)},t.prototype.destroy=function(){var n;this.changeHoverbarState.cancel(),this.$elem.remove(),(n=this.lngListen)===null||n===void 0||n.call(this),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null},t})(),Um=(function(){if(vc)return Cc;vc=1;var t="Expected a function",n=NaN,r="[object Symbol]",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt,u=typeof Ke=="object"&&Ke&&Ke.Object===Object&&Ke,d=typeof self=="object"&&self&&self.Object===Object&&self,f=u||d||Function("return this")(),p=Object.prototype.toString,h=Math.max,m=Math.min,g=function(){return f.Date.now()};function y(w,C,B){var k,_,x,N,T,M,R=0,z=!1,W=!1,Q=!0;if(typeof w!="function")throw new TypeError(t);function q(ne){var se=k,G=_;return k=_=void 0,R=ne,N=w.apply(G,se)}function J(ne){var se=ne-M;return M===void 0||se>=C||se<0||W&&ne-R>=x}function X(){var ne=g();if(J(ne))return ie(ne);T=setTimeout(X,(function(se){var G=C-(se-M);return W?m(G,x-(se-R)):G})(ne))}function ie(ne){return T=void 0,Q&&k?q(ne):(k=_=void 0,N)}function re(){var ne=g(),se=J(ne);if(k=arguments,_=this,M=ne,se){if(T===void 0)return(function(G){return R=G,T=setTimeout(X,C),z?q(G):N})(M);if(W)return T=setTimeout(X,C),q(M)}return T===void 0&&(T=setTimeout(X,C)),N}return C=D(C)||0,v(B)&&(z=!!B.leading,x=(W="maxWait"in B)?h(D(B.maxWait)||0,C):x,Q="trailing"in B?!!B.trailing:Q),re.cancel=function(){T!==void 0&&clearTimeout(T),R=0,k=M=_=T=void 0},re.flush=function(){return T===void 0?N:ie(g())},re}function v(w){var C=typeof w;return!!w&&(C=="object"||C=="function")}function D(w){if(typeof w=="number")return w;if((function(k){return typeof k=="symbol"||(function(_){return!!_&&typeof _=="object"})(k)&&p.call(k)==r})(w))return n;if(v(w)){var C=typeof w.valueOf=="function"?w.valueOf():w;w=v(C)?C+"":C}if(typeof w!="string")return w===0?w:+w;w=w.replace(o,"");var B=a.test(w);return B||l.test(w)?c(w.slice(2),B?2:8):i.test(w)?n:+w}return Cc=function(w,C,B){var k=!0,_=!0;if(typeof w!="function")throw new TypeError(t);return v(B)&&(k="leading"in B?!!B.leading:k,_="trailing"in B?!!B.trailing:_),y(w,C,{leading:k,maxWait:C,trailing:_})}})(),Dc=qt(Um);function kt(t,n){return rn(n)&&F.hasDOMNode(t,n,{editable:!0})}function wc(t,n){if(t.getConfig().readOnly)return!1;var r=En(t,n)&&F.toSlateNode(t,n);return b.isVoid(t,r)}function En(t,n){return rn(n)&&F.hasDOMNode(t,n)}const Bc=t=>typeof t=="object"&&t!=null&&t.nodeType===1,xc=(t,n)=>(!n||t!=="hidden")&&t!=="visible"&&t!=="clip",ji=(t,n)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const r=getComputedStyle(t,null);return xc(r.overflowY,n)||xc(r.overflowX,n)||(o=>{const i=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(o);return!!i&&(i.clientHeight<o.scrollHeight||i.clientWidth<o.scrollWidth)})(t)}return!1},oo=(t,n,r,o,i,a,l,c)=>a<t&&l>n||a>t&&l<n?0:a<=t&&c<=r||l>=n&&c>=r?a-t-o:l>n&&c<r||a<t&&c>r?l-n+i:0,Wm=t=>{const n=t.parentElement;return n??(t.getRootNode().host||null)},kc=(t,n)=>{var r,o,i,a;if(typeof document>"u")return[];const{scrollMode:l,block:c,inline:u,boundary:d,skipOverflowHiddenElements:f}=n,p=typeof d=="function"?d:J=>J!==d;if(!Bc(t))throw new TypeError("Invalid target");const h=document.scrollingElement||document.documentElement,m=[];let g=t;for(;Bc(g)&&p(g);){if(g=Wm(g),g===h){m.push(g);break}g!=null&&g===document.body&&ji(g)&&!ji(document.documentElement)||g!=null&&ji(g,f)&&m.push(g)}const y=(o=(r=window.visualViewport)==null?void 0:r.width)!=null?o:innerWidth,v=(a=(i=window.visualViewport)==null?void 0:i.height)!=null?a:innerHeight,{scrollX:D,scrollY:w}=window,{height:C,width:B,top:k,right:_,bottom:x,left:N}=t.getBoundingClientRect(),{top:T,right:M,bottom:R,left:z}=(J=>{const X=window.getComputedStyle(J);return{top:parseFloat(X.scrollMarginTop)||0,right:parseFloat(X.scrollMarginRight)||0,bottom:parseFloat(X.scrollMarginBottom)||0,left:parseFloat(X.scrollMarginLeft)||0}})(t);let W=c==="start"||c==="nearest"?k-T:c==="end"?x+R:k+C/2-T+R,Q=u==="center"?N+B/2-z+M:u==="end"?_+M:N-z;const q=[];for(let J=0;J<m.length;J++){const X=m[J],{height:ie,width:re,top:ne,right:se,bottom:G,left:Le}=X.getBoundingClientRect();if(l==="if-needed"&&k>=0&&N>=0&&x<=v&&_<=y&&k>=ne&&x<=G&&N>=Le&&_<=se)return q;const ke=getComputedStyle(X),Me=parseInt(ke.borderLeftWidth,10),Pe=parseInt(ke.borderTopWidth,10),Ve=parseInt(ke.borderRightWidth,10),Ce=parseInt(ke.borderBottomWidth,10);let xe=0,Ue=0;const lt="offsetWidth"in X?X.offsetWidth-X.clientWidth-Me-Ve:0,et="offsetHeight"in X?X.offsetHeight-X.clientHeight-Pe-Ce:0,ze="offsetWidth"in X?X.offsetWidth===0?0:re/X.offsetWidth:0,tt="offsetHeight"in X?X.offsetHeight===0?0:ie/X.offsetHeight:0;if(h===X)xe=c==="start"?W:c==="end"?W-v:c==="nearest"?oo(w,w+v,v,Pe,Ce,w+W,w+W+C,C):W-v/2,Ue=u==="start"?Q:u==="center"?Q-y/2:u==="end"?Q-y:oo(D,D+y,y,Me,Ve,D+Q,D+Q+B,B),xe=Math.max(0,xe+w),Ue=Math.max(0,Ue+D);else{xe=c==="start"?W-ne-Pe:c==="end"?W-G+Ce+et:c==="nearest"?oo(ne,G,ie,Pe,Ce+et,W,W+C,C):W-(ne+ie/2)+et/2,Ue=u==="start"?Q-Le-Me:u==="center"?Q-(Le+re/2)+lt/2:u==="end"?Q-se+Ve+lt:oo(Le,se,re,Me,Ve+lt,Q,Q+B,B);const{scrollLeft:nt,scrollTop:We}=X;xe=tt===0?0:Math.max(0,Math.min(We+xe/tt,X.scrollHeight-ie/tt+et)),Ue=ze===0?0:Math.max(0,Math.min(nt+Ue/ze,X.scrollWidth-re/ze+lt)),W+=We-xe,Q+=nt-Ue}q.push({el:X,top:xe,left:Ue})}return q},qm=t=>t===!1?{block:"end",inline:"nearest"}:(n=>n===Object(n)&&Object.keys(n).length!==0)(t)?t:{block:"start",inline:"nearest"};function Ec(t,n,r){r===void 0&&(r=!1);var o=n.selection,i=n.getConfig(),a=F.findDocumentOrShadowRoot(n).getSelection();if(a&&(!t.isComposing||r)&&n.isFocused()){var l=a.type!=="None";if(o||l){var c=ti.get(n),u=!1;if(c.contains(a.anchorNode)&&c.contains(a.focusNode)&&(u=!0),l&&u&&o){var d=F.toSlateRange(n,a,{exactMatch:!0,suppressThrow:!0});if(d&&j.equals(d,o)){var f=!0;if(j.isCollapsed(o)){var p=a.anchorNode,h=a.anchorOffset;if(p===c){var m=c.childNodes,g=void 0;(g=m[h])&&g.matches("table")&&(f=!1),(g=m[h-1])&&g.matches("table")&&(f=!1)}}if(f)return}}if(!o||F.hasRange(n,o)){t.isUpdatingSelection=!0;var y=o&&F.toDOMRange(n,o);if(y){j.isBackward(o)?a.setBaseAndExtent(y.endContainer,y.endOffset,y.startContainer,y.startOffset):a.setBaseAndExtent(y.startContainer,y.startOffset,y.endContainer,y.endOffset);var v=y.startContainer.parentElement;if(!v.closest("[data-slate-spacer]")&&y.getBoundingClientRect){v.getBoundingClientRect=y.getBoundingClientRect.bind(y);var D=document.body;(function(w,C){if(!w.isConnected||!(_=>{let x=_;for(;x&&x.parentNode;){if(x.parentNode===document)return!0;x=x.parentNode instanceof ShadowRoot?x.parentNode.host:x.parentNode}return!1})(w))return;const B=(_=>{const x=window.getComputedStyle(_);return{top:parseFloat(x.scrollMarginTop)||0,right:parseFloat(x.scrollMarginRight)||0,bottom:parseFloat(x.scrollMarginBottom)||0,left:parseFloat(x.scrollMarginLeft)||0}})(w);if((_=>typeof _=="object"&&typeof _.behavior=="function")(C))return C.behavior(kc(w,C));const k=typeof C=="boolean"||C==null?void 0:C.behavior;for(const{el:_,top:x,left:N}of kc(w,qm(C))){const T=x-B.top+B.bottom,M=N-B.left+B.right;_.scroll({top:T,left:M,behavior:k})}})(v,{scrollMode:"if-needed",boundary:i.scroll?c.parentElement:D,block:"end",behavior:"smooth"}),delete v.getBoundingClientRect}}else a.removeAllRanges();setTimeout((function(){y&&qn&&c.focus(),t.isUpdatingSelection=!1}))}else n.selection=F.toSlateRange(n,a,{exactMatch:!1,suppressThrow:!1})}}}var Li=new WeakMap,_c=new WeakMap,Ac,At={},io=(function(){if(Ac)return At;Ac=1,Object.defineProperty(At,"__esModule",{value:!0});for(var t=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),n={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},r={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:t?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},o={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=1;i<20;i++)o["f"+i]=111+i;function a(f,p,h){p&&!("byKey"in p)&&(h=p,p=null),Array.isArray(f)||(f=[f]);var m=f.map((function(y){return l(y,p)})),g=function(y){return m.some((function(v){return c(v,y)}))};return h==null?g:g(h)}function l(f,p){var h=p&&p.byKey,m={},g=(f=f.replace("++","+add")).split("+"),y=g.length;for(var v in n)m[n[v]]=!1;var D=!0,w=!1,C=void 0;try{for(var B,k=g[Symbol.iterator]();!(D=(B=k.next()).done);D=!0){var _=B.value,x=_.endsWith("?")&&_.length>1;x&&(_=_.slice(0,-1));var N=d(_),T=n[N];if(_.length>1&&!T&&!r[_]&&!o[N])throw new TypeError('Unknown modifier: "'+_+'"');y!==1&&T||(h?m.key=N:m.which=u(_)),T&&(m[T]=!x||null)}}catch(M){w=!0,C=M}finally{try{!D&&k.return&&k.return()}finally{if(w)throw C}}return m}function c(f,p){for(var h in f){var m=f[h],g=void 0;if(m!=null&&((g=h==="key"&&p.key!=null?p.key.toLowerCase():h==="which"?m===91&&p.which===93?91:p.which:p[h])!=null||m!==!1)&&g!==m)return!1}return!0}function u(f){return f=d(f),o[f]||f.toUpperCase().charCodeAt(0)}function d(f){return f=f.toLowerCase(),f=r[f]||f}return At.default=a,At.isHotkey=a,At.isCodeHotkey=function(f,p){return a(f,p)},At.isKeyHotkey=function(f,p){return a(f,{byKey:!0},p)},At.parseHotkey=l,At.compareHotkey=c,At.toKeyCode=u,At.toKeyName=d,At})(),Km={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",splitBlock:"shift?+enter",undo:"mod+z",tab:"tab",selectAll:"mod+a"},Jm={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},Gm={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Se=function(t){var n=Km[t],r=Jm[t],o=Gm[t],i=n&&io.isKeyHotkey(n),a=r&&io.isKeyHotkey(r),l=o&&io.isKeyHotkey(o);return function(c){return!(!i||!i(c))||!!(pi&&a&&a(c))||!(pi||!l||!l(c))}},Fe={isBold:Se("bold"),isCompose:Se("compose"),isMoveBackward:Se("moveBackward"),isMoveForward:Se("moveForward"),isDeleteBackward:Se("deleteBackward"),isDeleteForward:Se("deleteForward"),isDeleteLineBackward:Se("deleteLineBackward"),isDeleteLineForward:Se("deleteLineForward"),isDeleteWordBackward:Se("deleteWordBackward"),isDeleteWordForward:Se("deleteWordForward"),isExtendBackward:Se("extendBackward"),isExtendForward:Se("extendForward"),isExtendLineBackward:Se("extendLineBackward"),isExtendLineForward:Se("extendLineForward"),isItalic:Se("italic"),isMoveLineBackward:Se("moveLineBackward"),isMoveLineForward:Se("moveLineForward"),isMoveWordBackward:Se("moveWordBackward"),isMoveWordForward:Se("moveWordForward"),isRedo:Se("redo"),isSplitBlock:Se("splitBlock"),isTransposeCharacter:Se("transposeCharacter"),isUndo:Se("undo"),isTab:Se("tab"),isSelectAll:Se("selectAll")};function Je(t){t.preventDefault()}var Ym={beforeinput:function(t,n,r){var o=t,i=r.getConfig().readOnly;if(Kn&&!i&&kt(r,o.target)){var a=r.selection,l=o.inputType,c=o.dataTransfer||o.data||void 0;if(l!=="insertCompositionText"&&l!=="deleteCompositionText"){if(o.preventDefault(),!l.startsWith("delete")||l.startsWith("deleteBy")){var u=$(o.getTargetRanges(),1)[0];if(u){var d=F.toSlateRange(r,u,{exactMatch:!1,suppressThrow:!1});a&&j.equals(a,d)||O.select(r,d)}}if(a&&j.isExpanded(a)){var f=F.getSelectedElems(r),p=f[0].type==="table",h=f[f.length-1].type!=="table-cell";if(p&&h)return;if(l.startsWith("delete")){var m=l.endsWith("Backward")?"backward":"forward";return void b.deleteFragment(r,{direction:m})}}switch(l){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":b.deleteFragment(r);break;case"deleteContent":case"deleteContentForward":b.deleteForward(r);break;case"deleteContentBackward":b.deleteBackward(r);break;case"deleteEntireSoftLine":b.deleteBackward(r,{unit:"line"}),b.deleteForward(r,{unit:"line"});break;case"deleteHardLineBackward":b.deleteBackward(r,{unit:"block"});break;case"deleteSoftLineBackward":b.deleteBackward(r,{unit:"line"});break;case"deleteHardLineForward":b.deleteForward(r,{unit:"block"});break;case"deleteSoftLineForward":b.deleteForward(r,{unit:"line"});break;case"deleteWordBackward":b.deleteBackward(r,{unit:"word"});break;case"deleteWordForward":b.deleteForward(r,{unit:"word"});break;case"insertLineBreak":case"insertParagraph":b.insertBreak(r);break;case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if(l==="insertFromPaste"&&!oi.get(r))break;Hn(c)==="[object DataTransfer]"?r.insertData(c):typeof c=="string"&&b.insertText(r,c)}}}},blur:function(t,n,r){var o=t,i=n.isUpdatingSelection,a=n.latestElement;if(!r.getConfig().readOnly&&!i&&kt(r,o.target)){var l=F.findDocumentOrShadowRoot(r);if(a!==l.activeElement){var c=o.relatedTarget;if(!(c===F.toDOMNode(r,r)||ft(c)&&c.hasAttribute("data-slate-spacer"))){if(c!=null&&rn(c)&&F.hasDOMNode(r,c)){var u=F.toSlateNode(r,c);if(te.isElement(u)&&!r.isVoid(u))return}if(wn){var d=l.getSelection();d?.removeAllRanges()}tn.delete(r)}}}},focus:function(t,n,r){var o=F.toDOMNode(r,r),i=F.findDocumentOrShadowRoot(r);n.latestElement=i.activeElement,qn&&t.target!==o?o.focus():tn.set(r,!0)},click:function(t,n,r){if(!r.getConfig().readOnly&&En(r,t.target)&&rn(t.target)){var o=F.toSlateNode(r,t.target),i=F.findPath(r,o);if(b.hasPath(r,i)&&U.get(r,i)===o){var a=b.start(r,i),l=b.end(r,i),c=b.void(r,{at:a}),u=b.void(r,{at:l});if(c&&u&&A.equals(c[1],u[1])){var d=b.range(r,a);O.select(r,d)}}}},compositionstart:function(t,n,r){if(kt(r,t.target)){var o=r.selection;if(o&&j.isExpanded(o)&&(b.deleteFragment(r),Promise.resolve().then((function(){Ec(n,r,!0)}))),r.selection){var i=F.toDOMRange(r,r.selection).startContainer,a=i.textContent||"";Li.set(r,a),_c.set(r,i)}n.isComposing=!0,(function(l,c){var u;c.getConfig().placeholder&&c.isEmpty()&&l.showPlaceholder&&((u=l.$placeholder)===null||u===void 0||u.hide(),l.showPlaceholder=!1)})(n,r)}},compositionend:function(t,n,r){var o=t;if(kt(r,o.target)){n.isComposing=!1;var i=r.selection;if(i!=null){(hi||qn)&&F.cleanExposedTexNodeInSelectionBlock(r);for(var a=j.isBackward(i)?i.focus:i.anchor,l=$(b.node(r,[a.path[0]]),1)[0],c=0;c<a.path.length;c+=1){var u=$(b.node(r,a.path.slice(0,c+1)),1)[0];if(te.isElement(u)&&((wn||qn)&&u.type==="link"||u.type==="code")){F.setNewKey(l);break}}var d=o.data;if(d){if(r.getConfig().maxLength){var f=F.getLeftLengthOfMaxLength(r);if(f<d.length){var p=F.toDOMRange(r,i);p.startContainer.nodeType===Node.TEXT_NODE&&(p.startContainer.textContent=Li.get(r)||""),f>0&&b.insertText(r,d.slice(0,f)),n.changeViewState()}else b.insertText(r,d)}else{var h=F.findDocumentOrShadowRoot(r).getSelection();h&&(function(m,g){if(j.isCollapsed(g)){var y=g.anchor,v=g.focus;if([2,3].includes(y.path.length)&&[2,3].includes(v.path.length)&&(y.offset===0||v.offset===0)){var D=b.node(m,y.path),w=y.offset===0?y.path:v.path,C=[w[0],w[1]-1];if(w[1]===0)return!1;var B=b.node(m,C);if(K.isText(B[0])&&K.isText(D[0]))return!0}}})(r,i)&&(r.selection=F.toSlateRange(r,h,{exactMatch:!1,suppressThrow:!1})),b.insertText(r,d)}wn||setTimeout((function(){var m=r.selection;if(m!=null){var g=_c.get(r);g!=null&&F.toDOMRange(r,m).startContainer!==g&&(g.textContent=Li.get(r)||"")}}))}}}},compositionupdate:function(t,n,r){kt(r,t.target)&&(n.isComposing=!0)},keydown:function(t,n,r){var o=t,i=r.selection;if(!r.getConfig().readOnly&&!n.isComposing&&kt(r,o.target)){if((function(l,c){var u=br.get(l),d=u&&u.getMenus(),f=Cr.get(l),p=f&&f.getMenus(),h=me(me({},d),p);for(var m in h){var g=h[m],y=g.hotkey;if(y&&io.isHotkey(y,c)&&!g.isDisabled(l)){var v=g.getValue(l);g.exec(l,v)}}})(r,o),Fe.isTab(o))return Je(o),void r.handleTab();if(Fe.isRedo(o))return Je(o),void(typeof r.redo=="function"&&r.redo());if(Fe.isUndo(o))return Je(o),void(typeof r.undo=="function"&&r.undo());if(Fe.isMoveLineBackward(o))return Je(o),void O.move(r,{unit:"line",reverse:!0});if(Fe.isMoveLineForward(o))return Je(o),void O.move(r,{unit:"line"});if(Fe.isExtendLineBackward(o))return Je(o),void O.move(r,{unit:"line",edge:"focus",reverse:!0});if(Fe.isExtendLineForward(o))return Je(o),void O.move(r,{unit:"line",edge:"focus"});if(Fe.isMoveBackward(o))return Je(o),void(i&&j.isCollapsed(i)?O.move(r,{reverse:!0}):O.collapse(r,{edge:"start"}));if(Fe.isMoveForward(o))return Je(o),void(i&&j.isCollapsed(i)?O.move(r):O.collapse(r,{edge:"end"}));if(Fe.isMoveWordBackward(o))return Je(o),i&&j.isExpanded(i)&&O.collapse(r,{edge:"focus"}),void O.move(r,{unit:"word",reverse:!0});if(Fe.isMoveWordForward(o))return Je(o),i&&j.isExpanded(i)&&O.collapse(r,{edge:"focus"}),void O.move(r,{unit:"word"});if(Fe.isSelectAll(o))return Je(o),void r.selectAll();if(Kn){if((hi||wn)&&i&&(Fe.isDeleteBackward(o)||Fe.isDeleteForward(o))&&j.isCollapsed(i)){var a=U.parent(r,i.anchor.path);if(te.isElement(a)&&b.isVoid(r,a)&&b.isInline(r,a))return o.preventDefault(),void O.delete(r,{unit:"block"})}}else{if(Fe.isBold(o)||Fe.isItalic(o)||Fe.isTransposeCharacter(o))return void Je(o);if(Fe.isSplitBlock(o))return Je(o),void b.insertBreak(r);if(Fe.isDeleteBackward(o))return Je(o),void(i&&j.isExpanded(i)?b.deleteFragment(r,{direction:"backward"}):b.deleteBackward(r));if(Fe.isDeleteForward(o))return Je(o),void(i&&j.isExpanded(i)?b.deleteFragment(r,{direction:"forward"}):b.deleteForward(r));if(Fe.isDeleteLineBackward(o))return Je(o),void(i&&j.isExpanded(i)?b.deleteFragment(r,{direction:"backward"}):b.deleteBackward(r,{unit:"line"}));if(Fe.isDeleteLineForward(o))return Je(o),void(i&&j.isExpanded(i)?b.deleteFragment(r,{direction:"forward"}):b.deleteForward(r,{unit:"line"}));if(Fe.isDeleteWordBackward(o))return Je(o),void(i&&j.isExpanded(i)?b.deleteFragment(r,{direction:"backward"}):b.deleteBackward(r,{unit:"word"}));if(Fe.isDeleteWordForward(o))return Je(o),void(i&&j.isExpanded(i)?b.deleteFragment(r,{direction:"forward"}):b.deleteForward(r,{unit:"word"}))}}},keypress:function(t,n,r){if(!Kn&&!r.getConfig().readOnly&&kt(r,t.target)){t.preventDefault();var o=t.key;b.insertText(r,o)}},copy:function(t,n,r){var o=t;if(kt(r,o.target)){r.getConfig().readOnly||o.preventDefault();var i=o.clipboardData;i!=null&&r.setFragmentData(i)}},cut:function(t,n,r){var o=t,i=r.selection;if(!r.getConfig().readOnly&&(o.preventDefault(),kt(r,o.target))){var a=o.clipboardData;if(a!=null&&(r.setFragmentData(a),i))if(j.isExpanded(i))b.deleteFragment(r);else{var l=U.parent(r,i.anchor.path);b.isVoid(r,l)&&O.delete(r)}}},paste:function(t,n,r){oi.set(r,!0);var o=t;if(!r.getConfig().readOnly&&kt(r,o.target)){var i=r.getConfig().customPaste;if(i&&i(r,o)===!1)return void oi.set(r,!1);if(!Kn||(function(l){return l.clipboardData&&l.clipboardData.getData("text/plain")!==""&&l.clipboardData.types.length===1})(o)){o.preventDefault();var a=o.clipboardData;a!=null&&r.insertData(a)}}},dragover:function(t,n,r){if(En(r,t.target)){var o=F.toSlateNode(r,t.target);b.isVoid(r,o)&&t.preventDefault()}},dragstart:function(t,n,r){var o=t;if(En(r,o.target)&&!r.getConfig().readOnly){var i=F.toSlateNode(r,o.target),a=F.findPath(r,i);if(b.isVoid(r,i)||b.void(r,{at:a,voids:!0})){var l=b.range(r,a);O.select(r,l)}var c=o.dataTransfer;c!=null&&(n.isDraggingInternally=!0,r.setFragmentData(c))}},dragend:function(t,n,r){var o=t;r.getConfig().readOnly||n.isDraggingInternally&&En(r,o.target)&&(n.isDraggingInternally=!1)},drop:function(t,n,r){var o=t,i=o.dataTransfer;if(!r.getConfig().readOnly&&En(r,o.target)&&i!=null&&!(Kn&&wn&&i.files.length>0)){o.preventDefault();var a=r.selection,l=F.findEventRange(r,o);O.select(r,l),n.isDraggingInternally&&(a&&O.delete(r,{at:a}),n.isDraggingInternally=!1),r.insertData(i),r.isFocused()||r.focus()}}};const Zm={createElement:function(t,n){return document.createElement(t,n)},createElementNS:function(t,n,r){return document.createElementNS(t,n,r)},createTextNode:function(t){return document.createTextNode(t)},createComment:function(t){return document.createComment(t)},insertBefore:function(t,n,r){t.insertBefore(n,r)},removeChild:function(t,n){t.removeChild(n)},appendChild:function(t,n){t.appendChild(n)},parentNode:function(t){return t.parentNode},nextSibling:function(t){return t.nextSibling},tagName:function(t){return t.tagName},setTextContent:function(t,n){t.textContent=n},getTextContent:function(t){return t.textContent},isElement:function(t){return t.nodeType===1},isText:function(t){return t.nodeType===3},isComment:function(t){return t.nodeType===8}};function Zn(t,n,r,o,i){return{sel:t,data:n,children:r,text:o,elm:i,key:n===void 0?void 0:n.key}}const Pi=Array.isArray;function so(t){return typeof t=="string"||typeof t=="number"||t instanceof String||t instanceof Number}function Mi(t){return t===void 0}function wt(t){return t!==void 0}const Nc=Zn("",{},[],void 0,void 0);function Xn(t,n){var r,o;const i=t.key===n.key,a=((r=t.data)===null||r===void 0?void 0:r.is)===((o=n.data)===null||o===void 0?void 0:o.is);return t.sel===n.sel&&i&&a}function Xm(t,n,r){var o;const i={};for(let a=n;a<=r;++a){const l=(o=t[a])===null||o===void 0?void 0:o.key;l!==void 0&&(i[l]=a)}return i}const Qm=["create","update","remove","destroy","pre","post"];function eg(t,n){const r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},o=Zm;for(const p of Qm)for(const h of t){const m=h[p];m!==void 0&&r[p].push(m)}function i(p){const h=p.id?"#"+p.id:"",m=p.getAttribute("class"),g=m?"."+m.split(" ").join("."):"";return Zn(o.tagName(p).toLowerCase()+h+g,{},[],void 0,p)}function a(p,h){return function(){if(--h==0){const m=o.parentNode(p);o.removeChild(m,p)}}}function l(p,h){var m,g;let y,v=p.data;if(v!==void 0){const C=(m=v.hook)===null||m===void 0?void 0:m.init;wt(C)&&(C(p),v=p.data)}const D=p.children,w=p.sel;if(w==="!")Mi(p.text)&&(p.text=""),p.elm=o.createComment(p.text);else if(w!==void 0){const C=w.indexOf("#"),B=w.indexOf(".",C),k=C>0?C:w.length,_=B>0?B:w.length,x=C!==-1||B!==-1?w.slice(0,Math.min(k,_)):w,N=p.elm=wt(v)&&wt(y=v.ns)?o.createElementNS(y,x,v):o.createElement(x,v);for(k<_&&N.setAttribute("id",w.slice(k+1,_)),B>0&&N.setAttribute("class",w.slice(_+1).replace(/\./g," ")),y=0;y<r.create.length;++y)r.create[y](Nc,p);if(Pi(D))for(y=0;y<D.length;++y){const M=D[y];M!=null&&o.appendChild(N,l(M,h))}else so(p.text)&&o.appendChild(N,o.createTextNode(p.text));const T=p.data.hook;wt(T)&&((g=T.create)===null||g===void 0||g.call(T,Nc,p),T.insert&&h.push(p))}else p.elm=o.createTextNode(p.text);return p.elm}function c(p,h,m,g,y,v){for(;g<=y;++g){const D=m[g];D!=null&&o.insertBefore(p,l(D,v),h)}}function u(p){var h,m;const g=p.data;if(g!==void 0){(m=(h=g?.hook)===null||h===void 0?void 0:h.destroy)===null||m===void 0||m.call(h,p);for(let y=0;y<r.destroy.length;++y)r.destroy[y](p);if(p.children!==void 0)for(let y=0;y<p.children.length;++y){const v=p.children[y];v!=null&&typeof v!="string"&&u(v)}}}function d(p,h,m,g){for(var y,v;m<=g;++m){let D,w;const C=h[m];if(C!=null)if(wt(C.sel)){u(C),D=r.remove.length+1,w=a(C.elm,D);for(let k=0;k<r.remove.length;++k)r.remove[k](C,w);const B=(v=(y=C?.data)===null||y===void 0?void 0:y.hook)===null||v===void 0?void 0:v.remove;wt(B)?B(C,w):w()}else o.removeChild(p,C.elm)}}function f(p,h,m){var g,y,v,D,w;const C=(g=h.data)===null||g===void 0?void 0:g.hook;(y=C?.prepatch)===null||y===void 0||y.call(C,p,h);const B=h.elm=p.elm,k=p.children,_=h.children;if(p!==h){if(h.data!==void 0){for(let x=0;x<r.update.length;++x)r.update[x](p,h);(D=(v=h.data.hook)===null||v===void 0?void 0:v.update)===null||D===void 0||D.call(v,p,h)}Mi(h.text)?wt(k)&&wt(_)?k!==_&&(function(x,N,T,M){let R,z,W,Q,q=0,J=0,X=N.length-1,ie=N[0],re=N[X],ne=T.length-1,se=T[0],G=T[ne];for(;q<=X&&J<=ne;)ie==null?ie=N[++q]:re==null?re=N[--X]:se==null?se=T[++J]:G==null?G=T[--ne]:Xn(ie,se)?(f(ie,se,M),ie=N[++q],se=T[++J]):Xn(re,G)?(f(re,G,M),re=N[--X],G=T[--ne]):Xn(ie,G)?(f(ie,G,M),o.insertBefore(x,ie.elm,o.nextSibling(re.elm)),ie=N[++q],G=T[--ne]):Xn(re,se)?(f(re,se,M),o.insertBefore(x,re.elm,ie.elm),re=N[--X],se=T[++J]):(R===void 0&&(R=Xm(N,q,X)),z=R[se.key],Mi(z)?o.insertBefore(x,l(se,M),ie.elm):(W=N[z],W.sel!==se.sel?o.insertBefore(x,l(se,M),ie.elm):(f(W,se,M),N[z]=void 0,o.insertBefore(x,W.elm,ie.elm))),se=T[++J]);(q<=X||J<=ne)&&(q>X?(Q=T[ne+1]==null?null:T[ne+1].elm,c(x,Q,T,J,ne,M)):d(x,N,q,X))})(B,k,_,m):wt(_)?(wt(p.text)&&o.setTextContent(B,""),c(B,null,_,0,_.length-1,m)):wt(k)?d(B,k,0,k.length-1):wt(p.text)&&o.setTextContent(B,""):p.text!==h.text&&(wt(k)&&d(B,k,0,k.length-1),o.setTextContent(B,h.text)),(w=C?.postpatch)===null||w===void 0||w.call(C,p,h)}}return function(p,h){let m,g,y;const v=[];for(m=0;m<r.pre.length;++m)r.pre[m]();for((function(D){return D.sel!==void 0})(p)||(p=i(p)),Xn(p,h)?f(p,h,v):(g=p.elm,y=o.parentNode(g),l(h,v),y!==null&&(o.insertBefore(y,h.elm,o.nextSibling(g)),d(y,[p],0,0))),m=0;m<v.length;++m)v[m].data.hook.insert(v[m]);for(m=0;m<r.post.length;++m)r.post[m]();return h}}function Sc(t,n,r){if(t.ns="http://www.w3.org/2000/svg",r!=="foreignObject"&&n!==void 0)for(let o=0;o<n.length;++o){const i=n[o].data;i!==void 0&&Sc(i,n[o].children,n[o].sel)}}function ht(t,n,r){let o,i,a,l={};if(r!==void 0?(n!==null&&(l=n),Pi(r)?o=r:so(r)?i=r.toString():r&&r.sel&&(o=[r])):n!=null&&(Pi(n)?o=n:so(n)?i=n.toString():n&&n.sel?o=[n]:l=n),o!==void 0)for(a=0;a<o.length;++a)so(o[a])&&(o[a]=Zn(void 0,void 0,void 0,o[a],void 0));return t[0]!=="s"||t[1]!=="v"||t[2]!=="g"||t.length!==3&&t[3]!=="."&&t[3]!=="#"||Sc(l,o,t),Zn(t,l,o,i,void 0)}function Fc(t,n){let r;const o=n.elm;let i=t.data.attrs,a=n.data.attrs;if((i||a)&&i!==a){for(r in i=i||{},a=a||{},a){const l=a[r];i[r]!==l&&(l===!0?o.setAttribute(r,""):l===!1?o.removeAttribute(r):r.charCodeAt(0)!==120?o.setAttribute(r,l):r.charCodeAt(3)===58?o.setAttributeNS("http://www.w3.org/XML/1998/namespace",r,l):r.charCodeAt(5)===58?o.setAttributeNS("http://www.w3.org/1999/xlink",r,l):o.setAttribute(r,l))}for(r in i)r in a||o.removeAttribute(r)}}const tg={create:Fc,update:Fc};function Vc(t,n){let r,o;const i=n.elm;let a=t.data.class,l=n.data.class;if((a||l)&&a!==l){for(o in a=a||{},l=l||{},a)a[o]&&!Object.prototype.hasOwnProperty.call(l,o)&&i.classList.remove(o);for(o in l)r=l[o],r!==a[o]&&i.classList[r?"add":"remove"](o)}}const ng={create:Vc,update:Vc},Oc=/[A-Z]/g;function Tc(t,n){const r=n.elm;let o,i=t.data.dataset,a=n.data.dataset;if(!i&&!a||i===a)return;i=i||{},a=a||{};const l=r.dataset;for(o in i)a[o]||(l?o in l&&delete l[o]:r.removeAttribute("data-"+o.replace(Oc,"-$&").toLowerCase()));for(o in a)i[o]!==a[o]&&(l?l[o]=a[o]:r.setAttribute("data-"+o.replace(Oc,"-$&").toLowerCase(),a[o]))}const rg={create:Tc,update:Tc};function jc(t,n,r){if(typeof t=="function")t.call(n,r,n);else if(typeof t=="object")for(let o=0;o<t.length;o++)jc(t[o],n,r)}function og(t,n){const r=t.type,o=n.data.on;o&&o[r]&&jc(o[r],n,t)}function zi(t,n){const r=t.data.on,o=t.listener,i=t.elm,a=n&&n.data.on,l=n&&n.elm;let c;if(r!==a){if(r&&o)if(a)for(c in r)a[c]||i.removeEventListener(c,o,!1);else for(c in r)i.removeEventListener(c,o,!1);if(a){const u=n.listener=t.listener||function d(f){og(f,d.vnode)};if(u.vnode=n,r)for(c in a)r[c]||l.addEventListener(c,u,!1);else for(c in a)l.addEventListener(c,u,!1)}}}const ig={create:zi,update:zi,destroy:zi};function Lc(t,n){let r,o,i;const a=n.elm;let l=t.data.props,c=n.data.props;if((l||c)&&l!==c)for(r in l=l||{},c=c||{},c)o=c[r],i=l[r],i===o||r==="value"&&a[r]===o||(a[r]=o)}const sg={create:Lc,update:Lc},Pc=typeof window<"u"&&window.requestAnimationFrame.bind(window)||setTimeout,ag=function(t){Pc((function(){Pc(t)}))};let $i=!1;function lg(t,n,r){ag((function(){t[n]=r}))}function Mc(t,n){let r,o;const i=n.elm;let a=t.data.style,l=n.data.style;if(!a&&!l||a===l)return;a=a||{},l=l||{};const c="delayed"in a;for(o in a)l[o]||(o[0]==="-"&&o[1]==="-"?i.style.removeProperty(o):i.style[o]="");for(o in l)if(r=l[o],o==="delayed"&&l.delayed)for(const u in l.delayed)r=l.delayed[u],c&&r===a.delayed[u]||lg(i.style,u,r);else o!=="remove"&&r!==a[o]&&(o[0]==="-"&&o[1]==="-"?i.style.setProperty(o,r):i.style[o]=r)}const cg={pre:function(){$i=!1},create:Mc,update:Mc,destroy:function(t){let n,r;const o=t.elm,i=t.data.style;if(i&&(n=i.destroy))for(r in n)o.style[r]=n[r]},remove:function(t,n){const r=t.data.style;if(!r||!r.remove)return void n();let o;$i||(t.elm.offsetLeft,$i=!0);const i=t.elm;let a=0;const l=r.remove;let c=0;const u=[];for(o in l)u.push(o),i.style[o]=l[o];const d=getComputedStyle(i)["transition-property"].split(", ");for(;a<d.length;++a)u.indexOf(d[a])!==-1&&c++;i.addEventListener("transitionend",(function(f){f.target===i&&--c,c===0&&n()}))}};function zc(t,n){for(const r of t)r!=null&&r!==!1&&r!==""&&(Array.isArray(r)?zc(r,n):typeof r=="string"||typeof r=="number"||typeof r=="boolean"?n.push(Zn(void 0,void 0,void 0,String(r),void 0)):n.push(r));return n}function je(t,n,...r){const o=zc(r,[]);return typeof t=="function"?t(n,o):o.length===1&&!o[0].sel&&o[0].text?ht(t,n,o[0].text):ht(t,n,o)}var $c,Ic;je||(je={});var ug=(function(){if(Ic)return $c;Ic=1;var t,n="[object Symbol]",r=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,i="\\ud800-\\udfff",a="\\u0300-\\u036f\\ufe20-\\ufe23",l="\\u20d0-\\u20f0",c="\\u2700-\\u27bf",u="a-z\\xdf-\\xf6\\xf8-\\xff",d="A-Z\\xc0-\\xd6\\xd8-\\xde",f="\\ufe0e\\ufe0f",p="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",h="['’]",m="["+i+"]",g="["+p+"]",y="["+a+l+"]",v="\\d+",D="["+c+"]",w="["+u+"]",C="[^"+i+p+v+c+u+d+"]",B="\\ud83c[\\udffb-\\udfff]",k="[^"+i+"]",_="(?:\\ud83c[\\udde6-\\uddff]){2}",x="[\\ud800-\\udbff][\\udc00-\\udfff]",N="["+d+"]",T="\\u200d",M="(?:"+w+"|"+C+")",R="(?:"+N+"|"+C+")",z="(?:['’](?:d|ll|m|re|s|t|ve))?",W="(?:['’](?:D|LL|M|RE|S|T|VE))?",Q="(?:"+y+"|"+B+")?",q="["+f+"]?",J=q+Q+("(?:"+T+"(?:"+[k,_,x].join("|")+")"+q+Q+")*"),X="(?:"+[D,_,x].join("|")+")"+J,ie="(?:"+[k+y+"?",y,_,x,m].join("|")+")",re=RegExp(h,"g"),ne=RegExp(y,"g"),se=RegExp(B+"(?="+B+")|"+ie+J,"g"),G=RegExp([N+"?"+w+"+"+z+"(?="+[g,N,"$"].join("|")+")",R+"+"+W+"(?="+[g,N+M,"$"].join("|")+")",N+"?"+M+"+"+z,N+"+"+W,v,X].join("|"),"g"),Le=RegExp("["+T+i+a+l+f+"]"),ke=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Me=typeof Ke=="object"&&Ke&&Ke.Object===Object&&Ke,Pe=typeof self=="object"&&self&&self.Object===Object&&self,Ve=Me||Pe||Function("return this")(),Ce=(t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"ss"},function(pe){return t?.[pe]});function xe(pe){return Le.test(pe)}function Ue(pe){return xe(pe)?(function(le){return le.match(se)||[]})(pe):(function(le){return le.split("")})(pe)}var lt=Object.prototype.toString,et=Ve.Symbol,ze=et?et.prototype:void 0,tt=ze?ze.toString:void 0;function nt(pe){if(typeof pe=="string")return pe;if((function(ge){return typeof ge=="symbol"||(function(Ae){return!!Ae&&typeof Ae=="object"})(ge)&<.call(ge)==n})(pe))return tt?tt.call(pe):"";var le=pe+"";return le=="0"&&1/pe==-1/0?"-0":le}function We(pe,le,ge){var Ae=pe.length;return ge=ge===void 0?Ae:ge,!le&&ge>=Ae?pe:(function(yt,Ee,Oe){var Xe=-1,Te=yt.length;Ee<0&&(Ee=-Ee>Te?0:Te+Ee),(Oe=Oe>Te?Te:Oe)<0&&(Oe+=Te),Te=Ee>Oe?0:Oe-Ee>>>0,Ee>>>=0;for(var E=Array(Te);++Xe<Te;)E[Xe]=yt[Xe+Ee];return E})(pe,le,ge)}function $e(pe){return pe==null?"":nt(pe)}var mt,Et,gt=(mt=function(pe,le,ge){return le=le.toLowerCase(),pe+(ge?Bt($e(le).toLowerCase()):le)},function(pe){return(function(le,ge,Ae){for(var yt=-1,Ee=le?le.length:0;++yt<Ee;)Ae=ge(Ae,le[yt],yt,le);return Ae})((function(le,ge){return le=$e(le),ge===void 0?(function(Ae){return ke.test(Ae)})(le)?(function(Ae){return Ae.match(G)||[]})(le):(function(Ae){return Ae.match(r)||[]})(le):le.match(ge)||[]})((function(le){return(le=$e(le))&&le.replace(o,Ce).replace(ne,"")})(pe).replace(re,"")),mt,"")}),Bt=(Et="toUpperCase",function(pe){var le=xe(pe=$e(pe))?Ue(pe):void 0,ge=le?le[0]:pe.charAt(0),Ae=le?We(le,1).join(""):pe.slice(1);return ge[Et]()+Ae});return $c=gt})(),dg=qt(ug),fg=["props","attrs","style","dataset","on","hook"];function Rc(t){var n=t.data,r=n===void 0?{}:n,o=t.children,i=o===void 0?[]:o;Object.keys(r).forEach((function(a){var l,c,u=r[a];if(a!=="key"){if(!fg.includes(a)){if(a.startsWith("data-")){var d=a.slice(5);return d=dg(d),(function(f,p){f.data==null&&(f.data={});var h=f.data;h.dataset==null&&(h.dataset={}),Object.assign(h.dataset,p)})(t,((l={})[d]=u,l)),void delete r[a]}(function(f,p){f.data==null&&(f.data={});var h=f.data;h.props==null&&(h.props={}),Object.assign(h.props,p)})(t,(c={},c[a]=u,c)),delete r[a]}}else t.key=u})),i.length>0&&i.forEach((function(a){typeof a!="string"&&Rc(a)}))}var Ii=[],Hc={};function pg(t,n,r){return je(r.isInline(t)?"span":"div",null,n)}function hg(t,n){var r,o=F.findKey(n,t),i=n.isInline(t),a=b.isVoid(n,t),l=il(t.type,o.id),c={id:l,key:o.id,"data-slate-node":"element","data-slate-inline":i},u=t.type,d=t.children,f=d===void 0?[]:d,p=(function(D){return Hc[D]||pg})(u);r=a?null:f.map((function(D,w){return Hi(D,w,t,n)}));var h=p(t,r,n);if(a){c["data-slate-void"]=!0;var m=i?"span":"div",g=$(U.texts(t),1),y=$(g[0],1)[0],v=je(m,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},Hi(y,0,t,n));h=je(m,{style:{position:"relative"}},h,v),In.set(y,0),bn.set(y,t)}return h.data==null&&(h.data={}),Object.assign(h.data,c),a||i||(h=(function(D,w){var C=w;return Ii.forEach((function(B){C=B(D,w)})),C})(t,h)),xt((function(){var D=ci(l);D!=null&&(ni.set(o,D),wr.set(t,D),Dr.set(D,t))})),h}function Uc(t,n){return n===void 0&&(n=!1),je("span",{"data-slate-string":!0},n?t+`
|
|
19
|
+
`:t)}function Ri(t,n){return t===void 0&&(t=0),n===void 0&&(n=!1),je("span",{"data-slate-zero-width":n?"n":"z","data-slate-length":t},"\uFEFF",n?je("br",null):null)}function mg(t,n,r){if(t.text==null)throw new Error("Current node is not slate Text ".concat(JSON.stringify(t)));var o=F.findKey(r,t),i=r.getConfig().decorate;if(i==null)throw new Error("Can not get config.decorate");var a,l=F.findPath(r,t),c=i([t,l]),u=K.decorations(t,c),d=u.map((function(h,m){var g=(function(y,v,D,w,C){v===void 0&&(v=!1);var B=y.text,k=F.findPath(C,D),_=A.parent(k);if(b.isEditor(w))throw new Error("Text node ".concat(JSON.stringify(D)," parent is Editor"));return C.isVoid(w)?Ri(U.string(w).length):B!==""||w.children[w.children.length-1]!==D||C.isInline(w)||b.string(C,_)!==""?B===""?Ri():v&&B.slice(-1)===`
|
|
20
|
+
`?Uc(B,!0):Uc(B):Ri(0,!0)})(h,m===u.length-1,t,n,r);return g=(function(y,v){var D=v;return Ii.forEach((function(w){D=w(y,D)})),D})(h,g),je("span",{"data-slate-leaf":!0},g)})),f=(a=o.id,"w-e-text-".concat(a)),p=je("span",{"data-slate-node":"text",id:f,key:o.id},d);return xt((function(){var h=ci(f);h!=null&&(ni.set(o,h),wr.set(t,h),Dr.set(h,t))})),p}function Hi(t,n,r,o){return In.set(t,n),bn.set(t,r),te.isElement(t)?hg(t,o):mg(t,r,o)}function gg(t,n){var r,o,i=t.$scroll,a=(r=t.id,"w-e-textarea-".concat(r)),l=n.getConfig(),c=l.readOnly,u=l.autoFocus,d=(function(D,w){return w===void 0&&(w=!1),ht("div#".concat(D),{props:{contentEditable:!w}})})(a,c),f=n.children||[];d.children=f.map((function(D,w){var C=Hi(D,w,n,n);return Rc(C),C}));var p=Fa.get(t);if(p==null&&(p=!0),p){var h=(function(D){return V(`<div
|
|
21
|
+
id="`.concat(D,`"
|
|
22
|
+
data-slate-editor
|
|
23
|
+
data-slate-node="value"
|
|
24
|
+
suppressContentEditableWarning
|
|
25
|
+
role="textarea"
|
|
26
|
+
spellCheck="true"
|
|
27
|
+
autoCorrect="true"
|
|
28
|
+
autoCapitalize="true"
|
|
29
|
+
></div>`))})(a);i.append(h),t.$textArea=h,o=h[0],(g=eg([ng,sg,cg,rg,ig,tg]))(o,d),Fa.set(t,!1),Va.set(t,g)}else{var m=Oa.get(t),g=Va.get(t);if(m==null||g==null)return;o=m.elm,g(m,d)}if(o!=null||(o=ci(a))!=null){var y;if((p?u:n.isFocused())&&o.focus({preventScroll:!0}),p){var v=(y=o)&&y.ownerDocument&&y.ownerDocument.defaultView||null;v&&Ta.set(n,v)}ti.set(n,o),wr.set(n,o),Dr.set(o,n),Oa.set(t,d)}}var yg=1,bg=(function(){function t(n){var r=this;this.id=yg++,this.$textArea=null,this.$progressBar=V('<div class="w-e-progress-bar"></div>'),this.$maxLengthInfo=V('<div class="w-e-max-length-info"></div>'),this.isComposing=!1,this.isUpdatingSelection=!1,this.isDraggingInternally=!1,this.latestElement=null,this.showPlaceholder=!1,this.$placeholder=null,this.latestEditorSelection=null,this.onDOMSelectionChange=Dc((function(){var l=r.editorInstance;(function(c,u){var d=c.isComposing,f=c.isUpdatingSelection,p=c.isDraggingInternally;if(!(u.getConfig().readOnly||d||f||p)){var h=F.findDocumentOrShadowRoot(u),m=h.activeElement,g=F.toDOMNode(u,u),y=h.getSelection();if(m!==g)return tn.delete(u),void O.deselect(u);if(c.latestElement=m,tn.set(u,!0),!y)return O.deselect(u);var v=y.anchorNode,D=y.focusNode,w=kt(u,v)||wc(u,v),C=kt(u,D)||wc(u,D);if(w&&C){var B=F.toSlateRange(u,y,{exactMatch:!1,suppressThrow:!1});O.select(u,B)}}})(r,l)}),100);var o=V(n);if(o.length===0)throw new Error("Cannot find textarea DOM by selector '".concat(n,"'"));this.$box=o;var i=V('<div class="w-e-text-container"></div>');i.append(this.$progressBar),i.append(this.$maxLengthInfo),o.append(i);var a=V('<div class="w-e-scroll"></div>');i.append(a),this.$scroll=a,this.$textAreaContainer=i,xt((function(){var l=r.editorInstance,c=F.getWindow(l);c.document.addEventListener("selectionchange",r.onDOMSelectionChange),l.on(dt.DESTROYED,(function(){c.document.removeEventListener("selectionchange",r.onDOMSelectionChange)})),i.on("click",(function(){return l.hidePanelOrModal()})),l.on(dt.CHANGE,r.changeViewState.bind(r));var u=l.getConfig(),d=u.onChange,f=u.scroll;d&&l.on(dt.CHANGE,(function(){return d(l)})),f||(o.css("position","relative"),i.addClass("no-scroll")),r.onFocusAndOnBlur(),l.on(dt.CHANGE,r.changeMaxLengthInfo.bind(r)),r.bindEvent()}))}return Object.defineProperty(t.prototype,"editorInstance",{get:function(){var n=Yo.get(this);if(n==null)throw new Error("Can not get editor instance");return n},enumerable:!1,configurable:!0}),t.prototype.bindEvent=function(){var n=this,r=this.$textArea,o=this.$scroll,i=this.editorInstance;r!=null&&(Aa(Ym,(function(a,l){r.on(l,(function(c){a(c,n,i)}))})),i.getConfig().scroll&&(o.css("overflow-y","auto"),o.on("scroll",Dc((function(){i.emit("scroll")}),100))))},t.prototype.onFocusAndOnBlur=function(){var n=this,r=this.editorInstance,o=r.getConfig(),i=o.onBlur,a=o.onFocus;this.latestEditorSelection=r.selection,r.on(dt.CHANGE,(function(){n.latestEditorSelection==null&&r.selection!=null?setTimeout((function(){return a&&a(r)})):n.latestEditorSelection!=null&&r.selection==null&&setTimeout((function(){return i&&i(r)})),n.latestEditorSelection=r.selection}))},t.prototype.changeMaxLengthInfo=function(){var n=this.editorInstance,r=n.getConfig().maxLength;if(r){var o=r-F.getLeftLengthOfMaxLength(n);this.$maxLengthInfo[0].innerHTML="".concat(o,"/").concat(r)}},t.prototype.changeProgress=function(n){var r=this.$progressBar;r.css("width","".concat(n,"%")),n>=100&&setTimeout((function(){r.hide(),r.css("width","0"),r.show()}),1e3)},t.prototype.changeViewState=function(){var n=this,r=this.editorInstance;gg(this,r),(function(o,i){var a,l=i.getConfig().placeholder;if(l){var c=i.isEmpty();if(c&&!o.showPlaceholder&&!o.isComposing){if(o.$placeholder==null){var u=V('<div class="w-e-text-placeholder">'.concat(l,"</div>"));o.$textAreaContainer.append(u),o.$placeholder=u}return o.$placeholder.show(),void(o.showPlaceholder=!0)}!c&&o.showPlaceholder&&((a=o.$placeholder)===null||a===void 0||a.hide(),o.showPlaceholder=!1)}})(this,r),xt((function(){Ec(n,r)}))},t.prototype.destroy=function(){this.$textAreaContainer.remove()},t})();function Wc(t,n,r,o){if(In.set(t,n),bn.set(t,r),te.isElement(t)){var i=t.children;if((i===void 0?[]:i).forEach((function(c,u){return Wc(c,u,t,o)})),b.isVoid(o,t)){var a=$(U.texts(t),1),l=$(a[0],1)[0];In.set(l,0),bn.set(l,t)}}}var Cg=300,qc={heightWarning:{en:"Textarea height < 300px. This may cause modal and hoverbar position error",zh:"编辑区域高度 < 300px 这可能会导致 modal hoverbar 定位异常"}};function vg(t){var n=t.selector,r=n===void 0?"":n,o=t.config,i=o===void 0?{}:o,a=t.content,l=t.html,c=t.plugins,u=c===void 0?[]:c,d=(function(D){return[ym,im,R1,rm,Cm,mm,bm,L1].reduce((function(w,C){return C(w)}),D)})(q0());if(r&&(function(D,w){return rl(D,"data-w-e-textarea",w)})(d,r))throw new Error("Repeated create editor by selector '".concat(r,"'"));var f=(function(D){D===void 0&&(D={});var w=_a(Na),C={},B=D.MENU_CONF,k=B===void 0?{}:B;return Aa(w,(function(_,x){C[x]=me(me({},_),k[x]||{})})),delete D.MENU_CONF,me({scroll:!0,readOnly:!1,autoFocus:!0,decorate:function(){return[]},maxLength:0,MENU_CONF:C,hoverbarKeys:{},customAlert:function(_,x){window.alert("".concat(x,`:
|
|
30
|
+
`).concat(_))}},D)})(i);Sa.set(d,f);var p=f.hoverbarKeys,h=p===void 0?{}:p;if(u.forEach((function(D){d=D(d)})),(function(D,w){var C=w.html,B=w.content;C!=null&&(D.children=ol(D,C)),B&&B.length&&(D.children=B),D.children.length===0&&(D.children=[{type:"paragraph",children:[{text:""}]}])})(d,{html:l,content:a}),r){var m=new bg(r);Go.set(d,m),Yo.set(m,d),m.changeViewState(),xt((function(){var D=m.$scroll;D!=null&&D.height()<Cg&&console.warn("".concat(qc.heightWarning.zh,`
|
|
31
|
+
`).concat(qc.heightWarning.en),{element:D,height:D.height()})}));var g=void 0;Object.keys(h).length>0&&(g=new Hm,Xo.set(g,d),Cr.set(d,g)),d.on(dt.CHANGE,(function(){d.hidePanelOrModal()})),d.on(dt.SCROLL,(function(){d.hidePanelOrModal()}))}else d.children.forEach((function(D,w){return Wc(D,w,d,d)}));var y=f.onCreated,v=f.onDestroyed;return y&&d.on(dt.CREATED,(function(){return y(d)})),v&&d.on(dt.DESTROYED,(function(){return v(d)})),xt((function(){return d.emit("created")})),d}var Dg=(function(){function t(n,r){var o=this;this.$toolbar=V('<div class="w-e-bar w-e-bar-show w-e-toolbar"></div>'),this.menus={},this.toolbarItems=[],this.config={},this.lngListen=function(){},this.changeToolbarState=Ql((function(){o.toolbarItems.forEach((function(l){l.changeMenuState()}))}),200),this.config=r;var i=V(n);if(i.length===0)throw new Error("Cannot find toolbar DOM by selector '".concat(n,"'"));this.$box=i;var a=this.$toolbar;a.on("mousedown",(function(l){return l.preventDefault()}),{passive:!1}),i.append(a),xt((function(){o.initToolbar(),o.lngListen=pc((function(){return o.initToolbar()})),o.getEditorInstance().on(dt.CHANGE,o.changeToolbarState)}))}return t.prototype.getMenus=function(){return this.menus},t.prototype.getConfig=function(){return this.config},t.prototype.initToolbar=function(){this.menus={};var n=this.$toolbar;n?.empty(),this.registerItems(),this.changeToolbarState()},t.prototype.registerItems=function(){var n=this,r="",o=this.$toolbar,i=this.config,a=i.toolbarKeys,l=a===void 0?[]:a,c=i.insertKeys,u=c===void 0?{index:0,keys:[]}:c,d=i.excludeKeys,f=d===void 0?[]:d,p=_a(l);u.keys.length>0&&(typeof u.keys=="string"&&(u.keys=[u.keys]),u.keys.forEach((function(g,y){p.splice(u.index+y,0,g)})));var h=p.filter((function(g){var y=typeof g=="string"?g:g.key;return!f.includes(y)})),m=h.length;h.forEach((function(g,y){if(g==="|"){if(y===0||y+1===m||r==="|")return;var v=hc();return o.append(v),void(r=g)}if(typeof g=="string")return n.registerSingleItem(g,n),void(r=g);n.registerGroup(g),r="group"}))},t.prototype.registerGroup=function(n){var r=this,o=this.$toolbar,i=(function(d){return new gc(d)})(n),a=n.menuKeys,l=a===void 0?[]:a,c=this.config.excludeKeys,u=c===void 0?[]:c;l.forEach((function(d){u.includes(d)||r.registerSingleItem(d,i)})),o.append(i.$elem)},t.prototype.registerSingleItem=function(n,r){var o=this.getEditorInstance(),i=r instanceof gc,a=this.menus,l=a[n];if(l==null){var c=$n[n];if(c==null)throw new Error("Not found menu item factory by key '".concat(n,"'"));if(typeof c!="function")throw new Error("Menu item factory (key='".concat(n,"') is not a function"));l=c(),a[n]=l}else console.warn("Duplicated toolbar menu key '".concat(n,`'
|
|
32
|
+
重复注册了菜单栏 menu '`).concat(n,"'"));var u=o.getMenuConfig(n);u&&u.iconSvg!==void 0&&(l.iconSvg=u.iconSvg);var d=bc(n,l,i);this.toolbarItems.push(d),Qo.set(d,o),i?r.appendBarItem(d):r.$toolbar.append(d.$elem)},t.prototype.getEditorInstance=function(){var n=Zo.get(this);if(n==null)throw new Error("Can not get editor instance");return n},t.prototype.destroy=function(){var n;this.$toolbar.remove(),(n=this.lngListen)===null||n===void 0||n.call(this),this.menus={},this.toolbarItems=[]},t})();function wg(t,n){if(t==null)throw new Error("Cannot create toolbar, because editor is null");var r=n.selector,o=n.config,i=o===void 0?{}:o;if((function(c,u){return rl(c,"data-w-e-toolbar",u)})(t,r))throw new Error("Repeated create toolbar by selector '".concat(r,"'"));var a=me({toolbarKeys:[],excludeKeys:[],insertKeys:{index:0,keys:[]},modalAppendToBody:!1},i||{}),l=new Dg(r,a);return Zo.set(l,t),br.set(t,l),l}kn("en",{editor:{more:"More",justify:"Justify",indent:"Indent",image:"Image",video:"Video"}}),kn("zh-CN",{editor:{more:"更多",justify:"对齐",indent:"缩进",image:"图片",video:"视频"}}),kn("en",{common:{ok:"OK",delete:"Delete",enter:"Enter"},blockQuote:{title:"Quote"},codeBlock:{title:"Code block"},color:{color:"Font color",bgColor:"Back color",default:"Default color",clear:"Clear back color"},divider:{title:"Divider"},emotion:{title:"Emotion"},fontSize:{title:"Font size",default:"Default"},fontFamily:{title:"Font family",default:"Default"},fullScreen:{title:"Full screen",cancelTitle:"Cancel full screen"},header:{title:"Header",text:"Text"},image:{netImage:"Net image",delete:"Delete image",edit:"Edit image",editSize:"Edit size",viewLink:"View link",src:"Image src",desc:"Description",link:"Image link",ok:"Ok",width:"Width",height:"Height"},indent:{decrease:"Decrease",increase:"Increase"},justify:{left:"Left",right:"Right",center:"Center",justify:"Justify"},lineHeight:{title:"Line height",default:"Default"},link:{insert:"Insert link",text:"Link text",url:"Link source",unLink:"Unlink",edit:"Edit link",view:"View link"},textStyle:{bold:"Bold",clear:"Clear styles",code:"Inline code",italic:"Italic",sub:"Sub",sup:"Sup",through:"Through",underline:"Underline"},undo:{undo:"undo",redo:"Redo"},todo:{todo:"Todo"},formatPainter:{title:"Format Painter"}}),kn("zh-CN",{common:{ok:"确定",delete:"删除",enter:"回车"},blockQuote:{title:"引用"},codeBlock:{title:"代码块"},color:{color:"文字颜色",bgColor:"背景色",default:"默认颜色",clear:"清除背景色"},divider:{title:"分割线"},emotion:{title:"表情"},fontSize:{title:"字号",default:"默认字号"},fontFamily:{title:"字体",default:"默认字体"},fullScreen:{title:"全屏",cancelTitle:"取消全屏"},header:{title:"标题",text:"正文"},image:{netImage:"网络图片",delete:"删除图片",edit:"编辑图片",editSize:"修改尺寸",viewLink:"查看链接",src:"图片地址",desc:"图片描述",link:"图片链接",ok:"确定",width:"宽度",height:"高度"},indent:{decrease:"减少缩进",increase:"增加缩进"},justify:{left:"左对齐",right:"右对齐",center:"居中对齐",justify:"两端对齐"},lineHeight:{title:"行高",default:"默认行高"},link:{insert:"插入链接",text:"链接文本",url:"链接地址",unLink:"取消链接",edit:"修改链接",view:"查看链接"},textStyle:{bold:"粗体",clear:"清除格式",code:"行内代码",italic:"斜体",sub:"下标",sup:"上标",through:"删除线",underline:"下划线"},undo:{undo:"撤销",redo:"重做"},todo:{todo:"待办"},formatPainter:{title:"格式刷"}});var Kc='<svg viewBox="0 0 1024 1024"><path d="M133.705143 335.433143V133.851429h201.581714a29.622857 29.622857 0 0 0 29.622857-29.549715V68.754286a29.622857 29.622857 0 0 0-29.622857-29.622857H61.732571A22.893714 22.893714 0 0 0 38.765714 62.025143V335.725714c0 16.310857 13.238857 29.622857 29.622857 29.622857h35.547429a29.842286 29.842286 0 0 0 29.696-29.842285zM690.980571 133.851429h201.581715v201.654857c0 16.310857 13.238857 29.549714 29.622857 29.549714h35.547428a29.622857 29.622857 0 0 0 29.549715-29.549714V61.952a22.893714 22.893714 0 0 0-22.820572-22.893714h-273.554285a29.622857 29.622857 0 0 0-29.549715 29.622857v35.547428c0 16.310857 13.238857 29.696 29.622857 29.696zM335.286857 892.781714H133.705143V691.2a29.622857 29.622857 0 0 0-29.622857-29.622857H68.534857a29.622857 29.622857 0 0 0-29.549714 29.622857v273.554286c0 12.653714 10.24 22.893714 22.820571 22.893714h273.554286a29.622857 29.622857 0 0 0 29.696-29.622857v-35.547429a29.769143 29.769143 0 0 0-29.769143-29.696z m557.348572-201.581714v201.581714H690.907429a29.622857 29.622857 0 0 0-29.622858 29.622857v35.547429c0 16.310857 13.238857 29.622857 29.622858 29.622857h273.554285c12.580571 0 22.893714-10.313143 22.893715-22.893714V691.2a29.622857 29.622857 0 0 0-29.622858-29.622857h-35.547428a29.622857 29.622857 0 0 0-29.696 29.622857z"></path></svg>';function Ui(t){return V("<div>".concat(t,"</div>")).children().filter((function(n){return n.tagName!=="BR"})).length===0}function _n(t){return t.length===0?"":t[0].outerHTML}function ao(t){return t.length?t[0].tagName.toLowerCase():""}function It(t,n){for(var r="",o=(t.attr("style")||"").split(";"),i=o.length,a=0;a<i;a+=1){var l=o[a];if(l){var c=l.split(":");c[0].trim()===n&&(r=c[1].trim())}}return r}Pr&&(V.fn.css=Pr),vn&&(V.fn.append=vn),qa&&(V.fn.prepend=qa),Er&&(V.fn.addClass=Er),_r&&(V.fn.removeClass=_r),Ar&&(V.fn.hasClass=Ar),Vr&&(V.fn.on=Vr),Ia&&(V.fn.off=Ia),qr&&(V.fn.focus=qr),Cn&&(V.fn.attr=Cn),Nr&&(V.fn.removeAttr=Nr),jr&&(V.fn.hide=jr),Lr&&(V.fn.show=Lr),Ir&&(V.fn.parents=Ir),Sr&&(V.fn.dataset=Sr),Fr&&(V.fn.val=Fr),zr&&(V.fn.text=zr),Mr&&(V.fn.html=Mr),Hr&&(V.fn.children=Hr),Ur&&(V.fn.remove=Ur),Rr&&(V.fn.find=Rr),Or&&(V.fn.width=Or),Tr&&(V.fn.height=Tr),Ua&&(V.fn.filter=Ua),Wr&&(V.fn.empty=Wr);var Jc=(function(){function t(){this.tag="button",this.showDropPanel=!0,this.$content=null}return t.prototype.exec=function(n,r){},t.prototype.getValue=function(n){var r=this.mark,o=b.marks(n);return o&&o[r]?o[r]:""},t.prototype.isActive=function(n){return!!this.getValue(n)},t.prototype.isDisabled=function(n){if(n.selection==null)return!0;var r=$(b.nodes(n,{match:function(o){return F.getNodeType(o)==="pre"||!!b.isVoid(n,o)},universal:!0}),1);return!!r[0]},t.prototype.getPanelContentElem=function(n){var r=this.mark;if(this.$content==null){var o=V('<ul class="w-e-panel-content-color"></ul>');o.on("click","li",(function(d){var f=d.target;if(f!=null&&(d.preventDefault(),n.selection!=null)){var p=V(f).attr("data-value");p==="0"?b.removeMark(n,r):b.addMark(n,r,p)}})),this.$content=o}var i=this.$content;if(i==null)return document.createElement("ul");i.empty();var a=this.getValue(n),l=n.getMenuConfig(r).colors;(l===void 0?[]:l).forEach((function(d){var f=V('<div class="color-block" data-value="'.concat(d,'"></div>'));f.css("background-color",d);var p=V('<li data-value="'.concat(d,'"></li>'));a===d&&p.addClass("active"),p.append(f),i.append(p)}));var c="";r==="color"&&(c=ae("color.default")),r==="bgColor"&&(c=ae("color.clear"));var u=V(`
|
|
33
|
+
<li data-value="0" class="clear">
|
|
34
|
+
`.concat('<svg viewBox="0 0 1024 1024"><path d="M236.8 128L896 787.2V128H236.8z m614.4 704L192 172.8V832h659.2zM192 64h704c38.4 0 64 25.6 64 64v704c0 38.4-25.6 64-64 64H192c-38.4 0-64-25.6-64-64V128c0-38.4 25.6-64 64-64z"></path></svg>',`
|
|
35
|
+
`).concat(c,`
|
|
36
|
+
</li>
|
|
37
|
+
`));return i.prepend(u),i[0]},t})(),Bg=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title=ae("color.bgColor"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M510.030769 315.076923l84.676923 196.923077h-177.230769l76.8-196.923077h15.753846zM945.230769 157.538462v708.923076c0 43.323077-35.446154 78.769231-78.769231 78.769231H157.538462c-43.323077 0-78.769231-35.446154-78.769231-78.769231V157.538462c0-43.323077 35.446154-78.769231 78.769231-78.769231h708.923076c43.323077 0 78.769231 35.446154 78.769231 78.769231z m-108.307692 643.938461L600.615385 216.615385c-5.907692-11.815385-15.753846-19.692308-29.538462-19.692308h-139.815385c-11.815385 0-23.630769 7.876923-27.56923 19.692308l-216.615385 584.861538c-3.938462 11.815385 3.938462 25.6 17.723077 25.6h80.738462c11.815385 0 23.630769-9.846154 27.56923-21.661538l63.015385-175.261539h263.876923l68.923077 175.261539c3.938462 11.815385 15.753846 21.661538 27.569231 21.661538h80.738461c13.784615 0 23.630769-13.784615 19.692308-25.6z"></path></svg>',r.mark="bgColor",r}return ve(n,t),n})(Jc),xg=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title=ae("color.color"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M64 864h896v96H64zM360.58 576h302.85l81.53 224h102.16L579.24 64H444.77L176.89 800h102.16l81.53-224zM512 159.96L628.49 480H395.52L512 159.96z"></path></svg>',r.mark="color",r}return ve(n,t),n})(Jc),Gc=["rgb(0, 0, 0)","rgb(38, 38, 38)","rgb(89, 89, 89)","rgb(140, 140, 140)","rgb(191, 191, 191)","rgb(217, 217, 217)","rgb(233, 233, 233)","rgb(245, 245, 245)","rgb(250, 250, 250)","rgb(255, 255, 255)","rgb(225, 60, 57)","rgb(231, 95, 51)","rgb(235, 144, 58)","rgb(245, 219, 77)","rgb(114, 192, 64)","rgb(89, 191, 192)","rgb(66, 144, 247)","rgb(54, 88, 226)","rgb(106, 57, 201)","rgb(216, 68, 147)","rgb(251, 233, 230)","rgb(252, 237, 225)","rgb(252, 239, 212)","rgb(252, 251, 207)","rgb(231, 246, 213)","rgb(218, 244, 240)","rgb(217, 237, 250)","rgb(224, 232, 250)","rgb(237, 225, 248)","rgb(246, 226, 234)","rgb(255, 163, 158)","rgb(255, 187, 150)","rgb(255, 213, 145)","rgb(255, 251, 143)","rgb(183, 235, 143)","rgb(135, 232, 222)","rgb(145, 213, 255)","rgb(173, 198, 255)","rgb(211, 173, 247)","rgb(255, 173, 210)","rgb(255, 77, 79)","rgb(255, 122, 69)","rgb(255, 169, 64)","rgb(255, 236, 61)","rgb(115, 209, 61)","rgb(54, 207, 201)","rgb(64, 169, 255)","rgb(89, 126, 247)","rgb(146, 84, 222)","rgb(247, 89, 171)","rgb(207, 19, 34)","rgb(212, 56, 13)","rgb(212, 107, 8)","rgb(212, 177, 6)","rgb(56, 158, 13)","rgb(8, 151, 156)","rgb(9, 109, 217)","rgb(29, 57, 196)","rgb(83, 29, 171)","rgb(196, 29, 127)","rgb(130, 0, 20)","rgb(135, 20, 0)","rgb(135, 56, 0)","rgb(97, 71, 0)","rgb(19, 82, 0)","rgb(0, 71, 79)","rgb(0, 58, 140)","rgb(6, 17, 120)","rgb(34, 7, 94)","rgb(120, 6, 80)"],kg={selector:"font",preParseHtml:function(t){var n=V(t);if(ao(n)!=="font")return t;var r=n.attr("color")||"";return r&&(n.removeAttr("color"),n.css("color",r)),n[0]}};function on(t,n){t.data==null&&(t.data={});var r=t.data;r.style==null&&(r.style={}),Object.assign(r.style,n)}var Eg={renderStyle:function(t,n){var r=t,o=r.color,i=r.bgColor,a=n;return o&&on(a,{color:o}),i&&on(a,{backgroundColor:i}),a},styleToHtml:function(t,n){if(!K.isText(t))return n;var r,o=t,i=o.color,a=o.bgColor;return i||a?((Ui(n)||ao(r=V(n))!=="span")&&(r=V("<span>".concat(n,"</span>"))),i&&r.css("color",i),a&&r.css("background-color",a),_n(r)):n},preParseHtml:[kg],parseStyleHtml:function(t,n,r){var o=V(t);if(!K.isText(n))return n;var i=n,a=It(o,"color");a&&(i.color=a);var l=It(o,"background-color");return l||(l=It(o,"background")),l&&(i.bgColor=l),i},menus:[{key:"color",factory:function(){return new xg},config:{colors:Gc}},{key:"bgColor",factory:function(){return new Bg},config:{colors:Gc}}]},_g=(function(){function t(){this.title=ae("common.enter"),this.iconSvg='<svg viewBox="0 0 1255 1024"><path d="M1095.111111 731.477333h-625.777778V1024L0 658.318222 469.333333 292.408889v292.636444h625.777778V0h156.444445v731.477333z"></path></svg>',this.tag="button"}return t.prototype.getValue=function(n){return""},t.prototype.isActive=function(n){return!1},t.prototype.isDisabled=function(n){var r=n.selection;return r==null||!!j.isExpanded(r)},t.prototype.exec=function(n,r){var o=n.selection;if(o!=null){var i=[o.anchor.path[0]];O.insertNodes(n,{type:"paragraph",children:[{text:""}]},{at:i}),n.select(b.start(n,i))}},t})(),Ag={menus:[{key:"enter",factory:function(){return new _g}}]},Ng={type:"divider",elemToHtml:function(t,n){return"<hr/>"}},Sg=(function(){function t(){this.title=ae("divider.title"),this.iconSvg='<svg viewBox="0 0 1092 1024"><path d="M0 51.2m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M819.2 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M409.6 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 870.4m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path></svg>',this.tag="button"}return t.prototype.getValue=function(n){return""},t.prototype.isActive=function(n){return!1},t.prototype.isDisabled=function(n){return n.selection==null||!!F.getSelectedElems(n).some((function(r){if(n.isVoid(r))return!0;var o=F.getNodeType(r);return o==="table"||o==="pre"}))},t.prototype.exec=function(n,r){F.isSelectedEmptyParagraph(n)&&O.removeNodes(n,{mode:"highest"}),O.insertNodes(n,{type:"divider",children:[{text:""}]},{mode:"highest"})},t})(),Fg={renderElems:[{type:"divider",renderElem:function(t,n,r){return ht("div",{props:{contentEditable:!1,className:"w-e-textarea-divider"},dataset:{selected:F.isNodeSelected(r,t)?"true":""},style:{},on:{mousedown:function(o){return o.preventDefault()}}},[ht("hr")])}}],elemsToHtml:[Ng],parseElemsHtml:[{selector:"hr:not([data-w-e-type])",parseElemHtml:function(t,n,r){return{type:"divider",children:[{text:""}]}}}],menus:[{key:"divider",factory:function(){return new Sg}}],editorPlugin:function(t){var n=t.isVoid,r=t.normalizeNode,o=t;return o.isVoid=function(i){return i.type==="divider"||n(i)},o.normalizeNode=function(i){var a=$(i,2),l=a[0],c=a[1];if(F.getNodeType(l)!=="divider")return r([l,c]);F.isLastNode(o,l)&&O.insertNodes(o,F.genEmptyParagraph(),{at:[c[0]+1]})},o}},Vg=(function(){function t(){this.title=ae("emotion.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m0-102.4c226.742857 0 409.6-182.857143 409.6-409.6S738.742857 102.4 512 102.4 102.4 285.257143 102.4 512s182.857143 409.6 409.6 409.6z m-204.8-358.4h409.6c0 113.371429-91.428571 204.8-204.8 204.8s-204.8-91.428571-204.8-204.8z m0-102.4c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8 76.8 32.914286 76.8 76.8-32.914286 76.8-76.8 76.8z m409.6 0c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8c43.885714 0 76.8 32.914286 76.8 76.8s-32.914286 76.8-76.8 76.8z"></path></svg>',this.tag="button",this.showDropPanel=!0,this.$content=null}return t.prototype.exec=function(n,r){},t.prototype.getValue=function(n){return""},t.prototype.isActive=function(n){return!1},t.prototype.isDisabled=function(n){if(n.selection==null)return!0;var r=$(b.nodes(n,{match:function(o){return F.getNodeType(o)==="pre"||!!b.isVoid(n,o)},universal:!0}),1);return!!r[0]},t.prototype.getPanelContentElem=function(n){if(this.$content==null){var r=V('<ul class="w-e-panel-content-emotion"></ul>');r.on("click","li",(function(a){var l=a.target;if(l!=null){a.preventDefault();var c=V(l).text();n.insertText(c)}})),this.$content=r}var o=this.$content;if(o==null)return document.createElement("ul");o.empty();var i=n.getMenuConfig("emotion").emotions;return(i===void 0?[]:i).forEach((function(a){var l=V("<li>".concat(a,"</li>"));o.append(l)})),o[0]},t})(),Og={menus:[{key:"emotion",factory:function(){return new Vg},config:{emotions:"😀 😃 😄 😁 😆 😅 😂 🤣 😊 😇 🙂 🙃 😉 😌 😍 😘 😗 😙 😚 😋 😛 😝 😜 🤓 😎 😏 😒 😞 😔 😟 😕 🙁 😣 😖 😫 😩 😢 😭 😤 😠 😡 😳 😱 😨 🤗 🤔 😶 😑 😬 🙄 😯 😴 😷 🤑 😈 🤡 💩 👻 💀 👀 👣 👐 🙌 👏 🤝 👍 👎 👊 ✊ 🤛 🤜 🤞 ✌️ 🤘 👌 👈 👉 👆 👇 ☝️ ✋ 🤚 🖐 🖖 👋 🤙 💪 🖕 ✍️ 🙏".split(" ")}}]},Yc=(function(){function t(){this.tag="select",this.width=80}return t.prototype.isActive=function(n){return!1},t.prototype.getValue=function(n){var r=this.mark,o=b.marks(n);return o&&o[r]?o[r]:""},t.prototype.isDisabled=function(n){if(n.selection==null)return!0;var r=$(b.nodes(n,{match:function(o){return F.getNodeType(o)==="pre"||!!b.isVoid(n,o)},universal:!0}),1);return!!r[0]},t.prototype.exec=function(n,r){var o=this.mark;r?n.addMark(o,r):n.removeMark(o)},t})(),Tg=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title=ae("fontFamily.title"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M956.788364 152.110545h-24.110546l23.924364 9.029819 0.186182 121.018181h-65.070546l-86.574545-130.048H566.551273v650.14691l130.048 64.977454v65.163636h-390.050909v-65.163636l129.954909-64.977454V152.110545H198.283636L111.429818 282.065455H46.545455V69.259636C46.545455 33.792 82.664727 22.062545 98.955636 22.062545h812.683637c23.738182 0 45.056 15.173818 45.056 41.053091V169.425455v-17.221819z"></path></svg>',r.mark="fontFamily",r.selectPanelWidth=150,r}return ve(n,t),n.prototype.getOptions=function(r){var o=[],i=r.getMenuConfig(this.mark).fontFamilyList,a=i===void 0?[]:i;o.push({text:ae("fontFamily.default"),value:""}),a.forEach((function(u){if(typeof u=="string")o.push({text:u,value:u,styleForRenderMenuList:{"font-family":u}});else if(typeof u=="object"){var d=u.name,f=u.value;o.push({text:d,value:f,styleForRenderMenuList:{"font-family":f}})}}));var l=this.getValue(r),c=!1;return o.forEach((function(u){u.value===l?(c=!0,u.selected=!0):u.selected=void 0})),c||typeof l!="string"||o.push({text:l,value:l,selected:!0}),o},n})(Yc),jg=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title=ae("fontSize.title"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M64 512h384v128h-128V1024h-128V640h-128z m896-256H708.2496v768h-136.4992V256H320V128h640z"></path></svg>',r.mark="fontSize",r}return ve(n,t),n.prototype.getOptions=function(r){var o=[],i=r.getMenuConfig(this.mark).fontSizeList,a=i===void 0?[]:i;o.push({text:ae("fontSize.default"),value:""}),a.forEach((function(u){if(typeof u=="string")o.push({text:u,value:u});else if(typeof u=="object"){var d=u.name,f=u.value;o.push({text:d,value:f})}}));var l=this.getValue(r),c=!1;return o.forEach((function(u){u.value===l?(c=!0,u.selected=!0):u.selected=void 0})),c||typeof l!="string"||o.push({text:l,value:l,selected:!0}),o},n})(Yc),Lg={1:"12px",2:"14px",3:"16px",4:"19px",5:"24px",6:"32px",7:"48px"},Pg={renderStyle:function(t,n){var r=t,o=r.fontSize,i=r.fontFamily,a=n;return o&&on(a,{fontSize:o}),i&&on(a,{fontFamily:i}),a},styleToHtml:function(t,n){if(!K.isText(t))return n;var r,o=t,i=o.fontSize,a=o.fontFamily;return i||a?((Ui(n)||ao(r=V(n))!=="span")&&(r=V("<span>".concat(n,"</span>"))),i&&r.css("font-size",i),a&&r.css("font-family",a),_n(r)):n},preParseHtml:[{selector:"font",preParseHtml:function(t){var n=V(t);if(ao(n)!=="font")return t;var r=n.attr("size")||"";r&&(n.removeAttr("size"),n.css("font-size",Lg[r]));var o=n.attr("face")||"";return o&&(n.removeAttr("face"),n.css("font-family",o)),n[0]}}],parseStyleHtml:function(t,n,r){var o=V(t);if(!K.isText(n))return n;var i=n,a=It(o,"font-size");a&&(i.fontSize=a);var l=It(o,"font-family").replace(/"/g,"");return l&&(i.fontFamily=l),i},menus:[{key:"fontSize",factory:function(){return new jg},config:{fontSizeList:["12px",{name:"13px",value:"13px"},"14px","15px","16px","19px",{name:"22px",value:"22px"},"24px","29px","32px","40px","48px"]}},{key:"fontFamily",factory:function(){return new Tg},config:{fontFamilyList:["黑体",{name:"仿宋",value:"仿宋"},"楷体","标楷体","华文仿宋","华文楷体",{name:"宋体",value:"宋体"},"微软雅黑","Arial","Tahoma","Verdana","Times New Roman","Courier New"]}}]},Wi=(function(){function t(){this.title=ae("formatPainter.title"),this.iconSvg='<svg viewBox="0 0 24 24"><path d="M8 19.997v-5h2v5h9v-7H5v7zm-4-9h16v-3h-6v-4h-4v4H4zm-1 10v-8H2v-6a1 1 0 0 1 1-1h5v-3a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v3h5a1 1 0 0 1 1 1v6h-1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1"/></svg>',this.tag="button"}return t.prototype.getValue=function(n){return""},t.prototype.isActive=function(n){return t.attrs.isSelect},t.prototype.isDisabled=function(n){return!1},t.prototype.setFormatHtml=function(n){var r,o;if(n.getSelectionText().length){if(t.attrs.formatStyle){(function(d){var f=b.marks(d);f&&Object.keys(f).forEach((function(p){d.removeMark(p)}))})(n);try{for(var i=st(Object.entries(t.attrs.formatStyle)),a=i.next();!a.done;a=i.next()){var l=$(a.value,2),c=l[0],u=l[1];n.addMark(c,u)}}catch(d){r={error:d}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}}t.attrs.formatStyle=null,t.attrs.isSelect=!1}},t.prototype.exec=function(n){t.attrs.isSelect?(t.attrs.isSelect=!1,t.attrs.formatStyle=null):n.getSelectionText().length&&(t.attrs.formatStyle=b.marks(n),t.attrs.isSelect=!0),n.blur(),n.focus()},t.attrs={isSelect:!1,formatStyle:null},t})(),Mg={menus:[{key:"formatPainter",factory:function(){return new Wi}}],editorPlugin:function(t){var n=new Wi,r=t.onChange,o=t,i=function(){n.setFormatHtml(o),document.removeEventListener("mouseup",i)};return o.onChange=function(){r(),Wi.attrs.isSelect&&(document.removeEventListener("mouseup",i),document.addEventListener("mouseup",i))},o}},zg=(function(){function t(){this.title=ae("fullScreen.title"),this.iconSvg=Kc,this.tag="button",this.alwaysEnable=!0}return t.prototype.getValue=function(n){return""},t.prototype.isActive=function(n){return n.isFullScreen},t.prototype.isDisabled=function(n){return!1},t.prototype.getIcon=function(n){return n.isFullScreen?Kc:'<svg t="1723361745825" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8705" width="200" height="200"><path d="M703.926857 362.642286a42.642286 42.642286 0 0 1-42.642286-42.642286V128a42.642286 42.642286 0 1 1 85.357715 0v149.357714h149.357714c21.211429 0 38.765714 15.433143 42.057143 35.693715l0.585143 6.948571a42.642286 42.642286 0 0 1-42.642286 42.642286H703.926857zM703.926857 938.642286a42.642286 42.642286 0 0 1-42.642286-42.642286V704c0-23.552 19.090286-42.642286 42.642286-42.642286h192.073143a42.642286 42.642286 0 1 1 0 85.284572l-149.357714 0.073143v149.284571c0 21.211429-15.506286 38.765714-35.84 42.130286l-6.875429 0.512zM319.853714 938.642286a42.642286 42.642286 0 0 1-42.642285-42.642286v-149.284571H127.853714a42.642286 42.642286 0 0 1-42.130285-35.84l-0.585143-6.875429c0-23.552 19.163429-42.642286 42.715428-42.642286h192c23.552 0 42.715429 19.017143 42.715429 42.642286v192a42.642286 42.642286 0 0 1-42.715429 42.642286zM127.853714 362.642286a42.642286 42.642286 0 1 1 0-85.284572H277.211429V128c0-21.211429 15.433143-38.765714 35.766857-42.130286l6.875428-0.512c23.552 0 42.715429 19.017143 42.715429 42.642286v192a42.642286 42.642286 0 0 1-42.715429 42.642286H127.853714z" fill="#333333" p-id="8706"></path></svg>'},t.prototype.getTitle=function(n){return n.isFullScreen?ae("fullScreen.title"):ae("fullScreen.cancelTitle")},t.prototype.exec=function(n,r){n.isFullScreen?n.unFullScreen():n.fullScreen()},t})(),$g={menus:[{key:"fullScreen",factory:function(){return new zg}}]};function An(t){return function(n,r){return"<h".concat(t,">").concat(r,"</h").concat(t,">")}}var Ig={type:"header1",elemToHtml:An(1)},Rg={type:"header2",elemToHtml:An(2)},Hg={type:"header3",elemToHtml:An(3)},Ug={type:"header4",elemToHtml:An(4)},Wg={type:"header5",elemToHtml:An(5)},qg={type:"header6",elemToHtml:An(6)};function Zc(t){var n=$(b.nodes(t,{match:function(i){return F.getNodeType(i).startsWith("header")},universal:!0}),1),r=n[0];if(r==null)return"paragraph";var o=$(r,1)[0];return F.getNodeType(o)}function Xc(t){if(t.selection==null)return!0;var n=$(b.nodes(t,{match:function(r){var o=F.getNodeType(r);return o==="paragraph"||!!o.startsWith("header")},universal:!0,mode:"highest"}),1);return!n[0]}function Qc(t,n){n&&O.setNodes(t,{type:n})}var Nn=(function(){function t(){this.tag="button"}return t.prototype.getValue=function(n){return Zc(n)},t.prototype.isActive=function(n){return this.getValue(n)===this.type},t.prototype.isDisabled=function(n){return Xc(n)},t.prototype.exec=function(n,r){var o=this.type;Qc(n,r===o?"paragraph":o)},t})(),Kg=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title="H1",r.type="header1",r}return ve(n,t),n})(Nn),Jg=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title="H2",r.type="header2",r}return ve(n,t),n})(Nn),Gg=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title="H3",r.type="header3",r}return ve(n,t),n})(Nn),Yg=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title="H4",r.type="header4",r}return ve(n,t),n})(Nn),Zg=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title="H5",r.type="header5",r}return ve(n,t),n})(Nn),Xg=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title="H6",r.type="header6",r}return ve(n,t),n})(Nn),Qg=(function(){function t(){this.title=ae("header.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M960 960c-51.2 0-102.4-3.2-153.6-3.2-51.2 0-99.2 3.2-150.4 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 57.6-28.8 86.4-48 19.2-12.8 19.2-60.8 19.2-80v-224-19.2c-9.6-3.2-19.2-3.2-28.8-3.2H320c-9.6 0-19.2 0-28.8 3.2V780.8c0 22.4 0 80 22.4 92.8 28.8 19.2 96-6.4 96 44.8 0 16-9.6 41.6-28.8 41.6-54.4 0-105.6-3.2-160-3.2-48 0-96 3.2-147.2 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 51.2-28.8 80-48 19.2-12.8 19.2-60.8 19.2-83.2V294.4c0-28.8 3.2-115.2-22.4-131.2-25.6-16-86.4 9.6-86.4-41.6 0-16 6.4-41.6 28.8-41.6 51.2 0 105.6 3.2 156.8 3.2 48 0 96-3.2 144-3.2 19.2 0 28.8 22.4 28.8 41.6 0 48-57.6 25.6-83.2 41.6-19.2 12.8-19.2 73.6-19.2 92.8v201.6c6.4 3.2 16 3.2 22.4 3.2h400c6.4 0 12.8 0 22.4-3.2V256c0-22.4 0-80-19.2-92.8-28.8-16-86.4 6.4-86.4-41.6 0-16 9.6-41.6 28.8-41.6 51.2 0 99.2 3.2 150.4 3.2 48 0 99.2-3.2 147.2-3.2 19.2 0 28.8 22.4 28.8 41.6 0 51.2-57.6 25.6-86.4 41.6-19.2 12.8-19.2 70.4-19.2 92.8v537.6c0 19.2 0 67.2 19.2 80 28.8 19.2 89.6-6.4 89.6 44.8 0 19.2-6.4 41.6-28.8 41.6z"></path></svg>',this.tag="select",this.width=60}return t.prototype.getOptions=function(n){var r=[{value:"header1",text:"H1",styleForRenderMenuList:{"font-size":"32px","font-weight":"bold"}},{value:"header2",text:"H2",styleForRenderMenuList:{"font-size":"24px","font-weight":"bold"}},{value:"header3",text:"H3",styleForRenderMenuList:{"font-size":"18px","font-weight":"bold"}},{value:"header4",text:"H4",styleForRenderMenuList:{"font-size":"16px","font-weight":"bold"}},{value:"header5",text:"H5",styleForRenderMenuList:{"font-size":"13px","font-weight":"bold"}},{value:"header6",text:"H6",styleForRenderMenuList:{"font-size":"11px","font-weight":"bold"}},{value:"paragraph",text:ae("header.text")}],o=this.getValue(n).toString();return r.forEach((function(i){i.value===o?i.selected=!0:i.selected=void 0})),r},t.prototype.isActive=function(n){return!1},t.prototype.getValue=function(n){return Zc(n)},t.prototype.isDisabled=function(n){return Xc(n)},t.prototype.exec=function(n,r){Qc(n,r.toString())},t})(),e2={key:"headerSelect",factory:function(){return new Qg}},t2={key:"header1",factory:function(){return new Kg}},n2={key:"header2",factory:function(){return new Jg}},r2={key:"header3",factory:function(){return new Gg}},o2={key:"header4",factory:function(){return new Yg}},i2={key:"header5",factory:function(){return new Zg}},s2={key:"header6",factory:function(){return new Xg}};function Sn(t){return function(n,r,o){var i=V(n);return(r=r.filter((function(a){return!!K.isText(a)||!!o.isInline(a)}))).length===0&&(r=[{text:i.text().replace(/\s+/gm," ")}]),{type:"header".concat(t),children:r}}}var a2={selector:"h1:not([data-w-e-type])",parseElemHtml:Sn(1)},l2={selector:"h2:not([data-w-e-type])",parseElemHtml:Sn(2)},c2={selector:"h3:not([data-w-e-type])",parseElemHtml:Sn(3)},u2={selector:"h4:not([data-w-e-type])",parseElemHtml:Sn(4)},d2={selector:"h5:not([data-w-e-type])",parseElemHtml:Sn(5)},f2={selector:"h6:not([data-w-e-type])",parseElemHtml:Sn(6)};function Fn(t){return function(n,r,o){return je("h".concat(t),null,r)}}var p2={renderElems:[{type:"header1",renderElem:Fn(1)},{type:"header2",renderElem:Fn(2)},{type:"header3",renderElem:Fn(3)},{type:"header4",renderElem:Fn(4)},{type:"header5",renderElem:Fn(5)},{type:"header6",renderElem:Fn(6)}],elemsToHtml:[Ig,Rg,Hg,Ug,Wg,qg],parseElemsHtml:[a2,l2,c2,u2,d2,f2],menus:[e2,t2,n2,r2,o2,i2,s2],editorPlugin:function(t){var n=t.insertBreak,r=t;return r.insertBreak=function(){var o=$(b.nodes(r,{match:function(a){return F.getNodeType(a).startsWith("header")},universal:!0}),1),i=o[0];i&&F.isSelectionAtLineEnd(t,i[1])?O.insertNodes(r,{type:"paragraph",children:[{text:""}]},{mode:"highest"}):n()},r}},eu=(function(){function t(){this.tag="button"}return t.prototype.getValue=function(n){var r=$(b.nodes(n,{match:function(i){return!!i.indent},universal:!0}),1),o=r[0];return o==null?"":$(o,1)[0].indent||""},t.prototype.isActive=function(n){return!1},t.prototype.getMatchNode=function(n){var r=$(b.nodes(n,{match:function(i){var a=F.getNodeType(i);return a==="paragraph"||!!a.startsWith("header")},universal:!0,mode:"highest"}),1),o=r[0];return o==null?null:o[0]},t})(),h2=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title=ae("indent.decrease"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m256-512v384l-256-192z"></path></svg>',r}return ve(n,t),n.prototype.isDisabled=function(r){var o=this.getMatchNode(r);return o==null||!o.indent},n.prototype.exec=function(r,o){O.setNodes(r,{indent:null},{match:function(i){return te.isElement(i)}})},n})(eu),m2=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title=ae("indent.increase"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>',r.DEFAULT_INDENT_VALUE="2em",r}return ve(n,t),n.prototype.isDisabled=function(r){var o=this.getMatchNode(r);return o==null||!!o.indent},n.prototype.getIndentValue=function(r){var o=this.getMatchNode(r);if(!o)return this.DEFAULT_INDENT_VALUE;var i=o.children.filter(K.isText)[0];if(!i||!i.fontSize)return this.DEFAULT_INDENT_VALUE;var a=i.fontSize,l=parseInt(i.fontSize,10),c=a.replace("".concat(l),"");return"".concat(2*l).concat(c)},n.prototype.exec=function(r,o){var i=this.getIndentValue(r);O.setNodes(r,{indent:i},{match:function(a){return te.isElement(a)},mode:"highest"})},n})(eu),g2={renderStyle:function(t,n){if(!te.isElement(t))return n;var r=t.indent,o=n;return r&&on(o,{textIndent:r}),o},styleToHtml:function(t,n){if(!te.isElement(t))return n;var r=t.indent;if(!r)return n;var o=V(n);return o.css("text-indent",r),_n(o)},preParseHtml:[{selector:"p,h1,h2,h3,h4,h5",preParseHtml:function(t){var n=V(t),r=It(n,"padding-left");return/\dem/.test(r)&&n.css("text-indent","2em"),/\dpx/.test(r)&&parseInt(r,10)%32==0&&n.css("text-indent","2em"),n[0]}}],parseStyleHtml:function(t,n,r){var o=V(t);if(!te.isElement(n))return n;var i=n,a=It(o,"text-indent"),l=parseInt(a,10);return a&&l>0&&(i.indent=a),i},menus:[{key:"indent",factory:function(){return new m2}},{key:"delIndent",factory:function(){return new h2}}]},lo=(function(){function t(){this.tag="button"}return t.prototype.getValue=function(n){return""},t.prototype.isActive=function(n){return!1},t.prototype.isDisabled=function(n){return n.selection==null||!!F.getSelectedElems(n).some((function(r){var o=r.type;return!(!b.isVoid(n,r)||!b.isBlock(n,r)||o==="video")||!!["pre","code"].includes(o)}))},t})(),y2=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title=ae("justify.center"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M870.4 793.6v102.4H153.6v-102.4h716.8z m102.4-230.4v102.4H51.2v-102.4h921.6z m-102.4-230.4v102.4H153.6v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',r}return ve(n,t),n.prototype.exec=function(r,o){O.setNodes(r,{textAlign:"center"},{match:function(i){return te.isElement(i)&&!r.isInline(i)}})},n})(lo),b2=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title=ae("justify.justify"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z"></path></svg>',r}return ve(n,t),n.prototype.exec=function(r,o){O.setNodes(r,{textAlign:"justify"},{match:function(i){return te.isElement(i)&&!r.isInline(i)}})},n})(lo),C2=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title=ae("justify.left"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',r}return ve(n,t),n.prototype.exec=function(r,o){O.setNodes(r,{textAlign:"left"},{match:function(i){return te.isElement(i)&&!r.isInline(i)}})},n})(lo),v2=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.title=ae("justify.right"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M972.8 793.6v102.4H256v-102.4h716.8z m0-230.4v102.4H51.2v-102.4h921.6z m0-230.4v102.4H256v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',r}return ve(n,t),n.prototype.exec=function(r,o){O.setNodes(r,{textAlign:"right"},{match:function(i){return te.isElement(i)&&!r.isInline(i)}})},n})(lo),D2={renderStyle:function(t,n){if(!te.isElement(t))return n;var r=t.textAlign,o=n;return r&&on(o,{textAlign:r}),o},styleToHtml:function(t,n){if(!te.isElement(t))return n;var r=t.textAlign;if(!r)return n;var o=V(n);return o.css("text-align",r),_n(o)},parseStyleHtml:function(t,n,r){var o=V(t);if(!te.isElement(n))return n;var i=n,a=It(o,"text-align");return a&&(i.textAlign=a),i},menus:[{key:"justifyLeft",factory:function(){return new C2}},{key:"justifyRight",factory:function(){return new v2}},{key:"justifyCenter",factory:function(){return new y2}},{key:"justifyJustify",factory:function(){return new b2}}]},w2=(function(){function t(){this.title=ae("lineHeight.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M964 788a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526zM198.93 144.306c6.668-5.798 16.774-5.094 22.573 1.574l122.26 140.582a16 16 0 0 1 3.927 10.5c0 8.836-7.164 16-16 16h-61.8a8 8 0 0 0-8 8v390.077h69.819a16 16 0 0 1 10.502 3.928c6.666 5.8 7.37 15.906 1.57 22.573L221.476 878.123a16 16 0 0 1-1.57 1.57c-6.668 5.8-16.774 5.097-22.574-1.57L75.051 737.538a16 16 0 0 1-3.928-10.5c0-8.837 7.163-16 16-16h69.822V312.96H87.127a16 16 0 0 1-10.502-3.928c-6.666-5.8-7.37-15.906-1.57-22.573l122.303-140.582a16 16 0 0 1 1.572-1.572zM964 465a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z m0-323a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z"></path></svg>',this.tag="select",this.width=80}return t.prototype.getOptions=function(n){var r=[],o=n.getMenuConfig("lineHeight").lineHeightList,i=o===void 0?[]:o;r.push({text:ae("lineHeight.default"),value:""}),i.forEach((function(l){r.push({text:l,value:l})}));var a=this.getValue(n);return r.forEach((function(l){l.value===a?l.selected=!0:l.selected=void 0})),r},t.prototype.getMatchNode=function(n){var r=$(b.nodes(n,{match:function(i){var a=F.getNodeType(i);return!!a.startsWith("header")||!!["paragraph","blockquote","list-item"].includes(a)},universal:!0,mode:"highest"}),1),o=r[0];return o==null?null:o[0]},t.prototype.isActive=function(n){return!1},t.prototype.getValue=function(n){var r=this.getMatchNode(n);return r==null?"":te.isElement(r)&&r.lineHeight||""},t.prototype.isDisabled=function(n){return n.selection==null||this.getMatchNode(n)==null},t.prototype.exec=function(n,r){O.setNodes(n,{lineHeight:r.toString()},{mode:"highest"})},t})(),B2={renderStyle:function(t,n){if(!te.isElement(t))return n;var r=t.lineHeight,o=n;return r&&on(o,{lineHeight:r}),o},styleToHtml:function(t,n){if(!te.isElement(t))return n;var r=t.lineHeight;if(!r)return n;var o=V(n);return o.css("line-height",r),_n(o)},parseStyleHtml:function(t,n,r){var o=V(t);if(!te.isElement(n))return n;var i=n,a=r.getMenuConfig("lineHeight").lineHeightList,l=a===void 0?[]:a,c=It(o,"line-height");return c&&l.includes(c)&&(i.lineHeight=c),i},menus:[{key:"lineHeight",factory:function(){return new w2},config:{lineHeightList:["1","1.15","1.5","2","2.5","3"]}}]},x2={type:"link",elemToHtml:function(t,n){var r=t,o=r.url,i=r.target,a=i===void 0?"_blank":i;return'<a href="'.concat(o,'" target="').concat(a,'">').concat(n,"</a>")}};function tu(t){return t===void 0&&(t="r"),"".concat(t,"-").concat(q1())}function nu(t){return t.replace(/</g,"<").replace(/>/g,">")}function ru(t,n,r,o){return gn(this,void 0,void 0,(function(){var i,a;return yn(this,(function(l){switch(l.label){case 0:return(i=n.getMenuConfig(t).checkLink)?[4,i(r,o)]:[3,2];case 1:if(typeof(a=l.sent())=="string")return n.alert(a,"error"),[2,!1];if(a==null)return[2,!1];l.label=2;case 2:return[2,!0]}}))}))}function ou(t,n,r){return gn(this,void 0,void 0,(function(){var o;return yn(this,(function(i){switch(i.label){case 0:return(o=n.getMenuConfig(t).parseLinkUrl)?[4,o(r)]:[3,2];case 1:return[2,i.sent()];case 2:return[2,r]}}))}))}function qi(t){return t.selection==null||!!F.getSelectedElems(t).some((function(n){var r=n.type;return!!t.isVoid(n)||!!["pre","code","link"].includes(r)}))}function Ki(t,n){return{type:"link",url:nu(t),children:n?[{text:n}]:[]}}function iu(t,n,r){return gn(this,void 0,void 0,(function(){var o,i,a,l,c;return yn(this,(function(u){switch(u.label){case 0:return r?(n||(n=r),t.restoreSelection(),qi(t)?[2]:[4,ru("insertLink",t,n,r)]):[2];case 1:return u.sent()?[4,ou("insertLink",t,r)]:[2];case 2:if(o=u.sent(),(i=t.selection)==null)return[2];if(j.isCollapsed(i)){if((l=F.getLeftLengthOfMaxLength(t))<=0)return[2];t.insertText(" "),l<n.length+1&&(n=n.slice(0,l-1)),c=Ki(o,n),O.insertNodes(t,c),t.insertFragment([{text:" "}])}else if((a=b.string(t,i))!==n){if((l=F.getLeftLengthOfMaxLength(t))<=0)return[2];l<a.length-n.length&&(n=n.slice(0,l)),t.deleteFragment(),c=Ki(o,n),O.insertNodes(t,c)}else c=Ki(o),O.wrapNodes(t,c,{split:!0}),O.collapse(t,{edge:"end"});return[2]}}))}))}function su(){return tu("w-e-update-link")}var k2=(function(){function t(){this.title=ae("link.edit"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.urlInputId=su(),this.buttonId=su()}return t.prototype.getSelectedLinkElem=function(n){var r=F.getSelectedNodeByType(n,"link");return r??null},t.prototype.getValue=function(n){var r=this.getSelectedLinkElem(n);return r&&r.url||""},t.prototype.isActive=function(n){return!1},t.prototype.exec=function(n,r){},t.prototype.isDisabled=function(n){return n.selection==null||this.getSelectedLinkElem(n)==null},t.prototype.getModalPositionNode=function(n){return F.getSelectedNodeByType(n,"link")},t.prototype.getModalContentElem=function(n){var r=this.urlInputId,o=this.buttonId,i=$(Ti(ae("link.url"),r),2),a=i[0],l=V(i[1]),c=$(mc(o,ae("common.ok")),1)[0];if(this.$content==null){var u=V("<div></div>");u.on("click","#".concat(o),(function(p){p.preventDefault(),n.restoreSelection();var h=F.getSelectedNodeByType(n,"link"),m=h?U.string(h):"",g=u.find("#".concat(r)).val();(function(y,v,D){gn(this,void 0,void 0,(function(){var w,C;return yn(this,(function(B){switch(B.label){case 0:return D?[4,ru("editLink",y,v,D)]:[2];case 1:return B.sent()?[4,ou("editLink",y,D)]:[2];case 2:return w=B.sent(),C={url:nu(w)},O.setNodes(y,C,{match:function(k){return F.checkNodeType(k,"link")}}),[2]}}))}))})(n,m,g),n.hidePanelOrModal()})),this.$content=u}var d=this.$content;d.empty(),d.append(a),d.append(c);var f=this.getValue(n);return l.val(f),setTimeout((function(){l.focus()})),d[0]},t})();function Ji(){return tu("w-e-insert-link")}var E2=(function(){function t(){this.title=ae("link.insert"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M440.224 635.776a51.84 51.84 0 0 1-36.768-15.232c-95.136-95.136-95.136-249.92 0-345.056l192-192C641.536 37.408 702.816 12.032 768 12.032s126.432 25.376 172.544 71.456c95.136 95.136 95.136 249.92 0 345.056l-87.776 87.776a51.968 51.968 0 1 1-73.536-73.536l87.776-87.776a140.16 140.16 0 0 0 0-197.984c-26.432-26.432-61.6-40.992-99.008-40.992s-72.544 14.56-99.008 40.992l-192 192a140.16 140.16 0 0 0 0 197.984 51.968 51.968 0 0 1-36.768 88.768z"></path><path d="M256 1012a242.4 242.4 0 0 1-172.544-71.456c-95.136-95.136-95.136-249.92 0-345.056l87.776-87.776a51.968 51.968 0 1 1 73.536 73.536l-87.776 87.776a140.16 140.16 0 0 0 0 197.984c26.432 26.432 61.6 40.992 99.008 40.992s72.544-14.56 99.008-40.992l192-192a140.16 140.16 0 0 0 0-197.984 51.968 51.968 0 1 1 73.536-73.536c95.136 95.136 95.136 249.92 0 345.056l-192 192A242.4 242.4 0 0 1 256 1012z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textInputId=Ji(),this.urlInputId=Ji(),this.buttonId=Ji()}return t.prototype.getValue=function(n){return""},t.prototype.isActive=function(n){return!1},t.prototype.exec=function(n,r){},t.prototype.isDisabled=function(n){return qi(n)},t.prototype.getModalPositionNode=function(n){return null},t.prototype.getModalContentElem=function(n){var r=n.selection,o=this,i=o.textInputId,a=o.urlInputId,l=o.buttonId,c=$(Ti(ae("link.text"),i),2),u=c[0],d=V(c[1]),f=$(Ti(ae("link.url"),a),2),p=f[0],h=V(f[1]),m=$(mc(l,ae("common.ok")),1)[0];if(this.$content==null){var g=V("<div></div>");g.on("click","#".concat(l),(function(D){D.preventDefault();var w=g.find("#".concat(i)).val(),C=g.find("#".concat(a)).val();iu(n,w,C),n.hidePanelOrModal()})),this.$content=g}var y=this.$content;if(y.empty(),y.append(u),y.append(p),y.append(m),r==null||j.isCollapsed(r))d.val("");else{var v=b.string(n,r);d.val(v)}return h.val(""),setTimeout((function(){d.focus()})),y[0]},t})(),_2=(function(){function t(){this.title=ae("link.unLink"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M608.16328 811.815036c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.347563 89.347564c-118.525421 118.523421-311.38448 118.531421-429.919901 0-118.527421-118.529421-118.527421-311.39048 0-429.917901l89.349564-89.349563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.195613 79.195613c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.349563 89.347564c-56.143726 56.145726-56.143726 147.49928 0 203.645005 56.143726 56.143726 147.49928 56.145726 203.647005 0l89.347564-89.347563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.193613 79.195613z m-113.135447-520.429459c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.347564-89.347564c56.143726-56.149726 147.49928-56.145726 203.647006 0 56.143726 56.145726 56.143726 147.49928 0 203.645006l-89.349564 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.195613 79.195613c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.349564-89.349563c118.529421-118.529421 118.529421-311.38848 0-429.917901-118.531421-118.527421-311.38848-118.527421-429.919901 0l-89.347563 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.193613 79.195613z m469.653707 718.556492l45.253779-45.253779c18.745908-18.745908 18.745908-49.13776 0-67.881669L127.195629 14.062931c-18.745908-18.745908-49.13776-18.745908-67.881669 0L14.058181 59.31871c-18.745908 18.745908-18.745908 49.13776 0 67.881669l882.74169 882.74169c18.745908 18.743908 49.13776 18.743908 67.881669 0z"></path></svg>',this.tag="button"}return t.prototype.getValue=function(n){return""},t.prototype.isActive=function(n){return!1},t.prototype.isDisabled=function(n){return n.selection==null||F.getSelectedNodeByType(n,"link")==null},t.prototype.exec=function(n,r){this.isDisabled(n)||O.unwrapNodes(n,{match:function(o){return F.checkNodeType(o,"link")}})},t})(),A2=(function(){function t(){this.title=ae("link.view"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M924.402464 1023.068211H0.679665V99.345412h461.861399v98.909208H99.596867v725.896389h725.896389V561.206811h98.909208z" p-id="10909"></path><path d="M930.805104 22.977336l69.965436 69.965436-453.492405 453.492404-69.965435-69.901489z" p-id="10910"></path><path d="M1022.464381 304.030081h-98.917201V99.345412H709.230573V0.428211h313.233808z"></path></svg>',this.tag="button"}return t.prototype.getSelectedLinkElem=function(n){var r=F.getSelectedNodeByType(n,"link");return r??null},t.prototype.getValue=function(n){var r=this.getSelectedLinkElem(n);return r&&r.url||""},t.prototype.isActive=function(n){return!1},t.prototype.isDisabled=function(n){return n.selection==null||this.getSelectedLinkElem(n)==null},t.prototype.exec=function(n,r){if(!this.isDisabled(n)){if(!r||typeof r!="string")throw new Error("View link failed, link url is '".concat(r,"'"));window.open(r,"_blank")}},t})(),au={checkLink:function(t,n){return!0},parseLinkUrl:function(t){return t}},N2={key:"insertLink",factory:function(){return new E2},config:au},S2={key:"editLink",factory:function(){return new k2},config:au},F2={key:"unLink",factory:function(){return new _2}},V2={key:"viewLink",factory:function(){return new A2}},Gi,lu,O2={selector:"a:not([data-w-e-type])",parseElemHtml:function(t,n,r){var o=V(t);return(n=n.filter((function(i){return!!K.isText(i)||!!r.isInline(i)}))).length===0&&(n=[{text:o.text().replace(/\s+/gm," ")}]),{type:"link",url:o.attr("href")||"",target:o.attr("target")||"",children:n}}},T2=qt((function(){if(lu)return Gi;lu=1,Gi=function(o){if(typeof o!="string")return!1;var i=o.match(t);if(!i)return!1;var a=i[1];return a?!!(n.test(a)||r.test(a)):!1};var t=/^(?:\w+:)?\/\/(\S+)$/,n=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,r=/^[^\s\.]+\.\S{2,}$/;return Gi})()),j2={type:"link",renderElem:function(t,n,r){var o=t,i=o.url,a=o.target;return je("a",{href:i,target:a===void 0?"_blank":a},n)}},L2={renderElems:[j2],elemsToHtml:[x2],parseElemsHtml:[O2],menus:[N2,S2,F2,V2],editorPlugin:function(t){var n=t.isInline,r=t.insertData,o=t.normalizeNode,i=t;return i.isInline=function(a){return a.type==="link"||n(a)},i.insertData=function(a){var l=a.getData("text/plain");if(T2(l)){if(/<img[^>]+>/.test(a.getData("text/html")))r(a);else if(!qi(i)){var c=i.selection;if(c!=null){var u=b.string(i,c);iu(i,u,l)}}}else r(a)},i.normalizeNode=function(a){var l=$(a,2),c=l[0],u=l[1];return F.getNodeType(c)!=="link"?o([c,u]):U.string(c)===""?O.removeNodes(i,{at:u}):o([c,u])},i}},P2={selector:"p:not([data-w-e-type])",parseElemHtml:function(t,n,r){var o=V(t);return(n=n.filter((function(i){return!!K.isText(i)||!!r.isInline(i)}))).length===0&&(n=[{text:o.text().replace(/\s+/gm," ")}]),{type:"paragraph",children:n}}};function cu(t){var n=$(b.nodes(t,{match:function(l){return t.children[0]===l},mode:"highest"}),1),r=n[0];if(r==null)return!1;var o=r[0];if(!te.isElement(o)||o.type==="paragraph"||U.string(o)!=="")return!1;var i=o.children,a=i===void 0?[]:i;return!!K.isText(a[0])&&(O.setNodes(t,{type:"paragraph"}),!0)}var M2={type:"paragraph",renderElem:function(t,n,r){return je("p",null,n)}},z2={renderElems:[M2],elemsToHtml:[{type:"paragraph",elemToHtml:function(t,n){return n===""?"<p><br></p>":"<p>".concat(n,"</p>")}}],parseElemsHtml:[P2],editorPlugin:function(t){var n=t.deleteBackward,r=t.deleteForward,o=t;return o.deleteBackward=function(i){cu(o)||n(i)},o.deleteForward=function(i){cu(o)||r(i)},o}};function uu(t,n){if(t.selection==null)return!0;var r=$(b.nodes(t,{match:function(o){return F.getNodeType(o)==="pre"||!!b.isVoid(t,o)},universal:!0}),1);return!!r[0]}function $2(t,n){Object.keys(n).forEach((function(r){r!=="text"&&b.removeMark(t,r)}))}var sn=(function(){function t(){this.marksNeedToRemove=[],this.tag="button"}return t.prototype.getValue=function(n){var r=this.mark,o=b.marks(n);if(o)return o[r];var i=$(b.nodes(n,{match:function(a){return a[r]===!0}}),1);return!!i[0]},t.prototype.isActive=function(n){return!!this.getValue(n)},t.prototype.isDisabled=function(n){return uu(n,this.mark)},t.prototype.exec=function(n,r){var o=this.mark,i=this.marksNeedToRemove;r?n.removeMark(o):(n.addMark(o,!0),i&&i.forEach((function(a){return n.removeMark(a)})))},t})(),I2=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.mark="bold",r.title=ae("textStyle.bold"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M707.872 484.64A254.88 254.88 0 0 0 768 320c0-141.152-114.848-256-256-256H192v896h384c141.152 0 256-114.848 256-256a256.096 256.096 0 0 0-124.128-219.36zM384 192h101.504c55.968 0 101.504 57.408 101.504 128s-45.536 128-101.504 128H384V192z m159.008 640H384v-256h159.008c58.464 0 106.016 57.408 106.016 128s-47.552 128-106.016 128z"></path></svg>',r.hotkey="mod+b",r}return ve(n,t),n})(sn),R2=(function(){function t(){this.title=ae("textStyle.clear"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M969.382408 288.738615l-319.401123-270.852152a67.074236 67.074236 0 0 0-96.459139 5.74922l-505.931379 574.922021a68.35184 68.35184 0 0 0-17.886463 47.910169 74.101061 74.101061 0 0 0 24.274486 47.910168l156.50655 132.232065h373.060512L975.131628 383.281347a67.074236 67.074236 0 0 0-5.74922-96.459139z m-440.134747 433.746725H264.144729l-90.071117-78.572676c-5.74922-5.74922-12.137243-12.137243-12.137243-17.886463a36.411728 36.411728 0 0 1 5.749221-24.274485l210.804741-240.828447 265.102932 228.691204z m-439.495945 180.781036h843.218964a60.047411 60.047411 0 1 1 0 120.733624H89.751716a60.047411 60.047411 0 1 1 0-120.733624z m0 0"></path></svg>',this.tag="button"}return t.prototype.getValue=function(n){return""},t.prototype.isActive=function(n){return!1},t.prototype.isDisabled=function(n){return uu(n)},t.prototype.exec=function(n,r){var o,i,a=b.nodes(n,{match:function(u){return K.isText(u)},universal:!0});try{for(var l=st(a),c=l.next();!c.done;c=l.next())$2(n,c.value[0])}catch(u){o={error:u}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}},t})(),H2=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.mark="code",r.title=ae("textStyle.code"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M576 736l96 96 320-320L672 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224z"></path></svg>',r.hotkey="mod+e",r}return ve(n,t),n})(sn),U2=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.mark="italic",r.title=ae("textStyle.italic"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M896 64v64h-128L448 896h128v64H128v-64h128L576 128h-128V64z"></path></svg>',r.hotkey="mod+i",r}return ve(n,t),n})(sn),W2=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.mark="sub",r.marksNeedToRemove=["sup"],r.title=ae("textStyle.sub"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 910.016v50.016h128v64h-192v-146.016l128-60V768h-128v-64h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>',r.hotkey="",r}return ve(n,t),n})(sn),q2=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.mark="sup",r.marksNeedToRemove=["sub"],r.title=ae("textStyle.sup"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 206.016v50.016h128v64h-192V174.016l128-60V64h-128V0h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>',r.hotkey="",r}return ve(n,t),n})(sn),K2=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.mark="through",r.title=ae("textStyle.through"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M1024 512v64h-234.496c27.52 38.496 42.496 82.688 42.496 128 0 70.88-36.672 139.04-100.576 186.976C672.064 935.488 594.144 960 512 960s-160.064-24.512-219.424-69.024C228.64 843.04 192 774.88 192 704h128c0 69.376 87.936 128 192 128s192-58.624 192-128-87.936-128-192-128H0v-64h299.52a385.984 385.984 0 0 1-6.944-5.024C228.64 459.04 192 390.88 192 320s36.672-139.04 100.576-186.976C351.936 88.512 429.856 64 512 64s160.064 24.512 219.424 69.024C795.328 180.96 832 249.12 832 320h-128c0-69.376-87.936-128-192-128s-192 58.624-192 128 87.936 128 192 128c78.976 0 154.048 22.688 212.48 64H1024z"></path></svg>',r.hotkey="mod+shift+x",r}return ve(n,t),n})(sn),J2=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.mark="underline",r.title=ae("textStyle.underline"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M704 64l128 0 0 416c0 159.072-143.264 288-320 288s-320-128.928-320-288l0-416 128 0 0 416c0 40.16 18.24 78.688 51.36 108.512 36.896 33.216 86.848 51.488 140.64 51.488s103.744-18.304 140.64-51.488c33.12-29.792 51.36-68.352 51.36-108.512l0-416zM192 832l640 0 0 128-640 0z"></path></svg>',r.hotkey="mod+u",r}return ve(n,t),n})(sn);function an(t,n){return t.length!==0&&(!!t[0].matches(n)||t.find(n).length>0)}function du(t,n){var r=n,o=t,i=o.bold,a=o.italic,l=o.underline,c=o.code,u=o.through,d=o.sub,f=o.sup;return i&&(r="<strong>".concat(r,"</strong>")),c&&(r="<code>".concat(r,"</code>")),a&&(r="<em>".concat(r,"</em>")),l&&(r="<u>".concat(r,"</u>")),u&&(r="<s>".concat(r,"</s>")),d&&(r="<sub>".concat(r,"</sub>")),f&&(r="<sup>".concat(r,"</sup>")),r}var G2={renderStyle:function(t,n){var r=t,o=r.bold,i=r.italic,a=r.underline,l=r.code,c=r.through,u=r.sub,d=r.sup,f=n;return o&&(f=je("strong",null,f)),l&&(f=je("code",null,f)),i&&(f=je("em",null,f)),a&&(f=je("u",null,f)),c&&(f=je("s",null,f)),u&&(f=je("sub",null,f)),d&&(f=je("sup",null,f)),f},menus:[{key:"bold",factory:function(){return new I2}},{key:"underline",factory:function(){return new J2}},{key:"italic",factory:function(){return new U2}},{key:"through",factory:function(){return new K2}},{key:"code",factory:function(){return new H2}},{key:"sub",factory:function(){return new W2}},{key:"sup",factory:function(){return new q2}},{key:"clearStyle",factory:function(){return new R2}}],styleToHtml:function(t,n){if(!K.isText(t))return n;if(Ui(n))return du(t,n);var r=V(n),o=r.html();return o=du(t,o),r.html(o),_n(r)},parseStyleHtml:function(t,n,r){var o=V(t);if(!K.isText(n))return n;var i=n;return an(o,"b,strong")&&(i.bold=!0),an(o,"i,em")&&(i.italic=!0),an(o,"u")&&(i.underline=!0),an(o,"s,strike")&&(i.through=!0),an(o,"sub")&&(i.sub=!0),an(o,"sup")&&(i.sup=!0),an(o,"code")&&(i.code=!0),i}},Y2=(function(){function t(){this.title=ae("undo.redo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0.00032 576a510.72 510.72 0 0 0 173.344 384l84.672-96A383.136 383.136 0 0 1 128.00032 576C128.00032 363.936 299.93632 192 512.00032 192c106.048 0 202.048 42.976 271.52 112.48L640.00032 448h384V64l-149.984 149.984A510.272 510.272 0 0 0 512.00032 64C229.21632 64 0.00032 293.216 0.00032 576z"></path></svg>',this.tag="button"}return t.prototype.getValue=function(n){return""},t.prototype.isActive=function(n){return!1},t.prototype.isDisabled=function(n){return n.selection==null},t.prototype.exec=function(n,r){typeof n.redo=="function"&&n.redo()},t})(),Z2=(function(){function t(){this.title=ae("undo.undo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M512 64A510.272 510.272 0 0 0 149.984 213.984L0.032 64v384h384L240.512 304.48A382.784 382.784 0 0 1 512.032 192c212.064 0 384 171.936 384 384 0 114.688-50.304 217.632-130.016 288l84.672 96a510.72 510.72 0 0 0 173.344-384c0-282.784-229.216-512-512-512z"></path></svg>',this.tag="button"}return t.prototype.getValue=function(n){return""},t.prototype.isActive=function(n){return!1},t.prototype.isDisabled=function(n){return n.selection==null},t.prototype.exec=function(n,r){typeof n.undo=="function"&&n.undo()},t})(),X2=[G2,Eg,Pg,g2,D2,B2,Fg,Og,L2,p2,z2,Mg,{menus:[{key:"redo",factory:function(){return new Y2}},{key:"undo",factory:function(){return new Z2}}]},$g,Ag];kn("en",{listModule:{unOrderedList:"Unordered list",orderedList:"Ordered list"}}),kn("zh-CN",{listModule:{unOrderedList:"无序列表",orderedList:"有序列表"}});var Yi=new WeakMap;function fu(t){var n,r=t.children||[],o=r.length;if(o===0)return"";for(var i=0;i<o&&!n;i+=1){var a=r[i];K.isText(a)&&(n=a)}return n==null?"":n.color||""}function pu(t,n,r){for(var o=n.type,i=(function(h,m){var g={};for(var y in h)Object.prototype.hasOwnProperty.call(h,y)&&m.indexOf(y)<0&&(g[y]=h[y]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function"){var v=0;for(y=Object.getOwnPropertySymbols(h);v<y.length;v++)m.indexOf(y[v])<0&&Object.prototype.propertyIsEnumerable.call(h,y[v])&&(g[y[v]]=h[y[v]])}return g})(n,["type"]),a=r!==void 0?r:i.level||0,l=F.findPath(t,n),c=l;;){if(c.length===0||l[l.length-1]===0)return null;c=A.previous(c);var u=b.node(t,c);if(!u)return null;var d=$(u,1)[0],f=d.level,p=f===void 0?0:f;if(F.getNodeType(d)!==o)return null;if(p===a)return d}}function hu(t,n,r){var o=pu(t,n,r);return!!o&&o.ordered===n.ordered}var mu=[],Q2={type:"list-item",elemToHtml:function(t,n){var r="",o="",i=t.ordered,a=i!==void 0&&i?"ol":"ul",l=(function(h){var m=Yi.get(h);if(m==null)return 0;var g=h,y=g.type,v=g.ordered,D=v!==void 0&&v,w=g.level,C=w===void 0?0:w,B=F.findPath(m,h);if(B[0]===0)return C+1;var k=A.previous(B),_=b.node(m,k);if(!_)return 0;var x=$(_,1)[0];if(F.getNodeType(x)!==y)return C+1;var N=x,T=N.ordered,M=T!==void 0&&T,R=N.level,z=R===void 0?0:R;return z<C?C-z:z>C?hu(m,h)?0:1:z===C?M===D?0:1:0})(t);if(l>0)for(var c=0;c<l;c+=1)r+="<".concat(a,">"),mu.push(a);var u=(function(h){var m=Yi.get(h);if(m==null)return 0;var g=h,y=g.type,v=g.ordered,D=v!==void 0&&v,w=g.level,C=w===void 0?0:w,B=F.findPath(m,h);if(B[0]===m.children.length-1)return C+1;var k=A.next(B),_=b.node(m,k);if(!_)return 0;var x=$(_,1)[0];if(F.getNodeType(x)!==y)return C+1;var N=x,T=N.ordered,M=T!==void 0&&T,R=N.level,z=R===void 0?0:R;return z<C?hu(m,x)?C-z:C-z+1:z>C?0:z===C?M===D?0:1:0})(t);if(u>0)for(c=0;c<u;c+=1){var d=mu.pop();o+="</".concat(d,">")}var f=fu(t),p=f?' style="color:'.concat(f,'"'):"";return{html:"<li".concat(p,">").concat(n,"</li>"),prefix:r,suffix:o}}},gu=(function(){function t(){this.type="list-item",this.tag="button"}return t.prototype.getListNode=function(n){var r=this.type;return F.getSelectedNodeByType(n,r)},t.prototype.getValue=function(n){return""},t.prototype.isActive=function(n){var r=this.getListNode(n);if(r==null)return!1;var o=r.ordered;return(o!==void 0&&o)===this.ordered},t.prototype.isDisabled=function(n){return n.selection==null||!!F.getSelectedElems(n).some((function(r){if(b.isVoid(n,r)&&b.isBlock(n,r))return!0;var o=r.type;return!!["pre","code","table"].includes(o)}))},t.prototype.exec=function(n,r){this.isActive(n)?O.setNodes(n,{type:"paragraph",ordered:void 0,level:void 0}):O.setNodes(n,{type:"list-item",ordered:this.ordered,indent:void 0})},t})(),ey=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.ordered=!1,r.title=ae("listModule.unOrderedList"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M384 64h640v128H384V64z m0 384h640v128H384v-128z m0 384h640v128H384v-128zM0 128a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z"></path></svg>',r}return ve(n,t),n})(gu),ty=(function(t){function n(){var r=t.apply(this,Be([],$(arguments),!1))||this;return r.ordered=!0,r.title=ae("listModule.orderedList"),r.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M384 832h640v128H384z m0-384h640v128H384z m0-384h640v128H384zM192 0v256H128V64H64V0zM128 526.016v50.016h128v64H64v-146.016l128-60V384H64v-64h192v146.016zM256 704v320H64v-64h128v-64H64v-64h128v-64H64v-64z"></path></svg>',r}return ve(n,t),n})(gu),ny={key:"bulletedList",factory:function(){return new ey}},ry={key:"numberedList",factory:function(){return new ty}};function Zi(t){return t.length?t[0].tagName.toLowerCase():""}vn&&(V.fn.append=vn),Cn&&(V.fn.attr=Cn),$r&&(V.fn.parent=$r);var oy={selector:"li:not([data-w-e-type])",parseElemHtml:function(t,n,r){var o=V(t);(n=n.filter((function(l){return!!K.isText(l)||!!r.isInline(l)}))).length===0&&(n=[{text:o.text().replace(/\s+/gm," ")}]);var i=(function(l){return Zi(l.parent())==="ol"})(o),a=(function(l){for(var c=0,u=l.parent(),d=Zi(u);d==="ul"||d==="ol";)d=Zi(u=u.parent()),c+=1;return c-1})(o);return{type:"list-item",ordered:i,level:a,children:n}}},iy={selector:"ul:not([data-w-e-type]),ol:not([data-w-e-type])",parseElemHtml:function(t,n,r){return n.flat(1/0)}};function yu(t){return b.nodes(t,{at:t.selection||void 0,match:function(n){return F.findPath(t,n).length===1}})}var sy={type:"list-item",renderElem:function(t,n,r){Yi.set(t,r);var o=t,i=o.level,a=i===void 0?0:i,l=o.ordered,c=l!==void 0&&l,u={margin:"5px 0 5px ".concat(20*a,"px"),display:"flex",alignItems:"flex-start"},d="";if(c){var f=(function(p,h){var m=h,g=m.type,y=m.level,v=y===void 0?0:y,D=m.ordered,w=D!==void 0&&D,C=1,B=h,k=F.findPath(p,B);if(k[0]===0)return 1;for(;k[0]>0;){var _=A.previous(k),x=b.node(p,_);if(x==null)break;var N=x[0],T=N.level,M=T===void 0?0:T,R=N.type,z=N.ordered;if(R!==g||M<v)break;if(M===v){if(z!==w)break;C+=1}B=N,k=_}return C})(r,t);d="".concat(f,".")}else d=(function(p){p===void 0&&(p=0);var h="";switch(p){case 0:h="•";break;case 1:h="◦";break;default:h="▪"}return h})(a);return je("div",{style:u},je("span",{contentEditable:!1,style:{marginRight:"0.5em",color:fu(t)},"data-w-e-reserve":!0},d),je("span",{style:{flex:"1",wordBreak:"break-word"}},n))}},ay={renderElems:[sy],editorPlugin:function(t){var n=t.deleteBackward,r=t.handleTab,o=t.normalizeNode,i=t.insertBreak,a=t;return a.insertBreak=function(){var l=$(b.nodes(t,{match:function(u){return F.checkNodeType(u,"list-item")},universal:!0}),1),c=l[0];return c?c[0].children[0].text!==""?i():void O.setNodes(a,{type:"paragraph",ordered:void 0,level:void 0}):i()},a.deleteBackward=function(l){var c=a.selection;if(c!=null)if(j.isExpanded(c))n(l);else{var u=F.getSelectedNodeByType(a,"list-item");if(u!=null)if(c.focus.offset!==0)n(l);else{var d=u,f=d.level,p=f===void 0?0:f,h=d.ordered,m=h!==void 0&&h;if(p>0){var g=pu(t,u,p-1);g&&g.ordered!==m?O.setNodes(a,{level:p-1,ordered:!m}):O.setNodes(a,{level:p-1})}else O.setNodes(a,{type:"paragraph",ordered:void 0,level:void 0})}else n(l)}else n(l)},a.handleTab=function(){var l,c,u,d,f=a.selection;if(f!=null){if(j.isCollapsed(f)){var p=F.getSelectedNodeByType(a,"list-item");if(p==null)return void r();if(f.focus.offset===0){var h=p.level,m=h===void 0?0:h;return void O.setNodes(a,{level:m+1})}}if(j.isExpanded(f)){var g=0,y=!1;try{for(var v=st(yu(a)),D=v.next();!D.done;D=v.next()){var w=$(D.value,1)[0];F.getNodeType(w)==="list-item"?g+=1:y=!0}}catch(N){l={error:N}}finally{try{D&&!D.done&&(c=v.return)&&c.call(v)}finally{if(l)throw l.error}}if(y||g<=1)return void r();try{for(var C=st(yu(a)),B=C.next();!B.done;B=C.next()){var k=$(B.value,2),_=(w=k[0],k[1]),x=w.level;m=x===void 0?0:x,O.setNodes(a,{level:m+1},{at:_})}}catch(N){u={error:N}}finally{try{B&&!B.done&&(d=C.return)&&d.call(C)}finally{if(u)throw u.error}}}else r()}else r()},a.normalizeNode=function(l){var c=$(l,2),u=c[0],d=c[1],f=F.getNodeType(u);return f!=="bulleted-list"&&f!=="numbered-list"||O.unwrapNodes(a,{at:d}),o([u,d])},a},menus:[ny,ry],elemsToHtml:[Q2],parseElemsHtml:[iy,oy]},Ze=(function(){function t(){throw new Error(`不能实例化
|
|
38
|
+
Can not construct a instance`)}return t.setEditorConfig=function(n){n===void 0&&(n={}),this.editorConfig=me(me({},this.editorConfig),n)},t.setSimpleEditorConfig=function(n){n===void 0&&(n={}),this.simpleEditorConfig=me(me({},this.simpleEditorConfig),n)},t.setToolbarConfig=function(n){n===void 0&&(n={}),this.toolbarConfig=me(me({},this.toolbarConfig),n)},t.setSimpleToolbarConfig=function(n){n===void 0&&(n={}),this.simpleToolbarConfig=me(me({},this.simpleToolbarConfig),n)},t.registerPlugin=function(n){this.plugins.push(n)},t.registerMenu=function(n,r){I1(n,r)},t.registerRenderElem=function(n){var r,o,i;o=(r=n).type,i=r.renderElem,Hc[o||""]=i},t.registerRenderStyle=function(n){(function(r){Ii.push(r)})(n)},t.registerElemToHtml=function(n){(function(r){var o=r.type,i=r.elemToHtml;al[o||""]=i})(n)},t.registerStyleToHtml=function(n){(function(r){di.push(r)})(n)},t.registerPreParseHtml=function(n){var r;r=n,tl.push(r)},t.registerParseElemHtml=function(n){(function(r){var o=r.selector,i=r.parseElemHtml;Jr[o]=i})(n)},t.registerParseStyleHtml=function(n){(function(r){Kr.push(r)})(n)},t.registerModule=function(n){Xi(n)},t.editorConfig={},t.simpleEditorConfig={},t.toolbarConfig={},t.simpleToolbarConfig={},t.plugins=[],t})();function Xi(t){var n=t.menus,r=t.renderElems,o=t.renderStyle,i=t.elemsToHtml,a=t.styleToHtml,l=t.preParseHtml,c=t.parseElemsHtml,u=t.parseStyleHtml,d=t.editorPlugin;n&&n.forEach((function(f){return Ze.registerMenu(f)})),r&&r.forEach((function(f){return Ze.registerRenderElem(f)})),o&&Ze.registerRenderStyle(o),i&&i.forEach((function(f){return Ze.registerElemToHtml(f)})),a&&Ze.registerStyleToHtml(a),l&&l.forEach((function(f){return Ze.registerPreParseHtml(f)})),c&&c.forEach((function(f){return Ze.registerParseElemHtml(f)})),u&&Ze.registerParseStyleHtml(u),d&&Ze.registerPlugin(d)}X2.forEach((function(t){return Xi(t)})),Xi(ay);var ly='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>',cy='<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',uy='<svg viewBox="0 0 1024 1024"><path d="M204.8 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path><path d="M505.6 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path><path d="M806.4 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path></svg>',bu={link:{menuKeys:["editLink","unLink","viewLink"]},pre:{menuKeys:["enter","codeBlock","codeSelectLang"]},divider:{menuKeys:["enter"]}},dy={hoverbarKeys:me(me({},bu),{text:{menuKeys:["formatPainter","headerSelect","insertLink","bulletedList","|","bold","through","color","bgColor","clearStyle"]}})};Ze.setEditorConfig(me({},dy));var fy={hoverbarKeys:bu};Ze.setSimpleEditorConfig(me({},fy));var py={toolbarKeys:["headerSelect","|","bold","underline","italic",{key:"group-more-style",title:ae("editor.more"),iconSvg:uy,menuKeys:["through","code","sup","sub","clearStyle"]},"color","bgColor","|","fontSize","fontFamily","lineHeight","|","bulletedList","numberedList",{key:"group-justify",title:ae("editor.justify"),iconSvg:cy,menuKeys:["justifyLeft","justifyRight","justifyCenter","justifyJustify"]},{key:"group-indent",title:ae("editor.indent"),iconSvg:ly,menuKeys:["indent","delIndent"]},"|","emotion","divider","|","undo","redo","|","formatPainter","fullScreen"]};Ze.setToolbarConfig(py);var hy={toolbarKeys:["blockquote","header1","header2","header3","|","bold","underline","italic","through","color","bgColor","clearStyle","|","bulletedList","numberedList","todo","justifyLeft","justifyRight","justifyCenter","|","insertLink","insertTable","codeBlock","|","undo","redo","|","fullScreen"]};function my(t){t===void 0&&(t={});var n=t.selector,r=n===void 0?"":n,o=t.content,i=o===void 0?[]:o,a=t.html,l=t.config,c=l===void 0?{}:l,u=t.mode,d=(u===void 0?"default":u)==="simple"?Ze.simpleEditorConfig:Ze.editorConfig,f=me(me({},d.hoverbarKeys||{}),c.hoverbarKeys||{});return vg({selector:r,config:me(me(me({},d),c),{hoverbarKeys:f}),content:i,html:a,plugins:Ze.plugins})}function gy(t){var n=t.selector,r=t.editor,o=t.config,i=o===void 0?{}:o;if(!n)throw new Error("Cannot find 'selector' when create toolbar");var a=Ze.toolbarConfig;return wg(r,{selector:n,config:me(me({},a),i)})}Ze.setSimpleToolbarConfig(hy);class yy{constructor(){this.title="播放视频",this.tag="button"}getValue(n){return!1}isActive(n){return!1}isDisabled(n){return!1}exec(n){const r=F.getSelectedNodeByType(n,"video");console.log(r);const{view:o}=n.getMenuConfig("video");o(r)}}class Cu{constructor(n="video"){this.type=n,this.title={video:"删除视频",image:"删除图片"}[n]??"删除",this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M826.8032 356.5312c-19.328 0-36.3776 15.6928-36.3776 35.0464v524.2624c0 19.328-16 34.56-35.328 34.56H264.9344c-19.328 0-35.5072-15.3088-35.5072-34.56V390.0416c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.6928-33.5104 35.0464V915.712c0 57.9328 44.6208 108.288 102.528 108.288H755.2c57.9328 0 108.0832-50.4576 108.0832-108.288V391.4752c-0.1024-19.2512-17.1264-34.944-36.48-34.944z"></path><path d="M437.1712 775.7568V390.6048c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.616-33.5104 35.0464v385.152c0 19.328 14.1568 35.0464 33.5104 35.0464s33.5104-15.7184 33.5104-35.0464zM649.7024 775.7568V390.6048c0-19.328-17.0496-35.0464-36.3776-35.0464s-36.3776 15.616-36.3776 35.0464v385.152c0 19.328 17.0496 35.0464 36.3776 35.0464s36.3776-15.7184 36.3776-35.0464zM965.0432 217.0368h-174.6176V145.5104c0-57.9328-47.2064-101.76-104.6528-101.76h-350.976c-57.8304 0-105.3952 43.8528-105.3952 101.76v71.5264H54.784c-19.4304 0-35.0464 14.1568-35.0464 33.5104 0 19.328 15.616 33.5104 35.0464 33.5104h910.3616c19.328 0 35.0464-14.1568 35.0464-33.5104 0-19.3536-15.6928-33.5104-35.1488-33.5104z m-247.3728 0H297.3952V145.5104c0-19.328 18.2016-34.7648 37.4272-34.7648h350.976c19.1488 0 31.872 15.1296 31.872 34.7648v71.5264z"></path></svg>',this.tag="button"}getValue(n){return!1}isActive(n){return!1}isDisabled(n){return!1}exec(n){if(O.removeNodes(n,{match:r=>F.checkNodeType(r,this.type)}),n.children.length==0){const r={type:"paragraph",children:[{text:""}]};n.insertNode(r)}}}class by{constructor(){this.title="删除当前空白选区",this.tag="button",this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M128.98158345 72.59909097L957.65651249 882.41883582a12.62483038 12.62483038 0 0 1 0.20199729 17.85782259l-44.11746977 45.14639344a12.62483038 12.62483038 0 0 1-17.85151016 0.20199728L665.328565 720.3097013H44.88127586a37.87449114 37.87449114 0 0 1-37.87449115-37.87449114V341.56478984a37.87449114 37.87449114 0 0 1 37.87449115-37.87449114h194.11939195L67.21460081 135.80530428a12.62483038 12.62483038 0 0 1-0.2083097-17.85151017l44.12378219-45.14639344a12.62483038 12.62483038 0 0 1 17.85151015-0.2083097zM979.11872414 303.69661111a37.87449114 37.87449114 0 0 1 37.87449115 37.87449114v340.87042032a37.87449114 37.87449114 0 0 1-37.87449115 37.87449114l-60.10050504-0.00631241-90.43166002-88.37381267H928.61940262V392.06411137h-345.49742066L492.69032193 303.6902987H979.11872414zM574.89690496 631.93588863L329.43864025 392.06411137H95.38059738v239.87177726h479.51630758z"></path></svg>'}getValue(n){return!1}isActive(n){return!1}isDisabled(n){if(n.selection==null||n.children.length===1)return!0;const r=F.getSelectedElems(n);return!(r.length==1&&r[0].type=="paragraph"&&r[0].children.length==1&&r[0].children[0].text=="")}exec(n){console.log(n.selection),O.removeNodes(n)}}class Cy{constructor(){this.title="在当前选区上方输入内容",this.tag="button",this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M402.50684874 1007.33354475h564.71918286v-125.49315273h-439.22603161V405.8448679h339.70996129L465.25342362 3.38833024 62.79688595 405.8448679H402.50684874V1007.33354475z"></path></svg>'}getValue(n){return!1}isActive(n){return!1}isDisabled(n){return!1}exec(n){const r={type:"paragraph",children:[{text:""}]};O.insertNodes(n,r,{at:[n.selection.anchor.path[0]]})}}class vy{constructor(){this.title="在当前选区下方输入内容",this.tag="button",this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M396.97946691 2.76146536h565.5924011v125.68720121h-439.90520135v476.73155007h340.23525057L459.82306605 1008.25906783l-403.0788512-403.07885119H396.97946691V2.76146536z"></path></svg>'}getValue(n){return!1}isActive(n){return!1}isDisabled(n){}exec(n){const r={type:"paragraph",children:[{text:""}]};n.insertNode(r)}}const Dy={key:"viewVideo",factory(){return new yy}},wy={key:"delVideo",factory(){return new Cu("video")}},By={key:"delImage",factory(){return new Cu("image")}},xy={key:"insertBottom",factory(){return new vy}},ky={key:"insertTop",factory(){return new Cy}},Ey={key:"delEmpty",factory(){return new by}};class _y{title="上传图片";iconSvg='<svg viewBox="0 0 1024 1024"><path d="M828.708571 585.045333a48.761905 48.761905 0 0 0-48.737523 48.761905v18.529524l-72.143238-72.167619a135.972571 135.972571 0 0 0-191.585524 0l-34.133334 34.133333-120.880762-120.953905a138.898286 138.898286 0 0 0-191.585523 0l-72.167619 72.167619V292.400762a48.786286 48.786286 0 0 1 48.761904-48.761905h341.23581a48.737524 48.737524 0 0 0 34.474667-83.285333 48.737524 48.737524 0 0 0-34.474667-14.287238H146.236952A146.212571 146.212571 0 0 0 0 292.400762v585.289143A146.358857 146.358857 0 0 0 146.236952 1024h584.996572a146.212571 146.212571 0 0 0 146.236952-146.310095V633.807238a48.786286 48.786286 0 0 0-48.761905-48.761905zM146.261333 926.45181a48.737524 48.737524 0 0 1-48.761904-48.761905v-174.128762l141.409523-141.458286a38.497524 38.497524 0 0 1 53.126096 0l154.526476 154.624 209.627428 209.724953H146.236952z m633.734096-48.761905c-0.073143 9.337905-3.145143 18.383238-8.777143 25.843809l-219.843048-220.94019 34.133333-34.133334a37.546667 37.546667 0 0 1 53.613715 0l140.873143 141.897143V877.714286zM1009.615238 160.231619L863.329524 13.897143a48.737524 48.737524 0 0 0-16.091429-10.24c-11.849143-4.87619-25.161143-4.87619-37.059047 0a48.761905 48.761905 0 0 0-16.067048 10.24l-146.236952 146.334476a49.005714 49.005714 0 0 0 69.217523 69.241905l62.902858-63.390476v272.627809a48.761905 48.761905 0 1 0 97.475047 0V166.083048l62.902857 63.390476a48.737524 48.737524 0 0 0 69.217524 0 48.761905 48.761905 0 0 0 0-69.241905z"></path></svg>';tag="button";getValue(n){return""}isActive(n){return!1}isDisabled(n){return!1}getMenuConfig(n){return n.getMenuConfig("image")}exec(n,r){const{upload:o}=this.getMenuConfig(n);function i(a){const l={type:"image",src:a,children:[{text:""}]};n.insertNode(l)}o(i)}}const Ay={key:"image",factory(){return new _y},config:{}};class Ny{title="上传视频";playSvg='<svg viewBox="0 0 1024 1024"><path d="M870.2 466.333333l-618.666667-373.28a53.333333 53.333333 0 0 0-80.866666 45.666667v746.56a53.206667 53.206667 0 0 0 80.886666 45.666667l618.666667-373.28a53.333333 53.333333 0 0 0 0-91.333334z" fill="#ffffff" p-id="5959"></path></svg>';iconSvg='<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>';tag="button";getValue(n){return""}isActive(n){return!1}isDisabled(n){return!1}exec(n,r){const{upload:o}=n.getMenuConfig("video");function i(a){const l={type:"video",poster:a+".jpg",src:a,children:[{text:""}]};n.insertNode(l)}o(i)}}function Sy(t,n,r){const{id:o}=F.findKey(t,n);return`w-e-video-container-${o}`}function Fy(t,n,r,o){const{width:i,height:a}=o,l={};i&&(l.width=i),a&&(l.height=a);const c=Sy(t,n),u=F.isNodeSelected(t,n),d=ht("div",{props:{className:"we-video-play i-ri-play-fill"}});return ht("div",{props:{contentEditable:!1,id:c,className:"w-e-video-container"+(u?" w-e-video-selected":"")},style:l},[r,d])}function Vy(t,n,r){const{src:o,poster:i="",style:a={}}=t,{width:l="",height:c=""}=a,u={};u.width="100%",u.height="100%";const d=ht("img",{src:$fileUrl(i),style:u});return Fy(r,t,d,{width:l,height:c})}const Oy={type:"video",renderElem:Vy};function Ty(t,n){let{src:r="",poster:o="",width:i="auto",height:a="auto"}=t;const l=r.split(DMX.fileUrl);l[1]&&(r=l[1]);const c=o.split(DMX.fileUrl);return c[1]&&(o=c[1]),`<video poster="${o}" src="${r}" controls="true" width="${i}" height="${a}"></video>`}const jy={type:"video",elemToHtml:Ty};function Ly(t){const n=V(t);return{type:"video",src:$fileUrl(n.attr("src")),poster:$fileUrl(n.attr("poster"))||"",style:{width:n.attr("width")??"",height:n.attr("height")??""},children:[{text:""}]}}const Py={selector:"video",parseElemHtml:Ly},My={key:"video",factory(){return new Ny},config:{}};function zy(t,n){let r=0;return function(){const o=Date.now();o-r>=n&&(t.apply(this,arguments),r=o)}}function vu(t,n){let r="";const i=(t.attr("style")||"").split(";"),a=i.length;for(let l=0;l<a;l++){const c=i[l];if(c){const u=c.split(":");u[0].trim()===n&&(r=u[1].trim())}}return r}function Du(t,n){const{id:r}=F.findKey(t,n);return`w-e-image-container-${r}`}function $y(t,n,r,o){const{width:i,height:a}=o,l={};i&&(l.width=i),a&&(l.height=a);const c=Du(t,n);return ht("div",{props:{id:c,className:"w-e-image-container"},style:l},[r])}function Iy(t,n,r,o){const i=Du(t,n),a=V("body"),{width:l,height:c}=o;let u=0,d=0,f=!1,p=null;function h(){const C=V(`#${i}`);if(C.length===0)throw new Error("Cannot find image container elem");return C}function m(C){p=h(),u=C;const B=p.find("img");if(B.length===0)throw new Error("Cannot find image elem");d=B.width(),B.height(),a.on("mousemove",g),a.on("mouseup",y);const k=F.getHoverbar(t);k&&k.hideAndClean()}const g=zy(C=>{C.preventDefault();const{clientX:B}=C,k=f?u-B:B-u,_=d+k;p!=null&&(_<=15||(p.css("width",`${_}px`),p.css("height","auto")))},50);function y(){if(a.off("mousemove",g),p==null)return;const C=p.width().toFixed(2),B=V(".w-e-text-container").width(),k={style:{...n.style,width:`${(C/B*100).toFixed(2)}%`,height:"auto"}};let _=F.findPath(t,n);console.log(k,_),O.setNodes(t,k,{at:F.findPath(t,n)}),a.off("mouseup",y)}const v={};return l&&(v.width=l),c&&(v.height=c),v.boxShadow="0 0 0 1px #B4D5FF",ht("div",{props:{id:i,contentEditable:!1,className:"w-e-image-container w-e-selected-image-container"},style:v,on:{mousedown:C=>{const B=V(C.target);B.hasClass("w-e-image-dragger")&&(C.preventDefault(),(B.hasClass("left-top")||B.hasClass("left-bottom"))&&(f=!0),m(C.clientX))}}},[r,ht("div",{props:{className:"w-e-image-dragger left-top"}}),ht("div",{props:{className:"w-e-image-dragger right-top"}}),ht("div",{props:{className:"w-e-image-dragger left-bottom"}}),ht("div",{props:{className:"w-e-image-dragger right-bottom"}})])}function Ry(t,n,r){const{src:o,href:i="",style:a={}}=t,{width:l="",height:c=""}=a,u=F.isNodeSelected(r,t),d={};l&&(d.width="100%"),c&&(d.height="100%"),d.maxWidth=V(".w-e-text-container").width()+"px";const f=ht("img",{props:{src:o,draggable:!1,"data-href":i},style:d}),p=r.isDisabled();return u&&!p?Iy(r,t,f,{width:l,height:c}):$y(r,t,f,{width:l,height:c})}const Hy={type:"image",renderElem:Ry},Uy={video:{menuKeys:["viewVideo","delVideo","insertBottom","insertTop"]},text:{menuKeys:["headerSelect","urlKey","bulletedList","|","bold","through","color","bgColor","clearStyle"]},link:{menuKeys:["linkUrlKey","unLink"]},image:{menuKeys:["imgUrlKey","delImage","insertBottom","insertTop"]}};class Qi{constructor(n){this.type=n,this.title="插入或修改链接",this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M440.224 635.776a51.84 51.84 0 0 1-36.768-15.232c-95.136-95.136-95.136-249.92 0-345.056l192-192C641.536 37.408 702.816 12.032 768 12.032s126.432 25.376 172.544 71.456c95.136 95.136 95.136 249.92 0 345.056l-87.776 87.776a51.968 51.968 0 1 1-73.536-73.536l87.776-87.776a140.16 140.16 0 0 0 0-197.984c-26.432-26.432-61.6-40.992-99.008-40.992s-72.544 14.56-99.008 40.992l-192 192a140.16 140.16 0 0 0 0 197.984 51.968 51.968 0 0 1-36.768 88.768z"></path><path d="M256 1012a242.4 242.4 0 0 1-172.544-71.456c-95.136-95.136-95.136-249.92 0-345.056l87.776-87.776a51.968 51.968 0 1 1 73.536 73.536l-87.776 87.776a140.16 140.16 0 0 0 0 197.984c26.432 26.432 61.6 40.992 99.008 40.992s72.544-14.56 99.008-40.992l192-192a140.16 140.16 0 0 0 0-197.984 51.968 51.968 0 1 1 73.536-73.536c95.136 95.136 95.136 249.92 0 345.056l-192 192A242.4 242.4 0 0 1 256 1012z"></path></svg>',this.tag="button"}getValue(){return!1}isActive(){return!1}isDisabled(n){return this.type=="image"||this.type=="link"?!1:!!(n.selection==null||F.getSelectedElems(n).some(i=>{const{type:a}=i;if(n.isVoid(i)||["pre","code","link"].includes(a))return!0}))}exec(n){const r=F.getSelectedNodeByType(n,this.type);let o="";this.type=="image"?o=r.href:this.type=="link"?o=r.url:this.type=="text";const{exec:i=null}=n.getMenuConfig("linkUrlKey");i&&i(o)}}function Wy(t){let{src:n,href:r="",style:o={}}=t;const{width:i="",height:a=""}=o;let l="";return i&&(l+=`width: ${i};`),a&&(l+=`height: ${a};`),`<img src="${n}" data-href="${r}" style="${l}"/>`}const qy={type:"image",elemToHtml:Wy};function Ky(t){const n=V(t);let r=n.attr("data-href")||"";return r&&(r=decodeURIComponent(r)),{type:"image",src:$fileUrl(n.attr("src"))||"",href:r,style:{width:vu(n,"width"),height:vu(n,"height")},children:[{text:""}]}}const Jy={selector:"img:not([data-w-e-type])",parseElemHtml:Ky},Gy={key:"urlKey",factory(){return new Qi("text")}},Yy={key:"linkUrlKey",factory(){return new Qi("link")}},Zy={key:"imgUrlKey",factory(){return new Qi("image")}};function Xy(t){const{isInline:n,isVoid:r,insertNode:o}=t,i=t;return i.isInline=a=>{const{type:l}=a;return l==="image"?!0:n(a)},i.isVoid=a=>{const{type:l}=a;return l==="image"||l==="video"?!0:r(a)},i}const Qy={menus:[Zy,Gy,Yy,Ay,My,wy,By,Dy,xy,ky,Ey],renderElems:[Hy,Oy],parseElemsHtml:[Jy,Py],elemsToHtml:[qy,jy],editorPlugin:Xy};Ze.registerModule(Qy);const e3={components:{mediaBox:lr,urlBox:zs},props:{disabled:Boolean,placeholder:{type:String,default:"..."},modelValue:{type:String,default:""}},data(){return{mode:"phone",getFragment:null,editor:null,addFile:null,addUrl:null,fileShow:!1,fileType:"image",urlShow:!1,videoShow:!1,videoNodes:{},url:"",sum:10}},computed:{url2(){return this.url?this.$refs.urlbox.url2str(this.url):""},typeName(){return{video:"视频",audio:"音频",image:"图片",file:"文件"}[this.fileType]}},mounted(){this.init()},methods:{sethtml(t){},init(){const t=this,n={MENU_CONF:{},EXTEND_CONF:{demo:1111}};n.hoverbarKeys=Uy,n.placeholder=this.placeholder,n.autoFocus=!1,n.onChange=i=>{this.$emit("update:modelValue",i.isEmpty()?"":i.getHtml())},n.onFocus=i=>{},n.MENU_CONF.image={upload(i){t.sum=5,t.fileType="image",t.fileShow=!0,t.addFile=i}},n.MENU_CONF.linkUrlKey={exec:i=>{this.urlShow=!0,setTimeout(()=>{this.url=i},200)}},n.MENU_CONF.video={upload(i){t.sum=1,t.fileType="video",t.fileShow=!0,t.addFile=i},view(i){t.videoNodes=i,t.videoShow=!0}};const r=my({selector:this.$refs.wangEditor,config:n,html:typeof this.modelValue=="string"?this.modelValue:"",mode:"default"}),o={excludeKeys:["group-more-style","fontSize","fontFamily","insertLink"]};o.insertKeys={index:23,keys:["|","image","video","|","insertBottom","insertTop","delEmpty","|"]},gy({editor:r,selector:this.$refs.wangEditorToolbar,config:o}),this.editor=r},urlChange(t){this.url=t},fnUrlOk(){this.editor.restoreSelection();const t=this.$refs.urlbox.getData();if(F.getSelectedNodeByType(this.editor,"image"))O.setNodes(this.editor,{href:t},{match:r=>F.checkNodeType(r,"image")});else if(F.getSelectedNodeByType(this.editor,"link"))O.setNodes(this.editor,{url:t},{match:o=>F.checkNodeType(o,"link")});else{const o=this.editor.getSelectionText()||t;this.editor.dangerouslyInsertHtml(`<a href='${t}'>${o}</a>`)}this.urlShow=!1},fileOk(){const t=this,n=this.$refs.fileBox.getData();if(n.length==0)return this.$msg.error("请先选择"+this.typeName);n.forEach(function(r){console.log(r);let o=$fileUrl(r);t.addFile(o)}),this.fileShow=!1}}},t3={class:"pos-relative"},n3={class:"bg-black"},r3=["src"],o3={class:"dialog-footer"},i3={class:"dialog-footer"},s3={class:"dialog-footer flex justify-end"},a3={class:"pr"},l3={class:"bg-main z-999 b-1 b-solid b-color-[--el-border-color]"},c3={class:"pos-absolute rounded-md overflow-hidden z-9 right-6 top-13 flex items-center *:hover:text-white *:hover:bg-primary *:bg-zinc-100 *:size-8 *:flex *:items-center *:justify-center"},u3={class:"b-0 b-b-1 b-solid b-color-[--el-border-color]",ref:"wangEditorToolbar"};function d3(t,n,r,o,i,a){const l=s.resolveComponent("el-button"),c=s.resolveComponent("el-dialog"),u=s.resolveComponent("mediaBox"),d=s.resolveComponent("url-box"),f=s.resolveComponent("el-text");return s.openBlock(),s.createElementBlock("div",t3,[s.createVNode(c,{modelValue:i.videoShow,"onUpdate:modelValue":n[1]||(n[1]=p=>i.videoShow=p),title:"播放视频",width:"540px",top:"5vh"},{footer:s.withCtx(()=>[s.createElementVNode("span",o3,[s.createVNode(l,{size:"small",onClick:n[0]||(n[0]=p=>i.videoShow=!1)},{default:s.withCtx(()=>[...n[8]||(n[8]=[s.createTextVNode("关闭",-1)])]),_:1})])]),default:s.withCtx(()=>[s.createElementVNode("div",n3,[s.createElementVNode("video",{src:i.videoNodes.src,controls:"",width:"100%",height:"360px"},null,8,r3)])]),_:1},8,["modelValue"]),s.createVNode(c,{modelValue:i.fileShow,"onUpdate:modelValue":n[3]||(n[3]=p=>i.fileShow=p),title:"选择"+a.typeName,width:"1080px",top:"5vh"},{footer:s.withCtx(()=>[s.createElementVNode("span",i3,[s.createVNode(l,{size:"small",onClick:n[2]||(n[2]=p=>i.fileShow=!1)},{default:s.withCtx(()=>[...n[9]||(n[9]=[s.createTextVNode("取消",-1)])]),_:1}),s.createVNode(l,{size:"small",type:"primary",onClick:a.fileOk},{default:s.withCtx(()=>[...n[10]||(n[10]=[s.createTextVNode("确认",-1)])]),_:1},8,["onClick"])])]),default:s.withCtx(()=>[(s.openBlock(),s.createBlock(u,{ref:"fileBox",type:i.fileType,key:i.fileType,sum:i.sum},null,8,["type","sum"]))]),_:1},8,["modelValue","title"]),s.createVNode(c,{modelValue:i.urlShow,"onUpdate:modelValue":n[5]||(n[5]=p=>i.urlShow=p),title:"选择链接",width:"1080px",top:"5vh"},{footer:s.withCtx(()=>[s.createElementVNode("span",s3,[s.createElementVNode("div",a3,[s.createVNode(f,{size:"small",class:"pr-xs"},{default:s.withCtx(()=>[...n[11]||(n[11]=[s.createTextVNode("当前链接",-1)])]),_:1}),s.createVNode(f,{size:"small",type:"primary"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(a.url2),1)]),_:1})]),s.createVNode(l,{size:"small",onClick:n[4]||(n[4]=p=>i.urlShow=!1)},{default:s.withCtx(()=>[...n[12]||(n[12]=[s.createTextVNode("取消",-1)])]),_:1}),s.createVNode(l,{size:"small",type:"primary",onClick:a.fnUrlOk},{default:s.withCtx(()=>[...n[13]||(n[13]=[s.createTextVNode("确认",-1)])]),_:1},8,["onClick"])])]),default:s.withCtx(()=>[s.createVNode(d,{onChange:a.urlChange,ref:"urlbox"},null,8,["onChange"])]),_:1},8,["modelValue"]),s.createElementVNode("div",l3,[s.createElementVNode("div",c3,[s.createElementVNode("div",{onClick:n[6]||(n[6]=p=>i.mode="pc"),class:s.normalizeClass({"text-primary":i.mode==="pc"})},[...n[14]||(n[14]=[s.createElementVNode("div",{class:"i-mdi-monitor click size-4"},null,-1)])],2),s.createElementVNode("div",{onClick:n[7]||(n[7]=p=>i.mode="phone"),class:s.normalizeClass({"text-primary":i.mode==="phone"})},[...n[15]||(n[15]=[s.createElementVNode("div",{class:"i-mdi-cellphone click text-lg"},null,-1)])],2)]),s.createElementVNode("div",u3,null,512),s.createElementVNode("div",{class:s.normalizeClass(["wangEditor",i.mode==="phone"?"*:rounded-md *:w-120 *:mx-auto *:b-1 *:b-solid *:b-color-[--el-border-color]":""]),ref:"wangEditor"},null,2)])])}const wu=oe(e3,[["render",d3]]),f3=Object.freeze(Object.defineProperty({__proto__:null,default:wu},Symbol.toStringTag,{value:"Module"})),p3={name:"a-image-text",emits:["change","update:modelValue"],components:{imgBox:lr},props:{modelValue:{type:[Array,Object],default:[]}},data(){return{imgShow:!1,sum:10,index:-1,list:[]}},created(){Array.isArray(this.modelValue)&&(this.list=this.modelValue),this.$watch("list",function(t){this.$emit("update:modelValue",t),this.$emit("change",t)},{deep:!0})},methods:{getData(){return this.list},addText(){const t=this;this.$prompt(!1,"添加文字",{inputType:"textarea"}).then(n=>{this.list.push({text:n.value}),setTimeout(function(){t.$refs.scrollbar.setScrollTop(9999)},200)})},addImage(){this.sum=10,this.imgShow=!0},editImage(t){this.sum=1,this.index=t,this.imgShow=!0},fnImgsOk(){const t=this,n=this.$refs.imgbox.getData();if(n.length==0)return this.$msg.error("请先选择图片");if(this.sum==1)this.list[this.index].image=n[0];else{for(let r=0;r<n.length;r++)this.list.push({image:n[r]});setTimeout(function(){t.$refs.scrollbar.setScrollTop(9999)},200)}this.imgShow=!1},editText(t){this.$prompt(!1,"修改文字",{inputValue:this.list[t].text,inputType:"textarea"}).then(n=>{this.list[t].text=n.value})}}},h3={class:"dialog-footer"},m3={class:"image-text"},g3={class:"box"},y3={key:0,class:"no-data"},b3={key:0,class:"item text"},C3=["onClick"],v3=["onClick"],D3={key:1,class:"item img"},w3=["onClick"],B3=["onClick"],x3={class:"bottom"};function k3(t,n,r,o,i,a){const l=s.resolveComponent("img-box"),c=s.resolveComponent("el-button"),u=s.resolveComponent("el-dialog"),d=s.resolveComponent("a-image"),f=s.resolveComponent("a-draggable"),p=s.resolveComponent("el-scrollbar");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(u,{modelValue:i.imgShow,"onUpdate:modelValue":n[1]||(n[1]=h=>i.imgShow=h),title:"选择图片",width:"1080px",top:"5vh"},{footer:s.withCtx(()=>[s.createElementVNode("span",h3,[s.createVNode(c,{size:"small",onClick:n[0]||(n[0]=h=>i.imgShow=!1)},{default:s.withCtx(()=>[...n[4]||(n[4]=[s.createTextVNode("取消",-1)])]),_:1}),s.createVNode(c,{size:"small",type:"primary",onClick:a.fnImgsOk},{default:s.withCtx(()=>[...n[5]||(n[5]=[s.createTextVNode("确认",-1)])]),_:1},8,["onClick"])])]),default:s.withCtx(()=>[s.createVNode(l,{type:"image",ref:"imgbox",sum:i.sum,cate:2},null,8,["sum"])]),_:1},8,["modelValue"]),s.createElementVNode("div",m3,[s.createElementVNode("div",g3,[s.createVNode(p,{ref:"scrollbar",height:"100%"},{default:s.withCtx(()=>[i.list.length==0?(s.openBlock(),s.createElementBlock("div",y3," 点击下方按钮添加图片或者文字 ")):s.createCommentVNode("",!0),s.createVNode(f,{class:"list",list:i.list,filter:".del"},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.list,(h,m)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[h.text?(s.openBlock(),s.createElementBlock("div",b3,[s.createElementVNode("p",null,s.toDisplayString(h.text),1),s.createElementVNode("div",{class:"del",onClick:g=>i.list.splice(m,1)}," 删除 ",8,C3),s.createElementVNode("div",{class:"edit",onClick:g=>a.editText(m)}," 编辑 ",8,v3)])):s.createCommentVNode("",!0),h.image?(s.openBlock(),s.createElementBlock("div",D3,[s.createVNode(d,{preview:!1,src:h.image,process:"400"},null,8,["src"]),s.createElementVNode("div",{class:"del",onClick:g=>i.list.splice(m,1)}," 删除 ",8,w3),s.createElementVNode("div",{class:"edit",onClick:g=>a.editImage(m)}," 编辑 ",8,B3)])):s.createCommentVNode("",!0)],64))),256))]),_:1},8,["list"])]),_:1},512)]),s.createElementVNode("div",x3,[s.createElementVNode("div",{class:"item",onClick:n[2]||(n[2]=(...h)=>a.addText&&a.addText(...h))},[...n[6]||(n[6]=[s.createElementVNode("i",{class:"i-ri-text"},null,-1),s.createElementVNode("span",null,"文字",-1)])]),s.createElementVNode("div",{class:"item",onClick:n[3]||(n[3]=(...h)=>a.addImage&&a.addImage(...h))},[...n[7]||(n[7]=[s.createElementVNode("i",{class:"i-ri-image-add-line"},null,-1),s.createElementVNode("span",null,"图片",-1)])])])])])}const Bu=oe(p3,[["render",k3],["__scopeId","data-v-a908f232"]]),E3={props:{modelValue:Array|String|Number,remove:Array|String|Number,url:String|Array,disabled:Boolean,level:{type:Number,default:0},props:{type:Object,default:{}},placeholder:{type:String,default:"选择"}},data(){return{value:[],options:[],_props:{}}},created(){let t;if(this.url){if((this.props.emitPath||this.props.multiple)&&this.modelValue){t=(this.modelValue+"").split(",");for(let n=0;n<t.length;n++)t[n]=this.setNumber(t[n])}else t=this.setNumber(this.modelValue);if(this.value=t,this._props={value:"id",label:"title",checkStrictly:!0,emitPath:!1,...this.props},typeof this.url=="object")return Array.isArray(this.url)&&this.url.forEach(n=>{n.status===0&&(n.disabled=!0)}),this.options=this.composeTree(this.url);$req.post(this.url).then(n=>{n.code==0&&(n.data.constructor===Array&&n.data.forEach(r=>{r?.status===0&&(r.disabled=!0)}),this.options=this.composeTree(n.data))})}},methods:{setNumber(t){var n=/^\d+(\.\d+)?$/;return n.test(t)?Number(t):t},change(t){t&&t.constructor==Array?t=Array.from(new Set([].concat(...t))):t=t||0,this.$emit("update:modelValue",t),this._props.checkStrictly&&!this._props.multiple&&this.$refs.cascader.togglePopperVisible()},composeTree(t=[]){const n=[],r=this.remove,o=JSON.parse(JSON.stringify(t));if(t?.length&&typeof t[0]=="string")return t.forEach((l,c)=>{n.push({title:l,id:c})}),n;if(t&&t.constructor==Object){for(let l in t)n.push({title:t[l],id:l});return n}const i=function(l,c=1){return l==0?0:(o.forEach(u=>{u.id==l&&u.pid!=0&&i(u.pid,c++)}),c+1)};if(!Array.isArray(t))return n;const a={};return o.forEach(l=>{a[l.id]=l}),o.forEach(l=>{if((l.id==r||r instanceof Array&&r.indexOf(l.id)>-1||l.pid==r)&&r&&(l.disabled=!0),this.level==0||i(l.pid)<=this.level){const c=a[l.pid];c?(c.children||(c.children=[])).push(l):n.push(l)}}),n}}};function _3(t,n,r,o,i,a){const l=s.resolveComponent("el-cascader");return r.url?(s.openBlock(),s.createBlock(l,{key:0,"validate-event":!1,ref:"cascader",modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=c=>i.value=c),options:i.options,clearable:!0,"collapse-tags":!0,"show-all-levels":!1,onChange:a.change,maxCollapseTags:i._props.maxCollapseTags||1,props:i._props,disabled:r.disabled,placeholder:r.placeholder,class:"w-full"},null,8,["modelValue","options","onChange","maxCollapseTags","props","disabled","placeholder"])):s.createCommentVNode("",!0)}const xu=oe(E3,[["render",_3]]),A3={props:{modelValue:Array|String,add:{type:String,default:"添加"}},data(){return{tags:[]}},created(){Array.isArray(this.modelValue)&&(this.tags=this.modelValue)},methods:{fnEdit(t){const n=this.tags[t];$prompt(!1,"修改",{inputValue:n}).then(r=>{r.value!=n&&r.value&&(this.tags[t]=r.value)})},fnAdd(){$prompt(!1,"添加",{}).then(t=>{t.value&&t.value&&(this.tags.push(t.value),this.$emit("update:modelValue",this.tags))}).catch(()=>{})},fnClose(t){console.log(t),this.tags.splice(t,1),this.tags.length==0?this.$emit("update:modelValue",""):this.$emit("update:modelValue",this.tags)}}};function N3(t,n,r,o,i,a){const l=s.resolveComponent("el-tag"),c=s.resolveComponent("el-button"),u=s.resolveComponent("a-draggable");return i.tags?(s.openBlock(),s.createBlock(u,{key:0,class:"flex flex-wrap gap-10px",list:i.tags,filter:".add"},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.tags,(d,f)=>(s.openBlock(),s.createBlock(l,{key:d,closable:"","disable-transitions":!1,onClose:()=>{a.fnClose(f)},onClick:s.withModifiers(p=>a.fnEdit(f),["stop"]),title:"点击修改"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(d),1)]),_:2},1032,["onClose","onClick"]))),128)),s.createVNode(c,{class:"add",size:"small",onClick:a.fnAdd},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(r.add),1)]),_:1},8,["onClick"])]),_:1},8,["list"])):s.createCommentVNode("",!0)}const ku=oe(A3,[["render",N3]]),S3={name:"a-color-picker",props:{modelValue:String,tabindex:{type:[Number,String],default:0},colorFormat:{type:String,default:"rgb"},showAlpha:{type:[Boolean,String,Number],default:!0},colors:{type:Array,default:["#409EFF","#F56C6C","#E6A23C","#ffd700","#67C23A","#00ced1","#9254de","#000000","#303133","#666666","#909399","#C0C4CC","#DCDFE6","#E4E7ED","#EBEEF5","#F2F6FC","#ffffff"]}},data(){return{value:"",showAlpha_:!0}},created(){this.showAlpha==0?this.showAlpha_=!1:this.showAlpha_=!!this.showAlpha,this.modelValue&&(this.value=this.modelValue)},methods:{show(){this.$refs.colorPicker.show()},change(t){this.$emit("update:modelValue",t)}}},F3={class:"a-color-picker input-button w-full flex"};function V3(t,n,r,o,i,a){const l=s.resolveComponent("el-input"),c=s.resolveComponent("el-color-picker");return s.openBlock(),s.createElementBlock("div",F3,[s.createVNode(l,{readonly:"",modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=u=>i.value=u),placeholder:"点击右侧选择颜色"},{prefix:s.withCtx(()=>[...n[2]||(n[2]=[s.createElementVNode("div",{class:"color-icon"},[s.createElementVNode("i",{class:"i-ri-palette-line",style:{color:"#D9D9D9"}})],-1)])]),_:1},8,["modelValue"]),s.createElementVNode("div",null,[s.createVNode(c,{"color-format":r.colorFormat,ref:"colorPicker",tabindex:r.tabindex,onChange:a.change,modelValue:i.value,"onUpdate:modelValue":n[1]||(n[1]=u=>i.value=u),"show-alpha":i.showAlpha_,predefine:r.colors},null,8,["color-format","tabindex","onChange","modelValue","show-alpha","predefine"])])])}const Eu=oe(S3,[["render",V3]]),O3={上海:[121.487899486,31.24916171],临沧:[100.092612914,23.8878061038],丽江:[100.229628399,26.8753510895],保山:[99.1779956133,25.1204891962],大理白族自治州:[100.223674789,25.5968996394],德宏傣族景颇族自治州:[98.5894342874,24.441239663],怒江傈僳族自治州:[98.8599320425,25.8606769782],文山壮族苗族自治州:[104.246294318,23.3740868504],昆明:[102.714601139,25.0491531005],昭通:[103.725020656,27.3406329636],普洱:[100.98005773,22.7887777801],曲靖:[103.782538888,25.5207581429],楚雄彝族自治州:[101.529382239,25.0663556742],玉溪:[102.545067892,24.3704471344],红河哈尼族彝族自治州:[103.384064757,23.3677175165],西双版纳傣族自治州:[100.803038275,22.0094330022],迪庆藏族自治州:[99.7136815989,27.8310294612],乌兰察布:[113.112846391,41.0223629468],乌海:[106.831999097,39.6831770068],兴安盟:[122.048166514,46.0837570652],包头:[109.846238532,40.6471194257],呼伦贝尔:[119.760821794,49.2016360546],呼和浩特:[111.66035052,40.8283188731],巴彦淖尔:[107.42380672,40.7691799024],赤峰:[118.930761192,42.2971123203],通辽:[122.260363263,43.633756073],鄂尔多斯:[109.993706251,39.8164895606],锡林郭勒盟:[116.027339689,43.9397048423],阿拉善盟:[105.695682871,38.8430752644],北京:[116.395645038,39.9299857781],台湾省:[121.582386,25.0358],吉林:[126.564543989,43.8719883344],四平:[124.391382074,43.1755247011],延边朝鲜族自治州:[129.485901958,42.8964136037],松原:[124.832994532,45.1360489701],白城:[122.840776679,45.6210862752],白山:[126.435797675,41.945859397],辽源:[125.133686052,42.9233026191],通化:[125.942650139,41.7363971299],长春:[125.313642427,43.8983376071],乐山:[103.760824239,29.6009576111],内江:[105.073055992,29.5994615348],凉山彝族自治州:[102.259590803,27.8923929037],南充:[106.105553984,30.8009651682],宜宾:[104.633019062,28.7696747963],巴中:[106.757915842,31.8691891592],广元:[105.81968694,32.4410401584],广安:[106.635720331,30.4639838879],德阳:[104.402397818,31.1311396527],成都:[104.067923463,30.6799428454],攀枝花:[101.722423152,26.5875712571],泸州:[105.443970289,28.8959298039],甘孜藏族自治州:[101.969232063,30.0551441144],眉山:[103.841429563,30.0611150799],绵阳:[104.705518975,31.5047012581],自贡:[104.776071339,29.3591568895],资阳:[104.635930302,30.132191434],达州:[107.494973447,31.2141988589],遂宁:[105.564887792,30.5574913504],阿坝藏族羌族自治州:[102.228564689,31.9057628583],雅安:[103.009356466,29.9997163371],天津:[117.210813092,39.1439299033],中卫:[105.196754199,37.5211241916],吴忠:[106.208254199,37.9935610029],固原:[106.285267996,36.0215234807],石嘴山:[106.379337202,39.0202232836],银川:[106.206478608,38.5026210119],亳州:[115.787928245,33.8712105653],六安:[116.505252683,31.7555583552],合肥:[117.282699092,31.8669422607],安庆:[117.058738772,30.5378978174],宣城:[118.752096311,30.9516423543],宿州:[116.988692412,33.6367723858],池州:[117.494476772,30.6600192482],淮北:[116.791447429,33.9600233054],淮南:[117.018638863,32.6428118237],滁州:[118.324570351,32.3173505954],芜湖:[118.384108423,31.3660197875],蚌埠:[117.357079866,32.9294989067],铜陵:[117.819428729,30.9409296947],阜阳:[115.820932259,32.9012113306],马鞍山:[118.515881847,31.6885281589],黄山:[118.293569632,29.7344348562],东营:[118.583926333,37.4871211553],临沂:[118.340768237,35.0724090744],威海:[122.093958366,37.5287870813],德州:[116.328161364,37.4608259263],日照:[119.507179943,35.4202251931],枣庄:[117.279305383,34.8078830784],泰安:[117.089414917,36.1880777589],济南:[117.024967066,36.6827847272],济宁:[116.600797625,35.4021216643],淄博:[118.059134278,36.8046848542],滨州:[117.968292415,37.4053139418],潍坊:[119.142633823,36.7161148731],烟台:[121.30955503,37.5365615629],聊城:[115.986869139,36.4558285147],莱芜:[117.684666912,36.2336541336],菏泽:[115.463359775,35.2624404961],青岛:[120.384428184,36.1052149013],临汾:[111.538787596,36.0997454436],吕梁:[111.143156602,37.527316097],大同:[113.290508673,40.1137444997],太原:[112.550863589,37.890277054],忻州:[112.727938829,38.461030573],晋中:[112.7385144,37.6933615268],晋城:[112.867332758,35.4998344672],朔州:[112.479927727,39.3376719662],运城:[111.006853653,35.0388594798],长治:[113.120292086,36.2016643857],阳泉:[113.569237602,37.8695294932],东莞:[113.763433991,23.0430238154],中山:[113.422060021,22.5451775145],云浮:[112.050945959,22.9379756855],佛山:[113.134025635,23.0350948405],广州:[113.307649675,23.1200491021],惠州:[114.41065808,23.1135398524],揭阳:[116.379500855,23.5479994669],梅州:[116.126403098,24.304570606],汕头:[116.728650288,23.3839084533],汕尾:[115.372924289,22.7787305002],江门:[113.078125341,22.5751167835],河源:[114.713721476,23.7572508505],深圳:[114.025973657,22.5460535462],清远:[113.040773349,23.6984685504],湛江:[110.365067263,21.2574631038],潮州:[116.630075991,23.6618116765],珠海:[113.562447026,22.2569146461],肇庆:[112.47965337,23.0786632829],茂名:[110.931245331,21.6682257188],阳江:[111.977009756,21.8715173045],韶关:[113.594461107,24.8029603119],北海:[109.122627919,21.472718235],南宁:[108.297233556,22.8064929356],崇左:[107.357322038,22.4154552965],来宾:[109.231816505,23.7411659265],柳州:[109.42240181,24.3290533525],桂林:[110.260920147,25.262901246],梧州:[111.30547195,23.4853946367],河池:[108.069947709,24.6995207829],玉林:[110.151676316,22.6439736084],百色:[106.631821404,23.9015123679],贵港:[109.613707557,23.1033731644],贺州:[111.552594179,24.4110535471],钦州:[108.638798056,21.9733504653],防城港:[108.351791153,21.6173984705],乌鲁木齐:[87.5649877411,43.8403803472],伊犁哈萨克自治州:[81.2978535304,43.9222480963],克孜勒苏柯尔克孜自治州:[76.1375644775,39.7503455778],克拉玛依:[84.8811801861,45.5943310667],博尔塔拉蒙古自治州:[82.0524362672,44.9136513743],吐鲁番地区:[89.1815948657,42.9604700169],和田地区:[79.9302386372,37.1167744927],哈密地区:[93.5283550928,42.8585963324],喀什地区:[75.9929732675,39.4706271887],塔城地区:[82.9748805837,46.7586836297],昌吉回族自治州:[87.2960381257,44.0070578985],自治区直辖县级行政区划:[85.6148993383,42.1270009576],阿克苏地区:[80.2698461793,41.1717309015],阿勒泰地区:[88.1379154871,47.8397444862],南京:[118.778074408,32.0572355018],南通:[120.873800951,32.0146645408],宿迁:[118.296893379,33.9520497337],常州:[119.981861013,31.7713967447],徐州:[117.188106623,34.2715534311],扬州:[119.427777551,32.4085052546],无锡:[120.305455901,31.5700374519],泰州:[119.919606016,32.4760532748],淮安:[119.030186365,33.6065127393],盐城:[120.148871818,33.3798618771],苏州:[120.619907115,31.317987368],连云港:[119.173872217,34.601548967],镇江:[119.455835405,32.2044094436],上饶:[117.955463877,28.4576225539],九江:[115.999848022,29.7196395261],南昌:[115.893527546,28.6895780001],吉安:[114.992038711,27.1138476502],宜春:[114.400038672,27.8111298958],抚州:[116.360918867,27.9545451703],新余:[114.947117417,27.8223215586],景德镇:[117.186522625,29.3035627684],萍乡:[113.859917033,27.639544223],赣州:[114.935909079,25.8452955363],鹰潭:[117.035450186,28.2413095972],保定:[115.494810169,38.886564548],唐山:[118.183450598,39.6505309225],廊坊:[116.703602223,39.5186106251],张家口:[114.89378153,40.8111884911],承德:[117.933822456,40.9925210525],沧州:[116.863806476,38.2976153503],石家庄:[114.522081844,38.0489583146],秦皇岛:[119.604367616,39.9454615659],衡水:[115.686228653,37.7469290459],邢台:[114.520486813,37.0695311969],邯郸:[114.482693932,36.6093079285],三门峡:[111.181262093,34.7833199411],信阳:[114.085490993,32.1285823075],南阳:[112.542841901,33.0114195691],周口:[114.654101942,33.6237408181],商丘:[115.641885688,34.4385886402],安阳:[114.351806508,36.1102667222],平顶山:[113.300848978,33.7453014565],开封:[114.351642118,34.8018541758],新乡:[113.912690161,35.3072575577],洛阳:[112.447524769,34.6573678177],漯河:[114.0460614,33.5762786885],濮阳:[115.026627441,35.7532978882],焦作:[113.211835885,35.234607555],许昌:[113.83531246,34.0267395887],郑州:[113.64964385,34.7566100641],驻马店:[114.049153547,32.9831581541],鹤壁:[114.297769838,35.7554258742],丽水:[119.929575843,28.4562995521],台州:[121.440612936,28.6682832857],嘉兴:[120.760427699,30.7739922396],宁波:[121.579005973,29.8852589659],杭州:[120.219375416,30.2592444615],温州:[120.690634734,28.002837594],湖州:[120.137243163,30.8779251557],绍兴:[120.592467386,30.0023645805],舟山:[122.169872098,30.0360103026],衢州:[118.875841652,28.9569104475],金华:[119.652575704,29.1028991054],三亚:[109.522771281,18.2577759149],三沙:[112.350383075,16.840062894],海口:[110.330801848,20.022071277],十堰:[110.801228917,32.6369943395],咸宁:[114.300060592,29.8806567577],孝感:[113.935734392,30.9279547842],宜昌:[111.310981092,30.732757818],恩施土家族苗族自治州:[109.491923304,30.2858883166],武汉:[114.316200103,30.5810841269],省直辖:[112.410562192,31.2093162501],荆州:[112.241865807,30.332590523],荆门:[112.217330299,31.0426112029],襄阳:[112.250092848,32.2291685915],鄂州:[114.895594041,30.3844393228],随州:[113.379358364,31.7178576082],黄冈:[114.906618047,30.4461089379],黄石:[115.050683164,30.2161271277],娄底:[111.996396357,27.7410733023],岳阳:[113.146195519,29.3780070755],常德:[111.653718137,29.0121488552],张家界:[110.481620157,29.1248893532],怀化:[109.986958796,27.5574829012],株洲:[113.131695341,27.8274329277],永州:[111.614647686,26.4359716468],湘潭:[112.935555633,27.835095053],湘西土家族苗族自治州:[109.7457458,28.3179507937],益阳:[112.366546645,28.5880877799],衡阳:[112.583818811,26.8981644154],邵阳:[111.461525404,27.2368112449],郴州:[113.037704468,25.7822639757],长沙:[112.979352788,28.2134782309],澳门特别行政区:[113.566432335,22.1950041592],临夏回族自治州:[103.215249178,35.5985143488],兰州:[103.823305441,36.064225525],嘉峪关:[98.2816345853,39.8023973267],天水:[105.736931623,34.5843194189],定西:[104.626637601,35.5860562418],平凉:[106.688911157,35.55011019],庆阳:[107.644227087,35.7268007545],张掖:[100.459891869,38.939320297],武威:[102.640147343,37.9331721429],甘南藏族自治州:[102.917442486,34.9922111784],白银:[104.171240904,36.5466817062],酒泉:[98.5084145062,39.7414737682],金昌:[102.208126263,38.5160717995],陇南:[104.934573406,33.3944799729],三明:[117.642193934,26.2708352794],南平:[118.181882949,26.6436264742],厦门:[118.103886046,24.4892306125],宁德:[119.54208215,26.6565274192],泉州:[118.600362343,24.901652384],漳州:[117.676204679,24.5170647798],福州:[119.330221107,26.0471254966],莆田:[119.077730964,25.4484501367],龙岩:[117.017996739,25.0786854335],山南地区:[91.7506438744,29.2290269317],拉萨:[91.111890896,29.6625570621],日喀则地区:[88.8914855677,29.2690232039],昌都地区:[97.18558158,31.1405756319],林芝地区:[94.3499854582,29.6669406258],那曲地区:[92.0670183689,31.4806798301],阿里地区:[81.1076686895,30.4045565883],六盘水:[104.85208676,26.5918660603],安顺:[105.928269966,26.2285945777],毕节:[105.333323371,27.4085621313],贵阳:[106.709177096,26.6299067414],遵义:[106.931260316,27.6999613771],铜仁:[109.168558028,27.6749026906],黔东南苗族侗族自治州:[107.985352573,26.5839917665],黔南布依族苗族自治州:[107.52320511,26.2645359974],黔西南布依族苗族自治州:[104.900557798,25.0951480559],丹东:[124.338543115,40.1290228266],大连:[121.593477781,38.9487099383],抚顺:[123.929819767,41.8773038296],朝阳:[120.446162703,41.5718276679],本溪:[123.77806237,41.3258376266],沈阳:[123.432790922,41.8086447835],盘锦:[122.07322781,41.141248023],营口:[122.233391371,40.6686510665],葫芦岛:[120.860757645,40.7430298813],辽阳:[123.172451205,41.2733392656],铁岭:[123.854849615,42.2997570121],锦州:[121.147748738,41.1308788759],阜新:[121.660822129,42.0192501071],鞍山:[123.007763329,41.1187436822],重庆:[106.530635013,29.5446061089],咸阳:[108.707509278,34.345372996],商洛:[109.934208154,33.8739073951],安康:[109.038044563,32.70437045],宝鸡:[107.170645452,34.3640808097],延安:[109.500509757,36.6033203523],榆林:[109.745925744,38.2794392401],汉中:[107.045477629,33.0815689782],渭南:[109.483932697,34.5023579758],西安:[108.953098279,34.2777998978],铜川:[108.968067013,34.9083676964],果洛藏族自治州:[100.223722769,34.4804845846],海东地区:[102.085206987,36.5176101677],海北藏族自治州:[100.879802174,36.9606541011],海南藏族自治州:[100.624066094,36.2843638038],海西蒙古族藏族自治州:[97.3426254153,37.3737990706],玉树藏族自治州:[97.0133161374,33.0062399097],西宁:[101.76792099,36.640738612],黄南藏族自治州:[102.007600308,35.5228515517],香港特别行政区:[114.173291988,22.3072458588],七台河:[131.019048047,45.7750053686],伊春:[128.910765978,47.7346850751],佳木斯:[130.284734586,46.8137796047],双鸭山:[131.17140174,46.6551020625],哈尔滨:[126.657716855,45.7732246332],大兴安岭地区:[124.19610419,51.991788968],大庆:[125.02183973,46.59670902],牡丹江:[129.608035396,44.5885211528],绥化:[126.989094572,46.646063927],鸡西:[130.941767273,45.3215398866],鹤岗:[130.292472051,47.3386659037],黑河:[127.500830295,50.2506900907],齐齐哈尔:[123.987288942,47.3476998134]},T3={props:{zoom:{type:Number,default:15},mode:{type:String,default:""},search:String|Array,modelValue:String|Array},data(){return{map:{},point:[],show:!1,city:0,value:""}},created(){console.log("created"),this.modelValue&&typeof this.modelValue=="string"?this.value=this.modelValue.split(","):this.value=this.modelValue},mounted(){this.mode&&setTimeout(()=>{this.init()},100)},methods:{add(){const t=this;this.show=!0,setTimeout(()=>{t.init()},100)},init(){console.log("init");const t=this;this.map=new BMap.Map("container"),this.map.addEventListener("click",function(n){let r=n.point.lng.toFixed(6),o=n.point.lat.toFixed(6);t.point=[r,o],t.map.clearOverlays();let i=new BMap.Point(r,o);t.map.addOverlay(new BMap.Marker(i)),t.mode&&t.getData()}),this.map.addControl(new BMap.NavigationControl),this.map.addControl(new BMap.ScaleControl),this.map.addControl(new BMap.OverviewMapControl),this.map.enableScrollWheelZoom(!0),this.setMap(this.value)},clear(){this.$emit("update:modelValue","")},getData(){this.show=!1,this.value=this.point,this.$emit("update:modelValue",this.point.join(","))},setMap(t){if(t?.length===0&&(t=""),typeof t=="object"&&t?.length==2){const n=new BMap.Point(t[0],t[1]);this.map.clearOverlays(),this.map.addOverlay(new BMap.Marker(n)),this.map.centerAndZoom(n,this.zoom)}else this.map.centerAndZoom(new BMap.Point(116.41667,39.91667),7)},change(t,n){if(console.log(t,n),t?.length===0)return;let r="";t.length==1||t[0].indexOf("市")>-1?r=t[0]:r=t[1],r.endsWith("市")&&(r=r.slice(0,-1));let o=O3[r];console.log(o,r),o&&this.setMap(o)}}},j3={class:"map"},L3={class:"input"},P3={class:"dialog-footer"},M3={key:1,class:"map"},z3={class:"input text-center bg-main"},$3={key:2,class:"input-button"};function I3(t,n,r,o,i,a){const l=s.resolveComponent("a-region-picker"),c=s.resolveComponent("el-button"),u=s.resolveComponent("el-dialog"),d=s.resolveComponent("el-input");return s.openBlock(),s.createElementBlock("div",null,[r.mode?(s.openBlock(),s.createElementBlock("div",M3,[s.createElementVNode("div",z3,s.toDisplayString(r.modelValue),1),n[7]||(n[7]=s.createElementVNode("div",{id:"container"},null,-1))])):(s.openBlock(),s.createBlock(u,{key:0,modelValue:i.show,"onUpdate:modelValue":n[2]||(n[2]=f=>i.show=f),title:"选择地点",width:"1080px",top:"5vh"},{footer:s.withCtx(()=>[s.createElementVNode("span",P3,[s.createVNode(c,{onClick:n[1]||(n[1]=f=>i.show=!1)},{default:s.withCtx(()=>[...n[5]||(n[5]=[s.createTextVNode("取消",-1)])]),_:1}),s.createVNode(c,{type:"primary",onClick:a.getData},{default:s.withCtx(()=>[...n[6]||(n[6]=[s.createTextVNode("确认",-1)])]),_:1},8,["onClick"])])]),default:s.withCtx(()=>[s.createElementVNode("div",j3,[s.createElementVNode("div",L3,[s.createVNode(l,{level:2,onChange:a.change,placeholder:"按城市查找",modelValue:i.city,"onUpdate:modelValue":n[0]||(n[0]=f=>i.city=f)},null,8,["onChange","modelValue"])]),n[4]||(n[4]=s.createElementVNode("div",{id:"container"},null,-1))])]),_:1},8,["modelValue"])),r.mode?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",$3,[s.createVNode(d,{modelValue:i.value,"onUpdate:modelValue":n[3]||(n[3]=f=>i.value=f),onClear:a.clear,clearable:"",placeholder:"选择坐标"},{prefix:s.withCtx(()=>[...n[8]||(n[8]=[s.createElementVNode("div",null,[s.createElementVNode("i",{class:"i-ri-map-pin-line op-70"})],-1)])]),_:1},8,["modelValue","onClear"]),s.createVNode(c,{style:{"margin-left":"-2px"},type:"primary",onClick:a.add},{default:s.withCtx(()=>[...n[9]||(n[9]=[s.createTextVNode("选择坐标",-1)])]),_:1},8,["onClick"])]))])}const es=oe(T3,[["render",I3],["__scopeId","data-v-9356e288"]]),ts=globalThis.dmxRegions??[],R3={emits:["change","update:modelValue"],props:{disabled:Boolean,modelValue:Array|String|Number,checkStrictly:Boolean,placeholder:String,level:Boolean|String},data(){return{value:"",props:{emitPath:!1,checkStrictly:!!this.checkStrictly,children:"s",label:"n",value:"c"},region:ts}},created(){this.modelValue&&typeof this.modelValue=="string"?this.value=this.modelValue*1:this.value=this.modelValue,this.level==2?this.region=this.setList(2):this.level==1?this.region=this.setList(1):this.region=ts},methods:{setList(t){let n=[];return ts.forEach(r=>{t===1?n.push({n:r.n,c:r.c}):r.s?n.push({n:r.n,c:r.c,s:r.s.map(o=>({n:o.n,c:o.c}))}):n.push({n:r.n,c:r.c,s:r.s})}),n},change(t){const n=this.$refs.cascader.getCheckedNodes()?.[0]?.pathLabels;this.$emit("update:modelValue",t),n&&this.$emit("change",n,t)}}};function H3(t,n,r,o,i,a){const l=s.resolveComponent("el-cascader");return s.openBlock(),s.createElementBlock("div",null,[s.createVNode(l,{ref:"cascader",modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=c=>i.value=c),onChange:a.change,options:i.region,props:i.props,disabled:r.disabled,clearable:"",placeholder:r.placeholder||"选择"},null,8,["modelValue","onChange","options","props","disabled","placeholder"])])}const _u=oe(R3,[["render",H3]]),ns=t=>t?Array.isArray(t)?typeof t[0]=="object"?t:t.map(n=>({label:n,value:n})):typeof t=="object"?Object.keys(t).map(n=>({label:t[n],value:n})):[]:[],U3={props:{node:Object,modelValue:void 0,size:""},render(){const{slot:t,row:n,index:r,value:o,oldData:i}=this.node;return t({row:n,index:r,value:o,oldData:i})},renderError(t,n){return t("pre",{style:{color:"red"}},n.stack)}},rs=t=>defineAsyncComponent(t),W3=rs(()=>Promise.resolve().then(()=>H8)),q3=rs(()=>Promise.resolve().then(()=>Z8)),K3=rs(()=>Promise.resolve().then(()=>c5)),Jt={media:s0,slot:U3,"input-select":pp,"group-tabs":W3,"group-table":q3,group:K3,md5:h0,file:d0,"search-box":$s,"input-auto":bp},Au={input:{component:De.ElInput,props:(t,n)=>({type:"text",size:n.size,autocomplete:"off",disabled:n._disabled,readonly:t.readonly,clearable:t.clearable??!0,placeholder:t.placeholder||"输入"}),slots:t=>({prepend:t.pre?t.pre:null,append:t.unit?t.unit:null})},select:{component:De.ElSelect,props:(t,n)=>({size:n.size,disabled:n._disabled,placeholder:t.placeholder||"请选择"}),children:(t,n)=>n.selectCols.map(r=>({component:s.markRaw(De.ElOption),props:{label:r.label,value:r.value}}))},radio:{component:De.ElRadioGroup,props:(t,n)=>({size:n.size,disabled:n._disabled}),children:(t,n)=>n.radioCols.map(r=>({component:s.markRaw(De.ElRadio),props:{value:r.value},children:r.label}))},"radio-button":{component:De.ElRadioGroup,props:(t,n)=>({size:n.size,disabled:n._disabled}),children:(t,n)=>n.radioCols.map(r=>({component:s.markRaw(De.ElRadioButton),props:{disabled:n._disabled,value:r.value},children:r.label}))},checkbox:{component:De.ElCheckboxGroup,props:(t,n)=>({size:n.size,disabled:n._disabled}),children:(t,n)=>n.checkboxCols.map(r=>({component:s.markRaw(De.ElCheckbox),props:{value:r.value},children:r.label}))},imgs:{component:Ms,props:(t,n)=>({size:n.size,limit:t.limit,cateId:t.cateId,disabled:n._disabled,tips:t.tips})},images:{component:Ms,props:(t,n)=>({size:n.size,limit:t.limit,"cate-id":t.cateId,disabled:n._disabled,tips:t.tips})},editor:{component:wu,props:t=>({placeholder:t.placeholder})},"image-text":{component:Bu,props:()=>({})},selects:{component:xu,props:(t,n)=>({disabled:n._disabled,placeholder:t.placeholder,url:t.url,remove:t.remove,level:t.level||0})},tags:{component:ku,props:()=>({})},color:{component:Eu,props:t=>({showAlpha:t.showAlpha,colorFormat:t.colorFormat})},map:{component:es},pickerMap:{component:es},region:{component:_u,props:(t,n)=>({disabled:n._disabled,checkStrictly:t.checkStrictly,level:t.level})},url:{component:Jh,props:()=>({})},time:{component:De.ElTimePicker,props:(t,n)=>({size:n.size,disabled:n._disabled,format:t.format||"HH:mm:ss",valueFormat:t.valueFormat||"HH:mm:ss",placeholder:"选择时间"})},times:{component:De.ElTimePicker,props:(t,n)=>({size:n.size,disabled:n._disabled,"start-placeholder":"开始时间","end-placeholder":"结束时间",format:"HH:mm:ss","value-format":"HH:mm:ss","is-range":!0,"range-separator":"~"})},date:{component:De.ElDatePicker,props:(t,n)=>({size:n.size,disabled:n._disabled,type:"date",placeholder:"选择日期","value-format":"YYYY-MM-DD"})},dates:{component:De.ElDatePicker,props:(t,n)=>({size:n.size,disabled:n._disabled,"start-placeholder":"开始日期","end-placeholder":"结束日期",type:"daterange","range-separator":"~",format:"YYYY-MM-DD","value-format":"X"})},datetime:{component:De.ElDatePicker,props:(t,n)=>({size:n.size,disabled:n._disabled,type:"datetime",placeholder:"选择时间",format:"YYYY-MM-DD HH:mm:ss","value-format":"YYYY-MM-DD HH:mm:ss"})},datetimes:{component:De.ElDatePicker,props:(t,n)=>({size:n.size,disabled:n._disabled,"start-placeholder":"开始时间","end-placeholder":"结束时间",type:"datetimerange","range-separator":"~",format:t.format||"YYYY-MM-DD HH:mm:ss","value-format":"x"})},switch:{component:De.ElSwitch,props:(t,n)=>({size:n.size,disabled:n._disabled,"active-value":1,"inactive-value":0,"active-text":"是","inactive-text":"否","inline-prompt":!0})},slider:{component:De.ElSlider,props:(t,n)=>({size:"small",marks:t.marks,disabled:n._disabled,"show-input":t.showInput,min:t.min||0,max:t.max||100})},textarea:{component:De.ElInput,props:(t,n)=>({type:"textarea",size:n.size,disabled:n._disabled,autosize:{minRows:t.rows??1},maxlength:t.maxlength,"show-word-limit":!!t.maxlength,autocomplete:"off",placeholder:t.placeholder})},number:{component:De.ElInputNumber,props:(t,n)=>({disabled:n._disabled,style:"width: 120px",size:n.size,min:t.min||0,max:t.max,controls:t.controls??!0,placeholder:t.placeholder??"输入数字","controls-position":t.position??"right"})},password:{component:De.ElInput,props:(t,n)=>({type:"password",autocomplete:"off",disabled:n._disabled,"show-password":!0,placeholder:t.placeholder||"输入密码"})},"input-button":{component:Eo,props:(t,n)=>({btn:t.btn,readonly:t.readonly,disabled:n._disabled,placeholder:t.placeholder,icon:t.icon})}},J3=(t,n)=>{const{init:r}=n;switch(t){case"slot":return{component:Jt.slot,props:{node:{slot:r.slot,index:n.index,value:n.value,row:n.row,oldData:n.oldData}}};case"media":return{component:Jt.media,props:{type:r.type==="img"?"image":r.type,limit:r.limit,cate:r.cate}};case"component":return{component:typeof r.component=="string"?n.components?.[r.component]:r.component,props:{init:r,formData:n.row,data:n.oldData,onChange:n.joinChange}};case"search-box":return{component:Jt["search-box"],props:{init:r.init,data:n.oldData,onChange:n.joinChange}};case"input-auto":return{component:Jt["input-auto"],props:{list:r.list||[]}};case"input-select":return{component:Jt["input-select"],props:{options:r.options,group:r.group}};case"file":return{component:Jt.file,props:{isSystem:r.isSystem,url:r.url,filename:r.filename,accept:r.accept,disabled:n._disabled}};case"md5":return{component:Jt.md5,props:{length:r.length,type:r.md5type,disabled:n._disabled}};case"group-tabs":case"group-table":case"group":return{component:Jt[t],props:{init:n.prop}};default:return null}},G3=s.defineComponent({name:"form-item",emits:["change","update:modelValue"],props:{index:Number,cols:Array,clearable:{type:Boolean,default:!0},size:{type:String,default:"default"},modelValue:[String,Object,Number,Array,Boolean,Function],join:Object,disabled:Boolean,row:{type:Object,default:()=>({})},oldData:{type:Object,default:()=>({})},prop:{type:[Object,Function],default:()=>({})}},setup(t,{emit:n}){const r=s.ref(null),o=s.ref(null),i=s.computed(()=>{let g=t.prop;const y=$config?.inputs?.shortcuts?.[g.type];return y?{...y,...g,type:y.type}:g}),a=s.computed(()=>i.value.size??t.size??"default"),l=s.computed(()=>t.disabled!==void 0?t.disabled:typeof i.value.disabled=="function"?i.value.disabled(t.modelValue,t.row):!!i.value.disabled),c=s.computed(()=>i.value.url?i.value.url?.map?.(g=>({label:g.title,value:g.id})):ns(i.value.cols)),u=s.computed(()=>i.value.cols?ns(i.value.cols):[{label:"是",value:!0},{label:"否",value:!1}]),d=s.computed(()=>ns(i.value.cols)),f=()=>{const g=i.value;return typeof g.slot=="function"?"slot":["image","img","video","audio"].includes(g.type)?"media":g.component?"component":g.type||"input"},p=()=>{const g=i.value,{modelValue:y}=t;switch(g.type){case"switch":g.props?.activeValue===!0?r.value=!!y||!1:r.value=Number(y)||0;break;case"radio":r.value=y;break;case"checkbox":y&&typeof y=="string"&&y.includes(",")?r.value=y.split(","):y?r.value=y:r.value=[];break;default:(y||y===0)&&(r.value=y);break}},h=()=>{const g=f(),y={init:i.value,size:a.value,_disabled:l.value,value:r.value,row:t.row,oldData:t.oldData,prop:t.prop,index:t.index,selectCols:c.value,radioCols:u.value,checkboxCols:d.value,components:$config?.inputs?.components,joinChange:m},v=J3(g,y);if(v){o.value={...v,component:s.markRaw(v.component)};return}const D=Au[g]||Au.input;D&&(o.value={component:s.markRaw(D.component),props:D.props?D.props(i.value,y):{},slots:D.slots?D.slots(i.value,y):null,children:D.children?D.children(i.value,y):null},o.value?.slots&&console.log(o.value?.slots.append))},m=(g,y)=>{const v=y??i.value.field;n("change",{__join:!0,field:v,data:g})};return s.onMounted(()=>{p(),h(),s.watch(r,g=>{let y=g;typeof i.value.format=="function"&&(y=i.value.format(g)),n("update:modelValue",y),n("change",y)},{deep:!0})}),s.watch(()=>t.prop,()=>{p(),h()},{deep:!0}),{internalValue:r,currentComponent:o}}}),Y3={class:"dmx-input-item"};function Z3(t,n,r,o,i,a){return s.openBlock(),s.createElementBlock("div",Y3,[t.currentComponent?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.currentComponent.component),s.mergeProps({key:0,modelValue:t.internalValue,"onUpdate:modelValue":n[0]||(n[0]=l=>t.internalValue=l)},{...t.currentComponent.props,...t.prop.props||{}}),s.createSlots({default:s.withCtx(()=>[t.currentComponent.children?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(t.currentComponent.children,(l,c)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(l.component),s.mergeProps({key:c},{ref_for:!0},l.props),{default:s.withCtx(()=>[l.children?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(l.children),1)],64)):s.createCommentVNode("",!0)]),_:2},1040))),128)):s.createCommentVNode("",!0)]),_:2},[t.currentComponent.slots?.prepend?{name:"prepend",fn:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(t.currentComponent.slots.prepend),1)]),key:"0"}:void 0,t.currentComponent.slots?.append?{name:"append",fn:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(t.currentComponent.slots.append),1)]),key:"1"}:void 0]),1040,["modelValue"])):s.createCommentVNode("",!0)])}const os=oe(G3,[["render",Z3]]),is=Object.freeze(Object.defineProperty({__proto__:null,default:os},Symbol.toStringTag,{value:"Module"})),Nu=t=>{const n={};for(const r in t){const o=t[r];r.indexOf(".")>-1?dn(n,r,o):n[r]=o}return n},X3={name:"admin-form",components:{inputItem:os,imgInfo:Os},emits:["submit","change","end"],props:{init:{type:Object,default:()=>({})},disabled:Boolean,data:{type:Object,default:()=>({})},asyncData:Function|String|Object,showButton:{type:Boolean,default:!0},beforeSubmit:{type:Function,default:()=>!0},afterSubmit:{type:Function,default:()=>!0}},data(){return{_disabled:!1,width:"720px",gloKey:0,rules:{},loading:!0,tabsIndex:0,cols:[],colsHide:{},confirmButton:{},editData:{},change:{},hidden:{},linkages:{},rawData:{}}},created(){this.initializeForm()},methods:{initializeForm(){if(!this.init?.cols)return;this.setInitialValues(),this.processColumns();const t=this.asyncData||this.init.asyncData;t&&t.constructor===Function?t(this.setData):t&&t.constructor===Object?this.urlData(t):this.setData(this.init.data??this.data)},setInitialValues(){this.init?.tabs&&(this.tabsIndex=Object.keys(this.init.tabs)[0]),this.init.hidden&&typeof this.init.hidden=="object"&&(this.hidden=JSON.parse(JSON.stringify(this.init.hidden))),(this.init.disabled||this.disabled)&&(this._disabled=!0),this.init.width&&(this.width=this.init.width),this.init.confirmButton===!1?this.confirmButton=!1:this.init.confirmButton?this.confirmButton=this.init.confirmButton:this.confirmButton={text:this.init.buttonText??$config?.form?.btnText??"提交",disabled:!1}},processColumns(){this.init.cols.forEach(async(t,n)=>{if(typeof t=="function"&&(this.init.cols[n]=t=t(this.data)),typeof t.change=="function"&&Array.isArray(t.changeField)&&(this.linkages[t.field]=t),t.slot&&typeof t.slot!="function"){let r=typeof t.slot=="string"?t.slot:"cols."+t.field;this.$slots[r]&&(t.slot=this.$slots[r])}t.type=="selects"&&t.remove=="$row.id"&&(t.remove2={remove:this.data.id}),this.init.size&&!t.size&&(t.size=this.init.size),t.label!==void 0&&(t.title=t.label),t.component&&(t.component=s.markRaw(t.component))}),this.cols=this.init.cols},async btnAction(t){let n="";if(t.confirm===!0?n="确定要执行"+t.title+"操作?":t.confirm&&(n=t.confirm),!(n&&await $confirm(n)!="confirm")){if(!t.action)return $msg.error("action 未定义");t.action({...this.hidden,...this.editData},t)}},isIntersection(t,n){return typeof t!="object"||typeof n!="object"?0:t.filter(r=>n.some(o=>o===r))?.length},linkage(t,n=null){let r={};typeof t=="object"?r=t:r={[t]:n};for(const o in this.linkages)if(Object.hasOwnProperty.call(this.linkages,o)){const i=this.linkages[o];(o!=t&&(!i.changeField||i.changeField?.indexOf(t)>-1)||this.isIntersection(i.changeField,Object.keys(r)))&&i.change({data:r,form:this,input:this.$refs.inputItem?.filter(a=>a.prop.field===o)[0]})}},onChange(t,n){if(typeof t=="object"&&t?.__join){n=t.field,t=t.data;const r=this.cols.findIndex(o=>o.field===n);this.$refs.inputItem&&this.$refs.inputItem[r]&&(this.$refs.inputItem[r].value=t)}this.editData[n]=t,t!=this.rawData[n]?this.change[n]=t:delete this.change[n],Object.keys(this.linkages)?.length&&this.linkage(n,t),this.$emit("change",{[n]:t},this)},tabsChange(t){this.tabsIndex=t.paneName},setValue(t,n=!0){this.editData={...this.editData,...t},n&&this.gloKey++},hideField(t,n=!0){if(typeof t=="object")for(var r=0;r<t.length;r++)this.colsHide[t[r]]=n;else this.colsHide[t]=n},editCols(t,n){this.cols.forEach((r,o)=>{r.field==t&&(this.cols[o]={...r,...n})})},newData(){this.$req.removeCache(this.asyncData?.url),this.urlData(this.asyncData,!0)},urlData(t,n=!1){const r=this;let o={};t?.where?.constructor===Function?o=t.where(this.data):t?.where&&(o=t.where),$req.post(t.url,o,!1,t.cache||!1).then(function(i){i.code==0?(i.cache?r.$root.reload=r.newData:r.$root.reload=!1,n&&r.$msg.success("刷新成功"),r.setData(i.data)):r.$msg.error(i.msg)}).catch(i=>{console.error("Error fetching form data:",i),r.$msg.error("获取表单数据失败")})},setData(t,n=!1){this.rawData=t;let r={},o={};this.init.fields&&this.init.fields.forEach(i=>{r[i]=t[i],this.change[i]=t[i]}),this.cols.forEach(i=>{(i.hidden===!0||i.hidden==1||i.hidden?.(t[i.field],t))&&(this.colsHide[i.field]=!0),i.required?(o[i.field]=[{required:!0,message:`${i.title}不能为空`}],i.rules&&(i.rules.constructor===Array?o[i.field]=[...o[i.field],...i.rules]:i.rules.constructor===Object&&(o[i.field]=[...o[i.field],i.rules]))):i.rules&&(o[i.field]=i.rules);const a=Yt(t,i.field);typeof a<"u"&&a!==null&&i.type!="text"&&i.type!="hidden"?typeof i.format=="function"?r[i.field]=i.format(a):r[i.field]=JSON.parse(JSON.stringify(a)):i.type=="hidden"?this.hidden[i.field]=a??i.value:i.type!="text"&&(r[i.field]=(i.format?i.format(i.value):i.value)??"",i.value&&(this.change[i.field]=i.value)),r[i.field]||(["number","switch","slider"].indexOf(i.type)>-1?r[i.field]=0:["group","group-table","checkbox","image-text","times","datetimes","dates"].indexOf(i.type)>-1&&(i.type.indexOf("group")===-1||i.limit>1)&&(r[i.field]=[]))}),this.editData=r,this.rules=o,this.loading=!1,n&&this.gloKey++,this.$nextTick(()=>{this.linkage(t),this.$emit("end",this.getData(),this)})},getData(){return Nu({...this.hidden,...this.editData})},resetForm(){this.$refs.form&&this.$refs.form.resetFields()},doSubmit(t=!1){if(!this.init.url)return $msg.warning("url 未定义");t||(t=this.change);const n=Nu({...this.hidden,...t});if(typeof this.init.url=="function")return this.init.url(n);$req.post(this.init.url,n,this.init.loading||"提交中").then(r=>{this.$emit("submit",{data:n,res:r}),r.code==0?(this.asyncData?.cache&&$req.removeCache(this.asyncData.url),$msg.success(r.msg)):$msg.error(r.msg)}).catch(r=>{console.error("Error submitting form:",r),$msg.error("提交失败")})},fnSubmit(){if(Object.keys(this.change).length===0&&this.init.noChangeTip!==!1)return this.$msg.info("表单数据没有变化");this.$refs.form?.validate((t,n)=>{if(t){const r=this.beforeSubmit(this.init.noChangeTip===!1?this.editData:this.change,this.doSubmit);typeof r=="object"?this.doSubmit(r):r!==!1&&this.doSubmit(this.init.noChangeTip===!1?this.editData:!1)}else if(n){const r=Object.keys(n)[0];r&&n[r][0]&&$msg.error(n[r][0].message)}})}}},Q3={key:0},e4=["innerHTML"];function t4(t,n,r,o,i,a){const l=s.resolveComponent("el-tab-pane"),c=s.resolveComponent("el-tabs"),u=s.resolveComponent("img-info"),d=s.resolveComponent("input-item"),f=s.resolveComponent("el-form-item"),p=s.resolveComponent("el-button"),h=s.resolveComponent("el-form");return s.openBlock(),s.createElementBlock("div",{class:"admin-form",style:s.normalizeStyle({"margin-bottom":r.init.buttonFixed?"42px":0,...r.init.style||{}})},[r.init.tabs?(s.openBlock(),s.createBlock(s.Teleport,{key:0,defer:"",disabled:r.init.title!=="tabs",to:"#table-form-header"},[s.createVNode(c,{class:"admin-form-tabs",onTabClick:a.tabsChange,modelValue:i.tabsIndex,"onUpdate:modelValue":n[0]||(n[0]=m=>i.tabsIndex=m)},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.init.tabs,(m,g)=>(s.openBlock(),s.createBlock(l,{name:g+"",label:m},null,8,["name","label"]))),256))]),_:1},8,["onTabClick","modelValue"])],8,["disabled"])):s.createCommentVNode("",!0),s.createVNode(h,{class:s.normalizeClass(["flex flex-wrap",{"admin-form__disabled":i._disabled}]),disabled:i._disabled,style:s.normalizeStyle("width:"+i.width),"label-position":r.init.labelPosition??"right",ref:"form","label-width":r.init.labelWidth||120,model:i.editData,rules:i.rules},{default:s.withCtx(()=>[i.loading?s.createCommentVNode("",!0):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(i.cols,(m,g)=>(s.openBlock(),s.createElementBlock("div",{key:m.field,style:s.normalizeStyle({width:m.colWidth??i.width??"100%"})},[m.type=="hidden"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[],64)):s.withDirectives((s.openBlock(),s.createBlock(f,{required:m.required,label:m.title===!1?"":m.title+":","label-width":m.labelWidth??(m.title===!1?"0px":void 0),prop:m.field,style:s.normalizeStyle({width:m.colWidth??r.init.colWidth??"100%"}),key:i.gloKey},{default:s.withCtx(()=>[s.createElementVNode("div",{class:s.normalizeClass(["x-flex w-full",r.init.infoAlign=="right"?"items-center":"flex-col"])},[s.createElementVNode("div",{class:s.normalizeClass(["input",m.class])},[m.type=="text"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[m.textType=="user"?(s.openBlock(),s.createElementBlock("div",Q3,[s.createVNode(u,{init:{error:"用户不存在",imgName:"user_header",titleName:"user_name"},data:i.rawData[m.field]},null,8,["data"])])):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(m.class?"":"text-color-primary")},s.toDisplayString(i.rawData[m.field]??m.value),3))],64)):(s.openBlock(),s.createBlock(d,{key:1,ref_for:!0,ref:"inputItem",disabled:r.disabled,clearable:r.init.clearable,rawData:i.rawData,row:i.editData,index:g,cols:i.cols,style:s.normalizeStyle(m.width?"width:"+m.width:""),modelValue:i.editData[m.field],prop:{...m,...m.remove2},"onUpdate:modelValue":y=>a.onChange(y,m.field)},null,8,["disabled","clearable","rawData","row","index","cols","style","modelValue","prop","onUpdate:modelValue"]))],2),m.info?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["text-sm flex op-70 gap-1",r.init.infoAlign=="right"?"pl-xs items-start":"pt-xs items-center"])},[n[1]||(n[1]=s.createElementVNode("i",{class:"i-ri-error-warning-line"},null,-1)),s.createElementVNode("div",{innerHTML:m.info},null,8,e4)],2)):s.createCommentVNode("",!0)],2)]),_:2},1032,["required","label","label-width","prop","style"])),[[s.vShow,!i.colsHide[m.field]&&(!r.init.tabs||!m.tab&&i.tabsIndex==0||m.tab==i.tabsIndex||typeof m.tab=="object"&&m.tab?.map(y=>y+"")?.indexOf?.(i.tabsIndex)>-1)]])],4))),128)),r.showButton?(s.openBlock(),s.createBlock(f,{key:1,class:s.normalizeClass(["info-hide",{"form-btn":r.init.buttonFixed}])},{default:s.withCtx(()=>[i.loading?(s.openBlock(),s.createBlock(p,{key:0,loading:i.loading,type:"primary"},{default:s.withCtx(()=>[...n[2]||(n[2]=[s.createTextVNode("loading",-1)])]),_:1},8,["loading"])):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[i.confirmButton?(s.openBlock(),s.createBlock(p,{key:0,disabled:i.confirmButton.disabled,type:"primary",onClick:a.fnSubmit},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.confirmButton.text),1)]),_:1},8,["disabled","onClick"])):s.createCommentVNode("",!0),r.init.resetButton?(s.openBlock(),s.createBlock(p,{key:1,onClick:a.resetForm},{default:s.withCtx(()=>[...n[3]||(n[3]=[s.createTextVNode("重置",-1)])]),_:1},8,["onClick"])):s.createCommentVNode("",!0),r.init.btns?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:2},s.renderList(r.init.btns,m=>(s.openBlock(),s.createBlock(p,{loading:i.loading,type:m.type?m.type:"primary",onClick:g=>a.btnAction(m)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(m.title),1)]),_:2},1032,["loading","type","onClick"]))),256)):s.createCommentVNode("",!0)],64))]),_:1},8,["class"])):s.createCommentVNode("",!0)]),_:1},8,["disabled","class","style","label-position","label-width","model","rules"])],4)}const n4=oe(X3,[["render",t4]]),r4={name:"data-api",props:{init:{type:Object}},data(){return{data:!1,empty:!1,loading:!1}},created(){this.getData()},methods:{onChange(t=null){this.getData(t)},async getData(t=null){this.loading=!0;const n=this.init;let r={};t?r=t:r=n.where;const o=await this.$req.post(n.url,r,n.cache||0);console.log(o),this.loading=!1,o.code==0?(this.data=o.data,n.back&&n.back(o)):n.empty!==!1&&(this.empty=n.empty||o?.msg||"加载失败")}}},o4={key:1},i4={key:2},s4={class:"op-70"};function a4(t,n,r,o,i,a){const l=s.resolveComponent("el-skeleton");return i.data?s.renderSlot(t.$slots,"default",{key:0,data:i.data}):i.loading?(s.openBlock(),s.createElementBlock("div",o4,[s.renderSlot(t.$slots,"loading",{},()=>[s.createVNode(l,{rows:2,animated:""})])])):i.empty?(s.openBlock(),s.createElementBlock("div",i4,[s.renderSlot(t.$slots,"error",{},()=>[s.createElementVNode("div",{class:"text-center flex col-center justify-center w-full",onClick:n[0]||(n[0]=c=>a.getData())},[s.createElementVNode("span",s4,s.toDisplayString(i.empty),1),n[1]||(n[1]=s.createTextVNode()),n[2]||(n[2]=s.createElementVNode("span",{class:"pl color-primary click"},"重试",-1))])])])):s.createCommentVNode("",!0)}const l4=oe(r4,[["render",a4]]),c4={props:{title:{type:String,default:"提示"},type:{type:String,default:"primary"}},data(){return{value:"",show:!1}},methods:{}},u4={class:"font-weight mb line-height"},d4={class:"text-color-primary"};function f4(t,n,r,o,i,a){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["a-tip","a-tip--"+r.type])},[s.createElementVNode("div",u4,[n[0]||(n[0]=s.createElementVNode("i",{class:"i-ri-information-line pr-xs"},null,-1)),s.createTextVNode(s.toDisplayString(r.title),1)]),s.createElementVNode("div",d4,[s.renderSlot(t.$slots,"default",{},void 0,!0)])],2)}const p4=oe(c4,[["render",f4],["__scopeId","data-v-b6ef9e08"]]),h4={name:"text-edit",props:{clickType:{type:String,default:"click"},defaultValue:String,hideIcon:Boolean,height:String,text:""},emits:["save","status"],watch:{show(t){this.$emit("status",t)}},data(){return{value:"",show:!1}},methods:{click(t){t.preventDefault(),this.show||(this.value=this.text,this.show=!0)},editSave(){if(this.text==this.value){this.show=!1;return}$confirm("确认要提交本次修改吗?","提示").then(t=>{this.show=!1,this.$emit("save",{value:this.value,oldValue:this.text})}).catch(t=>{this.show=!1})}}},m4={key:0},g4={key:1,class:"text flex"},y4={class:"line-2"},b4={key:0,class:"i-ri-quill-pen-line ml-xs"};function C4(t,n,r,o,i,a){const l=s.resolveDirective("focus");return s.openBlock(),s.createElementBlock("div",s.mergeProps({class:"text-edit"},{[s.toHandlerKey(r.clickType)]:n[2]||(n[2]=s.withModifiers((...c)=>a.click&&a.click(...c),["stop"]))}),[i.show?(s.openBlock(),s.createElementBlock("div",m4,[s.withDirectives(s.createElementVNode("textarea",{style:s.normalizeStyle({height:r.height}),onBlur:n[0]||(n[0]=c=>a.editSave()),"onUpdate:modelValue":n[1]||(n[1]=c=>i.value=c)},null,36),[[l],[s.vModelText,i.value]])])):(s.openBlock(),s.createElementBlock("div",g4,[s.createElementVNode("div",y4,s.toDisplayString(r.text??r.defaultValue),1),!r.hideIcon||!r.text?(s.openBlock(),s.createElementBlock("i",b4)):s.createCommentVNode("",!0)]))],16)}const v4=oe(h4,[["render",C4],["__scopeId","data-v-26e8acc4"]]),D4={props:{url:String|Array|Object,modelValue:String|Number|Array,type:{type:String,default:"primary"},size:{type:String,default:"small"},showNum:{type:Number,default:2},keyName:{type:String,default:"id"},titleName:{type:String,default:"title"},format:Function,color:String},data(){return{text:[]}},created(){const{keyName:t,titleName:n,url:r,modelValue:o,format:i}=this;if(!o&&o!=0||!r)return;let a=[];if(typeof o=="string"||typeof o=="number"?a=i?(i(o)+"").split(","):(o+"").split(","):a=o,a.length===0)return;function l(c){let u=[],d={};if(!c)return[];if(c.constructor==Array)for(const f of c)d[f[t]]=f[n];else d=c;for(const f of a)d[f]&&u.push(d[f]);return u}if(typeof r=="object")return this.text=l(r);$req.post(r).then(c=>{this.text=l(c.data)})}},w4={key:0,class:"cate-text overflow-hidden"},B4={class:"cate-show"};function x4(t,n,r,o,i,a){const l=s.resolveComponent("el-tag"),c=s.resolveComponent("el-popover");return i.text.length>0?(s.openBlock(),s.createElementBlock("div",w4,[i.text.length>r.showNum?(s.openBlock(),s.createBlock(c,{key:0,placement:"left",width:220,trigger:"hover"},{reference:s.withCtx(()=>[s.createElementVNode("div",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.showNum,u=>(s.openBlock(),s.createBlock(l,{size:r.size,color:r.color,type:r.type},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.text[u-1]),1)]),_:2},1032,["size","color","type"]))),256)),s.createVNode(l,{size:r.size,color:r.color,type:r.type},{default:s.withCtx(()=>[...n[0]||(n[0]=[s.createTextVNode("...",-1)])]),_:1},8,["size","color","type"])])]),default:s.withCtx(()=>[s.createElementVNode("div",B4,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.text,u=>(s.openBlock(),s.createBlock(l,{size:r.size,type:r.type},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(u),1)]),_:2},1032,["size","type"]))),256))])]),_:1})):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(i.text,u=>(s.openBlock(),s.createBlock(l,{size:r.size,color:r.color,type:r.type},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(u),1)]),_:2},1032,["size","color","type"]))),256))])):s.createCommentVNode("",!0)}const k4=oe(D4,[["render",x4],["__scopeId","data-v-3c69ee7f"]]),E4={props:{date:{type:[Object,String,Number],default(){return"-"}},locale:{type:String,default:"zh"},threshold:{type:Array,default(){return[0,0]}},format:{type:String,default:void 0}},data(){return{text:""}},created(){this.text=$a.time.friendlyDate(this.date,{locale:this.locale,threshold:this.threshold,format:this.format})}};function _4(t,n,r,o,i,a){return s.openBlock(),s.createElementBlock("span",null,s.toDisplayString(i.text),1)}const A4=oe(E4,[["render",_4]]),N4={name:"a-image",props:{fit:{type:String,default:"contain"},src:String,width:{type:[String,Number]},height:{type:[String,Number]},background:String,borderRadius:String,css:String,process:"",lazy:{type:Boolean,default:!0},index:{type:Number,default:0},preview:{type:[Array,Boolean],default:!1}},data(){return{previewSrcList:[]}},methods:{addUnit(t){return typeof t=="number"?t+"px":t}},mounted(){typeof this.preview=="string"?this.previewSrcList=[this.url]:typeof this.preview=="object"&&(this.previewSrcList=this.preview.map(t=>this.$fileUrl(t,this.process)))},computed:{url(){return this.$fileUrl(this.src,this.process)}}};function S4(t,n,r,o,i,a){const l=s.resolveComponent("el-image");return s.openBlock(),s.createBlock(l,s.mergeProps({class:"a-image",fit:r.fit,"initial-index":r.index,"preview-src-list":i.previewSrcList,style:[{width:a.addUnit(r.width),height:a.addUnit(r.height),borderRadius:r.borderRadius,background:r.background},r.css],src:a.url},t.$attrs),{error:s.withCtx(()=>[...n[0]||(n[0]=[s.createElementVNode("div",{class:"image-slot min-w-10 min-h-10 bg-main-100"},[s.createElementVNode("i",{class:"i-ri-landscape-line"})],-1)])]),_:1},16,["fit","initial-index","preview-src-list","style","src"])}const F4=oe(N4,[["render",S4],["__scopeId","data-v-7b602c3b"]]),V4={name:"a-region-text",props:{code:String|Number},data(){return{text:""}},created(){this.text=$a.util.codeArea(this.code)}};function O4(t,n,r,o,i,a){return s.openBlock(),s.createElementBlock("span",null,s.toDisplayString(i.text),1)}const T4=oe(V4,[["render",O4]]),j4={name:"a-text-status",props:{status:{type:String,default:"info"}},data(){return{color:!1}},created(){this.status&&this.status.indexOf("#")===0&&(this.color=this.status)}},L4={class:"text-status"},P4={class:"text"};function M4(t,n,r,o,i,a){return s.openBlock(),s.createElementBlock("span",L4,[s.createElementVNode("span",{class:s.normalizeClass(["dot",i.color?"":"dot-"+r.status]),style:s.normalizeStyle("background-color:"+i.color)},null,6),s.createElementVNode("span",P4,[s.renderSlot(t.$slots,"default",{},void 0,!0)])])}const z4=oe(j4,[["render",M4],["__scopeId","data-v-99c2ca99"]]);function $4(t){const n=Object.create(null);return function(o){return n[o]||(n[o]=t(o))}}const I4=/-(\w)/g,Su=$4(t=>t.replace(I4,(n,r)=>r?r.toUpperCase():""));function ss(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function Fu(t,n,r){const o=r===0?t.children[0]:t.children[r-1].nextSibling;t.insertBefore(n,o)}function R4(t,n){return Object.values(t).indexOf(n)}function H4(t,n,r,o){if(!t)return[];const i=Object.values(t),a=n.length-o;return[...n].map((c,u)=>u>=a?i.length:i.indexOf(c))}function Vu(t,n){this.$nextTick(()=>this.$emit(t.toLowerCase(),n))}function U4(t){return n=>{this.realList!==null&&this["onDrag"+t](n),Vu.call(this,t,n)}}function W4(t){return["transition-group","TransitionGroup"].includes(t)}function q4(t){if(!t||t.length!==1)return!1;const[{type:n}]=t;return n?W4(n.name):!1}function K4(t,n){return n?{...n.props,...n.attrs}:t}const as=["Start","Add","Remove","Update","End"],ls=["Choose","Unchoose","Sort","Filter","Clone"],J4=["Move",...as,...ls].map(t=>"on"+t);let cs=null;const G4={options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:t=>t},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},Y4={name:"a-draggable",inheritAttrs:!1,emits:["update:modelValue","move","change",...as.map(t=>t.toLowerCase()),...ls.map(t=>t.toLowerCase())],props:G4,data(){return{transitionMode:!1,noneFunctionalComponentMode:!1,headerOffset:0,footerOffset:0,_sortable:{},visibleIndexes:[],context:{}}},render(){const t=this.$slots.default?this.$slots.default():null,n=K4(this.$attrs,this.componentData);return t?(this.transitionMode=q4(t),s.h(this.getTag(),n,t)):s.h(this.getTag(),n,[])},created(){this.list!==null&&this.modelValue!==null&&console.error("list props are mutually exclusive! Please set one.")},mounted(){const t={};as.forEach(i=>{t["on"+i]=U4.call(this,i)}),ls.forEach(i=>{t["on"+i]=Vu.bind(this,i)});const n=Object.keys(this.$attrs).reduce((i,a)=>(i[Su(a)]=this.$attrs[a],i),{}),r=Object.assign({},n,t,{onMove:(i,a)=>this.onDragMove(i,a)});!("draggable"in r)&&(r.draggable=">*");const o=this.$el.nodeType===1?this.$el:this.$el.parentElement;this._sortable=new Sortable(o,r),o.__draggable_component__=this,this.computeIndexes()},beforeUnmount(){try{this._sortable!==void 0&&this._sortable.destroy()}catch{}},computed:{realList(){return this.list?this.list:this.modelValue}},watch:{$attrs:{handler(t){this.updateOptions(t)},deep:!0},realList(){this.computeIndexes()}},methods:{getTag(){return this.component?s.resolveComponent(this.component):this.tag},updateOptions(t){for(var n in t){const r=Su(n);J4.indexOf(r)===-1&&this._sortable.option(r,t[n])}},getChildrenNodes(){return this.$el.children},computeIndexes(){this.$nextTick(()=>{this.visibleIndexes=H4(this.getChildrenNodes(),this.$el.children,this.transitionMode,this.footerOffset)})},getUnderlyingVm(t){const n=R4(this.getChildrenNodes()||[],t);if(n===-1)return null;const r=this.realList[n];return{index:n,element:r}},emitChanges(t){this.$nextTick(()=>{this.$emit("change",t)})},alterList(t){if(this.list){t(this.list);return}const n=[...this.modelValue];t(n),this.$emit("update:modelValue",n)},spliceList(){const t=n=>n.splice(...arguments);this.alterList(t)},updatePosition(t,n){const r=o=>o.splice(n,0,o.splice(t,1)[0]);this.alterList(r)},getVmIndex(t){const n=this.visibleIndexes,r=n.length;return t>r-1?r:n[t]},getComponent(){return this.$slots.default?this.$slots.default()[0].componentInstance:null},resetTransitionData(t){if(!this.noTransitionOnDrag||!this.transitionMode)return;var n=this.getChildrenNodes();n[t].data=null;const r=this.getComponent();r.children=[],r.kept=void 0},onDragStart(t){this.context=this.getUnderlyingVm(t.item),this.context&&(t.item._underlying_vm_=this.clone(this.context.element),cs=t.item)},onDragAdd(t){const n=t.item._underlying_vm_;if(n===void 0)return;ss(t.item);const r=this.getVmIndex(t.newIndex);this.spliceList(r,0,n),this.computeIndexes();const o={element:n,newIndex:r};this.emitChanges({added:o})},onDragRemove(t){if(Fu(this.$el,t.item,t.oldIndex),t.pullMode==="clone"){ss(t.clone);return}if(!this.context)return;const n=this.context.index;this.spliceList(n,1);const r={element:this.context.element,oldIndex:n};this.resetTransitionData(n),this.emitChanges({removed:r})},onDragUpdate(t){ss(t.item),Fu(t.from,t.item,t.oldIndex);const n=this.context.index,r=this.getVmIndex(t.newIndex);this.updatePosition(n,r);const o={element:this.context.element,oldIndex:n,newIndex:r};this.emitChanges({moved:o})},updateProperty(t,n){t.hasOwnProperty(n)&&(t[n]+=this.headerOffset)},onDragMove(t,n){const r=this.move;if(!r||!this.realList)return!0;const o=this.getRelatedContextFromMoveEvent(t),i=this.context,a=this.computeFutureIndex(o,t);Object.assign(i,{futureIndex:a});const l=Object.assign({},t,{relatedContext:o,draggedContext:i});return r(l,n)},onDragEnd(){this.computeIndexes(),cs=null},getTrargetedComponent(t){return t.__draggable_component__},getRelatedContextFromMoveEvent({to:t,related:n}){const r=this.getTrargetedComponent(t);if(!r)return{component:r};const o=r.realList,i={list:o,component:r};if(t!==n&&o&&r.getUnderlyingVm){const a=r.getUnderlyingVm(n);if(a)return Object.assign(a,i)}return i},computeFutureIndex(t,n){const r=[...n.to.children].filter(l=>l.style.display!=="none");if(r.length===0)return 0;const o=r.indexOf(n.related),i=t.component.getVmIndex(o);return r.indexOf(cs)!==-1||!n.willInsertAfter?i:i+1}}},Z4=defineAsyncComponent(()=>Promise.resolve().then(()=>m5)),X4=defineAsyncComponent(()=>Promise.resolve().then(()=>f3)),us={AdminTable:sp,AdminForm:n4,DataApi:l4,ASearch:Ts,AInputs:os,InputButton:Eo,ASearchBox:$s,ATip:p4,ATextEdit:v4,ACateText:k4,ACascader:xu,ATags:ku,ATime:A4,AImage:F4,AImageText:Bu,AColorPicker:Eu,ARegionPicker:_u,ARegionText:T4,ARegionMap:es,ATextStatus:z4,ADraggable:Y4,AChart:Z4,AEditor:X4};function Q4(t){for(const n in us)t.component(n,us[n])}const e6={install:Q4,components:us},t6={methods:{$getParent(t="",n=this,r=0){if(r>=20||!t||!n)return null;const o=n.$parent;return o?o.$options.name===t?o:(r++,this.$getParent(t,o,r)):null},$get(t=null){return $go.query(this.$route.query,t)}}},n6=function(...t){return t.reduce((n,r)=>xo(n,r),{})},r6={urlBox:{default:[{title:"推荐",list:[{title:"首页",url:"index/index"},{title:"我的",url:"user/index"}]}]},apis:{},form:{btnText:"提交"},table:{shortcuts:{user:{type:"img-info",init:{error:"用户不存在",imgName:"user_header",titleName:"user_name"}}}},inputs:{shortcuts:{user:{type:"search-box",init:{icon:"ri-user-line",name:"用户",join:"user",url:"__apis.user_search",imgName:"user_header",titleName:"user_name",placeholder:"请选择用户",placeholder2:"输入用户昵称或用户ID或手机号"}}}}};function o6(t){const n=yo.flattenObject(t);for(const r in n)if(typeof n[r]=="string"&&n[r].indexOf("__")===0){const o=n[r].replace("__","");dn(t,r,Yt(t,o))}}const i6=t=>{const n=n6(r6,t);return o6(n),n},s6=t=>{if(typeof document<"u")return window.getComputedStyle(document.getElementById("app")).getPropertyValue(t)},a6=(t="")=>{const n={};return n.primary=s6("--el-color-primary"),t?n[t]:n},co="_exptime",Nt="admin_",Qn={list:function(){const t=localStorage.length;let n=new Array;for(let r=0;r<t;r++){let o=localStorage.key(r);n[r]=o}return n},set:function(t,n,r=0){if(r){let o=Date.now();o=o/1e3+Number(r),localStorage.setItem(Nt+t+co,o+"")}localStorage.setItem(Nt+t,JSON.stringify(n))},remove:function(t){localStorage.removeItem(Nt+t),localStorage.removeItem(Nt+t+co)},clear:function(){localStorage.clear()},get:function(t,n=!1){let r=parseInt(localStorage.getItem(Nt+t+co));if(!localStorage.getItem(Nt+t))return!1;if(r&&r<Date.now()/1e3&&!n){localStorage.removeItem(Nt+t),localStorage.removeItem(Nt+t+co);return}else if(n&&r)return{data:JSON.parse(localStorage.getItem(Nt+t)),time:r};try{return JSON.parse(localStorage.getItem(Nt+t))}catch{return localStorage.getItem(Nt+t)}}},at=t=>De.ElMessage(t);at.info=t=>De.ElMessage(t),at.success=t=>De.ElMessage({message:t,type:"success"}),at.error=t=>De.ElMessage({message:t,type:"error"}),at.warning=t=>De.ElMessage({message:t,type:"warning"}),at.info=t=>De.ElMessage(t),at.warning=t=>De.ElMessage({message:t,type:"warning"}),at.confirm=(t,n="提示",r={})=>{let o={confirmButtonText:"确认",cancelButtonText:"取消",type:"warning",...r};return De.ElMessageBox.confirm(t,n,o)},at.prompt=(t,n="提示",r={})=>{let o={confirmButtonText:"确认",cancelButtonText:"取消",...r};return De.ElMessageBox.prompt(t,n,o)},at.loading=(t="加载中")=>(t===!0&&(t="加载中"),De.ElLoading.service({lock:!0,text:t,background:"rgba(0, 0, 0, 0.7)"}));function l6(t,n){if(!t)return{};let r={};return t?.jsonQuery?r=JSON.parse(t.jsonQuery):r=t,n?r[n]||null:r}class c6{data=null;router=null;query=l6;constructor(n){this.router=n}to(n,r=null){this.data=r;let o="";return n?.indexOf("http")===0?window.open(n):(r&&(o="?jsonQuery="+JSON.stringify(r)),n?.indexOf("/")!==0&&(n="/"+n),this.router.push(n+o))}}const ds="undefined",u6=Promise,d6=t=>u6.reject(t),fs=Object,Ou=void 0,f6=null,Tu=!0,ps=!1,p6=(t,n,r)=>JSON.stringify(t,n,r),h6=(t,n=0)=>setTimeout(t,n),ju=t=>clearTimeout(t),m6=(t,n)=>delete t[n],g6=t=>typeof t,y6=(t,n)=>t.includes(n);typeof window===ds&&(typeof process!==ds&&process.browser);const b6=t=>g6(t)==="string",C6=t=>fs.prototype.toString.call(t),v6=(t,n)=>t instanceof n,D6=t=>{const n=C6(t);return/^\[object (Blob|FormData|ReadableStream|URLSearchParams)\]$/i.test(n)||v6(t,ArrayBuffer)},w6=(t,...n)=>new t(...n),B6=t=>b6(t)||D6(t);function x6(){return(t,n)=>{const r=n.config,o=r.timeout||0,i=new AbortController,{data:a,headers:l}=t,c=/content-type/i.test(fs.keys(l).join()),u=a&&a.toString()==="[object FormData]";!c&&!u&&(l["Content-Type"]="application/json; charset=UTF-8");const d=["",Ou,f6,ps];fs.keys(l).forEach(m=>{y6(d,l[m])&&m6(l,m)});const f=fetch(t.url,{...r,method:t.type,signal:i.signal,body:B6(a)?a:p6(a)});let p,h=ps;return o>0&&(p=h6(()=>{h=Tu,i.abort()},o)),{response:()=>f.then(m=>(ju(p),m.clone()),m=>d6(h?w6(Error,"fetchError: network timeout"):m)),headers:()=>f.then(({headers:m})=>m,()=>({})),onDownload:async m=>{let g=ps;const y=await f.catch(()=>{g=Tu});if(!y)return;const{headers:v,body:D}=y.clone(),w=D?D.getReader():Ou,C=Number(v.get("Content-Length")||v.get("content-length")||0);if(C<=0)return;let B=0;if(w){const k=()=>w.read().then(({done:_,value:x=new Uint8Array})=>{if(_||g)g&&m(B,0);else return B+=x.byteLength,m(B,C),k()});k()}},onUpload(){console.error("fetch API does'nt support uploading progress. please consider to change `@alova/adapter-xhr` or `@alova/adapter-axios`")},abort:()=>{i.abort(),ju(p)}}}}let er="",uo,hs;function k6(t){t.responded||(t.responded={}),hs=t,er=t.baseURLPre||"",uo=sr.createAlova({requestAdapter:x6(),timeout:5e4,baseURL:t.baseURL,responded:{onSuccess:t.responded.onSuccess,onError:t.responded.onError,onComplete:async n=>{tr&&tr.close()}}})}let tr=!1;function Lu(t,n,r={}){const o=hs?.headers?.()||{},i=hs?.post?.auth();if(!i)return Promise.resolve(typeof i=="object"?i:{code:1001,msg:"请先登录"});const{loading:a=null,cache:l=0,headers:c={}}=r;if(Qn.get("REQ_"+t))return Promise.resolve({...Qn.get("REQ_"+t),cache:!0});a&&(tr=at.loading(a)),n&&(n=$a.object.removeEmptyValues(n,{removeEmptyStrings:!1,removeEmptyObjects:!1,removeEmptyArrays:!1}));const u={name:null,hitSource:null,cacheFor:null,headers:{...o,...c}};l&&typeof l=="number"&&(u.hitSource=RegExp(`^${t}/do`),u.cacheFor={mode:"restore",expire:60*1e3}),u.name=t;const d=uo.Post(t,n,u);return t.startsWith("http")&&(d.baseURL=""),d}const Pu=function(t,n=void 0){const r=uo.Get(t,n);return r.baseURL="",r};class E6{baseURL;constructor(n){er=n?.apiUrlPre||"",this.baseURL=n.baseURL,k6(n)}noLogin(n,r=void 0){return Lu(er+n,r)}post(n,r=void 0,o=void 0,i=void 0){let a={};return o&&typeof o=="object"?a=o:(typeof r=="number"?(i=r,r=void 0):typeof r=="string"?(o=r,r=void 0):typeof o=="number"&&(i=o),a={loading:o,cache:i}),n.startsWith("http")?n=n:n=er+n,Lu(n,r,a)}upload(n,r,o=null){if(n=er+n,!Qn.get("admin_jwt"))return Promise.resolve({code:1001,msg:"请先登录"});const a=sr.createAlova({requestAdapter:td.xhrRequestAdapter(),timeout:1e3*60,baseURL:this.baseURL,responded:{onSuccess:async l=>{const{status:c,statusText:u}=l;return c>=400?{code:c,msg:u}:await l.data},onError:(l,c)=>Promise.reject({code:500}),onComplete:async l=>{tr&&tr.close()}}}).Post(n,r,{headers:{jwt:Qn.get("admin_jwt")}});return a.onUpload(l=>{o&&o(l,r)}),a}query=Pu;get=Pu;instance=()=>uo;setCache=sr.setCache;create=sr.createAlova}const _6=function(t,n="复制成功"){if(!t){at.error("无复制内容");return}const r=document.createElement("textarea");r.readOnly=!0,r.style.position="absolute",r.style.left="-9999px",r.value=t,document.body.appendChild(r),r.select(),r.setSelectionRange(0,r.value.length),document.execCommand("Copy")&&at.success(n),document.body.removeChild(r)};function Gt(t,n=2){for(t+="";t.length<n;)t="0"+t;return t.slice(-n)}const A6={yyyy:t=>Gt(t.year,4),yy:t=>Gt(t.year),MM:t=>Gt(t.month),M:t=>t.month,dd:t=>Gt(t.day),d:t=>t.day,hh:t=>Gt(t.hour),h:t=>t.hour,mm:t=>Gt(t.minute),m:t=>t.minute,ss:t=>Gt(t.second),s:t=>t.second,SSS:t=>Gt(t.millisecond,3),S:t=>t.millisecond};function Mu(t){if(/^\d+$/.test(t)&&(t+"").length==10&&(t=t*1e3),t instanceof Date)return t;switch(typeof t){case"string":return t.indexOf("T")>-1?new Date(t):new Date(t.replace(/-/g,"/"));default:return new Date(t)}}function zu(t,n="yyyy-MM-dd hh:mm:ss"){if(!t&&t!==0||(t=Mu(t),!t.getTime()))return"-";const r={year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),millisecond:t.getMilliseconds()},o=/yyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S/;let i=!0,a=n;for(;i;)i=!1,a=a.replace(o,function(l){return i=!0,A6[l](r)});return a}function N6(t,{locale:n="zh",threshold:r=[6e4,36e5],format:o="yyyy-MM-dd hh:mm:ss"}){if(t==="-")return t;if(!t&&t!==0)return"";const i={zh:{year:"年",month:"月",day:"天",hour:"小时",minute:"分钟",second:"秒",ago:"前",later:"后",justNow:t.length==10?"今天":"刚刚",soon:"马上",template:"{num}{unit}{suffix}"},en:{year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",ago:"ago",later:"later",justNow:"just now",soon:"soon",template:"{num} {unit} {suffix}"}},a=i[n]||i.zh;let l=Mu(t),c=(l.getTime()||0)-Date.now(),u=Math.abs(c);if(u<r[0])return c<0?a.justNow:a.soon;if(u>=r[1])return zu(l,o);let d,f,p=a.later;c<0&&(p=a.ago,c=-c);const h=Math.floor(c/1e3),m=Math.floor(h/60),g=Math.floor(m/60),y=Math.floor(g/24),v=Math.floor(y/30),D=Math.floor(v/12);switch(!0){case D>0:d=D,f=a.year;break;case v>0:d=v,f=a.month;break;case y>0:d=y,f=a.day;break;case g>0:d=g,f=a.hour;break;case m>0:d=m,f=a.minute;break;default:d=h,f=a.second;break}return n==="en"&&(d===1?d="a":f+="s"),a.template.replace(/{\s*num\s*}/g,d+"").replace(/{\s*unit\s*}/g,f).replace(/{\s*suffix\s*}/g,p)}const S6=(t,n="/")=>{const r=String(t),o=Number(r.slice(0,2));let i=Number(r.slice(0,4));const a=Number(t);r.length>6&&(i=Number(r.slice(0,6)));let l=[];return dmxRegions.forEach(c=>{c.c===o&&(l[0]=c.n,c.s?.length>0&&i>=1e3&&c.s.forEach(u=>{u.c===i&&(l[1]=u.n,u.s?.length>0&&a>=1e5&&u.s.forEach(d=>{d.c===a&&(l[2]=d.n)}))}))}),n===!0?l:l.join(n)};function F6(t,n,r,o="array"){if(t){(!r||typeof r!="string")&&(r="data.csv");let i;o=="array"?i=V6(t,n):i=O6(t,n);let a=URL.createObjectURL(i),l=document.createElement("a");l.href=a,l.download=r,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a)}}function V6(t,n){let o=",",i=`\r
|
|
39
|
+
`,a=t.reduce((c,u)=>(c?c+o:"")+(u.title||u.column),"");if(Array.isArray(n)&&n.length>0){let c=t.map(u=>u.column);a=n.reduce((u,d)=>{let f=c.reduce((p,h)=>{if(d.hasOwnProperty(h)){let m=d[h];if(m!=null){let g=t.find(y=>y.column==h);if(g.formatter!=null&&typeof g.formatter=="function"&&(m=g.formatter(m)),m!=null)return m=m.toString().replace(new RegExp(i,"g")," "),m=new RegExp(o).test(m)?`"${m}"`:m,m=m+" ",p?p+o+m:p+m}return p?p+o:p+" "}else return p?p+o:p+" "},"");return u+i+f},a)}return new Blob(["\uFEFF"+a],{type:"text/csv;charset=utf-8;"})}function O6(t,n){return new Blob(["\uFEFF"+t+n],{type:"text/csv;charset=utf-8;"})}const T6={export:F6},ms=(t,n={})=>{const{removeEmptyStrings:r=!0,removeNull:o=!0,removeUndefined:i=!0,removeEmptyObjects:a=!0,removeEmptyArrays:l=!0}=n;if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(d=>ms(d,n)).filter(d=>!(l&&Array.isArray(d)&&d.length===0));const c={};for(const[u,d]of Object.entries(t)){if(d===null&&o||d===void 0&&i||d===""&&r)continue;const f=ms(d,n);a&&typeof f=="object"&&!Array.isArray(f)&&Object.keys(f).length===0||l&&Array.isArray(f)&&f.length===0||(c[u]=f)}return c},j6={get:function(t,n,r){return Yt(t,n,r)},set:function(t,n,r){return dn(t,n,r)},deepMerge:function(...t){return t.reduce((n,r)=>xo(n,r),{})},mapping:function(t,n=null){if(!n)return t;function r(i){const a={};for(const l in i)if(Object.prototype.hasOwnProperty.call(i,l)){const c=i[l];n[l]?a[n[l]]=c:a[l]=c}return a}let o;return Array.isArray(t)?(o=[],t.forEach(i=>{o.path(r(i))})):typeof t=="object"?o=r(t):o=t,o},removeEmptyValues:ms},nr={};nr.column=function(t,n){return t.map(function(r){return r[n]})},nr.addColumn=function(t,n,r){let o=t.length;for(var i=0;i<o;i++)t[i][n]=r},nr.removeColumn=function(t,n){let r=t.length;for(var o=0;o<r;o++)delete t[o][n]},nr.remove=function(t,n){var r=t.indexOf(n);return r>-1?t.splice(r,1):null};function L6(t=30){return new Promise(n=>{setTimeout(()=>{n(null)},t)})}function P6(t,n=""){let r="";return t&&(t.indexOf("//")>-1||t.indexOf("/assets")>-1||t.indexOf("/static")>-1||t.indexOf("data:")>-1||t.indexOf("<svg")>-1?r=t:r=dmx.fileUrl+t),r}const $u={array:nr,object:j6,sleep:L6,codeArea:S6,fileUrl:P6,time:{formatDate:zu,friendlyDate:N6},csv:T6},gs={};function M6(t,n,r){if(typeof t=="string"?window[t]:t){r();return}let i=gs[n];if(!i){i=gs[n]=[];const a=document.createElement("script");a.src=n,document.body.appendChild(a),a.onload=function(){i.forEach(l=>l()),delete gs[n]}}i.push(r)}function z6(t,n){const r=t.config.globalProperties,{store:o=null,config:i,menu:a=null}=n,l={$menu:a,$a:$u,$msg:at,$loading:at.loading,$confirm:at.confirm,$prompt:at.prompt,$cache:Qn,$copy:_6,$fileUrl:$u.fileUrl,$config:i6(i),$theme:a6,$number:nd,$req:new E6(n.req),$go:new c6(n.router),$store:o};l.$menu=a,r._plugins=n.pluigns,globalThis.loadjs=M6;for(const c in l)globalThis[c]=r[c]=l[c]}const $6={install:z6},I6={data(){return{init:{}}},methods:{edit2(t,n){const r=t.model;let o=[],i;r.forEach(l=>{let c={title:l.title,field:l.field,type:l.type,info:l.info};l.prop&&l.prop.forEach(u=>{let d=u.split(" ");c[d[0]]=d[1]}),o.push(c)}),t.type==2?i=t.max||20:i=1;const a={url:"doEdit",title:t.title,labelWidth:"0px",cols:[{field:"id",type:"hidden"},{type:"group",limit:i,field:"content",title:"",cols:o}]};this.$refs.table.dialogForm(t,n,a)}},created(){const t=(n,r)=>{n==4?r.hideField(["model","max","model3","cate"]):(r.hideField(["model3"]),r.hideField(["model","max"],!1))};this.init={url:"../dev/ad",title:"广告管理",edit:{url:"doEdit",end:(n,r)=>{t(n.type,r)},change:(n,r)=>{n.type!==void 0&&t(n.type,r)},cols:[{field:"id",type:"hidden"},{field:"title",title:"广告名称",required:!0},{field:"code",title:"广告编码",required:!0},{field:"cate",title:"上级编码",info:"如果是组合模型的子模型,请填写组合模型的编码 否则不用填写"},{field:"type",title:"数据类型",type:"radio",cols:[{label:"单组数据",value:1},{label:"多组数据",value:2},{label:"组合模型",value:4}],required:!0},{field:"model3",type:"textarea",rows:4,title:"广告模型",info:"json数据"},{field:"max",title:"最大数据量",type:"number",info:"只适用于[多组数据]类型"},{field:"model",type:"group",title:"广告模型",limit:10,cols:[{field:"title",title:"名称"},{field:"field",title:"字段"},{field:"type",title:"类型",type:"select",cols:{input:"文本",textarea:"多行文本",url:"链接",img:"图片",imgs:"多图",editor:"富文本",radio:"单选框",switch:"开关",tags:"多标签",audio:"音频",video:"视频",file:"文件",goods:"商品"}},{field:"info",title:"备注"},{field:"prop",type:"tags",title:"props"}]}]},add:{url:"doAdd"},del:{url:"doDel"},cols:[{field:"sort",title:"排序",edit:!0},{field:"title",title:"广告名称"},{field:"id",title:"广告ID"},{field:"code",title:"广告标识"},{field:"cate",title:"上级编码"},{field:"type",title:"数据类型",type:"text",cols:{1:"单组数据",2:"多组数据",4:"组合模型"}},{field:"content",title:"内容"},{field:"status",title:"是否启用",type:"switch"},{type:"tool",title:"操作",width:200,btn:[{title:"编辑",action:this.edit2},{title:"配置",action:"edit"},{action:"del"}]}],tools:[{title:"添加",type:"primary",action:"add"}]}}};function R6(t,n,r,o,i,a){const l=s.resolveComponent("admin-table");return s.openBlock(),s.createBlock(l,{init:i.init,ref:"table"},null,8,["init"])}const H6=Object.freeze(Object.defineProperty({__proto__:null,default:oe(I6,[["render",R6],["__scopeId","data-v-6bb6e19c"]])},Symbol.toStringTag,{value:"Module"})),U6={};function W6(t,n){return"Index"}const q6=Object.freeze(Object.defineProperty({__proto__:null,default:oe(U6,[["render",W6]])},Symbol.toStringTag,{value:"Module"})),K6={class:"w-full bg-main pd"},J6={key:1},G6=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"index",setup(t){const n=ref(null),r=ref(null),{width:o}=useElementSize(document.getElementById("app")),{height:i}=useElementSize(document.getElementById("app")),{height:a}=useElementSize(r),l=computed(()=>i.value-44-96-a.value),c=[{title:"序号",key:"index",dataKey:"index",width:60,sortable:!0},{title:"内容",dataKey:"name"}],u=y=>{p(y)},d=ref([]),f=ref("先选择要查看的日志文件"),p=y=>{$req.post("dev.log/index",{where:y}).then(v=>{d.value=v.data,f.value=v.msg})},h=ref({key:"index",order:"asc"}),m=y=>{d.value=d.value.reverse(),h.value=y},g={cols:[{field:"file",title:"文件",type:"selects",url:"dev.log/cate",props:{emitPath:!0,checkStrictly:!1}},{field:"time",title:"时间",type:"times"},{field:"text",title:"关键字"}]};return(y,v)=>{const D=s.resolveComponent("a-search"),w=s.resolveComponent("el-table-v2"),C=s.resolveComponent("el-empty");return s.openBlock(),s.createElementBlock("div",{class:"w-full",ref_key:"el",ref:n},[s.createElementVNode("div",{class:"bg-main mb-sm pt w-full",ref_key:"searchEl",ref:r},[s.createVNode(D,{onChange:u,init:g})],512),s.createElementVNode("div",K6,[s.unref(d)?.length>0?(s.openBlock(),s.createBlock(w,{key:0,"sort-by":s.unref(h),onColumnSort:m,columns:c,data:s.unref(d),"row-height":40,width:s.unref(o)-210,height:s.unref(l)},null,8,["sort-by","data","width","height"])):(s.openBlock(),s.createElementBlock("div",J6,[s.createVNode(C,{description:s.unref(f)},null,8,["description"])]))])],512)}}}},Symbol.toStringTag,{value:"Module"})),Y6={data(){return{table:{}}},created(){const t=function(){if(!$menu)return $msg.error("menu error");$req.post("../dev/menu/doSync",{menu:$menu}).then(n=>{n.code==0?this.$refs.table.reload(!0):$msg.error(n.msg)})};this.table={url:"../dev/menu",title:"权限列表",page:!1,tree:!0,cols:[{field:"title",title:"菜单名称",width:300},{field:"path",title:"路径"},{field:"role",title:"权限",type:"tags"}],tools:[{title:"同步菜单",type:"primary",action:t}]}}};function Z6(t,n,r,o,i,a){const l=s.resolveComponent("admin-table");return s.openBlock(),s.createBlock(l,{ref:"table",init:i.table},null,8,["init"])}const X6=Object.freeze(Object.defineProperty({__proto__:null,default:oe(Y6,[["render",Z6]])},Symbol.toStringTag,{value:"Module"})),Q6={data(){return{init:{url:"/api/admin/msg",data:{is_msg:1,sms_id:"SMS_478945053",sms_tpl:"尊敬的${name} ,服务人员已接单,请在公众号内查看订单详情",info:`服务项目 {{thing2.DATA}}
|
|
40
|
+
服务人员 {{thing3.DATA}}
|
|
41
|
+
预约时间 {{time7.DATA}}
|
|
42
|
+
服务地址 {{thing6.DATA}}
|
|
43
|
+
工单号 {{character_string1.DATA}}`},tabs:["基础设置","站内信","短信","微信公众号"],cols:[{field:"is_msg",title:"站内信",type:"radio-button",cols:[{label:"开启",value:1},{label:"关闭",value:0},{label:"禁用",value:-1}]},{field:"is_mp",title:"微信公众号",type:"radio-button",cols:[{label:"开启",value:1},{label:"关闭",value:0},{label:"禁用",value:-1}]},{field:"is_sms",title:"短信",type:"radio-button",cols:[{label:"开启",value:1},{label:"关闭",value:0},{label:"禁用",value:-1}]},{field:"sort",title:"模版配置",type:"group",limit:10,labelWidth:"70px",cols:[{field:"tmp",title:"变量名称",inputWidth:"33%"},{field:"sys",title:"系统变量",inputWidth:"33%"},{field:"tmp",title:"公众号变量",inputWidth:"33%"}]},{field:"msg",title:"站内信模版",type:"textarea",tab:1},{field:"sms_id",title:"短信ID",tab:2},{field:"sms_tpl",title:"短信模版",type:"textarea",tab:2,disabled:!0},{field:"id",title:"公众号模版编号",type:"number",tab:3},{field:"id",title:"公众号模版ID",tab:3},{field:"info",title:"模版",type:"textarea",tab:3}]}}}},e8={class:"pd bg-main"};function t8(t,n,r,o,i,a){const l=s.resolveComponent("admin-form");return s.openBlock(),s.createElementBlock("div",e8,[s.createVNode(l,{class:"bg-main",init:i.init},null,8,["init"])])}const n8=Object.freeze(Object.defineProperty({__proto__:null,default:oe(Q6,[["render",t8]])},Symbol.toStringTag,{value:"Module"})),r8={data(){return{init:{}}},created(){this.init={url:"dev.msg",title:"消息设置",edit:{url:"doEdit",title:"tabs",tabs:["基础设置","站内信","短信","微信公众号"],cols:[{field:"id",type:"hidden"},{field:"title",title:"消息名称"},{field:"type",title:"消息类型",type:"radio",cols:["通知用户","通知平台"]},{field:"code",title:"消息编码",colWidth:"50%"},{field:"sort",title:"排序",type:"number",colWidth:"25%"},{field:"is_msg",title:"站内信",type:"radio",tab:1,cols:[{label:"开启",value:1},{label:"关闭",value:0},{label:"禁用",value:-1}]},{field:"is_sms",title:"短信",type:"radio",tab:2,cols:[{label:"开启",value:1},{label:"关闭",value:0},{label:"禁用",value:-1}]},{field:"is_mp",title:"微信公众号",type:"radio",tab:3,cols:[{label:"开启",value:1},{label:"关闭",value:0},{label:"禁用",value:-1}]},{field:"mapping",title:"变量映射",type:"group-table",limit:10,cols:[{field:"title",title:"变量名称",inputWidth:"25%"},{field:"sys",title:"系统变量",inputWidth:"25%"},{field:"msg",title:"站内信变量",inputWidth:"25%"},{field:"mp",title:"公众号变量",inputWidth:"25%"},{field:"sms",title:"手机变量",inputWidth:"25%"}]},{field:"msg_data.tpl",title:"站内信模版",type:"textarea",rows:3,tab:1,changeField:["is_msg"],change:t=>{const{input:n,data:r}=t;n.disabled=r.is_msg==-1}},{field:"sms_data.id",title:"短信ID",tab:2,changeField:["is_sms"],change:t=>{const{input:n,data:r}=t;n.disabled=r.is_sms==-1}},{field:"sms_data.tpl",title:"短信模版",type:"textarea",rows:3,tab:2,changeField:["is_sms"],change:t=>{const{input:n,data:r}=t;n.disabled=r.is_sms==-1}},{field:"mp_data.code",title:"模版编号",tab:3,changeField:["is_mp"],change:t=>{const{input:n,data:r}=t;n.disabled=r.is_mp==-1}},{field:"mp_data.id",title:"模版ID",tab:3,changeField:["is_mp"],change:t=>{const{input:n,data:r}=t;n.disabled=r.is_mp==-1}}]},del:{url:"doDel"},add:{url:"doAdd",title:"tabs"},cols:[{type:"checkbox",width:60},{field:"id",title:"ID",width:60,sort:!0},{field:"sort",title:"排序",width:60,edit:!0},{field:"title",title:"消息名称",edit:!0},{field:"code",title:"消息代码",edit:!0},{field:"info",title:"消息说明",edit:!0},{field:"type",title:"通知类型",type:"text",cols:{0:"通知用户",1:"通知平台"}},{field:"is_msg",title:"站内信",type:"status",cols:{"-1":["禁用","end"],0:["关闭","info"],1:["开启","primary"]},width:100},{field:"is_mp",title:"公众号",type:"status",cols:{"-1":["禁用","end"],0:["关闭","info"],1:["开启","primary"]},width:100},{field:"is_sms",title:"短信",type:"status",cols:{"-1":["禁用","end"],0:["关闭","info"],1:["开启","primary"]},width:100},{field:"mark",title:"备注",edit:!0},{type:"tool",title:"操作",width:100,btn:[{title:"修改",action:"edit"}]}],tools:[{title:"同步微信模板消息",type:"default",action:"wxsync"},{action:"add"}],search:{cols:[{field:"title",title:"消息名称",placeholder:"输入关键词"},{field:"code",title:"消息代码"},{field:"id",title:"消息ID"}]}}}};function o8(t,n,r,o,i,a){const l=s.resolveComponent("admin-table");return s.openBlock(),s.createBlock(l,{init:i.init},null,8,["init"])}const i8=Object.freeze(Object.defineProperty({__proto__:null,default:oe(r8,[["render",o8]])},Symbol.toStringTag,{value:"Module"})),s8={data(){return{cateValue:"",table:!1}},created(){this.$req.post("../dev/setting/cate").then(t=>{this.loadData(t.data)})},methods:{change(t){this.cateValue=t.data},loadData(t){const n={url:"doEdit",title:"插件配置",cols:[{field:"id",type:"hidden"},{field:"tips",title:"说明",value:"非开发者禁止操作!!!",type:"text"},{field:"type",title:"数据类型",type:"radio",cols:[{label:"单行数据",value:0},{label:"单组数据",value:1},{label:"多组数据",value:2}],required:!0},{field:"max",title:"最大数据量",type:"number",info:"只适用于[多组数据]类型"},{field:"model",type:"group",title:"数据模型",limit:20,cols:[{field:"title",inputWidth:"33.33%",title:"名称"},{field:"field",inputWidth:"33.33%",title:"字段"},{field:"type",title:"类型",type:"input-auto",inputWidth:"33.33%",list:{input:"文本",textarea:"多行文本",url:"链接",img:"图片",imgs:"多图","image-text":"图文编辑器",editor:"富文本",radio:"单选框",checkbox:"多选框",switch:"开关",tags:"多标签",color:"颜色选择器",file:"文件",md5:"随机秘钥"}},{field:"info",title:"提示"},{field:"prop",type:"tags",title:"props"}]}]};this.table={url:"../dev/plugins",title:"插件列表",cate:{cols:[{title:"",field:"tag",cols:{"":"全部",...t}}]},where:{tag:""},del:{url:"doDel"},edit:{url:"doEdit",title:"参数修改",noChangeTip:!1,cols:[{field:"id",type:"hidden"},{field:"tag",title:"分组",type:"select",cols:t,required:!0},{field:"title",title:"名称",required:!0},{field:"code",title:"编码",required:!0}]},add:{url:"doAdd",title:"参数添加",data:{tag:computed(()=>this.cateValue)}},cols:[{field:"sort",title:"排序",edit:!0},{field:"title",title:"名称"},{field:"code",title:"编码"},{field:"tag",title:"分组",type:"text",sort:!0,cols:t},{field:"type",title:"类型",type:"text",cols:{0:"单行数据",1:"单组数据",2:"多组数据"}},{field:"is_open",title:"前端调用",type:"switch"},{field:"status",title:"是否启用",type:"switch"},{type:"tool",title:"操作",width:200,btn:[{action:"edit"},{title:"配置",action:n},{action:"del"}]}],search:{cols:[{field:"title",title:"参数名称"}]},tools:[{title:"添加",type:"primary",action:"add"}]}}}};function a8(t,n,r,o,i,a){const l=s.resolveComponent("admin-table");return i.table?(s.openBlock(),s.createBlock(l,{key:0,onChange:a.change,ref:"table",init:i.table},null,8,["onChange","init"])):s.createCommentVNode("",!0)}const l8=Object.freeze(Object.defineProperty({__proto__:null,default:oe(s8,[["render",a8]])},Symbol.toStringTag,{value:"Module"})),c8={data(){return{table:!1}},created(){this.loadData()},methods:{loadData(){this.table={url:"redis",title:"redis",del:{url:"dodel"},edit:{url:"doedit",title:"参数修改",cols:[{field:"id",type:"hidden"},{field:"sort",title:"排序",edit:!0},{field:"uid",type:"switch",title:"是否需要登录"},{field:"type",title:"数据类型",type:"radio",cols:[{label:"普通数据",value:0},{label:"树形数据",value:1}],required:!0},{field:"action",type:"group",title:"控制模型",limit:1,info:"控制模型中字段(id,uid除外)必须在数据模型中存在",cols:[{field:"search",title:"搜索字段",type:"tags"},{field:"table",title:"列表字段",type:"tags"},{field:"form",title:"表单字段",type:"tags"},{field:"sort",title:"排序字段",type:"tags",info:"默认排序规则 id desc"}]}]},add:{url:"doAdd",title:"添加"},search:{cols:[{field:"title",title:"名称"}]},cols:[{field:"key",title:"key",width:300},{field:"type",title:"类型",width:100},{field:"value",title:"值",slot:!0},{type:"tool",title:"操作",width:200,btn:[{action:"edit"},{action:"del"}]}],tools:[{action:"add"}]}}}},u8={class:"w-1000px break-words"};function d8(t,n,r,o,i,a){const l=s.resolveComponent("admin-table");return i.table?(s.openBlock(),s.createBlock(l,{key:0,ref:"table",init:i.table},{"cols.value":s.withCtx(({row:c})=>[s.createElementVNode("div",u8,s.toDisplayString(c.value),1)]),_:1},8,["init"])):s.createCommentVNode("",!0)}const f8=Object.freeze(Object.defineProperty({__proto__:null,default:oe(c8,[["render",d8]])},Symbol.toStringTag,{value:"Module"})),p8={data(){return{table:{}}},created(){this.table={url:"../dev/setting_cate",title:"参数分组",page:!1,del:{url:"doDel"},edit:{url:"doEdit",title:"修改",cols:[{field:"id",type:"hidden"},{field:"title",title:"名称",required:!0},{field:"code",title:"编码",required:!0},{field:"width",type:"number",title:"表单宽度"},{field:"cate",type:"tags",title:"表单分组"},{field:"sort",title:"排序"}]},add:{url:"doAdd"},cols:[{field:"sort",title:"排序",width:150,edit:!0},{field:"title",title:"名称",width:300},{field:"code",title:"编码"},{field:"width",format:t=>t||"-",title:"表单宽度"},{field:"cate",title:"表单分组"},{field:"status",title:"是否显示在设置中心",type:"switch"},{type:"tool",title:"操作",width:200,btn:[{title:"编辑",action:"edit"}]}],tools:[{title:"添加",icon:"el-icon-plus",type:"primary",action:"add"}]}}};function h8(t,n,r,o,i,a){const l=s.resolveComponent("admin-table");return s.openBlock(),s.createBlock(l,{init:i.table},null,8,["init"])}const m8=Object.freeze(Object.defineProperty({__proto__:null,default:oe(p8,[["render",h8]])},Symbol.toStringTag,{value:"Module"})),g8={data(){return{cateValue:"",table:!1}},created(){this.$req.post("../dev/setting/cate").then(t=>{this.loadData(t.data)})},methods:{change(t){this.cateValue=t.data},loadData(t){const n={url:"doEdit",title:"参数配置",cols:[{field:"id",type:"hidden"},{field:"tips",title:"说明",value:"非开发者禁止操作!!!",type:"text"},{field:"type",title:"数据类型",type:"radio",cols:[{label:"单行数据",value:0},{label:"单组数据",value:1},{label:"多组数据",value:2}],required:!0},{field:"max",title:"最大数据量",type:"number",info:"只适用于[多组数据]类型"},{field:"model",type:"group",title:"数据模型",limit:20,cols:[{field:"title",inputWidth:"33.33%",title:"名称"},{field:"field",inputWidth:"33.33%",title:"字段"},{field:"type",title:"类型",type:"input-auto",inputWidth:"33.33%",list:{input:"文本",textarea:"多行文本",url:"链接",img:"图片",imgs:"多图","image-text":"图文编辑器",editor:"富文本",radio:"单选框",checkbox:"多选框",switch:"开关",tags:"多标签",color:"颜色选择器",file:"文件",md5:"随机秘钥"}},{field:"info",title:"提示"},{field:"prop",type:"tags",title:"props"}]}]};this.table={url:"../dev/setting",title:"参数列表",cate:{cols:[{title:"",field:"tag",cols:{"":"全部",...t}}]},where:{tag:""},del:{url:"doDel"},edit:{url:"doEdit",title:"参数修改",noChangeTip:!1,cols:[{field:"id",type:"hidden"},{field:"tag",title:"分组",type:"select",cols:t,required:!0},{field:"title",title:"名称",required:!0},{field:"code",title:"编码",required:!0}]},add:{url:"doAdd",title:"参数添加",data:{tag:computed(()=>this.cateValue)}},cols:[{field:"sort",title:"排序",edit:!0},{field:"title",title:"名称"},{field:"code",title:"编码"},{field:"tag",title:"分组",type:"text",sort:!0,cols:t},{field:"type",title:"类型",type:"text",cols:{0:"单行数据",1:"单组数据",2:"多组数据"}},{field:"is_open",title:"前端调用",type:"switch"},{field:"status",title:"是否启用",type:"switch"},{type:"tool",title:"操作",width:200,btn:[{action:"edit"},{title:"配置",action:n},{action:"del"}]}],search:{cols:[{field:"title",title:"参数名称"}]},tools:[{title:"添加",type:"primary",action:"add"}]}}}};function y8(t,n,r,o,i,a){const l=s.resolveComponent("admin-table");return i.table?(s.openBlock(),s.createBlock(l,{key:0,onChange:a.change,ref:"table",init:i.table},null,8,["onChange","init"])):s.createCommentVNode("",!0)}const b8=Object.freeze(Object.defineProperty({__proto__:null,default:oe(g8,[["render",y8]])},Symbol.toStringTag,{value:"Module"})),C8={data(){return{table:!1,id:0}},created(){const t=this.$get(),n=this;if(!t.id)return this.$msg.error("非法操作");this.id=t.id,this.$req.post("setting.table_list/info",{id:t.id}).then(function(r){n.loadData(r.data)})},methods:{loadData(t){const n=this;t.form.forEach(r=>{r.data_type==="number"&&(r.format=Number)}),this.table={url:"setting.table_list",title:t.title||"数据列表",where:{type_id:n.id},edit:{url:"setting.table_list/doedit",title:"修改",updateTable:!0,cols:[{field:"id",type:"hidden"},{field:"type_id",type:"hidden",value:t.id},{field:"type",type:"hidden",value:t.code}].concat(t.form)},del:{url:"setting.table_list/dodel"},add:{url:"setting.table_list/doadd",title:"添加"},cols:t.table.concat([{type:"tool",title:"操作",width:200,btn:[{title:"编辑",action:"edit"},{title:"删除",action:"del",confirm:!0}]}]),tools:[{title:"添加",icon:"ri-add-line",type:"primary",action:"add"}],search:{cols:t.search},batch:[{title:"批量删除",action:"$batch.del",confirm:!0}]}}}};function v8(t,n,r,o,i,a){const l=s.resolveComponent("admin-table");return i.table?(s.openBlock(),s.createBlock(l,{key:0,init:i.table,ref:"table"},null,8,["init"])):s.createCommentVNode("",!0)}const D8=Object.freeze(Object.defineProperty({__proto__:null,default:oe(C8,[["render",v8]])},Symbol.toStringTag,{value:"Module"})),w8={data(){return{table:!1}},created(){this.loadData()},methods:{loadData(){this.table={url:"../dev/table",title:"参数列表",del:{url:"dodel"},edit:{url:"doedit",title:"参数修改",cols:[{field:"id",type:"hidden"},{field:"sort",title:"排序",edit:!0},{field:"name",title:"标识"},{field:"title",title:"备注"},{field:"uid",type:"switch",title:"是否需要登录"},{field:"type",title:"数据类型",type:"radio",cols:[{label:"普通数据",value:0},{label:"树形数据",value:1}],required:!0},{field:"action",type:"group",title:"控制模型",limit:1,info:"控制模型中字段(id,uid除外)必须在数据模型中存在",cols:[{field:"search",title:"搜索字段",type:"tags"},{field:"table",title:"列表字段",type:"tags"},{field:"form",title:"表单字段",type:"tags"},{field:"sort",title:"排序字段",type:"tags",info:"默认排序规则 id desc"}]},{field:"model",type:"group",title:"数据模型",limit:32,info:"数据模型 不得使用id,type_id,uid字段,系统预设默认值 $add_time 创建时间,$edit_time 修改时间,$ip 客户端IP",cols:[{field:"title",title:"名称",inputWidth:"33.33%"},{field:"field",title:"字段",inputWidth:"33.33%"},{field:"default",title:"默认值",inputWidth:"33.33%"},{field:"type",title:"输入类型",inputWidth:"33.33%",type:"select",cols:{input:"文本",textarea:"多行文本",url:"链接",img:"图片",imgs:"多图",editor:"富文本",select:"下拉框",selects:"多级下拉框",radio:"单选框",switch:"开关",tags:"多标签",file:"文件",datetime:"时间",region:"地址",date:"日期",goods:"商品"}},{field:"info",inputWidth:"66.66%",title:"备注"},{field:"data_type",title:"数据类型",inputWidth:"33.33%",type:"radio",cols:{default:"默认",number:"数字"}},{field:"prop",type:"tags",inputWidth:"66.66%",title:"props"}]}]},add:{url:"doAdd",title:"添加"},search:{cols:[{field:"title",title:"名称"}]},cols:[{field:"sort",title:"排序",edit:!0},{field:"id",title:"ID"},{field:"name",title:"标识"},{field:"title",title:"名称"},{field:"status",title:"是否启用",type:"switch"},{type:"tool",title:"操作",width:200,btn:[{title:"数据列表",action:"/dev/setting/tablelist"},{action:"edit"},{action:"del"}]}],tools:[{action:"add"}]}}}};function B8(t,n,r,o,i,a){const l=s.resolveComponent("admin-table");return i.table?(s.openBlock(),s.createBlock(l,{key:0,ref:"table",init:i.table},null,8,["init"])):s.createCommentVNode("",!0)}const x8=Object.freeze(Object.defineProperty({__proto__:null,default:oe(w8,[["render",B8]])},Symbol.toStringTag,{value:"Module"})),Iu=[{title:"权限管理",path:"dev/menu"},{title:"广告管理",path:"dev/ad/index"},{title:"参数管理",list:[{title:"参数列表",path:"dev/setting/index"},{title:"参数分组",path:"dev/setting/cate"}]},{title:"超级表单",path:"dev/table/index"},{title:"插件管理",path:"dev/plugins/index"}],Ru=Object.assign({"./dev/ad/index.vue":H6,"./dev/index.vue":q6,"./dev/log/index.vue":G6,"./dev/menu.vue":X6,"./dev/msg/detail.vue":n8,"./dev/msg/index.vue":i8,"./dev/plugins/index.vue":l8,"./dev/redis/index.vue":f8,"./dev/setting/cate.vue":m8,"./dev/setting/index.vue":b8,"./dev/setting/tablelist.vue":D8,"./dev/table/index.vue":x8}),Hu={};for(const t in Ru){const n=t.slice(2,-4).split("/").join("");Hu[n]=Ru[t].default}const k8={components:Hu,data(){return{component:"dev/ad/index",menu:Iu}},methods:{menuClick(t){this.component=t.index}},computed:{menuOn(){let t={};for(const n of Iu)if(n.path==this.$route.path){t=n;break}else if(n.list&&(t=n.list.filter(r=>r.path===this.$route.path)[0],t))break;return t}}},E8={class:"flex h-full w-full",style:{"--menu-width":"180px","--main-height":"calc(100vh - 300 px)"}},_8={class:"w-180px h-full bg-main"},A8={class:"text-center font-bold flex items-center justify-between px h-12 leading-12"},N8={class:"flex-1 mx"},S8={class:"w-full overflow-x-hidden max-h-[calc(100vh-80px)]"};function F8(t,n,r,o,i,a){const l=s.resolveComponent("el-button"),c=s.resolveComponent("el-menu-item"),u=s.resolveComponent("el-sub-menu"),d=s.resolveComponent("el-menu");return s.openBlock(),s.createElementBlock("div",E8,[s.createElementVNode("div",_8,[s.createVNode(d,{"default-active":i.component},{default:s.withCtx(()=>[s.createElementVNode("div",A8,[n[2]||(n[2]=s.createTextVNode(" 开发者 ",-1)),s.createVNode(l,{size:"small",onClick:n[0]||(n[0]=f=>t.$router.back())},{default:s.withCtx(()=>[...n[1]||(n[1]=[s.createTextVNode("返回",-1)])]),_:1})]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.menu,f=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[f.list?(s.openBlock(),s.createBlock(u,{key:0,index:f.title},{title:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(f.title),1)]),default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(f.list,p=>(s.openBlock(),s.createBlock(c,{onClick:a.menuClick,index:p.path,route:p.path},{title:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(p.title),1)]),_:2},1032,["onClick","index","route"]))),256))]),_:2},1032,["index"])):(s.openBlock(),s.createBlock(c,{key:1,onClick:a.menuClick,index:f.path},{title:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(f.title),1)]),_:2},1032,["onClick","index"]))],64))),256))]),_:1},8,["default-active"])]),s.createElementVNode("div",N8,[s.createElementVNode("div",S8,[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(i.component.split("/").join(""))))])])])}const V8=oe(k8,[["render",F8]]),Uu=(t,n)=>{$6.install(t,n),e6.install(t),t.mixin(t6),t.directive("focus",{mounted(r){r.focus()}})},O8={install:Uu},T8={name:"group-tabs",components:{inputItem:defineAsyncComponent(()=>Promise.resolve().then(()=>is))},emits:["change","update:modelValue"],props:{init:Object,size:{type:String,default:""},modelValue:Array|Object},data(){return{tabs:[],dataType:"Array",limit:1,key:1,alignTop:!1,list:[],cols:[]}},created(){this.init.tabs&&typeof this.init.tabs=="function"?this.tabs=this.init.tabs(this.modelValue):this.init.tabs&&(this.tabs=this.init.tabs),this.init.cols&&(Array.isArray(this.init.cols)?this.cols=this.init.cols:typeof this.init.cols=="object"&&(this.cols=[this.init.cols]),this.init.size&&this.cols.forEach(t=>{t.size=this.init.size}),this.init.alignTop&&(this.alignTop=!0),this.init.limit>1&&(this.limit=this.init.limit),this.modelValue&&this.modelValue.constructor.name==="Object"?(this.dataType="Object",this.list=[this.modelValue]):this.modelValue&&this.modelValue.constructor.name==="Array"&&(this.list=this.modelValue),this.limit===1&&(this.dataType="Object",this.modelValue||(this.list=[{}])),this.$watch("list",function(t,n){this.dataType==="Object"&&(t=t[0]),console.log(t,this.dataType),this.$emit("update:modelValue",t),this.$emit("change",t)},{deep:!0}))},methods:{change(){this.key++},del(t){this.list.splice(t,1),this.key++},add(){this.list.push({})}}},j8={class:"group-tabs"},L8={class:"input-group-item"},P8={class:"item"},M8={class:"input w-full"},z8={class:"input-item-box"},$8={class:"input-item-input"},I8={key:0,class:"input-item-info text-3 op-70 pt-xs leading-15"};function R8(t,n,r,o,i,a){const l=s.resolveComponent("inputItem"),c=s.resolveComponent("el-tab-pane"),u=s.resolveComponent("el-tabs");return s.openBlock(),s.createElementBlock("div",j8,[s.createVNode(u,{type:"border-card"},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.tabs,(d,f)=>(s.openBlock(),s.createBlock(c,{label:d.title},{default:s.withCtx(()=>[s.createElementVNode("div",L8,[s.createElementVNode("div",P8,[s.createElementVNode("div",M8,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.cols,p=>(s.openBlock(),s.createElementBlock("div",{class:"input-item",style:s.normalizeStyle({width:p.inputWidth?p.inputWidth:"100%"})},[s.createElementVNode("div",z8,[p.title?(s.openBlock(),s.createElementBlock("div",{key:0,class:"input-item-title",style:s.normalizeStyle(`width:${p.labelWidth||r.init.labelWidth};`)},s.toDisplayString(p.title)+": ",5)):s.createCommentVNode("",!0),s.createElementVNode("div",$8,[p.field?(s.openBlock(),s.createBlock(l,{key:0,modelValue:r.modelValue[d.key||f][p.field],"onUpdate:modelValue":h=>r.modelValue[d.key||f][p.field]=h,index:f,prop:p},null,8,["modelValue","onUpdate:modelValue","index","prop"])):i.cols.length===1?(s.openBlock(),s.createBlock(l,{key:1,modelValue:r.modelValue[d.key||f],"onUpdate:modelValue":h=>r.modelValue[d.key||f]=h,index:f,prop:p},null,8,["modelValue","onUpdate:modelValue","index","prop"])):s.createCommentVNode("",!0)])]),p.info?(s.openBlock(),s.createElementBlock("div",I8,[n[0]||(n[0]=s.createElementVNode("i",{class:"i-ri-error-warning-line"},null,-1)),s.createTextVNode(" "+s.toDisplayString(p.info),1)])):s.createCommentVNode("",!0)],4))),256))])])])]),_:2},1032,["label"]))),256))]),_:1})])}const H8=Object.freeze(Object.defineProperty({__proto__:null,default:oe(T8,[["render",R8]])},Symbol.toStringTag,{value:"Module"})),U8={name:"form-group",components:{inputItem:s.defineAsyncComponent(()=>Promise.resolve().then(()=>is))},emits:["change","update:modelValue"],props:{size:{type:String,default:""},init:Object,modelValue:Array|Object},data(){return{dataType:"Array",limit:1,key:1,list:[],cols:[]}},created(){this.cols=this.init.cols;const t=this.cols.filter(r=>!r.width).length;console.log(t);const n=`calc(${(100/t).toFixed(1)+"%"} - ${(80/t).toFixed(1)+"px"})`;console.log(n),this.init.size&&this.cols.forEach(r=>{r.size=this.init.size,r.width||(r.width=n)}),this.init.limit>1&&(this.limit=this.init.limit),this.modelValue&&this.modelValue.constructor.name==="Object"?(this.dataType="Object",this.list=[this.modelValue]):this.modelValue&&this.modelValue.constructor.name==="Array"?this.list=this.modelValue:this.limit===1&&(this.dataType="Object"),this.$watch("list",function(r,o){this.dataType==="Object"&&(r=r[0]),this.$emit("update:modelValue",r),this.$emit("change",r)},{deep:!0})},methods:{change(){this.key++},del(t){this.list.splice(t,1),this.key++},add(){this.list.push({})}}},W8={class:"input-group-table"},q8={align:"left"},K8={style:{"line-height":"1.2"}},J8=["onClick"],G8={class:"text-3 op-70 pl-sm"};function Y8(t,n,r,o,i,a){const l=s.resolveComponent("el-tooltip"),c=s.resolveComponent("inputItem");return s.openBlock(),s.createElementBlock("div",W8,[s.createElementVNode("table",null,[s.createElementVNode("colgroup",null,[n[1]||(n[1]=s.createElementVNode("col",{width:40},null,-1)),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.cols,u=>(s.openBlock(),s.createElementBlock("col",{style:s.normalizeStyle({width:u.width})},null,4))),256)),n[2]||(n[2]=s.createElementVNode("col",{width:40},null,-1))]),s.createElementVNode("thead",null,[s.createElementVNode("tr",null,[n[4]||(n[4]=s.createElementVNode("th",null,null,-1)),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.cols,u=>(s.openBlock(),s.createElementBlock("th",q8,[s.createElementVNode("div",K8,[s.createTextVNode(s.toDisplayString(u.title)+" ",1),u.info?(s.openBlock(),s.createBlock(l,{key:0,content:u.info,placement:"bottom",effect:"light"},{default:s.withCtx(()=>[...n[3]||(n[3]=[s.createElementVNode("i",{class:"i-ri-question-line op-70"},null,-1)])]),_:1},8,["content"])):s.createCommentVNode("",!0)])]))),256)),n[5]||(n[5]=s.createElementVNode("th",{align:"right"},null,-1))])]),(s.openBlock(),s.createBlock(s.resolveDynamicComponent(i.limit>1?"a-draggable":"span"),s.mergeProps({tag:"tbody"},i.limit>1?{filter:".del",handle:".sort",list:i.list,onChange:a.change}:{}),{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.list,(u,d)=>(s.openBlock(),s.createElementBlock("tr",null,[n[7]||(n[7]=s.createElementVNode("td",null,[s.createElementVNode("div",{class:"sort op-70",title:"拖动排序"},[s.createElementVNode("i",{class:"i-ri-menu-line"})])],-1)),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.cols,f=>(s.openBlock(),s.createElementBlock("td",null,[(s.openBlock(),s.createBlock(c,{clearable:f.clearable??r.init.clearable??!1,cols:i.cols,index:d,key:i.key,prop:f,modelValue:u[f.field],"onUpdate:modelValue":p=>u[f.field]=p},null,8,["clearable","cols","index","prop","modelValue","onUpdate:modelValue"]))]))),256)),s.createElementVNode("td",null,[s.createElementVNode("div",{title:"删除",class:"del op-70 flex",onClick:f=>a.del(d)},[...n[6]||(n[6]=[s.createElementVNode("i",{class:"i-ri-delete-bin-line"},null,-1)])],8,J8)])]))),256))]),_:1},16))]),i.list.length<i.limit?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["add flex justify-center items-center info-hide",{"add-small":r.init.size==="small"}]),onClick:n[0]||(n[0]=(...u)=>a.add&&a.add(...u))},[n[8]||(n[8]=s.createElementVNode("i",{class:"i-ri-add-line font-xl"},null,-1)),n[9]||(n[9]=s.createElementVNode("span",null,"添加数据",-1)),s.createElementVNode("span",G8,"("+s.toDisplayString(i.list.length)+"/"+s.toDisplayString(i.limit)+")",1)],2)):s.createCommentVNode("",!0)])}const Z8=Object.freeze(Object.defineProperty({__proto__:null,default:oe(U8,[["render",Y8],["__scopeId","data-v-5b3688e9"]])},Symbol.toStringTag,{value:"Module"})),X8={name:"form-group",components:{inputItem:s.defineAsyncComponent(()=>Promise.resolve().then(()=>is))},emits:["change","update:modelValue"],props:{init:Object,size:{type:String,default:""},modelValue:Array|Object},data(){return{config:{text:"添加数据"},dataType:"Array",limit:1,key:1,alignTop:!1,list:[],cols:[]}},created(){this.cols=this.init.cols,this.init.size&&this.cols.forEach(t=>{t.size=this.init.size}),this.init.alignTop&&(this.alignTop=!0),this.init.config&&(this.config=this.init.config),this.init.limit>1&&(this.limit=this.init.limit),this.modelValue&&this.modelValue.constructor.name==="Object"?(this.dataType="Object",this.list=[this.modelValue]):this.modelValue&&this.modelValue.constructor.name==="Array"&&(this.list=this.modelValue),this.limit===1&&(this.dataType="Object",this.modelValue||(this.list=[{}])),this.$watch("list",function(t,n){this.dataType==="Object"&&(t=t[0]),this.$emit("update:modelValue",t),this.$emit("change",t)},{deep:!0})},methods:{change(){this.key++},change2(t,n){this.list[n][t.field]=t.data},del(t){this.list.splice(t,1),this.key++},add(){this.list.push({})}}},Q8={class:"input-group-item"},e5={key:0,class:"sort",title:"拖动排序"},t5={class:"item"},n5={class:"input w-full"},r5={key:0,class:"input-item-title"},o5={class:"input-item-input"},i5={key:0,class:"input-item-info text-3 op-70 pt-xs",style:{"line-height":"1.5"}},s5=["onClick"],a5={class:"text-3 op-70 pl-sm"};function l5(t,n,r,o,i,a){const l=s.resolveComponent("inputItem");return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["input-group",i.limit==1?"input-group-one":""])},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(i.limit>1?"a-draggable":"span"),s.normalizeProps(s.guardReactiveProps(i.limit>1?{filter:".del",handle:".sort",list:i.list,onChange:a.change}:{})),{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.list,(c,u)=>(s.openBlock(),s.createElementBlock("div",Q8,[i.limit!=1?(s.openBlock(),s.createElementBlock("div",e5,[...n[1]||(n[1]=[s.createElementVNode("i",{class:"i-ri-menu-line"},null,-1)])])):s.createCommentVNode("",!0),s.createElementVNode("div",t5,[s.createElementVNode("div",n5,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.cols,d=>(s.openBlock(),s.createElementBlock("div",{class:"input-item",style:s.normalizeStyle({width:d.inputWidth?d.inputWidth:"100%"})},[s.createElementVNode("div",{class:s.normalizeClass(["input-item-box",{"input-item-box-h":i.alignTop}])},[d.title?(s.openBlock(),s.createElementBlock("div",r5,s.toDisplayString(d.title)+": ",1)):s.createCommentVNode("",!0),s.createElementVNode("div",o5,[(s.openBlock(),s.createBlock(l,{cols:i.cols,index:u,key:i.key,prop:d,onChange:f=>a.change2(f,u),modelValue:c[d.field],"onUpdate:modelValue":f=>c[d.field]=f},null,8,["cols","index","prop","onChange","modelValue","onUpdate:modelValue"]))])],2),d.info?(s.openBlock(),s.createElementBlock("div",i5,[n[2]||(n[2]=s.createElementVNode("i",{class:"i-ri-error-warning-line"},null,-1)),s.createTextVNode(" "+s.toDisplayString(d.info),1)])):s.createCommentVNode("",!0)],4))),256))]),i.limit!=1?(s.openBlock(),s.createElementBlock("div",{key:0,class:"del",onClick:d=>a.del(u)},[...n[3]||(n[3]=[s.createElementVNode("i",{class:"i-ri-close-line"},null,-1)])],8,s5)):s.createCommentVNode("",!0)])]))),256))]),_:1},16)),i.limit!=1&&i.list.length<i.limit?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["add flex justify-center items-center",{"add-small":r.init.size==="small"}]),onClick:n[0]||(n[0]=(...c)=>a.add&&a.add(...c))},[n[4]||(n[4]=s.createElementVNode("i",{class:"i-ri-add-line font-xl"},null,-1)),s.createElementVNode("span",null,s.toDisplayString(i.config.text),1),s.createElementVNode("span",a5,"("+s.toDisplayString(i.list.length)+"/"+s.toDisplayString(i.limit)+")",1)],2)):s.createCommentVNode("",!0)],2)}const c5=Object.freeze(Object.defineProperty({__proto__:null,default:oe(X8,[["render",l5],["__scopeId","data-v-f389829d"]])},Symbol.toStringTag,{value:"Module"})),u5={backgroundColor:"transparent",textStyle:{},title:{textStyle:{color:"#eeeeee"},subtextStyle:{color:"#aaaaaa"}},categoryAxis:{axisLine:{lineStyle:{color:"#eeeeee"}},axisTick:{lineStyle:{color:"#eeeeee"}},axisLabel:{color:"#eeeeee"},splitLine:{lineStyle:{color:["#aaaaaa"]}},splitArea:{show:!1,areaStyle:{color:["#eeeeee"]}}},valueAxis:{axisLine:{show:!0,lineStyle:{color:"#eeeeee"}},axisTick:{show:!0,lineStyle:{color:"#eeeeee"}},axisLabel:{show:!0,color:"#eeeeee"},splitLine:{show:!0,lineStyle:{color:["#aaaaaa"]}},splitArea:{show:!1,areaStyle:{color:["#eeeeee"]}}},legend:{textStyle:{color:"#eeeeee"}},tooltip:{axisPointer:{lineStyle:{color:"#eeeeee",width:"1"},crossStyle:{color:"#eeeeee",width:"1"}}},timeline:{lineStyle:{color:"#eeeeee",width:1},itemStyle:{color:"#dd6b66",borderWidth:1},controlStyle:{color:"#eeeeee",borderColor:"#eeeeee",borderWidth:.5},checkpointStyle:{color:"#e43c59",borderColor:"#c23531"},label:{color:"#eeeeee"},emphasis:{itemStyle:{color:"#a9334c"},controlStyle:{color:"#eeeeee",borderColor:"#eeeeee",borderWidth:.5},label:{color:"#eeeeee"}}},visualMap:{color:["#bf444c","#d88273","#f6efa6"]},dataZoom:{backgroundColor:"rgba(47,69,84,0)",dataBackgroundColor:"rgba(255,255,255,0.3)",fillerColor:"rgba(167,183,204,0.4)",handleColor:"#a7b7cc",handleSize:"100%",textStyle:{color:"#eeeeee"}},markPoint:{label:{color:"#eeeeee"},emphasis:{label:{color:"#eeeeee"}}}},fo={};function d5(t,n=.5){if(t.startsWith("rgba"))return t.replace(/[\d\.]+\)$/g,`${n})`);if(t.startsWith("rgb"))return t.replace("rgb","rgba").replace(")",`, ${n})`);if(t.startsWith("#")){if(t.length===4){const r=parseInt(t[1]+t[1],16),o=parseInt(t[2]+t[2],16),i=parseInt(t[3]+t[3],16);return`rgba(${r}, ${o}, ${i}, ${n})`}if(t.length===7){const r=parseInt(t.slice(1,3),16),o=parseInt(t.slice(3,5),16),i=parseInt(t.slice(5,7),16);return`rgba(${r}, ${o}, ${i}, ${n})`}if(t.length===9){const r=parseInt(t.slice(1,3),16),o=parseInt(t.slice(3,5),16),i=parseInt(t.slice(5,7),16),a=parseInt(t.slice(7,9),16)/255;return`rgba(${r}, ${o}, ${i}, ${a*n})`}}return t.startsWith("hsl")?t.startsWith("hsla")?t.replace(/[\d\.]+\)$/g,`${n})`):t.replace("hsl","hsla").replace(")",`, ${n})`):t.startsWith("hsla")?t.replace(/[\d\.]+\)$/g,`${n})`):t}const rr=(t=["#eee","#999"])=>(t=Array.isArray(t)?t:[d5(t,.7),t],{type:"linear",x:0,x2:0,y:0,y2:1,colorStops:[{offset:0,color:t[0]},{offset:1,color:t[1]}]}),f5=(t=-1)=>{const n=$store.theme+$store.dark;if(!fo[n]){const r=$store.theme,o={yellow:"#f59e0b",green:"#22c55e",purple:"#f43f5e",blue:"#3b82f6",red:"#f2140d"},i={yellow:"#eedd78",green:"#91ca8c",purple:"#e69d87",blue:"#73b9bc",red:"#dd6b66"};delete i[r],delete o[r];const a=[rr($theme("primary"))];if($store.dark){for(const l in i)a.push(rr(i[l]));for(const l in o)a.push(rr(o[l]))}else{for(const l in o)a.push(rr(o[l]));for(const l in i)a.push(rr(i[l]))}fo[n]=a}return t>-1?fo[n][t]:fo[n]},p5={class:"echarts"},h5={class:"chart-slot"},m5=Object.freeze(Object.defineProperty({__proto__:null,default:s.defineComponent({__name:"chart",props:{init:{type:Object,default:()=>({})},data:{type:[Boolean,Object],default:!1},type:String,asyncData:{type:[Function,String]}},setup(t){const n=t,r=ref(null),o=ref(!0),i=ref(null),a=()=>{const v=$store.dark?u5:{};return v.color=f5(),v},l={type:"bar",yAxisIndex:0,itemStyle:{borderRadius:[4,4,0,0]}},c={yAxisIndex:0,type:"line"},u=ref({}),d=(v,D)=>{const{type:w="line"}=v;let C=v||{};if(C.tooltip===void 0&&(C.tooltip={}),C.mini)return C.grid={left:0,right:0,bottom:0},C.xAxis={show:!1,data:Object.keys(D)},C.yAxis={type:"value",show:!1},v.type=="line"||!v.type?C.series={type:"line",areaStyle:{},smooth:!0}:C.series={type:"bar"},delete C.mini,C.series.data=Object.values(D),C;if(C.grid===void 0&&(C.grid={top:0,left:0,right:0,bottom:80}),C.legend===void 0&&(C.legend={}),C.xAxis===void 0&&(C.xAxis={type:"category"}),C.yAxis===void 0&&(C.yAxis={}),C.series===void 0){const B=[];D[0].forEach((k,_)=>{if(_>0){const N=(Array.isArray(w)?w[_-1]:w)==="bar"?l:c;B.push({...N})}}),C.series=B}return typeof D=="object"&&(C.dataset={source:D}),C},f=v=>{n.init.type=="pie"?p(v):n.init.type=="map"?h(v):m(v)},p=v=>{const D=n.init;if(delete D.type,D.tooltip===void 0&&(D.tooltip={}),D.legend===void 0&&(D.legend={}),v){if(D.series=[{type:"pie",labelLine:{length:15,length2:0,maxSurfaceAngle:80},data:[]}],Array.isArray(v))D.series[0].data=v;else for(const w in v)if(Object.prototype.hasOwnProperty.call(v,w)){const C=v[w];D.series[0].data.push({value:C,name:w})}}console.log(D),u.value=D,g()},h=async v=>{let D=0;v&&(D=v[0].value);let w=n.init,C=w.adcode||1e5,B={1e5:"china"}[C]||"map";const k=await $req.query(`https://geo.datav.aliyun.com/areas_v3/bound/${C}_full.json`),_=bo.init(i.value);w.visualMap={text:["高","低"],min:0,max:D,calculable:!0,orient:"horizontal",bottom:20,inRange:{color:["#ebf5ff","#409eff"]}},w.series={type:"map",map:B,label:{show:!0,color:"#999",fontSize:10},itemStyle:{areaColor:"#ecf5ff",borderColor:"#dddddd"}},w.series.data=v,bo.registerMap(B,k),_.setOption(w),r.value=_,o.value=!1},m=v=>{u.value=n.type==="native"?n.init:d(n.init,v),g()},g=()=>{const v=bo.init(i.value,a(),{renderer:"svg"});v.setOption(u.value),r.value=v,o.value=!1};watch(()=>[$store.dark,$store.theme],()=>{r.value&&r.value.setTheme(a())}),onMounted(()=>{n.asyncData&&typeof n.asyncData=="function"?n.asyncData(f):f(n.data)}),onUnmounted(()=>{r.value&&r.value.dispose(),window.removeEventListener("resize",y)});const y=()=>{r.value&&r.value.resize()};return window.addEventListener("resize",y),(v,D)=>{const w=s.resolveDirective("loading");return s.openBlock(),s.createElementBlock("div",p5,[s.withDirectives((s.openBlock(),s.createElementBlock("div",h5,[s.unref(o)?s.createCommentVNode("",!0):s.renderSlot(v.$slots,"default",{key:0})])),[[w,s.unref(o)]]),s.createElementVNode("div",{class:"chart-box",ref_key:"echartsRef",ref:i},null,512)])}}})},Symbol.toStringTag,{value:"Module"}));ut.adminDev=V8,ut.default=O8,ut.install=Uu,Object.defineProperties(ut,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|