dmx-admin-ui 1.2.113 → 1.2.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(at,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("@vueuse/core"),require("echarts")):typeof define=="function"&&define.amd?define(["exports","vue","es-toolkit","element-plus","alova","@alova/adapter-xhr","number-precision","@vueuse/core","echarts"],s):(at=typeof globalThis<"u"?globalThis:at||self,s(at.AdminUi={},at.vue,at.esToolkit,at.elementPlus,at.alova,at.adapterXhr,at.np,at.core,at.echarts))})(this,(function(at,s,yo,we,sr,id,sd,bo,ad){"use strict";function ld(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 Co=ld(ad);function cd(t){return Number.isSafeInteger(t)&&t>=0}function ud(t){return t!=null&&typeof t!="function"&&cd(t.length)}function Tn(t){return t==="__proto__"}function Es(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}function vo(t){return typeof t=="string"||typeof t=="symbol"?t:Object.is(t?.valueOf?.(),-0)?"-0":String(t)}function _s(t){if(t==null)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(_s).join(",");const n=String(t);return n==="0"&&Object.is(Number(t),-0)?"-0":n}function Do(t){if(Array.isArray(t))return t.map(vo);if(typeof t=="symbol")return[t];t=_s(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?Es(n)?Yt(t,Do(n),r):r:o}case"number":case"symbol":{typeof n=="number"&&(n=vo(n));const o=t[n];return o===void 0?r:o}default:{if(Array.isArray(n))return dd(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 dd(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 As(t){return t!==null&&(typeof t=="object"||typeof t=="function")}function wo(t){return t==null||typeof t!="object"&&typeof t!="function"}function fd(t,n){return t===n||Number.isNaN(t)&&Number.isNaN(n)}function Ss(t){return Object.getOwnPropertySymbols(t).filter(n=>Object.prototype.propertyIsEnumerable.call(t,n))}function Bo(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const pd="[object RegExp]",Ns="[object String]",Fs="[object Number]",Vs="[object Boolean]",Os="[object Arguments]",hd="[object Symbol]",md="[object Date]",gd="[object Map]",yd="[object Set]",bd="[object Array]",Cd="[object ArrayBuffer]",Ts="[object Object]",vd="[object DataView]",Dd="[object Uint8Array]",wd="[object Uint8ClampedArray]",Bd="[object Uint16Array]",xd="[object Uint32Array]",kd="[object Int8Array]",Ed="[object Int16Array]",_d="[object Int32Array]",Ad="[object Float32Array]",Sd="[object Float64Array]";function xo(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Nd(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(wo(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(xo(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),kt(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),kt(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),kt(l,t,r,o,i),l}if(t instanceof Error){const l=structuredClone(t);return o.set(t,l),l.message=t.message,l.name=t.name,l.stack=t.stack,l.cause=t.cause,l.constructor=t.constructor,kt(l,t,r,o,i),l}if(t instanceof Boolean){const l=new Boolean(t.valueOf());return o.set(t,l),kt(l,t,r,o,i),l}if(t instanceof Number){const l=new Number(t.valueOf());return o.set(t,l),kt(l,t,r,o,i),l}if(t instanceof String){const l=new String(t.valueOf());return o.set(t,l),kt(l,t,r,o,i),l}if(typeof t=="object"&&Fd(t)){const l=Object.create(Object.getPrototypeOf(t));return o.set(t,l),kt(l,t,r,o,i),l}return t}function kt(t,n,r=t,o,i){const a=[...Object.keys(n),...Ss(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 Fd(t){switch(Bo(t)){case Os:case bd:case Cd:case vd:case Vs:case md:case Ad:case Sd:case kd:case Ed:case _d:case gd:case Fs:case Ts:case pd:case yd:case Ns:case hd:case Dd:case wd:case Bd:case xd:return!0;default:return!1}}function Vd(t,n){return Nd(t,(r,o,i,a)=>{if(typeof t=="object"){if(Bo(t)===Ts&&typeof t.constructor!="function"){const l={};return a.set(t,l),kt(l,t,i,a),l}switch(Object.prototype.toString.call(t)){case Fs:case Ns:case Vs:{const l=new t.constructor(t?.valueOf());return kt(l,t),l}case Os:{const l={};return kt(l,t),l.length=t.length,l[Symbol.iterator]=t[Symbol.iterator],l}default:return}}})}function js(t){return Vd(t)}const Od=/^(?:0|[1-9]\d*)$/;function Ls(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 Od.test(t)}}function ko(t){return t!==null&&typeof t=="object"&&Bo(t)==="[object Arguments]"}function Td(t,n){let r;if(Array.isArray(n)?r=n:typeof n=="string"&&Es(n)&&t?.[n]==null?r=Do(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)||ko(o))&&Ls(a)&&a<o.length))return!1;o=o[a]}return!0}function Eo(t){return typeof t=="object"&&t!==null}function jd(t){return Eo(t)&&ud(t)}function Ld(t){return typeof t=="symbol"||t instanceof Symbol}const Pd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Md=/^\w*$/;function zd(t,n){return Array.isArray(t)?!1:typeof t=="number"||typeof t=="boolean"||t==null||Ld(t)?!0:typeof t=="string"&&(Md.test(t)||!Pd.test(t))||n!=null&&Object.hasOwn(n,t)}const $d=(t,n,r)=>{const o=t[n];(!(Object.hasOwn(t,n)&&fd(o,r))||r===void 0&&!(n in t))&&(t[n]=r)};function Id(t,n,r,o){if(t==null&&!As(t))return t;let i;zd(n,t)?i=[n]:Array.isArray(n)?i=n:i=Do(n);const a=r(Yt(t,i));let l=t;for(let c=0;c<i.length&&l!=null;c++){const u=vo(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:As(f)?f:Ls(i[c+1])?[]:{}}$d(l,u,d),l=l[u]}return t}function dn(t,n,r){return Id(t,n,()=>r,()=>{})}function Rd(){}function _o(t){return xo(t)}function Ao(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 Hd(t){if(wo(t))return t;if(Array.isArray(t)||xo(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const n=Object.getPrototypeOf(t);if(n==null)return Object.assign(Object.create(n),t);const 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){let o;return t instanceof AggregateError?o=new r(t.errors,t.message,{cause:t.cause}):o=new r(t.message,{cause:t.cause}),o.stack=t.stack,Object.assign(o,t),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 Ud(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(wo(t)&&(t=Object(t)),n==null||typeof n!="object")return t;if(o.has(n))return Hd(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),...Ss(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(ko(c)&&(c={...c}),ko(u)&&(u={...u}),typeof Buffer<"u"&&Buffer.isBuffer(c)&&(c=js(c)),Array.isArray(c))if(Array.isArray(u)){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 if(jd(u)){const f=[];for(let p=0;p<u.length;p++)f[p]=u[p];u=f}else u=[];const d=r(u,c,l,t,n,o);d!==void 0?t[l]=d:Array.isArray(c)||Eo(u)&&Eo(c)&&(Ao(u)||Ao(c)||_o(u)||_o(c))?t[l]=ar(u,c,r,o):u==null&&Ao(c)?t[l]=ar({},c,r,o):u==null&&_o(c)?t[l]=js(c):(u===void 0||c!==void 0)&&(t[l]=c)}return t}function So(t,...n){return Ud(t,...n,Rd)}const Wd=(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};s.reactive({table:{},limit:10,page:1,pageSizes:[],tree:!1}),s.reactive({limit:10,page:1});function qd(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 Kd(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=Wd(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 Jd=(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)})}},ne=(t,n)=>{const r=t.__vccOpts||t;for(const[o,i]of n)r[o]=i;return r},Gd={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)}}}},Yd={class:"table-footer"},Zd={key:0};function Xd(t,n,r,o,i,a){const l=s.resolveComponent("el-pagination");return s.openBlock(),s.createElementBlock("div",Yd,[s.createElementVNode("div",null,[s.renderSlot(t.$slots,"left")]),r.init.page?(s.openBlock(),s.createElementBlock("div",Zd,[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 Qd=ne(Gd,[["render",Xd]]),ef={key:0,class:"table-tool-footer"},tf={class:"color-primary"},nf={__name:"tableBatch",props:{checkAllChange:Function,batch:Array,tabs:Array,tabsIndex:Number,table:Object},setup(t){const{checkData:n,uniApi:r,config:o,pk:i}=s.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",ef,[s.createElementVNode("div",null,[c[2]||(c[2]=s.createTextVNode(" 已选择 ",-1)),s.createElementVNode("span",tf,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)}}},rf={key:1,style:{"margin-bottom":"-12px","margin-top":"-6px"},id:"table-form-header"},of={class:"overflow-hidden"},sf={class:"dialog-footer"},af=s.defineComponent({__name:"tableDialog",setup(t,{expose:n}){const r=s.inject("table"),o=s.ref(!1),i=s.ref({}),a=s.ref($config?.form?.btnText??"提交"),l=s.ref(0),c=s.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",rf))]),footer:s.withCtx(()=>[s.createElementVNode("span",sf,[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",of,[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"])}}}),lf={key:0,class:"cate-search bg-main pl pb mb-xs"},cf={class:"flex-center pt"},uf={class:"label px-sm"},df=s.defineComponent({__name:"tableNav",setup(t){const n=s.ref({}),{init:r,navChange:o}=s.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",lf,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(r).cate.cols,u=>(s.openBlock(),s.createElementBlock("div",cf,[s.createElementVNode("div",uf,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)}}}),ff={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})}}},pf={style:{cursor:"pointer",color:"#0D84FF"},class:"flex"},hf={style:{"text-align":"center"}},mf=["onClick"];function gf(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",hf,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,mf))]),_:2},1024)):s.createCommentVNode("",!0)],64))),256))]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",pf,[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 yf=ne(ff,[["render",gf]]),bf={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}},Cf={class:"flex py-sm leading-tight max-w-200px"},vf={class:"flex-col ml-sm flex-1 overflow-hidden"},Df={class:"font-md line-1"},wf={style:{color:"#F56C6C"}},Bf={key:1,class:"flex-col ml-sm"},xf={class:"font-md op-70"};function kf(t,n,r,o,i,a){const l=s.resolveComponent("a-image");return s.openBlock(),s.createElementBlock("div",Cf,[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",vf,[s.createElementVNode("div",Df,s.toDisplayString(r.data[i.titleName]),1),s.createElementVNode("div",wf,"ID:"+s.toDisplayString(r.data[i.pk]),1)])],64)):(s.openBlock(),s.createElementBlock("div",Bf,[s.createElementVNode("div",xf,s.toDisplayString(r.init?.error||"数据不存在"),1)]))])}const Ps=ne(bf,[["render",kf]]),Ef={components:{Tool:yf,imgInfo:Ps},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=s.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}}},_f={key:1,class:"pl"},Af={key:1},Sf={key:0,class:"tags"},Nf={key:0,class:"table-goods flex py-xs"},Ff={class:"flex-col ml-sm flex-1 overflow-hidden",style:{}},Vf={class:"line-1"},Of={class:"text-color-regular"},Tf={class:"color-danger"};function jf(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",_f)),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",Af,"无"))],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",Sf,[(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",Nf,[s.createVNode(f,{height:"60px",width:"60px",lazy:"",fit:"cover",preview:!1,src:i.value.head_img},null,8,["src"]),s.createElementVNode("div",Ff,[s.createElementVNode("div",Vf,s.toDisplayString(i.value.title),1),s.createElementVNode("div",Of,"价格:"+s.toDisplayString(i.value.price),1),s.createElementVNode("div",Tf,"商品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 Lf=ne(Ef,[["render",jf]]),Pf={class:"table-main table-fixed border-collapse",cellspacing:"0",cellpadding:"0"},Mf=["width"],zf={key:0},$f={class:"cell line-1"},If={key:0},Rf=["onClick"],Hf={class:"sort"},Uf={key:0,class:"text-3 pl-sm",style:{color:"var(--el-color-info)"}},Wf={key:0,class:"cols-tool"},qf=["colspan"],Kf={class:"cols-tool-main"},Jf=["onClick"],Gf={__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",Pf,[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,Mf))),256))]),t.init.header!==!1?(s.openBlock(),s.createElementBlock("thead",zf,[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",$f,[y.type=="checkbox"?(s.openBlock(),s.createElementBlock("div",If,[(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",Hf,[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,Rf)):(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",Uf,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",Wf,[s.createElementVNode("td",{colspan:d.value.length},[s.createElementVNode("div",Kf,[s.renderSlot(p.$slots,"colsTool",{key:v,row:y})])],8,qf)])):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(Lf,{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,Jf)],2))),256)):s.createCommentVNode("",!0)],2)],64))),128))],2)])]),_:3},8,["max-height"])}}},Yf=s.defineComponent({__name:"tableTabs",props:{modelValue:Number},setup(t){const n=s.ref(t.modelValue),{init:r,tabsChange:o,toolAction:i}=s.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)}}}),Zf={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,this.sum=this.init.cols.length;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.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)}}},Xf={key:1,class:"flex-col text-right line-height"},Qf={class:"op-70 text-3 pt-xs line-2"},ep={class:""};function tp(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",Xf,[s.createElementVNode("span",null,s.toDisplayString(m.title),1),s.createElementVNode("span",Qf,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",ep,[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 Ms=ne(Zf,[["render",tp]]),No={table:{}},np={class:"admin-table-page"},rp={key:1,class:"mb bg-main h-19"},op={class:"admin-table rounded-md"},ip={key:0,class:"table-header"},sp={key:0,class:"left flex-1"},ap={key:1,class:"left"},lp={class:"right flex"},cp={key:3,class:"table-no-data"},up=s.defineComponent({__name:"table",props:{init:Object},emits:["change"],setup(t,{expose:n,emit:r}){const o=A=>{const P={};for(const Y in A)if(Object.hasOwnProperty.call(A,Y)){const J=A[Y];Y.indexOf(".")>-1?dn(P,Y,J):P[Y]=J}return P},i=r,a=t,{proxy:l}=s.getCurrentInstance(),c=l.$route.path,u=Object.keys(l.$slots).filter(A=>["title","footer"].indexOf(A)===-1&&A.indexOf("form.")===-1),d=qd(a.init);let{url:f="",title:p,success:h,sort:m={},pk:g,noPage:y=null,batch:v=null,tabs:D=null,cache:w}=d;const C={page:d.page,limit:d.limit};d.add&&!d.add?.title&&(d.add.title="添加"),d.edit&&!d.edit?.title&&(d.edit.title="编辑");let B=d.search?100:0;B=B+(p!==!1||l.$slots.title?52:0),B=B+(d.page||l.$slots.footer?56:0),B=B+(d.cate?60:0);const k=`calc(var(--main-height) - 24px - ${B}px)`,E=s.ref(0),x=s.ref({}),V=s.ref(d.where),T=s.ref(!0),L=s.ref([]),R=s.ref(0),I=s.ref("暂无数据"),U=s.ref(0),G=s.ref({}),W=s.ref(null),K=(A,P)=>{C[A]=P,ge()},X=A=>{E.value=A,x.value=D[A].where,L.value=[],C.page=1,ge()},oe=A=>{i("change",{type:"nav",data:A}),ge("nav")},re=(A,P=!1)=>{P&&U.value++,G.value=A,C.page=1,ge("search")},ie=A=>{re(A)},ce=d.name,Q=No.table[ce];if(Q&&(C.page=Q.page||C.page,C.limit=Q.limit||C.limit,m=Q.sort||m,G.value=Q.searchWhere||G.value,V.value=Q.where||V.value,E.value=Q.tabsIndex||0),s.onBeforeUnmount(()=>{if(ce){const A=ce===!0?f:ce;if(!A)return;No.table[A]={page:C.page,limit:C.limit,sort:m.value,searchWhere:G.value,where:V.value,tabsIndex:E.value}}}),!y&&l.$route.query){const A=$go.query(l.$route.query);G.value=A.where||{},E.value=A.tabs||0}D&&(x.value=D[E.value].where),m=s.ref(m);const Be=s.ref(-1),ge=async(A="init",P=!1)=>{T.value=!0;const Y={...x.value,...V.value,...G.value},{data:J,count:be,msg:z}=await Kd({where:Y,page:C.page,limit:C.limit,sort:m.value,data:d.data,url:f,cache:w,cellFmt:St,pk:g,tree:d.tree});if(h&&h({data:J,count:be,msg:z}),z)return T.value=!1,I.value=z;L.value=J,R.value=be,T.value=!1},Je=(A=!0)=>L.value,Ge=(A=!0)=>{ge("reload",A)},Se=A=>A.indexOf("http")>-1||typeof A=="function"||A.indexOf("/")>-1?A:d.url+"/"+A,Ce=(A,P={},Y="")=>{if(Y=Y||d?.edit?.url,!Y)return $msg.warning("url 未定义");if(A&&(P[g]=A),d.apiBefore&&typeof d.apiBefore=="function"){const J=d.apiBefore(Y,P);if(J===!1)return;if(typeof J=="string")return $msg.error(J);typeof J=="object"&&(P=J)}$req.post(Se(Y),P,"处理中").then(J=>{J.code==0?(d.apiSuccess&&typeof d.apiSuccess=="function"&&d.apiSuccess("uniApi",P,Y),d.refresh!==!1&&ge(),$msg.success(J.msg)):$msg.error(J.msg)})},_e=(A,P=!1)=>{if(P!==!1)return m.value={},m.value[A]=P,ge();m.value[A]?m.value[A]==="asc"&&(P="desc"):P="asc",m.value={},P&&(m.value[A]=P),ge()},Me=s.computed(()=>L.value.filter(function(A){return A.ROW_ON})),nt=A=>{i("change",{type:"selection",data:A}),L.value.map(P=>{P.ROW_ON=A})},rt=(A,P)=>{typeof A.on=="function"?A.on(L.value[P],P):typeof A.on=="string"?Ye({action:A.on},P):Ye({action:A.on},P)},et=(A,P=-1,Y="")=>{P===-1&&(P=Be.value),P!==-1&&(L.value[P]={...L.value[P],...A},Y&&$msg.success(Y),Be.value=-1)},ot=(A,P,Y)=>{const J=Y.field;let be=Yt(L.value[P],J);if(!Td(L.value[P],J))return!1;let z=Se(d.edit.url);Y.edit&&typeof Y.edit=="string"?z=Y.edit:Y.type=="switch"&&Y.url&&(z=Y.url);const ee=d.edit?.data??{};if(d.edit?.fields&&d.edit.fields.forEach(he=>{ee[he]=L.value[P][he]}),ee[g]=L.value[P][g],ee[J]=Y.valueformat?Y.valueformat(A.value):A.value,typeof z=="function")return z(ee,P);let ae=$loading("修改中");$req.post(z,o(ee)).then(he=>{ae.close(),he.code==0?(L.value[P]=dn(L.value[P],J,A.value),$msg.success("修改成功"),d.apiSuccess&&d.apiSuccess("cellEdit",P,ee),d.editUpdateTable&&ge()):(L.value[P]=dn(L.value[P],J,be),$msg.error(he.msg))})},Re=s.ref([]),mt=A=>{const P=L.value[A].treePid,Y=Re.value;return P.filter(function(be){return Y.indexOf(be)!==-1}).length-P.length},He=A=>{if(!L.value[A]._isParent)return;const P=L.value[A].id,Y=Re.value.indexOf(P);Y>-1?Re.value.splice(Y,1):Re.value.push(P)},ze=s.ref(),Dt=s.ref(),St={};if(d.cols||(d.cols=[]),d.cols.forEach(A=>{A.type=="checkbox"&&!A.width&&(A.width=40)}),v&&v.map(A=>{A.action==="del"&&(A.title=A.title||"删除",A.confirm===void 0&&(A.confirm=!0))}),D&&v){let A=[];D.forEach((P,Y)=>{A[Y]=v.filter(J=>J.tab===Y||typeof J.tab=="object"&&J.tab.indexOf(Y)>-1||!J.hasOwnProperty("tab"))}),v=A}const jt=(A,P)=>{if(typeof A.btn=="function")return A.btn(P);let Y=A.btn.filter(J=>J.tab===void 0||J.tab===E.value||typeof J.tab=="object"&&J.tab.indexOf(E.value)>-1);return Y?.map(J=>{!J.title&&typeof J.action=="string"&&(J.title={del:"删除",edit:"编辑",detail:"详情"}[J.action]||"",J.action==="del"&&J.confirm===void 0&&(J.confirm="确定要删除本条数据吗"))}),Y},ue={};async function le(A){ue[A.url]?ue[A.url].push(A):ue[A.url]=[A]}d.cols?.forEach(async A=>{A.type=="cate"&&A.url&&le(A)}),d.search?.cols&&d.search.cols.forEach(async A=>{["selects","select"].indexOf(A.type)>-1&&typeof A.url=="string"&&le(A)}),d.add?.cols&&d.add.cols.forEach(async A=>{["selects","select"].indexOf(A.type)>-1&&typeof A.url=="string"&&le(A)}),d.edit?.cols&&d.edit.cols.forEach(async A=>{["selects","select"].indexOf(A.type)>-1&&typeof A.url=="string"&&le(A)});const ve=Object.keys(ue);ve?.length?ve.forEach(async(A,P)=>{let Y=await $req.post(A);ue[A].forEach(J=>{J.url=Y.data}),P===ve.length-1&&(ze.value=d.search,ge())}):(ze.value=d.search,ge());const Ee=s.ref({}),Ue=(A,P,Y)=>{Y.cols.forEach(J=>{if(J.slot&&typeof J.slot!="function"){let be=typeof J.slot=="string"?J.slot:"form.cols."+J.field;l.$slots[be]&&(J.slot=l.$slots[be])}}),Y.url=Se(Y.url),Ee.value={title:Y.title,width:Y.width,data:A,confirmButton:Y.confirmButton,form:{...Y,width:"100%",confirmButton:!1}},Be.value=P,W.value.show(Ee.value)},Ve=A=>{const{res:P,data:Y}=A;W.value.close();const J=Ee.value,be=L.value;P.code==0&&(J.form.success?J.form.success(Y,P.data):d.apiSuccess&&typeof d.apiSuccess=="function"&&d.apiSuccess("dialogSubmit",Y),Be.value>-1&&!d.tree&&!J.form.updateTable?be[Be.value]=So(be[Be.value],Y,{ROW_KEY:Math.random()}):d.refresh!==!1&&ge(),Be.value=-1)},Le=async A=>{if(A.confirm){let P=A.confirm;if(typeof P=="function"){if(P()!==!0)return}else if(typeof P!="string"&&(P="确定要执行"+A.title+"操作?"),await $confirm(P)!="confirm")return}if(A.action=="add"){let P={};d.add?.data&&typeof d.add?.data=="function"?P=d.add.data():d.add?.data&&typeof d.add?.data=="object"&&(P=d.add.data),Ue(P,-1,{...d.edit,...d.add})}else if(typeof A.action=="object"&&A.action.type=="csv")Jd(A.action.url,A.action.name||"数据",A.action.where||{},A.action.format||null);else if(typeof A.action=="object"&&A.action.api){A.action.data||(A.action.data={});const P={...x.value,...V.value,...G.value,...A.action.data};Ce(0,P,A.action.api)}else typeof A.action=="object"?Ue({},-1,A.action):typeof A.action=="function"&&A.action()},Ye=async(A,P,Y={})=>{let J=L.value;if(!(Y.before&&Y.before(J[P],A)===!1))if(typeof A.action=="string")if(A.action=="edit")Ue(J[P],P,d.edit);else if(A.action=="del"){if(!d?.del?.url)return $msg.warning("del.url 未定义");let be={};d?.tree&&(be={child:[...J[P]._child],childs:[...J[P]._childs]}),Ce(J[P][g],be,d.del.url)}else if(A.action.indexOf("/")>-1){const be=A.action.split("?"),z={},ee=J[P];be[1]?(A.action=be[0],be[1].split(",").forEach(he=>{z[he]=ee[he]})):z[g]=ee[g],$go.to(A.action,z)}else $msg.error("error");else if(typeof A.action=="object"&&A.action.api)typeof A.action.api!="string"&&(A.action.api=d.edit.url),Ce(J[P][g],A.action.data,A.action.api);else if(typeof A.action=="object"&&typeof A.action.form=="function"){const be=await A.action.form(J[P],P);if(be.form)return Ue(be.data,P,be.form);Ue(J[P],P,be)}else typeof A.action=="object"?Ue(J[P],P,A.action):typeof A.action=="function"&&A.action(J[P],P)},Te=s.ref(!1),Pe=(A=!0)=>{Te.value=A};s.watch(()=>l.$route.query,A=>{const P=l.$route.path;P!=c||!ze.value||(ze.value={...ze.value,spread:Dt.value?.spread},G.value=$go.query(A,"where"),C.page=No.table[P+"_page"]||1,U.value++,ge())});const xt={getData:Je,search:re,init:d,treeOn:Re,cellEdit:ot,cellClick:rt,rowEdit:et,onSort:_e,sort:m,fnTreeShow:mt,fnTreeOn:He,setPageStatus:Pe,checkAllChange:nt,navChange:oe,tabsChange:X,tableData:L,checkData:Me,reload:Ge,dialogForm:Ue,dialogSubmit:Ve,getCellTool:jt,rowAction:Ye,toolAction:Le,uniApi:Ce,pk:g};return s.provide("table",xt),n(xt),(A,P)=>{const Y=s.resolveComponent("el-empty"),J=s.resolveDirective("loading");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(af,{ref_key:"dialogRef",ref:W},null,512),s.createElementVNode("div",np,[s.unref(d).cate?(s.openBlock(),s.createBlock(df,{key:0})):s.createCommentVNode("",!0),s.unref(d).search&&!s.unref(ze)?(s.openBlock(),s.createElementBlock("div",rp)):s.createCommentVNode("",!0),s.unref(ze)?(s.openBlock(),s.createBlock(Ms,{ref_key:"searchRef",ref:Dt,key:s.unref(U),init:s.unref(ze),data:s.unref(G),onChange:ie,class:s.normalizeClass(["mb bg-main pt-lg pr-lg rounded-md",s.unref(d).serachClass])},null,8,["init","data","class"])):s.createCommentVNode("",!0),s.createElementVNode("div",op,[s.unref(d).title!==!1?(s.openBlock(),s.createElementBlock("div",ip,[A.$slots.title?(s.openBlock(),s.createElementBlock("div",sp,[s.renderSlot(A.$slots,"title")])):(s.openBlock(),s.createElementBlock("div",ap,s.toDisplayString(s.unref(p)),1)),s.createElementVNode("div",lp,[s.createVNode(Yf,{modelValue:s.unref(E),"onUpdate:modelValue":P[0]||(P[0]=be=>s.isRef(E)?E.value=be:null)},null,8,["modelValue"])])])):s.createCommentVNode("",!0),A.$slots.default?s.renderSlot(A.$slots,"default",{key:1,data:s.unref(L),height:k}):s.withDirectives((s.openBlock(),s.createBlock(Gf,{key:2,init:t.init,data:s.unref(L),height:k},s.createSlots({_:2},[s.renderList(s.unref(u),be=>({name:be,fn:s.withCtx(({row:z,key:ee})=>[s.renderSlot(A.$slots,be,{key:ee,row:z})])}))]),1032,["init","data"])),[[J,s.unref(T)]]),!s.unref(d).hideEmpty&&s.unref(L).length==0&&!s.unref(T)?(s.openBlock(),s.createElementBlock("div",cp,[s.createVNode(Y,{"image-size":120,description:s.unref(I)},null,8,["description"])])):s.createCommentVNode("",!0),C.page||A.$slots.footer?(s.openBlock(),s.createBlock(Qd,{key:4,onChange:K,disabled:s.unref(Te),count:s.unref(R),init:{page:s.unref(d).page,limit:s.unref(d).limit,pageSizes:s.unref(d).pageSizes}},{left:s.withCtx(()=>[s.renderSlot(A.$slots,"footer",{data:s.unref(L)})]),_:3},8,["disabled","count","init"])):s.createCommentVNode("",!0)]),s.createVNode(nf,{checkAllChange:nt,batch:s.unref(d).batch,tabs:s.unref(D),"tabs-index":s.unref(E),"check-data":s.unref(Me)},null,8,["batch","tabs","tabs-index","check-data"])])],64)}}}),dp={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])}}},fp={class:"input-with-select flex pr"},pp={class:"flex justify-center pl",title:"下拉选择"},hp={class:"flex justify-center pl",title:"下拉选择"},mp={key:0,class:"flex pr-sm"};function gp(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",fp,[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",pp,[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",hp,[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",mp,[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 yp=ne(dp,[["render",gp]]),bp={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)}}},Cp={class:""},vp={key:0,class:"pl-sm"};function Dp(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",Cp,s.toDisplayString(c.value),1),c.label?(s.openBlock(),s.createElementBlock("span",vp,s.toDisplayString(c.label),1)):s.createCommentVNode("",!0)]),_:1},8,["modelValue","fetch-suggestions","placeholder"])}const wp=ne(bp,[["render",Dp]]);function zs(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 Bp(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 xp(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 $s={},kp={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(`文件不能大于${xp(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=$s[r]||0;this.loadedSize=this.loadedSize+t.loaded-o,$s[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 Bp(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 zs(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}}},Ep={class:"flex-col justify-center w-full"},_p={class:""},Ap={class:""};function Sp(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",Ep,[s.createElementVNode("span",_p,s.toDisplayString(d)+"%",1),s.createElementVNode("span",Ap,s.toDisplayString(d==100?"验证文件":"上传中"),1)])]),_:1},8,["percentage"])):s.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}const Is=ne(kp,[["render",Sp],["__scopeId","data-v-02e2034c"]]),Np={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)})}}},Fp={class:"dir-list"},Vp={class:"title"},Op={key:0,style:{"margin-left":"-10px","margin-bottom":"10px"}},Tp={class:"item"},jp=["onClick"],Lp={class:"left"},Pp={key:0,class:"tool"},Mp=["onClick"],zp=["onClick"];function $p(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",Fp,[s.createElementVNode("div",Vp,[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",Op,[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",Tp,[(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",Lp,[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",Pp,[s.createElementVNode("span",{onClick:h=>a.cateEdit(p,f)},"编辑",8,Mp),s.createElementVNode("span",{onClick:h=>a.cateDel(p,f)},"删除",8,zp)])):s.createCommentVNode("",!0)],10,jp))),256))])]),_:1})),[[d,i.loading]])])}const Ip={name:"media-box",components:{BigUpload:Is,FileMenu:ne(Np,[["render",$p],["__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 zs(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)}}},Rp=["src"],Hp={class:"dialog-footer"},Up={class:"imgs-top flex justify-between pb-sm"},Wp={class:"flex text-3"},qp={key:1,class:"ml-xl flex"},Kp={class:"flex"},Jp={class:"mr"},Gp={key:0,class:"mr"},Yp={class:"mr"},Zp={class:"flex items-center"},Xp={class:"file-box-body"},Qp={class:"list"},eh={key:0,class:"no-file"},th={class:"add"},nh={key:0,class:"number"},rh={class:"box-bg"},oh=["onClick"],ih={key:0,class:"i-ri-eye-line"},sh={key:1,class:"i-ri-play-fill"},ah={key:4,class:"type-name"},lh={key:0,class:"i-ri-link pr-xs2"},ch=["title","onClick"],uh={class:"pages"};function dh(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",Hp,[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,Rp)):s.createCommentVNode("",!0)]),_:1},8,["modelValue","title"]),s.createElementVNode("div",Up,[s.createElementVNode("div",Wp,[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",qp,[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",Kp,[s.createElementVNode("div",Jp,[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",Gp,[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",Yp,[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",Zp,[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",Xp,[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",Qp,[i.list.length==0?(s.openBlock(),s.createElementBlock("div",eh,[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",th,[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,E)=>(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",nh,s.toDisplayString(i.onList.indexOf(k.id)+1),1)):s.createCommentVNode("",!0),s.createElementVNode("div",rh,[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",ih)):(s.openBlock(),s.createElementBlock("i",sh))],8,oh)):s.createCommentVNode("",!0),k.file_type?(s.openBlock(),s.createElementBlock("div",ah,[k.url?.startsWith("http")?(s.openBlock(),s.createElementBlock("span",lh)):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(E,k)},[s.createElementVNode("span",null,s.toDisplayString(k.name||"未命名"),1)],8,ch)],2)]),_:2},1024))),256))]),_:1})])]),s.createElementVNode("div",uh,[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=ne(Ip,[["render",dh],["__scopeId","data-v-b3f1b2c2"]]),fh={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}}},ph={class:"dialog-footer"},hh={class:"input-imgs"},mh=["onClick"],gh={class:"text-12px pt-xs op-50"},yh={key:0,class:"pl-sm color-primary"};function bh(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",ph,[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",hh,[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,mh),[[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",gh,[s.createTextVNode("拖拽可调整图片顺序,最多可上传"+s.toDisplayString(r.limit)+"张",1),r.tips?(s.openBlock(),s.createElementBlock("span",yh,"("+s.toDisplayString(r.tips)+")",1)):s.createCommentVNode("",!0)],512),[[s.vShow,!i._disabled]])])],64)}const Rs=ne(fh,[["render",bh],["__scopeId","data-v-8f11d9a0"]]),Ch={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)}}},vh={class:"input-button"};function Dh(t,n,r,o,i,a){const l=s.resolveComponent("el-input"),c=s.resolveComponent("el-button");return s.openBlock(),s.createElementBlock("div",vh,[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 Fo=ne(Ch,[["render",Dh]]),wh={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)}}},Bh={class:"list"},xh={class:"py"},kh=["onClick"];function Eh(t,n,r,o,i,a){const l=s.resolveComponent("el-col"),c=s.resolveComponent("el-row");return s.openBlock(),s.createElementBlock("div",Bh,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.list,(u,d)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",xh,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,kh)]),_:2},1024))),256))]),_:2},1024)],64))),256))])}const _h=ne(wh,[["render",Eh],["__scopeId","data-v-bf3f41e0"]]),Ah={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}}},Sh={style:{"--main-height":"calc(75vh + 36px)"}};function Nh(t,n,r,o,i,a){const l=s.resolveComponent("el-button"),c=s.resolveComponent("admin-table");return s.openBlock(),s.createElementBlock("div",Sh,[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 Fh=ne(Ah,[["render",Nh]]),Vh={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 Oh(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 Th=ne(Vh,[["render",Oh]]),jh={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}}},Lh={style:{"--main-height":"calc(75vh + 36px)"}};function Ph(t,n,r,o,i,a){const l=s.resolveComponent("el-button"),c=s.resolveComponent("admin-table");return s.openBlock(),s.createElementBlock("div",Lh,[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 Mh=ne(jh,[["render",Ph]]),zh={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)}}},$h={class:"pxl mxl flex justify-center"},Ih={style:{width:"500px"}};function Rh(t,n,r,o,i,a){const l=s.resolveComponent("el-input");return s.openBlock(),s.createElementBlock("div",$h,[s.createElementVNode("div",Ih,[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 Hh={name:"url-box",emits:["change"],components:{Base:_h,Goods:Fh,GoodsCate:Th,Article:Mh,Diy:ne(zh,[["render",Rh]])},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)}}},Uh={class:""},Wh={class:"pl-xs"};function qh(t,n,r,o,i,a){const l=s.resolveComponent("el-tab-pane"),c=s.resolveComponent("el-tabs");return s.openBlock(),s.createElementBlock("div",Uh,[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",Wh,[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 Hs=ne(Hh,[["render",qh]]),Kh={components:{inputButton:Fo,urlBox:Hs},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}}},Jh={style:{height:"75vh"}},Gh={class:"dialog-footer flex justify-end"},Yh={key:0,class:"pr"};function Zh(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",Gh,[a.url?(s.openBlock(),s.createElementBlock("div",Yh,[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",Jh,[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 Xh=ne(Kh,[["render",Zh]]),Qh={components:{mediaBox:lr,BigUpload:Is},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,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()}}},e0={class:"dialog-footer"},t0={key:2,class:"i-ri-image-add-line size-30%"},n0={class:"input-button"},r0={key:0,class:"mt flex"},o0={key:0,controls:"",style:{height:"160px",width:"240px"}},i0=["src"],s0={key:1,controls:"",class:"h-60px w-240px"},a0=["src"],l0={key:2};function c0(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",e0,[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",t0))],4)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("div",n0,[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)=>a.fndel&&a.fndel(...h),["stop"])),class:"i-ri-delete-bin-7-line click 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",r0,[i.fileType=="video"?(s.openBlock(),s.createElementBlock("video",o0,[s.createElementVNode("source",{src:t.$fileUrl(i.value)},null,8,i0),s.createTextVNode(" 浏览器不支持此"+s.toDisplayString(a.typeName),1)])):i.fileType=="audio"?(s.openBlock(),s.createElementBlock("audio",s0,[s.createElementVNode("source",{src:t.$fileUrl(i.value)},null,8,a0),s.createTextVNode(" 浏览器不支持此"+s.toDisplayString(a.typeName),1)])):(s.openBlock(),s.createElementBlock("div",l0,[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 u0=ne(Qh,[["render",c0]]);let Vo=!1;const d0={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(),Vo.close(),t.code==0?(this.value=t.data,this.$emit("update:modelValue",this.value),this.$msg.success("上传成功")):this.$msg.error(t.msg)},beforeUpload(t){Vo=this.$loading("上传中")},onError(t){return Vo.close(),this.$msg.error("上传失败")},onProgress(t){this.percent=parseInt(t.percent)}}},f0={class:"input-button"},p0={key:0,class:"mt-sm"};function h0(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",f0,[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",p0,[s.createVNode(d,{percentage:i.percent},null,8,["percentage"])])):s.createCommentVNode("",!0)],64)}const m0=ne(d0,[["render",h0]]),g0={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 y0(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 b0=ne(g0,[["render",y0]]),C0={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.list=[],this.$msg.info(t.msg||"没有相关搜索结果"),this.errorStatus=!0)})}}},v0={class:"search-box"},D0={key:0,class:"search-box-no-msg"},w0={class:"search-box-list max-w-800px flex gap-sm flex-wrap mx-auto"},B0=["onClick"],x0={class:"flex psm"},k0={class:"flex flex-col flex-1"},E0={key:0,class:"line-clamp-2"},_0={class:"color-error pt-xs"};function A0(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",v0,[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",D0,s.toDisplayString(i.error),1)):s.createCommentVNode("",!0),s.createElementVNode("div",w0,[(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))] leading-tight",i.current==d[i.pk]?"on":""]),onClick:p=>a.fnClick(d)},[s.renderSlot(t.$slots,"item",{item:d},()=>[s.createElementVNode("div",x0,[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",k0,[d[t.titleName]?(s.openBlock(),s.createElementBlock("span",E0,s.toDisplayString(d[t.titleName]),1)):s.createCommentVNode("",!0),s.createElementVNode("span",_0,"ID:"+s.toDisplayString(d[i.pk]),1)])])],!0)],10,B0))),256))])]),_:3})])}const S0={components:{inBox:ne(C0,[["render",A0],["__scopeId","data-v-ddd88d80"]])},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("没有选择数据")}}},N0={class:"h-60vh w-full"},F0={class:"dialog-footer flex justify-end"},V0={key:0,class:"pr"},O0={key:0,class:"mt-sm"},T0={class:"flex-inline leading-none border rounded-xs pd"},j0={key:0,class:"mr"},L0={class:"flex-col"},P0={key:0,class:"line-clamp-2 pb-sm"},M0={key:1,class:"color-error"};function z0(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",F0,[i.showValue?(s.openBlock(),s.createElementBlock("div",V0,[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",N0,[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",O0,[s.renderSlot(t.$slots,"info",{data:i.showData},()=>[s.createElementVNode("div",T0,[i.showData[i.imgName]?(s.openBlock(),s.createElementBlock("div",j0,[s.createVNode(p,{class:"size-36px",fit:"cover",preview:!1,src:i.showData[i.imgName]},null,8,["src"])])):s.createCommentVNode("",!0),s.createElementVNode("div",L0,[i.showData[i.titleName]?(s.openBlock(),s.createElementBlock("div",P0,s.toDisplayString(i.showData[i.titleName]),1)):s.createCommentVNode("",!0),i.showData[i.pk]?(s.openBlock(),s.createElementBlock("div",M0,"ID:"+s.toDisplayString(i.showData[i.pk]),1)):s.createCommentVNode("",!0)])])])])):s.createCommentVNode("",!0)],64)}const Us=ne(S0,[["render",z0]]);var Oo;typeof global>"u"?("ActiveXObject"in window&&console.error(`抱歉,wangEditor V5+ 版本开始,不在支持 IE 浏览器
1
+ (function(at,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("@vueuse/core"),require("echarts")):typeof define=="function"&&define.amd?define(["exports","vue","es-toolkit","element-plus","alova","@alova/adapter-xhr","number-precision","@vueuse/core","echarts"],s):(at=typeof globalThis<"u"?globalThis:at||self,s(at.AdminUi={},at.vue,at.esToolkit,at.elementPlus,at.alova,at.adapterXhr,at.np,at.core,at.echarts))})(this,(function(at,s,yo,we,sr,id,sd,bo,ad){"use strict";function ld(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 Co=ld(ad);function cd(t){return Number.isSafeInteger(t)&&t>=0}function ud(t){return t!=null&&typeof t!="function"&&cd(t.length)}function Tn(t){return t==="__proto__"}function Es(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}function vo(t){return typeof t=="string"||typeof t=="symbol"?t:Object.is(t?.valueOf?.(),-0)?"-0":String(t)}function _s(t){if(t==null)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(_s).join(",");const n=String(t);return n==="0"&&Object.is(Number(t),-0)?"-0":n}function Do(t){if(Array.isArray(t))return t.map(vo);if(typeof t=="symbol")return[t];t=_s(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?Es(n)?Yt(t,Do(n),r):r:o}case"number":case"symbol":{typeof n=="number"&&(n=vo(n));const o=t[n];return o===void 0?r:o}default:{if(Array.isArray(n))return dd(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 dd(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 As(t){return t!==null&&(typeof t=="object"||typeof t=="function")}function wo(t){return t==null||typeof t!="object"&&typeof t!="function"}function fd(t,n){return t===n||Number.isNaN(t)&&Number.isNaN(n)}function Ss(t){return Object.getOwnPropertySymbols(t).filter(n=>Object.prototype.propertyIsEnumerable.call(t,n))}function Bo(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const pd="[object RegExp]",Ns="[object String]",Fs="[object Number]",Vs="[object Boolean]",Os="[object Arguments]",hd="[object Symbol]",md="[object Date]",gd="[object Map]",yd="[object Set]",bd="[object Array]",Cd="[object ArrayBuffer]",Ts="[object Object]",vd="[object DataView]",Dd="[object Uint8Array]",wd="[object Uint8ClampedArray]",Bd="[object Uint16Array]",xd="[object Uint32Array]",kd="[object Int8Array]",Ed="[object Int16Array]",_d="[object Int32Array]",Ad="[object Float32Array]",Sd="[object Float64Array]";function xo(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Nd(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(wo(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(xo(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),kt(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),kt(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),kt(l,t,r,o,i),l}if(t instanceof Error){const l=structuredClone(t);return o.set(t,l),l.message=t.message,l.name=t.name,l.stack=t.stack,l.cause=t.cause,l.constructor=t.constructor,kt(l,t,r,o,i),l}if(t instanceof Boolean){const l=new Boolean(t.valueOf());return o.set(t,l),kt(l,t,r,o,i),l}if(t instanceof Number){const l=new Number(t.valueOf());return o.set(t,l),kt(l,t,r,o,i),l}if(t instanceof String){const l=new String(t.valueOf());return o.set(t,l),kt(l,t,r,o,i),l}if(typeof t=="object"&&Fd(t)){const l=Object.create(Object.getPrototypeOf(t));return o.set(t,l),kt(l,t,r,o,i),l}return t}function kt(t,n,r=t,o,i){const a=[...Object.keys(n),...Ss(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 Fd(t){switch(Bo(t)){case Os:case bd:case Cd:case vd:case Vs:case md:case Ad:case Sd:case kd:case Ed:case _d:case gd:case Fs:case Ts:case pd:case yd:case Ns:case hd:case Dd:case wd:case Bd:case xd:return!0;default:return!1}}function Vd(t,n){return Nd(t,(r,o,i,a)=>{if(typeof t=="object"){if(Bo(t)===Ts&&typeof t.constructor!="function"){const l={};return a.set(t,l),kt(l,t,i,a),l}switch(Object.prototype.toString.call(t)){case Fs:case Ns:case Vs:{const l=new t.constructor(t?.valueOf());return kt(l,t),l}case Os:{const l={};return kt(l,t),l.length=t.length,l[Symbol.iterator]=t[Symbol.iterator],l}default:return}}})}function js(t){return Vd(t)}const Od=/^(?:0|[1-9]\d*)$/;function Ls(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 Od.test(t)}}function ko(t){return t!==null&&typeof t=="object"&&Bo(t)==="[object Arguments]"}function Td(t,n){let r;if(Array.isArray(n)?r=n:typeof n=="string"&&Es(n)&&t?.[n]==null?r=Do(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)||ko(o))&&Ls(a)&&a<o.length))return!1;o=o[a]}return!0}function Eo(t){return typeof t=="object"&&t!==null}function jd(t){return Eo(t)&&ud(t)}function Ld(t){return typeof t=="symbol"||t instanceof Symbol}const Pd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Md=/^\w*$/;function zd(t,n){return Array.isArray(t)?!1:typeof t=="number"||typeof t=="boolean"||t==null||Ld(t)?!0:typeof t=="string"&&(Md.test(t)||!Pd.test(t))||n!=null&&Object.hasOwn(n,t)}const $d=(t,n,r)=>{const o=t[n];(!(Object.hasOwn(t,n)&&fd(o,r))||r===void 0&&!(n in t))&&(t[n]=r)};function Id(t,n,r,o){if(t==null&&!As(t))return t;let i;zd(n,t)?i=[n]:Array.isArray(n)?i=n:i=Do(n);const a=r(Yt(t,i));let l=t;for(let c=0;c<i.length&&l!=null;c++){const u=vo(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:As(f)?f:Ls(i[c+1])?[]:{}}$d(l,u,d),l=l[u]}return t}function dn(t,n,r){return Id(t,n,()=>r,()=>{})}function Rd(){}function _o(t){return xo(t)}function Ao(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 Hd(t){if(wo(t))return t;if(Array.isArray(t)||xo(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const n=Object.getPrototypeOf(t);if(n==null)return Object.assign(Object.create(n),t);const 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){let o;return t instanceof AggregateError?o=new r(t.errors,t.message,{cause:t.cause}):o=new r(t.message,{cause:t.cause}),o.stack=t.stack,Object.assign(o,t),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 Ud(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(wo(t)&&(t=Object(t)),n==null||typeof n!="object")return t;if(o.has(n))return Hd(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),...Ss(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(ko(c)&&(c={...c}),ko(u)&&(u={...u}),typeof Buffer<"u"&&Buffer.isBuffer(c)&&(c=js(c)),Array.isArray(c))if(Array.isArray(u)){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 if(jd(u)){const f=[];for(let p=0;p<u.length;p++)f[p]=u[p];u=f}else u=[];const d=r(u,c,l,t,n,o);d!==void 0?t[l]=d:Array.isArray(c)||Eo(u)&&Eo(c)&&(Ao(u)||Ao(c)||_o(u)||_o(c))?t[l]=ar(u,c,r,o):u==null&&Ao(c)?t[l]=ar({},c,r,o):u==null&&_o(c)?t[l]=js(c):(u===void 0||c!==void 0)&&(t[l]=c)}return t}function So(t,...n){return Ud(t,...n,Rd)}const Wd=(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};s.reactive({table:{},limit:10,page:1,pageSizes:[],tree:!1}),s.reactive({limit:10,page:1});function qd(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 Kd(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=Wd(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 Jd=(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)})}},ne=(t,n)=>{const r=t.__vccOpts||t;for(const[o,i]of n)r[o]=i;return r},Gd={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)}}}},Yd={class:"table-footer"},Zd={key:0};function Xd(t,n,r,o,i,a){const l=s.resolveComponent("el-pagination");return s.openBlock(),s.createElementBlock("div",Yd,[s.createElementVNode("div",null,[s.renderSlot(t.$slots,"left")]),r.init.page?(s.openBlock(),s.createElementBlock("div",Zd,[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 Qd=ne(Gd,[["render",Xd]]),ef={key:0,class:"table-tool-footer"},tf={class:"color-primary"},nf={__name:"tableBatch",props:{checkAllChange:Function,batch:Array,tabs:Array,tabsIndex:Number,table:Object},setup(t){const{checkData:n,uniApi:r,config:o,pk:i}=s.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",ef,[s.createElementVNode("div",null,[c[2]||(c[2]=s.createTextVNode(" 已选择 ",-1)),s.createElementVNode("span",tf,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)}}},rf={key:1,style:{"margin-bottom":"-12px","margin-top":"-6px"},id:"table-form-header"},of={class:"overflow-hidden"},sf={class:"dialog-footer"},af=s.defineComponent({__name:"tableDialog",setup(t,{expose:n}){const r=s.inject("table"),o=s.ref(!1),i=s.ref({}),a=s.ref($config?.form?.btnText??"提交"),l=s.ref(0),c=s.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",rf))]),footer:s.withCtx(()=>[s.createElementVNode("span",sf,[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",of,[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"])}}}),lf={key:0,class:"cate-search bg-main pl pb mb-xs"},cf={class:"flex-center pt"},uf={class:"label px-sm"},df=s.defineComponent({__name:"tableNav",setup(t){const n=s.ref({}),{init:r,navChange:o}=s.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",lf,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(r).cate.cols,u=>(s.openBlock(),s.createElementBlock("div",cf,[s.createElementVNode("div",uf,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)}}}),ff={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})}}},pf={style:{cursor:"pointer",color:"#0D84FF"},class:"flex"},hf={style:{"text-align":"center"}},mf=["onClick"];function gf(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",hf,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,mf))]),_:2},1024)):s.createCommentVNode("",!0)],64))),256))]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",pf,[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 yf=ne(ff,[["render",gf]]),bf={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}},Cf={class:"flex py-sm leading-tight max-w-200px"},vf={class:"flex-col ml-sm flex-1 overflow-hidden"},Df={class:"font-md line-1"},wf={style:{color:"#F56C6C"}},Bf={key:1,class:"flex-col ml-sm"},xf={class:"font-md op-70"};function kf(t,n,r,o,i,a){const l=s.resolveComponent("a-image");return s.openBlock(),s.createElementBlock("div",Cf,[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",vf,[s.createElementVNode("div",Df,s.toDisplayString(r.data[i.titleName]),1),s.createElementVNode("div",wf,"ID:"+s.toDisplayString(r.data[i.pk]),1)])],64)):(s.openBlock(),s.createElementBlock("div",Bf,[s.createElementVNode("div",xf,s.toDisplayString(r.init?.error||"数据不存在"),1)]))])}const Ps=ne(bf,[["render",kf]]),Ef={components:{Tool:yf,imgInfo:Ps},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=s.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}}},_f={key:1,class:"pl"},Af={key:1},Sf={key:0,class:"tags"},Nf={key:0,class:"table-goods flex py-xs"},Ff={class:"flex-col ml-sm flex-1 overflow-hidden",style:{}},Vf={class:"line-1"},Of={class:"text-color-regular"},Tf={class:"color-danger"};function jf(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",_f)),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",Af,"无"))],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",Sf,[(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",Nf,[s.createVNode(f,{height:"60px",width:"60px",lazy:"",fit:"cover",preview:!1,src:i.value.head_img},null,8,["src"]),s.createElementVNode("div",Ff,[s.createElementVNode("div",Vf,s.toDisplayString(i.value.title),1),s.createElementVNode("div",Of,"价格:"+s.toDisplayString(i.value.price),1),s.createElementVNode("div",Tf,"商品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 Lf=ne(Ef,[["render",jf]]),Pf={class:"table-main table-fixed border-collapse",cellspacing:"0",cellpadding:"0"},Mf=["width"],zf={key:0},$f={class:"cell line-1"},If={key:0},Rf=["onClick"],Hf={class:"sort"},Uf={key:0,class:"text-3 pl-sm",style:{color:"var(--el-color-info)"}},Wf={key:0,class:"cols-tool"},qf=["colspan"],Kf={class:"cols-tool-main"},Jf=["onClick"],Gf={__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",Pf,[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,Mf))),256))]),t.init.header!==!1?(s.openBlock(),s.createElementBlock("thead",zf,[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",$f,[y.type=="checkbox"?(s.openBlock(),s.createElementBlock("div",If,[(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",Hf,[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,Rf)):(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",Uf,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",Wf,[s.createElementVNode("td",{colspan:d.value.length},[s.createElementVNode("div",Kf,[s.renderSlot(p.$slots,"colsTool",{key:v,row:y})])],8,qf)])):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(Lf,{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,Jf)],2))),256)):s.createCommentVNode("",!0)],2)],64))),128))],2)])]),_:3},8,["max-height"])}}},Yf=s.defineComponent({__name:"tableTabs",props:{modelValue:Number},setup(t){const n=s.ref(t.modelValue),{init:r,tabsChange:o,toolAction:i}=s.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)}}}),Zf={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,this.sum=this.init.cols.length;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.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)}}},Xf={key:1,class:"flex-col text-right line-height"},Qf={class:"op-70 text-3 pt-xs line-2"},ep={class:""};function tp(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",Xf,[s.createElementVNode("span",null,s.toDisplayString(m.title),1),s.createElementVNode("span",Qf,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",ep,[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 Ms=ne(Zf,[["render",tp]]),No={table:{}},np={class:"admin-table-page"},rp={key:1,class:"mb bg-main h-19"},op={class:"admin-table rounded-md"},ip={key:0,class:"table-header"},sp={key:0,class:"left flex-1"},ap={key:1,class:"left"},lp={class:"right flex"},cp={key:3,class:"table-no-data"},up=s.defineComponent({__name:"table",props:{init:Object},emits:["change"],setup(t,{expose:n,emit:r}){const o=A=>{const P={};for(const Y in A)if(Object.hasOwnProperty.call(A,Y)){const J=A[Y];Y.indexOf(".")>-1?dn(P,Y,J):P[Y]=J}return P},i=r,a=t,{proxy:l}=s.getCurrentInstance(),c=l.$route.path,u=Object.keys(l.$slots).filter(A=>["title","footer"].indexOf(A)===-1&&A.indexOf("form.")===-1),d=qd(a.init);let{url:f="",title:p,success:h,sort:m={},pk:g,noPage:y=null,batch:v=null,tabs:D=null,cache:w}=d;const C={page:d.page,limit:d.limit};d.add&&!d.add?.title&&(d.add.title="添加"),d.edit&&!d.edit?.title&&(d.edit.title="编辑");let B=d.search?100:0;B=B+(p!==!1||l.$slots.title?52:0),B=B+(d.page||l.$slots.footer?56:0),B=B+(d.cate?60:0);const k=`calc(var(--main-height) - 24px - ${B}px)`,E=s.ref(0),x=s.ref({}),V=s.ref(d.where),T=s.ref(!0),L=s.ref([]),R=s.ref(0),I=s.ref("暂无数据"),U=s.ref(0),G=s.ref({}),W=s.ref(null),K=(A,P)=>{C[A]=P,ge()},X=A=>{E.value=A,x.value=D[A].where,L.value=[],C.page=1,ge()},oe=A=>{i("change",{type:"nav",data:A}),ge("nav")},re=(A,P=!1)=>{P&&U.value++,G.value=A,C.page=1,ge("search")},ie=A=>{re(A)},ce=d.name,Q=No.table[ce];if(Q&&(C.page=Q.page||C.page,C.limit=Q.limit||C.limit,m=Q.sort||m,G.value=Q.searchWhere||G.value,V.value=Q.where||V.value,E.value=Q.tabsIndex||0),s.onBeforeUnmount(()=>{if(ce){const A=ce===!0?f:ce;if(!A)return;No.table[A]={page:C.page,limit:C.limit,sort:m.value,searchWhere:G.value,where:V.value,tabsIndex:E.value}}}),!y&&l.$route.query){const A=$go.query(l.$route.query);G.value=A.where||{},E.value=A.tabs||0}D&&(x.value=D[E.value].where),m=s.ref(m);const Be=s.ref(-1),ge=async(A="init",P=!1)=>{T.value=!0;const Y={...x.value,...V.value,...G.value},{data:J,count:be,msg:z}=await Kd({where:Y,page:C.page,limit:C.limit,sort:m.value,data:d.data,url:f,cache:w,cellFmt:St,pk:g,tree:d.tree});if(h&&h({data:J,count:be,msg:z}),z)return T.value=!1,I.value=z;L.value=J,R.value=be,T.value=!1},Je=(A=!0)=>L.value,Ge=(A=!0)=>{ge("reload",A)},Se=A=>A.indexOf("http")>-1||typeof A=="function"||A.indexOf("/")>-1?A:d.url+"/"+A,Ce=(A,P={},Y="")=>{if(Y=Y||d?.edit?.url,!Y)return $msg.warning("url 未定义");if(A&&(P[g]=A),d.apiBefore&&typeof d.apiBefore=="function"){const J=d.apiBefore(Y,P);if(J===!1)return;if(typeof J=="string")return $msg.error(J);typeof J=="object"&&(P=J)}$req.post(Se(Y),P,"处理中").then(J=>{J.code==0?(d.apiSuccess&&typeof d.apiSuccess=="function"&&d.apiSuccess("uniApi",P,Y),d.refresh!==!1&&ge(),$msg.success(J.msg)):$msg.error(J.msg)})},_e=(A,P=!1)=>{if(P!==!1)return m.value={},m.value[A]=P,ge();m.value[A]?m.value[A]==="asc"&&(P="desc"):P="asc",m.value={},P&&(m.value[A]=P),ge()},Me=s.computed(()=>L.value.filter(function(A){return A.ROW_ON})),nt=A=>{i("change",{type:"selection",data:A}),L.value.map(P=>{P.ROW_ON=A})},rt=(A,P)=>{typeof A.on=="function"?A.on(L.value[P],P):typeof A.on=="string"?Ye({action:A.on},P):Ye({action:A.on},P)},et=(A,P=-1,Y="")=>{P===-1&&(P=Be.value),P!==-1&&(L.value[P]={...L.value[P],...A},Y&&$msg.success(Y),Be.value=-1)},ot=(A,P,Y)=>{const J=Y.field;let be=Yt(L.value[P],J);if(!Td(L.value[P],J))return!1;let z=Se(d.edit.url);Y.edit&&typeof Y.edit=="string"?z=Y.edit:Y.type=="switch"&&Y.url&&(z=Y.url);const ee=d.edit?.data??{};if(d.edit?.fields&&d.edit.fields.forEach(he=>{ee[he]=L.value[P][he]}),ee[g]=L.value[P][g],ee[J]=Y.valueformat?Y.valueformat(A.value):A.value,typeof z=="function")return z(ee,P);let ae=$loading("修改中");$req.post(z,o(ee)).then(he=>{ae.close(),he.code==0?(L.value[P]=dn(L.value[P],J,A.value),$msg.success("修改成功"),d.apiSuccess&&d.apiSuccess("cellEdit",P,ee),d.editUpdateTable&&ge()):(L.value[P]=dn(L.value[P],J,be),$msg.error(he.msg))})},Re=s.ref([]),mt=A=>{const P=L.value[A].treePid,Y=Re.value;return P.filter(function(be){return Y.indexOf(be)!==-1}).length-P.length},He=A=>{if(!L.value[A]._isParent)return;const P=L.value[A].id,Y=Re.value.indexOf(P);Y>-1?Re.value.splice(Y,1):Re.value.push(P)},ze=s.ref(),Dt=s.ref(),St={};if(d.cols||(d.cols=[]),d.cols.forEach(A=>{A.type=="checkbox"&&!A.width&&(A.width=40)}),v&&v.map(A=>{A.action==="del"&&(A.title=A.title||"删除",A.confirm===void 0&&(A.confirm=!0))}),D&&v){let A=[];D.forEach((P,Y)=>{A[Y]=v.filter(J=>J.tab===Y||typeof J.tab=="object"&&J.tab.indexOf(Y)>-1||!J.hasOwnProperty("tab"))}),v=A}const jt=(A,P)=>{if(typeof A.btn=="function")return A.btn(P);let Y=A.btn.filter(J=>J.tab===void 0||J.tab===E.value||typeof J.tab=="object"&&J.tab.indexOf(E.value)>-1);return Y?.map(J=>{!J.title&&typeof J.action=="string"&&(J.title={del:"删除",edit:"编辑",detail:"详情"}[J.action]||"",J.action==="del"&&J.confirm===void 0&&(J.confirm="确定要删除本条数据吗"))}),Y},ue={};async function le(A){ue[A.url]?ue[A.url].push(A):ue[A.url]=[A]}d.cols?.forEach(async A=>{A.type=="cate"&&A.url&&le(A)}),d.search?.cols&&d.search.cols.forEach(async A=>{["selects","select"].indexOf(A.type)>-1&&typeof A.url=="string"&&le(A)}),d.add?.cols&&d.add.cols.forEach(async A=>{["selects","select"].indexOf(A.type)>-1&&typeof A.url=="string"&&le(A)}),d.edit?.cols&&d.edit.cols.forEach(async A=>{["selects","select"].indexOf(A.type)>-1&&typeof A.url=="string"&&le(A)});const ve=Object.keys(ue);ve?.length?ve.forEach(async(A,P)=>{let Y=await $req.post(A);ue[A].forEach(J=>{J.url=Y.data}),P===ve.length-1&&(ze.value=d.search,ge())}):(ze.value=d.search,ge());const Ee=s.ref({}),Ue=(A,P,Y)=>{Y.cols.forEach(J=>{if(J.slot&&typeof J.slot!="function"){let be=typeof J.slot=="string"?J.slot:"form.cols."+J.field;l.$slots[be]&&(J.slot=l.$slots[be])}}),Y.url=Se(Y.url),Ee.value={title:Y.title,width:Y.width,data:A,confirmButton:Y.confirmButton,form:{...Y,width:"100%",confirmButton:!1}},Be.value=P,W.value.show(Ee.value)},Ve=A=>{const{res:P,data:Y}=A;W.value.close();const J=Ee.value,be=L.value;P.code==0&&(J.form.success?J.form.success(Y,P.data):d.apiSuccess&&typeof d.apiSuccess=="function"&&d.apiSuccess("dialogSubmit",Y),Be.value>-1&&!d.tree&&!J.form.updateTable?be[Be.value]=So(be[Be.value],Y,{ROW_KEY:Math.random()}):d.refresh!==!1&&ge(),Be.value=-1)},Le=async A=>{if(A.confirm){let P=A.confirm;if(typeof P=="function"){if(P()!==!0)return}else if(typeof P!="string"&&(P="确定要执行"+A.title+"操作?"),await $confirm(P)!="confirm")return}if(A.action=="add"){let P={};d.add?.data&&typeof d.add?.data=="function"?P=d.add.data():d.add?.data&&typeof d.add?.data=="object"&&(P=d.add.data),Ue(P,-1,{...d.edit,...d.add})}else if(typeof A.action=="object"&&A.action.type=="csv")Jd(A.action.url,A.action.name||"数据",A.action.where||{},A.action.format||null);else if(typeof A.action=="object"&&A.action.api){A.action.data||(A.action.data={});const P={...x.value,...V.value,...G.value,...A.action.data};Ce(0,P,A.action.api)}else typeof A.action=="object"?Ue({},-1,A.action):typeof A.action=="function"&&A.action()},Ye=async(A,P,Y={})=>{let J=L.value;if(!(Y.before&&Y.before(J[P],A)===!1))if(typeof A.action=="string")if(A.action=="edit")Ue(J[P],P,d.edit);else if(A.action=="del"){if(!d?.del?.url)return $msg.warning("del.url 未定义");let be={};d?.tree&&(be={child:[...J[P]._child],childs:[...J[P]._childs]}),Ce(J[P][g],be,d.del.url)}else if(A.action.indexOf("/")>-1){const be=A.action.split("?"),z={},ee=J[P];be[1]?(A.action=be[0],be[1].split(",").forEach(he=>{z[he]=ee[he]})):z[g]=ee[g],$go.to(A.action,z)}else $msg.error("error");else if(typeof A.action=="object"&&A.action.api)typeof A.action.api!="string"&&(A.action.api=d.edit.url),Ce(J[P][g],A.action.data,A.action.api);else if(typeof A.action=="object"&&typeof A.action.form=="function"){const be=await A.action.form(J[P],P);if(be.form)return Ue(be.data,P,be.form);Ue(J[P],P,be)}else typeof A.action=="object"?Ue(J[P],P,A.action):typeof A.action=="function"&&A.action(J[P],P)},Te=s.ref(!1),Pe=(A=!0)=>{Te.value=A};s.watch(()=>l.$route.query,A=>{const P=l.$route.path;P!=c||!ze.value||(ze.value={...ze.value,spread:Dt.value?.spread},G.value=$go.query(A,"where"),C.page=No.table[P+"_page"]||1,U.value++,ge())});const xt={getData:Je,search:re,init:d,treeOn:Re,cellEdit:ot,cellClick:rt,rowEdit:et,onSort:_e,sort:m,fnTreeShow:mt,fnTreeOn:He,setPageStatus:Pe,checkAllChange:nt,navChange:oe,tabsChange:X,tableData:L,checkData:Me,reload:Ge,dialogForm:Ue,dialogSubmit:Ve,getCellTool:jt,rowAction:Ye,toolAction:Le,uniApi:Ce,pk:g};return s.provide("table",xt),n(xt),(A,P)=>{const Y=s.resolveComponent("el-empty"),J=s.resolveDirective("loading");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(af,{ref_key:"dialogRef",ref:W},null,512),s.createElementVNode("div",np,[s.unref(d).cate?(s.openBlock(),s.createBlock(df,{key:0})):s.createCommentVNode("",!0),s.unref(d).search&&!s.unref(ze)?(s.openBlock(),s.createElementBlock("div",rp)):s.createCommentVNode("",!0),s.unref(ze)?(s.openBlock(),s.createBlock(Ms,{ref_key:"searchRef",ref:Dt,key:s.unref(U),init:s.unref(ze),data:s.unref(G),onChange:ie,class:s.normalizeClass(["mb bg-main pt-lg pr-lg rounded-md",s.unref(d).serachClass])},null,8,["init","data","class"])):s.createCommentVNode("",!0),s.createElementVNode("div",op,[s.unref(d).title!==!1?(s.openBlock(),s.createElementBlock("div",ip,[A.$slots.title?(s.openBlock(),s.createElementBlock("div",sp,[s.renderSlot(A.$slots,"title")])):(s.openBlock(),s.createElementBlock("div",ap,s.toDisplayString(s.unref(p)),1)),s.createElementVNode("div",lp,[s.createVNode(Yf,{modelValue:s.unref(E),"onUpdate:modelValue":P[0]||(P[0]=be=>s.isRef(E)?E.value=be:null)},null,8,["modelValue"])])])):s.createCommentVNode("",!0),A.$slots.default?s.renderSlot(A.$slots,"default",{key:1,data:s.unref(L),height:k}):s.withDirectives((s.openBlock(),s.createBlock(Gf,{key:2,init:t.init,data:s.unref(L),height:k},s.createSlots({_:2},[s.renderList(s.unref(u),be=>({name:be,fn:s.withCtx(({row:z,key:ee})=>[s.renderSlot(A.$slots,be,{key:ee,row:z})])}))]),1032,["init","data"])),[[J,s.unref(T)]]),!s.unref(d).hideEmpty&&s.unref(L).length==0&&!s.unref(T)?(s.openBlock(),s.createElementBlock("div",cp,[s.createVNode(Y,{"image-size":120,description:s.unref(I)},null,8,["description"])])):s.createCommentVNode("",!0),C.page||A.$slots.footer?(s.openBlock(),s.createBlock(Qd,{key:4,onChange:K,disabled:s.unref(Te),count:s.unref(R),init:{page:s.unref(d).page,limit:s.unref(d).limit,pageSizes:s.unref(d).pageSizes}},{left:s.withCtx(()=>[s.renderSlot(A.$slots,"footer",{data:s.unref(L)})]),_:3},8,["disabled","count","init"])):s.createCommentVNode("",!0)]),s.createVNode(nf,{checkAllChange:nt,batch:s.unref(d).batch,tabs:s.unref(D),"tabs-index":s.unref(E),"check-data":s.unref(Me)},null,8,["batch","tabs","tabs-index","check-data"])])],64)}}}),dp={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])}}},fp={class:"input-with-select flex pr"},pp={class:"flex justify-center pl",title:"下拉选择"},hp={class:"flex justify-center pl",title:"下拉选择"},mp={key:0,class:"flex pr-sm"};function gp(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",fp,[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",pp,[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",hp,[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",mp,[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 yp=ne(dp,[["render",gp]]),bp={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)}}},Cp={class:""},vp={key:0,class:"pl-sm"};function Dp(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",Cp,s.toDisplayString(c.value),1),c.label?(s.openBlock(),s.createElementBlock("span",vp,s.toDisplayString(c.label),1)):s.createCommentVNode("",!0)]),_:1},8,["modelValue","fetch-suggestions","placeholder"])}const wp=ne(bp,[["render",Dp]]);function zs(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 Bp(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 xp(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 $s={},kp={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(`文件不能大于${xp(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=$s[r]||0;this.loadedSize=this.loadedSize+t.loaded-o,$s[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 Bp(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 zs(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}}},Ep={class:"flex-col justify-center w-full"},_p={class:""},Ap={class:""};function Sp(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",Ep,[s.createElementVNode("span",_p,s.toDisplayString(d)+"%",1),s.createElementVNode("span",Ap,s.toDisplayString(d==100?"验证文件":"上传中"),1)])]),_:1},8,["percentage"])):s.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}const Is=ne(kp,[["render",Sp],["__scopeId","data-v-02e2034c"]]),Np={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)})}}},Fp={class:"dir-list"},Vp={class:"title"},Op={key:0,style:{"margin-left":"-10px","margin-bottom":"10px"}},Tp={class:"item"},jp=["onClick"],Lp={class:"left"},Pp={key:0,class:"tool"},Mp=["onClick"],zp=["onClick"];function $p(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",Fp,[s.createElementVNode("div",Vp,[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",Op,[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",Tp,[(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",Lp,[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",Pp,[s.createElementVNode("span",{onClick:h=>a.cateEdit(p,f)},"编辑",8,Mp),s.createElementVNode("span",{onClick:h=>a.cateDel(p,f)},"删除",8,zp)])):s.createCommentVNode("",!0)],10,jp))),256))])]),_:1})),[[d,i.loading]])])}const Ip={name:"media-box",components:{BigUpload:Is,FileMenu:ne(Np,[["render",$p],["__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 zs(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)}}},Rp=["src"],Hp={class:"dialog-footer"},Up={class:"imgs-top flex justify-between pb-sm"},Wp={class:"flex text-3"},qp={key:1,class:"ml-xl flex"},Kp={class:"flex"},Jp={class:"mr"},Gp={key:0,class:"mr"},Yp={class:"mr"},Zp={class:"flex items-center"},Xp={class:"file-box-body"},Qp={class:"list"},eh={key:0,class:"no-file"},th={class:"add"},nh={key:0,class:"number"},rh={class:"box-bg"},oh=["onClick"],ih={key:0,class:"i-ri-eye-line"},sh={key:1,class:"i-ri-play-fill"},ah={key:4,class:"type-name"},lh={key:0,class:"i-ri-link pr-xs2"},ch=["title","onClick"],uh={class:"pages"};function dh(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",Hp,[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,Rp)):s.createCommentVNode("",!0)]),_:1},8,["modelValue","title"]),s.createElementVNode("div",Up,[s.createElementVNode("div",Wp,[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",qp,[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",Kp,[s.createElementVNode("div",Jp,[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",Gp,[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",Yp,[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",Zp,[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",Xp,[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",Qp,[i.list.length==0?(s.openBlock(),s.createElementBlock("div",eh,[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",th,[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,E)=>(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",nh,s.toDisplayString(i.onList.indexOf(k.id)+1),1)):s.createCommentVNode("",!0),s.createElementVNode("div",rh,[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",ih)):(s.openBlock(),s.createElementBlock("i",sh))],8,oh)):s.createCommentVNode("",!0),k.file_type?(s.openBlock(),s.createElementBlock("div",ah,[k.url?.startsWith("http")?(s.openBlock(),s.createElementBlock("span",lh)):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(E,k)},[s.createElementVNode("span",null,s.toDisplayString(k.name||"未命名"),1)],8,ch)],2)]),_:2},1024))),256))]),_:1})])]),s.createElementVNode("div",uh,[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=ne(Ip,[["render",dh],["__scopeId","data-v-b3f1b2c2"]]),fh={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}}},ph={class:"dialog-footer"},hh={class:"input-imgs"},mh=["onClick"],gh={class:"text-12px pt-xs op-50"},yh={key:0,class:"pl-sm color-primary"};function bh(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",ph,[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",hh,[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,mh),[[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",gh,[s.createTextVNode("拖拽可调整图片顺序,最多可上传"+s.toDisplayString(r.limit)+"张",1),r.tips?(s.openBlock(),s.createElementBlock("span",yh,"("+s.toDisplayString(r.tips)+")",1)):s.createCommentVNode("",!0)],512),[[s.vShow,!i._disabled]])])],64)}const Rs=ne(fh,[["render",bh],["__scopeId","data-v-8f11d9a0"]]),Ch={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)}}},vh={class:"input-button"};function Dh(t,n,r,o,i,a){const l=s.resolveComponent("el-input"),c=s.resolveComponent("el-button");return s.openBlock(),s.createElementBlock("div",vh,[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 Fo=ne(Ch,[["render",Dh]]),wh={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)}}},Bh={class:"list"},xh={class:"py"},kh=["onClick"];function Eh(t,n,r,o,i,a){const l=s.resolveComponent("el-col"),c=s.resolveComponent("el-row");return s.openBlock(),s.createElementBlock("div",Bh,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.list,(u,d)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",xh,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,kh)]),_:2},1024))),256))]),_:2},1024)],64))),256))])}const _h=ne(wh,[["render",Eh],["__scopeId","data-v-bf3f41e0"]]),Ah={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}}},Sh={style:{"--main-height":"calc(75vh + 36px)"}};function Nh(t,n,r,o,i,a){const l=s.resolveComponent("el-button"),c=s.resolveComponent("admin-table");return s.openBlock(),s.createElementBlock("div",Sh,[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 Fh=ne(Ah,[["render",Nh]]),Vh={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 Oh(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 Th=ne(Vh,[["render",Oh]]),jh={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}}},Lh={style:{"--main-height":"calc(75vh + 36px)"}};function Ph(t,n,r,o,i,a){const l=s.resolveComponent("el-button"),c=s.resolveComponent("admin-table");return s.openBlock(),s.createElementBlock("div",Lh,[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 Mh=ne(jh,[["render",Ph]]),zh={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)}}},$h={class:"pxl mxl flex justify-center"},Ih={style:{width:"500px"}};function Rh(t,n,r,o,i,a){const l=s.resolveComponent("el-input");return s.openBlock(),s.createElementBlock("div",$h,[s.createElementVNode("div",Ih,[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 Hh={name:"url-box",emits:["change"],components:{Base:_h,Goods:Fh,GoodsCate:Th,Article:Mh,Diy:ne(zh,[["render",Rh]])},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)}}},Uh={class:""},Wh={class:"pl-xs"};function qh(t,n,r,o,i,a){const l=s.resolveComponent("el-tab-pane"),c=s.resolveComponent("el-tabs");return s.openBlock(),s.createElementBlock("div",Uh,[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",Wh,[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 Hs=ne(Hh,[["render",qh]]),Kh={components:{inputButton:Fo,urlBox:Hs},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}}},Jh={style:{height:"75vh"}},Gh={class:"dialog-footer flex justify-end"},Yh={key:0,class:"pr"};function Zh(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",Gh,[a.url?(s.openBlock(),s.createElementBlock("div",Yh,[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",Jh,[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 Xh=ne(Kh,[["render",Zh]]),Qh={components:{mediaBox:lr,BigUpload:Is},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,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()}}},e0={class:"dialog-footer"},t0={key:2,class:"i-ri-image-add-line size-30%"},n0={class:"input-button"},r0={key:0,class:"mt flex"},o0={key:0,controls:"",style:{height:"160px",width:"240px"}},i0=["src"],s0={key:1,controls:"",class:"h-60px w-240px"},a0=["src"],l0={key:2};function c0(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",e0,[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",t0))],4)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("div",n0,[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)=>a.fndel&&a.fndel(...h),["stop"])),class:"i-ri-delete-bin-7-line click 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",r0,[i.fileType=="video"?(s.openBlock(),s.createElementBlock("video",o0,[s.createElementVNode("source",{src:t.$fileUrl(i.value)},null,8,i0),s.createTextVNode(" 浏览器不支持此"+s.toDisplayString(a.typeName),1)])):i.fileType=="audio"?(s.openBlock(),s.createElementBlock("audio",s0,[s.createElementVNode("source",{src:t.$fileUrl(i.value)},null,8,a0),s.createTextVNode(" 浏览器不支持此"+s.toDisplayString(a.typeName),1)])):(s.openBlock(),s.createElementBlock("div",l0,[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 u0=ne(Qh,[["render",c0]]);let Vo=!1;const d0={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(),Vo.close(),t.code==0?(this.value=t.data,this.$emit("update:modelValue",this.value),this.$msg.success("上传成功")):this.$msg.error(t.msg)},beforeUpload(t){Vo=this.$loading("上传中")},onError(t){return Vo.close(),this.$msg.error("上传失败")},onProgress(t){this.percent=parseInt(t.percent)}}},f0={class:"input-button"},p0={key:0,class:"mt-sm"};function h0(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",f0,[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",p0,[s.createVNode(d,{percentage:i.percent},null,8,["percentage"])])):s.createCommentVNode("",!0)],64)}const m0=ne(d0,[["render",h0]]),g0={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 y0(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 b0=ne(g0,[["render",y0]]),C0={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.list=[],this.$msg.info(t.msg||"没有相关搜索结果"),this.errorStatus=!0)})}}},v0={class:"search-box"},D0={key:0,class:"search-box-no-msg"},w0={class:"search-box-list max-w-800px flex gap-sm flex-wrap mx-auto"},B0=["onClick"],x0={class:"flex psm"},k0={class:"flex flex-col flex-1"},E0={key:0,class:"line-clamp-2"},_0={class:"color-error pt-xs"};function A0(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",v0,[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",D0,s.toDisplayString(i.error),1)):s.createCommentVNode("",!0),s.createElementVNode("div",w0,[(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%-0.875rem)] leading-tight",i.current==d[i.pk]?"on":""]),onClick:p=>a.fnClick(d)},[s.renderSlot(t.$slots,"item",{item:d},()=>[s.createElementVNode("div",x0,[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",k0,[d[t.titleName]?(s.openBlock(),s.createElementBlock("span",E0,s.toDisplayString(d[t.titleName]),1)):s.createCommentVNode("",!0),s.createElementVNode("span",_0,"ID:"+s.toDisplayString(d[i.pk]),1)])])],!0)],10,B0))),256))])]),_:3})])}const S0={components:{inBox:ne(C0,[["render",A0],["__scopeId","data-v-877e7b5a"]])},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("没有选择数据")}}},N0={class:"h-60vh w-full"},F0={class:"dialog-footer flex justify-end"},V0={key:0,class:"pr"},O0={key:0,class:"mt-sm"},T0={class:"flex-inline leading-none border rounded-xs pd"},j0={key:0,class:"mr"},L0={class:"flex-col"},P0={key:0,class:"line-clamp-2 pb-sm"},M0={key:1,class:"color-error"};function z0(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",F0,[i.showValue?(s.openBlock(),s.createElementBlock("div",V0,[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",N0,[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",O0,[s.renderSlot(t.$slots,"info",{data:i.showData},()=>[s.createElementVNode("div",T0,[i.showData[i.imgName]?(s.openBlock(),s.createElementBlock("div",j0,[s.createVNode(p,{class:"size-36px",fit:"cover",preview:!1,src:i.showData[i.imgName]},null,8,["src"])])):s.createCommentVNode("",!0),s.createElementVNode("div",L0,[i.showData[i.titleName]?(s.openBlock(),s.createElementBlock("div",P0,s.toDisplayString(i.showData[i.titleName]),1)):s.createCommentVNode("",!0),i.showData[i.pk]?(s.openBlock(),s.createElementBlock("div",M0,"ID:"+s.toDisplayString(i.showData[i.pk]),1)):s.createCommentVNode("",!0)])])])])):s.createCommentVNode("",!0)],64)}const Us=ne(S0,[["render",z0]]);var Oo;typeof global>"u"?("ActiveXObject"in window&&console.error(`抱歉,wangEditor V5+ 版本开始,不在支持 IE 浏览器
2
2
  Sorry, wangEditor V5+ versions do not support IE browser.`),Ws(),qs()):global&&(!((Oo=global.navigator)===null||Oo===void 0)&&Oo.userAgent.match("QQBrowser"))&&(Ws(),qs());function Ws(){typeof globalThis>"u"&&(window.globalThis=window)}function qs(){typeof AggregateError>"u"&&(window.AggregateError=function(t,n){var r=new Error(n);return r.errors=t,r})}if(typeof global=="object"){var $0=Object.getOwnPropertyDescriptor(global,"window");global.window&&!$0.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 Ks(t){return Object.prototype.toString.call(t)==="[object Object]"}function tt(t){var n,r;return Ks(t)!==!1&&((n=t.constructor)===void 0||Ks(r=n.prototype)!==!1&&r.hasOwnProperty("isPrototypeOf")!==!1)}function Et(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[bt]}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)===q0})(t)||Array.isArray(t)||!!t[ra]||!!t.constructor[ra]||jo(t)||Lo(t))}function jn(t,n,r){r===void 0&&(r=!1),fn(t)===0?(r?Object.keys:Jo)(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[bt];return n?n.i>3?n.i-4:n.i:Array.isArray(t)?1:jo(t)?2:Lo(t)?3:0}function To(t,n){return fn(t)===2?t.has(n):Object.prototype.hasOwnProperty.call(t,n)}function Js(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 jo(t){return U0&&t instanceof Map}function Lo(t){return W0&&t instanceof Set}function Qt(t){return t.o||t.t}function Po(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var n=K0(t);delete n[bt];for(var r=Jo(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 Mo(t,n){return n===void 0&&(n=!1),zo(t)||Zt(t)||!Xt(t)||(fn(t)>1&&(t.set=t.add=t.clear=t.delete=I0),Object.freeze(t),n&&jn(t,(function(r,o){return Mo(o,!0)}),!0)),t}function I0(){Et(2)}function zo(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Pt(t){var n=J0[t];return n||Et(18,t),n}function Gs(){return Ln}function $o(t,n){n&&(Pt("Patches"),t.u=[],t.s=[],t.v=n)}function cr(t){Io(t),t.p.forEach(R0),t.p=null}function Io(t){t===Ln&&(Ln=t.l)}function Ys(t){return Ln={p:[],l:Ln,h:t,m:!0,_:0}}function R0(t){var n=t[bt];n.i===0||n.i===1?n.j():n.O=!0}function Ro(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[bt].P&&(cr(n),Et(4)),Xt(t)&&(t=ur(n,t),n.l||dr(n,t)),n.u&&Pt("Patches").M(r[bt],t,n.u,n.s)):t=ur(n,r,[]),cr(n),n.u&&n.v(n.u,n.s),t!==na?t:void 0}function ur(t,n,r){if(zo(n))return n;var o=n[bt];if(!o)return jn(n,(function(a,l){return Zs(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=Po(o.k):o.o;jn(o.i===3?new Set(i):i,(function(a,l){return Zs(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 Zs(t,n,r,o,i,a){if(Zt(i)){var l=ur(t,i,a&&n&&n.i!==3&&!To(n.D,o)?a.concat(o):void 0);if(Js(r,o,l),!Zt(l))return;t.m=!1}if(Xt(i)&&!zo(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&&Mo(n,r)}function Ho(t,n){var r=t[bt];return(r?Qt(r):t)[n]}function Xs(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 Uo(t){t.P||(t.P=!0,t.l&&Uo(t.l))}function Wo(t){t.o||(t.o=Po(t.t))}function qo(t,n,r){var o=jo(n)?Pt("MapSet").N(n,r):Lo(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:Gs(),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:Gs()).p.push(o),o}function H0(t){return Zt(t)||Et(22,t),(function n(r){if(!Xt(r))return r;var o,i=r[bt],a=fn(r);if(i){if(!i.P&&(i.i<4||!Pt("ES5").K(i)))return i.t;i.I=!0,o=Qs(r,a),i.I=!1}else o=Qs(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||Js(o,l,n(c))})),a===3?new Set(o):o})(t)}function Qs(t,n){switch(n){case 2:return new Map(t);case 3:return Array.from(t)}return Po(t)}var ea,Ln,Ko=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",U0=typeof Map<"u",W0=typeof Set<"u",ta=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",na=Ko?Symbol.for("immer-nothing"):((ea={})["immer-nothing"]=!0,ea),ra=Ko?Symbol.for("immer-draftable"):"__$immer_draftable",bt=Ko?Symbol.for("immer-state"):"__$immer_state",q0=""+Object.prototype.constructor,Jo=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,K0=Object.getOwnPropertyDescriptors||function(t){var n={};return Jo(t).forEach((function(r){n[r]=Object.getOwnPropertyDescriptor(t,r)})),n},J0={},fr={get:function(t,n){if(n===bt)return t;var r=Qt(t);if(!To(r,n))return(function(i,a,l){var c,u=Xs(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===Ho(t.t,n)?(Wo(t),t.o[n]=qo(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=Xs(Qt(t),n);if(o?.set)return o.set.call(t.k,r),!0;if(!t.P){var i=Ho(Qt(t),n),a=i?.[bt];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||To(t.t,n)))return!0;Wo(t),Uo(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 Ho(t.t,n)!==void 0||n in t.t?(t.D[n]=!1,Wo(t),Uo(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(){Et(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Et(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 G0=(function(){function t(r){var o=this;this.g=ta,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"&&Et(6),l!==void 0&&typeof l!="function"&&Et(7),Xt(i)){var f=Ys(o),p=qo(o,i,void 0),h=!0;try{d=a(p),h=!1}finally{h?cr(f):Io(f)}return typeof Promise<"u"&&d instanceof Promise?d.then((function(m){return $o(f,l),Ro(m,f)}),(function(m){throw cr(f),m})):($o(f,l),Ro(d,f))}if(!i||typeof i!="object")return(d=a(i))===na?void 0:(d===void 0&&(d=i),o.F&&Mo(d,!0),d);Et(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)||Et(8),Zt(r)&&(r=H0(r));var o=Ys(this),i=qo(this,r,void 0);return i[bt].C=!0,Io(o),i},n.finishDraft=function(r,o){var i=(r&&r[bt]).A;return $o(i,o),Ro(void 0,i)},n.setAutoFreeze=function(r){this.F=r},n.setUseProxies=function(r){r&&!ta&&Et(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})(),Ct=new G0,hr=Ct.produce;Ct.produceWithPatches.bind(Ct),Ct.setAutoFreeze.bind(Ct),Ct.setUseProxies.bind(Ct),Ct.applyPatches.bind(Ct);var oa=Ct.createDraft.bind(Ct),ia=Ct.finishDraft.bind(Ct);function Vt(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,sa=new WeakMap,aa=new WeakMap,la=new WeakMap,ca=new WeakMap;function ua(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?ua(Object(r),!0).forEach((function(o){Vt(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ua(Object(r)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))}))}return t}var Y0=()=>{var t={children:[],operations:[],selection:null,marks:null,isInline:()=>!1,isVoid:()=>!1,onChange:()=>{},apply:n=>{for(var r of b.pathRefs(t))E1.transform(r,n);for(var o of b.pointRefs(t))_1.transform(o,n);for(var i of b.rangeRefs(t))S1.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=Z0(n);for(var f of u)c(_.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:q.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?H.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(!q.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||q.isText(r.children[0])||t.isInline(r.children[0])),a=0,l=0;l<r.children.length;l++,a++){var c=H.get(t,o);if(!q.isText(c)){var u=r.children[l],d=c.children[a-1],f=l===r.children.length-1;(q.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&&q.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&&q.isText(d)&&(q.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:q.isText,split:!0});else{var o=gr({},b.marks(t)||{});delete o[n],t.marks=o,Pn.get(t)||t.onChange()}}};return t},Z0=t=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":var{path:n}=t;return _.levels(n);case"insert_node":var{node:r,path:o}=t,i=_.levels(o),a=q.isText(r)?[]:Array.from(H.nodes(r),(B=>{var[,k]=B;return o.concat(k)}));return[...i,...a];case"merge_node":var{path:l}=t;return[..._.ancestors(l),_.previous(l)];case"move_node":var{path:c,newPath:u}=t;if(_.equals(c,u))return[];var d=[],f=[];for(var p of _.ancestors(c)){var h=_.transform(p,t);d.push(h)}for(var m of _.ancestors(u)){var g=_.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[..._.ancestors(w)];case"split_node":var{path:C}=t;return[..._.levels(C),_.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 pe,Go=function(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=!n,o=n?n1(t):t,i=pe.None,a=pe.None,l=0,c=null;for(var u of o){var d=u.codePointAt(0);if(!d)break;var f=h1(u,d);if([i,a]=r?[a,f]:[f,i],pn(i,pe.ZWJ)&&pn(a,pe.ExtPict)&&!b1(r?t.substring(0,l):t.substring(0,t.length-l))||pn(i,pe.RI)&&pn(a,pe.RI)&&!(c=c!==null?!c:!!r||v1(t.substring(0,t.length-l)))||i!==pe.None&&a!==pe.None&&g1(i,a))break;l+=u.length}return l||1},X0=/\s/,Q0=/[\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]/,e1=/['\u2018\u2019]/,Yo=(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)]},t1=function t(n,r){var o=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(X0.test(n))return!1;if(e1.test(n)){var i=Go(r,o),[a,l]=Yo(r,i,o);if(t(a,l,o))return!0}return!Q0.test(n)},n1=function*(t){for(var n=t.length-1,r=0;r<t.length;r++){var o=t.charAt(n-r);if(o1(o.charCodeAt(0))){var i=t.charAt(n-r-1);if(r1(i.charCodeAt(0))){yield i+o,r++;continue}}yield o}},r1=t=>t>=55296&&t<=56319,o1=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"})(pe||(pe={}));var i1=/^(?:[\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])$/,s1=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,a1=/^(?:[\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])$/,l1=/^[\u1100-\u115F\uA960-\uA97C]$/,c1=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,u1=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,d1=/^[\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]$/,f1=/^[\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]$/,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])$/,h1=(t,n)=>{var r=pe.Any;return t.search(i1)!==-1&&(r|=pe.Extend),n===8205&&(r|=pe.ZWJ),n>=127462&&n<=127487&&(r|=pe.RI),t.search(s1)!==-1&&(r|=pe.Prepend),t.search(a1)!==-1&&(r|=pe.SpacingMark),t.search(l1)!==-1&&(r|=pe.L),t.search(c1)!==-1&&(r|=pe.V),t.search(u1)!==-1&&(r|=pe.T),t.search(d1)!==-1&&(r|=pe.LV),t.search(f1)!==-1&&(r|=pe.LVT),t.search(p1)!==-1&&(r|=pe.ExtPict),r};function pn(t,n){return!!(t&n)}var m1=[[pe.L,pe.L|pe.V|pe.LV|pe.LVT],[pe.LV|pe.V,pe.V|pe.T],[pe.LVT|pe.T,pe.T],[pe.Any,pe.Extend|pe.ZWJ],[pe.Any,pe.SpacingMark],[pe.Prepend,pe.Any],[pe.ZWJ,pe.ExtPict],[pe.RI,pe.RI]];function g1(t,n){return m1.findIndex((r=>pn(t,r[0])&&pn(n,r[1])))===-1}var y1=/(?:[\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$/,b1=t=>t.search(y1)!==-1,C1=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,v1=t=>{var n=t.match(C1);return n!==null&&n[0].length/2%2==1},da=t=>tt(t)&&H.isNodeList(t.children)&&!b.isEditor(t),te={isAncestor:t=>tt(t)&&H.isNodeList(t.children),isElement:da,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 da(t)&&t[r]===n},matches(t,n){for(var r in n)if(r!=="children"&&t[r]!==n[r])return!1;return!0}},D1=["text"],w1=["text"];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 hn(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){Vt(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 pa=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(!q.isText(u)&&!_.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 H.fragment(t,r)},hasBlocks:(t,n)=>n.children.some((r=>b.isBlock(t,r))),hasInlines:(t,n)=>n.children.some((r=>q.isText(r)||b.isInline(t,r))),hasTexts:(t,n)=>n.children.every((r=>q.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(!tt(t))return!1;var n=pa.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||tt(t.marks))&&(t.selection===null||j.isRange(t.selection))&&H.isNodeList(t.children)&&Wt.isOperationList(t.operations);return pa.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&&q.isText(o)&&o.text===""&&!t.isVoid(n)},isInline:(t,n)=>te.isElement(n)&&t.isInline(n),isNormalizing(t){var n=sa.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[H.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 H.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:q.isText});if(o){var[i]=o;return Mt(i,D1)}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:q.isText}),d=b.above(t,{match:m=>b.isBlock(t,m)});if(u&&d){var[f,p]=u,[,h]=d;_.isAncestor(h,p)&&(c=f)}}return Mt(c,w1)},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(_.isPath(a)&&a.length===0)throw new Error("Cannot get the next node from the root node!");if(i==null)if(_.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[H.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(B1.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=H.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&&_.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&&q.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(H.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(H.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(`
3
3
  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.
4
4
  `));var p=o(t).pop();if(H.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=_.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(_.isPath(n)){if(i==="start"){var[,a]=H.first(t,n);n=a}else if(i==="end"){var[,l]=H.last(t,n);n=l}}return j.isRange(n)&&(n=i==="start"?j.start(n):i==="end"?j.end(n):_.common(n.anchor.path,n.focus.path)),ye.isPoint(n)&&(n=n.path),o!=null&&(n=n.slice(0,o)),n},hasPath:(t,n)=>H.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=aa.get(t);return n||(n=new Set,aa.set(t,n)),n},point(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:o="start"}=r;if(_.isPath(n)){var i;if(o==="end"){var[,a]=H.last(t,n);i=a}else{var[,l]=H.first(t,n);i=l}var c=H.get(t,i);if(!q.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=la.get(t);return n||(n=new Set,la.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=_.isAncestor(v,u.path)?u:b.end(t,v),w=_.isAncestor(v,c.path)?c:b.start(t,v);p=b.string(t,{anchor:w,focus:D},{voids:a}),f=!0}}if(q.isText(y)){var C=_.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=Yo(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,E,x){return E==="character"?Go(k,x):E==="word"?(function(V){for(var T=arguments.length>1&&arguments[1]!==void 0&&arguments[1],L=0,R=!1;V.length>0;){var I=Go(V,T),[U,G]=Yo(V,I,T);if(t1(U,G,T))R=!0,L+=I;else{if(R)break;L+=I}V=G}return L})(k,x):E==="line"||E==="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(_.isPath(a)&&a.length===0)throw new Error("Cannot get the previous node from the root node!");if(i==null)if(_.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=ca.get(t);return n||(n=new Set,ca.set(t,n)),n},removeMark(t,n){t.removeMark(n)},setNormalizing(t,n){sa.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:q.isText,voids:o})){var f=u.text;_.equals(d,l.path)&&(f=f.slice(0,l.offset)),_.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:q.isText,reverse:!0,voids:o}))if(d)d=!1;else if(f.text!==""||_.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)}},B1={isSpan:t=>Array.isArray(t)&&t.length===2&&t.every(_.isPath)},x1=["children"],k1=["text"],ha=new WeakMap,H={ancestor(t,n){var r=H.get(t,n);if(q.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 _.ancestors(n,r)){var i=[H.ancestor(t,o),o];yield i}},child(t,n){if(q.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=H.ancestor(t,n),{children:a}=i,l=o?a.length-1:0;o?l>=0:l<a.length;){var c=H.child(i,l),u=n.concat(l);yield[c,u],l=o?l-1:l+1}},common(t,n,r){var o=_.common(n,r);return[H.get(t,o),o]},descendant(t,n){var r=H.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 H.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 H.nodes(t,n))te.isElement(r)&&(yield[r,o])},extractProps:t=>te.isAncestor(t)?Mt(t,x1):Mt(t,k1),first(t,n){for(var r=n.slice(),o=H.get(t,r);o&&!q.isText(o)&&o.children.length!==0;)o=o.children[0],r.push(0);return[o,r]},fragment(t,n){if(q.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=H.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=H.parent(o,c),d=c[c.length-1];u.children.splice(d,1)}if(_.equals(c,a.path)){var f=H.leaf(o,c);f.text=f.text.slice(0,a.offset)}if(_.equals(c,i.path)){var p=H.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(q.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(q.isText(r)||!r.children[i])return!1;r=r.children[i]}return!0},isNode:t=>q.isText(t)||te.isElement(t)||b.isEditor(t),isNodeList(t){if(!Array.isArray(t))return!1;var n=ha.get(t);if(n!==void 0)return n;var r=t.every((o=>H.isNode(o)));return ha.set(t,r),r},last(t,n){for(var r=n.slice(),o=H.get(t,r);o&&!q.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=H.get(t,n);if(!q.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 _.levels(n,r)){var i=H.get(t,o);yield[i,o]}},matches:(t,n)=>te.isElement(t)&&te.isElementProps(n)&&te.matches(t,n)||q.isText(t)&&q.isTextProps(n)&&q.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?_.isBefore(c,a):_.isAfter(c,a));)if(l.has(u)||(yield[u,c]),l.has(u)||q.isText(u)||u.children.length===0||r!=null&&r([u,c])!==!1){if(c.length===0)break;if(!o){var d=_.next(c);if(H.has(t,d)){c=d,u=H.get(t,c);continue}}o&&c[c.length-1]!==0?(c=_.previous(c),u=H.get(t,c)):(c=_.parent(c),u=H.get(t,c),l.add(u))}else{l.add(u);var f=o?u.children.length-1:0;_.isAncestor(c,i)&&(f=i[c.length]),c=c.concat(f),u=H.get(t,c)}},parent(t,n){var r=_.parent(n),o=H.get(t,r);if(q.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=>q.isText(t)?t.text:t.children.map(H.string).join(""),*texts(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var[r,o]of H.nodes(t,n))q.isText(r)&&(yield[r,o])}};function ma(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 We(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?ma(Object(r),!0).forEach((function(o){Vt(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ma(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(!tt(t))return!1;switch(t.type){case"insert_node":case"remove_node":return _.isPath(t.path)&&H.isNode(t.node);case"insert_text":case"remove_text":return typeof t.offset=="number"&&typeof t.text=="string"&&_.isPath(t.path);case"merge_node":return typeof t.position=="number"&&_.isPath(t.path)&&tt(t.properties);case"move_node":return _.isPath(t.path)&&_.isPath(t.newPath);case"set_node":return _.isPath(t.path)&&tt(t.properties)&&tt(t.newProperties);case"set_selection":return t.properties===null&&j.isRange(t.newProperties)||t.newProperties===null&&j.isRange(t.properties)||tt(t.properties)&&tt(t.newProperties);case"split_node":return _.isPath(t.path)&&typeof t.position=="number"&&tt(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 We(We({},t),{},{type:"remove_node"});case"insert_text":return We(We({},t),{},{type:"remove_text"});case"merge_node":return We(We({},t),{},{type:"split_node",path:_.previous(t.path)});case"move_node":var{newPath:n,path:r}=t;if(_.equals(n,r))return t;if(_.isSibling(r,n))return We(We({},t),{},{path:n,newPath:r});var o=_.transform(r,t),i=_.transform(_.next(r),t);return We(We({},t),{},{path:o,newPath:i});case"remove_node":return We(We({},t),{},{type:"insert_node"});case"remove_text":return We(We({},t),{},{type:"insert_text"});case"set_node":var{properties:a,newProperties:l}=t;return We(We({},t),{},{properties:l,newProperties:a});case"set_selection":var{properties:c,newProperties:u}=t;return We(We({},t),{},c==null?{properties:u,newProperties:null}:u==null?{properties:null,newProperties:c}:{properties:u,newProperties:c});case"split_node":return We(We({},t),{},{type:"merge_node",path:_.next(t.path)})}}},_={ancestors(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=n,o=_.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 _.equals(o,i)&&a>l},endsAt(t,n){var r=t.length,o=t.slice(0,r),i=n.slice(0,r);return _.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 _.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)=>_.compare(t,n)===1,isAncestor:(t,n)=>t.length<n.length&&_.compare(t,n)===0,isBefore:(t,n)=>_.compare(t,n)===-1,isChild:(t,n)=>t.length===n.length+1&&_.compare(t,n)===0,isCommon:(t,n)=>t.length<=n.length&&_.compare(t,n)===0,isDescendant:(t,n)=>t.length>n.length&&_.compare(t,n)===0,isParent:(t,n)=>t.length+1===n.length&&_.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]&&_.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(!_.isAncestor(n,t)&&!_.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;(_.equals(a,o)||_.endsBefore(a,o)||_.isAncestor(a,o))&&(o[a.length-1]+=1);break;case"remove_node":var{path:l}=n;if(_.equals(l,o)||_.isAncestor(l,o))return null;_.endsBefore(l,o)&&(o[l.length-1]-=1);break;case"merge_node":var{path:c,position:u}=n;_.equals(c,o)||_.endsBefore(c,o)?o[c.length-1]-=1:_.isAncestor(c,o)&&(o[c.length-1]-=1,o[c.length]+=u);break;case"split_node":var{path:d,position:f}=n;if(_.equals(d,o)){if(i==="forward")o[o.length-1]+=1;else if(i!=="backward")return null}else _.endsBefore(d,o)?o[d.length-1]+=1:_.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(_.equals(p,h))return;if(_.isAncestor(p,o)||_.equals(p,o)){var m=h.slice();return _.endsBefore(p,h)&&p.length<h.length&&(m[p.length-1]-=1),m.concat(o.slice(p.length))}_.isSibling(p,h)&&(_.isAncestor(h,o)||_.equals(h,o))?_.endsBefore(p,o)?o[p.length-1]-=1:o[p.length-1]+=1:_.endsBefore(h,o)||_.equals(h,o)||_.isAncestor(h,o)?(_.endsBefore(p,o)&&(o[p.length-1]-=1),o[h.length-1]+=1):_.endsBefore(p,o)&&(_.equals(h,o)&&(o[h.length-1]+=1),o[p.length-1]-=1)}}}))}},E1={transform(t,n){var{current:r,affinity:o}=t;if(r!=null){var i=_.transform(r,n,{affinity:o});t.current=i,i==null&&t.unref()}}};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 ya(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){Vt(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 ye={compare(t,n){var r=_.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&&_.equals(t.path,n.path),isPoint:t=>tt(t)&&typeof t.offset=="number"&&_.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=_.transform(a,n,r);break;case"insert_text":_.equals(n.path,a)&&n.offset<=l&&(o.offset+=n.text.length);break;case"merge_node":_.equals(n.path,a)&&(o.offset+=n.position),o.path=_.transform(a,n,r);break;case"remove_text":_.equals(n.path,a)&&n.offset<=l&&(o.offset-=Math.min(l-n.offset,n.text.length));break;case"remove_node":if(_.equals(n.path,a)||_.isAncestor(n.path,a))return null;o.path=_.transform(a,n,r);break;case"split_node":if(_.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=_.transform(a,n,ya(ya({},r),{},{affinity:"forward"})))}else o.path=_.transform(a,n,r)}}))}},_1={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()}}},A1=["anchor","focus"];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}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=_.compare(n,l.path)>=0,d=_.compare(n,c.path)<=0),u&&d},intersection(t,n){var r=Mt(t,A1),[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?ba(Object(p),!0).forEach((function(h){Vt(d,h,p[h])})):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(p)):ba(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=>tt(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}))}},S1={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()}}},Ca=(t,n)=>{for(var r in t){var o=t[r],i=n[r];if(tt(o)&&tt(i)){if(!Ca(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},N1=["text"],F1=["anchor","focus"];function va(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?va(Object(r),!0).forEach((function(o){Vt(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):va(Object(r)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))}))}return t}var q={equals(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{loose:o=!1}=r;function i(a){return Mt(a,N1)}return Ca(o?i(t):t,o?i(n):n)},isText:t=>tt(t)&&typeof t.text=="string",isTextList:t=>Array.isArray(t)&&t.every((n=>q.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,F1),[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 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 Mn(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){Vt(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 V1={transform(t,n){t.children=oa(t.children);var r=t.selection&&oa(t.selection);try{r=((o,i,a)=>{switch(a.type){case"insert_node":var{path:l,node:c}=a,u=H.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=H.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=H.get(o,B),E=_.previous(B),x=H.get(o,E),V=H.parent(o,B),T=B[B.length-1];if(q.isText(k)&&q.isText(x))x.text+=k.text;else{if(q.isText(k)||q.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(V.children.splice(T,1),i)for(var[L,R]of j.points(i))i[R]=ye.transform(L,a);break;case"move_node":var{path:I,newPath:U}=a;if(_.isAncestor(I,U))throw new Error("Cannot move a path [".concat(I,"] to new path [").concat(U,"] because the destination is inside itself."));var G=H.get(o,I),W=H.parent(o,I),K=I[I.length-1];W.children.splice(K,1);var X=_.transform(I,a),oe=H.get(o,_.parent(X)),re=X[X.length-1];if(oe.children.splice(re,0,G),i)for(var[ie,ce]of j.points(i))i[ce]=ye.transform(ie,a);break;case"remove_node":var{path:Q}=a,Be=Q[Q.length-1];if(H.parent(o,Q).children.splice(Be,1),i)for(var[ge,Je]of j.points(i)){var Ge=ye.transform(ge,a);if(i!=null&&Ge!=null)i[Je]=Ge;else{var Se=void 0,Ce=void 0;for(var[_e,Me]of H.texts(o)){if(_.compare(Me,Q)!==-1){Ce=[_e,Me];break}Se=[_e,Me]}var nt=!1;Se&&Ce&&(nt=_.equals(Ce[1],Q)?!_.hasPrevious(Ce[1]):_.common(Se[1],Q).length<_.common(Ce[1],Q).length),Se&&!nt?(ge.path=Se[1],ge.offset=Se[0].text.length):Ce?(ge.path=Ce[1],ge.offset=0):i=null}}break;case"remove_text":var{path:rt,offset:et,text:ot}=a;if(ot.length===0)break;var Re=H.leaf(o,rt),mt=Re.text.slice(0,et),He=Re.text.slice(et+ot.length);if(Re.text=mt+He,i)for(var[ze,Dt]of j.points(i))i[Dt]=ye.transform(ze,a);break;case"set_node":var{path:St,properties:jt,newProperties:ue}=a;if(St.length===0)throw new Error("Cannot set properties on the root node!");var le=H.get(o,St);for(var ve in ue){if(ve==="children"||ve==="text")throw new Error('Cannot set the "'.concat(ve,'" property of nodes!'));var Ee=ue[ve];Ee==null?delete le[ve]:le[ve]=Ee}for(var Ue in jt)ue.hasOwnProperty(Ue)||delete le[Ue];break;case"set_selection":var{newProperties:Ve}=a;if(Ve==null)i=Ve;else{if(i==null){if(!j.isRange(Ve))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(JSON.stringify(Ve)," when there is no current selection."));i=Mn({},Ve)}for(var Le in Ve){var Ye=Ve[Le];if(Ye==null){if(Le==="anchor"||Le==="focus")throw new Error('Cannot remove the "'.concat(Le,'" selection property'));delete i[Le]}else i[Le]=Ye}}break;case"split_node":var{path:Te,position:Pe,properties:xt}=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 A,P=H.get(o,Te),Y=H.parent(o,Te),J=Te[Te.length-1];if(q.isText(P)){var be=P.text.slice(0,Pe),z=P.text.slice(Pe);P.text=be,A=Mn(Mn({},xt),{},{text:z})}else{var ee=P.children.slice(0,Pe),ae=P.children.slice(Pe);P.children=ee,A=Mn(Mn({},xt),{},{children:ae})}if(Y.children.splice(J+1,0,A),i)for(var[he,Ne]of j.points(i))i[Ne]=ye.transform(he,a)}return i})(t,r,n)}finally{t.children=ia(t.children),t.selection=r?Zt(r)?ia(r):r:null}}},O1=["text"],T1=["children"];function wa(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 Ba(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?wa(Object(r),!0).forEach((function(o){Vt(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wa(Object(r)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))}))}return t}var j1={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(H.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=q.isText(d)?E=>q.isText(E):t.isInline(d)?E=>q.isText(E)||b.isInline(t,E):E=>b.isBlock(t,E));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?_.next(v):v}var D=_.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=_.next(l)}if(l=_.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=_.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,_.parent(d)),[p,h]=f,m=d[d.length-1],{length:g}=p.children;if(g===1){var y=_.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=_.next(h);O.moveNodes(t,{at:d,to:v,voids:i})}else{var D=_.next(d),w=_.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(_.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=_.next(y),C=_.common(m,y),B=_.isSibling(m,y),k=Array.from(b.levels(t,{at:m}),(T=>{var[L]=T;return L})).slice(C.length).slice(0,-1),E=b.above(t,{at:m,mode:"highest",match:T=>k.includes(T)&&xa(t,T)}),x=E&&b.pathRef(t,E[1]);if(q.isText(h)&&q.isText(g)){var V=Mt(h,O1);D=g.text.length,v=V}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)));V=Mt(h,T1),D=g.children.length,v=V}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)||q.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=_.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&&_.isSibling(h,p)&&_.isAfter(h,p)&&(c.current=_.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=_.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=_.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=G=>b.isBlock(t,G)),j.isRange(a)&&(a=L1(t,a)),_.isPath(a)){var u=a,d=b.point(t,u),[f]=b.parent(t,u);i=G=>G===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=_.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),E=l===0?a.offset:a.path[C]+0;for(var[x,V]of b.levels(t,{at:k,reverse:!0,voids:o})){var T=!1;if(V.length<B.length||V.length===0||!o&&b.isVoid(t,x))break;var L=p.current,R=b.isEnd(t,L,V);if(c||!p||!b.isEdge(t,L,V)){T=!0;var I=H.extractProps(x);t.apply({type:"split_node",path:V,position:E,properties:I})}E=V[V.length-1]+(T||R?1:0)}if(n.at==null){var U=w.current||b.end(t,[]);O.select(t,U)}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=_.isPath(a)?mn(t,a):h=>b.isBlock(t,h)),_.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=_.isPath(c)?mn(t,c):t.isInline(n)?v=>b.isInline(t,v)||q.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=_.equals(w,C)?_.parent(w):_.common(w,C),k=b.range(t,w,C),E=b.node(t,B),[x]=E,V=B.length+1,T=_.next(C.slice(0,V)),L=Ba(Ba({},n),{},{children:[]});O.insertNodes(t,L,{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}}}}}))}},xa=(t,n)=>{if(te.isElement(n)){var r=n;return!!b.isVoid(t,n)||r.children.length===1&&xa(t,r.children[0])}return!b.isEditor(n)},L1=(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 ka(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 Ea(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?ka(Object(r),!0).forEach((function(o){Vt(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ka(Object(r)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))}))}return t}var P1={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"]:Ea(Ea({},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})}}},M1={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(_.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&&!_.equals(y[1],v[1]),w=_.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&&_.isAncestor(y[1],k.path)&&(m=k)}if(B){var E=b.after(t,g);E&&v&&_.isAncestor(v[1],E.path)&&(g=E)}var x,V=[];for(var T of b.nodes(t,{at:l,voids:a})){var[L,R]=T;x&&_.compare(R,x)===0||(!a&&b.isVoid(t,L)||!_.isCommon(R,m.path)&&!_.isCommon(R,g.path))&&(V.push(T),x=R)}var I=Array.from(V,(Ce=>{var[,_e]=Ce;return b.pathRef(t,_e)})),U=b.pointRef(t,m),G=b.pointRef(t,g);if(!w&&!C){var W=U.current,[K]=b.leaf(t,W),{path:X}=W,{offset:oe}=m,re=K.text.slice(oe);re.length>0&&t.apply({type:"remove_text",path:X,offset:oe,text:re})}for(var ie of I){var ce=ie.unref();O.removeNodes(t,{at:ce,voids:a})}if(!B){var Q=G.current,[Be]=b.leaf(t,Q),{path:ge}=Q,Je=w?m.offset:0,Ge=Be.text.slice(Je,g.offset);Ge.length>0&&t.apply({type:"remove_text",path:ge,offset:Je,text:Ge})}!w&&D&&G.current&&U.current&&O.mergeNodes(t,{at:G.current,hanging:!0,voids:a});var Se=r?U.unref()||G.unref():G.unref()||U.unref();n.at==null&&Se&&O.select(t,Se)}}}))},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 _.isPath(a)&&(a=b.start(t,a));if(i||!b.void(t,{at:a})){var u=b.above(t,{at:a,match:Q=>b.isInline(t,Q),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:Q=>b.isBlock(t,Q),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]=H.first({children:n},[]),[,w]=H.last({children:n},[]),C=[],B=Q=>{var[Be,ge]=Q;return ge.length!==0&&(!!g||!(y&&_.isAncestor(ge,D)&&te.isElement(Be)&&!t.isVoid(Be)&&!t.isInline(Be))&&!(v&&_.isAncestor(ge,w)&&te.isElement(Be)&&!t.isVoid(Be)&&!t.isInline(Be)))};for(var k of H.nodes({children:n},{pass:B}))B(k)&&C.push(k);var E=[],x=[],V=[],T=!0,L=!1;for(var[R]of C)te.isElement(R)&&!t.isInline(R)?(T=!1,L=!0,x.push(R)):T?E.push(R):V.push(R);var[I]=b.nodes(t,{at:a,match:Q=>q.isText(Q)||b.isInline(t,Q),mode:"highest",voids:i}),[,U]=I,G=b.isStart(t,a,U),W=b.isEnd(t,a,U),K=b.pathRef(t,m?_.next(p):p),X=b.pathRef(t,W?_.next(U):U),oe=b.pathRef(t,p);O.splitNodes(t,{at:a,match:Q=>L?b.isBlock(t,Q):q.isText(Q)||b.isInline(t,Q),mode:L?"lowest":"highest",voids:i});var re=b.pathRef(t,!G||G&&W?_.next(U):U);if(O.insertNodes(t,E,{at:re.current,match:Q=>q.isText(Q)||b.isInline(t,Q),mode:"highest",voids:i}),g&&x.length&&O.delete(t,{at:oe.unref(),voids:i}),O.insertNodes(t,x,{at:K.current,match:Q=>b.isBlock(t,Q),mode:"lowest",voids:i}),O.insertNodes(t,V,{at:X.current,match:Q=>q.isText(Q)||b.isInline(t,Q),mode:"highest",voids:i}),!r.at){var ie;ie=V.length>0?_.previous(X.current):x.length>0?_.previous(K.current):_.previous(re.current);var ce=b.end(t,ie);O.select(t,ce)}re.unref(),K.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(_.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 _a(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?_a(Object(r),!0).forEach((function(o){Vt(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_a(Object(r)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))}))}return t}var O=yr(yr(yr(yr({},V1),j1),P1),M1),z1={isHistory:t=>tt(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))},Zo=new WeakMap,zn=new WeakMap,en={isHistoryEditor:t=>z1.isHistory(t.history)&&b.isEditor(t),isMerging:t=>zn.get(t),isSaving:t=>Zo.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);Zo.set(t,!1),n(),Zo.set(t,r)}},$1=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=R1(o)),d){if(f==null&&(f=c!=null&&(i.length!==0||I1(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},I1=(t,n)=>!(!n||t.type!=="insert_text"||n.type!=="insert_text"||t.offset!==n.offset+n.text.length||!_.equals(t.path,n.path))||!(!n||t.type!=="remove_text"||n.type!=="remove_text"||t.offset+t.text.length!==n.offset||!_.equals(t.path,n.path)),R1=(t,n)=>t.type!=="set_selection",Xo=function(t,n){return Xo=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])},Xo(t,n)};function De(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}Xo(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 lt(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 ke(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 qe=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 Aa,Qo={exports:{}},Sa,Na,H1=(Aa||(Aa=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]",E="[object Int8Array]",x="[object Int16Array]",V="[object Int32Array]",T="[object Uint8Array]",L="[object Uint8ClampedArray]",R="[object Uint16Array]",I="[object Uint32Array]",U=/\w*$/,G=/^\[object .+?Constructor\]$/,W=/^(?:0|[1-9]\d*)$/,K={};K[i]=K["[object Array]"]=K[w]=K[C]=K[a]=K[l]=K[B]=K[k]=K[E]=K[x]=K[V]=K[d]=K[f]=K[p]=K[m]=K[g]=K[y]=K[v]=K[T]=K[L]=K[R]=K[I]=!0,K["[object Error]"]=K[c]=K[D]=!1;var X=typeof qe=="object"&&qe&&qe.Object===Object&&qe,oe=typeof self=="object"&&self&&self.Object===Object&&self,re=X||oe||Function("return this")(),ie=n&&!n.nodeType&&n,ce=ie&&t&&!t.nodeType&&t,Q=ce&&ce.exports===ie;function Be(S,M){return S.set(M[0],M[1]),S}function ge(S,M){return S.add(M),S}function Je(S,M,Z,de){for(var it=-1,gt=S?S.length:0;++it<gt;)Z=M(Z,S[it],it,S);return Z}function Ge(S){var M=!1;if(S!=null&&typeof S.toString!="function")try{M=!!(S+"")}catch{}return M}function Se(S){var M=-1,Z=Array(S.size);return S.forEach((function(de,it){Z[++M]=[it,de]})),Z}function Ce(S,M){return function(Z){return S(M(Z))}}function _e(S){var M=-1,Z=Array(S.size);return S.forEach((function(de){Z[++M]=de})),Z}var Me,nt=Array.prototype,rt=Function.prototype,et=Object.prototype,ot=re["__core-js_shared__"],Re=(Me=/[^.]+$/.exec(ot&&ot.keys&&ot.keys.IE_PROTO||""))?"Symbol(src)_1."+Me:"",mt=rt.toString,He=et.hasOwnProperty,ze=et.toString,Dt=RegExp("^"+mt.call(He).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),St=Q?re.Buffer:void 0,jt=re.Symbol,ue=re.Uint8Array,le=Ce(Object.getPrototypeOf,Object),ve=Object.create,Ee=et.propertyIsEnumerable,Ue=nt.splice,Ve=Object.getOwnPropertySymbols,Le=St?St.isBuffer:void 0,Ye=Ce(Object.keys,Object),Te=Vn(re,"DataView"),Pe=Vn(re,"Map"),xt=Vn(re,"Promise"),A=Vn(re,"Set"),P=Vn(re,"WeakMap"),Y=Vn(Object,"create"),J=cn(Te),be=cn(Pe),z=cn(xt),ee=cn(A),ae=cn(P),he=jt?jt.prototype:void 0,Ne=he?he.valueOf:void 0;function $e(S){var M=-1,Z=S?S.length:0;for(this.clear();++M<Z;){var de=S[M];this.set(de[0],de[1])}}function Ze(S){var M=-1,Z=S?S.length:0;for(this.clear();++M<Z;){var de=S[M];this.set(de[0],de[1])}}function Nt(S){var M=-1,Z=S?S.length:0;for(this.clear();++M<Z;){var de=S[M];this.set(de[0],de[1])}}function Lt(S){this.__data__=new Ze(S)}function po(S,M){var Z=xs(S)||(function(st){return(function(ut){return(function(Rt){return!!Rt&&typeof Rt=="object"})(ut)&&ed(ut)})(st)&&He.call(st,"callee")&&(!Ee.call(st,"callee")||ze.call(st)==i)})(S)?(function(st,ut){for(var Rt=-1,Ht=Array(st);++Rt<st;)Ht[Rt]=ut(Rt);return Ht})(S.length,String):[],de=Z.length,it=!!de;for(var gt in S)!He.call(S,gt)||it&&(gt=="length"||D5(gt,de))||Z.push(gt);return Z}function Gu(S,M,Z){var de=S[M];He.call(S,M)&&Qu(de,Z)&&(Z!==void 0||M in S)||(S[M]=Z)}function ho(S,M){for(var Z=S.length;Z--;)if(Qu(S[Z][0],M))return Z;return-1}function ws(S,M,Z,de,it,gt,st){var ut;if(de&&(ut=gt?de(S,it,gt,st):de(S)),ut!==void 0)return ut;if(!go(S))return S;var Rt=xs(S);if(Rt){if(ut=(function(fe){var xe=fe.length,Xe=fe.constructor(xe);return xe&&typeof fe[0]=="string"&&He.call(fe,"index")&&(Xe.index=fe.index,Xe.input=fe.input),Xe})(S),!M)return(function(fe,xe){var Xe=-1,Ft=fe.length;for(xe||(xe=Array(Ft));++Xe<Ft;)xe[Xe]=fe[Xe];return xe})(S,ut)}else{var Ht=ln(S),nd=Ht==c||Ht==u;if(w5(S))return(function(fe,xe){if(xe)return fe.slice();var Xe=new fe.constructor(fe.length);return fe.copy(Xe),Xe})(S,M);if(Ht==p||Ht==i||nd&&!gt){if(Ge(S))return gt?S:{};if(ut=(function(fe){return typeof fe.constructor!="function"||Xu(fe)?{}:go(xe=le(fe))?ve(xe):{};var xe})(nd?{}:S),!M)return(function(fe,xe){return Yu(fe,Zu(fe),xe)})(S,(function(fe,xe){return fe&&Yu(xe,ks(xe),fe)})(ut,S))}else{if(!K[Ht])return gt?S:{};ut=(function(fe,xe,Xe,Ft){var or,On=fe.constructor;switch(xe){case w:return Bs(fe);case a:case l:return new On(+fe);case C:return(function(Ae,yt){var Ut=yt?Bs(Ae.buffer):Ae.buffer;return new Ae.constructor(Ut,Ae.byteOffset,Ae.byteLength)})(fe,Ft);case B:case k:case E:case x:case V:case T:case L:case R:case I:return(function(Ae,yt){var Ut=yt?Bs(Ae.buffer):Ae.buffer;return new Ae.constructor(Ut,Ae.byteOffset,Ae.length)})(fe,Ft);case d:return(function(Ae,yt,Ut){var ir=yt?Ut(Se(Ae),!0):Se(Ae);return Je(ir,Be,new Ae.constructor)})(fe,Ft,Xe);case f:case y:return new On(fe);case m:return(function(Ae){var yt=new Ae.constructor(Ae.source,U.exec(Ae));return yt.lastIndex=Ae.lastIndex,yt})(fe);case g:return(function(Ae,yt,Ut){var ir=yt?Ut(_e(Ae),!0):_e(Ae);return Je(ir,ge,new Ae.constructor)})(fe,Ft,Xe);case v:return or=fe,Ne?Object(Ne.call(or)):{}}})(S,Ht,ws,M)}}st||(st=new Lt);var rd=st.get(S);if(rd)return rd;if(st.set(S,ut),!Rt)var od=Z?(function(fe){return(function(xe,Xe,Ft){var or=Xe(xe);return xs(xe)?or:(function(On,Ae){for(var yt=-1,Ut=Ae.length,ir=On.length;++yt<Ut;)On[ir+yt]=Ae[yt];return On})(or,Ft(xe))})(fe,ks,Zu)})(S):ks(S);return(function(fe,xe){for(var Xe=-1,Ft=fe?fe.length:0;++Xe<Ft&&xe(fe[Xe],Xe,fe)!==!1;);})(od||S,(function(fe,xe){od&&(fe=S[xe=fe]),Gu(ut,xe,ws(fe,M,Z,de,xe,S,st))})),ut}function v5(S){return!(!go(S)||(M=S,Re&&Re in M))&&(td(S)||Ge(S)?Dt:G).test(cn(S));var M}function Bs(S){var M=new S.constructor(S.byteLength);return new ue(M).set(new ue(S)),M}function Yu(S,M,Z,de){Z||(Z={});for(var it=-1,gt=M.length;++it<gt;){var st=M[it];Gu(Z,st,S[st])}return Z}function mo(S,M){var Z,de,it=S.__data__;return((de=typeof(Z=M))=="string"||de=="number"||de=="symbol"||de=="boolean"?Z!=="__proto__":Z===null)?it[typeof M=="string"?"string":"hash"]:it.map}function Vn(S,M){var Z=(function(de,it){return de?.[it]})(S,M);return v5(Z)?Z:void 0}$e.prototype.clear=function(){this.__data__=Y?Y(null):{}},$e.prototype.delete=function(S){return this.has(S)&&delete this.__data__[S]},$e.prototype.get=function(S){var M=this.__data__;if(Y){var Z=M[S];return Z===r?void 0:Z}return He.call(M,S)?M[S]:void 0},$e.prototype.has=function(S){var M=this.__data__;return Y?M[S]!==void 0:He.call(M,S)},$e.prototype.set=function(S,M){return this.__data__[S]=Y&&M===void 0?r:M,this},Ze.prototype.clear=function(){this.__data__=[]},Ze.prototype.delete=function(S){var M=this.__data__,Z=ho(M,S);return!(Z<0||(Z==M.length-1?M.pop():Ue.call(M,Z,1),0))},Ze.prototype.get=function(S){var M=this.__data__,Z=ho(M,S);return Z<0?void 0:M[Z][1]},Ze.prototype.has=function(S){return ho(this.__data__,S)>-1},Ze.prototype.set=function(S,M){var Z=this.__data__,de=ho(Z,S);return de<0?Z.push([S,M]):Z[de][1]=M,this},Nt.prototype.clear=function(){this.__data__={hash:new $e,map:new(Pe||Ze),string:new $e}},Nt.prototype.delete=function(S){return mo(this,S).delete(S)},Nt.prototype.get=function(S){return mo(this,S).get(S)},Nt.prototype.has=function(S){return mo(this,S).has(S)},Nt.prototype.set=function(S,M){return mo(this,S).set(S,M),this},Lt.prototype.clear=function(){this.__data__=new Ze},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,M){var Z=this.__data__;if(Z instanceof Ze){var de=Z.__data__;if(!Pe||de.length<199)return de.push([S,M]),this;Z=this.__data__=new Nt(de)}return Z.set(S,M),this};var Zu=Ve?Ce(Ve,Object):function(){return[]},ln=function(S){return ze.call(S)};function D5(S,M){return!!(M=M??o)&&(typeof S=="number"||W.test(S))&&S>-1&&S%1==0&&S<M}function Xu(S){var M=S&&S.constructor;return S===(typeof M=="function"&&M.prototype||et)}function cn(S){if(S!=null){try{return mt.call(S)}catch{}try{return S+""}catch{}}return""}function Qu(S,M){return S===M||S!=S&&M!=M}(Te&&ln(new Te(new ArrayBuffer(1)))!=C||Pe&&ln(new Pe)!=d||xt&&ln(xt.resolve())!=h||A&&ln(new A)!=g||P&&ln(new P)!=D)&&(ln=function(S){var M=ze.call(S),Z=M==p?S.constructor:void 0,de=Z?cn(Z):void 0;if(de)switch(de){case J:return C;case be:return d;case z:return h;case ee:return g;case ae:return D}return M});var xs=Array.isArray;function ed(S){return S!=null&&(function(M){return typeof M=="number"&&M>-1&&M%1==0&&M<=o})(S.length)&&!td(S)}var w5=Le||function(){return!1};function td(S){var M=go(S)?ze.call(S):"";return M==c||M==u}function go(S){var M=typeof S;return!!S&&(M=="object"||M=="function")}function ks(S){return ed(S)?po(S):(function(M){if(!Xu(M))return Ye(M);var Z=[];for(var de in Object(M))He.call(M,de)&&de!="constructor"&&Z.push(de);return Z})(S)}t.exports=function(S){return ws(S,!0,!0)}})(Qo,Qo.exports)),Qo.exports),Fa=qt(H1),U1=(function(){if(Na)return Sa;Na=1;var t=9007199254740991,n="[object Arguments]",r="[object Function]",o="[object GeneratorFunction]",i=/^(?:0|[1-9]\d*)$/;function a(x,V){for(var T=-1,L=x?x.length:0;++T<L&&V(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,V){var T=C(x)||(function(U){return(function(G){return(function(W){return!!W&&typeof W=="object"})(G)&&B(G)})(U)&&d.call(U,"callee")&&(!p.call(U,"callee")||f.call(U)==n)})(x)?(function(U,G){for(var W=-1,K=Array(U);++W<U;)K[W]=G(W);return K})(x.length,String):[],L=T.length,R=!!L;for(var I in x)!d.call(x,I)||R&&(I=="length"||w(I,L))||T.push(I);return T}var g,y=(g=function(x,V){return x&&v(x,V,k)},function(x,V){if(x==null)return x;if(!B(x))return g(x,V);for(var T=x.length,L=-1,R=Object(x);++L<T&&V(R[L],L,R)!==!1;);return x}),v=function(x,V,T){for(var L=-1,R=Object(x),I=T(x),U=I.length;U--;){var G=I[++L];if(V(R[G],G,R)===!1)break}return x};function D(x){if(T=(V=x)&&V.constructor,L=typeof T=="function"&&T.prototype||u,V!==L)return h(x);var V,T,L,R=[];for(var I in Object(x))d.call(x,I)&&I!="constructor"&&R.push(I);return R}function w(x,V){return!!(V=V??t)&&(typeof x=="number"||i.test(x))&&x>-1&&x%1==0&&x<V}var C=Array.isArray;function B(x){return x!=null&&(function(V){return typeof V=="number"&&V>-1&&V%1==0&&V<=t})(x.length)&&!(function(V){var T=(function(L){var R=typeof L;return!!L&&(R=="object"||R=="function")})(V)?f.call(V):"";return T==r||T==o})(x)}function k(x){return B(x)?m(x):D(x)}function E(x){return x}return Sa=function(x,V){return(C(x)?a:y)(x,typeof V=="function"?V:E)}})(),Va=qt(U1),Oa={},dt={CREATED:"created",DESTROYED:"destroyed",CHANGE:"change",SCROLL:"scroll",FULLSCREEN:"fullscreen",UNFULLSCREEN:"unFullScreen"},$n={};function W1(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&&(Oa[l]=c)})(r,a)}var ei=new WeakMap,ti=new WeakMap,ni=new WeakMap,br=new WeakMap,ri=new WeakMap,Cr=new WeakMap,oi=new WeakMap,ii=new WeakMap,vr=new WeakMap,Ta=new WeakMap,ja=new WeakMap,La=new WeakMap,Pa=new WeakMap,In=new WeakMap,bn=new WeakMap,si=new WeakMap,Dr=new WeakMap,ai=new WeakMap,wr=new WeakMap,Br=new WeakMap,Ma=new WeakMap,tn=new WeakMap,li=new WeakMap,za=new WeakMap,ci=new WeakMap,q1=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=Ta.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},Ia=new Set(["doctype","!doctype","meta","script","style","link","frame","iframe","title","svg"]);function Ra(t){return t!==null&&typeof t=="object"&&"constructor"in t&&t.constructor===Object}function ui(t,n){t===void 0&&(t={}),n===void 0&&(n={}),Object.keys(n).forEach((function(r){t[r]===void 0?t[r]=n[r]:Ra(n[r])&&Ra(t[r])&&Object.keys(n[r]).length>0&&ui(t[r],n[r])}))}var Ha={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 ui(t,Ha),t}var K1={document:Ha,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 ui(t,K1),t}function di(t){return di=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},di(t)}function xr(t,n){return xr=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},xr(t,n)}function fi(t,n,r){return fi=(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},fi.apply(null,arguments)}function pi(t){var n=typeof Map=="function"?new Map:void 0;return pi=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 fi(r,arguments,di(this).constructor)}return o.prototype=Object.create(r.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),xr(o,r)},pi(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})(pi(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 Ua(t,n){return Array.prototype.filter.call(t,n)}function F(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 Ua(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 Sr(t){for(var n=0;n<this.length;n+=1)this[n].removeAttribute(t);return this}function Nr(){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),F(v).is(i))a.apply(v,D);else for(var w=F(v).parents(),C=0;C<w.length;C+=1)F(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 Wa(){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 qa(){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 Ka(t){return t?(this.forEach((function(n,r){t.apply(n,[n,r])})),this):this}function Ja(t){return F(Ua(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 Ga(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=F(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 Ya(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?F(this[r].parentNode).is(t)&&n.push(this[r].parentNode):n.push(this[r].parentNode));return F(n)}function Ir(t){for(var n=[],r=0;r<this.length;r+=1)for(var o=this[r].parentNode;o;)t?F(o).is(t)&&n.push(o):n.push(o),o=o.parentNode;return F(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 F(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&&!F(o[i]).is(t)||n.push(o[i]);return F(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}F.fn=Kt.prototype;var J1="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)J1.indexOf(Dn)<0&&(Dn in this[o]?this[o][Dn]():F(this[o]).trigger(Dn));return this}return this.on.apply(this,[Dn].concat(n))});const G1=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];let Y1=(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 wt(t){Promise.resolve().then(t)}var Ot,Hn=function(t){return Object.prototype.toString.call(t)};Pr&&(F.fn.css=Pr),vn&&(F.fn.append=vn),Er&&(F.fn.addClass=Er),_r&&(F.fn.removeClass=_r),Ar&&(F.fn.hasClass=Ar),Vr&&(F.fn.on=Vr),qr&&(F.fn.focus=qr),Cn&&(F.fn.attr=Cn),Sr&&(F.fn.removeAttr=Sr),jr&&(F.fn.hide=jr),Lr&&(F.fn.show=Lr),qa&&(F.fn.offset=qa),Or&&(F.fn.width=Or),Tr&&(F.fn.height=Tr),$r&&(F.fn.parent=$r),Ir&&(F.fn.parents=Ir),Ga&&(F.fn.is=Ga),Nr&&(F.fn.dataset=Nr),Fr&&(F.fn.val=Fr),zr&&(F.fn.text=zr),Mr&&(F.fn.html=Mr),Hr&&(F.fn.children=Hr),Ur&&(F.fn.remove=Ur),Rr&&(F.fn.find=Rr),Ka&&(F.fn.each=Ka),Wr&&(F.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"})(Ot||(Ot={}));var Z1=/\[object HTML([A-Z][a-z]*)*Element\]/,rn=function(t){return t!=null&&typeof t.nodeType=="number"},Za=function(t){return rn(t)&&t.nodeType===Ot.COMMENT_NODE},ft=function(t){return rn(t)&&t.nodeType===Ot.ELEMENT_NODE},Xa=function(t){return Hn(t)==="[object Selection]"},$t=function(t){return rn(t)&&t.nodeType===Ot.TEXT_NODE},hi=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},Qa=function(t,n,r){for(var o=t.childNodes,i=o[n],a=n,l=!1,c=!1;(Za(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]},X1=function(t,n,r){return $(Qa(t,n,r),1)[0]},el=function(t){var n,r,o="";if($t(t)&&t.nodeValue)return t.nodeValue;if(ft(t)){try{for(var i=lt(Array.from(t.childNodes)),a=i.next();!a.done;a=i.next()){var l=a.value;o+=el(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+=`
@@ -34,7 +34,7 @@ You has disabled editor scroll, please do this yourself`,void console.warn(o)}va
34
34
  `).concat(c,`
35
35
  </li>
36
36
  `));return i.prepend(u),i[0]},t})(),_g=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title=se("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 De(n,t),n})(Xc),Ag=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title=se("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 De(n,t),n})(Xc),Qc=["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)"],Sg={selector:"font",preParseHtml:function(t){var n=F(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 Ng={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(!q.isText(t))return n;var r,o=t,i=o.color,a=o.bgColor;return i||a?((Gi(n)||ao(r=F(n))!=="span")&&(r=F("<span>".concat(n,"</span>"))),i&&r.css("color",i),a&&r.css("background-color",a),_n(r)):n},preParseHtml:[Sg],parseStyleHtml:function(t,n,r){var o=F(t);if(!q.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 Ag},config:{colors:Qc}},{key:"bgColor",factory:function(){return new _g},config:{colors:Qc}}]},Fg=(function(){function t(){this.title=se("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})(),Vg={menus:[{key:"enter",factory:function(){return new Fg}}]},Og={type:"divider",elemToHtml:function(t,n){return"<hr/>"}},Tg=(function(){function t(){this.title=se("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||!!N.getSelectedElems(n).some((function(r){if(n.isVoid(r))return!0;var o=N.getNodeType(r);return o==="table"||o==="pre"}))},t.prototype.exec=function(n,r){N.isSelectedEmptyParagraph(n)&&O.removeNodes(n,{mode:"highest"}),O.insertNodes(n,{type:"divider",children:[{text:""}]},{mode:"highest"})},t})(),jg={renderElems:[{type:"divider",renderElem:function(t,n,r){return ht("div",{props:{contentEditable:!1,className:"w-e-textarea-divider"},dataset:{selected:N.isNodeSelected(r,t)?"true":""},style:{},on:{mousedown:function(o){return o.preventDefault()}}},[ht("hr")])}}],elemsToHtml:[Og],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 Tg}}],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(N.getNodeType(l)!=="divider")return r([l,c]);N.isLastNode(o,l)&&O.insertNodes(o,N.genEmptyParagraph(),{at:[c[0]+1]})},o}},Lg=(function(){function t(){this.title=se("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 N.getNodeType(o)==="pre"||!!b.isVoid(n,o)},universal:!0}),1);return!!r[0]},t.prototype.getPanelContentElem=function(n){if(this.$content==null){var r=F('<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=F(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=F("<li>".concat(a,"</li>"));o.append(l)})),o[0]},t})(),Pg={menus:[{key:"emotion",factory:function(){return new Lg},config:{emotions:"😀 😃 😄 😁 😆 😅 😂 🤣 😊 😇 🙂 🙃 😉 😌 😍 😘 😗 😙 😚 😋 😛 😝 😜 🤓 😎 😏 😒 😞 😔 😟 😕 🙁 😣 😖 😫 😩 😢 😭 😤 😠 😡 😳 😱 😨 🤗 🤔 😶 😑 😬 🙄 😯 😴 😷 🤑 😈 🤡 💩 👻 💀 👀 👣 👐 🙌 👏 🤝 👍 👎 👊 ✊ 🤛 🤜 🤞 ✌️ 🤘 👌 👈 👉 👆 👇 ☝️ ✋ 🤚 🖐 🖖 👋 🤙 💪 🖕 ✍️ 🙏".split(" ")}}]},eu=(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 N.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})(),Mg=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title=se("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 De(n,t),n.prototype.getOptions=function(r){var o=[],i=r.getMenuConfig(this.mark).fontFamilyList,a=i===void 0?[]:i;o.push({text:se("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})(eu),zg=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title=se("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 De(n,t),n.prototype.getOptions=function(r){var o=[],i=r.getMenuConfig(this.mark).fontSizeList,a=i===void 0?[]:i;o.push({text:se("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})(eu),$g={1:"12px",2:"14px",3:"16px",4:"19px",5:"24px",6:"32px",7:"48px"},Ig={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(!q.isText(t))return n;var r,o=t,i=o.fontSize,a=o.fontFamily;return i||a?((Gi(n)||ao(r=F(n))!=="span")&&(r=F("<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=F(t);if(ao(n)!=="font")return t;var r=n.attr("size")||"";r&&(n.removeAttr("size"),n.css("font-size",$g[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=F(t);if(!q.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 zg},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 Mg},config:{fontFamilyList:["黑体",{name:"仿宋",value:"仿宋"},"楷体","标楷体","华文仿宋","华文楷体",{name:"宋体",value:"宋体"},"微软雅黑","Arial","Tahoma","Verdana","Times New Roman","Courier New"]}}]},Yi=(function(){function t(){this.title=se("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=lt(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})(),Rg={menus:[{key:"formatPainter",factory:function(){return new Yi}}],editorPlugin:function(t){var n=new Yi,r=t.onChange,o=t,i=function(){n.setFormatHtml(o),document.removeEventListener("mouseup",i)};return o.onChange=function(){r(),Yi.attrs.isSelect&&(document.removeEventListener("mouseup",i),document.addEventListener("mouseup",i))},o}},Hg=(function(){function t(){this.title=se("fullScreen.title"),this.iconSvg=Zc,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?Zc:'<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?se("fullScreen.title"):se("fullScreen.cancelTitle")},t.prototype.exec=function(n,r){n.isFullScreen?n.unFullScreen():n.fullScreen()},t})(),Ug={menus:[{key:"fullScreen",factory:function(){return new Hg}}]};function An(t){return function(n,r){return"<h".concat(t,">").concat(r,"</h").concat(t,">")}}var Wg={type:"header1",elemToHtml:An(1)},qg={type:"header2",elemToHtml:An(2)},Kg={type:"header3",elemToHtml:An(3)},Jg={type:"header4",elemToHtml:An(4)},Gg={type:"header5",elemToHtml:An(5)},Yg={type:"header6",elemToHtml:An(6)};function tu(t){var n=$(b.nodes(t,{match:function(i){return N.getNodeType(i).startsWith("header")},universal:!0}),1),r=n[0];if(r==null)return"paragraph";var o=$(r,1)[0];return N.getNodeType(o)}function nu(t){if(t.selection==null)return!0;var n=$(b.nodes(t,{match:function(r){var o=N.getNodeType(r);return o==="paragraph"||!!o.startsWith("header")},universal:!0,mode:"highest"}),1);return!n[0]}function ru(t,n){n&&O.setNodes(t,{type:n})}var Sn=(function(){function t(){this.tag="button"}return t.prototype.getValue=function(n){return tu(n)},t.prototype.isActive=function(n){return this.getValue(n)===this.type},t.prototype.isDisabled=function(n){return nu(n)},t.prototype.exec=function(n,r){var o=this.type;ru(n,r===o?"paragraph":o)},t})(),Zg=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title="H1",r.type="header1",r}return De(n,t),n})(Sn),Xg=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title="H2",r.type="header2",r}return De(n,t),n})(Sn),Qg=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title="H3",r.type="header3",r}return De(n,t),n})(Sn),e2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title="H4",r.type="header4",r}return De(n,t),n})(Sn),t2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title="H5",r.type="header5",r}return De(n,t),n})(Sn),n2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title="H6",r.type="header6",r}return De(n,t),n})(Sn),r2=(function(){function t(){this.title=se("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:se("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 tu(n)},t.prototype.isDisabled=function(n){return nu(n)},t.prototype.exec=function(n,r){ru(n,r.toString())},t})(),o2={key:"headerSelect",factory:function(){return new r2}},i2={key:"header1",factory:function(){return new Zg}},s2={key:"header2",factory:function(){return new Xg}},a2={key:"header3",factory:function(){return new Qg}},l2={key:"header4",factory:function(){return new e2}},c2={key:"header5",factory:function(){return new t2}},u2={key:"header6",factory:function(){return new n2}};function Nn(t){return function(n,r,o){var i=F(n);return(r=r.filter((function(a){return!!q.isText(a)||!!o.isInline(a)}))).length===0&&(r=[{text:i.text().replace(/\s+/gm," ")}]),{type:"header".concat(t),children:r}}}var d2={selector:"h1:not([data-w-e-type])",parseElemHtml:Nn(1)},f2={selector:"h2:not([data-w-e-type])",parseElemHtml:Nn(2)},p2={selector:"h3:not([data-w-e-type])",parseElemHtml:Nn(3)},h2={selector:"h4:not([data-w-e-type])",parseElemHtml:Nn(4)},m2={selector:"h5:not([data-w-e-type])",parseElemHtml:Nn(5)},g2={selector:"h6:not([data-w-e-type])",parseElemHtml:Nn(6)};function Fn(t){return function(n,r,o){return je("h".concat(t),null,r)}}var y2={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:[Wg,qg,Kg,Jg,Gg,Yg],parseElemsHtml:[d2,f2,p2,h2,m2,g2],menus:[o2,i2,s2,a2,l2,c2,u2],editorPlugin:function(t){var n=t.insertBreak,r=t;return r.insertBreak=function(){var o=$(b.nodes(r,{match:function(a){return N.getNodeType(a).startsWith("header")},universal:!0}),1),i=o[0];i&&N.isSelectionAtLineEnd(t,i[1])?O.insertNodes(r,{type:"paragraph",children:[{text:""}]},{mode:"highest"}):n()},r}},ou=(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=N.getNodeType(i);return a==="paragraph"||!!a.startsWith("header")},universal:!0,mode:"highest"}),1),o=r[0];return o==null?null:o[0]},t})(),b2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title=se("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 De(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})(ou),C2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title=se("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 De(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(q.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})(ou),v2={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=F(n);return o.css("text-indent",r),_n(o)},preParseHtml:[{selector:"p,h1,h2,h3,h4,h5",preParseHtml:function(t){var n=F(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=F(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 C2}},{key:"delIndent",factory:function(){return new b2}}]},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||!!N.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})(),D2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title=se("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 De(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),w2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title=se("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 De(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),B2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title=se("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 De(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),x2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.title=se("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 De(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),k2={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=F(n);return o.css("text-align",r),_n(o)},parseStyleHtml:function(t,n,r){var o=F(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 B2}},{key:"justifyRight",factory:function(){return new x2}},{key:"justifyCenter",factory:function(){return new D2}},{key:"justifyJustify",factory:function(){return new w2}}]},E2=(function(){function t(){this.title=se("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:se("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=N.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})(),_2={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=F(n);return o.css("line-height",r),_n(o)},parseStyleHtml:function(t,n,r){var o=F(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 E2},config:{lineHeightList:["1","1.15","1.5","2","2.5","3"]}}]},A2={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 iu(t){return t===void 0&&(t="r"),"".concat(t,"-").concat(Y1())}function su(t){return t.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function au(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 lu(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 Zi(t){return t.selection==null||!!N.getSelectedElems(t).some((function(n){var r=n.type;return!!t.isVoid(n)||!!["pre","code","link"].includes(r)}))}function Xi(t,n){return{type:"link",url:su(t),children:n?[{text:n}]:[]}}function cu(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(),Zi(t)?[2]:[4,au("insertLink",t,n,r)]):[2];case 1:return u.sent()?[4,lu("insertLink",t,r)]:[2];case 2:if(o=u.sent(),(i=t.selection)==null)return[2];if(j.isCollapsed(i)){if((l=N.getLeftLengthOfMaxLength(t))<=0)return[2];t.insertText(" "),l<n.length+1&&(n=n.slice(0,l-1)),c=Xi(o,n),O.insertNodes(t,c),t.insertFragment([{text:" "}])}else if((a=b.string(t,i))!==n){if((l=N.getLeftLengthOfMaxLength(t))<=0)return[2];l<a.length-n.length&&(n=n.slice(0,l)),t.deleteFragment(),c=Xi(o,n),O.insertNodes(t,c)}else c=Xi(o),O.wrapNodes(t,c,{split:!0}),O.collapse(t,{edge:"end"});return[2]}}))}))}function uu(){return iu("w-e-update-link")}var S2=(function(){function t(){this.title=se("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=uu(),this.buttonId=uu()}return t.prototype.getSelectedLinkElem=function(n){var r=N.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 N.getSelectedNodeByType(n,"link")},t.prototype.getModalContentElem=function(n){var r=this.urlInputId,o=this.buttonId,i=$(zi(se("link.url"),r),2),a=i[0],l=F(i[1]),c=$(Cc(o,se("common.ok")),1)[0];if(this.$content==null){var u=F("<div></div>");u.on("click","#".concat(o),(function(p){p.preventDefault(),n.restoreSelection();var h=N.getSelectedNodeByType(n,"link"),m=h?H.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,au("editLink",y,v,D)]:[2];case 1:return B.sent()?[4,lu("editLink",y,D)]:[2];case 2:return w=B.sent(),C={url:su(w)},O.setNodes(y,C,{match:function(k){return N.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 Qi(){return iu("w-e-insert-link")}var N2=(function(){function t(){this.title=se("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=Qi(),this.urlInputId=Qi(),this.buttonId=Qi()}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 Zi(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=$(zi(se("link.text"),i),2),u=c[0],d=F(c[1]),f=$(zi(se("link.url"),a),2),p=f[0],h=F(f[1]),m=$(Cc(l,se("common.ok")),1)[0];if(this.$content==null){var g=F("<div></div>");g.on("click","#".concat(l),(function(D){D.preventDefault();var w=g.find("#".concat(i)).val(),C=g.find("#".concat(a)).val();cu(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})(),F2=(function(){function t(){this.title=se("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||N.getSelectedNodeByType(n,"link")==null},t.prototype.exec=function(n,r){this.isDisabled(n)||O.unwrapNodes(n,{match:function(o){return N.checkNodeType(o,"link")}})},t})(),V2=(function(){function t(){this.title=se("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=N.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})(),du={checkLink:function(t,n){return!0},parseLinkUrl:function(t){return t}},O2={key:"insertLink",factory:function(){return new N2},config:du},T2={key:"editLink",factory:function(){return new S2},config:du},j2={key:"unLink",factory:function(){return new F2}},L2={key:"viewLink",factory:function(){return new V2}},es,fu,P2={selector:"a:not([data-w-e-type])",parseElemHtml:function(t,n,r){var o=F(t);return(n=n.filter((function(i){return!!q.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}}},M2=qt((function(){if(fu)return es;fu=1,es=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 es})()),z2={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)}},$2={renderElems:[z2],elemsToHtml:[A2],parseElemsHtml:[P2],menus:[O2,T2,j2,L2],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(M2(l)){if(/<img[^>]+>/.test(a.getData("text/html")))r(a);else if(!Zi(i)){var c=i.selection;if(c!=null){var u=b.string(i,c);cu(i,u,l)}}}else r(a)},i.normalizeNode=function(a){var l=$(a,2),c=l[0],u=l[1];return N.getNodeType(c)!=="link"?o([c,u]):H.string(c)===""?O.removeNodes(i,{at:u}):o([c,u])},i}},I2={selector:"p:not([data-w-e-type])",parseElemHtml:function(t,n,r){var o=F(t);return(n=n.filter((function(i){return!!q.isText(i)||!!r.isInline(i)}))).length===0&&(n=[{text:o.text().replace(/\s+/gm," ")}]),{type:"paragraph",children:n}}};function pu(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"||H.string(o)!=="")return!1;var i=o.children,a=i===void 0?[]:i;return!!q.isText(a[0])&&(O.setNodes(t,{type:"paragraph"}),!0)}var R2={type:"paragraph",renderElem:function(t,n,r){return je("p",null,n)}},H2={renderElems:[R2],elemsToHtml:[{type:"paragraph",elemToHtml:function(t,n){return n===""?"<p><br></p>":"<p>".concat(n,"</p>")}}],parseElemsHtml:[I2],editorPlugin:function(t){var n=t.deleteBackward,r=t.deleteForward,o=t;return o.deleteBackward=function(i){pu(o)||n(i)},o.deleteForward=function(i){pu(o)||r(i)},o}};function hu(t,n){if(t.selection==null)return!0;var r=$(b.nodes(t,{match:function(o){return N.getNodeType(o)==="pre"||!!b.isVoid(t,o)},universal:!0}),1);return!!r[0]}function U2(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 hu(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})(),W2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.mark="bold",r.title=se("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 De(n,t),n})(sn),q2=(function(){function t(){this.title=se("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 hu(n)},t.prototype.exec=function(n,r){var o,i,a=b.nodes(n,{match:function(u){return q.isText(u)},universal:!0});try{for(var l=lt(a),c=l.next();!c.done;c=l.next())U2(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})(),K2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.mark="code",r.title=se("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 De(n,t),n})(sn),J2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.mark="italic",r.title=se("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 De(n,t),n})(sn),G2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.mark="sub",r.marksNeedToRemove=["sup"],r.title=se("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 De(n,t),n})(sn),Y2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.mark="sup",r.marksNeedToRemove=["sub"],r.title=se("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 De(n,t),n})(sn),Z2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.mark="through",r.title=se("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 De(n,t),n})(sn),X2=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.mark="underline",r.title=se("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 De(n,t),n})(sn);function an(t,n){return t.length!==0&&(!!t[0].matches(n)||t.find(n).length>0)}function mu(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 Q2={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 W2}},{key:"underline",factory:function(){return new X2}},{key:"italic",factory:function(){return new J2}},{key:"through",factory:function(){return new Z2}},{key:"code",factory:function(){return new K2}},{key:"sub",factory:function(){return new G2}},{key:"sup",factory:function(){return new Y2}},{key:"clearStyle",factory:function(){return new q2}}],styleToHtml:function(t,n){if(!q.isText(t))return n;if(Gi(n))return mu(t,n);var r=F(n),o=r.html();return o=mu(t,o),r.html(o),_n(r)},parseStyleHtml:function(t,n,r){var o=F(t);if(!q.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}},ey=(function(){function t(){this.title=se("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})(),ty=(function(){function t(){this.title=se("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})(),ny=[Q2,Ng,Ig,v2,k2,_2,jg,Pg,$2,y2,H2,Rg,{menus:[{key:"redo",factory:function(){return new ey}},{key:"undo",factory:function(){return new ty}}]},Ug,Vg];kn("en",{listModule:{unOrderedList:"Unordered list",orderedList:"Ordered list"}}),kn("zh-CN",{listModule:{unOrderedList:"无序列表",orderedList:"有序列表"}});var ts=new WeakMap;function gu(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];q.isText(a)&&(n=a)}return n==null?"":n.color||""}function yu(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=N.findPath(t,n),c=l;;){if(c.length===0||l[l.length-1]===0)return null;c=_.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(N.getNodeType(d)!==o)return null;if(p===a)return d}}function bu(t,n,r){var o=yu(t,n,r);return!!o&&o.ordered===n.ordered}var Cu=[],ry={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=ts.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=N.findPath(m,h);if(B[0]===0)return C+1;var k=_.previous(B),E=b.node(m,k);if(!E)return 0;var x=$(E,1)[0];if(N.getNodeType(x)!==y)return C+1;var V=x,T=V.ordered,L=T!==void 0&&T,R=V.level,I=R===void 0?0:R;return I<C?C-I:I>C?bu(m,h)?0:1:I===C?L===D?0:1:0})(t);if(l>0)for(var c=0;c<l;c+=1)r+="<".concat(a,">"),Cu.push(a);var u=(function(h){var m=ts.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=N.findPath(m,h);if(B[0]===m.children.length-1)return C+1;var k=_.next(B),E=b.node(m,k);if(!E)return 0;var x=$(E,1)[0];if(N.getNodeType(x)!==y)return C+1;var V=x,T=V.ordered,L=T!==void 0&&T,R=V.level,I=R===void 0?0:R;return I<C?bu(m,x)?C-I:C-I+1:I>C?0:I===C?L===D?0:1:0})(t);if(u>0)for(c=0;c<u;c+=1){var d=Cu.pop();o+="</".concat(d,">")}var f=gu(t),p=f?' style="color:'.concat(f,'"'):"";return{html:"<li".concat(p,">").concat(n,"</li>"),prefix:r,suffix:o}}},vu=(function(){function t(){this.type="list-item",this.tag="button"}return t.prototype.getListNode=function(n){var r=this.type;return N.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||!!N.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})(),oy=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.ordered=!1,r.title=se("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 De(n,t),n})(vu),iy=(function(t){function n(){var r=t.apply(this,ke([],$(arguments),!1))||this;return r.ordered=!0,r.title=se("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 De(n,t),n})(vu),sy={key:"bulletedList",factory:function(){return new oy}},ay={key:"numberedList",factory:function(){return new iy}};function ns(t){return t.length?t[0].tagName.toLowerCase():""}vn&&(F.fn.append=vn),Cn&&(F.fn.attr=Cn),$r&&(F.fn.parent=$r);var ly={selector:"li:not([data-w-e-type])",parseElemHtml:function(t,n,r){var o=F(t);(n=n.filter((function(l){return!!q.isText(l)||!!r.isInline(l)}))).length===0&&(n=[{text:o.text().replace(/\s+/gm," ")}]);var i=(function(l){return ns(l.parent())==="ol"})(o),a=(function(l){for(var c=0,u=l.parent(),d=ns(u);d==="ul"||d==="ol";)d=ns(u=u.parent()),c+=1;return c-1})(o);return{type:"list-item",ordered:i,level:a,children:n}}},cy={selector:"ul:not([data-w-e-type]),ol:not([data-w-e-type])",parseElemHtml:function(t,n,r){return n.flat(1/0)}};function Du(t){return b.nodes(t,{at:t.selection||void 0,match:function(n){return N.findPath(t,n).length===1}})}var uy={type:"list-item",renderElem:function(t,n,r){ts.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=N.findPath(p,B);if(k[0]===0)return 1;for(;k[0]>0;){var E=_.previous(k),x=b.node(p,E);if(x==null)break;var V=x[0],T=V.level,L=T===void 0?0:T,R=V.type,I=V.ordered;if(R!==g||L<v)break;if(L===v){if(I!==w)break;C+=1}B=V,k=E}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:gu(t)},"data-w-e-reserve":!0},d),je("span",{style:{flex:"1",wordBreak:"break-word"}},n))}},dy={renderElems:[uy],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 N.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=N.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=yu(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=N.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=lt(Du(a)),D=v.next();!D.done;D=v.next()){var w=$(D.value,1)[0];N.getNodeType(w)==="list-item"?g+=1:y=!0}}catch(V){l={error:V}}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=lt(Du(a)),B=C.next();!B.done;B=C.next()){var k=$(B.value,2),E=(w=k[0],k[1]),x=w.level;m=x===void 0?0:x,O.setNodes(a,{level:m+1},{at:E})}}catch(V){u={error:V}}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=N.getNodeType(u);return f!=="bulleted-list"&&f!=="numbered-list"||O.unwrapNodes(a,{at:d}),o([u,d])},a},menus:[sy,ay],elemsToHtml:[ry],parseElemsHtml:[cy,ly]},Qe=(function(){function t(){throw new Error(`不能实例化
37
- 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){W1(n,r)},t.registerRenderElem=function(n){var r,o,i;o=(r=n).type,i=r.renderElem,Kc[o||""]=i},t.registerRenderStyle=function(n){(function(r){qi.push(r)})(n)},t.registerElemToHtml=function(n){(function(r){var o=r.type,i=r.elemToHtml;dl[o||""]=i})(n)},t.registerStyleToHtml=function(n){(function(r){gi.push(r)})(n)},t.registerPreParseHtml=function(n){var r;r=n,il.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){rs(n)},t.editorConfig={},t.simpleEditorConfig={},t.toolbarConfig={},t.simpleToolbarConfig={},t.plugins=[],t})();function rs(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 Qe.registerMenu(f)})),r&&r.forEach((function(f){return Qe.registerRenderElem(f)})),o&&Qe.registerRenderStyle(o),i&&i.forEach((function(f){return Qe.registerElemToHtml(f)})),a&&Qe.registerStyleToHtml(a),l&&l.forEach((function(f){return Qe.registerPreParseHtml(f)})),c&&c.forEach((function(f){return Qe.registerParseElemHtml(f)})),u&&Qe.registerParseStyleHtml(u),d&&Qe.registerPlugin(d)}ny.forEach((function(t){return rs(t)})),rs(dy);var fy='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>',py='<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>',hy='<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>',wu={link:{menuKeys:["editLink","unLink","viewLink"]},pre:{menuKeys:["enter","codeBlock","codeSelectLang"]},divider:{menuKeys:["enter"]}},my={hoverbarKeys:me(me({},wu),{text:{menuKeys:["formatPainter","headerSelect","insertLink","bulletedList","|","bold","through","color","bgColor","clearStyle"]}})};Qe.setEditorConfig(me({},my));var gy={hoverbarKeys:wu};Qe.setSimpleEditorConfig(me({},gy));var yy={toolbarKeys:["headerSelect","|","bold","underline","italic",{key:"group-more-style",title:se("editor.more"),iconSvg:hy,menuKeys:["through","code","sup","sub","clearStyle"]},"color","bgColor","|","fontSize","fontFamily","lineHeight","|","bulletedList","numberedList",{key:"group-justify",title:se("editor.justify"),iconSvg:py,menuKeys:["justifyLeft","justifyRight","justifyCenter","justifyJustify"]},{key:"group-indent",title:se("editor.indent"),iconSvg:fy,menuKeys:["indent","delIndent"]},"|","emotion","divider","|","undo","redo","|","formatPainter","fullScreen"]};Qe.setToolbarConfig(yy);var by={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 Cy(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"?Qe.simpleEditorConfig:Qe.editorConfig,f=me(me({},d.hoverbarKeys||{}),c.hoverbarKeys||{});return xg({selector:r,config:me(me(me({},d),c),{hoverbarKeys:f}),content:i,html:a,plugins:Qe.plugins})}function vy(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=Qe.toolbarConfig;return Eg(r,{selector:n,config:me(me({},a),i)})}Qe.setSimpleToolbarConfig(by);class Dy{constructor(){this.title="播放视频",this.tag="button"}getValue(n){return!1}isActive(n){return!1}isDisabled(n){return!1}exec(n){const r=N.getSelectedNodeByType(n,"video");console.log(r);const{view:o}=n.getMenuConfig("video");o(r)}}class Bu{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=>N.checkNodeType(r,this.type)}),n.children.length==0){const r={type:"paragraph",children:[{text:""}]};n.insertNode(r)}}}class wy{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=N.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 By{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 xy{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 ky={key:"viewVideo",factory(){return new Dy}},Ey={key:"delVideo",factory(){return new Bu("video")}},_y={key:"delImage",factory(){return new Bu("image")}},Ay={key:"insertBottom",factory(){return new xy}},Sy={key:"insertTop",factory(){return new By}},Ny={key:"delEmpty",factory(){return new wy}};class Fy{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 Vy={key:"image",factory(){return new Fy},config:{}};class Oy{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 Ty(t,n,r){const{id:o}=N.findKey(t,n);return`w-e-video-container-${o}`}function jy(t,n,r,o){const{width:i,height:a}=o,l={};i&&(l.width=i),a&&(l.height=a);const c=Ty(t,n),u=N.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 Ly(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 jy(r,t,d,{width:l,height:c})}const Py={type:"video",renderElem:Ly};function My(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 zy={type:"video",elemToHtml:My};function $y(t){const n=F(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 Iy={selector:"video",parseElemHtml:$y},Ry={key:"video",factory(){return new Oy},config:{}};function Hy(t,n){let r=0;return function(){const o=Date.now();o-r>=n&&(t.apply(this,arguments),r=o)}}function xu(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 ku(t,n){const{id:r}=N.findKey(t,n);return`w-e-image-container-${r}`}function Uy(t,n,r,o){const{width:i,height:a}=o,l={};i&&(l.width=i),a&&(l.height=a);const c=ku(t,n);return ht("div",{props:{id:c,className:"w-e-image-container"},style:l},[r])}function Wy(t,n,r,o){const i=ku(t,n),a=F("body"),{width:l,height:c}=o;let u=0,d=0,f=!1,p=null;function h(){const C=F(`#${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=N.getHoverbar(t);k&&k.hideAndClean()}const g=Hy(C=>{C.preventDefault();const{clientX:B}=C,k=f?u-B:B-u,E=d+k;p!=null&&(E<=15||(p.css("width",`${E}px`),p.css("height","auto")))},50);function y(){if(a.off("mousemove",g),p==null)return;const C=p.width().toFixed(2),B=F(".w-e-text-container").width(),k={style:{...n.style,width:`${(C/B*100).toFixed(2)}%`,height:"auto"}};let E=N.findPath(t,n);console.log(k,E),O.setNodes(t,k,{at:N.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=F(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 qy(t,n,r){const{src:o,href:i="",style:a={}}=t,{width:l="",height:c=""}=a,u=N.isNodeSelected(r,t),d={};l&&(d.width="100%"),c&&(d.height="100%"),d.maxWidth=F(".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?Wy(r,t,f,{width:l,height:c}):Uy(r,t,f,{width:l,height:c})}const Ky={type:"image",renderElem:qy},Jy={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 os{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||N.getSelectedElems(n).some(i=>{const{type:a}=i;if(n.isVoid(i)||["pre","code","link"].includes(a))return!0}))}exec(n){const r=N.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 Gy(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 Yy={type:"image",elemToHtml:Gy};function Zy(t){const n=F(t);let r=n.attr("data-href")||"";return r&&(r=decodeURIComponent(r)),{type:"image",src:$fileUrl(n.attr("src"))||"",href:r,style:{width:xu(n,"width"),height:xu(n,"height")},children:[{text:""}]}}const Xy={selector:"img:not([data-w-e-type])",parseElemHtml:Zy},Qy={key:"urlKey",factory(){return new os("text")}},e3={key:"linkUrlKey",factory(){return new os("link")}},t3={key:"imgUrlKey",factory(){return new os("image")}};function n3(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 r3={menus:[t3,Qy,e3,Vy,Ry,Ey,_y,ky,Ay,Sy,Ny],renderElems:[Ky,Py],parseElemsHtml:[Xy,Iy],elemsToHtml:[Yy,zy],editorPlugin:n3};Qe.registerModule(r3);const o3={components:{mediaBox:lr,urlBox:Hs},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=Jy,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=Cy({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","|"]},vy({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(N.getSelectedNodeByType(this.editor,"image"))O.setNodes(this.editor,{href:t},{match:r=>N.checkNodeType(r,"image")});else if(N.getSelectedNodeByType(this.editor,"link"))O.setNodes(this.editor,{url:t},{match:o=>N.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}}},i3={class:"pos-relative"},s3={class:"bg-black"},a3=["src"],l3={class:"dialog-footer"},c3={class:"dialog-footer"},u3={class:"dialog-footer flex justify-end"},d3={class:"pr"},f3={class:"bg-main z-999 b-1 b-solid b-color-[--el-border-color]"},p3={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"},h3={class:"b-0 b-b-1 b-solid b-color-[--el-border-color]",ref:"wangEditorToolbar"};function m3(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",i3,[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",l3,[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",s3,[s.createElementVNode("video",{src:i.videoNodes.src,controls:"",width:"100%",height:"360px"},null,8,a3)])]),_: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",c3,[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",u3,[s.createElementVNode("div",d3,[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",f3,[s.createElementVNode("div",p3,[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",h3,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 Eu=ne(o3,[["render",m3]]),g3=Object.freeze(Object.defineProperty({__proto__:null,default:Eu},Symbol.toStringTag,{value:"Module"})),y3={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})}}},b3={class:"dialog-footer"},C3={class:"image-text"},v3={class:"box"},D3={key:0,class:"no-data"},w3={key:0,class:"item text"},B3=["onClick"],x3=["onClick"],k3={key:1,class:"item img"},E3=["onClick"],_3=["onClick"],A3={class:"bottom"};function S3(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",b3,[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",C3,[s.createElementVNode("div",v3,[s.createVNode(p,{ref:"scrollbar",height:"100%"},{default:s.withCtx(()=>[i.list.length==0?(s.openBlock(),s.createElementBlock("div",D3," 点击下方按钮添加图片或者文字 ")):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",w3,[s.createElementVNode("p",null,s.toDisplayString(h.text),1),s.createElementVNode("div",{class:"del",onClick:g=>i.list.splice(m,1)}," 删除 ",8,B3),s.createElementVNode("div",{class:"edit",onClick:g=>a.editText(m)}," 编辑 ",8,x3)])):s.createCommentVNode("",!0),h.image?(s.openBlock(),s.createElementBlock("div",k3,[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,E3),s.createElementVNode("div",{class:"edit",onClick:g=>a.editImage(m)}," 编辑 ",8,_3)])):s.createCommentVNode("",!0)],64))),256))]),_:1},8,["list"])]),_:1},512)]),s.createElementVNode("div",A3,[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 _u=ne(y3,[["render",S3],["__scopeId","data-v-a908f232"]]),N3={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 F3(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 Au=ne(N3,[["render",F3]]),V3={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 O3(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 Su=ne(V3,[["render",O3]]),T3={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)}}},j3={class:"a-color-picker input-button w-full flex"};function L3(t,n,r,o,i,a){const l=s.resolveComponent("el-input"),c=s.resolveComponent("el-color-picker");return s.openBlock(),s.createElementBlock("div",j3,[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 Nu=ne(T3,[["render",L3]]),P3={上海:[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]},M3={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=P3[r];console.log(o,r),o&&this.setMap(o)}}},z3={class:"map"},$3={class:"input"},I3={class:"dialog-footer"},R3={key:1,class:"map"},H3={class:"input text-center bg-main"},U3={key:2,class:"input-button"};function W3(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",R3,[s.createElementVNode("div",H3,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",I3,[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",z3,[s.createElementVNode("div",$3,[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",U3,[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 is=ne(M3,[["render",W3],["__scopeId","data-v-9356e288"]]),ss=globalThis.dmxRegions??[],q3={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:ss}},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=ss},methods:{setList(t){let n=[];return ss.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 K3(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 Fu=ne(q3,[["render",K3]]),as=t=>t?Array.isArray(t)?typeof t[0]=="object"?t:t.map((n,r)=>({label:n,value:r})):typeof t=="object"?Object.keys(t).map(n=>({label:t[n],value:n})):[]:[],J3={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)}},ls=t=>s.defineAsyncComponent(t),G3=ls(()=>Promise.resolve().then(()=>K8)),Y3=ls(()=>Promise.resolve().then(()=>t5)),Z3=ls(()=>Promise.resolve().then(()=>p5)),Jt={media:u0,slot:J3,"input-select":yp,"group-tabs":G3,"group-table":Y3,group:Z3,md5:b0,file:m0,"search-box":Us,"input-auto":wp},Vu={input:{component:we.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:we.ElSelect,props:(t,n)=>({size:n.size,disabled:n._disabled,placeholder:t.placeholder||"请选择"}),children:(t,n)=>n.selectCols.map(r=>({component:s.markRaw(we.ElOption),props:{label:r.label,value:r.value}}))},radio:{component:we.ElRadioGroup,props:(t,n)=>({size:n.size,disabled:n._disabled}),children:(t,n)=>n.radioCols.map(r=>({component:s.markRaw(we.ElRadio),props:{value:r.value},children:r.label}))},"radio-button":{component:we.ElRadioGroup,props:(t,n)=>({size:n.size,disabled:n._disabled}),children:(t,n)=>n.radioCols.map(r=>({component:s.markRaw(we.ElRadioButton),props:{disabled:n._disabled,value:r.value},children:r.label}))},checkbox:{component:we.ElCheckboxGroup,props:(t,n)=>({size:n.size,disabled:n._disabled}),children:(t,n)=>n.checkboxCols.map(r=>({component:s.markRaw(we.ElCheckbox),props:{value:r.value},children:r.label}))},imgs:{component:Rs,props:(t,n)=>({size:n.size,limit:t.limit,cateId:t.cateId,disabled:n._disabled,tips:t.tips})},images:{component:Rs,props:(t,n)=>({size:n.size,limit:t.limit,"cate-id":t.cateId,disabled:n._disabled,tips:t.tips})},editor:{component:Eu,props:t=>({placeholder:t.placeholder})},"image-text":{component:_u,props:()=>({})},selects:{component:Au,props:(t,n)=>({disabled:n._disabled,placeholder:t.placeholder,url:t.url,remove:t.remove,level:t.level||0})},tags:{component:Su,props:()=>({})},color:{component:Nu,props:t=>({showAlpha:t.showAlpha,colorFormat:t.colorFormat})},map:{component:is},pickerMap:{component:is},region:{component:Fu,props:(t,n)=>({disabled:n._disabled,checkStrictly:t.checkStrictly,level:t.level})},url:{component:Xh,props:()=>({})},time:{component:we.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:we.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:we.ElDatePicker,props:(t,n)=>({size:n.size,disabled:n._disabled,type:"date",placeholder:"选择日期","value-format":"YYYY-MM-DD"})},dates:{component:we.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:we.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:we.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:we.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:we.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:we.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:we.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:we.ElInput,props:(t,n)=>({type:"password",autocomplete:"off",disabled:n._disabled,"show-password":!0,placeholder:t.placeholder||"输入密码"})},"input-button":{component:Fo,props:(t,n)=>({btn:t.btn,readonly:t.readonly,disabled:n._disabled,placeholder:t.placeholder,icon:t.icon})}},X3=(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}},Q3=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})):as(i.value.cols)),u=s.computed(()=>i.value.cols?as(i.value.cols):[{label:"是",value:!0},{label:"否",value:!1}]),d=s.computed(()=>as(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=X3(g,y);if(v){o.value={...v,component:s.markRaw(v.component)};return}const D=Vu[g]||Vu.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})},m=g=>{n("update:modelValue",g)};return s.onMounted(()=>{p(),h(),s.watch(r,g=>{let y=g;o.value.props.onChange||(typeof i.value.format=="function"&&(y=i.value.format(g)),n("update:modelValue",y))},{deep:!0})}),s.watch(()=>t.prop,()=>{p(),h()},{deep:!0}),{internalValue:r,currentComponent:o}}}),e4={class:"dmx-input-item"};function t4(t,n,r,o,i,a){return s.openBlock(),s.createElementBlock("div",e4,[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 cs=ne(Q3,[["render",t4]]),us=Object.freeze(Object.defineProperty({__proto__:null,default:cs},Symbol.toStringTag,{value:"Module"})),Ou=t=>{const n={};for(const r in t){const o=t[r];r.indexOf(".")>-1?dn(n,r,o):n[r]=o}return n},n4={name:"admin-form",components:{inputItem:cs,imgInfo:Ps},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 Ou({...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=Ou({...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)}})}}},r4={key:0},o4=["innerHTML"];function i4(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(["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",r4,[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,o4)],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 s4=ne(n4,[["render",i4]]),a4={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||"加载失败")}}},l4={key:1},c4={key:2},u4={class:"op-70"};function d4(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",l4,[s.renderSlot(t.$slots,"loading",{},()=>[s.createVNode(l,{rows:2,animated:""})])])):i.empty?(s.openBlock(),s.createElementBlock("div",c4,[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",u4,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 f4=ne(a4,[["render",d4]]),p4={props:{title:{type:String,default:"提示"},type:{type:String,default:"primary"}},data(){return{value:"",show:!1}},methods:{}},h4={class:"font-weight mb line-height"},m4={class:"text-color-primary"};function g4(t,n,r,o,i,a){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["a-tip","a-tip--"+r.type])},[s.createElementVNode("div",h4,[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",m4,[s.renderSlot(t.$slots,"default",{},void 0,!0)])],2)}const y4=ne(p4,[["render",g4],["__scopeId","data-v-b6ef9e08"]]),b4={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})}}},C4={key:0},v4={key:1,class:"text flex"},D4={class:"line-2"},w4={key:0,class:"i-ri-quill-pen-line ml-xs"};function B4(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",C4,[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",v4,[s.createElementVNode("div",D4,s.toDisplayString(r.text??r.defaultValue),1),!r.hideIcon||!r.text?(s.openBlock(),s.createElementBlock("i",w4)):s.createCommentVNode("",!0)]))],16)}const x4=ne(b4,[["render",B4],["__scopeId","data-v-26e8acc4"]]),k4={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)})}},E4={key:0,class:"cate-text overflow-hidden"},_4={class:"cate-show"};function A4(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",E4,[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",_4,[(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 S4=ne(k4,[["render",A4],["__scopeId","data-v-3c69ee7f"]]),N4={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 F4(t,n,r,o,i,a){return s.openBlock(),s.createElementBlock("span",null,s.toDisplayString(i.text),1)}const V4=ne(N4,[["render",F4]]),O4={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 T4(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 j4=ne(O4,[["render",T4],["__scopeId","data-v-7b602c3b"]]),L4={name:"a-region-text",props:{code:String|Number},data(){return{text:""}},created(){this.text=$a.util.codeArea(this.code)}};function P4(t,n,r,o,i,a){return s.openBlock(),s.createElementBlock("span",null,s.toDisplayString(i.text),1)}const M4=ne(L4,[["render",P4]]),z4={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)}},$4={class:"text-status"},I4={class:"text"};function R4(t,n,r,o,i,a){return s.openBlock(),s.createElementBlock("span",$4,[s.createElementVNode("span",{class:s.normalizeClass(["dot",i.color?"":"dot-"+r.status]),style:s.normalizeStyle("background-color:"+i.color)},null,6),s.createElementVNode("span",I4,[s.renderSlot(t.$slots,"default",{},void 0,!0)])])}const H4=ne(z4,[["render",R4],["__scopeId","data-v-99c2ca99"]]);function U4(t){const n=Object.create(null);return function(o){return n[o]||(n[o]=t(o))}}const W4=/-(\w)/g,Tu=U4(t=>t.replace(W4,(n,r)=>r?r.toUpperCase():""));function ds(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function ju(t,n,r){const o=r===0?t.children[0]:t.children[r-1].nextSibling;t.insertBefore(n,o)}function q4(t,n){return Object.values(t).indexOf(n)}function K4(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 Lu(t,n){this.$nextTick(()=>this.$emit(t.toLowerCase(),n))}function J4(t){return n=>{this.realList!==null&&this["onDrag"+t](n),Lu.call(this,t,n)}}function G4(t){return["transition-group","TransitionGroup"].includes(t)}function Y4(t){if(!t||t.length!==1)return!1;const[{type:n}]=t;return n?G4(n.name):!1}function Z4(t,n){return n?{...n.props,...n.attrs}:t}const fs=["Start","Add","Remove","Update","End"],ps=["Choose","Unchoose","Sort","Filter","Clone"],X4=["Move",...fs,...ps].map(t=>"on"+t);let hs=null;const Q4={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}},e6={name:"a-draggable",inheritAttrs:!1,emits:["update:modelValue","move","change",...fs.map(t=>t.toLowerCase()),...ps.map(t=>t.toLowerCase())],props:Q4,data(){return{transitionMode:!1,noneFunctionalComponentMode:!1,headerOffset:0,footerOffset:0,_sortable:{},visibleIndexes:[],context:{}}},render(){const t=this.$slots.default?this.$slots.default():null,n=Z4(this.$attrs,this.componentData);return t?(this.transitionMode=Y4(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={};fs.forEach(i=>{t["on"+i]=J4.call(this,i)}),ps.forEach(i=>{t["on"+i]=Lu.bind(this,i)});const n=Object.keys(this.$attrs).reduce((i,a)=>(i[Tu(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=Tu(n);X4.indexOf(r)===-1&&this._sortable.option(r,t[n])}},getChildrenNodes(){return this.$el.children},computeIndexes(){this.$nextTick(()=>{this.visibleIndexes=K4(this.getChildrenNodes(),this.$el.children,this.transitionMode,this.footerOffset)})},getUnderlyingVm(t){const n=q4(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),hs=t.item)},onDragAdd(t){const n=t.item._underlying_vm_;if(n===void 0)return;ds(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(ju(this.$el,t.item,t.oldIndex),t.pullMode==="clone"){ds(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){ds(t.item),ju(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(),hs=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(hs)!==-1||!n.willInsertAfter?i:i+1}}},t6=s.defineAsyncComponent(()=>Promise.resolve().then(()=>C5)),n6=s.defineAsyncComponent(()=>Promise.resolve().then(()=>g3)),ms={AdminTable:up,AdminForm:s4,DataApi:f4,ASearch:Ms,AInputs:cs,InputButton:Fo,ASearchBox:Us,ATip:y4,ATextEdit:x4,ACateText:S4,ACascader:Au,ATags:Su,ATime:V4,AImage:j4,AImageText:_u,AColorPicker:Nu,ARegionPicker:Fu,ARegionText:M4,ARegionMap:is,ATextStatus:H4,ADraggable:e6,AChart:t6,AEditor:n6};function r6(t){for(const n in ms)t.component(n,ms[n])}const o6={install:r6,components:ms},i6={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)}}},s6=function(...t){return t.reduce((n,r)=>So(n,r),{})},a6={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 l6(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 c6=t=>{const n=s6(a6,t);return l6(n),n},u6=t=>{if(typeof document<"u")return window.getComputedStyle(document.getElementById("app")).getPropertyValue(t)},d6=(t="")=>{const n={};return n.primary=u6("--el-color-primary"),t?n[t]:n},co="_exptime",At="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(At+t+co,o+"")}localStorage.setItem(At+t,JSON.stringify(n))},remove:function(t){localStorage.removeItem(At+t),localStorage.removeItem(At+t+co)},clear:function(){localStorage.clear()},get:function(t,n=!1){let r=parseInt(localStorage.getItem(At+t+co));if(!localStorage.getItem(At+t))return!1;if(r&&r<Date.now()/1e3&&!n){localStorage.removeItem(At+t),localStorage.removeItem(At+t+co);return}else if(n&&r)return{data:JSON.parse(localStorage.getItem(At+t)),time:r};try{return JSON.parse(localStorage.getItem(At+t))}catch{return localStorage.getItem(At+t)}}},ct=t=>we.ElMessage(t);ct.info=t=>we.ElMessage(t),ct.success=t=>we.ElMessage({message:t,type:"success"}),ct.error=t=>we.ElMessage({message:t,type:"error"}),ct.warning=t=>we.ElMessage({message:t,type:"warning"}),ct.info=t=>we.ElMessage(t),ct.warning=t=>we.ElMessage({message:t,type:"warning"}),ct.confirm=(t,n="提示",r={})=>{let o={confirmButtonText:"确认",cancelButtonText:"取消",type:"warning",...r};return we.ElMessageBox.confirm(t,n,o)},ct.prompt=(t,n="提示",r={})=>{let o={confirmButtonText:"确认",cancelButtonText:"取消",...r};return we.ElMessageBox.prompt(t,n,o)},ct.loading=(t="加载中")=>(t===!0&&(t="加载中"),we.ElLoading.service({lock:!0,text:t,background:"rgba(0, 0, 0, 0.7)"}));function f6(t,n){if(!t)return{};let r={};return t?.jsonQuery?r=JSON.parse(t.jsonQuery):r=t,n?r[n]||null:r}class p6{data=null;router=null;query=f6;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 gs="undefined",h6=Promise,m6=t=>h6.reject(t),ys=Object,Pu=void 0,g6=null,Mu=!0,bs=!1,y6=(t,n,r)=>JSON.stringify(t,n,r),b6=(t,n=0)=>setTimeout(t,n),zu=t=>clearTimeout(t),C6=(t,n)=>delete t[n],v6=t=>typeof t,D6=(t,n)=>t.includes(n);typeof window===gs&&(typeof process!==gs&&process.browser);const w6=t=>v6(t)==="string",B6=t=>ys.prototype.toString.call(t),x6=(t,n)=>t instanceof n,k6=t=>{const n=B6(t);return/^\[object (Blob|FormData|ReadableStream|URLSearchParams)\]$/i.test(n)||x6(t,ArrayBuffer)},E6=(t,...n)=>new t(...n),_6=t=>w6(t)||k6(t);function A6(t={}){return(n,r)=>{const o=r.config,i=o.timeout||0,a=new AbortController,{data:l,headers:c}=n,u=/content-type/i.test(ys.keys(c).join()),d=l&&l.toString()==="[object FormData]";!u&&!d&&(c["Content-Type"]="application/json; charset=UTF-8");const f=["",Pu,g6,bs];ys.keys(c).forEach(g=>{D6(f,c[g])&&C6(c,g)});const p=(t.customFetch||fetch)(n.url,{...o,method:n.type,signal:a.signal,body:_6(l)?l:y6(l)});let h,m=bs;return i>0&&(h=b6(()=>{m=Mu,a.abort()},i)),{response:()=>p.then(g=>(zu(h),g.clone()),g=>m6(m?E6(Error,"fetchError: network timeout"):g)),headers:()=>p.then(({headers:g})=>g,()=>({})),onDownload:async g=>{let y=bs;const v=await p.catch(()=>{y=Mu});if(!v)return;const{headers:D,body:w}=v.clone(),C=w?w.getReader():Pu,B=Number(D.get("Content-Length")||D.get("content-length")||0);if(B<=0)return;let k=0;if(C){const E=()=>C.read().then(({done:x,value:V=new Uint8Array})=>{if(x||y)y&&g(k,0);else return k+=V.byteLength,g(k,B),E()});E()}},onUpload(){console.error("fetch API does'nt support uploading progress. please consider to change `@alova/adapter-xhr` or `@alova/adapter-axios`")},abort:()=>{a.abort(),zu(h)}}}}let er="",uo,Cs;function S6(t){t.responded||(t.responded={}),Cs=t,er=t.baseURLPre||"",uo=sr.createAlova({requestAdapter:A6(),timeout:5e4,baseURL:t.baseURL,responded:{onSuccess:t.responded.onSuccess,onError:t.responded.onError,onComplete:async n=>{tr&&tr.close()}}})}let tr=!1;function $u(t,n,r={}){const o=Cs?.headers?.()||{},i=Cs?.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=ct.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 Iu=function(t,n=void 0){const r=uo.Get(t,n);return r.baseURL="",r};class N6{baseURL;constructor(n){er=n?.apiUrlPre||"",this.baseURL=n.baseURL,S6(n)}noLogin(n,r=void 0){return $u(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,$u(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:id.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=Iu;get=Iu;instance=()=>uo;setCache=sr.setCache;create=sr.createAlova}const F6=function(t,n="复制成功"){if(!t){ct.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")&&ct.success(n),document.body.removeChild(r)};function Gt(t,n=2){for(t+="";t.length<n;)t="0"+t;return t.slice(-n)}const V6={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 Ru(t){return/^\d+$/.test(t)&&(t+"").length==10&&(t=t*1e3),t instanceof Date?t:typeof t==="string"?t.indexOf("T")>-1?new Date(t):new Date(t.replace(/-/g,"/")):new Date(t)}function Hu(t,n="yyyy-MM-dd hh:mm:ss"){if(!t&&t!==0||(t=Ru(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,V6[l](r)});return a}function O6(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=Ru(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 Hu(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 T6=(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 j6(t,n,r,o="array"){if(t){(!r||typeof r!="string")&&(r="data.csv");let i;o=="array"?i=L6(t,n):i=P6(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 L6(t,n){let o=",",i=`\r
37
+ 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){W1(n,r)},t.registerRenderElem=function(n){var r,o,i;o=(r=n).type,i=r.renderElem,Kc[o||""]=i},t.registerRenderStyle=function(n){(function(r){qi.push(r)})(n)},t.registerElemToHtml=function(n){(function(r){var o=r.type,i=r.elemToHtml;dl[o||""]=i})(n)},t.registerStyleToHtml=function(n){(function(r){gi.push(r)})(n)},t.registerPreParseHtml=function(n){var r;r=n,il.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){rs(n)},t.editorConfig={},t.simpleEditorConfig={},t.toolbarConfig={},t.simpleToolbarConfig={},t.plugins=[],t})();function rs(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 Qe.registerMenu(f)})),r&&r.forEach((function(f){return Qe.registerRenderElem(f)})),o&&Qe.registerRenderStyle(o),i&&i.forEach((function(f){return Qe.registerElemToHtml(f)})),a&&Qe.registerStyleToHtml(a),l&&l.forEach((function(f){return Qe.registerPreParseHtml(f)})),c&&c.forEach((function(f){return Qe.registerParseElemHtml(f)})),u&&Qe.registerParseStyleHtml(u),d&&Qe.registerPlugin(d)}ny.forEach((function(t){return rs(t)})),rs(dy);var fy='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>',py='<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>',hy='<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>',wu={link:{menuKeys:["editLink","unLink","viewLink"]},pre:{menuKeys:["enter","codeBlock","codeSelectLang"]},divider:{menuKeys:["enter"]}},my={hoverbarKeys:me(me({},wu),{text:{menuKeys:["formatPainter","headerSelect","insertLink","bulletedList","|","bold","through","color","bgColor","clearStyle"]}})};Qe.setEditorConfig(me({},my));var gy={hoverbarKeys:wu};Qe.setSimpleEditorConfig(me({},gy));var yy={toolbarKeys:["headerSelect","|","bold","underline","italic",{key:"group-more-style",title:se("editor.more"),iconSvg:hy,menuKeys:["through","code","sup","sub","clearStyle"]},"color","bgColor","|","fontSize","fontFamily","lineHeight","|","bulletedList","numberedList",{key:"group-justify",title:se("editor.justify"),iconSvg:py,menuKeys:["justifyLeft","justifyRight","justifyCenter","justifyJustify"]},{key:"group-indent",title:se("editor.indent"),iconSvg:fy,menuKeys:["indent","delIndent"]},"|","emotion","divider","|","undo","redo","|","formatPainter","fullScreen"]};Qe.setToolbarConfig(yy);var by={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 Cy(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"?Qe.simpleEditorConfig:Qe.editorConfig,f=me(me({},d.hoverbarKeys||{}),c.hoverbarKeys||{});return xg({selector:r,config:me(me(me({},d),c),{hoverbarKeys:f}),content:i,html:a,plugins:Qe.plugins})}function vy(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=Qe.toolbarConfig;return Eg(r,{selector:n,config:me(me({},a),i)})}Qe.setSimpleToolbarConfig(by);class Dy{constructor(){this.title="播放视频",this.tag="button"}getValue(n){return!1}isActive(n){return!1}isDisabled(n){return!1}exec(n){const r=N.getSelectedNodeByType(n,"video");console.log(r);const{view:o}=n.getMenuConfig("video");o(r)}}class Bu{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=>N.checkNodeType(r,this.type)}),n.children.length==0){const r={type:"paragraph",children:[{text:""}]};n.insertNode(r)}}}class wy{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=N.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 By{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 xy{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 ky={key:"viewVideo",factory(){return new Dy}},Ey={key:"delVideo",factory(){return new Bu("video")}},_y={key:"delImage",factory(){return new Bu("image")}},Ay={key:"insertBottom",factory(){return new xy}},Sy={key:"insertTop",factory(){return new By}},Ny={key:"delEmpty",factory(){return new wy}};class Fy{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 Vy={key:"image",factory(){return new Fy},config:{}};class Oy{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 Ty(t,n,r){const{id:o}=N.findKey(t,n);return`w-e-video-container-${o}`}function jy(t,n,r,o){const{width:i,height:a}=o,l={};i&&(l.width=i),a&&(l.height=a);const c=Ty(t,n),u=N.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 Ly(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 jy(r,t,d,{width:l,height:c})}const Py={type:"video",renderElem:Ly};function My(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 zy={type:"video",elemToHtml:My};function $y(t){const n=F(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 Iy={selector:"video",parseElemHtml:$y},Ry={key:"video",factory(){return new Oy},config:{}};function Hy(t,n){let r=0;return function(){const o=Date.now();o-r>=n&&(t.apply(this,arguments),r=o)}}function xu(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 ku(t,n){const{id:r}=N.findKey(t,n);return`w-e-image-container-${r}`}function Uy(t,n,r,o){const{width:i,height:a}=o,l={};i&&(l.width=i),a&&(l.height=a);const c=ku(t,n);return ht("div",{props:{id:c,className:"w-e-image-container"},style:l},[r])}function Wy(t,n,r,o){const i=ku(t,n),a=F("body"),{width:l,height:c}=o;let u=0,d=0,f=!1,p=null;function h(){const C=F(`#${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=N.getHoverbar(t);k&&k.hideAndClean()}const g=Hy(C=>{C.preventDefault();const{clientX:B}=C,k=f?u-B:B-u,E=d+k;p!=null&&(E<=15||(p.css("width",`${E}px`),p.css("height","auto")))},50);function y(){if(a.off("mousemove",g),p==null)return;const C=p.width().toFixed(2),B=F(".w-e-text-container").width(),k={style:{...n.style,width:`${(C/B*100).toFixed(2)}%`,height:"auto"}};let E=N.findPath(t,n);console.log(k,E),O.setNodes(t,k,{at:N.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=F(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 qy(t,n,r){const{src:o,href:i="",style:a={}}=t,{width:l="",height:c=""}=a,u=N.isNodeSelected(r,t),d={};l&&(d.width="100%"),c&&(d.height="100%"),d.maxWidth=F(".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?Wy(r,t,f,{width:l,height:c}):Uy(r,t,f,{width:l,height:c})}const Ky={type:"image",renderElem:qy},Jy={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 os{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||N.getSelectedElems(n).some(i=>{const{type:a}=i;if(n.isVoid(i)||["pre","code","link"].includes(a))return!0}))}exec(n){const r=N.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 Gy(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 Yy={type:"image",elemToHtml:Gy};function Zy(t){const n=F(t);let r=n.attr("data-href")||"";return r&&(r=decodeURIComponent(r)),{type:"image",src:$fileUrl(n.attr("src"))||"",href:r,style:{width:xu(n,"width"),height:xu(n,"height")},children:[{text:""}]}}const Xy={selector:"img:not([data-w-e-type])",parseElemHtml:Zy},Qy={key:"urlKey",factory(){return new os("text")}},e3={key:"linkUrlKey",factory(){return new os("link")}},t3={key:"imgUrlKey",factory(){return new os("image")}};function n3(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 r3={menus:[t3,Qy,e3,Vy,Ry,Ey,_y,ky,Ay,Sy,Ny],renderElems:[Ky,Py],parseElemsHtml:[Xy,Iy],elemsToHtml:[Yy,zy],editorPlugin:n3};Qe.registerModule(r3);const o3={components:{mediaBox:lr,urlBox:Hs},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=Jy,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=Cy({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","|"]},vy({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(N.getSelectedNodeByType(this.editor,"image"))O.setNodes(this.editor,{href:t},{match:r=>N.checkNodeType(r,"image")});else if(N.getSelectedNodeByType(this.editor,"link"))O.setNodes(this.editor,{url:t},{match:o=>N.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}}},i3={class:"pos-relative"},s3={class:"bg-black"},a3=["src"],l3={class:"dialog-footer"},c3={class:"dialog-footer"},u3={class:"dialog-footer flex justify-end"},d3={class:"pr"},f3={class:"bg-main z-999 b-1 b-solid b-color-[--el-border-color]"},p3={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"},h3={class:"b-0 b-b-1 b-solid b-color-[--el-border-color]",ref:"wangEditorToolbar"};function m3(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",i3,[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",l3,[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",s3,[s.createElementVNode("video",{src:i.videoNodes.src,controls:"",width:"100%",height:"360px"},null,8,a3)])]),_: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",c3,[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",u3,[s.createElementVNode("div",d3,[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",f3,[s.createElementVNode("div",p3,[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",h3,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 Eu=ne(o3,[["render",m3]]),g3=Object.freeze(Object.defineProperty({__proto__:null,default:Eu},Symbol.toStringTag,{value:"Module"})),y3={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})}}},b3={class:"dialog-footer"},C3={class:"image-text"},v3={class:"box"},D3={key:0,class:"no-data"},w3={key:0,class:"item text"},B3=["onClick"],x3=["onClick"],k3={key:1,class:"item img"},E3=["onClick"],_3=["onClick"],A3={class:"bottom"};function S3(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",b3,[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",C3,[s.createElementVNode("div",v3,[s.createVNode(p,{ref:"scrollbar",height:"100%"},{default:s.withCtx(()=>[i.list.length==0?(s.openBlock(),s.createElementBlock("div",D3," 点击下方按钮添加图片或者文字 ")):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",w3,[s.createElementVNode("p",null,s.toDisplayString(h.text),1),s.createElementVNode("div",{class:"del",onClick:g=>i.list.splice(m,1)}," 删除 ",8,B3),s.createElementVNode("div",{class:"edit",onClick:g=>a.editText(m)}," 编辑 ",8,x3)])):s.createCommentVNode("",!0),h.image?(s.openBlock(),s.createElementBlock("div",k3,[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,E3),s.createElementVNode("div",{class:"edit",onClick:g=>a.editImage(m)}," 编辑 ",8,_3)])):s.createCommentVNode("",!0)],64))),256))]),_:1},8,["list"])]),_:1},512)]),s.createElementVNode("div",A3,[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 _u=ne(y3,[["render",S3],["__scopeId","data-v-a908f232"]]),N3={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 F3(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 Au=ne(N3,[["render",F3]]),V3={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 O3(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 Su=ne(V3,[["render",O3]]),T3={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)}}},j3={class:"a-color-picker input-button w-full flex"};function L3(t,n,r,o,i,a){const l=s.resolveComponent("el-input"),c=s.resolveComponent("el-color-picker");return s.openBlock(),s.createElementBlock("div",j3,[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 Nu=ne(T3,[["render",L3]]),P3={上海:[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]},M3={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=P3[r];console.log(o,r),o&&this.setMap(o)}}},z3={class:"map"},$3={class:"input"},I3={class:"dialog-footer"},R3={key:1,class:"map"},H3={class:"input text-center bg-main"},U3={key:2,class:"input-button"};function W3(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",R3,[s.createElementVNode("div",H3,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",I3,[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",z3,[s.createElementVNode("div",$3,[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",U3,[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 is=ne(M3,[["render",W3],["__scopeId","data-v-9356e288"]]),ss=globalThis.dmxRegions??[],q3={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:ss}},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=ss},methods:{setList(t){let n=[];return ss.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 K3(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 Fu=ne(q3,[["render",K3]]),as=t=>t?Array.isArray(t)?typeof t[0]=="object"?t:t.map((n,r)=>({label:n,value:r})):typeof t=="object"?Object.keys(t).map(n=>({label:t[n],value:n})):[]:[],J3={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)}},ls=t=>s.defineAsyncComponent(t),G3=ls(()=>Promise.resolve().then(()=>K8)),Y3=ls(()=>Promise.resolve().then(()=>t5)),Z3=ls(()=>Promise.resolve().then(()=>p5)),Jt={media:u0,slot:J3,"input-select":yp,"group-tabs":G3,"group-table":Y3,group:Z3,md5:b0,file:m0,"search-box":Us,"input-auto":wp},Vu={input:{component:we.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:we.ElSelect,props:(t,n)=>({size:n.size,disabled:n._disabled,placeholder:t.placeholder||"请选择"}),children:(t,n)=>n.selectCols.map(r=>({component:s.markRaw(we.ElOption),props:{label:r.label,value:r.value}}))},radio:{component:we.ElRadioGroup,props:(t,n)=>({size:n.size,disabled:n._disabled}),children:(t,n)=>n.radioCols.map(r=>({component:s.markRaw(we.ElRadio),props:{value:r.value},children:r.label}))},"radio-button":{component:we.ElRadioGroup,props:(t,n)=>({size:n.size,disabled:n._disabled}),children:(t,n)=>n.radioCols.map(r=>({component:s.markRaw(we.ElRadioButton),props:{disabled:n._disabled,value:r.value},children:r.label}))},checkbox:{component:we.ElCheckboxGroup,props:(t,n)=>({size:n.size,disabled:n._disabled}),children:(t,n)=>n.checkboxCols.map(r=>({component:s.markRaw(we.ElCheckbox),props:{value:r.value},children:r.label}))},imgs:{component:Rs,props:(t,n)=>({size:n.size,limit:t.limit,cateId:t.cateId,disabled:n._disabled,tips:t.tips})},images:{component:Rs,props:(t,n)=>({size:n.size,limit:t.limit,"cate-id":t.cateId,disabled:n._disabled,tips:t.tips})},editor:{component:Eu,props:t=>({placeholder:t.placeholder})},"image-text":{component:_u,props:()=>({})},selects:{component:Au,props:(t,n)=>({disabled:n._disabled,placeholder:t.placeholder,url:t.url,remove:t.remove,level:t.level||0})},tags:{component:Su,props:()=>({})},color:{component:Nu,props:t=>({showAlpha:t.showAlpha,colorFormat:t.colorFormat})},map:{component:is},pickerMap:{component:is},region:{component:Fu,props:(t,n)=>({disabled:n._disabled,checkStrictly:t.checkStrictly,level:t.level})},url:{component:Xh,props:()=>({})},time:{component:we.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:we.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:we.ElDatePicker,props:(t,n)=>({size:n.size,disabled:n._disabled,type:"date",placeholder:"选择日期","value-format":"YYYY-MM-DD"})},dates:{component:we.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:we.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:we.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:we.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:we.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:we.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:we.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:we.ElInput,props:(t,n)=>({type:"password",autocomplete:"off",disabled:n._disabled,"show-password":!0,placeholder:t.placeholder||"输入密码"})},"input-button":{component:Fo,props:(t,n)=>({btn:t.btn,readonly:t.readonly,disabled:n._disabled,placeholder:t.placeholder,icon:t.icon})}},X3=(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}},Q3=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})):as(i.value.cols)),u=s.computed(()=>i.value.cols?as(i.value.cols):[{label:"是",value:!0},{label:"否",value:!1}]),d=s.computed(()=>as(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=X3(g,y);if(v){o.value={...v,component:s.markRaw(v.component)};return}const D=Vu[g]||Vu.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})},m=g=>{n("update:modelValue",g)};return s.onMounted(()=>{p(),h(),s.watch(r,g=>{let y=g;o.value.props.onChange||(typeof i.value.format=="function"&&(y=i.value.format(g)),n("update:modelValue",y))},{deep:!0})}),s.watch(()=>t.prop,()=>{p(),h()},{deep:!0}),{internalValue:r,currentComponent:o}}}),e4={class:"dmx-input-item"};function t4(t,n,r,o,i,a){return s.openBlock(),s.createElementBlock("div",e4,[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 cs=ne(Q3,[["render",t4]]),us=Object.freeze(Object.defineProperty({__proto__:null,default:cs},Symbol.toStringTag,{value:"Module"})),Ou=t=>{const n={};for(const r in t){const o=t[r];r.indexOf(".")>-1?dn(n,r,o):n[r]=o}return n},n4={name:"admin-form",components:{inputItem:cs,imgInfo:Ps},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 Ou({...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=Ou({...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)}})}}},r4={key:0},o4=["innerHTML"];function i4(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(["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",r4,[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,o4)],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 s4=ne(n4,[["render",i4]]),a4={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||"加载失败")}}},l4={key:1},c4={key:2},u4={class:"op-70"};function d4(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",l4,[s.renderSlot(t.$slots,"loading",{},()=>[s.createVNode(l,{rows:2,animated:""})])])):i.empty?(s.openBlock(),s.createElementBlock("div",c4,[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",u4,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 f4=ne(a4,[["render",d4]]),p4={props:{title:{type:String,default:"提示"},type:{type:String,default:"primary"}},data(){return{value:"",show:!1}},methods:{}},h4={class:"font-weight mb line-height"},m4={class:"text-color-primary"};function g4(t,n,r,o,i,a){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["a-tip","a-tip--"+r.type])},[s.createElementVNode("div",h4,[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",m4,[s.renderSlot(t.$slots,"default",{},void 0,!0)])],2)}const y4=ne(p4,[["render",g4],["__scopeId","data-v-b6ef9e08"]]),b4={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})}}},C4={key:0},v4={key:1,class:"text flex"},D4={class:"line-2"},w4={key:0,class:"i-ri-quill-pen-line ml-xs"};function B4(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",C4,[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",v4,[s.createElementVNode("div",D4,s.toDisplayString(r.text??r.defaultValue),1),!r.hideIcon||!r.text?(s.openBlock(),s.createElementBlock("i",w4)):s.createCommentVNode("",!0)]))],16)}const x4=ne(b4,[["render",B4],["__scopeId","data-v-26e8acc4"]]),k4={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)})}},E4={key:0,class:"cate-text overflow-hidden"},_4={class:"cate-show"};function A4(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",E4,[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",_4,[(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 S4=ne(k4,[["render",A4],["__scopeId","data-v-3c69ee7f"]]),N4={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 F4(t,n,r,o,i,a){return s.openBlock(),s.createElementBlock("span",null,s.toDisplayString(i.text),1)}const V4=ne(N4,[["render",F4]]),O4={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 T4(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 j4=ne(O4,[["render",T4],["__scopeId","data-v-7b602c3b"]]),L4={name:"a-region-text",props:{code:String|Number},data(){return{text:""}},created(){this.text=$a.codeArea(this.code)}};function P4(t,n,r,o,i,a){return s.openBlock(),s.createElementBlock("span",null,s.toDisplayString(i.text),1)}const M4=ne(L4,[["render",P4]]),z4={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)}},$4={class:"text-status"},I4={class:"text"};function R4(t,n,r,o,i,a){return s.openBlock(),s.createElementBlock("span",$4,[s.createElementVNode("span",{class:s.normalizeClass(["dot",i.color?"":"dot-"+r.status]),style:s.normalizeStyle("background-color:"+i.color)},null,6),s.createElementVNode("span",I4,[s.renderSlot(t.$slots,"default",{},void 0,!0)])])}const H4=ne(z4,[["render",R4],["__scopeId","data-v-99c2ca99"]]);function U4(t){const n=Object.create(null);return function(o){return n[o]||(n[o]=t(o))}}const W4=/-(\w)/g,Tu=U4(t=>t.replace(W4,(n,r)=>r?r.toUpperCase():""));function ds(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function ju(t,n,r){const o=r===0?t.children[0]:t.children[r-1].nextSibling;t.insertBefore(n,o)}function q4(t,n){return Object.values(t).indexOf(n)}function K4(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 Lu(t,n){this.$nextTick(()=>this.$emit(t.toLowerCase(),n))}function J4(t){return n=>{this.realList!==null&&this["onDrag"+t](n),Lu.call(this,t,n)}}function G4(t){return["transition-group","TransitionGroup"].includes(t)}function Y4(t){if(!t||t.length!==1)return!1;const[{type:n}]=t;return n?G4(n.name):!1}function Z4(t,n){return n?{...n.props,...n.attrs}:t}const fs=["Start","Add","Remove","Update","End"],ps=["Choose","Unchoose","Sort","Filter","Clone"],X4=["Move",...fs,...ps].map(t=>"on"+t);let hs=null;const Q4={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}},e6={name:"a-draggable",inheritAttrs:!1,emits:["update:modelValue","move","change",...fs.map(t=>t.toLowerCase()),...ps.map(t=>t.toLowerCase())],props:Q4,data(){return{transitionMode:!1,noneFunctionalComponentMode:!1,headerOffset:0,footerOffset:0,_sortable:{},visibleIndexes:[],context:{}}},render(){const t=this.$slots.default?this.$slots.default():null,n=Z4(this.$attrs,this.componentData);return t?(this.transitionMode=Y4(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={};fs.forEach(i=>{t["on"+i]=J4.call(this,i)}),ps.forEach(i=>{t["on"+i]=Lu.bind(this,i)});const n=Object.keys(this.$attrs).reduce((i,a)=>(i[Tu(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=Tu(n);X4.indexOf(r)===-1&&this._sortable.option(r,t[n])}},getChildrenNodes(){return this.$el.children},computeIndexes(){this.$nextTick(()=>{this.visibleIndexes=K4(this.getChildrenNodes(),this.$el.children,this.transitionMode,this.footerOffset)})},getUnderlyingVm(t){const n=q4(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),hs=t.item)},onDragAdd(t){const n=t.item._underlying_vm_;if(n===void 0)return;ds(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(ju(this.$el,t.item,t.oldIndex),t.pullMode==="clone"){ds(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){ds(t.item),ju(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(),hs=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(hs)!==-1||!n.willInsertAfter?i:i+1}}},t6=s.defineAsyncComponent(()=>Promise.resolve().then(()=>C5)),n6=s.defineAsyncComponent(()=>Promise.resolve().then(()=>g3)),ms={AdminTable:up,AdminForm:s4,DataApi:f4,ASearch:Ms,AInputs:cs,InputButton:Fo,ASearchBox:Us,ATip:y4,ATextEdit:x4,ACateText:S4,ACascader:Au,ATags:Su,ATime:V4,AImage:j4,AImageText:_u,AColorPicker:Nu,ARegionPicker:Fu,ARegionText:M4,ARegionMap:is,ATextStatus:H4,ADraggable:e6,AChart:t6,AEditor:n6};function r6(t){for(const n in ms)t.component(n,ms[n])}const o6={install:r6,components:ms},i6={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)}}},s6=function(...t){return t.reduce((n,r)=>So(n,r),{})},a6={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 l6(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 c6=t=>{const n=s6(a6,t);return l6(n),n},u6=t=>{if(typeof document<"u")return window.getComputedStyle(document.getElementById("app")).getPropertyValue(t)},d6=(t="")=>{const n={};return n.primary=u6("--el-color-primary"),t?n[t]:n},co="_exptime",At="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(At+t+co,o+"")}localStorage.setItem(At+t,JSON.stringify(n))},remove:function(t){localStorage.removeItem(At+t),localStorage.removeItem(At+t+co)},clear:function(){localStorage.clear()},get:function(t,n=!1){let r=parseInt(localStorage.getItem(At+t+co));if(!localStorage.getItem(At+t))return!1;if(r&&r<Date.now()/1e3&&!n){localStorage.removeItem(At+t),localStorage.removeItem(At+t+co);return}else if(n&&r)return{data:JSON.parse(localStorage.getItem(At+t)),time:r};try{return JSON.parse(localStorage.getItem(At+t))}catch{return localStorage.getItem(At+t)}}},ct=t=>we.ElMessage(t);ct.info=t=>we.ElMessage(t),ct.success=t=>we.ElMessage({message:t,type:"success"}),ct.error=t=>we.ElMessage({message:t,type:"error"}),ct.warning=t=>we.ElMessage({message:t,type:"warning"}),ct.info=t=>we.ElMessage(t),ct.warning=t=>we.ElMessage({message:t,type:"warning"}),ct.confirm=(t,n="提示",r={})=>{let o={confirmButtonText:"确认",cancelButtonText:"取消",type:"warning",...r};return we.ElMessageBox.confirm(t,n,o)},ct.prompt=(t,n="提示",r={})=>{let o={confirmButtonText:"确认",cancelButtonText:"取消",...r};return we.ElMessageBox.prompt(t,n,o)},ct.loading=(t="加载中")=>(t===!0&&(t="加载中"),we.ElLoading.service({lock:!0,text:t,background:"rgba(0, 0, 0, 0.7)"}));function f6(t,n){if(!t)return{};let r={};return t?.jsonQuery?r=JSON.parse(t.jsonQuery):r=t,n?r[n]||null:r}class p6{data=null;router=null;query=f6;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 gs="undefined",h6=Promise,m6=t=>h6.reject(t),ys=Object,Pu=void 0,g6=null,Mu=!0,bs=!1,y6=(t,n,r)=>JSON.stringify(t,n,r),b6=(t,n=0)=>setTimeout(t,n),zu=t=>clearTimeout(t),C6=(t,n)=>delete t[n],v6=t=>typeof t,D6=(t,n)=>t.includes(n);typeof window===gs&&(typeof process!==gs&&process.browser);const w6=t=>v6(t)==="string",B6=t=>ys.prototype.toString.call(t),x6=(t,n)=>t instanceof n,k6=t=>{const n=B6(t);return/^\[object (Blob|FormData|ReadableStream|URLSearchParams)\]$/i.test(n)||x6(t,ArrayBuffer)},E6=(t,...n)=>new t(...n),_6=t=>w6(t)||k6(t);function A6(t={}){return(n,r)=>{const o=r.config,i=o.timeout||0,a=new AbortController,{data:l,headers:c}=n,u=/content-type/i.test(ys.keys(c).join()),d=l&&l.toString()==="[object FormData]";!u&&!d&&(c["Content-Type"]="application/json; charset=UTF-8");const f=["",Pu,g6,bs];ys.keys(c).forEach(g=>{D6(f,c[g])&&C6(c,g)});const p=(t.customFetch||fetch)(n.url,{...o,method:n.type,signal:a.signal,body:_6(l)?l:y6(l)});let h,m=bs;return i>0&&(h=b6(()=>{m=Mu,a.abort()},i)),{response:()=>p.then(g=>(zu(h),g.clone()),g=>m6(m?E6(Error,"fetchError: network timeout"):g)),headers:()=>p.then(({headers:g})=>g,()=>({})),onDownload:async g=>{let y=bs;const v=await p.catch(()=>{y=Mu});if(!v)return;const{headers:D,body:w}=v.clone(),C=w?w.getReader():Pu,B=Number(D.get("Content-Length")||D.get("content-length")||0);if(B<=0)return;let k=0;if(C){const E=()=>C.read().then(({done:x,value:V=new Uint8Array})=>{if(x||y)y&&g(k,0);else return k+=V.byteLength,g(k,B),E()});E()}},onUpload(){console.error("fetch API does'nt support uploading progress. please consider to change `@alova/adapter-xhr` or `@alova/adapter-axios`")},abort:()=>{a.abort(),zu(h)}}}}let er="",uo,Cs;function S6(t){t.responded||(t.responded={}),Cs=t,er=t.baseURLPre||"",uo=sr.createAlova({requestAdapter:A6(),timeout:5e4,baseURL:t.baseURL,responded:{onSuccess:t.responded.onSuccess,onError:t.responded.onError,onComplete:async n=>{tr&&tr.close()}}})}let tr=!1;function $u(t,n,r={}){const o=Cs?.headers?.()||{},i=Cs?.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=ct.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 Iu=function(t,n=void 0){const r=uo.Get(t,n);return r.baseURL="",r};class N6{baseURL;constructor(n){er=n?.apiUrlPre||"",this.baseURL=n.baseURL,S6(n)}noLogin(n,r=void 0){return $u(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,$u(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:id.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=Iu;get=Iu;instance=()=>uo;setCache=sr.setCache;create=sr.createAlova}const F6=function(t,n="复制成功"){if(!t){ct.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")&&ct.success(n),document.body.removeChild(r)};function Gt(t,n=2){for(t+="";t.length<n;)t="0"+t;return t.slice(-n)}const V6={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 Ru(t){return/^\d+$/.test(t)&&(t+"").length==10&&(t=t*1e3),t instanceof Date?t:typeof t==="string"?t.indexOf("T")>-1?new Date(t):new Date(t.replace(/-/g,"/")):new Date(t)}function Hu(t,n="yyyy-MM-dd hh:mm:ss"){if(!t&&t!==0||(t=Ru(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,V6[l](r)});return a}function O6(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=Ru(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 Hu(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 T6=(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 j6(t,n,r,o="array"){if(t){(!r||typeof r!="string")&&(r="data.csv");let i;o=="array"?i=L6(t,n):i=P6(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 L6(t,n){let o=",",i=`\r
38
38
  `,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 P6(t,n){return new Blob(["\uFEFF"+t+n],{type:"text/csv;charset=utf-8;"})}const M6={export:j6},vs=(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=>vs(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=vs(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},z6={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)=>So(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:vs},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 $6(t=30){return new Promise(n=>{setTimeout(()=>{n(null)},t)})}function I6(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 Uu={array:nr,object:z6,sleep:$6,codeArea:T6,fileUrl:I6,time:{formatDate:Hu,friendlyDate:O6},csv:M6},Ds={};function R6(t,n,r){if(typeof t=="string"?window[t]:t){r();return}let i=Ds[n];if(!i){i=Ds[n]=[];const a=document.createElement("script");a.src=n,document.body.appendChild(a),a.onload=function(){i.forEach(l=>l()),delete Ds[n]}}i.push(r)}function H6(t,n){const r=t.config.globalProperties,{store:o=null,config:i,menu:a=null}=n,l={$menu:a,$a:Uu,$msg:ct,$loading:ct.loading,$confirm:ct.confirm,$prompt:ct.prompt,$cache:Qn,$copy:F6,$fileUrl:Uu.fileUrl,$config:c6(i),$theme:d6,$number:sd,$req:new N6(n.req),$go:new p6(n.router),$store:o};l.$menu=a,r._plugins=n.pluigns,globalThis.loadjs=R6;for(const c in l)globalThis[c]=r[c]=l[c]}const U6={install:H6},W6={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 q6(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 K6=Object.freeze(Object.defineProperty({__proto__:null,default:ne(W6,[["render",q6],["__scopeId","data-v-6bb6e19c"]])},Symbol.toStringTag,{value:"Module"})),J6={};function G6(t,n){return"Index"}const Y6=Object.freeze(Object.defineProperty({__proto__:null,default:ne(J6,[["render",G6]])},Symbol.toStringTag,{value:"Module"})),Z6={class:"w-full bg-main pd"},X6={key:1},Q6=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"index",setup(t){const n=s.ref(null),r=s.ref(null),{width:o}=bo.useElementSize(document.getElementById("app")),{height:i}=bo.useElementSize(document.getElementById("app")),{height:a}=bo.useElementSize(r),l=s.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=s.ref([]),f=s.ref("先选择要查看的日志文件"),p=y=>{$req.post("dev.log/index",{where:y}).then(v=>{d.value=v.data,f.value=v.msg})},h=s.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",Z6,[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",X6,[s.createVNode(C,{description:s.unref(f)},null,8,["description"])]))])],512)}}}},Symbol.toStringTag,{value:"Module"})),e8={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 t8(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 n8=Object.freeze(Object.defineProperty({__proto__:null,default:ne(e8,[["render",t8]])},Symbol.toStringTag,{value:"Module"})),r8={data(){return{init:{url:"/api/admin/msg",data:{is_msg:1,sms_id:"SMS_478945053",sms_tpl:"尊敬的${name} ,服务人员已接单,请在公众号内查看订单详情",info:`服务项目 {{thing2.DATA}}
39
39
  服务人员 {{thing3.DATA}}
40
40
  预约时间 {{time7.DATA}}