@10yun/cv-pc-ui 0.3.54 → 0.3.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cv-ui.cjs +6 -6
- package/lib/cv-ui.js +493 -485
- package/package.json +9 -9
- package/src/mixins/value.js +3 -3
- package/src/utils/value.js +39 -0
package/lib/cv-ui.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";var on=Object.create;var oa=Object.defineProperty;var an=Object.getOwnPropertyDescriptor;var ln=Object.getOwnPropertyNames;var nn=Object.getPrototypeOf,rn=Object.prototype.hasOwnProperty;var sn=(t,o,a,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of ln(o))!rn.call(t,l)&&l!==a&&oa(t,l,{get:()=>o[l],enumerable:!(i=an(o,l))||i.enumerable});return t};var lo=(t,o,a)=>(a=t!=null?on(nn(t)):{},sn(o||!t||!t.__esModule?oa(a,"default",{value:t,enumerable:!0}):a,t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("element-plus"),e=require("vue"),cn=require("codemirror"),L=require("@codemirror/state"),E=require("@codemirror/view"),dn=require("@codemirror/commands"),x=require("@codemirror/language"),s=require("@lezer/highlight"),aa=require("@codemirror/lang-javascript"),pn=require("@codemirror/lang-html"),hn=require("@codemirror/lang-json"),mn=require("@codemirror/lang-markdown"),un=require("@codemirror/lang-vue"),gn=require("@codemirror/lang-php"),fn=require("@codemirror/lang-java"),la=require("@codemirror/lang-sql"),Cn=require("@codemirror/lang-python"),vn=require("@codemirror/lang-xml"),yn=require("@codemirror/lang-go"),kn=require("@codemirror/lang-css"),bn=require("html-to-md"),v=(t,o)=>{const a=t.__vccOpts||t;for(const[i,l]of o)a[i]=l;return a},ve=v({name:"cvBadge",extends:{ExtendBadge:k.ElBadge},props:{...k.ElBadge.props},created(){},computed:{isShow(){return!this.value||!(this.value>0)}},data:()=>({})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-badge");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{hidden:n.isShow}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["hidden"])}]]);ve.install=function(t){t.component(ve.name,ve)};const ye=v({name:"cvRow",props:{gutter:{type:[Number,String],default:0},type:{type:[String],default:""},justify:{type:[String],default:"start"},align:{type:[String],default:"top"},tag:{type:[String],default:"div"}},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-row");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-row"},{type:a.type,justify:a.justify,align:a.align,tag:a.tag},{gutter:parseInt(a.gutter)}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["gutter"])}]]),ke=v({name:"cvCol",props:{span:{type:[Number,String],default:24},offset:{type:[Number,String],default:0}},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-col");return e.openBlock(),e.createBlock(r,{class:"cv-col",span:parseInt(a.span),offset:parseInt(a.offset)},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},8,["span","offset"])}]]);ye.install=function(t){t.component(ye.name,ye)},ke.install=function(t){t.component(ke.name,ke)};const be=v({name:"cvBtnBase",emits:["click"],props:{...k.ElButton.props,autoLoading:{type:Boolean,default:!1}},data:()=>({loadingStatus:!1}),computed:{filteredProps(){const{autoLoading:t,...o}=this.$props;return o},hasDefaultContent(){const t=this.$slots.default?.();return t&&t.length>0}},methods:{handleClick(t){this.autoLoading&&(this.loadingStatus=!0);try{this.$emit("click",()=>{this.loadingStatus=!1})}catch(o){throw this.loadingStatus=!1,o}}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button");return t.$slots.default||n.hasDefaultContent?(e.openBlock(),e.createBlock(r,e.mergeProps({key:0,class:"cv-btn"},n.filteredProps,{loading:l.loadingStatus,onClick:n.handleClick}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["loading","onClick"])):(e.openBlock(),e.createBlock(r,e.mergeProps({key:1,class:"cv-btn"},n.filteredProps,{loading:l.loadingStatus,onClick:n.handleClick}),null,16,["loading","onClick"]))}]]),we=v({name:"cvBtnText",emits:["click"],props:{...k.ElButton.props,autoLoading:{type:Boolean,default:!1}},data:()=>({loadingStatus:!1}),methods:{handleClick(){this.autoLoading&&(this.loadingStatus=!0),this.$emit("click",()=>{this.loadingStatus=!1})}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-btn"},t.$props,{link:"",loading:l.loadingStatus,onClick:n.handleClick}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["loading","onClick"])}]]);be.install=function(t){t.component(be.name,be)},we.install=function(t){t.component(we.name,we)};const Ve=v({name:"cvAutocompleteBase",props:{...k.ElAutocomplete.props},data:()=>({localVal:"",loadingStatus:!1}),created(){},methods:{async querySearchAsync(t,o){}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-autocomplete");return e.openBlock(),e.createBlock(r,e.mergeProps({modelValue:l.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>l.localVal=c)},t.$props,{"fetch-suggestions":n.querySearchAsync}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["modelValue","fetch-suggestions"])}]]),to={props:{compConfig:{},dataParse:{type:[Function],default:()=>null}},data:()=>({searchData:{},loadDataLoading:!1,loadDataList:[],loadDataTotal:0,loadPageCurr:1,loadPageLimit:10,loadConfigSetting:{},loadConfigDef:{pageCurr:1,pageLimit:10,isSkip:!1,url:null,apiFunc:null,mockData:null,where:{},response:{statusName:"status",statusCode:200,msgName:"msg",countName:"total",dataName:"data"},request:{pageName:"page",limitName:"pagesize"}}}),methods:{loadEnding(){this.loadDataLoading=!1,this.$nextTick(()=>{this.loadDataLoading=!1})},loadGetData(){if(this.loadDataLoading=!0,this.loadConfigSetting.apiFunc&&typeof this.loadConfigSetting.apiFunc=="function"){const t=this.loadConfigSetting;let o={...t.where};o[t.request.pageName]=this.loadPageCurr,o[t.request.limitName]=this.loadPageLimit,o=Object.assign(o,this.searchData),this.loadConfigSetting.apiFunc(o).then(a=>{this.loadPageCurr=o[t.request.pageName],this.loadEnding();let i=this.sortOutData(a);if(i.status!=t.response.statusCode)return void ExtendMessage({message:i.msg,type:"error",duration:1300});if(i.data.length===0)return void ExtendMessage({message:"没有更多数据了",type:"warning",duration:1300});let l=i[t.response.dataName]||[];this.dataParse&&typeof this.dataParse=="function"&&(l=this.dataParse.call(null,l)),this.loadDataList.push(...l),this.loadDataTotal=i[t.response.countName]||0}).catch(a=>{this.loadEnding()})}else this.loadDataList.length>0&&(this.loadDataTotal=this.loadDataList.length),this.loadEnding()},sortOutData(t){let o=this.loadConfigSetting.response,a={},i=[],l=[];a.status=t[o.statusName],a.msg=t[o.msgName],a.total=t[o.countName],i=t[o.dataName];for(let n in i)l[n]=i[n];return a.data=l,a}}},xe=v({name:"cvAutocompleteLoad",mixins:[to],emits:["update:modelValue","input"],props:{...k.ElAutocomplete.props,modelValue:{type:[String,Object,Number],default:()=>({})},placeholder:{type:[String],default:"请输入内容"},popperClass:{type:[String],default:"cv-autocomplete-load"},clearable:{type:[Boolean],default:!0},triggerOnFocus:!1,debounce:500,refID:{type:[String],required:!1,default:()=>"cvAutocompleteLoad-"+ +new Date+(Math.random()/1e4).toFixed(0)},compConfig:{type:[Object],default:()=>({})}},data:()=>({localVal:"",searchList:[],compConfigDef:{searchField:["value"]},timeout:null,loadingMore:!1}),directives:{loadmore:{mounted(t,o){const a=((l,n)=>{let r=null;return function(...c){r&&clearTimeout(r),r=setTimeout(()=>{l.apply(this,c)},n)}})(l=>{const{scrollTop:n,scrollHeight:r,clientHeight:c}=l.target;r-(n+c)<10&&!o.instance.loading&&o.value()},200),i=new MutationObserver(()=>{const l=t.querySelector(".el-autocomplete-suggestion__wrap");l&&!t.__scrollHandler__&&(l.addEventListener("scroll",a),t.__scrollHandler__=a,i.disconnect())});i.observe(t,{childList:!0,subtree:!0})},beforeUnmount(t){if(t.__scrollHandler__){const o=t.querySelector(".el-autocomplete-suggestion__wrap");o&&o.removeEventListener("scroll",t.__scrollHandler__),delete t.__scrollHandler__}}}},created(){this.initConfAll(),this.getData()},methods:{initConfAll(){let t={};Object.assign(t,this.loadConfigDef,this.compConfigDef,this.compConfig),this.loadPageCurr=t.pageCurr||1,this.loadPageLimit=t.pageLimit||10,Object.assign(t.where,this.searchData),this.loadConfigSetting=t},getMoreData(){if(!(this.loadingMore||this.loadDataList.length>=this.loadDataTotal))try{this.loadingMore=!0,this.loadPageCurr++,this.loadGetData()}finally{this.loadingMore=!1}},getData(){this.loadPageCurr=1,this.loadDataList=[],this.loadGetData()},async querySearchAsync(t,o){this.loadPageCurr=1,this.loadDataLoading=!0;var a=this.loadDataList||[];let i=[];const l=this.loadConfigSetting.searchField||["value"];if(i=(t=t.toLowerCase())?a.filter(this.createFilter(t,l)):a,i.length>0)o(i.map(n=>({...n,is_last_tip:!1}))),this.lookFlag=!0;else try{this.loadDataList.length<this.loadDataTotal&&this.loadPageCurr++,this.searchData.keyword=t,this.loadDataList=[],await this.loadGetData();const n=this.loadDataList.map(r=>({...r,is_last_tip:!1}));n.push({is_last_tip:!0}),o(n)}catch{}finally{this.lookFlag=!0}},createFilter:(t,o)=>a=>o.some(i=>(a[i]+"").toLowerCase().indexOf(t)!==-1),handleChange(t){},handleSelect(t){this.$emit("update:modelValue",t)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("el-autocomplete"),p=e.resolveDirective("loadmore");return e.withDirectives((e.openBlock(),e.createElementBlock("div",null,[e.createVNode(c,e.mergeProps(t.$props,{modelValue:l.localVal,"onUpdate:modelValue":o[1]||(o[1]=d=>l.localVal=d),"fetch-suggestions":n.querySearchAsync,onChange:n.handleChange,onSelect:n.handleSelect,teleported:!1,"popper-append-to-body":!1}),{load:e.withCtx(()=>[...o[2]||(o[2]=[])]),default:e.withCtx(({item:d})=>[d.is_last_tip?e.createCommentVNode("",!0):e.renderSlot(t.$slots,"default",e.normalizeProps(e.mergeProps({key:0},{item:d}))),d.is_last_tip?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cv-autocomolete-nodata",onClick:o[0]||(o[0]=e.withModifiers((...h)=>n.getData&&n.getData(...h),["stop"])),disabled:""},[o[3]||(o[3]=e.createTextVNode(" 没有更多数据了 ",-1)),e.createVNode(r,{type:"ElIconRefreshLeft"}),o[4]||(o[4]=e.createTextVNode(" 刷新按钮 ",-1))])):e.createCommentVNode("",!0)]),_:3},16,["modelValue","fetch-suggestions","onChange","onSelect"])])),[[p,n.getMoreData]])}]]);Ve.install=function(t){t.component(Ve.name,Ve)},xe.install=function(t){t.component(xe.name,xe)};const Se=v({...k.ElForm,name:"cvFormBase",extends:k.ElForm,provide(){return{elForm:this}},props:{...k.ElForm.props,labelWidth:{type:[String,Number],default:"auto"},labelPosition:{type:String,default:"right"}},watch:{model(){}},data:()=>({})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-form-base"},{...t.$props,...t.$attrs},e.toHandlers(t.$attrs)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}]]),Ne=v({name:"cvFormInline",provide(){return{elForm:this}},props:{...k.ElForm.props},watch:{},data:()=>({form:{}})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-form-base"},t.$props,e.toHandlers(t.$attrs),{inline:!0}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}]]),wn={name:"cvFormItem",extends:k.ElFormItem,props:{...k.ElFormItem.props},data:()=>({localLabelWidth:"",localError:""}),created(){},methods:{}},Vn={key:0,class:"cv-form-item__tip"},Be=v(wn,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-form-item");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps({...t.$props,...t.$attrs})),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default"),t.$slots.tip?(e.openBlock(),e.createElementBlock("div",Vn,[e.renderSlot(t.$slots,"tip")])):e.createCommentVNode("",!0)]),_:3},16)}]]);Se.install=function(t){t.component(Se.name,Se)},Ne.install=function(t){t.component(Ne.name,Ne)},Be.install=function(t){t.component(Be.name,Be)};const F={extends:k.ElInput,emits:["update:modelValue","change"],props:{...k.ElInput.props,modelValue:{type:[Number,String],default:""},placeholder:{type:[Number,String],default:""},disabled:{type:Boolean,default:!1}},watch:{modelValue(t){this.localVal=t},localVal(){this.handleChange(),this.handleInput()}},data(){return{localVal:this.modelValue,localRules:[]}},created(){},methods:{handleChange(){this.$emit("change",this.localVal)},handleInput(){this.$emit("update:modelValue",this.localVal)},handleBlur(){this._isCheckValue()},_showError(t){this.localError=t||"请输入正确的"+this.label},_diyValidate(){},_isCheckValue(){const o=this?.rules.split("|");this.localError="";for(let a in o){let i=o[a].split(":"),l=i[0]||"",n=i[1]||"";switch(l){case"require":if(this.localVal=="")return void this._showError(this.label+"不能为空");break;case"max":if(this.localVal.length>n)return void this._showError(this.label+"最大长度不超过"+n);break;case"min":if(this.localVal.length<n)return void this._showError(this.label+"最小长度不小于"+n);break;default:this._diyValidate(l)}}}}},xn=v({name:"cvInputText",mixins:[F],props:{},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({type:"text"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入",clearable:""}),e.createSlots({_:2},[t.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"prepend")]),key:"0"}:void 0,t.$slots.prepend?{name:"append",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"append")]),key:"1"}:void 0]),1040,["modelValue","onChange","onInput","placeholder"])}]]),Ee=v({name:"cvInputMobile",mixins:[F],components:{},props:{},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({type:"number",oninput:"if(value.length>11)value=value.slice(0,11)"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入11位大陆手机号",clearable:""}),e.createSlots({prepend:e.withCtx(()=>[o[1]||(o[1]=e.createTextVNode("+86",-1))]),_:2},[t.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"append")]),key:"0"}:void 0]),1040,["modelValue","onChange","onInput","placeholder"])}]]),De=v({name:"cvInputEmail",mixins:[F],components:{},props:{},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({type:"text"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入邮箱",clearable:""}),e.createSlots({_:2},[t.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"prepend")]),key:"0"}:void 0,t.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"append")]),key:"1"}:void 0]),1040,["modelValue","onChange","onInput","placeholder"])}]]),Te=v({name:"cvInputPassword",mixins:[F],components:{},props:{showPassword:{type:Boolean,default:!1}},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({type:"password"},{disabled:t.disabled,showPassword:a.showPassword},{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入密码",clearable:""}),e.createSlots({_:2},[t.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"prepend")]),key:"0"}:void 0,t.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"append")]),key:"1"}:void 0]),1040,["modelValue","onChange","onInput","placeholder"])}]]),_e=v({name:"cvInputNumber",mixins:[F],props:{},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-number",type:"number"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入整数",clearable:""}),e.createSlots({_:2},[t.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"prepend")]),key:"0"}:void 0,t.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"append")]),key:"1"}:void 0]),1040,["modelValue","onChange","onInput","placeholder"])}]]),Ie=v({name:"cvInputIdcard",mixins:[F],components:{},props:{},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({type:"text",oninput:"if(value.length>18)value=value.slice(0,18)"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入身份证",clearable:"",maxlength:"18"}),e.createSlots({_:2},[t.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"prepend")]),key:"0"}:void 0,t.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"append")]),key:"1"}:void 0]),1040,["modelValue","onChange","onInput","placeholder"])}]]),Le=v({name:"cvInputDigit",mixins:[F],components:{},props:{},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({type:"number"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入",clearable:""}),e.createSlots({_:2},[t.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"prepend")]),key:"0"}:void 0,t.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"append")]),key:"1"}:void 0]),1040,["modelValue","onChange","onInput","placeholder"])}]]),Fe=v({name:"cvTextarea",mixins:[F],props:{rows:{type:[Number,String],default:3},autosize:{type:[Boolean,Object],default:!1}},data:()=>({}),computed:{lastRow(){return parseInt(this.rows)}},created(){},methods:{onSubmit(){this.$emit("btnClick",this.localVal)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({type:"textarea"},{disabled:t.disabled,rows:n.lastRow,autosize:a.autosize},{rows:n.lastRow,modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入内容",clearable:""}),null,16,["rows","modelValue","onInput","placeholder"])}]]),Sn={name:"cvTextareaBtn",mixins:[F],components:{},props:{rows:{type:[Number,String],default:3},btnText:{type:[Number,String],default:""},btnIcon:{type:[String],default:""},autosize:{type:[Boolean,Object],default:!1}},data:()=>({}),computed:{lastRow(){return parseInt(this.rows)}},methods:{onSubmit(){this.$emit("btnClick",this.localVal)}}},Nn={class:"cv-textab-group"},Bn={class:"cv-textab-group__append"},En={class:"cv-textab_slot-wrap"},$e=v(Sn,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input"),c=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",Nn,[e.createVNode(r,e.mergeProps({type:"textarea"},{disabled:t.disabled,rows:n.lastRow,autosize:a.autosize},{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=p=>t.localVal=p),onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入内容",clearable:""}),null,16,["modelValue","onInput","placeholder"]),e.createElementVNode("div",Bn,[e.createElementVNode("div",En,[e.renderSlot(t.$slots,"default",{},()=>[e.createVNode(c,{class:"cv-textab_slotbtn",type:"primary",size:t.size,onClick:n.onSubmit},{default:e.withCtx(()=>[a.btnIcon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(a.btnIcon),style:{"margin-right":"5px"}},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(a.btnText),1)]),_:1},8,["size","onClick"])])])])])}]]),Dn={class:"cv-input-group"},Tn={class:"cv-input-group__append"},Oe=v({name:"cvInputBtn",mixins:[F],emits:["btnClick"],components:{},props:{btnText:{type:[Number,String],default:"确定"},btnIcon:{type:[String],default:""}},data:()=>({}),methods:{onSubmit(){this.$emit("btnClick",this.localVal)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input"),c=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",Dn,[e.createVNode(r,e.mergeProps({type:"text"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=p=>t.localVal=p),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入",clearable:""}),null,16,["modelValue","onChange","onInput","placeholder"]),e.createElementVNode("div",Tn,[e.renderSlot(t.$slots,"default",{},()=>[e.createVNode(c,{class:"cv-input-btn__slotbtn",type:"primary",size:t.size,onClick:n.onSubmit},{default:e.withCtx(()=>[a.btnIcon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(a.btnIcon),style:{"margin-right":"5px"}},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(a.btnText),1)]),_:1},8,["size","onClick"])])])])}]]),no=v({data:()=>({formData:{}})},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div")}]]);Ee.install=function(t){t.component(Ee.name,Ee)},De.install=function(t){t.component(De.name,De)},Te.install=function(t){t.component(Te.name,Te)},_e.install=function(t){t.component(_e.name,_e)},Ie.install=function(t){t.component(Ie.name,Ie)},Le.install=function(t){t.component(Le.name,Le)},Fe.install=function(t){t.component(Fe.name,Fe)},$e.install=function(t){t.component($e.name,$e)},Oe.install=function(t){t.component(Oe.name,Oe)},no.install=function(t){t.component(no.name,no)};const Me=v({name:"cvInputCounter",extends:k.ElInputNumber,props:{},watch:{modelValue(){this.localVal=this.modelValue}},data:()=>({localVal:0}),created(){},methods:{handleChange(t){this.$emit("update:modelValue",this.localVal)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input-number");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{modelValue:l.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>l.localVal=c),onChange:n.handleChange,step:t.step}),null,16,["modelValue","onChange","step"])}]]);Me.install=function(t){t.component(Me.name,Me)};const _n={class:"cv-show-text"},In=["innerHTML"],ze=v({name:"cvShowText",mixins:[],components:{},props:{text:{type:[Number,String,Object],default:""}},data:()=>({}),created(){},methods:{}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",_n,[a.text?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:a.text},null,8,In)):e.createCommentVNode("",!0),a.text?e.createCommentVNode("",!0):e.renderSlot(t.$slots,"default",{key:1})])}]]),Ln={class:"cv-show-image"},Pe=v({name:"cvShowImage",mixins:[],components:{},props:{url:{type:[String,Array,Object],default:""},width:{type:[String],default:"100px"},height:{type:[String],default:"100px"}},data:()=>({localUrl:""}),watch:{url:{handler(){this.localUrl=typeof this.url=="string"?[this.url]:this.url},immediate:!0,deep:!0}},created(){},methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-image");return e.openBlock(),e.createElementBlock("div",Ln,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.localUrl,(c,p)=>(e.openBlock(),e.createBlock(r,{style:e.normalizeStyle("width:"+a.width+"; height:"+a.height+"; margin-right:10px"),key:p,src:c,"preview-src-list":l.localUrl},null,8,["style","src","preview-src-list"]))),128))])}]]),He=v({name:"cvShowTip",props:{borderColor:{type:[String],default:"#50bfff"},bgColor:{type:[String],default:"#ecf8ff"}},data:()=>({backgroundColor:"#ecf8ff",borderLeft:"5px solid #50bfff"}),created(){this.borderLeft=`5px solid ${this.borderColor}`,this.backgroundColor=`${this.bgColor}`},methods:{}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:"cv-show-tip",style:e.normalizeStyle({backgroundColor:this.backgroundColor,borderLeft:this.borderLeft})},[e.renderSlot(t.$slots,"default")],4)}]]),Fn={name:"cv-gallery-dialog",props:{type:String,title:String,sources:Array,sliceSingle:{type:Boolean,default:!1},carouselAttrs:Object},data:()=>({isShowCarousel:!1,sourceTitle:"",initialIndex:0,isShowPreview:!1}),methods:{startPreview(t){this.isShowPreview=!0,this.initialIndex=t,this.sourceTitle=this.sources[t].title},handleCarouselChange(t){this.sources[t]&&this.sources[t].title?this.sourceTitle=this.sources[t].title:this.sourceTitle=""}}},$n=["src"],On={key:0,class:"cv-gallery-iframe embed-responsive embed-responsive-16by9"},Mn=["src"],zn=["src"],Pn=["src"],Hn={name:"gallery",components:{GalleryDialog:v(Fn,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-carousel-item"),c=e.resolveComponent("el-carousel"),p=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(p,{visible:l.isShowPreview,"append-to-body":"",onOpen:o[0]||(o[0]=d=>l.isShowCarousel=!0),onClosed:o[1]||(o[1]=d=>l.isShowCarousel=!1),style:{"text-align":"center"}},{header:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.sourceTitle||a.title),1)]),default:e.withCtx(()=>[a.type==="video"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l.isShowPreview?(e.openBlock(),e.createElementBlock("video",{key:0,src:a.sources[l.initialIndex].src,autoplay:"autoplay",class:"cv-gallery-video",controls:"controls",width:"100%"},null,8,$n)):e.createCommentVNode("",!0)],64)):a.type==="iframe"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.isShowPreview?(e.openBlock(),e.createElementBlock("div",On,[e.createElementVNode("iframe",{src:a.sources[l.initialIndex].src,allowfullscreen:"true",border:"0",frameborder:"no",framespacing:"0",scrolling:"no"},null,8,Mn)])):e.createCommentVNode("",!0)],64)):a.type==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[a.sliceSingle&&a.sources[l.initialIndex]||a.sources.length===1?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.sources[l.initialIndex].src,class:"cv-gallery-image"},null,8,zn)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.isShowCarousel?(e.openBlock(),e.createBlock(c,e.mergeProps({key:0,"initial-index":l.initialIndex,onChange:n.handleCarouselChange,"indicator-position":"outside"},a.carouselAttrs),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.sources,(d,h)=>(e.openBlock(),e.createBlock(r,{key:h},{default:e.withCtx(()=>[e.createElementVNode("img",{src:d.src,class:"cv-gallery-image"},null,8,Pn)]),_:2},1024))),128))]),_:1},16,["initial-index","onChange"])):e.createCommentVNode("",!0)],64))],64)):e.createCommentVNode("",!0)]),_:1},8,["visible"])}]])},props:{type:{type:String,default:"image",validator:t=>["image","video","iframe"].includes(t)},size:Number,width:Number,height:Number,lazy:{type:Boolean,default:!1},source:[String,Array,Object],thumbSuffix:{type:String,default:""},thumbStyle:Object,carouselAttrs:Object,title:String,sliceSingle:{type:Boolean,default:!1}},data:()=>({}),computed:{computedStyle(){let t=this.width||this.size,o=this.height||this.size;return this.type==="iframe"&&(t=t?t+"px":"360px",o=o?o+"px":"auto"),Object.assign({},{width:t,height:o,display:"block"},this.thumbStyle)},thumbs(){return this.computedSources.map(t=>t.thumb)},computedSources(){const t=this.source;if(typeof t=="string")return[this.getStringSource(t)];if(t instanceof Array){const o=[];return t.forEach(a=>{a instanceof Object?o.push(this.getObjectSource(a)):typeof a=="string"&&o.push(this.getStringSource(a))}),o}return t instanceof Object?[this.getObjectSource(t)]:[]}},methods:{handlePreview(t){this.$refs.dialog.startPreview(t)},getStringSource(t){let o=t;return this.type==="image"&&this.thumbSuffix&&(o+=this.thumbSuffix),{type:this.type,src:t,thumb:o}},getObjectSource(t){return t.type=t.thumb?"image":this.type,t.thumb=t.thumb||t.src,t}}},An={key:0,class:"cv-gallery"},jn={class:"el-upload-list el-upload-list--picture-card"},Rn=["src"],Un={class:"el-upload-list__item-actions"},Wn=["onClick"],io=v(Hn,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("GalleryDialog");return a.source?(e.openBlock(),e.createElementBlock("div",An,[e.createElementVNode("div",jn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.computedSources,(p,d)=>(e.openBlock(),e.createElementBlock("li",{key:d,class:"el-upload-list__item"},[e.createElementVNode("div",{style:e.normalizeStyle(n.computedStyle),class:"cv-gallery-iframe embed-responsive embed-responsive-16by9"},[e.createElementVNode("iframe",{src:p.thumb,allowfullscreen:"true",border:"0",frameborder:"no",framespacing:"0",scrolling:"no"},null,8,Rn)],4),e.createElementVNode("span",Un,[e.createElementVNode("span",{onClick:h=>n.handlePreview(d,p)},[e.createVNode(r,{type:"ElIconVideoPlay",size:"20"})],8,Wn),e.renderSlot(t.$slots,"action",e.mergeProps({ref_for:!0},{source:p,index:d}))])]))),128))]),e.createVNode(c,{carouselAttrs:a.carouselAttrs,sliceSingle:a.sliceSingle,sources:n.computedSources,title:a.title,type:a.type,ref:"dialog"},null,8,["carouselAttrs","sliceSingle","sources","title","type"])])):e.createCommentVNode("",!0)}]]);ze.install=function(t){t.component(ze.name,ze)},Pe.install=function(t){t.component(Pe.name,Pe)},He.install=function(t){t.component(He.name,He)},io.install=function(t){t.component(io.name,io)};const Ae=v({name:"cvRadioOptBase"},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-radio");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}]]),je=v({name:"cvRadioOptBtn"},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-radio-button");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}]]),Re=v({name:"cvRadioGroup",props:{...k.ElRadioGroup.props,modelValue:{default:""},type:{type:[String],default:"base"},dataLists:{type:Array,default:()=>[]},dataField:{type:[Object],default:()=>({})},disabled:{type:Boolean,default:!1}},watch:{modelValue(t){this.localVal=t},localVal(){this.handleChange()},dataLists:{handler(){this._parseLocalOpt()},immediate:!0,deep:!0}},data(){return{localText:[],localVal:this.modelValue,localOpt:[]}},created(){this._parseLocalOpt()},methods:{handleChange(){this.$emit("update:modelValue",this.localVal)},_parseLocalOpt(){let t=[];if(this.dataLists&&this.dataLists.length!==0)if(typeof this.dataLists[0]=="string")this.dataLists.map(i=>{t.push({label:i,value:i})}),this.localOpt=t;else{var o=this.dataField&&this.dataField.label||"label",a=this.dataField&&this.dataField.value||"value";this.dataLists.map(i=>{let l=i[o]===0?0:i[o]||"",n=i[a]===0?0:i[a]||"";n=n===0?0:n||l,t.push({label:l,value:n,disabled:!!i.disabled}),i.checked!="true"&&i.checked!=1||(typeof this.localVal=="string"?this.localVal=n:typeof this.localVal!="array"&&typeof this.localVal!="object"||this.localVal.push(n))}),this.localOpt=t}}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-radio"),c=e.resolveComponent("el-radio-button"),p=e.resolveComponent("el-radio-group");return e.openBlock(),e.createBlock(p,{class:"cv-radio-group",modelValue:l.localVal,"onUpdate:modelValue":o[0]||(o[0]=d=>l.localVal=d)},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[a.type=="base"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.localOpt,(d,h)=>(e.openBlock(),e.createBlock(r,{label:d.label,value:d.value,key:h,disabled:a.disabled||d.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["label","value","disabled"]))),128)):e.createCommentVNode("",!0),a.type=="button"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(l.localOpt,(d,h)=>(e.openBlock(),e.createBlock(c,{label:d.label,value:d.value,key:h,disabled:a.disabled||d.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["label","value","disabled"]))),128)):e.createCommentVNode("",!0)])]),_:3},8,["modelValue"])}]]);Ae.install=function(t){t.component(Ae.name,Ae)},je.install=function(t){t.component(je.name,je)},Re.install=function(t){t.component(Re.name,Re)};const Ue=v({name:"cvCheckboxOptBase",extends:k.ElCheckbox},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-checkbox");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}]]),We=v({name:"cvCheckboxOptBtn",extends:k.ElCheckboxButton,props:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-checkbox-button");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}]]),El={props:{...k.ElCheckboxGroup.props,modelValue:{type:[Array],default:()=>[]},dataLists:{type:Array,default:()=>[]},dataField:{type:[Object],default:()=>({})},disabled:{type:Boolean,default:!1}},watch:{modelValue(){this.localVal=this.modelValue},localVal(){this.handleChange()},dataLists:{handler(){this._parseLocalOpt()},immediate:!0,deep:!0}},data(){return{localVal:this.modelValue,localOpt:[]}},created(){this.handleChange(),this._parseLocalOpt()},methods:{handleChange(){this.$emit("update:modelValue",this.localVal)},_parseLocalOpt(){let t=[];if(this.dataLists&&this.dataLists.length!==0)if(typeof this.dataLists[0]=="string")this.dataLists.map(i=>{t.push({label:i,value:i})}),this.localOpt=t;else{var o=this.dataField&&this.dataField.label||"label",a=this.dataField&&this.dataField.value||"value";this.dataLists.map(i=>{let l=i[o]===0?0:i[o]||"",n=i[a]===0?0:i[a]||"";n=n===0?0:n||l,t.push({label:l,value:n,disabled:!!i.disabled}),i.checked!="true"&&i.checked!=1||(typeof this.localVal=="string"?this.localVal=n:typeof this.localVal!="array"&&typeof this.localVal!="object"||this.localVal.push(n))}),this.localOpt=t}this._parseLocalOptDiy()},_parseLocalOptDiy(){}}},Yn={class:"cv-checkbox-all"},Ye=v({name:"cvCheckboxAll",mixins:[El],components:{},data:()=>({checkAll:!1,isIndeterminate:!0,localOptAll:[]}),methods:{handleCheckAllChange(t){this.localVal=t?this.localOptAll:[],this.isIndeterminate=!1,this.handleChange()},handleCheckedCitiesChange(t){let o=t.length;this.checkAll=o===this.localOptAll.length,this.isIndeterminate=o>0&&o<this.localOptAll.length},_parseLocalOptDiy(){this.localOpt&&this.localOpt.length!==0&&this.localOpt.map(t=>{t.disabled||this.localOptAll.push(t.label)})}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-checkbox"),c=e.resolveComponent("el-checkbox-group");return e.openBlock(),e.createElementBlock("div",Yn,[e.createVNode(r,{indeterminate:l.isIndeterminate,modelValue:l.checkAll,"onUpdate:modelValue":o[0]||(o[0]=p=>l.checkAll=p),onChange:n.handleCheckAllChange},{default:e.withCtx(()=>[...o[2]||(o[2]=[e.createTextVNode("全选",-1)])]),_:1},8,["indeterminate","modelValue","onChange"]),o[3]||(o[3]=e.createElementVNode("div",{style:{margin:"15px 0"}},null,-1)),e.createVNode(c,{modelValue:t.localVal,"onUpdate:modelValue":o[1]||(o[1]=p=>t.localVal=p),onChange:n.handleCheckedCitiesChange},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.localOpt,(p,d)=>(e.openBlock(),e.createBlock(r,{label:p.label,value:p.value,key:d,onChange:t.handleChange,disabled:t.disabled||p.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.label),1)]),_:2},1032,["label","value","onChange","disabled"]))),128))])]),_:3},8,["modelValue","onChange"])])}]]),qe=v({name:"cvCheckboxGroup",mixins:[El],components:{},props:{type:{type:[String],default:"base"}},data:()=>({})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-checkbox"),c=e.resolveComponent("el-checkbox-button"),p=e.resolveComponent("el-checkbox-group");return e.openBlock(),e.createBlock(p,e.mergeProps(t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=d=>t.localVal=d)}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[a.type=="base"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.localOpt,(d,h)=>(e.openBlock(),e.createBlock(r,{label:d.label,value:d.value,key:h,onChange:t.handleChange,disabled:t.disabled||d.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["label","value","onChange","disabled"]))),128)):e.createCommentVNode("",!0),a.type=="button"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.localOpt,(d,h)=>(e.openBlock(),e.createBlock(c,{label:d.label,value:d.value,key:h,onChange:t.handleChange,disabled:t.disabled||d.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["label","value","onChange","disabled"]))),128)):e.createCommentVNode("",!0)])]),_:3},16,["modelValue"])}]]);function Dl(t,o,a){var i={}.atBegin;return function(l,n,r){var c,p=r||{},d=p.noTrailing,h=d!==void 0&&d,u=p.noLeading,m=u!==void 0&&u,f=p.debounceMode,C=f===void 0?void 0:f,g=!1,y=0;function b(){c&&clearTimeout(c)}function w(){for(var V=arguments.length,S=new Array(V),B=0;B<V;B++)S[B]=arguments[B];var T=this,_=Date.now()-y;function O(){y=Date.now(),n.apply(T,S)}function ae(){c=void 0}g||(m||!C||c||O(),b(),C===void 0&&_>l?m?(y=Date.now(),h||(c=setTimeout(C?ae:O,l))):O():h!==!0&&(c=setTimeout(C?ae:O,C===void 0?l-_:l)))}return w.cancel=function(V){var S=(V||{}).upcomingOnly,B=S!==void 0&&S;b(),g=!B},w}(t,o,{debounceMode:(i!==void 0&&i)!==!1})}function Xe(t,o=!1,a=!0){return new Promise((i,l)=>{const n=document.createElement("script");t=t.replace(/([^:]\/)\/+/g,"$1"),n.id=t,n.type="text/javascript",n.src=o?t+"?t="+new Date().getTime():t,document.getElementById(t)&&a?i():(document.body.appendChild(n),n.onload=()=>{i()})})}function qn(t){const o=t;try{const a=document.createElement("textarea");a.value=o,document.body.appendChild(a),a.select(),document.execCommand("Copy"),a.remove(),document.body.removeChild(a)}catch{navigator.clipboard.writeText(o).then(()=>{}).catch(i=>{})}k.ElMessage({message:"复制成功",type:"success"})}function Xn(t){var o=new Date,a=new Date(t),i=o-a,l=Math.floor(i/1e3),n=Math.floor(l/60),r=Math.floor(n/60);if(n<1)var c=l+"秒前";else r<1?c=n+"分钟前":r<24?c=r+"小时前":c=a.toLocaleString();return c}function K(t,...o){return o.reduce((a,i)=>Object.keys(i).reduce((l,n)=>{const r=i[n];return eo(r)?l[n]=K(l[n]?l[n]:{},r):_l(r)?l[n]=r.map((c,p)=>{if(eo(c)){const d=l[n]?l[n]:[];return K(d[p]?d[p]:{},c)}return c}):l[n]=r,l},a),t)}function Tl(t,o){const{[o[0]]:a,...i}=t;return Object.keys(t).reduce((l,n)=>(o.includes(n)||(l[n]=t[n]),l),{})}function eo(t){return Object.prototype.toString.call(t)==="[object Object]"}function _l(t){return typeof Array.isArray=="function"?Array.isArray(t):Object.prototype.toString.call(t)==="[object Array]"}function ee(t){return _l(t)?t.length===0:eo(t)?Object.keys(t).length===0:t===""||t==null}function oe(t,o){return ee(t)?o:t}function Kn(t){let o=t.lastIndexOf("."),a=t.substring(o+1);return["png","jpg","jpeg","gif","webp","svg"].indexOf(a.toLowerCase())!=-1}function Z(t){return t==null?"":String(t)}Ue.install=function(t){t.component(Ue.name,Ue)},We.install=function(t){t.component(We.name,We)},qe.install=function(t){t.component(qe.name,qe)},Ye.install=function(t){t.component(Ye.name,Ye)};const Il=(()=>{const t={svg:["image/svg+xml","image/svg"],jpg:["image/jpeg","image/jpg"],jpeg:["image/jpeg"],png:["image/png"],gif:["image/gif"],webp:["image/webp"],bmp:["image/bmp","image/x-bmp","image/x-ms-bmp"],ico:["image/x-icon","image/vnd.microsoft.icon"],tiff:["image/tiff","image/tif","image/x-tiff"],apng:["image/apng"],avif:["image/avif"],heic:["image/heic"],pdf:["application/pdf"],txt:["text/plain"],csv:["text/csv"],json:["application/json"],xml:["application/xml"],doc:["application/msword"],docx:["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],xls:["application/vnd.ms-excel"],xlsx:["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],ppt:["application/vnd.ms-powerpoint"],pptx:["application/vnd.openxmlformats-officedocument.presentationml.presentation"],zip:["application/zip"],rar:["application/x-rar-compressed"],"7z":["application/x-7z-compressed"],mp3:["audio/mpeg"],mp4:["video/mp4"],mov:["video/quicktime"],avi:["video/x-msvideo"],wav:["audio/wav"]},o={},a={};for(const[i,l]of Object.entries(t)){o[i]=l[0];for(const n of l)a[n]=i}return{extensionToMime:o,mimeToExtension:a}})(),Gn={name:"cvGeoCity",mixins:[],components:{},emits:["update:province","update:city","update:district","update:provinceCode","update:cityCode","update:districtCode"],props:{modelValue:{type:[String,Array,Number],default:()=>[]},province:{type:[String]},provinceCode:{type:[Number,String],default:""},city:{type:[String]},cityCode:{type:[Number,String],default:""},district:{type:[String]},districtCode:{type:[Number,String],default:""},cityHide:{type:Boolean,default:!1},districtHide:{type:Boolean,default:!1}},watch:{modelValue(t){},province(t){this.initProvince()},provinceCode(t){this.initProvince()},cityCode(t){this.initCity()},districtCode(t){this.initDistrict()}},data:()=>({provinceCdnList:{},cityCdnList:{},districtCdnList:{},isCdnLoading:!0,provinceList:[],cityList:[],districtList:[],local1_code:"",local1_name:"",local2_code:"",local2_name:"",local3_code:"",local3_name:"",local1_flag:!1,local2_flag:!1,local3_flag:!1,hideMunicipality:!1,municipalities:["110000","120000","310000","500000","北京市","天津市","上海市","重庆市"]}),async mounted(){await Xe(this.CDN_URL_UI+"/dict/geo/province-kv-window.js"),await Xe(this.CDN_URL_UI+"/dict/geo/city-kv-window.js"),await Xe(this.CDN_URL_UI+"/dict/geo/district-kv-window.js"),await this.initLoad()},methods:{initLoad(){setTimeout(()=>{this.provinceCdnList=window.cdn__DictAreaProvince,this.cityCdnList=window.cdn__DictAreaCity,this.districtCdnList=window.cdn__DictAreaDistrict,this.local1_flag=!1,this.isCdnLoading=!1,this.getProvinces(),this.initProvince()},200)},initProvince(){if(!this.province&&!this.provinceCode)return!1;this.getProvinces();const t=this.provinceList.find(o=>this.province?o.provinceName===this.province:this.provinceCode&&o.provinceCode===this.provinceCode);t&&(this.local1_code=t.provinceCode,this.changeProvince(t.provinceCode)),this.initCity()},initCity(){if(!this.city&&!this.cityCode)return!1;const t=this.cityList.find(o=>this.city?o.cityName===this.city:this.cityCode&&o.cityCode===this.cityCode);t&&(this.local2_code=t.cityCode,this.changeCity(t.cityCode)),this.initDistrict()},initDistrict(){if(!this.district&&!this.districtCode)return!1;const t=this.districtList.find(o=>this.district?o.districtName===this.district:this.districtCode&&o.districtCode===this.districtCode);t&&this.changeDistrict(t.districtCode)},getProvinces(){if(!this.local1_flag&&typeof this.provinceCdnList=="object"){let t=[];for(let o in this.provinceCdnList)t.push({provinceCode:o,provinceName:this.provinceCdnList[o]});this.provinceList=t,this.local1_flag=!0}},changeProvince(t){this._getNeedCity(),this.local2_flag=!0,this.local2_code="",this.local2_name="",this.local3_code="",this.local3_name="",this.local1_code=t,this.local1_name=this.provinceList.find(o=>o.provinceCode===t)?.provinceName,this.handleChoose()},_getNeedCity(){let t=[],o=this.local1_code.substring(0,2);for(let a in this.cityCdnList)a.substring(0,2)==o&&t.push({cityCode:a,cityName:this.cityCdnList[a]});this.cityList=t},getCities(){this.local2_flag||this.provinceCode&&(this._getNeedCity(),this.local2_flag=!0)},changeCity(t){this._getNeedDistrict(),this.local3_flag=!0,this.local3_name="",this.local3_code="",this.local2_code=t,this.local2_name=this.cityList.find(o=>o.cityCode===t)?.cityName,this.handleChoose()},_getNeedDistrict(){let t=[],o=this.local2_code.substring(0,4);for(let a in this.districtCdnList)a.substring(0,4)==o&&t.push({districtCode:a,districtName:this.districtCdnList[a]});this.districtList=t},getDistrict(){this.local3_flag||this.local2_code&&this._getNeedDistrict()},changeDistrict(t){this.local3_code=t,this.local3_name=this.districtList.find(o=>o.districtCode===t)?.districtName,this.handleChoose()},handleChoose(){this.$emit("update:province",this.local1_name),this.$emit("update:provinceCode",this.local1_code),this.$emit("update:city",this.local2_name),this.$emit("update:cityCode",this.local2_code),this.$emit("update:district",this.local3_name),this.$emit("update:districtCode",this.local3_code)}}},Zn={class:"cv-geo-city"},Qn={key:0},Jn={key:1},Ke=v(Gn,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-option"),c=e.resolveComponent("el-select"),p=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",Zn,[e.createElementVNode("div",null,[e.createVNode(c,{modelValue:l.local1_code,"onUpdate:modelValue":o[0]||(o[0]=d=>l.local1_code=d),onFocus:n.getProvinces,onChange:n.changeProvince,placeholder:"省",filterable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.provinceList,(d,h)=>(e.openBlock(),e.createBlock(r,{key:d.provinceCode,label:d.provinceName,value:d.provinceCode},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.provinceName),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onFocus","onChange"])]),a.cityHide?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Qn,[e.createVNode(c,{modelValue:l.local2_code,"onUpdate:modelValue":o[1]||(o[1]=d=>l.local2_code=d),onFocus:n.getCities,onChange:n.changeCity,placeholder:"市",filterable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.cityList,(d,h)=>(e.openBlock(),e.createBlock(r,{key:d.cityCode,label:d.cityName,value:d.cityCode},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.cityName),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onFocus","onChange"])])),a.cityHide||a.districtHide?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Jn,[e.createVNode(c,{modelValue:l.local3_code,"onUpdate:modelValue":o[2]||(o[2]=d=>l.local3_code=d),onFocus:n.getDistrict,onChange:n.changeDistrict,placeholder:"区/县",filterable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.districtList,(d,h)=>(e.openBlock(),e.createBlock(r,{key:d.districtCode,label:d.districtName,value:d.districtCode},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.districtName),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onFocus","onChange"])]))])),[[p,l.isCdnLoading]])}]]),Ll={computed:{componentName(){return this.$options.name}},methods:{_mergeAttrs(t){const o=this.$cvUiParams||{},a=t&&o[t]||{},i=o[this.componentName]||{},l=Object.assign({},a,i);return Object.assign({},l,this.$attrs)}}},ei={class:"cv-geo-map__wrap"},ti={class:"cv-geo-map__box"},oi={style:{width:"100%",height:"510px"}},ai=["src"],li={class:"cv-geo-map__info"},ni={key:0,class:"cv-geo-map__address"},ii={key:1,class:"cv-geo-map__jwd"},Ge=v({name:"cvGeoMap",mixins:[Ll],emits:["update:address","update:latitude","update:longitude","update:name","update:city"],props:{title:{type:[String],default:"选择经纬度地点"},mapKey:{type:[String],default:""},mapSecret:{type:[String],default:""},mapType:{type:[String],default:"qq"},address:{type:[String]},name:{type:[String]},city:{type:[String]},latitude:{type:[Number,String]},longitude:{type:[Number,String]}},watch:{address(t){this.localAddress=t},latitude(t){this.localLatitude=t},longitude(t){this.localLongitude=t},name(t){this.localName=t},city(t){this.localCity=t}},computed:{localMapKey(){return this._mergeAttrs("geo").mapKey},localMapSecret(){return this._mergeAttrs("geo").mapSecret},mapSrc(){let t=this.localMapKey;if(this.mapType=="qq"){if(!this.localMapKey)return"";let o="https://apis.map.qq.com/tools/locpicker";return o+=`?search=1&type=1&key=${t}&referer=myapp`,this.latitude&&this.longitude&&(o+=`&coord=${this.latitude},${this.longitude}`),o}if(this.mapType=="amap"){if(!this.localMapKey||!this.localMapSecret)return"";let o="https://m.amap.com/picker/";return o+=`?zoom=15&radius=1000&total=20&key=${t}&jscode=${localMapSecret}`,this.latitude&&this.longitude&&(o+=`¢er=${this.longitude},${this.latitude}`),o}return this.$message.info("目前不支持百度地图"),""}},data:()=>({localMapShow:!1,localAddress:"",localLatitude:"",localLongitude:"",localName:"",localCity:""}),mounted(){this.initData()},methods:{initData(){let t=this;window.addEventListener("message",o=>{let a=o.data;a&&a.module=="locationPicker"&&(t.localAddress=a.poiaddress||"",t.localName=a.poiname||"",t.localCity=a.cityname||"",t.localLatitude=a.latlng.lat||"",t.localLongitude=a.latlng.lng||"")},!1)},handleMapClose(){this.localMapShow=!1},handleMapOpen(){this.localMapShow=!0},handleConfirm(){this.$emit("update:address",this.localAddress),this.$emit("update:longitude",this.localLongitude),this.$emit("update:latitude",this.localLatitude),this.$emit("update:name",this.localName),this.$emit("update:city",this.localCity),this.handleMapClose()},handleCopy(t){this.$cvCopy(t)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input"),c=e.resolveComponent("el-tooltip"),p=e.resolveComponent("el-button"),d=e.resolveComponent("el-scrollbar"),h=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",ei,[e.createElementVNode("div",ti,[e.createVNode(c,{class:"item",effect:"dark",content:"请点击查找位置选择位置",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(r,{modelValue:l.localAddress,"onUpdate:modelValue":o[0]||(o[0]=u=>l.localAddress=u)},null,8,["modelValue"])]),_:1}),e.createVNode(p,{type:"primary",icon:"ElIconSearch",onClick:n.handleMapOpen},{default:e.withCtx(()=>[...o[5]||(o[5]=[e.createTextVNode("请查找位置",-1)])]),_:1},8,["onClick"])])]),e.createVNode(h,{modelValue:l.localMapShow,"onUpdate:modelValue":o[4]||(o[4]=u=>l.localMapShow=u),title:a.title,width:"520","before-close":n.handleMapClose},{footer:e.withCtx(()=>[e.createElementVNode("div",li,[l.localAddress?(e.openBlock(),e.createElementBlock("div",ni,[o[6]||(o[6]=e.createElementVNode("span",{class:"cv-geo-map__label"},"已选:",-1)),e.createVNode(c,{class:"item",effect:"dark",content:"点击复制",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("span",{class:"cv-geo-map__value",onClick:o[1]||(o[1]=u=>n.handleCopy(l.localAddress))},e.toDisplayString(l.localAddress),1)]),_:1})])):e.createCommentVNode("",!0),l.localAddress?(e.openBlock(),e.createElementBlock("div",ii,[o[7]||(o[7]=e.createElementVNode("span",{class:"cv-geo-map__label"},"经度:",-1)),e.createVNode(c,{class:"item",effect:"dark",content:"点击复制",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("span",{class:"cv-geo-map__value",onClick:o[2]||(o[2]=u=>n.handleCopy(l.localLongitude))},e.toDisplayString(l.localLongitude),1)]),_:1}),o[8]||(o[8]=e.createElementVNode("span",{class:"cv-geo-map__label"},"纬度:",-1)),e.createVNode(c,{class:"item",effect:"dark",content:"点击复制",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("span",{class:"cv-geo-map__value",onClick:o[3]||(o[3]=u=>n.handleCopy(l.localLatitude))},e.toDisplayString(l.localLatitude),1)]),_:1})])):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[e.createVNode(p,{onClick:n.handleMapClose},{default:e.withCtx(()=>[...o[9]||(o[9]=[e.createTextVNode("取消",-1)])]),_:1},8,["onClick"]),e.createVNode(p,{type:"primary",onClick:n.handleConfirm,disabled:!l.localAddress},{default:e.withCtx(()=>[...o[10]||(o[10]=[e.createTextVNode("确认选择",-1)])]),_:1},8,["onClick","disabled"])])]),default:e.withCtx(()=>[e.createElementVNode("div",oi,[e.createVNode(d,{style:{height:"510px"}},{default:e.withCtx(()=>[e.createElementVNode("iframe",{id:"mapPage",width:"100%",height:"100%",style:{height:"500px"},frameborder:"0",src:n.mapSrc},null,8,ai)]),_:1})])]),_:1},8,["modelValue","title","before-close"])],64)}]]);Ke.install=function(t){t.component(Ke.name,Ke)},Ge.install=function(t){t.component(Ge.name,Ge)};const Ze={...k.ElOption,extends:k.ElOption,name:"cvSelectOpt"},Qe=v({name:"cvSelectBase",emits:["onChoose","change","update:modelValue"],props:{...k.ElSelect.props,modelValue:{type:[String,Array,Number],default:()=>""},dataLists:{type:[Array],default:()=>[]},dataField:{type:[Object],default:()=>({})},dataDisabled:{type:[Array],default:()=>[]},disabled:{type:Boolean,default:!1},placeholder:{type:[String,Number],default:"请选择"}},watch:{modelValue(t){this.localVal=t},dataLists:{handler(){this._parseLocalOpt()},immediate:!0,deep:!0},localVal(t){this.handleChange()}},data(){return{localVal:this.modelValue,localOpt:[]}},methods:{handleChoose(t,o){this.$emit("onChoose",t,o)},handleChange(){this.$emit("change",this.localVal),this.$emit("update:modelValue",this.localVal)},_parseLocalOpt(){let t=[];if(this.dataLists&&this.dataLists.length!==0)if(typeof this.dataLists[0]=="string")this.dataLists.map(i=>{t.push({label:i,value:i})}),this.localOpt=t;else{var o=this.dataField&&this.dataField.label||"label",a=this.dataField&&this.dataField.value||"value";this.dataLists.map(i=>{let l=i[o]===0?0:i[o]||"",n=i[a]===0?0:i[a]||"";if(n=n===0?0:n||l,this.dataDisabled.length>0)for(let r in this.dataDisabled)this.dataDisabled[r][a]==n&&(i.disabled=!0);t.push({label:l,value:n,disabled:!!i.disabled}),i.checked!="true"&&i.checked!=1||(typeof this.localVal=="string"?this.localVal=n:typeof this.localVal!="array"&&typeof this.localVal!="object"||this.localVal.push(n))}),this.localOpt=t}}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-option"),c=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(c,e.mergeProps({class:"cv-select-base"},t.$props,{modelValue:l.localVal,"onUpdate:modelValue":o[0]||(o[0]=p=>l.localVal=p),size:t.size,filterable:"",clearable:""}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.localOpt,(p,d)=>(e.openBlock(),e.createBlock(r,{onClick:h=>n.handleChoose(p,d),disabled:p.disabled,label:p.label,value:p.value,key:d},null,8,["onClick","disabled","label","value"]))),128))])]),_:3},16,["modelValue","size"])}]]),Je=v({name:"cvSelectTree",emits:["update:modelValue","change"],props:{...k.ElSelect.props,modelValue:{type:[String,Array,Number],default:()=>""},dataLists:{type:[Array],default:()=>[]},dataField:{type:[Object],default:()=>({value:"id",label:"title",children:"children"})},clearable:{type:Boolean,default:!0},accordion:{type:Boolean,default:!1},defaultExpandAll:{type:Boolean,default:!0},dataDisabled:{type:[Array],default:()=>[]},disabled:{type:Boolean,default:!1},placeholder:{type:[String,Number],default:"请选择"},showAllLevels:{type:Boolean,default:!0},showCheckbox:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},emitPath:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},refID:{type:[String],required:!1,default:()=>"cvSelectTree-"+ +new Date+(Math.random()/1e4).toFixed(0)}},watch:{modelValue(){this.localVal=this.modelValue,this.initHandle()},dataLists:{handler(){this._parseLocalOpt()},immediate:!0,deep:!0},localVal(){this.handleChange()}},data:()=>({localVal:"",localOpt:[],localTitle:"",defaultExpandedKey:[]}),computed:{props2(){return Object.assign(this.dataField,{emitPath:this.emitPath},{multiple:this.multiple})}},created(){},mounted(){this.localVal=this.modelValue,this.initHandle()},methods:{initHandle(){if(this.localVal){var t=this.$refs[this.refID+"tree"].getNode(this.localVal);t&&(this.localTitle=t.data[this.dataField.label],this.$refs[this.refID+"tree"].setCurrentKey(this.localVal),this.defaultExpandedKey=[this.localVal])}else this.clearHandle();this.initScroll()},initScroll(){this.$nextTick(()=>{let t=document.querySelectorAll(".cv-select-tree .el-scrollbar .el-select-dropdown__wrap")[0],o=document.querySelectorAll(".cv-select-tree .el-scrollbar .el-scrollbar__bar");t.style.cssText="margin: 0px; max-height: none; overflow: hidden;",o.forEach(a=>a.style.width=0)})},handleNodeClick(t,o,a){t.disabled||(this.localTitle=t[this.dataField.label],this.localVal=t[this.dataField.value],this.defaultExpandedKey=[],this.$refs[this.refID].blur())},clearHandle(){this.localTitle="",this.localVal="",this.defaultExpandedKey=[],this.clearSelected()},clearSelected(){document.querySelectorAll(`#${this.refID}tree .el-tree-node`).forEach(t=>t.classList.remove("is-current"))},handleChange(){this.$emit("change",this.localVal),this.$emit("update:modelValue",this.localVal)},_parseLocalOpt(){let t=this.dataLists;this.dataField&&this.dataField.label;let o=this.dataField&&this.dataField.value||"value",a=this.dataField&&this.dataField.children||"children",i=this.dataDisabled;(function l(n){for(let r in n)i.map(c=>{n[r][o]==c[o]&&(n[r].disabled=!0)}),n[r][a]&&l(n[r][a])})(t),this.localOpt=t}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-tree"),c=e.resolveComponent("el-option"),p=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(p,e.mergeProps(t.$props,{ref:a.refID,"popper-class":"cv-select-tree",modelValue:l.localTitle,onClear:n.clearHandle}),{default:e.withCtx(()=>[e.createVNode(c,{value:l.localTitle,label:l.localTitle,class:"options"},{default:e.withCtx(()=>[e.createVNode(r,{"highlight-current":"",id:a.refID+"tree",ref:a.refID+"tree",accordion:a.accordion,showCheckbox:a.showCheckbox,data:l.localOpt,props:a.dataField,"node-key":a.dataField.value,onNodeClick:n.handleNodeClick,"default-expand-all":a.defaultExpandAll},null,8,["id","accordion","showCheckbox","data","props","node-key","onNodeClick","default-expand-all"])]),_:1},8,["value","label"])]),_:1},16,["modelValue","onClear"])}]]);Ze.install=function(t){t.component(Ze.name,Ze)},Qe.install=function(t){t.component(Qe.name,Qe)},Je.install=function(t){t.component(Je.name,Je)};const ri={name:"cvCascaderBase",components:{},props:{...k.ElCascader.props,modelValue:{type:[String,Array,Number],default(){}},dataLists:{type:[Array],default:()=>[]},dataDisabled:{type:[Array],default:()=>[]},disabled:{type:Boolean,default:!1},placeholder:{type:[String,Number],default:"请选择"},showAllLevels:{type:Boolean,default:!0},filterable:{type:Boolean,default:!0},dataField:{type:[Object],default:()=>({})},emitPath:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1}},watch:{modelValue(){this.localVal=this.modelValue},dataLists:{handler(){this._parseLocalOpt()},immediate:!0,deep:!0},localVal(){this.handleChange(),this.handleInput()}},data(){return{localVal:this.modelValue,localOpt:[]}},computed:{props2(){return Object.assign(this.dataField,{emitPath:this.emitPath},{multiple:this.multiple})}},created(){},methods:{handleChange(){this.$emit("change",this.localVal)},handleInput(){this.$emit("update:modelValue",this.localVal)},_parseLocalOpt(){let t=this.dataLists,o=this.dataField&&this.dataField.value||"value",a=this.dataDisabled;(function i(l){for(let n in l)a.map(r=>{l[n][o]==r[o]&&(l[n].disabled=!0)}),l[n].children&&i(l[n].children)})(t),this.localOpt=t},getCheckedNodes(){}}},si={class:"cv-cascader-base block"},et=v(ri,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-cascader");return e.openBlock(),e.createElementBlock("div",si,[e.createVNode(r,e.mergeProps(t.$props,{props:n.props2,modelValue:l.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>l.localVal=c),options:l.localOpt,onChange:n.handleChange,onGetCheckedNodes:n.getCheckedNodes}),null,16,["props","modelValue","options","onChange","onGetCheckedNodes"])])}]]);et.install=function(t){t.component(et.name,et)};const Fl={props:{...k.ElTimePicker.props,modelValue:{type:[String,Array,Number,Object,Date],default:null}},watch:{modelValue:{handler(){if(this.valueFormat!="timestamp")this.localVal=this.modelValue;else if(Array.isArray(this.modelValue)){var t;if(t=this.modelValue.map(o=>{if(!isNaN(o)&&o.toString().length==10)return 1e3*o}),this.localVal&&this.localVal[0]==t[0]&&this.localVal[1]==t[1])return;this.localVal=t}else this.modelValue&&this.modelValue.toString().length==10&&this.localVal!=1e3*this.modelValue&&(this.localVal=1e3*this.modelValue)},immediate:!0,deep:!0},localVal(){var t;if(this.valueFormat!="timestamp")this.$emit("update:modelValue",this.localVal);else if(Array.isArray(this.localVal)){if(t=this.localVal.map(o=>{if(!isNaN(o)&&o.toString().length==13)return parseInt(o/1e3)}),this.modelValue&&t[0]==this.modelValue[0]&&t[1]==this.modelValue[1])return;this.$emit("update:modelValue",t)}else isNaN(this.localVal)||this.localVal.toString().length!=13||(t=parseInt(this.localVal/1e3),this.modelValue!=t&&this.$emit("update:modelValue",t))}},data:()=>({localVal:""}),created(){},methods:{}},tt=v({name:"cvTimeBase",mixins:[Fl],props:{format:{type:String,default:"HH:mm:ss"},valueFormat:{type:String,default:"HH:mm:ss"},placeholder:{type:[String,Number],default:"选择时间"}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-time-picker");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-timePicker-base"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),format:a.format,"picker-options":{}}),null,16,["modelValue","format"])}]]),ot=v({name:"cvTimeRange",mixins:[Fl],props:{format:{type:String,default:"HH:mm:ss"},valueFormat:{type:String,default:"HH:mm:ss"},startPlaceholder:{type:[String,Number],default:"开始时间"},rangeSeparator:{type:[String,Number],default:"至"},endPlaceholder:{type:[String,Number],default:"结束时间"}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-time-picker");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-timePicker-range"},t.$props,{"is-range":"",modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),format:a.format,"range-separator":a.rangeSeparator,"start-placeholder":a.startPlaceholder,"end-placeholder":a.endPlaceholder}),null,16,["modelValue","format","range-separator","start-placeholder","end-placeholder"])}]]),at=v({name:"cvTimeSelect"},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-time-select");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-time-select"},t.$props),null,16)}]]),oo={props:{...k.ElDatePicker.props,modelValue:{type:[String,Array,Number,Object,Date],default:null},pickerOptions:{type:Boolean,default:!1}},watch:{modelValue:{handler(){if(this.valueFormat!="timestamp")this.localVal=this.modelValue;else if(Array.isArray(this.modelValue)){var t;if(t=this.modelValue.map(o=>{if(!isNaN(o)&&o.toString().length==10)return 1e3*o}),this.localVal&&this.localVal[0]==t[0]&&this.localVal[1]==t[1])return;this.localVal=t}else this.modelValue&&this.modelValue.toString().length==10&&this.localVal!=1e3*this.modelValue&&(this.localVal=1e3*this.modelValue)},immediate:!0,deep:!0},localVal(){var t;if(this.valueFormat!="timestamp")this.$emit("update:modelValue",this.localVal);else if(Array.isArray(this.localVal)){if(t=this.localVal.map(o=>{if(!isNaN(o)&&o.toString().length==13)return parseInt(o/1e3)}),this.modelValue&&t[0]==this.modelValue[0]&&t[1]==this.modelValue[1])return;this.$emit("update:modelValue",t)}else isNaN(this.localVal)||this.localVal.toString().length!=13||(t=parseInt(this.localVal/1e3),this.modelValue!=t&&this.$emit("update:modelValue",t))}},data:()=>({localVal:""})},lt=v({name:"cvDateBase",mixins:[oo],props:{format:{type:String,default:"YYYY-MM-DD"},valueFormat:{type:String,default:"YYYY-MM-DD"},placeholder:{type:[String,Number],default:"选择日期"}},data:()=>({localPickerOptions:{disabledDate:t=>t.getTime()>Date.now(),shortcuts:[{text:"今天",onClick(t){t.$emit("pick",new Date)}},{text:"昨天",onClick(t){const o=new Date;o.setTime(o.getTime()-864e5),t.$emit("pick",o)}},{text:"一周前",onClick(t){const o=new Date;o.setTime(o.getTime()-6048e5),t.$emit("pick",o)}},{text:"一个月前",onClick(t){const o=new Date;o.setTime(o.getTime()-2592e6),t.$emit("pick",o)}},{text:"三个月前",onClick(t){const o=new Date;o.setTime(o.getTime()-7776e6),t.$emit("pick",o)}},{text:"六个月前",onClick(t){const o=new Date;o.setTime(o.getTime()-15552e6),t.$emit("pick",o)}},{text:"一年前",onClick(t){const o=new Date;o.setTime(o.getTime()-31536e6),t.$emit("pick",o)}}]}})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-date-picker");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),type:"date","value-format":a.valueFormat,placeholder:a.placeholder,"picker-options":t.pickerOptions&&l.localPickerOptions}),null,16,["modelValue","value-format","placeholder","picker-options"])}]]),nt=v({name:"cvDateRange",mixins:[oo],props:{valueFormat:{type:String,default:"yyyy-MM-dd"},startPlaceholder:{type:[String,Number],default:"开始日期"},rangeSeparator:{type:[String,Number],default:"至"},endPlaceholder:{type:[String,Number],default:"结束日期"}},data:()=>({localPickerOptions:{shortcuts:[{text:"今天",onClick(t){const o=new Date,a=new Date;t.$emit("pick",[a,o])}},{text:"昨天",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-864e5),o.setTime(o.getTime()-864e5),t.$emit("pick",[a,o])}},{text:"最近一周",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-6048e5),t.$emit("pick",[a,o])}},{text:"最近一个月",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-2592e6),t.$emit("pick",[a,o])}},{text:"最近三个月",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-7776e6),t.$emit("pick",[a,o])}},{text:"最近六个月",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-15552e6),t.$emit("pick",[a,o])}},{text:"最近一年",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-31536e6),t.$emit("pick",[a,o])}}]}})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-date-picker");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),type:"daterange","value-format":a.valueFormat,"range-separator":a.rangeSeparator,"start-placeholder":a.startPlaceholder,"end-placeholder":a.endPlaceholder,"picker-options":t.pickerOptions&&l.localPickerOptions}),null,16,["modelValue","value-format","range-separator","start-placeholder","end-placeholder","picker-options"])}]]),it=v({name:"cvDatetimeBase",mixins:[oo],props:{format:{type:String,default:"YYYY-MM-DD HH:mm:ss"},valueFormat:{type:String,default:"YYYY-MM-DD HH:mm:ss"},placeholder:{type:[String,Number],default:"选择日期时间"}},data:()=>({localPickerOptions:{disabledDate:t=>t.getTime()>Date.now(),shortcuts:[{text:"今天",onClick(t){t.$emit("pick",new Date)}},{text:"昨天",onClick(t){const o=new Date;o.setTime(o.getTime()-864e5),t.$emit("pick",o)}},{text:"一周前",onClick(t){const o=new Date;o.setTime(o.getTime()-6048e5),t.$emit("pick",o)}},{text:"一个月前",onClick(t){const o=new Date;o.setTime(o.getTime()-2592e6),t.$emit("pick",o)}},{text:"三个月前",onClick(t){const o=new Date;o.setTime(o.getTime()-7776e6),t.$emit("pick",o)}},{text:"六个月前",onClick(t){const o=new Date;o.setTime(o.getTime()-15552e6),t.$emit("pick",o)}},{text:"一年前",onClick(t){const o=new Date;o.setTime(o.getTime()-31536e6),t.$emit("pick",o)}}]}})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-date-picker");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),type:"datetime","value-format":a.valueFormat,placeholder:a.placeholder,"picker-options":t.pickerOptions&&l.localPickerOptions}),null,16,["modelValue","value-format","placeholder","picker-options"])}]]),rt=v({name:"cvDatetimeRange",mixins:[oo],props:{valueFormat:{type:String,default:"YYYY-MM-DD HH:mm:ss"},startPlaceholder:{type:[String,Number],default:"开始日期"},rangeSeparator:{type:[String,Number],default:"至"},endPlaceholder:{type:[String,Number],default:"结束日期"}},data:()=>({localPickerOptions:{shortcuts:[{text:"今天",onClick(t){const o=new Date,a=new Date;t.$emit("pick",[a,o])}},{text:"昨天",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-864e5),o.setTime(o.getTime()-864e5),t.$emit("pick",[a,o])}},{text:"最近一周",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-6048e5),t.$emit("pick",[a,o])}},{text:"最近一个月",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-2592e6),t.$emit("pick",[a,o])}},{text:"最近三个月",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-7776e6),t.$emit("pick",[a,o])}},{text:"最近六个月",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-15552e6),t.$emit("pick",[a,o])}},{text:"最近一年",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-31536e6),t.$emit("pick",[a,o])}}]}})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-date-picker");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),type:"datetimerange","value-format":a.valueFormat,"range-separator":a.rangeSeparator,"start-placeholder":a.startPlaceholder,"end-placeholder":a.endPlaceholder,align:"right","picker-options":t.pickerOptions&&l.localPickerOptions}),null,16,["modelValue","value-format","range-separator","start-placeholder","end-placeholder","picker-options"])}]]),st=v({name:"cvDatetimeScreen",props:{start:{type:String,default:null},end:{type:String,default:null},autoUpdate:{type:Boolean,default:!0}},emits:["update:start","update:end","change"],data(){return{defaultTime:[new Date(2e3,0,1,0,0,0),new Date(2e3,0,1,23,59,59)],internalValue:[this.start||"",this.end||""]}},watch:{start(t){t!==null&&t!==""||this.end!==null&&this.end!==""?this.internalValue[0]=t:this.internalValue=[null,null]},end(t){this.start!==null&&this.start!==""||t!==null&&t!==""?this.internalValue[1]=t:this.internalValue=[null,null]}},computed:{dateUtil:()=>({getStartOfDay(t=new Date){const o=new Date(t);return o.setHours(0,0,0,0),o},getEndOfDay(t=new Date){const o=new Date(t);return o.setHours(23,59,59,999),o},getYesterday(){const t=new Date;return t.setDate(t.getDate()-1),t},getDaysAgo(t){const o=new Date;return o.setDate(o.getDate()-(t-1)),o},getFirstDayOfMonth(){const t=new Date;return t.setDate(1),t},getFirstDayOfYear(){const t=new Date;return t.setMonth(0,1),t}}),refinedShortcuts(){return[{text:"本日",value:()=>[this.dateUtil.getStartOfDay(),this.dateUtil.getEndOfDay()]},{text:"昨天",value:()=>{const t=this.dateUtil.getYesterday();return[this.dateUtil.getStartOfDay(t),this.dateUtil.getEndOfDay(t)]}},{text:"最近7天",value:()=>[this.dateUtil.getStartOfDay(this.dateUtil.getDaysAgo(7)),this.dateUtil.getEndOfDay()]},{text:"最近30天",value:()=>[this.dateUtil.getStartOfDay(this.dateUtil.getDaysAgo(30)),this.dateUtil.getEndOfDay()]},{text:"本月",value:()=>[this.dateUtil.getStartOfDay(this.dateUtil.getFirstDayOfMonth()),this.dateUtil.getEndOfDay()]},{text:"本年",value:()=>[this.dateUtil.getStartOfDay(this.dateUtil.getFirstDayOfYear()),this.dateUtil.getEndOfDay()]},{text:"全部",value:()=>[null,null]}]}},methods:{syncInternalValue(){this.start!==null&&this.start!==""||this.end!==null&&this.end!==""?this.internalValue=[this.start,this.end]:this.internalValue=[null,null]},handleDateChange(t){t?(this.$emit("update:start",t[0]),this.$emit("update:end",t[1])):(this.$emit("update:start",null),this.$emit("update:end",null)),this.$emit("change",t)},handleCalendarChange(t){}},created(){this.syncInternalValue()}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-date-picker");return e.openBlock(),e.createBlock(r,{modelValue:l.internalValue,"onUpdate:modelValue":o[0]||(o[0]=c=>l.internalValue=c),type:"datetimerange",shortcuts:n.refinedShortcuts,"range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间","value-format":"YYYY-MM-DD HH:mm:ss","default-time":l.defaultTime,onChange:n.handleDateChange,onCalendarChange:n.handleCalendarChange,clearable:"",class:"screen-date-picker"},null,8,["modelValue","shortcuts","default-time","onChange","onCalendarChange"])}]]);tt.install=function(t){t.component(tt.name,tt)},ot.install=function(t){t.component(ot.name,ot)},at.install=function(t){t.component(at.name,at)},lt.install=function(t){t.component(lt.name,lt)},nt.install=function(t){t.component(nt.name,nt)},it.install=function(t){t.component(it.name,it)},rt.install=function(t){t.component(rt.name,rt)},st.install=function(t){t.component(st.name,st)};const ct=v({name:"cvSwitchBase",props:{...k.ElSwitch.props,activeColor:{type:[String],default:""},inactiveColor:{type:[String],default:""},disabled:{type:Boolean,default:!1}},watch:{modelValue(){this.localVal=this.modelValue},localVal(){this.$emit("update:modelValue",this.localVal)}},data(){return{localVal:this.modelValue}},created(){this.localVal=this.modelValue},methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-switch");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{modelValue:l.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>l.localVal=c)}),null,16,["modelValue"])}]]);ct.install=function(t){t.component(ct.name,ct)};const dt=v({name:"cvCodeSms",mixins:[],components:{},props:{...k.ElInput.props,maxlength:{type:[Number,String],default:6},modelValue:{type:[Number,String],default:""},placeholder:{type:[Number,String],default:"请输入验证码"},disabled:{type:Boolean,default:!1},mobile:{type:[Number,String],default:""},mobileParam:{type:String,default:"mobile"},codeUrl:{type:String,default:""},codeSign:{type:Boolean,default:!1},apiFunc:{type:Function,default:null},waitTime:{type:[Number,String],default:60}},watch:{mobile(t){this.localMobile=t},modelValue(t){this.localVal=t}},data(){return{localVal:this.modelValue,localMobile:"",nextTime:0,diyPlaceholder:"短信验证码",btnDisabled:!1,btnText:"获取验证码",btnIntervalObj:null}},created(){this.localMobile=this.mobile},methods:{showDiyMsg(t){this.$message(t)},getSmsCode(){if(!this.localMobile)return this.showDiyMsg("手机号不正确"),void this.$emit("onGetSms",!1);if(!/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.localMobile))return this.showDiyMsg("手机号格式不正确"),void this.$emit("onGetSms",!1);this.codeUrl||this.apiFunc?(this.btnDisabled=!0,this.btnIntervalObj||this.btnDisabled&&(this.btnText="请稍后...",this.apiFunc?this.apiFunc({postType:"sendSms",cto_sms_type:"alterMobile",sendCode:"发送验证码",[this.mobileParam]:this.localMobile}).then(t=>{let o=t;o.status==200?(this.showDiyMsg("发送成功!"),setTimeout(()=>{if(this.codeSign){let a=o.data&&o.data.sign||"";this.diyPlaceholder="识别码:"+a}this.smsCodeWaitTime()},500)):(this.showDiyMsg("短信获取失败,请检查网络"),this.btnDisabled=!1,this.btnText="获取验证码")}).catch(t=>{this.btnDisabled=!1,this.btnText="获取验证码"}):(this.btnDisabled=!1,this.btnText="重新获取验证码"))):this.showDiyMsg("短信接口地址不能为空")},smsCodeWaitTime(){this.nextTime=Date.parse(new Date)/1e3+parseInt(this.waitTime),this.btnIntervalObj=setInterval(()=>{let t=this.nextTime-Date.parse(new Date)/1e3;t<=0?(clearInterval(this.btnIntervalObj),this.btnText="重新获取验证码",this.btnIntervalObj=0,this.btnDisabled=!1):(this.btnDisabled=!0,this.btnText=t.toString()+"s")},100)},updateInput(t){this.$emit("update:modelValue",this.localVal)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button"),c=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(c,e.mergeProps(t.$props,{modelValue:l.localVal,"onUpdate:modelValue":o[0]||(o[0]=p=>l.localVal=p),clearable:"",placeholder:l.diyPlaceholder,onInput:n.updateInput}),{append:e.withCtx(()=>[e.createVNode(r,{onClick:n.getSmsCode,disabled:l.btnDisabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.btnText),1)]),_:1},8,["onClick","disabled"])]),_:1},16,["modelValue","placeholder","onInput"])}]]);dt.install=function(t){t.component(dt.name,dt)};const ci={props:{fileType:{type:[Array],default:[]},fileSize:{type:[Number],default:2},fileUnit:{type:[String],default:""},multiple:{type:[Boolean],default:!1},limit:{type:[Number],default:5}}},di={class:"cv-upload-tip-box"},pi={key:0},hi={key:1},ao={inheritAttrs:!1,emits:["update:modelValue","update:initValue","delete","error","success"],components:{uploadTip:v(ci,[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",di,[o[0]||(o[0]=e.createElementVNode("span",null,"最多上传",-1)),e.createElementVNode("b",null,e.toDisplayString(a.limit),1),e.createElementVNode("span",null,e.toDisplayString(a.fileUnit),1),a.fileType.length?(e.openBlock(),e.createElementBlock("b",pi,e.toDisplayString(a.fileType.length?a.fileType.join("/"):""),1)):e.createCommentVNode("",!0),a.fileType.length?(e.openBlock(),e.createElementBlock("span",hi,"格式")):e.createCommentVNode("",!0),e.createElementVNode("span",null,"文件;且每"+e.toDisplayString(a.fileUnit)+"不超过",1),e.createElementVNode("b",null,e.toDisplayString(a.fileSize)+"MB",1)])}]])},mixins:[Ll],props:{multiple:{type:[Boolean],default:!1},limit:{type:[Number,String],default:1},drag:{type:Boolean,default:!1},httpRequest:{type:[Function],default:()=>{}},accept:String,beforeRemove:Function,upResponseFn:{type:[Function],default:null},signatureFn:{type:Function,default:null},signatureType:{type:[String],default:"aliyun_oss_type2"},signatureParam:{type:[Object],default:()=>({})}},data:()=>({cropShow:!1,upIngPercent:0,upIngLoading:!1,upIngFileInfo:{}}),computed:{fileTypeStr(){return this.fileType.join(",")},tipAttr(){return{fileType:this.fileType||[],fileSize:this.fileSize||"",multiple:this?.multiple||!1,limit:this.limit?parseInt(this.limit):5}},mergeAttrs(){let t=this._mergeAttrs("upload");return this.$props.signatureType&&(t.signatureType=this.$props.signatureType),this.$props.signatureFn&&(t.signatureFn=this.$props.signatureFn),this.$props.signatureParam&&(t.signatureParam=this.$props.signatureParam),typeof t.upResponseFn!="function"&&(t.upResponseFn=null),Object.assign({},t,this.$attrs)}},methods:{_commonBeforeUpload(t){t.type;const o=t.name||"";t.size;const a=o.split(".").pop().toLowerCase(),i=this.fileType.join("、");return this.fileType.includes(a)?!(t>this.fileSize)||(ExtendMessage.error(`文件大小不能超过 ${this.fileSize} MB`),!1):(ExtendMessage.error(`文件格式错误,请上传类型 如:${i}格式文件`),!1)},_commonRemove(){return new Promise((t,o)=>{this.$confirm("提示",{title:"确定删除??",showCancelButton:!0,confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{t(!0)}).catch(()=>{o(!1)})})},initHttpRequest(){},initOnProgress(t){this.upIngPercent=Number(t.percentage.toFixed(0))},initOnSuccess(t,o){},initOnExceed(){this.$message.error(`最多上传${this.limit}个文件`)}}};function na(t){let o=t.lastIndexOf("/"),a=t.substring(o+1,t.length),i="";return a.lastIndexOf(".")>-1&&(i=a.slice(a.lastIndexOf(".")+1),i="image/"+i),{name:a,url:t,type:i,status:"success"}}function M(t){return Math.pow(1024,t)}function ia(t){return t?t<M(1)?t+" B":t<M(2)?(t/M(1)).toFixed(2)+" KB":t<M(3)?(t/M(2)).toFixed(2)+" MB":t<M(4)?(t/M(3)).toFixed(2)+" GB":(t/M(4)).toFixed(2)+" TB":"-"}function mi(t){if(!t)return!0;const o=t?.expiration_last;if(!o)return!0;const a=function(l){if(/^\d{8}T\d{6}Z$/.test(l)){const n=l.replace(/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/,"$1-$2-$3T$4:$5:$6Z");return new Date(n)}return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|([+-]\d{2}:\d{2}))?$/.test(l)?new Date(l):/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(l)?new Date(l.replace(" ","T")):new Date(l)}(o),i=new Date;return!!isNaN(a.getTime())||a.getTime()-i.getTime()<=6e4}function Yo(t){return t?typeof t=="string"||typeof t=="number"?[t]:Object.prototype.toString.call(t)==="[object Object]"?[]:[...t]:[]}function ra(t,o){let a=[];Array.isArray(t)&&t.length>0&&a.push(...t),Array.isArray(o)&&o.length>0&&a.push(...o),typeof o=="string"&&a.push(o);let i=[];for(let l in a){let n=a[l],r=Object.prototype.toString.call(n);r==="[object String]"?i.push(n):r==="[object Object]"&&n.url&&i.push(n.url)}return i}function Xo(t){let o=[],a=Object.prototype.toString.call(t);if(a==="[object String]")o.push(na(t));else if(a==="[object Object]")t.name&&t.url&&o.push(t);else if(a==="[object Array]")for(let i in t){let l=t[i],n=Object.prototype.toString.call(l);n==="[object String]"?o.push(na(l)):n==="[object Object]"&&l.name&&l.url&&o.push(l)}return o}async function sa(t,o){if(!t||typeof t!="function")return!1;let a=null;if(mi(a)){let i=await t({...o});if(!i||!i.data||i.status!=200)throw k.ElMessage.error("获取STS令牌失败"),new Error(`获取STS令牌失败 ${i?.message}`);a=i.data||{}}return{...a,pass:!!a}}async function ca(t,o,a,i){t=t||"aliyun_oss_type2",i=i||{};const l=await sa(o,{upload_type:t,...a});if(!l.pass)return k.ElMessage.error("获取oss上传凭证异常");if(t=="oss_upload1"){const n={bucket:l.bucket,region:l.endpoint.split(".")[0],accessKeyId:l.accessKeyId,accessKeySecret:l.accessKeySecret,stsToken:l.securityToken,expiration:l.expiration,...i,refreshSTSToken:async()=>{const r=await sa(o);return{accessKeyId:r.accessKeyId,accessKeySecret:r.accessKeySecret,stsToken:r.securityToken}},refreshSTSTokenInterval:new Date(l.expiration)-new Date-6e4};return new OSS(n)}if(t=="aliyun_oss_type2")return l;throw new Error("上传类型错误")}async function $l(t,o,a){let i=new FormData;i.append("success_action_status",o.success_action_status||"200"),i.append("policy",o.policy),i.append("signature",o.signature),i.append("x-oss-signature",o.signature),i.append("x-oss-signature-version","OSS4-HMAC-SHA256"),i.append("x-oss-credential",o.x_oss_credential),i.append("x-oss-date",o.x_oss_date),i.append("x-oss-security-token",o.security_token);let l=o.key;if(o.key||(l=o.dir+"/"+t.name),i.append("key",l),o.callback&&i.append("callback",o.callback),o.callback_var&&eo(o.callback_var))for(const n in o.callback_var)o.callback_var.hasOwnProperty(n)&&i.append(n,o.callback_var[n]);return i.append("file",t),fetch(o.host,{method:"POST",body:i,headers:{}}).then(n=>{if(n.ok)return n.json()}).then(n=>{if(n&&n.success)return n.data}).catch(n=>{})}async function Ko(t,o,a,i){if(!a||typeof a!="function")return k.ElMessage.error("签名方法错误"),Promise.reject();try{let l=function(){const p=new Date;return[p.getFullYear(),String(p.getMonth()+1).padStart(2,"0"),String(p.getDate()).padStart(2,"0"),String(p.getHours()).padStart(2,"0"),String(p.getMinutes()).padStart(2,"0"),String(p.getSeconds()).padStart(2,"0")].join("")+Math.random().toString(36).substring(2,10)}(),n=function(p){if(!p)return"jpg";const d=p.toLowerCase().trim();return Il.mimeToExtension[d]||"jpg"}(t.type),r=`${l}.${n}`;const c=await a({upload_type:o,...i,save_extension:n}).then(p=>p.data||{}).catch(p=>(k.ElMessage.error("签名失败"),Promise.reject()));if(!c)return Promise.reject();if(c.name&&(r=`${c.name}.${n}`),t instanceof Blob&&(t=new File([t],r,{type:t.type,lastModified:Date.now()})),t)return await $l(t,c)}catch{return Promise.reject()}}const Ol={};Ol.getData=t=>new Promise((o,a)=>{let i={};(function(l){let n=null;return new Promise((r,c)=>{if(l.src)if(/^data\:/i.test(l.src))n=function(h,u){u=u||h.match(/^data\:([^\;]+)\;base64,/im)[1]||"",h=h.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var m=atob(h),f=m.length%2==0?m.length:m.length+1,C=new ArrayBuffer(f),g=new Uint16Array(C),y=0;y<f;y++)g[y]=m.charCodeAt(y);return C}(l.src),r(n);else if(/^blob\:/i.test(l.src)){var p=new FileReader;p.onload=function(h){n=h.target.result,r(n)},function(h,u){var m=new XMLHttpRequest;m.open("GET",h,!0),m.responseType="blob",m.onload=function(f){(this.status==200||this.status===0)&&u(this.response)},m.send()}(l.src,function(h){p.readAsArrayBuffer(h)})}else{var d=new XMLHttpRequest;d.onload=function(){if(this.status!=200&&this.status!==0)throw"Could not load image";n=d.response,r(n),d=null},d.open("GET",l.src,!0),d.responseType="arraybuffer",d.send(null)}else c("img error")})})(t).then(l=>{i.arrayBuffer=l;try{i.orientation=function(n){var r,c,p,d,h,u,m,f,C,g,y=new DataView(n),b=y.byteLength;if(y.getUint8(0)===255&&y.getUint8(1)===216)for(C=2;C<b;){if(y.getUint8(C)===255&&y.getUint8(C+1)===225){m=C;break}C++}if(m&&(c=m+4,p=m+10,function(w,V,S){var B,T="";for(B=V,S+=V;B<S;B++)T+=String.fromCharCode(w.getUint8(B));return T}(y,c,4)==="Exif"&&(u=y.getUint16(p),((h=u===18761)||u===19789)&&y.getUint16(p+2,h)===42&&(d=y.getUint32(p+4,h),d>=8&&(f=p+d)))),f){for(b=y.getUint16(f,h),g=0;g<b;g++)if(C=f+12*g+2,y.getUint16(C,h)===274){C+=8,r=y.getUint16(C,h);break}}return r}(l)}catch{i.orientation=-1}o(i)}).catch(l=>{a(l)})});const ui=(t,o)=>{const a=t.__vccOpts||t;for(const[i,l]of o)a[i]=l;return a},gi=e.defineComponent({data:function(){return{w:0,h:0,scale:1,x:0,y:0,loading:!0,trueWidth:0,trueHeight:0,move:!0,moveX:0,moveY:0,crop:!1,cropping:!1,cropW:0,cropH:0,cropOldW:0,cropOldH:0,canChangeX:!1,canChangeY:!1,changeCropTypeX:1,changeCropTypeY:1,cropX:0,cropY:0,cropChangeX:0,cropChangeY:0,cropOffsertX:0,cropOffsertY:0,support:"",touches:[],touchNow:!1,rotate:0,isIos:!1,orientation:0,imgs:"",coe:.2,scaling:!1,scalingSet:"",coeStatus:"",isCanShow:!0,imgIsQqualCrop:!1}},props:{img:{type:[String,Blob,null,File],default:""},outputSize:{type:Number,default:1},outputType:{type:String,default:"jpeg"},info:{type:Boolean,default:!0},canScale:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!1},autoCropWidth:{type:[Number,String],default:0},autoCropHeight:{type:[Number,String],default:0},fixed:{type:Boolean,default:!1},fixedNumber:{type:Array,default:()=>[1,1]},fixedBox:{type:Boolean,default:!1},full:{type:Boolean,default:!1},canMove:{type:Boolean,default:!0},canMoveBox:{type:Boolean,default:!0},original:{type:Boolean,default:!1},centerBox:{type:Boolean,default:!1},high:{type:Boolean,default:!0},infoTrue:{type:Boolean,default:!1},maxImgSize:{type:[Number,String],default:2e3},enlarge:{type:[Number,String],default:1},preW:{type:[Number,String],default:0},mode:{type:String,default:"contain"},limitMinSize:{type:[Number,Array,String],default:()=>10,validator:function(t){return Array.isArray(t)?Number(t[0])>=0&&Number(t[1])>=0:Number(t)>=0}},fillColor:{type:String,default:""}},computed:{cropInfo(){let t={};if(t.top=this.cropOffsertY>21?"-21px":"0px",t.width=this.cropW>0?this.cropW:0,t.height=this.cropH>0?this.cropH:0,this.infoTrue){let o=1;this.high&&!this.full&&(o=window.devicePixelRatio),this.enlarge!==1&!this.full&&(o=Math.abs(Number(this.enlarge))),t.width=t.width*o,t.height=t.height*o,this.full&&(t.width=t.width/this.scale,t.height=t.height/this.scale)}return t.width=t.width.toFixed(0),t.height=t.height.toFixed(0),t},isIE:()=>!!window.ActiveXObject||"ActiveXObject"in window,passive(){return this.isIE?null:{passive:!1}},isRotateRightOrLeft(){return[1,-1,3,-3].includes(this.rotate)}},watch:{img(){this.checkedImg()},imgs(t){t!==""&&this.reload()},cropW(){this.showPreview()},cropH(){this.showPreview()},cropOffsertX(){this.showPreview()},cropOffsertY(){this.showPreview()},scale(t,o){this.showPreview()},x(){this.showPreview()},y(){this.showPreview()},autoCrop(t){t&&this.goAutoCrop()},autoCropWidth(){this.autoCrop&&this.goAutoCrop()},autoCropHeight(){this.autoCrop&&this.goAutoCrop()},mode(){this.checkedImg()},rotate(){this.showPreview(),(this.autoCrop||this.cropW>0||this.cropH>0)&&this.goAutoCrop(this.cropW,this.cropH)}},methods:{getVersion(t){var o=navigator.userAgent.split(" "),a="";let i=0;const l=new RegExp(t,"i");for(var n=0;n<o.length;n++)l.test(o[n])&&(a=o[n]);return i=a?a.split("/")[1].split("."):["0","0","0"],i},checkOrientationImage(t,o,a,i){if(this.getVersion("chrome")[0]>=81)o=-1;else if(this.getVersion("safari")[0]>=605){const r=this.getVersion("version");r[0]>13&&r[1]>1&&(o=-1)}else{const r=navigator.userAgent.toLowerCase().match(/cpu iphone os (.*?) like mac os/);if(r){let c=r[1];c=c.split("_"),(c[0]>13||c[0]>=13&&c[1]>=4)&&(o=-1)}}let l=document.createElement("canvas"),n=l.getContext("2d");switch(n.save(),o){case 2:l.width=a,l.height=i,n.translate(a,0),n.scale(-1,1);break;case 3:l.width=a,l.height=i,n.translate(a/2,i/2),n.rotate(180*Math.PI/180),n.translate(-a/2,-i/2);break;case 4:l.width=a,l.height=i,n.translate(0,i),n.scale(1,-1);break;case 5:l.height=a,l.width=i,n.rotate(.5*Math.PI),n.scale(1,-1);break;case 6:l.width=i,l.height=a,n.translate(i/2,a/2),n.rotate(90*Math.PI/180),n.translate(-a/2,-i/2);break;case 7:l.height=a,l.width=i,n.rotate(.5*Math.PI),n.translate(a,-i),n.scale(-1,1);break;case 8:l.height=a,l.width=i,n.translate(i/2,a/2),n.rotate(-90*Math.PI/180),n.translate(-a/2,-i/2);break;default:l.width=a,l.height=i}n.drawImage(t,0,0,a,i),n.restore(),l.toBlob(r=>{let c=URL.createObjectURL(r);URL.revokeObjectURL(this.imgs),this.imgs=c},"image/"+this.outputType,1)},checkedImg(){if(this.img===null||this.img==="")return this.imgs="",void this.clearCrop();this.loading=!0,this.scale=1,this.rotate=0,this.imgIsQqualCrop=!1,this.clearCrop();let t=new Image;if(t.onload=()=>{if(this.img==="")return this.$emit("img-load",new Error("图片不能为空")),!1;let a=t.width,i=t.height;Ol.getData(t).then(l=>{this.orientation=l.orientation||1;let n=Number(this.maxImgSize);!this.orientation&&a<n&i<n?this.imgs=this.img:(a>n&&(i=i/a*n,a=n),i>n&&(a=a/i*n,i=n),this.checkOrientationImage(t,this.orientation,a,i))}).catch(l=>{this.$emit("img-load","error"),this.$emit("img-load-error",l)})},t.onerror=a=>{this.$emit("img-load","error"),this.$emit("img-load-error",a)},this.img.substr(0,4)!=="data"&&(t.crossOrigin=""),this.isIE){var o=new XMLHttpRequest;o.onload=function(){var a=URL.createObjectURL(this.response);t.src=a},o.open("GET",this.img,!0),o.responseType="blob",o.send()}else t.src=this.img},startMove(t){if(t.preventDefault(),this.move&&!this.crop){if(!this.canMove)return!1;this.moveX=("clientX"in t?t.clientX:t.touches[0].clientX)-this.x,this.moveY=("clientY"in t?t.clientY:t.touches[0].clientY)-this.y,t.touches?(window.addEventListener("touchmove",this.moveImg),window.addEventListener("touchend",this.leaveImg),t.touches.length==2&&(this.touches=t.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale))):(window.addEventListener("mousemove",this.moveImg),window.addEventListener("mouseup",this.leaveImg)),this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})}else this.cropping=!0,window.addEventListener("mousemove",this.createCrop),window.addEventListener("mouseup",this.endCrop),window.addEventListener("touchmove",this.createCrop),window.addEventListener("touchend",this.endCrop),this.cropOffsertX=t.offsetX?t.offsetX:t.touches[0].pageX-this.$refs.cropper.offsetLeft,this.cropOffsertY=t.offsetY?t.offsetY:t.touches[0].pageY-this.$refs.cropper.offsetTop,this.cropX="clientX"in t?t.clientX:t.touches[0].clientX,this.cropY="clientY"in t?t.clientY:t.touches[0].clientY,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.cropW=0,this.cropH=0},touchScale(t){t.preventDefault();let o=this.scale;var a=this.touches[0].clientX,i=this.touches[0].clientY,l=t.touches[0].clientX,n=t.touches[0].clientY,r=this.touches[1].clientX,c=this.touches[1].clientY,p=t.touches[1].clientX,d=t.touches[1].clientY,h=Math.sqrt(Math.pow(a-r,2)+Math.pow(i-c,2)),u=Math.sqrt(Math.pow(l-p,2)+Math.pow(n-d,2))-h,m=1,f=(m=(m=m/this.trueWidth>m/this.trueHeight?m/this.trueHeight:m/this.trueWidth)>.1?.1:m)*u;if(!this.touchNow){if(this.touchNow=!0,u>0?o+=Math.abs(f):u<0&&o>Math.abs(f)&&(o-=Math.abs(f)),this.touches=t.touches,setTimeout(()=>{this.touchNow=!1},8),!this.checkoutImgAxis(this.x,this.y,o))return!1;this.scale=o}},cancelTouchScale(t){window.removeEventListener("touchmove",this.touchScale)},moveImg(t){if(t.preventDefault(),t.touches&&t.touches.length===2)return this.touches=t.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale),window.removeEventListener("touchmove",this.moveImg),!1;let o,a,i="clientX"in t?t.clientX:t.touches[0].clientX,l="clientY"in t?t.clientY:t.touches[0].clientY;o=i-this.moveX,a=l-this.moveY,this.$nextTick(()=>{if(this.centerBox){let n,r,c,p,d=this.getImgAxis(o,a,this.scale),h=this.getCropAxis(),u=this.trueHeight*this.scale,m=this.trueWidth*this.scale;switch(this.rotate){case 1:case-1:case 3:case-3:n=this.cropOffsertX-this.trueWidth*(1-this.scale)/2+(u-m)/2,r=this.cropOffsertY-this.trueHeight*(1-this.scale)/2+(m-u)/2,c=n-u+this.cropW,p=r-m+this.cropH;break;default:n=this.cropOffsertX-this.trueWidth*(1-this.scale)/2,r=this.cropOffsertY-this.trueHeight*(1-this.scale)/2,c=n-m+this.cropW,p=r-u+this.cropH}d.x1>=h.x1&&(o=n),d.y1>=h.y1&&(a=r),d.x2<=h.x2&&(o=c),d.y2<=h.y2&&(a=p)}this.x=o,this.y=a,this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})})},leaveImg(t){window.removeEventListener("mousemove",this.moveImg),window.removeEventListener("touchmove",this.moveImg),window.removeEventListener("mouseup",this.leaveImg),window.removeEventListener("touchend",this.leaveImg),this.$emit("img-moving",{moving:!1,axis:this.getImgAxis()})},scaleImg(){this.canScale&&window.addEventListener(this.support,this.changeSize,this.passive)},cancelScale(){this.canScale&&window.removeEventListener(this.support,this.changeSize)},changeSize(t){t.preventDefault();let o=this.scale;var a=t.deltaY||t.wheelDelta;a=navigator.userAgent.indexOf("Firefox")>0?30*a:a,this.isIE&&(a=-a);var i=this.coe,l=(i=i/this.trueWidth>i/this.trueHeight?i/this.trueHeight:i/this.trueWidth)*a;l<0?o+=Math.abs(l):o>Math.abs(l)&&(o-=Math.abs(l));let n=l<0?"add":"reduce";if(n!==this.coeStatus&&(this.coeStatus=n,this.coe=.2),this.scaling||(this.scalingSet=setTimeout(()=>{this.scaling=!1,this.coe=this.coe+=.01},50)),this.scaling=!0,!this.checkoutImgAxis(this.x,this.y,o))return!1;this.scale=o},changeScale(t){let o=this.scale;t=t||1;var a=20;if((t*=a=a/this.trueWidth>a/this.trueHeight?a/this.trueHeight:a/this.trueWidth)>0?o+=Math.abs(t):o>Math.abs(t)&&(o-=Math.abs(t)),!this.checkoutImgAxis(this.x,this.y,o))return!1;this.scale=o},createCrop(t){t.preventDefault();var o="clientX"in t?t.clientX:t.touches?t.touches[0].clientX:0,a="clientY"in t?t.clientY:t.touches?t.touches[0].clientY:0;this.$nextTick(()=>{var i=o-this.cropX,l=a-this.cropY;if(i>0?(this.cropW=i+this.cropChangeX>this.w?this.w-this.cropChangeX:i,this.cropOffsertX=this.cropChangeX):(this.cropW=this.w-this.cropChangeX+Math.abs(i)>this.w?this.cropChangeX:Math.abs(i),this.cropOffsertX=this.cropChangeX+i>0?this.cropChangeX+i:0),this.fixed){var n=this.cropW/this.fixedNumber[0]*this.fixedNumber[1];n+this.cropOffsertY>this.h?(this.cropH=this.h-this.cropOffsertY,this.cropW=this.cropH/this.fixedNumber[1]*this.fixedNumber[0],this.cropOffsertX=i>0?this.cropChangeX:this.cropChangeX-this.cropW):this.cropH=n,this.cropOffsertY=this.cropOffsertY}else l>0?(this.cropH=l+this.cropChangeY>this.h?this.h-this.cropChangeY:l,this.cropOffsertY=this.cropChangeY):(this.cropH=this.h-this.cropChangeY+Math.abs(l)>this.h?this.cropChangeY:Math.abs(l),this.cropOffsertY=this.cropChangeY+l>0?this.cropChangeY+l:0)})},changeCropSize(t,o,a,i,l){t.preventDefault(),window.addEventListener("mousemove",this.changeCropNow),window.addEventListener("mouseup",this.changeCropEnd),window.addEventListener("touchmove",this.changeCropNow),window.addEventListener("touchend",this.changeCropEnd),this.canChangeX=o,this.canChangeY=a,this.changeCropTypeX=i,this.changeCropTypeY=l,this.cropX="clientX"in t?t.clientX:t.touches[0].clientX,this.cropY="clientY"in t?t.clientY:t.touches[0].clientY,this.cropOldW=this.cropW,this.cropOldH=this.cropH,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.fixed&&this.canChangeX&&this.canChangeY&&(this.canChangeY=0),this.$emit("change-crop-size",{width:this.cropW,height:this.cropH})},changeCropNow(t){t.preventDefault();var o="clientX"in t?t.clientX:t.touches?t.touches[0].clientX:0,a="clientY"in t?t.clientY:t.touches?t.touches[0].clientY:0;let i=this.w,l=this.h,n=0,r=0;if(this.centerBox){let d=this.getImgAxis(),h=d.x2,u=d.y2;n=d.x1>0?d.x1:0,r=d.y1>0?d.y1:0,i>h&&(i=h),l>u&&(l=u)}const[c,p]=this.checkCropLimitSize();this.$nextTick(()=>{var d=o-this.cropX,h=a-this.cropY;if(this.canChangeX&&(this.changeCropTypeX===1?this.cropOldW-d<c?(this.cropW=c,this.cropOffsertX=this.cropOldW+this.cropChangeX-n-c):this.cropOldW-d>0?(this.cropW=i-this.cropChangeX-d<=i-n?this.cropOldW-d:this.cropOldW+this.cropChangeX-n,this.cropOffsertX=i-this.cropChangeX-d<=i-n?this.cropChangeX+d:n):(this.cropW=Math.abs(d)+this.cropChangeX<=i?Math.abs(d)-this.cropOldW:i-this.cropOldW-this.cropChangeX,this.cropOffsertX=this.cropChangeX+this.cropOldW):this.changeCropTypeX===2&&(this.cropOldW+d<c?this.cropW=c:this.cropOldW+d>0?(this.cropW=this.cropOldW+d+this.cropOffsertX<=i?this.cropOldW+d:i-this.cropOffsertX,this.cropOffsertX=this.cropChangeX):(this.cropW=i-this.cropChangeX+Math.abs(d+this.cropOldW)<=i-n?Math.abs(d+this.cropOldW):this.cropChangeX-n,this.cropOffsertX=i-this.cropChangeX+Math.abs(d+this.cropOldW)<=i-n?this.cropChangeX-Math.abs(d+this.cropOldW):n))),this.canChangeY&&(this.changeCropTypeY===1?this.cropOldH-h<p?(this.cropH=p,this.cropOffsertY=this.cropOldH+this.cropChangeY-r-p):this.cropOldH-h>0?(this.cropH=l-this.cropChangeY-h<=l-r?this.cropOldH-h:this.cropOldH+this.cropChangeY-r,this.cropOffsertY=l-this.cropChangeY-h<=l-r?this.cropChangeY+h:r):(this.cropH=Math.abs(h)+this.cropChangeY<=l?Math.abs(h)-this.cropOldH:l-this.cropOldH-this.cropChangeY,this.cropOffsertY=this.cropChangeY+this.cropOldH):this.changeCropTypeY===2&&(this.cropOldH+h<p?this.cropH=p:this.cropOldH+h>0?(this.cropH=this.cropOldH+h+this.cropOffsertY<=l?this.cropOldH+h:l-this.cropOffsertY,this.cropOffsertY=this.cropChangeY):(this.cropH=l-this.cropChangeY+Math.abs(h+this.cropOldH)<=l-r?Math.abs(h+this.cropOldH):this.cropChangeY-r,this.cropOffsertY=l-this.cropChangeY+Math.abs(h+this.cropOldH)<=l-r?this.cropChangeY-Math.abs(h+this.cropOldH):r))),this.canChangeX&&this.fixed){var u=this.cropW/this.fixedNumber[0]*this.fixedNumber[1];u<p?(this.cropH=p,this.cropW=this.fixedNumber[0]*p/this.fixedNumber[1],this.changeCropTypeX===1&&(this.cropOffsertX=this.cropChangeX+(this.cropOldW-this.cropW))):u+this.cropOffsertY>l?(this.cropH=l-this.cropOffsertY,this.cropW=this.cropH/this.fixedNumber[1]*this.fixedNumber[0],this.changeCropTypeX===1&&(this.cropOffsertX=this.cropChangeX+(this.cropOldW-this.cropW))):this.cropH=u}if(this.canChangeY&&this.fixed){var m=this.cropH/this.fixedNumber[1]*this.fixedNumber[0];m<c?(this.cropW=c,this.cropH=this.fixedNumber[1]*c/this.fixedNumber[0],this.cropOffsertY=this.cropOldH+this.cropChangeY-this.cropH):m+this.cropOffsertX>i?(this.cropW=i-this.cropOffsertX,this.cropH=this.cropW/this.fixedNumber[0]*this.fixedNumber[1]):this.cropW=m}})},checkCropLimitSize(){let{cropW:t,cropH:o,limitMinSize:a}=this,i=new Array;return i=Array.isArray(a)?a:[a,a],t=parseFloat(i[0]),o=parseFloat(i[1]),[t,o]},changeCropEnd(t){window.removeEventListener("mousemove",this.changeCropNow),window.removeEventListener("mouseup",this.changeCropEnd),window.removeEventListener("touchmove",this.changeCropNow),window.removeEventListener("touchend",this.changeCropEnd)},calculateSize(t,o,a,i,l,n){const r=t/o;let c=l,p=n;return c<a&&(c=a,p=Math.ceil(c/r)),p<i&&(p=i,c=Math.ceil(p*r),c<a&&(c=a,p=Math.ceil(c/r))),c<l&&(c=l,p=Math.ceil(c/r)),p<n&&(p=n,c=Math.ceil(p*r)),{width:c,height:p}},endCrop(){this.cropW===0&&this.cropH===0&&(this.cropping=!1);let[t,o]=this.checkCropLimitSize();const{width:a,height:i}=this.fixed?this.calculateSize(this.fixedNumber[0],this.fixedNumber[1],t,o,this.cropW,this.cropH):{width:t,height:o};a>this.cropW&&(this.cropW=a,this.cropOffsertX+a>this.w&&(this.cropOffsertX=this.w-a)),i>this.cropH&&(this.cropH=i,this.cropOffsertY+i>this.h&&(this.cropOffsertY=this.h-i)),window.removeEventListener("mousemove",this.createCrop),window.removeEventListener("mouseup",this.endCrop),window.removeEventListener("touchmove",this.createCrop),window.removeEventListener("touchend",this.endCrop)},startCrop(){this.crop=!0},stopCrop(){this.crop=!1},clearCrop(){this.cropping=!1,this.cropW=0,this.cropH=0},cropMove(t){if(t.preventDefault(),!this.canMoveBox)return this.crop=!1,this.startMove(t),!1;if(t.touches&&t.touches.length===2)return this.crop=!1,this.startMove(t),this.leaveCrop(),!1;window.addEventListener("mousemove",this.moveCrop),window.addEventListener("mouseup",this.leaveCrop),window.addEventListener("touchmove",this.moveCrop),window.addEventListener("touchend",this.leaveCrop);let o,a,i="clientX"in t?t.clientX:t.touches[0].clientX,l="clientY"in t?t.clientY:t.touches[0].clientY;o=i-this.cropOffsertX,a=l-this.cropOffsertY,this.cropX=o,this.cropY=a,this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})},moveCrop(t,o){let a=0,i=0;t&&(t.preventDefault(),a="clientX"in t?t.clientX:t.touches[0].clientX,i="clientY"in t?t.clientY:t.touches[0].clientY),this.$nextTick(()=>{let l,n,r=a-this.cropX,c=i-this.cropY;if(o&&(r=this.cropOffsertX,c=this.cropOffsertY),l=r<=0?0:r+this.cropW>this.w?this.w-this.cropW:r,n=c<=0?0:c+this.cropH>this.h?this.h-this.cropH:c,this.centerBox){let p=this.getImgAxis();l<=p.x1&&(l=p.x1),l+this.cropW>p.x2&&(l=p.x2-this.cropW),n<=p.y1&&(n=p.y1),n+this.cropH>p.y2&&(n=p.y2-this.cropH)}this.cropOffsertX=l,this.cropOffsertY=n,this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})})},getImgAxis(t,o,a){t=t||this.x,o=o||this.y,a=a||this.scale;let i={x1:0,x2:0,y1:0,y2:0},l=this.trueWidth*a,n=this.trueHeight*a;switch(this.rotate){case 0:i.x1=t+this.trueWidth*(1-a)/2,i.x2=i.x1+this.trueWidth*a,i.y1=o+this.trueHeight*(1-a)/2,i.y2=i.y1+this.trueHeight*a;break;case 1:case-1:case 3:case-3:i.x1=t+this.trueWidth*(1-a)/2+(l-n)/2,i.x2=i.x1+this.trueHeight*a,i.y1=o+this.trueHeight*(1-a)/2+(n-l)/2,i.y2=i.y1+this.trueWidth*a;break;default:i.x1=t+this.trueWidth*(1-a)/2,i.x2=i.x1+this.trueWidth*a,i.y1=o+this.trueHeight*(1-a)/2,i.y2=i.y1+this.trueHeight*a}return i},getCropAxis(){let t={x1:0,x2:0,y1:0,y2:0};return t.x1=this.cropOffsertX,t.x2=t.x1+this.cropW,t.y1=this.cropOffsertY,t.y2=t.y1+this.cropH,t},leaveCrop(t){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.$emit("crop-moving",{moving:!1,axis:this.getCropAxis()})},getCropChecked(t){let o=document.createElement("canvas"),a=o.getContext("2d"),i=new Image,l=this.rotate,n=this.trueWidth,r=this.trueHeight,c=this.cropOffsertX,p=this.cropOffsertY;i.onload=()=>{if(this.cropW!==0){let u=1;this.high&!this.full&&(u=window.devicePixelRatio),this.enlarge!==1&!this.full&&(u=Math.abs(Number(this.enlarge)));let m=this.cropW*u,f=this.cropH*u,C=n*this.scale*u,g=r*this.scale*u,y=(this.x-c+this.trueWidth*(1-this.scale)/2)*u,b=(this.y-p+this.trueHeight*(1-this.scale)/2)*u;switch(h(m,f),a.save(),l){case 0:this.full?(h(m/this.scale,f/this.scale),a.drawImage(i,y/this.scale,b/this.scale,C/this.scale,g/this.scale)):a.drawImage(i,y,b,C,g);break;case 1:case-3:this.full?(h(m/this.scale,f/this.scale),y=y/this.scale+(C/this.scale-g/this.scale)/2,b=b/this.scale+(g/this.scale-C/this.scale)/2,a.rotate(90*l*Math.PI/180),a.drawImage(i,b,-y-g/this.scale,C/this.scale,g/this.scale)):(y+=(C-g)/2,b+=(g-C)/2,a.rotate(90*l*Math.PI/180),a.drawImage(i,b,-y-g,C,g));break;case 2:case-2:this.full?(h(m/this.scale,f/this.scale),a.rotate(90*l*Math.PI/180),y/=this.scale,b/=this.scale,a.drawImage(i,-y-C/this.scale,-b-g/this.scale,C/this.scale,g/this.scale)):(a.rotate(90*l*Math.PI/180),a.drawImage(i,-y-C,-b-g,C,g));break;case 3:case-1:this.full?(h(m/this.scale,f/this.scale),y=y/this.scale+(C/this.scale-g/this.scale)/2,b=b/this.scale+(g/this.scale-C/this.scale)/2,a.rotate(90*l*Math.PI/180),a.drawImage(i,-b-C/this.scale,y,C/this.scale,g/this.scale)):(y+=(C-g)/2,b+=(g-C)/2,a.rotate(90*l*Math.PI/180),a.drawImage(i,-b-C,y,C,g));break;default:this.full?(h(m/this.scale,f/this.scale),a.drawImage(i,y/this.scale,b/this.scale,C/this.scale,g/this.scale)):a.drawImage(i,y,b,C,g)}a.restore()}else{let u=n*this.scale,m=r*this.scale;switch(a.save(),l){case 0:h(u,m),a.drawImage(i,0,0,u,m);break;case 1:case-3:h(m,u),a.rotate(90*l*Math.PI/180),a.drawImage(i,0,-m,u,m);break;case 2:case-2:h(u,m),a.rotate(90*l*Math.PI/180),a.drawImage(i,-u,-m,u,m);break;case 3:case-1:h(m,u),a.rotate(90*l*Math.PI/180),a.drawImage(i,-u,0,u,m);break;default:h(u,m),a.drawImage(i,0,0,u,m)}a.restore()}t(o)},this.img.substr(0,4)!=="data"&&(i.crossOrigin="Anonymous"),i.src=this.imgs;const d=this.fillColor;function h(u,m){o.width=Math.round(u),o.height=Math.round(m),d&&(a.fillStyle=d,a.fillRect(0,0,o.width,o.height))}},getCropData(t){this.getCropChecked(o=>{t(o.toDataURL("image/"+this.outputType,this.outputSize))})},getCropBlob(t){this.getCropChecked(o=>{o.toBlob(a=>t(a),"image/"+this.outputType,this.outputSize)})},showPreview(){if(!this.isCanShow)return!1;this.isCanShow=!1,setTimeout(()=>{this.isCanShow=!0},16);let t=this.cropW,o=this.cropH,a=this.scale;var i={};i.div={width:`${t}px`,height:`${o}px`};let l=(this.x-this.cropOffsertX)/a,n=(this.y-this.cropOffsertY)/a;i.w=t,i.h=o,i.url=this.imgs,i.img={width:`${this.trueWidth}px`,height:`${this.trueHeight}px`,transform:`scale(${a})translate3d(${l}px, ${n}px, 0px)rotateZ(${90*this.rotate}deg)`},i.html=`
|
|
1
|
+
"use strict";var on=Object.create;var oa=Object.defineProperty;var an=Object.getOwnPropertyDescriptor;var ln=Object.getOwnPropertyNames;var nn=Object.getPrototypeOf,rn=Object.prototype.hasOwnProperty;var sn=(t,o,a,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of ln(o))!rn.call(t,l)&&l!==a&&oa(t,l,{get:()=>o[l],enumerable:!(i=an(o,l))||i.enumerable});return t};var no=(t,o,a)=>(a=t!=null?on(nn(t)):{},sn(o||!t||!t.__esModule?oa(a,"default",{value:t,enumerable:!0}):a,t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("element-plus"),e=require("vue"),cn=require("codemirror"),L=require("@codemirror/state"),E=require("@codemirror/view"),dn=require("@codemirror/commands"),x=require("@codemirror/language"),s=require("@lezer/highlight"),aa=require("@codemirror/lang-javascript"),pn=require("@codemirror/lang-html"),hn=require("@codemirror/lang-json"),mn=require("@codemirror/lang-markdown"),un=require("@codemirror/lang-vue"),gn=require("@codemirror/lang-php"),fn=require("@codemirror/lang-java"),la=require("@codemirror/lang-sql"),Cn=require("@codemirror/lang-python"),vn=require("@codemirror/lang-xml"),yn=require("@codemirror/lang-go"),kn=require("@codemirror/lang-css"),bn=require("html-to-md"),v=(t,o)=>{const a=t.__vccOpts||t;for(const[i,l]of o)a[i]=l;return a},ye=v({name:"cvBadge",extends:{ExtendBadge:k.ElBadge},props:{...k.ElBadge.props},created(){},computed:{isShow(){return!this.value||!(this.value>0)}},data:()=>({})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-badge");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{hidden:n.isShow}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["hidden"])}]]);ye.install=function(t){t.component(ye.name,ye)};const ke=v({name:"cvRow",props:{gutter:{type:[Number,String],default:0},type:{type:[String],default:""},justify:{type:[String],default:"start"},align:{type:[String],default:"top"},tag:{type:[String],default:"div"}},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-row");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-row"},{type:a.type,justify:a.justify,align:a.align,tag:a.tag},{gutter:parseInt(a.gutter)}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["gutter"])}]]),be=v({name:"cvCol",props:{span:{type:[Number,String],default:24},offset:{type:[Number,String],default:0}},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-col");return e.openBlock(),e.createBlock(r,{class:"cv-col",span:parseInt(a.span),offset:parseInt(a.offset)},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},8,["span","offset"])}]]);ke.install=function(t){t.component(ke.name,ke)},be.install=function(t){t.component(be.name,be)};const we=v({name:"cvBtnBase",emits:["click"],props:{...k.ElButton.props,autoLoading:{type:Boolean,default:!1}},data:()=>({loadingStatus:!1}),computed:{filteredProps(){const{autoLoading:t,...o}=this.$props;return o},hasDefaultContent(){const t=this.$slots.default?.();return t&&t.length>0}},methods:{handleClick(t){this.autoLoading&&(this.loadingStatus=!0);try{this.$emit("click",()=>{this.loadingStatus=!1})}catch(o){throw this.loadingStatus=!1,o}}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button");return t.$slots.default||n.hasDefaultContent?(e.openBlock(),e.createBlock(r,e.mergeProps({key:0,class:"cv-btn"},n.filteredProps,{loading:l.loadingStatus,onClick:n.handleClick}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["loading","onClick"])):(e.openBlock(),e.createBlock(r,e.mergeProps({key:1,class:"cv-btn"},n.filteredProps,{loading:l.loadingStatus,onClick:n.handleClick}),null,16,["loading","onClick"]))}]]),Ve=v({name:"cvBtnText",emits:["click"],props:{...k.ElButton.props,autoLoading:{type:Boolean,default:!1}},data:()=>({loadingStatus:!1}),methods:{handleClick(){this.autoLoading&&(this.loadingStatus=!0),this.$emit("click",()=>{this.loadingStatus=!1})}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-btn"},t.$props,{link:"",loading:l.loadingStatus,onClick:n.handleClick}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["loading","onClick"])}]]);we.install=function(t){t.component(we.name,we)},Ve.install=function(t){t.component(Ve.name,Ve)};const xe=v({name:"cvAutocompleteBase",props:{...k.ElAutocomplete.props},data:()=>({localVal:"",loadingStatus:!1}),created(){},methods:{async querySearchAsync(t,o){}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-autocomplete");return e.openBlock(),e.createBlock(r,e.mergeProps({modelValue:l.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>l.localVal=c)},t.$props,{"fetch-suggestions":n.querySearchAsync}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["modelValue","fetch-suggestions"])}]]),oo={props:{compConfig:{},dataParse:{type:[Function],default:()=>null}},data:()=>({searchData:{},loadDataLoading:!1,loadDataList:[],loadDataTotal:0,loadPageCurr:1,loadPageLimit:10,loadConfigSetting:{},loadConfigDef:{pageCurr:1,pageLimit:10,isSkip:!1,url:null,apiFunc:null,mockData:null,where:{},response:{statusName:"status",statusCode:200,msgName:"msg",countName:"total",dataName:"data"},request:{pageName:"page",limitName:"pagesize"}}}),methods:{loadEnding(){this.loadDataLoading=!1,this.$nextTick(()=>{this.loadDataLoading=!1})},loadGetData(){if(this.loadDataLoading=!0,this.loadConfigSetting.apiFunc&&typeof this.loadConfigSetting.apiFunc=="function"){const t=this.loadConfigSetting;let o={...t.where};o[t.request.pageName]=this.loadPageCurr,o[t.request.limitName]=this.loadPageLimit,o=Object.assign(o,this.searchData),this.loadConfigSetting.apiFunc(o).then(a=>{this.loadPageCurr=o[t.request.pageName],this.loadEnding();let i=this.sortOutData(a);if(i.status!=t.response.statusCode)return void ExtendMessage({message:i.msg,type:"error",duration:1300});if(i.data.length===0)return void ExtendMessage({message:"没有更多数据了",type:"warning",duration:1300});let l=i[t.response.dataName]||[];this.dataParse&&typeof this.dataParse=="function"&&(l=this.dataParse.call(null,l)),this.loadDataList.push(...l),this.loadDataTotal=i[t.response.countName]||0}).catch(a=>{this.loadEnding()})}else this.loadDataList.length>0&&(this.loadDataTotal=this.loadDataList.length),this.loadEnding()},sortOutData(t){let o=this.loadConfigSetting.response,a={},i=[],l=[];a.status=t[o.statusName],a.msg=t[o.msgName],a.total=t[o.countName],i=t[o.dataName];for(let n in i)l[n]=i[n];return a.data=l,a}}},Se=v({name:"cvAutocompleteLoad",mixins:[oo],emits:["update:modelValue","input"],props:{...k.ElAutocomplete.props,modelValue:{type:[String,Object,Number],default:()=>({})},placeholder:{type:[String],default:"请输入内容"},popperClass:{type:[String],default:"cv-autocomplete-load"},clearable:{type:[Boolean],default:!0},triggerOnFocus:!1,debounce:500,refID:{type:[String],required:!1,default:()=>"cvAutocompleteLoad-"+ +new Date+(Math.random()/1e4).toFixed(0)},compConfig:{type:[Object],default:()=>({})}},data:()=>({localVal:"",searchList:[],compConfigDef:{searchField:["value"]},timeout:null,loadingMore:!1}),directives:{loadmore:{mounted(t,o){const a=((l,n)=>{let r=null;return function(...c){r&&clearTimeout(r),r=setTimeout(()=>{l.apply(this,c)},n)}})(l=>{const{scrollTop:n,scrollHeight:r,clientHeight:c}=l.target;r-(n+c)<10&&!o.instance.loading&&o.value()},200),i=new MutationObserver(()=>{const l=t.querySelector(".el-autocomplete-suggestion__wrap");l&&!t.__scrollHandler__&&(l.addEventListener("scroll",a),t.__scrollHandler__=a,i.disconnect())});i.observe(t,{childList:!0,subtree:!0})},beforeUnmount(t){if(t.__scrollHandler__){const o=t.querySelector(".el-autocomplete-suggestion__wrap");o&&o.removeEventListener("scroll",t.__scrollHandler__),delete t.__scrollHandler__}}}},created(){this.initConfAll(),this.getData()},methods:{initConfAll(){let t={};Object.assign(t,this.loadConfigDef,this.compConfigDef,this.compConfig),this.loadPageCurr=t.pageCurr||1,this.loadPageLimit=t.pageLimit||10,Object.assign(t.where,this.searchData),this.loadConfigSetting=t},getMoreData(){if(!(this.loadingMore||this.loadDataList.length>=this.loadDataTotal))try{this.loadingMore=!0,this.loadPageCurr++,this.loadGetData()}finally{this.loadingMore=!1}},getData(){this.loadPageCurr=1,this.loadDataList=[],this.loadGetData()},async querySearchAsync(t,o){this.loadPageCurr=1,this.loadDataLoading=!0;var a=this.loadDataList||[];let i=[];const l=this.loadConfigSetting.searchField||["value"];if(i=(t=t.toLowerCase())?a.filter(this.createFilter(t,l)):a,i.length>0)o(i.map(n=>({...n,is_last_tip:!1}))),this.lookFlag=!0;else try{this.loadDataList.length<this.loadDataTotal&&this.loadPageCurr++,this.searchData.keyword=t,this.loadDataList=[],await this.loadGetData();const n=this.loadDataList.map(r=>({...r,is_last_tip:!1}));n.push({is_last_tip:!0}),o(n)}catch{}finally{this.lookFlag=!0}},createFilter:(t,o)=>a=>o.some(i=>(a[i]+"").toLowerCase().indexOf(t)!==-1),handleChange(t){},handleSelect(t){this.$emit("update:modelValue",t)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("el-autocomplete"),p=e.resolveDirective("loadmore");return e.withDirectives((e.openBlock(),e.createElementBlock("div",null,[e.createVNode(c,e.mergeProps(t.$props,{modelValue:l.localVal,"onUpdate:modelValue":o[1]||(o[1]=d=>l.localVal=d),"fetch-suggestions":n.querySearchAsync,onChange:n.handleChange,onSelect:n.handleSelect,teleported:!1,"popper-append-to-body":!1}),{load:e.withCtx(()=>[...o[2]||(o[2]=[])]),default:e.withCtx(({item:d})=>[d.is_last_tip?e.createCommentVNode("",!0):e.renderSlot(t.$slots,"default",e.normalizeProps(e.mergeProps({key:0},{item:d}))),d.is_last_tip?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cv-autocomolete-nodata",onClick:o[0]||(o[0]=e.withModifiers((...h)=>n.getData&&n.getData(...h),["stop"])),disabled:""},[o[3]||(o[3]=e.createTextVNode(" 没有更多数据了 ",-1)),e.createVNode(r,{type:"ElIconRefreshLeft"}),o[4]||(o[4]=e.createTextVNode(" 刷新按钮 ",-1))])):e.createCommentVNode("",!0)]),_:3},16,["modelValue","fetch-suggestions","onChange","onSelect"])])),[[p,n.getMoreData]])}]]);xe.install=function(t){t.component(xe.name,xe)},Se.install=function(t){t.component(Se.name,Se)};const Ne=v({...k.ElForm,name:"cvFormBase",extends:k.ElForm,provide(){return{elForm:this}},props:{...k.ElForm.props,labelWidth:{type:[String,Number],default:"auto"},labelPosition:{type:String,default:"right"}},watch:{model(){}},data:()=>({})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-form-base"},{...t.$props,...t.$attrs},e.toHandlers(t.$attrs)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}]]),Be=v({name:"cvFormInline",provide(){return{elForm:this}},props:{...k.ElForm.props},watch:{},data:()=>({form:{}})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-form-base"},t.$props,e.toHandlers(t.$attrs),{inline:!0}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}]]),wn={name:"cvFormItem",extends:k.ElFormItem,props:{...k.ElFormItem.props},data:()=>({localLabelWidth:"",localError:""}),created(){},methods:{}},Vn={key:0,class:"cv-form-item__tip"},Ee=v(wn,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-form-item");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps({...t.$props,...t.$attrs})),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default"),t.$slots.tip?(e.openBlock(),e.createElementBlock("div",Vn,[e.renderSlot(t.$slots,"tip")])):e.createCommentVNode("",!0)]),_:3},16)}]]);Ne.install=function(t){t.component(Ne.name,Ne)},Be.install=function(t){t.component(Be.name,Be)},Ee.install=function(t){t.component(Ee.name,Ee)};const F={extends:k.ElInput,emits:["update:modelValue","change"],props:{...k.ElInput.props,modelValue:{type:[Number,String],default:""},placeholder:{type:[Number,String],default:""},disabled:{type:Boolean,default:!1}},watch:{modelValue(t){this.localVal=t},localVal(){this.handleChange(),this.handleInput()}},data(){return{localVal:this.modelValue,localRules:[]}},created(){},methods:{handleChange(){this.$emit("change",this.localVal)},handleInput(){this.$emit("update:modelValue",this.localVal)},handleBlur(){this._isCheckValue()},_showError(t){this.localError=t||"请输入正确的"+this.label},_diyValidate(){},_isCheckValue(){const o=this?.rules.split("|");this.localError="";for(let a in o){let i=o[a].split(":"),l=i[0]||"",n=i[1]||"";switch(l){case"require":if(this.localVal=="")return void this._showError(this.label+"不能为空");break;case"max":if(this.localVal.length>n)return void this._showError(this.label+"最大长度不超过"+n);break;case"min":if(this.localVal.length<n)return void this._showError(this.label+"最小长度不小于"+n);break;default:this._diyValidate(l)}}}}},xn=v({name:"cvInputText",mixins:[F],props:{},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({type:"text"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入",clearable:""}),e.createSlots({_:2},[t.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"prepend")]),key:"0"}:void 0,t.$slots.prepend?{name:"append",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"append")]),key:"1"}:void 0]),1040,["modelValue","onChange","onInput","placeholder"])}]]),De=v({name:"cvInputMobile",mixins:[F],components:{},props:{},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({type:"number",oninput:"if(value.length>11)value=value.slice(0,11)"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入11位大陆手机号",clearable:""}),e.createSlots({prepend:e.withCtx(()=>[o[1]||(o[1]=e.createTextVNode("+86",-1))]),_:2},[t.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"append")]),key:"0"}:void 0]),1040,["modelValue","onChange","onInput","placeholder"])}]]),_e=v({name:"cvInputEmail",mixins:[F],components:{},props:{},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({type:"text"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入邮箱",clearable:""}),e.createSlots({_:2},[t.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"prepend")]),key:"0"}:void 0,t.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"append")]),key:"1"}:void 0]),1040,["modelValue","onChange","onInput","placeholder"])}]]),Te=v({name:"cvInputPassword",mixins:[F],components:{},props:{showPassword:{type:Boolean,default:!1}},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({type:"password"},{disabled:t.disabled,showPassword:a.showPassword},{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入密码",clearable:""}),e.createSlots({_:2},[t.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"prepend")]),key:"0"}:void 0,t.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"append")]),key:"1"}:void 0]),1040,["modelValue","onChange","onInput","placeholder"])}]]),Ie=v({name:"cvInputNumber",mixins:[F],props:{},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-number",type:"number"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入整数",clearable:""}),e.createSlots({_:2},[t.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"prepend")]),key:"0"}:void 0,t.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"append")]),key:"1"}:void 0]),1040,["modelValue","onChange","onInput","placeholder"])}]]),Le=v({name:"cvInputIdcard",mixins:[F],components:{},props:{},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({type:"text",oninput:"if(value.length>18)value=value.slice(0,18)"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入身份证",clearable:"",maxlength:"18"}),e.createSlots({_:2},[t.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"prepend")]),key:"0"}:void 0,t.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"append")]),key:"1"}:void 0]),1040,["modelValue","onChange","onInput","placeholder"])}]]),Fe=v({name:"cvInputDigit",mixins:[F],components:{},props:{},data:()=>({}),methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({type:"number"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入",clearable:""}),e.createSlots({_:2},[t.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"prepend")]),key:"0"}:void 0,t.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"append")]),key:"1"}:void 0]),1040,["modelValue","onChange","onInput","placeholder"])}]]),$e=v({name:"cvTextarea",mixins:[F],props:{rows:{type:[Number,String],default:3},autosize:{type:[Boolean,Object],default:!1}},data:()=>({}),computed:{lastRow(){return parseInt(this.rows)}},created(){},methods:{onSubmit(){this.$emit("btnClick",this.localVal)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(r,e.mergeProps({type:"textarea"},{disabled:t.disabled,rows:n.lastRow,autosize:a.autosize},{rows:n.lastRow,modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入内容",clearable:""}),null,16,["rows","modelValue","onInput","placeholder"])}]]),Sn={name:"cvTextareaBtn",mixins:[F],components:{},props:{rows:{type:[Number,String],default:3},btnText:{type:[Number,String],default:""},btnIcon:{type:[String],default:""},autosize:{type:[Boolean,Object],default:!1}},data:()=>({}),computed:{lastRow(){return parseInt(this.rows)}},methods:{onSubmit(){this.$emit("btnClick",this.localVal)}}},Nn={class:"cv-textab-group"},Bn={class:"cv-textab-group__append"},En={class:"cv-textab_slot-wrap"},Oe=v(Sn,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input"),c=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",Nn,[e.createVNode(r,e.mergeProps({type:"textarea"},{disabled:t.disabled,rows:n.lastRow,autosize:a.autosize},{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=p=>t.localVal=p),onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入内容",clearable:""}),null,16,["modelValue","onInput","placeholder"]),e.createElementVNode("div",Bn,[e.createElementVNode("div",En,[e.renderSlot(t.$slots,"default",{},()=>[e.createVNode(c,{class:"cv-textab_slotbtn",type:"primary",size:t.size,onClick:n.onSubmit},{default:e.withCtx(()=>[a.btnIcon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(a.btnIcon),style:{"margin-right":"5px"}},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(a.btnText),1)]),_:1},8,["size","onClick"])])])])])}]]),Dn={class:"cv-input-group"},_n={class:"cv-input-group__append"},Me=v({name:"cvInputBtn",mixins:[F],emits:["btnClick"],components:{},props:{btnText:{type:[Number,String],default:"确定"},btnIcon:{type:[String],default:""}},data:()=>({}),methods:{onSubmit(){this.$emit("btnClick",this.localVal)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input"),c=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",Dn,[e.createVNode(r,e.mergeProps({type:"text"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=p=>t.localVal=p),onChange:t.handleChange,onInput:t.handleInput,placeholder:t.placeholder?t.placeholder:"请输入",clearable:""}),null,16,["modelValue","onChange","onInput","placeholder"]),e.createElementVNode("div",_n,[e.renderSlot(t.$slots,"default",{},()=>[e.createVNode(c,{class:"cv-input-btn__slotbtn",type:"primary",size:t.size,onClick:n.onSubmit},{default:e.withCtx(()=>[a.btnIcon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(a.btnIcon),style:{"margin-right":"5px"}},null,2)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(a.btnText),1)]),_:1},8,["size","onClick"])])])])}]]),io=v({data:()=>({formData:{}})},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div")}]]);De.install=function(t){t.component(De.name,De)},_e.install=function(t){t.component(_e.name,_e)},Te.install=function(t){t.component(Te.name,Te)},Ie.install=function(t){t.component(Ie.name,Ie)},Le.install=function(t){t.component(Le.name,Le)},Fe.install=function(t){t.component(Fe.name,Fe)},$e.install=function(t){t.component($e.name,$e)},Oe.install=function(t){t.component(Oe.name,Oe)},Me.install=function(t){t.component(Me.name,Me)},io.install=function(t){t.component(io.name,io)};const ze=v({name:"cvInputCounter",extends:k.ElInputNumber,props:{},watch:{modelValue(){this.localVal=this.modelValue}},data:()=>({localVal:0}),created(){},methods:{handleChange(t){this.$emit("update:modelValue",this.localVal)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input-number");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{modelValue:l.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>l.localVal=c),onChange:n.handleChange,step:t.step}),null,16,["modelValue","onChange","step"])}]]);ze.install=function(t){t.component(ze.name,ze)};const Tn={class:"cv-show-text"},In=["innerHTML"],Pe=v({name:"cvShowText",mixins:[],components:{},props:{text:{type:[Number,String,Object],default:""}},data:()=>({}),created(){},methods:{}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",Tn,[a.text?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:a.text},null,8,In)):e.createCommentVNode("",!0),a.text?e.createCommentVNode("",!0):e.renderSlot(t.$slots,"default",{key:1})])}]]),Ln={class:"cv-show-image"},He=v({name:"cvShowImage",mixins:[],components:{},props:{url:{type:[String,Array,Object],default:""},width:{type:[String],default:"100px"},height:{type:[String],default:"100px"}},data:()=>({localUrl:""}),watch:{url:{handler(){this.localUrl=typeof this.url=="string"?[this.url]:this.url},immediate:!0,deep:!0}},created(){},methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-image");return e.openBlock(),e.createElementBlock("div",Ln,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.localUrl,(c,p)=>(e.openBlock(),e.createBlock(r,{style:e.normalizeStyle("width:"+a.width+"; height:"+a.height+"; margin-right:10px"),key:p,src:c,"preview-src-list":l.localUrl},null,8,["style","src","preview-src-list"]))),128))])}]]),Ae=v({name:"cvShowTip",props:{borderColor:{type:[String],default:"#50bfff"},bgColor:{type:[String],default:"#ecf8ff"}},data:()=>({backgroundColor:"#ecf8ff",borderLeft:"5px solid #50bfff"}),created(){this.borderLeft=`5px solid ${this.borderColor}`,this.backgroundColor=`${this.bgColor}`},methods:{}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:"cv-show-tip",style:e.normalizeStyle({backgroundColor:this.backgroundColor,borderLeft:this.borderLeft})},[e.renderSlot(t.$slots,"default")],4)}]]),Fn={name:"cv-gallery-dialog",props:{type:String,title:String,sources:Array,sliceSingle:{type:Boolean,default:!1},carouselAttrs:Object},data:()=>({isShowCarousel:!1,sourceTitle:"",initialIndex:0,isShowPreview:!1}),methods:{startPreview(t){this.isShowPreview=!0,this.initialIndex=t,this.sourceTitle=this.sources[t].title},handleCarouselChange(t){this.sources[t]&&this.sources[t].title?this.sourceTitle=this.sources[t].title:this.sourceTitle=""}}},$n=["src"],On={key:0,class:"cv-gallery-iframe embed-responsive embed-responsive-16by9"},Mn=["src"],zn=["src"],Pn=["src"],Hn={name:"gallery",components:{GalleryDialog:v(Fn,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-carousel-item"),c=e.resolveComponent("el-carousel"),p=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(p,{visible:l.isShowPreview,"append-to-body":"",onOpen:o[0]||(o[0]=d=>l.isShowCarousel=!0),onClosed:o[1]||(o[1]=d=>l.isShowCarousel=!1),style:{"text-align":"center"}},{header:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.sourceTitle||a.title),1)]),default:e.withCtx(()=>[a.type==="video"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l.isShowPreview?(e.openBlock(),e.createElementBlock("video",{key:0,src:a.sources[l.initialIndex].src,autoplay:"autoplay",class:"cv-gallery-video",controls:"controls",width:"100%"},null,8,$n)):e.createCommentVNode("",!0)],64)):a.type==="iframe"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.isShowPreview?(e.openBlock(),e.createElementBlock("div",On,[e.createElementVNode("iframe",{src:a.sources[l.initialIndex].src,allowfullscreen:"true",border:"0",frameborder:"no",framespacing:"0",scrolling:"no"},null,8,Mn)])):e.createCommentVNode("",!0)],64)):a.type==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[a.sliceSingle&&a.sources[l.initialIndex]||a.sources.length===1?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.sources[l.initialIndex].src,class:"cv-gallery-image"},null,8,zn)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.isShowCarousel?(e.openBlock(),e.createBlock(c,e.mergeProps({key:0,"initial-index":l.initialIndex,onChange:n.handleCarouselChange,"indicator-position":"outside"},a.carouselAttrs),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.sources,(d,h)=>(e.openBlock(),e.createBlock(r,{key:h},{default:e.withCtx(()=>[e.createElementVNode("img",{src:d.src,class:"cv-gallery-image"},null,8,Pn)]),_:2},1024))),128))]),_:1},16,["initial-index","onChange"])):e.createCommentVNode("",!0)],64))],64)):e.createCommentVNode("",!0)]),_:1},8,["visible"])}]])},props:{type:{type:String,default:"image",validator:t=>["image","video","iframe"].includes(t)},size:Number,width:Number,height:Number,lazy:{type:Boolean,default:!1},source:[String,Array,Object],thumbSuffix:{type:String,default:""},thumbStyle:Object,carouselAttrs:Object,title:String,sliceSingle:{type:Boolean,default:!1}},data:()=>({}),computed:{computedStyle(){let t=this.width||this.size,o=this.height||this.size;return this.type==="iframe"&&(t=t?t+"px":"360px",o=o?o+"px":"auto"),Object.assign({},{width:t,height:o,display:"block"},this.thumbStyle)},thumbs(){return this.computedSources.map(t=>t.thumb)},computedSources(){const t=this.source;if(typeof t=="string")return[this.getStringSource(t)];if(t instanceof Array){const o=[];return t.forEach(a=>{a instanceof Object?o.push(this.getObjectSource(a)):typeof a=="string"&&o.push(this.getStringSource(a))}),o}return t instanceof Object?[this.getObjectSource(t)]:[]}},methods:{handlePreview(t){this.$refs.dialog.startPreview(t)},getStringSource(t){let o=t;return this.type==="image"&&this.thumbSuffix&&(o+=this.thumbSuffix),{type:this.type,src:t,thumb:o}},getObjectSource(t){return t.type=t.thumb?"image":this.type,t.thumb=t.thumb||t.src,t}}},An={key:0,class:"cv-gallery"},jn={class:"el-upload-list el-upload-list--picture-card"},Rn=["src"],Un={class:"el-upload-list__item-actions"},Wn=["onClick"],ro=v(Hn,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("GalleryDialog");return a.source?(e.openBlock(),e.createElementBlock("div",An,[e.createElementVNode("div",jn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.computedSources,(p,d)=>(e.openBlock(),e.createElementBlock("li",{key:d,class:"el-upload-list__item"},[e.createElementVNode("div",{style:e.normalizeStyle(n.computedStyle),class:"cv-gallery-iframe embed-responsive embed-responsive-16by9"},[e.createElementVNode("iframe",{src:p.thumb,allowfullscreen:"true",border:"0",frameborder:"no",framespacing:"0",scrolling:"no"},null,8,Rn)],4),e.createElementVNode("span",Un,[e.createElementVNode("span",{onClick:h=>n.handlePreview(d,p)},[e.createVNode(r,{type:"ElIconVideoPlay",size:"20"})],8,Wn),e.renderSlot(t.$slots,"action",e.mergeProps({ref_for:!0},{source:p,index:d}))])]))),128))]),e.createVNode(c,{carouselAttrs:a.carouselAttrs,sliceSingle:a.sliceSingle,sources:n.computedSources,title:a.title,type:a.type,ref:"dialog"},null,8,["carouselAttrs","sliceSingle","sources","title","type"])])):e.createCommentVNode("",!0)}]]);Pe.install=function(t){t.component(Pe.name,Pe)},He.install=function(t){t.component(He.name,He)},Ae.install=function(t){t.component(Ae.name,Ae)},ro.install=function(t){t.component(ro.name,ro)};const je=v({name:"cvRadioOptBase"},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-radio");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}]]),Re=v({name:"cvRadioOptBtn"},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-radio-button");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}]]),Ue=v({name:"cvRadioGroup",props:{...k.ElRadioGroup.props,modelValue:{default:""},type:{type:[String],default:"base"},dataLists:{type:Array,default:()=>[]},dataField:{type:[Object],default:()=>({})},disabled:{type:Boolean,default:!1}},watch:{modelValue(t){this.localVal=t},localVal(){this.handleChange()},dataLists:{handler(){this._parseLocalOpt()},immediate:!0,deep:!0}},data(){return{localText:[],localVal:this.modelValue,localOpt:[]}},created(){this._parseLocalOpt()},methods:{handleChange(){this.$emit("update:modelValue",this.localVal)},_parseLocalOpt(){let t=[];if(this.dataLists&&this.dataLists.length!==0)if(typeof this.dataLists[0]=="string")this.dataLists.map(i=>{t.push({label:i,value:i})}),this.localOpt=t;else{var o=this.dataField&&this.dataField.label||"label",a=this.dataField&&this.dataField.value||"value";this.dataLists.map(i=>{let l=i[o]===0?0:i[o]||"",n=i[a]===0?0:i[a]||"";n=n===0?0:n||l,t.push({label:l,value:n,disabled:!!i.disabled}),i.checked!="true"&&i.checked!=1||(typeof this.localVal=="string"?this.localVal=n:typeof this.localVal!="array"&&typeof this.localVal!="object"||this.localVal.push(n))}),this.localOpt=t}}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-radio"),c=e.resolveComponent("el-radio-button"),p=e.resolveComponent("el-radio-group");return e.openBlock(),e.createBlock(p,{class:"cv-radio-group",modelValue:l.localVal,"onUpdate:modelValue":o[0]||(o[0]=d=>l.localVal=d)},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[a.type=="base"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.localOpt,(d,h)=>(e.openBlock(),e.createBlock(r,{label:d.label,value:d.value,key:h,disabled:a.disabled||d.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["label","value","disabled"]))),128)):e.createCommentVNode("",!0),a.type=="button"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(l.localOpt,(d,h)=>(e.openBlock(),e.createBlock(c,{label:d.label,value:d.value,key:h,disabled:a.disabled||d.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["label","value","disabled"]))),128)):e.createCommentVNode("",!0)])]),_:3},8,["modelValue"])}]]);je.install=function(t){t.component(je.name,je)},Re.install=function(t){t.component(Re.name,Re)},Ue.install=function(t){t.component(Ue.name,Ue)};const We=v({name:"cvCheckboxOptBase",extends:k.ElCheckbox},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-checkbox");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}]]),Ye=v({name:"cvCheckboxOptBtn",extends:k.ElCheckboxButton,props:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-checkbox-button");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}]]),El={props:{...k.ElCheckboxGroup.props,modelValue:{type:[Array],default:()=>[]},dataLists:{type:Array,default:()=>[]},dataField:{type:[Object],default:()=>({})},disabled:{type:Boolean,default:!1}},watch:{modelValue(){this.localVal=this.modelValue},localVal(){this.handleChange()},dataLists:{handler(){this._parseLocalOpt()},immediate:!0,deep:!0}},data(){return{localVal:this.modelValue,localOpt:[]}},created(){this.handleChange(),this._parseLocalOpt()},methods:{handleChange(){this.$emit("update:modelValue",this.localVal)},_parseLocalOpt(){let t=[];if(this.dataLists&&this.dataLists.length!==0)if(typeof this.dataLists[0]=="string")this.dataLists.map(i=>{t.push({label:i,value:i})}),this.localOpt=t;else{var o=this.dataField&&this.dataField.label||"label",a=this.dataField&&this.dataField.value||"value";this.dataLists.map(i=>{let l=i[o]===0?0:i[o]||"",n=i[a]===0?0:i[a]||"";n=n===0?0:n||l,t.push({label:l,value:n,disabled:!!i.disabled}),i.checked!="true"&&i.checked!=1||(typeof this.localVal=="string"?this.localVal=n:typeof this.localVal!="array"&&typeof this.localVal!="object"||this.localVal.push(n))}),this.localOpt=t}this._parseLocalOptDiy()},_parseLocalOptDiy(){}}},Yn={class:"cv-checkbox-all"},qe=v({name:"cvCheckboxAll",mixins:[El],components:{},data:()=>({checkAll:!1,isIndeterminate:!0,localOptAll:[]}),methods:{handleCheckAllChange(t){this.localVal=t?this.localOptAll:[],this.isIndeterminate=!1,this.handleChange()},handleCheckedCitiesChange(t){let o=t.length;this.checkAll=o===this.localOptAll.length,this.isIndeterminate=o>0&&o<this.localOptAll.length},_parseLocalOptDiy(){this.localOpt&&this.localOpt.length!==0&&this.localOpt.map(t=>{t.disabled||this.localOptAll.push(t.label)})}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-checkbox"),c=e.resolveComponent("el-checkbox-group");return e.openBlock(),e.createElementBlock("div",Yn,[e.createVNode(r,{indeterminate:l.isIndeterminate,modelValue:l.checkAll,"onUpdate:modelValue":o[0]||(o[0]=p=>l.checkAll=p),onChange:n.handleCheckAllChange},{default:e.withCtx(()=>[...o[2]||(o[2]=[e.createTextVNode("全选",-1)])]),_:1},8,["indeterminate","modelValue","onChange"]),o[3]||(o[3]=e.createElementVNode("div",{style:{margin:"15px 0"}},null,-1)),e.createVNode(c,{modelValue:t.localVal,"onUpdate:modelValue":o[1]||(o[1]=p=>t.localVal=p),onChange:n.handleCheckedCitiesChange},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.localOpt,(p,d)=>(e.openBlock(),e.createBlock(r,{label:p.label,value:p.value,key:d,onChange:t.handleChange,disabled:t.disabled||p.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.label),1)]),_:2},1032,["label","value","onChange","disabled"]))),128))])]),_:3},8,["modelValue","onChange"])])}]]),Xe=v({name:"cvCheckboxGroup",mixins:[El],components:{},props:{type:{type:[String],default:"base"}},data:()=>({})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-checkbox"),c=e.resolveComponent("el-checkbox-button"),p=e.resolveComponent("el-checkbox-group");return e.openBlock(),e.createBlock(p,e.mergeProps(t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=d=>t.localVal=d)}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[a.type=="base"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.localOpt,(d,h)=>(e.openBlock(),e.createBlock(r,{label:d.label,value:d.value,key:h,onChange:t.handleChange,disabled:t.disabled||d.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["label","value","onChange","disabled"]))),128)):e.createCommentVNode("",!0),a.type=="button"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.localOpt,(d,h)=>(e.openBlock(),e.createBlock(c,{label:d.label,value:d.value,key:h,onChange:t.handleChange,disabled:t.disabled||d.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["label","value","onChange","disabled"]))),128)):e.createCommentVNode("",!0)])]),_:3},16,["modelValue"])}]]);function Dl(t,o,a){var i={}.atBegin;return function(l,n,r){var c,p=r||{},d=p.noTrailing,h=d!==void 0&&d,u=p.noLeading,m=u!==void 0&&u,f=p.debounceMode,C=f===void 0?void 0:f,g=!1,y=0;function b(){c&&clearTimeout(c)}function w(){for(var V=arguments.length,S=new Array(V),B=0;B<V;B++)S[B]=arguments[B];var _=this,T=Date.now()-y;function O(){y=Date.now(),n.apply(_,S)}function le(){c=void 0}g||(m||!C||c||O(),b(),C===void 0&&T>l?m?(y=Date.now(),h||(c=setTimeout(C?le:O,l))):O():h!==!0&&(c=setTimeout(C?le:O,C===void 0?l-T:l)))}return w.cancel=function(V){var S=(V||{}).upcomingOnly,B=S!==void 0&&S;b(),g=!B},w}(t,o,{debounceMode:(i!==void 0&&i)!==!1})}function Ke(t,o=!1,a=!0){return new Promise((i,l)=>{const n=document.createElement("script");t=t.replace(/([^:]\/)\/+/g,"$1"),n.id=t,n.type="text/javascript",n.src=o?t+"?t="+new Date().getTime():t,document.getElementById(t)&&a?i():(document.body.appendChild(n),n.onload=()=>{i()})})}function qn(t){const o=t;try{const a=document.createElement("textarea");a.value=o,document.body.appendChild(a),a.select(),document.execCommand("Copy"),a.remove(),document.body.removeChild(a)}catch{navigator.clipboard.writeText(o).then(()=>{}).catch(i=>{})}k.ElMessage({message:"复制成功",type:"success"})}function Xn(t){var o=new Date,a=new Date(t),i=o-a,l=Math.floor(i/1e3),n=Math.floor(l/60),r=Math.floor(n/60);if(n<1)var c=l+"秒前";else r<1?c=n+"分钟前":r<24?c=r+"小时前":c=a.toLocaleString();return c}function K(t,...o){return o.reduce((a,i)=>Object.keys(i).reduce((l,n)=>{const r=i[n];return to(r)?l[n]=K(l[n]?l[n]:{},r):Tl(r)?l[n]=r.map((c,p)=>{if(to(c)){const d=l[n]?l[n]:[];return K(d[p]?d[p]:{},c)}return c}):l[n]=r,l},a),t)}function _l(t,o){const{[o[0]]:a,...i}=t;return Object.keys(t).reduce((l,n)=>(o.includes(n)||(l[n]=t[n]),l),{})}function to(t){return Object.prototype.toString.call(t)==="[object Object]"}function Tl(t){return typeof Array.isArray=="function"?Array.isArray(t):Object.prototype.toString.call(t)==="[object Array]"}function ee(t){return Tl(t)?t.length===0:to(t)?Object.keys(t).length===0:t===""||t==null}function oe(t,o){return ee(t)?o:t}function Kn(t){let o=t.lastIndexOf("."),a=t.substring(o+1);return["png","jpg","jpeg","gif","webp","svg"].indexOf(a.toLowerCase())!=-1}function Z(t){return t==null?"":String(t)}We.install=function(t){t.component(We.name,We)},Ye.install=function(t){t.component(Ye.name,Ye)},Xe.install=function(t){t.component(Xe.name,Xe)},qe.install=function(t){t.component(qe.name,qe)};const Il=(()=>{const t={svg:["image/svg+xml","image/svg"],jpg:["image/jpeg","image/jpg"],jpeg:["image/jpeg"],png:["image/png"],gif:["image/gif"],webp:["image/webp"],bmp:["image/bmp","image/x-bmp","image/x-ms-bmp"],ico:["image/x-icon","image/vnd.microsoft.icon"],tiff:["image/tiff","image/tif","image/x-tiff"],apng:["image/apng"],avif:["image/avif"],heic:["image/heic"],pdf:["application/pdf"],txt:["text/plain"],csv:["text/csv"],json:["application/json"],xml:["application/xml"],doc:["application/msword"],docx:["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],xls:["application/vnd.ms-excel"],xlsx:["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],ppt:["application/vnd.ms-powerpoint"],pptx:["application/vnd.openxmlformats-officedocument.presentationml.presentation"],zip:["application/zip"],rar:["application/x-rar-compressed"],"7z":["application/x-7z-compressed"],mp3:["audio/mpeg"],mp4:["video/mp4"],mov:["video/quicktime"],avi:["video/x-msvideo"],wav:["audio/wav"]},o={},a={};for(const[i,l]of Object.entries(t)){o[i]=l[0];for(const n of l)a[n]=i}return{extensionToMime:o,mimeToExtension:a}})(),Gn={name:"cvGeoCity",mixins:[],components:{},emits:["update:province","update:city","update:district","update:provinceCode","update:cityCode","update:districtCode"],props:{modelValue:{type:[String,Array,Number],default:()=>[]},province:{type:[String]},provinceCode:{type:[Number,String],default:""},city:{type:[String]},cityCode:{type:[Number,String],default:""},district:{type:[String]},districtCode:{type:[Number,String],default:""},cityHide:{type:Boolean,default:!1},districtHide:{type:Boolean,default:!1}},watch:{modelValue(t){},province(t){this.initProvince()},provinceCode(t){this.initProvince()},cityCode(t){this.initCity()},districtCode(t){this.initDistrict()}},data:()=>({provinceCdnList:{},cityCdnList:{},districtCdnList:{},isCdnLoading:!0,provinceList:[],cityList:[],districtList:[],local1_code:"",local1_name:"",local2_code:"",local2_name:"",local3_code:"",local3_name:"",local1_flag:!1,local2_flag:!1,local3_flag:!1,hideMunicipality:!1,municipalities:["110000","120000","310000","500000","北京市","天津市","上海市","重庆市"]}),async mounted(){await Ke(this.CDN_URL_UI+"/dict/geo/province-kv-window.js"),await Ke(this.CDN_URL_UI+"/dict/geo/city-kv-window.js"),await Ke(this.CDN_URL_UI+"/dict/geo/district-kv-window.js"),await this.initLoad()},methods:{initLoad(){setTimeout(()=>{this.provinceCdnList=window.cdn__DictAreaProvince,this.cityCdnList=window.cdn__DictAreaCity,this.districtCdnList=window.cdn__DictAreaDistrict,this.local1_flag=!1,this.isCdnLoading=!1,this.getProvinces(),this.initProvince()},200)},initProvince(){if(!this.province&&!this.provinceCode)return!1;this.getProvinces();const t=this.provinceList.find(o=>this.province?o.provinceName===this.province:this.provinceCode&&o.provinceCode===this.provinceCode);t&&(this.local1_code=t.provinceCode,this.changeProvince(t.provinceCode)),this.initCity()},initCity(){if(!this.city&&!this.cityCode)return!1;const t=this.cityList.find(o=>this.city?o.cityName===this.city:this.cityCode&&o.cityCode===this.cityCode);t&&(this.local2_code=t.cityCode,this.changeCity(t.cityCode)),this.initDistrict()},initDistrict(){if(!this.district&&!this.districtCode)return!1;const t=this.districtList.find(o=>this.district?o.districtName===this.district:this.districtCode&&o.districtCode===this.districtCode);t&&this.changeDistrict(t.districtCode)},getProvinces(){if(!this.local1_flag&&typeof this.provinceCdnList=="object"){let t=[];for(let o in this.provinceCdnList)t.push({provinceCode:o,provinceName:this.provinceCdnList[o]});this.provinceList=t,this.local1_flag=!0}},changeProvince(t){this._getNeedCity(),this.local2_flag=!0,this.local2_code="",this.local2_name="",this.local3_code="",this.local3_name="",this.local1_code=t,this.local1_name=this.provinceList.find(o=>o.provinceCode===t)?.provinceName,this.handleChoose()},_getNeedCity(){let t=[],o=this.local1_code.substring(0,2);for(let a in this.cityCdnList)a.substring(0,2)==o&&t.push({cityCode:a,cityName:this.cityCdnList[a]});this.cityList=t},getCities(){this.local2_flag||this.provinceCode&&(this._getNeedCity(),this.local2_flag=!0)},changeCity(t){this._getNeedDistrict(),this.local3_flag=!0,this.local3_name="",this.local3_code="",this.local2_code=t,this.local2_name=this.cityList.find(o=>o.cityCode===t)?.cityName,this.handleChoose()},_getNeedDistrict(){let t=[],o=this.local2_code.substring(0,4);for(let a in this.districtCdnList)a.substring(0,4)==o&&t.push({districtCode:a,districtName:this.districtCdnList[a]});this.districtList=t},getDistrict(){this.local3_flag||this.local2_code&&this._getNeedDistrict()},changeDistrict(t){this.local3_code=t,this.local3_name=this.districtList.find(o=>o.districtCode===t)?.districtName,this.handleChoose()},handleChoose(){this.$emit("update:province",this.local1_name),this.$emit("update:provinceCode",this.local1_code),this.$emit("update:city",this.local2_name),this.$emit("update:cityCode",this.local2_code),this.$emit("update:district",this.local3_name),this.$emit("update:districtCode",this.local3_code)}}},Zn={class:"cv-geo-city"},Qn={key:0},Jn={key:1},Ge=v(Gn,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-option"),c=e.resolveComponent("el-select"),p=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",Zn,[e.createElementVNode("div",null,[e.createVNode(c,{modelValue:l.local1_code,"onUpdate:modelValue":o[0]||(o[0]=d=>l.local1_code=d),onFocus:n.getProvinces,onChange:n.changeProvince,placeholder:"省",filterable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.provinceList,(d,h)=>(e.openBlock(),e.createBlock(r,{key:d.provinceCode,label:d.provinceName,value:d.provinceCode},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.provinceName),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onFocus","onChange"])]),a.cityHide?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Qn,[e.createVNode(c,{modelValue:l.local2_code,"onUpdate:modelValue":o[1]||(o[1]=d=>l.local2_code=d),onFocus:n.getCities,onChange:n.changeCity,placeholder:"市",filterable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.cityList,(d,h)=>(e.openBlock(),e.createBlock(r,{key:d.cityCode,label:d.cityName,value:d.cityCode},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.cityName),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onFocus","onChange"])])),a.cityHide||a.districtHide?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Jn,[e.createVNode(c,{modelValue:l.local3_code,"onUpdate:modelValue":o[2]||(o[2]=d=>l.local3_code=d),onFocus:n.getDistrict,onChange:n.changeDistrict,placeholder:"区/县",filterable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.districtList,(d,h)=>(e.openBlock(),e.createBlock(r,{key:d.districtCode,label:d.districtName,value:d.districtCode},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.districtName),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onFocus","onChange"])]))])),[[p,l.isCdnLoading]])}]]),Ll={computed:{componentName(){return this.$options.name}},methods:{_mergeAttrs(t){const o=this.$cvUiParams||{},a=t&&o[t]||{},i=o[this.componentName]||{},l=Object.assign({},a,i);return Object.assign({},l,this.$attrs)}}},ei={class:"cv-geo-map__wrap"},ti={class:"cv-geo-map__box"},oi={style:{width:"100%",height:"510px"}},ai=["src"],li={class:"cv-geo-map__info"},ni={key:0,class:"cv-geo-map__address"},ii={key:1,class:"cv-geo-map__jwd"},Ze=v({name:"cvGeoMap",mixins:[Ll],emits:["update:address","update:latitude","update:longitude","update:name","update:city"],props:{title:{type:[String],default:"选择经纬度地点"},mapKey:{type:[String],default:""},mapSecret:{type:[String],default:""},mapType:{type:[String],default:"qq"},address:{type:[String]},name:{type:[String]},city:{type:[String]},latitude:{type:[Number,String]},longitude:{type:[Number,String]}},watch:{address(t){this.localAddress=t},latitude(t){this.localLatitude=t},longitude(t){this.localLongitude=t},name(t){this.localName=t},city(t){this.localCity=t}},computed:{localMapKey(){return this._mergeAttrs("geo").mapKey},localMapSecret(){return this._mergeAttrs("geo").mapSecret},mapSrc(){let t=this.localMapKey;if(this.mapType=="qq"){if(!this.localMapKey)return"";let o="https://apis.map.qq.com/tools/locpicker";return o+=`?search=1&type=1&key=${t}&referer=myapp`,this.latitude&&this.longitude&&(o+=`&coord=${this.latitude},${this.longitude}`),o}if(this.mapType=="amap"){if(!this.localMapKey||!this.localMapSecret)return"";let o="https://m.amap.com/picker/";return o+=`?zoom=15&radius=1000&total=20&key=${t}&jscode=${localMapSecret}`,this.latitude&&this.longitude&&(o+=`¢er=${this.longitude},${this.latitude}`),o}return this.$message.info("目前不支持百度地图"),""}},data:()=>({localMapShow:!1,localAddress:"",localLatitude:"",localLongitude:"",localName:"",localCity:""}),mounted(){this.initData()},methods:{initData(){let t=this;window.addEventListener("message",o=>{let a=o.data;a&&a.module=="locationPicker"&&(t.localAddress=a.poiaddress||"",t.localName=a.poiname||"",t.localCity=a.cityname||"",t.localLatitude=a.latlng.lat||"",t.localLongitude=a.latlng.lng||"")},!1)},handleMapClose(){this.localMapShow=!1},handleMapOpen(){this.localMapShow=!0},handleConfirm(){this.$emit("update:address",this.localAddress),this.$emit("update:longitude",this.localLongitude),this.$emit("update:latitude",this.localLatitude),this.$emit("update:name",this.localName),this.$emit("update:city",this.localCity),this.handleMapClose()},handleCopy(t){this.$cvCopy(t)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input"),c=e.resolveComponent("el-tooltip"),p=e.resolveComponent("el-button"),d=e.resolveComponent("el-scrollbar"),h=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",ei,[e.createElementVNode("div",ti,[e.createVNode(c,{class:"item",effect:"dark",content:"请点击查找位置选择位置",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(r,{modelValue:l.localAddress,"onUpdate:modelValue":o[0]||(o[0]=u=>l.localAddress=u)},null,8,["modelValue"])]),_:1}),e.createVNode(p,{type:"primary",icon:"ElIconSearch",onClick:n.handleMapOpen},{default:e.withCtx(()=>[...o[5]||(o[5]=[e.createTextVNode("请查找位置",-1)])]),_:1},8,["onClick"])])]),e.createVNode(h,{modelValue:l.localMapShow,"onUpdate:modelValue":o[4]||(o[4]=u=>l.localMapShow=u),title:a.title,width:"520","before-close":n.handleMapClose},{footer:e.withCtx(()=>[e.createElementVNode("div",li,[l.localAddress?(e.openBlock(),e.createElementBlock("div",ni,[o[6]||(o[6]=e.createElementVNode("span",{class:"cv-geo-map__label"},"已选:",-1)),e.createVNode(c,{class:"item",effect:"dark",content:"点击复制",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("span",{class:"cv-geo-map__value",onClick:o[1]||(o[1]=u=>n.handleCopy(l.localAddress))},e.toDisplayString(l.localAddress),1)]),_:1})])):e.createCommentVNode("",!0),l.localAddress?(e.openBlock(),e.createElementBlock("div",ii,[o[7]||(o[7]=e.createElementVNode("span",{class:"cv-geo-map__label"},"经度:",-1)),e.createVNode(c,{class:"item",effect:"dark",content:"点击复制",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("span",{class:"cv-geo-map__value",onClick:o[2]||(o[2]=u=>n.handleCopy(l.localLongitude))},e.toDisplayString(l.localLongitude),1)]),_:1}),o[8]||(o[8]=e.createElementVNode("span",{class:"cv-geo-map__label"},"纬度:",-1)),e.createVNode(c,{class:"item",effect:"dark",content:"点击复制",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("span",{class:"cv-geo-map__value",onClick:o[3]||(o[3]=u=>n.handleCopy(l.localLatitude))},e.toDisplayString(l.localLatitude),1)]),_:1})])):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[e.createVNode(p,{onClick:n.handleMapClose},{default:e.withCtx(()=>[...o[9]||(o[9]=[e.createTextVNode("取消",-1)])]),_:1},8,["onClick"]),e.createVNode(p,{type:"primary",onClick:n.handleConfirm,disabled:!l.localAddress},{default:e.withCtx(()=>[...o[10]||(o[10]=[e.createTextVNode("确认选择",-1)])]),_:1},8,["onClick","disabled"])])]),default:e.withCtx(()=>[e.createElementVNode("div",oi,[e.createVNode(d,{style:{height:"510px"}},{default:e.withCtx(()=>[e.createElementVNode("iframe",{id:"mapPage",width:"100%",height:"100%",style:{height:"500px"},frameborder:"0",src:n.mapSrc},null,8,ai)]),_:1})])]),_:1},8,["modelValue","title","before-close"])],64)}]]);Ge.install=function(t){t.component(Ge.name,Ge)},Ze.install=function(t){t.component(Ze.name,Ze)};const Qe={...k.ElOption,extends:k.ElOption,name:"cvSelectOpt"},Je=v({name:"cvSelectBase",emits:["onChoose","change","update:modelValue"],props:{...k.ElSelect.props,modelValue:{type:[String,Array,Number],default:()=>""},dataLists:{type:[Array],default:()=>[]},dataField:{type:[Object],default:()=>({})},dataDisabled:{type:[Array],default:()=>[]},disabled:{type:Boolean,default:!1},placeholder:{type:[String,Number],default:"请选择"}},watch:{modelValue(t){this.localVal=t},dataLists:{handler(){this._parseLocalOpt()},immediate:!0,deep:!0},localVal(t){this.handleChange()}},data(){return{localVal:this.modelValue,localOpt:[]}},methods:{handleChoose(t,o){this.$emit("onChoose",t,o)},handleChange(){this.$emit("change",this.localVal),this.$emit("update:modelValue",this.localVal)},_parseLocalOpt(){let t=[];if(this.dataLists&&this.dataLists.length!==0)if(typeof this.dataLists[0]=="string")this.dataLists.map(i=>{t.push({label:i,value:i})}),this.localOpt=t;else{var o=this.dataField&&this.dataField.label||"label",a=this.dataField&&this.dataField.value||"value";this.dataLists.map(i=>{let l=i[o]===0?0:i[o]||"",n=i[a]===0?0:i[a]||"";if(n=n===0?0:n||l,this.dataDisabled.length>0)for(let r in this.dataDisabled)this.dataDisabled[r][a]==n&&(i.disabled=!0);t.push({label:l,value:n,disabled:!!i.disabled}),i.checked!="true"&&i.checked!=1||(typeof this.localVal=="string"?this.localVal=n:typeof this.localVal!="array"&&typeof this.localVal!="object"||this.localVal.push(n))}),this.localOpt=t}}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-option"),c=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(c,e.mergeProps({class:"cv-select-base"},t.$props,{modelValue:l.localVal,"onUpdate:modelValue":o[0]||(o[0]=p=>l.localVal=p),size:t.size,filterable:"",clearable:""}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.localOpt,(p,d)=>(e.openBlock(),e.createBlock(r,{onClick:h=>n.handleChoose(p,d),disabled:p.disabled,label:p.label,value:p.value,key:d},null,8,["onClick","disabled","label","value"]))),128))])]),_:3},16,["modelValue","size"])}]]),et=v({name:"cvSelectTree",emits:["update:modelValue","change"],props:{...k.ElSelect.props,modelValue:{type:[String,Array,Number],default:()=>""},dataLists:{type:[Array],default:()=>[]},dataField:{type:[Object],default:()=>({value:"id",label:"title",children:"children"})},clearable:{type:Boolean,default:!0},accordion:{type:Boolean,default:!1},defaultExpandAll:{type:Boolean,default:!0},dataDisabled:{type:[Array],default:()=>[]},disabled:{type:Boolean,default:!1},placeholder:{type:[String,Number],default:"请选择"},showAllLevels:{type:Boolean,default:!0},showCheckbox:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},emitPath:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},refID:{type:[String],required:!1,default:()=>"cvSelectTree-"+ +new Date+(Math.random()/1e4).toFixed(0)}},watch:{modelValue(){this.localVal=this.modelValue,this.initHandle()},dataLists:{handler(){this._parseLocalOpt()},immediate:!0,deep:!0},localVal(){this.handleChange()}},data:()=>({localVal:"",localOpt:[],localTitle:"",defaultExpandedKey:[]}),computed:{props2(){return Object.assign(this.dataField,{emitPath:this.emitPath},{multiple:this.multiple})}},created(){},mounted(){this.localVal=this.modelValue,this.initHandle()},methods:{initHandle(){if(this.localVal){var t=this.$refs[this.refID+"tree"].getNode(this.localVal);t&&(this.localTitle=t.data[this.dataField.label],this.$refs[this.refID+"tree"].setCurrentKey(this.localVal),this.defaultExpandedKey=[this.localVal])}else this.clearHandle();this.initScroll()},initScroll(){this.$nextTick(()=>{let t=document.querySelectorAll(".cv-select-tree .el-scrollbar .el-select-dropdown__wrap")[0],o=document.querySelectorAll(".cv-select-tree .el-scrollbar .el-scrollbar__bar");t.style.cssText="margin: 0px; max-height: none; overflow: hidden;",o.forEach(a=>a.style.width=0)})},handleNodeClick(t,o,a){t.disabled||(this.localTitle=t[this.dataField.label],this.localVal=t[this.dataField.value],this.defaultExpandedKey=[],this.$refs[this.refID].blur())},clearHandle(){this.localTitle="",this.localVal="",this.defaultExpandedKey=[],this.clearSelected()},clearSelected(){document.querySelectorAll(`#${this.refID}tree .el-tree-node`).forEach(t=>t.classList.remove("is-current"))},handleChange(){this.$emit("change",this.localVal),this.$emit("update:modelValue",this.localVal)},_parseLocalOpt(){let t=this.dataLists;this.dataField&&this.dataField.label;let o=this.dataField&&this.dataField.value||"value",a=this.dataField&&this.dataField.children||"children",i=this.dataDisabled;(function l(n){for(let r in n)i.map(c=>{n[r][o]==c[o]&&(n[r].disabled=!0)}),n[r][a]&&l(n[r][a])})(t),this.localOpt=t}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-tree"),c=e.resolveComponent("el-option"),p=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(p,e.mergeProps(t.$props,{ref:a.refID,"popper-class":"cv-select-tree",modelValue:l.localTitle,onClear:n.clearHandle}),{default:e.withCtx(()=>[e.createVNode(c,{value:l.localTitle,label:l.localTitle,class:"options"},{default:e.withCtx(()=>[e.createVNode(r,{"highlight-current":"",id:a.refID+"tree",ref:a.refID+"tree",accordion:a.accordion,showCheckbox:a.showCheckbox,data:l.localOpt,props:a.dataField,"node-key":a.dataField.value,onNodeClick:n.handleNodeClick,"default-expand-all":a.defaultExpandAll},null,8,["id","accordion","showCheckbox","data","props","node-key","onNodeClick","default-expand-all"])]),_:1},8,["value","label"])]),_:1},16,["modelValue","onClear"])}]]);Qe.install=function(t){t.component(Qe.name,Qe)},Je.install=function(t){t.component(Je.name,Je)},et.install=function(t){t.component(et.name,et)};const ri={name:"cvCascaderBase",components:{},props:{...k.ElCascader.props,modelValue:{type:[String,Array,Number],default(){}},dataLists:{type:[Array],default:()=>[]},dataDisabled:{type:[Array],default:()=>[]},disabled:{type:Boolean,default:!1},placeholder:{type:[String,Number],default:"请选择"},showAllLevels:{type:Boolean,default:!0},filterable:{type:Boolean,default:!0},dataField:{type:[Object],default:()=>({})},emitPath:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1}},watch:{modelValue(){this.localVal=this.modelValue},dataLists:{handler(){this._parseLocalOpt()},immediate:!0,deep:!0},localVal(){this.handleChange(),this.handleInput()}},data(){return{localVal:this.modelValue,localOpt:[]}},computed:{props2(){return Object.assign(this.dataField,{emitPath:this.emitPath},{multiple:this.multiple})}},created(){},methods:{handleChange(){this.$emit("change",this.localVal)},handleInput(){this.$emit("update:modelValue",this.localVal)},_parseLocalOpt(){let t=this.dataLists,o=this.dataField&&this.dataField.value||"value",a=this.dataDisabled;(function i(l){for(let n in l)a.map(r=>{l[n][o]==r[o]&&(l[n].disabled=!0)}),l[n].children&&i(l[n].children)})(t),this.localOpt=t},getCheckedNodes(){}}},si={class:"cv-cascader-base block"},tt=v(ri,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-cascader");return e.openBlock(),e.createElementBlock("div",si,[e.createVNode(r,e.mergeProps(t.$props,{props:n.props2,modelValue:l.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>l.localVal=c),options:l.localOpt,onChange:n.handleChange,onGetCheckedNodes:n.getCheckedNodes}),null,16,["props","modelValue","options","onChange","onGetCheckedNodes"])])}]]);tt.install=function(t){t.component(tt.name,tt)};const Fl={props:{...k.ElTimePicker.props,modelValue:{type:[String,Array,Number,Object,Date],default:null}},watch:{modelValue:{handler(){if(this.valueFormat!="timestamp")this.localVal=this.modelValue;else if(Array.isArray(this.modelValue)){var t;if(t=this.modelValue.map(o=>{if(!isNaN(o)&&o.toString().length==10)return 1e3*o}),this.localVal&&this.localVal[0]==t[0]&&this.localVal[1]==t[1])return;this.localVal=t}else this.modelValue&&this.modelValue.toString().length==10&&this.localVal!=1e3*this.modelValue&&(this.localVal=1e3*this.modelValue)},immediate:!0,deep:!0},localVal(){var t;if(this.valueFormat!="timestamp")this.$emit("update:modelValue",this.localVal);else if(Array.isArray(this.localVal)){if(t=this.localVal.map(o=>{if(!isNaN(o)&&o.toString().length==13)return parseInt(o/1e3)}),this.modelValue&&t[0]==this.modelValue[0]&&t[1]==this.modelValue[1])return;this.$emit("update:modelValue",t)}else isNaN(this.localVal)||this.localVal.toString().length!=13||(t=parseInt(this.localVal/1e3),this.modelValue!=t&&this.$emit("update:modelValue",t))}},data:()=>({localVal:""}),created(){},methods:{}},ot=v({name:"cvTimeBase",mixins:[Fl],props:{format:{type:String,default:"HH:mm:ss"},valueFormat:{type:String,default:"HH:mm:ss"},placeholder:{type:[String,Number],default:"选择时间"}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-time-picker");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-timePicker-base"},t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),format:a.format,"picker-options":{}}),null,16,["modelValue","format"])}]]),at=v({name:"cvTimeRange",mixins:[Fl],props:{format:{type:String,default:"HH:mm:ss"},valueFormat:{type:String,default:"HH:mm:ss"},startPlaceholder:{type:[String,Number],default:"开始时间"},rangeSeparator:{type:[String,Number],default:"至"},endPlaceholder:{type:[String,Number],default:"结束时间"}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-time-picker");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-timePicker-range"},t.$props,{"is-range":"",modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),format:a.format,"range-separator":a.rangeSeparator,"start-placeholder":a.startPlaceholder,"end-placeholder":a.endPlaceholder}),null,16,["modelValue","format","range-separator","start-placeholder","end-placeholder"])}]]),lt=v({name:"cvTimeSelect"},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-time-select");return e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-time-select"},t.$props),null,16)}]]),ao={props:{...k.ElDatePicker.props,modelValue:{type:[String,Array,Number,Object,Date],default:null},pickerOptions:{type:Boolean,default:!1}},watch:{modelValue:{handler(){if(this.valueFormat!="timestamp")this.localVal=this.modelValue;else if(Array.isArray(this.modelValue)){var t;if(t=this.modelValue.map(o=>{if(!isNaN(o)&&o.toString().length==10)return 1e3*o}),this.localVal&&this.localVal[0]==t[0]&&this.localVal[1]==t[1])return;this.localVal=t}else this.modelValue&&this.modelValue.toString().length==10&&this.localVal!=1e3*this.modelValue&&(this.localVal=1e3*this.modelValue)},immediate:!0,deep:!0},localVal(){var t;if(this.valueFormat!="timestamp")this.$emit("update:modelValue",this.localVal);else if(Array.isArray(this.localVal)){if(t=this.localVal.map(o=>{if(!isNaN(o)&&o.toString().length==13)return parseInt(o/1e3)}),this.modelValue&&t[0]==this.modelValue[0]&&t[1]==this.modelValue[1])return;this.$emit("update:modelValue",t)}else isNaN(this.localVal)||this.localVal.toString().length!=13||(t=parseInt(this.localVal/1e3),this.modelValue!=t&&this.$emit("update:modelValue",t))}},data:()=>({localVal:""})},nt=v({name:"cvDateBase",mixins:[ao],props:{format:{type:String,default:"YYYY-MM-DD"},valueFormat:{type:String,default:"YYYY-MM-DD"},placeholder:{type:[String,Number],default:"选择日期"}},data:()=>({localPickerOptions:{disabledDate:t=>t.getTime()>Date.now(),shortcuts:[{text:"今天",onClick(t){t.$emit("pick",new Date)}},{text:"昨天",onClick(t){const o=new Date;o.setTime(o.getTime()-864e5),t.$emit("pick",o)}},{text:"一周前",onClick(t){const o=new Date;o.setTime(o.getTime()-6048e5),t.$emit("pick",o)}},{text:"一个月前",onClick(t){const o=new Date;o.setTime(o.getTime()-2592e6),t.$emit("pick",o)}},{text:"三个月前",onClick(t){const o=new Date;o.setTime(o.getTime()-7776e6),t.$emit("pick",o)}},{text:"六个月前",onClick(t){const o=new Date;o.setTime(o.getTime()-15552e6),t.$emit("pick",o)}},{text:"一年前",onClick(t){const o=new Date;o.setTime(o.getTime()-31536e6),t.$emit("pick",o)}}]}})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-date-picker");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),type:"date","value-format":a.valueFormat,placeholder:a.placeholder,"picker-options":t.pickerOptions&&l.localPickerOptions}),null,16,["modelValue","value-format","placeholder","picker-options"])}]]),it=v({name:"cvDateRange",mixins:[ao],props:{valueFormat:{type:String,default:"yyyy-MM-dd"},startPlaceholder:{type:[String,Number],default:"开始日期"},rangeSeparator:{type:[String,Number],default:"至"},endPlaceholder:{type:[String,Number],default:"结束日期"}},data:()=>({localPickerOptions:{shortcuts:[{text:"今天",onClick(t){const o=new Date,a=new Date;t.$emit("pick",[a,o])}},{text:"昨天",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-864e5),o.setTime(o.getTime()-864e5),t.$emit("pick",[a,o])}},{text:"最近一周",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-6048e5),t.$emit("pick",[a,o])}},{text:"最近一个月",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-2592e6),t.$emit("pick",[a,o])}},{text:"最近三个月",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-7776e6),t.$emit("pick",[a,o])}},{text:"最近六个月",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-15552e6),t.$emit("pick",[a,o])}},{text:"最近一年",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-31536e6),t.$emit("pick",[a,o])}}]}})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-date-picker");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),type:"daterange","value-format":a.valueFormat,"range-separator":a.rangeSeparator,"start-placeholder":a.startPlaceholder,"end-placeholder":a.endPlaceholder,"picker-options":t.pickerOptions&&l.localPickerOptions}),null,16,["modelValue","value-format","range-separator","start-placeholder","end-placeholder","picker-options"])}]]),rt=v({name:"cvDatetimeBase",mixins:[ao],props:{format:{type:String,default:"YYYY-MM-DD HH:mm:ss"},valueFormat:{type:String,default:"YYYY-MM-DD HH:mm:ss"},placeholder:{type:[String,Number],default:"选择日期时间"}},data:()=>({localPickerOptions:{disabledDate:t=>t.getTime()>Date.now(),shortcuts:[{text:"今天",onClick(t){t.$emit("pick",new Date)}},{text:"昨天",onClick(t){const o=new Date;o.setTime(o.getTime()-864e5),t.$emit("pick",o)}},{text:"一周前",onClick(t){const o=new Date;o.setTime(o.getTime()-6048e5),t.$emit("pick",o)}},{text:"一个月前",onClick(t){const o=new Date;o.setTime(o.getTime()-2592e6),t.$emit("pick",o)}},{text:"三个月前",onClick(t){const o=new Date;o.setTime(o.getTime()-7776e6),t.$emit("pick",o)}},{text:"六个月前",onClick(t){const o=new Date;o.setTime(o.getTime()-15552e6),t.$emit("pick",o)}},{text:"一年前",onClick(t){const o=new Date;o.setTime(o.getTime()-31536e6),t.$emit("pick",o)}}]}})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-date-picker");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),type:"datetime","value-format":a.valueFormat,placeholder:a.placeholder,"picker-options":t.pickerOptions&&l.localPickerOptions}),null,16,["modelValue","value-format","placeholder","picker-options"])}]]),st=v({name:"cvDatetimeRange",mixins:[ao],props:{valueFormat:{type:String,default:"YYYY-MM-DD HH:mm:ss"},startPlaceholder:{type:[String,Number],default:"开始日期"},rangeSeparator:{type:[String,Number],default:"至"},endPlaceholder:{type:[String,Number],default:"结束日期"}},data:()=>({localPickerOptions:{shortcuts:[{text:"今天",onClick(t){const o=new Date,a=new Date;t.$emit("pick",[a,o])}},{text:"昨天",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-864e5),o.setTime(o.getTime()-864e5),t.$emit("pick",[a,o])}},{text:"最近一周",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-6048e5),t.$emit("pick",[a,o])}},{text:"最近一个月",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-2592e6),t.$emit("pick",[a,o])}},{text:"最近三个月",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-7776e6),t.$emit("pick",[a,o])}},{text:"最近六个月",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-15552e6),t.$emit("pick",[a,o])}},{text:"最近一年",onClick(t){const o=new Date,a=new Date;a.setTime(a.getTime()-31536e6),t.$emit("pick",[a,o])}}]}})},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-date-picker");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{modelValue:t.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>t.localVal=c),type:"datetimerange","value-format":a.valueFormat,"range-separator":a.rangeSeparator,"start-placeholder":a.startPlaceholder,"end-placeholder":a.endPlaceholder,align:"right","picker-options":t.pickerOptions&&l.localPickerOptions}),null,16,["modelValue","value-format","range-separator","start-placeholder","end-placeholder","picker-options"])}]]),ct=v({name:"cvDatetimeScreen",props:{start:{type:String,default:null},end:{type:String,default:null},autoUpdate:{type:Boolean,default:!0}},emits:["update:start","update:end","change"],data(){return{defaultTime:[new Date(2e3,0,1,0,0,0),new Date(2e3,0,1,23,59,59)],internalValue:[this.start||"",this.end||""]}},watch:{start(t){t!==null&&t!==""||this.end!==null&&this.end!==""?this.internalValue[0]=t:this.internalValue=[null,null]},end(t){this.start!==null&&this.start!==""||t!==null&&t!==""?this.internalValue[1]=t:this.internalValue=[null,null]}},computed:{dateUtil:()=>({getStartOfDay(t=new Date){const o=new Date(t);return o.setHours(0,0,0,0),o},getEndOfDay(t=new Date){const o=new Date(t);return o.setHours(23,59,59,999),o},getYesterday(){const t=new Date;return t.setDate(t.getDate()-1),t},getDaysAgo(t){const o=new Date;return o.setDate(o.getDate()-(t-1)),o},getFirstDayOfMonth(){const t=new Date;return t.setDate(1),t},getFirstDayOfYear(){const t=new Date;return t.setMonth(0,1),t}}),refinedShortcuts(){return[{text:"本日",value:()=>[this.dateUtil.getStartOfDay(),this.dateUtil.getEndOfDay()]},{text:"昨天",value:()=>{const t=this.dateUtil.getYesterday();return[this.dateUtil.getStartOfDay(t),this.dateUtil.getEndOfDay(t)]}},{text:"最近7天",value:()=>[this.dateUtil.getStartOfDay(this.dateUtil.getDaysAgo(7)),this.dateUtil.getEndOfDay()]},{text:"最近30天",value:()=>[this.dateUtil.getStartOfDay(this.dateUtil.getDaysAgo(30)),this.dateUtil.getEndOfDay()]},{text:"本月",value:()=>[this.dateUtil.getStartOfDay(this.dateUtil.getFirstDayOfMonth()),this.dateUtil.getEndOfDay()]},{text:"本年",value:()=>[this.dateUtil.getStartOfDay(this.dateUtil.getFirstDayOfYear()),this.dateUtil.getEndOfDay()]},{text:"全部",value:()=>[null,null]}]}},methods:{syncInternalValue(){this.start!==null&&this.start!==""||this.end!==null&&this.end!==""?this.internalValue=[this.start,this.end]:this.internalValue=[null,null]},handleDateChange(t){t?(this.$emit("update:start",t[0]),this.$emit("update:end",t[1])):(this.$emit("update:start",null),this.$emit("update:end",null)),this.$emit("change",t)},handleCalendarChange(t){}},created(){this.syncInternalValue()}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-date-picker");return e.openBlock(),e.createBlock(r,{modelValue:l.internalValue,"onUpdate:modelValue":o[0]||(o[0]=c=>l.internalValue=c),type:"datetimerange",shortcuts:n.refinedShortcuts,"range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间","value-format":"YYYY-MM-DD HH:mm:ss","default-time":l.defaultTime,onChange:n.handleDateChange,onCalendarChange:n.handleCalendarChange,clearable:"",class:"screen-date-picker"},null,8,["modelValue","shortcuts","default-time","onChange","onCalendarChange"])}]]);ot.install=function(t){t.component(ot.name,ot)},at.install=function(t){t.component(at.name,at)},lt.install=function(t){t.component(lt.name,lt)},nt.install=function(t){t.component(nt.name,nt)},it.install=function(t){t.component(it.name,it)},rt.install=function(t){t.component(rt.name,rt)},st.install=function(t){t.component(st.name,st)},ct.install=function(t){t.component(ct.name,ct)};const dt=v({name:"cvSwitchBase",props:{...k.ElSwitch.props,activeColor:{type:[String],default:""},inactiveColor:{type:[String],default:""},disabled:{type:Boolean,default:!1}},watch:{modelValue(){this.localVal=this.modelValue},localVal(){this.$emit("update:modelValue",this.localVal)}},data(){return{localVal:this.modelValue}},created(){this.localVal=this.modelValue},methods:{}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-switch");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{modelValue:l.localVal,"onUpdate:modelValue":o[0]||(o[0]=c=>l.localVal=c)}),null,16,["modelValue"])}]]);dt.install=function(t){t.component(dt.name,dt)};const pt=v({name:"cvCodeSms",mixins:[],components:{},props:{...k.ElInput.props,maxlength:{type:[Number,String],default:6},modelValue:{type:[Number,String],default:""},placeholder:{type:[Number,String],default:"请输入验证码"},disabled:{type:Boolean,default:!1},mobile:{type:[Number,String],default:""},mobileParam:{type:String,default:"mobile"},codeUrl:{type:String,default:""},codeSign:{type:Boolean,default:!1},apiFunc:{type:Function,default:null},waitTime:{type:[Number,String],default:60}},watch:{mobile(t){this.localMobile=t},modelValue(t){this.localVal=t}},data(){return{localVal:this.modelValue,localMobile:"",nextTime:0,diyPlaceholder:"短信验证码",btnDisabled:!1,btnText:"获取验证码",btnIntervalObj:null}},created(){this.localMobile=this.mobile},methods:{showDiyMsg(t){this.$message(t)},getSmsCode(){if(!this.localMobile)return this.showDiyMsg("手机号不正确"),void this.$emit("onGetSms",!1);if(!/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.localMobile))return this.showDiyMsg("手机号格式不正确"),void this.$emit("onGetSms",!1);this.codeUrl||this.apiFunc?(this.btnDisabled=!0,this.btnIntervalObj||this.btnDisabled&&(this.btnText="请稍后...",this.apiFunc?this.apiFunc({postType:"sendSms",cto_sms_type:"alterMobile",sendCode:"发送验证码",[this.mobileParam]:this.localMobile}).then(t=>{let o=t;o.status==200?(this.showDiyMsg("发送成功!"),setTimeout(()=>{if(this.codeSign){let a=o.data&&o.data.sign||"";this.diyPlaceholder="识别码:"+a}this.smsCodeWaitTime()},500)):(this.showDiyMsg("短信获取失败,请检查网络"),this.btnDisabled=!1,this.btnText="获取验证码")}).catch(t=>{this.btnDisabled=!1,this.btnText="获取验证码"}):(this.btnDisabled=!1,this.btnText="重新获取验证码"))):this.showDiyMsg("短信接口地址不能为空")},smsCodeWaitTime(){this.nextTime=Date.parse(new Date)/1e3+parseInt(this.waitTime),this.btnIntervalObj=setInterval(()=>{let t=this.nextTime-Date.parse(new Date)/1e3;t<=0?(clearInterval(this.btnIntervalObj),this.btnText="重新获取验证码",this.btnIntervalObj=0,this.btnDisabled=!1):(this.btnDisabled=!0,this.btnText=t.toString()+"s")},100)},updateInput(t){this.$emit("update:modelValue",this.localVal)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button"),c=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(c,e.mergeProps(t.$props,{modelValue:l.localVal,"onUpdate:modelValue":o[0]||(o[0]=p=>l.localVal=p),clearable:"",placeholder:l.diyPlaceholder,onInput:n.updateInput}),{append:e.withCtx(()=>[e.createVNode(r,{onClick:n.getSmsCode,disabled:l.btnDisabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.btnText),1)]),_:1},8,["onClick","disabled"])]),_:1},16,["modelValue","placeholder","onInput"])}]]);pt.install=function(t){t.component(pt.name,pt)};const ci={props:{fileType:{type:[Array],default:[]},fileSize:{type:[Number],default:2},fileUnit:{type:[String],default:""},multiple:{type:[Boolean],default:!1},limit:{type:[Number],default:5}}},di={class:"cv-upload-tip-box"},pi={key:0},hi={key:1},lo={inheritAttrs:!1,emits:["update:modelValue","update:initValue","delete","error","success"],components:{uploadTip:v(ci,[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",di,[o[0]||(o[0]=e.createElementVNode("span",null,"最多上传",-1)),e.createElementVNode("b",null,e.toDisplayString(a.limit),1),e.createElementVNode("span",null,e.toDisplayString(a.fileUnit),1),a.fileType.length?(e.openBlock(),e.createElementBlock("b",pi,e.toDisplayString(a.fileType.length?a.fileType.join("/"):""),1)):e.createCommentVNode("",!0),a.fileType.length?(e.openBlock(),e.createElementBlock("span",hi,"格式")):e.createCommentVNode("",!0),e.createElementVNode("span",null,"文件;且每"+e.toDisplayString(a.fileUnit)+"不超过",1),e.createElementVNode("b",null,e.toDisplayString(a.fileSize)+"MB",1)])}]])},mixins:[Ll],props:{multiple:{type:[Boolean],default:!1},limit:{type:[Number,String],default:1},drag:{type:Boolean,default:!1},httpRequest:{type:[Function],default:()=>{}},accept:String,beforeRemove:Function,upResponseFn:{type:[Function],default:null},signatureFn:{type:Function,default:null},signatureType:{type:[String],default:"aliyun_oss_type2"},signatureParam:{type:[Object],default:()=>({})}},data:()=>({cropShow:!1,upIngPercent:0,upIngLoading:!1,upIngFileInfo:{}}),computed:{fileTypeStr(){return this.fileType.join(",")},tipAttr(){return{fileType:this.fileType||[],fileSize:this.fileSize||"",multiple:this?.multiple||!1,limit:this.limit?parseInt(this.limit):5}},mergeAttrs(){let t=this._mergeAttrs("upload");return this.$props.signatureType&&(t.signatureType=this.$props.signatureType),this.$props.signatureFn&&(t.signatureFn=this.$props.signatureFn),this.$props.signatureParam&&(t.signatureParam=this.$props.signatureParam),typeof t.upResponseFn!="function"&&(t.upResponseFn=null),Object.assign({},t,this.$attrs)}},methods:{_commonBeforeUpload(t){t.type;const o=t.name||"";t.size;const a=o.split(".").pop().toLowerCase(),i=this.fileType.join("、");return this.fileType.includes(a)?!(t>this.fileSize)||(ExtendMessage.error(`文件大小不能超过 ${this.fileSize} MB`),!1):(ExtendMessage.error(`文件格式错误,请上传类型 如:${i}格式文件`),!1)},_commonRemove(){return new Promise((t,o)=>{this.$confirm("提示",{title:"确定删除??",showCancelButton:!0,confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{t(!0)}).catch(()=>{o(!1)})})},initHttpRequest(){},initOnProgress(t){this.upIngPercent=Number(t.percentage.toFixed(0))},initOnSuccess(t,o){},initOnExceed(){this.$message.error(`最多上传${this.limit}个文件`)}}};function Xo(t){let o=[],a=Object.prototype.toString.call(t);if(a==="[object String]")o.push(na(t));else if(a==="[object Object]")t.name&&t.url&&o.push(t);else if(a==="[object Array]")for(let i in t){let l=t[i],n=Object.prototype.toString.call(l);n==="[object String]"?o.push(na(l)):n==="[object Object]"&&l.name&&l.url&&o.push(l)}return o}function na(t){let o=t.lastIndexOf("/"),a=t.substring(o+1,t.length),i="";return a.lastIndexOf(".")>-1&&(i=a.slice(a.lastIndexOf(".")+1),i="image/"+i),{name:a,url:t,type:i,status:"success"}}function M(t){return Math.pow(1024,t)}function ia(t){return t?t<M(1)?t+" B":t<M(2)?(t/M(1)).toFixed(2)+" KB":t<M(3)?(t/M(2)).toFixed(2)+" MB":t<M(4)?(t/M(3)).toFixed(2)+" GB":(t/M(4)).toFixed(2)+" TB":"-"}function mi(t){if(!t)return!0;const o=t?.expiration_last;if(!o)return!0;const a=function(l){if(/^\d{8}T\d{6}Z$/.test(l)){const n=l.replace(/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/,"$1-$2-$3T$4:$5:$6Z");return new Date(n)}return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|([+-]\d{2}:\d{2}))?$/.test(l)?new Date(l):/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(l)?new Date(l.replace(" ","T")):new Date(l)}(o),i=new Date;return!!isNaN(a.getTime())||a.getTime()-i.getTime()<=6e4}async function ra(t,o){if(!t||typeof t!="function")return!1;let a=null;if(mi(a)){let i=await t({...o});if(!i||!i.data||i.status!=200)throw k.ElMessage.error("获取STS令牌失败"),new Error(`获取STS令牌失败 ${i?.message}`);a=i.data||{}}return{...a,pass:!!a}}async function sa(t,o,a,i){t=t||"aliyun_oss_type2",i=i||{};const l=await ra(o,{upload_type:t,...a});if(!l.pass)return k.ElMessage.error("获取oss上传凭证异常");if(t=="oss_upload1"){const n={bucket:l.bucket,region:l.endpoint.split(".")[0],accessKeyId:l.accessKeyId,accessKeySecret:l.accessKeySecret,stsToken:l.securityToken,expiration:l.expiration,...i,refreshSTSToken:async()=>{const r=await ra(o);return{accessKeyId:r.accessKeyId,accessKeySecret:r.accessKeySecret,stsToken:r.securityToken}},refreshSTSTokenInterval:new Date(l.expiration)-new Date-6e4};return new OSS(n)}if(t=="aliyun_oss_type2")return l;throw new Error("上传类型错误")}async function $l(t,o,a){let i=new FormData;i.append("success_action_status",o.success_action_status||"200"),i.append("policy",o.policy),i.append("signature",o.signature),i.append("x-oss-signature",o.signature),i.append("x-oss-signature-version","OSS4-HMAC-SHA256"),i.append("x-oss-credential",o.x_oss_credential),i.append("x-oss-date",o.x_oss_date),i.append("x-oss-security-token",o.security_token);let l=o.key;if(o.key||(l=o.dir+"/"+t.name),i.append("key",l),o.callback&&i.append("callback",o.callback),o.callback_var&&to(o.callback_var))for(const n in o.callback_var)o.callback_var.hasOwnProperty(n)&&i.append(n,o.callback_var[n]);return i.append("file",t),fetch(o.host,{method:"POST",body:i,headers:{}}).then(n=>{if(n.ok)return n.json()}).then(n=>{if(n&&n.success)return n.data}).catch(n=>{})}async function Ko(t,o,a,i){if(!a||typeof a!="function")return k.ElMessage.error("签名方法错误"),Promise.reject();try{let l=function(){const p=new Date;return[p.getFullYear(),String(p.getMonth()+1).padStart(2,"0"),String(p.getDate()).padStart(2,"0"),String(p.getHours()).padStart(2,"0"),String(p.getMinutes()).padStart(2,"0"),String(p.getSeconds()).padStart(2,"0")].join("")+Math.random().toString(36).substring(2,10)}(),n=function(p){if(!p)return"jpg";const d=p.toLowerCase().trim();return Il.mimeToExtension[d]||"jpg"}(t.type),r=`${l}.${n}`;const c=await a({upload_type:o,...i,save_extension:n}).then(p=>p.data||{}).catch(p=>(k.ElMessage.error("签名失败"),Promise.reject()));if(!c)return Promise.reject();if(c.name&&(r=`${c.name}.${n}`),t instanceof Blob&&(t=new File([t],r,{type:t.type,lastModified:Date.now()})),t)return await $l(t,c)}catch{return Promise.reject()}}const Ol={};Ol.getData=t=>new Promise((o,a)=>{let i={};(function(l){let n=null;return new Promise((r,c)=>{if(l.src)if(/^data\:/i.test(l.src))n=function(h,u){u=u||h.match(/^data\:([^\;]+)\;base64,/im)[1]||"",h=h.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var m=atob(h),f=m.length%2==0?m.length:m.length+1,C=new ArrayBuffer(f),g=new Uint16Array(C),y=0;y<f;y++)g[y]=m.charCodeAt(y);return C}(l.src),r(n);else if(/^blob\:/i.test(l.src)){var p=new FileReader;p.onload=function(h){n=h.target.result,r(n)},function(h,u){var m=new XMLHttpRequest;m.open("GET",h,!0),m.responseType="blob",m.onload=function(f){(this.status==200||this.status===0)&&u(this.response)},m.send()}(l.src,function(h){p.readAsArrayBuffer(h)})}else{var d=new XMLHttpRequest;d.onload=function(){if(this.status!=200&&this.status!==0)throw"Could not load image";n=d.response,r(n),d=null},d.open("GET",l.src,!0),d.responseType="arraybuffer",d.send(null)}else c("img error")})})(t).then(l=>{i.arrayBuffer=l;try{i.orientation=function(n){var r,c,p,d,h,u,m,f,C,g,y=new DataView(n),b=y.byteLength;if(y.getUint8(0)===255&&y.getUint8(1)===216)for(C=2;C<b;){if(y.getUint8(C)===255&&y.getUint8(C+1)===225){m=C;break}C++}if(m&&(c=m+4,p=m+10,function(w,V,S){var B,_="";for(B=V,S+=V;B<S;B++)_+=String.fromCharCode(w.getUint8(B));return _}(y,c,4)==="Exif"&&(u=y.getUint16(p),((h=u===18761)||u===19789)&&y.getUint16(p+2,h)===42&&(d=y.getUint32(p+4,h),d>=8&&(f=p+d)))),f){for(b=y.getUint16(f,h),g=0;g<b;g++)if(C=f+12*g+2,y.getUint16(C,h)===274){C+=8,r=y.getUint16(C,h);break}}return r}(l)}catch{i.orientation=-1}o(i)}).catch(l=>{a(l)})});const ui=(t,o)=>{const a=t.__vccOpts||t;for(const[i,l]of o)a[i]=l;return a},gi=e.defineComponent({data:function(){return{w:0,h:0,scale:1,x:0,y:0,loading:!0,trueWidth:0,trueHeight:0,move:!0,moveX:0,moveY:0,crop:!1,cropping:!1,cropW:0,cropH:0,cropOldW:0,cropOldH:0,canChangeX:!1,canChangeY:!1,changeCropTypeX:1,changeCropTypeY:1,cropX:0,cropY:0,cropChangeX:0,cropChangeY:0,cropOffsertX:0,cropOffsertY:0,support:"",touches:[],touchNow:!1,rotate:0,isIos:!1,orientation:0,imgs:"",coe:.2,scaling:!1,scalingSet:"",coeStatus:"",isCanShow:!0,imgIsQqualCrop:!1}},props:{img:{type:[String,Blob,null,File],default:""},outputSize:{type:Number,default:1},outputType:{type:String,default:"jpeg"},info:{type:Boolean,default:!0},canScale:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!1},autoCropWidth:{type:[Number,String],default:0},autoCropHeight:{type:[Number,String],default:0},fixed:{type:Boolean,default:!1},fixedNumber:{type:Array,default:()=>[1,1]},fixedBox:{type:Boolean,default:!1},full:{type:Boolean,default:!1},canMove:{type:Boolean,default:!0},canMoveBox:{type:Boolean,default:!0},original:{type:Boolean,default:!1},centerBox:{type:Boolean,default:!1},high:{type:Boolean,default:!0},infoTrue:{type:Boolean,default:!1},maxImgSize:{type:[Number,String],default:2e3},enlarge:{type:[Number,String],default:1},preW:{type:[Number,String],default:0},mode:{type:String,default:"contain"},limitMinSize:{type:[Number,Array,String],default:()=>10,validator:function(t){return Array.isArray(t)?Number(t[0])>=0&&Number(t[1])>=0:Number(t)>=0}},fillColor:{type:String,default:""}},computed:{cropInfo(){let t={};if(t.top=this.cropOffsertY>21?"-21px":"0px",t.width=this.cropW>0?this.cropW:0,t.height=this.cropH>0?this.cropH:0,this.infoTrue){let o=1;this.high&&!this.full&&(o=window.devicePixelRatio),this.enlarge!==1&!this.full&&(o=Math.abs(Number(this.enlarge))),t.width=t.width*o,t.height=t.height*o,this.full&&(t.width=t.width/this.scale,t.height=t.height/this.scale)}return t.width=t.width.toFixed(0),t.height=t.height.toFixed(0),t},isIE:()=>!!window.ActiveXObject||"ActiveXObject"in window,passive(){return this.isIE?null:{passive:!1}},isRotateRightOrLeft(){return[1,-1,3,-3].includes(this.rotate)}},watch:{img(){this.checkedImg()},imgs(t){t!==""&&this.reload()},cropW(){this.showPreview()},cropH(){this.showPreview()},cropOffsertX(){this.showPreview()},cropOffsertY(){this.showPreview()},scale(t,o){this.showPreview()},x(){this.showPreview()},y(){this.showPreview()},autoCrop(t){t&&this.goAutoCrop()},autoCropWidth(){this.autoCrop&&this.goAutoCrop()},autoCropHeight(){this.autoCrop&&this.goAutoCrop()},mode(){this.checkedImg()},rotate(){this.showPreview(),(this.autoCrop||this.cropW>0||this.cropH>0)&&this.goAutoCrop(this.cropW,this.cropH)}},methods:{getVersion(t){var o=navigator.userAgent.split(" "),a="";let i=0;const l=new RegExp(t,"i");for(var n=0;n<o.length;n++)l.test(o[n])&&(a=o[n]);return i=a?a.split("/")[1].split("."):["0","0","0"],i},checkOrientationImage(t,o,a,i){if(this.getVersion("chrome")[0]>=81)o=-1;else if(this.getVersion("safari")[0]>=605){const r=this.getVersion("version");r[0]>13&&r[1]>1&&(o=-1)}else{const r=navigator.userAgent.toLowerCase().match(/cpu iphone os (.*?) like mac os/);if(r){let c=r[1];c=c.split("_"),(c[0]>13||c[0]>=13&&c[1]>=4)&&(o=-1)}}let l=document.createElement("canvas"),n=l.getContext("2d");switch(n.save(),o){case 2:l.width=a,l.height=i,n.translate(a,0),n.scale(-1,1);break;case 3:l.width=a,l.height=i,n.translate(a/2,i/2),n.rotate(180*Math.PI/180),n.translate(-a/2,-i/2);break;case 4:l.width=a,l.height=i,n.translate(0,i),n.scale(1,-1);break;case 5:l.height=a,l.width=i,n.rotate(.5*Math.PI),n.scale(1,-1);break;case 6:l.width=i,l.height=a,n.translate(i/2,a/2),n.rotate(90*Math.PI/180),n.translate(-a/2,-i/2);break;case 7:l.height=a,l.width=i,n.rotate(.5*Math.PI),n.translate(a,-i),n.scale(-1,1);break;case 8:l.height=a,l.width=i,n.translate(i/2,a/2),n.rotate(-90*Math.PI/180),n.translate(-a/2,-i/2);break;default:l.width=a,l.height=i}n.drawImage(t,0,0,a,i),n.restore(),l.toBlob(r=>{let c=URL.createObjectURL(r);URL.revokeObjectURL(this.imgs),this.imgs=c},"image/"+this.outputType,1)},checkedImg(){if(this.img===null||this.img==="")return this.imgs="",void this.clearCrop();this.loading=!0,this.scale=1,this.rotate=0,this.imgIsQqualCrop=!1,this.clearCrop();let t=new Image;if(t.onload=()=>{if(this.img==="")return this.$emit("img-load",new Error("图片不能为空")),!1;let a=t.width,i=t.height;Ol.getData(t).then(l=>{this.orientation=l.orientation||1;let n=Number(this.maxImgSize);!this.orientation&&a<n&i<n?this.imgs=this.img:(a>n&&(i=i/a*n,a=n),i>n&&(a=a/i*n,i=n),this.checkOrientationImage(t,this.orientation,a,i))}).catch(l=>{this.$emit("img-load","error"),this.$emit("img-load-error",l)})},t.onerror=a=>{this.$emit("img-load","error"),this.$emit("img-load-error",a)},this.img.substr(0,4)!=="data"&&(t.crossOrigin=""),this.isIE){var o=new XMLHttpRequest;o.onload=function(){var a=URL.createObjectURL(this.response);t.src=a},o.open("GET",this.img,!0),o.responseType="blob",o.send()}else t.src=this.img},startMove(t){if(t.preventDefault(),this.move&&!this.crop){if(!this.canMove)return!1;this.moveX=("clientX"in t?t.clientX:t.touches[0].clientX)-this.x,this.moveY=("clientY"in t?t.clientY:t.touches[0].clientY)-this.y,t.touches?(window.addEventListener("touchmove",this.moveImg),window.addEventListener("touchend",this.leaveImg),t.touches.length==2&&(this.touches=t.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale))):(window.addEventListener("mousemove",this.moveImg),window.addEventListener("mouseup",this.leaveImg)),this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})}else this.cropping=!0,window.addEventListener("mousemove",this.createCrop),window.addEventListener("mouseup",this.endCrop),window.addEventListener("touchmove",this.createCrop),window.addEventListener("touchend",this.endCrop),this.cropOffsertX=t.offsetX?t.offsetX:t.touches[0].pageX-this.$refs.cropper.offsetLeft,this.cropOffsertY=t.offsetY?t.offsetY:t.touches[0].pageY-this.$refs.cropper.offsetTop,this.cropX="clientX"in t?t.clientX:t.touches[0].clientX,this.cropY="clientY"in t?t.clientY:t.touches[0].clientY,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.cropW=0,this.cropH=0},touchScale(t){t.preventDefault();let o=this.scale;var a=this.touches[0].clientX,i=this.touches[0].clientY,l=t.touches[0].clientX,n=t.touches[0].clientY,r=this.touches[1].clientX,c=this.touches[1].clientY,p=t.touches[1].clientX,d=t.touches[1].clientY,h=Math.sqrt(Math.pow(a-r,2)+Math.pow(i-c,2)),u=Math.sqrt(Math.pow(l-p,2)+Math.pow(n-d,2))-h,m=1,f=(m=(m=m/this.trueWidth>m/this.trueHeight?m/this.trueHeight:m/this.trueWidth)>.1?.1:m)*u;if(!this.touchNow){if(this.touchNow=!0,u>0?o+=Math.abs(f):u<0&&o>Math.abs(f)&&(o-=Math.abs(f)),this.touches=t.touches,setTimeout(()=>{this.touchNow=!1},8),!this.checkoutImgAxis(this.x,this.y,o))return!1;this.scale=o}},cancelTouchScale(t){window.removeEventListener("touchmove",this.touchScale)},moveImg(t){if(t.preventDefault(),t.touches&&t.touches.length===2)return this.touches=t.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale),window.removeEventListener("touchmove",this.moveImg),!1;let o,a,i="clientX"in t?t.clientX:t.touches[0].clientX,l="clientY"in t?t.clientY:t.touches[0].clientY;o=i-this.moveX,a=l-this.moveY,this.$nextTick(()=>{if(this.centerBox){let n,r,c,p,d=this.getImgAxis(o,a,this.scale),h=this.getCropAxis(),u=this.trueHeight*this.scale,m=this.trueWidth*this.scale;switch(this.rotate){case 1:case-1:case 3:case-3:n=this.cropOffsertX-this.trueWidth*(1-this.scale)/2+(u-m)/2,r=this.cropOffsertY-this.trueHeight*(1-this.scale)/2+(m-u)/2,c=n-u+this.cropW,p=r-m+this.cropH;break;default:n=this.cropOffsertX-this.trueWidth*(1-this.scale)/2,r=this.cropOffsertY-this.trueHeight*(1-this.scale)/2,c=n-m+this.cropW,p=r-u+this.cropH}d.x1>=h.x1&&(o=n),d.y1>=h.y1&&(a=r),d.x2<=h.x2&&(o=c),d.y2<=h.y2&&(a=p)}this.x=o,this.y=a,this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})})},leaveImg(t){window.removeEventListener("mousemove",this.moveImg),window.removeEventListener("touchmove",this.moveImg),window.removeEventListener("mouseup",this.leaveImg),window.removeEventListener("touchend",this.leaveImg),this.$emit("img-moving",{moving:!1,axis:this.getImgAxis()})},scaleImg(){this.canScale&&window.addEventListener(this.support,this.changeSize,this.passive)},cancelScale(){this.canScale&&window.removeEventListener(this.support,this.changeSize)},changeSize(t){t.preventDefault();let o=this.scale;var a=t.deltaY||t.wheelDelta;a=navigator.userAgent.indexOf("Firefox")>0?30*a:a,this.isIE&&(a=-a);var i=this.coe,l=(i=i/this.trueWidth>i/this.trueHeight?i/this.trueHeight:i/this.trueWidth)*a;l<0?o+=Math.abs(l):o>Math.abs(l)&&(o-=Math.abs(l));let n=l<0?"add":"reduce";if(n!==this.coeStatus&&(this.coeStatus=n,this.coe=.2),this.scaling||(this.scalingSet=setTimeout(()=>{this.scaling=!1,this.coe=this.coe+=.01},50)),this.scaling=!0,!this.checkoutImgAxis(this.x,this.y,o))return!1;this.scale=o},changeScale(t){let o=this.scale;t=t||1;var a=20;if((t*=a=a/this.trueWidth>a/this.trueHeight?a/this.trueHeight:a/this.trueWidth)>0?o+=Math.abs(t):o>Math.abs(t)&&(o-=Math.abs(t)),!this.checkoutImgAxis(this.x,this.y,o))return!1;this.scale=o},createCrop(t){t.preventDefault();var o="clientX"in t?t.clientX:t.touches?t.touches[0].clientX:0,a="clientY"in t?t.clientY:t.touches?t.touches[0].clientY:0;this.$nextTick(()=>{var i=o-this.cropX,l=a-this.cropY;if(i>0?(this.cropW=i+this.cropChangeX>this.w?this.w-this.cropChangeX:i,this.cropOffsertX=this.cropChangeX):(this.cropW=this.w-this.cropChangeX+Math.abs(i)>this.w?this.cropChangeX:Math.abs(i),this.cropOffsertX=this.cropChangeX+i>0?this.cropChangeX+i:0),this.fixed){var n=this.cropW/this.fixedNumber[0]*this.fixedNumber[1];n+this.cropOffsertY>this.h?(this.cropH=this.h-this.cropOffsertY,this.cropW=this.cropH/this.fixedNumber[1]*this.fixedNumber[0],this.cropOffsertX=i>0?this.cropChangeX:this.cropChangeX-this.cropW):this.cropH=n,this.cropOffsertY=this.cropOffsertY}else l>0?(this.cropH=l+this.cropChangeY>this.h?this.h-this.cropChangeY:l,this.cropOffsertY=this.cropChangeY):(this.cropH=this.h-this.cropChangeY+Math.abs(l)>this.h?this.cropChangeY:Math.abs(l),this.cropOffsertY=this.cropChangeY+l>0?this.cropChangeY+l:0)})},changeCropSize(t,o,a,i,l){t.preventDefault(),window.addEventListener("mousemove",this.changeCropNow),window.addEventListener("mouseup",this.changeCropEnd),window.addEventListener("touchmove",this.changeCropNow),window.addEventListener("touchend",this.changeCropEnd),this.canChangeX=o,this.canChangeY=a,this.changeCropTypeX=i,this.changeCropTypeY=l,this.cropX="clientX"in t?t.clientX:t.touches[0].clientX,this.cropY="clientY"in t?t.clientY:t.touches[0].clientY,this.cropOldW=this.cropW,this.cropOldH=this.cropH,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.fixed&&this.canChangeX&&this.canChangeY&&(this.canChangeY=0),this.$emit("change-crop-size",{width:this.cropW,height:this.cropH})},changeCropNow(t){t.preventDefault();var o="clientX"in t?t.clientX:t.touches?t.touches[0].clientX:0,a="clientY"in t?t.clientY:t.touches?t.touches[0].clientY:0;let i=this.w,l=this.h,n=0,r=0;if(this.centerBox){let d=this.getImgAxis(),h=d.x2,u=d.y2;n=d.x1>0?d.x1:0,r=d.y1>0?d.y1:0,i>h&&(i=h),l>u&&(l=u)}const[c,p]=this.checkCropLimitSize();this.$nextTick(()=>{var d=o-this.cropX,h=a-this.cropY;if(this.canChangeX&&(this.changeCropTypeX===1?this.cropOldW-d<c?(this.cropW=c,this.cropOffsertX=this.cropOldW+this.cropChangeX-n-c):this.cropOldW-d>0?(this.cropW=i-this.cropChangeX-d<=i-n?this.cropOldW-d:this.cropOldW+this.cropChangeX-n,this.cropOffsertX=i-this.cropChangeX-d<=i-n?this.cropChangeX+d:n):(this.cropW=Math.abs(d)+this.cropChangeX<=i?Math.abs(d)-this.cropOldW:i-this.cropOldW-this.cropChangeX,this.cropOffsertX=this.cropChangeX+this.cropOldW):this.changeCropTypeX===2&&(this.cropOldW+d<c?this.cropW=c:this.cropOldW+d>0?(this.cropW=this.cropOldW+d+this.cropOffsertX<=i?this.cropOldW+d:i-this.cropOffsertX,this.cropOffsertX=this.cropChangeX):(this.cropW=i-this.cropChangeX+Math.abs(d+this.cropOldW)<=i-n?Math.abs(d+this.cropOldW):this.cropChangeX-n,this.cropOffsertX=i-this.cropChangeX+Math.abs(d+this.cropOldW)<=i-n?this.cropChangeX-Math.abs(d+this.cropOldW):n))),this.canChangeY&&(this.changeCropTypeY===1?this.cropOldH-h<p?(this.cropH=p,this.cropOffsertY=this.cropOldH+this.cropChangeY-r-p):this.cropOldH-h>0?(this.cropH=l-this.cropChangeY-h<=l-r?this.cropOldH-h:this.cropOldH+this.cropChangeY-r,this.cropOffsertY=l-this.cropChangeY-h<=l-r?this.cropChangeY+h:r):(this.cropH=Math.abs(h)+this.cropChangeY<=l?Math.abs(h)-this.cropOldH:l-this.cropOldH-this.cropChangeY,this.cropOffsertY=this.cropChangeY+this.cropOldH):this.changeCropTypeY===2&&(this.cropOldH+h<p?this.cropH=p:this.cropOldH+h>0?(this.cropH=this.cropOldH+h+this.cropOffsertY<=l?this.cropOldH+h:l-this.cropOffsertY,this.cropOffsertY=this.cropChangeY):(this.cropH=l-this.cropChangeY+Math.abs(h+this.cropOldH)<=l-r?Math.abs(h+this.cropOldH):this.cropChangeY-r,this.cropOffsertY=l-this.cropChangeY+Math.abs(h+this.cropOldH)<=l-r?this.cropChangeY-Math.abs(h+this.cropOldH):r))),this.canChangeX&&this.fixed){var u=this.cropW/this.fixedNumber[0]*this.fixedNumber[1];u<p?(this.cropH=p,this.cropW=this.fixedNumber[0]*p/this.fixedNumber[1],this.changeCropTypeX===1&&(this.cropOffsertX=this.cropChangeX+(this.cropOldW-this.cropW))):u+this.cropOffsertY>l?(this.cropH=l-this.cropOffsertY,this.cropW=this.cropH/this.fixedNumber[1]*this.fixedNumber[0],this.changeCropTypeX===1&&(this.cropOffsertX=this.cropChangeX+(this.cropOldW-this.cropW))):this.cropH=u}if(this.canChangeY&&this.fixed){var m=this.cropH/this.fixedNumber[1]*this.fixedNumber[0];m<c?(this.cropW=c,this.cropH=this.fixedNumber[1]*c/this.fixedNumber[0],this.cropOffsertY=this.cropOldH+this.cropChangeY-this.cropH):m+this.cropOffsertX>i?(this.cropW=i-this.cropOffsertX,this.cropH=this.cropW/this.fixedNumber[0]*this.fixedNumber[1]):this.cropW=m}})},checkCropLimitSize(){let{cropW:t,cropH:o,limitMinSize:a}=this,i=new Array;return i=Array.isArray(a)?a:[a,a],t=parseFloat(i[0]),o=parseFloat(i[1]),[t,o]},changeCropEnd(t){window.removeEventListener("mousemove",this.changeCropNow),window.removeEventListener("mouseup",this.changeCropEnd),window.removeEventListener("touchmove",this.changeCropNow),window.removeEventListener("touchend",this.changeCropEnd)},calculateSize(t,o,a,i,l,n){const r=t/o;let c=l,p=n;return c<a&&(c=a,p=Math.ceil(c/r)),p<i&&(p=i,c=Math.ceil(p*r),c<a&&(c=a,p=Math.ceil(c/r))),c<l&&(c=l,p=Math.ceil(c/r)),p<n&&(p=n,c=Math.ceil(p*r)),{width:c,height:p}},endCrop(){this.cropW===0&&this.cropH===0&&(this.cropping=!1);let[t,o]=this.checkCropLimitSize();const{width:a,height:i}=this.fixed?this.calculateSize(this.fixedNumber[0],this.fixedNumber[1],t,o,this.cropW,this.cropH):{width:t,height:o};a>this.cropW&&(this.cropW=a,this.cropOffsertX+a>this.w&&(this.cropOffsertX=this.w-a)),i>this.cropH&&(this.cropH=i,this.cropOffsertY+i>this.h&&(this.cropOffsertY=this.h-i)),window.removeEventListener("mousemove",this.createCrop),window.removeEventListener("mouseup",this.endCrop),window.removeEventListener("touchmove",this.createCrop),window.removeEventListener("touchend",this.endCrop)},startCrop(){this.crop=!0},stopCrop(){this.crop=!1},clearCrop(){this.cropping=!1,this.cropW=0,this.cropH=0},cropMove(t){if(t.preventDefault(),!this.canMoveBox)return this.crop=!1,this.startMove(t),!1;if(t.touches&&t.touches.length===2)return this.crop=!1,this.startMove(t),this.leaveCrop(),!1;window.addEventListener("mousemove",this.moveCrop),window.addEventListener("mouseup",this.leaveCrop),window.addEventListener("touchmove",this.moveCrop),window.addEventListener("touchend",this.leaveCrop);let o,a,i="clientX"in t?t.clientX:t.touches[0].clientX,l="clientY"in t?t.clientY:t.touches[0].clientY;o=i-this.cropOffsertX,a=l-this.cropOffsertY,this.cropX=o,this.cropY=a,this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})},moveCrop(t,o){let a=0,i=0;t&&(t.preventDefault(),a="clientX"in t?t.clientX:t.touches[0].clientX,i="clientY"in t?t.clientY:t.touches[0].clientY),this.$nextTick(()=>{let l,n,r=a-this.cropX,c=i-this.cropY;if(o&&(r=this.cropOffsertX,c=this.cropOffsertY),l=r<=0?0:r+this.cropW>this.w?this.w-this.cropW:r,n=c<=0?0:c+this.cropH>this.h?this.h-this.cropH:c,this.centerBox){let p=this.getImgAxis();l<=p.x1&&(l=p.x1),l+this.cropW>p.x2&&(l=p.x2-this.cropW),n<=p.y1&&(n=p.y1),n+this.cropH>p.y2&&(n=p.y2-this.cropH)}this.cropOffsertX=l,this.cropOffsertY=n,this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})})},getImgAxis(t,o,a){t=t||this.x,o=o||this.y,a=a||this.scale;let i={x1:0,x2:0,y1:0,y2:0},l=this.trueWidth*a,n=this.trueHeight*a;switch(this.rotate){case 0:i.x1=t+this.trueWidth*(1-a)/2,i.x2=i.x1+this.trueWidth*a,i.y1=o+this.trueHeight*(1-a)/2,i.y2=i.y1+this.trueHeight*a;break;case 1:case-1:case 3:case-3:i.x1=t+this.trueWidth*(1-a)/2+(l-n)/2,i.x2=i.x1+this.trueHeight*a,i.y1=o+this.trueHeight*(1-a)/2+(n-l)/2,i.y2=i.y1+this.trueWidth*a;break;default:i.x1=t+this.trueWidth*(1-a)/2,i.x2=i.x1+this.trueWidth*a,i.y1=o+this.trueHeight*(1-a)/2,i.y2=i.y1+this.trueHeight*a}return i},getCropAxis(){let t={x1:0,x2:0,y1:0,y2:0};return t.x1=this.cropOffsertX,t.x2=t.x1+this.cropW,t.y1=this.cropOffsertY,t.y2=t.y1+this.cropH,t},leaveCrop(t){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.$emit("crop-moving",{moving:!1,axis:this.getCropAxis()})},getCropChecked(t){let o=document.createElement("canvas"),a=o.getContext("2d"),i=new Image,l=this.rotate,n=this.trueWidth,r=this.trueHeight,c=this.cropOffsertX,p=this.cropOffsertY;i.onload=()=>{if(this.cropW!==0){let u=1;this.high&!this.full&&(u=window.devicePixelRatio),this.enlarge!==1&!this.full&&(u=Math.abs(Number(this.enlarge)));let m=this.cropW*u,f=this.cropH*u,C=n*this.scale*u,g=r*this.scale*u,y=(this.x-c+this.trueWidth*(1-this.scale)/2)*u,b=(this.y-p+this.trueHeight*(1-this.scale)/2)*u;switch(h(m,f),a.save(),l){case 0:this.full?(h(m/this.scale,f/this.scale),a.drawImage(i,y/this.scale,b/this.scale,C/this.scale,g/this.scale)):a.drawImage(i,y,b,C,g);break;case 1:case-3:this.full?(h(m/this.scale,f/this.scale),y=y/this.scale+(C/this.scale-g/this.scale)/2,b=b/this.scale+(g/this.scale-C/this.scale)/2,a.rotate(90*l*Math.PI/180),a.drawImage(i,b,-y-g/this.scale,C/this.scale,g/this.scale)):(y+=(C-g)/2,b+=(g-C)/2,a.rotate(90*l*Math.PI/180),a.drawImage(i,b,-y-g,C,g));break;case 2:case-2:this.full?(h(m/this.scale,f/this.scale),a.rotate(90*l*Math.PI/180),y/=this.scale,b/=this.scale,a.drawImage(i,-y-C/this.scale,-b-g/this.scale,C/this.scale,g/this.scale)):(a.rotate(90*l*Math.PI/180),a.drawImage(i,-y-C,-b-g,C,g));break;case 3:case-1:this.full?(h(m/this.scale,f/this.scale),y=y/this.scale+(C/this.scale-g/this.scale)/2,b=b/this.scale+(g/this.scale-C/this.scale)/2,a.rotate(90*l*Math.PI/180),a.drawImage(i,-b-C/this.scale,y,C/this.scale,g/this.scale)):(y+=(C-g)/2,b+=(g-C)/2,a.rotate(90*l*Math.PI/180),a.drawImage(i,-b-C,y,C,g));break;default:this.full?(h(m/this.scale,f/this.scale),a.drawImage(i,y/this.scale,b/this.scale,C/this.scale,g/this.scale)):a.drawImage(i,y,b,C,g)}a.restore()}else{let u=n*this.scale,m=r*this.scale;switch(a.save(),l){case 0:h(u,m),a.drawImage(i,0,0,u,m);break;case 1:case-3:h(m,u),a.rotate(90*l*Math.PI/180),a.drawImage(i,0,-m,u,m);break;case 2:case-2:h(u,m),a.rotate(90*l*Math.PI/180),a.drawImage(i,-u,-m,u,m);break;case 3:case-1:h(m,u),a.rotate(90*l*Math.PI/180),a.drawImage(i,-u,0,u,m);break;default:h(u,m),a.drawImage(i,0,0,u,m)}a.restore()}t(o)},this.img.substr(0,4)!=="data"&&(i.crossOrigin="Anonymous"),i.src=this.imgs;const d=this.fillColor;function h(u,m){o.width=Math.round(u),o.height=Math.round(m),d&&(a.fillStyle=d,a.fillRect(0,0,o.width,o.height))}},getCropData(t){this.getCropChecked(o=>{t(o.toDataURL("image/"+this.outputType,this.outputSize))})},getCropBlob(t){this.getCropChecked(o=>{o.toBlob(a=>t(a),"image/"+this.outputType,this.outputSize)})},showPreview(){if(!this.isCanShow)return!1;this.isCanShow=!1,setTimeout(()=>{this.isCanShow=!0},16);let t=this.cropW,o=this.cropH,a=this.scale;var i={};i.div={width:`${t}px`,height:`${o}px`};let l=(this.x-this.cropOffsertX)/a,n=(this.y-this.cropOffsertY)/a;i.w=t,i.h=o,i.url=this.imgs,i.img={width:`${this.trueWidth}px`,height:`${this.trueHeight}px`,transform:`scale(${a})translate3d(${l}px, ${n}px, 0px)rotateZ(${90*this.rotate}deg)`},i.html=`
|
|
2
2
|
<div class="show-preview" style="width: ${i.w}px; height: ${i.h}px,; overflow: hidden">
|
|
3
3
|
<div style="width: ${t}px; height: ${o}px">
|
|
4
4
|
<img src=${i.url} style="width: ${this.trueWidth}px; height: ${this.trueHeight}px; transform:
|
|
5
5
|
scale(${a})translate3d(${l}px, ${n}px, 0px)rotateZ(${90*this.rotate}deg)">
|
|
6
6
|
</div>
|
|
7
|
-
</div>`,this.$emit("real-time",i)},reload(){let t=new Image;t.onload=()=>{this.w=parseFloat(window.getComputedStyle(this.$refs.cropper).width),this.h=parseFloat(window.getComputedStyle(this.$refs.cropper).height),this.trueWidth=t.width,this.trueHeight=t.height,this.original?this.scale=1:this.scale=this.checkedMode(),this.$nextTick(()=>{this.x=-(this.trueWidth-this.trueWidth*this.scale)/2+(this.w-this.trueWidth*this.scale)/2,this.y=-(this.trueHeight-this.trueHeight*this.scale)/2+(this.h-this.trueHeight*this.scale)/2,this.loading=!1,this.autoCrop&&this.goAutoCrop(),this.$emit("img-load","success"),setTimeout(()=>{this.showPreview()},20)})},t.onerror=()=>{this.$emit("img-load","error")},t.src=this.imgs},checkedMode(){let t=1,o=this.trueWidth,a=this.trueHeight;const i=this.mode.split(" ");switch(i[0]){case"contain":this.trueWidth>this.w&&(t=this.w/this.trueWidth),this.trueHeight*t>this.h&&(t=this.h/this.trueHeight);break;case"cover":o=this.w,t=o/this.trueWidth,a*=t,a<this.h&&(a=this.h,t=a/this.trueHeight);break;default:try{let l=i[0];if(l.search("px")!==-1){l=l.replace("px",""),o=parseFloat(l);const n=o/this.trueWidth;let r=1,c=i[1];c.search("px")!==-1&&(c=c.replace("px",""),a=parseFloat(c),r=a/this.trueHeight),t=Math.min(n,r)}if(l.search("%")!==-1&&(l=l.replace("%",""),o=parseFloat(l)/100*this.w,t=o/this.trueWidth),i.length===2&&l==="auto"){let n=i[1];n.search("px")!==-1&&(n=n.replace("px",""),a=parseFloat(n),t=a/this.trueHeight),n.search("%")!==-1&&(n=n.replace("%",""),a=parseFloat(n)/100*this.h,t=a/this.trueHeight)}}catch{t=1}}return t},goAutoCrop(t,o){if(this.imgs===""||this.imgs===null)return;this.clearCrop(),this.cropping=!0;let a=this.w,i=this.h;if(this.centerBox){const r=Math.abs(this.rotate)%2>0;let c=(r?this.trueHeight:this.trueWidth)*this.scale,p=(r?this.trueWidth:this.trueHeight)*this.scale;a=c<a?c:a,i=p<i?p:i}var l=t||parseFloat(this.autoCropWidth),n=o||parseFloat(this.autoCropHeight);(l===0||n===0)&&(l=.8*a,n=.8*i),l=l>a?a:l,n=n>i?i:n,this.fixed&&(n=l/this.fixedNumber[0]*this.fixedNumber[1]),n>this.h&&(l=(n=this.h)/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(l,n)},changeCrop(t,o){if(this.centerBox){let a=this.getImgAxis();t>a.x2-a.x1&&(o=(t=a.x2-a.x1)/this.fixedNumber[0]*this.fixedNumber[1]),o>a.y2-a.y1&&(t=(o=a.y2-a.y1)/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=t,this.cropH=o,this.checkCropLimitSize(),this.$nextTick(()=>{this.cropOffsertX=(this.w-this.cropW)/2,this.cropOffsertY=(this.h-this.cropH)/2,this.centerBox&&this.moveCrop(null,!0)})},refresh(){this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.imgIsQqualCrop=!1,this.clearCrop(),this.$nextTick(()=>{this.checkedImg()})},rotateLeft(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight(){this.rotate=this.rotate>=3?0:this.rotate+1},rotateClear(){this.rotate=0},checkoutImgAxis(t,o,a){t=t||this.x,o=o||this.y,a=a||this.scale;let i=!0;if(this.centerBox){let l=this.getImgAxis(t,o,a),n=this.getCropAxis();l.x1>=n.x1&&(i=!1),l.x2<=n.x2&&(i=!1),l.y1>=n.y1&&(i=!1),l.y2<=n.y2&&(i=!1),i||this.changeImgScale(l,n,a)}return i},changeImgScale(t,o,a){let i=this.trueWidth,l=this.trueHeight,n=i*a,r=l*a;if(n>=this.cropW&&r>=this.cropH)this.scale=a;else{const c=this.cropW/i,p=this.cropH/l,d=this.cropH<=l*c?c:p;this.scale=d,n=i*d,r=l*d}this.imgIsQqualCrop||(t.x1>=o.x1&&(this.isRotateRightOrLeft?this.x=o.x1-(i-n)/2-(n-r)/2:this.x=o.x1-(i-n)/2),t.x2<=o.x2&&(this.isRotateRightOrLeft?this.x=o.x1-(i-n)/2-(n-r)/2-r+this.cropW:this.x=o.x2-(i-n)/2-n),t.y1>=o.y1&&(this.isRotateRightOrLeft?this.y=o.y1-(l-r)/2-(r-n)/2:this.y=o.y1-(l-r)/2),t.y2<=o.y2&&(this.isRotateRightOrLeft?this.y=o.y2-(l-r)/2-(r-n)/2-n:this.y=o.y2-(l-r)/2-r)),(n<this.cropW||r<this.cropH)&&(this.imgIsQqualCrop=!0)}},mounted(){this.support="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let t=this;var o=navigator.userAgent;this.isIOS=!!o.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(a,i,l){for(var n=atob(this.toDataURL(i,l).split(",")[1]),r=n.length,c=new Uint8Array(r),p=0;p<r;p++)c[p]=n.charCodeAt(p);a(new Blob([c],{type:t.type||"image/png"}))}}),this.showPreview(),this.checkedImg()},unmounted(){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.cancelScale()}}),fi={key:0,class:"cropper-box"},Ci=["src"],vi={class:"cropper-view-box"},yi=["src"],ki={key:1},bi={props:{loading:{type:[Boolean],default:!1},modelValue:{type:[Boolean],default:!1},src:{type:[String],default:""},size:{type:[Number],default:120},title:{type:[String],default:"裁剪"}},components:{VueCropper:ui(gi,[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:"vue-cropper",ref:"cropper",onMouseover:o[28]||(o[28]=(...r)=>t.scaleImg&&t.scaleImg(...r)),onMouseout:o[29]||(o[29]=(...r)=>t.cancelScale&&t.cancelScale(...r))},[t.imgs?(e.openBlock(),e.createElementBlock("div",fi,[e.withDirectives(e.createElementVNode("div",{class:"cropper-box-canvas",style:e.normalizeStyle({width:t.trueWidth+"px",height:t.trueHeight+"px",transform:"scale("+t.scale+","+t.scale+") translate3d("+t.x/t.scale+"px,"+t.y/t.scale+"px,0)rotateZ("+90*t.rotate+"deg)"})},[e.createElementVNode("img",{src:t.imgs,alt:"cropper-img",ref:"cropperImg"},null,8,Ci)],4),[[e.vShow,!t.loading]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["cropper-drag-box",{"cropper-move":t.move&&!t.crop,"cropper-crop":t.crop,"cropper-modal":t.cropping}]),onMousedown:o[0]||(o[0]=(...r)=>t.startMove&&t.startMove(...r)),onTouchstart:o[1]||(o[1]=(...r)=>t.startMove&&t.startMove(...r))},null,34),e.withDirectives(e.createElementVNode("div",{class:"cropper-crop-box",style:e.normalizeStyle({width:t.cropW+"px",height:t.cropH+"px",transform:"translate3d("+t.cropOffsertX+"px,"+t.cropOffsertY+"px,0)"})},[e.createElementVNode("span",vi,[e.createElementVNode("img",{style:e.normalizeStyle({width:t.trueWidth+"px",height:t.trueHeight+"px",transform:"scale("+t.scale+","+t.scale+") translate3d("+(t.x-t.cropOffsertX)/t.scale+"px,"+(t.y-t.cropOffsertY)/t.scale+"px,0)rotateZ("+90*t.rotate+"deg)"}),src:t.imgs,alt:"cropper-img"},null,12,yi)]),e.createElementVNode("span",{class:"cropper-face cropper-move",onMousedown:o[2]||(o[2]=(...r)=>t.cropMove&&t.cropMove(...r)),onTouchstart:o[3]||(o[3]=(...r)=>t.cropMove&&t.cropMove(...r))},null,32),t.info?(e.openBlock(),e.createElementBlock("span",{key:0,class:"crop-info",style:e.normalizeStyle({top:t.cropInfo.top})},e.toDisplayString(t.cropInfo.width)+" × "+e.toDisplayString(t.cropInfo.height),5)):e.createCommentVNode("",!0),t.fixedBox?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ki,[e.createElementVNode("span",{class:"crop-line line-w",onMousedown:o[4]||(o[4]=r=>t.changeCropSize(r,!1,!0,0,1)),onTouchstart:o[5]||(o[5]=r=>t.changeCropSize(r,!1,!0,0,1))},null,32),e.createElementVNode("span",{class:"crop-line line-a",onMousedown:o[6]||(o[6]=r=>t.changeCropSize(r,!0,!1,1,0)),onTouchstart:o[7]||(o[7]=r=>t.changeCropSize(r,!0,!1,1,0))},null,32),e.createElementVNode("span",{class:"crop-line line-s",onMousedown:o[8]||(o[8]=r=>t.changeCropSize(r,!1,!0,0,2)),onTouchstart:o[9]||(o[9]=r=>t.changeCropSize(r,!1,!0,0,2))},null,32),e.createElementVNode("span",{class:"crop-line line-d",onMousedown:o[10]||(o[10]=r=>t.changeCropSize(r,!0,!1,2,0)),onTouchstart:o[11]||(o[11]=r=>t.changeCropSize(r,!0,!1,2,0))},null,32),e.createElementVNode("span",{class:"crop-point point1",onMousedown:o[12]||(o[12]=r=>t.changeCropSize(r,!0,!0,1,1)),onTouchstart:o[13]||(o[13]=r=>t.changeCropSize(r,!0,!0,1,1))},null,32),e.createElementVNode("span",{class:"crop-point point2",onMousedown:o[14]||(o[14]=r=>t.changeCropSize(r,!1,!0,0,1)),onTouchstart:o[15]||(o[15]=r=>t.changeCropSize(r,!1,!0,0,1))},null,32),e.createElementVNode("span",{class:"crop-point point3",onMousedown:o[16]||(o[16]=r=>t.changeCropSize(r,!0,!0,2,1)),onTouchstart:o[17]||(o[17]=r=>t.changeCropSize(r,!0,!0,2,1))},null,32),e.createElementVNode("span",{class:"crop-point point4",onMousedown:o[18]||(o[18]=r=>t.changeCropSize(r,!0,!1,1,0)),onTouchstart:o[19]||(o[19]=r=>t.changeCropSize(r,!0,!1,1,0))},null,32),e.createElementVNode("span",{class:"crop-point point5",onMousedown:o[20]||(o[20]=r=>t.changeCropSize(r,!0,!1,2,0)),onTouchstart:o[21]||(o[21]=r=>t.changeCropSize(r,!0,!1,2,0))},null,32),e.createElementVNode("span",{class:"crop-point point6",onMousedown:o[22]||(o[22]=r=>t.changeCropSize(r,!0,!0,1,2)),onTouchstart:o[23]||(o[23]=r=>t.changeCropSize(r,!0,!0,1,2))},null,32),e.createElementVNode("span",{class:"crop-point point7",onMousedown:o[24]||(o[24]=r=>t.changeCropSize(r,!1,!0,0,2)),onTouchstart:o[25]||(o[25]=r=>t.changeCropSize(r,!1,!0,0,2))},null,32),e.createElementVNode("span",{class:"crop-point point8",onMousedown:o[26]||(o[26]=r=>t.changeCropSize(r,!0,!0,2,2)),onTouchstart:o[27]||(o[27]=r=>t.changeCropSize(r,!0,!0,2,2))},null,32)]))],4),[[e.vShow,t.cropping]])],544)}],["__scopeId","data-v-a742df44"]])},emits:["update:modelValue","onSubmit","onClose"],data(){return{cropDialogVisible:!1,cropAutoCrop:!0,cropFixedBox:!0,cropOutputType:"png",cropPreviews:{},cropVisible:!1,cropBeforelImage:"",cropAfterImage:"",cropLocalWidth:this.size,cropLocalHeight:this.size}},watch:{modelValue(t){this.cropDialogVisible=t,this.cropInit()},src(t){this.cropInit()}},computed:{cropAttrs(){return{info:!0,autoCrop:this.cropAutoCrop,fixedBox:this.cropFixedBox,autoCropWidth:this.cropLocalWidth,autoCropHeight:this.cropLocalHeight,outputType:this.cropOutputType}}},mounted(){},methods:{cropInit(){this.cropBeforelImage=this.src||""},cropDialoClose(){this.cropBeforelImage="",this.cropPreviews="",this.cropVisible=!1,this.cropDialogVisible=!1,this.$emit("update:modelValue",!1),this.$emit("onClose",!1)},cropDialogOpened(){this.$nextTick(()=>{this.cropVisible=!0})},cropSubmit(){this._submit_blob()},_submit_blob(){this.$refs.cvAvatartCropper.getCropBlob(t=>{this.$emit("onSubmit",{file:t})})},_submit_base64(){this.$refs.cvAvatartCropper.getCropData(t=>{let o=new Image;o.src=t,o.onload=async()=>{imageCompress(o)}})},cropRotateRefresh(){},cropRotateLeft(){this.$refs.cvAvatartCropper.rotateLeft()},cropRotateRight(){this.$refs.cvAvatartCropper.rotateRight()},cropChangeScale(t){t=t||1,this.$refs.cvAvatartCropper.changeScale(t)},cropRealTime(t){this.cropPreviews=t}}},wi={class:"cv-upload-crop-box"},Vi={class:"cv-upload-crop-left-box"},xi={class:"cv-upload-crop-left-opt"},Si={class:"cv-upload-crop-left-opt2"},Ni={class:"cv-upload-crop-left-opt2"},Bi={class:"cv-upload-crop-right-box"},Ei=["innerHTML"],Di={title:"头像上传",name:"cvUploadAvatar",mixins:[ao],components:{UploadCrop:v(bi,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("vue-cropper"),c=e.resolveComponent("el-button"),p=e.resolveComponent("el-tooltip"),d=e.resolveComponent("el-input"),h=e.resolveComponent("el-dialog"),u=e.resolveDirective("loading");return e.openBlock(),e.createBlock(h,{title:a.title,modelValue:l.cropDialogVisible,"onUpdate:modelValue":o[7]||(o[7]=m=>l.cropDialogVisible=m),width:"800px","append-to-body":"",onOpened:n.cropDialogOpened,onClose:n.cropDialoClose},{footer:e.withCtx(()=>[e.createVNode(c,{type:"primary",onClick:n.cropSubmit,loading:a.loading,disabled:a.loading},{default:e.withCtx(()=>[...o[12]||(o[12]=[e.createTextVNode("提 交",-1)])]),_:1},8,["onClick","loading","disabled"])]),default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",wi,[e.createElementVNode("div",Vi,[l.cropVisible?(e.openBlock(),e.createBlock(r,e.mergeProps({key:0,ref:"cvAvatartCropper",img:l.cropBeforelImage},n.cropAttrs,{onRealTime:n.cropRealTime}),null,16,["img","onRealTime"])):e.createCommentVNode("",!0),e.createElementVNode("div",xi,[e.renderSlot(t.$slots,"default"),e.createVNode(p,{effect:"dark",content:"重置",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconRefresh",onClick:o[0]||(o[0]=m=>n.cropRotateRefresh())})]),_:1}),e.createVNode(p,{effect:"dark",content:"放大",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconZoomIn",onClick:o[1]||(o[1]=m=>n.cropChangeScale(1))})]),_:1}),e.createVNode(p,{effect:"dark",content:"缩小",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconZoomOut",onClick:o[2]||(o[2]=m=>n.cropChangeScale(-1))})]),_:1}),e.createVNode(p,{effect:"dark",content:"向左旋转",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconRefreshLeft",onClick:o[3]||(o[3]=m=>n.cropRotateLeft())})]),_:1}),e.createVNode(p,{effect:"dark",content:"向右旋转",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconRefreshRight",onClick:o[4]||(o[4]=m=>n.cropRotateRight())})]),_:1})]),e.createElementVNode("div",Si,[e.createVNode(d,{size:"small"},{prepend:e.withCtx(()=>[...o[8]||(o[8]=[e.createTextVNode("X 坐标",-1)])]),_:1}),e.createVNode(d,{size:"small"},{prepend:e.withCtx(()=>[...o[9]||(o[9]=[e.createTextVNode("Y 坐标",-1)])]),_:1})]),e.createElementVNode("div",Ni,[e.createVNode(d,{size:"small",modelValue:l.cropLocalWidth,"onUpdate:modelValue":o[5]||(o[5]=m=>l.cropLocalWidth=m)},{prepend:e.withCtx(()=>[...o[10]||(o[10]=[e.createTextVNode("宽度",-1)])]),_:1},8,["modelValue"]),e.createVNode(d,{size:"small",modelValue:l.cropLocalHeight,"onUpdate:modelValue":o[6]||(o[6]=m=>l.cropLocalHeight=m)},{prepend:e.withCtx(()=>[...o[11]||(o[11]=[e.createTextVNode("高度",-1)])]),_:1},8,["modelValue"])])]),e.createElementVNode("div",Bi,[e.createElementVNode("div",{class:"cv-upload-crop-preview",innerHTML:l.cropPreviews.html},null,8,Ei)])])),[[u,a.loading]])]),_:3},8,["title","modelValue","onOpened","onClose"])}]])},props:{modelValue:{type:[String],default:""},initValue:{type:[String],default:""},fileSize:{type:[Number],default:2},fileType:{type:[Array],default:()=>["png","jpg","jpeg","gif"]},showSize:{type:Number,default:120},crop:{type:[Boolean],default:!0},signatureParam:{type:[Object],default:()=>({save_sign:"avatar"})}},data:()=>({localValue:"",localList:[],upAccept:"image/*"}),computed:{localRef:()=>"cvUploadAvatar"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",accept:this.upAccept,limit:1,multiple:!1,drag:!1,disabled:this.upIngLoading,showFileList:!1}},showStyle(){return{width:this.showSize+"px",height:this.showSize+"px",lineHeight:this.showSize+"px"}}},watch:{initValue(t){this._init_parse()}},mounted(){this._init_parse()},methods:{_init_parse(){this.localValue=this.initValue||""},cropDialogOpen(){this.cropShow=!0,this.$nextTick(()=>{this._init_parse()})},initBeforeUpload(t){if(!this._commonBeforeUpload(t))return this.upIngLoading=!1,!1;if(this.crop){const o=new FileReader;o.readAsDataURL(t),o.onload=()=>{this.localValue=o.result},this.$refs.cvUploadAvatar.clearFiles()}},async onHttpRequest(t){const{file:o}=t;this.upIngLoading=!0;const a=this.mergeAttrs.signatureType||null,i=this.mergeAttrs.signatureFn||null,l=this.mergeAttrs.signatureParam||{};await Ko(o,a,i,l).then(n=>{this.$nextTick(()=>{this.$emit("update:modelValue",n.full_path),this.$emit("update:initValue",n.cdn_full_path)}),k.ElMessage.success("上传成功"),this.upIngLoading=!1,this.cropShow=!1}).catch(()=>{this.upIngLoading=!1})}}},Ti=["src"],pt=v(Di,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("upload-tip"),c=e.resolveComponent("cv-icons"),p=e.resolveComponent("el-button"),d=e.resolveComponent("el-tooltip"),h=e.resolveComponent("el-upload"),u=e.resolveComponent("upload-crop");return e.openBlock(),e.createElementBlock("div",{class:"cv-upload-avatar-wrap",onClick:o[2]||(o[2]=(...m)=>n.cropDialogOpen&&n.cropDialogOpen(...m))},[a.initValue?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"cv-upload-avatar-box cv-upload-avatar-empty",style:e.normalizeStyle(n.showStyle)},[...o[3]||(o[3]=[e.createElementVNode("div",{class:"cv-upload-avatar__text"},"上传头像",-1)])],4)),a.initValue?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cv-upload-avatar-box",style:e.normalizeStyle(n.showStyle)},[e.createElementVNode("img",{class:"cv-upload-avatar__img",src:a.initValue},null,8,Ti)],4)):e.createCommentVNode("",!0),e.createVNode(r,e.mergeProps(t.tipAttr,{fileUnit:"张",multiple:!1,limit:1}),null,16),a.crop?(e.openBlock(),e.createBlock(u,{key:2,modelValue:t.cropShow,"onUpdate:modelValue":o[0]||(o[0]=m=>t.cropShow=m),title:"修改头像",size:a.showSize,onOnSubmit:n.onHttpRequest,onOnClose:o[1]||(o[1]=m=>t.upIngLoading=!1),loading:t.upIngLoading,src:l.localValue},{default:e.withCtx(()=>[e.createVNode(h,e.mergeProps(n.handlerAttr,{"before-upload":n.initBeforeUpload,"http-request":t.initHttpRequest}),{default:e.withCtx(()=>[e.createVNode(d,{effect:"dark",content:"选择图片",placement:"top"},{default:e.withCtx(()=>[e.createVNode(p,{style:{"margin-right":"10px"},loading:t.upIngLoading,disabled:t.upIngLoading},{default:e.withCtx(()=>[e.createVNode(c,{type:"ElIconPlus",size:"14",style:{"margin-right":"10px"}}),o[4]||(o[4]=e.createTextVNode(" 选择 ",-1))]),_:1},8,["loading","disabled"])]),_:1})]),_:1},16,["before-upload","http-request"])]),_:1},8,["modelValue","size","onOnSubmit","loading","src"])):e.createCommentVNode("",!0)])}]]),_i={title:"图片上传",name:"cvUploadImage",mixins:[ao],components:{},props:{modelValue:{type:[String,Number,Array,Object],default:""},initValue:{type:[String,Number,Array],default:()=>""},fileSize:{type:[Number],default:2},fileType:{type:[Array],default:()=>["png","jpg","jpeg","gif"]},showSize:{type:Number,default:150},showBig:{type:[Boolean],default:!1},crop:{type:[Boolean],default:!1},galleryLabel:{type:String,default:""},lazy:{type:Boolean,default:!0},drag:{type:Boolean,default:!1},signatureParam:{type:[Object],default:()=>({save_sign:"image"})}},data:()=>({localValue:[],localList:[],previewShow:!1,previewTitle:"",previewUrl:"",upAccept:"image/*"}),computed:{localRef:()=>"cvUploadImage"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",accept:this.upAccept,limit:parseInt(this.limit),multiple:this.multiple,drag:!!this.drag,disabled:this.upIngLoading,showFileList:!1}},showUpload(){return!(this.localList.length>=this.limit)},showStyle(){let t=this.showSize+"px";return(this.showBig||this.drag)&&(t=2*this.showSize+"px"),{width:t,height:this.showSize+"px",lineHeight:this.showSize+"px"}}},watch:{modelValue(t){this._init_parse_value()},initValue(t){this._init_parse_list()}},mounted(){},methods:{_init_parse_value(){if(this.modelValue)if(typeof this.modelValue=="string"&&this.modelValue.includes(",")){const t=String(this.modelValue).split(",").map(o=>o.trim());this.localValue=Yo(t)}else this.localValue=Yo(this.modelValue);else this.localValue=[]},_init_parse_list(){this.initValue?this.localList=Xo(this.initValue):this.localList=[]},initOnChange(t,o){},initBeforeUpload(t){return this.upIngLoading=!0,!!this._commonBeforeUpload(t)||(this.upIngLoading=!1,!1)},async initHttpRequest(t){const{file:o}=t;this.upIngLoading=!0,this.mergeAttrs.upResponseFn;const a=this.mergeAttrs.signatureType||null,i=this.mergeAttrs.signatureFn||null,l=this.mergeAttrs.signatureParam||{};await Ko(o,a,i,l).then(n=>{this.$nextTick(()=>{this.updateValue(n.filelog_id,n.cdn_full_path)}),k.ElMessage.success("上传成功"),this.upIngLoading=!1}).catch(()=>{this.upIngLoading=!1})},updateValue(t,o){if(this.multiple){let a=ra(this.localValue,t).join(",");this.$emit("update:modelValue",a)}else this.$emit("update:modelValue",t);if(this.multiple){let a=ra(this.localList,o);this.$emit("update:initValue",a)}else this.$emit("update:initValue",o)},handleItemPreview(t,o){t.raw,t.type.includes("image")?(this.previewTitle=t.name,this.previewUrl=t.url,this.previewShow=!0):window.open(t.url)},doRemove(t){this.multiple?(this.localValue.splice(t,1),this.localList.splice(t,1)):(this.localValue="",this.localList=[]),this.updateValue(null,null)},handleItemRemove(t,o){if(this.beforeRemove&&typeof this.beforeRemove=="function"){const a=this.multiple?this.localValue[o]:this.localValue,i=this.beforeRemove(a,this.localValue);i&&i.then?i.then(()=>{this.doRemove(o)},()=>{}):i!==!1&&this.doRemove(o)}else this.doRemove(o)},handleItemEdit(t,o){k.ElMessageBox.prompt("请输入文件地址","编辑",{confirmButtonText:"OK",cancelButtonText:"Cancel",inputValue:t.url||"",inputErrorMessage:"格式不正确"}).then(({value:a})=>{const i=a.split("/").pop(),l=i.split(".").pop().toLowerCase();if(!this.fileType.includes(l)){let p=this.fileType.join("、");return k.ElMessage.error(`文件格式错误,请填写类型,如:${p} 格式文件`),!1}const n=function(p){if(!p)return"";const d=p.replace(/^\./,"").toLowerCase();return Il.extensionToMime[d]||""}(l);if(!n)return k.ElMessage.error("文件格式错误"),!1;var r;(r=a).startsWith("http://")||r.startsWith("https://")||r.startsWith("//")||this.mergeAttrs?.baseDomain&&(a=this.mergeAttrs?.baseDomain+a);const c={name:i,status:"success",type:n,uid:Date.now(),url:a};this.localList[o]=c}).catch(()=>{})},handleItemCrop(t,o){}}},Ii={class:"cv-upload-image cv-upload-common"},Li={class:"cv-upload-list-box el-upload-list el-upload-list--picture-card"},Fi=["tabindex"],$i={class:"el-upload-list__item-status-label"},Oi={class:"el-upload-list__item-actions"},Mi=["onClick"],zi={class:"el-upload-list__item-delete"},Pi={class:"el-upload-list__item-delete"},Hi=["onClick"],Ai={style:{margin:"0 auto"}},ji=["src"],ht=v(_i,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-image"),c=e.resolveComponent("cv-icons"),p=e.resolveComponent("el-upload"),d=e.resolveComponent("upload-tip"),h=e.resolveComponent("el-dialog"),u=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Ii,[e.createElementVNode("div",Li,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.localList,(m,f)=>(e.openBlock(),e.createElementBlock("section",{class:"el-upload-list__item is-success",key:f,tabindex:f,style:e.normalizeStyle(n.showStyle)},[e.createVNode(r,{class:"el-upload-list__item-thumbnail",lazy:a.lazy,src:m.url,style:e.normalizeStyle(n.showStyle),fit:"contain"},null,8,["lazy","src","style"]),e.createElementVNode("label",$i,[e.createVNode(c,{type:"ElIconCheck",color:"#ffffff",size:"12"})]),e.createElementVNode("span",Oi,[e.createElementVNode("span",{class:"el-upload-list__item-preview",onClick:C=>n.handleItemPreview(m)},[e.createVNode(c,{type:"ElIconZoomIn",size:"20"})],8,Mi),e.createElementVNode("span",zi,[e.createVNode(c,{type:"ElIconDelete",size:"20",onClick:C=>n.handleItemRemove(m,f)},null,8,["onClick"])]),e.createElementVNode("span",Pi,[e.createVNode(c,{type:"ElIconEdit",size:"20",onClick:C=>n.handleItemEdit(m,f)},null,8,["onClick"])]),a.crop?(e.openBlock(),e.createElementBlock("span",{key:0,class:"el-upload-list__item-preview",onClick:C=>n.handleItemCrop(m)},[e.createVNode(c,{type:"ElIconCrop",size:"20"})],8,Hi)):e.createCommentVNode("",!0)])],12,Fi))),128)),n.showUpload?(e.openBlock(),e.createBlock(p,e.mergeProps({key:0,class:"cv-upload-common-handle"},n.handlerAttr,{"file-list":l.localList,"before-upload":n.initBeforeUpload,"http-request":n.initHttpRequest,"on-change":n.initOnChange,"on-exceed":t.initOnExceed,style:n.showStyle}),{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"cv-upload-common__ing",style:e.normalizeStyle(n.showStyle)},[a.drag?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(c,{type:"ElIconUpload",size:"24"}),o[1]||(o[1]=e.createElementVNode("div",{class:"el-upload__text"},[e.createTextVNode(" 将文件拖到此处,或 "),e.createElementVNode("em",null,"点击上传")],-1))],64)):(e.openBlock(),e.createBlock(c,{key:1,type:"ElIconPlus",size:a.showSize/3},null,8,["size"]))],4)),[[u,t.upIngLoading]])]),_:1},16,["file-list","before-upload","http-request","on-change","on-exceed","style"])):e.createCommentVNode("",!0)]),e.createVNode(d,e.mergeProps(t.tipAttr,{fileUnit:"张"}),null,16),e.createVNode(h,{modelValue:l.previewShow,"onUpdate:modelValue":o[0]||(o[0]=m=>l.previewShow=m),title:l.previewTitle,"append-to-body":""},{default:e.withCtx(()=>[e.createElementVNode("div",Ai,[e.createElementVNode("img",{width:"100%",src:l.previewUrl,style:{"max-width":"300px"}},null,8,ji)])]),_:1},8,["modelValue","title"])])}]]),Ri={mdb:"access",accdb:"access",ai:"ai",html:"html",htm:"html",asp:"web",pdf:"pdf",psd:"photoshop",psb:"photoshop",mpo:"photoshop",eps:"photoshop",avi:"video",wmv:"video",rm:"video",rmvb:"video",mp4:"video","3gp":"video",asf:"video",mov:"video",m4v:"video",flv:"video",f4v:"video",mkv:"video",mts:"video",swf:"flash",ts:"video",mp3:"audio",wav:"audio",wma:"audio",ape:"audio",aac:"audio",zip:"zip",rar:"zip",gz:"zip","7z":"zip",z:"zip",bmp:"image",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",txt:"txt",rtf:"txt",xls:"excel",xlsx:"excel",xlsm:"excel",xltx:"excel",doc:"word",docx:"word",docm:"word",wps:"word",dotx:"word",dotm:"word",ppt:"powerpoint",pptx:"powerpoint",mdf:"db",db:"db",dbf:"db",wdb:"db",vue:"vue",php:"php",jar:"jar",ini:"ini",bat:"bat",config:"config",fla:"fla",eot:"font",otf:"font",fon:"font",font:"font",ttf:"font",ttc:"font",woff:"font",woff2:"font",js:"js",md:"markdown",one:"onenote",jsx:"reactjs",xfl:"xfl",file:"file",css:"css"};function ro(t){return`https://10ui.cn/default/icon_ext/${Ri[t]}.svg`}const Ui={name:"uploadList",props:{files:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},isCanDownload:{type:Boolean,default:!0},isCanDelete:{type:Boolean,default:!0}},methods:{getExtension(t){return t.lastIndexOf(".")>-1&&ro[t.slice(t.lastIndexOf(".")+1).toLowerCase()]||ro.file},getSize:t=>t&&!isNaN(Number(t))?t:"",parsePercentage:t=>parseInt(t,10),handleDownload(t){t.url},handleDelete(t,o){this.$confirm("确认删除该文件吗? ").then(()=>{this.$emit("remove",t,o)}).catch(()=>{})}}},Wi=["src"],Yi={class:"cv-upload-list__item-content-action"},qi={title:"文件上传",inheritAttrs:!1,name:"cvUploadFile",mixins:[ao],components:{uploadList:v(Ui,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(e.TransitionGroup,{class:"cv-upload-file-list el-upload-list el-upload-list--text",name:"el-list",tag:"ul"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.files,(c,p)=>(e.openBlock(),e.createElementBlock("li",{key:c.uid,class:"el-upload-list__item cv-upload-list__item-content"},[e.createVNode(r,{href:c.url,underline:!1,target:"_blank"},{default:e.withCtx(()=>[e.createElementVNode("img",{src:n.getExtension(c.name),class:"el-upload-list__item-content-name-icon"},null,8,Wi),e.createElementVNode("span",null,e.toDisplayString(c.name),1)]),_:2},1032,["href"]),e.createElementVNode("div",Yi,[e.createVNode(r,{underline:!1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.getSize(c.size)),1)]),_:2},1024),a.isCanDownload?(e.openBlock(),e.createBlock(r,{key:0,underline:!1,onClick:d=>n.handleDownload(c)},{default:e.withCtx(()=>[...o[0]||(o[0]=[e.createTextVNode("下载",-1)])]),_:1},8,["onClick"])):e.createCommentVNode("",!0),!a.disabled&&a.isCanDelete?(e.openBlock(),e.createBlock(r,{key:1,underline:!1,onClick:d=>n.handleDelete(p,c),type:"danger"},{default:e.withCtx(()=>[...o[1]||(o[1]=[e.createTextVNode(" 删除 ",-1)])]),_:1},8,["onClick"])):e.createCommentVNode("",!0)])]))),128))]),_:1})}]])},props:{modelValue:{type:[String,Object,Array],default:""},initValue:{type:[String,Object,Array],default:""},fileSize:{type:[Number],default:5},fileType:{type:[Array],default:["txt","png","jpg","xlsx","xls"]},multiple:{type:[Boolean],default:!1},limit:{type:[Number],default:5},disabled:Boolean,isCanDownload:{type:Boolean,default:!0},isCanDelete:{type:Boolean,default:!0},isCanUploadSame:{type:Boolean,default:!0}},data:()=>({localValue:[],localList:[]}),computed:{localRef:()=>"cvUploadFile"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",limit:parseInt(this.limit),multiple:this.multiple,drag:!1,disabled:this.upIngLoading,showFileList:!0}},list(){let t=1;return this.modelValue?(Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]).map(o=>(typeof o=="string"&&(o={name:o,url:o}),o.uid=o.uid||new Date().getTime()+t++,o)):[]}},watch:{initValue(t){this._init_parse()}},mounted(){this._init_parse()},methods:{_init_parse(){this.initValue?this.localList=Xo(this.initValue):this.localList=[]},initOnChange(t,o){this.localList=o},initBeforeUpload(t){return this._commonBeforeUpload(t)?!this.isCanUploadSame&&this.localList.some(o=>o.name+o.size===t.name+t.size)?(this.$message.error("此文件已上传!"),!1):!0:!1},upFileError(t){this.$message.error("上传失败, 请重试"),this.$emit("error",t)},upFileSuccess(t,o){this.upResponseFn&&typeof this.upResponseFn=="function"&&(t=this.upResponseFn(t,o,this.localList)),this.multiple?this.$emit("update:modelValue",[...this.localList,t]):this.$emit("update:modelValue",t),this.$emit("success",t,this.localList)},handleRemove(t,o){if(this.beforeRemove&&typeof this.beforeRemove=="function"){const a=this.beforeRemove(this.localList[o],this.localList);a&&a.then?a.then(()=>{this._do_remove(o)},()=>{}):a!==!1&&this._do_remove(o)}else this._do_remove(o)},_do_remove(t){if(this.$emit("remove",this.list[t],this.list),this.localList.splice(t,1),this.multiple){const o=[...this.list];o.splice(t,1),this.$emit("update:modelValue",o||[])}else this.$emit("update:modelValue",null)}}},Xi={class:"cv-upload-file"},mt=v(qi,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button"),c=e.resolveComponent("el-upload"),p=e.resolveComponent("upload-tip"),d=e.resolveComponent("upload-list");return e.openBlock(),e.createElementBlock("div",Xi,[e.createVNode(c,e.mergeProps({class:"cv-upload-file-uploader"},n.handlerAttr,{"file-list":l.localList,"onUpdate:fileList":o[0]||(o[0]=h=>l.localList=h),"before-upload":n.initBeforeUpload,"on-change":n.initOnChange,"on-exceed":t.initOnExceed,"on-error":n.upFileError,"on-success":n.upFileSuccess}),{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",icon:"ElIconUpload"},{default:e.withCtx(()=>[...o[1]||(o[1]=[e.createTextVNode("上传文件",-1)])]),_:1})]),_:1},16,["file-list","before-upload","on-change","on-exceed","on-error","on-success"]),e.createVNode(p,e.mergeProps(t.tipAttr,{fileUnit:"个"}),null,16),e.createVNode(d,{disabled:a.disabled,files:n.list,isCanDelete:a.isCanDelete,isCanDownload:a.isCanDownload,onRemove:n.handleRemove},null,8,["disabled","files","isCanDelete","isCanDownload","onRemove"])])}]]),Ki={class:"cv-upload-video"},Gi={class:"cv-upload-list-box el-upload-list el-upload-list--picture-card"},Zi=["tabindex"],Qi=["src"],Ji={class:"el-upload-list__item-status-label"},er={class:"el-upload-list__item-actions"},tr=["onClick"],or={class:"el-upload-list__item-delete"},ar={class:"el-upload-list__item-delete"},lr={key:0,style:{width:"500px",height:"300px",margin:"0 auto"}},nr=["src"],ut=v({title:"视频上传",name:"cvUploadVideo",mixins:[ao],components:{},props:{modelValue:{type:[String],default:""},initValue:{type:[String],default:""},fileSize:{type:[Number],default:10},fileType:{type:Array,default:["mp4","mp3"]},showSize:{type:Number,default:360},signatureParam:{type:[Object],default:()=>({save_sign:"video"})}},data:()=>({localValue:"",localList:"",previewShow:!1,previewTitle:"",previewUrl:"",upAccept:"video/*"}),computed:{localRef:()=>"cvUploadVideo"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",accept:this.upAccept,limit:1,multiple:!1,drag:!0,disabled:this.upIngLoading,showFileList:!1}},showUpload(){return!this.localValue},showStyle(){return{width:this.showSize+"px",height:this.showSize/5*3+"px",lineHeight:this.showSize+"px"}}},watch:{modelValue(t){this._init_parse_value()},initValue(t){this._init_parse_list()}},mounted(){this._init_parse_value(),this._init_parse_list()},methods:{_init_parse_value(){this.modelValue?this.localValue=Yo(this.modelValue):this.localValue=""},_init_parse_list(){this.initValue?this.localList=Xo(this.initValue):this.localList=""},initBeforeUpload(t){return this.upIngLoading=!0,!!this._commonBeforeUpload(t)||(this.upIngLoading=!1,!1)},async initHttpRequest(t){const{file:o}=t;this.upIngLoading=!0,this.mergeAttrs.upResponseFn;const a=this.mergeAttrs.signatureType||null,i=this.mergeAttrs.signatureFn||null,l=this.mergeAttrs.signatureParam||{};await Ko(o,a,i,l).then(n=>{this.$nextTick(()=>{this.$emit("update:modelValue",n.full_path),this.$emit("update:initValue",n.cdn_full_path)}),ExtendMessage.success("上传成功"),this.upIngLoading=!1}).catch(()=>{this.upIngLoading=!1})},handleItemPreview(t,o){this.previewTitle=t.name,this.previewUrl=t.url,this.previewShow=!0},doRemove(t){this.localValue="",this.localList="",this.$emit("update:modelValue",""),this.$emit("update:initValue","")},handleItemRemove(t,o){if(this.beforeRemove&&typeof this.beforeRemove=="function"){const a=this.multiple?this.localValue[o]:this.localValue,i=this.beforeRemove(a,this.localValue);i&&i.then?i.then(()=>{this.doRemove(o)},()=>{}):i!==!1&&this.doRemove(o)}else this.doRemove(o)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("el-progress"),p=e.resolveComponent("el-upload"),d=e.resolveComponent("upload-tip"),h=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",Ki,[e.createElementVNode("div",Gi,[l.localList?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.localList,(u,m)=>(e.openBlock(),e.createElementBlock("section",{class:"el-upload-list__item is-success",key:m,tabindex:m,style:e.normalizeStyle(n.showStyle)},[e.createElementVNode("video",{class:"el-upload-list__item-thumbnail",autoplay:!1,src:u.url,style:e.normalizeStyle(n.showStyle)}," 您的浏览器不支持视频播放 ",12,Qi),e.createElementVNode("label",Ji,[e.createVNode(r,{type:"ElIconCheck",color:"#ffffff",size:"12"})]),e.createElementVNode("span",er,[e.createElementVNode("span",{class:"el-upload-list__item-preview",onClick:f=>n.handleItemPreview(u)},[e.createVNode(r,{type:"ElIconVideoPlay",size:"20"})],8,tr),e.createElementVNode("span",or,[e.createVNode(r,{type:"ElIconDelete",size:"20",onClick:f=>n.handleItemRemove(u,m)},null,8,["onClick"])]),e.createElementVNode("span",ar,[e.createVNode(r,{type:"ElIconEdit",size:"20",onClick:f=>t.handleItemEdit(u,m)},null,8,["onClick"])])])],12,Zi))),128)):e.createCommentVNode("",!0),n.showUpload?(e.openBlock(),e.createBlock(p,e.mergeProps({key:1,class:"cv-upload-handler"},n.handlerAttr,{"before-upload":n.initBeforeUpload,"http-request":n.initHttpRequest,style:n.showStyle}),{default:e.withCtx(()=>[t.upIngPercent>0?(e.openBlock(),e.createBlock(c,{key:0,percentage:t.upIngPercent,style:{"margin-top":"20px"},type:"circle"},null,8,["percentage"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:"cv-upload-video__ing",style:e.normalizeStyle(n.showStyle)},[e.createVNode(r,{type:"ElIconUpload",size:"24"}),o[1]||(o[1]=e.createElementVNode("div",{class:"el-upload__text"},[e.createTextVNode(" 将视频拖到此处,或 "),e.createElementVNode("em",null,"点击上传")],-1))],4))]),_:1},16,["before-upload","http-request","style"])):e.createCommentVNode("",!0)]),e.createVNode(d,e.mergeProps(t.tipAttr,{fileUnit:"个",limit:1}),null,16),e.createVNode(h,{modelValue:l.previewShow,"onUpdate:modelValue":o[0]||(o[0]=u=>l.previewShow=u),title:l.previewTitle,"append-to-body":""},{default:e.withCtx(()=>[l.previewShow?(e.openBlock(),e.createElementBlock("div",lr,[e.createElementVNode("video",{autoplay:!0,src:l.previewUrl,controls:"controls",style:{width:"500px",height:"300px"}}," 您的浏览器不支持视频播放 ",8,nr)])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}]]),ir={emits:["get-unlist","on-close","on-update","on-delete"],props:{modelValue:{type:Array,default:()=>[]},model:{type:String,default:""},accept:{type:String,default:""},multiple:{type:Boolean,default:!1}},data:()=>({audioInfo:{},file:null,fileList:[],fileHash:"",tempCheckpoint:null,uploadId:"",uploadStatus:null,showAudio:!1,percentage:0,uploadName:"",client:null,year:new Date().getFullYear(),uploadDisabled:!0,resumeDisabled:!0,pauseDisabled:!0,dialogVisible:!1,isDoing:!1,unList:[],fileMap:{},map_max_key:0,partSize:1048576,parallel:4,checkpoints:{}}),watch:{dialogVisible:{handler(t){t||(this.fileList=[],this.$refs.upload.uploadFiles=[])}},fileList:{handler(t){if(t.length){this.dialogVisible=!0;let o=[],a=[];t.forEach(i=>{i.raw.name.indexOf(".")===-1&&(i.errMsg="不支持此格式上传"),i.percentage===100?o.push(i):a.push(i)}),o.length===t.length?(this.pauseDisabled=!0,this.isDoing=!0):this.isDoing=!1,this.unList=a}},deep:!0}},mounted(){window.addEventListener("online",this.resumeUpload)},methods:{filterSize:ia,handleExceed(){this.$confirm("上传文件数量不能超过100个,请重新选择!","操作提示",{confirmButtonText:"确 定",cancelButtonText:"取 消",type:"warning"}).then(()=>{this.fileList=[],this.dialogVisible=!1}).catch(()=>{this.fileList=[]})},handleDeleteChangeFile(t){this.fileList.splice(t,1),this.fileList.length||(this.dialogVisible=!1)},fileTypeIcon(t){const{type:o}=t.raw,a=o.indexOf("video")!==-1,i=o.indexOf("image")!==-1,l=o.indexOf("audio")!==-1,n=o.indexOf("zip")!==-1,r=o.indexOf("wordprocessingml")!==-1,c=o.indexOf("pdf")!==-1,p=o.indexOf("text")!==-1,d=o.indexOf("sheet")!==-1;return a?"MP4":i?"JPG1":l?"mp3-1":n?"yasuo":r?"DOCX":c?"wenjianleixing-biaozhuntu-PDFwendang":p?"div-1":d?"excel1":"weizhiwenjian"},handleClose(){this.$emit("on-close"),this.isDoing?this.dialogVisible=!1:this.$confirm("正在上传文件,关闭后上传文件会丢失!是否继续?","操作提示",{confirmButtonText:"确 定",cancelButtonText:"取 消",type:"warning"}).then(()=>{this.$emit("get-unlist"),this.fileList.forEach(t=>{t.client&&t.percentage<100&&t.client.cancel()}),this.dialogVisible=!1}).catch(()=>{})},async handleBeforeUpload(t){},handleStopChangeFile(t,o){o.isPlay=!o.isPlay,this.fileList.splice(t,1,o),o.isPlay?this.resumeMultipartUpload(o):o.client.cancel()},async starUpload(){this.uploadDisabled=!0,this.pauseDisabled=!1,this.multipartUpload()},async multipartUpload(){this.file?this.fileList.forEach(async t=>{t.isLoading=!0,await this.ossUploadHandle(t,this.fileList)}):k.ElMessage.error("请选择文件")},async resumeUpload(){this.pauseDisabled=!1,this.uploadDisabled=!0,this.resumeDisabled=!0,await this.resumeMultipartUpload()},stopUpload(){this.resumeDisabled=!1,this.pauseDisabled=!0,this.fileList.forEach(t=>{t.client.cancel(),t.isPlay=!1})},async change(t,o){this.fileMap[t]=o,this.map_max_key=t},async handle_network_speed_change(t,o,a){t-this.map_max_key>=1e4&&(this.fileMap={});for(let i=t;i<=o;i++){const l=await this.fileMap[i];l?await this.change(i,l+a):await this.change(i,a)}},handle_network_speed(t,o,a){const i=t.rt/1e3,l=new Date(t.headers.date).getTime(),n=l-i;let r=parseInt(o/i);return a===0&&(r=0),r===0||this.handle_network_speed_change(n,l,r),r?ia(r):0},async resetUpload(t,o){JSON.stringify(t).indexOf("Error")!==-1&&(o.client&&o.client.cancel(),o.client=await ca(this.signatureType,this.apiFunc),await this.resumeMultipartUpload(o))},async resumeMultipartUpload(t){if(t){const{tempCheckpoint:o}=t;this.resumeUploadFile(t,o)}else Object.values(this.checkpoints).forEach(o=>{const{uploadId:a}=o,i=this.fileList.findIndex(n=>n.upload===a),l=this.fileList[i];this.resumeUploadFile(l,o)})},async resumeUploadFile(t,o){const{uploadId:a,file:i,name:l}=o;try{const{raw:n,percentage:r}=t;t.partSize=0,r<100&&n.name.indexOf(".")!==-1&&t.client.multipartUpload(a,i,{parallel:this.parallel,partSize:this.partSize,progress:async(c,p,d)=>{await this.onUploadProgress(t,c,p,d,l)},checkpoint:o}).then(()=>{delete this.checkpoints[o.uploadId],this.$emit("update:modelValue",this.fileList),this.resumeDisabled=!0,this.unList.length&&this.uploadDisabled&&(this.resumeDisabled=!1),this.onCreatePanFile(t)}).catch(async c=>{await this.resetUpload(c,t)})}catch{}},async onUploadProgress(t,o,a,i,l){a&&(this.checkpoints[a.uploadId]=a,t.speed=this.handle_network_speed(i,this.partSize,o),t.tempCheckpoint=a,t.abortCheckpoint=a,t.upload=a.uploadId),t.isPlay=!0,t.isPlay&&(t.isLoading=!1),t.uploadName=l,t.percentage=Number((100*o).toFixed(2))},async ossUploadHandle(t){let o={pass:!0,filePath:""};try{const{raw:a,percentage:i}=t,l=a,n=await ca(this.signatureType,this.apiFunc,{},{secure:!0});if(this.signatureType=="aliyun_oss_type1"){if(t.client=n,t.partSize=0,i<100&&a.name.indexOf(".")!==-1){const r=n.dir+l.name;await t.client.multipartUpload(r,l,{parallel:this.parallel,partSize:this.partSize,progress:async(c,p,d)=>{await this.onUploadProgress(t,c,p,d,r)}}).then(()=>{this.$emit("upload:modelValue",this.fileList),this.resumeDisabled=!0,this.onCreatePanFile(t),this.unList.length&&this.uploadDisabled&&(this.resumeDisabled=!1)}).catch(async c=>{})}}else this.signatureType=="aliyun_oss_type2"&&$l(l,n)}catch(a){o={...a,pass:!1,filePath:""}}return o},getToday(){const t=new Date;return`${t.getFullYear()}${t.getMonth()+1}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`},handleChange(t,o){o.forEach(a=>{a.client=null,a.isPlay=!1,a.isLoading=!1,a.abortCheckpoint=!1}),this.fileList=o,this.file=t.raw,this.uploadDisabled=!1,this.pauseDisabled=this.resumeDisabled=!0},handleDeleteFile(t){const o=t.indexOf(this.model);t.substring(o,t.length),this.$emit("on-delete"),this.fileList=[],k.ElMessage.success("删除成功")},async onCreatePanFile(t){await this.getParams(t),this.$emit("on-update")},handleMediaRes:t=>({image:async function(o){return new Promise(a=>{var i=new FileReader;i.onload=function(l){var n=l.target.result,r=new Image;r.onload=function(){a({Width:this.width,Height:this.height})},r.src=n},i.readAsDataURL(o)})},audio:async function(o){return new Promise(a=>{var i=new FileReader;i.onload=function(l){var n=l.target.result,r=new Audio;r.onloadeddata=function(){const c=r.duration;a({Duration:1e3*c})},r.src=n},i.readAsDataURL(o)})},video:async function(o){return new Promise(a=>{var i=URL.createObjectURL(o);const l=document.createElement("video");l.src=i,l.onloadeddata=function(){a({CoverImg:"",Duration:1e3*this.duration,Width:this.videoWidth,Height:this.videoHeight})}})}})[t],captureImage:(t,o)=>t+"?x-oss-process=video/snapshot,t_"+(o=o||"3000 ")+",f_jpg",async getParams(t){const{type:o}=t.raw,a=o.indexOf("video")!==-1,i=o.indexOf("image")!==-1,l=o.indexOf("audio")!==-1;let n,r="";return a?r="video":i?o.indexOf("adobe")===-1&&(r="image"):l&&(r="audio"),(a||i||l)&&r&&(n=await this.handleMediaRes(r)(t.raw)),{ResTitle:t.name,ResDescribe:"",OssKey:t.uploadName,ContentType:o||"application/octet-stream",ContentLength:t.size,...n}}}},rr={class:"oss-upload"},sr={class:"cv-upload-task-hd-title"},cr={class:"cv-upload-task-hd-num"},dr={class:"cv-upload-task-opts"},pr={class:"cv-upload-task-lists"},hr={class:"cv-upload-task-item-name"},mr={class:"name"},ur={class:"file-name-item"},gr={key:0,class:"speed"},fr={key:1,class:"speed"},Cr={key:2,class:"success"},vr={class:"total"},yr={key:0,class:"name error"},kr={class:"cv-upload-task-item-tool"},br=["onClick"],wr=["onClick"],gt=v({name:"cvUploadOss",mixins:[ir]},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button"),c=e.resolveComponent("el-upload"),p=e.resolveComponent("el-progress"),d=e.resolveComponent("cv-icons"),h=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",rr,[e.createVNode(c,{ref:"upload",action:"","show-file-list":!1,multiple:"","on-change":t.handleChange,"before-upload":t.handleBeforeUpload,"auto-upload":!1,limit:100,"on-exceed":t.handleExceed,accept:t.accept},{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",icon:"ElIconUpload",round:""},{default:e.withCtx(()=>[...o[1]||(o[1]=[e.createTextVNode("上 传",-1)])]),_:1})]),_:1},8,["on-change","before-upload","on-exceed","accept"]),e.createVNode(h,{modelValue:t.dialogVisible,"onUpdate:modelValue":o[0]||(o[0]=u=>t.dialogVisible=u),width:"650px",height:"500","destroy-on-close":"","close-on-click-modal":!1,"before-close":t.handleClose,style:{height:"500px"}},{header:e.withCtx(()=>[e.createElementVNode("div",sr,[o[2]||(o[2]=e.createElementVNode("span",null,"上传",-1)),e.createElementVNode("span",cr,e.toDisplayString(t.fileList.length-t.unList.length)+"/"+e.toDisplayString(t.fileList.length),1)])]),default:e.withCtx(()=>[e.createElementVNode("div",dr,[e.createVNode(r,{type:"primary",icon:"ElIconVideoPlay",disabled:t.uploadDisabled,onClick:t.starUpload},{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode("开始上传",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(r,{type:"success",icon:"ElIconRefreshRight",disabled:t.resumeDisabled,onClick:t.resumeUpload},{default:e.withCtx(()=>[...o[4]||(o[4]=[e.createTextVNode("继续",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(r,{type:"danger",icon:"ElIconVideoPause",disabled:t.pauseDisabled,onClick:t.stopUpload},{default:e.withCtx(()=>[...o[5]||(o[5]=[e.createTextVNode("暂停",-1)])]),_:1},8,["disabled","onClick"])]),e.createElementVNode("div",pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fileList,(u,m)=>(e.openBlock(),e.createElementBlock("div",{class:"cv-upload-task-item-box",key:m},[e.createElementVNode("div",hr,[e.createElementVNode("div",mr,[e.createElementVNode("span",ur,e.toDisplayString(m+1)+"."+e.toDisplayString(u.name),1),u.isLoading&&!u.isPlay?(e.openBlock(),e.createElementBlock("span",gr,"准备就绪")):e.createCommentVNode("",!0),u.isPlay&&u.percentage!==100?(e.openBlock(),e.createElementBlock("span",fr,e.toDisplayString(u.speed)+"/s",1)):e.createCommentVNode("",!0),u.percentage===100?(e.openBlock(),e.createElementBlock("span",Cr,"完成")):e.createCommentVNode("",!0),e.createElementVNode("div",vr,e.toDisplayString(t.filterSize(u.size)),1)]),u.errMsg?(e.openBlock(),e.createElementBlock("span",yr,e.toDisplayString(u.errMsg),1)):e.createCommentVNode("",!0),u.percentage<100&&!u.errMsg?(e.openBlock(),e.createBlock(p,{key:1,percentage:u.percentage},null,8,["percentage"])):(e.openBlock(),e.createBlock(p,{key:2,percentage:u.percentage,status:u.errMsg?"exception":"success"},null,8,["percentage","status"]))]),e.createElementVNode("div",kr,[!u.percentage||0<u.percentage<100&&!u.isPlay?(e.openBlock(),e.createElementBlock("span",{key:0,class:"icon delete",onClick:f=>t.handleDeleteChangeFile(m)},[e.createVNode(d,{type:"ElIconClose"})],8,br)):e.createCommentVNode("",!0),u.percentage&&u.percentage!==100?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["icon",u.isPlay?"delete":"success"]),onClick:f=>t.handleStopChangeFile(m,u)},[u.isPlay?(e.openBlock(),e.createBlock(d,{key:0,type:"ElIconVideoPause"})):(e.openBlock(),e.createBlock(d,{key:1,type:"ElIconCaretRight"}))],10,wr)):e.createCommentVNode("",!0)])]))),128))])]),_:1},8,["modelValue","before-close"])])}],["__scopeId","data-v-9c3ea43c"]]);pt.install=function(t){t.component(pt.name,pt)},ht.install=function(t){t.component(ht.name,ht)},mt.install=function(t){t.component(mt.name,mt)},ut.install=function(t){t.component(ut.name,ut)},gt.install=function(t){t.component(gt.name,gt)};const Vr={class:"tabs-header"},ft=v({name:"cvTabsJump",props:{tabPosition:{type:String,default:"top"}},provide(){return{addChildComponents:t=>{this.childComponents.push(t)},clearChildClass:()=>{this.childComponents.map(t=>{t.className=null})}}},data:()=>({childComponents:[]}),computed:{tabPositionClass(){return this.tabPosition=="left"?"left":this.tabPosition=="right"?"right":this.tabPosition=="bottom"?"bottom":"top"}},created(){},mounted(){}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-tabs-jump",n.tabPositionClass])},[e.createElementVNode("div",Vr,[e.renderSlot(t.$slots,"default")])],2)}]]),xr={name:"cvTabPane",emits:["click"],inject:["addChildComponents","clearChildClass"],data:()=>({isshow:!0,className:null}),props:{label:{type:String,default:""},current:{type:Boolean,default:!1},name:{type:String}},mounted(){this.addChildComponents(this),this.initCurrent()},methods:{initCurrent(){this.current&&this.handleClick()},handleClick(){this.clearChildClass(),this.className="active",this.$emit("click")}}},Sr={key:1},Ct=v(xr,[["render",function(t,o,a,i,l,n){return e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-tab-pane",l.className]),onClick:o[0]||(o[0]=(...r)=>n.handleClick&&n.handleClick(...r))},[t.$slots.label?e.renderSlot(t.$slots,"label",{key:0}):(e.openBlock(),e.createElementBlock("span",Sr,e.toDisplayString(a.label),1))],2)),[[e.vShow,l.isshow]])}]]);ft.install=function(t){t.component(ft.name,ft)},Ct.install=function(t){t.component(Ct.name,Ct)};const Nr={class:"cv-draw-captcha"},Br=["width","height"],vt=v({name:"cvDrawCaptcha",props:{modelValue:{type:[String,Number],default:"1234"},baseCode:{type:String,default:"1234567890ABCDEFGHGKMNPQRSTUVWXY"},fontSizeMin:{type:Number,default:25},fontSizeMax:{type:Number,default:30},backgroundColorMin:{type:Number,default:255},backgroundColorMax:{type:Number,default:255},colorMin:{type:Number,default:0},colorMax:{type:Number,default:160},lineColorMin:{type:Number,default:100},lineColorMax:{type:Number,default:255},dotColorMin:{type:Number,default:0},dotColorMax:{type:Number,default:255},contentWidth:{type:Number,default:112},contentHeight:{type:Number,default:31},refreshNum:{type:Number,default:1}},data:()=>({localCode:""}),watch:{modelValue(t){this.localCode=t,this.drawPic()},refreshNum(){this.refreshCode(),this.drawPic()}},mounted(){this.modelValue==""&&(this.refreshCode(),this.drawPic())},created(){this.localCode=this.modelValue},methods:{refreshCode(){this.localCode="",this.makeCode(this.baseCode,4),this.$emit("update:modelValue",this.localCode)},makeCode(t,o){for(let a=0;a<o;a++)this.localCode+=this.baseCode[this.randomNum(0,this.baseCode.length)]},randomNum:(t,o)=>Math.floor(Math.random()*(o-t)+t),randomColor(t,o){return"rgb("+this.randomNum(t,o)+","+this.randomNum(t,o)+","+this.randomNum(t,o)+")"},drawPic(){let t=document.getElementById("cv-draw-captcha").getContext("2d");t.textBaseline="bottom",t.fillStyle=this.randomColor(this.backgroundColorMin,this.backgroundColorMax),t.fillRect(0,0,this.contentWidth,this.contentHeight);for(let o=0;o<this.localCode.length;o++)this.drawText(t,this.localCode[o],o);this.drawLine(t),this.drawDot(t)},drawText(t,o,a){t.fillStyle=this.randomColor(this.colorMin,this.colorMax),t.font=this.randomNum(this.fontSizeMin,this.fontSizeMax)+"px SimHei";let i=(a+1)*(this.contentWidth/(this.localCode.length+1)),l=this.randomNum(this.fontSizeMax,this.contentHeight-5);var n=this.randomNum(-45,45);t.translate(i,l),t.rotate(n*Math.PI/180),t.fillText(o,0,0),t.rotate(-n*Math.PI/180),t.translate(-i,-l)},drawLine(t){for(let o=0;o<5;o++)t.strokeStyle=this.randomColor(this.lineColorMin,this.lineColorMax),t.beginPath(),t.moveTo(this.randomNum(0,this.contentWidth),this.randomNum(0,this.contentHeight)),t.lineTo(this.randomNum(0,this.contentWidth),this.randomNum(0,this.contentHeight)),t.stroke()},drawDot(t){for(let o=0;o<80;o++)t.fillStyle=this.randomColor(0,255),t.beginPath(),t.arc(this.randomNum(0,this.contentWidth),this.randomNum(0,this.contentHeight),1,0,2*Math.PI),t.fill()}}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",Nr,[e.createElementVNode("canvas",{id:"cv-draw-captcha",width:a.contentWidth,height:a.contentHeight,onClick:o[0]||(o[0]=(...r)=>n.refreshCode&&n.refreshCode(...r))},null,8,Br)])}]]),yt=v({name:"cvDrawQrcode",data:()=>({})},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",null,"二维码")}]]);vt.install=function(t){t.component(vt.name,vt)},yt.install=function(t){t.component(yt.name,yt)};const Er={name:"cvTagBase",mixins:[],components:{},emits:["update:modelValue","exceed-max-length"],props:{...k.ElTag.props,modelValue:{type:[Array,Object],default:()=>[]},closable:{type:Boolean,default:!1},disableTransitions:{type:Boolean,default:!1},effect:{type:String,default:"light"},color:{type:String,default:""},hit:{type:Boolean,default:!1},type:{type:[String],default:"primary"},size:{type:[String],default:"large"},disabled:{type:Boolean,default:!1},maxlength:{type:Number,default:3,validator:t=>t>0}},watch:{modelValue(){this.localVal=this.modelValue},localVal(t){this.$emit("update:modelValue",t),t.length>=this.maxlength&&this.$emit("exceed-max-length",t.length)}},data(){return{localVal:this.modelValue}},methods:{addTag(){this.disabled||this.localVal.length>=this.maxlength||(this.localVal.push("新标签"),this.$nextTick(()=>{let t=this.localVal.length,o=this.$refs["newTag"+(t-1)][0],a=document.createRange();a.selectNodeContents(o),window.getSelection().removeAllRanges(),window.getSelection().addRange(a)}))},checkTag(t){if(this.disabled)return;let o=this.$refs[`newTag${t}`][0].innerText.trim();o.length==0?this.localVal.pop():this.localVal[t]=o},removeTag(t){this.disabled||this.localVal.splice(t,1)}}},Dr={class:"cv-tag-base"},Tr=["contenteditable","onKeyup","onBlur"],_r={key:1,class:"cv-tag-maxlength-hint"},kt=v(Er,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-tag"),c=e.resolveComponent("cv-icons");return e.openBlock(),e.createElementBlock("div",Dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.localVal,(p,d)=>(e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-tag-content"},{ref_for:!0},{closable:!a.disabled&&a.closable,disableTransitions:a.disableTransitions,effect:a.effect,type:a.type,color:a.color,hit:a.hit,size:a.size},{key:d,onClose:h=>n.removeTag(d),disabled:a.disabled}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:"cv-tag-item",contenteditable:!a.disabled&&"plaintext-only",ref_for:!0,ref:`newTag${d}`,onKeyup:e.withKeys(h=>!a.disabled&&n.checkTag(d),["enter"]),onBlur:h=>!a.disabled&&n.checkTag(d)},e.toDisplayString(p),41,Tr)]),_:2},1040,["onClose","disabled"]))),128)),!a.disabled&&l.localVal.length<a.maxlength?(e.openBlock(),e.createBlock(c,{key:0,type:"ElIconCirclePlus",size:"20",onClick:o[0]||(o[0]=p=>n.addTag())})):e.createCommentVNode("",!0),!a.disabled&&l.localVal.length>=a.maxlength?(e.openBlock(),e.createElementBlock("span",_r,"已达到最大数量 ("+e.toDisplayString(a.maxlength)+")",1)):e.createCommentVNode("",!0)])}]]);kt.install=function(t){t.component(kt.name,kt)};const Ir={name:"cvTransferTable",props:{modelValue:{type:[Array],default:()=>[]},showQuery:{type:Boolean,default:!1},showPagination:{type:Boolean,default:!1},paginationCallBack:{type:Function,default:function(){return new Promise((t,o)=>{try{t({total:0,data:null})}catch{o()}})}},titleTexts:{type:Array,default:()=>["待选项","已选项"]},buttonTexts:{type:Array,default:()=>[]},queryTexts:{type:Array,default:()=>["查询","筛选"]},leftColumns:{type:Array,default:()=>[]},rightColumns:{type:Array,default(){}},minHeight:{type:String,default:"300px"},maxHeight:{type:String,default:"500px"},tableRowKey:{type:Function,default:t=>t&&t&&t.id}},data:()=>({leftTableData:[],rightTableData:[],pageIndex:1,pageSize:20,totalSize:0,leftSelection:[],rightSelection:[],leftQueryCondition:{},rightQueryCondition:{},rightConditionTemp:void 0}),watch:{modelValue(t){this.rightTableData=t}},created(){this.rightTableData=this.modelValue,this.handlePaginationCallBack()},computed:{hasButtonTexts(){return this.buttonTexts.length===2},buttonClasses(){return["transfer-button",{"is-with-texts":this.hasButtonTexts}]},disabledLeftButton(){return!this.leftSelection.some(t=>!this.rightTableData.some(o=>this.checkObjectIsEqual(t,o)))},calcRightTableData(){if(this.showQuery&&this.rightConditionTemp){const t=Object.keys(this.rightConditionTemp);return this.rightTableData.filter(o=>t.some(a=>{const i=o[a],l=this.rightConditionTemp[a].trim();return!i||String(i).indexOf(l)>-1}))}return this.rightTableData}},methods:{handleLeftSelectionChange(t){this.leftSelection=t},handleRightSelectionChange(t){this.rightSelection=t},handleLeftRowClick(t){this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))||this.$refs.leftTable.toggleRowSelection(t)},handleRightRowClick(t){this.$refs.rightTable.toggleRowSelection(t)},handleSizeChange(t){this.pageSize=t,this.handlePaginationCallBack()},handleCurrentChange(t){this.pageIndex=t,this.handlePaginationCallBack()},handlePaginationCallBack(){if(this.showPagination&&this.paginationCallBack){const t={pageIndex:this.pageIndex,pageSize:this.pageSize,...this.leftQueryCondition};this.paginationCallBack.call(null,t).then(o=>{o&&Array.isArray(o.data)&&(this.leftTableData=o.data,this.totalSize=o.total),this.$nextTick(()=>{this.leftTableData.forEach(a=>{const i=this.rightTableData.some(l=>this.checkObjectIsEqual(l,a));this.$refs.leftTable.toggleRowSelection(a,i)})})})}},handleRowStyle({row:t}){return this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))?{color:"blue"}:{}},handleSelectable(t){return!this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))},addToRight(){for(const t of this.leftSelection)this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))||this.rightTableData.push(t);this.$emit("update:modelValue",this.rightTableData)},addToLeft(){this.rightSelection.forEach(t=>{const o=this.rightTableData.findIndex(a=>this.checkObjectIsEqual(a,t));if(o!==-1){this.rightTableData.splice(o,1);const a=this.leftTableData.find(i=>this.checkObjectIsEqual(i,t));a&&this.$refs.leftTable.toggleRowSelection(a,!1)}}),this.$emit("update:modelValue",this.rightTableData)},onLeftQuerySubmit(){this.handlePaginationCallBack()},onRightQuerySubmit(){this.rightConditionTemp=JSON.parse(JSON.stringify(this.rightQueryCondition))},checkObjectIsEqual(t,o){return this.tableRowKey(t)===this.tableRowKey(o)},clear(){this.rightTableData=[],this.$refs.leftTable.clearSelection();for(const t in this.leftQueryCondition)this.leftQueryCondition[t]=void 0;for(const t in this.rightQueryCondition)this.rightQueryCondition[t]=void 0;this.pageIndex=1,this.handlePaginationCallBack()}}},Lr={class:"cv-transfer-table"},Fr={class:"transfer-panel"},$r={class:"transfer-panel-header"},Or={key:0},Mr={style:{padding:"5px"}},zr={class:"transfer-buttons"},Pr={key:0,class:"button-text"},Hr={key:0,class:"button-text"},Ar={class:"transfer-panel"},jr={class:"transfer-panel-header"},Rr={key:0},Ur={style:{padding:"5px"}},bt=v(Ir,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button"),c=e.resolveComponent("el-form-item"),p=e.resolveComponent("el-form"),d=e.resolveComponent("el-table-column"),h=e.resolveComponent("el-table"),u=e.resolveComponent("el-pagination"),m=e.resolveComponent("cv-icons");return e.openBlock(),e.createElementBlock("div",Lr,[e.createElementVNode("div",Fr,[e.createElementVNode("p",$r,[e.createElementVNode("span",null,e.toDisplayString(a.titleTexts&&a.titleTexts[0]),1),e.createElementVNode("span",null,e.toDisplayString(l.leftSelection.length)+"/"+e.toDisplayString(l.leftTableData.length),1)]),a.showQuery?(e.openBlock(),e.createElementBlock("div",Or,[e.createVNode(p,{inline:!0,model:l.leftQueryCondition,class:"cv-transfer-form"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"leftCondition",{scope:l.leftQueryCondition}),e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",onClick:o[0]||(o[0]=f=>n.onLeftQuerySubmit())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.queryTexts[0]),1)]),_:1})]),_:1})]),_:3},8,["model"])])):e.createCommentVNode("",!0),e.createVNode(h,{ref:"leftTable","max-height":a.maxHeight,height:a.minHeight,data:l.leftTableData,"row-key":a.tableRowKey,"row-style":n.handleRowStyle,onRowClick:n.handleLeftRowClick,onSelectionChange:n.handleLeftSelectionChange,border:"",stripe:""},{default:e.withCtx(()=>[e.createVNode(d,{width:"40px",type:"selection",selectable:n.handleSelectable},null,8,["selectable"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.leftColumns,f=>(e.openBlock(),e.createBlock(d,{prop:f.id,key:f.id,label:f.label,width:f.width},{default:e.withCtx(C=>[e.renderSlot(t.$slots,"default",{scope:{row:C.row,col:f}},()=>[e.createElementVNode("span",null,e.toDisplayString(C.row[f.id]),1)])]),_:2},1032,["prop","label","width"]))),128))]),_:3},8,["max-height","height","data","row-key","row-style","onRowClick","onSelectionChange"]),e.createElementVNode("div",Mr,[a.showPagination?(e.openBlock(),e.createBlock(u,{key:0,onSizeChange:n.handleSizeChange,onCurrentChange:n.handleCurrentChange,"current-page":l.pageIndex,"page-sizes":[10,20,50,100],"page-size":l.pageSize,"pager-count":5,total:l.totalSize,layout:"total, sizes, prev, pager, next"},null,8,["onSizeChange","onCurrentChange","current-page","page-size","total"])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",zr,[e.createVNode(r,{type:"primary",class:e.normalizeClass(n.buttonClasses),disabled:n.disabledLeftButton,onClick:n.addToRight},{default:e.withCtx(()=>[a.buttonTexts[0]!==void 0?(e.openBlock(),e.createElementBlock("span",Pr,e.toDisplayString(a.buttonTexts[0]),1)):e.createCommentVNode("",!0),e.createVNode(m,{type:"ElIconArrowRight"})]),_:1},8,["class","disabled","onClick"]),e.createVNode(r,{type:"primary",class:e.normalizeClass(n.buttonClasses),disabled:l.rightSelection.length===0,onClick:n.addToLeft},{default:e.withCtx(()=>[e.createVNode(m,{type:"ElIconArrowLeft"}),a.buttonTexts[1]!==void 0?(e.openBlock(),e.createElementBlock("span",Hr,e.toDisplayString(a.buttonTexts[1]),1)):e.createCommentVNode("",!0)]),_:1},8,["class","disabled","onClick"])]),e.createElementVNode("div",Ar,[e.createElementVNode("p",jr,[e.createElementVNode("span",null,e.toDisplayString(a.titleTexts&&a.titleTexts[1]),1),e.createElementVNode("span",null,e.toDisplayString(l.rightSelection.length)+"/"+e.toDisplayString(l.rightTableData.length),1)]),a.showQuery?(e.openBlock(),e.createElementBlock("div",Rr,[e.createVNode(p,{inline:!0,model:l.rightQueryCondition,class:"cv-transfer-form"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"rightCondition",{scope:l.rightQueryCondition}),e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",onClick:o[1]||(o[1]=f=>n.onRightQuerySubmit())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.queryTexts[1]),1)]),_:1})]),_:1})]),_:3},8,["model"])])):e.createCommentVNode("",!0),e.createVNode(h,{ref:"rightTable","max-height":a.maxHeight,height:a.minHeight,data:n.calcRightTableData,"row-key":a.tableRowKey,onRowClick:n.handleRightRowClick,onSelectionChange:n.handleRightSelectionChange,border:"",stripe:""},{default:e.withCtx(()=>[e.createVNode(d,{width:"40px",type:"selection"}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.rightColumns||a.leftColumns,f=>(e.openBlock(),e.createBlock(d,{prop:f.id,key:f.id,label:f.label,width:f.width},{default:e.withCtx(C=>[e.renderSlot(t.$slots,"default",{scope:{row:C.row,col:f}},()=>[e.createElementVNode("span",null,e.toDisplayString(C.row[f.id]),1)])]),_:2},1032,["prop","label","width"]))),128))]),_:3},8,["max-height","height","data","row-key","onRowClick","onSelectionChange"]),e.createElementVNode("div",Ur,[a.showPagination?(e.openBlock(),e.createBlock(u,{key:0,total:l.rightTableData.length,layout:"total"},null,8,["total"])):e.createCommentVNode("",!0)])])])}]]);bt.install=function(t){t.component(bt.name,bt)};const Go={provide(){return{pageCurr:this.loadConfigSetting.pageCurr||1,pageLimit:this.loadConfigSetting.pageLimit||10}},props:{...k.ElTable.props,modelValue:{type:[Array,Object],default:()=>[]},headerCellStyle:{type:[Function,Object],default:()=>({})}},data:()=>({loadDataList:[]}),watch:{modelValue(t){this.loadDataList=t},loadDataList(t){this.$emit("update:modelValue",t)}},created(){this.loadDataList=this.modelValue},methods:{_getPageCurr(){return this.loadPageCurr},_getPageSize(){return this.loadPageLimit},handleCurrentChange(t){this.loadPageCurr=t,this.getData()},handleSizeChange(t){this.loadPageLimit=t,this.getData()}}},Wr={name:"cvTableBase",mixins:[to,Go],props:{align:{type:String,default:"left"},showPagebreak:{type:[Boolean,String],default:!0},tablePagin:{type:Object,default:()=>({})},tableConfig:{type:Object,default:()=>({})},tableRefresh:{type:Number,default:()=>0}},data:()=>({paginationGroup:[10,20,30,50,100,200],paginationCount:7,searchData:{},tableConfDef:{}}),watch:{tableRefresh(t,o){this.initConfAll(),this.refresh()}},updated(){},created(){this.initConfAll(),this.getData()},mounted(){},methods:{getData(){this.loadDataList=[],this.loadGetData()},handleSelectionChange(t){this.$emit("selection-change",t)},initConfAll(){let t={};Object.assign(t,this.loadConfigDef,this.tableConfDef,this.tableConfig),this.loadPageCurr=t.pageCurr||1,this.loadPageLimit=t.pageLimit||this.paginationGroup[0],Object.assign(t.where,this.searchData),this.loadConfigSetting=t},searchSubmit(t){this.searchData=t||{},this.loadConfigSetting.isSkip?this.searchData:(this.page=1,this.getData())},searchReset(t){this.searchData={},this.page=1,this.getData()},refresh(t){this.getData()}}},Yr={class:"cv-table-list"},qr={key:0,class:"cv-tablie-list-page page"},wt=v(Wr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table"),c=e.resolveComponent("cv-icons"),p=e.resolveComponent("el-button"),d=e.resolveComponent("el-pagination"),h=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Yr,[e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{data:t.loadDataList,style:{width:"100%"},onSelectionChange:n.handleSelectionChange}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["data","onSelectionChange"])),[[h,t.loadDataLoading]]),a.showPagebreak?e.withDirectives((e.openBlock(),e.createElementBlock("div",qr,[e.createVNode(p,{onClick:n.refresh,style:{float:"left",margin:"0 10px 0 0",padding:"5px 10px"}},{default:e.withCtx(()=>[e.createVNode(c,{type:"ElIconRefresh",size:"14"})]),_:1},8,["onClick"]),e.createVNode(d,{background:"",onSizeChange:t.handleSizeChange,onCurrentChange:t.handleCurrentChange,"pager-count":l.paginationCount,"page-sizes":l.paginationGroup,"current-page":t.loadPageCurr,"page-size":t.loadPageLimit,layout:"total, sizes, prev, pager, next, jumper",total:t.loadDataTotal},null,8,["onSizeChange","onCurrentChange","pager-count","page-sizes","current-page","page-size","total"])],512)),[[e.vShow,t.loadDataLoading===!1]]):e.createCommentVNode("",!0)])}]]),Xr={class:"cv-table-tree"},Vt=v({name:"cvTableTree",mixins:[to,Go],props:{tableConfig:{type:Object,default:()=>({})},tableRefresh:{type:Number,default:()=>0}},data:()=>({searchData:{},tableConfDef:{tablePrimary:"",childName:"children"},pager_count:7,page:1}),watch:{tableRefresh(t,o){this.refresh()}},created(){this.initConfAll(),this.getData()},mounted(){},methods:{getData(){this.loadDataList=[],this.loadGetData()},handleSelectionChange(t){this.$emit("selection-change",t)},initConfAll(){let t={};Object.assign(t,this.loadConfigDef,this.tableConfDef,this.tableConfig),Object.assign(t.where,this.searchData),this.loadConfigSetting=t},searchSubmit(t){this.searchData=t||{},this.loadConfigSetting.isSkip?this.searchData:(this.page=1,this.getData())},searchReset(t){this.searchData={},this.page=1,this.getData()},refresh(t){this.getData()}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table"),c=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Xr,[e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{data:t.loadDataList,style:{width:"100%"},onSelectionChange:n.handleSelectionChange,"row-key":t.loadConfigSetting.tablePrimary,"tree-props":{children:t.loadConfigSetting.childName,hasChildren:"hasChildren"}}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["data","onSelectionChange","row-key","tree-props"])),[[c,t.loadDataLoading]])])}]]),Kr={name:"cvTableEditor",mixins:[to,Go],props:{border:{type:[Boolean],default:!0},tableConfig:{type:[Array,Object],default:()=>({})}},data:()=>({mergeRules:{},apiFunc:null,tableConfDef:{},cell_click_index:null,cell_click_label:""}),watch:{},created(){this.loadConfigSetting=Object.assign({},this.tableConfDef,this.tableConfig)},mounted(){},methods:{cell_click(t,o,a,i){switch(this.cell_click_index=t.index,this.cell_click_label=o.label,o.label){case"taskid":case"taskname":this.cell_click_index=t.index,this.cell_click_label=o.label;break;default:return}},handleChangeTData(t){}}},Gr={class:"cv-table-editor"},xt=v(Kr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table"),c=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Gr,[e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{data:t.loadDataList,style:{width:"100%"},"row-class-name":"cv-tbed-tr"}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["data"])),[[c,t.loadDataLoading]])])}]]),St=v({name:"cvTbColumnIndex",inject:{pageCurr:{default:1},pageLimit:{default:10}},props:{...k.ElTableColumn.props,fixed:{type:[String],default:"left"},align:{type:String,default:"center"},width:{type:[String,Number],default:55},continuity:{type:[Boolean,String],default:!1}},data:()=>({}),created(){},methods:{indexMethod(t){return this.continuity&&this.pageCurr&&this.pageLimit?t+1+(this.pageCurr-1)*this.pageLimit:t+1}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{type:"index",index:n.indexMethod}),null,16,["index"])}]]),Nt=v({name:"cvTbColumnCheck",props:{...k.ElTableColumn.props,fixed:{type:[String],default:"left"},align:{type:[String],default:"center"},width:{type:[String,Number],default:55}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{type:"selection"}),null,16)}]]),Zr={name:"cvTbColumnText",props:{...k.ElTableColumn.props},data:()=>({}),created(){},methods:{getContentText(t){let o=t.row[this.prop];return this.formatter&&(o=this.formatter(t.row,t.column)),o}}},Qr={style:{display:"contents"}},Bt=v(Zr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.createElementVNode("div",Qr,e.toDisplayString(c.row[t.prop]),1)]),_:1},16)}]]),Jr={name:"cvTbColumnImg",props:{...k.ElTableColumn.props,imgWidth:{type:[String,Number],default:null},imgHeight:{type:[String,Number],default:null}},data:()=>({localImgWidth:"50px",localImgHeight:"50px",localImgArr:[],localImgOne:""}),created(){this.imgWidth&&(this.localImgWidth=this.imgWidth.indexOf("px")!==-1?this.imgWidth:this.imgWidth+"px"),this.imgHeight&&(this.localImgHeight=this.imgHeight.indexOf("px")!==-1?this.imgHeight:this.imgHeight+"px")},methods:{handleImgOne(t){let o=t[this.prop]||null;if(o){if(Object.prototype.toString.call(o)==="[object Array]")return o[0];if(Object.prototype.toString.call(o)==="[object String]")return o}},handleImgArr(t){let o=t[this.prop]||null;if(o){if(Object.prototype.toString.call(o)==="[object Array]")return o;if(Object.prototype.toString.call(o)==="[object String]")return[o]}},handleImgLeng(t){let o=t[this.prop]||null;return o?Object.prototype.toString.call(o)==="[object Array]"?o.length:Object.prototype.toString.call(o)==="[object String]"?1:void 0:0}}},es={key:0,class:"cv-table-column-img-mark"},ts={class:"cv-table-column-img-text"},Et=v(Jr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-image"),c=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(c,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(p=>[e.createElementVNode("div",{class:"cv-table-column-img-box",style:e.normalizeStyle({width:l.localImgWidth,height:l.localImgHeight})},[e.createVNode(r,{style:e.normalizeStyle({width:l.localImgWidth,height:l.localImgHeight}),fit:"scale-down",lazy:"",src:n.handleImgOne(p.row),"preview-src-list":n.handleImgArr(p.row)},{error:e.withCtx(()=>[...o[0]||(o[0]=[e.createElementVNode("span",{class:"el-image__error cv-table-column-img-err"},[e.createTextVNode(" 暂无 "),e.createElementVNode("br"),e.createTextVNode(" 图片 ")],-1)])]),_:1},8,["style","src","preview-src-list"]),n.handleImgLeng(p.row)>1?(e.openBlock(),e.createElementBlock("p",es,[e.createElementVNode("span",ts,e.toDisplayString(n.handleImgLeng(p.row))+"张",1)])):e.createCommentVNode("",!0)],4)]),_:1},16)}]]),Dt=v({name:"cvTbColumnOpt",props:{...k.ElTableColumn.props,fixed:{type:[String],default:"right"},label:{type:[String],default:"操作"}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({row:c.row,$index:c.$index,scope:c})))]),_:3},16)}]]),Tt=v({name:"cvTbColumnBase",props:{...k.ElTableColumn.props,width:{type:[String,Number],default:""}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({row:c.row,$index:c.$index,scope:c})))]),_:3},16)}]]),_t=v({name:"cvTbColumnExpand",props:{...k.ElTableColumn.props},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{type:"expand"}),{default:e.withCtx(c=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({row:c.row,$index:c.$index,props:c})))]),_:3},16)}]]),It=v({name:"cvTbColumnEnum",props:{...k.ElTableColumn.props,dataLists:{type:[Object,Array],default:()=>({})}},data:()=>({}),created(){},methods:{dealTypeEnum(t){let o=Object.keys(this.dataLists);return t[this.prop]?this.dataLists[t[this.prop]]||"":this.dataLists[o[0]]||""}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.createElementVNode("span",null,e.toDisplayString(n.dealTypeEnum(c.row)),1)]),_:1},16)}]]),os={name:"cvTbEditSearch",props:{...k.ElTableColumn.props,modelValue:{type:[String],default:""},align:{type:[String],default:"left"}},data:()=>({isEditIndex:null,localVal:"",autocompleteAttr:{debounce:0},searchSett:{searchFunc:null,searchParam:{},searchMockData:null,searchField:{}},searchResList:[],searchCurrClass:"",searchCurrTbIndex:0,searchIsSelect:!1}),watch:{modelValue(t){},localVal(t){this.$emit("update:modelValue",t)}},directives:{edfocus:{mounted:t=>{}}},created(){},methods:{searchEdit(t,o){this.isEditIndex=o,this.$nextTick(()=>{this.$refs[`cv-tbce-autocomplete${o}`].focus()})},searchSave(t,o){this.isEditIndex=null},searchSelect(t,o,a){this.searchIsSelect=!0,this.localTableData[a]=Object.assign(this.localTableData[a],t),this.localTableData[a].row_num=1,t.row_attr?this.localTableData[a].row_name=t.row_name+`<br><span class="cv-tbce-showtext-attr">[ ${t.row_attr} ]</span>`:this.localTableData[a].row_name=t.row_name},searchFocus(t,o){this.searchCurrClass="cvtegac"+t,this.searchCurrTbIndex=t},searchBlur(t,o){this.searchIsSelect||(this.isEditIndex=null)},searchQuery(t,o){this.searchIsSelect=!1,this.searchResList=[];const a=this.searchSett;if(a.searchMockData!=null&&a.searchMockData){if(!(typeof a.searchMockData!="Array"&&typeof a.searchMockData!="object")){const i=this.sortOutData(a.searchMockData);this.tableData=i,this.$message({message:i.msg||"",type:"warning",duration:1300})}this.$nextTick(()=>{this.tableLoading=!1})}else a.searchFunc&&typeof a.searchFunc=="function"&&a.searchFunc({page:1,pagesize:20,keyword:t,...a.searchParam}).then(i=>{this.searchResList=[...i.data],this.searchParseData(t,o)})},searchParseData(t,o){var a=[],i=[];const l=this.searchSett;if(this.searchResList.length>0){for(let n in this.searchResList){let r=this.searchResList[n];const c=l.searchField.row_price;r.row_price=r[c];const p=l.searchField.row_stock;r.row_stock=r[p];const d=l.searchField.row_attr;r.row_attr=r[d];const h=l.searchField.row_name;r.row_name=r[h];const u=l.searchField.row_unit;r.row_unit=r[u];const m=l.searchField.row_id;r.row_id=r[m],r.value=r.row_name,i.push(r)}a=i}clearTimeout(this.timeout),this.timeout=setTimeout(()=>{o(a)},600)},inputSearchFilter:t=>o=>o.value.toLowerCase().indexOf(t.toLowerCase())===0,searchIconClick(){this.isEditIndex=null}}},as={class:"name"},ls={class:"addr"},ns={class:"addr"},is={class:"droplist-item"},rs={class:"name"},ss={key:0,class:"attr"},cs={class:"price"},ds={class:"rest"},ps=["onClick"],Lt=v(os,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("ElIconCircleClose"),c=e.resolveComponent("el-icon"),p=e.resolveComponent("el-autocomplete"),d=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(d,e.mergeProps(t.$props,{"class-name":"cv-table-editor-search-column"}),{default:e.withCtx(h=>[l.isEditIndex==h.$index?(e.openBlock(),e.createBlock(p,e.mergeProps({key:0,ref:`cv-tbce-autocomplete${h.$index}`},l.autocompleteAttr,{modelValue:h.row[t.prop],"onUpdate:modelValue":u=>h.row[t.prop]=u,"popper-class":`cv-tbce-autocomplete cvtegac${h.$index}`,"fetch-suggestions":n.searchQuery,onSelect:u=>n.searchSelect(u,h.row,h.$index),onFocus:u=>n.searchFocus(h.$index,u),onBlur:u=>n.searchBlur(h.row,h.$index)}),{suffix:e.withCtx(()=>[e.createVNode(c,{onClick:u=>n.searchIconClick(h.row,h.$index)},{default:e.withCtx(()=>[e.createVNode(r)]),_:1},8,["onClick"])]),default:e.withCtx(({item:u})=>[e.renderSlot(t.$slots,"default",{item:u},()=>[e.createElementVNode("div",as,e.toDisplayString(u.row_name),1),e.createElementVNode("span",ls,"价格:"+e.toDisplayString(u.row_price),1),e.createElementVNode("span",ns,e.toDisplayString(u.row_rest),1),e.createElementVNode("div",is,[e.createElementVNode("div",rs,[e.createTextVNode(e.toDisplayString(u.row_name)+" ",1),u.row_attr?(e.openBlock(),e.createElementBlock("div",ss,"[ "+e.toDisplayString(u.row_attr)+"]",1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",cs,"¥ "+e.toDisplayString(u.row_price),1),e.createElementVNode("div",ds,e.toDisplayString(u.attr_stock),1)])])]),_:2},1040,["modelValue","onUpdate:modelValue","popper-class","fetch-suggestions","onSelect","onFocus","onBlur"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:"showtext",onClick:u=>n.searchEdit(h.row,h.$index)},e.toDisplayString(h.row[t.prop]),9,ps))]),_:3},16)}]]),Ft=v({name:"cvTbEditOpt",props:{tableData:{type:[Array],default:()=>[]},...k.ElTableColumn.props,label:{type:[String],default:"操作"},align:{type:[String],default:"center"},width:{type:[String],default:"100"},fixed:{type:[String],default:"left"},btnAdd:{type:[Boolean,String],default:!0},btnDel:{type:[Boolean,String],default:!0}},data:()=>({localTbData:[]}),watch:{tableData(t){this.localTbData=t}},created(){this.localTbData=this.tableData},methods:{optHdDelete(t,o){this.localTbData.splice(t,1),this.localTbData.length<1&&this.optHdAdd()},optHdAdd(){this.localTbData.push({})}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("el-button"),p=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(p,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[a.btnAdd?(e.openBlock(),e.createBlock(c,{key:0,plain:"",style:{padding:"5px",width:"26px",height:"26px"},onClick:o[0]||(o[0]=h=>n.optHdAdd())},{default:e.withCtx(()=>[e.createVNode(r,{type:"ElIconPlus"})]),_:1})):e.createCommentVNode("",!0),a.btnDel?(e.openBlock(),e.createBlock(c,{key:1,plain:"",style:{padding:"5px",width:"26px",height:"26px"},onClick:h=>n.optHdDelete(d.$index,d.row)},{default:e.withCtx(()=>[e.createVNode(r,{type:"ElIconClose"})]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1},16)}]]),hs={name:"cvTbEditText",props:{...k.ElTableColumn.props,width:{type:[String,Number],default:""},editAttr:{type:[Object],default:()=>({placeholder:"请输入"})},editClearable:{type:[Boolean],default:!0},editStyle:{type:[Object],default:()=>({"--el-input-border":0,"--el-input-border-radius":0,"--el-input-height":"36px"})},editClass:{type:[Object],default:()=>({})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}},toFixed:{type:[String,Number],default:""}},data:()=>({currValue:"",isEditIndex:null,isErrIndex:[]}),directives:{edfocus:{mounted:t=>{t.querySelector("input").focus()},inserted:function(t){t.querySelector("input").focus()}}},created(){},methods:{textIsError(t){return this.isErrIndex&&this.isErrIndex[t]&&this.isErrIndex[t][this.prop]},textHdEdit(t,o){this.isEditIndex=o},textHdClear(t,o){},textHdSave(t,o){this.isEditIndex=null;let a=t[this.prop];if(this.toFixed!=""){let i=parseInt(this.toFixed);isNaN(a)||(t[this.prop]=parseFloat(a).toFixed(i))}else t[this.prop]=a}},render22(t,o){let a=this;return t("el-table-column",{props:{...this.$props},scopedSlots:{default:i=>{this.currValue=i.row[this.prop];let l=i.$index;return this.isEditIndex==l?t("el-input",{props:{style:this.editStyle,class:this.editClass},domProps:{value:this.currValue},props:{placeholder:this.placeholder,value:this.param},nativeOn:{keyup:n=>{n.keyCode===13&&(this.$emit("update:param",n.target.value),this.callback&&this.callback())}},on:{blur:n=>{this.$emit("update:param",n.target.value),this.callback&&this.callback()},input:function(n){a.currValue=n||n.target.value},blur:n=>{this.isEditIndex=null,a.currValue=n||n.target.value}}},this.currValue):t("span",{class:{showtext:!0},on:{click:()=>{this.isEditIndex=l}}},this.currValue)}}})}},ms=["onClick"],$t=v(hs,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input"),c=e.resolveComponent("el-table-column"),p=e.resolveDirective("edfocus");return e.openBlock(),e.createBlock(c,e.mergeProps(t.$props,{"class-name":"cv-table-editor-text-column"}),{default:e.withCtx(d=>[l.isEditIndex!=d.$index||a.editAttr.disabled?(e.openBlock(),e.createElementBlock("span",{key:1,class:"showtext",onClick:h=>n.textHdEdit(d.row,d.$index)},e.toDisplayString(d.row[t.prop]),9,ms)):e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps({key:0},a.editAttr,{clearable:a.editClearable,style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":h=>d.row[t.prop]=h,onBlur:e.withModifiers(h=>n.textHdSave(d.row,d.$index),["prevent"]),onClear:h=>n.textHdClear(d.row,d.$index)}),null,16,["clearable","style","class","modelValue","onUpdate:modelValue","onBlur","onClear"])),[[p]])]),_:1},16)}]]),Ot=v({name:"cvTbEditRadio",props:{...k.ElTableColumn.props,editAttr:{type:[Object],default:()=>({})},editStyle:{type:[Object],default:()=>({})},editClass:{type:[Object],default:()=>({})},dataLists:{type:[Object,Array],default:()=>({})},dataField:{type:Object,default:()=>({label:"label",value:"value"})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-radio"),c=e.resolveComponent("el-radio-group"),p=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(p,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[e.createVNode(c,e.mergeProps({style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":h=>d.row[t.prop]=h},a.editAttr),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.dataLists,(h,u)=>(e.openBlock(),e.createBlock(r,{key:u,label:h[a.dataField.label],value:h[a.dataField.value]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h[a.dataField.label]),1)]),_:2},1032,["label","value"]))),128))]),_:1},16,["style","class","modelValue","onUpdate:modelValue"])]),_:1},16)}]]),Mt=v({name:"cvTbEditCheckbox",props:{...k.ElTableColumn.props,editAttr:{type:[Object],default:()=>({})},editStyle:{type:[Object],default:()=>({})},editClass:{type:[Object],default:()=>({})},dataLists:{type:[Object,Array],default:()=>({})},dataField:{type:Object,default:()=>({label:"label",value:"value"})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}}},data:()=>({localVal:[]}),created(){},methods:{handleParseValue(t){this.localVal=[]}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-checkbox"),c=e.resolveComponent("el-checkbox-group"),p=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(p,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[d.row[t.prop]?(e.openBlock(),e.createBlock(c,e.mergeProps({key:0,style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":h=>d.row[t.prop]=h},a.editAttr),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.dataLists,(h,u)=>(e.openBlock(),e.createBlock(r,{key:u,label:h[a.dataField.label],value:h[a.dataField.value]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h[a.dataField.label]),1)]),_:2},1032,["label","value"]))),128))]),_:1},16,["style","class","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)]),_:1},16)}]]),zt=v({name:"cvTbEditSelect",props:{...k.ElTableColumn.props,editAttr:{type:[Object],default:()=>({})},editStyle:{type:[Object],default:()=>({})},editClass:{type:[Object],default:()=>({})},dataLists:{type:[Object,Array],default:()=>({})},dataField:{type:Object,default:()=>({label:"label",value:"value"})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-option"),c=e.resolveComponent("el-select"),p=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(p,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[e.createVNode(c,e.mergeProps({style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":h=>d.row[t.prop]=h},a.editAttr),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.dataLists,(h,u)=>(e.openBlock(),e.createBlock(r,{key:u,label:h[a.dataField.label],value:h[a.dataField.value]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h[a.dataField.label]),1)]),_:2},1032,["label","value"]))),128))]),_:1},16,["style","class","modelValue","onUpdate:modelValue"])]),_:1},16)}]]);wt.install=function(t){t.component(wt.name,wt)},Vt.install=function(t){t.component(Vt.name,Vt)},xt.install=function(t){t.component(xt.name,xt)},St.install=function(t){t.component(St.name,St)},Nt.install=function(t){t.component(Nt.name,Nt)},Bt.install=function(t){t.component(Bt.name,Bt)},Et.install=function(t){t.component(Et.name,Et)},Dt.install=function(t){t.component(Dt.name,Dt)},Tt.install=function(t){t.component(Tt.name,Tt)},_t.install=function(t){t.component(_t.name,_t)},It.install=function(t){t.component(It.name,It)},Lt.install=function(t){t.component(Lt.name,Lt)},Ft.install=function(t){t.component(Ft.name,Ft)},$t.install=function(t){t.component($t.name,$t)},Ot.install=function(t){t.component(Ot.name,Ot)},Mt.install=function(t){t.component(Mt.name,Mt)},zt.install=function(t){t.component(zt.name,zt)};const us={width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},gs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",us,[...o[0]||(o[0]=[e.createElementVNode("rect",{width:"12",height:"12",rx:"2",fill:"#86909C"},null,-1),e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.98095 5.49307L8.22012 3.25389C8.28521 3.18881 8.39074 3.18881 8.45582 3.25389L8.69153 3.4896C8.75661 3.55468 8.75661 3.66021 8.69153 3.7253L6.45235 5.96447L8.69153 8.20364C8.75661 8.26873 8.75661 8.37426 8.69153 8.43934L8.45582 8.67505C8.39074 8.74013 8.28521 8.74013 8.22012 8.67505L5.98095 6.43587L3.74178 8.67505C3.67669 8.74013 3.57116 8.74013 3.50608 8.67505L3.27037 8.43934C3.20529 8.37426 3.20529 8.26873 3.27037 8.20364L5.50954 5.96447L3.27037 3.7253C3.20529 3.66021 3.20529 3.55468 3.27037 3.4896L3.50608 3.25389C3.57116 3.18881 3.67669 3.18881 3.74178 3.25389L5.98095 5.49307Z",fill:"white"},null,-1)])])}]]),fs={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"icon"},Cs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",fs,[...o[0]||(o[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.00002 0.666504C12.0501 0.666504 15.3334 3.94975 15.3334 7.99984C15.3334 12.0499 12.0501 15.3332 8.00002 15.3332C3.94993 15.3332 0.666687 12.0499 0.666687 7.99984C0.666687 3.94975 3.94993 0.666504 8.00002 0.666504ZM8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2ZM10.6667 5.66667V7.66667H9.33333V5.66667H10.6667ZM6.66667 5.66667V7.66667H5.33333V5.66667H6.66667ZM10.0767 9.33333H11.0495C11.1804 9.33333 11.2866 9.43951 11.2866 9.57048C11.2866 9.60754 11.2779 9.64409 11.2612 9.67718L11.244 9.71053C10.6294 10.8739 9.40726 11.6667 7.99998 11.6667C6.61523 11.6667 5.40977 10.8991 4.7859 9.76612L4.73786 9.67593C4.67845 9.56052 4.72385 9.4188 4.83926 9.35939C4.87253 9.34226 4.90941 9.33333 4.94683 9.33333H5.92347C6.02396 9.33332 6.11908 9.37865 6.18238 9.4567C6.26207 9.55496 6.32833 9.62955 6.38117 9.68046C6.80074 10.0847 7.37133 10.3333 7.99998 10.3333C8.63289 10.3333 9.20694 10.0814 9.62728 9.67224C9.67791 9.62296 9.74135 9.55121 9.8176 9.45698C9.88089 9.37877 9.97611 9.33333 10.0767 9.33333Z"},null,-1)])])}]]),vs={class:"comment-common-icon"},ys=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",vs,[...o[0]||(o[0]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:""},[e.createElementVNode("path",{d:"M4.88933 0.613974C4.92947 0.616946 4.96831 0.629568 5.00253 0.650767C6.67348 1.68589 7.55141 3.13884 7.63632 5.00962C7.947 5.00962 8.2245 4.65999 8.46882 3.96072L8.49487 3.88447C8.53862 3.75351 8.68025 3.68282 8.8112 3.72656C8.83398 3.73417 8.85554 3.74502 8.87522 3.75878C9.96316 4.5193 10.5048 5.50231 10.5 6.70782C10.4999 6.73762 10.4982 6.76675 10.495 6.7952C10.4985 6.86294 10.5 6.93131 10.5 7.00005C10.5 9.48533 8.48528 11.5 6 11.5C3.51472 11.5 1.5 9.48533 1.5 7.00005C1.5 6.90255 1.5031 6.80578 1.50921 6.70983C1.5062 6.70917 1.5031 6.70849 1.5 6.70782C1.50864 6.60849 1.52139 6.50994 1.53824 6.41219C1.54515 6.35775 1.55321 6.30373 1.56222 6.25003L1.57017 6.24983C1.7622 5.3813 2.28426 4.57601 3.13635 3.83394C4.00892 3.07405 4.50079 2.11523 4.61198 0.957499L4.62156 0.844839C4.63175 0.707146 4.75163 0.603784 4.88933 0.613974Z"})],-1)])])}]]),ks={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"icon"},bs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",ks,[...o[0]||(o[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14 1.3335C14.3514 1.3335 14.6394 1.60546 14.6648 1.95041L14.6666 2.00016V14.0002C14.6666 14.3516 14.3947 14.6396 14.0497 14.665L14 14.6668H1.99998C1.64853 14.6668 1.36059 14.3949 1.33514 14.0499L1.33331 14.0002V2.00016C1.33331 1.64871 1.60527 1.36077 1.95023 1.33532L1.99998 1.3335H14ZM13.3333 2.66618H2.66664V13.3328H13.3333V2.66618ZM11.9219 6.7879C11.9719 6.83791 12 6.90574 12 6.97647V11.7993C12 11.9098 11.9104 11.9993 11.8 11.9993H6.81615C6.7975 11.9993 6.77945 11.9968 6.76232 11.992L3.91042 11.9847C3.79996 11.9844 3.71063 11.8947 3.7109 11.7842C3.71102 11.7313 3.73209 11.6807 3.76948 11.6433L6.52468 8.88807C6.62882 8.78393 6.79766 8.78393 6.9018 8.88807L8.17297 10.1593L11.5447 6.7879C11.6489 6.68376 11.8177 6.68376 11.9219 6.7879ZM5.99997 3.99951V5.99951H3.99997V3.99951H5.99997Z"},null,-1)])])}]]),ws={class:"comment-common-icon"},Vs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",ws,[...o[0]||(o[0]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M586.624 234.624a74.624 74.624 0 1 1-149.184 0 74.624 74.624 0 0 1 149.12 0z m0 554.624a74.624 74.624 0 1 1-149.248 0 74.624 74.624 0 0 1 149.248 0zM512 586.624a74.624 74.624 0 1 0 0-149.248 74.624 74.624 0 0 0 0 149.248z",fill:"currentColor"})],-1)])])}]]),xs={class:"comment-common-icon",style:{color:"#1e80ff"}},Ss=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",xs,[...o[0]||(o[0]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1534"},[e.createElementVNode("path",{d:"M668.928 166.912c-20.48-53.504-47.9744-84.7872-82.0224-94.9248-33.5872-10.0352-61.952 4.096-76.032 13.9776-27.5456 19.3536-41.216 49.664-50.0224 74.1376-3.3792 9.3184-6.4512 19.0976-9.216 27.9552l-2.6624 8.3968a227.8912 227.8912 0 0 1-10.3936 27.9552c-25.344 52.9408-47.4112 84.5312-66.7648 104.96-18.944 19.968-36.4544 30.464-55.1936 39.7824a45.3632 45.3632 0 0 0-25.088 40.5504l-0.1024 480.7168c0 24.9344 20.2752 45.2096 45.2096 45.2096h423.0656c21.7088 0 38.144-6.912 50.0224-16.9984a72.192 72.192 0 0 0 14.4896-16.896l0.2048-0.2048 0.0512-0.1536 0.8192-1.024 1.2288-1.8944c39.424-63.7952 66.7648-114.688 88.2176-175.616 24.4224-69.4784 36.8128-129.6896 42.0352-176.64 5.12-45.6704 3.7888-81.664-1.5872-101.376a77.9776 77.9776 0 0 0-45.568-52.3264 116.5824 116.5824 0 0 0-45.4144-8.6016l-192.8192-2.6624c28.1088-115.0976 10.0864-181.6064-2.4576-214.3744zM64.0512 413.9008a45.2096 45.2096 0 0 1 45.1584-47.36H176.128c24.9344 0 45.2096 20.2752 45.2096 45.2096v480.6144a45.2096 45.2096 0 0 1-45.2096 45.2096h-44.288a45.2096 45.2096 0 0 1-45.1584-43.0592L64 413.952z","p-id":"1535"})],-1)])])}]]),Ns={class:"comment-common-icon"},Bs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",Ns,[...o[0]||(o[0]=[e.createElementVNode("svg",{t:"1650360973068",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1168",width:"200",height:"200"},[e.createElementVNode("path",{d:"M547.968 138.88c6.656-4.672 14.08-6.976 20.48-5.056 6.08 1.792 22.848 10.752 40.192 56.128 8.576 22.4 27.264 81.536-5.632 197.504a45.44 45.44 0 0 0 42.88 57.984l217.6 3.008h0.448a53.12 53.12 0 0 1 20.096 3.328 16.256 16.256 0 0 1 5.568 3.648 14.464 14.464 0 0 1 3.264 6.4c2.176 7.808 4.608 33.984-0.256 77.248-4.672 41.984-15.936 97.408-38.784 162.368-19.136 54.336-43.52 100.48-81.472 161.792a56.384 56.384 0 0 0-1.664 2.496l-0.128 0.128-1.408 2.112a7.872 7.872 0 0 1-1.28 1.472 3.84 3.84 0 0 1-1.28 0.64 20.48 20.48 0 0 1-6.848 0.96H356.032V421.44c19.712-10.624 40.704-24.576 62.592-47.616 25.472-26.88 51.008-64.768 78.208-121.6 5.568-11.584 9.856-24.384 13.632-36.032l3.072-9.856c2.688-8.448 5.184-16.384 8.064-24.32 8.064-22.4 16.128-36.032 26.368-43.136z m120.96 27.968c-20.48-53.44-48-84.736-81.984-94.912-33.6-9.984-61.952 4.16-76.032 14.08-27.584 19.264-41.28 49.6-50.048 74.048-3.392 9.344-6.464 19.2-9.216 27.968l-2.688 8.448a227.84 227.84 0 0 1-10.432 27.904c-25.28 52.928-47.36 84.544-66.752 104.96-18.944 19.968-36.48 30.464-55.168 39.808a45.376 45.376 0 0 0-25.088 40.576l-0.064 480.64c0 24.96 20.224 45.248 45.184 45.248h423.04c21.76 0 38.144-6.912 50.048-16.96a71.808 71.808 0 0 0 14.528-16.896l0.128-0.256 0.128-0.128 0.832-0.96 1.152-1.92c39.424-63.872 66.816-114.688 88.256-175.68a810.24 810.24 0 0 0 42.048-176.64c5.12-45.632 3.776-81.664-1.6-101.376a77.952 77.952 0 0 0-45.568-52.288 116.544 116.544 0 0 0-45.44-8.64l-192.768-2.688c28.096-115.072 10.048-181.568-2.496-214.336z m-604.864 247.04a45.184 45.184 0 0 1 45.12-47.296h67.008c24.96 0 45.184 20.288 45.184 45.248v480.64c0 24.96-20.224 45.12-45.184 45.12H131.84a45.184 45.184 0 0 1-45.12-43.072l-22.656-480.64z","p-id":"1169"})],-1)])])}]]),Es={width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:""},Ds=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",Es,[...o[0]||(o[0]=[e.createElementVNode("path",{"data-v-d6f79dbc":"","fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.99976 7.93206L10.0656 3.86619C10.1633 3.76856 10.3215 3.76856 10.4192 3.86619L10.7727 4.21975C10.8704 4.31738 10.8704 4.47567 10.7727 4.5733L6.35331 8.99272C6.15805 9.18798 5.84147 9.18798 5.6462 8.99272L1.22679 4.5733C1.12916 4.47567 1.12916 4.31738 1.22679 4.21975L1.58034 3.86619C1.67797 3.76856 1.83626 3.76856 1.93389 3.86619L5.99976 7.93206Z"},null,-1)])])}]]),Ts={class:"comment-common-icon"},_s=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",Ts,[...o[0]||(o[0]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:""},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.99951 0.5C9.03708 0.5 11.4995 2.96243 11.4995 6C11.4995 9.03757 9.03708 11.5 5.99951 11.5C2.96195 11.5 0.499512 9.03757 0.499512 6C0.499512 2.96243 2.96195 0.5 5.99951 0.5ZM6.25 3.49988C6.38807 3.49988 6.5 3.61181 6.5 3.74988V5.49988H8.25C8.38807 5.49988 8.5 5.61181 8.5 5.74988V6.24988C8.5 6.38795 8.38807 6.49988 8.25 6.49988H5.75C5.61193 6.49988 5.5 6.38795 5.5 6.24988V3.74988C5.5 3.61181 5.61193 3.49988 5.75 3.49988H6.25Z"})],-1)])])}]]),Is={class:"comment-common-icon"},Ls=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",Is,[...o[0]||(o[0]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1320",width:"200",height:"200"},[e.createElementVNode("path",{d:"M147.264 647.296V220.928c0-49.536 40.128-89.728 89.6-89.728H793.6c49.536 0 89.728 40.192 89.728 89.728v426.368c0 49.536-40.128 89.728-89.6 89.728h-145.216a47.04 47.04 0 0 0-28.16 9.408l-194.56 145.792a3.392 3.392 0 0 1-5.12-1.984l-26.752-116.672a47.04 47.04 0 0 0-45.824-36.544H236.992a89.728 89.728 0 0 1-89.728-89.728zM236.864 64A156.928 156.928 0 0 0 80 220.928l0.064 426.368a156.928 156.928 0 0 0 156.928 156.928h94.976l23.232 101.312 0.064 0.448a70.592 70.592 0 0 0 109.696 40.832l190.208-142.592H793.6a156.928 156.928 0 0 0 156.928-156.928l-0.064-426.368A156.928 156.928 0 0 0 793.536 64H236.928z m69.44 442.496a65.344 65.344 0 1 0 0-130.752 65.344 65.344 0 0 0 0 130.752z m268.8-65.344a65.344 65.344 0 1 1-130.752 0 65.344 65.344 0 0 1 130.752 0z m138.368 65.344a65.344 65.344 0 1 0 0-130.752 65.344 65.344 0 0 0 0 130.752z","p-id":"1321"})],-1)])])}]]),Fs={class:"cv-comment-emoji"},$s={class:"face-tooltip-head select-none"},Os=["onClick"],Ms=["src"],zs={class:"emoji-body select-none"},Ps={style:{padding:"0 5px"}},Hs=["onClick"],As={class:"emoji-btn select-none"},js={key:0},Rs=v(Object.assign({name:"CompInputEmoji"},{__name:"input-emoji",props:{emoji:{faceList:[],emojiList:[],allEmoji:{}},placement:"bottom"},emits:["addEmoji"],setup(t,{emit:o}){const a=t,i=e.ref(0),l=e.ref(0),n=e.ref(new Array(2)),{emojiList:r,faceList:c}=a.emoji;function p(){n.value[0]=r[0]}return(d,h)=>(e.openBlock(),e.createElementBlock("div",Fs,[e.createVNode(e.unref(k.ElPopover),{placement:t.placement,"popper-class":"emoji-popover",width:250,trigger:"click",onBeforeEnter:p},{reference:e.withCtx(()=>[e.createElementVNode("div",As,[d.$slots.default?e.renderSlot(d.$slots,"default",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock("div",js,[e.createVNode(e.unref(Cs)),h[0]||(h[0]=e.createElementVNode("span",null,"表情",-1))]))])]),default:e.withCtx(()=>[e.createElementVNode("div",$s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(u,m)=>(e.openBlock(),e.createElementBlock("label",{key:m,class:e.normalizeClass(i.value==m?"active":""),onClick:f=>function(C){switch(i.value=C,C){case 0:l.value=0;break;case 1:l.value=-50,n.value[1]=r[1]}}(m)},[e.createElementVNode("img",{src:u,alt:""},null,8,Ms)],10,Os))),128))]),e.createElementVNode("div",zs,[e.createElementVNode("div",{class:"emjio-container",style:e.normalizeStyle({transform:`translateX(${l.value}%)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(u,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"emoji-wrapper"},[e.createVNode(e.unref(k.ElScrollbar),null,{default:e.withCtx(()=>[e.createElementVNode("div",Ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u,(f,C)=>(e.openBlock(),e.createElementBlock("span",{key:C,class:"emoji-item",onClick:g=>d.$emit("addEmoji",C)},[e.createVNode(e.unref(k.ElImage),{src:f,title:String(C),class:"emoji",style:{width:"24px",height:"24px",margin:"5px"},lazy:""},null,8,["src","title"])],8,Hs))),128))])]),_:2},1024)]))),128))],4)])]),_:3},8,["placement"])]))}}),[["__scopeId","data-v-2fb59975"]]),Us={class:"cv-comment-editor"},Ws=["placeholder","innerHTML"],Ys=["src"],qs=["onClick"],Xs={key:0,class:"cv-comment-editor__action"},Ks={__name:"input-box",props:{placeholder:"",contentBtn:"",parentId:"",reply:""},emits:["hide","close"],setup(t,{expose:o,emit:a}){const i=t,l=e.ref(""),n=e.ref(),r=e.ref(!1),c=e.ref(!1),p=e.ref(),d=e.ref(!0),h=e.ref(),u=e.ref(),m=e.ref([]),f=e.ref([]),C=e.reactive({imgLength:0}),g=64,y=e.ref(),b=e.ref(!1),w=e.ref(),V=e.computed(()=>g+"px"),S=e.computed(()=>"8px 12px"),B=a,{upload:T,submit:_,focus:O}=e.inject("InjectInputBox"),ae=e.inject("InjectionEmojiApi");function ea(){_({content:i.reply?`回复 <span style="color: var(--cv-color-success-dark-2);">@${i.reply.user.username}:</span> ${l.value}`:l.value,parentId:oe(i.parentId,null),reply:i.reply,files:f.value,clear:()=>{p.value&&(p.value.innerHTML="",l.value=p.value.innerHTML,r.value=!1),m.value.length=0,f.value=[],d.value=!0,B("close")}})}function Gl(D){ee(l.value)&&!C.imgLength&&(c.value=!1,B("hide",D))}function Zl(D){b.value=!0,r.value=!0,c.value=!0,e.nextTick(()=>{h.value=document.querySelector("div[id^='el-popper-container']")}),O()}function Ql(D){y.value=window.getSelection()?.getRangeAt(0),p.value?.innerHTML||(r.value=!1),b.value=!1}function Jl(D){const{innerHTML:N}=D?.target||D;l.value=N||"",ee(l.value.replace(/ |<br>| /g,""))?d.value=!0:d.value=!1}function ta(){e.nextTick(()=>{p.value?.focus()})}function en(D){D.ctrlKey&&D.key=="Enter"&&(ee(l.value.replace(/ |<br>| /g,""))?k.ElMessage({message:"内容不能为空",type:"info"}):ea())}function tn(D){m.value.length=0,f.value.length=0;const N=u.value?.files;if(C.imgLength=oe(N?.length,0),N)for(let I=0;I<N.length;I++){let G=N[I].name,le=($=N[I],window.URL?window.URL.createObjectURL($):window.webkitURL?window.webkitURL.createObjectURL($):"");f.value.push(N[I]),Kn(G)?m.value.push(le):k.ElMessage({type:"warn",message:"请选择图片类型文件!",duration:2500})}var $}return e.watch(()=>l.value,D=>{b.value||(n.value=D)}),e.onMounted(()=>{p.value?.addEventListener("keyup",D=>{const N=D.target;N.innerHTML=="<br>"&&(N.innerHTML="")})}),o({focus:()=>ta()}),(D,N)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",Us,[e.createElementVNode("div",{class:e.normalizeClass(["cv-comment-editor__box",{active:r.value,"input-active":c.value}])},[e.createElementVNode("div",{ref_key:"editorRef",ref:p,class:"rich-input",contenteditable:"true",placeholder:i.placeholder,onFocus:Zl,onInput:Jl,onBlur:Ql,onKeydown:e.withKeys(en,["enter"]),innerHTML:n.value,style:e.normalizeStyle({minHeight:V.value,padding:S.value})},null,44,Ws),e.createElementVNode("div",{ref_key:"imageRef",ref:w,class:"image-preview-box"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,($,I)=>(e.openBlock(),e.createElementBlock("div",{key:I,class:"image-preview"},[e.createElementVNode("img",{src:$,alt:""},null,8,Ys),e.createElementVNode("div",{class:"clean-btn",onClick:G=>{return le=I,void m?.value?.splice(le,1);var le}},[e.createVNode(e.unref(gs))],8,qs)]))),128))],512)],2),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",Xs,[e.createElementVNode("div",null,[e.createVNode(Rs,{emoji:e.unref(ae),onAddEmoji:N[0]||(N[0]=$=>function(I){let G=window.getSelection();G&&(G.removeAllRanges(),y.value||(ta(),y.value=G.getRangeAt(0)),y.value.deleteContents(),y.value.insertNode(y.value.createContextualFragment(I)),y.value.collapse(!1),G.addRange(y.value),l.value=p?.value?.innerHTML||"",ee(l.value.replace(/ |<br>| /g,""))?d.value=!0:d.value=!1)}($))},null,8,["emoji"]),e.createElementVNode("div",{class:"picture",onClick:N[1]||(N[1]=(...$)=>u.value?.click&&u.value?.click(...$))},[e.createVNode(e.unref(bs)),N[2]||(N[2]=e.createElementVNode("span",null,"图片",-1)),e.createElementVNode("input",{id:"comment-upload",ref_key:"inputRef",ref:u,type:"file",multiple:"",onChange:tn},null,544)])]),e.createElementVNode("div",null,[N[3]||(N[3]=e.createElementVNode("span",{style:{"margin-right":"10px"}},[e.createTextVNode(" 文明上网理性发言,请遵守 "),e.createElementVNode("a",{href:"###",target:"_blank"},"《新闻评论服务协议》")],-1)),e.createVNode(e.unref(k.ElButton),{type:"primary",disabled:d.value,onClick:ea},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.contentBtn),1)]),_:1},8,["disabled"])])])):e.createCommentVNode("",!0)]),_:1})])),[[e.unref(k.ClickOutside),Gl,h.value]])}},Ml=v(Ks,[["__scopeId","data-v-e3fd437e"]]),Gs={class:"u-fold"},Zs={class:"action-box select-none"},Qs=v(Object.assign({name:"UFold"},{__name:"fold",props:{line:{type:[Number,String],default:5}},setup(t){e.useCssVars(c=>({v15491e60:a.value}));const o=t,a=e.computed(()=>{let c=Math.trunc(Number(o.line));return c>0?c:1}),i=e.ref(!0),l=e.ref(!1),n=e.ref();let r;return e.onMounted(()=>{r=new ResizeObserver(c=>{i.value&&n.value&&(l.value=n.value.offsetHeight<n.value.scrollHeight)}),r.observe(n.value)}),e.onUnmounted(()=>{r.disconnect()}),(c,p)=>(e.openBlock(),e.createElementBlock("div",Gs,[e.createElementVNode("div",{class:e.normalizeClass(["txt-box",{"over-hidden":i.value}])},[e.createElementVNode("div",{ref_key:"divBox",ref:n},[e.renderSlot(c.$slots,"default",{},void 0,!0)],512)],2),e.createElementVNode("div",Zs,[l.value&&c.unfold?(e.openBlock(),e.createElementBlock("div",{key:0,class:"expand-btn",onClick:p[0]||(p[0]=d=>i.value=!i.value)},e.toDisplayString(i.value?"展开":"收起"),1)):e.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-94334818"]]),da={__name:"user-card",props:{uid:""},setup(t){const o=e.ref({}),{showInfo:a}=e.inject("InjectContentBox"),i=e.inject("InjectSlots"),l=()=>e.h("div",i.card(o.value));return(n,r)=>e.unref(i).card?(e.openBlock(),e.createBlock(e.unref(k.ElPopover),{key:0,placement:"top",width:300,"show-after":300,onBeforeEnter:r[0]||(r[0]=()=>e.unref(a)(t.uid,c=>o.value=c))},{reference:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),default:e.withCtx(()=>[e.createVNode(l)]),_:3})):e.renderSlot(n.$slots,"default",{key:1})}};function zl(t){return!!e.getCurrentScope()&&(e.onScopeDispose(t),!0)}const Zo=typeof window<"u"&&typeof document<"u";const Js=Object.prototype.toString,ec=t=>Js.call(t)==="[object Object]";function so(t){return Array.isArray(t)?t:[t]}const tc=Zo?window:void 0,Pl=Zo?window.navigator:void 0;function Hl(...t){const o=[],a=()=>{o.forEach(p=>p()),o.length=0},i=e.computed(()=>{const p=so(e.toValue(t[0])).filter(d=>d!=null);return p.every(d=>typeof d!="string")?p:void 0}),l=(n=()=>{var p,d;return[(d=(p=i.value)==null?void 0:p.map(h=>function(u){var m;const f=e.toValue(u);return(m=f?.$el)!=null?m:f}(h)))!=null?d:[tc].filter(h=>h!=null),so(e.toValue(i.value?t[1]:t[0])),so(e.unref(i.value?t[2]:t[1])),e.toValue(i.value?t[3]:t[2])]},r=([p,d,h,u])=>{if(a(),!p?.length||!d?.length||!h?.length)return;const m=ec(u)?{...u}:u;o.push(...p.flatMap(f=>d.flatMap(C=>h.map(g=>((y,b,w,V)=>(y.addEventListener(b,w,V),()=>y.removeEventListener(b,w,V)))(f,C,g,m)))))},c={flush:"post"},e.watch(n,r,{...c,immediate:!0}));var n,r,c;return zl(a),()=>{l(),a()}}function oc(){const t=e.shallowRef(!1),o=e.getCurrentInstance();return o&&e.onMounted(()=>{t.value=!0},o),t}function Al(t){const o=oc();return e.computed(()=>(o.value,!!t()))}function pa(t,o={}){const{controls:a=!1,navigator:i=Pl}=o,l=Al(()=>i&&"permissions"in i),n=e.shallowRef(),r=typeof t=="string"?{name:t}:t,c=e.shallowRef(),p=()=>{var h,u;c.value=(u=(h=n.value)==null?void 0:h.state)!=null?u:"prompt"};Hl(n,"change",p,{passive:!0});const d=function(h){let u;function m(){return u||(u=h()),u}return m.reset=async()=>{const f=u;u=void 0,f&&await f},m}(async()=>{if(l.value){if(!n.value)try{n.value=await i.permissions.query(r)}catch{n.value=void 0}finally{p()}return a?e.toRaw(n.value):void 0}});return d(),a?{state:c,isSupported:l,query:d}:c}function ac(t={}){const{navigator:o=Pl,read:a=!1,source:i,copiedDuring:l=1500,legacy:n=!1}=t,r=Al(()=>o&&"clipboard"in o),c=pa("clipboard-read"),p=pa("clipboard-write"),d=e.computed(()=>r.value||n),h=e.shallowRef(""),u=e.shallowRef(!1),m=function(C,g,y={}){const{immediate:b=!0,immediateCallback:w=!1}=y,V=e.shallowRef(!1);let S;function B(){S&&(clearTimeout(S),S=void 0)}function T(){V.value=!1,B()}function _(...O){w&&C(),B(),V.value=!0,S=setTimeout(()=>{V.value=!1,S=void 0,C(...O)},e.toValue(g))}return b&&(V.value=!0,Zo&&_()),zl(T),{isPending:e.shallowReadonly(V),start:_,stop:T}}(()=>u.value=!1,l,{immediate:!1});function f(C){return C==="granted"||C==="prompt"}return d.value&&a&&Hl(["copy","cut"],async function(){let C=!(r.value&&f(c.value));if(!C)try{h.value=await o.clipboard.readText()}catch{C=!0}var g,y,b;C&&(h.value=(b=(y=(g=document?.getSelection)==null?void 0:g.call(document))==null?void 0:y.toString())!=null?b:"")},{passive:!0}),{isSupported:d,text:h,copied:u,copy:async function(C=e.toValue(i)){if(d.value&&C!=null){let g=!(r.value&&f(p.value));if(!g)try{await o.clipboard.writeText(C)}catch{g=!0}g&&function(y){const b=document.createElement("textarea");b.value=y??"",b.style.position="absolute",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),b.remove()}(C),h.value=C,u.value=!0,m.start()}}}}const lc={class:"comment-list-actbox__right"},nc={class:"operation-warp"},ic={class:"dialog-footer"},rc={__name:"comment-operate",props:{data:{type:[Object],default:()=>({})}},setup(t){const{copy:o}=ac(),a=e.ref(!1),i=e.ref({report_type:"",report_content:""}),l=t;function n(){let r=l.data||{};a.value=!1,k.ElMessage({type:"info",message:"举报成功: "+r.id})}return(r,c)=>{const p=e.resolveComponent("el-dropdown-item"),d=e.resolveComponent("el-dropdown-menu"),h=e.resolveComponent("el-dropdown"),u=e.resolveComponent("el-radio"),m=e.resolveComponent("el-radio-group"),f=e.resolveComponent("el-form-item"),C=e.resolveComponent("el-input"),g=e.resolveComponent("el-form"),y=e.resolveComponent("el-button"),b=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",lc,[e.createVNode(h,{trigger:"click",onCommand:c[0]||(c[0]=w=>function(V){let S=l.data||{};switch(V){case"remove":setTimeout(()=>{commentRef.value?.remove(S)},200);break;case"report":a.value=!0;break;case"copy":o(S.content),k.ElMessage({type:"info",message:"复制成功"})}}(w))},{dropdown:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>[e.createVNode(p,{command:"report"},{default:e.withCtx(()=>[...c[5]||(c[5]=[e.createTextVNode("举报",-1)])]),_:1}),e.createVNode(p,{command:"remove"},{default:e.withCtx(()=>[...c[6]||(c[6]=[e.createTextVNode("删除",-1)])]),_:1}),e.createVNode(p,{divided:"",command:"copy"},{default:e.withCtx(()=>[...c[7]||(c[7]=[e.createTextVNode("复制",-1)])]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",nc,[e.createVNode(e.unref(Vs))])]),_:1}),e.createVNode(b,{title:"举报",modelValue:a.value,"onUpdate:modelValue":c[4]||(c[4]=w=>a.value=w),width:"400px",style:{width:"90%","max-width":"400px"}},{footer:e.withCtx(()=>[e.createElementVNode("span",ic,[e.createVNode(y,{onClick:c[3]||(c[3]=w=>a.value=!1)},{default:e.withCtx(()=>[...c[13]||(c[13]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(y,{type:"primary",onClick:n},{default:e.withCtx(()=>[...c[14]||(c[14]=[e.createTextVNode("提交",-1)])]),_:1})])]),default:e.withCtx(()=>[e.createVNode(g,{"label-position":"top"},{default:e.withCtx(()=>[e.createVNode(f,{label:"您为什么要举报此信息?"},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:i.value.report_type,"onUpdate:modelValue":c[1]||(c[1]=w=>i.value.report_type=w)},{default:e.withCtx(()=>[e.createVNode(u,{value:"色情淫秽"},{default:e.withCtx(()=>[...c[8]||(c[8]=[e.createTextVNode("色情淫秽",-1)])]),_:1}),e.createVNode(u,{value:"骚扰谩骂"},{default:e.withCtx(()=>[...c[9]||(c[9]=[e.createTextVNode("骚扰谩骂",-1)])]),_:1}),e.createVNode(u,{value:"广告欺诈"},{default:e.withCtx(()=>[...c[10]||(c[10]=[e.createTextVNode("广告欺诈",-1)])]),_:1}),e.createVNode(u,{value:"反动"},{default:e.withCtx(()=>[...c[11]||(c[11]=[e.createTextVNode("反动",-1)])]),_:1}),e.createVNode(u,{value:"其他"},{default:e.withCtx(()=>[...c[12]||(c[12]=[e.createTextVNode("其他",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(f,{label:"举报说明(可选):"},{default:e.withCtx(()=>[e.createVNode(C,{type:"textarea",modelValue:i.value.report_content,"onUpdate:modelValue":c[2]||(c[2]=w=>i.value.report_content=w),maxlength:"200",placeholder:"描述恶意行为",rows:"3"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}},sc={class:"comment-sub"},cc=["href"],dc={class:"comment-primary"},pc={class:"comment-main"},hc={key:1,class:"user-info"},mc=["href"],uc={class:"username"},gc={class:"name",style:{"max-width":"10em"}},fc={blank:"true",class:"rank"},Cc=["innerHTML"],vc={class:"address",style:{color:"#939393","font-size":"12px"}},yc={class:"time"},kc={class:"content"},bc=["innerHTML"],wc={class:"imgbox",style:{display:"flex"}},Vc={class:"comment-list-actbox select-none"},xc={class:"comment-list-actbox__left"},Sc={key:2},Nc={class:"comment-list-actbox__right"},Bc={key:2},Ec={__name:"content-box",props:{reply:{type:[Boolean],default:!1},data:{type:[Object],default:()=>({})},id:{type:[String],default:""}},setup(t){const o=t,a=e.reactive({active:!1}),i=e.ref(),l=e.ref(),n=e.computed(()=>{let y=o.data.contentImg;return ee(y)?[]:y?.split("||")}),{allEmoji:r}=e.inject("InjectionEmojiApi"),{like:c,user:p,relativeTime:d}=e.inject("InjectContentBox");function h(){a.active=!a.active,a.active&&e.nextTick(()=>{i.value?.focus()})}function u(y){const b=y.target;l.value?.contains(b)||(a.active=!1)}const m=e.inject("InjectSlots"),f=()=>e.h("div",m.info(o.data)),C=e.computed(()=>((y,b)=>b.replace(/\[.+?\]/g,w=>{const V=y[w];return V?['<img src="',V,'" width="20" height="20" alt="',w,'" title="',w,'" style="margin: 0 1px; vertical-align: text-bottom"',"/>"].join(""):w}))(r,o.data.content)),g=y=>{switch(y){case 1:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="831"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#8CDBF4" p-id="832"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="833"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m950.857143-365.714285l73.142857-73.142858v146.285715h-73.142857z m73.142857-73.142858h146.285715v146.285715h-146.285715z m0 146.285715h146.285715v438.857143h-146.285715z" fill="#FFFFFF"></path></svg>';case 2:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="765"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#6ECEFF" p-id="766"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="767"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m877.714286-438.857143h365.714286v146.285715h-365.714286z m219.428572 146.285715h146.285714v146.285714h-146.285714z m-219.428572 292.571428V512h146.285714v146.285714z" fill="#FFFFFF" p-id="768"></path><path d="M1097.142857 585.142857V438.857143h365.714286v146.285714z m0 73.142857h365.714286v146.285715h-365.714286z" fill="#FFFFFF"></path></svg>';case 3:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="799"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#599DFF" p-id="800"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="801"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m877.714286-438.857143h365.714286v146.285715h-365.714286z m219.428572 146.285715h146.285714v73.142857h-146.285714z m0 219.428571h146.285714v73.142857h-146.285714z m-146.285715-146.285714h292.571429v146.285714h-292.571429z m-73.142857 219.428571h365.714286v146.285715h-365.714286z" fill="#FFFFFF"></path></svg>';case 4:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="815"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#34D19B" p-id="816"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="817"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m975.213715-365.714285L1243.428571 219.428571v219.428572h-146.285714zM1097.142857 438.857143h146.285714v292.571428h-146.285714z m146.285714 146.285714h73.142858v146.285714h-73.142858z m0-365.714286h73.142858v146.285715h-73.142858z m73.142858 0h146.285714v585.142858h-146.285714z" fill="#FFFFFF"></path></svg>';case 5:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="782"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#FFA000" p-id="783"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="784"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m1097.142858-73.142857h146.285714v219.428572h-146.285714z m-219.428572-365.714286h365.714286v146.285715h-365.714286z m0 438.857143h219.428572v146.285715h-219.428572z m73.142857-219.428571h219.428572v146.285714h-219.428572z" fill="#FFFFFF" p-id="785"></path><path d="M1316.571429 438.857143h146.285714v146.285714h-146.285714z m-219.428572-73.142857h146.285714v219.428571h-146.285714z" fill="#FFFFFF"></path></svg>';case 6:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="748"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#F36262" p-id="749"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="750"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m1097.142858-146.285714h146.285714v292.571429h-146.285714z m-73.142858-292.571429h146.285715v146.285715h-146.285715z m-146.285714 146.285715h146.285714v438.857143h-146.285714z" fill="#FFFFFF" p-id="751"></path><path d="M1243.428571 438.857143h219.428572v146.285714h-219.428572z m-48.786285-170.642286L1243.428571 219.428571v146.285715h-146.285714zM1243.428571 658.285714h146.285715v146.285715h-146.285715z" fill="#FFFFFF"></path></svg>';default:return""}};return(y,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["comment",{reply:o.reply}])},[e.createElementVNode("div",sc,[e.createVNode(da,{uid:e.unref(Z)(t.data.uid)},{default:e.withCtx(()=>[e.createElementVNode("a",{href:t.data.user.homeLink,target:"_blank",class:"no-underline",style:{display:"block"}},[e.createVNode(e.unref(k.ElAvatar),{style:{"margin-top":"5px"},size:40,fit:"cover",src:t.data.user.avatar},{default:e.withCtx(()=>[...b[2]||(b[2]=[e.createElementVNode("img",{src:"https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"},null,-1)])]),_:1},8,["src"])],8,cc)]),_:1},8,["uid"])]),e.createElementVNode("div",dc,[e.createElementVNode("div",pc,[e.unref(m).info?(e.openBlock(),e.createBlock(f,{key:0})):(e.openBlock(),e.createElementBlock("div",hc,[e.createVNode(da,{uid:e.unref(Z)(t.data.uid)},{default:e.withCtx(()=>[e.createElementVNode("a",{href:t.data.user.homeLink,target:"_blank",class:"no-underline",style:{display:"block"}},[e.createElementVNode("div",uc,[e.createElementVNode("span",gc,e.toDisplayString(t.data.user.username),1),e.createElementVNode("span",fc,[e.createElementVNode("i",{class:"comment-common-icon",style:{"font-size":"24px"},innerHTML:g(t.data.user.level)},null,8,Cc)])])],8,mc)]),_:1},8,["uid"]),e.createElementVNode("span",vc," "+e.toDisplayString(t.data.address),1),e.createElementVNode("time",yc,e.toDisplayString(e.unref(d)?e.unref(Xn)(t.data.createTime):t.data.createTime),1)])),e.createElementVNode("div",kc,[e.createVNode(Qs,{unfold:""},{default:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:C.value},null,8,bc),e.createElementVNode("div",wc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(w,V)=>(e.openBlock(),e.createBlock(e.unref(k.ElImage),{key:V,src:w,style:{height:"72px",padding:"8px 4px"},lazy:"","preview-src-list":n.value,"initial-index":V},null,8,["src","preview-src-list","initial-index"]))),128))])]),_:1})]),e.createElementVNode("div",Vc,[e.createElementVNode("div",xc,[e.createElementVNode("div",{"data-tip":"点赞",class:"item",onClick:b[0]||(b[0]=w=>e.unref(c)(e.unref(Z)(t.data.id)))},[e.unref(p).likeIds.map(String).indexOf(e.unref(Z)(t.data.id))==-1?(e.openBlock(),e.createBlock(e.unref(Bs),{key:0})):(e.openBlock(),e.createBlock(e.unref(Ss),{key:1})),t.data.likes!=0?(e.openBlock(),e.createElementBlock("span",Sc,e.toDisplayString(t.data.likes),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{"data-tip":"回复",ref_key:"btnRef",ref:l,class:e.normalizeClass(["item",{active:a.active}]),onClick:h},[e.createVNode(e.unref(Ls)),e.createElementVNode("span",null,e.toDisplayString(a.active?"取消回复":"回复"),1)],2)]),e.createElementVNode("div",Nc,[e.renderSlot(y.$slots,"operate",{},()=>[e.createVNode(rc,{data:o.data},null,8,["data"])],!0)])]),a.active?(e.openBlock(),e.createElementBlock("div",Bc,[e.createVNode(Ml,{ref_key:"commentRef",ref:i,"parent-id":e.unref(Z)(t.id),placeholder:`回复 @${t.data.user.username}...`,reply:t.data,"content-btn":"发布",style:{"margin-top":"12px"},onHide:u,onClose:b[1]||(b[1]=w=>a.active=!1)},null,8,["parent-id","placeholder","reply"])])):e.createCommentVNode("",!0)]),e.renderSlot(y.$slots,"default",{},void 0,!0)])],2))}},jl=v(Ec,[["__scopeId","data-v-cfe79df7"]]),Dc={key:0,class:"reply-box"},Tc={class:"reply-list"},_c={key:0,class:"fetch-more"},Ic={key:0},Lc={key:1},Fc={key:0},$c={key:1,class:"fetch-more"},Oc={__name:"reply-box",props:{data:{type:[Array,Object],default:()=>null},id:{type:[String],default:""}},setup(t){const o=t,a=e.reactive({loading:!1,over:!1,pageNum:1,pageSize:5}),{replyPage:i,replyShowSize:l,comments:n,page:r}=e.inject("InjectReplyBox"),c=e.computed(()=>{let m={total:0,length:0,list:[]};if(o.data){let f=o.data.list.length;m={total:o.data.total,length:f,list:o.data.list}}if(!a.over){let f=m.list.slice(0,l);m.list=f}return r&&(m.list=m.list.slice(0,5)),m}),p=()=>{a.over=!0},d=m=>{n.value.forEach(f=>{f.id==o.id&&f.reply&&(f.reply=m)})},h=m=>{a.pageNum=m,i(o.id,m,a.pageSize,f=>d(f))},u=m=>{a.pageSize=m,i(o.id,a.pageNum,m,f=>d(f))};return(m,f)=>c.value.length>0?(e.openBlock(),e.createElementBlock("div",Dc,[e.createElementVNode("div",Tc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.list,(C,g)=>(e.openBlock(),e.createBlock(jl,{id:t.id,key:g,data:C,reply:""},null,8,["id","data"]))),128)),c.value.length>e.unref(l)?(e.openBlock(),e.createElementBlock("div",_c,[a.loading?(e.openBlock(),e.createElementBlock("span",Ic,"加载中...")):(e.openBlock(),e.createElementBlock("div",Lc,[a.over?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Fc,[e.createTextVNode(" 共"+e.toDisplayString(c.value.total)+"条回复, ",1),e.createElementVNode("span",{class:"fetch-more-comment select-none",onClick:p},[f[0]||(f[0]=e.createTextVNode(" 点击查看 ",-1)),e.createVNode(e.unref(Ds))])]))]))])):e.createCommentVNode("",!0),a.over&&e.unref(r)?(e.openBlock(),e.createElementBlock("div",$c,[e.createVNode(e.unref(k.ElPagination),{small:"","hide-on-single-page":"",layout:"total, prev, pager, next",total:c.value.total,"page-size":a.pageSize,onCurrentChange:h,onSizeChange:u},null,8,["total","page-size"])])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)}},Mc=v(Oc,[["__scopeId","data-v-16e0a50b"]]),zc={key:0,class:"comment-list"},Pc={__name:"comment-list",props:{data:{type:[Array,Object],default:()=>[]},total:{type:[Number],default:0},showSize:{type:[Number],default:0}},setup:t=>(o,a)=>t.data?(e.openBlock(),e.createElementBlock("div",zc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(i,l)=>(e.openBlock(),e.createBlock(jl,{id:e.unref(Z)(i.id),key:l,data:i},{default:e.withCtx(()=>[e.createVNode(Mc,{id:e.unref(Z)(i.id),data:i.reply},null,8,["id","data"])]),_:2},1032,["id","data"]))),128))])):e.createCommentVNode("",!0)},Hc={class:"cv-comment-base"},Ac={class:"cv-comment-form"},jc={class:"cv-comment-form__content"},Rc={class:"cv-comment-form__avatar"},Uc={class:"cv-comment-list-wrapper"},Pt=Object.assign({name:"cvCommentBase"},{__name:"comment",props:{config:{},page:!1,upload:!1,relativeTime:!1},emits:["submit","like","replyPage","showInfo","focus"],setup(t,{expose:o,emit:a}){const i=t,{user:l,comments:n,showSize:r,replyShowSize:c,total:p}=e.toRefs(i.config),d=a,h={upload:i.upload,submit:({content:m,parentId:f,reply:C,files:g,clear:y})=>{d("submit",{content:m,parentId:f,reply:C,files:g,finish:b=>{if(y(),f){let w=n.value.find(V=>V.id==f);if(w){let V=w.reply;V?(V.list.unshift(b),V.total++):w.reply={total:1,list:[b]}}}else n.value.unshift(b)}})},focus:()=>d("focus")};e.provide("InjectInputBox",h);const u=(m,f)=>{let C=null;n.value.forEach(g=>{C=g.id==m?g:g.reply?.list.find(y=>y.id==m),C&&(C.likes+=f)})};return e.provide("InjectContentBox",{user:l,like:m=>{const f=i.config.user.likeIds;d("like",m,()=>{if(f.findIndex(C=>C==m)==-1)f.push(m),u(m,1);else{let C=f.findIndex(g=>g==m);C!=-1&&(f.splice(C,1),u(m,-1))}})},relativeTime:oe(i.relativeTime,!1),showInfo:(m,f)=>d("showInfo",m,f)}),e.provide("InjectReplyBox",{page:i.page,replyPage:(m,f,C,g)=>{d("replyPage",{parentId:m,pageNum:f,pageSize:C,finish:g})},replyShowSize:oe(c,3),comments:n}),e.provide("InjectionEmojiApi",i.config.emoji),e.provide("InjectSlots",e.useSlots()),o({remove:m=>{const{parentId:f,id:C}=m;if(f){let g=n.value.find(b=>b.id==f),y=g?.reply;if(y){let b=y.list.findIndex(w=>w.id==C);b!=-1&&(y.list.splice(b,1),y.total--)}}else{let g=n.value.findIndex(y=>y.id==C);g!=-1&&n.value.splice(g,1)}}}),(m,f)=>{const C=e.resolveComponent("el-avatar");return e.openBlock(),e.createElementBlock("div",Hc,[e.createElementVNode("div",Ac,[f[1]||(f[1]=e.createElementVNode("div",{class:"cv-comment-form__header"},[e.createElementVNode("span",{class:"cv-comment-form__hdtitle"},"评论")],-1)),e.createElementVNode("div",jc,[e.createElementVNode("div",Rc,[e.createVNode(C,{size:40,src:t.config.user.avatar},{default:e.withCtx(()=>[...f[0]||(f[0]=[e.createElementVNode("img",{src:"https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"},null,-1)])]),_:1},8,["src"])]),e.createVNode(Ml,{placeholder:"输入评论(Enter换行,Ctrl + Enter发送)","content-btn":"发表评论"})])]),e.renderSlot(m.$slots,"default",{},()=>[f[2]||(f[2]=e.createElementVNode("div",{class:"title"},"全部评论",-1))]),e.createElementVNode("div",Uc,[e.createVNode(Pc,{data:e.unref(n),total:e.unref(p),"show-size":e.unref(oe)(e.unref(r),5)},null,8,["data","total","show-size"])])])}}}),Wc={class:"comment-scroll"},Yc=["infinite-scroll-disabled"],qc={class:"scroll-btn"},Xc={key:1},Kc={key:2},Ht=Object.assign({name:"cvCommentScroll"},{__name:"comment-scroll",props:{disable:{type:[Boolean],default:!1},show:{type:[Boolean],default:!1}},emits:["more"],setup(t,{emit:o}){const a=t,i=e.ref(!1),l=e.ref(!1),n=o,r=e.computed(()=>l.value&&a.disable),c=e.computed(()=>!l.value||i.value||r.value),p=Dl(()=>{n("more"),i.value=!1},500),d=()=>{i.value=!0,p()};return(h,u)=>{const m=e.resolveComponent("el-link"),f=e.resolveDirective("infinite-scroll");return e.openBlock(),e.createElementBlock("div",Wc,[e.withDirectives((e.openBlock(),e.createElementBlock("div",{"infinite-scroll-disabled":c.value,"infinite-scroll-distance":"2"},[e.renderSlot(h.$slots,"default"),e.createElementVNode("div",qc,[l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(m,{key:0,type:"primary",underline:"never",onClick:u[0]||(u[0]=C=>l.value=!l.value)},{default:e.withCtx(()=>[...u[1]||(u[1]=[e.createTextVNode("加载更多",-1)])]),_:1})),i.value?(e.openBlock(),e.createElementBlock("p",Xc,"加载中...")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("p",Kc,"没有更多了")):e.createCommentVNode("",!0)])],8,Yc)),[[f,d]])])}}}),Gc={class:"cv-comment-nav-wrap"},Zc={class:"cv-comment-nav__sort"},At=Object.assign({name:"cvCommentNav"},{__name:"comment-nav",props:{modelValue:!1},emits:["update:modelValue","sorted"],setup(t,{emit:o}){const a=t,i=o,l=e.computed({get:()=>a.modelValue,set(n){i("update:modelValue",n),i("sorted",n)}});return(n,r)=>(e.openBlock(),e.createElementBlock("div",Gc,[r[4]||(r[4]=e.createElementVNode("span",{class:"cv-comment-nav__title"},"全部评论",-1)),e.createElementVNode("div",Zc,[e.createElementVNode("div",{class:e.normalizeClass(["item select-none",{active:l.value}]),onClick:r[0]||(r[0]=c=>l.value=!0)},[e.createVNode(e.unref(_s)),r[2]||(r[2]=e.createTextVNode(" 最新 ",-1))],2),e.createElementVNode("div",{class:e.normalizeClass(["item select-none",{active:!l.value}]),onClick:r[1]||(r[1]=c=>l.value=!1)},[e.createVNode(e.unref(ys)),r[3]||(r[3]=e.createTextVNode(" 最热 ",-1))],2)])]))}});Pt.install=function(t){t.component(Pt.name,Pt)},Ht.install=function(t){t.component(Ht.name,Ht)},At.install=function(t){t.component(At.name,At)};const Qc={name:"cvSvgs",props:{...k.ElIcon.prop,type:{type:[String],default:""},size:{type:[String,Number],default:12},name:{type:[String],default:""}},data:()=>({}),computed:{svgType(){return"svg"+this.type},style(){return{fontSize:isNaN(Number(this.size))?this.size+"px":this.size,color:props.color}}},created(){},methods:{}},Jc={key:0,"aria-hidden":"true"},ed=["xlink:href"],jt=v(Qc,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.svgType)))]),a.name?(e.openBlock(),e.createElementBlock("svg",Jc,[e.createElementVNode("use",{"xlink:href":a.name},null,8,ed)])):e.createCommentVNode("",!0)]),_:3},16)}]]),td={name:"cvIcons",props:{...k.ElIcon.prop,type:{type:[String],default:""},size:{type:[String,Number],default:12},name:{type:[String],default:""}},data:()=>({}),computed:{style(){return{fontSize:isNaN(Number(this.size))?this.size+"px":this.size,color:props.color}}},created(){},methods:{}},od={key:0,"aria-hidden":"true"},ad=["xlink:href"],Rt=v(td,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.type)))]),a.name?(e.openBlock(),e.createElementBlock("svg",od,[e.createElementVNode("use",{"xlink:href":a.name},null,8,ad)])):e.createCommentVNode("",!0)]),_:3},16)}]]);Rt.install=function(t){t.component(Rt.name,Rt)},jt.install=function(t){t.component(jt.name,jt)};const ld={class:"u-emoji"},nd={class:"face-tooltip-head select-none"},id=["onClick"],rd=["src"],sd={class:"emoji-body select-none"},cd={style:{padding:"0 5px"}},dd=["onClick"],pd={class:"emoji-btn select-none"},hd={key:0},md=v(Object.assign({name:"cvEmoji"},{__name:"emoji",props:{emoji:{faceList:[],emojiList:[],allEmoji:{}},placement:"bottom"},emits:["addEmoji"],setup(t,{emit:o}){const a=t,i=e.ref(0),l=e.ref(0),n=e.ref(new Array(2)),{emojiList:r,faceList:c}=a.emoji;function p(){n.value[0]=r[0]}return(d,h)=>(e.openBlock(),e.createElementBlock("div",ld,[e.createVNode(e.unref(k.ElPopover),{placement:t.placement,"popper-class":"emoji-popover",width:250,trigger:"click",onBeforeEnter:p},{reference:e.withCtx(()=>[e.createElementVNode("div",pd,[d.$slots.default?e.renderSlot(d.$slots,"default",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock("div",hd,[...h[0]||(h[0]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.00002 0.666504C12.0501 0.666504 15.3334 3.94975 15.3334 7.99984C15.3334 12.0499 12.0501 15.3332 8.00002 15.3332C3.94993 15.3332 0.666687 12.0499 0.666687 7.99984C0.666687 3.94975 3.94993 0.666504 8.00002 0.666504ZM8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2ZM10.6667 5.66667V7.66667H9.33333V5.66667H10.6667ZM6.66667 5.66667V7.66667H5.33333V5.66667H6.66667ZM10.0767 9.33333H11.0495C11.1804 9.33333 11.2866 9.43951 11.2866 9.57048C11.2866 9.60754 11.2779 9.64409 11.2612 9.67718L11.244 9.71053C10.6294 10.8739 9.40726 11.6667 7.99998 11.6667C6.61523 11.6667 5.40977 10.8991 4.7859 9.76612L4.73786 9.67593C4.67845 9.56052 4.72385 9.4188 4.83926 9.35939C4.87253 9.34226 4.90941 9.33333 4.94683 9.33333H5.92347C6.02396 9.33332 6.11908 9.37865 6.18238 9.4567C6.26207 9.55496 6.32833 9.62955 6.38117 9.68046C6.80074 10.0847 7.37133 10.3333 7.99998 10.3333C8.63289 10.3333 9.20694 10.0814 9.62728 9.67224C9.67791 9.62296 9.74135 9.55121 9.8176 9.45698C9.88089 9.37877 9.97611 9.33333 10.0767 9.33333Z"})],-1),e.createElementVNode("span",null,"表情",-1)])]))])]),default:e.withCtx(()=>[e.createElementVNode("div",nd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(u,m)=>(e.openBlock(),e.createElementBlock("label",{key:m,class:e.normalizeClass(i.value==m?"active":""),onClick:f=>function(C){switch(i.value=C,C){case 0:l.value=0;break;case 1:l.value=-50,n.value[1]=r[1]}}(m)},[e.createElementVNode("img",{src:u,alt:""},null,8,rd)],10,id))),128))]),e.createElementVNode("div",sd,[e.createElementVNode("div",{class:"emjio-container",style:e.normalizeStyle({transform:`translateX(${l.value}%)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(u,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"emoji-wrapper"},[e.createVNode(e.unref(k.ElScrollbar),null,{default:e.withCtx(()=>[e.createElementVNode("div",cd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u,(f,C)=>(e.openBlock(),e.createElementBlock("span",{key:C,class:"emoji-item",onClick:g=>d.$emit("addEmoji",C)},[e.createVNode(e.unref(k.ElImage),{src:f,title:String(C),class:"emoji",style:{width:"24px",height:"24px",margin:"5px"},lazy:""},null,8,["src","title"])],8,dd))),128))])]),_:2},1024)]))),128))],4)])]),_:3},8,["placement"])]))}}),[["__scopeId","data-v-da53b6ed"]]),ud={class:"cv-chat-message"},gd={class:"chat-list"},fd={class:"content"},Cd={key:0,class:"username"},vd=["innerHTML"],yd={__name:"message",props:{data:{type:[Array],default:()=>[]},userId:{type:[Number],default:0}},setup(t,{expose:o}){const{allEmoji:a}=e.inject("InjectionEmojiApi"),i=e.ref();o({scroll:()=>{e.nextTick(()=>{const n=document.querySelector(".chat-item:last-child");i.value.setScrollTop(n.offsetTop)})}});const l=(n,r)=>r=r.replace(/\[.+?\]/g,c=>{const p=n[c];return p?['<img src="',p,'" width="20" height="20" alt="',c,'" title="',c,'" style="margin: 0 1px; vertical-align: text-bottom"',"/>"].join(""):c});return(n,r)=>(e.openBlock(),e.createElementBlock("div",ud,[e.createVNode(e.unref(k.ElScrollbar),{ref_key:"scrollbarRef",ref:i},{default:e.withCtx(()=>[e.createElementVNode("div",gd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(c,p)=>(e.openBlock(),e.createElementBlock("div",{key:p,class:e.normalizeClass([{self:t.userId==c.id},"chat-item"])},[e.createElementVNode("div",null,[e.createVNode(e.unref(k.ElAvatar),null,{default:e.withCtx(()=>[...r[0]||(r[0]=[e.createElementVNode("img",{src:"https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"},null,-1)])]),_:1})]),e.createElementVNode("div",fd,[t.userId!=c.id?(e.openBlock(),e.createElementBlock("div",Cd,e.toDisplayString(c.username),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"card-box",innerHTML:l(e.unref(a),c.content)},null,8,vd)]),r[1]||(r[1]=e.createElementVNode("div",{class:"date"},null,-1))],2))),128))])]),_:1},512)]))}},kd={class:"cv-chat-wrap"},bd={class:"header"},wd={id:"chat-footer",class:"footer"},Ut=Object.assign({name:"cvChat"},{__name:"chat",props:{data:{type:[Array],default:()=>[]},userId:{type:[Number],default:0},emoji:{type:[Object],default:()=>({})}},emits:["submit"],setup(t,{emit:o}){const a=t,i=e.ref(!1),l=e.ref(""),n=e.ref(),{data:r}=a,c=o,p=m=>{const{ctrlKey:f,key:C}=m;f&&C=="Enter"&&h()},d=()=>{l.value="",n.value.scroll()},h=()=>{let m=l.value;m.trim()?(m=m.replace(/\n/g,"<br/>"),c("submit",{clear:d,content:m})):k.ElMessage({type:"error",message:"内容不能为空"})},u=m=>{let f=document.getElementById("emojiInput"),C=f.selectionStart,g=f.selectionEnd,y=f.value;if(C===null||g===null)return;let b=y.substring(0,C)+m+y.substring(g);f.value=b,f.focus(),f.selectionStart=C+m.length,f.selectionEnd=C+m.length,l.value=b};return e.provide("InjectionEmojiApi",a.emoji),(m,f)=>{const C=e.resolveComponent("cvIcons");return e.openBlock(),e.createElementBlock("div",kd,[e.createElementVNode("div",{class:e.normalizeClass([{active:i.value},"chat-container translate"])},[e.createElementVNode("div",bd,[e.createVNode(C,{size:"32"},{default:e.withCtx(()=>[...f[2]||(f[2]=[e.createElementVNode("svg",{viewBox:"0 0 1318 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1318.502489 432.779052c0-231.790522-209.29842-419.704826-467.458992-419.704826s-467.56979 188.357498-467.56979 419.704826 209.409219 419.704826 467.56979 419.704826a512.110799 512.110799 0 0 0 183.482363-33.239559l93.292361 93.292361a25.816057 25.816057 0 0 0 44.319412-19.168145L1165.822116 742.350141C1259.336074 665.56676 1318.502489 555.433023 1318.502489 432.779052z",fill:"#612273","p-id":"10993"}),e.createElementVNode("path",{d:"M1034.304263 745.784895a509.673231 509.673231 0 0 1-183.482363 33.239559c-244.532352 0-445.077689-168.524562-465.353819-383.25211-1.107985 12.07704-1.883575 24.264878-1.883575 36.563514 0 231.790522 209.409219 419.704826 467.56979 419.704826a512.110799 512.110799 0 0 0 183.482363-33.239559l93.292361 93.292361a25.816057 25.816057 0 0 0 44.319411-19.168145 25.262064 25.262064 0 0 0-7.5343-17.284571zM1165.822116 669.223112l2.769964 70.689461C1260.44406 663.239991 1318.502489 553.992642 1318.502489 432.779052a366.632331 366.632331 0 0 0-1.883575-36.785111 403.971435 403.971435 0 0 1-150.796798 273.229171z",fill:"#612273",opacity:".2","p-id":"10994"}),e.createElementVNode("path",{d:"M383.25211 432.779052a383.141311 383.141311 0 0 1 41.881844-172.956503c-12.298637-0.997187-24.81887-1.661978-37.449903-1.661978C173.510496 258.160571 0 413.943302 0 606.178749c0 101.713049 48.97295 193.011037 126.421121 256.609392l-5.761524 148.470028a12.187838 12.187838 0 0 0 20.830124 9.08548l94.06795-93.957153A425.577148 425.577148 0 0 0 387.79485 954.196927a404.636226 404.636226 0 0 0 300.37481-128.304696c-177.831638-59.388011-304.91755-212.733175-304.91755-393.113179z",fill:"#EB3D72","p-id":"10995"}),e.createElementVNode("path",{d:"M342.256654 391.672798c0 117.557239 53.958883 223.59143 140.714132 299.71002a391.008007 391.008007 0 0 1-99.718676-258.603766 383.141311 383.141311 0 0 1 41.881844-172.956503c-12.298637-0.997187-24.81887-1.661978-37.449903-1.661978-7.091106 0-14.071413 0-21.05172 0.553993a375.939407 375.939407 0 0 0-24.375677 132.958234zM630.111231 802.181346a407.627786 407.627786 0 0 1-283.533434 110.798528 424.136767 424.136767 0 0 1-152.12638-27.699632l-71.686647 71.686648-2.105173 54.291279a12.187838 12.187838 0 0 0 20.830124 9.08548l94.06795-93.957153A425.577148 425.577148 0 0 0 387.79485 954.196927a404.636226 404.636226 0 0 0 300.37481-128.304696 486.294741 486.294741 0 0 1-58.058429-23.710885zM85.425665 821.792686l-5.761523-4.985934c1.883575 2.215971 3.656351 4.431941 5.650725 6.647911z",fill:"#EB3D72",opacity:".5","p-id":"10996"}),e.createElementVNode("path",{d:"M833.426531 332.395585c64.263147-10.193465 64.041549-66.479117 62.601169-75.342999s-15.400995-54.291279-59.942004-47.200173S799.078987 254.836615 799.078987 254.836615a28.475222 28.475222 0 1 0 56.174854-8.97468s6.315516 3.323956 8.30989 20.27613-11.966241 29.029214-35.455529 33.239559-88.638823-19.943735-104.039819-115.452067C709.110582 96.39472 781.57282 28.253625 838.966457 13.185025a55.399264 55.399264 0 0 0-64.041549-5.318329c-56.064055 35.123134-97.170309 109.579745-85.536464 182.817571 14.957801 93.846354 79.664142 151.904783 144.038087 141.711318zM203.980091 573.825579a53.072495 53.072495 0 0 0 33.90435-67.919498c-2.659165-6.537113-21.162519-38.225492-53.51569-25.040467a30.026401 30.026401 0 0 0-19.832936 40.773858 22.159706 22.159706 0 1 0 40.773858-16.619779s5.318329 1.329582 9.861069 13.739017-3.988747 24.043281-21.05172 31.023588-70.02467 0.553993-98.832288-68.695087C68.916685 417.599654 110.798528 353.558104 151.904783 332.395585a42.879031 42.879031 0 0 0-48.97295 7.423502 146.918849 146.918849 0 0 0-32.574767 152.458775c27.810431 68.141095 86.866046 100.605064 133.623025 81.547717z",fill:"#FED150","p-id":"10997"})],-1)])]),_:1}),f[3]||(f[3]=e.createElementVNode("div",{style:{"margin-left":"12px"}},[e.createElementVNode("div",null,"聊天室"),e.createElementVNode("div",{style:{"font-size":"12px"}},"当前2人在线")],-1))]),e.createVNode(yd,{ref_key:"messageRef",ref:n,data:e.unref(r),"user-id":t.userId},null,8,["data","user-id"]),e.createElementVNode("div",wd,[e.createVNode(e.unref(k.ElInput),{id:"emojiInput",modelValue:l.value,"onUpdate:modelValue":f[0]||(f[0]=g=>l.value=g),type:"textarea",autosize:{minRows:1,maxRows:4},placeholder:"请输入内容",onKeydown:e.withKeys(p,["enter"])},null,8,["modelValue"]),e.createVNode(md,{style:{margin:"0 8px 0"},emoji:t.emoji,placement:"top-end",onAddEmoji:u},{default:e.withCtx(()=>[...f[4]||(f[4]=[e.createElementVNode("svg",{width:"22",height:"22",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7186"},[e.createElementVNode("path",{d:"M510.944 960c-247.04 0-448-200.96-448-448s200.992-448 448-448c247.008 0 448 200.96 448 448S757.984 960 510.944 960zM510.944 128c-211.744 0-384 172.256-384 384 0 211.744 172.256 384 384 384 211.744 0 384-172.256 384-384C894.944 300.256 722.688 128 510.944 128zM512 773.344c-89.184 0-171.904-40.32-226.912-110.624-10.88-13.92-8.448-34.016 5.472-44.896 13.888-10.912 34.016-8.48 44.928 5.472 42.784 54.688 107.136 86.048 176.512 86.048 70.112 0 134.88-31.904 177.664-87.552 10.784-14.016 30.848-16.672 44.864-5.888 14.016 10.784 16.672 30.88 5.888 44.864C685.408 732.32 602.144 773.344 512 773.344zM368 515.2c-26.528 0-48-21.472-48-48l0-64c0-26.528 21.472-48 48-48s48 21.472 48 48l0 64C416 493.696 394.496 515.2 368 515.2zM656 515.2c-26.496 0-48-21.472-48-48l0-64c0-26.528 21.504-48 48-48s48 21.472 48 48l0 64C704 493.696 682.496 515.2 656 515.2z","p-id":"7187"})],-1)])]),_:1},8,["emoji"]),e.createVNode(C,{size:"18",class:e.normalizeClass([{".cv-chat-wrap submit-btn":l.value.trim()!=""},"select-none cursor-pointer"]),style:{"padding-bottom":"5px"},onClick:h},{default:e.withCtx(()=>[...f[5]||(f[5]=[e.createElementVNode("svg",{viewBox:"0 0 1025 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"15072"},[e.createElementVNode("path",{d:"M1008.00076 6.285714q18.857143 13.714286 15.428571 36.571429l-146.285714 877.714286q-2.857143 16.571429-18.285714 25.714286-8 4.571429-17.714286 4.571429-6.285714 0-13.714286-2.857143l-258.857143-105.714286-138.285714 168.571429q-10.285714 13.142857-28 13.142857-7.428571 0-12.571429-2.285714-10.857143-4-17.428571-13.428571t-6.571429-20.857143l0-199.428571 493.714286-605.142857-610.857143 528.571429-225.714286-92.571429q-21.142857-8-22.857143-31.428571-1.142857-22.857143 18.285714-33.714286l950.857143-548.571429q8.571429-5.142857 18.285714-5.142857 11.428571 0 20.571429 6.285714z","p-id":"15073"})],-1)])]),_:1},8,["class"])])],2),e.createVNode(e.unref(k.ElButton),{class:"chat-btn",onClick:f[1]||(f[1]=g=>i.value=!i.value)},{default:e.withCtx(()=>[...f[6]||(f[6]=[e.createTextVNode("chat",-1)])]),_:1})])}}});Ut.install=function(t){t.component(Ut.name,Ut)};const Vd={key:0},Wt=Object.assign({name:"cvNoticeBar"},{__name:"notice-bar",props:{data:{type:[String,Array],default:()=>[]},vertical:{type:[Boolean],default:!1},suffixIcon:{type:[String],default:""},prefixIcon:{type:[String],default:""},size:{type:[Number],default:14},height:{type:[Number],default:40},delay:{type:[Number],default:1e3},spped:{type:[Number],default:100},color:{type:[String],default:"--color-warning"},background:{type:[String],default:"var(--color-warning-light-9)"}},setup(t){const o=t,{data:a,vertical:i,suffixIcon:l,prefixIcon:n,size:r,height:c,delay:p,spped:d,color:h,background:u}=o,m=e.reactive({boxWidth:0,textWidth:0,oneTime:0,twoTime:0,order:1}),f=e.ref({}),C=e.ref({style:{cssText:""}}),g=e.computed(()=>o.delay>2e3?o.delay:2e3),y=()=>{m.oneTime=m.textWidth/o.spped,m.twoTime=(m.textWidth+m.boxWidth)/o.spped},b=()=>{m.order===1?(C.value?.style&&(C.value.style.cssText=`animation: oneAnimation ${m.oneTime}s linear; opactity: 1;}`),m.order=2):C.value?.style&&(C.value.style.cssText=`animation: twoAnimation ${m.twoTime}s linear infinite; opacity: 1;`)};return e.onMounted(()=>{o.vertical||(e.nextTick(()=>{m.boxWidth=f.value.offsetWidth,m.textWidth=C.value.offsetWidth,document.styleSheets[0].insertRule(`@keyframes oneAnimation {0% {left: 0px;} 100% {left: -${m.textWidth}px;}}`),document.styleSheets[0].insertRule(`@keyframes twoAnimation {0% {left: ${m.boxWidth}px;} 100% {left: -${m.textWidth}px;}}`),y(),setTimeout(()=>{b()},o.delay)}),C.value.addEventListener("animationend",()=>{b()},!1))}),(w,V)=>{const S=e.resolveComponent("el-carousel-item"),B=e.resolveComponent("el-carousel"),T=e.resolveComponent("cvIcons");return e.openBlock(),e.createElementBlock("div",{class:"cv-notice-bar",style:e.normalizeStyle({background:e.unref(u),height:`${e.unref(c)}px`})},[e.unref(i)?(e.openBlock(),e.createElementBlock("div",Vd,[e.createVNode(B,{height:"40px",direction:"vertical",autoplay:!0,"indicator-position":"none",interval:g.value},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),_=>(e.openBlock(),e.createBlock(S,{key:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_),1)]),_:2},1024))),128))]),_:1},8,["interval"])])):(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle({color:e.unref(h),fontSize:`${e.unref(r)}px`}),class:"cv-notice-bar-wrap"},[e.unref(n)?(e.openBlock(),e.createBlock(T,{key:0,type:e.unref(n)},null,8,["type"])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"boxRef",ref:f,class:"text-box"},[e.createElementVNode("div",{ref_key:"textRef",ref:C,class:"text"},e.toDisplayString(e.unref(a)),513)],512),e.unref(l)?(e.openBlock(),e.createBlock(T,{key:1,type:e.unref(l)},null,8,["type"])):e.createCommentVNode("",!0)],4))],4)}}});Wt.install=function(t){t.component(Wt.name,Wt)};const xd=Object.freeze({autofocus:!1,disabled:!1,indentWithTab:!0,tabSize:2,placeholder:"",autoDestroy:!0,extensions:[cn.basicSetup]}),ha="change",ma="update",ua="focus",ga="blur",fa="ready",Ca="update:modelValue",Sd=({onUpdate:t,onChange:o,onFocus:a,onBlur:i,...l})=>L.EditorState.create({doc:l.doc,selection:l.selection,extensions:[...Array.isArray(l.extensions)?l.extensions:[l.extensions],E.EditorView.updateListener.of(n=>{t(n),n.docChanged&&o(n.state.doc.toString(),n),n.focusChanged&&(n.view.hasFocus?a(n):i(n))})]}),J=t=>{const o=new L.Compartment;return{compartment:o,run:a=>{o.get(t.state)?t.dispatch({effects:o.reconfigure(a)}):t.dispatch({effects:L.StateEffect.appendConfig.of(o.of(a))})}}},va=(t,o)=>{const{compartment:a,run:i}=J(t);return l=>{const n=a.get(t.state);i(l??n!==o?o:[])}},Nd=t=>{const o=()=>t.state.doc.toString(),{run:a}=J(t),i=va(t,[E.EditorView.editable.of(!1),L.EditorState.readOnly.of(!0)]),l=va(t,E.keymap.of([dn.indentWithTab])),{run:n}=J(t),{run:r}=J(t),{run:c}=J(t),{run:p}=J(t);return{focus:()=>t.focus(),getDoc:o,setDoc:d=>{d!==o()&&t.dispatch({changes:{from:0,to:t.state.doc.length,insert:d}})},reExtensions:a,toggleDisabled:i,toggleIndentWithTab:l,setTabSize:d=>{n([L.EditorState.tabSize.of(d),x.indentUnit.of(" ".repeat(d))])},setPhrases:d=>{r([L.EditorState.phrases.of(d)])},setPlaceholder:d=>{c(E.placeholder(d))},setStyle:(d={})=>{p(E.EditorView.theme({"&":{...d}}))}}},Bd=e.defineComponent({name:"VueCodemirror",props:{modelValue:{type:String,default:""},autofocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},indentWithTab:{type:Boolean,default:!1},tabSize:Number,placeholder:String,style:Object,autoDestroy:{type:Boolean,default:!1},phrases:Object,root:Object,extensions:Array,selection:Object},emits:{[ha]:(t,o)=>!0,[ma]:t=>!0,[ua]:t=>!0,[ga]:t=>!0,[fa]:t=>!0,[Ca]:(t,o)=>!0},setup(t,o){const a=e.shallowRef(),i=e.shallowRef(),l=e.shallowRef(),n={...xd},r=e.computed(()=>{const c={};return Object.keys(e.toRaw(t)).forEach(p=>{p!=="modelValue"&&(c[p]=t[p]??n[p])}),c});return e.onMounted(()=>{i.value=Sd({doc:t.modelValue,selection:r.value.selection,extensions:n.extensions??[],onFocus:p=>o.emit(ua,p),onBlur:p=>o.emit(ga,p),onUpdate:p=>o.emit(ma,p),onChange:(p,d)=>{p!==t.modelValue&&(o.emit(ha,p,d),o.emit(Ca,p,d))}}),l.value=new E.EditorView({state:i.value,parent:a.value,root:r.value.root}),l.value.contentDOM.addEventListener("scroll",p=>{});const c=Nd(l.value);e.watch(()=>t.modelValue,p=>{p!==c.getDoc()&&c.setDoc(p)}),e.watch(()=>t.extensions,p=>c.reExtensions(p||[]),{immediate:!0}),e.watch(()=>r.value.disabled,p=>c.toggleDisabled(p),{immediate:!0}),e.watch(()=>r.value.indentWithTab,p=>c.toggleIndentWithTab(p),{immediate:!0}),e.watch(()=>r.value.tabSize,p=>c.setTabSize(p),{immediate:!0}),e.watch(()=>r.value.phrases,p=>c.setPhrases(p||{}),{immediate:!0}),e.watch(()=>r.value.placeholder,p=>c.setPlaceholder(p),{immediate:!0}),e.watch(()=>r.value.style,p=>c.setStyle(p),{immediate:!0}),r.value.autofocus&&c.focus(),o.emit(fa,{state:i.value,view:l.value,container:a.value,editorTools:c})}),e.onBeforeUnmount(()=>{r.value.autoDestroy&&l.value&&l.value.destroy()}),()=>e.h("div",{class:"cv-editor-codemirror",ref:a})}}),ya="#e06c75",Yt="#abb2bf",qo="#7d8799",ka="#d19a66",ba="#2c313a",wa="#282c34",co="#353a42",Va="#528bff",Ed=E.EditorView.theme({"&":{color:Yt,backgroundColor:wa},".cm-content":{caretColor:Va},".cm-cursor, .cm-dropCursor":{borderLeftColor:Va},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:Yt},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:wa,color:qo,border:"none"},".cm-activeLineGutter":{backgroundColor:ba},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:co},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:co,borderBottomColor:co},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:ba,color:Yt}}},{dark:!0}),Dd=x.HighlightStyle.define([{tag:s.tags.keyword,color:"#c678dd"},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.propertyName,s.tags.macroName],color:ya},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:"#61afef"},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:ka},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Yt},{tag:[s.tags.typeName,s.tags.className,s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:"#e5c07b"},{tag:[s.tags.operator,s.tags.operatorKeyword,s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link,s.tags.special(s.tags.string)],color:"#56b6c2"},{tag:[s.tags.meta,s.tags.comment],color:qo},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.strikethrough,textDecoration:"line-through"},{tag:s.tags.link,color:qo,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:ya},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:ka},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted],color:"#98c379"},{tag:s.tags.invalid,color:"#ffffff"}]),Td=[Ed,x.syntaxHighlighting(Dd)],_d=!1,po="#FAFAFA",z="#90A4AE",ne="#80CBC440",xa="#272727",ho="#FAFAFA",Sa="#00000010",Id="#c2c2c222",Ld="#CFD8DC",Fd="#7E939E",$d="#FAFAFA",Na="#7C4DFF",mo="#90A4AE",Ba="#6182B8",Od="#91B859",Md="#F76D47",Ea="#8796B0",zd="#FFB62C",Pd="#F76D47",Hd="#90A4AE",Ad="#91B859",jd="#E53935",Rd="#39ADB5",Ud=E.EditorView.theme({"&":{color:z,backgroundColor:po},".cm-content":{caretColor:xa},".cm-cursor, .cm-dropCursor":{borderLeftColor:xa},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ne},".cm-panels":{backgroundColor:ho,color:z},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:ho,outline:`1px solid ${Sa}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ne},".cm-activeLine":{backgroundColor:Id},".cm-selectionMatch":{backgroundColor:ne},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:$d,outline:"none"},".cm-gutters":{backgroundColor:po,color:z,border:"none"},".cm-activeLineGutter":{backgroundColor:po},".cm-lineNumbers .cm-gutterElement":{color:Ld},".cm-lineNumbers .cm-activeLineGutter":{color:Fd},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:z},".cm-tooltip":{border:`1px solid ${Sa}`,backgroundColor:ho,color:z},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:z,borderBottomColor:z},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:ne,color:z}}},{dark:_d}),Wd=x.HighlightStyle.define([{tag:s.tags.keyword,color:Na},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:mo},{tag:[s.tags.propertyName],color:Ba},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Od},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Ba},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Md},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:mo},{tag:[s.tags.className],color:zd},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Pd},{tag:[s.tags.typeName],color:Ea,fontStyle:Ea},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Na},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Rd},{tag:[s.tags.meta,s.tags.comment],color:Hd},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Ad},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:mo},{tag:s.tags.invalid,color:jd},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Yd=[Ud,x.syntaxHighlighting(Wd)],qd=!0,uo="#263238",P="#EEFFFF",ie="#80CBC420",Da="#FFCC00",go="#263238",Ta="#FFFFFF10",Xd="#4c616c22",Kd="#37474F",Gd="#607a86",Zd="#263238",_a="#C792EA",fo="#EEFFFF",Ia="#82AAFF",Qd="#C3E88D",Jd="#F78C6C",La="#B2CCD6",ep="#FFCB6B",tp="#F78C6C",op="#546E7A",ap="#C3E88D",lp="#FF5370",np="#89DDFF",ip=E.EditorView.theme({"&":{color:P,backgroundColor:uo},".cm-content":{caretColor:Da},".cm-cursor, .cm-dropCursor":{borderLeftColor:Da},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ie},".cm-panels":{backgroundColor:go,color:P},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:go,outline:`1px solid ${Ta}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ie},".cm-activeLine":{backgroundColor:Xd},".cm-selectionMatch":{backgroundColor:ie},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Zd,outline:"none"},".cm-gutters":{backgroundColor:uo,color:P,border:"none"},".cm-activeLineGutter":{backgroundColor:uo},".cm-lineNumbers .cm-gutterElement":{color:Kd},".cm-lineNumbers .cm-activeLineGutter":{color:Gd},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:P},".cm-tooltip":{border:`1px solid ${Ta}`,backgroundColor:go,color:P},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:P,borderBottomColor:P},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:ie,color:P}}},{dark:qd}),rp=x.HighlightStyle.define([{tag:s.tags.keyword,color:_a},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:fo},{tag:[s.tags.propertyName],color:Ia},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Qd},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Ia},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Jd},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:fo},{tag:[s.tags.className],color:ep},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:tp},{tag:[s.tags.typeName],color:La,fontStyle:La},{tag:[s.tags.operator,s.tags.operatorKeyword],color:_a},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:np},{tag:[s.tags.meta,s.tags.comment],color:op},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:ap},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:fo},{tag:s.tags.invalid,color:lp},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),sp=[ip,x.syntaxHighlighting(rp)],cp=!1,Co="#FDF6E3",H="#586E75",re="#EEE8D5",Fa="#657B83",vo="#FDF6E3",$a="#D3AF86",dp="#d5bd5c22",pp="#586E75",hp="#567983",mp="#EEE8D5",Oa="#859900",yo="#268BD2",Ma="#268BD2",up="#2AA198",gp="#CB4B16",za="#CB4B16",fp="#CB4B16",Cp="#D33682",vp="#93A1A1",yp="#268BD2",kp="#DC322F",bp="#DC322F",wp=E.EditorView.theme({"&":{color:H,backgroundColor:Co},".cm-content":{caretColor:Fa},".cm-cursor, .cm-dropCursor":{borderLeftColor:Fa},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:re},".cm-panels":{backgroundColor:vo,color:H},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:vo,outline:`1px solid ${$a}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:re},".cm-activeLine":{backgroundColor:dp},".cm-selectionMatch":{backgroundColor:re},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:mp,outline:"none"},".cm-gutters":{backgroundColor:Co,color:H,border:"none"},".cm-activeLineGutter":{backgroundColor:Co},".cm-lineNumbers .cm-gutterElement":{color:pp},".cm-lineNumbers .cm-activeLineGutter":{color:hp},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:H},".cm-tooltip":{border:`1px solid ${$a}`,backgroundColor:vo,color:H},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:H,borderBottomColor:H},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:re,color:H}}},{dark:cp}),Vp=x.HighlightStyle.define([{tag:s.tags.keyword,color:Oa},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:yo},{tag:[s.tags.propertyName],color:Ma},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:up},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Ma},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:gp},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:yo},{tag:[s.tags.className],color:fp},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Cp},{tag:[s.tags.typeName],color:za,fontStyle:za},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Oa},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:bp},{tag:[s.tags.meta,s.tags.comment],color:vp},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:yp},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:yo},{tag:s.tags.invalid,color:kp},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),xp=[wp,x.syntaxHighlighting(Vp)],Sp=!0,ko="#002B36",A="#93A1A1",se="#274642",Pa="#D30102",bo="#002B36",Ha="#2AA19899",Np="#005b7022",Bp="#93A1A1",Ep="#949494",Dp="#073642",Aa="#859900",wo="#268BD2",ja="#268BD2",Tp="#2AA198",_p="#CB4B16",Ra="#CB4B16",Ip="#CB4B16",Lp="#D33682",Fp="#586E75",$p="#268BD2",Op="#DC322F",Mp="#DC322F",zp=E.EditorView.theme({"&":{color:A,backgroundColor:ko},".cm-content":{caretColor:Pa},".cm-cursor, .cm-dropCursor":{borderLeftColor:Pa},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:se},".cm-panels":{backgroundColor:bo,color:A},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:bo,outline:`1px solid ${Ha}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:se},".cm-activeLine":{backgroundColor:Np},".cm-selectionMatch":{backgroundColor:se},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Dp,outline:"none"},".cm-gutters":{backgroundColor:ko,color:A,border:"none"},".cm-activeLineGutter":{backgroundColor:ko},".cm-lineNumbers .cm-gutterElement":{color:Bp},".cm-lineNumbers .cm-activeLineGutter":{color:Ep},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:A},".cm-tooltip":{border:`1px solid ${Ha}`,backgroundColor:bo,color:A},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:A,borderBottomColor:A},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:se,color:A}}},{dark:Sp}),Pp=x.HighlightStyle.define([{tag:s.tags.keyword,color:Aa},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:wo},{tag:[s.tags.propertyName],color:ja},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Tp},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:ja},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:_p},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:wo},{tag:[s.tags.className],color:Ip},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Lp},{tag:[s.tags.typeName],color:Ra,fontStyle:Ra},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Aa},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Mp},{tag:[s.tags.meta,s.tags.comment],color:Fp},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:$p},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:wo},{tag:s.tags.invalid,color:Op},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Hp=[zp,x.syntaxHighlighting(Pp)],Ap=!0,Vo="#282A36",j="#F8F8F2",ce="#44475A",Ua="#F8F8F2",xo="#282A36",Wa="#191A21",jp="#53576c22",Rp="#6272A4",Up="#F8F8F2",Wp="#44475A",Ya="#FF79C6",So="#F8F8F2",qa="#50FA7B",Yp="#F1FA8C",qp="#BD93F9",Xa="#8BE9FD",Xp="#8BE9FD",Kp="#BD93F9",Gp="#6272A4",Zp="#BD93F9",Qp="#FF5555",Jp="#F1FA8C",eh=E.EditorView.theme({"&":{color:j,backgroundColor:Vo},".cm-content":{caretColor:Ua},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ua},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ce},".cm-panels":{backgroundColor:xo,color:j},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:xo,outline:`1px solid ${Wa}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ce},".cm-activeLine":{backgroundColor:jp},".cm-selectionMatch":{backgroundColor:ce},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Wp,outline:"none"},".cm-gutters":{backgroundColor:Vo,color:j,border:"none"},".cm-activeLineGutter":{backgroundColor:Vo},".cm-lineNumbers .cm-gutterElement":{color:Rp},".cm-lineNumbers .cm-activeLineGutter":{color:Up},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:j},".cm-tooltip":{border:`1px solid ${Wa}`,backgroundColor:xo,color:j},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:j,borderBottomColor:j},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:ce,color:j}}},{dark:Ap}),th=x.HighlightStyle.define([{tag:s.tags.keyword,color:Ya},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:So},{tag:[s.tags.propertyName],color:qa},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Yp},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:qa},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:qp},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:So},{tag:[s.tags.className],color:Xp},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Kp},{tag:[s.tags.typeName],color:Xa,fontStyle:Xa},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Ya},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Jp},{tag:[s.tags.meta,s.tags.comment],color:Gp},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Zp},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:So},{tag:s.tags.invalid,color:Qp},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),oh=[eh,x.syntaxHighlighting(th)],ah=!1,No="#fff",R="#444d56",de="#0366d625",Ka="#044289",Bo="#fff",Ga="#e1e4e8",lh="#c6c6c622",nh="#1b1f234d",ih="#24292e",rh="#34d05840",Za="#d73a49",Eo="#e36209",Qa="#005cc5",sh="#032f62",ch="#005cc5",Ja="#005cc5",dh="#6f42c1",ph="#005cc5",hh="#6a737d",mh="#005cc5",uh="#cb2431",gh="#032f62",fh=E.EditorView.theme({"&":{color:R,backgroundColor:No},".cm-content":{caretColor:Ka},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ka},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:de},".cm-panels":{backgroundColor:Bo,color:R},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Bo,outline:`1px solid ${Ga}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:de},".cm-activeLine":{backgroundColor:lh},".cm-selectionMatch":{backgroundColor:de},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:rh,outline:"none"},".cm-gutters":{backgroundColor:No,color:R,border:"none"},".cm-activeLineGutter":{backgroundColor:No},".cm-lineNumbers .cm-gutterElement":{color:nh},".cm-lineNumbers .cm-activeLineGutter":{color:ih},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:R},".cm-tooltip":{border:`1px solid ${Ga}`,backgroundColor:Bo,color:R},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:R,borderBottomColor:R},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:de,color:R}}},{dark:ah}),Ch=x.HighlightStyle.define([{tag:s.tags.keyword,color:Za},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Eo},{tag:[s.tags.propertyName],color:Qa},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:sh},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Qa},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:ch},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Eo},{tag:[s.tags.className],color:dh},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:ph},{tag:[s.tags.typeName],color:Ja,fontStyle:Ja},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Za},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:gh},{tag:[s.tags.meta,s.tags.comment],color:hh},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:mh},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Eo},{tag:s.tags.invalid,color:uh},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),vh=[fh,x.syntaxHighlighting(Ch)],yh=!0,Do="#24292e",U="#d1d5da",pe="#3392FF44",el="#c8e1ff",To="#24292e",tl="#1b1f23",kh="#4d566022",bh="#444d56",wh="#e1e4e8",Vh="#17E5E650",ol="#f97583",_o="#ffab70",al="#79b8ff",xh="#9ecbff",Sh="#79b8ff",ll="#79b8ff",Nh="#b392f0",Bh="#79b8ff",Eh="#6a737d",Dh="#79b8ff",Th="#f97583",_h="#9ecbff",Ih=E.EditorView.theme({"&":{color:U,backgroundColor:Do},".cm-content":{caretColor:el},".cm-cursor, .cm-dropCursor":{borderLeftColor:el},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:pe},".cm-panels":{backgroundColor:To,color:U},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:To,outline:`1px solid ${tl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:pe},".cm-activeLine":{backgroundColor:kh},".cm-selectionMatch":{backgroundColor:pe},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Vh,outline:"none"},".cm-gutters":{backgroundColor:Do,color:U,border:"none"},".cm-activeLineGutter":{backgroundColor:Do},".cm-lineNumbers .cm-gutterElement":{color:bh},".cm-lineNumbers .cm-activeLineGutter":{color:wh},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:U},".cm-tooltip":{border:`1px solid ${tl}`,backgroundColor:To,color:U},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:U,borderBottomColor:U},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:pe,color:U}}},{dark:yh}),Lh=x.HighlightStyle.define([{tag:s.tags.keyword,color:ol},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:_o},{tag:[s.tags.propertyName],color:al},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:xh},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:al},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Sh},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:_o},{tag:[s.tags.className],color:Nh},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Bh},{tag:[s.tags.typeName],color:ll,fontStyle:ll},{tag:[s.tags.operator,s.tags.operatorKeyword],color:ol},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:_h},{tag:[s.tags.meta,s.tags.comment],color:Eh},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Dh},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:_o},{tag:s.tags.invalid,color:Th},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Fh=[Ih,x.syntaxHighlighting(Lh)],$h=!0,Io="#21202e",W="#edecee",he="#3d375e7f",nl="#a277ff",Lo="#21202e",il="#3b334b",Oh="#4d4b6622",Mh="#a394f033",zh="#cdccce",Ph="#a394f033",rl="#a277ff",Fo="#edecee",sl="#ffca85",Hh="#61ffca",Ah="#61ffca",cl="#82e2ff",jh="#82e2ff",Rh="#61ffca",Uh="#6d6d6d",Wh="#a277ff",Yh="#ff6767",qh="#61ffca",Xh=E.EditorView.theme({"&":{color:W,backgroundColor:Io},".cm-content":{caretColor:nl},".cm-cursor, .cm-dropCursor":{borderLeftColor:nl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:he},".cm-panels":{backgroundColor:Lo,color:W},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Lo,outline:`1px solid ${il}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:he},".cm-activeLine":{backgroundColor:Oh},".cm-selectionMatch":{backgroundColor:he},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Ph,outline:"none"},".cm-gutters":{backgroundColor:Io,color:W,border:"none"},".cm-activeLineGutter":{backgroundColor:Io},".cm-lineNumbers .cm-gutterElement":{color:Mh},".cm-lineNumbers .cm-activeLineGutter":{color:zh},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:W},".cm-tooltip":{border:`1px solid ${il}`,backgroundColor:Lo,color:W},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:W,borderBottomColor:W},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:he,color:W}}},{dark:$h}),Kh=x.HighlightStyle.define([{tag:s.tags.keyword,color:rl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Fo},{tag:[s.tags.propertyName],color:sl},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Hh},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:sl},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Ah},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Fo},{tag:[s.tags.className],color:jh},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Rh},{tag:[s.tags.typeName],color:cl,fontStyle:cl},{tag:[s.tags.operator,s.tags.operatorKeyword],color:rl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:qh},{tag:[s.tags.meta,s.tags.comment],color:Uh},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Wh},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Fo},{tag:s.tags.invalid,color:Yh},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Gh=[Xh,x.syntaxHighlighting(Kh)],Zh=!0,$o="#1a1b26",Y="#787c99",me="#515c7e40",dl="#c0caf5",Oo="#1a1b26",pl="#787c99",Qh="#43455c22",Jh="#363b54",em="#737aa2",tm="#16161e",hl="#bb9af7",Mo="#c0caf5",ml="#7aa2f7",om="#9ece6a",am="#bb9af7",ul="#0db9d7",lm="#c0caf5",nm="#ff9e64",im="#444b6a",rm="#89ddff",sm="#ff5370",cm="#b4f9f8",dm=E.EditorView.theme({"&":{color:Y,backgroundColor:$o},".cm-content":{caretColor:dl},".cm-cursor, .cm-dropCursor":{borderLeftColor:dl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:me},".cm-panels":{backgroundColor:Oo,color:Y},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Oo,outline:`1px solid ${pl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:me},".cm-activeLine":{backgroundColor:Qh},".cm-selectionMatch":{backgroundColor:me},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:tm,outline:"none"},".cm-gutters":{backgroundColor:$o,color:Y,border:"none"},".cm-activeLineGutter":{backgroundColor:$o},".cm-lineNumbers .cm-gutterElement":{color:Jh},".cm-lineNumbers .cm-activeLineGutter":{color:em},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:Y},".cm-tooltip":{border:`1px solid ${pl}`,backgroundColor:Oo,color:Y},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Y,borderBottomColor:Y},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:me,color:Y}}},{dark:Zh}),pm=x.HighlightStyle.define([{tag:s.tags.keyword,color:hl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Mo},{tag:[s.tags.propertyName],color:ml},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:om},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:ml},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:am},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Mo},{tag:[s.tags.className],color:lm},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:nm},{tag:[s.tags.typeName],color:ul,fontStyle:ul},{tag:[s.tags.operator,s.tags.operatorKeyword],color:hl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:cm},{tag:[s.tags.meta,s.tags.comment],color:im},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:rm},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Mo},{tag:s.tags.invalid,color:sm},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),hm=[dm,x.syntaxHighlighting(pm)],mm=!0,zo="#24283b",q="#7982a9",ue="#6f7bb630",gl="#c0caf5",Po="#24283b",fl="#7982a9",um="#4d547722",gm="#3b4261",fm="#737aa2",Cm="#1f2335",Cl="#bb9af7",Ho="#c0caf5",vl="#7aa2f7",vm="#9ece6a",ym="#bb9af7",yl="#2ac3de",km="#c0caf5",bm="#ff9e64",wm="#565f89",Vm="#89ddff",xm="#ff5370",Sm="#b4f9f8",Nm=E.EditorView.theme({"&":{color:q,backgroundColor:zo},".cm-content":{caretColor:gl},".cm-cursor, .cm-dropCursor":{borderLeftColor:gl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ue},".cm-panels":{backgroundColor:Po,color:q},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Po,outline:`1px solid ${fl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ue},".cm-activeLine":{backgroundColor:um},".cm-selectionMatch":{backgroundColor:ue},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Cm,outline:"none"},".cm-gutters":{backgroundColor:zo,color:q,border:"none"},".cm-activeLineGutter":{backgroundColor:zo},".cm-lineNumbers .cm-gutterElement":{color:gm},".cm-lineNumbers .cm-activeLineGutter":{color:fm},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:q},".cm-tooltip":{border:`1px solid ${fl}`,backgroundColor:Po,color:q},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:q,borderBottomColor:q},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:ue,color:q}}},{dark:mm}),Bm=x.HighlightStyle.define([{tag:s.tags.keyword,color:Cl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Ho},{tag:[s.tags.propertyName],color:vl},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:vm},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:vl},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:ym},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Ho},{tag:[s.tags.className],color:km},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:bm},{tag:[s.tags.typeName],color:yl,fontStyle:yl},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Cl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Sm},{tag:[s.tags.meta,s.tags.comment],color:wm},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Vm},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Ho},{tag:s.tags.invalid,color:xm},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Em=[Nm,x.syntaxHighlighting(Bm)],Dm=!1,Ao="#e1e2e7",X="#6a6f8e",ge="#8591b840",kl="#3760bf",jo="#e1e2e7",bl="#6a6f8e",Tm="#a7aaba22",_m="#b3b6cd",Im="#68709a",Lm="#e9e9ec",wl="#9854f1",Ro="#3760bf",Vl="#2e7de9",Fm="#587539",$m="#9854f1",xl="#07879d",Om="#3760bf",Mm="#b15c00",zm="#9da3c2",Pm="#006a83",Hm="#ff3e64",Am="#2e5857",jm=E.EditorView.theme({"&":{color:X,backgroundColor:Ao},".cm-content":{caretColor:kl},".cm-cursor, .cm-dropCursor":{borderLeftColor:kl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ge},".cm-panels":{backgroundColor:jo,color:X},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:jo,outline:`1px solid ${bl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ge},".cm-activeLine":{backgroundColor:Tm},".cm-selectionMatch":{backgroundColor:ge},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Lm,outline:"none"},".cm-gutters":{backgroundColor:Ao,color:X,border:"none"},".cm-activeLineGutter":{backgroundColor:Ao},".cm-lineNumbers .cm-gutterElement":{color:_m},".cm-lineNumbers .cm-activeLineGutter":{color:Im},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:X},".cm-tooltip":{border:`1px solid ${bl}`,backgroundColor:jo,color:X},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:X,borderBottomColor:X},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:ge,color:X}}},{dark:Dm}),Rm=x.HighlightStyle.define([{tag:s.tags.keyword,color:wl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Ro},{tag:[s.tags.propertyName],color:Vl},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Fm},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Vl},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:$m},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Ro},{tag:[s.tags.className],color:Om},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Mm},{tag:[s.tags.typeName],color:xl,fontStyle:xl},{tag:[s.tags.operator,s.tags.operatorKeyword],color:wl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Am},{tag:[s.tags.meta,s.tags.comment],color:zm},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Pm},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Ro},{tag:s.tags.invalid,color:Hm},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Um=[jm,x.syntaxHighlighting(Rm)],Wm={disabled:!1,indentWithTab:!0,tabSize:4,autofocus:!1,placeholder:"input...",backgroundColor:"white",language:"markdown",theme:"oneDark",phrases:"en-us"},Rl={emits:["update:config"],components:{CodemirrorEditor:Bd},data:()=>({codemrrConfig:{...Wm},codemrrThemes:{oneDark:Td,materialLight:Yd,materialDark:sp,solarizedLight:xp,solarizedDark:Hp,dracula:oh,githubLight:vh,githubDark:Fh,aura:Gh,tokyoNight:hm,tokyoNightStorm:Em,tokyoNightDay:Um},codemrrLanguages:{javascript:aa.javascript(),js:aa.javascript(),html:pn.html(),markdown:mn.markdown(),json:hn.json(),vue:un.vue(),java:fn.java(),php:gn.php(),python:Cn.python(),go:yn.go(),mysql:la.sql(),sql:la.sql(),xml:vn.xml(),css:kn.css()},codemrrPhrases:{"Control character":"Steuerzeichen","Selection deleted":"Auswahl gelöscht","Folded lines":"Eingeklappte Zeilen","Unfolded lines":"Ausgeklappte Zeilen",to:"bis","folded code":"eingeklappter Code",unfold:"ausklappen","Fold line":"Zeile einklappen","Unfold line":"Zeile ausklappen","Go to line":"Springe zu Zeile",go:"OK",Find:"Suchen",Replace:"Ersetzen",next:"nächste",previous:"vorherige",all:"alle","match case":"groß/klein beachten","by word":"ganze Wörter",replace:"ersetzen","replace all":"alle ersetzen",close:"schließen","current match":"aktueller Treffer","replaced $ matches":"$ Treffer ersetzt","replaced match on line $":"Treffer on Zeile $ ersetzt","on line":"auf Zeile",Completions:"Vervollständigungen",Diagnostics:"Diagnosen","No diagnostics":"Keine Diagnosen"},editorViewInst:null,editorStateInst:null}),computed:{optionTheme(){let t=Object.keys(this.codemrrThemes);return["default"].concat(t)},optionPhrases:()=>["en-us","de-de"],optionLanguage(){return Object.keys(this.codemrrLanguages)},extensions(){const t=[];return t.push(this.codemrrLanguages[this.codemrrConfig.language]),this.codemrrThemes[this.codemrrConfig.theme]&&t.push(this.codemrrThemes[this.codemrrConfig.theme]),t},codemrrBind(){return{theme:this.codemrrConfig.theme,language:this.codemrrConfig.language,autofocus:this.codemrrConfig.autofocus,placeholder:this.codemrrConfig.placeholder,indentWithTab:this.codemrrConfig.indentWithTab,tabSize:this.codemrrConfig.tabSize,disabled:this.codemrrConfig.disabled,phrases:this.codemrrConfig.phrases==="en-us"?{}:this.codemrrPhrases}}},watch:{codemrrConfig(t){this.$emit("update:config",t)}}},te={props:{editorID:{type:[String],required:!1,default:()=>""}},data:()=>({editorRefEL:null}),computed:{editorRefID(){return this.editorID?this.editorID:this.$options.name+ +new Date+((1e3*Math.random()).toFixed(0)+"")}}};function Ul(t,o){var a=document.createElement("a");if(a.setAttribute("href","data:text/plain;charset=UTF-8,"+encodeURIComponent(t)),a.setAttribute("download",o),a.style.display="none",document.createEvent){const i=document.createEvent("MouseEvents");i.initEvent("click",!0,!0),a.dispatchEvent(i)}else a.click()}function fe(t){return t<10?"0"+t:t}const Ym={undo:!1,redo:!1,strong:!0,italic:!0,overline:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,hr:!0,quote:!0,ul:!0,ol:!0,notChecked:!0,checked:!0,link:!0,table:!0,image:!0,uploadImage:!0,custom_image:!0,custom_uploadImage:!0,custom_uploadFile:!0,importmd:!0,exportmd:!0,code:!0,html_to_markdown:!0,split:!0,preview:!0,scrollSync:!0,save:!0,clear:!0,copy:!0,toc:!0,fullscreen:!0,theme:!0,backgroundColor:!1,language:!1,phrases:!1,disabled:!1,autofocus:!1,indentWithTab:!1},qm={t:"1713021153946",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1924",width:"20",height:"20"},Xm={t:"1599285632421",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"45640",width:"17",height:"17"},Km={t:"1611551476626",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4615",width:"22",height:"22"},Gm={t:"1713097613984",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6856",width:"18",height:"18"},Zm={t:"1713109019954",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"13071",width:"18",height:"18"},Qo={components:{SvgImgMap:v({name:"SvgImgMap"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",qm,[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M659.456 786.432l-114.688-188.416c-4.10112-8.192-8.19712-12.28288-16.384-12.28288-4.096 0-8.19712 4.096-12.288 4.096l-57.344 57.344-61.44-90.11712c-4.096-8.192-8.192-12.28288-16.384-12.28288s-12.288 4.096-16.384 8.192l-151.552 225.28c0 4.096-4.096 8.192-4.096 12.288 0 12.28288 8.192 20.48 20.48 20.48h413.696c12.288 0 20.48-8.19712 20.48-20.48l-4.096-4.10112zM286.72 512c40.96 0 73.728-32.768 73.728-73.728S327.68 364.544 286.72 364.544s-73.728 32.768-73.728 73.728C208.896 479.232 245.76 512 286.72 512zM851.968 98.304H323.584c-40.96 0-73.728 32.768-73.728 73.728v20.48c0 12.288 8.192 20.48 20.48 20.48s16.384-12.288 16.384-20.48v-20.48c0-20.48 16.384-36.864 36.864-36.864h528.384c20.48 0 36.85888 16.384 36.85888 36.864v528.384c0 20.48-16.37888 36.864-36.85888 36.864h-20.48c-12.288 0-20.48 8.192-20.48 20.48s8.192 20.48 20.48 20.48h20.48c40.96 0 73.72288-32.768 73.72288-73.728v-532.48c0.00512-40.96-32.76288-73.728-73.72288-73.728z","p-id":"1925"},null,-1),e.createElementVNode("path",{d:"M700.416 249.856H172.032c-40.96 0-73.728 32.768-73.728 73.728v528.384c0 40.96 32.768 73.72288 73.728 73.72288h528.384c40.96 0 73.728-32.76288 73.728-73.72288V323.584c0-40.96-32.768-73.728-73.728-73.728z m36.864 602.112c0 20.48-16.384 36.85888-36.864 36.85888H172.032c-20.48 0-36.864-16.37888-36.864-36.85888V323.584c0-20.48 16.384-36.864 36.864-36.864h528.384c20.48 0 36.864 16.384 36.864 36.864v528.384z","p-id":"1926"},null,-1)])])}]]),SvgUploadFile:v({name:"SvgUploadFile"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Xm,[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M127.519 892.879v-763.34h655.448V514.69h63.612V81.831c0-8.783-7.12-15.903-15.903-15.903H79.81c-8.783 0-15.903 7.12-15.903 15.903v858.757c0 8.783 7.12 15.903 15.903 15.903h493.993v-63.612H127.519z","p-id":"45641"},null,-1),e.createElementVNode("path",{d:"M231.608 228.388h447.269V292H231.608zM231.608 384.409h447.269v63.612H231.608zM231.608 540.43h245.141v63.612H231.608zM231.608 696.451h245.141v63.612H231.608zM923.269 762.938L745.315 584.984c-3.545-3.545-8.34-5.074-12.966-4.596a15.931 15.931 0 0 0-9.848 4.616L544.586 762.918c-6.248 6.248-6.248 16.379 0 22.627l22.353 22.353c6.248 6.248 16.379 6.248 22.627 0l112.555-112.555v245.148c0 8.837 7.163 16 16 16h31.612c8.837 0 16-7.163 16-16V695.363l112.555 112.555c6.248 6.248 16.379 6.248 22.627 0l22.353-22.353c6.249-6.248 6.249-16.378 0.001-22.627z","p-id":"45642"},null,-1)])])}]]),SvgToc:v({name:"SvgToc"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Km,[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M370.1 371.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7zM370.1 712.4h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.2-2.6 5.7-5.7 5.7z m333.5-7.5H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.1-2.7 5.7-5.8 5.7zM370.1 542.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7z","p-id":"4616"},null,-1),e.createElementVNode("path",{d:"M847.1 560.4V250.1s0-24.7-14-46.4c-10.8-16.8-30-31.8-64.2-31.8h-261c-0.2 0-0.3 0-0.5 0.1H255s-78.1 0-78.1 78.1l0.1 213.4V774s0 24.7 13.9 46.3c10.8 16.8 30 31.8 64.2 31.8h261.1c0.2 0 0.3 0 0.5-0.1H769s78.1 0 78.1-78.1l-0.1-213.4 0.1-0.1z m-39 213.6c-1.3 38.5-38.9 39-38.9 39h-514c-1.3-0.1-2.5-0.2-3.8-0.3-5.4-1.1-15.7-4.1-23.9-11.7-9-9.7-11.2-22.3-11.7-26.1v-0.7l0.1-524.2c1.3-38.5 38.9-39 38.9-39h514c1.3 0.1 2.5 0.2 3.7 0.3 5.4 1.1 15.7 4.1 23.9 11.7 9 9.7 11.2 22.2 11.7 26 0 0.2 0 0.5 0.1 0.7l-0.1 524.3z","p-id":"4617"},null,-1)])])}]]),SvgCopy:v({name:"SvgCopy"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Gm,[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M857.373005 65.290005 469.604424 65.290005c-34.211173 0-62.044078 27.832905-62.044078 62.043055l0 10.340509-63.076594 0c-25.993001 0-48.228421 16.346293-57.001225 39.293935L166.626995 176.967504c-34.21015 0-62.043055 27.832905-62.043055 62.043055l0 657.655358c0 34.21015 27.832905 62.043055 62.043055 62.043055l550.115086 0c34.21015 0 62.043055-27.832905 62.043055-62.043055l0-49.634444 78.587869 0c34.21015 0 62.043055-27.832905 62.043055-62.043055L919.41606 127.33306C919.41606 93.122911 891.583155 65.290005 857.373005 65.290005zM344.483752 179.035606l194.402595 0c10.833743 0 19.646456 8.813736 19.646456 19.646456 0 10.833743-8.813736 19.646456-19.646456 19.646456L344.483752 218.328517c-10.833743 0-19.646456-8.813736-19.646456-19.646456C324.836273 187.849342 333.650009 179.035606 344.483752 179.035606zM737.423099 896.665917c0 11.402701-9.278317 20.681018-20.681018 20.681018L166.626995 917.346935c-11.403724 0-20.681018-9.278317-20.681018-20.681018L145.945977 239.010559c0-11.402701 9.277294-20.681018 20.681018-20.681018l120.111588 0c8.197706 24.02723 30.977525 41.362037 57.744145 41.362037l194.402595 0c26.767644 0 49.54644-17.334807 57.744145-41.362037l120.111588 0c11.402701 0 20.681018 9.278317 20.681018 20.681018L737.422076 896.665917zM878.054023 784.988418c0 11.402701-9.278317 20.681018-20.681018 20.681018l-78.587869 0L778.785136 239.010559c0-34.21015-27.832905-62.043055-62.043055-62.043055L595.886549 176.967504c-8.771781-22.947641-31.007201-39.293935-57.001225-39.293935l-89.963964 0L448.921359 127.33306c0-11.403724 9.278317-20.681018 20.683065-20.681018l387.768581 0c11.402701 0 20.681018 9.277294 20.681018 20.681018L878.054023 784.988418z","p-id":"6857"},null,-1),e.createElementVNode("path",{d:"M620.597347 334.252737 260.748652 334.252737c-11.422144 0-20.681018 9.259898-20.681018 20.681018s9.258874 20.681018 20.681018 20.681018l359.849718 0c11.42112 0 20.681018-9.259898 20.681018-20.681018S632.018467 334.252737 620.597347 334.252737z","p-id":"6858"},null,-1),e.createElementVNode("path",{d:"M620.597347 454.201619 260.748652 454.201619c-11.422144 0-20.681018 9.259898-20.681018 20.681018 0 11.42112 9.258874 20.681018 20.681018 20.681018l359.849718 0c11.42112 0 20.681018-9.259898 20.681018-20.681018C641.278365 463.46254 632.018467 454.201619 620.597347 454.201619z","p-id":"6859"},null,-1),e.createElementVNode("path",{d:"M440.673511 574.151525 260.748652 574.151525c-11.422144 0-20.681018 9.259898-20.681018 20.681018 0 11.42112 9.258874 20.681018 20.681018 20.681018l179.924859 0c11.42112 0 20.681018-9.259898 20.681018-20.681018C461.35453 583.411423 452.093609 574.151525 440.673511 574.151525z","p-id":"6860"},null,-1)])])}]]),SvgLanguage:v({name:"SvgLanguage"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Zm,[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M200.313605 806.764028h487.993851v78.708685h-487.993851z",fill:"#6C7280","p-id":"13072"},null,-1),e.createElementVNode("path",{d:"M809.518832 136.166026H79.102229a78.708686 78.708686 0 0 0-78.708686 78.708686V944.504228a78.708686 78.708686 0 0 0 78.708686 78.708685h730.416603a78.708686 78.708686 0 0 0 78.708685-78.708685V214.874712a78.708686 78.708686 0 0 0-78.708685-78.708686z m0 848.479631V944.504228H79.102229V214.874712h730.416603V944.504228z","p-id":"13073"},null,-1),e.createElementVNode("path",{d:"M944.897771 0H171.978478v78.708686H944.897771v787.086856h78.708686V78.708686a78.708686 78.708686 0 0 0-78.708686-78.708686z","p-id":"13074"},null,-1),e.createElementVNode("path",{d:"M360.092237 609.205227h161.352805l44.863951 117.275941h58.244427l-157.417371-385.672559h-55.09608L263.280553 725.694081H315.228286z m57.45734-157.417372a487.206764 487.206764 0 0 0 20.464259-73.986164q8.657955 31.483474 27.548039 78.708686l40.14143 107.043812H375.046887z","p-id":"13075"},null,-1)])])}]])},emits:["on-action","on-act-copy","on-act-save","on-act-theme","on-act-custom","on-act-choose-image"],props:{exportFileName:{type:String,default:""},toolbars:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1}},data:()=>({actionThemeDropdown:!1,actionPhrasesDropdown:!1,actionLanguageDropdown:!1,actionBgColorDropdown:!1,actionSplit:!0,actionPreview:!1,actionScrollSync:!0,actionToc:!0,actionFullscreen:!1,actionHtmlDiaVisible:!1,actionHtmlText:""}),computed:{lastExpFileName(){let t=new Date,o=t.getFullYear(),a=t.getMonth()+1,i=t.getDate(),l=t.getHours(),n=t.getMinutes(),r=o+"-"+fe(a)+"-"+fe(i)+"_"+fe(l)+"-"+fe(n);return this.exportFileName||r},toolConfig(){const{toolbars:t={}}=this;return{...Ym,...t}}},created(){this.actionPreview=this.isPreview||!1},methods:{actionPhrasesSet(t){this.codemrrConfig.phrases=t,this.actionPhrasesDropdown=!1},actionLanguageSet(t){this.codemrrConfig.language=t,this.actionLanguageDropdown=!1},actionBgColorSet(t){this.codemrrConfig.backgroundColor=t,this.actionBgColorDropdown=!1},actionThemesSet(t){this.codemrrConfig.theme=t,this.actionThemeDropdown=!1,this.$emit("on-act-theme",t)},actionFullscreenSet(t){this.actionFullscreen=t;let o=this.$refs[this.editorWrapRefID];t?o.classList.add("fullscreen"):o.classList.remove("fullscreen"),this.actionCurrent("fullscreen",t)},actionChooseImage(){const t=document.createElement("input");t.type="file",t.accept="image/*",t.onchange=()=>{const o=t.files;o[0]&&(this.$emit("on-act-choose-image",o[0]),t.value="")},t.click()},actionInsBg(){const t=this.getLastPoint(),o=t.content||!1;o?this.insertContent("=="+o+"=="):(this.insertContent("===="),this.setCursor(t.line,t.ch+1))},actionUndo(){if(this.editorViewInst){const t=this.editorViewInst.state.behavior(L.EditorState.effect(L.EditorState.undo));this.editorViewInst.update([{changes:{from:0,to:t.doc.length,insert:t.doc},selection:L.EditorSelection.single(0)}])}},actionRedo(){this.editorViewInst&&this.editorViewInst.dispatch({...this.editorViewInst.state,effects:L.EditorState.redo()})},actionInsStrong(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="**"+o+"**",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="****",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsItalic(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="*"+o+"*",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="**",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsOverline(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="~~"+o+"~~",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="~~~~",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsUnderline(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="<u>"+o+"</u>",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="<u></u>",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsTitle(t){const o={1:"# ",2:"## ",3:"### ",4:"#### ",5:"##### ",6:"###### "}[t],a=this.getLastPoint(),i=a.content||!1;let l=`
|
|
7
|
+
</div>`,this.$emit("real-time",i)},reload(){let t=new Image;t.onload=()=>{this.w=parseFloat(window.getComputedStyle(this.$refs.cropper).width),this.h=parseFloat(window.getComputedStyle(this.$refs.cropper).height),this.trueWidth=t.width,this.trueHeight=t.height,this.original?this.scale=1:this.scale=this.checkedMode(),this.$nextTick(()=>{this.x=-(this.trueWidth-this.trueWidth*this.scale)/2+(this.w-this.trueWidth*this.scale)/2,this.y=-(this.trueHeight-this.trueHeight*this.scale)/2+(this.h-this.trueHeight*this.scale)/2,this.loading=!1,this.autoCrop&&this.goAutoCrop(),this.$emit("img-load","success"),setTimeout(()=>{this.showPreview()},20)})},t.onerror=()=>{this.$emit("img-load","error")},t.src=this.imgs},checkedMode(){let t=1,o=this.trueWidth,a=this.trueHeight;const i=this.mode.split(" ");switch(i[0]){case"contain":this.trueWidth>this.w&&(t=this.w/this.trueWidth),this.trueHeight*t>this.h&&(t=this.h/this.trueHeight);break;case"cover":o=this.w,t=o/this.trueWidth,a*=t,a<this.h&&(a=this.h,t=a/this.trueHeight);break;default:try{let l=i[0];if(l.search("px")!==-1){l=l.replace("px",""),o=parseFloat(l);const n=o/this.trueWidth;let r=1,c=i[1];c.search("px")!==-1&&(c=c.replace("px",""),a=parseFloat(c),r=a/this.trueHeight),t=Math.min(n,r)}if(l.search("%")!==-1&&(l=l.replace("%",""),o=parseFloat(l)/100*this.w,t=o/this.trueWidth),i.length===2&&l==="auto"){let n=i[1];n.search("px")!==-1&&(n=n.replace("px",""),a=parseFloat(n),t=a/this.trueHeight),n.search("%")!==-1&&(n=n.replace("%",""),a=parseFloat(n)/100*this.h,t=a/this.trueHeight)}}catch{t=1}}return t},goAutoCrop(t,o){if(this.imgs===""||this.imgs===null)return;this.clearCrop(),this.cropping=!0;let a=this.w,i=this.h;if(this.centerBox){const r=Math.abs(this.rotate)%2>0;let c=(r?this.trueHeight:this.trueWidth)*this.scale,p=(r?this.trueWidth:this.trueHeight)*this.scale;a=c<a?c:a,i=p<i?p:i}var l=t||parseFloat(this.autoCropWidth),n=o||parseFloat(this.autoCropHeight);(l===0||n===0)&&(l=.8*a,n=.8*i),l=l>a?a:l,n=n>i?i:n,this.fixed&&(n=l/this.fixedNumber[0]*this.fixedNumber[1]),n>this.h&&(l=(n=this.h)/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(l,n)},changeCrop(t,o){if(this.centerBox){let a=this.getImgAxis();t>a.x2-a.x1&&(o=(t=a.x2-a.x1)/this.fixedNumber[0]*this.fixedNumber[1]),o>a.y2-a.y1&&(t=(o=a.y2-a.y1)/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=t,this.cropH=o,this.checkCropLimitSize(),this.$nextTick(()=>{this.cropOffsertX=(this.w-this.cropW)/2,this.cropOffsertY=(this.h-this.cropH)/2,this.centerBox&&this.moveCrop(null,!0)})},refresh(){this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.imgIsQqualCrop=!1,this.clearCrop(),this.$nextTick(()=>{this.checkedImg()})},rotateLeft(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight(){this.rotate=this.rotate>=3?0:this.rotate+1},rotateClear(){this.rotate=0},checkoutImgAxis(t,o,a){t=t||this.x,o=o||this.y,a=a||this.scale;let i=!0;if(this.centerBox){let l=this.getImgAxis(t,o,a),n=this.getCropAxis();l.x1>=n.x1&&(i=!1),l.x2<=n.x2&&(i=!1),l.y1>=n.y1&&(i=!1),l.y2<=n.y2&&(i=!1),i||this.changeImgScale(l,n,a)}return i},changeImgScale(t,o,a){let i=this.trueWidth,l=this.trueHeight,n=i*a,r=l*a;if(n>=this.cropW&&r>=this.cropH)this.scale=a;else{const c=this.cropW/i,p=this.cropH/l,d=this.cropH<=l*c?c:p;this.scale=d,n=i*d,r=l*d}this.imgIsQqualCrop||(t.x1>=o.x1&&(this.isRotateRightOrLeft?this.x=o.x1-(i-n)/2-(n-r)/2:this.x=o.x1-(i-n)/2),t.x2<=o.x2&&(this.isRotateRightOrLeft?this.x=o.x1-(i-n)/2-(n-r)/2-r+this.cropW:this.x=o.x2-(i-n)/2-n),t.y1>=o.y1&&(this.isRotateRightOrLeft?this.y=o.y1-(l-r)/2-(r-n)/2:this.y=o.y1-(l-r)/2),t.y2<=o.y2&&(this.isRotateRightOrLeft?this.y=o.y2-(l-r)/2-(r-n)/2-n:this.y=o.y2-(l-r)/2-r)),(n<this.cropW||r<this.cropH)&&(this.imgIsQqualCrop=!0)}},mounted(){this.support="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let t=this;var o=navigator.userAgent;this.isIOS=!!o.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(a,i,l){for(var n=atob(this.toDataURL(i,l).split(",")[1]),r=n.length,c=new Uint8Array(r),p=0;p<r;p++)c[p]=n.charCodeAt(p);a(new Blob([c],{type:t.type||"image/png"}))}}),this.showPreview(),this.checkedImg()},unmounted(){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.cancelScale()}}),fi={key:0,class:"cropper-box"},Ci=["src"],vi={class:"cropper-view-box"},yi=["src"],ki={key:1},bi={props:{loading:{type:[Boolean],default:!1},modelValue:{type:[Boolean],default:!1},src:{type:[String],default:""},size:{type:[Number],default:120},title:{type:[String],default:"裁剪"}},components:{VueCropper:ui(gi,[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:"vue-cropper",ref:"cropper",onMouseover:o[28]||(o[28]=(...r)=>t.scaleImg&&t.scaleImg(...r)),onMouseout:o[29]||(o[29]=(...r)=>t.cancelScale&&t.cancelScale(...r))},[t.imgs?(e.openBlock(),e.createElementBlock("div",fi,[e.withDirectives(e.createElementVNode("div",{class:"cropper-box-canvas",style:e.normalizeStyle({width:t.trueWidth+"px",height:t.trueHeight+"px",transform:"scale("+t.scale+","+t.scale+") translate3d("+t.x/t.scale+"px,"+t.y/t.scale+"px,0)rotateZ("+90*t.rotate+"deg)"})},[e.createElementVNode("img",{src:t.imgs,alt:"cropper-img",ref:"cropperImg"},null,8,Ci)],4),[[e.vShow,!t.loading]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["cropper-drag-box",{"cropper-move":t.move&&!t.crop,"cropper-crop":t.crop,"cropper-modal":t.cropping}]),onMousedown:o[0]||(o[0]=(...r)=>t.startMove&&t.startMove(...r)),onTouchstart:o[1]||(o[1]=(...r)=>t.startMove&&t.startMove(...r))},null,34),e.withDirectives(e.createElementVNode("div",{class:"cropper-crop-box",style:e.normalizeStyle({width:t.cropW+"px",height:t.cropH+"px",transform:"translate3d("+t.cropOffsertX+"px,"+t.cropOffsertY+"px,0)"})},[e.createElementVNode("span",vi,[e.createElementVNode("img",{style:e.normalizeStyle({width:t.trueWidth+"px",height:t.trueHeight+"px",transform:"scale("+t.scale+","+t.scale+") translate3d("+(t.x-t.cropOffsertX)/t.scale+"px,"+(t.y-t.cropOffsertY)/t.scale+"px,0)rotateZ("+90*t.rotate+"deg)"}),src:t.imgs,alt:"cropper-img"},null,12,yi)]),e.createElementVNode("span",{class:"cropper-face cropper-move",onMousedown:o[2]||(o[2]=(...r)=>t.cropMove&&t.cropMove(...r)),onTouchstart:o[3]||(o[3]=(...r)=>t.cropMove&&t.cropMove(...r))},null,32),t.info?(e.openBlock(),e.createElementBlock("span",{key:0,class:"crop-info",style:e.normalizeStyle({top:t.cropInfo.top})},e.toDisplayString(t.cropInfo.width)+" × "+e.toDisplayString(t.cropInfo.height),5)):e.createCommentVNode("",!0),t.fixedBox?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ki,[e.createElementVNode("span",{class:"crop-line line-w",onMousedown:o[4]||(o[4]=r=>t.changeCropSize(r,!1,!0,0,1)),onTouchstart:o[5]||(o[5]=r=>t.changeCropSize(r,!1,!0,0,1))},null,32),e.createElementVNode("span",{class:"crop-line line-a",onMousedown:o[6]||(o[6]=r=>t.changeCropSize(r,!0,!1,1,0)),onTouchstart:o[7]||(o[7]=r=>t.changeCropSize(r,!0,!1,1,0))},null,32),e.createElementVNode("span",{class:"crop-line line-s",onMousedown:o[8]||(o[8]=r=>t.changeCropSize(r,!1,!0,0,2)),onTouchstart:o[9]||(o[9]=r=>t.changeCropSize(r,!1,!0,0,2))},null,32),e.createElementVNode("span",{class:"crop-line line-d",onMousedown:o[10]||(o[10]=r=>t.changeCropSize(r,!0,!1,2,0)),onTouchstart:o[11]||(o[11]=r=>t.changeCropSize(r,!0,!1,2,0))},null,32),e.createElementVNode("span",{class:"crop-point point1",onMousedown:o[12]||(o[12]=r=>t.changeCropSize(r,!0,!0,1,1)),onTouchstart:o[13]||(o[13]=r=>t.changeCropSize(r,!0,!0,1,1))},null,32),e.createElementVNode("span",{class:"crop-point point2",onMousedown:o[14]||(o[14]=r=>t.changeCropSize(r,!1,!0,0,1)),onTouchstart:o[15]||(o[15]=r=>t.changeCropSize(r,!1,!0,0,1))},null,32),e.createElementVNode("span",{class:"crop-point point3",onMousedown:o[16]||(o[16]=r=>t.changeCropSize(r,!0,!0,2,1)),onTouchstart:o[17]||(o[17]=r=>t.changeCropSize(r,!0,!0,2,1))},null,32),e.createElementVNode("span",{class:"crop-point point4",onMousedown:o[18]||(o[18]=r=>t.changeCropSize(r,!0,!1,1,0)),onTouchstart:o[19]||(o[19]=r=>t.changeCropSize(r,!0,!1,1,0))},null,32),e.createElementVNode("span",{class:"crop-point point5",onMousedown:o[20]||(o[20]=r=>t.changeCropSize(r,!0,!1,2,0)),onTouchstart:o[21]||(o[21]=r=>t.changeCropSize(r,!0,!1,2,0))},null,32),e.createElementVNode("span",{class:"crop-point point6",onMousedown:o[22]||(o[22]=r=>t.changeCropSize(r,!0,!0,1,2)),onTouchstart:o[23]||(o[23]=r=>t.changeCropSize(r,!0,!0,1,2))},null,32),e.createElementVNode("span",{class:"crop-point point7",onMousedown:o[24]||(o[24]=r=>t.changeCropSize(r,!1,!0,0,2)),onTouchstart:o[25]||(o[25]=r=>t.changeCropSize(r,!1,!0,0,2))},null,32),e.createElementVNode("span",{class:"crop-point point8",onMousedown:o[26]||(o[26]=r=>t.changeCropSize(r,!0,!0,2,2)),onTouchstart:o[27]||(o[27]=r=>t.changeCropSize(r,!0,!0,2,2))},null,32)]))],4),[[e.vShow,t.cropping]])],544)}],["__scopeId","data-v-a742df44"]])},emits:["update:modelValue","onSubmit","onClose"],data(){return{cropDialogVisible:!1,cropAutoCrop:!0,cropFixedBox:!0,cropOutputType:"png",cropPreviews:{},cropVisible:!1,cropBeforelImage:"",cropAfterImage:"",cropLocalWidth:this.size,cropLocalHeight:this.size}},watch:{modelValue(t){this.cropDialogVisible=t,this.cropInit()},src(t){this.cropInit()}},computed:{cropAttrs(){return{info:!0,autoCrop:this.cropAutoCrop,fixedBox:this.cropFixedBox,autoCropWidth:this.cropLocalWidth,autoCropHeight:this.cropLocalHeight,outputType:this.cropOutputType}}},mounted(){},methods:{cropInit(){this.cropBeforelImage=this.src||""},cropDialoClose(){this.cropBeforelImage="",this.cropPreviews="",this.cropVisible=!1,this.cropDialogVisible=!1,this.$emit("update:modelValue",!1),this.$emit("onClose",!1)},cropDialogOpened(){this.$nextTick(()=>{this.cropVisible=!0})},cropSubmit(){this._submit_blob()},_submit_blob(){this.$refs.cvAvatartCropper.getCropBlob(t=>{this.$emit("onSubmit",{file:t})})},_submit_base64(){this.$refs.cvAvatartCropper.getCropData(t=>{let o=new Image;o.src=t,o.onload=async()=>{imageCompress(o)}})},cropRotateRefresh(){},cropRotateLeft(){this.$refs.cvAvatartCropper.rotateLeft()},cropRotateRight(){this.$refs.cvAvatartCropper.rotateRight()},cropChangeScale(t){t=t||1,this.$refs.cvAvatartCropper.changeScale(t)},cropRealTime(t){this.cropPreviews=t}}},wi={class:"cv-upload-crop-box"},Vi={class:"cv-upload-crop-left-box"},xi={class:"cv-upload-crop-left-opt"},Si={class:"cv-upload-crop-left-opt2"},Ni={class:"cv-upload-crop-left-opt2"},Bi={class:"cv-upload-crop-right-box"},Ei=["innerHTML"],Di={title:"头像上传",name:"cvUploadAvatar",mixins:[lo],components:{UploadCrop:v(bi,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("vue-cropper"),c=e.resolveComponent("el-button"),p=e.resolveComponent("el-tooltip"),d=e.resolveComponent("el-input"),h=e.resolveComponent("el-dialog"),u=e.resolveDirective("loading");return e.openBlock(),e.createBlock(h,{title:a.title,modelValue:l.cropDialogVisible,"onUpdate:modelValue":o[7]||(o[7]=m=>l.cropDialogVisible=m),width:"800px","append-to-body":"",onOpened:n.cropDialogOpened,onClose:n.cropDialoClose},{footer:e.withCtx(()=>[e.createVNode(c,{type:"primary",onClick:n.cropSubmit,loading:a.loading,disabled:a.loading},{default:e.withCtx(()=>[...o[12]||(o[12]=[e.createTextVNode("提 交",-1)])]),_:1},8,["onClick","loading","disabled"])]),default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",wi,[e.createElementVNode("div",Vi,[l.cropVisible?(e.openBlock(),e.createBlock(r,e.mergeProps({key:0,ref:"cvAvatartCropper",img:l.cropBeforelImage},n.cropAttrs,{onRealTime:n.cropRealTime}),null,16,["img","onRealTime"])):e.createCommentVNode("",!0),e.createElementVNode("div",xi,[e.renderSlot(t.$slots,"default"),e.createVNode(p,{effect:"dark",content:"重置",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconRefresh",onClick:o[0]||(o[0]=m=>n.cropRotateRefresh())})]),_:1}),e.createVNode(p,{effect:"dark",content:"放大",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconZoomIn",onClick:o[1]||(o[1]=m=>n.cropChangeScale(1))})]),_:1}),e.createVNode(p,{effect:"dark",content:"缩小",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconZoomOut",onClick:o[2]||(o[2]=m=>n.cropChangeScale(-1))})]),_:1}),e.createVNode(p,{effect:"dark",content:"向左旋转",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconRefreshLeft",onClick:o[3]||(o[3]=m=>n.cropRotateLeft())})]),_:1}),e.createVNode(p,{effect:"dark",content:"向右旋转",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconRefreshRight",onClick:o[4]||(o[4]=m=>n.cropRotateRight())})]),_:1})]),e.createElementVNode("div",Si,[e.createVNode(d,{size:"small"},{prepend:e.withCtx(()=>[...o[8]||(o[8]=[e.createTextVNode("X 坐标",-1)])]),_:1}),e.createVNode(d,{size:"small"},{prepend:e.withCtx(()=>[...o[9]||(o[9]=[e.createTextVNode("Y 坐标",-1)])]),_:1})]),e.createElementVNode("div",Ni,[e.createVNode(d,{size:"small",modelValue:l.cropLocalWidth,"onUpdate:modelValue":o[5]||(o[5]=m=>l.cropLocalWidth=m)},{prepend:e.withCtx(()=>[...o[10]||(o[10]=[e.createTextVNode("宽度",-1)])]),_:1},8,["modelValue"]),e.createVNode(d,{size:"small",modelValue:l.cropLocalHeight,"onUpdate:modelValue":o[6]||(o[6]=m=>l.cropLocalHeight=m)},{prepend:e.withCtx(()=>[...o[11]||(o[11]=[e.createTextVNode("高度",-1)])]),_:1},8,["modelValue"])])]),e.createElementVNode("div",Bi,[e.createElementVNode("div",{class:"cv-upload-crop-preview",innerHTML:l.cropPreviews.html},null,8,Ei)])])),[[u,a.loading]])]),_:3},8,["title","modelValue","onOpened","onClose"])}]])},props:{modelValue:{type:[String],default:""},initValue:{type:[String],default:""},fileSize:{type:[Number],default:2},fileType:{type:[Array],default:()=>["png","jpg","jpeg","gif"]},showSize:{type:Number,default:120},crop:{type:[Boolean],default:!0},signatureParam:{type:[Object],default:()=>({save_sign:"avatar"})}},data:()=>({localValue:"",localList:[],upAccept:"image/*"}),computed:{localRef:()=>"cvUploadAvatar"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",accept:this.upAccept,limit:1,multiple:!1,drag:!1,disabled:this.upIngLoading,showFileList:!1}},showStyle(){return{width:this.showSize+"px",height:this.showSize+"px",lineHeight:this.showSize+"px"}}},watch:{initValue(t){this._init_parse()}},mounted(){this._init_parse()},methods:{_init_parse(){this.localValue=this.initValue||""},cropDialogOpen(){this.cropShow=!0,this.$nextTick(()=>{this._init_parse()})},initBeforeUpload(t){if(!this._commonBeforeUpload(t))return this.upIngLoading=!1,!1;if(this.crop){const o=new FileReader;o.readAsDataURL(t),o.onload=()=>{this.localValue=o.result},this.$refs.cvUploadAvatar.clearFiles()}},async onHttpRequest(t){const{file:o}=t;this.upIngLoading=!0;const a=this.mergeAttrs.signatureType||null,i=this.mergeAttrs.signatureFn||null,l=this.mergeAttrs.signatureParam||{};await Ko(o,a,i,l).then(n=>{this.$nextTick(()=>{this.$emit("update:modelValue",n.full_path),this.$emit("update:initValue",n.cdn_full_path)}),k.ElMessage.success("上传成功"),this.upIngLoading=!1,this.cropShow=!1}).catch(()=>{this.upIngLoading=!1})}}},_i=["src"],ht=v(Di,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("upload-tip"),c=e.resolveComponent("cv-icons"),p=e.resolveComponent("el-button"),d=e.resolveComponent("el-tooltip"),h=e.resolveComponent("el-upload"),u=e.resolveComponent("upload-crop");return e.openBlock(),e.createElementBlock("div",{class:"cv-upload-avatar-wrap",onClick:o[2]||(o[2]=(...m)=>n.cropDialogOpen&&n.cropDialogOpen(...m))},[a.initValue?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"cv-upload-avatar-box cv-upload-avatar-empty",style:e.normalizeStyle(n.showStyle)},[...o[3]||(o[3]=[e.createElementVNode("div",{class:"cv-upload-avatar__text"},"上传头像",-1)])],4)),a.initValue?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cv-upload-avatar-box",style:e.normalizeStyle(n.showStyle)},[e.createElementVNode("img",{class:"cv-upload-avatar__img",src:a.initValue},null,8,_i)],4)):e.createCommentVNode("",!0),e.createVNode(r,e.mergeProps(t.tipAttr,{fileUnit:"张",multiple:!1,limit:1}),null,16),a.crop?(e.openBlock(),e.createBlock(u,{key:2,modelValue:t.cropShow,"onUpdate:modelValue":o[0]||(o[0]=m=>t.cropShow=m),title:"修改头像",size:a.showSize,onOnSubmit:n.onHttpRequest,onOnClose:o[1]||(o[1]=m=>t.upIngLoading=!1),loading:t.upIngLoading,src:l.localValue},{default:e.withCtx(()=>[e.createVNode(h,e.mergeProps(n.handlerAttr,{"before-upload":n.initBeforeUpload,"http-request":t.initHttpRequest}),{default:e.withCtx(()=>[e.createVNode(d,{effect:"dark",content:"选择图片",placement:"top"},{default:e.withCtx(()=>[e.createVNode(p,{style:{"margin-right":"10px"},loading:t.upIngLoading,disabled:t.upIngLoading},{default:e.withCtx(()=>[e.createVNode(c,{type:"ElIconPlus",size:"14",style:{"margin-right":"10px"}}),o[4]||(o[4]=e.createTextVNode(" 选择 ",-1))]),_:1},8,["loading","disabled"])]),_:1})]),_:1},16,["before-upload","http-request"])]),_:1},8,["modelValue","size","onOnSubmit","loading","src"])):e.createCommentVNode("",!0)])}]]);function ae(t){return t?typeof t=="string"||typeof t=="number"?[t]:Object.prototype.toString.call(t)==="[object Object]"?[]:[...t]:[]}function ca(t,o){let a=[];Array.isArray(t)&&t.length>0&&a.push(...t),Array.isArray(o)&&o.length>0&&a.push(...o),typeof o=="string"&&a.push(o);let i=[];for(let l in a){let n=a[l],r=Object.prototype.toString.call(n);r==="[object String]"?i.push(n):r==="[object Object]"&&n.url&&i.push(n.url)}return i}const Ti={title:"图片上传",name:"cvUploadImage",mixins:[lo],components:{},props:{modelValue:{type:[String,Number,Array,Object],default:""},initValue:{type:[String,Number,Array],default:()=>""},fileSize:{type:[Number],default:2},fileType:{type:[Array],default:()=>["png","jpg","jpeg","gif"]},showSize:{type:Number,default:150},showBig:{type:[Boolean],default:!1},crop:{type:[Boolean],default:!1},galleryLabel:{type:String,default:""},lazy:{type:Boolean,default:!0},drag:{type:Boolean,default:!1},signatureParam:{type:[Object],default:()=>({save_sign:"image"})}},data:()=>({localValue:[],localList:[],previewShow:!1,previewTitle:"",previewUrl:"",upAccept:"image/*"}),computed:{localRef:()=>"cvUploadImage"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",accept:this.upAccept,limit:parseInt(this.limit),multiple:this.multiple,drag:!!this.drag,disabled:this.upIngLoading,showFileList:!1}},showUpload(){return!(this.localList.length>=this.limit)},showStyle(){let t=this.showSize+"px";return(this.showBig||this.drag)&&(t=2*this.showSize+"px"),{width:t,height:this.showSize+"px",lineHeight:this.showSize+"px"}}},watch:{modelValue(t){this._init_parse_value()},initValue(t){this._init_parse_list()}},mounted(){},methods:{_init_parse_value(){if(this.modelValue)if(typeof this.modelValue=="string"&&this.modelValue.includes(",")){const t=String(this.modelValue).split(",").map(o=>o.trim());this.localValue=ae(t)}else this.localValue=ae(this.modelValue);else this.localValue=[]},_init_parse_list(){this.initValue?this.localList=Xo(this.initValue):this.localList=[]},initOnChange(t,o){},initBeforeUpload(t){return this.upIngLoading=!0,!!this._commonBeforeUpload(t)||(this.upIngLoading=!1,!1)},async initHttpRequest(t){const{file:o}=t;this.upIngLoading=!0,this.mergeAttrs.upResponseFn;const a=this.mergeAttrs.signatureType||null,i=this.mergeAttrs.signatureFn||null,l=this.mergeAttrs.signatureParam||{};await Ko(o,a,i,l).then(n=>{this.$nextTick(()=>{this.updateValue(n.filelog_id,n.cdn_full_path)}),k.ElMessage.success("上传成功"),this.upIngLoading=!1}).catch(()=>{this.upIngLoading=!1})},updateValue(t,o){if(this.multiple){let a=ca(this.localValue,t).join(",");this.$emit("update:modelValue",a)}else this.$emit("update:modelValue",t);if(this.multiple){let a=ca(this.localList,o);this.$emit("update:initValue",a)}else this.$emit("update:initValue",o)},handleItemPreview(t,o){t.raw,t.type.includes("image")?(this.previewTitle=t.name,this.previewUrl=t.url,this.previewShow=!0):window.open(t.url)},doRemove(t){this.multiple?(this.localValue.splice(t,1),this.localList.splice(t,1)):(this.localValue="",this.localList=[]),this.updateValue(null,null)},handleItemRemove(t,o){if(this.beforeRemove&&typeof this.beforeRemove=="function"){const a=this.multiple?this.localValue[o]:this.localValue,i=this.beforeRemove(a,this.localValue);i&&i.then?i.then(()=>{this.doRemove(o)},()=>{}):i!==!1&&this.doRemove(o)}else this.doRemove(o)},handleItemEdit(t,o){k.ElMessageBox.prompt("请输入文件地址","编辑",{confirmButtonText:"OK",cancelButtonText:"Cancel",inputValue:t.url||"",inputErrorMessage:"格式不正确"}).then(({value:a})=>{const i=a.split("/").pop(),l=i.split(".").pop().toLowerCase();if(!this.fileType.includes(l)){let p=this.fileType.join("、");return k.ElMessage.error(`文件格式错误,请填写类型,如:${p} 格式文件`),!1}const n=function(p){if(!p)return"";const d=p.replace(/^\./,"").toLowerCase();return Il.extensionToMime[d]||""}(l);if(!n)return k.ElMessage.error("文件格式错误"),!1;var r;(r=a).startsWith("http://")||r.startsWith("https://")||r.startsWith("//")||this.mergeAttrs?.baseDomain&&(a=this.mergeAttrs?.baseDomain+a);const c={name:i,status:"success",type:n,uid:Date.now(),url:a};this.localList[o]=c}).catch(()=>{})},handleItemCrop(t,o){}}},Ii={class:"cv-upload-image cv-upload-common"},Li={class:"cv-upload-list-box el-upload-list el-upload-list--picture-card"},Fi=["tabindex"],$i={class:"el-upload-list__item-status-label"},Oi={class:"el-upload-list__item-actions"},Mi=["onClick"],zi={class:"el-upload-list__item-delete"},Pi={class:"el-upload-list__item-delete"},Hi=["onClick"],Ai={style:{margin:"0 auto"}},ji=["src"],mt=v(Ti,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-image"),c=e.resolveComponent("cv-icons"),p=e.resolveComponent("el-upload"),d=e.resolveComponent("upload-tip"),h=e.resolveComponent("el-dialog"),u=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Ii,[e.createElementVNode("div",Li,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.localList,(m,f)=>(e.openBlock(),e.createElementBlock("section",{class:"el-upload-list__item is-success",key:f,tabindex:f,style:e.normalizeStyle(n.showStyle)},[e.createVNode(r,{class:"el-upload-list__item-thumbnail",lazy:a.lazy,src:m.url,style:e.normalizeStyle(n.showStyle),fit:"contain"},null,8,["lazy","src","style"]),e.createElementVNode("label",$i,[e.createVNode(c,{type:"ElIconCheck",color:"#ffffff",size:"12"})]),e.createElementVNode("span",Oi,[e.createElementVNode("span",{class:"el-upload-list__item-preview",onClick:C=>n.handleItemPreview(m)},[e.createVNode(c,{type:"ElIconZoomIn",size:"20"})],8,Mi),e.createElementVNode("span",zi,[e.createVNode(c,{type:"ElIconDelete",size:"20",onClick:C=>n.handleItemRemove(m,f)},null,8,["onClick"])]),e.createElementVNode("span",Pi,[e.createVNode(c,{type:"ElIconEdit",size:"20",onClick:C=>n.handleItemEdit(m,f)},null,8,["onClick"])]),a.crop?(e.openBlock(),e.createElementBlock("span",{key:0,class:"el-upload-list__item-preview",onClick:C=>n.handleItemCrop(m)},[e.createVNode(c,{type:"ElIconCrop",size:"20"})],8,Hi)):e.createCommentVNode("",!0)])],12,Fi))),128)),n.showUpload?(e.openBlock(),e.createBlock(p,e.mergeProps({key:0,class:"cv-upload-common-handle"},n.handlerAttr,{"file-list":l.localList,"before-upload":n.initBeforeUpload,"http-request":n.initHttpRequest,"on-change":n.initOnChange,"on-exceed":t.initOnExceed,style:n.showStyle}),{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"cv-upload-common__ing",style:e.normalizeStyle(n.showStyle)},[a.drag?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(c,{type:"ElIconUpload",size:"24"}),o[1]||(o[1]=e.createElementVNode("div",{class:"el-upload__text"},[e.createTextVNode(" 将文件拖到此处,或 "),e.createElementVNode("em",null,"点击上传")],-1))],64)):(e.openBlock(),e.createBlock(c,{key:1,type:"ElIconPlus",size:a.showSize/3},null,8,["size"]))],4)),[[u,t.upIngLoading]])]),_:1},16,["file-list","before-upload","http-request","on-change","on-exceed","style"])):e.createCommentVNode("",!0)]),e.createVNode(d,e.mergeProps(t.tipAttr,{fileUnit:"张"}),null,16),e.createVNode(h,{modelValue:l.previewShow,"onUpdate:modelValue":o[0]||(o[0]=m=>l.previewShow=m),title:l.previewTitle,"append-to-body":""},{default:e.withCtx(()=>[e.createElementVNode("div",Ai,[e.createElementVNode("img",{width:"100%",src:l.previewUrl,style:{"max-width":"300px"}},null,8,ji)])]),_:1},8,["modelValue","title"])])}]]),Ri={mdb:"access",accdb:"access",ai:"ai",html:"html",htm:"html",asp:"web",pdf:"pdf",psd:"photoshop",psb:"photoshop",mpo:"photoshop",eps:"photoshop",avi:"video",wmv:"video",rm:"video",rmvb:"video",mp4:"video","3gp":"video",asf:"video",mov:"video",m4v:"video",flv:"video",f4v:"video",mkv:"video",mts:"video",swf:"flash",ts:"video",mp3:"audio",wav:"audio",wma:"audio",ape:"audio",aac:"audio",zip:"zip",rar:"zip",gz:"zip","7z":"zip",z:"zip",bmp:"image",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",txt:"txt",rtf:"txt",xls:"excel",xlsx:"excel",xlsm:"excel",xltx:"excel",doc:"word",docx:"word",docm:"word",wps:"word",dotx:"word",dotm:"word",ppt:"powerpoint",pptx:"powerpoint",mdf:"db",db:"db",dbf:"db",wdb:"db",vue:"vue",php:"php",jar:"jar",ini:"ini",bat:"bat",config:"config",fla:"fla",eot:"font",otf:"font",fon:"font",font:"font",ttf:"font",ttc:"font",woff:"font",woff2:"font",js:"js",md:"markdown",one:"onenote",jsx:"reactjs",xfl:"xfl",file:"file",css:"css"};function so(t){return`https://10ui.cn/default/icon_ext/${Ri[t]}.svg`}const Ui={name:"uploadList",props:{files:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},isCanDownload:{type:Boolean,default:!0},isCanDelete:{type:Boolean,default:!0}},methods:{getExtension(t){return t.lastIndexOf(".")>-1&&so[t.slice(t.lastIndexOf(".")+1).toLowerCase()]||so.file},getSize:t=>t&&!isNaN(Number(t))?t:"",parsePercentage:t=>parseInt(t,10),handleDownload(t){t.url},handleDelete(t,o){this.$confirm("确认删除该文件吗? ").then(()=>{this.$emit("remove",t,o)}).catch(()=>{})}}},Wi=["src"],Yi={class:"cv-upload-list__item-content-action"},qi={title:"文件上传",inheritAttrs:!1,name:"cvUploadFile",mixins:[lo],components:{uploadList:v(Ui,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(e.TransitionGroup,{class:"cv-upload-file-list el-upload-list el-upload-list--text",name:"el-list",tag:"ul"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.files,(c,p)=>(e.openBlock(),e.createElementBlock("li",{key:c.uid,class:"el-upload-list__item cv-upload-list__item-content"},[e.createVNode(r,{href:c.url,underline:!1,target:"_blank"},{default:e.withCtx(()=>[e.createElementVNode("img",{src:n.getExtension(c.name),class:"el-upload-list__item-content-name-icon"},null,8,Wi),e.createElementVNode("span",null,e.toDisplayString(c.name),1)]),_:2},1032,["href"]),e.createElementVNode("div",Yi,[e.createVNode(r,{underline:!1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.getSize(c.size)),1)]),_:2},1024),a.isCanDownload?(e.openBlock(),e.createBlock(r,{key:0,underline:!1,onClick:d=>n.handleDownload(c)},{default:e.withCtx(()=>[...o[0]||(o[0]=[e.createTextVNode("下载",-1)])]),_:1},8,["onClick"])):e.createCommentVNode("",!0),!a.disabled&&a.isCanDelete?(e.openBlock(),e.createBlock(r,{key:1,underline:!1,onClick:d=>n.handleDelete(p,c),type:"danger"},{default:e.withCtx(()=>[...o[1]||(o[1]=[e.createTextVNode(" 删除 ",-1)])]),_:1},8,["onClick"])):e.createCommentVNode("",!0)])]))),128))]),_:1})}]])},props:{modelValue:{type:[String,Object,Array],default:""},initValue:{type:[String,Object,Array],default:""},fileSize:{type:[Number],default:5},fileType:{type:[Array],default:["txt","png","jpg","xlsx","xls"]},multiple:{type:[Boolean],default:!1},limit:{type:[Number],default:5},disabled:Boolean,isCanDownload:{type:Boolean,default:!0},isCanDelete:{type:Boolean,default:!0},isCanUploadSame:{type:Boolean,default:!0}},data:()=>({localValue:[],localList:[]}),computed:{localRef:()=>"cvUploadFile"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",limit:parseInt(this.limit),multiple:this.multiple,drag:!1,disabled:this.upIngLoading,showFileList:!0}},list(){let t=1;return this.modelValue?(Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]).map(o=>(typeof o=="string"&&(o={name:o,url:o}),o.uid=o.uid||new Date().getTime()+t++,o)):[]}},watch:{initValue(t){this._init_parse()}},mounted(){this._init_parse()},methods:{_init_parse(){this.initValue?this.localList=Xo(this.initValue):this.localList=[]},initOnChange(t,o){this.localList=o},initBeforeUpload(t){return this._commonBeforeUpload(t)?!this.isCanUploadSame&&this.localList.some(o=>o.name+o.size===t.name+t.size)?(this.$message.error("此文件已上传!"),!1):!0:!1},upFileError(t){this.$message.error("上传失败, 请重试"),this.$emit("error",t)},upFileSuccess(t,o){this.upResponseFn&&typeof this.upResponseFn=="function"&&(t=this.upResponseFn(t,o,this.localList)),this.multiple?this.$emit("update:modelValue",[...this.localList,t]):this.$emit("update:modelValue",t),this.$emit("success",t,this.localList)},handleRemove(t,o){if(this.beforeRemove&&typeof this.beforeRemove=="function"){const a=this.beforeRemove(this.localList[o],this.localList);a&&a.then?a.then(()=>{this._do_remove(o)},()=>{}):a!==!1&&this._do_remove(o)}else this._do_remove(o)},_do_remove(t){if(this.$emit("remove",this.list[t],this.list),this.localList.splice(t,1),this.multiple){const o=[...this.list];o.splice(t,1),this.$emit("update:modelValue",o||[])}else this.$emit("update:modelValue",null)}}},Xi={class:"cv-upload-file"},ut=v(qi,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button"),c=e.resolveComponent("el-upload"),p=e.resolveComponent("upload-tip"),d=e.resolveComponent("upload-list");return e.openBlock(),e.createElementBlock("div",Xi,[e.createVNode(c,e.mergeProps({class:"cv-upload-file-uploader"},n.handlerAttr,{"file-list":l.localList,"onUpdate:fileList":o[0]||(o[0]=h=>l.localList=h),"before-upload":n.initBeforeUpload,"on-change":n.initOnChange,"on-exceed":t.initOnExceed,"on-error":n.upFileError,"on-success":n.upFileSuccess}),{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",icon:"ElIconUpload"},{default:e.withCtx(()=>[...o[1]||(o[1]=[e.createTextVNode("上传文件",-1)])]),_:1})]),_:1},16,["file-list","before-upload","on-change","on-exceed","on-error","on-success"]),e.createVNode(p,e.mergeProps(t.tipAttr,{fileUnit:"个"}),null,16),e.createVNode(d,{disabled:a.disabled,files:n.list,isCanDelete:a.isCanDelete,isCanDownload:a.isCanDownload,onRemove:n.handleRemove},null,8,["disabled","files","isCanDelete","isCanDownload","onRemove"])])}]]),Ki={class:"cv-upload-video"},Gi={class:"cv-upload-list-box el-upload-list el-upload-list--picture-card"},Zi=["tabindex"],Qi=["src"],Ji={class:"el-upload-list__item-status-label"},er={class:"el-upload-list__item-actions"},tr=["onClick"],or={class:"el-upload-list__item-delete"},ar={class:"el-upload-list__item-delete"},lr={key:0,style:{width:"500px",height:"300px",margin:"0 auto"}},nr=["src"],gt=v({title:"视频上传",name:"cvUploadVideo",mixins:[lo],components:{},props:{modelValue:{type:[String],default:""},initValue:{type:[String],default:""},fileSize:{type:[Number],default:10},fileType:{type:Array,default:["mp4","mp3"]},showSize:{type:Number,default:360},signatureParam:{type:[Object],default:()=>({save_sign:"video"})}},data:()=>({localValue:"",localList:"",previewShow:!1,previewTitle:"",previewUrl:"",upAccept:"video/*"}),computed:{localRef:()=>"cvUploadVideo"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",accept:this.upAccept,limit:1,multiple:!1,drag:!0,disabled:this.upIngLoading,showFileList:!1}},showUpload(){return!this.localValue},showStyle(){return{width:this.showSize+"px",height:this.showSize/5*3+"px",lineHeight:this.showSize+"px"}}},watch:{modelValue(t){this._init_parse_value()},initValue(t){this._init_parse_list()}},mounted(){this._init_parse_value(),this._init_parse_list()},methods:{_init_parse_value(){this.modelValue?this.localValue=ae(this.modelValue):this.localValue=""},_init_parse_list(){this.initValue?this.localList=Xo(this.initValue):this.localList=""},initBeforeUpload(t){return this.upIngLoading=!0,!!this._commonBeforeUpload(t)||(this.upIngLoading=!1,!1)},async initHttpRequest(t){const{file:o}=t;this.upIngLoading=!0,this.mergeAttrs.upResponseFn;const a=this.mergeAttrs.signatureType||null,i=this.mergeAttrs.signatureFn||null,l=this.mergeAttrs.signatureParam||{};await Ko(o,a,i,l).then(n=>{this.$nextTick(()=>{this.$emit("update:modelValue",n.full_path),this.$emit("update:initValue",n.cdn_full_path)}),ExtendMessage.success("上传成功"),this.upIngLoading=!1}).catch(()=>{this.upIngLoading=!1})},handleItemPreview(t,o){this.previewTitle=t.name,this.previewUrl=t.url,this.previewShow=!0},doRemove(t){this.localValue="",this.localList="",this.$emit("update:modelValue",""),this.$emit("update:initValue","")},handleItemRemove(t,o){if(this.beforeRemove&&typeof this.beforeRemove=="function"){const a=this.multiple?this.localValue[o]:this.localValue,i=this.beforeRemove(a,this.localValue);i&&i.then?i.then(()=>{this.doRemove(o)},()=>{}):i!==!1&&this.doRemove(o)}else this.doRemove(o)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("el-progress"),p=e.resolveComponent("el-upload"),d=e.resolveComponent("upload-tip"),h=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",Ki,[e.createElementVNode("div",Gi,[l.localList?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.localList,(u,m)=>(e.openBlock(),e.createElementBlock("section",{class:"el-upload-list__item is-success",key:m,tabindex:m,style:e.normalizeStyle(n.showStyle)},[e.createElementVNode("video",{class:"el-upload-list__item-thumbnail",autoplay:!1,src:u.url,style:e.normalizeStyle(n.showStyle)}," 您的浏览器不支持视频播放 ",12,Qi),e.createElementVNode("label",Ji,[e.createVNode(r,{type:"ElIconCheck",color:"#ffffff",size:"12"})]),e.createElementVNode("span",er,[e.createElementVNode("span",{class:"el-upload-list__item-preview",onClick:f=>n.handleItemPreview(u)},[e.createVNode(r,{type:"ElIconVideoPlay",size:"20"})],8,tr),e.createElementVNode("span",or,[e.createVNode(r,{type:"ElIconDelete",size:"20",onClick:f=>n.handleItemRemove(u,m)},null,8,["onClick"])]),e.createElementVNode("span",ar,[e.createVNode(r,{type:"ElIconEdit",size:"20",onClick:f=>t.handleItemEdit(u,m)},null,8,["onClick"])])])],12,Zi))),128)):e.createCommentVNode("",!0),n.showUpload?(e.openBlock(),e.createBlock(p,e.mergeProps({key:1,class:"cv-upload-handler"},n.handlerAttr,{"before-upload":n.initBeforeUpload,"http-request":n.initHttpRequest,style:n.showStyle}),{default:e.withCtx(()=>[t.upIngPercent>0?(e.openBlock(),e.createBlock(c,{key:0,percentage:t.upIngPercent,style:{"margin-top":"20px"},type:"circle"},null,8,["percentage"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:"cv-upload-video__ing",style:e.normalizeStyle(n.showStyle)},[e.createVNode(r,{type:"ElIconUpload",size:"24"}),o[1]||(o[1]=e.createElementVNode("div",{class:"el-upload__text"},[e.createTextVNode(" 将视频拖到此处,或 "),e.createElementVNode("em",null,"点击上传")],-1))],4))]),_:1},16,["before-upload","http-request","style"])):e.createCommentVNode("",!0)]),e.createVNode(d,e.mergeProps(t.tipAttr,{fileUnit:"个",limit:1}),null,16),e.createVNode(h,{modelValue:l.previewShow,"onUpdate:modelValue":o[0]||(o[0]=u=>l.previewShow=u),title:l.previewTitle,"append-to-body":""},{default:e.withCtx(()=>[l.previewShow?(e.openBlock(),e.createElementBlock("div",lr,[e.createElementVNode("video",{autoplay:!0,src:l.previewUrl,controls:"controls",style:{width:"500px",height:"300px"}}," 您的浏览器不支持视频播放 ",8,nr)])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}]]),ir={emits:["get-unlist","on-close","on-update","on-delete"],props:{modelValue:{type:Array,default:()=>[]},model:{type:String,default:""},accept:{type:String,default:""},multiple:{type:Boolean,default:!1}},data:()=>({audioInfo:{},file:null,fileList:[],fileHash:"",tempCheckpoint:null,uploadId:"",uploadStatus:null,showAudio:!1,percentage:0,uploadName:"",client:null,year:new Date().getFullYear(),uploadDisabled:!0,resumeDisabled:!0,pauseDisabled:!0,dialogVisible:!1,isDoing:!1,unList:[],fileMap:{},map_max_key:0,partSize:1048576,parallel:4,checkpoints:{}}),watch:{dialogVisible:{handler(t){t||(this.fileList=[],this.$refs.upload.uploadFiles=[])}},fileList:{handler(t){if(t.length){this.dialogVisible=!0;let o=[],a=[];t.forEach(i=>{i.raw.name.indexOf(".")===-1&&(i.errMsg="不支持此格式上传"),i.percentage===100?o.push(i):a.push(i)}),o.length===t.length?(this.pauseDisabled=!0,this.isDoing=!0):this.isDoing=!1,this.unList=a}},deep:!0}},mounted(){window.addEventListener("online",this.resumeUpload)},methods:{filterSize:ia,handleExceed(){this.$confirm("上传文件数量不能超过100个,请重新选择!","操作提示",{confirmButtonText:"确 定",cancelButtonText:"取 消",type:"warning"}).then(()=>{this.fileList=[],this.dialogVisible=!1}).catch(()=>{this.fileList=[]})},handleDeleteChangeFile(t){this.fileList.splice(t,1),this.fileList.length||(this.dialogVisible=!1)},fileTypeIcon(t){const{type:o}=t.raw,a=o.indexOf("video")!==-1,i=o.indexOf("image")!==-1,l=o.indexOf("audio")!==-1,n=o.indexOf("zip")!==-1,r=o.indexOf("wordprocessingml")!==-1,c=o.indexOf("pdf")!==-1,p=o.indexOf("text")!==-1,d=o.indexOf("sheet")!==-1;return a?"MP4":i?"JPG1":l?"mp3-1":n?"yasuo":r?"DOCX":c?"wenjianleixing-biaozhuntu-PDFwendang":p?"div-1":d?"excel1":"weizhiwenjian"},handleClose(){this.$emit("on-close"),this.isDoing?this.dialogVisible=!1:this.$confirm("正在上传文件,关闭后上传文件会丢失!是否继续?","操作提示",{confirmButtonText:"确 定",cancelButtonText:"取 消",type:"warning"}).then(()=>{this.$emit("get-unlist"),this.fileList.forEach(t=>{t.client&&t.percentage<100&&t.client.cancel()}),this.dialogVisible=!1}).catch(()=>{})},async handleBeforeUpload(t){},handleStopChangeFile(t,o){o.isPlay=!o.isPlay,this.fileList.splice(t,1,o),o.isPlay?this.resumeMultipartUpload(o):o.client.cancel()},async starUpload(){this.uploadDisabled=!0,this.pauseDisabled=!1,this.multipartUpload()},async multipartUpload(){this.file?this.fileList.forEach(async t=>{t.isLoading=!0,await this.ossUploadHandle(t,this.fileList)}):k.ElMessage.error("请选择文件")},async resumeUpload(){this.pauseDisabled=!1,this.uploadDisabled=!0,this.resumeDisabled=!0,await this.resumeMultipartUpload()},stopUpload(){this.resumeDisabled=!1,this.pauseDisabled=!0,this.fileList.forEach(t=>{t.client.cancel(),t.isPlay=!1})},async change(t,o){this.fileMap[t]=o,this.map_max_key=t},async handle_network_speed_change(t,o,a){t-this.map_max_key>=1e4&&(this.fileMap={});for(let i=t;i<=o;i++){const l=await this.fileMap[i];l?await this.change(i,l+a):await this.change(i,a)}},handle_network_speed(t,o,a){const i=t.rt/1e3,l=new Date(t.headers.date).getTime(),n=l-i;let r=parseInt(o/i);return a===0&&(r=0),r===0||this.handle_network_speed_change(n,l,r),r?ia(r):0},async resetUpload(t,o){JSON.stringify(t).indexOf("Error")!==-1&&(o.client&&o.client.cancel(),o.client=await sa(this.signatureType,this.apiFunc),await this.resumeMultipartUpload(o))},async resumeMultipartUpload(t){if(t){const{tempCheckpoint:o}=t;this.resumeUploadFile(t,o)}else Object.values(this.checkpoints).forEach(o=>{const{uploadId:a}=o,i=this.fileList.findIndex(n=>n.upload===a),l=this.fileList[i];this.resumeUploadFile(l,o)})},async resumeUploadFile(t,o){const{uploadId:a,file:i,name:l}=o;try{const{raw:n,percentage:r}=t;t.partSize=0,r<100&&n.name.indexOf(".")!==-1&&t.client.multipartUpload(a,i,{parallel:this.parallel,partSize:this.partSize,progress:async(c,p,d)=>{await this.onUploadProgress(t,c,p,d,l)},checkpoint:o}).then(()=>{delete this.checkpoints[o.uploadId],this.$emit("update:modelValue",this.fileList),this.resumeDisabled=!0,this.unList.length&&this.uploadDisabled&&(this.resumeDisabled=!1),this.onCreatePanFile(t)}).catch(async c=>{await this.resetUpload(c,t)})}catch{}},async onUploadProgress(t,o,a,i,l){a&&(this.checkpoints[a.uploadId]=a,t.speed=this.handle_network_speed(i,this.partSize,o),t.tempCheckpoint=a,t.abortCheckpoint=a,t.upload=a.uploadId),t.isPlay=!0,t.isPlay&&(t.isLoading=!1),t.uploadName=l,t.percentage=Number((100*o).toFixed(2))},async ossUploadHandle(t){let o={pass:!0,filePath:""};try{const{raw:a,percentage:i}=t,l=a,n=await sa(this.signatureType,this.apiFunc,{},{secure:!0});if(this.signatureType=="aliyun_oss_type1"){if(t.client=n,t.partSize=0,i<100&&a.name.indexOf(".")!==-1){const r=n.dir+l.name;await t.client.multipartUpload(r,l,{parallel:this.parallel,partSize:this.partSize,progress:async(c,p,d)=>{await this.onUploadProgress(t,c,p,d,r)}}).then(()=>{this.$emit("upload:modelValue",this.fileList),this.resumeDisabled=!0,this.onCreatePanFile(t),this.unList.length&&this.uploadDisabled&&(this.resumeDisabled=!1)}).catch(async c=>{})}}else this.signatureType=="aliyun_oss_type2"&&$l(l,n)}catch(a){o={...a,pass:!1,filePath:""}}return o},getToday(){const t=new Date;return`${t.getFullYear()}${t.getMonth()+1}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`},handleChange(t,o){o.forEach(a=>{a.client=null,a.isPlay=!1,a.isLoading=!1,a.abortCheckpoint=!1}),this.fileList=o,this.file=t.raw,this.uploadDisabled=!1,this.pauseDisabled=this.resumeDisabled=!0},handleDeleteFile(t){const o=t.indexOf(this.model);t.substring(o,t.length),this.$emit("on-delete"),this.fileList=[],k.ElMessage.success("删除成功")},async onCreatePanFile(t){await this.getParams(t),this.$emit("on-update")},handleMediaRes:t=>({image:async function(o){return new Promise(a=>{var i=new FileReader;i.onload=function(l){var n=l.target.result,r=new Image;r.onload=function(){a({Width:this.width,Height:this.height})},r.src=n},i.readAsDataURL(o)})},audio:async function(o){return new Promise(a=>{var i=new FileReader;i.onload=function(l){var n=l.target.result,r=new Audio;r.onloadeddata=function(){const c=r.duration;a({Duration:1e3*c})},r.src=n},i.readAsDataURL(o)})},video:async function(o){return new Promise(a=>{var i=URL.createObjectURL(o);const l=document.createElement("video");l.src=i,l.onloadeddata=function(){a({CoverImg:"",Duration:1e3*this.duration,Width:this.videoWidth,Height:this.videoHeight})}})}})[t],captureImage:(t,o)=>t+"?x-oss-process=video/snapshot,t_"+(o=o||"3000 ")+",f_jpg",async getParams(t){const{type:o}=t.raw,a=o.indexOf("video")!==-1,i=o.indexOf("image")!==-1,l=o.indexOf("audio")!==-1;let n,r="";return a?r="video":i?o.indexOf("adobe")===-1&&(r="image"):l&&(r="audio"),(a||i||l)&&r&&(n=await this.handleMediaRes(r)(t.raw)),{ResTitle:t.name,ResDescribe:"",OssKey:t.uploadName,ContentType:o||"application/octet-stream",ContentLength:t.size,...n}}}},rr={class:"oss-upload"},sr={class:"cv-upload-task-hd-title"},cr={class:"cv-upload-task-hd-num"},dr={class:"cv-upload-task-opts"},pr={class:"cv-upload-task-lists"},hr={class:"cv-upload-task-item-name"},mr={class:"name"},ur={class:"file-name-item"},gr={key:0,class:"speed"},fr={key:1,class:"speed"},Cr={key:2,class:"success"},vr={class:"total"},yr={key:0,class:"name error"},kr={class:"cv-upload-task-item-tool"},br=["onClick"],wr=["onClick"],ft=v({name:"cvUploadOss",mixins:[ir]},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button"),c=e.resolveComponent("el-upload"),p=e.resolveComponent("el-progress"),d=e.resolveComponent("cv-icons"),h=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",rr,[e.createVNode(c,{ref:"upload",action:"","show-file-list":!1,multiple:"","on-change":t.handleChange,"before-upload":t.handleBeforeUpload,"auto-upload":!1,limit:100,"on-exceed":t.handleExceed,accept:t.accept},{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",icon:"ElIconUpload",round:""},{default:e.withCtx(()=>[...o[1]||(o[1]=[e.createTextVNode("上 传",-1)])]),_:1})]),_:1},8,["on-change","before-upload","on-exceed","accept"]),e.createVNode(h,{modelValue:t.dialogVisible,"onUpdate:modelValue":o[0]||(o[0]=u=>t.dialogVisible=u),width:"650px",height:"500","destroy-on-close":"","close-on-click-modal":!1,"before-close":t.handleClose,style:{height:"500px"}},{header:e.withCtx(()=>[e.createElementVNode("div",sr,[o[2]||(o[2]=e.createElementVNode("span",null,"上传",-1)),e.createElementVNode("span",cr,e.toDisplayString(t.fileList.length-t.unList.length)+"/"+e.toDisplayString(t.fileList.length),1)])]),default:e.withCtx(()=>[e.createElementVNode("div",dr,[e.createVNode(r,{type:"primary",icon:"ElIconVideoPlay",disabled:t.uploadDisabled,onClick:t.starUpload},{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode("开始上传",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(r,{type:"success",icon:"ElIconRefreshRight",disabled:t.resumeDisabled,onClick:t.resumeUpload},{default:e.withCtx(()=>[...o[4]||(o[4]=[e.createTextVNode("继续",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(r,{type:"danger",icon:"ElIconVideoPause",disabled:t.pauseDisabled,onClick:t.stopUpload},{default:e.withCtx(()=>[...o[5]||(o[5]=[e.createTextVNode("暂停",-1)])]),_:1},8,["disabled","onClick"])]),e.createElementVNode("div",pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fileList,(u,m)=>(e.openBlock(),e.createElementBlock("div",{class:"cv-upload-task-item-box",key:m},[e.createElementVNode("div",hr,[e.createElementVNode("div",mr,[e.createElementVNode("span",ur,e.toDisplayString(m+1)+"."+e.toDisplayString(u.name),1),u.isLoading&&!u.isPlay?(e.openBlock(),e.createElementBlock("span",gr,"准备就绪")):e.createCommentVNode("",!0),u.isPlay&&u.percentage!==100?(e.openBlock(),e.createElementBlock("span",fr,e.toDisplayString(u.speed)+"/s",1)):e.createCommentVNode("",!0),u.percentage===100?(e.openBlock(),e.createElementBlock("span",Cr,"完成")):e.createCommentVNode("",!0),e.createElementVNode("div",vr,e.toDisplayString(t.filterSize(u.size)),1)]),u.errMsg?(e.openBlock(),e.createElementBlock("span",yr,e.toDisplayString(u.errMsg),1)):e.createCommentVNode("",!0),u.percentage<100&&!u.errMsg?(e.openBlock(),e.createBlock(p,{key:1,percentage:u.percentage},null,8,["percentage"])):(e.openBlock(),e.createBlock(p,{key:2,percentage:u.percentage,status:u.errMsg?"exception":"success"},null,8,["percentage","status"]))]),e.createElementVNode("div",kr,[!u.percentage||0<u.percentage<100&&!u.isPlay?(e.openBlock(),e.createElementBlock("span",{key:0,class:"icon delete",onClick:f=>t.handleDeleteChangeFile(m)},[e.createVNode(d,{type:"ElIconClose"})],8,br)):e.createCommentVNode("",!0),u.percentage&&u.percentage!==100?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["icon",u.isPlay?"delete":"success"]),onClick:f=>t.handleStopChangeFile(m,u)},[u.isPlay?(e.openBlock(),e.createBlock(d,{key:0,type:"ElIconVideoPause"})):(e.openBlock(),e.createBlock(d,{key:1,type:"ElIconCaretRight"}))],10,wr)):e.createCommentVNode("",!0)])]))),128))])]),_:1},8,["modelValue","before-close"])])}],["__scopeId","data-v-9c3ea43c"]]);ht.install=function(t){t.component(ht.name,ht)},mt.install=function(t){t.component(mt.name,mt)},ut.install=function(t){t.component(ut.name,ut)},gt.install=function(t){t.component(gt.name,gt)},ft.install=function(t){t.component(ft.name,ft)};const Vr={class:"tabs-header"},Ct=v({name:"cvTabsJump",props:{tabPosition:{type:String,default:"top"}},provide(){return{addChildComponents:t=>{this.childComponents.push(t)},clearChildClass:()=>{this.childComponents.map(t=>{t.className=null})}}},data:()=>({childComponents:[]}),computed:{tabPositionClass(){return this.tabPosition=="left"?"left":this.tabPosition=="right"?"right":this.tabPosition=="bottom"?"bottom":"top"}},created(){},mounted(){}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-tabs-jump",n.tabPositionClass])},[e.createElementVNode("div",Vr,[e.renderSlot(t.$slots,"default")])],2)}]]),xr={name:"cvTabPane",emits:["click"],inject:["addChildComponents","clearChildClass"],data:()=>({isshow:!0,className:null}),props:{label:{type:String,default:""},current:{type:Boolean,default:!1},name:{type:String}},mounted(){this.addChildComponents(this),this.initCurrent()},methods:{initCurrent(){this.current&&this.handleClick()},handleClick(){this.clearChildClass(),this.className="active",this.$emit("click")}}},Sr={key:1},vt=v(xr,[["render",function(t,o,a,i,l,n){return e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-tab-pane",l.className]),onClick:o[0]||(o[0]=(...r)=>n.handleClick&&n.handleClick(...r))},[t.$slots.label?e.renderSlot(t.$slots,"label",{key:0}):(e.openBlock(),e.createElementBlock("span",Sr,e.toDisplayString(a.label),1))],2)),[[e.vShow,l.isshow]])}]]);Ct.install=function(t){t.component(Ct.name,Ct)},vt.install=function(t){t.component(vt.name,vt)};const Nr={class:"cv-draw-captcha"},Br=["width","height"],yt=v({name:"cvDrawCaptcha",props:{modelValue:{type:[String,Number],default:"1234"},baseCode:{type:String,default:"1234567890ABCDEFGHGKMNPQRSTUVWXY"},fontSizeMin:{type:Number,default:25},fontSizeMax:{type:Number,default:30},backgroundColorMin:{type:Number,default:255},backgroundColorMax:{type:Number,default:255},colorMin:{type:Number,default:0},colorMax:{type:Number,default:160},lineColorMin:{type:Number,default:100},lineColorMax:{type:Number,default:255},dotColorMin:{type:Number,default:0},dotColorMax:{type:Number,default:255},contentWidth:{type:Number,default:112},contentHeight:{type:Number,default:31},refreshNum:{type:Number,default:1}},data:()=>({localCode:""}),watch:{modelValue(t){this.localCode=t,this.drawPic()},refreshNum(){this.refreshCode(),this.drawPic()}},mounted(){this.modelValue==""&&(this.refreshCode(),this.drawPic())},created(){this.localCode=this.modelValue},methods:{refreshCode(){this.localCode="",this.makeCode(this.baseCode,4),this.$emit("update:modelValue",this.localCode)},makeCode(t,o){for(let a=0;a<o;a++)this.localCode+=this.baseCode[this.randomNum(0,this.baseCode.length)]},randomNum:(t,o)=>Math.floor(Math.random()*(o-t)+t),randomColor(t,o){return"rgb("+this.randomNum(t,o)+","+this.randomNum(t,o)+","+this.randomNum(t,o)+")"},drawPic(){let t=document.getElementById("cv-draw-captcha").getContext("2d");t.textBaseline="bottom",t.fillStyle=this.randomColor(this.backgroundColorMin,this.backgroundColorMax),t.fillRect(0,0,this.contentWidth,this.contentHeight);for(let o=0;o<this.localCode.length;o++)this.drawText(t,this.localCode[o],o);this.drawLine(t),this.drawDot(t)},drawText(t,o,a){t.fillStyle=this.randomColor(this.colorMin,this.colorMax),t.font=this.randomNum(this.fontSizeMin,this.fontSizeMax)+"px SimHei";let i=(a+1)*(this.contentWidth/(this.localCode.length+1)),l=this.randomNum(this.fontSizeMax,this.contentHeight-5);var n=this.randomNum(-45,45);t.translate(i,l),t.rotate(n*Math.PI/180),t.fillText(o,0,0),t.rotate(-n*Math.PI/180),t.translate(-i,-l)},drawLine(t){for(let o=0;o<5;o++)t.strokeStyle=this.randomColor(this.lineColorMin,this.lineColorMax),t.beginPath(),t.moveTo(this.randomNum(0,this.contentWidth),this.randomNum(0,this.contentHeight)),t.lineTo(this.randomNum(0,this.contentWidth),this.randomNum(0,this.contentHeight)),t.stroke()},drawDot(t){for(let o=0;o<80;o++)t.fillStyle=this.randomColor(0,255),t.beginPath(),t.arc(this.randomNum(0,this.contentWidth),this.randomNum(0,this.contentHeight),1,0,2*Math.PI),t.fill()}}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",Nr,[e.createElementVNode("canvas",{id:"cv-draw-captcha",width:a.contentWidth,height:a.contentHeight,onClick:o[0]||(o[0]=(...r)=>n.refreshCode&&n.refreshCode(...r))},null,8,Br)])}]]),kt=v({name:"cvDrawQrcode",data:()=>({})},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",null,"二维码")}]]);yt.install=function(t){t.component(yt.name,yt)},kt.install=function(t){t.component(kt.name,kt)};const Er={name:"cvTagBase",mixins:[],components:{},emits:["update:modelValue","exceed-max-length"],props:{...k.ElTag.props,modelValue:{type:[Array,String],default:()=>[]},closable:{type:Boolean,default:!1},disableTransitions:{type:Boolean,default:!1},effect:{type:String,default:"light"},color:{type:String,default:""},hit:{type:Boolean,default:!1},type:{type:[String],default:"primary"},size:{type:[String],default:"large"},disabled:{type:Boolean,default:!1},maxlength:{type:Number,default:3,validator:t=>t>0}},watch:{modelValue(t){this._init_parse_value()},localVal(t){this._parse_last()}},data:()=>({localVal:""}),mounted(){this._init_parse_value()},methods:{_init_parse_value(){if(this.modelValue)if(typeof this.modelValue=="string"&&this.modelValue.includes(",")){const t=String(this.modelValue).split(",").map(o=>o.trim());this.localVal=ae(t)}else this.localVal=ae(this.modelValue)},_parse_last(){let t=this.localVal,o=t.join(",");this.$emit("update:modelValue",o),t.length>=this.maxlength&&this.$emit("exceed-max-length",t.length)},addTag(){this.disabled||this.localVal.length>=this.maxlength||(this.localVal.push("新标签"),this.$nextTick(()=>{let t=this.localVal.length,o=this.$refs["newTag"+(t-1)][0],a=document.createRange();a.selectNodeContents(o),window.getSelection().removeAllRanges(),window.getSelection().addRange(a),this._parse_last()}))},checkTag(t){if(this.disabled)return;let o=this.$refs[`newTag${t}`][0].innerText.trim();o.length==0?this.localVal.pop():this.localVal[t]=o,this._parse_last()},removeTag(t){this.disabled||(this.localVal.splice(t,1),this._parse_last())}}},Dr={class:"cv-tag-base"},_r=["contenteditable","onKeyup","onBlur"],Tr={key:1,class:"cv-tag-maxlength-hint"},bt=v(Er,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-tag"),c=e.resolveComponent("cv-icons");return e.openBlock(),e.createElementBlock("div",Dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.localVal,(p,d)=>(e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-tag-content"},{ref_for:!0},{closable:!a.disabled&&a.closable,disableTransitions:a.disableTransitions,effect:a.effect,type:a.type,color:a.color,hit:a.hit,size:a.size},{key:d,onClose:h=>n.removeTag(d),disabled:a.disabled}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:"cv-tag-item",contenteditable:!a.disabled&&"plaintext-only",ref_for:!0,ref:`newTag${d}`,onKeyup:e.withKeys(h=>!a.disabled&&n.checkTag(d),["enter"]),onBlur:h=>!a.disabled&&n.checkTag(d)},e.toDisplayString(p),41,_r)]),_:2},1040,["onClose","disabled"]))),128)),!a.disabled&&l.localVal.length<a.maxlength?(e.openBlock(),e.createBlock(c,{key:0,type:"ElIconCirclePlus",size:"20",onClick:o[0]||(o[0]=p=>n.addTag())})):e.createCommentVNode("",!0),!a.disabled&&l.localVal.length>=a.maxlength?(e.openBlock(),e.createElementBlock("span",Tr,"已达到最大数量 ("+e.toDisplayString(a.maxlength)+")",1)):e.createCommentVNode("",!0)])}]]);bt.install=function(t){t.component(bt.name,bt)};const Ir={name:"cvTransferTable",props:{modelValue:{type:[Array],default:()=>[]},showQuery:{type:Boolean,default:!1},showPagination:{type:Boolean,default:!1},paginationCallBack:{type:Function,default:function(){return new Promise((t,o)=>{try{t({total:0,data:null})}catch{o()}})}},titleTexts:{type:Array,default:()=>["待选项","已选项"]},buttonTexts:{type:Array,default:()=>[]},queryTexts:{type:Array,default:()=>["查询","筛选"]},leftColumns:{type:Array,default:()=>[]},rightColumns:{type:Array,default(){}},minHeight:{type:String,default:"300px"},maxHeight:{type:String,default:"500px"},tableRowKey:{type:Function,default:t=>t&&t&&t.id}},data:()=>({leftTableData:[],rightTableData:[],pageIndex:1,pageSize:20,totalSize:0,leftSelection:[],rightSelection:[],leftQueryCondition:{},rightQueryCondition:{},rightConditionTemp:void 0}),watch:{modelValue(t){this.rightTableData=t}},created(){this.rightTableData=this.modelValue,this.handlePaginationCallBack()},computed:{hasButtonTexts(){return this.buttonTexts.length===2},buttonClasses(){return["transfer-button",{"is-with-texts":this.hasButtonTexts}]},disabledLeftButton(){return!this.leftSelection.some(t=>!this.rightTableData.some(o=>this.checkObjectIsEqual(t,o)))},calcRightTableData(){if(this.showQuery&&this.rightConditionTemp){const t=Object.keys(this.rightConditionTemp);return this.rightTableData.filter(o=>t.some(a=>{const i=o[a],l=this.rightConditionTemp[a].trim();return!i||String(i).indexOf(l)>-1}))}return this.rightTableData}},methods:{handleLeftSelectionChange(t){this.leftSelection=t},handleRightSelectionChange(t){this.rightSelection=t},handleLeftRowClick(t){this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))||this.$refs.leftTable.toggleRowSelection(t)},handleRightRowClick(t){this.$refs.rightTable.toggleRowSelection(t)},handleSizeChange(t){this.pageSize=t,this.handlePaginationCallBack()},handleCurrentChange(t){this.pageIndex=t,this.handlePaginationCallBack()},handlePaginationCallBack(){if(this.showPagination&&this.paginationCallBack){const t={pageIndex:this.pageIndex,pageSize:this.pageSize,...this.leftQueryCondition};this.paginationCallBack.call(null,t).then(o=>{o&&Array.isArray(o.data)&&(this.leftTableData=o.data,this.totalSize=o.total),this.$nextTick(()=>{this.leftTableData.forEach(a=>{const i=this.rightTableData.some(l=>this.checkObjectIsEqual(l,a));this.$refs.leftTable.toggleRowSelection(a,i)})})})}},handleRowStyle({row:t}){return this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))?{color:"blue"}:{}},handleSelectable(t){return!this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))},addToRight(){for(const t of this.leftSelection)this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))||this.rightTableData.push(t);this.$emit("update:modelValue",this.rightTableData)},addToLeft(){this.rightSelection.forEach(t=>{const o=this.rightTableData.findIndex(a=>this.checkObjectIsEqual(a,t));if(o!==-1){this.rightTableData.splice(o,1);const a=this.leftTableData.find(i=>this.checkObjectIsEqual(i,t));a&&this.$refs.leftTable.toggleRowSelection(a,!1)}}),this.$emit("update:modelValue",this.rightTableData)},onLeftQuerySubmit(){this.handlePaginationCallBack()},onRightQuerySubmit(){this.rightConditionTemp=JSON.parse(JSON.stringify(this.rightQueryCondition))},checkObjectIsEqual(t,o){return this.tableRowKey(t)===this.tableRowKey(o)},clear(){this.rightTableData=[],this.$refs.leftTable.clearSelection();for(const t in this.leftQueryCondition)this.leftQueryCondition[t]=void 0;for(const t in this.rightQueryCondition)this.rightQueryCondition[t]=void 0;this.pageIndex=1,this.handlePaginationCallBack()}}},Lr={class:"cv-transfer-table"},Fr={class:"transfer-panel"},$r={class:"transfer-panel-header"},Or={key:0},Mr={style:{padding:"5px"}},zr={class:"transfer-buttons"},Pr={key:0,class:"button-text"},Hr={key:0,class:"button-text"},Ar={class:"transfer-panel"},jr={class:"transfer-panel-header"},Rr={key:0},Ur={style:{padding:"5px"}},wt=v(Ir,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button"),c=e.resolveComponent("el-form-item"),p=e.resolveComponent("el-form"),d=e.resolveComponent("el-table-column"),h=e.resolveComponent("el-table"),u=e.resolveComponent("el-pagination"),m=e.resolveComponent("cv-icons");return e.openBlock(),e.createElementBlock("div",Lr,[e.createElementVNode("div",Fr,[e.createElementVNode("p",$r,[e.createElementVNode("span",null,e.toDisplayString(a.titleTexts&&a.titleTexts[0]),1),e.createElementVNode("span",null,e.toDisplayString(l.leftSelection.length)+"/"+e.toDisplayString(l.leftTableData.length),1)]),a.showQuery?(e.openBlock(),e.createElementBlock("div",Or,[e.createVNode(p,{inline:!0,model:l.leftQueryCondition,class:"cv-transfer-form"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"leftCondition",{scope:l.leftQueryCondition}),e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",onClick:o[0]||(o[0]=f=>n.onLeftQuerySubmit())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.queryTexts[0]),1)]),_:1})]),_:1})]),_:3},8,["model"])])):e.createCommentVNode("",!0),e.createVNode(h,{ref:"leftTable","max-height":a.maxHeight,height:a.minHeight,data:l.leftTableData,"row-key":a.tableRowKey,"row-style":n.handleRowStyle,onRowClick:n.handleLeftRowClick,onSelectionChange:n.handleLeftSelectionChange,border:"",stripe:""},{default:e.withCtx(()=>[e.createVNode(d,{width:"40px",type:"selection",selectable:n.handleSelectable},null,8,["selectable"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.leftColumns,f=>(e.openBlock(),e.createBlock(d,{prop:f.id,key:f.id,label:f.label,width:f.width},{default:e.withCtx(C=>[e.renderSlot(t.$slots,"default",{scope:{row:C.row,col:f}},()=>[e.createElementVNode("span",null,e.toDisplayString(C.row[f.id]),1)])]),_:2},1032,["prop","label","width"]))),128))]),_:3},8,["max-height","height","data","row-key","row-style","onRowClick","onSelectionChange"]),e.createElementVNode("div",Mr,[a.showPagination?(e.openBlock(),e.createBlock(u,{key:0,onSizeChange:n.handleSizeChange,onCurrentChange:n.handleCurrentChange,"current-page":l.pageIndex,"page-sizes":[10,20,50,100],"page-size":l.pageSize,"pager-count":5,total:l.totalSize,layout:"total, sizes, prev, pager, next"},null,8,["onSizeChange","onCurrentChange","current-page","page-size","total"])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",zr,[e.createVNode(r,{type:"primary",class:e.normalizeClass(n.buttonClasses),disabled:n.disabledLeftButton,onClick:n.addToRight},{default:e.withCtx(()=>[a.buttonTexts[0]!==void 0?(e.openBlock(),e.createElementBlock("span",Pr,e.toDisplayString(a.buttonTexts[0]),1)):e.createCommentVNode("",!0),e.createVNode(m,{type:"ElIconArrowRight"})]),_:1},8,["class","disabled","onClick"]),e.createVNode(r,{type:"primary",class:e.normalizeClass(n.buttonClasses),disabled:l.rightSelection.length===0,onClick:n.addToLeft},{default:e.withCtx(()=>[e.createVNode(m,{type:"ElIconArrowLeft"}),a.buttonTexts[1]!==void 0?(e.openBlock(),e.createElementBlock("span",Hr,e.toDisplayString(a.buttonTexts[1]),1)):e.createCommentVNode("",!0)]),_:1},8,["class","disabled","onClick"])]),e.createElementVNode("div",Ar,[e.createElementVNode("p",jr,[e.createElementVNode("span",null,e.toDisplayString(a.titleTexts&&a.titleTexts[1]),1),e.createElementVNode("span",null,e.toDisplayString(l.rightSelection.length)+"/"+e.toDisplayString(l.rightTableData.length),1)]),a.showQuery?(e.openBlock(),e.createElementBlock("div",Rr,[e.createVNode(p,{inline:!0,model:l.rightQueryCondition,class:"cv-transfer-form"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"rightCondition",{scope:l.rightQueryCondition}),e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",onClick:o[1]||(o[1]=f=>n.onRightQuerySubmit())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.queryTexts[1]),1)]),_:1})]),_:1})]),_:3},8,["model"])])):e.createCommentVNode("",!0),e.createVNode(h,{ref:"rightTable","max-height":a.maxHeight,height:a.minHeight,data:n.calcRightTableData,"row-key":a.tableRowKey,onRowClick:n.handleRightRowClick,onSelectionChange:n.handleRightSelectionChange,border:"",stripe:""},{default:e.withCtx(()=>[e.createVNode(d,{width:"40px",type:"selection"}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.rightColumns||a.leftColumns,f=>(e.openBlock(),e.createBlock(d,{prop:f.id,key:f.id,label:f.label,width:f.width},{default:e.withCtx(C=>[e.renderSlot(t.$slots,"default",{scope:{row:C.row,col:f}},()=>[e.createElementVNode("span",null,e.toDisplayString(C.row[f.id]),1)])]),_:2},1032,["prop","label","width"]))),128))]),_:3},8,["max-height","height","data","row-key","onRowClick","onSelectionChange"]),e.createElementVNode("div",Ur,[a.showPagination?(e.openBlock(),e.createBlock(u,{key:0,total:l.rightTableData.length,layout:"total"},null,8,["total"])):e.createCommentVNode("",!0)])])])}]]);wt.install=function(t){t.component(wt.name,wt)};const Go={provide(){return{pageCurr:this.loadConfigSetting.pageCurr||1,pageLimit:this.loadConfigSetting.pageLimit||10}},props:{...k.ElTable.props,modelValue:{type:[Array,Object],default:()=>[]},headerCellStyle:{type:[Function,Object],default:()=>({})}},data:()=>({loadDataList:[]}),watch:{modelValue(t){this.loadDataList=t},loadDataList(t){this.$emit("update:modelValue",t)}},created(){this.loadDataList=this.modelValue},methods:{_getPageCurr(){return this.loadPageCurr},_getPageSize(){return this.loadPageLimit},handleCurrentChange(t){this.loadPageCurr=t,this.getData()},handleSizeChange(t){this.loadPageLimit=t,this.getData()}}},Wr={name:"cvTableBase",mixins:[oo,Go],props:{align:{type:String,default:"left"},showPagebreak:{type:[Boolean,String],default:!0},tablePagin:{type:Object,default:()=>({})},tableConfig:{type:Object,default:()=>({})},tableRefresh:{type:Number,default:()=>0}},data:()=>({paginationGroup:[10,20,30,50,100,200],paginationCount:7,searchData:{},tableConfDef:{}}),watch:{tableRefresh(t,o){this.initConfAll(),this.refresh()}},updated(){},created(){this.initConfAll(),this.getData()},mounted(){},methods:{getData(){this.loadDataList=[],this.loadGetData()},handleSelectionChange(t){this.$emit("selection-change",t)},initConfAll(){let t={};Object.assign(t,this.loadConfigDef,this.tableConfDef,this.tableConfig),this.loadPageCurr=t.pageCurr||1,this.loadPageLimit=t.pageLimit||this.paginationGroup[0],Object.assign(t.where,this.searchData),this.loadConfigSetting=t},searchSubmit(t){this.searchData=t||{},this.loadConfigSetting.isSkip?this.searchData:(this.page=1,this.getData())},searchReset(t){this.searchData={},this.page=1,this.getData()},refresh(t){this.getData()}}},Yr={class:"cv-table-list"},qr={key:0,class:"cv-tablie-list-page page"},Vt=v(Wr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table"),c=e.resolveComponent("cv-icons"),p=e.resolveComponent("el-button"),d=e.resolveComponent("el-pagination"),h=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Yr,[e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{data:t.loadDataList,style:{width:"100%"},onSelectionChange:n.handleSelectionChange}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["data","onSelectionChange"])),[[h,t.loadDataLoading]]),a.showPagebreak?e.withDirectives((e.openBlock(),e.createElementBlock("div",qr,[e.createVNode(p,{onClick:n.refresh,style:{float:"left",margin:"0 10px 0 0",padding:"5px 10px"}},{default:e.withCtx(()=>[e.createVNode(c,{type:"ElIconRefresh",size:"14"})]),_:1},8,["onClick"]),e.createVNode(d,{background:"",onSizeChange:t.handleSizeChange,onCurrentChange:t.handleCurrentChange,"pager-count":l.paginationCount,"page-sizes":l.paginationGroup,"current-page":t.loadPageCurr,"page-size":t.loadPageLimit,layout:"total, sizes, prev, pager, next, jumper",total:t.loadDataTotal},null,8,["onSizeChange","onCurrentChange","pager-count","page-sizes","current-page","page-size","total"])],512)),[[e.vShow,t.loadDataLoading===!1]]):e.createCommentVNode("",!0)])}]]),Xr={class:"cv-table-tree"},xt=v({name:"cvTableTree",mixins:[oo,Go],props:{tableConfig:{type:Object,default:()=>({})},tableRefresh:{type:Number,default:()=>0}},data:()=>({searchData:{},tableConfDef:{tablePrimary:"",childName:"children"},pager_count:7,page:1}),watch:{tableRefresh(t,o){this.refresh()}},created(){this.initConfAll(),this.getData()},mounted(){},methods:{getData(){this.loadDataList=[],this.loadGetData()},handleSelectionChange(t){this.$emit("selection-change",t)},initConfAll(){let t={};Object.assign(t,this.loadConfigDef,this.tableConfDef,this.tableConfig),Object.assign(t.where,this.searchData),this.loadConfigSetting=t},searchSubmit(t){this.searchData=t||{},this.loadConfigSetting.isSkip?this.searchData:(this.page=1,this.getData())},searchReset(t){this.searchData={},this.page=1,this.getData()},refresh(t){this.getData()}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table"),c=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Xr,[e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{data:t.loadDataList,style:{width:"100%"},onSelectionChange:n.handleSelectionChange,"row-key":t.loadConfigSetting.tablePrimary,"tree-props":{children:t.loadConfigSetting.childName,hasChildren:"hasChildren"}}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["data","onSelectionChange","row-key","tree-props"])),[[c,t.loadDataLoading]])])}]]),Kr={name:"cvTableEditor",mixins:[oo,Go],props:{border:{type:[Boolean],default:!0},tableConfig:{type:[Array,Object],default:()=>({})}},data:()=>({mergeRules:{},apiFunc:null,tableConfDef:{},cell_click_index:null,cell_click_label:""}),watch:{},created(){this.loadConfigSetting=Object.assign({},this.tableConfDef,this.tableConfig)},mounted(){},methods:{cell_click(t,o,a,i){switch(this.cell_click_index=t.index,this.cell_click_label=o.label,o.label){case"taskid":case"taskname":this.cell_click_index=t.index,this.cell_click_label=o.label;break;default:return}},handleChangeTData(t){}}},Gr={class:"cv-table-editor"},St=v(Kr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table"),c=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Gr,[e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{data:t.loadDataList,style:{width:"100%"},"row-class-name":"cv-tbed-tr"}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["data"])),[[c,t.loadDataLoading]])])}]]),Nt=v({name:"cvTbColumnIndex",inject:{pageCurr:{default:1},pageLimit:{default:10}},props:{...k.ElTableColumn.props,fixed:{type:[String],default:"left"},align:{type:String,default:"center"},width:{type:[String,Number],default:55},continuity:{type:[Boolean,String],default:!1}},data:()=>({}),created(){},methods:{indexMethod(t){return this.continuity&&this.pageCurr&&this.pageLimit?t+1+(this.pageCurr-1)*this.pageLimit:t+1}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{type:"index",index:n.indexMethod}),null,16,["index"])}]]),Bt=v({name:"cvTbColumnCheck",props:{...k.ElTableColumn.props,fixed:{type:[String],default:"left"},align:{type:[String],default:"center"},width:{type:[String,Number],default:55}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{type:"selection"}),null,16)}]]),Zr={name:"cvTbColumnText",props:{...k.ElTableColumn.props},data:()=>({}),created(){},methods:{getContentText(t){let o=t.row[this.prop];return this.formatter&&(o=this.formatter(t.row,t.column)),o}}},Qr={style:{display:"contents"}},Et=v(Zr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.createElementVNode("div",Qr,e.toDisplayString(c.row[t.prop]),1)]),_:1},16)}]]),Jr={name:"cvTbColumnImg",props:{...k.ElTableColumn.props,imgWidth:{type:[String,Number],default:null},imgHeight:{type:[String,Number],default:null}},data:()=>({localImgWidth:"50px",localImgHeight:"50px",localImgArr:[],localImgOne:""}),created(){this.imgWidth&&(this.localImgWidth=this.imgWidth.indexOf("px")!==-1?this.imgWidth:this.imgWidth+"px"),this.imgHeight&&(this.localImgHeight=this.imgHeight.indexOf("px")!==-1?this.imgHeight:this.imgHeight+"px")},methods:{handleImgOne(t){let o=t[this.prop]||null;if(o){if(Object.prototype.toString.call(o)==="[object Array]")return o[0];if(Object.prototype.toString.call(o)==="[object String]")return o}},handleImgArr(t){let o=t[this.prop]||null;if(o){if(Object.prototype.toString.call(o)==="[object Array]")return o;if(Object.prototype.toString.call(o)==="[object String]")return[o]}},handleImgLeng(t){let o=t[this.prop]||null;return o?Object.prototype.toString.call(o)==="[object Array]"?o.length:Object.prototype.toString.call(o)==="[object String]"?1:void 0:0}}},es={key:0,class:"cv-table-column-img-mark"},ts={class:"cv-table-column-img-text"},Dt=v(Jr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-image"),c=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(c,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(p=>[e.createElementVNode("div",{class:"cv-table-column-img-box",style:e.normalizeStyle({width:l.localImgWidth,height:l.localImgHeight})},[e.createVNode(r,{style:e.normalizeStyle({width:l.localImgWidth,height:l.localImgHeight}),fit:"scale-down",lazy:"",src:n.handleImgOne(p.row),"preview-src-list":n.handleImgArr(p.row)},{error:e.withCtx(()=>[...o[0]||(o[0]=[e.createElementVNode("span",{class:"el-image__error cv-table-column-img-err"},[e.createTextVNode(" 暂无 "),e.createElementVNode("br"),e.createTextVNode(" 图片 ")],-1)])]),_:1},8,["style","src","preview-src-list"]),n.handleImgLeng(p.row)>1?(e.openBlock(),e.createElementBlock("p",es,[e.createElementVNode("span",ts,e.toDisplayString(n.handleImgLeng(p.row))+"张",1)])):e.createCommentVNode("",!0)],4)]),_:1},16)}]]),_t=v({name:"cvTbColumnOpt",props:{...k.ElTableColumn.props,fixed:{type:[String],default:"right"},label:{type:[String],default:"操作"}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({row:c.row,$index:c.$index,scope:c})))]),_:3},16)}]]),Tt=v({name:"cvTbColumnBase",props:{...k.ElTableColumn.props,width:{type:[String,Number],default:""}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({row:c.row,$index:c.$index,scope:c})))]),_:3},16)}]]),It=v({name:"cvTbColumnExpand",props:{...k.ElTableColumn.props},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{type:"expand"}),{default:e.withCtx(c=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({row:c.row,$index:c.$index,props:c})))]),_:3},16)}]]),Lt=v({name:"cvTbColumnEnum",props:{...k.ElTableColumn.props,dataLists:{type:[Object,Array],default:()=>({})}},data:()=>({}),created(){},methods:{dealTypeEnum(t){let o=Object.keys(this.dataLists);return t[this.prop]?this.dataLists[t[this.prop]]||"":this.dataLists[o[0]]||""}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.createElementVNode("span",null,e.toDisplayString(n.dealTypeEnum(c.row)),1)]),_:1},16)}]]),os={name:"cvTbEditSearch",props:{...k.ElTableColumn.props,modelValue:{type:[String],default:""},align:{type:[String],default:"left"}},data:()=>({isEditIndex:null,localVal:"",autocompleteAttr:{debounce:0},searchSett:{searchFunc:null,searchParam:{},searchMockData:null,searchField:{}},searchResList:[],searchCurrClass:"",searchCurrTbIndex:0,searchIsSelect:!1}),watch:{modelValue(t){},localVal(t){this.$emit("update:modelValue",t)}},directives:{edfocus:{mounted:t=>{}}},created(){},methods:{searchEdit(t,o){this.isEditIndex=o,this.$nextTick(()=>{this.$refs[`cv-tbce-autocomplete${o}`].focus()})},searchSave(t,o){this.isEditIndex=null},searchSelect(t,o,a){this.searchIsSelect=!0,this.localTableData[a]=Object.assign(this.localTableData[a],t),this.localTableData[a].row_num=1,t.row_attr?this.localTableData[a].row_name=t.row_name+`<br><span class="cv-tbce-showtext-attr">[ ${t.row_attr} ]</span>`:this.localTableData[a].row_name=t.row_name},searchFocus(t,o){this.searchCurrClass="cvtegac"+t,this.searchCurrTbIndex=t},searchBlur(t,o){this.searchIsSelect||(this.isEditIndex=null)},searchQuery(t,o){this.searchIsSelect=!1,this.searchResList=[];const a=this.searchSett;if(a.searchMockData!=null&&a.searchMockData){if(!(typeof a.searchMockData!="Array"&&typeof a.searchMockData!="object")){const i=this.sortOutData(a.searchMockData);this.tableData=i,this.$message({message:i.msg||"",type:"warning",duration:1300})}this.$nextTick(()=>{this.tableLoading=!1})}else a.searchFunc&&typeof a.searchFunc=="function"&&a.searchFunc({page:1,pagesize:20,keyword:t,...a.searchParam}).then(i=>{this.searchResList=[...i.data],this.searchParseData(t,o)})},searchParseData(t,o){var a=[],i=[];const l=this.searchSett;if(this.searchResList.length>0){for(let n in this.searchResList){let r=this.searchResList[n];const c=l.searchField.row_price;r.row_price=r[c];const p=l.searchField.row_stock;r.row_stock=r[p];const d=l.searchField.row_attr;r.row_attr=r[d];const h=l.searchField.row_name;r.row_name=r[h];const u=l.searchField.row_unit;r.row_unit=r[u];const m=l.searchField.row_id;r.row_id=r[m],r.value=r.row_name,i.push(r)}a=i}clearTimeout(this.timeout),this.timeout=setTimeout(()=>{o(a)},600)},inputSearchFilter:t=>o=>o.value.toLowerCase().indexOf(t.toLowerCase())===0,searchIconClick(){this.isEditIndex=null}}},as={class:"name"},ls={class:"addr"},ns={class:"addr"},is={class:"droplist-item"},rs={class:"name"},ss={key:0,class:"attr"},cs={class:"price"},ds={class:"rest"},ps=["onClick"],Ft=v(os,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("ElIconCircleClose"),c=e.resolveComponent("el-icon"),p=e.resolveComponent("el-autocomplete"),d=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(d,e.mergeProps(t.$props,{"class-name":"cv-table-editor-search-column"}),{default:e.withCtx(h=>[l.isEditIndex==h.$index?(e.openBlock(),e.createBlock(p,e.mergeProps({key:0,ref:`cv-tbce-autocomplete${h.$index}`},l.autocompleteAttr,{modelValue:h.row[t.prop],"onUpdate:modelValue":u=>h.row[t.prop]=u,"popper-class":`cv-tbce-autocomplete cvtegac${h.$index}`,"fetch-suggestions":n.searchQuery,onSelect:u=>n.searchSelect(u,h.row,h.$index),onFocus:u=>n.searchFocus(h.$index,u),onBlur:u=>n.searchBlur(h.row,h.$index)}),{suffix:e.withCtx(()=>[e.createVNode(c,{onClick:u=>n.searchIconClick(h.row,h.$index)},{default:e.withCtx(()=>[e.createVNode(r)]),_:1},8,["onClick"])]),default:e.withCtx(({item:u})=>[e.renderSlot(t.$slots,"default",{item:u},()=>[e.createElementVNode("div",as,e.toDisplayString(u.row_name),1),e.createElementVNode("span",ls,"价格:"+e.toDisplayString(u.row_price),1),e.createElementVNode("span",ns,e.toDisplayString(u.row_rest),1),e.createElementVNode("div",is,[e.createElementVNode("div",rs,[e.createTextVNode(e.toDisplayString(u.row_name)+" ",1),u.row_attr?(e.openBlock(),e.createElementBlock("div",ss,"[ "+e.toDisplayString(u.row_attr)+"]",1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",cs,"¥ "+e.toDisplayString(u.row_price),1),e.createElementVNode("div",ds,e.toDisplayString(u.attr_stock),1)])])]),_:2},1040,["modelValue","onUpdate:modelValue","popper-class","fetch-suggestions","onSelect","onFocus","onBlur"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:"showtext",onClick:u=>n.searchEdit(h.row,h.$index)},e.toDisplayString(h.row[t.prop]),9,ps))]),_:3},16)}]]),$t=v({name:"cvTbEditOpt",props:{tableData:{type:[Array],default:()=>[]},...k.ElTableColumn.props,label:{type:[String],default:"操作"},align:{type:[String],default:"center"},width:{type:[String],default:"100"},fixed:{type:[String],default:"left"},btnAdd:{type:[Boolean,String],default:!0},btnDel:{type:[Boolean,String],default:!0}},data:()=>({localTbData:[]}),watch:{tableData(t){this.localTbData=t}},created(){this.localTbData=this.tableData},methods:{optHdDelete(t,o){this.localTbData.splice(t,1),this.localTbData.length<1&&this.optHdAdd()},optHdAdd(){this.localTbData.push({})}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("el-button"),p=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(p,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[a.btnAdd?(e.openBlock(),e.createBlock(c,{key:0,plain:"",style:{padding:"5px",width:"26px",height:"26px"},onClick:o[0]||(o[0]=h=>n.optHdAdd())},{default:e.withCtx(()=>[e.createVNode(r,{type:"ElIconPlus"})]),_:1})):e.createCommentVNode("",!0),a.btnDel?(e.openBlock(),e.createBlock(c,{key:1,plain:"",style:{padding:"5px",width:"26px",height:"26px"},onClick:h=>n.optHdDelete(d.$index,d.row)},{default:e.withCtx(()=>[e.createVNode(r,{type:"ElIconClose"})]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:1},16)}]]),hs={name:"cvTbEditText",props:{...k.ElTableColumn.props,width:{type:[String,Number],default:""},editAttr:{type:[Object],default:()=>({placeholder:"请输入"})},editClearable:{type:[Boolean],default:!0},editStyle:{type:[Object],default:()=>({"--el-input-border":0,"--el-input-border-radius":0,"--el-input-height":"36px"})},editClass:{type:[Object],default:()=>({})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}},toFixed:{type:[String,Number],default:""}},data:()=>({currValue:"",isEditIndex:null,isErrIndex:[]}),directives:{edfocus:{mounted:t=>{t.querySelector("input").focus()},inserted:function(t){t.querySelector("input").focus()}}},created(){},methods:{textIsError(t){return this.isErrIndex&&this.isErrIndex[t]&&this.isErrIndex[t][this.prop]},textHdEdit(t,o){this.isEditIndex=o},textHdClear(t,o){},textHdSave(t,o){this.isEditIndex=null;let a=t[this.prop];if(this.toFixed!=""){let i=parseInt(this.toFixed);isNaN(a)||(t[this.prop]=parseFloat(a).toFixed(i))}else t[this.prop]=a}},render22(t,o){let a=this;return t("el-table-column",{props:{...this.$props},scopedSlots:{default:i=>{this.currValue=i.row[this.prop];let l=i.$index;return this.isEditIndex==l?t("el-input",{props:{style:this.editStyle,class:this.editClass},domProps:{value:this.currValue},props:{placeholder:this.placeholder,value:this.param},nativeOn:{keyup:n=>{n.keyCode===13&&(this.$emit("update:param",n.target.value),this.callback&&this.callback())}},on:{blur:n=>{this.$emit("update:param",n.target.value),this.callback&&this.callback()},input:function(n){a.currValue=n||n.target.value},blur:n=>{this.isEditIndex=null,a.currValue=n||n.target.value}}},this.currValue):t("span",{class:{showtext:!0},on:{click:()=>{this.isEditIndex=l}}},this.currValue)}}})}},ms=["onClick"],Ot=v(hs,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input"),c=e.resolveComponent("el-table-column"),p=e.resolveDirective("edfocus");return e.openBlock(),e.createBlock(c,e.mergeProps(t.$props,{"class-name":"cv-table-editor-text-column"}),{default:e.withCtx(d=>[l.isEditIndex!=d.$index||a.editAttr.disabled?(e.openBlock(),e.createElementBlock("span",{key:1,class:"showtext",onClick:h=>n.textHdEdit(d.row,d.$index)},e.toDisplayString(d.row[t.prop]),9,ms)):e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps({key:0},a.editAttr,{clearable:a.editClearable,style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":h=>d.row[t.prop]=h,onBlur:e.withModifiers(h=>n.textHdSave(d.row,d.$index),["prevent"]),onClear:h=>n.textHdClear(d.row,d.$index)}),null,16,["clearable","style","class","modelValue","onUpdate:modelValue","onBlur","onClear"])),[[p]])]),_:1},16)}]]),Mt=v({name:"cvTbEditRadio",props:{...k.ElTableColumn.props,editAttr:{type:[Object],default:()=>({})},editStyle:{type:[Object],default:()=>({})},editClass:{type:[Object],default:()=>({})},dataLists:{type:[Object,Array],default:()=>({})},dataField:{type:Object,default:()=>({label:"label",value:"value"})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-radio"),c=e.resolveComponent("el-radio-group"),p=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(p,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[e.createVNode(c,e.mergeProps({style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":h=>d.row[t.prop]=h},a.editAttr),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.dataLists,(h,u)=>(e.openBlock(),e.createBlock(r,{key:u,label:h[a.dataField.label],value:h[a.dataField.value]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h[a.dataField.label]),1)]),_:2},1032,["label","value"]))),128))]),_:1},16,["style","class","modelValue","onUpdate:modelValue"])]),_:1},16)}]]),zt=v({name:"cvTbEditCheckbox",props:{...k.ElTableColumn.props,editAttr:{type:[Object],default:()=>({})},editStyle:{type:[Object],default:()=>({})},editClass:{type:[Object],default:()=>({})},dataLists:{type:[Object,Array],default:()=>({})},dataField:{type:Object,default:()=>({label:"label",value:"value"})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}}},data:()=>({localVal:[]}),created(){},methods:{handleParseValue(t){this.localVal=[]}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-checkbox"),c=e.resolveComponent("el-checkbox-group"),p=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(p,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[d.row[t.prop]?(e.openBlock(),e.createBlock(c,e.mergeProps({key:0,style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":h=>d.row[t.prop]=h},a.editAttr),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.dataLists,(h,u)=>(e.openBlock(),e.createBlock(r,{key:u,label:h[a.dataField.label],value:h[a.dataField.value]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h[a.dataField.label]),1)]),_:2},1032,["label","value"]))),128))]),_:1},16,["style","class","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)]),_:1},16)}]]),Pt=v({name:"cvTbEditSelect",props:{...k.ElTableColumn.props,editAttr:{type:[Object],default:()=>({})},editStyle:{type:[Object],default:()=>({})},editClass:{type:[Object],default:()=>({})},dataLists:{type:[Object,Array],default:()=>({})},dataField:{type:Object,default:()=>({label:"label",value:"value"})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-option"),c=e.resolveComponent("el-select"),p=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(p,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[e.createVNode(c,e.mergeProps({style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":h=>d.row[t.prop]=h},a.editAttr),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.dataLists,(h,u)=>(e.openBlock(),e.createBlock(r,{key:u,label:h[a.dataField.label],value:h[a.dataField.value]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h[a.dataField.label]),1)]),_:2},1032,["label","value"]))),128))]),_:1},16,["style","class","modelValue","onUpdate:modelValue"])]),_:1},16)}]]);Vt.install=function(t){t.component(Vt.name,Vt)},xt.install=function(t){t.component(xt.name,xt)},St.install=function(t){t.component(St.name,St)},Nt.install=function(t){t.component(Nt.name,Nt)},Bt.install=function(t){t.component(Bt.name,Bt)},Et.install=function(t){t.component(Et.name,Et)},Dt.install=function(t){t.component(Dt.name,Dt)},_t.install=function(t){t.component(_t.name,_t)},Tt.install=function(t){t.component(Tt.name,Tt)},It.install=function(t){t.component(It.name,It)},Lt.install=function(t){t.component(Lt.name,Lt)},Ft.install=function(t){t.component(Ft.name,Ft)},$t.install=function(t){t.component($t.name,$t)},Ot.install=function(t){t.component(Ot.name,Ot)},Mt.install=function(t){t.component(Mt.name,Mt)},zt.install=function(t){t.component(zt.name,zt)},Pt.install=function(t){t.component(Pt.name,Pt)};const us={width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},gs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",us,[...o[0]||(o[0]=[e.createElementVNode("rect",{width:"12",height:"12",rx:"2",fill:"#86909C"},null,-1),e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.98095 5.49307L8.22012 3.25389C8.28521 3.18881 8.39074 3.18881 8.45582 3.25389L8.69153 3.4896C8.75661 3.55468 8.75661 3.66021 8.69153 3.7253L6.45235 5.96447L8.69153 8.20364C8.75661 8.26873 8.75661 8.37426 8.69153 8.43934L8.45582 8.67505C8.39074 8.74013 8.28521 8.74013 8.22012 8.67505L5.98095 6.43587L3.74178 8.67505C3.67669 8.74013 3.57116 8.74013 3.50608 8.67505L3.27037 8.43934C3.20529 8.37426 3.20529 8.26873 3.27037 8.20364L5.50954 5.96447L3.27037 3.7253C3.20529 3.66021 3.20529 3.55468 3.27037 3.4896L3.50608 3.25389C3.57116 3.18881 3.67669 3.18881 3.74178 3.25389L5.98095 5.49307Z",fill:"white"},null,-1)])])}]]),fs={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"icon"},Cs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",fs,[...o[0]||(o[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.00002 0.666504C12.0501 0.666504 15.3334 3.94975 15.3334 7.99984C15.3334 12.0499 12.0501 15.3332 8.00002 15.3332C3.94993 15.3332 0.666687 12.0499 0.666687 7.99984C0.666687 3.94975 3.94993 0.666504 8.00002 0.666504ZM8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2ZM10.6667 5.66667V7.66667H9.33333V5.66667H10.6667ZM6.66667 5.66667V7.66667H5.33333V5.66667H6.66667ZM10.0767 9.33333H11.0495C11.1804 9.33333 11.2866 9.43951 11.2866 9.57048C11.2866 9.60754 11.2779 9.64409 11.2612 9.67718L11.244 9.71053C10.6294 10.8739 9.40726 11.6667 7.99998 11.6667C6.61523 11.6667 5.40977 10.8991 4.7859 9.76612L4.73786 9.67593C4.67845 9.56052 4.72385 9.4188 4.83926 9.35939C4.87253 9.34226 4.90941 9.33333 4.94683 9.33333H5.92347C6.02396 9.33332 6.11908 9.37865 6.18238 9.4567C6.26207 9.55496 6.32833 9.62955 6.38117 9.68046C6.80074 10.0847 7.37133 10.3333 7.99998 10.3333C8.63289 10.3333 9.20694 10.0814 9.62728 9.67224C9.67791 9.62296 9.74135 9.55121 9.8176 9.45698C9.88089 9.37877 9.97611 9.33333 10.0767 9.33333Z"},null,-1)])])}]]),vs={class:"comment-common-icon"},ys=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",vs,[...o[0]||(o[0]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:""},[e.createElementVNode("path",{d:"M4.88933 0.613974C4.92947 0.616946 4.96831 0.629568 5.00253 0.650767C6.67348 1.68589 7.55141 3.13884 7.63632 5.00962C7.947 5.00962 8.2245 4.65999 8.46882 3.96072L8.49487 3.88447C8.53862 3.75351 8.68025 3.68282 8.8112 3.72656C8.83398 3.73417 8.85554 3.74502 8.87522 3.75878C9.96316 4.5193 10.5048 5.50231 10.5 6.70782C10.4999 6.73762 10.4982 6.76675 10.495 6.7952C10.4985 6.86294 10.5 6.93131 10.5 7.00005C10.5 9.48533 8.48528 11.5 6 11.5C3.51472 11.5 1.5 9.48533 1.5 7.00005C1.5 6.90255 1.5031 6.80578 1.50921 6.70983C1.5062 6.70917 1.5031 6.70849 1.5 6.70782C1.50864 6.60849 1.52139 6.50994 1.53824 6.41219C1.54515 6.35775 1.55321 6.30373 1.56222 6.25003L1.57017 6.24983C1.7622 5.3813 2.28426 4.57601 3.13635 3.83394C4.00892 3.07405 4.50079 2.11523 4.61198 0.957499L4.62156 0.844839C4.63175 0.707146 4.75163 0.603784 4.88933 0.613974Z"})],-1)])])}]]),ks={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"icon"},bs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",ks,[...o[0]||(o[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14 1.3335C14.3514 1.3335 14.6394 1.60546 14.6648 1.95041L14.6666 2.00016V14.0002C14.6666 14.3516 14.3947 14.6396 14.0497 14.665L14 14.6668H1.99998C1.64853 14.6668 1.36059 14.3949 1.33514 14.0499L1.33331 14.0002V2.00016C1.33331 1.64871 1.60527 1.36077 1.95023 1.33532L1.99998 1.3335H14ZM13.3333 2.66618H2.66664V13.3328H13.3333V2.66618ZM11.9219 6.7879C11.9719 6.83791 12 6.90574 12 6.97647V11.7993C12 11.9098 11.9104 11.9993 11.8 11.9993H6.81615C6.7975 11.9993 6.77945 11.9968 6.76232 11.992L3.91042 11.9847C3.79996 11.9844 3.71063 11.8947 3.7109 11.7842C3.71102 11.7313 3.73209 11.6807 3.76948 11.6433L6.52468 8.88807C6.62882 8.78393 6.79766 8.78393 6.9018 8.88807L8.17297 10.1593L11.5447 6.7879C11.6489 6.68376 11.8177 6.68376 11.9219 6.7879ZM5.99997 3.99951V5.99951H3.99997V3.99951H5.99997Z"},null,-1)])])}]]),ws={class:"comment-common-icon"},Vs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",ws,[...o[0]||(o[0]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M586.624 234.624a74.624 74.624 0 1 1-149.184 0 74.624 74.624 0 0 1 149.12 0z m0 554.624a74.624 74.624 0 1 1-149.248 0 74.624 74.624 0 0 1 149.248 0zM512 586.624a74.624 74.624 0 1 0 0-149.248 74.624 74.624 0 0 0 0 149.248z",fill:"currentColor"})],-1)])])}]]),xs={class:"comment-common-icon",style:{color:"#1e80ff"}},Ss=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",xs,[...o[0]||(o[0]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1534"},[e.createElementVNode("path",{d:"M668.928 166.912c-20.48-53.504-47.9744-84.7872-82.0224-94.9248-33.5872-10.0352-61.952 4.096-76.032 13.9776-27.5456 19.3536-41.216 49.664-50.0224 74.1376-3.3792 9.3184-6.4512 19.0976-9.216 27.9552l-2.6624 8.3968a227.8912 227.8912 0 0 1-10.3936 27.9552c-25.344 52.9408-47.4112 84.5312-66.7648 104.96-18.944 19.968-36.4544 30.464-55.1936 39.7824a45.3632 45.3632 0 0 0-25.088 40.5504l-0.1024 480.7168c0 24.9344 20.2752 45.2096 45.2096 45.2096h423.0656c21.7088 0 38.144-6.912 50.0224-16.9984a72.192 72.192 0 0 0 14.4896-16.896l0.2048-0.2048 0.0512-0.1536 0.8192-1.024 1.2288-1.8944c39.424-63.7952 66.7648-114.688 88.2176-175.616 24.4224-69.4784 36.8128-129.6896 42.0352-176.64 5.12-45.6704 3.7888-81.664-1.5872-101.376a77.9776 77.9776 0 0 0-45.568-52.3264 116.5824 116.5824 0 0 0-45.4144-8.6016l-192.8192-2.6624c28.1088-115.0976 10.0864-181.6064-2.4576-214.3744zM64.0512 413.9008a45.2096 45.2096 0 0 1 45.1584-47.36H176.128c24.9344 0 45.2096 20.2752 45.2096 45.2096v480.6144a45.2096 45.2096 0 0 1-45.2096 45.2096h-44.288a45.2096 45.2096 0 0 1-45.1584-43.0592L64 413.952z","p-id":"1535"})],-1)])])}]]),Ns={class:"comment-common-icon"},Bs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",Ns,[...o[0]||(o[0]=[e.createElementVNode("svg",{t:"1650360973068",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1168",width:"200",height:"200"},[e.createElementVNode("path",{d:"M547.968 138.88c6.656-4.672 14.08-6.976 20.48-5.056 6.08 1.792 22.848 10.752 40.192 56.128 8.576 22.4 27.264 81.536-5.632 197.504a45.44 45.44 0 0 0 42.88 57.984l217.6 3.008h0.448a53.12 53.12 0 0 1 20.096 3.328 16.256 16.256 0 0 1 5.568 3.648 14.464 14.464 0 0 1 3.264 6.4c2.176 7.808 4.608 33.984-0.256 77.248-4.672 41.984-15.936 97.408-38.784 162.368-19.136 54.336-43.52 100.48-81.472 161.792a56.384 56.384 0 0 0-1.664 2.496l-0.128 0.128-1.408 2.112a7.872 7.872 0 0 1-1.28 1.472 3.84 3.84 0 0 1-1.28 0.64 20.48 20.48 0 0 1-6.848 0.96H356.032V421.44c19.712-10.624 40.704-24.576 62.592-47.616 25.472-26.88 51.008-64.768 78.208-121.6 5.568-11.584 9.856-24.384 13.632-36.032l3.072-9.856c2.688-8.448 5.184-16.384 8.064-24.32 8.064-22.4 16.128-36.032 26.368-43.136z m120.96 27.968c-20.48-53.44-48-84.736-81.984-94.912-33.6-9.984-61.952 4.16-76.032 14.08-27.584 19.264-41.28 49.6-50.048 74.048-3.392 9.344-6.464 19.2-9.216 27.968l-2.688 8.448a227.84 227.84 0 0 1-10.432 27.904c-25.28 52.928-47.36 84.544-66.752 104.96-18.944 19.968-36.48 30.464-55.168 39.808a45.376 45.376 0 0 0-25.088 40.576l-0.064 480.64c0 24.96 20.224 45.248 45.184 45.248h423.04c21.76 0 38.144-6.912 50.048-16.96a71.808 71.808 0 0 0 14.528-16.896l0.128-0.256 0.128-0.128 0.832-0.96 1.152-1.92c39.424-63.872 66.816-114.688 88.256-175.68a810.24 810.24 0 0 0 42.048-176.64c5.12-45.632 3.776-81.664-1.6-101.376a77.952 77.952 0 0 0-45.568-52.288 116.544 116.544 0 0 0-45.44-8.64l-192.768-2.688c28.096-115.072 10.048-181.568-2.496-214.336z m-604.864 247.04a45.184 45.184 0 0 1 45.12-47.296h67.008c24.96 0 45.184 20.288 45.184 45.248v480.64c0 24.96-20.224 45.12-45.184 45.12H131.84a45.184 45.184 0 0 1-45.12-43.072l-22.656-480.64z","p-id":"1169"})],-1)])])}]]),Es={width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:""},Ds=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",Es,[...o[0]||(o[0]=[e.createElementVNode("path",{"data-v-d6f79dbc":"","fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.99976 7.93206L10.0656 3.86619C10.1633 3.76856 10.3215 3.76856 10.4192 3.86619L10.7727 4.21975C10.8704 4.31738 10.8704 4.47567 10.7727 4.5733L6.35331 8.99272C6.15805 9.18798 5.84147 9.18798 5.6462 8.99272L1.22679 4.5733C1.12916 4.47567 1.12916 4.31738 1.22679 4.21975L1.58034 3.86619C1.67797 3.76856 1.83626 3.76856 1.93389 3.86619L5.99976 7.93206Z"},null,-1)])])}]]),_s={class:"comment-common-icon"},Ts=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",_s,[...o[0]||(o[0]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:""},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.99951 0.5C9.03708 0.5 11.4995 2.96243 11.4995 6C11.4995 9.03757 9.03708 11.5 5.99951 11.5C2.96195 11.5 0.499512 9.03757 0.499512 6C0.499512 2.96243 2.96195 0.5 5.99951 0.5ZM6.25 3.49988C6.38807 3.49988 6.5 3.61181 6.5 3.74988V5.49988H8.25C8.38807 5.49988 8.5 5.61181 8.5 5.74988V6.24988C8.5 6.38795 8.38807 6.49988 8.25 6.49988H5.75C5.61193 6.49988 5.5 6.38795 5.5 6.24988V3.74988C5.5 3.61181 5.61193 3.49988 5.75 3.49988H6.25Z"})],-1)])])}]]),Is={class:"comment-common-icon"},Ls=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",Is,[...o[0]||(o[0]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1320",width:"200",height:"200"},[e.createElementVNode("path",{d:"M147.264 647.296V220.928c0-49.536 40.128-89.728 89.6-89.728H793.6c49.536 0 89.728 40.192 89.728 89.728v426.368c0 49.536-40.128 89.728-89.6 89.728h-145.216a47.04 47.04 0 0 0-28.16 9.408l-194.56 145.792a3.392 3.392 0 0 1-5.12-1.984l-26.752-116.672a47.04 47.04 0 0 0-45.824-36.544H236.992a89.728 89.728 0 0 1-89.728-89.728zM236.864 64A156.928 156.928 0 0 0 80 220.928l0.064 426.368a156.928 156.928 0 0 0 156.928 156.928h94.976l23.232 101.312 0.064 0.448a70.592 70.592 0 0 0 109.696 40.832l190.208-142.592H793.6a156.928 156.928 0 0 0 156.928-156.928l-0.064-426.368A156.928 156.928 0 0 0 793.536 64H236.928z m69.44 442.496a65.344 65.344 0 1 0 0-130.752 65.344 65.344 0 0 0 0 130.752z m268.8-65.344a65.344 65.344 0 1 1-130.752 0 65.344 65.344 0 0 1 130.752 0z m138.368 65.344a65.344 65.344 0 1 0 0-130.752 65.344 65.344 0 0 0 0 130.752z","p-id":"1321"})],-1)])])}]]),Fs={class:"cv-comment-emoji"},$s={class:"face-tooltip-head select-none"},Os=["onClick"],Ms=["src"],zs={class:"emoji-body select-none"},Ps={style:{padding:"0 5px"}},Hs=["onClick"],As={class:"emoji-btn select-none"},js={key:0},Rs=v(Object.assign({name:"CompInputEmoji"},{__name:"input-emoji",props:{emoji:{faceList:[],emojiList:[],allEmoji:{}},placement:"bottom"},emits:["addEmoji"],setup(t,{emit:o}){const a=t,i=e.ref(0),l=e.ref(0),n=e.ref(new Array(2)),{emojiList:r,faceList:c}=a.emoji;function p(){n.value[0]=r[0]}return(d,h)=>(e.openBlock(),e.createElementBlock("div",Fs,[e.createVNode(e.unref(k.ElPopover),{placement:t.placement,"popper-class":"emoji-popover",width:250,trigger:"click",onBeforeEnter:p},{reference:e.withCtx(()=>[e.createElementVNode("div",As,[d.$slots.default?e.renderSlot(d.$slots,"default",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock("div",js,[e.createVNode(e.unref(Cs)),h[0]||(h[0]=e.createElementVNode("span",null,"表情",-1))]))])]),default:e.withCtx(()=>[e.createElementVNode("div",$s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(u,m)=>(e.openBlock(),e.createElementBlock("label",{key:m,class:e.normalizeClass(i.value==m?"active":""),onClick:f=>function(C){switch(i.value=C,C){case 0:l.value=0;break;case 1:l.value=-50,n.value[1]=r[1]}}(m)},[e.createElementVNode("img",{src:u,alt:""},null,8,Ms)],10,Os))),128))]),e.createElementVNode("div",zs,[e.createElementVNode("div",{class:"emjio-container",style:e.normalizeStyle({transform:`translateX(${l.value}%)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(u,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"emoji-wrapper"},[e.createVNode(e.unref(k.ElScrollbar),null,{default:e.withCtx(()=>[e.createElementVNode("div",Ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u,(f,C)=>(e.openBlock(),e.createElementBlock("span",{key:C,class:"emoji-item",onClick:g=>d.$emit("addEmoji",C)},[e.createVNode(e.unref(k.ElImage),{src:f,title:String(C),class:"emoji",style:{width:"24px",height:"24px",margin:"5px"},lazy:""},null,8,["src","title"])],8,Hs))),128))])]),_:2},1024)]))),128))],4)])]),_:3},8,["placement"])]))}}),[["__scopeId","data-v-2fb59975"]]),Us={class:"cv-comment-editor"},Ws=["placeholder","innerHTML"],Ys=["src"],qs=["onClick"],Xs={key:0,class:"cv-comment-editor__action"},Ks={__name:"input-box",props:{placeholder:"",contentBtn:"",parentId:"",reply:""},emits:["hide","close"],setup(t,{expose:o,emit:a}){const i=t,l=e.ref(""),n=e.ref(),r=e.ref(!1),c=e.ref(!1),p=e.ref(),d=e.ref(!0),h=e.ref(),u=e.ref(),m=e.ref([]),f=e.ref([]),C=e.reactive({imgLength:0}),g=64,y=e.ref(),b=e.ref(!1),w=e.ref(),V=e.computed(()=>g+"px"),S=e.computed(()=>"8px 12px"),B=a,{upload:_,submit:T,focus:O}=e.inject("InjectInputBox"),le=e.inject("InjectionEmojiApi");function ea(){T({content:i.reply?`回复 <span style="color: var(--cv-color-success-dark-2);">@${i.reply.user.username}:</span> ${l.value}`:l.value,parentId:oe(i.parentId,null),reply:i.reply,files:f.value,clear:()=>{p.value&&(p.value.innerHTML="",l.value=p.value.innerHTML,r.value=!1),m.value.length=0,f.value=[],d.value=!0,B("close")}})}function Gl(D){ee(l.value)&&!C.imgLength&&(c.value=!1,B("hide",D))}function Zl(D){b.value=!0,r.value=!0,c.value=!0,e.nextTick(()=>{h.value=document.querySelector("div[id^='el-popper-container']")}),O()}function Ql(D){y.value=window.getSelection()?.getRangeAt(0),p.value?.innerHTML||(r.value=!1),b.value=!1}function Jl(D){const{innerHTML:N}=D?.target||D;l.value=N||"",ee(l.value.replace(/ |<br>| /g,""))?d.value=!0:d.value=!1}function ta(){e.nextTick(()=>{p.value?.focus()})}function en(D){D.ctrlKey&&D.key=="Enter"&&(ee(l.value.replace(/ |<br>| /g,""))?k.ElMessage({message:"内容不能为空",type:"info"}):ea())}function tn(D){m.value.length=0,f.value.length=0;const N=u.value?.files;if(C.imgLength=oe(N?.length,0),N)for(let I=0;I<N.length;I++){let G=N[I].name,ne=($=N[I],window.URL?window.URL.createObjectURL($):window.webkitURL?window.webkitURL.createObjectURL($):"");f.value.push(N[I]),Kn(G)?m.value.push(ne):k.ElMessage({type:"warn",message:"请选择图片类型文件!",duration:2500})}var $}return e.watch(()=>l.value,D=>{b.value||(n.value=D)}),e.onMounted(()=>{p.value?.addEventListener("keyup",D=>{const N=D.target;N.innerHTML=="<br>"&&(N.innerHTML="")})}),o({focus:()=>ta()}),(D,N)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",Us,[e.createElementVNode("div",{class:e.normalizeClass(["cv-comment-editor__box",{active:r.value,"input-active":c.value}])},[e.createElementVNode("div",{ref_key:"editorRef",ref:p,class:"rich-input",contenteditable:"true",placeholder:i.placeholder,onFocus:Zl,onInput:Jl,onBlur:Ql,onKeydown:e.withKeys(en,["enter"]),innerHTML:n.value,style:e.normalizeStyle({minHeight:V.value,padding:S.value})},null,44,Ws),e.createElementVNode("div",{ref_key:"imageRef",ref:w,class:"image-preview-box"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,($,I)=>(e.openBlock(),e.createElementBlock("div",{key:I,class:"image-preview"},[e.createElementVNode("img",{src:$,alt:""},null,8,Ys),e.createElementVNode("div",{class:"clean-btn",onClick:G=>{return ne=I,void m?.value?.splice(ne,1);var ne}},[e.createVNode(e.unref(gs))],8,qs)]))),128))],512)],2),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",Xs,[e.createElementVNode("div",null,[e.createVNode(Rs,{emoji:e.unref(le),onAddEmoji:N[0]||(N[0]=$=>function(I){let G=window.getSelection();G&&(G.removeAllRanges(),y.value||(ta(),y.value=G.getRangeAt(0)),y.value.deleteContents(),y.value.insertNode(y.value.createContextualFragment(I)),y.value.collapse(!1),G.addRange(y.value),l.value=p?.value?.innerHTML||"",ee(l.value.replace(/ |<br>| /g,""))?d.value=!0:d.value=!1)}($))},null,8,["emoji"]),e.createElementVNode("div",{class:"picture",onClick:N[1]||(N[1]=(...$)=>u.value?.click&&u.value?.click(...$))},[e.createVNode(e.unref(bs)),N[2]||(N[2]=e.createElementVNode("span",null,"图片",-1)),e.createElementVNode("input",{id:"comment-upload",ref_key:"inputRef",ref:u,type:"file",multiple:"",onChange:tn},null,544)])]),e.createElementVNode("div",null,[N[3]||(N[3]=e.createElementVNode("span",{style:{"margin-right":"10px"}},[e.createTextVNode(" 文明上网理性发言,请遵守 "),e.createElementVNode("a",{href:"###",target:"_blank"},"《新闻评论服务协议》")],-1)),e.createVNode(e.unref(k.ElButton),{type:"primary",disabled:d.value,onClick:ea},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.contentBtn),1)]),_:1},8,["disabled"])])])):e.createCommentVNode("",!0)]),_:1})])),[[e.unref(k.ClickOutside),Gl,h.value]])}},Ml=v(Ks,[["__scopeId","data-v-e3fd437e"]]),Gs={class:"u-fold"},Zs={class:"action-box select-none"},Qs=v(Object.assign({name:"UFold"},{__name:"fold",props:{line:{type:[Number,String],default:5}},setup(t){e.useCssVars(c=>({v15491e60:a.value}));const o=t,a=e.computed(()=>{let c=Math.trunc(Number(o.line));return c>0?c:1}),i=e.ref(!0),l=e.ref(!1),n=e.ref();let r;return e.onMounted(()=>{r=new ResizeObserver(c=>{i.value&&n.value&&(l.value=n.value.offsetHeight<n.value.scrollHeight)}),r.observe(n.value)}),e.onUnmounted(()=>{r.disconnect()}),(c,p)=>(e.openBlock(),e.createElementBlock("div",Gs,[e.createElementVNode("div",{class:e.normalizeClass(["txt-box",{"over-hidden":i.value}])},[e.createElementVNode("div",{ref_key:"divBox",ref:n},[e.renderSlot(c.$slots,"default",{},void 0,!0)],512)],2),e.createElementVNode("div",Zs,[l.value&&c.unfold?(e.openBlock(),e.createElementBlock("div",{key:0,class:"expand-btn",onClick:p[0]||(p[0]=d=>i.value=!i.value)},e.toDisplayString(i.value?"展开":"收起"),1)):e.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-94334818"]]),da={__name:"user-card",props:{uid:""},setup(t){const o=e.ref({}),{showInfo:a}=e.inject("InjectContentBox"),i=e.inject("InjectSlots"),l=()=>e.h("div",i.card(o.value));return(n,r)=>e.unref(i).card?(e.openBlock(),e.createBlock(e.unref(k.ElPopover),{key:0,placement:"top",width:300,"show-after":300,onBeforeEnter:r[0]||(r[0]=()=>e.unref(a)(t.uid,c=>o.value=c))},{reference:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),default:e.withCtx(()=>[e.createVNode(l)]),_:3})):e.renderSlot(n.$slots,"default",{key:1})}};function zl(t,o){return!!e.getCurrentScope()&&(e.onScopeDispose(t,o),!0)}const Zo=typeof window<"u"&&typeof document<"u";const Js=Object.prototype.toString,ec=t=>Js.call(t)==="[object Object]";function co(t){return Array.isArray(t)?t:[t]}const tc=Zo?window:void 0,Pl=Zo?window.navigator:void 0;function Hl(...t){const o=[],a=()=>{o.forEach(p=>p()),o.length=0},i=e.computed(()=>{const p=co(e.toValue(t[0])).filter(d=>d!=null);return p.every(d=>typeof d!="string")?p:void 0}),l=(n=()=>{var p,d;return[(p=(d=i.value)===null||d===void 0?void 0:d.map(h=>function(u){var m;const f=e.toValue(u);return(m=f?.$el)!==null&&m!==void 0?m:f}(h)))!==null&&p!==void 0?p:[tc].filter(h=>h!=null),co(e.toValue(i.value?t[1]:t[0])),co(e.unref(i.value?t[2]:t[1])),e.toValue(i.value?t[3]:t[2])]},r=([p,d,h,u])=>{if(a(),!p?.length||!d?.length||!h?.length)return;const m=ec(u)?{...u}:u;o.push(...p.flatMap(f=>d.flatMap(C=>h.map(g=>((y,b,w,V)=>(y.addEventListener(b,w,V),()=>y.removeEventListener(b,w,V)))(f,C,g,m)))))},c={flush:"post"},e.watch(n,r,{...c,immediate:!0}));var n,r,c;return zl(a),()=>{l(),a()}}function Al(t){const o=function(){const a=e.shallowRef(!1),i=e.getCurrentInstance();return i&&e.onMounted(()=>{a.value=!0},i),a}();return e.computed(()=>(o.value,!!t()))}function pa(t,o={}){const{controls:a=!1,navigator:i=Pl}=o,l=Al(()=>i&&"permissions"in i),n=e.shallowRef(),r=typeof t=="string"?{name:t}:t,c=e.shallowRef(),p=()=>{var h,u;c.value=(h=(u=n.value)===null||u===void 0?void 0:u.state)!==null&&h!==void 0?h:"prompt"};Hl(n,"change",p,{passive:!0});const d=function(h){let u;function m(){return u||(u=h()),u}return m.reset=async()=>{const f=u;u=void 0,f&&await f},m}(async()=>{if(l.value){if(!n.value)try{n.value=await i.permissions.query(r)}catch{n.value=void 0}finally{p()}return a?e.toRaw(n.value):void 0}});return d(),a?{state:c,isSupported:l,query:d}:c}function oc(t={}){const{navigator:o=Pl,read:a=!1,source:i,copiedDuring:l=1500,legacy:n=!1}=t,r=Al(()=>o&&"clipboard"in o),c=pa("clipboard-read"),p=pa("clipboard-write"),d=e.computed(()=>r.value||n),h=e.shallowRef(""),u=e.shallowRef(!1),m=function(C,g,y={}){const{immediate:b=!0,immediateCallback:w=!1}=y,V=e.shallowRef(!1);let S;function B(){S&&(clearTimeout(S),S=void 0)}function _(){V.value=!1,B()}function T(...O){w&&C(),B(),V.value=!0,S=setTimeout(()=>{V.value=!1,S=void 0,C(...O)},e.toValue(g))}return b&&(V.value=!0,Zo&&T()),zl(_),{isPending:e.shallowReadonly(V),start:T,stop:_}}(()=>u.value=!1,l,{immediate:!1});function f(C){return C==="granted"||C==="prompt"}return d.value&&a&&Hl(["copy","cut"],async function(){let C=!(r.value&&f(c.value));if(!C)try{h.value=await o.clipboard.readText()}catch{C=!0}var g,y,b;C&&(h.value=(g=(y=document)===null||y===void 0||(b=y.getSelection)===null||b===void 0||(b=b.call(y))===null||b===void 0?void 0:b.toString())!==null&&g!==void 0?g:"")},{passive:!0}),{isSupported:d,text:e.readonly(h),copied:e.readonly(u),copy:async function(C=e.toValue(i)){if(d.value&&C!=null){let g=!(r.value&&f(p.value));if(!g)try{await o.clipboard.writeText(C)}catch{g=!0}g&&function(y){const b=document.createElement("textarea");b.value=y,b.style.position="absolute",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),b.remove()}(C),h.value=C,u.value=!0,m.start()}}}}const ac={class:"comment-list-actbox__right"},lc={class:"operation-warp"},nc={class:"dialog-footer"},ic={__name:"comment-operate",props:{data:{type:[Object],default:()=>({})}},setup(t){const{copy:o}=oc(),a=e.ref(!1),i=e.ref({report_type:"",report_content:""}),l=t;function n(){let r=l.data||{};a.value=!1,k.ElMessage({type:"info",message:"举报成功: "+r.id})}return(r,c)=>{const p=e.resolveComponent("el-dropdown-item"),d=e.resolveComponent("el-dropdown-menu"),h=e.resolveComponent("el-dropdown"),u=e.resolveComponent("el-radio"),m=e.resolveComponent("el-radio-group"),f=e.resolveComponent("el-form-item"),C=e.resolveComponent("el-input"),g=e.resolveComponent("el-form"),y=e.resolveComponent("el-button"),b=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",ac,[e.createVNode(h,{trigger:"click",onCommand:c[0]||(c[0]=w=>function(V){let S=l.data||{};switch(V){case"remove":setTimeout(()=>{commentRef.value?.remove(S)},200);break;case"report":a.value=!0;break;case"copy":o(S.content),k.ElMessage({type:"info",message:"复制成功"})}}(w))},{dropdown:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>[e.createVNode(p,{command:"report"},{default:e.withCtx(()=>[...c[5]||(c[5]=[e.createTextVNode("举报",-1)])]),_:1}),e.createVNode(p,{command:"remove"},{default:e.withCtx(()=>[...c[6]||(c[6]=[e.createTextVNode("删除",-1)])]),_:1}),e.createVNode(p,{divided:"",command:"copy"},{default:e.withCtx(()=>[...c[7]||(c[7]=[e.createTextVNode("复制",-1)])]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",lc,[e.createVNode(e.unref(Vs))])]),_:1}),e.createVNode(b,{title:"举报",modelValue:a.value,"onUpdate:modelValue":c[4]||(c[4]=w=>a.value=w),width:"400px",style:{width:"90%","max-width":"400px"}},{footer:e.withCtx(()=>[e.createElementVNode("span",nc,[e.createVNode(y,{onClick:c[3]||(c[3]=w=>a.value=!1)},{default:e.withCtx(()=>[...c[13]||(c[13]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(y,{type:"primary",onClick:n},{default:e.withCtx(()=>[...c[14]||(c[14]=[e.createTextVNode("提交",-1)])]),_:1})])]),default:e.withCtx(()=>[e.createVNode(g,{"label-position":"top"},{default:e.withCtx(()=>[e.createVNode(f,{label:"您为什么要举报此信息?"},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:i.value.report_type,"onUpdate:modelValue":c[1]||(c[1]=w=>i.value.report_type=w)},{default:e.withCtx(()=>[e.createVNode(u,{value:"色情淫秽"},{default:e.withCtx(()=>[...c[8]||(c[8]=[e.createTextVNode("色情淫秽",-1)])]),_:1}),e.createVNode(u,{value:"骚扰谩骂"},{default:e.withCtx(()=>[...c[9]||(c[9]=[e.createTextVNode("骚扰谩骂",-1)])]),_:1}),e.createVNode(u,{value:"广告欺诈"},{default:e.withCtx(()=>[...c[10]||(c[10]=[e.createTextVNode("广告欺诈",-1)])]),_:1}),e.createVNode(u,{value:"反动"},{default:e.withCtx(()=>[...c[11]||(c[11]=[e.createTextVNode("反动",-1)])]),_:1}),e.createVNode(u,{value:"其他"},{default:e.withCtx(()=>[...c[12]||(c[12]=[e.createTextVNode("其他",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(f,{label:"举报说明(可选):"},{default:e.withCtx(()=>[e.createVNode(C,{type:"textarea",modelValue:i.value.report_content,"onUpdate:modelValue":c[2]||(c[2]=w=>i.value.report_content=w),maxlength:"200",placeholder:"描述恶意行为",rows:"3"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}},rc={class:"comment-sub"},sc=["href"],cc={class:"comment-primary"},dc={class:"comment-main"},pc={key:1,class:"user-info"},hc=["href"],mc={class:"username"},uc={class:"name",style:{"max-width":"10em"}},gc={blank:"true",class:"rank"},fc=["innerHTML"],Cc={class:"address",style:{color:"#939393","font-size":"12px"}},vc={class:"time"},yc={class:"content"},kc=["innerHTML"],bc={class:"imgbox",style:{display:"flex"}},wc={class:"comment-list-actbox select-none"},Vc={class:"comment-list-actbox__left"},xc={key:2},Sc={class:"comment-list-actbox__right"},Nc={key:2},Bc={__name:"content-box",props:{reply:{type:[Boolean],default:!1},data:{type:[Object],default:()=>({})},id:{type:[String],default:""}},setup(t){const o=t,a=e.reactive({active:!1}),i=e.ref(),l=e.ref(),n=e.computed(()=>{let y=o.data.contentImg;return ee(y)?[]:y?.split("||")}),{allEmoji:r}=e.inject("InjectionEmojiApi"),{like:c,user:p,relativeTime:d}=e.inject("InjectContentBox");function h(){a.active=!a.active,a.active&&e.nextTick(()=>{i.value?.focus()})}function u(y){const b=y.target;l.value?.contains(b)||(a.active=!1)}const m=e.inject("InjectSlots"),f=()=>e.h("div",m.info(o.data)),C=e.computed(()=>((y,b)=>b.replace(/\[.+?\]/g,w=>{const V=y[w];return V?['<img src="',V,'" width="20" height="20" alt="',w,'" title="',w,'" style="margin: 0 1px; vertical-align: text-bottom"',"/>"].join(""):w}))(r,o.data.content)),g=y=>{switch(y){case 1:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="831"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#8CDBF4" p-id="832"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="833"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m950.857143-365.714285l73.142857-73.142858v146.285715h-73.142857z m73.142857-73.142858h146.285715v146.285715h-146.285715z m0 146.285715h146.285715v438.857143h-146.285715z" fill="#FFFFFF"></path></svg>';case 2:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="765"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#6ECEFF" p-id="766"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="767"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m877.714286-438.857143h365.714286v146.285715h-365.714286z m219.428572 146.285715h146.285714v146.285714h-146.285714z m-219.428572 292.571428V512h146.285714v146.285714z" fill="#FFFFFF" p-id="768"></path><path d="M1097.142857 585.142857V438.857143h365.714286v146.285714z m0 73.142857h365.714286v146.285715h-365.714286z" fill="#FFFFFF"></path></svg>';case 3:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="799"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#599DFF" p-id="800"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="801"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m877.714286-438.857143h365.714286v146.285715h-365.714286z m219.428572 146.285715h146.285714v73.142857h-146.285714z m0 219.428571h146.285714v73.142857h-146.285714z m-146.285715-146.285714h292.571429v146.285714h-292.571429z m-73.142857 219.428571h365.714286v146.285715h-365.714286z" fill="#FFFFFF"></path></svg>';case 4:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="815"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#34D19B" p-id="816"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="817"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m975.213715-365.714285L1243.428571 219.428571v219.428572h-146.285714zM1097.142857 438.857143h146.285714v292.571428h-146.285714z m146.285714 146.285714h73.142858v146.285714h-73.142858z m0-365.714286h73.142858v146.285715h-73.142858z m73.142858 0h146.285714v585.142858h-146.285714z" fill="#FFFFFF"></path></svg>';case 5:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="782"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#FFA000" p-id="783"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="784"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m1097.142858-73.142857h146.285714v219.428572h-146.285714z m-219.428572-365.714286h365.714286v146.285715h-365.714286z m0 438.857143h219.428572v146.285715h-219.428572z m73.142857-219.428571h219.428572v146.285714h-219.428572z" fill="#FFFFFF" p-id="785"></path><path d="M1316.571429 438.857143h146.285714v146.285714h-146.285714z m-219.428572-73.142857h146.285714v219.428571h-146.285714z" fill="#FFFFFF"></path></svg>';case 6:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="748"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#F36262" p-id="749"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="750"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m1097.142858-146.285714h146.285714v292.571429h-146.285714z m-73.142858-292.571429h146.285715v146.285715h-146.285715z m-146.285714 146.285715h146.285714v438.857143h-146.285714z" fill="#FFFFFF" p-id="751"></path><path d="M1243.428571 438.857143h219.428572v146.285714h-219.428572z m-48.786285-170.642286L1243.428571 219.428571v146.285715h-146.285714zM1243.428571 658.285714h146.285715v146.285715h-146.285715z" fill="#FFFFFF"></path></svg>';default:return""}};return(y,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["comment",{reply:o.reply}])},[e.createElementVNode("div",rc,[e.createVNode(da,{uid:e.unref(Z)(t.data.uid)},{default:e.withCtx(()=>[e.createElementVNode("a",{href:t.data.user.homeLink,target:"_blank",class:"no-underline",style:{display:"block"}},[e.createVNode(e.unref(k.ElAvatar),{style:{"margin-top":"5px"},size:40,fit:"cover",src:t.data.user.avatar},{default:e.withCtx(()=>[...b[2]||(b[2]=[e.createElementVNode("img",{src:"https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"},null,-1)])]),_:1},8,["src"])],8,sc)]),_:1},8,["uid"])]),e.createElementVNode("div",cc,[e.createElementVNode("div",dc,[e.unref(m).info?(e.openBlock(),e.createBlock(f,{key:0})):(e.openBlock(),e.createElementBlock("div",pc,[e.createVNode(da,{uid:e.unref(Z)(t.data.uid)},{default:e.withCtx(()=>[e.createElementVNode("a",{href:t.data.user.homeLink,target:"_blank",class:"no-underline",style:{display:"block"}},[e.createElementVNode("div",mc,[e.createElementVNode("span",uc,e.toDisplayString(t.data.user.username),1),e.createElementVNode("span",gc,[e.createElementVNode("i",{class:"comment-common-icon",style:{"font-size":"24px"},innerHTML:g(t.data.user.level)},null,8,fc)])])],8,hc)]),_:1},8,["uid"]),e.createElementVNode("span",Cc," "+e.toDisplayString(t.data.address),1),e.createElementVNode("time",vc,e.toDisplayString(e.unref(d)?e.unref(Xn)(t.data.createTime):t.data.createTime),1)])),e.createElementVNode("div",yc,[e.createVNode(Qs,{unfold:""},{default:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:C.value},null,8,kc),e.createElementVNode("div",bc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(w,V)=>(e.openBlock(),e.createBlock(e.unref(k.ElImage),{key:V,src:w,style:{height:"72px",padding:"8px 4px"},lazy:"","preview-src-list":n.value,"initial-index":V},null,8,["src","preview-src-list","initial-index"]))),128))])]),_:1})]),e.createElementVNode("div",wc,[e.createElementVNode("div",Vc,[e.createElementVNode("div",{"data-tip":"点赞",class:"item",onClick:b[0]||(b[0]=w=>e.unref(c)(e.unref(Z)(t.data.id)))},[e.unref(p).likeIds.map(String).indexOf(e.unref(Z)(t.data.id))==-1?(e.openBlock(),e.createBlock(e.unref(Bs),{key:0})):(e.openBlock(),e.createBlock(e.unref(Ss),{key:1})),t.data.likes!=0?(e.openBlock(),e.createElementBlock("span",xc,e.toDisplayString(t.data.likes),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{"data-tip":"回复",ref_key:"btnRef",ref:l,class:e.normalizeClass(["item",{active:a.active}]),onClick:h},[e.createVNode(e.unref(Ls)),e.createElementVNode("span",null,e.toDisplayString(a.active?"取消回复":"回复"),1)],2)]),e.createElementVNode("div",Sc,[e.renderSlot(y.$slots,"operate",{},()=>[e.createVNode(ic,{data:o.data},null,8,["data"])],!0)])]),a.active?(e.openBlock(),e.createElementBlock("div",Nc,[e.createVNode(Ml,{ref_key:"commentRef",ref:i,"parent-id":e.unref(Z)(t.id),placeholder:`回复 @${t.data.user.username}...`,reply:t.data,"content-btn":"发布",style:{"margin-top":"12px"},onHide:u,onClose:b[1]||(b[1]=w=>a.active=!1)},null,8,["parent-id","placeholder","reply"])])):e.createCommentVNode("",!0)]),e.renderSlot(y.$slots,"default",{},void 0,!0)])],2))}},jl=v(Bc,[["__scopeId","data-v-cfe79df7"]]),Ec={key:0,class:"reply-box"},Dc={class:"reply-list"},_c={key:0,class:"fetch-more"},Tc={key:0},Ic={key:1},Lc={key:0},Fc={key:1,class:"fetch-more"},$c={__name:"reply-box",props:{data:{type:[Array,Object],default:()=>null},id:{type:[String],default:""}},setup(t){const o=t,a=e.reactive({loading:!1,over:!1,pageNum:1,pageSize:5}),{replyPage:i,replyShowSize:l,comments:n,page:r}=e.inject("InjectReplyBox"),c=e.computed(()=>{let m={total:0,length:0,list:[]};if(o.data){let f=o.data.list.length;m={total:o.data.total,length:f,list:o.data.list}}if(!a.over){let f=m.list.slice(0,l);m.list=f}return r&&(m.list=m.list.slice(0,5)),m}),p=()=>{a.over=!0},d=m=>{n.value.forEach(f=>{f.id==o.id&&f.reply&&(f.reply=m)})},h=m=>{a.pageNum=m,i(o.id,m,a.pageSize,f=>d(f))},u=m=>{a.pageSize=m,i(o.id,a.pageNum,m,f=>d(f))};return(m,f)=>c.value.length>0?(e.openBlock(),e.createElementBlock("div",Ec,[e.createElementVNode("div",Dc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.list,(C,g)=>(e.openBlock(),e.createBlock(jl,{id:t.id,key:g,data:C,reply:""},null,8,["id","data"]))),128)),c.value.length>e.unref(l)?(e.openBlock(),e.createElementBlock("div",_c,[a.loading?(e.openBlock(),e.createElementBlock("span",Tc,"加载中...")):(e.openBlock(),e.createElementBlock("div",Ic,[a.over?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Lc,[e.createTextVNode(" 共"+e.toDisplayString(c.value.total)+"条回复, ",1),e.createElementVNode("span",{class:"fetch-more-comment select-none",onClick:p},[f[0]||(f[0]=e.createTextVNode(" 点击查看 ",-1)),e.createVNode(e.unref(Ds))])]))]))])):e.createCommentVNode("",!0),a.over&&e.unref(r)?(e.openBlock(),e.createElementBlock("div",Fc,[e.createVNode(e.unref(k.ElPagination),{small:"","hide-on-single-page":"",layout:"total, prev, pager, next",total:c.value.total,"page-size":a.pageSize,onCurrentChange:h,onSizeChange:u},null,8,["total","page-size"])])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)}},Oc=v($c,[["__scopeId","data-v-16e0a50b"]]),Mc={key:0,class:"comment-list"},zc={__name:"comment-list",props:{data:{type:[Array,Object],default:()=>[]},total:{type:[Number],default:0},showSize:{type:[Number],default:0}},setup:t=>(o,a)=>t.data?(e.openBlock(),e.createElementBlock("div",Mc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(i,l)=>(e.openBlock(),e.createBlock(jl,{id:e.unref(Z)(i.id),key:l,data:i},{default:e.withCtx(()=>[e.createVNode(Oc,{id:e.unref(Z)(i.id),data:i.reply},null,8,["id","data"])]),_:2},1032,["id","data"]))),128))])):e.createCommentVNode("",!0)},Pc={class:"cv-comment-base"},Hc={class:"cv-comment-form"},Ac={class:"cv-comment-form__content"},jc={class:"cv-comment-form__avatar"},Rc={class:"cv-comment-list-wrapper"},Ht=Object.assign({name:"cvCommentBase"},{__name:"comment",props:{config:{},page:!1,upload:!1,relativeTime:!1},emits:["submit","like","replyPage","showInfo","focus"],setup(t,{expose:o,emit:a}){const i=t,{user:l,comments:n,showSize:r,replyShowSize:c,total:p}=e.toRefs(i.config),d=a,h={upload:i.upload,submit:({content:m,parentId:f,reply:C,files:g,clear:y})=>{d("submit",{content:m,parentId:f,reply:C,files:g,finish:b=>{if(y(),f){let w=n.value.find(V=>V.id==f);if(w){let V=w.reply;V?(V.list.unshift(b),V.total++):w.reply={total:1,list:[b]}}}else n.value.unshift(b)}})},focus:()=>d("focus")};e.provide("InjectInputBox",h);const u=(m,f)=>{let C=null;n.value.forEach(g=>{C=g.id==m?g:g.reply?.list.find(y=>y.id==m),C&&(C.likes+=f)})};return e.provide("InjectContentBox",{user:l,like:m=>{const f=i.config.user.likeIds;d("like",m,()=>{if(f.findIndex(C=>C==m)==-1)f.push(m),u(m,1);else{let C=f.findIndex(g=>g==m);C!=-1&&(f.splice(C,1),u(m,-1))}})},relativeTime:oe(i.relativeTime,!1),showInfo:(m,f)=>d("showInfo",m,f)}),e.provide("InjectReplyBox",{page:i.page,replyPage:(m,f,C,g)=>{d("replyPage",{parentId:m,pageNum:f,pageSize:C,finish:g})},replyShowSize:oe(c,3),comments:n}),e.provide("InjectionEmojiApi",i.config.emoji),e.provide("InjectSlots",e.useSlots()),o({remove:m=>{const{parentId:f,id:C}=m;if(f){let g=n.value.find(b=>b.id==f),y=g?.reply;if(y){let b=y.list.findIndex(w=>w.id==C);b!=-1&&(y.list.splice(b,1),y.total--)}}else{let g=n.value.findIndex(y=>y.id==C);g!=-1&&n.value.splice(g,1)}}}),(m,f)=>{const C=e.resolveComponent("el-avatar");return e.openBlock(),e.createElementBlock("div",Pc,[e.createElementVNode("div",Hc,[f[1]||(f[1]=e.createElementVNode("div",{class:"cv-comment-form__header"},[e.createElementVNode("span",{class:"cv-comment-form__hdtitle"},"评论")],-1)),e.createElementVNode("div",Ac,[e.createElementVNode("div",jc,[e.createVNode(C,{size:40,src:t.config.user.avatar},{default:e.withCtx(()=>[...f[0]||(f[0]=[e.createElementVNode("img",{src:"https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"},null,-1)])]),_:1},8,["src"])]),e.createVNode(Ml,{placeholder:"输入评论(Enter换行,Ctrl + Enter发送)","content-btn":"发表评论"})])]),e.renderSlot(m.$slots,"default",{},()=>[f[2]||(f[2]=e.createElementVNode("div",{class:"title"},"全部评论",-1))]),e.createElementVNode("div",Rc,[e.createVNode(zc,{data:e.unref(n),total:e.unref(p),"show-size":e.unref(oe)(e.unref(r),5)},null,8,["data","total","show-size"])])])}}}),Uc={class:"comment-scroll"},Wc=["infinite-scroll-disabled"],Yc={class:"scroll-btn"},qc={key:1},Xc={key:2},At=Object.assign({name:"cvCommentScroll"},{__name:"comment-scroll",props:{disable:{type:[Boolean],default:!1},show:{type:[Boolean],default:!1}},emits:["more"],setup(t,{emit:o}){const a=t,i=e.ref(!1),l=e.ref(!1),n=o,r=e.computed(()=>l.value&&a.disable),c=e.computed(()=>!l.value||i.value||r.value),p=Dl(()=>{n("more"),i.value=!1},500),d=()=>{i.value=!0,p()};return(h,u)=>{const m=e.resolveComponent("el-link"),f=e.resolveDirective("infinite-scroll");return e.openBlock(),e.createElementBlock("div",Uc,[e.withDirectives((e.openBlock(),e.createElementBlock("div",{"infinite-scroll-disabled":c.value,"infinite-scroll-distance":"2"},[e.renderSlot(h.$slots,"default"),e.createElementVNode("div",Yc,[l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(m,{key:0,type:"primary",underline:"never",onClick:u[0]||(u[0]=C=>l.value=!l.value)},{default:e.withCtx(()=>[...u[1]||(u[1]=[e.createTextVNode("加载更多",-1)])]),_:1})),i.value?(e.openBlock(),e.createElementBlock("p",qc,"加载中...")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("p",Xc,"没有更多了")):e.createCommentVNode("",!0)])],8,Wc)),[[f,d]])])}}}),Kc={class:"cv-comment-nav-wrap"},Gc={class:"cv-comment-nav__sort"},jt=Object.assign({name:"cvCommentNav"},{__name:"comment-nav",props:{modelValue:!1},emits:["update:modelValue","sorted"],setup(t,{emit:o}){const a=t,i=o,l=e.computed({get:()=>a.modelValue,set(n){i("update:modelValue",n),i("sorted",n)}});return(n,r)=>(e.openBlock(),e.createElementBlock("div",Kc,[r[4]||(r[4]=e.createElementVNode("span",{class:"cv-comment-nav__title"},"全部评论",-1)),e.createElementVNode("div",Gc,[e.createElementVNode("div",{class:e.normalizeClass(["item select-none",{active:l.value}]),onClick:r[0]||(r[0]=c=>l.value=!0)},[e.createVNode(e.unref(Ts)),r[2]||(r[2]=e.createTextVNode(" 最新 ",-1))],2),e.createElementVNode("div",{class:e.normalizeClass(["item select-none",{active:!l.value}]),onClick:r[1]||(r[1]=c=>l.value=!1)},[e.createVNode(e.unref(ys)),r[3]||(r[3]=e.createTextVNode(" 最热 ",-1))],2)])]))}});Ht.install=function(t){t.component(Ht.name,Ht)},At.install=function(t){t.component(At.name,At)},jt.install=function(t){t.component(jt.name,jt)};const Zc={name:"cvSvgs",props:{...k.ElIcon.prop,type:{type:[String],default:""},size:{type:[String,Number],default:12},name:{type:[String],default:""}},data:()=>({}),computed:{svgType(){return"svg"+this.type},style(){return{fontSize:isNaN(Number(this.size))?this.size+"px":this.size,color:props.color}}},created(){},methods:{}},Qc={key:0,"aria-hidden":"true"},Jc=["xlink:href"],Rt=v(Zc,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.svgType)))]),a.name?(e.openBlock(),e.createElementBlock("svg",Qc,[e.createElementVNode("use",{"xlink:href":a.name},null,8,Jc)])):e.createCommentVNode("",!0)]),_:3},16)}]]),ed={name:"cvIcons",props:{...k.ElIcon.prop,type:{type:[String],default:""},size:{type:[String,Number],default:12},name:{type:[String],default:""}},data:()=>({}),computed:{style(){return{fontSize:isNaN(Number(this.size))?this.size+"px":this.size,color:props.color}}},created(){},methods:{}},td={key:0,"aria-hidden":"true"},od=["xlink:href"],Ut=v(ed,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.type)))]),a.name?(e.openBlock(),e.createElementBlock("svg",td,[e.createElementVNode("use",{"xlink:href":a.name},null,8,od)])):e.createCommentVNode("",!0)]),_:3},16)}]]);Ut.install=function(t){t.component(Ut.name,Ut)},Rt.install=function(t){t.component(Rt.name,Rt)};const ad={class:"u-emoji"},ld={class:"face-tooltip-head select-none"},nd=["onClick"],id=["src"],rd={class:"emoji-body select-none"},sd={style:{padding:"0 5px"}},cd=["onClick"],dd={class:"emoji-btn select-none"},pd={key:0},hd=v(Object.assign({name:"cvEmoji"},{__name:"emoji",props:{emoji:{faceList:[],emojiList:[],allEmoji:{}},placement:"bottom"},emits:["addEmoji"],setup(t,{emit:o}){const a=t,i=e.ref(0),l=e.ref(0),n=e.ref(new Array(2)),{emojiList:r,faceList:c}=a.emoji;function p(){n.value[0]=r[0]}return(d,h)=>(e.openBlock(),e.createElementBlock("div",ad,[e.createVNode(e.unref(k.ElPopover),{placement:t.placement,"popper-class":"emoji-popover",width:250,trigger:"click",onBeforeEnter:p},{reference:e.withCtx(()=>[e.createElementVNode("div",dd,[d.$slots.default?e.renderSlot(d.$slots,"default",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock("div",pd,[...h[0]||(h[0]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.00002 0.666504C12.0501 0.666504 15.3334 3.94975 15.3334 7.99984C15.3334 12.0499 12.0501 15.3332 8.00002 15.3332C3.94993 15.3332 0.666687 12.0499 0.666687 7.99984C0.666687 3.94975 3.94993 0.666504 8.00002 0.666504ZM8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2ZM10.6667 5.66667V7.66667H9.33333V5.66667H10.6667ZM6.66667 5.66667V7.66667H5.33333V5.66667H6.66667ZM10.0767 9.33333H11.0495C11.1804 9.33333 11.2866 9.43951 11.2866 9.57048C11.2866 9.60754 11.2779 9.64409 11.2612 9.67718L11.244 9.71053C10.6294 10.8739 9.40726 11.6667 7.99998 11.6667C6.61523 11.6667 5.40977 10.8991 4.7859 9.76612L4.73786 9.67593C4.67845 9.56052 4.72385 9.4188 4.83926 9.35939C4.87253 9.34226 4.90941 9.33333 4.94683 9.33333H5.92347C6.02396 9.33332 6.11908 9.37865 6.18238 9.4567C6.26207 9.55496 6.32833 9.62955 6.38117 9.68046C6.80074 10.0847 7.37133 10.3333 7.99998 10.3333C8.63289 10.3333 9.20694 10.0814 9.62728 9.67224C9.67791 9.62296 9.74135 9.55121 9.8176 9.45698C9.88089 9.37877 9.97611 9.33333 10.0767 9.33333Z"})],-1),e.createElementVNode("span",null,"表情",-1)])]))])]),default:e.withCtx(()=>[e.createElementVNode("div",ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(u,m)=>(e.openBlock(),e.createElementBlock("label",{key:m,class:e.normalizeClass(i.value==m?"active":""),onClick:f=>function(C){switch(i.value=C,C){case 0:l.value=0;break;case 1:l.value=-50,n.value[1]=r[1]}}(m)},[e.createElementVNode("img",{src:u,alt:""},null,8,id)],10,nd))),128))]),e.createElementVNode("div",rd,[e.createElementVNode("div",{class:"emjio-container",style:e.normalizeStyle({transform:`translateX(${l.value}%)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(u,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"emoji-wrapper"},[e.createVNode(e.unref(k.ElScrollbar),null,{default:e.withCtx(()=>[e.createElementVNode("div",sd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u,(f,C)=>(e.openBlock(),e.createElementBlock("span",{key:C,class:"emoji-item",onClick:g=>d.$emit("addEmoji",C)},[e.createVNode(e.unref(k.ElImage),{src:f,title:String(C),class:"emoji",style:{width:"24px",height:"24px",margin:"5px"},lazy:""},null,8,["src","title"])],8,cd))),128))])]),_:2},1024)]))),128))],4)])]),_:3},8,["placement"])]))}}),[["__scopeId","data-v-da53b6ed"]]),md={class:"cv-chat-message"},ud={class:"chat-list"},gd={class:"content"},fd={key:0,class:"username"},Cd=["innerHTML"],vd={__name:"message",props:{data:{type:[Array],default:()=>[]},userId:{type:[Number],default:0}},setup(t,{expose:o}){const{allEmoji:a}=e.inject("InjectionEmojiApi"),i=e.ref();o({scroll:()=>{e.nextTick(()=>{const n=document.querySelector(".chat-item:last-child");i.value.setScrollTop(n.offsetTop)})}});const l=(n,r)=>r=r.replace(/\[.+?\]/g,c=>{const p=n[c];return p?['<img src="',p,'" width="20" height="20" alt="',c,'" title="',c,'" style="margin: 0 1px; vertical-align: text-bottom"',"/>"].join(""):c});return(n,r)=>(e.openBlock(),e.createElementBlock("div",md,[e.createVNode(e.unref(k.ElScrollbar),{ref_key:"scrollbarRef",ref:i},{default:e.withCtx(()=>[e.createElementVNode("div",ud,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(c,p)=>(e.openBlock(),e.createElementBlock("div",{key:p,class:e.normalizeClass([{self:t.userId==c.id},"chat-item"])},[e.createElementVNode("div",null,[e.createVNode(e.unref(k.ElAvatar),null,{default:e.withCtx(()=>[...r[0]||(r[0]=[e.createElementVNode("img",{src:"https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"},null,-1)])]),_:1})]),e.createElementVNode("div",gd,[t.userId!=c.id?(e.openBlock(),e.createElementBlock("div",fd,e.toDisplayString(c.username),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"card-box",innerHTML:l(e.unref(a),c.content)},null,8,Cd)]),r[1]||(r[1]=e.createElementVNode("div",{class:"date"},null,-1))],2))),128))])]),_:1},512)]))}},yd={class:"cv-chat-wrap"},kd={class:"header"},bd={id:"chat-footer",class:"footer"},Wt=Object.assign({name:"cvChat"},{__name:"chat",props:{data:{type:[Array],default:()=>[]},userId:{type:[Number],default:0},emoji:{type:[Object],default:()=>({})}},emits:["submit"],setup(t,{emit:o}){const a=t,i=e.ref(!1),l=e.ref(""),n=e.ref(),{data:r}=a,c=o,p=m=>{const{ctrlKey:f,key:C}=m;f&&C=="Enter"&&h()},d=()=>{l.value="",n.value.scroll()},h=()=>{let m=l.value;m.trim()?(m=m.replace(/\n/g,"<br/>"),c("submit",{clear:d,content:m})):k.ElMessage({type:"error",message:"内容不能为空"})},u=m=>{let f=document.getElementById("emojiInput"),C=f.selectionStart,g=f.selectionEnd,y=f.value;if(C===null||g===null)return;let b=y.substring(0,C)+m+y.substring(g);f.value=b,f.focus(),f.selectionStart=C+m.length,f.selectionEnd=C+m.length,l.value=b};return e.provide("InjectionEmojiApi",a.emoji),(m,f)=>{const C=e.resolveComponent("cvIcons");return e.openBlock(),e.createElementBlock("div",yd,[e.createElementVNode("div",{class:e.normalizeClass([{active:i.value},"chat-container translate"])},[e.createElementVNode("div",kd,[e.createVNode(C,{size:"32"},{default:e.withCtx(()=>[...f[2]||(f[2]=[e.createElementVNode("svg",{viewBox:"0 0 1318 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1318.502489 432.779052c0-231.790522-209.29842-419.704826-467.458992-419.704826s-467.56979 188.357498-467.56979 419.704826 209.409219 419.704826 467.56979 419.704826a512.110799 512.110799 0 0 0 183.482363-33.239559l93.292361 93.292361a25.816057 25.816057 0 0 0 44.319412-19.168145L1165.822116 742.350141C1259.336074 665.56676 1318.502489 555.433023 1318.502489 432.779052z",fill:"#612273","p-id":"10993"}),e.createElementVNode("path",{d:"M1034.304263 745.784895a509.673231 509.673231 0 0 1-183.482363 33.239559c-244.532352 0-445.077689-168.524562-465.353819-383.25211-1.107985 12.07704-1.883575 24.264878-1.883575 36.563514 0 231.790522 209.409219 419.704826 467.56979 419.704826a512.110799 512.110799 0 0 0 183.482363-33.239559l93.292361 93.292361a25.816057 25.816057 0 0 0 44.319411-19.168145 25.262064 25.262064 0 0 0-7.5343-17.284571zM1165.822116 669.223112l2.769964 70.689461C1260.44406 663.239991 1318.502489 553.992642 1318.502489 432.779052a366.632331 366.632331 0 0 0-1.883575-36.785111 403.971435 403.971435 0 0 1-150.796798 273.229171z",fill:"#612273",opacity:".2","p-id":"10994"}),e.createElementVNode("path",{d:"M383.25211 432.779052a383.141311 383.141311 0 0 1 41.881844-172.956503c-12.298637-0.997187-24.81887-1.661978-37.449903-1.661978C173.510496 258.160571 0 413.943302 0 606.178749c0 101.713049 48.97295 193.011037 126.421121 256.609392l-5.761524 148.470028a12.187838 12.187838 0 0 0 20.830124 9.08548l94.06795-93.957153A425.577148 425.577148 0 0 0 387.79485 954.196927a404.636226 404.636226 0 0 0 300.37481-128.304696c-177.831638-59.388011-304.91755-212.733175-304.91755-393.113179z",fill:"#EB3D72","p-id":"10995"}),e.createElementVNode("path",{d:"M342.256654 391.672798c0 117.557239 53.958883 223.59143 140.714132 299.71002a391.008007 391.008007 0 0 1-99.718676-258.603766 383.141311 383.141311 0 0 1 41.881844-172.956503c-12.298637-0.997187-24.81887-1.661978-37.449903-1.661978-7.091106 0-14.071413 0-21.05172 0.553993a375.939407 375.939407 0 0 0-24.375677 132.958234zM630.111231 802.181346a407.627786 407.627786 0 0 1-283.533434 110.798528 424.136767 424.136767 0 0 1-152.12638-27.699632l-71.686647 71.686648-2.105173 54.291279a12.187838 12.187838 0 0 0 20.830124 9.08548l94.06795-93.957153A425.577148 425.577148 0 0 0 387.79485 954.196927a404.636226 404.636226 0 0 0 300.37481-128.304696 486.294741 486.294741 0 0 1-58.058429-23.710885zM85.425665 821.792686l-5.761523-4.985934c1.883575 2.215971 3.656351 4.431941 5.650725 6.647911z",fill:"#EB3D72",opacity:".5","p-id":"10996"}),e.createElementVNode("path",{d:"M833.426531 332.395585c64.263147-10.193465 64.041549-66.479117 62.601169-75.342999s-15.400995-54.291279-59.942004-47.200173S799.078987 254.836615 799.078987 254.836615a28.475222 28.475222 0 1 0 56.174854-8.97468s6.315516 3.323956 8.30989 20.27613-11.966241 29.029214-35.455529 33.239559-88.638823-19.943735-104.039819-115.452067C709.110582 96.39472 781.57282 28.253625 838.966457 13.185025a55.399264 55.399264 0 0 0-64.041549-5.318329c-56.064055 35.123134-97.170309 109.579745-85.536464 182.817571 14.957801 93.846354 79.664142 151.904783 144.038087 141.711318zM203.980091 573.825579a53.072495 53.072495 0 0 0 33.90435-67.919498c-2.659165-6.537113-21.162519-38.225492-53.51569-25.040467a30.026401 30.026401 0 0 0-19.832936 40.773858 22.159706 22.159706 0 1 0 40.773858-16.619779s5.318329 1.329582 9.861069 13.739017-3.988747 24.043281-21.05172 31.023588-70.02467 0.553993-98.832288-68.695087C68.916685 417.599654 110.798528 353.558104 151.904783 332.395585a42.879031 42.879031 0 0 0-48.97295 7.423502 146.918849 146.918849 0 0 0-32.574767 152.458775c27.810431 68.141095 86.866046 100.605064 133.623025 81.547717z",fill:"#FED150","p-id":"10997"})],-1)])]),_:1}),f[3]||(f[3]=e.createElementVNode("div",{style:{"margin-left":"12px"}},[e.createElementVNode("div",null,"聊天室"),e.createElementVNode("div",{style:{"font-size":"12px"}},"当前2人在线")],-1))]),e.createVNode(vd,{ref_key:"messageRef",ref:n,data:e.unref(r),"user-id":t.userId},null,8,["data","user-id"]),e.createElementVNode("div",bd,[e.createVNode(e.unref(k.ElInput),{id:"emojiInput",modelValue:l.value,"onUpdate:modelValue":f[0]||(f[0]=g=>l.value=g),type:"textarea",autosize:{minRows:1,maxRows:4},placeholder:"请输入内容",onKeydown:e.withKeys(p,["enter"])},null,8,["modelValue"]),e.createVNode(hd,{style:{margin:"0 8px 0"},emoji:t.emoji,placement:"top-end",onAddEmoji:u},{default:e.withCtx(()=>[...f[4]||(f[4]=[e.createElementVNode("svg",{width:"22",height:"22",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7186"},[e.createElementVNode("path",{d:"M510.944 960c-247.04 0-448-200.96-448-448s200.992-448 448-448c247.008 0 448 200.96 448 448S757.984 960 510.944 960zM510.944 128c-211.744 0-384 172.256-384 384 0 211.744 172.256 384 384 384 211.744 0 384-172.256 384-384C894.944 300.256 722.688 128 510.944 128zM512 773.344c-89.184 0-171.904-40.32-226.912-110.624-10.88-13.92-8.448-34.016 5.472-44.896 13.888-10.912 34.016-8.48 44.928 5.472 42.784 54.688 107.136 86.048 176.512 86.048 70.112 0 134.88-31.904 177.664-87.552 10.784-14.016 30.848-16.672 44.864-5.888 14.016 10.784 16.672 30.88 5.888 44.864C685.408 732.32 602.144 773.344 512 773.344zM368 515.2c-26.528 0-48-21.472-48-48l0-64c0-26.528 21.472-48 48-48s48 21.472 48 48l0 64C416 493.696 394.496 515.2 368 515.2zM656 515.2c-26.496 0-48-21.472-48-48l0-64c0-26.528 21.504-48 48-48s48 21.472 48 48l0 64C704 493.696 682.496 515.2 656 515.2z","p-id":"7187"})],-1)])]),_:1},8,["emoji"]),e.createVNode(C,{size:"18",class:e.normalizeClass([{".cv-chat-wrap submit-btn":l.value.trim()!=""},"select-none cursor-pointer"]),style:{"padding-bottom":"5px"},onClick:h},{default:e.withCtx(()=>[...f[5]||(f[5]=[e.createElementVNode("svg",{viewBox:"0 0 1025 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"15072"},[e.createElementVNode("path",{d:"M1008.00076 6.285714q18.857143 13.714286 15.428571 36.571429l-146.285714 877.714286q-2.857143 16.571429-18.285714 25.714286-8 4.571429-17.714286 4.571429-6.285714 0-13.714286-2.857143l-258.857143-105.714286-138.285714 168.571429q-10.285714 13.142857-28 13.142857-7.428571 0-12.571429-2.285714-10.857143-4-17.428571-13.428571t-6.571429-20.857143l0-199.428571 493.714286-605.142857-610.857143 528.571429-225.714286-92.571429q-21.142857-8-22.857143-31.428571-1.142857-22.857143 18.285714-33.714286l950.857143-548.571429q8.571429-5.142857 18.285714-5.142857 11.428571 0 20.571429 6.285714z","p-id":"15073"})],-1)])]),_:1},8,["class"])])],2),e.createVNode(e.unref(k.ElButton),{class:"chat-btn",onClick:f[1]||(f[1]=g=>i.value=!i.value)},{default:e.withCtx(()=>[...f[6]||(f[6]=[e.createTextVNode("chat",-1)])]),_:1})])}}});Wt.install=function(t){t.component(Wt.name,Wt)};const wd={key:0},Yt=Object.assign({name:"cvNoticeBar"},{__name:"notice-bar",props:{data:{type:[String,Array],default:()=>[]},vertical:{type:[Boolean],default:!1},suffixIcon:{type:[String],default:""},prefixIcon:{type:[String],default:""},size:{type:[Number],default:14},height:{type:[Number],default:40},delay:{type:[Number],default:1e3},spped:{type:[Number],default:100},color:{type:[String],default:"--color-warning"},background:{type:[String],default:"var(--color-warning-light-9)"}},setup(t){const o=t,{data:a,vertical:i,suffixIcon:l,prefixIcon:n,size:r,height:c,delay:p,spped:d,color:h,background:u}=o,m=e.reactive({boxWidth:0,textWidth:0,oneTime:0,twoTime:0,order:1}),f=e.ref({}),C=e.ref({style:{cssText:""}}),g=e.computed(()=>o.delay>2e3?o.delay:2e3),y=()=>{m.oneTime=m.textWidth/o.spped,m.twoTime=(m.textWidth+m.boxWidth)/o.spped},b=()=>{m.order===1?(C.value?.style&&(C.value.style.cssText=`animation: oneAnimation ${m.oneTime}s linear; opactity: 1;}`),m.order=2):C.value?.style&&(C.value.style.cssText=`animation: twoAnimation ${m.twoTime}s linear infinite; opacity: 1;`)};return e.onMounted(()=>{o.vertical||(e.nextTick(()=>{m.boxWidth=f.value.offsetWidth,m.textWidth=C.value.offsetWidth,document.styleSheets[0].insertRule(`@keyframes oneAnimation {0% {left: 0px;} 100% {left: -${m.textWidth}px;}}`),document.styleSheets[0].insertRule(`@keyframes twoAnimation {0% {left: ${m.boxWidth}px;} 100% {left: -${m.textWidth}px;}}`),y(),setTimeout(()=>{b()},o.delay)}),C.value.addEventListener("animationend",()=>{b()},!1))}),(w,V)=>{const S=e.resolveComponent("el-carousel-item"),B=e.resolveComponent("el-carousel"),_=e.resolveComponent("cvIcons");return e.openBlock(),e.createElementBlock("div",{class:"cv-notice-bar",style:e.normalizeStyle({background:e.unref(u),height:`${e.unref(c)}px`})},[e.unref(i)?(e.openBlock(),e.createElementBlock("div",wd,[e.createVNode(B,{height:"40px",direction:"vertical",autoplay:!0,"indicator-position":"none",interval:g.value},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),T=>(e.openBlock(),e.createBlock(S,{key:T},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T),1)]),_:2},1024))),128))]),_:1},8,["interval"])])):(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle({color:e.unref(h),fontSize:`${e.unref(r)}px`}),class:"cv-notice-bar-wrap"},[e.unref(n)?(e.openBlock(),e.createBlock(_,{key:0,type:e.unref(n)},null,8,["type"])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"boxRef",ref:f,class:"text-box"},[e.createElementVNode("div",{ref_key:"textRef",ref:C,class:"text"},e.toDisplayString(e.unref(a)),513)],512),e.unref(l)?(e.openBlock(),e.createBlock(_,{key:1,type:e.unref(l)},null,8,["type"])):e.createCommentVNode("",!0)],4))],4)}}});Yt.install=function(t){t.component(Yt.name,Yt)};const Vd=Object.freeze({autofocus:!1,disabled:!1,indentWithTab:!0,tabSize:2,placeholder:"",autoDestroy:!0,extensions:[cn.basicSetup]}),ha="change",ma="update",ua="focus",ga="blur",fa="ready",Ca="update:modelValue",xd=({onUpdate:t,onChange:o,onFocus:a,onBlur:i,...l})=>L.EditorState.create({doc:l.doc,selection:l.selection,extensions:[...Array.isArray(l.extensions)?l.extensions:[l.extensions],E.EditorView.updateListener.of(n=>{t(n),n.docChanged&&o(n.state.doc.toString(),n),n.focusChanged&&(n.view.hasFocus?a(n):i(n))})]}),J=t=>{const o=new L.Compartment;return{compartment:o,run:a=>{o.get(t.state)?t.dispatch({effects:o.reconfigure(a)}):t.dispatch({effects:L.StateEffect.appendConfig.of(o.of(a))})}}},va=(t,o)=>{const{compartment:a,run:i}=J(t);return l=>{const n=a.get(t.state);i(l??n!==o?o:[])}},Sd=t=>{const o=()=>t.state.doc.toString(),{run:a}=J(t),i=va(t,[E.EditorView.editable.of(!1),L.EditorState.readOnly.of(!0)]),l=va(t,E.keymap.of([dn.indentWithTab])),{run:n}=J(t),{run:r}=J(t),{run:c}=J(t),{run:p}=J(t);return{focus:()=>t.focus(),getDoc:o,setDoc:d=>{d!==o()&&t.dispatch({changes:{from:0,to:t.state.doc.length,insert:d}})},reExtensions:a,toggleDisabled:i,toggleIndentWithTab:l,setTabSize:d=>{n([L.EditorState.tabSize.of(d),x.indentUnit.of(" ".repeat(d))])},setPhrases:d=>{r([L.EditorState.phrases.of(d)])},setPlaceholder:d=>{c(E.placeholder(d))},setStyle:(d={})=>{p(E.EditorView.theme({"&":{...d}}))}}},Nd=e.defineComponent({name:"VueCodemirror",props:{modelValue:{type:String,default:""},autofocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},indentWithTab:{type:Boolean,default:!1},tabSize:Number,placeholder:String,style:Object,autoDestroy:{type:Boolean,default:!1},phrases:Object,root:Object,extensions:Array,selection:Object},emits:{[ha]:(t,o)=>!0,[ma]:t=>!0,[ua]:t=>!0,[ga]:t=>!0,[fa]:t=>!0,[Ca]:(t,o)=>!0},setup(t,o){const a=e.shallowRef(),i=e.shallowRef(),l=e.shallowRef(),n={...Vd},r=e.computed(()=>{const c={};return Object.keys(e.toRaw(t)).forEach(p=>{p!=="modelValue"&&(c[p]=t[p]??n[p])}),c});return e.onMounted(()=>{i.value=xd({doc:t.modelValue,selection:r.value.selection,extensions:n.extensions??[],onFocus:p=>o.emit(ua,p),onBlur:p=>o.emit(ga,p),onUpdate:p=>o.emit(ma,p),onChange:(p,d)=>{p!==t.modelValue&&(o.emit(ha,p,d),o.emit(Ca,p,d))}}),l.value=new E.EditorView({state:i.value,parent:a.value,root:r.value.root}),l.value.contentDOM.addEventListener("scroll",p=>{});const c=Sd(l.value);e.watch(()=>t.modelValue,p=>{p!==c.getDoc()&&c.setDoc(p)}),e.watch(()=>t.extensions,p=>c.reExtensions(p||[]),{immediate:!0}),e.watch(()=>r.value.disabled,p=>c.toggleDisabled(p),{immediate:!0}),e.watch(()=>r.value.indentWithTab,p=>c.toggleIndentWithTab(p),{immediate:!0}),e.watch(()=>r.value.tabSize,p=>c.setTabSize(p),{immediate:!0}),e.watch(()=>r.value.phrases,p=>c.setPhrases(p||{}),{immediate:!0}),e.watch(()=>r.value.placeholder,p=>c.setPlaceholder(p),{immediate:!0}),e.watch(()=>r.value.style,p=>c.setStyle(p),{immediate:!0}),r.value.autofocus&&c.focus(),o.emit(fa,{state:i.value,view:l.value,container:a.value,editorTools:c})}),e.onBeforeUnmount(()=>{r.value.autoDestroy&&l.value&&l.value.destroy()}),()=>e.h("div",{class:"cv-editor-codemirror",ref:a})}}),ya="#e06c75",qt="#abb2bf",qo="#7d8799",ka="#d19a66",ba="#2c313a",wa="#282c34",po="#353a42",Va="#528bff",Bd=E.EditorView.theme({"&":{color:qt,backgroundColor:wa},".cm-content":{caretColor:Va},".cm-cursor, .cm-dropCursor":{borderLeftColor:Va},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:qt},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:wa,color:qo,border:"none"},".cm-activeLineGutter":{backgroundColor:ba},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:po},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:po,borderBottomColor:po},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:ba,color:qt}}},{dark:!0}),Ed=x.HighlightStyle.define([{tag:s.tags.keyword,color:"#c678dd"},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.propertyName,s.tags.macroName],color:ya},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:"#61afef"},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:ka},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:qt},{tag:[s.tags.typeName,s.tags.className,s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:"#e5c07b"},{tag:[s.tags.operator,s.tags.operatorKeyword,s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link,s.tags.special(s.tags.string)],color:"#56b6c2"},{tag:[s.tags.meta,s.tags.comment],color:qo},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.strikethrough,textDecoration:"line-through"},{tag:s.tags.link,color:qo,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:ya},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:ka},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted],color:"#98c379"},{tag:s.tags.invalid,color:"#ffffff"}]),Dd=[Bd,x.syntaxHighlighting(Ed)],_d=!1,ho="#FAFAFA",z="#90A4AE",ie="#80CBC440",xa="#272727",mo="#FAFAFA",Sa="#00000010",Td="#c2c2c222",Id="#CFD8DC",Ld="#7E939E",Fd="#FAFAFA",Na="#7C4DFF",uo="#90A4AE",Ba="#6182B8",$d="#91B859",Od="#F76D47",Ea="#8796B0",Md="#FFB62C",zd="#F76D47",Pd="#90A4AE",Hd="#91B859",Ad="#E53935",jd="#39ADB5",Rd=E.EditorView.theme({"&":{color:z,backgroundColor:ho},".cm-content":{caretColor:xa},".cm-cursor, .cm-dropCursor":{borderLeftColor:xa},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ie},".cm-panels":{backgroundColor:mo,color:z},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:mo,outline:`1px solid ${Sa}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ie},".cm-activeLine":{backgroundColor:Td},".cm-selectionMatch":{backgroundColor:ie},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Fd,outline:"none"},".cm-gutters":{backgroundColor:ho,color:z,border:"none"},".cm-activeLineGutter":{backgroundColor:ho},".cm-lineNumbers .cm-gutterElement":{color:Id},".cm-lineNumbers .cm-activeLineGutter":{color:Ld},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:z},".cm-tooltip":{border:`1px solid ${Sa}`,backgroundColor:mo,color:z},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:z,borderBottomColor:z},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:ie,color:z}}},{dark:_d}),Ud=x.HighlightStyle.define([{tag:s.tags.keyword,color:Na},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:uo},{tag:[s.tags.propertyName],color:Ba},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:$d},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Ba},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Od},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:uo},{tag:[s.tags.className],color:Md},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:zd},{tag:[s.tags.typeName],color:Ea,fontStyle:Ea},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Na},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:jd},{tag:[s.tags.meta,s.tags.comment],color:Pd},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Hd},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:uo},{tag:s.tags.invalid,color:Ad},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Wd=[Rd,x.syntaxHighlighting(Ud)],Yd=!0,go="#263238",P="#EEFFFF",re="#80CBC420",Da="#FFCC00",fo="#263238",_a="#FFFFFF10",qd="#4c616c22",Xd="#37474F",Kd="#607a86",Gd="#263238",Ta="#C792EA",Co="#EEFFFF",Ia="#82AAFF",Zd="#C3E88D",Qd="#F78C6C",La="#B2CCD6",Jd="#FFCB6B",ep="#F78C6C",tp="#546E7A",op="#C3E88D",ap="#FF5370",lp="#89DDFF",np=E.EditorView.theme({"&":{color:P,backgroundColor:go},".cm-content":{caretColor:Da},".cm-cursor, .cm-dropCursor":{borderLeftColor:Da},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:re},".cm-panels":{backgroundColor:fo,color:P},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:fo,outline:`1px solid ${_a}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:re},".cm-activeLine":{backgroundColor:qd},".cm-selectionMatch":{backgroundColor:re},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Gd,outline:"none"},".cm-gutters":{backgroundColor:go,color:P,border:"none"},".cm-activeLineGutter":{backgroundColor:go},".cm-lineNumbers .cm-gutterElement":{color:Xd},".cm-lineNumbers .cm-activeLineGutter":{color:Kd},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:P},".cm-tooltip":{border:`1px solid ${_a}`,backgroundColor:fo,color:P},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:P,borderBottomColor:P},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:re,color:P}}},{dark:Yd}),ip=x.HighlightStyle.define([{tag:s.tags.keyword,color:Ta},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Co},{tag:[s.tags.propertyName],color:Ia},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Zd},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Ia},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Qd},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Co},{tag:[s.tags.className],color:Jd},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:ep},{tag:[s.tags.typeName],color:La,fontStyle:La},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Ta},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:lp},{tag:[s.tags.meta,s.tags.comment],color:tp},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:op},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Co},{tag:s.tags.invalid,color:ap},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),rp=[np,x.syntaxHighlighting(ip)],sp=!1,vo="#FDF6E3",H="#586E75",se="#EEE8D5",Fa="#657B83",yo="#FDF6E3",$a="#D3AF86",cp="#d5bd5c22",dp="#586E75",pp="#567983",hp="#EEE8D5",Oa="#859900",ko="#268BD2",Ma="#268BD2",mp="#2AA198",up="#CB4B16",za="#CB4B16",gp="#CB4B16",fp="#D33682",Cp="#93A1A1",vp="#268BD2",yp="#DC322F",kp="#DC322F",bp=E.EditorView.theme({"&":{color:H,backgroundColor:vo},".cm-content":{caretColor:Fa},".cm-cursor, .cm-dropCursor":{borderLeftColor:Fa},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:se},".cm-panels":{backgroundColor:yo,color:H},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:yo,outline:`1px solid ${$a}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:se},".cm-activeLine":{backgroundColor:cp},".cm-selectionMatch":{backgroundColor:se},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:hp,outline:"none"},".cm-gutters":{backgroundColor:vo,color:H,border:"none"},".cm-activeLineGutter":{backgroundColor:vo},".cm-lineNumbers .cm-gutterElement":{color:dp},".cm-lineNumbers .cm-activeLineGutter":{color:pp},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:H},".cm-tooltip":{border:`1px solid ${$a}`,backgroundColor:yo,color:H},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:H,borderBottomColor:H},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:se,color:H}}},{dark:sp}),wp=x.HighlightStyle.define([{tag:s.tags.keyword,color:Oa},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:ko},{tag:[s.tags.propertyName],color:Ma},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:mp},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Ma},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:up},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:ko},{tag:[s.tags.className],color:gp},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:fp},{tag:[s.tags.typeName],color:za,fontStyle:za},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Oa},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:kp},{tag:[s.tags.meta,s.tags.comment],color:Cp},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:vp},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:ko},{tag:s.tags.invalid,color:yp},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Vp=[bp,x.syntaxHighlighting(wp)],xp=!0,bo="#002B36",A="#93A1A1",ce="#274642",Pa="#D30102",wo="#002B36",Ha="#2AA19899",Sp="#005b7022",Np="#93A1A1",Bp="#949494",Ep="#073642",Aa="#859900",Vo="#268BD2",ja="#268BD2",Dp="#2AA198",_p="#CB4B16",Ra="#CB4B16",Tp="#CB4B16",Ip="#D33682",Lp="#586E75",Fp="#268BD2",$p="#DC322F",Op="#DC322F",Mp=E.EditorView.theme({"&":{color:A,backgroundColor:bo},".cm-content":{caretColor:Pa},".cm-cursor, .cm-dropCursor":{borderLeftColor:Pa},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ce},".cm-panels":{backgroundColor:wo,color:A},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:wo,outline:`1px solid ${Ha}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ce},".cm-activeLine":{backgroundColor:Sp},".cm-selectionMatch":{backgroundColor:ce},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Ep,outline:"none"},".cm-gutters":{backgroundColor:bo,color:A,border:"none"},".cm-activeLineGutter":{backgroundColor:bo},".cm-lineNumbers .cm-gutterElement":{color:Np},".cm-lineNumbers .cm-activeLineGutter":{color:Bp},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:A},".cm-tooltip":{border:`1px solid ${Ha}`,backgroundColor:wo,color:A},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:A,borderBottomColor:A},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:ce,color:A}}},{dark:xp}),zp=x.HighlightStyle.define([{tag:s.tags.keyword,color:Aa},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Vo},{tag:[s.tags.propertyName],color:ja},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Dp},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:ja},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:_p},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Vo},{tag:[s.tags.className],color:Tp},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Ip},{tag:[s.tags.typeName],color:Ra,fontStyle:Ra},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Aa},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Op},{tag:[s.tags.meta,s.tags.comment],color:Lp},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Fp},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Vo},{tag:s.tags.invalid,color:$p},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Pp=[Mp,x.syntaxHighlighting(zp)],Hp=!0,xo="#282A36",j="#F8F8F2",de="#44475A",Ua="#F8F8F2",So="#282A36",Wa="#191A21",Ap="#53576c22",jp="#6272A4",Rp="#F8F8F2",Up="#44475A",Ya="#FF79C6",No="#F8F8F2",qa="#50FA7B",Wp="#F1FA8C",Yp="#BD93F9",Xa="#8BE9FD",qp="#8BE9FD",Xp="#BD93F9",Kp="#6272A4",Gp="#BD93F9",Zp="#FF5555",Qp="#F1FA8C",Jp=E.EditorView.theme({"&":{color:j,backgroundColor:xo},".cm-content":{caretColor:Ua},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ua},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:de},".cm-panels":{backgroundColor:So,color:j},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:So,outline:`1px solid ${Wa}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:de},".cm-activeLine":{backgroundColor:Ap},".cm-selectionMatch":{backgroundColor:de},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Up,outline:"none"},".cm-gutters":{backgroundColor:xo,color:j,border:"none"},".cm-activeLineGutter":{backgroundColor:xo},".cm-lineNumbers .cm-gutterElement":{color:jp},".cm-lineNumbers .cm-activeLineGutter":{color:Rp},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:j},".cm-tooltip":{border:`1px solid ${Wa}`,backgroundColor:So,color:j},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:j,borderBottomColor:j},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:de,color:j}}},{dark:Hp}),eh=x.HighlightStyle.define([{tag:s.tags.keyword,color:Ya},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:No},{tag:[s.tags.propertyName],color:qa},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Wp},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:qa},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Yp},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:No},{tag:[s.tags.className],color:qp},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Xp},{tag:[s.tags.typeName],color:Xa,fontStyle:Xa},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Ya},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Qp},{tag:[s.tags.meta,s.tags.comment],color:Kp},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Gp},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:No},{tag:s.tags.invalid,color:Zp},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),th=[Jp,x.syntaxHighlighting(eh)],oh=!1,Bo="#fff",R="#444d56",pe="#0366d625",Ka="#044289",Eo="#fff",Ga="#e1e4e8",ah="#c6c6c622",lh="#1b1f234d",nh="#24292e",ih="#34d05840",Za="#d73a49",Do="#e36209",Qa="#005cc5",rh="#032f62",sh="#005cc5",Ja="#005cc5",ch="#6f42c1",dh="#005cc5",ph="#6a737d",hh="#005cc5",mh="#cb2431",uh="#032f62",gh=E.EditorView.theme({"&":{color:R,backgroundColor:Bo},".cm-content":{caretColor:Ka},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ka},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:pe},".cm-panels":{backgroundColor:Eo,color:R},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Eo,outline:`1px solid ${Ga}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:pe},".cm-activeLine":{backgroundColor:ah},".cm-selectionMatch":{backgroundColor:pe},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:ih,outline:"none"},".cm-gutters":{backgroundColor:Bo,color:R,border:"none"},".cm-activeLineGutter":{backgroundColor:Bo},".cm-lineNumbers .cm-gutterElement":{color:lh},".cm-lineNumbers .cm-activeLineGutter":{color:nh},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:R},".cm-tooltip":{border:`1px solid ${Ga}`,backgroundColor:Eo,color:R},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:R,borderBottomColor:R},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:pe,color:R}}},{dark:oh}),fh=x.HighlightStyle.define([{tag:s.tags.keyword,color:Za},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Do},{tag:[s.tags.propertyName],color:Qa},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:rh},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Qa},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:sh},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Do},{tag:[s.tags.className],color:ch},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:dh},{tag:[s.tags.typeName],color:Ja,fontStyle:Ja},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Za},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:uh},{tag:[s.tags.meta,s.tags.comment],color:ph},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:hh},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Do},{tag:s.tags.invalid,color:mh},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Ch=[gh,x.syntaxHighlighting(fh)],vh=!0,_o="#24292e",U="#d1d5da",he="#3392FF44",el="#c8e1ff",To="#24292e",tl="#1b1f23",yh="#4d566022",kh="#444d56",bh="#e1e4e8",wh="#17E5E650",ol="#f97583",Io="#ffab70",al="#79b8ff",Vh="#9ecbff",xh="#79b8ff",ll="#79b8ff",Sh="#b392f0",Nh="#79b8ff",Bh="#6a737d",Eh="#79b8ff",Dh="#f97583",_h="#9ecbff",Th=E.EditorView.theme({"&":{color:U,backgroundColor:_o},".cm-content":{caretColor:el},".cm-cursor, .cm-dropCursor":{borderLeftColor:el},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:he},".cm-panels":{backgroundColor:To,color:U},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:To,outline:`1px solid ${tl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:he},".cm-activeLine":{backgroundColor:yh},".cm-selectionMatch":{backgroundColor:he},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:wh,outline:"none"},".cm-gutters":{backgroundColor:_o,color:U,border:"none"},".cm-activeLineGutter":{backgroundColor:_o},".cm-lineNumbers .cm-gutterElement":{color:kh},".cm-lineNumbers .cm-activeLineGutter":{color:bh},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:U},".cm-tooltip":{border:`1px solid ${tl}`,backgroundColor:To,color:U},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:U,borderBottomColor:U},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:he,color:U}}},{dark:vh}),Ih=x.HighlightStyle.define([{tag:s.tags.keyword,color:ol},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Io},{tag:[s.tags.propertyName],color:al},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Vh},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:al},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:xh},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Io},{tag:[s.tags.className],color:Sh},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Nh},{tag:[s.tags.typeName],color:ll,fontStyle:ll},{tag:[s.tags.operator,s.tags.operatorKeyword],color:ol},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:_h},{tag:[s.tags.meta,s.tags.comment],color:Bh},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Eh},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Io},{tag:s.tags.invalid,color:Dh},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Lh=[Th,x.syntaxHighlighting(Ih)],Fh=!0,Lo="#21202e",W="#edecee",me="#3d375e7f",nl="#a277ff",Fo="#21202e",il="#3b334b",$h="#4d4b6622",Oh="#a394f033",Mh="#cdccce",zh="#a394f033",rl="#a277ff",$o="#edecee",sl="#ffca85",Ph="#61ffca",Hh="#61ffca",cl="#82e2ff",Ah="#82e2ff",jh="#61ffca",Rh="#6d6d6d",Uh="#a277ff",Wh="#ff6767",Yh="#61ffca",qh=E.EditorView.theme({"&":{color:W,backgroundColor:Lo},".cm-content":{caretColor:nl},".cm-cursor, .cm-dropCursor":{borderLeftColor:nl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:me},".cm-panels":{backgroundColor:Fo,color:W},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Fo,outline:`1px solid ${il}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:me},".cm-activeLine":{backgroundColor:$h},".cm-selectionMatch":{backgroundColor:me},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:zh,outline:"none"},".cm-gutters":{backgroundColor:Lo,color:W,border:"none"},".cm-activeLineGutter":{backgroundColor:Lo},".cm-lineNumbers .cm-gutterElement":{color:Oh},".cm-lineNumbers .cm-activeLineGutter":{color:Mh},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:W},".cm-tooltip":{border:`1px solid ${il}`,backgroundColor:Fo,color:W},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:W,borderBottomColor:W},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:me,color:W}}},{dark:Fh}),Xh=x.HighlightStyle.define([{tag:s.tags.keyword,color:rl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:$o},{tag:[s.tags.propertyName],color:sl},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Ph},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:sl},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Hh},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:$o},{tag:[s.tags.className],color:Ah},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:jh},{tag:[s.tags.typeName],color:cl,fontStyle:cl},{tag:[s.tags.operator,s.tags.operatorKeyword],color:rl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Yh},{tag:[s.tags.meta,s.tags.comment],color:Rh},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Uh},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:$o},{tag:s.tags.invalid,color:Wh},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Kh=[qh,x.syntaxHighlighting(Xh)],Gh=!0,Oo="#1a1b26",Y="#787c99",ue="#515c7e40",dl="#c0caf5",Mo="#1a1b26",pl="#787c99",Zh="#43455c22",Qh="#363b54",Jh="#737aa2",em="#16161e",hl="#bb9af7",zo="#c0caf5",ml="#7aa2f7",tm="#9ece6a",om="#bb9af7",ul="#0db9d7",am="#c0caf5",lm="#ff9e64",nm="#444b6a",im="#89ddff",rm="#ff5370",sm="#b4f9f8",cm=E.EditorView.theme({"&":{color:Y,backgroundColor:Oo},".cm-content":{caretColor:dl},".cm-cursor, .cm-dropCursor":{borderLeftColor:dl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ue},".cm-panels":{backgroundColor:Mo,color:Y},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Mo,outline:`1px solid ${pl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ue},".cm-activeLine":{backgroundColor:Zh},".cm-selectionMatch":{backgroundColor:ue},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:em,outline:"none"},".cm-gutters":{backgroundColor:Oo,color:Y,border:"none"},".cm-activeLineGutter":{backgroundColor:Oo},".cm-lineNumbers .cm-gutterElement":{color:Qh},".cm-lineNumbers .cm-activeLineGutter":{color:Jh},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:Y},".cm-tooltip":{border:`1px solid ${pl}`,backgroundColor:Mo,color:Y},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Y,borderBottomColor:Y},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:ue,color:Y}}},{dark:Gh}),dm=x.HighlightStyle.define([{tag:s.tags.keyword,color:hl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:zo},{tag:[s.tags.propertyName],color:ml},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:tm},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:ml},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:om},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:zo},{tag:[s.tags.className],color:am},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:lm},{tag:[s.tags.typeName],color:ul,fontStyle:ul},{tag:[s.tags.operator,s.tags.operatorKeyword],color:hl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:sm},{tag:[s.tags.meta,s.tags.comment],color:nm},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:im},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:zo},{tag:s.tags.invalid,color:rm},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),pm=[cm,x.syntaxHighlighting(dm)],hm=!0,Po="#24283b",q="#7982a9",ge="#6f7bb630",gl="#c0caf5",Ho="#24283b",fl="#7982a9",mm="#4d547722",um="#3b4261",gm="#737aa2",fm="#1f2335",Cl="#bb9af7",Ao="#c0caf5",vl="#7aa2f7",Cm="#9ece6a",vm="#bb9af7",yl="#2ac3de",ym="#c0caf5",km="#ff9e64",bm="#565f89",wm="#89ddff",Vm="#ff5370",xm="#b4f9f8",Sm=E.EditorView.theme({"&":{color:q,backgroundColor:Po},".cm-content":{caretColor:gl},".cm-cursor, .cm-dropCursor":{borderLeftColor:gl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ge},".cm-panels":{backgroundColor:Ho,color:q},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Ho,outline:`1px solid ${fl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ge},".cm-activeLine":{backgroundColor:mm},".cm-selectionMatch":{backgroundColor:ge},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:fm,outline:"none"},".cm-gutters":{backgroundColor:Po,color:q,border:"none"},".cm-activeLineGutter":{backgroundColor:Po},".cm-lineNumbers .cm-gutterElement":{color:um},".cm-lineNumbers .cm-activeLineGutter":{color:gm},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:q},".cm-tooltip":{border:`1px solid ${fl}`,backgroundColor:Ho,color:q},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:q,borderBottomColor:q},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:ge,color:q}}},{dark:hm}),Nm=x.HighlightStyle.define([{tag:s.tags.keyword,color:Cl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Ao},{tag:[s.tags.propertyName],color:vl},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Cm},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:vl},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:vm},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Ao},{tag:[s.tags.className],color:ym},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:km},{tag:[s.tags.typeName],color:yl,fontStyle:yl},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Cl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:xm},{tag:[s.tags.meta,s.tags.comment],color:bm},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:wm},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Ao},{tag:s.tags.invalid,color:Vm},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Bm=[Sm,x.syntaxHighlighting(Nm)],Em=!1,jo="#e1e2e7",X="#6a6f8e",fe="#8591b840",kl="#3760bf",Ro="#e1e2e7",bl="#6a6f8e",Dm="#a7aaba22",_m="#b3b6cd",Tm="#68709a",Im="#e9e9ec",wl="#9854f1",Uo="#3760bf",Vl="#2e7de9",Lm="#587539",Fm="#9854f1",xl="#07879d",$m="#3760bf",Om="#b15c00",Mm="#9da3c2",zm="#006a83",Pm="#ff3e64",Hm="#2e5857",Am=E.EditorView.theme({"&":{color:X,backgroundColor:jo},".cm-content":{caretColor:kl},".cm-cursor, .cm-dropCursor":{borderLeftColor:kl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:fe},".cm-panels":{backgroundColor:Ro,color:X},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Ro,outline:`1px solid ${bl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:fe},".cm-activeLine":{backgroundColor:Dm},".cm-selectionMatch":{backgroundColor:fe},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Im,outline:"none"},".cm-gutters":{backgroundColor:jo,color:X,border:"none"},".cm-activeLineGutter":{backgroundColor:jo},".cm-lineNumbers .cm-gutterElement":{color:_m},".cm-lineNumbers .cm-activeLineGutter":{color:Tm},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:X},".cm-tooltip":{border:`1px solid ${bl}`,backgroundColor:Ro,color:X},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:X,borderBottomColor:X},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:fe,color:X}}},{dark:Em}),jm=x.HighlightStyle.define([{tag:s.tags.keyword,color:wl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Uo},{tag:[s.tags.propertyName],color:Vl},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Lm},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Vl},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Fm},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Uo},{tag:[s.tags.className],color:$m},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Om},{tag:[s.tags.typeName],color:xl,fontStyle:xl},{tag:[s.tags.operator,s.tags.operatorKeyword],color:wl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Hm},{tag:[s.tags.meta,s.tags.comment],color:Mm},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:zm},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Uo},{tag:s.tags.invalid,color:Pm},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Rm=[Am,x.syntaxHighlighting(jm)],Um={disabled:!1,indentWithTab:!0,tabSize:4,autofocus:!1,placeholder:"input...",backgroundColor:"white",language:"markdown",theme:"oneDark",phrases:"en-us"},Rl={emits:["update:config"],components:{CodemirrorEditor:Nd},data:()=>({codemrrConfig:{...Um},codemrrThemes:{oneDark:Dd,materialLight:Wd,materialDark:rp,solarizedLight:Vp,solarizedDark:Pp,dracula:th,githubLight:Ch,githubDark:Lh,aura:Kh,tokyoNight:pm,tokyoNightStorm:Bm,tokyoNightDay:Rm},codemrrLanguages:{javascript:aa.javascript(),js:aa.javascript(),html:pn.html(),markdown:mn.markdown(),json:hn.json(),vue:un.vue(),java:fn.java(),php:gn.php(),python:Cn.python(),go:yn.go(),mysql:la.sql(),sql:la.sql(),xml:vn.xml(),css:kn.css()},codemrrPhrases:{"Control character":"Steuerzeichen","Selection deleted":"Auswahl gelöscht","Folded lines":"Eingeklappte Zeilen","Unfolded lines":"Ausgeklappte Zeilen",to:"bis","folded code":"eingeklappter Code",unfold:"ausklappen","Fold line":"Zeile einklappen","Unfold line":"Zeile ausklappen","Go to line":"Springe zu Zeile",go:"OK",Find:"Suchen",Replace:"Ersetzen",next:"nächste",previous:"vorherige",all:"alle","match case":"groß/klein beachten","by word":"ganze Wörter",replace:"ersetzen","replace all":"alle ersetzen",close:"schließen","current match":"aktueller Treffer","replaced $ matches":"$ Treffer ersetzt","replaced match on line $":"Treffer on Zeile $ ersetzt","on line":"auf Zeile",Completions:"Vervollständigungen",Diagnostics:"Diagnosen","No diagnostics":"Keine Diagnosen"},editorViewInst:null,editorStateInst:null}),computed:{optionTheme(){let t=Object.keys(this.codemrrThemes);return["default"].concat(t)},optionPhrases:()=>["en-us","de-de"],optionLanguage(){return Object.keys(this.codemrrLanguages)},extensions(){const t=[];return t.push(this.codemrrLanguages[this.codemrrConfig.language]),this.codemrrThemes[this.codemrrConfig.theme]&&t.push(this.codemrrThemes[this.codemrrConfig.theme]),t},codemrrBind(){return{theme:this.codemrrConfig.theme,language:this.codemrrConfig.language,autofocus:this.codemrrConfig.autofocus,placeholder:this.codemrrConfig.placeholder,indentWithTab:this.codemrrConfig.indentWithTab,tabSize:this.codemrrConfig.tabSize,disabled:this.codemrrConfig.disabled,phrases:this.codemrrConfig.phrases==="en-us"?{}:this.codemrrPhrases}}},watch:{codemrrConfig(t){this.$emit("update:config",t)}}},te={props:{editorID:{type:[String],required:!1,default:()=>""}},data:()=>({editorRefEL:null}),computed:{editorRefID(){return this.editorID?this.editorID:this.$options.name+ +new Date+((1e3*Math.random()).toFixed(0)+"")}}};function Ul(t,o){var a=document.createElement("a");if(a.setAttribute("href","data:text/plain;charset=UTF-8,"+encodeURIComponent(t)),a.setAttribute("download",o),a.style.display="none",document.createEvent){const i=document.createEvent("MouseEvents");i.initEvent("click",!0,!0),a.dispatchEvent(i)}else a.click()}function Ce(t){return t<10?"0"+t:t}const Wm={undo:!1,redo:!1,strong:!0,italic:!0,overline:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,hr:!0,quote:!0,ul:!0,ol:!0,notChecked:!0,checked:!0,link:!0,table:!0,image:!0,uploadImage:!0,custom_image:!0,custom_uploadImage:!0,custom_uploadFile:!0,importmd:!0,exportmd:!0,code:!0,html_to_markdown:!0,split:!0,preview:!0,scrollSync:!0,save:!0,clear:!0,copy:!0,toc:!0,fullscreen:!0,theme:!0,backgroundColor:!1,language:!1,phrases:!1,disabled:!1,autofocus:!1,indentWithTab:!1},Ym={t:"1713021153946",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1924",width:"20",height:"20"},qm={t:"1599285632421",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"45640",width:"17",height:"17"},Xm={t:"1611551476626",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4615",width:"22",height:"22"},Km={t:"1713097613984",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6856",width:"18",height:"18"},Gm={t:"1713109019954",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"13071",width:"18",height:"18"},Qo={components:{SvgImgMap:v({name:"SvgImgMap"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Ym,[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M659.456 786.432l-114.688-188.416c-4.10112-8.192-8.19712-12.28288-16.384-12.28288-4.096 0-8.19712 4.096-12.288 4.096l-57.344 57.344-61.44-90.11712c-4.096-8.192-8.192-12.28288-16.384-12.28288s-12.288 4.096-16.384 8.192l-151.552 225.28c0 4.096-4.096 8.192-4.096 12.288 0 12.28288 8.192 20.48 20.48 20.48h413.696c12.288 0 20.48-8.19712 20.48-20.48l-4.096-4.10112zM286.72 512c40.96 0 73.728-32.768 73.728-73.728S327.68 364.544 286.72 364.544s-73.728 32.768-73.728 73.728C208.896 479.232 245.76 512 286.72 512zM851.968 98.304H323.584c-40.96 0-73.728 32.768-73.728 73.728v20.48c0 12.288 8.192 20.48 20.48 20.48s16.384-12.288 16.384-20.48v-20.48c0-20.48 16.384-36.864 36.864-36.864h528.384c20.48 0 36.85888 16.384 36.85888 36.864v528.384c0 20.48-16.37888 36.864-36.85888 36.864h-20.48c-12.288 0-20.48 8.192-20.48 20.48s8.192 20.48 20.48 20.48h20.48c40.96 0 73.72288-32.768 73.72288-73.728v-532.48c0.00512-40.96-32.76288-73.728-73.72288-73.728z","p-id":"1925"},null,-1),e.createElementVNode("path",{d:"M700.416 249.856H172.032c-40.96 0-73.728 32.768-73.728 73.728v528.384c0 40.96 32.768 73.72288 73.728 73.72288h528.384c40.96 0 73.728-32.76288 73.728-73.72288V323.584c0-40.96-32.768-73.728-73.728-73.728z m36.864 602.112c0 20.48-16.384 36.85888-36.864 36.85888H172.032c-20.48 0-36.864-16.37888-36.864-36.85888V323.584c0-20.48 16.384-36.864 36.864-36.864h528.384c20.48 0 36.864 16.384 36.864 36.864v528.384z","p-id":"1926"},null,-1)])])}]]),SvgUploadFile:v({name:"SvgUploadFile"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",qm,[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M127.519 892.879v-763.34h655.448V514.69h63.612V81.831c0-8.783-7.12-15.903-15.903-15.903H79.81c-8.783 0-15.903 7.12-15.903 15.903v858.757c0 8.783 7.12 15.903 15.903 15.903h493.993v-63.612H127.519z","p-id":"45641"},null,-1),e.createElementVNode("path",{d:"M231.608 228.388h447.269V292H231.608zM231.608 384.409h447.269v63.612H231.608zM231.608 540.43h245.141v63.612H231.608zM231.608 696.451h245.141v63.612H231.608zM923.269 762.938L745.315 584.984c-3.545-3.545-8.34-5.074-12.966-4.596a15.931 15.931 0 0 0-9.848 4.616L544.586 762.918c-6.248 6.248-6.248 16.379 0 22.627l22.353 22.353c6.248 6.248 16.379 6.248 22.627 0l112.555-112.555v245.148c0 8.837 7.163 16 16 16h31.612c8.837 0 16-7.163 16-16V695.363l112.555 112.555c6.248 6.248 16.379 6.248 22.627 0l22.353-22.353c6.249-6.248 6.249-16.378 0.001-22.627z","p-id":"45642"},null,-1)])])}]]),SvgToc:v({name:"SvgToc"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Xm,[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M370.1 371.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7zM370.1 712.4h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.2-2.6 5.7-5.7 5.7z m333.5-7.5H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.1-2.7 5.7-5.8 5.7zM370.1 542.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7z","p-id":"4616"},null,-1),e.createElementVNode("path",{d:"M847.1 560.4V250.1s0-24.7-14-46.4c-10.8-16.8-30-31.8-64.2-31.8h-261c-0.2 0-0.3 0-0.5 0.1H255s-78.1 0-78.1 78.1l0.1 213.4V774s0 24.7 13.9 46.3c10.8 16.8 30 31.8 64.2 31.8h261.1c0.2 0 0.3 0 0.5-0.1H769s78.1 0 78.1-78.1l-0.1-213.4 0.1-0.1z m-39 213.6c-1.3 38.5-38.9 39-38.9 39h-514c-1.3-0.1-2.5-0.2-3.8-0.3-5.4-1.1-15.7-4.1-23.9-11.7-9-9.7-11.2-22.3-11.7-26.1v-0.7l0.1-524.2c1.3-38.5 38.9-39 38.9-39h514c1.3 0.1 2.5 0.2 3.7 0.3 5.4 1.1 15.7 4.1 23.9 11.7 9 9.7 11.2 22.2 11.7 26 0 0.2 0 0.5 0.1 0.7l-0.1 524.3z","p-id":"4617"},null,-1)])])}]]),SvgCopy:v({name:"SvgCopy"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Km,[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M857.373005 65.290005 469.604424 65.290005c-34.211173 0-62.044078 27.832905-62.044078 62.043055l0 10.340509-63.076594 0c-25.993001 0-48.228421 16.346293-57.001225 39.293935L166.626995 176.967504c-34.21015 0-62.043055 27.832905-62.043055 62.043055l0 657.655358c0 34.21015 27.832905 62.043055 62.043055 62.043055l550.115086 0c34.21015 0 62.043055-27.832905 62.043055-62.043055l0-49.634444 78.587869 0c34.21015 0 62.043055-27.832905 62.043055-62.043055L919.41606 127.33306C919.41606 93.122911 891.583155 65.290005 857.373005 65.290005zM344.483752 179.035606l194.402595 0c10.833743 0 19.646456 8.813736 19.646456 19.646456 0 10.833743-8.813736 19.646456-19.646456 19.646456L344.483752 218.328517c-10.833743 0-19.646456-8.813736-19.646456-19.646456C324.836273 187.849342 333.650009 179.035606 344.483752 179.035606zM737.423099 896.665917c0 11.402701-9.278317 20.681018-20.681018 20.681018L166.626995 917.346935c-11.403724 0-20.681018-9.278317-20.681018-20.681018L145.945977 239.010559c0-11.402701 9.277294-20.681018 20.681018-20.681018l120.111588 0c8.197706 24.02723 30.977525 41.362037 57.744145 41.362037l194.402595 0c26.767644 0 49.54644-17.334807 57.744145-41.362037l120.111588 0c11.402701 0 20.681018 9.278317 20.681018 20.681018L737.422076 896.665917zM878.054023 784.988418c0 11.402701-9.278317 20.681018-20.681018 20.681018l-78.587869 0L778.785136 239.010559c0-34.21015-27.832905-62.043055-62.043055-62.043055L595.886549 176.967504c-8.771781-22.947641-31.007201-39.293935-57.001225-39.293935l-89.963964 0L448.921359 127.33306c0-11.403724 9.278317-20.681018 20.683065-20.681018l387.768581 0c11.402701 0 20.681018 9.277294 20.681018 20.681018L878.054023 784.988418z","p-id":"6857"},null,-1),e.createElementVNode("path",{d:"M620.597347 334.252737 260.748652 334.252737c-11.422144 0-20.681018 9.259898-20.681018 20.681018s9.258874 20.681018 20.681018 20.681018l359.849718 0c11.42112 0 20.681018-9.259898 20.681018-20.681018S632.018467 334.252737 620.597347 334.252737z","p-id":"6858"},null,-1),e.createElementVNode("path",{d:"M620.597347 454.201619 260.748652 454.201619c-11.422144 0-20.681018 9.259898-20.681018 20.681018 0 11.42112 9.258874 20.681018 20.681018 20.681018l359.849718 0c11.42112 0 20.681018-9.259898 20.681018-20.681018C641.278365 463.46254 632.018467 454.201619 620.597347 454.201619z","p-id":"6859"},null,-1),e.createElementVNode("path",{d:"M440.673511 574.151525 260.748652 574.151525c-11.422144 0-20.681018 9.259898-20.681018 20.681018 0 11.42112 9.258874 20.681018 20.681018 20.681018l179.924859 0c11.42112 0 20.681018-9.259898 20.681018-20.681018C461.35453 583.411423 452.093609 574.151525 440.673511 574.151525z","p-id":"6860"},null,-1)])])}]]),SvgLanguage:v({name:"SvgLanguage"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Gm,[...o[0]||(o[0]=[e.createElementVNode("path",{d:"M200.313605 806.764028h487.993851v78.708685h-487.993851z",fill:"#6C7280","p-id":"13072"},null,-1),e.createElementVNode("path",{d:"M809.518832 136.166026H79.102229a78.708686 78.708686 0 0 0-78.708686 78.708686V944.504228a78.708686 78.708686 0 0 0 78.708686 78.708685h730.416603a78.708686 78.708686 0 0 0 78.708685-78.708685V214.874712a78.708686 78.708686 0 0 0-78.708685-78.708686z m0 848.479631V944.504228H79.102229V214.874712h730.416603V944.504228z","p-id":"13073"},null,-1),e.createElementVNode("path",{d:"M944.897771 0H171.978478v78.708686H944.897771v787.086856h78.708686V78.708686a78.708686 78.708686 0 0 0-78.708686-78.708686z","p-id":"13074"},null,-1),e.createElementVNode("path",{d:"M360.092237 609.205227h161.352805l44.863951 117.275941h58.244427l-157.417371-385.672559h-55.09608L263.280553 725.694081H315.228286z m57.45734-157.417372a487.206764 487.206764 0 0 0 20.464259-73.986164q8.657955 31.483474 27.548039 78.708686l40.14143 107.043812H375.046887z","p-id":"13075"},null,-1)])])}]])},emits:["on-action","on-act-copy","on-act-save","on-act-theme","on-act-custom","on-act-choose-image"],props:{exportFileName:{type:String,default:""},toolbars:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1}},data:()=>({actionThemeDropdown:!1,actionPhrasesDropdown:!1,actionLanguageDropdown:!1,actionBgColorDropdown:!1,actionSplit:!0,actionPreview:!1,actionScrollSync:!0,actionToc:!0,actionFullscreen:!1,actionHtmlDiaVisible:!1,actionHtmlText:""}),computed:{lastExpFileName(){let t=new Date,o=t.getFullYear(),a=t.getMonth()+1,i=t.getDate(),l=t.getHours(),n=t.getMinutes(),r=o+"-"+Ce(a)+"-"+Ce(i)+"_"+Ce(l)+"-"+Ce(n);return this.exportFileName||r},toolConfig(){const{toolbars:t={}}=this;return{...Wm,...t}}},created(){this.actionPreview=this.isPreview||!1},methods:{actionPhrasesSet(t){this.codemrrConfig.phrases=t,this.actionPhrasesDropdown=!1},actionLanguageSet(t){this.codemrrConfig.language=t,this.actionLanguageDropdown=!1},actionBgColorSet(t){this.codemrrConfig.backgroundColor=t,this.actionBgColorDropdown=!1},actionThemesSet(t){this.codemrrConfig.theme=t,this.actionThemeDropdown=!1,this.$emit("on-act-theme",t)},actionFullscreenSet(t){this.actionFullscreen=t;let o=this.$refs[this.editorWrapRefID];t?o.classList.add("fullscreen"):o.classList.remove("fullscreen"),this.actionCurrent("fullscreen",t)},actionChooseImage(){const t=document.createElement("input");t.type="file",t.accept="image/*",t.onchange=()=>{const o=t.files;o[0]&&(this.$emit("on-act-choose-image",o[0]),t.value="")},t.click()},actionInsBg(){const t=this.getLastPoint(),o=t.content||!1;o?this.insertContent("=="+o+"=="):(this.insertContent("===="),this.setCursor(t.line,t.ch+1))},actionUndo(){if(this.editorViewInst){const t=this.editorViewInst.state.behavior(L.EditorState.effect(L.EditorState.undo));this.editorViewInst.update([{changes:{from:0,to:t.doc.length,insert:t.doc},selection:L.EditorSelection.single(0)}])}},actionRedo(){this.editorViewInst&&this.editorViewInst.dispatch({...this.editorViewInst.state,effects:L.EditorState.redo()})},actionInsStrong(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="**"+o+"**",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="****",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsItalic(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="*"+o+"*",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="**",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsOverline(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="~~"+o+"~~",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="~~~~",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsUnderline(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="<u>"+o+"</u>",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="<u></u>",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsTitle(t){const o={1:"# ",2:"## ",3:"### ",4:"#### ",5:"##### ",6:"###### "}[t],a=this.getLastPoint(),i=a.content||!1;let l=`
|
|
8
8
|
`+o+`标题
|
|
9
9
|
|
|
10
10
|
`;i?i.startsWith("#")?this.insertContent(a.end+1,l):(l=`
|
|
@@ -30,11 +30,11 @@ row 2 col 1 | row 2 col 2
|
|
|
30
30
|
`,this.insertContent(t.end,o),this.setCursor(t.start+77,t.start+77)},actionInsImage(){const t=this.getLastPoint();let o="";o=`
|
|
31
31
|
|
|
32
32
|
`,this.insertContent(t.end,o),this.setCursor(t.start+48,t.start+48)},actionImportFile(t){const o=t.target.files[0];if(!o)return;const{type:a}=o;if(!["text/markdown","text/src"].includes(a))return;const i=new FileReader;i.readAsText(o,{encoding:"utf-8"}),i.onload=()=>{this.localVal=i.result},i.onerror=l=>{}},actionExportFile(){let t=".text";const o={java:".java",php:".php",css:".css",vue:".vue",go:".go",python:".py",json:".json",javascript:".js",js:".js",html:".html",markdown:".md"};this.language&&o[this.language]&&(t=o[this.language]),Ul(this.localVal,this.lastExpFileName+t)},insertCode(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="\n```text\n"+o+"\n```\n",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="\n```text\n\n```\n",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionSaveSet(){const{localVal:t,codemrrConfig:o,lastHtml:a}=this;this.$emit("on-act-save",{theme:o.theme||"",value:t||"",html:a||""})},actionCopySet(){this.$cvCopy(this.localVal),this.$emit("on-act-copy",this.localVal)},actionHtmlVisible(t){this.actionHtmlText="",this.actionHtmlDiaVisible=!!t},actionHtmlToMD(){const t=this.getLastPoint();let o="";o=`
|
|
33
|
-
`+bn(this.actionHtmlText),this.insertContent(t.end,o),this.setCursor(t.start+o.length,t.start+o.length),this.actionHtmlText="",this.actionHtmlDiaVisible=!1},actionCurrent(t,o){this.$emit("on-action",t,o)},actionCustom(t){this.$emit("on-act-custom",t)}}},Qm={name:"cvEditorCode",mixins:[Rl,te,Qo],emits:["update:modelValue","on-ready"],props:{modelValue:{type:[String,Number],default:""},options:{type:[Object],default:()=>({autoRefresh:!0,autofocus:!1,lineNumbers:!0,tabSize:4,indentUnit:2,line:!0,styleActiveLine:!0})},toolbars:{type:[Object],default:()=>({})},language:{type:[String],default:""},theme:{type:[String],default:"oneDark"},readOnly:{type:[Boolean],default:!1},autoSave:{type:[Boolean],default:!1},width:{type:[Number,String],default:"auto"},height:{type:[Number,String],default:600},bordered:{type:[Boolean],default:!0}},data:()=>({localVal:"",heightMainPx:"",editorWrapRefEL:null}),watch:{localVal(t){this.$emit("update:modelValue",t)},modelValue(t){this.localVal!=t&&(this.localVal=t)},height(t){this.heightMainPx=this.getHeightMainPx()}},computed:{editorWrapRefID(){return this.editorRefID+"wrap"},heightTotalPx(){let t=""+this.height;return t.includes("%")||t.includes("px")?t:t+"px"},widthTotalPx(){let t=""+this.width;return t.includes("px")?t:t+"px"}},created(){this.localVal=this.modelValue,this.codemrrConfig.disabled=this.readOnly||!1},mounted(){this.heightMainPx=this.getHeightMainPx(),this.optionLanguage.includes(this.language)&&(this.codemrrConfig.language=this.language),this.optionTheme.includes(this.theme)&&(this.codemrrConfig.theme=this.theme)},destroyed(){},methods:{getHeightMainPx(){this.editorWrapRefEL=this.$refs[this.editorWrapRefID];const t=this.editorWrapRefEL.querySelector(".cv-editor-code-toolbar").offsetHeight;return t?this.heightTotalPx.includes("%")?`calc(100% - ${t}px - 2px)`:this.heightTotalPx.replace("px","")-t-2+"px":this.heightTotalPx},consoleLog(t,o){},initEditorReady(t){const{container:o,state:a,view:i}=t;this.editorStateInst=a,this.editorViewInst=i,this.listerenEvent(),this.$emit("on-ready")},listerenEvent(){}}},Jm={key:0,class:"cv-editor-code-toolbar","data-title":"头部工具栏"},eu={class:"cv-editor-toolbars"},tu={name:"导入文件",class:"import-file"},ou={name:"保存到本地"},au={key:1,class:"shift-theme",name:"主题"},lu=["onClick"],nu={class:"shift-theme",name:"语言"},iu=["onClick"],ru={class:"icon-svg"},su={key:5,class:"segmentation"},cu=["name"],du={title:"编辑器",class:"cv-editor-code-main"},qt=v(Qm,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("SvgLanguage"),c=e.resolveComponent("SvgCopy"),p=e.resolveComponent("CodemirrorEditor");return e.openBlock(),e.createElementBlock("div",{ref:n.editorWrapRefID,class:e.normalizeClass(["cv-editor-code-wrap cv-editor-vars",a.bordered?"border":""]),style:e.normalizeStyle({width:n.widthTotalPx,height:n.heightTotalPx})},[t.actionPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Jm,[e.createElementVNode("ul",eu,[t.$slots.title?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("li",null,[e.renderSlot(t.$slots,"title")]),o[16]||(o[16]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1))],64)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("li",tu,[e.createElementVNode("span",{class:"iconfont icon-daoru",onClick:o[0]||(o[0]=(...d)=>t.actionImportFile&&t.actionImportFile(...d))}),e.createElementVNode("input",{type:"file",onChange:o[1]||(o[1]=d=>t.actionImportFile(d)),accept:"text/markdown"},null,32)],512),[[e.vShow,t.toolConfig.importmd]]),e.withDirectives(e.createElementVNode("li",ou,[e.createElementVNode("span",{class:"iconfont icon-download",onClick:o[2]||(o[2]=(...d)=>t.actionExportFile&&t.actionExportFile(...d))})],512),[[e.vShow,t.toolConfig.exportmd]]),o[20]||(o[20]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1)),t.toolConfig.theme?(e.openBlock(),e.createElementBlock("li",au,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[3]||(o[3]=d=>t.actionThemeDropdown=!t.actionThemeDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionThemeDropdown}),onMouseleave:o[4]||(o[4]=d=>t.actionThemeDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionTheme,d=>(e.openBlock(),e.createElementBlock("li",{onClick:h=>t.actionThemesSet(d)},e.toDisplayString(d),9,lu))),256))],34)])):e.createCommentVNode("",!0),e.createElementVNode("li",nu,[e.createElementVNode("span",{class:"icon-svg",onClick:o[5]||(o[5]=d=>t.actionLanguageDropdown=!t.actionLanguageDropdown)},[e.createVNode(r)]),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionLanguageDropdown}),onMouseleave:o[6]||(o[6]=d=>t.actionLanguageDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionLanguage,d=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(d==a.language?"active":""),onClick:h=>t.actionLanguageSet(d)},e.toDisplayString(d),11,iu))),256))],34)]),o[21]||(o[21]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.copy?(e.openBlock(),e.createElementBlock("li",{key:2,name:"复制",onClick:o[7]||(o[7]=(...d)=>t.actionCopySet&&t.actionCopySet(...d))},[e.createElementVNode("span",ru,[e.createVNode(c)])])):e.createCommentVNode("",!0),t.toolConfig.clear?(e.openBlock(),e.createElementBlock("li",{key:3,name:"清空",onClick:o[8]||(o[8]=d=>l.localVal="")},[...o[17]||(o[17]=[e.createElementVNode("span",{class:"iconfont icon-clear"},null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",{key:4,name:"保存",onClick:o[9]||(o[9]=(...d)=>t.actionSaveSet&&t.actionSaveSet(...d))},[...o[18]||(o[18]=[e.createElementVNode("span",{class:"iconfont icon-save"},null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",su,[...o[19]||(o[19]=[e.createElementVNode("div",null,null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",{key:6,name:t.actionFullscreen?"退出全屏":"全屏"},[e.withDirectives(e.createElementVNode("span",{onClick:o[10]||(o[10]=d=>t.actionFullscreenSet(!1)),class:"iconfont icon-quite"},null,512),[[e.vShow,t.actionFullscreen]]),e.withDirectives(e.createElementVNode("span",{onClick:o[11]||(o[11]=d=>t.actionFullscreenSet(!0)),class:"iconfont icon-fullscreen"},null,512),[[e.vShow,!t.actionFullscreen]])],8,cu)):e.createCommentVNode("",!0)])])),e.createElementVNode("div",du,[e.createVNode(p,e.mergeProps(t.codemrrBind,{id:t.editorRefID,ref:t.editorRefID,style:{height:l.heightMainPx,backgroundColor:t.codemrrConfig.backgroundColor},extensions:t.extensions,modelValue:l.localVal,"onUpdate:modelValue":o[12]||(o[12]=d=>l.localVal=d),onReady:n.initEditorReady,onChange:o[13]||(o[13]=d=>n.consoleLog("change",d)),onFocus:o[14]||(o[14]=d=>n.consoleLog("focus",d)),onBlur:o[15]||(o[15]=d=>n.consoleLog("blur",d))}),null,16,["id","style","extensions","modelValue","onReady"])])],6)}]]),Xt=v({name:"cvEditorJson",components:{},mixins:[te],props:{modelValue:{type:[Object,Array,Number,String,Boolean],default:""},mode:{type:[String],default:"text"},readOnly:{type:[Boolean],default:!1},options:{type:[Object],default:()=>({mode:"text"})},height:{type:String},plus:{type:Boolean,default:!0}},data:()=>({editorInstance:null,style:{},max:!1,internalChange:!1,localVal:""}),watch:{modelValue:{handler(t){this.localVal!=t&&(this.localVal=t,this.updateVal(t))},deep:!0},max(t){this.$nextTick(()=>{this.initNewCreate()})},options:{handler(t){this.options&&this.options.mode&&this.editorInstance},deep:!0}},computed:{getHeight(){return this.height&&!this.max?{height:this.height}:{}}},async mounted(){this.initNewCreate()},updated(){this.editorInstance.updateProps({mode:this.mode,readOnly:this.readOnly})},beforeUnmount(){this.destroyView()},beforeDestroy(){this.destroyView()},methods:{async initNewCreate(){const{JSONEditor:t}=await import("https://10ui.cn/jsoneditor/vanilla-jsoneditor@0.22.0/standalone.js");this.editorInstance||(this.editorInstance=new t({target:this.$refs[this.editorRefID],props:{value:this.modelValue,mode:this.mode,readOnly:this.readOnly,...this.options,onChange:this.onChange}}),this.updateVal(this.modelValue))},onChange(){let t=null,o={};try{o=this.editorInstance.get()}catch(a){t=a}t?this.$emit("error",t):this.editorInstance&&(this.internalChange=!0,this.localVal=o,this.$emit("update:modelValue",this.localVal),this.$nextTick(()=>{this.internalChange=!1}))},updateVal(t){this.editorInstance&&t!==void 0&&!this.internalChange&&this.editorInstance.update({json:t})},isJSON(t){try{return JSON.parse(t),!0}catch{return!1}},destroyView(){this.editor&&(this.editorInstance.destroy(),this.editor=null)},handleChange(t){this.emitData||(this.emitData=Dl(400,o=>{this.$emit("update:modelValue",o)})),this.emitData(t)}}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-editor-json",{"max-box":l.max,"min-box":!l.max}]),style:e.normalizeStyle(n.getHeight)},[e.createElementVNode("div",{ref:t.editorRefID,class:"jsoneditor-box"},null,512),e.createElementVNode("a",{onClick:o[0]||(o[0]=r=>l.max=!l.max),class:"max-btn"})],6)}]]),pu={class:"cv-editor-upload-container"},hu=["advlist","anchor","autolink","autosave","code","codesample","directionality","emoticons","fullscreen","image","insertdatetime","link","lists","media","nonbreaking","pagebreak","preview","save","searchreplace","table","visualblocks","visualchars","wordcount"],mu=["hr blockquote anchor pagebreak insertdatetime table emoticons | searchreplace preview code codesample | fullscreen | link media image ","inserttemplate undo redo | styles | removeformat subscript superscript forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist indent"];let Q=[];const uu=(t,o)=>{const a=document.getElementById(t),i=o||function(){};if(!a){const l=document.createElement("script");l.src=t,l.id=t,document.body.appendChild(l),Q.push(i),("onload"in l?function(r){r.onload=function(){this.onerror=this.onload=null;for(const c of Q)c(null,r);Q=null},r.onerror=function(){this.onerror=this.onload=null,i(new Error("Failed to load "+t),r)}}:function(r){r.onreadystatechange=function(){if(this.readyState==="complete"||this.readyState==="loaded"){this.onreadystatechange=null;for(const c of Q)c(null,r);Q=null}}})(l)}a&&i&&(window.tinymce?i(null,a):Q.push(i))},gu=["id"],fu={class:"editor-custom-btn-container"},Kt=v({inheritAttrs:!1,name:"cvEditorTinymce",components:{EditorSlideUpload:v({name:"EditorSlideUpload",props:{color:{type:String,default:"#1890ff"},accept:{type:[String],default:"image/jpeg,image/gif,image/png"},upName:{type:[String],default:""},upAction:{type:[String],default:""},upResponseFn:{type:[Function],default:()=>{}},upHeaders:{type:[Object],default:()=>{}},upData:{type:[Object],default:()=>{}}},data:()=>({dialogVisible:!1,listObj:{},fileList:[],diyUpList:new FormData}),methods:{checkAllSuccess(){return Object.keys(this.listObj).every(t=>this.listObj[t].hasSuccess)},handleSubmit(){const t=Object.keys(this.listObj).map(o=>this.listObj[o]);this.checkAllSuccess()?(this.$emit("successCBK",t),this.listObj={},this.fileList=[],this.dialogVisible=!1):this.$message("请等待所有图片上传成功。如果出现网络问题,请刷新页面并重新上传!")},handleSuccess(t,o){const a=o.uid,i=Object.keys(this.listObj);for(let l=0,n=i.length;l<n;l++)if(this.listObj[i[l]].uid===a)return this.upResponseFn&&typeof this.upResponseFn=="function"?this.listObj[i[l]].url=this.upResponseFn(t):this.listObj[i[l]].url=t.files.file||"",void(this.listObj[i[l]].hasSuccess=!0)},handleRemove(t){const o=t.uid,a=Object.keys(this.listObj);for(let i=0,l=a.length;i<l;i++)if(this.listObj[a[i]].uid===o)return void delete this.listObj[a[i]]},beforeUpload(t){const o=this,a=window.URL||window.webkitURL,i=t.uid;return this.listObj[i]={},new Promise((l,n)=>{const r=new Image;r.src=a.createObjectURL(t),r.onload=function(){o.listObj[i]={hasSuccess:!1,uid:t.uid,width:this.width,height:this.height}},l(!0)})}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("el-button"),p=e.resolveComponent("el-upload"),d=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",pu,[e.createVNode(c,{style:e.normalizeStyle({background:a.color,borderColor:a.color,fontSize:"16px"}),type:"primary",onClick:o[0]||(o[0]=h=>l.dialogVisible=!0)},{default:e.withCtx(()=>[e.createVNode(r,{type:"ElIconUpload",size:"16",style:{"margin-right":"5px"}}),o[2]||(o[2]=e.createTextVNode(" 上传 ",-1))]),_:1},8,["style"]),e.createVNode(d,{visible:l.dialogVisible},{default:e.withCtx(()=>[e.createVNode(p,e.mergeProps({class:"editor-slide-upload"},{action:a.upAction,headers:a.upHeaders,data:a.upData,name:a.upName,multiple:!0,showFileList:!0,listType:"picture-card",autoUpload:!0},{"file-list":l.fileList,"on-remove":n.handleRemove,"on-success":n.handleSuccess,"before-upload":n.beforeUpload}),{default:e.withCtx(()=>[e.createVNode(c,{type:"primary"},{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode("点击上传",-1)])]),_:1})]),_:1},16,["file-list","on-remove","on-success","before-upload"]),e.createVNode(c,{onClick:o[1]||(o[1]=h=>l.dialogVisible=!1)},{default:e.withCtx(()=>[...o[4]||(o[4]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(c,{type:"primary",onClick:n.handleSubmit},{default:e.withCtx(()=>[...o[5]||(o[5]=[e.createTextVNode("确定",-1)])]),_:1},8,["onClick"])]),_:1},8,["visible"])])}]])},emits:["update:modelValue"],mixins:[te],props:{modelValue:{type:String,default:""},toolbar:{type:Array,required:!1,default:()=>[]},menubar:{type:String,default:"file edit insert view format table"},height:{type:[Number,String],required:!1,default:360},width:{type:[Number,String],required:!1,default:"100%"},uploadAttr:{type:[Object],default:()=>({})}},data:()=>({localVal:"",fullscreen:!1,languageTypeList:{en:"en",zh:"zh_CN",es:"es_MX",ja:"ja"}}),computed:{containerWidth(){const t=this.width;return/^[\d]+(\.[\d]+)?$/.test(t)?`${t}px`:t}},watch:{modelValue(t){this.localVal!=t&&(this.localVal=t,window.tinymce.get(this.editorRefID).setContent(t||""))}},created(){this.localVal=this.modelValue},mounted(){this.initLoad()},activated(){window.tinymce&&this.initTinymce()},deactivated(){this.destroyTinymce()},destroyed(){this.destroyTinymce()},methods:{initLoad(){uu("https://10ui.cn/tinymce/@7.0.0/tinymce.min.js",t=>{t?this.$message.error(t.message):this.initTinymce()})},initTinymce(){const t=this;window.tinymce.init({selector:`#${this.editorRefID}`,license_key:"gpl",language:this.languageTypeList.zh,height:this.height,body_class:"panel-body ",object_resizing:!1,toolbar:this.toolbar.length>0?this.toolbar:mu,menubar:this.menubar,plugins:hu,end_container_on_empty_block:!0,powerpaste_word_import:"clean",code_dialog_height:450,code_dialog_width:1e3,advlist_bullet_styles:"square",advlist_number_styles:"default",editimage_cors_hosts:["www.tinymce.com","codepen.io"],link_default_target:"_blank",link_title:!1,nonbreaking_force_tab:!0,init_instance_callback:o=>{t.localVal&&o.setContent(t.localVal)},setup(o){o.on("FullscreenStateChanged",a=>{t.fullscreen=a.state}),o.on("input",a=>{t.localVal=o.getContent(),t.$emit("update:modelValue",t.localVal)})},convert_urls:!1,images_upload_handler(o,a,i,l){l(0),new FormData}})},destroyTinymce(){const t=window.tinymce.get(this.editorRefID);this.fullscreen&&t.execCommand("mceFullScreen"),t&&t.destroy()},setContent(t){window.tinymce.get(this.editorRefID).setContent(t)},getContent(){window.tinymce.get(this.editorRefID).getContent()},imageSuccessCBK(t){t.forEach(o=>window.tinymce.get(this.editorRefID).insertContent(`<img class="wscnph" src="${o.url}" >`))}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("EditorSlideUpload");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-editor-tinymce tinymce-container",{fullscreen:l.fullscreen}]),style:e.normalizeStyle({width:n.containerWidth})},[e.createElementVNode("textarea",{id:t.editorRefID,class:"tinymce-textarea"},null,8,gu),e.createElementVNode("div",fu,[e.createVNode(r,e.mergeProps({color:"#1890ff",class:"editor-upload-btn",onSuccessCBK:n.imageSuccessCBK},a.uploadAttr),null,16,["onSuccessCBK"])])],6)}],["__scopeId","data-v-8cbc5d06"]]),Cu={name:"cvEditorMarkdown",mixins:[Rl,te,Qo],emits:["update:modelValue","on-ready","on-upload-image"],props:{modelValue:{type:[String,Number],default:""},options:{type:[Object],default:()=>({})},toolbars:{type:[Object],default:()=>({})},language:{type:[String],default:"markdown"},theme:{type:[String],default:"light"},readOnly:{type:[Boolean],default:!1},autoSave:{type:[Boolean],default:!1},width:{type:[Number,String],default:"auto"},height:{type:[Number,String],default:600},bordered:{type:[Boolean],default:!0}},data:()=>({lastPos:"",lastInsert:"",lastHtml:"",scrollSide:"",localVal:"",heightMainPx:"",editorWrapRefEL:null}),watch:{localVal(t){this.$emit("update:modelValue",t)},modelValue(t){this.localVal!=t&&(this.localVal=t)},height(t){this.heightMainPx=this.getHeightMainPx()}},computed:{editorWrapRefID(){return this.editorRefID+"wrap"},previewRefID(){return this.editorRefID+"preview"},heightTotalPx(){let t=""+this.height;return t.includes("%")||t.includes("px")?t:t+"px"},widthTotalPx(){let t=""+this.width;return t.includes("px")?t:t+"px"}},created(){this.localVal=this.modelValue,this.codemrrConfig.disabled=this.readOnly||!1},mounted(){this.heightMainPx=this.getHeightMainPx()},destroyed(){},methods:{getHeightMainPx(){this.editorWrapRefEL=this.$refs[this.editorWrapRefID];const t=this.editorWrapRefEL.querySelector(".cv-editor-markdown-toolbar").offsetHeight;return t?this.heightTotalPx.includes("%")?`calc(100% - ${t}px - 2px)`:this.heightTotalPx.replace("px","")-t-2+"px":this.heightTotalPx},consoleLog(t,o){},initEditorReady(t){const{container:o,state:a,view:i}=t;this.editorStateInst=a,this.editorViewInst=i,this.listerenEvent(),this.$emit("on-ready")},listerenEvent(){this.editorWrapRefEL=this.$refs[this.editorWrapRefID],this.editorWrapRefEL.querySelector(".cv-editor-markdown-main .cm-scroller").addEventListener("scroll",this.markdownScroll),this.editorWrapRefEL.querySelector(".cv-markdown-preview .markdown-preview").addEventListener("scroll",this.previewScroll)},handlePaste(t,o){const{clipboardData:a={}}=o,{types:i=[],items:l}=a;let n=null;for(let r=0;r<i.length;r++)if(i[r]==="Files"){n=l[r];break}if(n){const r=n.getAsFile();/image/gi.test(r.type)&&(this.$emit("on-upload-image",r),o.preventDefault())}},setCursor(t,o){this.editorViewInst.dispatch({selection:{anchor:t,head:o}}),this.editorViewInst.focus()},GetContent(){const t=this.editorViewState.selection.main.head,o=this.editorViewState.doc.lineAt(t).number,a=this.editorViewState.doc.line(o).text.trim();return a!==""&&a},deleteContent(t,o){this.editorViewInst.dispatch({changes:{from:t,to:o}})},getLastPoint(){const t=this.editorViewInst.state.selection.main.head,o=this.editorViewInst.state.doc.lineAt(t).number,a=this.editorViewInst.state.doc.line(o).from,i=this.editorViewInst.state.doc.line(o).to,l=this.editorViewInst.state.doc.line(o).text;return this.lastPos||{line:o,start:a,end:i,content:l}},insertContent(t,o){this.getLastPoint(),this.editorViewInst.dispatch({changes:{from:t,insert:o}})},listerenKeyupEnter(t){const{lastInsert:o}=this;o&&(["-","- [ ]","- [x]"].includes(o.trim())?(t.preventDefault(),this.insertContent(`
|
|
33
|
+
`+bn(this.actionHtmlText),this.insertContent(t.end,o),this.setCursor(t.start+o.length,t.start+o.length),this.actionHtmlText="",this.actionHtmlDiaVisible=!1},actionCurrent(t,o){this.$emit("on-action",t,o)},actionCustom(t){this.$emit("on-act-custom",t)}}},Zm={name:"cvEditorCode",mixins:[Rl,te,Qo],emits:["update:modelValue","on-ready"],props:{modelValue:{type:[String,Number],default:""},options:{type:[Object],default:()=>({autoRefresh:!0,autofocus:!1,lineNumbers:!0,tabSize:4,indentUnit:2,line:!0,styleActiveLine:!0})},toolbars:{type:[Object],default:()=>({})},language:{type:[String],default:""},theme:{type:[String],default:"oneDark"},readOnly:{type:[Boolean],default:!1},autoSave:{type:[Boolean],default:!1},width:{type:[Number,String],default:"auto"},height:{type:[Number,String],default:600},bordered:{type:[Boolean],default:!0}},data:()=>({localVal:"",heightMainPx:"",editorWrapRefEL:null}),watch:{localVal(t){this.$emit("update:modelValue",t)},modelValue(t){this.localVal!=t&&(this.localVal=t)},height(t){this.heightMainPx=this.getHeightMainPx()}},computed:{editorWrapRefID(){return this.editorRefID+"wrap"},heightTotalPx(){let t=""+this.height;return t.includes("%")||t.includes("px")?t:t+"px"},widthTotalPx(){let t=""+this.width;return t.includes("px")?t:t+"px"}},created(){this.localVal=this.modelValue,this.codemrrConfig.disabled=this.readOnly||!1},mounted(){this.heightMainPx=this.getHeightMainPx(),this.optionLanguage.includes(this.language)&&(this.codemrrConfig.language=this.language),this.optionTheme.includes(this.theme)&&(this.codemrrConfig.theme=this.theme)},destroyed(){},methods:{getHeightMainPx(){this.editorWrapRefEL=this.$refs[this.editorWrapRefID];const t=this.editorWrapRefEL.querySelector(".cv-editor-code-toolbar").offsetHeight;return t?this.heightTotalPx.includes("%")?`calc(100% - ${t}px - 2px)`:this.heightTotalPx.replace("px","")-t-2+"px":this.heightTotalPx},consoleLog(t,o){},initEditorReady(t){const{container:o,state:a,view:i}=t;this.editorStateInst=a,this.editorViewInst=i,this.listerenEvent(),this.$emit("on-ready")},listerenEvent(){}}},Qm={key:0,class:"cv-editor-code-toolbar","data-title":"头部工具栏"},Jm={class:"cv-editor-toolbars"},eu={name:"导入文件",class:"import-file"},tu={name:"保存到本地"},ou={key:1,class:"shift-theme",name:"主题"},au=["onClick"],lu={class:"shift-theme",name:"语言"},nu=["onClick"],iu={class:"icon-svg"},ru={key:5,class:"segmentation"},su=["name"],cu={title:"编辑器",class:"cv-editor-code-main"},Xt=v(Zm,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("SvgLanguage"),c=e.resolveComponent("SvgCopy"),p=e.resolveComponent("CodemirrorEditor");return e.openBlock(),e.createElementBlock("div",{ref:n.editorWrapRefID,class:e.normalizeClass(["cv-editor-code-wrap cv-editor-vars",a.bordered?"border":""]),style:e.normalizeStyle({width:n.widthTotalPx,height:n.heightTotalPx})},[t.actionPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Qm,[e.createElementVNode("ul",Jm,[t.$slots.title?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("li",null,[e.renderSlot(t.$slots,"title")]),o[16]||(o[16]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1))],64)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("li",eu,[e.createElementVNode("span",{class:"iconfont icon-daoru",onClick:o[0]||(o[0]=(...d)=>t.actionImportFile&&t.actionImportFile(...d))}),e.createElementVNode("input",{type:"file",onChange:o[1]||(o[1]=d=>t.actionImportFile(d)),accept:"text/markdown"},null,32)],512),[[e.vShow,t.toolConfig.importmd]]),e.withDirectives(e.createElementVNode("li",tu,[e.createElementVNode("span",{class:"iconfont icon-download",onClick:o[2]||(o[2]=(...d)=>t.actionExportFile&&t.actionExportFile(...d))})],512),[[e.vShow,t.toolConfig.exportmd]]),o[20]||(o[20]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1)),t.toolConfig.theme?(e.openBlock(),e.createElementBlock("li",ou,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[3]||(o[3]=d=>t.actionThemeDropdown=!t.actionThemeDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionThemeDropdown}),onMouseleave:o[4]||(o[4]=d=>t.actionThemeDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionTheme,d=>(e.openBlock(),e.createElementBlock("li",{onClick:h=>t.actionThemesSet(d)},e.toDisplayString(d),9,au))),256))],34)])):e.createCommentVNode("",!0),e.createElementVNode("li",lu,[e.createElementVNode("span",{class:"icon-svg",onClick:o[5]||(o[5]=d=>t.actionLanguageDropdown=!t.actionLanguageDropdown)},[e.createVNode(r)]),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionLanguageDropdown}),onMouseleave:o[6]||(o[6]=d=>t.actionLanguageDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionLanguage,d=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(d==a.language?"active":""),onClick:h=>t.actionLanguageSet(d)},e.toDisplayString(d),11,nu))),256))],34)]),o[21]||(o[21]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.copy?(e.openBlock(),e.createElementBlock("li",{key:2,name:"复制",onClick:o[7]||(o[7]=(...d)=>t.actionCopySet&&t.actionCopySet(...d))},[e.createElementVNode("span",iu,[e.createVNode(c)])])):e.createCommentVNode("",!0),t.toolConfig.clear?(e.openBlock(),e.createElementBlock("li",{key:3,name:"清空",onClick:o[8]||(o[8]=d=>l.localVal="")},[...o[17]||(o[17]=[e.createElementVNode("span",{class:"iconfont icon-clear"},null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",{key:4,name:"保存",onClick:o[9]||(o[9]=(...d)=>t.actionSaveSet&&t.actionSaveSet(...d))},[...o[18]||(o[18]=[e.createElementVNode("span",{class:"iconfont icon-save"},null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",ru,[...o[19]||(o[19]=[e.createElementVNode("div",null,null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",{key:6,name:t.actionFullscreen?"退出全屏":"全屏"},[e.withDirectives(e.createElementVNode("span",{onClick:o[10]||(o[10]=d=>t.actionFullscreenSet(!1)),class:"iconfont icon-quite"},null,512),[[e.vShow,t.actionFullscreen]]),e.withDirectives(e.createElementVNode("span",{onClick:o[11]||(o[11]=d=>t.actionFullscreenSet(!0)),class:"iconfont icon-fullscreen"},null,512),[[e.vShow,!t.actionFullscreen]])],8,su)):e.createCommentVNode("",!0)])])),e.createElementVNode("div",cu,[e.createVNode(p,e.mergeProps(t.codemrrBind,{id:t.editorRefID,ref:t.editorRefID,style:{height:l.heightMainPx,backgroundColor:t.codemrrConfig.backgroundColor},extensions:t.extensions,modelValue:l.localVal,"onUpdate:modelValue":o[12]||(o[12]=d=>l.localVal=d),onReady:n.initEditorReady,onChange:o[13]||(o[13]=d=>n.consoleLog("change",d)),onFocus:o[14]||(o[14]=d=>n.consoleLog("focus",d)),onBlur:o[15]||(o[15]=d=>n.consoleLog("blur",d))}),null,16,["id","style","extensions","modelValue","onReady"])])],6)}]]),Kt=v({name:"cvEditorJson",components:{},mixins:[te],props:{modelValue:{type:[Object,Array,Number,String,Boolean],default:""},mode:{type:[String],default:"text"},readOnly:{type:[Boolean],default:!1},options:{type:[Object],default:()=>({mode:"text"})},height:{type:String},plus:{type:Boolean,default:!0}},data:()=>({editorInstance:null,style:{},max:!1,internalChange:!1,localVal:""}),watch:{modelValue:{handler(t){this.localVal!=t&&(this.localVal=t,this.updateVal(t))},deep:!0},max(t){this.$nextTick(()=>{this.initNewCreate()})},options:{handler(t){this.options&&this.options.mode&&this.editorInstance},deep:!0}},computed:{getHeight(){return this.height&&!this.max?{height:this.height}:{}}},async mounted(){this.initNewCreate()},updated(){this.editorInstance.updateProps({mode:this.mode,readOnly:this.readOnly})},beforeUnmount(){this.destroyView()},beforeDestroy(){this.destroyView()},methods:{async initNewCreate(){const{JSONEditor:t}=await import("https://10ui.cn/jsoneditor/vanilla-jsoneditor@0.22.0/standalone.js");this.editorInstance||(this.editorInstance=new t({target:this.$refs[this.editorRefID],props:{value:this.modelValue,mode:this.mode,readOnly:this.readOnly,...this.options,onChange:this.onChange}}),this.updateVal(this.modelValue))},onChange(){let t=null,o={};try{o=this.editorInstance.get()}catch(a){t=a}t?this.$emit("error",t):this.editorInstance&&(this.internalChange=!0,this.localVal=o,this.$emit("update:modelValue",this.localVal),this.$nextTick(()=>{this.internalChange=!1}))},updateVal(t){this.editorInstance&&t!==void 0&&!this.internalChange&&this.editorInstance.update({json:t})},isJSON(t){try{return JSON.parse(t),!0}catch{return!1}},destroyView(){this.editor&&(this.editorInstance.destroy(),this.editor=null)},handleChange(t){this.emitData||(this.emitData=Dl(400,o=>{this.$emit("update:modelValue",o)})),this.emitData(t)}}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-editor-json",{"max-box":l.max,"min-box":!l.max}]),style:e.normalizeStyle(n.getHeight)},[e.createElementVNode("div",{ref:t.editorRefID,class:"jsoneditor-box"},null,512),e.createElementVNode("a",{onClick:o[0]||(o[0]=r=>l.max=!l.max),class:"max-btn"})],6)}]]),du={class:"cv-editor-upload-container"},pu=["advlist","anchor","autolink","autosave","code","codesample","directionality","emoticons","fullscreen","image","insertdatetime","link","lists","media","nonbreaking","pagebreak","preview","save","searchreplace","table","visualblocks","visualchars","wordcount"],hu=["hr blockquote anchor pagebreak insertdatetime table emoticons | searchreplace preview code codesample | fullscreen | link media image ","inserttemplate undo redo | styles | removeformat subscript superscript forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist indent"];let Q=[];const mu=(t,o)=>{const a=document.getElementById(t),i=o||function(){};if(!a){const l=document.createElement("script");l.src=t,l.id=t,document.body.appendChild(l),Q.push(i),("onload"in l?function(r){r.onload=function(){this.onerror=this.onload=null;for(const c of Q)c(null,r);Q=null},r.onerror=function(){this.onerror=this.onload=null,i(new Error("Failed to load "+t),r)}}:function(r){r.onreadystatechange=function(){if(this.readyState==="complete"||this.readyState==="loaded"){this.onreadystatechange=null;for(const c of Q)c(null,r);Q=null}}})(l)}a&&i&&(window.tinymce?i(null,a):Q.push(i))},uu=["id"],gu={class:"editor-custom-btn-container"},Gt=v({inheritAttrs:!1,name:"cvEditorTinymce",components:{EditorSlideUpload:v({name:"EditorSlideUpload",props:{color:{type:String,default:"#1890ff"},accept:{type:[String],default:"image/jpeg,image/gif,image/png"},upName:{type:[String],default:""},upAction:{type:[String],default:""},upResponseFn:{type:[Function],default:()=>{}},upHeaders:{type:[Object],default:()=>{}},upData:{type:[Object],default:()=>{}}},data:()=>({dialogVisible:!1,listObj:{},fileList:[],diyUpList:new FormData}),methods:{checkAllSuccess(){return Object.keys(this.listObj).every(t=>this.listObj[t].hasSuccess)},handleSubmit(){const t=Object.keys(this.listObj).map(o=>this.listObj[o]);this.checkAllSuccess()?(this.$emit("successCBK",t),this.listObj={},this.fileList=[],this.dialogVisible=!1):this.$message("请等待所有图片上传成功。如果出现网络问题,请刷新页面并重新上传!")},handleSuccess(t,o){const a=o.uid,i=Object.keys(this.listObj);for(let l=0,n=i.length;l<n;l++)if(this.listObj[i[l]].uid===a)return this.upResponseFn&&typeof this.upResponseFn=="function"?this.listObj[i[l]].url=this.upResponseFn(t):this.listObj[i[l]].url=t.files.file||"",void(this.listObj[i[l]].hasSuccess=!0)},handleRemove(t){const o=t.uid,a=Object.keys(this.listObj);for(let i=0,l=a.length;i<l;i++)if(this.listObj[a[i]].uid===o)return void delete this.listObj[a[i]]},beforeUpload(t){const o=this,a=window.URL||window.webkitURL,i=t.uid;return this.listObj[i]={},new Promise((l,n)=>{const r=new Image;r.src=a.createObjectURL(t),r.onload=function(){o.listObj[i]={hasSuccess:!1,uid:t.uid,width:this.width,height:this.height}},l(!0)})}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("el-button"),p=e.resolveComponent("el-upload"),d=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",du,[e.createVNode(c,{style:e.normalizeStyle({background:a.color,borderColor:a.color,fontSize:"16px"}),type:"primary",onClick:o[0]||(o[0]=h=>l.dialogVisible=!0)},{default:e.withCtx(()=>[e.createVNode(r,{type:"ElIconUpload",size:"16",style:{"margin-right":"5px"}}),o[2]||(o[2]=e.createTextVNode(" 上传 ",-1))]),_:1},8,["style"]),e.createVNode(d,{visible:l.dialogVisible},{default:e.withCtx(()=>[e.createVNode(p,e.mergeProps({class:"editor-slide-upload"},{action:a.upAction,headers:a.upHeaders,data:a.upData,name:a.upName,multiple:!0,showFileList:!0,listType:"picture-card",autoUpload:!0},{"file-list":l.fileList,"on-remove":n.handleRemove,"on-success":n.handleSuccess,"before-upload":n.beforeUpload}),{default:e.withCtx(()=>[e.createVNode(c,{type:"primary"},{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode("点击上传",-1)])]),_:1})]),_:1},16,["file-list","on-remove","on-success","before-upload"]),e.createVNode(c,{onClick:o[1]||(o[1]=h=>l.dialogVisible=!1)},{default:e.withCtx(()=>[...o[4]||(o[4]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(c,{type:"primary",onClick:n.handleSubmit},{default:e.withCtx(()=>[...o[5]||(o[5]=[e.createTextVNode("确定",-1)])]),_:1},8,["onClick"])]),_:1},8,["visible"])])}]])},emits:["update:modelValue"],mixins:[te],props:{modelValue:{type:String,default:""},toolbar:{type:Array,required:!1,default:()=>[]},menubar:{type:String,default:"file edit insert view format table"},height:{type:[Number,String],required:!1,default:360},width:{type:[Number,String],required:!1,default:"100%"},uploadAttr:{type:[Object],default:()=>({})}},data:()=>({localVal:"",fullscreen:!1,languageTypeList:{en:"en",zh:"zh_CN",es:"es_MX",ja:"ja"}}),computed:{containerWidth(){const t=this.width;return/^[\d]+(\.[\d]+)?$/.test(t)?`${t}px`:t}},watch:{modelValue(t){this.localVal!=t&&(this.localVal=t,window.tinymce.get(this.editorRefID).setContent(t||""))}},created(){this.localVal=this.modelValue},mounted(){this.initLoad()},activated(){window.tinymce&&this.initTinymce()},deactivated(){this.destroyTinymce()},destroyed(){this.destroyTinymce()},methods:{initLoad(){mu("https://10ui.cn/tinymce/@7.0.0/tinymce.min.js",t=>{t?this.$message.error(t.message):this.initTinymce()})},initTinymce(){const t=this;window.tinymce.init({selector:`#${this.editorRefID}`,license_key:"gpl",language:this.languageTypeList.zh,height:this.height,body_class:"panel-body ",object_resizing:!1,toolbar:this.toolbar.length>0?this.toolbar:hu,menubar:this.menubar,plugins:pu,end_container_on_empty_block:!0,powerpaste_word_import:"clean",code_dialog_height:450,code_dialog_width:1e3,advlist_bullet_styles:"square",advlist_number_styles:"default",editimage_cors_hosts:["www.tinymce.com","codepen.io"],link_default_target:"_blank",link_title:!1,nonbreaking_force_tab:!0,init_instance_callback:o=>{t.localVal&&o.setContent(t.localVal)},setup(o){o.on("FullscreenStateChanged",a=>{t.fullscreen=a.state}),o.on("input",a=>{t.localVal=o.getContent(),t.$emit("update:modelValue",t.localVal)})},convert_urls:!1,images_upload_handler(o,a,i,l){l(0),new FormData}})},destroyTinymce(){const t=window.tinymce.get(this.editorRefID);this.fullscreen&&t.execCommand("mceFullScreen"),t&&t.destroy()},setContent(t){window.tinymce.get(this.editorRefID).setContent(t)},getContent(){window.tinymce.get(this.editorRefID).getContent()},imageSuccessCBK(t){t.forEach(o=>window.tinymce.get(this.editorRefID).insertContent(`<img class="wscnph" src="${o.url}" >`))}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("EditorSlideUpload");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-editor-tinymce tinymce-container",{fullscreen:l.fullscreen}]),style:e.normalizeStyle({width:n.containerWidth})},[e.createElementVNode("textarea",{id:t.editorRefID,class:"tinymce-textarea"},null,8,uu),e.createElementVNode("div",gu,[e.createVNode(r,e.mergeProps({color:"#1890ff",class:"editor-upload-btn",onSuccessCBK:n.imageSuccessCBK},a.uploadAttr),null,16,["onSuccessCBK"])])],6)}],["__scopeId","data-v-8cbc5d06"]]),fu={name:"cvEditorMarkdown",mixins:[Rl,te,Qo],emits:["update:modelValue","on-ready","on-upload-image"],props:{modelValue:{type:[String,Number],default:""},options:{type:[Object],default:()=>({})},toolbars:{type:[Object],default:()=>({})},language:{type:[String],default:"markdown"},theme:{type:[String],default:"light"},readOnly:{type:[Boolean],default:!1},autoSave:{type:[Boolean],default:!1},width:{type:[Number,String],default:"auto"},height:{type:[Number,String],default:600},bordered:{type:[Boolean],default:!0}},data:()=>({lastPos:"",lastInsert:"",lastHtml:"",scrollSide:"",localVal:"",heightMainPx:"",editorWrapRefEL:null}),watch:{localVal(t){this.$emit("update:modelValue",t)},modelValue(t){this.localVal!=t&&(this.localVal=t)},height(t){this.heightMainPx=this.getHeightMainPx()}},computed:{editorWrapRefID(){return this.editorRefID+"wrap"},previewRefID(){return this.editorRefID+"preview"},heightTotalPx(){let t=""+this.height;return t.includes("%")||t.includes("px")?t:t+"px"},widthTotalPx(){let t=""+this.width;return t.includes("px")?t:t+"px"}},created(){this.localVal=this.modelValue,this.codemrrConfig.disabled=this.readOnly||!1},mounted(){this.heightMainPx=this.getHeightMainPx()},destroyed(){},methods:{getHeightMainPx(){this.editorWrapRefEL=this.$refs[this.editorWrapRefID];const t=this.editorWrapRefEL.querySelector(".cv-editor-markdown-toolbar").offsetHeight;return t?this.heightTotalPx.includes("%")?`calc(100% - ${t}px - 2px)`:this.heightTotalPx.replace("px","")-t-2+"px":this.heightTotalPx},consoleLog(t,o){},initEditorReady(t){const{container:o,state:a,view:i}=t;this.editorStateInst=a,this.editorViewInst=i,this.listerenEvent(),this.$emit("on-ready")},listerenEvent(){this.editorWrapRefEL=this.$refs[this.editorWrapRefID],this.editorWrapRefEL.querySelector(".cv-editor-markdown-main .cm-scroller").addEventListener("scroll",this.markdownScroll),this.editorWrapRefEL.querySelector(".cv-markdown-preview .markdown-preview").addEventListener("scroll",this.previewScroll)},handlePaste(t,o){const{clipboardData:a={}}=o,{types:i=[],items:l}=a;let n=null;for(let r=0;r<i.length;r++)if(i[r]==="Files"){n=l[r];break}if(n){const r=n.getAsFile();/image/gi.test(r.type)&&(this.$emit("on-upload-image",r),o.preventDefault())}},setCursor(t,o){this.editorViewInst.dispatch({selection:{anchor:t,head:o}}),this.editorViewInst.focus()},GetContent(){const t=this.editorViewState.selection.main.head,o=this.editorViewState.doc.lineAt(t).number,a=this.editorViewState.doc.line(o).text.trim();return a!==""&&a},deleteContent(t,o){this.editorViewInst.dispatch({changes:{from:t,to:o}})},getLastPoint(){const t=this.editorViewInst.state.selection.main.head,o=this.editorViewInst.state.doc.lineAt(t).number,a=this.editorViewInst.state.doc.line(o).from,i=this.editorViewInst.state.doc.line(o).to,l=this.editorViewInst.state.doc.line(o).text;return this.lastPos||{line:o,start:a,end:i,content:l}},insertContent(t,o){this.getLastPoint(),this.editorViewInst.dispatch({changes:{from:t,insert:o}})},listerenKeyupEnter(t){const{lastInsert:o}=this;o&&(["-","- [ ]","- [x]"].includes(o.trim())?(t.preventDefault(),this.insertContent(`
|
|
34
34
|
`+o)):/^\d+\.$/.test(o.trim())&&(t.preventDefault(),this.insertContent(`
|
|
35
35
|
`+(parseInt(o,0)+1)+". ")))},listerenDelete(){setTimeout(()=>{const{editorViewInst:t}=this;t.isClean()||t.getValue().split(`
|
|
36
|
-
`).pop()===""&&(this.lastInsert="")},20)},mousescrollSide(t){this.scrollSide=t},getScrollData(){const t=this.editorWrapRefEL.querySelector(".cv-editor-markdown-main .cm-scroller"),o=t.scrollHeight,a=t.scrollTop,i=this.editorWrapRefEL.querySelector(".cv-markdown-preview .markdown-preview");return{markdownRef:t,markdownScrollHeight:o,markdownScrollTop:a,previewRef:i,contentHeight:i.offsetHeight,previewScrollHeight:i.scrollHeight,previewScrollTop:i.scrollTop||0}},markdownScroll(){if(this.actionScrollSync&&this.scrollSide==="left"){const{markdownRef:t,markdownScrollHeight:o,markdownScrollTop:a,previewRef:i,contentHeight:l,previewScrollHeight:n,previewScrollTop:r}=this.getScrollData();i.scrollTop=parseInt(a/(o-l)*(n-l),0)}},previewScroll(){if(this.actionScrollSync&&this.scrollSide==="right"){const{markdownRef:t,markdownScrollHeight:o,markdownScrollTop:a,previewRef:i,contentHeight:l,previewScrollHeight:n,previewScrollTop:r}=this.getScrollData(),c=parseInt(r/(n-l)*(o-l),0);t.scrollTop=c}}}},vu={key:0,class:"cv-editor-markdown-toolbar","data-title":"头部工具栏"},yu={class:"cv-editor-toolbars"},ku={key:1,name:"插入图片"},bu={key:2,name:"本地图片"},wu={class:"icon-svg"},Vu={key:4,name:"上传图片"},xu={key:5,name:"上传文件"},Su={name:"导入文件",class:"import-file"},Nu={name:"保存到本地"},Bu={key:6,name:"代码块"},Eu={key:7,class:"shift-theme",name:"主题"},Du=["onClick"],Tu={key:8,class:"shift-theme",name:"背景颜色"},_u=["onClick"],Iu={key:9,class:"shift-theme",name:"phrases"},Lu=["onClick"],Fu=["name"],$u=["name"],Ou=["name"],Mu=["name"],zu={key:15,name:"全屏编辑"},Pu={key:16,name:"分屏显示"},Hu={key:17,name:"预览"},Au={key:18,class:"segmentation"},ju={class:"icon-svg"},Ru={key:22,class:"segmentation"},Uu={key:23,name:"目录"},Wu={key:24,class:"segmentation"},Yu=["name"],qu={class:"cv-editor-toolbars"},Xu={key:0,name:"撤销"},Ku={key:2,name:"粗体"},Gu={key:3,name:"斜体"},Zu={key:4,name:"删除线"},Qu={key:5,name:"下划线"},Ju={key:6,name:"标题1"},eg={key:7,name:"标题2"},tg={key:8,name:"标题3"},og={key:9,name:"标题4"},ag={key:10,name:"标题5"},lg={key:11,name:"标题6"},ng={key:12,name:"分割线"},ig={key:13,name:"引用"},rg={key:14,name:"无序列表"},sg={key:15,name:"有序列表"},cg={key:16,name:"未完成列表"},dg={key:17,name:"已完成列表"},pg={key:18,name:"链接"},hg={key:19,name:"表格"},Gt=v(Cu,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("SvgImgMap"),c=e.resolveComponent("SvgUploadFile"),p=e.resolveComponent("SvgCopy"),d=e.resolveComponent("SvgToc"),h=e.resolveComponent("CodemirrorEditor"),u=e.resolveComponent("cv-markdown-show"),m=e.resolveComponent("el-input"),f=e.resolveComponent("el-button"),C=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",{ref:n.editorWrapRefID,class:e.normalizeClass(["cv-editor-markdown-wrap",a.bordered?"border":""]),style:e.normalizeStyle({width:n.widthTotalPx,height:n.heightTotalPx})},[t.actionPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",vu,[e.createElementVNode("ul",yu,[t.$slots.title?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("li",null,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),o[65]||(o[65]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1))],64)):e.createCommentVNode("",!0),t.toolConfig.image?(e.openBlock(),e.createElementBlock("li",ku,[e.createElementVNode("span",{onClick:o[0]||(o[0]=(...g)=>t.actionInsImage&&t.actionInsImage(...g)),class:"iconfont icon-img"})])):e.createCommentVNode("",!0),t.toolConfig.uploadImage?(e.openBlock(),e.createElementBlock("li",bu,[e.createElementVNode("span",{onClick:o[1]||(o[1]=(...g)=>t.actionChooseImage&&t.actionChooseImage(...g)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_image?(e.openBlock(),e.createElementBlock("li",{key:3,name:"图片空间",onClick:o[2]||(o[2]=g=>t.actionCustom("image-browse"))},[e.createElementVNode("span",wu,[e.createVNode(r)])])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadImage?(e.openBlock(),e.createElementBlock("li",Vu,[e.createElementVNode("span",{onClick:o[3]||(o[3]=g=>t.actionCustom("image-upload")),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadFile?(e.openBlock(),e.createElementBlock("li",xu,[e.createElementVNode("span",{onClick:o[4]||(o[4]=g=>t.actionCustom("file-upload")),class:"icon-svg"},[e.createVNode(c)])])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("li",Su,[e.createElementVNode("span",{class:"iconfont icon-daoru",onClick:o[5]||(o[5]=(...g)=>t.actionImportFile&&t.actionImportFile(...g))}),e.createElementVNode("input",{type:"file",onChange:o[6]||(o[6]=g=>t.actionImportFile(g)),accept:"text/markdown"},null,32)],512),[[e.vShow,t.toolConfig.importmd]]),e.withDirectives(e.createElementVNode("li",Nu,[e.createElementVNode("span",{class:"iconfont icon-download",onClick:o[7]||(o[7]=(...g)=>t.actionExportFile&&t.actionExportFile(...g))})],512),[[e.vShow,t.toolConfig.exportmd]]),o[72]||(o[72]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1)),t.toolConfig.code?(e.openBlock(),e.createElementBlock("li",Bu,[e.createElementVNode("span",{onClick:o[8]||(o[8]=(...g)=>t.insertCode&&t.insertCode(...g)),class:"iconfont icon-code"})])):e.createCommentVNode("",!0),t.toolConfig.theme?(e.openBlock(),e.createElementBlock("li",Eu,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[9]||(o[9]=g=>t.actionThemeDropdown=!t.actionThemeDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionThemeDropdown}),onMouseleave:o[10]||(o[10]=g=>t.actionThemeDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionTheme,g=>(e.openBlock(),e.createElementBlock("li",{onClick:y=>t.actionThemesSet(g)},e.toDisplayString(g),9,Du))),256))],34)])):e.createCommentVNode("",!0),t.toolConfig.backgroundColor?(e.openBlock(),e.createElementBlock("li",Tu,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[11]||(o[11]=g=>t.actionBgColorDropdown=!t.actionBgColorDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionBgColorDropdown}),onMouseleave:o[12]||(o[12]=g=>t.actionBgColorDropdown=!1)},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["red","black","yellow","lawngreen","blue","white"],g=>e.createElementVNode("li",{onClick:y=>t.actionBgColorSet(g)},e.toDisplayString(g),9,_u)),64))],34)])):e.createCommentVNode("",!0),t.toolConfig.phrases?(e.openBlock(),e.createElementBlock("li",Iu,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[13]||(o[13]=g=>t.actionPhrasesDropdown=!t.actionPhrasesDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionPhrasesDropdown}),onMouseleave:o[14]||(o[14]=g=>t.actionPhrasesDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionPhrases,g=>(e.openBlock(),e.createElementBlock("li",{onClick:y=>t.actionPhrasesSet(g)},e.toDisplayString(g),9,Lu))),256))],34)])):e.createCommentVNode("",!0),t.toolConfig.html_to_markdown?(e.openBlock(),e.createElementBlock("li",{key:10,name:"html转markdown",onClick:o[15]||(o[15]=g=>t.actionHtmlVisible(!0))},[...o[66]||(o[66]=[e.createElementVNode("span",{style:{width:"auto","font-size":"12px !important",padding:"0px 6px",margin:"0 10px",border:"1px #e2e2e2 solid"}}," HTML2MD ",-1)])])):e.createCommentVNode("",!0),t.toolConfig.disabled?(e.openBlock(),e.createElementBlock("li",{key:11,name:t.codemrrConfig.disabled?"toggle disabled:开":"toggle disabled:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[16]||(o[16]=g=>t.codemrrConfig.disabled=!t.codemrrConfig.disabled),class:"iconfont icon-on"},null,512),[[e.vShow,t.codemrrConfig.disabled]]),e.withDirectives(e.createElementVNode("span",{onClick:o[17]||(o[17]=g=>t.codemrrConfig.disabled=!t.codemrrConfig.disabled),class:"iconfont icon-off"},null,512),[[e.vShow,!t.codemrrConfig.disabled]])],8,Fu)):e.createCommentVNode("",!0),t.toolConfig.autofocus?(e.openBlock(),e.createElementBlock("li",{key:12,name:t.codemrrConfig.autofocus?"toggle autofocus:开":"toggle autofocus:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[18]||(o[18]=g=>t.codemrrConfig.autofocus=!t.codemrrConfig.autofocus),class:"iconfont icon-on"},null,512),[[e.vShow,t.codemrrConfig.autofocus]]),e.withDirectives(e.createElementVNode("span",{onClick:o[19]||(o[19]=g=>t.codemrrConfig.autofocus=!t.codemrrConfig.autofocus),class:"iconfont icon-off"},null,512),[[e.vShow,!t.codemrrConfig.autofocus]])],8,$u)):e.createCommentVNode("",!0),t.toolConfig.indentWithTab?(e.openBlock(),e.createElementBlock("li",{key:13,name:t.codemrrConfig.indentWithTab?"toggle indentWithTab:开":"toggle indentWithTab:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[20]||(o[20]=g=>t.codemrrConfig.indentWithTab=!t.codemrrConfig.indentWithTab),class:"iconfont icon-on"},null,512),[[e.vShow,t.codemrrConfig.indentWithTab]]),e.withDirectives(e.createElementVNode("span",{onClick:o[21]||(o[21]=g=>t.codemrrConfig.indentWithTab=!t.codemrrConfig.indentWithTab),class:"iconfont icon-off"},null,512),[[e.vShow,!t.codemrrConfig.indentWithTab]])],8,Ou)):e.createCommentVNode("",!0),o[73]||(o[73]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.scrollSync?(e.openBlock(),e.createElementBlock("li",{key:14,name:t.actionScrollSync?"同步滚动:开":"同步滚动:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[22]||(o[22]=g=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-on active"},null,512),[[e.vShow,t.actionScrollSync]]),e.withDirectives(e.createElementVNode("span",{onClick:o[23]||(o[23]=g=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-off"},null,512),[[e.vShow,!t.actionScrollSync]])],8,Mu)):e.createCommentVNode("",!0),t.toolConfig.split&&t.actionSplit?(e.openBlock(),e.createElementBlock("li",zu,[e.createElementVNode("span",{onClick:o[24]||(o[24]=g=>t.actionSplit=!1),class:"iconfont icon-md"})])):e.createCommentVNode("",!0),t.toolConfig.split&&!t.actionSplit?(e.openBlock(),e.createElementBlock("li",Pu,[e.createElementVNode("span",{onClick:o[25]||(o[25]=g=>t.actionSplit=!0),class:"iconfont icon-group"})])):e.createCommentVNode("",!0),t.toolConfig.preview?(e.openBlock(),e.createElementBlock("li",Hu,[e.createElementVNode("span",{onClick:o[26]||(o[26]=g=>t.actionPreview=!0),class:"iconfont icon-preview"})])):e.createCommentVNode("",!0),t.toolConfig.copy||t.toolConfig.clear||t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",Au,[...o[67]||(o[67]=[e.createElementVNode("div",null,null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.copy?(e.openBlock(),e.createElementBlock("li",{key:19,name:"复制",onClick:o[27]||(o[27]=(...g)=>t.actionCopySet&&t.actionCopySet(...g))},[e.createElementVNode("span",ju,[e.createVNode(p)])])):e.createCommentVNode("",!0),t.toolConfig.clear?(e.openBlock(),e.createElementBlock("li",{key:20,name:"清空",onClick:o[28]||(o[28]=g=>l.localVal="")},[...o[68]||(o[68]=[e.createElementVNode("span",{class:"iconfont icon-clear"},null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",{key:21,name:"保存",onClick:o[29]||(o[29]=(...g)=>t.actionSaveSet&&t.actionSaveSet(...g))},[...o[69]||(o[69]=[e.createElementVNode("span",{class:"iconfont icon-save"},null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.toc?(e.openBlock(),e.createElementBlock("li",Ru,[...o[70]||(o[70]=[e.createElementVNode("div",null,null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.toc?(e.openBlock(),e.createElementBlock("li",Uu,[e.withDirectives(e.createElementVNode("span",{onClick:o[30]||(o[30]=g=>t.actionToc=!t.actionToc),class:"icon-svg active"},[e.createVNode(d)],512),[[e.vShow,t.actionToc]]),e.withDirectives(e.createElementVNode("span",{onClick:o[31]||(o[31]=g=>t.actionToc=!t.actionToc),class:"icon-svg"},[e.createVNode(d)],512),[[e.vShow,!t.actionToc]])])):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",Wu,[...o[71]||(o[71]=[e.createElementVNode("div",null,null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",{key:25,name:t.actionFullscreen?"退出全屏":"全屏"},[e.withDirectives(e.createElementVNode("span",{onClick:o[32]||(o[32]=g=>t.actionFullscreenSet(!1)),class:"iconfont icon-quite"},null,512),[[e.vShow,t.actionFullscreen]]),e.withDirectives(e.createElementVNode("span",{onClick:o[33]||(o[33]=g=>t.actionFullscreenSet(!0)),class:"iconfont icon-fullscreen"},null,512),[[e.vShow,!t.actionFullscreen]])],8,Yu)):e.createCommentVNode("",!0)]),e.createElementVNode("ul",qu,[t.toolConfig.undo?(e.openBlock(),e.createElementBlock("li",Xu,[e.createElementVNode("span",{class:"iconfont icon-undo",onClick:o[34]||(o[34]=(...g)=>t.actionUndo&&t.actionUndo(...g))})])):e.createCommentVNode("",!0),t.toolConfig.redo?(e.openBlock(),e.createElementBlock("li",{key:1,name:"重做",onClick:o[35]||(o[35]=(...g)=>t.actionRedo&&t.actionRedo(...g))},[...o[74]||(o[74]=[e.createElementVNode("span",{class:"iconfont icon-redo"},null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.strong?(e.openBlock(),e.createElementBlock("li",Ku,[e.createElementVNode("span",{onClick:o[36]||(o[36]=(...g)=>t.actionInsStrong&&t.actionInsStrong(...g)),class:"iconfont icon-bold"})])):e.createCommentVNode("",!0),t.toolConfig.italic?(e.openBlock(),e.createElementBlock("li",Gu,[e.createElementVNode("span",{onClick:o[37]||(o[37]=(...g)=>t.actionInsItalic&&t.actionInsItalic(...g)),class:"iconfont icon-italic"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",Zu,[e.createElementVNode("span",{onClick:o[38]||(o[38]=(...g)=>t.actionInsOverline&&t.actionInsOverline(...g)),class:"iconfont icon-overline"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",Qu,[e.createElementVNode("span",{onClick:o[39]||(o[39]=(...g)=>t.actionInsUnderline&&t.actionInsUnderline(...g)),class:"iconfont icon-under-line"})])):e.createCommentVNode("",!0),t.toolConfig.h1?(e.openBlock(),e.createElementBlock("li",Ju,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[40]||(o[40]=g=>t.actionInsTitle(1))},"h1")])):e.createCommentVNode("",!0),t.toolConfig.h2?(e.openBlock(),e.createElementBlock("li",eg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[41]||(o[41]=g=>t.actionInsTitle(2))},"h2")])):e.createCommentVNode("",!0),t.toolConfig.h3?(e.openBlock(),e.createElementBlock("li",tg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[42]||(o[42]=g=>t.actionInsTitle(3))},"h3")])):e.createCommentVNode("",!0),t.toolConfig.h4?(e.openBlock(),e.createElementBlock("li",og,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[43]||(o[43]=g=>t.actionInsTitle(4))},"h4")])):e.createCommentVNode("",!0),t.toolConfig.h5?(e.openBlock(),e.createElementBlock("li",ag,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[44]||(o[44]=g=>t.actionInsTitle(5))},"h5")])):e.createCommentVNode("",!0),t.toolConfig.h6?(e.openBlock(),e.createElementBlock("li",lg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[45]||(o[45]=g=>t.actionInsTitle(6))},"h6")])):e.createCommentVNode("",!0),t.toolConfig.hr?(e.openBlock(),e.createElementBlock("li",ng,[e.createElementVNode("span",{onClick:o[46]||(o[46]=(...g)=>t.actionInsLine&&t.actionInsLine(...g)),class:"iconfont icon-horizontal"})])):e.createCommentVNode("",!0),t.toolConfig.quote?(e.openBlock(),e.createElementBlock("li",ig,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[47]||(o[47]=(...g)=>t.actionInsQuote&&t.actionInsQuote(...g)),class:"iconfont icon-quote"})])):e.createCommentVNode("",!0),t.toolConfig.ul?(e.openBlock(),e.createElementBlock("li",rg,[e.createElementVNode("span",{onClick:o[48]||(o[48]=(...g)=>t.actionInsUl&&t.actionInsUl(...g)),class:"iconfont icon-ul"})])):e.createCommentVNode("",!0),t.toolConfig.ol?(e.openBlock(),e.createElementBlock("li",sg,[e.createElementVNode("span",{onClick:o[49]||(o[49]=(...g)=>t.actionInsOl&&t.actionInsOl(...g)),class:"iconfont icon-ol"})])):e.createCommentVNode("",!0),t.toolConfig.notChecked?(e.openBlock(),e.createElementBlock("li",cg,[e.createElementVNode("span",{onClick:o[50]||(o[50]=(...g)=>t.insertNotFinished&&t.insertNotFinished(...g)),class:"iconfont icon-checked-false"})])):e.createCommentVNode("",!0),t.toolConfig.checked?(e.openBlock(),e.createElementBlock("li",dg,[e.createElementVNode("span",{onClick:o[51]||(o[51]=(...g)=>t.insertFinished&&t.insertFinished(...g)),class:"iconfont icon-checked"})])):e.createCommentVNode("",!0),t.toolConfig.link?(e.openBlock(),e.createElementBlock("li",pg,[e.createElementVNode("span",{onClick:o[52]||(o[52]=(...g)=>t.actionInsLink&&t.actionInsLink(...g)),class:"iconfont icon-link"})])):e.createCommentVNode("",!0),t.toolConfig.table?(e.openBlock(),e.createElementBlock("li",hg,[e.createElementVNode("span",{onClick:o[53]||(o[53]=(...g)=>t.actionInsTable&&t.actionInsTable(...g)),class:"iconfont icon-table"})])):e.createCommentVNode("",!0)])])),e.createElementVNode("div",{title:"编辑器",class:"cv-editor-markdown-main",style:e.normalizeStyle({background:t.actionPreview?"#fff":""})},[e.withDirectives(e.createVNode(h,e.mergeProps(t.codemrrBind,{id:t.editorRefID,ref:t.editorRefID,style:{height:l.heightMainPx,backgroundColor:t.codemrrConfig.backgroundColor},extensions:t.extensions,modelValue:l.localVal,"onUpdate:modelValue":o[54]||(o[54]=g=>l.localVal=g),onReady:n.initEditorReady,onChange:o[55]||(o[55]=g=>n.consoleLog("change",g)),onFocus:o[56]||(o[56]=g=>n.consoleLog("focus",g)),onBlur:o[57]||(o[57]=g=>n.consoleLog("blur",g)),onMouseenter:o[58]||(o[58]=g=>n.mousescrollSide("left"))}),null,16,["id","style","extensions","modelValue","onReady"]),[[e.vShow,!t.actionPreview]]),e.withDirectives(e.createVNode(u,{html:l.lastHtml,"onUpdate:html":o[59]||(o[59]=g=>l.lastHtml=g),ref:n.previewRefID,editorID:n.previewRefID,modelValue:l.localVal,theme:t.codemrrConfig.theme||a.theme,language:a.language,tocShow:t.actionToc,style:e.normalizeStyle([{flex:"1",height:"100%","border-left":"1px solid #dedede","overflow-y":"auto"},{height:t.actionPreview?"":l.heightMainPx}]),onMouseenter:o[60]||(o[60]=g=>n.mousescrollSide("right"))},null,8,["html","editorID","modelValue","theme","language","tocShow","style"]),[[e.vShow,t.actionPreview?t.actionPreview:t.actionSplit]])],4),e.withDirectives(e.createElementVNode("div",{title:"关闭预览按钮",class:"close-preview",onClick:o[61]||(o[61]=g=>t.actionPreview=!1)},[...o[75]||(o[75]=[e.createElementVNode("span",{class:"iconfont icon-close"},null,-1)])],512),[[e.vShow,t.actionPreview]]),e.createVNode(C,{modelValue:t.actionHtmlDiaVisible,"onUpdate:modelValue":o[64]||(o[64]=g=>t.actionHtmlDiaVisible=g),title:"html转markdown",width:"680","show-close":!1,"append-to-body":""},{footer:e.withCtx(()=>[e.createVNode(f,{onClick:o[63]||(o[63]=g=>t.actionHtmlVisible(!1))},{default:e.withCtx(()=>[...o[76]||(o[76]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(f,{type:"primary",onClick:t.actionHtmlToMD},{default:e.withCtx(()=>[...o[77]||(o[77]=[e.createTextVNode("转换成markdown",-1)])]),_:1},8,["onClick"])]),default:e.withCtx(()=>[e.createVNode(m,{type:"textarea",modelValue:t.actionHtmlText,"onUpdate:modelValue":o[62]||(o[62]=g=>t.actionHtmlText=g),rows:14,placeholder:"请输入html代码..."},null,8,["modelValue"])]),_:1},8,["modelValue"])],6)}],["__scopeId","data-v-a76ecd6a"]]),Ce={add(t,o){const a=`toc${o}${++this.index}`,i={anchor:a,level:o,text:t},l=this.tocItems;return i.level<=5&&l.push(i),a},reset:function(){this.tocItems=[],this.index=0},tocItems:[],index:0};function Sl(t){return o=>{typeof o=="string"&&o!==t.text&&(t.escaped=!0,t.text=o)}}const Wl=/[&<>"']/,mg=new RegExp(Wl.source,"g"),Yl=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ug=new RegExp(Yl.source,"g"),gg={"&":"&","<":"<",">":">",'"':""","'":"'"},Nl=t=>gg[t];function Bl(t,o){if(o){if(Wl.test(t))return t.replace(mg,Nl)}else if(Yl.test(t))return t.replace(ug,Nl);return t}const fg={name:"cvMarkdownShow",mixins:[te],emits:["update:html","on-copy"],props:{html:{type:[String]},modelValue:{type:[String],default:""},markedOptions:{type:Object,default:()=>({})},theme:{type:String,default:"light"},language:{type:String,default:""},copyCode:{type:Boolean,default:!0},copyBtnText:{type:String,default:"复制代码"},tocShow:{type:[Boolean],default:!1}},watch:{modelValue(t){this.localVal=t||"",this.initNewCreate()},localHtml(t){this.$emit("update:html",t)}},data:()=>({localVal:"",localHtml:"",previewImgModal:!1,previewImgSrc:"",previewImgMode:"",timeoutId:null,imgs:[],tocTrigger:!1,tocAction:"",tocLists:[]}),created(){this.localVal=this.modelValue||""},async mounted(){Ce.reset(),await function(t,o=!1){let a=document.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("id",t),o?a.setAttribute("href",t+"?t="+new Date().getTime()):a.setAttribute("href",t),document.getElementById(t)||document.head.appendChild(a)}(this.CDN_URL_UI+"/highlight.js/@11.8.0/styles/default.min.css"),await Xe(this.CDN_URL_UI+"/highlight.js/@11.8.0/highlight.min.js").then(()=>{setTimeout(()=>{hljs.highlightAll(),this.initNewCreate()},30)})},methods:{async initNewCreate(){const{Marked:t,Renderer:o}=await import("https://10ui.cn/marked/@12.0.1/marked.esm.js");o.prototype.heading=function(l,n,r,c){let p=Ce.add(l,n);return`<h${n} id="${r.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-")}" toc-id="${p}">${l}</h${n}>`};const a=new t(function(l){if(typeof l=="function"&&(l={highlight:l}),!l||typeof l.highlight!="function")throw new Error("Must provide highlight function");return typeof l.langPrefix!="string"&&(l.langPrefix="language-"),{async:!!l.async,walkTokens(n){if(n.type!=="code")return;const r=function(p){return(p.lang||"").match(/\S*/)[0]}(n);if(l.async)return Promise.resolve(l.highlight(n.text,r)).then(Sl(n));const c=l.highlight(n.text,r);if(c instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");Sl(n)(c)},renderer:{code(n,r,c){const p=(r||"").match(/\S*/)[0],d=p?` class="${l.langPrefix}${Bl(p)}"`:"";return n=n.replace(/\n$/,""),`<pre><code${d}>${c?n:Bl(n,!0)}
|
|
37
|
-
</code></pre>`}}}}({langPrefix:"hljs language-",highlight(l,n){const r=hljs.getLanguage(n)?n:"plaintext";return hljs.highlight(l,{language:r}).value}}));a.use({gfm:!0,tables:!0,breaks:!1,pedantic:!1,smartLists:!0});let i=a.parse(this.localVal,{sanitize:!1,...this.markedOptions});i=i.replace(/href="/gi,'target="_blank" href="'),this.copyCode&&(i=i.replace(/<pre>/g,'<div class="code-block"><span class="copy-code">'+this.copyBtnText+"</span><pre>").replace(/<\/pre>/g,"</pre></div>")),/\[\[TOC\]\]/.test(i)&&(i=i.replace(/\[\[TOC\]\]/g,'<ul class="toc-anchor"></ul>')),this.localHtml=i,this.tocLists=
|
|
36
|
+
`).pop()===""&&(this.lastInsert="")},20)},mousescrollSide(t){this.scrollSide=t},getScrollData(){const t=this.editorWrapRefEL.querySelector(".cv-editor-markdown-main .cm-scroller"),o=t.scrollHeight,a=t.scrollTop,i=this.editorWrapRefEL.querySelector(".cv-markdown-preview .markdown-preview");return{markdownRef:t,markdownScrollHeight:o,markdownScrollTop:a,previewRef:i,contentHeight:i.offsetHeight,previewScrollHeight:i.scrollHeight,previewScrollTop:i.scrollTop||0}},markdownScroll(){if(this.actionScrollSync&&this.scrollSide==="left"){const{markdownRef:t,markdownScrollHeight:o,markdownScrollTop:a,previewRef:i,contentHeight:l,previewScrollHeight:n,previewScrollTop:r}=this.getScrollData();i.scrollTop=parseInt(a/(o-l)*(n-l),0)}},previewScroll(){if(this.actionScrollSync&&this.scrollSide==="right"){const{markdownRef:t,markdownScrollHeight:o,markdownScrollTop:a,previewRef:i,contentHeight:l,previewScrollHeight:n,previewScrollTop:r}=this.getScrollData(),c=parseInt(r/(n-l)*(o-l),0);t.scrollTop=c}}}},Cu={key:0,class:"cv-editor-markdown-toolbar","data-title":"头部工具栏"},vu={class:"cv-editor-toolbars"},yu={key:1,name:"插入图片"},ku={key:2,name:"本地图片"},bu={class:"icon-svg"},wu={key:4,name:"上传图片"},Vu={key:5,name:"上传文件"},xu={name:"导入文件",class:"import-file"},Su={name:"保存到本地"},Nu={key:6,name:"代码块"},Bu={key:7,class:"shift-theme",name:"主题"},Eu=["onClick"],Du={key:8,class:"shift-theme",name:"背景颜色"},_u=["onClick"],Tu={key:9,class:"shift-theme",name:"phrases"},Iu=["onClick"],Lu=["name"],Fu=["name"],$u=["name"],Ou=["name"],Mu={key:15,name:"全屏编辑"},zu={key:16,name:"分屏显示"},Pu={key:17,name:"预览"},Hu={key:18,class:"segmentation"},Au={class:"icon-svg"},ju={key:22,class:"segmentation"},Ru={key:23,name:"目录"},Uu={key:24,class:"segmentation"},Wu=["name"],Yu={class:"cv-editor-toolbars"},qu={key:0,name:"撤销"},Xu={key:2,name:"粗体"},Ku={key:3,name:"斜体"},Gu={key:4,name:"删除线"},Zu={key:5,name:"下划线"},Qu={key:6,name:"标题1"},Ju={key:7,name:"标题2"},eg={key:8,name:"标题3"},tg={key:9,name:"标题4"},og={key:10,name:"标题5"},ag={key:11,name:"标题6"},lg={key:12,name:"分割线"},ng={key:13,name:"引用"},ig={key:14,name:"无序列表"},rg={key:15,name:"有序列表"},sg={key:16,name:"未完成列表"},cg={key:17,name:"已完成列表"},dg={key:18,name:"链接"},pg={key:19,name:"表格"},Zt=v(fu,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("SvgImgMap"),c=e.resolveComponent("SvgUploadFile"),p=e.resolveComponent("SvgCopy"),d=e.resolveComponent("SvgToc"),h=e.resolveComponent("CodemirrorEditor"),u=e.resolveComponent("cv-markdown-show"),m=e.resolveComponent("el-input"),f=e.resolveComponent("el-button"),C=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",{ref:n.editorWrapRefID,class:e.normalizeClass(["cv-editor-markdown-wrap",a.bordered?"border":""]),style:e.normalizeStyle({width:n.widthTotalPx,height:n.heightTotalPx})},[t.actionPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Cu,[e.createElementVNode("ul",vu,[t.$slots.title?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("li",null,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),o[65]||(o[65]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1))],64)):e.createCommentVNode("",!0),t.toolConfig.image?(e.openBlock(),e.createElementBlock("li",yu,[e.createElementVNode("span",{onClick:o[0]||(o[0]=(...g)=>t.actionInsImage&&t.actionInsImage(...g)),class:"iconfont icon-img"})])):e.createCommentVNode("",!0),t.toolConfig.uploadImage?(e.openBlock(),e.createElementBlock("li",ku,[e.createElementVNode("span",{onClick:o[1]||(o[1]=(...g)=>t.actionChooseImage&&t.actionChooseImage(...g)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_image?(e.openBlock(),e.createElementBlock("li",{key:3,name:"图片空间",onClick:o[2]||(o[2]=g=>t.actionCustom("image-browse"))},[e.createElementVNode("span",bu,[e.createVNode(r)])])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadImage?(e.openBlock(),e.createElementBlock("li",wu,[e.createElementVNode("span",{onClick:o[3]||(o[3]=g=>t.actionCustom("image-upload")),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadFile?(e.openBlock(),e.createElementBlock("li",Vu,[e.createElementVNode("span",{onClick:o[4]||(o[4]=g=>t.actionCustom("file-upload")),class:"icon-svg"},[e.createVNode(c)])])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("li",xu,[e.createElementVNode("span",{class:"iconfont icon-daoru",onClick:o[5]||(o[5]=(...g)=>t.actionImportFile&&t.actionImportFile(...g))}),e.createElementVNode("input",{type:"file",onChange:o[6]||(o[6]=g=>t.actionImportFile(g)),accept:"text/markdown"},null,32)],512),[[e.vShow,t.toolConfig.importmd]]),e.withDirectives(e.createElementVNode("li",Su,[e.createElementVNode("span",{class:"iconfont icon-download",onClick:o[7]||(o[7]=(...g)=>t.actionExportFile&&t.actionExportFile(...g))})],512),[[e.vShow,t.toolConfig.exportmd]]),o[72]||(o[72]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1)),t.toolConfig.code?(e.openBlock(),e.createElementBlock("li",Nu,[e.createElementVNode("span",{onClick:o[8]||(o[8]=(...g)=>t.insertCode&&t.insertCode(...g)),class:"iconfont icon-code"})])):e.createCommentVNode("",!0),t.toolConfig.theme?(e.openBlock(),e.createElementBlock("li",Bu,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[9]||(o[9]=g=>t.actionThemeDropdown=!t.actionThemeDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionThemeDropdown}),onMouseleave:o[10]||(o[10]=g=>t.actionThemeDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionTheme,g=>(e.openBlock(),e.createElementBlock("li",{onClick:y=>t.actionThemesSet(g)},e.toDisplayString(g),9,Eu))),256))],34)])):e.createCommentVNode("",!0),t.toolConfig.backgroundColor?(e.openBlock(),e.createElementBlock("li",Du,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[11]||(o[11]=g=>t.actionBgColorDropdown=!t.actionBgColorDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionBgColorDropdown}),onMouseleave:o[12]||(o[12]=g=>t.actionBgColorDropdown=!1)},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["red","black","yellow","lawngreen","blue","white"],g=>e.createElementVNode("li",{onClick:y=>t.actionBgColorSet(g)},e.toDisplayString(g),9,_u)),64))],34)])):e.createCommentVNode("",!0),t.toolConfig.phrases?(e.openBlock(),e.createElementBlock("li",Tu,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[13]||(o[13]=g=>t.actionPhrasesDropdown=!t.actionPhrasesDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionPhrasesDropdown}),onMouseleave:o[14]||(o[14]=g=>t.actionPhrasesDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionPhrases,g=>(e.openBlock(),e.createElementBlock("li",{onClick:y=>t.actionPhrasesSet(g)},e.toDisplayString(g),9,Iu))),256))],34)])):e.createCommentVNode("",!0),t.toolConfig.html_to_markdown?(e.openBlock(),e.createElementBlock("li",{key:10,name:"html转markdown",onClick:o[15]||(o[15]=g=>t.actionHtmlVisible(!0))},[...o[66]||(o[66]=[e.createElementVNode("span",{style:{width:"auto","font-size":"12px !important",padding:"0px 6px",margin:"0 10px",border:"1px #e2e2e2 solid"}}," HTML2MD ",-1)])])):e.createCommentVNode("",!0),t.toolConfig.disabled?(e.openBlock(),e.createElementBlock("li",{key:11,name:t.codemrrConfig.disabled?"toggle disabled:开":"toggle disabled:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[16]||(o[16]=g=>t.codemrrConfig.disabled=!t.codemrrConfig.disabled),class:"iconfont icon-on"},null,512),[[e.vShow,t.codemrrConfig.disabled]]),e.withDirectives(e.createElementVNode("span",{onClick:o[17]||(o[17]=g=>t.codemrrConfig.disabled=!t.codemrrConfig.disabled),class:"iconfont icon-off"},null,512),[[e.vShow,!t.codemrrConfig.disabled]])],8,Lu)):e.createCommentVNode("",!0),t.toolConfig.autofocus?(e.openBlock(),e.createElementBlock("li",{key:12,name:t.codemrrConfig.autofocus?"toggle autofocus:开":"toggle autofocus:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[18]||(o[18]=g=>t.codemrrConfig.autofocus=!t.codemrrConfig.autofocus),class:"iconfont icon-on"},null,512),[[e.vShow,t.codemrrConfig.autofocus]]),e.withDirectives(e.createElementVNode("span",{onClick:o[19]||(o[19]=g=>t.codemrrConfig.autofocus=!t.codemrrConfig.autofocus),class:"iconfont icon-off"},null,512),[[e.vShow,!t.codemrrConfig.autofocus]])],8,Fu)):e.createCommentVNode("",!0),t.toolConfig.indentWithTab?(e.openBlock(),e.createElementBlock("li",{key:13,name:t.codemrrConfig.indentWithTab?"toggle indentWithTab:开":"toggle indentWithTab:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[20]||(o[20]=g=>t.codemrrConfig.indentWithTab=!t.codemrrConfig.indentWithTab),class:"iconfont icon-on"},null,512),[[e.vShow,t.codemrrConfig.indentWithTab]]),e.withDirectives(e.createElementVNode("span",{onClick:o[21]||(o[21]=g=>t.codemrrConfig.indentWithTab=!t.codemrrConfig.indentWithTab),class:"iconfont icon-off"},null,512),[[e.vShow,!t.codemrrConfig.indentWithTab]])],8,$u)):e.createCommentVNode("",!0),o[73]||(o[73]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.scrollSync?(e.openBlock(),e.createElementBlock("li",{key:14,name:t.actionScrollSync?"同步滚动:开":"同步滚动:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[22]||(o[22]=g=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-on active"},null,512),[[e.vShow,t.actionScrollSync]]),e.withDirectives(e.createElementVNode("span",{onClick:o[23]||(o[23]=g=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-off"},null,512),[[e.vShow,!t.actionScrollSync]])],8,Ou)):e.createCommentVNode("",!0),t.toolConfig.split&&t.actionSplit?(e.openBlock(),e.createElementBlock("li",Mu,[e.createElementVNode("span",{onClick:o[24]||(o[24]=g=>t.actionSplit=!1),class:"iconfont icon-md"})])):e.createCommentVNode("",!0),t.toolConfig.split&&!t.actionSplit?(e.openBlock(),e.createElementBlock("li",zu,[e.createElementVNode("span",{onClick:o[25]||(o[25]=g=>t.actionSplit=!0),class:"iconfont icon-group"})])):e.createCommentVNode("",!0),t.toolConfig.preview?(e.openBlock(),e.createElementBlock("li",Pu,[e.createElementVNode("span",{onClick:o[26]||(o[26]=g=>t.actionPreview=!0),class:"iconfont icon-preview"})])):e.createCommentVNode("",!0),t.toolConfig.copy||t.toolConfig.clear||t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",Hu,[...o[67]||(o[67]=[e.createElementVNode("div",null,null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.copy?(e.openBlock(),e.createElementBlock("li",{key:19,name:"复制",onClick:o[27]||(o[27]=(...g)=>t.actionCopySet&&t.actionCopySet(...g))},[e.createElementVNode("span",Au,[e.createVNode(p)])])):e.createCommentVNode("",!0),t.toolConfig.clear?(e.openBlock(),e.createElementBlock("li",{key:20,name:"清空",onClick:o[28]||(o[28]=g=>l.localVal="")},[...o[68]||(o[68]=[e.createElementVNode("span",{class:"iconfont icon-clear"},null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",{key:21,name:"保存",onClick:o[29]||(o[29]=(...g)=>t.actionSaveSet&&t.actionSaveSet(...g))},[...o[69]||(o[69]=[e.createElementVNode("span",{class:"iconfont icon-save"},null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.toc?(e.openBlock(),e.createElementBlock("li",ju,[...o[70]||(o[70]=[e.createElementVNode("div",null,null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.toc?(e.openBlock(),e.createElementBlock("li",Ru,[e.withDirectives(e.createElementVNode("span",{onClick:o[30]||(o[30]=g=>t.actionToc=!t.actionToc),class:"icon-svg active"},[e.createVNode(d)],512),[[e.vShow,t.actionToc]]),e.withDirectives(e.createElementVNode("span",{onClick:o[31]||(o[31]=g=>t.actionToc=!t.actionToc),class:"icon-svg"},[e.createVNode(d)],512),[[e.vShow,!t.actionToc]])])):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",Uu,[...o[71]||(o[71]=[e.createElementVNode("div",null,null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",{key:25,name:t.actionFullscreen?"退出全屏":"全屏"},[e.withDirectives(e.createElementVNode("span",{onClick:o[32]||(o[32]=g=>t.actionFullscreenSet(!1)),class:"iconfont icon-quite"},null,512),[[e.vShow,t.actionFullscreen]]),e.withDirectives(e.createElementVNode("span",{onClick:o[33]||(o[33]=g=>t.actionFullscreenSet(!0)),class:"iconfont icon-fullscreen"},null,512),[[e.vShow,!t.actionFullscreen]])],8,Wu)):e.createCommentVNode("",!0)]),e.createElementVNode("ul",Yu,[t.toolConfig.undo?(e.openBlock(),e.createElementBlock("li",qu,[e.createElementVNode("span",{class:"iconfont icon-undo",onClick:o[34]||(o[34]=(...g)=>t.actionUndo&&t.actionUndo(...g))})])):e.createCommentVNode("",!0),t.toolConfig.redo?(e.openBlock(),e.createElementBlock("li",{key:1,name:"重做",onClick:o[35]||(o[35]=(...g)=>t.actionRedo&&t.actionRedo(...g))},[...o[74]||(o[74]=[e.createElementVNode("span",{class:"iconfont icon-redo"},null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.strong?(e.openBlock(),e.createElementBlock("li",Xu,[e.createElementVNode("span",{onClick:o[36]||(o[36]=(...g)=>t.actionInsStrong&&t.actionInsStrong(...g)),class:"iconfont icon-bold"})])):e.createCommentVNode("",!0),t.toolConfig.italic?(e.openBlock(),e.createElementBlock("li",Ku,[e.createElementVNode("span",{onClick:o[37]||(o[37]=(...g)=>t.actionInsItalic&&t.actionInsItalic(...g)),class:"iconfont icon-italic"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",Gu,[e.createElementVNode("span",{onClick:o[38]||(o[38]=(...g)=>t.actionInsOverline&&t.actionInsOverline(...g)),class:"iconfont icon-overline"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",Zu,[e.createElementVNode("span",{onClick:o[39]||(o[39]=(...g)=>t.actionInsUnderline&&t.actionInsUnderline(...g)),class:"iconfont icon-under-line"})])):e.createCommentVNode("",!0),t.toolConfig.h1?(e.openBlock(),e.createElementBlock("li",Qu,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[40]||(o[40]=g=>t.actionInsTitle(1))},"h1")])):e.createCommentVNode("",!0),t.toolConfig.h2?(e.openBlock(),e.createElementBlock("li",Ju,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[41]||(o[41]=g=>t.actionInsTitle(2))},"h2")])):e.createCommentVNode("",!0),t.toolConfig.h3?(e.openBlock(),e.createElementBlock("li",eg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[42]||(o[42]=g=>t.actionInsTitle(3))},"h3")])):e.createCommentVNode("",!0),t.toolConfig.h4?(e.openBlock(),e.createElementBlock("li",tg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[43]||(o[43]=g=>t.actionInsTitle(4))},"h4")])):e.createCommentVNode("",!0),t.toolConfig.h5?(e.openBlock(),e.createElementBlock("li",og,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[44]||(o[44]=g=>t.actionInsTitle(5))},"h5")])):e.createCommentVNode("",!0),t.toolConfig.h6?(e.openBlock(),e.createElementBlock("li",ag,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[45]||(o[45]=g=>t.actionInsTitle(6))},"h6")])):e.createCommentVNode("",!0),t.toolConfig.hr?(e.openBlock(),e.createElementBlock("li",lg,[e.createElementVNode("span",{onClick:o[46]||(o[46]=(...g)=>t.actionInsLine&&t.actionInsLine(...g)),class:"iconfont icon-horizontal"})])):e.createCommentVNode("",!0),t.toolConfig.quote?(e.openBlock(),e.createElementBlock("li",ng,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[47]||(o[47]=(...g)=>t.actionInsQuote&&t.actionInsQuote(...g)),class:"iconfont icon-quote"})])):e.createCommentVNode("",!0),t.toolConfig.ul?(e.openBlock(),e.createElementBlock("li",ig,[e.createElementVNode("span",{onClick:o[48]||(o[48]=(...g)=>t.actionInsUl&&t.actionInsUl(...g)),class:"iconfont icon-ul"})])):e.createCommentVNode("",!0),t.toolConfig.ol?(e.openBlock(),e.createElementBlock("li",rg,[e.createElementVNode("span",{onClick:o[49]||(o[49]=(...g)=>t.actionInsOl&&t.actionInsOl(...g)),class:"iconfont icon-ol"})])):e.createCommentVNode("",!0),t.toolConfig.notChecked?(e.openBlock(),e.createElementBlock("li",sg,[e.createElementVNode("span",{onClick:o[50]||(o[50]=(...g)=>t.insertNotFinished&&t.insertNotFinished(...g)),class:"iconfont icon-checked-false"})])):e.createCommentVNode("",!0),t.toolConfig.checked?(e.openBlock(),e.createElementBlock("li",cg,[e.createElementVNode("span",{onClick:o[51]||(o[51]=(...g)=>t.insertFinished&&t.insertFinished(...g)),class:"iconfont icon-checked"})])):e.createCommentVNode("",!0),t.toolConfig.link?(e.openBlock(),e.createElementBlock("li",dg,[e.createElementVNode("span",{onClick:o[52]||(o[52]=(...g)=>t.actionInsLink&&t.actionInsLink(...g)),class:"iconfont icon-link"})])):e.createCommentVNode("",!0),t.toolConfig.table?(e.openBlock(),e.createElementBlock("li",pg,[e.createElementVNode("span",{onClick:o[53]||(o[53]=(...g)=>t.actionInsTable&&t.actionInsTable(...g)),class:"iconfont icon-table"})])):e.createCommentVNode("",!0)])])),e.createElementVNode("div",{title:"编辑器",class:"cv-editor-markdown-main",style:e.normalizeStyle({background:t.actionPreview?"#fff":""})},[e.withDirectives(e.createVNode(h,e.mergeProps(t.codemrrBind,{id:t.editorRefID,ref:t.editorRefID,style:{height:l.heightMainPx,backgroundColor:t.codemrrConfig.backgroundColor},extensions:t.extensions,modelValue:l.localVal,"onUpdate:modelValue":o[54]||(o[54]=g=>l.localVal=g),onReady:n.initEditorReady,onChange:o[55]||(o[55]=g=>n.consoleLog("change",g)),onFocus:o[56]||(o[56]=g=>n.consoleLog("focus",g)),onBlur:o[57]||(o[57]=g=>n.consoleLog("blur",g)),onMouseenter:o[58]||(o[58]=g=>n.mousescrollSide("left"))}),null,16,["id","style","extensions","modelValue","onReady"]),[[e.vShow,!t.actionPreview]]),e.withDirectives(e.createVNode(u,{html:l.lastHtml,"onUpdate:html":o[59]||(o[59]=g=>l.lastHtml=g),ref:n.previewRefID,editorID:n.previewRefID,modelValue:l.localVal,theme:t.codemrrConfig.theme||a.theme,language:a.language,tocShow:t.actionToc,style:e.normalizeStyle([{flex:"1",height:"100%","border-left":"1px solid #dedede","overflow-y":"auto"},{height:t.actionPreview?"":l.heightMainPx}]),onMouseenter:o[60]||(o[60]=g=>n.mousescrollSide("right"))},null,8,["html","editorID","modelValue","theme","language","tocShow","style"]),[[e.vShow,t.actionPreview?t.actionPreview:t.actionSplit]])],4),e.withDirectives(e.createElementVNode("div",{title:"关闭预览按钮",class:"close-preview",onClick:o[61]||(o[61]=g=>t.actionPreview=!1)},[...o[75]||(o[75]=[e.createElementVNode("span",{class:"iconfont icon-close"},null,-1)])],512),[[e.vShow,t.actionPreview]]),e.createVNode(C,{modelValue:t.actionHtmlDiaVisible,"onUpdate:modelValue":o[64]||(o[64]=g=>t.actionHtmlDiaVisible=g),title:"html转markdown",width:"680","show-close":!1,"append-to-body":""},{footer:e.withCtx(()=>[e.createVNode(f,{onClick:o[63]||(o[63]=g=>t.actionHtmlVisible(!1))},{default:e.withCtx(()=>[...o[76]||(o[76]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(f,{type:"primary",onClick:t.actionHtmlToMD},{default:e.withCtx(()=>[...o[77]||(o[77]=[e.createTextVNode("转换成markdown",-1)])]),_:1},8,["onClick"])]),default:e.withCtx(()=>[e.createVNode(m,{type:"textarea",modelValue:t.actionHtmlText,"onUpdate:modelValue":o[62]||(o[62]=g=>t.actionHtmlText=g),rows:14,placeholder:"请输入html代码..."},null,8,["modelValue"])]),_:1},8,["modelValue"])],6)}],["__scopeId","data-v-a76ecd6a"]]),ve={add(t,o){const a=`toc${o}${++this.index}`,i={anchor:a,level:o,text:t},l=this.tocItems;return i.level<=5&&l.push(i),a},reset:function(){this.tocItems=[],this.index=0},tocItems:[],index:0};function Sl(t){return o=>{typeof o=="string"&&o!==t.text&&(t.escaped=!0,t.text=o)}}const Wl=/[&<>"']/,hg=new RegExp(Wl.source,"g"),Yl=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,mg=new RegExp(Yl.source,"g"),ug={"&":"&","<":"<",">":">",'"':""","'":"'"},Nl=t=>ug[t];function Bl(t,o){if(o){if(Wl.test(t))return t.replace(hg,Nl)}else if(Yl.test(t))return t.replace(mg,Nl);return t}const gg={name:"cvMarkdownShow",mixins:[te],emits:["update:html","on-copy"],props:{html:{type:[String]},modelValue:{type:[String],default:""},markedOptions:{type:Object,default:()=>({})},theme:{type:String,default:"light"},language:{type:String,default:""},copyCode:{type:Boolean,default:!0},copyBtnText:{type:String,default:"复制代码"},tocShow:{type:[Boolean],default:!1}},watch:{modelValue(t){this.localVal=t||"",this.initNewCreate()},localHtml(t){this.$emit("update:html",t)}},data:()=>({localVal:"",localHtml:"",previewImgModal:!1,previewImgSrc:"",previewImgMode:"",timeoutId:null,imgs:[],tocTrigger:!1,tocAction:"",tocLists:[]}),created(){this.localVal=this.modelValue||""},async mounted(){ve.reset(),await function(t,o=!1){let a=document.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("id",t),o?a.setAttribute("href",t+"?t="+new Date().getTime()):a.setAttribute("href",t),document.getElementById(t)||document.head.appendChild(a)}(this.CDN_URL_UI+"/highlight.js/@11.8.0/styles/default.min.css"),await Ke(this.CDN_URL_UI+"/highlight.js/@11.8.0/highlight.min.js").then(()=>{setTimeout(()=>{hljs.highlightAll(),this.initNewCreate()},30)})},methods:{async initNewCreate(){const{Marked:t,Renderer:o}=await import("https://10ui.cn/marked/@12.0.1/marked.esm.js");o.prototype.heading=function(l,n,r,c){let p=ve.add(l,n);return`<h${n} id="${r.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-")}" toc-id="${p}">${l}</h${n}>`};const a=new t(function(l){if(typeof l=="function"&&(l={highlight:l}),!l||typeof l.highlight!="function")throw new Error("Must provide highlight function");return typeof l.langPrefix!="string"&&(l.langPrefix="language-"),{async:!!l.async,walkTokens(n){if(n.type!=="code")return;const r=function(p){return(p.lang||"").match(/\S*/)[0]}(n);if(l.async)return Promise.resolve(l.highlight(n.text,r)).then(Sl(n));const c=l.highlight(n.text,r);if(c instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");Sl(n)(c)},renderer:{code(n,r,c){const p=(r||"").match(/\S*/)[0],d=p?` class="${l.langPrefix}${Bl(p)}"`:"";return n=n.replace(/\n$/,""),`<pre><code${d}>${c?n:Bl(n,!0)}
|
|
37
|
+
</code></pre>`}}}}({langPrefix:"hljs language-",highlight(l,n){const r=hljs.getLanguage(n)?n:"plaintext";return hljs.highlight(l,{language:r}).value}}));a.use({gfm:!0,tables:!0,breaks:!1,pedantic:!1,smartLists:!0});let i=a.parse(this.localVal,{sanitize:!1,...this.markedOptions});i=i.replace(/href="/gi,'target="_blank" href="'),this.copyCode&&(i=i.replace(/<pre>/g,'<div class="code-block"><span class="copy-code">'+this.copyBtnText+"</span><pre>").replace(/<\/pre>/g,"</pre></div>")),/\[\[TOC\]\]/.test(i)&&(i=i.replace(/\[\[TOC\]\]/g,'<ul class="toc-anchor"></ul>')),this.localHtml=i,this.tocLists=ve.tocItems,this.tocTrigger,ve.reset(),this.addCopyListener(),this.addImageClickListener()},addCopyListener(){setTimeout(()=>{const t=document.querySelectorAll(".code-block .copy-code");this.btns=t;for(let o=0,a=t.length;o<a;o++)t[o].onclick=()=>{const i=t[o].parentNode.querySelectorAll("pre")[0].innerText;this.$cvCopy(i),this.$emit("on-copy",i)}},30)},addImageClickListener(){if(this.imgs.length>0)for(let t=0,o=this.imgs.length;t<o;t++)this.imgs[t].onclick=null;setTimeout(()=>{if(this.$refs[this.editorRefID]){this.imgs=this.$refs[this.editorRefID].querySelectorAll("img");for(let t=0,o=this.imgs.length;t<o;t++)this.imgs[t].onclick=()=>{const a=this.imgs[t].getAttribute("src");this.previewImage(a)}}},600)},previewImage(t){const o=new Image;o.src=t,o.onload=()=>{const a=o.naturalWidth,i=o.naturalHeight;this.previewImgMode=i/a>1.4?"horizontal":"vertical",this.previewImgSrc=t,this.previewImgModal=!0}},handleScroll(){const t=this.$refs[this.editorRefID],o=t.querySelector(".markdown-preview"),a=o.querySelectorAll("h1,h2,h3,h4,h5");let i=null;if([...a].forEach(l=>{l.offsetTop-o.offsetTop<=o.scrollTop&&(i=l)}),i){this.tocAction=i.getAttribute("toc-id");const l=t.querySelector("ul.toc-anchor");if(l){const n=l.querySelector(`li[anchor="${this.tocAction}"]`);n&&(l.scrollTop=n.offsetTop-l.offsetTop-20)}}},tocClick(t){this.tocAction=t.anchor;const o=this.$refs[this.editorRefID].querySelector(".markdown-preview"),a=o.querySelector("h"+t.level+'[toc-id="'+this.tocAction+'"]');a&&o.scrollTo({top:a.offsetTop-o.offsetTop,behavior:"smooth"})},tocLevel(t,o){let a=9999;return o===void 0&&(o=this.tocLists),o.forEach(({level:i})=>{a=Math.min(a,i)}),a===9999?t:t-(a-1)}}},fg=["id"],Cg=["innerHTML"],vg={class:"toc-anchor"},yg=["anchor","onClick"],kg=["anchor","title"],bg=["src"],Qt=v(gg,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons");return e.openBlock(),e.createElementBlock("div",{class:"cv-markdown-preview",id:t.editorRefID,ref:t.editorRefID,style:e.normalizeStyle([a.tocShow?"display:flex;":""])},[t.$slots.default?e.renderSlot(t.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(l.localHtml),1)]):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass("markdown-preview markdown-theme-base "+("markdown-theme-"+a.theme)),onScroll:o[0]||(o[0]=(...c)=>n.handleScroll&&n.handleScroll(...c)),innerHTML:l.localHtml},null,42,Cg),e.withDirectives(e.createElementVNode("ul",vg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.tocLists,c=>(e.openBlock(),e.createElementBlock("li",{class:"toc-anchor-item",anchor:c.anchor,key:c.anchor,onClick:p=>n.tocClick(c)},[e.createElementVNode("span",{class:e.normalizeClass(`toc-link-${n.tocLevel(c.level)}${l.tocAction==c.anchor?" toc-link-action":""}`),anchor:c.anchor,title:c.text},e.toDisplayString(c.text),11,kg)],8,yg))),128))],512),[[e.vShow,a.tocShow]]),e.createElementVNode("div",{class:e.normalizeClass(["preview-img",l.previewImgModal?"active":""])},[e.createVNode(r,{type:"ElIconClose",onClick:o[1]||(o[1]=c=>l.previewImgModal=!1)}),e.createElementVNode("img",{src:l.previewImgSrc,class:e.normalizeClass([l.previewImgMode]),alt:""},null,10,bg)],2)],12,fg)}]]),wg={name:"cvMarkdownSimple",mixins:[te,Qo,{methods:{toggleSlideDown(){this.slideDown=!this.slideDown},actionThemesSet(t){this.codemrrConfig.theme=t,this.actionThemeDropdown=!1,this.$emit("on-act-theme",t)},actionChooseImage(){const t=document.createElement("input");t.type="file",t.accept="image/*",t.onchange=()=>{const o=t.files;o[0]&&(this.$emit("on-act-choose-image",o[0]),t.value="")},t.click()},actionUndo(){},actionRedo(){},actionInsBg(){const t=this.getCursortPosition(),o=this.localVal.substring(t-1,t);this.insertContent("===="),o!==`
|
|
38
38
|
`&&this.localVal,this.setCaretPosition(t+5)},actionInsStrong(){const t=this.getCursortPosition(),o=this.localVal.substring(t-1,t);this.insertContent("****"),o!==`
|
|
39
39
|
`&&this.localVal,this.setCaretPosition(t+2)},actionInsItalic(){const t=this.getCursortPosition(),o=this.localVal.substring(t-1,t);this.insertContent("**"),o!==`
|
|
40
40
|
`&&this.localVal,this.setCaretPosition(t+1)},actionInsOverline(){const t=this.getCursortPosition(),o=this.localVal.substring(t-1,t);this.insertContent("~~~~"),o!==`
|
|
@@ -55,4 +55,4 @@ row 2 col 1 | row 2 col 2
|
|
|
55
55
|
`).length,this.textareaHeight=22*this.indexLenth,this.addImageClickListener(),this.addCopyListener(),this.$emit("update:modelValue",t)},30)},modelValue(){this.localVal!==this.modelValue&&(this.localVal=this.modelValue)}},mounted(){this.init()},methods:{init(){this.localVal=this.modelValue,this.codemrrConfig.theme=this.theme,setTimeout(()=>{const t=this.$refs.textarea;t.focus(),t.addEventListener("keydown",o=>{o.keyCode===83&&(o.metaKey||o.ctrlKey)&&(o.preventDefault(),this.actionSaveSet())}),t.addEventListener("paste",this.handlePaste),this.autoSave&&(this.timerId=setInterval(()=>{this.actionSaveSet()},this.interval)),this.$emit("on-ready",{vm:this,insertContent:this.insertContent})},20)},insertContent(t){this.lastInsert=t;const o=this.getCursortPosition(),a=this.localVal.substring(o-1,o),i=this.localVal.substring(o-4,o);if(a!==`
|
|
56
56
|
`&&this.localVal!==""&&i!==" "){const l=`
|
|
57
57
|
`+t;this.insertAfterText(l)}else this.insertAfterText(t)},getCursortPosition(){const t=this.$refs.textarea;let o=0;if(document.selection){t.focus();let a=document.selection.createRange();a.moveStart("character",-this.localVal.length),o=a.text.length}else(t.selectionStart||parseInt(t.selectionStart,0)===0)&&(o=t.selectionStart);return o},insertAfterText(t){const o=this.$refs.textarea;let a;if(document.selection)o.focus(),a=document.selection.createRange(),a.text=t,o.focus();else if(o.selectionStart||parseInt(o.selectionStart,0)===0){const i=o.selectionStart,l=o.selectionEnd,n=o.scrollTop;o.value=o.value.substring(0,i)+t+o.value.substring(l,o.value.length),o.focus(),o.selectionStart=i+t.length,o.selectionEnd=i+t.length,o.scrollTop=n}else o.value+=t,o.focus();this.localVal=o.value},setCaretPosition(t){const o=this.$refs.textarea;if(o.setSelectionRange)o.focus(),o.setSelectionRange(t,t);else if(o.createTextRange){let a=o.createTextRange();a.collapse(!0),a.moveEnd("character",t),a.moveStart("character",t),a.select()}},tab(t){this.insertContent(" ",this),t.preventDefault?t.preventDefault():t.returnValue=!1},enter(){const{lastInsert:t}=this;["- ","1. ","- [ ] ","- [x] "].includes(t)&&this.insertContent(t)},onDelete(){const t=this.localVal.split(`
|
|
58
|
-
`);t[t.length-1]===""&&(this.lastInsert="")},mousescrollSide(t){this.scrollSide=t},handlePaste(t){const{clipboardData:o={}}=t,{types:a=[],items:i}=o;let l=null;for(let n=0;n<a.length;n++)if(a[n]==="Files"){l=i[n];break}if(l){const n=l.getAsFile();/image/gi.test(n.type)&&(this.$emit("on-upload-image",n),this.$emit("on-paste-image",n),t.preventDefault())}},markdownScroll(){const{scrolling:t}=this;if(t&&this.scroll==="left"){const o=this.$refs.markdownEditor,a=this.$refs.preview,i=a.offsetHeight,l=o.scrollHeight,n=o.scrollTop,r=a.scrollHeight;a.scrollTop=parseInt(n/(l-i)*(r-i),0)}},previewScroll(){const{scrolling:t}=this;if(t&&this.scroll==="right"){const o=this.$refs.markdownEditor,a=this.$refs.preview,i=a.offsetHeight,l=o.scrollHeight,n=a.scrollHeight,r=a.scrollTop;o.scrollTop=parseInt(r/(n-i)*(l-i),0)}},mousescrollSide(t){this.scroll=t}}},xg={key:0,title:"头部工具栏"},Sg={class:"cv-editor-toolbars"},Ng={key:0,name:"粗体"},Bg={key:1,name:"斜体"},Eg={key:2,name:"删除线"},Dg={key:3,name:"下划线"},Tg={key:4,name:"标题1"},_g={key:5,name:"标题2"},Ig={key:6,name:"标题3"},Lg={key:7,name:"标题4"},Fg={key:8,name:"标题5"},$g={key:9,name:"标题6"},Og={key:10,name:"分割线"},Mg={key:11,name:"引用"},zg={key:12,name:"无序列表"},Pg={key:13,name:"有序列表"},Hg={key:14,name:"未完成列表"},Ag={key:15,name:"已完成列表"},jg={key:16,name:"链接"},Rg={key:17,name:"表格"},Ug=["name"],Wg={key:19,name:"全屏编辑"},Yg={key:20,name:"分屏显示"},qg={key:21,name:"预览"},Xg={class:"cv-editor-toolbars"},Kg={key:0,name:"图片"},Gg={key:1,name:"本地图片"},Zg={key:2,name:"图片空间"},Qg={key:3,name:"上传图片"},Jg={key:4,name:"上传文件"},e1={key:5,class:"shift-theme",name:"代码块主题"},t1={name:"导入文件",class:"import-file"},o1={name:"保存到本地"},a1={key:6,name:"全屏"},l1={key:7,name:"退出全屏"},n1=["innerHTML"],Qt=v(Vg,[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`markdown ${l.fullscreen?"fullscreen":""} ${a.bordered?"border":""}`),ref:"markdown",style:e.normalizeStyle({width:a.width+(typeof a.width=="string"?"":"px"),height:a.height+(typeof a.height=="string"?"":"px")})},[t.actionPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",xg,[e.createElementVNode("ul",Sg,[e.createElementVNode("li",null,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),t.toolConfig.strong?(e.openBlock(),e.createElementBlock("li",Ng,[e.createElementVNode("span",{onClick:o[0]||(o[0]=(...r)=>t.actionInsStrong&&t.actionInsStrong(...r)),class:"iconfont icon-bold"})])):e.createCommentVNode("",!0),t.toolConfig.italic?(e.openBlock(),e.createElementBlock("li",Bg,[e.createElementVNode("span",{onClick:o[1]||(o[1]=(...r)=>t.actionInsItalic&&t.actionInsItalic(...r)),class:"iconfont icon-italic"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",Eg,[e.createElementVNode("span",{onClick:o[2]||(o[2]=(...r)=>t.actionInsOverline&&t.actionInsOverline(...r)),class:"iconfont icon-overline"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",Dg,[e.createElementVNode("span",{onClick:o[3]||(o[3]=(...r)=>t.actionInsUnderline&&t.actionInsUnderline(...r)),class:"iconfont icon-under-line"})])):e.createCommentVNode("",!0),t.toolConfig.h1?(e.openBlock(),e.createElementBlock("li",Tg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[4]||(o[4]=r=>t.actionInsTitle(1))},"h1")])):e.createCommentVNode("",!0),t.toolConfig.h2?(e.openBlock(),e.createElementBlock("li",_g,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[5]||(o[5]=r=>t.actionInsTitle(2))},"h2")])):e.createCommentVNode("",!0),t.toolConfig.h3?(e.openBlock(),e.createElementBlock("li",Ig,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[6]||(o[6]=r=>t.actionInsTitle(3))},"h3")])):e.createCommentVNode("",!0),t.toolConfig.h4?(e.openBlock(),e.createElementBlock("li",Lg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[7]||(o[7]=r=>t.actionInsTitle(4))},"h4")])):e.createCommentVNode("",!0),t.toolConfig.h5?(e.openBlock(),e.createElementBlock("li",Fg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[8]||(o[8]=r=>t.actionInsTitle(5))},"h5")])):e.createCommentVNode("",!0),t.toolConfig.h6?(e.openBlock(),e.createElementBlock("li",$g,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[9]||(o[9]=r=>t.actionInsTitle(6))},"h6")])):e.createCommentVNode("",!0),t.toolConfig.hr?(e.openBlock(),e.createElementBlock("li",Og,[e.createElementVNode("span",{onClick:o[10]||(o[10]=(...r)=>t.actionInsLine&&t.actionInsLine(...r)),class:"iconfont icon-horizontal"})])):e.createCommentVNode("",!0),t.toolConfig.quote?(e.openBlock(),e.createElementBlock("li",Mg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[11]||(o[11]=(...r)=>t.actionInsQuote&&t.actionInsQuote(...r)),class:"iconfont icon-quote"})])):e.createCommentVNode("",!0),t.toolConfig.ul?(e.openBlock(),e.createElementBlock("li",zg,[e.createElementVNode("span",{onClick:o[12]||(o[12]=(...r)=>t.actionInsUl&&t.actionInsUl(...r)),class:"iconfont icon-ul"})])):e.createCommentVNode("",!0),t.toolConfig.ol?(e.openBlock(),e.createElementBlock("li",Pg,[e.createElementVNode("span",{onClick:o[13]||(o[13]=(...r)=>t.actionInsOl&&t.actionInsOl(...r)),class:"iconfont icon-ol"})])):e.createCommentVNode("",!0),t.toolConfig.notChecked?(e.openBlock(),e.createElementBlock("li",Hg,[e.createElementVNode("span",{onClick:o[14]||(o[14]=(...r)=>t.insertNotFinished&&t.insertNotFinished(...r)),class:"iconfont icon-checked-false"})])):e.createCommentVNode("",!0),t.toolConfig.checked?(e.openBlock(),e.createElementBlock("li",Ag,[e.createElementVNode("span",{onClick:o[15]||(o[15]=(...r)=>t.insertFinished&&t.insertFinished(...r)),class:"iconfont icon-checked"})])):e.createCommentVNode("",!0),t.toolConfig.link?(e.openBlock(),e.createElementBlock("li",jg,[e.createElementVNode("span",{onClick:o[16]||(o[16]=(...r)=>t.actionInsLink&&t.actionInsLink(...r)),class:"iconfont icon-link"})])):e.createCommentVNode("",!0),t.toolConfig.table?(e.openBlock(),e.createElementBlock("li",Rg,[e.createElementVNode("span",{onClick:o[17]||(o[17]=(...r)=>t.actionInsTable&&t.actionInsTable(...r)),class:"iconfont icon-table"})])):e.createCommentVNode("",!0),o[53]||(o[53]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.scrollSync?(e.openBlock(),e.createElementBlock("li",{key:18,name:t.actionScrollSync?"同步滚动:开":"同步滚动:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[18]||(o[18]=r=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-on"},null,512),[[e.vShow,t.actionScrollSync]]),e.withDirectives(e.createElementVNode("span",{onClick:o[19]||(o[19]=r=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-off"},null,512),[[e.vShow,!t.actionScrollSync]])],8,Ug)):e.createCommentVNode("",!0),t.toolConfig.split&&t.actionSplit?(e.openBlock(),e.createElementBlock("li",Wg,[e.createElementVNode("span",{onClick:o[20]||(o[20]=r=>t.actionSplit=!1),class:"iconfont icon-md"})])):e.createCommentVNode("",!0),t.toolConfig.split&&!t.actionSplit?(e.openBlock(),e.createElementBlock("li",Yg,[e.createElementVNode("span",{onClick:o[21]||(o[21]=r=>t.actionSplit=!0),class:"iconfont icon-group"})])):e.createCommentVNode("",!0),t.toolConfig.preview?(e.openBlock(),e.createElementBlock("li",qg,[e.createElementVNode("span",{onClick:o[22]||(o[22]=r=>t.actionPreview=!0),class:"iconfont icon-preview"})])):e.createCommentVNode("",!0),t.toolConfig.clear?(e.openBlock(),e.createElementBlock("li",{key:22,name:"清空",onClick:o[23]||(o[23]=r=>l.localVal="")},[...o[51]||(o[51]=[e.createElementVNode("span",{class:"iconfont icon-clear"},null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",{key:23,name:"保存",onClick:o[24]||(o[24]=(...r)=>t.actionSaveSet&&t.actionSaveSet(...r))},[...o[52]||(o[52]=[e.createElementVNode("span",{class:"iconfont icon-save"},null,-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("ul",Xg,[t.toolConfig.image?(e.openBlock(),e.createElementBlock("li",Kg,[e.createElementVNode("span",{onClick:o[25]||(o[25]=(...r)=>t.actionInsImage&&t.actionInsImage(...r)),class:"iconfont icon-img"})])):e.createCommentVNode("",!0),t.toolConfig.uploadImage?(e.openBlock(),e.createElementBlock("li",Gg,[e.createElementVNode("span",{onClick:o[26]||(o[26]=(...r)=>t.actionChooseImage&&t.actionChooseImage(...r)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_image?(e.openBlock(),e.createElementBlock("li",Zg,[e.createElementVNode("span",{onClick:o[27]||(o[27]=(...r)=>t.custom_actionInsImage&&t.custom_actionInsImage(...r)),class:"iconfont icon-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadImage?(e.openBlock(),e.createElementBlock("li",Qg,[e.createElementVNode("span",{onClick:o[28]||(o[28]=(...r)=>t.custom_chooseImage&&t.custom_chooseImage(...r)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadFile?(e.openBlock(),e.createElementBlock("li",Jg,[e.createElementVNode("span",{onClick:o[29]||(o[29]=(...r)=>t.custom_chooseFile&&t.custom_chooseFile(...r)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.theme?(e.openBlock(),e.createElementBlock("li",e1,[e.createElementVNode("div",null,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[30]||(o[30]=r=>l.themeSlideDown=!l.themeSlideDown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:l.themeSlideDown}),onMouseleave:o[35]||(o[35]=r=>l.themeSlideDown=!1)},[e.createElementVNode("li",{onClick:o[31]||(o[31]=r=>t.setThemes("light"))},"Light"),e.createElementVNode("li",{onClick:o[32]||(o[32]=r=>t.setThemes("dark"))},"VS Code"),e.createElementVNode("li",{onClick:o[33]||(o[33]=r=>t.setThemes("oneDark"))},"Atom OneDark"),e.createElementVNode("li",{onClick:o[34]||(o[34]=r=>t.setThemes("gitHub"))},"GitHub")],34)])])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("li",t1,[e.createElementVNode("span",{class:"iconfont icon-daoru",onClick:o[36]||(o[36]=(...r)=>t.actionImportFile&&t.actionImportFile(...r))}),e.createElementVNode("input",{type:"file",onChange:o[37]||(o[37]=r=>t.actionImportFile(r)),accept:"text/markdown"},null,32)],512),[[e.vShow,t.toolConfig.importmd]]),e.withDirectives(e.createElementVNode("li",o1,[e.createElementVNode("span",{class:"iconfont icon-download",onClick:o[38]||(o[38]=(...r)=>t.actionExportFile&&t.actionExportFile(...r))})],512),[[e.vShow,t.toolConfig.exportmd]]),o[54]||(o[54]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.fullscreen&&!l.fullscreen?(e.openBlock(),e.createElementBlock("li",a1,[e.createElementVNode("span",{onClick:o[39]||(o[39]=r=>l.fullscreen=!l.fullscreen),class:"iconfont icon-fullscreen"})])):e.createCommentVNode("",!0),t.toolConfig.fullscreen&&l.fullscreen?(e.openBlock(),e.createElementBlock("li",l1,[e.createElementVNode("span",{onClick:o[40]||(o[40]=r=>l.fullscreen=!l.fullscreen),class:"iconfont icon-quite"})])):e.createCommentVNode("",!0)])])),e.withDirectives(e.createElementVNode("div",{title:"关闭预览按钮",class:"close-preview",onClick:o[41]||(o[41]=r=>t.actionPreview=!1)},[...o[55]||(o[55]=[e.createElementVNode("span",{class:"iconfont icon-close"},null,-1)])],512),[[e.vShow,t.actionPreview]]),e.createElementVNode("div",{title:"编辑器",class:"cv-editor-markdown-main",style:e.normalizeStyle({background:t.actionPreview?"#fff":""})},[e.withDirectives(e.createElementVNode("div",{class:"markdown-editor",ref:"markdownEditor",onScroll:o[47]||(o[47]=(...r)=>n.markdownScroll&&n.markdownScroll(...r)),onMouseenter:o[48]||(o[48]=r=>n.mousescrollSide("markdown"))},[e.createElementVNode("ul",{class:"index",ref:"index",style:e.normalizeStyle({height:l.textareaHeight?`${l.textareaHeight}px`:"100%"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.indexLenth,r=>(e.openBlock(),e.createElementBlock("li",{key:r},e.toDisplayString(r),1))),128))],4),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":o[42]||(o[42]=r=>l.localVal=r),ref:"textarea",onKeydown:o[43]||(o[43]=e.withKeys((...r)=>n.tab&&n.tab(...r),["tab"])),onKeyup:[o[44]||(o[44]=e.withKeys((...r)=>n.enter&&n.enter(...r),["enter"])),o[45]||(o[45]=e.withKeys((...r)=>n.onDelete&&n.onDelete(...r),["delete"]))],onMouseenter:o[46]||(o[46]=r=>n.mousescrollSide("left")),style:e.normalizeStyle({height:l.textareaHeight?`${l.textareaHeight}px`:"100%"})},null,36),[[e.vModelText,l.localVal]])],544),[[e.vShow,!t.preview]]),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass("markdown-preview "+("markdown-theme-"+t.codemrrConfig.theme)),ref:"preview",onScroll:o[49]||(o[49]=(...r)=>n.previewScroll&&n.previewScroll(...r)),onMouseenter:o[50]||(o[50]=r=>n.mousescrollSide("right"))},[e.createElementVNode("div",{innerHTML:l.html,ref:"previewInner"},null,8,n1)],34),[[e.vShow,t.preview?t.preview:t.split]])],4)],6)}],["__scopeId","data-v-36211c6f"]]),i1=["innerHTML"],Jt=v({name:"cvMarkdownNostyle",props:{modelValue:{type:String,default:""},initValue:{type:String,default:""}},data:()=>({localHtml:"",localVal:""}),watch:{initValue(){this.initNewCreate()}},created(){this.localVal=this.initValue||""},async mounted(){this.initNewCreate()},methods:{async initNewCreate(){const{Marked:t,Renderer:o}=await import("https://10ui.cn/marked/@12.0.1/marked.esm.js");let a=new t().parser(this.localVal,{sanitize:!1});a=a.replace(/href="/gi,'target="_blank" href="'),this.localHtml=a}}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:"markdown-preview-nostyle",innerHTML:l.localHtml},null,8,i1)}]]);function Uo(t){return{text:"按钮",clickFn:null,type:"default",isHide:!1,order:2,...t}}Gt.install=function(t){t.component(Gt.name,Gt)},Zt.install=function(t){t.component(Zt.name,Zt)},Qt.install=function(t){t.component(Qt.name,Qt)},Jt.install=function(t){t.component(Jt.name,Jt)},qt.install=function(t){t.component(qt.name,qt)},Xt.install=function(t){t.component(Xt.name,Xt)},Kt.install=function(t){t.component(Kt.name,Kt)};class r1{constructor(o,a){this.WinVue=o,this.vmCompObj=null,this.vmComponent=null,this.vmApp=null,this.dialogObj=null,this.boxShow=e.ref(!1),this.boxProps=e.ref({}),this.boxOptions=K({closeIsConfirm:!1,closeIsDestroy:!0,width:"40%",title:"默认标题"},a.diyOpts),this.boxProps.value=Tl(this.boxOptions,["closeIsConfirm","closeIsDestroy"]),this.bodyComponent=a.component||"",this.bodyOptions=K({},a.props),this.bodyFunc=K({},a.onFunc);for(const i in this.bodyFunc)if(this.bodyFunc.hasOwnProperty(i)&&!i.startsWith("on")){const l="on"+i.charAt(0).toUpperCase()+i.slice(1);this.bodyFunc[l]=this.bodyFunc[i],delete this.bodyFunc[i]}this.defaultFunc={onOK:()=>{this.close()},onCancel:()=>{this.close()}},this._initVm()}_initVm(){var o=this;const a={data:()=>({}),methods:{clearVm(){o.vmApp&&o.close()}},mounted(){},unmounted(){},render(){const n=e.createVNode(o.bodyComponent,{...o.bodyOptions,ref:"inner",onSetTitle(h){o.boxProps.value.title=h},onClose:()=>o.close(),...o.bodyFunc},{default:()=>""});let r={ok:Uo({text:"确定",type:"primary",order:0}),cancel:Uo({text:"取消",order:1})};Object.entries(r).forEach(([h,u])=>{if(["ok","cancel"].includes(h)){const m=h==="ok"?o.defaultFunc.onOK:o.defaultFunc.onCancel;u.clickFn=u.clickFn||m}else r[h]=Uo(u)});const c=Object.values(r).filter(h=>!h.isHide);e.createVNode("div",{},c.map(h=>e.createVNode(k.ElButton,{type:h.type,onClick:h.clickFn},h.text)));const p=function(h){o.close()},d=typeof o.boxOptions.beforeClose=="function"?o.boxOptions.beforeClose:p;return e.createVNode(k.ElDialog,{...o.boxProps.value,modelValue:o.boxShow.value,beforeClose:h=>{o.boxOptions.closeIsConfirm?k.ElMessageBox.confirm("确认关闭?","提示").then(u=>{d(p)}).catch(u=>{p()}):d(p)},onClosed2(h){o.close()},onClosed:o.close},{default:()=>n})}};this.vmComponent=a;const i=document.createElement("div");document.body.appendChild(i),this.vmTargetElement=i;const l=e.createVNode(a);l.appContext=this.WinVue._context,e.render(l,this.vmTargetElement),this.vmApp=l}close(){this.boxShow&&(this.boxShow.value=!1),this.vmTargetElement&&(e.render(null,this.vmTargetElement),document.body.removeChild(this.vmTargetElement),this.vmApp=null)}show(){this.boxShow.value=!0}getInner(){return this.vmCompObj.$refs.inner}}function Wo(t){return{text:"按钮",clickFn:null,type:"default",isHide:!1,order:2,...t}}class s1{constructor(o,a){this.WinVue=o,this.vmCompObj=null,this.vmComponent=null,this.vmApp=null,this.dialogObj=null,this.boxShow=e.ref(!1),this.boxProps=e.ref({}),this.boxOptions=K({closeIsConfirm:!0,closeIsDestroy:!0,width:"40%",title:"默认标题"},a.diyOpts),this.boxProps.value=Tl(this.boxOptions,["closeIsConfirm","closeIsDestroy"]),this.bodyComponent=a.component||"",this.bodyOptions=K({},a.props),this.bodyFunc=K({},a.onFunc);for(const i in this.bodyFunc)if(this.bodyFunc.hasOwnProperty(i)&&!i.startsWith("on")){const l="on"+i.charAt(0).toUpperCase()+i.slice(1);this.bodyFunc[l]=this.bodyFunc[i],delete this.bodyFunc[i]}this.defaultFunc={onOK:()=>{this.close()},onCancel:()=>{this.close()}},this._initVm()}_initVm(){var o=this;const a={data:()=>({}),methods:{clearVm(){o.vmApp&&o.close()}},mounted(){},unmounted(){document.body.removeChild(o.vmTargetElement)},render(){const n=e.createVNode(o.bodyComponent,{...o.bodyOptions,ref:"inner",onSetTitle(h){o.boxProps.value.title=h},onClose:this.clearVm,...o.bodyFunc},{default:()=>""});let r={ok:Wo({text:"确定",type:"primary",order:0}),cancel:Wo({text:"取消",order:1})};Object.entries(r).forEach(([h,u])=>{if(["ok","cancel"].includes(h)){const m=h==="ok"?o.defaultFunc.onOK:o.defaultFunc.onCancel;u.clickFn=u.clickFn||m}else r[h]=Wo(u)});const c=Object.values(r).filter(h=>!h.isHide);e.createVNode("div",{},c.map(h=>e.createVNode(k.ElButton,{type:h.type,onClick:h.clickFn},h.text)));const p=function(h){o.close()},d=typeof o.boxOptions.beforeClose=="function"?o.boxOptions.beforeClose:p;return e.createVNode(k.ElDrawer,{...o.boxProps.value,modelValue:o.boxShow.value,beforeClose:h=>{o.boxOptions.closeIsConfirm?k.ElMessageBox.confirm("确认关闭?","提示").then(u=>{d(p)}).catch(u=>{p()}):d(p)},onClosed2(h){this.clearVm()},onClosed:this.clearVm},{default:()=>n})}};this.vmComponent=a;const i=document.createElement("div");document.body.appendChild(i),this.vmTargetElement=i;const l=e.createVNode(a);l.appContext=this.WinVue._context,e.render(l,this.vmTargetElement),this.vmApp=l}close(){this.boxShow.value=!1,e.render(null,this.vmTargetElement)}show(){this.boxShow.value=!0}getInner(){return this.vmCompObj.$refs.inner}}function ql(t,o=null,a={},i={},l={}){const n=new r1(t,{component:o,diyOpts:a,props:i,onFunc:l,onOK(){n.getInner(),n.close()},onCancel(){n.close()}});return n}function Xl(t,o="",a={},i={},l=null){const n=new s1(t,{component:o,diyOpts:{...a},props:i,onFunc:l,onOK(){n.getInner(),n.close()},onCancel(){n.close()}});return n}var Kl=[ve,ye,ke,be,we,Ve,xe,Se,Ne,Be,xn,Ee,De,Te,_e,Ie,Le,Oe,Me,Fe,$e,ze,Pe,He,Re,Ae,je,qe,Ue,We,Ye,Ze,Qe,Je,et,tt,ot,at,lt,nt,it,rt,st,ct,pt,ht,mt,ut,gt,kt,bt,dt,vt,yt,Vt,wt,xt,Lt,Ft,$t,Ot,Mt,zt,St,Nt,Bt,Et,Dt,Tt,_t,It,ft,Ct,Ke,Ge,Pt,Ht,At,Rt,jt,Ut,Wt,qt,Xt,Kt,Gt,Zt,Qt,Jt];const Jo=function(t,o={}){Kl.forEach(a=>{t.component(a.name,a)}),t.config.globalProperties.$cvUiParams={...o},t.config.globalProperties.$cvDialogRender=function(){return ql(t,...arguments)},t.config.globalProperties.$cvCopy=qn,t.config.globalProperties.$cvDrawerRender=function(){return Xl(t,...arguments)},t.config.globalProperties.CDN_URL_UI="https://10ui.cn/"};typeof window<"u"&&window._vueApp_&&Jo(window._vueApp_);const c1={version:"0.3.x",install:Jo};exports.components=Kl,exports.cvDialogRender=ql,exports.cvDrawerRender=Xl,exports.default=c1,exports.install=Jo;
|
|
58
|
+
`);t[t.length-1]===""&&(this.lastInsert="")},mousescrollSide(t){this.scrollSide=t},handlePaste(t){const{clipboardData:o={}}=t,{types:a=[],items:i}=o;let l=null;for(let n=0;n<a.length;n++)if(a[n]==="Files"){l=i[n];break}if(l){const n=l.getAsFile();/image/gi.test(n.type)&&(this.$emit("on-upload-image",n),this.$emit("on-paste-image",n),t.preventDefault())}},markdownScroll(){const{scrolling:t}=this;if(t&&this.scroll==="left"){const o=this.$refs.markdownEditor,a=this.$refs.preview,i=a.offsetHeight,l=o.scrollHeight,n=o.scrollTop,r=a.scrollHeight;a.scrollTop=parseInt(n/(l-i)*(r-i),0)}},previewScroll(){const{scrolling:t}=this;if(t&&this.scroll==="right"){const o=this.$refs.markdownEditor,a=this.$refs.preview,i=a.offsetHeight,l=o.scrollHeight,n=a.scrollHeight,r=a.scrollTop;o.scrollTop=parseInt(r/(n-i)*(l-i),0)}},mousescrollSide(t){this.scroll=t}}},Vg={key:0,title:"头部工具栏"},xg={class:"cv-editor-toolbars"},Sg={key:0,name:"粗体"},Ng={key:1,name:"斜体"},Bg={key:2,name:"删除线"},Eg={key:3,name:"下划线"},Dg={key:4,name:"标题1"},_g={key:5,name:"标题2"},Tg={key:6,name:"标题3"},Ig={key:7,name:"标题4"},Lg={key:8,name:"标题5"},Fg={key:9,name:"标题6"},$g={key:10,name:"分割线"},Og={key:11,name:"引用"},Mg={key:12,name:"无序列表"},zg={key:13,name:"有序列表"},Pg={key:14,name:"未完成列表"},Hg={key:15,name:"已完成列表"},Ag={key:16,name:"链接"},jg={key:17,name:"表格"},Rg=["name"],Ug={key:19,name:"全屏编辑"},Wg={key:20,name:"分屏显示"},Yg={key:21,name:"预览"},qg={class:"cv-editor-toolbars"},Xg={key:0,name:"图片"},Kg={key:1,name:"本地图片"},Gg={key:2,name:"图片空间"},Zg={key:3,name:"上传图片"},Qg={key:4,name:"上传文件"},Jg={key:5,class:"shift-theme",name:"代码块主题"},e1={name:"导入文件",class:"import-file"},t1={name:"保存到本地"},o1={key:6,name:"全屏"},a1={key:7,name:"退出全屏"},l1=["innerHTML"],Jt=v(wg,[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`markdown ${l.fullscreen?"fullscreen":""} ${a.bordered?"border":""}`),ref:"markdown",style:e.normalizeStyle({width:a.width+(typeof a.width=="string"?"":"px"),height:a.height+(typeof a.height=="string"?"":"px")})},[t.actionPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Vg,[e.createElementVNode("ul",xg,[e.createElementVNode("li",null,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),t.toolConfig.strong?(e.openBlock(),e.createElementBlock("li",Sg,[e.createElementVNode("span",{onClick:o[0]||(o[0]=(...r)=>t.actionInsStrong&&t.actionInsStrong(...r)),class:"iconfont icon-bold"})])):e.createCommentVNode("",!0),t.toolConfig.italic?(e.openBlock(),e.createElementBlock("li",Ng,[e.createElementVNode("span",{onClick:o[1]||(o[1]=(...r)=>t.actionInsItalic&&t.actionInsItalic(...r)),class:"iconfont icon-italic"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",Bg,[e.createElementVNode("span",{onClick:o[2]||(o[2]=(...r)=>t.actionInsOverline&&t.actionInsOverline(...r)),class:"iconfont icon-overline"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",Eg,[e.createElementVNode("span",{onClick:o[3]||(o[3]=(...r)=>t.actionInsUnderline&&t.actionInsUnderline(...r)),class:"iconfont icon-under-line"})])):e.createCommentVNode("",!0),t.toolConfig.h1?(e.openBlock(),e.createElementBlock("li",Dg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[4]||(o[4]=r=>t.actionInsTitle(1))},"h1")])):e.createCommentVNode("",!0),t.toolConfig.h2?(e.openBlock(),e.createElementBlock("li",_g,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[5]||(o[5]=r=>t.actionInsTitle(2))},"h2")])):e.createCommentVNode("",!0),t.toolConfig.h3?(e.openBlock(),e.createElementBlock("li",Tg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[6]||(o[6]=r=>t.actionInsTitle(3))},"h3")])):e.createCommentVNode("",!0),t.toolConfig.h4?(e.openBlock(),e.createElementBlock("li",Ig,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[7]||(o[7]=r=>t.actionInsTitle(4))},"h4")])):e.createCommentVNode("",!0),t.toolConfig.h5?(e.openBlock(),e.createElementBlock("li",Lg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[8]||(o[8]=r=>t.actionInsTitle(5))},"h5")])):e.createCommentVNode("",!0),t.toolConfig.h6?(e.openBlock(),e.createElementBlock("li",Fg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[9]||(o[9]=r=>t.actionInsTitle(6))},"h6")])):e.createCommentVNode("",!0),t.toolConfig.hr?(e.openBlock(),e.createElementBlock("li",$g,[e.createElementVNode("span",{onClick:o[10]||(o[10]=(...r)=>t.actionInsLine&&t.actionInsLine(...r)),class:"iconfont icon-horizontal"})])):e.createCommentVNode("",!0),t.toolConfig.quote?(e.openBlock(),e.createElementBlock("li",Og,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[11]||(o[11]=(...r)=>t.actionInsQuote&&t.actionInsQuote(...r)),class:"iconfont icon-quote"})])):e.createCommentVNode("",!0),t.toolConfig.ul?(e.openBlock(),e.createElementBlock("li",Mg,[e.createElementVNode("span",{onClick:o[12]||(o[12]=(...r)=>t.actionInsUl&&t.actionInsUl(...r)),class:"iconfont icon-ul"})])):e.createCommentVNode("",!0),t.toolConfig.ol?(e.openBlock(),e.createElementBlock("li",zg,[e.createElementVNode("span",{onClick:o[13]||(o[13]=(...r)=>t.actionInsOl&&t.actionInsOl(...r)),class:"iconfont icon-ol"})])):e.createCommentVNode("",!0),t.toolConfig.notChecked?(e.openBlock(),e.createElementBlock("li",Pg,[e.createElementVNode("span",{onClick:o[14]||(o[14]=(...r)=>t.insertNotFinished&&t.insertNotFinished(...r)),class:"iconfont icon-checked-false"})])):e.createCommentVNode("",!0),t.toolConfig.checked?(e.openBlock(),e.createElementBlock("li",Hg,[e.createElementVNode("span",{onClick:o[15]||(o[15]=(...r)=>t.insertFinished&&t.insertFinished(...r)),class:"iconfont icon-checked"})])):e.createCommentVNode("",!0),t.toolConfig.link?(e.openBlock(),e.createElementBlock("li",Ag,[e.createElementVNode("span",{onClick:o[16]||(o[16]=(...r)=>t.actionInsLink&&t.actionInsLink(...r)),class:"iconfont icon-link"})])):e.createCommentVNode("",!0),t.toolConfig.table?(e.openBlock(),e.createElementBlock("li",jg,[e.createElementVNode("span",{onClick:o[17]||(o[17]=(...r)=>t.actionInsTable&&t.actionInsTable(...r)),class:"iconfont icon-table"})])):e.createCommentVNode("",!0),o[53]||(o[53]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.scrollSync?(e.openBlock(),e.createElementBlock("li",{key:18,name:t.actionScrollSync?"同步滚动:开":"同步滚动:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[18]||(o[18]=r=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-on"},null,512),[[e.vShow,t.actionScrollSync]]),e.withDirectives(e.createElementVNode("span",{onClick:o[19]||(o[19]=r=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-off"},null,512),[[e.vShow,!t.actionScrollSync]])],8,Rg)):e.createCommentVNode("",!0),t.toolConfig.split&&t.actionSplit?(e.openBlock(),e.createElementBlock("li",Ug,[e.createElementVNode("span",{onClick:o[20]||(o[20]=r=>t.actionSplit=!1),class:"iconfont icon-md"})])):e.createCommentVNode("",!0),t.toolConfig.split&&!t.actionSplit?(e.openBlock(),e.createElementBlock("li",Wg,[e.createElementVNode("span",{onClick:o[21]||(o[21]=r=>t.actionSplit=!0),class:"iconfont icon-group"})])):e.createCommentVNode("",!0),t.toolConfig.preview?(e.openBlock(),e.createElementBlock("li",Yg,[e.createElementVNode("span",{onClick:o[22]||(o[22]=r=>t.actionPreview=!0),class:"iconfont icon-preview"})])):e.createCommentVNode("",!0),t.toolConfig.clear?(e.openBlock(),e.createElementBlock("li",{key:22,name:"清空",onClick:o[23]||(o[23]=r=>l.localVal="")},[...o[51]||(o[51]=[e.createElementVNode("span",{class:"iconfont icon-clear"},null,-1)])])):e.createCommentVNode("",!0),t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",{key:23,name:"保存",onClick:o[24]||(o[24]=(...r)=>t.actionSaveSet&&t.actionSaveSet(...r))},[...o[52]||(o[52]=[e.createElementVNode("span",{class:"iconfont icon-save"},null,-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("ul",qg,[t.toolConfig.image?(e.openBlock(),e.createElementBlock("li",Xg,[e.createElementVNode("span",{onClick:o[25]||(o[25]=(...r)=>t.actionInsImage&&t.actionInsImage(...r)),class:"iconfont icon-img"})])):e.createCommentVNode("",!0),t.toolConfig.uploadImage?(e.openBlock(),e.createElementBlock("li",Kg,[e.createElementVNode("span",{onClick:o[26]||(o[26]=(...r)=>t.actionChooseImage&&t.actionChooseImage(...r)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_image?(e.openBlock(),e.createElementBlock("li",Gg,[e.createElementVNode("span",{onClick:o[27]||(o[27]=(...r)=>t.custom_actionInsImage&&t.custom_actionInsImage(...r)),class:"iconfont icon-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadImage?(e.openBlock(),e.createElementBlock("li",Zg,[e.createElementVNode("span",{onClick:o[28]||(o[28]=(...r)=>t.custom_chooseImage&&t.custom_chooseImage(...r)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadFile?(e.openBlock(),e.createElementBlock("li",Qg,[e.createElementVNode("span",{onClick:o[29]||(o[29]=(...r)=>t.custom_chooseFile&&t.custom_chooseFile(...r)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.theme?(e.openBlock(),e.createElementBlock("li",Jg,[e.createElementVNode("div",null,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[30]||(o[30]=r=>l.themeSlideDown=!l.themeSlideDown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:l.themeSlideDown}),onMouseleave:o[35]||(o[35]=r=>l.themeSlideDown=!1)},[e.createElementVNode("li",{onClick:o[31]||(o[31]=r=>t.setThemes("light"))},"Light"),e.createElementVNode("li",{onClick:o[32]||(o[32]=r=>t.setThemes("dark"))},"VS Code"),e.createElementVNode("li",{onClick:o[33]||(o[33]=r=>t.setThemes("oneDark"))},"Atom OneDark"),e.createElementVNode("li",{onClick:o[34]||(o[34]=r=>t.setThemes("gitHub"))},"GitHub")],34)])])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("li",e1,[e.createElementVNode("span",{class:"iconfont icon-daoru",onClick:o[36]||(o[36]=(...r)=>t.actionImportFile&&t.actionImportFile(...r))}),e.createElementVNode("input",{type:"file",onChange:o[37]||(o[37]=r=>t.actionImportFile(r)),accept:"text/markdown"},null,32)],512),[[e.vShow,t.toolConfig.importmd]]),e.withDirectives(e.createElementVNode("li",t1,[e.createElementVNode("span",{class:"iconfont icon-download",onClick:o[38]||(o[38]=(...r)=>t.actionExportFile&&t.actionExportFile(...r))})],512),[[e.vShow,t.toolConfig.exportmd]]),o[54]||(o[54]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.fullscreen&&!l.fullscreen?(e.openBlock(),e.createElementBlock("li",o1,[e.createElementVNode("span",{onClick:o[39]||(o[39]=r=>l.fullscreen=!l.fullscreen),class:"iconfont icon-fullscreen"})])):e.createCommentVNode("",!0),t.toolConfig.fullscreen&&l.fullscreen?(e.openBlock(),e.createElementBlock("li",a1,[e.createElementVNode("span",{onClick:o[40]||(o[40]=r=>l.fullscreen=!l.fullscreen),class:"iconfont icon-quite"})])):e.createCommentVNode("",!0)])])),e.withDirectives(e.createElementVNode("div",{title:"关闭预览按钮",class:"close-preview",onClick:o[41]||(o[41]=r=>t.actionPreview=!1)},[...o[55]||(o[55]=[e.createElementVNode("span",{class:"iconfont icon-close"},null,-1)])],512),[[e.vShow,t.actionPreview]]),e.createElementVNode("div",{title:"编辑器",class:"cv-editor-markdown-main",style:e.normalizeStyle({background:t.actionPreview?"#fff":""})},[e.withDirectives(e.createElementVNode("div",{class:"markdown-editor",ref:"markdownEditor",onScroll:o[47]||(o[47]=(...r)=>n.markdownScroll&&n.markdownScroll(...r)),onMouseenter:o[48]||(o[48]=r=>n.mousescrollSide("markdown"))},[e.createElementVNode("ul",{class:"index",ref:"index",style:e.normalizeStyle({height:l.textareaHeight?`${l.textareaHeight}px`:"100%"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.indexLenth,r=>(e.openBlock(),e.createElementBlock("li",{key:r},e.toDisplayString(r),1))),128))],4),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":o[42]||(o[42]=r=>l.localVal=r),ref:"textarea",onKeydown:o[43]||(o[43]=e.withKeys((...r)=>n.tab&&n.tab(...r),["tab"])),onKeyup:[o[44]||(o[44]=e.withKeys((...r)=>n.enter&&n.enter(...r),["enter"])),o[45]||(o[45]=e.withKeys((...r)=>n.onDelete&&n.onDelete(...r),["delete"]))],onMouseenter:o[46]||(o[46]=r=>n.mousescrollSide("left")),style:e.normalizeStyle({height:l.textareaHeight?`${l.textareaHeight}px`:"100%"})},null,36),[[e.vModelText,l.localVal]])],544),[[e.vShow,!t.preview]]),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass("markdown-preview "+("markdown-theme-"+t.codemrrConfig.theme)),ref:"preview",onScroll:o[49]||(o[49]=(...r)=>n.previewScroll&&n.previewScroll(...r)),onMouseenter:o[50]||(o[50]=r=>n.mousescrollSide("right"))},[e.createElementVNode("div",{innerHTML:l.html,ref:"previewInner"},null,8,l1)],34),[[e.vShow,t.preview?t.preview:t.split]])],4)],6)}],["__scopeId","data-v-36211c6f"]]),n1=["innerHTML"],eo=v({name:"cvMarkdownNostyle",props:{modelValue:{type:String,default:""},initValue:{type:String,default:""}},data:()=>({localHtml:"",localVal:""}),watch:{initValue(){this.initNewCreate()}},created(){this.localVal=this.initValue||""},async mounted(){this.initNewCreate()},methods:{async initNewCreate(){const{Marked:t,Renderer:o}=await import("https://10ui.cn/marked/@12.0.1/marked.esm.js");let a=new t().parser(this.localVal,{sanitize:!1});a=a.replace(/href="/gi,'target="_blank" href="'),this.localHtml=a}}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:"markdown-preview-nostyle",innerHTML:l.localHtml},null,8,n1)}]]);function Wo(t){return{text:"按钮",clickFn:null,type:"default",isHide:!1,order:2,...t}}Zt.install=function(t){t.component(Zt.name,Zt)},Qt.install=function(t){t.component(Qt.name,Qt)},Jt.install=function(t){t.component(Jt.name,Jt)},eo.install=function(t){t.component(eo.name,eo)},Xt.install=function(t){t.component(Xt.name,Xt)},Kt.install=function(t){t.component(Kt.name,Kt)},Gt.install=function(t){t.component(Gt.name,Gt)};class i1{constructor(o,a){this.WinVue=o,this.vmCompObj=null,this.vmComponent=null,this.vmApp=null,this.dialogObj=null,this.boxShow=e.ref(!1),this.boxProps=e.ref({}),this.boxOptions=K({closeIsConfirm:!1,closeIsDestroy:!0,width:"40%",title:"默认标题"},a.diyOpts),this.boxProps.value=_l(this.boxOptions,["closeIsConfirm","closeIsDestroy"]),this.bodyComponent=a.component||"",this.bodyOptions=K({},a.props),this.bodyFunc=K({},a.onFunc);for(const i in this.bodyFunc)if(this.bodyFunc.hasOwnProperty(i)&&!i.startsWith("on")){const l="on"+i.charAt(0).toUpperCase()+i.slice(1);this.bodyFunc[l]=this.bodyFunc[i],delete this.bodyFunc[i]}this.defaultFunc={onOK:()=>{this.close()},onCancel:()=>{this.close()}},this._initVm()}_initVm(){var o=this;const a={data:()=>({}),methods:{clearVm(){o.vmApp&&o.close()}},mounted(){},unmounted(){},render(){const n=e.createVNode(o.bodyComponent,{...o.bodyOptions,ref:"inner",onSetTitle(h){o.boxProps.value.title=h},onClose:()=>o.close(),...o.bodyFunc},{default:()=>""});let r={ok:Wo({text:"确定",type:"primary",order:0}),cancel:Wo({text:"取消",order:1})};Object.entries(r).forEach(([h,u])=>{if(["ok","cancel"].includes(h)){const m=h==="ok"?o.defaultFunc.onOK:o.defaultFunc.onCancel;u.clickFn=u.clickFn||m}else r[h]=Wo(u)});const c=Object.values(r).filter(h=>!h.isHide);e.createVNode("div",{},c.map(h=>e.createVNode(k.ElButton,{type:h.type,onClick:h.clickFn},h.text)));const p=function(h){o.close()},d=typeof o.boxOptions.beforeClose=="function"?o.boxOptions.beforeClose:p;return e.createVNode(k.ElDialog,{...o.boxProps.value,modelValue:o.boxShow.value,beforeClose:h=>{o.boxOptions.closeIsConfirm?k.ElMessageBox.confirm("确认关闭?","提示").then(u=>{d(p)}).catch(u=>{p()}):d(p)},onClosed2(h){o.close()},onClosed:o.close},{default:()=>n})}};this.vmComponent=a;const i=document.createElement("div");document.body.appendChild(i),this.vmTargetElement=i;const l=e.createVNode(a);l.appContext=this.WinVue._context,e.render(l,this.vmTargetElement),this.vmApp=l}close(){this.boxShow&&(this.boxShow.value=!1),this.vmTargetElement&&(e.render(null,this.vmTargetElement),document.body.removeChild(this.vmTargetElement),this.vmApp=null)}show(){this.boxShow.value=!0}getInner(){return this.vmCompObj.$refs.inner}}function Yo(t){return{text:"按钮",clickFn:null,type:"default",isHide:!1,order:2,...t}}class r1{constructor(o,a){this.WinVue=o,this.vmCompObj=null,this.vmComponent=null,this.vmApp=null,this.dialogObj=null,this.boxShow=e.ref(!1),this.boxProps=e.ref({}),this.boxOptions=K({closeIsConfirm:!0,closeIsDestroy:!0,width:"40%",title:"默认标题"},a.diyOpts),this.boxProps.value=_l(this.boxOptions,["closeIsConfirm","closeIsDestroy"]),this.bodyComponent=a.component||"",this.bodyOptions=K({},a.props),this.bodyFunc=K({},a.onFunc);for(const i in this.bodyFunc)if(this.bodyFunc.hasOwnProperty(i)&&!i.startsWith("on")){const l="on"+i.charAt(0).toUpperCase()+i.slice(1);this.bodyFunc[l]=this.bodyFunc[i],delete this.bodyFunc[i]}this.defaultFunc={onOK:()=>{this.close()},onCancel:()=>{this.close()}},this._initVm()}_initVm(){var o=this;const a={data:()=>({}),methods:{clearVm(){o.vmApp&&o.close()}},mounted(){},unmounted(){document.body.removeChild(o.vmTargetElement)},render(){const n=e.createVNode(o.bodyComponent,{...o.bodyOptions,ref:"inner",onSetTitle(h){o.boxProps.value.title=h},onClose:this.clearVm,...o.bodyFunc},{default:()=>""});let r={ok:Yo({text:"确定",type:"primary",order:0}),cancel:Yo({text:"取消",order:1})};Object.entries(r).forEach(([h,u])=>{if(["ok","cancel"].includes(h)){const m=h==="ok"?o.defaultFunc.onOK:o.defaultFunc.onCancel;u.clickFn=u.clickFn||m}else r[h]=Yo(u)});const c=Object.values(r).filter(h=>!h.isHide);e.createVNode("div",{},c.map(h=>e.createVNode(k.ElButton,{type:h.type,onClick:h.clickFn},h.text)));const p=function(h){o.close()},d=typeof o.boxOptions.beforeClose=="function"?o.boxOptions.beforeClose:p;return e.createVNode(k.ElDrawer,{...o.boxProps.value,modelValue:o.boxShow.value,beforeClose:h=>{o.boxOptions.closeIsConfirm?k.ElMessageBox.confirm("确认关闭?","提示").then(u=>{d(p)}).catch(u=>{p()}):d(p)},onClosed2(h){this.clearVm()},onClosed:this.clearVm},{default:()=>n})}};this.vmComponent=a;const i=document.createElement("div");document.body.appendChild(i),this.vmTargetElement=i;const l=e.createVNode(a);l.appContext=this.WinVue._context,e.render(l,this.vmTargetElement),this.vmApp=l}close(){this.boxShow.value=!1,e.render(null,this.vmTargetElement)}show(){this.boxShow.value=!0}getInner(){return this.vmCompObj.$refs.inner}}function ql(t,o=null,a={},i={},l={}){const n=new i1(t,{component:o,diyOpts:a,props:i,onFunc:l,onOK(){n.getInner(),n.close()},onCancel(){n.close()}});return n}function Xl(t,o="",a={},i={},l=null){const n=new r1(t,{component:o,diyOpts:{...a},props:i,onFunc:l,onOK(){n.getInner(),n.close()},onCancel(){n.close()}});return n}var Kl=[ye,ke,be,we,Ve,xe,Se,Ne,Be,Ee,xn,De,_e,Te,Ie,Le,Fe,Me,ze,$e,Oe,Pe,He,Ae,Ue,je,Re,Xe,We,Ye,qe,Qe,Je,et,tt,ot,at,lt,nt,it,rt,st,ct,dt,ht,mt,ut,gt,ft,bt,wt,pt,yt,kt,xt,Vt,St,Ft,$t,Ot,Mt,zt,Pt,Nt,Bt,Et,Dt,_t,Tt,It,Lt,Ct,vt,Ge,Ze,Ht,At,jt,Ut,Rt,Wt,Yt,Xt,Kt,Gt,Zt,Qt,Jt,eo];const Jo=function(t,o={}){Kl.forEach(a=>{t.component(a.name,a)}),t.config.globalProperties.$cvUiParams={...o},t.config.globalProperties.$cvDialogRender=function(){return ql(t,...arguments)},t.config.globalProperties.$cvCopy=qn,t.config.globalProperties.$cvDrawerRender=function(){return Xl(t,...arguments)},t.config.globalProperties.CDN_URL_UI="https://10ui.cn/"};typeof window<"u"&&window._vueApp_&&Jo(window._vueApp_);const s1={version:"0.3.x",install:Jo};exports.components=Kl,exports.cvDialogRender=ql,exports.cvDrawerRender=Xl,exports.default=s1,exports.install=Jo;
|