@gis_victory/curd-form 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/curd-form.es.js +7 -2
- package/dist/curd-form.umd.js +2 -2
- package/package.json +1 -1
package/dist/curd-form.es.js
CHANGED
|
@@ -31,7 +31,7 @@ const qS = {
|
|
|
31
31
|
setup(e, { emit: t }) {
|
|
32
32
|
const n = e;
|
|
33
33
|
let r = n.modelValue;
|
|
34
|
-
const i = n.item.type === "
|
|
34
|
+
const i = n.item.type === "multi-select" || n.item.type === "checkbox" || n.item.searchFormType === "multi-select" || n.item.searchFormType === "checkbox";
|
|
35
35
|
i && typeof r == "string" && r && (r = r.split(","));
|
|
36
36
|
const o = Oe(r);
|
|
37
37
|
Oe([]);
|
|
@@ -83,7 +83,7 @@ const qS = {
|
|
|
83
83
|
}, null, 8, ["label", "value"]))), 128))
|
|
84
84
|
]),
|
|
85
85
|
_: 1
|
|
86
|
-
}, 8, ["modelValue", "placeholder", "disabled", "readonly"])) : e.item.searchFormType === "
|
|
86
|
+
}, 8, ["modelValue", "placeholder", "disabled", "readonly"])) : e.item.searchFormType === "multi-select" || e.item.type === "multi-select" ? (z(), ge(B(Mu), {
|
|
87
87
|
key: 1,
|
|
88
88
|
modelValue: o.value,
|
|
89
89
|
"onUpdate:modelValue": d[1] || (d[1] = (u) => o.value = u),
|
|
@@ -83613,6 +83613,11 @@ class gU {
|
|
|
83613
83613
|
const i = this.dictionaryMap.get(r) || [];
|
|
83614
83614
|
if (!i || i.length === 0)
|
|
83615
83615
|
return n;
|
|
83616
|
+
if (t.showMethod === "multi-select")
|
|
83617
|
+
return n.map((a) => {
|
|
83618
|
+
const s = i.find((l) => l.id === a);
|
|
83619
|
+
return s ? s.name : a;
|
|
83620
|
+
}).join(", ");
|
|
83616
83621
|
const o = i.find((a) => a.id === n);
|
|
83617
83622
|
return o ? o.name : n;
|
|
83618
83623
|
}
|
package/dist/curd-form.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(qt,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("vue"),require("element-plus"),require("@gis_victory/gismap")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","@gis_victory/gismap"],g):(qt=typeof globalThis<"u"?globalThis:qt||self,g(qt.CurdForm={},qt.Vue,qt.ElementPlus,qt.GisMap))})(this,(function(qt,g,B,iu){"use strict";const QE={name:"FormItem"},ou=g.defineComponent({...QE,props:{modelValue:{type:[String,Number,Array,Boolean,null],default:()=>""},item:{type:Object,default:()=>({})},dropdownOptions:{type:Array,default:()=>[]},currentOperationType:{type:String,default:"default"},headers:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e;let r=n.modelValue;const i=n.item.type==="multiple-select"||n.item.type==="checkbox"||n.item.searchFormType==="multiple-select"||n.item.searchFormType==="checkbox";i&&typeof r=="string"&&r&&(r=r.split(","));const o=g.ref(r);g.ref([]);const a=t,s=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1}),l=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1});return g.watch(o,c=>{let d=c;i&&Array.isArray(c)&&(d=c.join(",")),a("update:modelValue",d)}),g.watch(()=>n.modelValue,c=>{let d=c;i&&typeof c=="string"&&c&&(d=c.split(",")),o.value=d}),(c,d)=>e.item.searchFormType==="select"||e.item.type==="select"?(g.openBlock(),g.createBlock(g.unref(B.ElSelect),{key:0,modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=u=>o.value=u),placeholder:e.item.placeholder||"请选择",disabled:s.value,readonly:l.value,clearable:""},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElOption),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="multiple-select"||e.item.type==="multiple-select"?(g.openBlock(),g.createBlock(g.unref(B.ElSelect),{key:1,modelValue:o.value,"onUpdate:modelValue":d[1]||(d[1]=u=>o.value=u),placeholder:e.item.placeholder||"请选择",multiple:"",disabled:s.value,readonly:l.value,clearable:""},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElOption),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="date"||e.item.type==="date"?(g.openBlock(),g.createBlock(g.unref(B.ElDatePicker),{key:2,modelValue:o.value,"onUpdate:modelValue":d[2]||(d[2]=u=>o.value=u),type:"date","value-format":"YYYY-MM-DD",placeholder:e.item.placeholder||"请选择日期",disabled:s.value,readonly:l.value,clearable:"",style:{width:"100%"}},null,8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="daterange"||e.item.type==="daterange"?(g.openBlock(),g.createBlock(g.unref(B.ElDatePicker),{key:3,modelValue:o.value,"onUpdate:modelValue":d[3]||(d[3]=u=>o.value=u),type:"daterange","value-format":"yyyy-MM-dd",placeholder:e.item.placeholder||"请选择日期范围",disabled:s.value,readonly:l.value,clearable:""},null,8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="checkbox"||e.item.type==="checkbox"?(g.openBlock(),g.createBlock(g.unref(B.ElCheckboxGroup),{key:4,modelValue:o.value,"onUpdate:modelValue":d[4]||(d[4]=u=>o.value=u),disabled:s.value,readonly:l.value},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElCheckbox),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled","readonly"])):e.item.searchFormType==="radio"||e.item.type==="radio"?(g.openBlock(),g.createBlock(g.unref(B.ElRadioGroup),{key:5,modelValue:o.value,"onUpdate:modelValue":d[5]||(d[5]=u=>o.value=u),disabled:s.value,readonly:l.value},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElRadio),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled","readonly"])):e.item.searchFormType==="textarea"||e.item.type==="textarea"?(g.openBlock(),g.createBlock(g.unref(B.ElInput),{key:6,modelValue:o.value,"onUpdate:modelValue":d[6]||(d[6]=u=>o.value=u),type:"textarea",placeholder:e.item.placeholder||"请输入",disabled:s.value,readonly:l.value,clearable:""},null,8,["modelValue","placeholder","disabled","readonly"])):(g.openBlock(),g.createBlock(g.unref(B.ElInput),{key:7,modelValue:o.value,"onUpdate:modelValue":d[7]||(d[7]=u=>o.value=u),placeholder:e.item.placeholder||"请输入",disabled:s.value,readonly:l.value,clearable:""},null,8,["modelValue","placeholder","disabled","readonly"]))}});var ZE=g.defineComponent({name:"CircleClose",__name:"circle-close",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),g.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),XE=ZE,JE=g.defineComponent({name:"Delete",__name:"delete",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),au=JE,eS=g.defineComponent({name:"Document",__name:"document",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),su=eS,tS=g.defineComponent({name:"Download",__name:"download",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"})]))}}),nS=tS,rS=g.defineComponent({name:"EditPen",__name:"edit-pen",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"m199.04 672.64 193.984 112 224-387.968-193.92-112-224 388.032zm-23.872 60.16 32.896 148.288 144.896-45.696zM455.04 229.248l193.92 112 56.704-98.112-193.984-112zM104.32 708.8l384-665.024 304.768 175.936L409.152 884.8h.064l-248.448 78.336zm384 254.272v-64h448v64z"})]))}}),iS=rS,oS=g.defineComponent({name:"Files",__name:"files",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M128 384v448h768V384zm-32-64h832a32 32 0 0 1 32 32v512a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V352a32 32 0 0 1 32-32m64-128h704v64H160zm96-128h512v64H256z"})]))}}),lu=oS,aS=g.defineComponent({name:"Headset",__name:"headset",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M896 529.152V512a384 384 0 1 0-768 0v17.152A128 128 0 0 1 320 640v128a128 128 0 1 1-256 0V512a448 448 0 1 1 896 0v256a128 128 0 1 1-256 0V640a128 128 0 0 1 192-110.848M896 640a64 64 0 0 0-128 0v128a64 64 0 0 0 128 0zm-768 0v128a64 64 0 0 0 128 0V640a64 64 0 1 0-128 0"})]))}}),sS=aS,lS=g.defineComponent({name:"Menu",__name:"menu",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z"})]))}}),cS=lS,dS=g.defineComponent({name:"MoreFilled",__name:"more-filled",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M176 416a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224"})]))}}),uS=dS,pS=g.defineComponent({name:"Plus",__name:"plus",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),mS=pS,hS=g.defineComponent({name:"VideoCamera",__name:"video-camera",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M704 768V256H128v512zm64-416 192-96v512l-192-96v128a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zm0 71.552v176.896l128 64V359.552zM192 320h192v64H192z"})]))}}),_S=hS,gS=g.defineComponent({name:"ZoomIn",__name:"zoom-in",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}}),cu=gS;const fS=(e,t)=>{let n=[];if(e)try{n=JSON.parse(e)}catch(r){console.log(r)}return Array.isArray(n)?n.map(r=>({...r,url:ES(r,t)})):[]},ES=(e,t)=>{if(e==null||t==null)return null;{let n=[];return(e.fileName||e.filename)&&n.push(`fileName=${e.fileName||e.filename}`),(e.floderName||e.flodername)&&n.push(`floderName=${e.floderName||e.flodername}`),e.position&&n.push(`position=${e.position}`),`${t}&${n.join("&")}`}},SS={class:"custom-upload-file"},bS=["src"],yS={class:"file-actions"},CS=["onClick"],vS=["onClick"],TS={class:"file-name"},NS={class:"file-actions"},OS=["onClick"],RS=["onClick"],AS={name:"FormItemUpLoad"},wS=g.defineComponent({...AS,props:{modelValue:{type:[String,Number,Array,Boolean,null],default:()=>""},item:{type:Object,default:()=>({})},currentOperationType:{type:String,default:"default"},upload:{type:String,default:""},download:{type:String,default:""},headers:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=g.ref(n.modelValue),i=g.ref([]),o=g.ref(!1),a=g.ref([]),s=g.ref(""),l=t,c=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1}),d=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1}),u=(E,C)=>{},p=E=>{const C=i.value.filter(v=>v.uid!==E.uid);i.value=C,_(C)},m=(E,C,v)=>{B.ElMessage.error("文件上传失败")},h=(E,C,v)=>{E.success?(C.filename=E.data?.filename,C.position=E.data?.position,C.floder=E.data?.floder,B.ElMessage.success("文件上传成功"),_(v)):B.ElMessage.error(E.message||"文件上传失败")},_=E=>{if(!E||E.length===0){r.value="[]";return}const C=E.map(v=>v.response?{fileName:v.response.data?.fileName,position:v.response.data?.position,floderName:v.response.data?.floderName}:{fileName:v.fileName,position:v.position,floderName:v.floderName});r.value=JSON.stringify(C)},f=E=>{const C=b(E.name||E.fileName),v=E.url||(E.response?.data?.position?n.download+"/"+E.response.data.position:"");C==="image"?(a.value=[v],o.value=!0):window.open(v,"_blank")},b=E=>{if(!E)return"other";const C=E.toLowerCase().split(".").pop()||"",v=["jpg","jpeg","png","gif","bmp","webp","svg"],N="pdf",w=["doc","docx","xls","xlsx","ppt","pptx","txt"],O=["mp4","avi","mov","wmv","flv","mkv"],L=["mp3","wav","flac","aac","ogg"];return v.includes(C)?"image":C===N?"pdf":w.includes(C)?"document":O.includes(C)?"video":L.includes(C)?"audio":"other"},S=E=>{switch(b(E)){case"pdf":return su;case"document":return su;case"video":return _S;case"audio":return sS;case"image":return lu;default:return lu}},y=E=>{switch(b(E)){case"pdf":return"#f56c6c";case"document":return"#409eff";case"video":return"#67c23a";case"audio":return"#e6a23c";default:return"#909399"}};return g.watch(r,E=>{l("update:modelValue",E)}),g.watch(()=>n.modelValue,E=>{let C=E;r.value=C}),g.onMounted(()=>{if((n.item.type==="upload"||n.item.showMethod==="upload")&&n.modelValue&&n.modelValue!==""){i.value=fS(n.modelValue,n.download)||[],a.value=i.value.map(E=>E.url),s.value=a.value[0]||"";debugger}}),(E,C)=>e.currentOperationType=="column"?(g.openBlock(),g.createBlock(g.unref(B.ElImage),{key:0,src:s.value,"preview-src-list":a.value,"initial-index":0,fit:"cover","preview-teleported":"",style:{width:"100%",height:"100%"}},null,8,["src","preview-src-list"])):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createVNode(g.unref(B.ElUpload),{"file-list":i.value,"onUpdate:fileList":C[0]||(C[0]=v=>i.value=v),action:e.upload,name:"uploadFile",headers:e.headers,accept:e.item.uploadAllowFormat||"image/*",limit:e.item.uploadCountLimit?Number(e.item.uploadCountLimit):0,"list-type":"picture-card","on-exceed":u,"on-success":h,"on-error":m,disabled:c.value,readonly:d.value,class:g.normalizeClass(["upload-small",{"upload-hidden":c.value}]),"on-preview":f,style:{width:"100%"}},{file:g.withCtx(({file:v})=>[g.createElementVNode("div",SS,[b(v.name||v.fileName)==="image"?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createElementVNode("img",{src:v.url,class:"upload-image"},null,8,bS),g.createElementVNode("div",yS,[g.createElementVNode("span",{class:"file-action",onClick:N=>f(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(cu))]),_:1})],8,CS),c.value?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("span",{key:0,class:"file-action",onClick:N=>p(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(au))]),_:1})],8,vS))])],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createVNode(g.unref(B.ElIcon),{size:32,color:y(v.name||v.fileName)},{default:g.withCtx(()=>[(g.openBlock(),g.createBlock(g.resolveDynamicComponent(S(v.name||v.fileName))))]),_:2},1032,["color"]),g.createElementVNode("span",TS,g.toDisplayString(v.name||v.fileName),1),g.createElementVNode("div",NS,[g.createElementVNode("span",{class:"file-action",onClick:N=>f(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(cu))]),_:1})],8,OS),c.value?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("span",{key:0,class:"file-action",onClick:N=>p(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(au))]),_:1})],8,RS))])],64))])]),default:g.withCtx(()=>[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(mS))]),_:1})]),_:1},8,["file-list","action","headers","accept","limit","disabled","readonly","class"]),o.value?(g.openBlock(),g.createBlock(g.unref(B.ElImageViewer),{key:0,"url-list":a.value,"show-progress":"","initial-index":0,onClose:C[1]||(C[1]=v=>o.value=!1)},null,8,["url-list"])):g.createCommentVNode("",!0)],64))}}),Rr=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Ws=Rr(wS,[["__scopeId","data-v-75a84e05"]]);var xS=Object.defineProperty,du=e=>{throw TypeError(e)},IS=(e,t,n)=>t in e?xS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D=(e,t,n)=>IS(e,typeof t!="symbol"?t+"":t,n),uu=(e,t,n)=>t.has(e)||du("Cannot "+n),fi=(e,t,n)=>(uu(e,t,"read from private field"),t.get(e)),DS=(e,t,n)=>t.has(e)?du("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),kS=(e,t,n,r)=>(uu(e,t,"write to private field"),t.set(e,n),n);function Ke(e){this.content=e}Ke.prototype={constructor:Ke,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new Ke(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Ke(n)},addToStart:function(e,t){return new Ke([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Ke(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new Ke(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Ke.from(e),e.size?new Ke(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Ke.from(e),e.size?new Ke(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Ke.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Ke.from=function(e){if(e instanceof Ke)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ke(t)};function pu(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=pu(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function mu(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=e.child(--i),s=t.child(--o),l=a.nodeSize;if(a==s){n-=l,r-=l;continue}if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){let c=0,d=Math.min(a.text.length,s.text.length);for(;c<d&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){let c=mu(a.content,s.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class M{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,s=0;s<n;a++){let l=this.content[a],c=s+l.nodeSize;if(c>t&&r(l,i+s,o||null,a)!==!1&&l.content.size){let d=s+1;l.nodesBetween(Math.max(0,t-d),Math.min(l.content.size,n-d),r,i+d)}s=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(s,l)=>{let c=s.isText?s.text.slice(Math.max(t,l)-l,n-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&c||s.isTextblock)&&r&&(a?a=!1:o+=r),o+=c},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new M(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,a=0;a<n;o++){let s=this.content[o],l=a+s.nodeSize;l>t&&((a<t||l>n)&&(s.isText?s=s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s=s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),r.push(s),i+=s.nodeSize),a=l}return new M(r,i)}cutByIndex(t,n){return t==n?M.empty:t==0&&n==this.content.length?this:new M(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new M(i,o)}addToStart(t){return new M([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new M(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return pu(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return mu(this,t,n,r)}findIndex(t,n=-1){if(t==0)return Io(0,t);if(t==this.size)return Io(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=t)return a==t||n>0?Io(r+1,a):Io(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return M.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new M(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return M.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new M(n||t,r)}static from(t){if(!t)return M.empty;if(t instanceof M)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new M([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}M.empty=new M([],0);const Ks={index:0,offset:0};function Io(e,t){return Ks.index=e,Ks.offset=t,Ks}function Do(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Do(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Do(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let Ie=class Jd{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Do(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Jd.none;if(t instanceof Jd)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Ie.none=[];class ko extends Error{}class ${constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=_u(this.content,t+this.openStart,n);return r&&new $(r,this.openStart,this.openEnd)}removeBetween(t,n){return new $(hu(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return $.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new $(M.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new $(t,r,i)}}$.empty=new $(M.empty,0,0);function hu(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:a,offset:s}=e.findIndex(n);if(i==t||o.isText){if(s!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(hu(o.content,t-i-1,n-i-1)))}function _u(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),a=e.maybeChild(i);if(o==t||a.isText)return e.cut(0,t).append(n).append(e.cut(t));let s=_u(a.content,t-o-1,n);return s&&e.replaceChild(i,a.copy(s))}function MS(e,t,n){if(n.openStart>e.depth)throw new ko("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ko("Inconsistent open depths");return gu(e,t,n,0)}function gu(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=gu(e,t,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,s=a.content;return Jn(a,s.cut(0,e.parentOffset).append(n.content).append(s.cut(t.parentOffset)))}else{let{start:a,end:s}=LS(n,e);return Jn(o,Eu(e,a,s,t,r))}else return Jn(o,Mo(e,t,r))}function fu(e,t){if(!t.type.compatibleContent(e.type))throw new ko("Cannot join "+t.type.name+" onto "+e.type.name)}function Qs(e,t,n){let r=e.node(n);return fu(r,t.node(n)),r}function Xn(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Ei(e,t,n,r){let i=(t||e).node(n),o=0,a=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Xn(e.nodeAfter,r),o++));for(let s=o;s<a;s++)Xn(i.child(s),r);t&&t.depth==n&&t.textOffset&&Xn(t.nodeBefore,r)}function Jn(e,t){return e.type.checkContent(t),e.copy(t)}function Eu(e,t,n,r,i){let o=e.depth>i&&Qs(e,t,i+1),a=r.depth>i&&Qs(n,r,i+1),s=[];return Ei(null,e,i,s),o&&a&&t.index(i)==n.index(i)?(fu(o,a),Xn(Jn(o,Eu(e,t,n,r,i+1)),s)):(o&&Xn(Jn(o,Mo(e,t,i+1)),s),Ei(t,n,i,s),a&&Xn(Jn(a,Mo(n,r,i+1)),s)),Ei(r,null,i,s),new M(s)}function Mo(e,t,n){let r=[];if(Ei(null,e,n,r),e.depth>n){let i=Qs(e,t,n+1);Xn(Jn(i,Mo(e,t,n+1)),r)}return Ei(t,null,n,r),new M(r)}function LS(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)r=t.node(i).copy(M.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}class Si{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Ie.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let s=r;r=i,i=s}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Lo(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:s,offset:l}=a.content.findIndex(o),c=o-l;if(r.push(a,s,i+l),!c||(a=a.child(s),a.isText))break;o=c-1,i+=l+1}return new Si(n,r,o)}static resolveCached(t,n){let r=Su.get(t);if(r)for(let o=0;o<r.elts.length;o++){let a=r.elts[o];if(a.pos==n)return a}else Su.set(t,r=new PS);let i=r.elts[r.i]=Si.resolve(t,n);return r.i=(r.i+1)%FS,i}}class PS{constructor(){this.elts=[],this.i=0}}const FS=12,Su=new WeakMap;class Lo{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const BS=Object.create(null);let un=class eu{constructor(t,n,r,i=Ie.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||M.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Do(this.attrs,n||t.defaultAttrs||BS)&&Ie.sameSet(this.marks,r||Ie.none)}copy(t=null){return t==this.content?this:new eu(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new eu(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return $.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),s=i.start(a),l=i.node(a).content.cut(i.pos-s,o.pos-s);return new $(l,i.depth-a,o.depth-a)}replace(t,n,r){return MS(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Si.resolveCached(this,t)}resolveNoCache(t){return Si.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),bu(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=M.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),s=a&&a.matchFragment(this.content,n);if(!s||!s.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=Ie.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!Ie.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=M.fromJSON(t,n.content),o=t.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};un.prototype.text=void 0;class Po extends un{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):bu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Po(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Po(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function bu(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class er{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new US(t,n);if(r.next==null)return er.empty;let i=yu(r);r.next&&r.err("Unexpected trailing text");let o=qS(YS(i));return jS(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(a,s){let l=a.matchFragment(t,r);if(l&&(!n||l.validEnd))return M.from(s.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:d,next:u}=a.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let p=o(u,s.concat(d));if(p)return p}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:l}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!i.type||l.validEnd)&&(r.push({match:s.contentMatch,type:s,via:i}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return o}).join(`
|
|
1
|
+
(function(qt,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("vue"),require("element-plus"),require("@gis_victory/gismap")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","@gis_victory/gismap"],g):(qt=typeof globalThis<"u"?globalThis:qt||self,g(qt.CurdForm={},qt.Vue,qt.ElementPlus,qt.GisMap))})(this,(function(qt,g,B,iu){"use strict";const QE={name:"FormItem"},ou=g.defineComponent({...QE,props:{modelValue:{type:[String,Number,Array,Boolean,null],default:()=>""},item:{type:Object,default:()=>({})},dropdownOptions:{type:Array,default:()=>[]},currentOperationType:{type:String,default:"default"},headers:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e;let r=n.modelValue;const i=n.item.type==="multi-select"||n.item.type==="checkbox"||n.item.searchFormType==="multi-select"||n.item.searchFormType==="checkbox";i&&typeof r=="string"&&r&&(r=r.split(","));const o=g.ref(r);g.ref([]);const a=t,s=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1}),l=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1});return g.watch(o,c=>{let d=c;i&&Array.isArray(c)&&(d=c.join(",")),a("update:modelValue",d)}),g.watch(()=>n.modelValue,c=>{let d=c;i&&typeof c=="string"&&c&&(d=c.split(",")),o.value=d}),(c,d)=>e.item.searchFormType==="select"||e.item.type==="select"?(g.openBlock(),g.createBlock(g.unref(B.ElSelect),{key:0,modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=u=>o.value=u),placeholder:e.item.placeholder||"请选择",disabled:s.value,readonly:l.value,clearable:""},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElOption),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="multi-select"||e.item.type==="multi-select"?(g.openBlock(),g.createBlock(g.unref(B.ElSelect),{key:1,modelValue:o.value,"onUpdate:modelValue":d[1]||(d[1]=u=>o.value=u),placeholder:e.item.placeholder||"请选择",multiple:"",disabled:s.value,readonly:l.value,clearable:""},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElOption),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="date"||e.item.type==="date"?(g.openBlock(),g.createBlock(g.unref(B.ElDatePicker),{key:2,modelValue:o.value,"onUpdate:modelValue":d[2]||(d[2]=u=>o.value=u),type:"date","value-format":"YYYY-MM-DD",placeholder:e.item.placeholder||"请选择日期",disabled:s.value,readonly:l.value,clearable:"",style:{width:"100%"}},null,8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="daterange"||e.item.type==="daterange"?(g.openBlock(),g.createBlock(g.unref(B.ElDatePicker),{key:3,modelValue:o.value,"onUpdate:modelValue":d[3]||(d[3]=u=>o.value=u),type:"daterange","value-format":"yyyy-MM-dd",placeholder:e.item.placeholder||"请选择日期范围",disabled:s.value,readonly:l.value,clearable:""},null,8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="checkbox"||e.item.type==="checkbox"?(g.openBlock(),g.createBlock(g.unref(B.ElCheckboxGroup),{key:4,modelValue:o.value,"onUpdate:modelValue":d[4]||(d[4]=u=>o.value=u),disabled:s.value,readonly:l.value},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElCheckbox),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled","readonly"])):e.item.searchFormType==="radio"||e.item.type==="radio"?(g.openBlock(),g.createBlock(g.unref(B.ElRadioGroup),{key:5,modelValue:o.value,"onUpdate:modelValue":d[5]||(d[5]=u=>o.value=u),disabled:s.value,readonly:l.value},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElRadio),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled","readonly"])):e.item.searchFormType==="textarea"||e.item.type==="textarea"?(g.openBlock(),g.createBlock(g.unref(B.ElInput),{key:6,modelValue:o.value,"onUpdate:modelValue":d[6]||(d[6]=u=>o.value=u),type:"textarea",placeholder:e.item.placeholder||"请输入",disabled:s.value,readonly:l.value,clearable:""},null,8,["modelValue","placeholder","disabled","readonly"])):(g.openBlock(),g.createBlock(g.unref(B.ElInput),{key:7,modelValue:o.value,"onUpdate:modelValue":d[7]||(d[7]=u=>o.value=u),placeholder:e.item.placeholder||"请输入",disabled:s.value,readonly:l.value,clearable:""},null,8,["modelValue","placeholder","disabled","readonly"]))}});var ZE=g.defineComponent({name:"CircleClose",__name:"circle-close",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),g.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),XE=ZE,JE=g.defineComponent({name:"Delete",__name:"delete",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),au=JE,eS=g.defineComponent({name:"Document",__name:"document",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),su=eS,tS=g.defineComponent({name:"Download",__name:"download",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"})]))}}),nS=tS,rS=g.defineComponent({name:"EditPen",__name:"edit-pen",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"m199.04 672.64 193.984 112 224-387.968-193.92-112-224 388.032zm-23.872 60.16 32.896 148.288 144.896-45.696zM455.04 229.248l193.92 112 56.704-98.112-193.984-112zM104.32 708.8l384-665.024 304.768 175.936L409.152 884.8h.064l-248.448 78.336zm384 254.272v-64h448v64z"})]))}}),iS=rS,oS=g.defineComponent({name:"Files",__name:"files",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M128 384v448h768V384zm-32-64h832a32 32 0 0 1 32 32v512a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V352a32 32 0 0 1 32-32m64-128h704v64H160zm96-128h512v64H256z"})]))}}),lu=oS,aS=g.defineComponent({name:"Headset",__name:"headset",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M896 529.152V512a384 384 0 1 0-768 0v17.152A128 128 0 0 1 320 640v128a128 128 0 1 1-256 0V512a448 448 0 1 1 896 0v256a128 128 0 1 1-256 0V640a128 128 0 0 1 192-110.848M896 640a64 64 0 0 0-128 0v128a64 64 0 0 0 128 0zm-768 0v128a64 64 0 0 0 128 0V640a64 64 0 1 0-128 0"})]))}}),sS=aS,lS=g.defineComponent({name:"Menu",__name:"menu",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z"})]))}}),cS=lS,dS=g.defineComponent({name:"MoreFilled",__name:"more-filled",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M176 416a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224"})]))}}),uS=dS,pS=g.defineComponent({name:"Plus",__name:"plus",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),mS=pS,hS=g.defineComponent({name:"VideoCamera",__name:"video-camera",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M704 768V256H128v512zm64-416 192-96v512l-192-96v128a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zm0 71.552v176.896l128 64V359.552zM192 320h192v64H192z"})]))}}),_S=hS,gS=g.defineComponent({name:"ZoomIn",__name:"zoom-in",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}}),cu=gS;const fS=(e,t)=>{let n=[];if(e)try{n=JSON.parse(e)}catch(r){console.log(r)}return Array.isArray(n)?n.map(r=>({...r,url:ES(r,t)})):[]},ES=(e,t)=>{if(e==null||t==null)return null;{let n=[];return(e.fileName||e.filename)&&n.push(`fileName=${e.fileName||e.filename}`),(e.floderName||e.flodername)&&n.push(`floderName=${e.floderName||e.flodername}`),e.position&&n.push(`position=${e.position}`),`${t}&${n.join("&")}`}},SS={class:"custom-upload-file"},bS=["src"],yS={class:"file-actions"},CS=["onClick"],vS=["onClick"],TS={class:"file-name"},NS={class:"file-actions"},OS=["onClick"],RS=["onClick"],AS={name:"FormItemUpLoad"},wS=g.defineComponent({...AS,props:{modelValue:{type:[String,Number,Array,Boolean,null],default:()=>""},item:{type:Object,default:()=>({})},currentOperationType:{type:String,default:"default"},upload:{type:String,default:""},download:{type:String,default:""},headers:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=g.ref(n.modelValue),i=g.ref([]),o=g.ref(!1),a=g.ref([]),s=g.ref(""),l=t,c=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1}),d=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1}),u=(E,C)=>{},p=E=>{const C=i.value.filter(v=>v.uid!==E.uid);i.value=C,_(C)},m=(E,C,v)=>{B.ElMessage.error("文件上传失败")},h=(E,C,v)=>{E.success?(C.filename=E.data?.filename,C.position=E.data?.position,C.floder=E.data?.floder,B.ElMessage.success("文件上传成功"),_(v)):B.ElMessage.error(E.message||"文件上传失败")},_=E=>{if(!E||E.length===0){r.value="[]";return}const C=E.map(v=>v.response?{fileName:v.response.data?.fileName,position:v.response.data?.position,floderName:v.response.data?.floderName}:{fileName:v.fileName,position:v.position,floderName:v.floderName});r.value=JSON.stringify(C)},f=E=>{const C=b(E.name||E.fileName),v=E.url||(E.response?.data?.position?n.download+"/"+E.response.data.position:"");C==="image"?(a.value=[v],o.value=!0):window.open(v,"_blank")},b=E=>{if(!E)return"other";const C=E.toLowerCase().split(".").pop()||"",v=["jpg","jpeg","png","gif","bmp","webp","svg"],N="pdf",w=["doc","docx","xls","xlsx","ppt","pptx","txt"],O=["mp4","avi","mov","wmv","flv","mkv"],L=["mp3","wav","flac","aac","ogg"];return v.includes(C)?"image":C===N?"pdf":w.includes(C)?"document":O.includes(C)?"video":L.includes(C)?"audio":"other"},S=E=>{switch(b(E)){case"pdf":return su;case"document":return su;case"video":return _S;case"audio":return sS;case"image":return lu;default:return lu}},y=E=>{switch(b(E)){case"pdf":return"#f56c6c";case"document":return"#409eff";case"video":return"#67c23a";case"audio":return"#e6a23c";default:return"#909399"}};return g.watch(r,E=>{l("update:modelValue",E)}),g.watch(()=>n.modelValue,E=>{let C=E;r.value=C}),g.onMounted(()=>{if((n.item.type==="upload"||n.item.showMethod==="upload")&&n.modelValue&&n.modelValue!==""){i.value=fS(n.modelValue,n.download)||[],a.value=i.value.map(E=>E.url),s.value=a.value[0]||"";debugger}}),(E,C)=>e.currentOperationType=="column"?(g.openBlock(),g.createBlock(g.unref(B.ElImage),{key:0,src:s.value,"preview-src-list":a.value,"initial-index":0,fit:"cover","preview-teleported":"",style:{width:"100%",height:"100%"}},null,8,["src","preview-src-list"])):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createVNode(g.unref(B.ElUpload),{"file-list":i.value,"onUpdate:fileList":C[0]||(C[0]=v=>i.value=v),action:e.upload,name:"uploadFile",headers:e.headers,accept:e.item.uploadAllowFormat||"image/*",limit:e.item.uploadCountLimit?Number(e.item.uploadCountLimit):0,"list-type":"picture-card","on-exceed":u,"on-success":h,"on-error":m,disabled:c.value,readonly:d.value,class:g.normalizeClass(["upload-small",{"upload-hidden":c.value}]),"on-preview":f,style:{width:"100%"}},{file:g.withCtx(({file:v})=>[g.createElementVNode("div",SS,[b(v.name||v.fileName)==="image"?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createElementVNode("img",{src:v.url,class:"upload-image"},null,8,bS),g.createElementVNode("div",yS,[g.createElementVNode("span",{class:"file-action",onClick:N=>f(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(cu))]),_:1})],8,CS),c.value?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("span",{key:0,class:"file-action",onClick:N=>p(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(au))]),_:1})],8,vS))])],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createVNode(g.unref(B.ElIcon),{size:32,color:y(v.name||v.fileName)},{default:g.withCtx(()=>[(g.openBlock(),g.createBlock(g.resolveDynamicComponent(S(v.name||v.fileName))))]),_:2},1032,["color"]),g.createElementVNode("span",TS,g.toDisplayString(v.name||v.fileName),1),g.createElementVNode("div",NS,[g.createElementVNode("span",{class:"file-action",onClick:N=>f(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(cu))]),_:1})],8,OS),c.value?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("span",{key:0,class:"file-action",onClick:N=>p(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(au))]),_:1})],8,RS))])],64))])]),default:g.withCtx(()=>[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(mS))]),_:1})]),_:1},8,["file-list","action","headers","accept","limit","disabled","readonly","class"]),o.value?(g.openBlock(),g.createBlock(g.unref(B.ElImageViewer),{key:0,"url-list":a.value,"show-progress":"","initial-index":0,onClose:C[1]||(C[1]=v=>o.value=!1)},null,8,["url-list"])):g.createCommentVNode("",!0)],64))}}),Rr=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Ws=Rr(wS,[["__scopeId","data-v-75a84e05"]]);var xS=Object.defineProperty,du=e=>{throw TypeError(e)},IS=(e,t,n)=>t in e?xS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D=(e,t,n)=>IS(e,typeof t!="symbol"?t+"":t,n),uu=(e,t,n)=>t.has(e)||du("Cannot "+n),fi=(e,t,n)=>(uu(e,t,"read from private field"),t.get(e)),DS=(e,t,n)=>t.has(e)?du("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),kS=(e,t,n,r)=>(uu(e,t,"write to private field"),t.set(e,n),n);function Ke(e){this.content=e}Ke.prototype={constructor:Ke,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new Ke(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Ke(n)},addToStart:function(e,t){return new Ke([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Ke(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new Ke(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Ke.from(e),e.size?new Ke(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Ke.from(e),e.size?new Ke(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Ke.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Ke.from=function(e){if(e instanceof Ke)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ke(t)};function pu(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=pu(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function mu(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=e.child(--i),s=t.child(--o),l=a.nodeSize;if(a==s){n-=l,r-=l;continue}if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){let c=0,d=Math.min(a.text.length,s.text.length);for(;c<d&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){let c=mu(a.content,s.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class M{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,s=0;s<n;a++){let l=this.content[a],c=s+l.nodeSize;if(c>t&&r(l,i+s,o||null,a)!==!1&&l.content.size){let d=s+1;l.nodesBetween(Math.max(0,t-d),Math.min(l.content.size,n-d),r,i+d)}s=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(s,l)=>{let c=s.isText?s.text.slice(Math.max(t,l)-l,n-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&c||s.isTextblock)&&r&&(a?a=!1:o+=r),o+=c},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new M(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,a=0;a<n;o++){let s=this.content[o],l=a+s.nodeSize;l>t&&((a<t||l>n)&&(s.isText?s=s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s=s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),r.push(s),i+=s.nodeSize),a=l}return new M(r,i)}cutByIndex(t,n){return t==n?M.empty:t==0&&n==this.content.length?this:new M(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new M(i,o)}addToStart(t){return new M([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new M(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return pu(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return mu(this,t,n,r)}findIndex(t,n=-1){if(t==0)return Io(0,t);if(t==this.size)return Io(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=t)return a==t||n>0?Io(r+1,a):Io(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return M.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new M(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return M.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new M(n||t,r)}static from(t){if(!t)return M.empty;if(t instanceof M)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new M([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}M.empty=new M([],0);const Ks={index:0,offset:0};function Io(e,t){return Ks.index=e,Ks.offset=t,Ks}function Do(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Do(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Do(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let Ie=class Jd{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Do(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Jd.none;if(t instanceof Jd)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Ie.none=[];class ko extends Error{}class ${constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=_u(this.content,t+this.openStart,n);return r&&new $(r,this.openStart,this.openEnd)}removeBetween(t,n){return new $(hu(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return $.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new $(M.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new $(t,r,i)}}$.empty=new $(M.empty,0,0);function hu(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:a,offset:s}=e.findIndex(n);if(i==t||o.isText){if(s!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(hu(o.content,t-i-1,n-i-1)))}function _u(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),a=e.maybeChild(i);if(o==t||a.isText)return e.cut(0,t).append(n).append(e.cut(t));let s=_u(a.content,t-o-1,n);return s&&e.replaceChild(i,a.copy(s))}function MS(e,t,n){if(n.openStart>e.depth)throw new ko("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ko("Inconsistent open depths");return gu(e,t,n,0)}function gu(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=gu(e,t,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,s=a.content;return Jn(a,s.cut(0,e.parentOffset).append(n.content).append(s.cut(t.parentOffset)))}else{let{start:a,end:s}=LS(n,e);return Jn(o,Eu(e,a,s,t,r))}else return Jn(o,Mo(e,t,r))}function fu(e,t){if(!t.type.compatibleContent(e.type))throw new ko("Cannot join "+t.type.name+" onto "+e.type.name)}function Qs(e,t,n){let r=e.node(n);return fu(r,t.node(n)),r}function Xn(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Ei(e,t,n,r){let i=(t||e).node(n),o=0,a=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Xn(e.nodeAfter,r),o++));for(let s=o;s<a;s++)Xn(i.child(s),r);t&&t.depth==n&&t.textOffset&&Xn(t.nodeBefore,r)}function Jn(e,t){return e.type.checkContent(t),e.copy(t)}function Eu(e,t,n,r,i){let o=e.depth>i&&Qs(e,t,i+1),a=r.depth>i&&Qs(n,r,i+1),s=[];return Ei(null,e,i,s),o&&a&&t.index(i)==n.index(i)?(fu(o,a),Xn(Jn(o,Eu(e,t,n,r,i+1)),s)):(o&&Xn(Jn(o,Mo(e,t,i+1)),s),Ei(t,n,i,s),a&&Xn(Jn(a,Mo(n,r,i+1)),s)),Ei(r,null,i,s),new M(s)}function Mo(e,t,n){let r=[];if(Ei(null,e,n,r),e.depth>n){let i=Qs(e,t,n+1);Xn(Jn(i,Mo(e,t,n+1)),r)}return Ei(t,null,n,r),new M(r)}function LS(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)r=t.node(i).copy(M.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}class Si{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Ie.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let s=r;r=i,i=s}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Lo(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:s,offset:l}=a.content.findIndex(o),c=o-l;if(r.push(a,s,i+l),!c||(a=a.child(s),a.isText))break;o=c-1,i+=l+1}return new Si(n,r,o)}static resolveCached(t,n){let r=Su.get(t);if(r)for(let o=0;o<r.elts.length;o++){let a=r.elts[o];if(a.pos==n)return a}else Su.set(t,r=new PS);let i=r.elts[r.i]=Si.resolve(t,n);return r.i=(r.i+1)%FS,i}}class PS{constructor(){this.elts=[],this.i=0}}const FS=12,Su=new WeakMap;class Lo{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const BS=Object.create(null);let un=class eu{constructor(t,n,r,i=Ie.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||M.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Do(this.attrs,n||t.defaultAttrs||BS)&&Ie.sameSet(this.marks,r||Ie.none)}copy(t=null){return t==this.content?this:new eu(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new eu(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return $.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),s=i.start(a),l=i.node(a).content.cut(i.pos-s,o.pos-s);return new $(l,i.depth-a,o.depth-a)}replace(t,n,r){return MS(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Si.resolveCached(this,t)}resolveNoCache(t){return Si.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),bu(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=M.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),s=a&&a.matchFragment(this.content,n);if(!s||!s.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=Ie.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!Ie.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=M.fromJSON(t,n.content),o=t.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};un.prototype.text=void 0;class Po extends un{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):bu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Po(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Po(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function bu(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class er{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new US(t,n);if(r.next==null)return er.empty;let i=yu(r);r.next&&r.err("Unexpected trailing text");let o=qS(YS(i));return jS(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(a,s){let l=a.matchFragment(t,r);if(l&&(!n||l.validEnd))return M.from(s.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:d,next:u}=a.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let p=o(u,s.concat(d));if(p)return p}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:l}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!i.type||l.validEnd)&&(r.push({match:s.contentMatch,type:s,via:i}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return o}).join(`
|
|
2
2
|
`)}}er.empty=new er(!0);class US{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function yu(e){let t=[];do t.push(HS(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function HS(e){let t=[];do t.push(VS(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function VS(e){let t=$S(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=GS(e,t);else break;return t}function Cu(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function GS(e,t){let n=Cu(e),r=n;return e.eat(",")&&(e.next!="}"?r=Cu(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function zS(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let a=n[o];a.isInGroup(t)&&i.push(a)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function $S(e){if(e.eat("(")){let t=yu(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=zS(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function YS(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(a,s,l){let c={term:l,to:s};return t[a].push(c),c}function i(a,s){a.forEach(l=>l.to=s)}function o(a,s){if(a.type=="choice")return a.exprs.reduce((l,c)=>l.concat(o(c,s)),[]);if(a.type=="seq")for(let l=0;;l++){let c=o(a.exprs[l],s);if(l==a.exprs.length-1)return c;i(c,s=n())}else if(a.type=="star"){let l=n();return r(s,l),i(o(a.expr,l),l),[r(l)]}else if(a.type=="plus"){let l=n();return i(o(a.expr,s),l),i(o(a.expr,l),l),[r(l)]}else{if(a.type=="opt")return[r(s)].concat(o(a.expr,s));if(a.type=="range"){let l=s;for(let c=0;c<a.min;c++){let d=n();i(o(a.expr,l),d),l=d}if(a.max==-1)i(o(a.expr,l),l);else for(let c=a.min;c<a.max;c++){let d=n();r(l,d),i(o(a.expr,l),d),l=d}return[r(l)]}else{if(a.type=="name")return[r(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function vu(e,t){return t-e}function Tu(e,t){let n=[];return r(t),n.sort(vu);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let a=0;a<o.length;a++){let{term:s,to:l}=o[a];!s&&n.indexOf(l)==-1&&r(l)}}}function qS(e){let t=Object.create(null);return n(Tu(e,0));function n(r){let i=[];r.forEach(a=>{e[a].forEach(({term:s,to:l})=>{if(!s)return;let c;for(let d=0;d<i.length;d++)i[d][0]==s&&(c=i[d][1]);Tu(e,l).forEach(d=>{c||i.push([s,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let o=t[r.join(",")]=new er(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let s=i[a][1].sort(vu);o.next.push({type:i[a][0],next:t[s.join(",")]||n(s)})}return o}}function jS(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,a=[];for(let s=0;s<i.next.length;s++){let{type:l,next:c}=i.next[s];a.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Nu(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Ou(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Ru(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in e){let o=e[i];o.validate&&o.validate(t[i])}}function Au(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new KS(e,r,t[r]);return n}let wu=class jE{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Au(t,r.attrs),this.defaultAttrs=Nu(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==er.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:Ou(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new un(this,this.computeAttrs(t),M.from(n),Ie.setFrom(r))}createChecked(t=null,n,r){return n=M.from(n),this.checkContent(n),new un(this,this.computeAttrs(t),n,Ie.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=M.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(M.empty,!0);return o?new un(this,t,n.append(o),Ie.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){Ru(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:Ie.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new jE(o,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function WS(e,t,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}class KS{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?WS(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Fo{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=Au(t,i.attrs),this.excluded=null;let o=Nu(this.attrs);this.instance=o?new Ie(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Ie(this,Ou(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new Fo(o,i++,n,a)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){Ru(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class xu{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=Ke.from(t.nodes),n.marks=Ke.from(t.marks||{}),this.nodes=wu.compile(this.spec.nodes,this),this.marks=Fo.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",s=o.spec.marks;if(o.contentMatch=r[a]||(r[a]=er.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=s=="_"?null:s?Iu(this,s.split(" ")):s==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:Iu(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof wu){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Po(r,r.defaultAttrs,t,Ie.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return un.fromJSON(this,t)}markFromJSON(t){return Ie.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function Iu(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],a=o;if(o)n.push(o);else for(let s in e.marks){let l=e.marks[s];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function QS(e){return e.tag!=null}function ZS(e){return e.style!=null}let Ar=class tu{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(QS(i))this.tags.push(i);else if(ZS(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=t.nodes[i.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new Lu(this,n,!1);return r.addAll(t,Ie.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new Lu(this,n,!0);return r.addAll(t,Ie.none,n.from,n.to),$.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(eb(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],s=a.style;if(!(s.indexOf(t)!=0||a.context&&!r.matchesContext(a.context)||s.length>t.length&&(s.charCodeAt(t.length)!=61||s.slice(t.length+1)!=n))){if(a.getAttrs){let l=a.getAttrs(n);if(l===!1)continue;a.attrs=l||void 0}return a}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let s=n[a];if((s.priority==null?50:s.priority)<o)break}n.splice(a,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=Pu(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=Pu(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new tu(t,tu.schemaRules(t)))}};const Du={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},XS={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ku={ol:!0,ul:!0},bi=1,Zs=2,yi=4;function Mu(e,t,n){return t!=null?(t?bi:0)|(t==="full"?Zs:0):e&&e.whitespace=="pre"?bi|Zs:n&~yi}class Bo{constructor(t,n,r,i,o,a){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=Ie.none,this.match=o||(a&yi?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(M.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&bi)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=M.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(M.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Du.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Lu{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,a=Mu(null,n.preserveWhitespace,0)|(r?yi:0);i?o=new Bo(i.type,i.attrs,Ie.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new Bo(null,null,Ie.none,!0,null,a):o=new Bo(t.schema.topNodeType,null,Ie.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,o=i.options&Zs?"full":this.localPreserveWS||(i.options&bi)>0;if(o==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],s=t.previousSibling;(!a||s&&s.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,o=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let a=t.nodeName.toLowerCase(),s;ku.hasOwnProperty(a)&&this.parser.normalizeLists&&JS(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(s=this.parser.matchTag(t,this,r));e:if(l?l.ignore:XS.hasOwnProperty(a))this.findInside(t),this.ignoreFallback(t,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let c,d=this.needsBlock;if(Du.hasOwnProperty(a))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let u=l&&l.skip?n:this.readStyles(t,n);u&&this.addAll(t,u),c&&this.sync(o),this.needsBlock=d}else{let c=this.readStyles(t,n);c&&this.addElementByRule(t,l,c,l.consuming===!1?s:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
4
4
|
`),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],a=r.getPropertyValue(o);if(a)for(let s=void 0;;){let l=this.parser.matchStyle(o,a,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return n}addElementByRule(t,n,r,i){let o,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r)||this.leafFallback(t,r);else{let l=this.enter(a,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let s=this.top;if(a&&a.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!1)}o&&this.sync(s)&&this.open--}addAll(t,n,r,i){let o=r||0;for(let a=r?t.childNodes[r]:t.firstChild,s=i==null?null:t.childNodes[i];a!=s;a=a.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(a,n);this.findAtPoint(t,o)}findPlace(t,n){let r,i;for(let o=this.open;o>=0;o--){let a=this.nodes[o],s=a.findWrapping(t);if(s&&(!r||r.length>s.length)&&(r=s,i=a,!s.length)||a.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(t,n){if(t.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(t,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(t.type));let o=Ie.none;for(let a of r.concat(t.marks))(i.type?i.type.allowsMarkType(a.type):Fu(a.type,t.type))&&(o=a.addToSet(o));return i.content.push(t.mark(o)),!0}return!1}enter(t,n,r,i){let o=this.findPlace(t.create(n),r);return o&&(o=this.enterInner(t,n,r,!0,i)),o}enterInner(t,n,r,i=!1,o){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(t);let s=Mu(t,o,a.options);a.options&yi&&a.content.length==0&&(s|=yi);let l=Ie.none;return r=r.filter(c=>(a.type?a.type.allowsMarkType(c.type):Fu(c.type,t))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Bo(t,n,l,i,null,s)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=bi)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(s,l)=>{for(;s>=0;s--){let c=n[s];if(c==""){if(s==n.length-1||s==0)continue;for(;l>=o;l--)if(a(s-1,l))return!0;return!1}else{let d=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function JS(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&ku.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function eb(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Pu(e){let t={};for(let n in e)t[n]=e[n];return t}function Fu(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],a=s=>{o.push(s);for(let l=0;l<s.edgeCount;l++){let{type:c,next:d}=s.edge(l);if(c==t||o.indexOf(d)<0&&a(d))return!0}};if(a(i.contentMatch))return!0}}class tr{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=Xs(n).createDocumentFragment());let i=r,o=[];return t.forEach(a=>{if(o.length||a.marks.length){let s=0,l=0;for(;s<o.length&&l<a.marks.length;){let c=a.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[s][0])||c.type.spec.spanning===!1)break;s++,l++}for(;s<o.length;)i=o.pop()[1];for(;l<a.marks.length;){let c=a.marks[l++],d=this.serializeMark(c,a.isInline,n);d&&(o.push([c,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=Uo(Xs(n),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&Uo(Xs(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return Uo(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new tr(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=Bu(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return Bu(t.marks)}}function Bu(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Xs(e){return e.document||window.document}const Uu=new WeakMap;function tb(e){let t=Uu.get(e);return t===void 0&&Uu.set(e,t=nb(e)),t}function nb(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(e),t}function Uo(e,t,n,r){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=tb(r))&&o.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let s,l=n?e.createElementNS(n,i):e.createElement(i),c=t[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let u in c)if(c[u]!=null){let p=u.indexOf(" ");p>0?l.setAttributeNS(u.slice(0,p),u.slice(p+1),c[u]):l.setAttribute(u,c[u])}}for(let u=d;u<t.length;u++){let p=t[u];if(p===0){if(u<t.length-1||u>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:m,contentDOM:h}=Uo(e,p,n,r);if(l.appendChild(m),h){if(s)throw new RangeError("Multiple content holes");s=h}}}return{dom:l,contentDOM:s}}const Hu=65535,Vu=Math.pow(2,16);function rb(e,t){return e+t*Vu}function Gu(e){return e&Hu}function ib(e){return(e-(e&Hu))/Vu}const zu=1,$u=2,Ho=4,Yu=8;class Js{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Yu)>0}get deletedBefore(){return(this.delInfo&(zu|Ho))>0}get deletedAfter(){return(this.delInfo&($u|Ho))>0}get deletedAcross(){return(this.delInfo&Ho)>0}}class yt{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&yt.empty)return yt.empty}recover(t){let n=0,r=Gu(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+ib(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?i:0);if(l>t)break;let c=this.ranges[s+o],d=this.ranges[s+a],u=l+c;if(t<=u){let p=c?t==l?-1:t==u?1:n:n,m=l+i+(p<0?0:d);if(r)return m;let h=t==(n<0?l:u)?null:rb(s/3,t-l),_=t==l?$u:t==u?zu:Ho;return(n<0?t!=l:t!=u)&&(_|=Yu),new Js(m,_,h)}i+=d-c}return r?t+i:new Js(t+i,0,null)}touches(t,n){let r=0,i=Gu(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>t)break;let c=this.ranges[s+o],d=l+c;if(t<=d&&s==i*3)return!0;r+=this.ranges[s+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),l=a+(this.inverted?0:o),c=this.ranges[i+n],d=this.ranges[i+r];t(s,s+c,l,l+d),o+=d-c}}invert(){return new yt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?yt.empty:new yt(t<0?[0,-t,0]:[0,0,t])}}yt.empty=new yt([]);class wr{constructor(t=[],n,r=0,i=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=i}slice(t=0,n=this.maps.length){return new wr(this.maps,this.mirror,t,n)}copy(){return new wr(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let i=t.getMirror(n);this.appendMap(t.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new wr;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],s=a.mapResult(t,n);if(s.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,t=this.maps[l].recover(s.recover);continue}}i|=s.delInfo,t=s.pos}return r?t:new Js(t,i,null)}}const el=Object.create(null);class et{getMap(){return yt.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=el[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in el)throw new RangeError("Duplicate use of step JSON ID "+t);return el[t]=n,n.prototype.jsonID=t,n}}class He{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new He(t,null)}static fail(t){return new He(null,t)}static fromReplace(t,n,r,i){try{return He.ok(t.replace(n,r,i))}catch(o){if(o instanceof ko)return He.fail(o.message);throw o}}}function tl(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(tl(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return M.fromArray(r)}class Tn extends et{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new $(tl(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return He.fromReplace(t,this.from,this.to,o)}invert(){return new jt(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Tn(n.pos,r.pos,this.mark)}merge(t){return t instanceof Tn&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Tn(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Tn(n.from,n.to,t.markFromJSON(n.mark))}}et.jsonID("addMark",Tn);class jt extends et{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new $(tl(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return He.fromReplace(t,this.from,this.to,r)}invert(){return new Tn(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new jt(n.pos,r.pos,this.mark)}merge(t){return t instanceof jt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new jt(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new jt(n.from,n.to,t.markFromJSON(n.mark))}}et.jsonID("removeMark",jt);class Nn extends et{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return He.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return He.fromReplace(t,this.pos,this.pos+1,new $(M.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Nn(this.pos,n.marks[i]);return new Nn(this.pos,this.mark)}}return new xr(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Nn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Nn(n.pos,t.markFromJSON(n.mark))}}et.jsonID("addNodeMark",Nn);class xr extends et{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return He.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return He.fromReplace(t,this.pos,this.pos+1,new $(M.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Nn(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new xr(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new xr(n.pos,t.markFromJSON(n.mark))}}et.jsonID("removeNodeMark",xr);class ze extends et{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&nl(t,this.from,this.to)?He.fail("Structure replace would overwrite content"):He.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new yt([this.from,this.to-this.from,this.slice.size])}invert(t){return new ze(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new ze(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof ze)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?$.empty:new $(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new ze(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?$.empty:new $(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new ze(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ze(n.from,n.to,$.fromJSON(t,n.slice),!!n.structure)}}et.jsonID("replace",ze);class $e extends et{constructor(t,n,r,i,o,a,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(t){if(this.structure&&(nl(t,this.from,this.gapFrom)||nl(t,this.gapTo,this.to)))return He.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return He.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?He.fromReplace(t,this.from,this.to,r):He.fail("Content does not fit in gap")}getMap(){return new yt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new $e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new $e(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new $e(n.from,n.to,n.gapFrom,n.gapTo,$.fromJSON(t,n.slice),n.insert,!!n.structure)}}et.jsonID("replaceAround",$e);function nl(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function ob(e,t,n,r){let i=[],o=[],a,s;e.doc.nodesBetween(t,n,(l,c,d)=>{if(!l.isInline)return;let u=l.marks;if(!r.isInSet(u)&&d.type.allowsMarkType(r.type)){let p=Math.max(c,t),m=Math.min(c+l.nodeSize,n),h=r.addToSet(u);for(let _=0;_<u.length;_++)u[_].isInSet(h)||(a&&a.to==p&&a.mark.eq(u[_])?a.to=m:i.push(a=new jt(p,m,u[_])));s&&s.to==p?s.to=m:o.push(s=new Tn(p,m,r))}}),i.forEach(l=>e.step(l)),o.forEach(l=>e.step(l))}function ab(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(a,s)=>{if(!a.isInline)return;o++;let l=null;if(r instanceof Fo){let c=a.marks,d;for(;d=r.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(a.marks)&&(l=[r]):l=a.marks;if(l&&l.length){let c=Math.min(s+a.nodeSize,n);for(let d=0;d<l.length;d++){let u=l[d],p;for(let m=0;m<i.length;m++){let h=i[m];h.step==o-1&&u.eq(i[m].style)&&(p=h)}p?(p.to=c,p.step=o):i.push({style:u,from:Math.max(s,t),to:c,step:o})}}}),i.forEach(a=>e.step(new jt(a.from,a.to,a.style)))}function rl(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),a=[],s=t+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),d=s+c.nodeSize,u=r.matchType(c.type);if(!u)a.push(new ze(s,d,$.empty));else{r=u;for(let p=0;p<c.marks.length;p++)n.allowsMarkType(c.marks[p].type)||e.step(new jt(s,d,c.marks[p]));if(i&&c.isText&&n.whitespace!="pre"){let p,m=/\r?\n|\r/g,h;for(;p=m.exec(c.text);)h||(h=new $(M.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),a.push(new ze(s+p.index,s+p.index+p[0].length,h))}}s=d}if(!r.validEnd){let l=r.fillBefore(M.empty,!0);e.replace(s,s,new $(l,0,0))}for(let l=a.length-1;l>=0;l--)e.step(a[l])}function sb(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Ir(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(n==0||r.type.spec.isolating||!sb(r,i,o))break}return null}function lb(e,t,n){let{$from:r,$to:i,depth:o}=t,a=r.before(o+1),s=i.after(o+1),l=a,c=s,d=M.empty,u=0;for(let h=o,_=!1;h>n;h--)_||r.index(h)>0?(_=!0,d=M.from(r.node(h).copy(d)),u++):l--;let p=M.empty,m=0;for(let h=o,_=!1;h>n;h--)_||i.after(h+1)<i.end(h)?(_=!0,p=M.from(i.node(h).copy(p)),m++):c++;e.step(new $e(l,c,a,s,new $(d.append(p),u,m),d.size-u,!0))}function il(e,t,n=null,r=e){let i=cb(e,t),o=i&&db(r,t);return o?i.map(qu).concat({type:t,attrs:n}).concat(o.map(qu)):null}function qu(e){return{type:e,attrs:null}}function cb(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function db(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let s=(a.length?a[a.length-1]:t).contentMatch;for(let l=r;s&&l<i;l++)s=s.matchType(n.child(l).type);return!s||!s.validEnd?null:a}function ub(e,t,n){let r=M.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let s=n[a].type.contentMatch.matchFragment(r);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=M.from(n[a].type.create(n[a].attrs,r))}let i=t.start,o=t.end;e.step(new $e(i,o,i,o,new $(r,0,0),n.length,!0))}function pb(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(a,s)=>{let l=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,l)&&mb(e.doc,e.mapping.slice(o).map(s),r)){let c=null;if(r.schema.linebreakReplacement){let m=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);m&&!h?c=!1:!m&&h&&(c=!0)}c===!1&&Wu(e,a,s,o),rl(e,e.mapping.slice(o).map(s,1),r,void 0,c===null);let d=e.mapping.slice(o),u=d.map(s,1),p=d.map(s+a.nodeSize,1);return e.step(new $e(u,p,u+1,p-1,new $(M.from(r.create(l,null,a.marks)),0,0),1,!0)),c===!0&&ju(e,a,s,o),!1}})}function ju(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let a,s=/\r?\n|\r/g;for(;a=s.exec(i.text);){let l=e.mapping.slice(r).map(n+1+o+a.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function Wu(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let a=e.mapping.slice(r).map(n+1+o);e.replaceWith(a,a+1,t.type.schema.text(`
|
|
@@ -674,4 +674,4 @@ ${re("ai-append")}</button>
|
|
|
674
674
|
`+e.trim()+`
|
|
675
675
|
:::
|
|
676
676
|
`}});const zs=e=>{if(!e)return e;const t=Qd.render(e).trim();return t?Ji(t.includes("<pre")?t:t.replace(/\n/g,"")):e},D3=e=>{if(!e)return e;const t=new DOMParser().parseFromString(e,"text/html");t.querySelectorAll("colgroup").forEach(r=>r.remove()),t.querySelectorAll("li").forEach(r=>{const i=r.querySelector("div");if(i&&!i.querySelector("img")&&i.firstElementChild){const o=document.createDocumentFragment();o.append(" "),i.firstElementChild.childNodes.forEach(a=>{o.append(a.cloneNode(!0))}),i.replaceWith(o)}});const n=t.body.innerHTML;return Nr.turndown(n)};ce("aie-header",l_),ce("aie-footer",c_);const k3={theme:"light",lang:"zh",contentRetentionKey:"ai-editor-content",editable:!0,draggable:!0,placeholder:"",toolbarSize:"small"};class M3 extends yT{constructor(t,n={}){super(n),D(this,"aiEditor"),this.aiEditor=t}parseHtml(t){function n(r){return new window.DOMParser().parseFromString(`<body>${r}</body>`,"text/html").body}return Ar.fromSchema(this.schema).parse(n(t),{}).content}parseMarkdown(t){const n=zs(t);return this.parseHtml(n)}insertMarkdown(t){this.commands.insertContent(zs(t))}}class L3{constructor(t){D(this,"customLayout",!1),D(this,"innerEditor"),D(this,"container"),D(this,"header"),D(this,"mainEl"),D(this,"footer"),D(this,"options"),D(this,"eventComponents",[]),this.options={...k3,...t},this.initI18nAndInnerEditor()}initI18nAndInnerEditor(){const t=this.options.i18n||{},n={de:{translation:{...$2,...t.de}},en:{translation:{...z2,...t.en}},pt:{translation:{...Y2,...t.pt}},zh:{translation:{...G2,...t.zh}},es:{translation:{...q2,...t.es}},hi:{translation:{...j2,...t.hi}},id:{translation:{...W2,...t.id}},ja:{translation:{...K2,...t.ja}},ko:{translation:{...Q2,...t.ko}},th:{translation:{...Z2,...t.th}},vi:{translation:{...X2,...t.vi}}};for(let r of Object.keys(t))r!="de"&&r!="en"&&r!="pt"&&r!="zh"&&(n[r]={translation:{...t[r]}});Xe.init({lng:this.options.lang,resources:n},(r,i)=>{this.initInnerEditor()})}initInnerEditor(){const t=typeof this.options.element=="string"?document.querySelector(this.options.element):this.options.element;t.classList.add(`aie-theme-${this.options.theme}`),this.container=t.querySelector(".aie-container"),this.container?this.customLayout=!0:(this.container=document.createElement("div"),this.container.classList.add("aie-container")),t.appendChild(this.container),this.mainEl=document.createElement("div"),this.mainEl.style.flexGrow="1",this.mainEl.style.overflow="auto",this.header=new l_,this.eventComponents.push(this.header),this.footer=new c_,this.footer.initDraggable(this.options.draggable),this.eventComponents.push(this.footer);let n=this.options.content;if(typeof n=="string"&&(this.options.contentIsMarkdown?n=zs(n):n=Ji(n)),this.options.contentRetention&&this.options.contentRetentionKey){const r=localStorage.getItem(this.options.contentRetentionKey);if(r)try{n=JSON.parse(r)}catch(i){console.error(i,"Can not parse the cache content from localStorage.")}}this.innerEditor=new M3(this,{...this.options,element:this.mainEl,content:n,editable:this.options.editable,extensions:this.getExtensions(),onCreate:r=>this.onCreate(r),onTransaction:r=>this.onTransaction(r),onFocus:()=>{var r,i;return(i=(r=this.options)==null?void 0:r.onFocus)==null?void 0:i.call(r,this)},onBlur:()=>{var r,i;return(i=(r=this.options)==null?void 0:r.onBlur)==null?void 0:i.call(r,this)},onDestroy:()=>{var r,i;return(i=(r=this.options)==null?void 0:r.onDestroy)==null?void 0:i.call(r,this)},editorProps:{attributes:{class:"aie-content"}}})}getExtensions(){let t=V2(this,this.options);if(this.options.onCreateBefore){const n=this.options.onCreateBefore(this,t);n&&(t=n)}return t}onCreate(t){this.innerEditor.view.dom.style.height="calc(100% - 20px)",this.eventComponents.forEach(n=>{n.onCreate&&n.onCreate(t,this.options)}),(this.container.querySelector(".aie-container-header")||this.container).appendChild(this.header),(this.container.querySelector(".aie-container-main")||this.container).appendChild(this.mainEl),(this.container.querySelector(".aie-container-footer")||this.container).appendChild(this.footer),this.options.ai&&Hn.init(this.innerEditor,this.options.ai),this.options.onCreated&&this.options.onCreated(this)}onTransaction(t){var n,r;if(this.eventComponents.forEach(i=>{i.onTransaction&&i.onTransaction(t)}),!t.transaction.getMeta("ignoreChanged")&&((r=(n=this.options).onTransaction)==null||r.call(n,this,t.transaction),t.transaction.docChanged&&this.options.onChange&&this.options.onChange(this),t.transaction.docChanged&&this.options.contentRetention&&this.options.contentRetentionKey)){const i=t.editor.getHTML();if(i==="<p></p>"||i==="")localStorage.removeItem(this.options.contentRetentionKey);else{const o=t.editor.getJSON();localStorage.setItem(this.options.contentRetentionKey,JSON.stringify(o))}}}getHtml(){return this.innerEditor.getHTML()}getJson(){return this.innerEditor.getJSON()}getText(){return this.innerEditor.getText()}getSelectedText(){const t=this.innerEditor.state.selection;return t.empty?"":sa(this.innerEditor.state.doc,{from:t.from,to:t.to})}getMarkdown(){return D3(this.getHtml())}getOptions(){return this.options}getAttributes(t){return this.innerEditor.getAttributes(t)}setAttributes(t,n){this.innerEditor.commands.updateAttributes(t,n)}isActive(t,n){return typeof t=="object"||!n?this.innerEditor.isActive(t):this.innerEditor.isActive(t,n)}commands(){return this.innerEditor.commands}commandsChain(){return this.innerEditor.chain()}getOutline(){const t=this.innerEditor.state.doc,n=[];return t.descendants((r,i)=>{if(r.type.name==="heading"){const o=`aie-heading-${n.length+1}`;if(r.attrs.id!==o){const{state:{tr:s},view:{dispatch:l}}=this.innerEditor;l(s.setNodeMarkup(i,void 0,{...r.attrs,id:o}).setMeta("ignoreChanged",!0))}let a="";r.descendants(s=>{s.text&&(a+=s.text)}),n.push({id:o,text:a,level:r.attrs.level,pos:i,size:r.nodeSize})}}),n}focus(){return this.innerEditor.commands.focus(),this}focusPos(t){return this.innerEditor.commands.focus(t),this}focusStart(){return this.innerEditor.commands.focus("start"),this}focusEnd(){return this.innerEditor.commands.focus("end"),this}isFocused(){return this.innerEditor.isFocused}blur(){return this.innerEditor.commands.blur(),this}insert(t){return typeof t=="string"&&(t=Ji(t)),this.innerEditor.commands.insertContent(t),this}insertMarkdown(t){return this.innerEditor.insertMarkdown(t),this}setEditable(t){return this.options.editable=t,this.innerEditor.setEditable(t,!0),this.eventComponents.forEach(n=>{n.onEditableChange(t)}),this}setContent(t,n){return typeof t=="string"&&(t=Ji(t)),n===!1?this.clear().insert(t):this.focus().clear().insert(t),this}setMarkdownContent(t){const n=zs(t);return this.setContent(n)}clear(){return this.innerEditor.commands.clearContent(!0),this}isEmpty(){return this.innerEditor.isEmpty}changeLang(t){return this.destroy(),this.options.lang=t,Xe.changeLanguage(t),this.initInnerEditor(),this}changeTheme(t){const n=typeof this.options.element=="string"?document.querySelector(this.options.element):this.options.element;t||(t=this.options.theme==="dark"?"light":"dark"),n.classList.remove(`aie-theme-${this.options.theme}`),n.classList.add(`aie-theme-${t}`),this.options.theme=t}removeRetention(){return this.options.contentRetentionKey&&localStorage.removeItem(this.options.contentRetentionKey),this}destroy(){var t,n,r,i;(n=(t=this.options).onDestroy)==null||n.call(t,this),this.innerEditor.destroy(),this.eventComponents=[],this.customLayout?((r=this.header)==null||r.remove(),this.mainEl.remove(),(i=this.footer)==null||i.remove()):this.container.remove()}isDestroyed(){return this.innerEditor.isDestroyed}}const P3={name:"FormItemEditor"},F3=g.defineComponent({...P3,props:{modelValue:{type:[String],default:()=>""},item:{type:Object,default:()=>({})},currentOperationType:{type:String,default:"default"}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=g.ref(null);let i=null;const o=g.ref(n.modelValue),a=t;return g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1}),g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1}),g.watch(o,s=>{a("update:modelValue",s)}),g.watch(()=>n.modelValue,s=>{let l=s;o.value=l}),g.onMounted(()=>{i=new L3({element:r.value,placeholder:"点击输入内容...",content:o.value,onBlur:s=>{o.value=s.getHtml()}})}),g.onUnmounted(()=>{i&&i.destroy()}),(s,l)=>(g.openBlock(),g.createElementBlock("div",{ref_key:"editorRef",ref:r,style:{height:"400px"}},null,512))}}),B3={name:"FormItemDetail"},U3=g.defineComponent({...B3,props:{modelValue:{type:[String,Number,Array,Object],default:()=>""},item:{type:Object,default:()=>({})},dropdownOptions:{type:Array,default:()=>[]}},setup(e){const t=e;let n=t.modelValue;const r=t.item.type==="multiple-select"||t.item.type==="checkbox"||t.item.searchFormType==="multiple-select"||t.item.searchFormType==="checkbox";typeof n=="object"&&n!==null&&!Array.isArray(n)&&(n=Object.values(n).join(",")),r&&typeof n=="string"&&n&&(n=n.split(","));const i=g.ref(n);return g.onMounted(()=>{switch(t.item.type){case"select":case"radio":const o=t.dropdownOptions.find(l=>l.id===t.modelValue);i.value=o?.name||"";break;case"checkbox":case"multiple-select":const s=(Array.isArray(i.value)?i.value:i.value?.split(",")||[]).map(l=>t.dropdownOptions.find(d=>d.id===l)?.name||l).filter(Boolean);i.value=s.join(",")||"";break;case"date":i.value=t.modelValue?B.dayjs(t.modelValue).format(t.item.formatter||"YYYY-MM-DD"):"";break;case"datetime":i.value=t.modelValue?B.dayjs(t.modelValue).format(t.item.formatter||"YYYY-MM-DD HH:mm:ss"):"";break;default:i.value=t.modelValue;break}}),(o,a)=>(g.openBlock(),g.createElementBlock("span",null,g.toDisplayString(i.value),1))}});var wo={exports:{}},zE;function H3(){if(zE)return wo.exports;zE=1,wo.exports=n,wo.exports.parse=n,wo.exports.stringify=r;var e=/[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/,t=new RegExp("^"+e.source+"(\\s"+e.source+"){1,}");function n(i){var o=i.split(";"),a=o.pop(),s=(o.shift()||"").split("=").pop(),l=0;function c(v){var N=a.substring(l).match(v);return N?(l+=N[0].length,N[0]):null}function d(v){return v&&s.match(/\d+/)&&(v.crs={type:"name",properties:{name:"urn:ogc:def:crs:EPSG::"+s}}),v}function u(){c(/^\s*/)}function p(){u();for(var v=0,N=[],w=[N],O=N,L;L=c(/^(\()/)||c(/^(\))/)||c(/^(,)/)||c(t);){if(L==="(")w.push(O),O=[],w[w.length-1].push(O),v++;else if(L===")"){if(O.length===0||(O=w.pop(),!O))return null;if(v--,v===0)break}else if(L===",")O=[],w[w.length-1].push(O);else if(!L.split(/\s/g).some(isNaN))Array.prototype.push.apply(O,L.split(/\s/g).map(parseFloat));else return null;u()}return v!==0?null:N}function m(){for(var v=[],N,w;w=c(t)||c(/^(,)/);)w===","?(v.push(N),N=[]):w.split(/\s/g).some(isNaN)||(N||(N=[]),Array.prototype.push.apply(N,w.split(/\s/g).map(parseFloat))),u();if(N)v.push(N);else return null;return v.length?v:null}function h(){if(!c(/^(point(\sz)?)/i)||(u(),!c(/^(\()/)))return null;var v=m();return!v||(u(),!c(/^(\))/))?null:{type:"Point",coordinates:v[0]}}function _(){if(!c(/^(multipoint)/i))return null;u();var v=a.substring(a.indexOf("(")+1,a.length-1).replace(/\(/g,"").replace(/\)/g,"");a="MULTIPOINT ("+v+")";var N=p();return N?(u(),{type:"MultiPoint",coordinates:N}):null}function f(){if(!c(/^(multilinestring)/i))return null;u();var v=p();return v?(u(),{type:"MultiLineString",coordinates:v}):null}function b(){if(!c(/^(linestring(\sz)?)/i)||(u(),!c(/^(\()/)))return null;var v=m();return!v||!c(/^(\))/)?null:{type:"LineString",coordinates:v}}function S(){if(!c(/^(polygon(\sz)?)/i))return null;u();var v=p();return v?{type:"Polygon",coordinates:v}:null}function y(){if(!c(/^(multipolygon)/i))return null;u();var v=p();return v?{type:"MultiPolygon",coordinates:v}:null}function E(){var v=[],N;if(!c(/^(geometrycollection)/i)||(u(),!c(/^(\()/)))return null;for(;N=C();)v.push(N),u(),c(/^(,)/),u();return c(/^(\))/)?{type:"GeometryCollection",geometries:v}:null}function C(){return h()||b()||S()||_()||f()||y()||E()}return d(C())}function r(i){i.type==="Feature"&&(i=i.geometry);function o(d){return d.join(" ")}function a(d){return d.map(o).join(", ")}function s(d){return d.map(a).map(c).join(", ")}function l(d){return d.map(s).map(c).join(", ")}function c(d){return"("+d+")"}switch(i.type){case"Point":return"POINT ("+o(i.coordinates)+")";case"LineString":return"LINESTRING ("+a(i.coordinates)+")";case"Polygon":return"POLYGON ("+s(i.coordinates)+")";case"MultiPoint":return"MULTIPOINT ("+a(i.coordinates)+")";case"MultiPolygon":return"MULTIPOLYGON ("+l(i.coordinates)+")";case"MultiLineString":return"MULTILINESTRING ("+s(i.coordinates)+")";case"GeometryCollection":return"GEOMETRYCOLLECTION ("+i.geometries.map(r).join(", ")+")";default:throw new Error("stringify requires a valid GeoJSON Feature or geometry object as input")}}return wo.exports}var Zd=H3();function V3(e,t,n={}){const r={type:"Feature"};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function G3(e,t,n={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!$E(e[0])||!$E(e[1]))throw new Error("coordinates must contain numbers");return V3({type:"Point",coordinates:e},t,n)}function $E(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function YE(e,t,n){if(e!==null)for(var r,i,o,a,s,l,c,d=0,u=0,p,m=e.type,h=m==="FeatureCollection",_=m==="Feature",f=h?e.features.length:1,b=0;b<f;b++){c=h?e.features[b].geometry:_?e.geometry:e,p=c?c.type==="GeometryCollection":!1,s=p?c.geometries.length:1;for(var S=0;S<s;S++){var y=0,E=0;if(a=p?c.geometries[S]:c,a!==null){l=a.coordinates;var C=a.type;switch(d=C==="Polygon"||C==="MultiPolygon"?1:0,C){case null:break;case"Point":if(t(l,u,b,y,E)===!1)return!1;u++,y++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(t(l[r],u,b,y,E)===!1)return!1;u++,C==="MultiPoint"&&y++}C==="LineString"&&y++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-d;i++){if(t(l[r][i],u,b,y,E)===!1)return!1;u++}C==="MultiLineString"&&y++,C==="Polygon"&&E++}C==="Polygon"&&y++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(E=0,i=0;i<l[r].length;i++){for(o=0;o<l[r][i].length-d;o++){if(t(l[r][i][o],u,b,y,E)===!1)return!1;u++}E++}y++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(YE(a.geometries[r],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function z3(e,t={}){let n=0,r=0,i=0;return YE(e,function(o){n+=o[0],r+=o[1],i++}),G3([n/i,r/i],t.properties)}class $3{map;sourceId="curd-map-source";layerId="curd-map-layer";featureCollection={type:"FeatureCollection",features:[]};constructor(t){this.map=t,this.setSource()}setSource(){this.map.addSource(this.sourceId,{type:"geojson",data:this.featureCollection})}setLayer(t){if(!this.map.getLayer(this.layerId))switch(t.toLowerCase()){case"polygon":case"multipolygon":this.map.addLayer({id:this.layerId,type:"fill",source:this.sourceId,paint:{"fill-color":"#ff0000","fill-opacity":.5}});break;case"linestring":case"multilinestring":this.map.addLayer({id:this.layerId,type:"line",source:this.sourceId,paint:{"line-color":"#ff0000","line-opacity":.8,"line-width":3}});break;case"point":this.map.addLayer({id:this.layerId,type:"circle",source:this.sourceId,paint:{"circle-color":"#ff0000","circle-opacity":.8,"circle-radius":5,"circle-stroke-color":"#fff","circle-stroke-width":2,"circle-stroke-opacity":1}});break}}setData(t){if(!t)return;const n={type:"Feature",geometry:t},r=this.map.getSource(this.sourceId);r&&(this.featureCollection.features=[n],r?.setData(this.featureCollection))}flyTo(){if(this.featureCollection.features.length!==0)try{let t=this.featureCollection.features[0];if(!t)return;let n=null;if(t.geometry.type.toLowerCase()==="point"?n=t.geometry.coordinates:n=z3(this.featureCollection)?.geometry?.coordinates||null,!n)return;this.map.panTo(n)}catch(t){console.error("计算外包边框中心点失败:",t)}}formatWktToGeoJson(t){if(!t)return null;try{return Zd.parse(t)}catch(n){return console.error("WKT 转换为 GeoJSON 失败:",n),null}}formatGeoJsonToWkt(t){if(!t)return"";try{return Zd.stringify(t)}catch(n){return console.error("GeoJSON 转换为 WKT 失败:",n),""}}clear(){this.map.removeLayer(this.layerId),this.map.removeSource(this.sourceId)}}class Y3{map;drawSourceId="curd-map-draw-source";drawLayerId="curd-map-draw-layer";drawLineLayerId="curd-map-draw-line-layer";drawPointLayerId="curd-map-draw-point-layer";drawFeatureCollection={type:"FeatureCollection",features:[]};drawType="none";drawCoordinates=[];drawCallback=null;constructor(t){this.map=t,this.initDrawSource()}initDrawSource(){this.map.getSource(this.drawSourceId)||this.map.addSource(this.drawSourceId,{type:"geojson",data:this.drawFeatureCollection})}startDraw(t,n){this.clearDraw(),this.drawType=t,this.drawCallback=n,this.drawCoordinates=[],this.setupDrawLayers(),this.setupDrawEvents(),this.map.getCanvas().style.cursor="crosshair"}stopDraw(){this.drawType="none",this.drawCallback=null,this.clearDraw(),this.removeDrawEvents(),this.map.getCanvas().style.cursor=""}clearDraw(){this.drawCoordinates=[],this.drawFeatureCollection.features=[];const t=this.map.getSource(this.drawSourceId);t&&t.setData(this.drawFeatureCollection),[this.drawLayerId,this.drawLineLayerId,this.drawPointLayerId,`${this.drawLayerId}-outline`].forEach(n=>{this.map.getLayer(n)&&this.map.removeLayer(n)})}setupDrawLayers(){[this.drawLayerId,this.drawLineLayerId,this.drawPointLayerId,`${this.drawLayerId}-outline`].forEach(n=>{this.map.getLayer(n)&&this.map.removeLayer(n)});const t="#ff0000";this.drawType==="point"&&this.map.addLayer({id:this.drawLayerId,type:"circle",source:this.drawSourceId,paint:{"circle-color":t,"circle-opacity":.8,"circle-radius":6,"circle-stroke-color":"#fff","circle-stroke-width":2,"circle-stroke-opacity":1}}),(this.drawType==="line"||this.drawType==="polygon")&&(this.map.addLayer({id:this.drawLineLayerId,type:"line",source:this.drawSourceId,paint:{"line-color":t,"line-opacity":.8,"line-width":3}}),this.map.addLayer({id:this.drawPointLayerId,type:"circle",source:this.drawSourceId,paint:{"circle-color":t,"circle-opacity":.8,"circle-radius":4,"circle-stroke-color":"#fff","circle-stroke-width":2,"circle-stroke-opacity":1}})),this.drawType==="polygon"&&(this.map.addLayer({id:this.drawLayerId,type:"fill",source:this.drawSourceId,paint:{"fill-color":t,"fill-opacity":.3}}),this.map.addLayer({id:`${this.drawLayerId}-outline`,type:"line",source:this.drawSourceId,paint:{"line-color":t,"line-opacity":.8,"line-width":2}}))}setupDrawEvents(){this.map.on("click",this.handleMapClick.bind(this)),this.map.on("mousemove",this.handleMapMouseMove.bind(this)),this.map.on("dblclick",this.handleMapDoubleClick.bind(this)),this.map.doubleClickZoom.disable()}removeDrawEvents(){this.map.off("click",this.handleMapClick.bind(this)),this.map.off("mousemove",this.handleMapMouseMove.bind(this)),this.map.off("dblclick",this.handleMapDoubleClick.bind(this)),this.map.doubleClickZoom.enable()}handleMapClick(t){const n=t.lngLat.toArray();this.drawCoordinates.push(n),this.updateDrawFeature(),this.drawType==="point"&&this.finishDraw()}handleMapMouseMove(t){if(this.drawType==="none"||this.drawCoordinates.length===0)return;const n=t.lngLat.toArray(),r=[...this.drawCoordinates,n];this.updateDrawFeature(r)}handleMapDoubleClick(){(this.drawType==="line"||this.drawType==="polygon")&&this.finishDraw()}updateDrawFeature(t){const n=t||this.drawCoordinates;if(n.length===0)return;let r=null;switch(this.drawType){case"point":r={type:"Point",coordinates:n[0]};break;case"line":r={type:"LineString",coordinates:n};break;case"polygon":r={type:"Polygon",coordinates:[n]};break}if(r){this.drawFeatureCollection.features=[{type:"Feature",geometry:r}];const i=this.map.getSource(this.drawSourceId);i&&i.setData(this.drawFeatureCollection)}}finishDraw(){if(this.drawCoordinates.length===0)return;let t=null;switch(this.drawType){case"point":t={type:"Point",coordinates:this.drawCoordinates[0]};break;case"line":if(this.drawCoordinates.length<2){this.clearDraw();return}t={type:"LineString",coordinates:this.drawCoordinates};break;case"polygon":if(this.drawCoordinates.length<3){this.clearDraw();return}t={type:"Polygon",coordinates:[[...this.drawCoordinates,this.drawCoordinates[0]]]};break}if(t&&this.drawCallback){const n=Zd.stringify(t);this.drawCallback(this.drawType,t,n),this.map.getCanvas().style.cursor="",this.drawType="none",this.map.off("click",this.handleMapClick.bind(this)),this.map.off("mousemove",this.handleMapMouseMove.bind(this)),this.map.off("dblclick",this.handleMapDoubleClick.bind(this)),setTimeout(()=>{this.map.doubleClickZoom.enable()},0)}}destroy(){this.stopDraw(),this.map.getSource(this.drawSourceId)&&this.map.removeSource(this.drawSourceId)}}const q3={class:"map-draw-container"},j3={name:"FormItemMapDraw"},W3=g.defineComponent({...j3,props:{geomType:{type:String,default:"point"}},emits:["draw-start","draw-end","draw-cancel"],setup(e,{emit:t}){const n=t,r=g.ref("none");g.ref(!1),g.ref(null);const i=XE,o=iS,a=uS,s=l=>{r.value=l,l==="none"?n("draw-cancel"):n("draw-start",l)};return(l,c)=>(g.openBlock(),g.createElementBlock("div",q3,[e.geomType==="point"?(g.openBlock(),g.createBlock(g.unref(B.ElButton),{key:0,type:"primary",size:"small",circle:"",onClick:c[0]||(c[0]=d=>s("point")),icon:g.unref(i),class:g.normalizeClass({active:r.value==="point"})},null,8,["icon","class"])):g.createCommentVNode("",!0),e.geomType==="linestring"?(g.openBlock(),g.createBlock(g.unref(B.ElButton),{key:1,type:"primary",size:"small",circle:"",onClick:c[1]||(c[1]=d=>s("line")),icon:g.unref(o),class:g.normalizeClass({active:r.value==="line"})},null,8,["icon","class"])):g.createCommentVNode("",!0),e.geomType==="polygon"?(g.openBlock(),g.createBlock(g.unref(B.ElButton),{key:2,type:"primary",size:"small",circle:"",onClick:c[2]||(c[2]=d=>s("polygon")),icon:g.unref(a),class:g.normalizeClass({active:r.value==="polygon"})},null,8,["icon","class"])):g.createCommentVNode("",!0)]))}}),K3=Rr(W3,[["__scopeId","data-v-c4ff065e"]]),Q3={class:"curd-map"},Z3={name:"FormItemMap"},X3=g.defineComponent({...Z3,props:{modelValue:{type:String||void 0,default:()=>""},glyphs:{type:String||void 0,default:()=>""},mapViewData:{type:Object||void 0,default:()=>({})},currentOperationType:{type:String,default:()=>"details"}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=g.ref(n.modelValue);let i,o;const a=g.reactive({mapViewData:{zoom:n.mapViewData.zoom||13,center:n.mapViewData.center||[120.656774,29.8],maxPitch:n.mapViewData.maxPitch||0,dragRotate:n.mapViewData.dragRotate||!1,style:{glyphs:n.glyphs},...n.mapViewData},switchData:{layers:[{name:"tdt-vec",label:"地图",iconName:"vector",checked:!0},{name:"tdt-img",label:"影像",iconName:"satellite",checked:!1}],extensions:[{name:"tdt-cia",label:"注记",checked:!0}]}}),s=t;g.watch(r,u=>{s("update:modelValue",u)}),g.watch(()=>n.modelValue,u=>{r.value=u});const l=u=>{i=new $3(u),o=new Y3(u);const p=i.formatWktToGeoJson(r.value);p&&(i.setLayer(p.type),i.setData(p),i.flyTo())},c=u=>{o&&o.startDraw(u,(p,m,h)=>{r.value=h})},d=()=>{o&&o.stopDraw()};return g.onUnmounted(()=>{o&&(o.destroy(),o=void 0)}),(u,p)=>(g.openBlock(),g.createElementBlock("div",Q3,[g.createVNode(g.unref(iu.GisMapView),{options:a.mapViewData,onLoad:l},{"top-left":g.withCtx(()=>[e.currentOperationType!=="details"?(g.openBlock(),g.createBlock(K3,{key:0,onDrawStart:c,onDrawCancel:d})):g.createCommentVNode("",!0)]),"bottom-right":g.withCtx(()=>[g.createVNode(g.unref(iu.GisMapSwitch),{data:a.switchData},null,8,["data"])]),default:g.withCtx(()=>[g.renderSlot(u.$slots,"default",{},void 0,!0)]),_:3},8,["options"])]))}}),J3=Rr(X3,[["__scopeId","data-v-e1f42b56"]]),e4={class:"field-select-container"},t4={name:"ExportButton"},n4=g.defineComponent({...t4,props:{columns:{type:Array,default:()=>[]},visibleColumns:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]}},setup(e){const t=e,n=g.ref(null),r=g.ref(!1),i=g.reactive({filename:"",dataType:"current",selectedFields:[]}),o=g.reactive({filename:[{required:!0,message:"请输入文件名称",trigger:["blur"]}]}),a=g.computed(()=>(t?.columns||[]).filter(c=>c.checkedFields.indexOf("exportable")>-1));g.onMounted(()=>{i.selectedFields=t?.visibleColumns||[]});const s=async()=>{if(!await n.value?.validate()){B.ElMessage.error("请填写正确的文件名称");return}let d=[...t.data];if(d.length===0){B.ElMessage.warning("没有数据可导出");return}const u={};t.columns.forEach(S=>{u[S.columnProperty]=S.columnLabel||S.columnProperty});const p=d.map(S=>{const y={};return i.selectedFields.forEach(E=>{y[E]=S[E]}),y}),m=i.filename||`导出数据_${new Date().getTime()}`,h=l(p,u),_=new Blob([h],{type:"text/csv;charset=utf-8;"}),f=document.createElement("a"),b=URL.createObjectURL(_);f.setAttribute("href",b),f.setAttribute("download",`${m}.csv`),f.style.visibility="hidden",document.body.appendChild(f),f.click(),document.body.removeChild(f),r.value=!1,B.ElMessage.success("导出成功")},l=(c,d)=>{if(c.length===0)return"";const u=Object.keys(c[0])||[],p=[],m=u.map(h=>d[h]||h);p.push(m.join(","));for(const h of c){const _=u.map(f=>{const b=h[f];return typeof b=="string"?`"${b.replace(/"/g,'""')}"`:b});p.push(_.join(","))}return p.join(`
|
|
677
|
-
`)};return(c,d)=>(g.openBlock(),g.createElementBlock("div",null,[g.createVNode(g.unref(B.ElButton),{type:"default",round:"",onClick:d[0]||(d[0]=u=>r.value=!0)},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(nS))]),_:1})]),_:1}),g.createVNode(g.unref(B.ElDialog),{modelValue:r.value,"onUpdate:modelValue":d[4]||(d[4]=u=>r.value=u),title:"导出数据",width:"400px","close-on-click-modal":!1},{footer:g.withCtx(()=>[g.createVNode(g.unref(B.ElButton),{onClick:d[3]||(d[3]=u=>r.value=!1)},{default:g.withCtx(()=>[...d[5]||(d[5]=[g.createTextVNode("取消",-1)])]),_:1}),g.createVNode(g.unref(B.ElButton),{type:"primary",onClick:s},{default:g.withCtx(()=>[...d[6]||(d[6]=[g.createTextVNode("导出",-1)])]),_:1})]),default:g.withCtx(()=>[g.createVNode(g.unref(B.ElForm),{ref_key:"exportFormRef",ref:n,model:i,"label-width":"100px",rules:o},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElFormItem),{label:"文件名称",prop:"filename"},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElInput),{modelValue:i.filename,"onUpdate:modelValue":d[1]||(d[1]=u=>i.filename=u),placeholder:"请输入文件名称"},null,8,["modelValue"])]),_:1}),g.createVNode(g.unref(B.ElFormItem),{label:"选择字段"},{default:g.withCtx(()=>[g.createElementVNode("div",e4,[g.createVNode(g.unref(B.ElCheckboxGroup),{modelValue:i.selectedFields,"onUpdate:modelValue":d[2]||(d[2]=u=>i.selectedFields=u)},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(a.value,u=>(g.openBlock(),g.createElementBlock("div",{key:u.columnProperty,class:"column-item"},[g.createVNode(g.unref(B.ElCheckbox),{value:u.columnProperty},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(u.columnLabel),1)]),_:2},1032,["value"])]))),128))]),_:1},8,["modelValue"])])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])]))}}),r4=Rr(n4,[["__scopeId","data-v-551fc665"]]),i4={class:"column-manager"},o4={name:"ColumnManager"},a4=g.defineComponent({...o4,props:{tableColumns:{type:Array,default:()=>({columns:[]})},visibleColumns:{type:Array,default:()=>[]}},emits:["update:visibleColumns","update:columns"],setup(e,{emit:t}){const n=e,r=t,i=g.ref(!1),o=g.ref([...n.visibleColumns]),a=(s,l)=>{l?o.value.push(s):o.value=o.value.filter(c=>c!==s),r("update:visibleColumns",o.value)};return g.watch(()=>n.visibleColumns,s=>{o.value=[...s]},{deep:!0}),(s,l)=>(g.openBlock(),g.createElementBlock("div",null,[g.createVNode(g.unref(B.ElPopover),{visible:i.value,"onUpdate:visible":l[0]||(l[0]=c=>i.value=c),placement:"bottom-end",width:220,trigger:"click","popper-class":"column-manager-popover"},{reference:g.withCtx(()=>[g.createVNode(g.unref(B.ElButton),{type:"default",round:""},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(cS))]),_:1})]),_:1})]),default:g.withCtx(()=>[g.createElementVNode("div",i4,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.tableColumns,c=>(g.openBlock(),g.createElementBlock("div",{class:"column-item",key:c.columnProperty},[g.createVNode(g.unref(B.ElCheckbox),{modelValue:o.value.includes(c.columnProperty),onChange:d=>a(c.columnProperty,d)},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(c.columnLabel||c.columnProperty),1)]),_:2},1032,["modelValue","onChange"])]))),128))])]),_:1},8,["visible"])]))}}),s4=Rr(a4,[["__scopeId","data-v-3bb66278"]]);class l4{serverConfig;curdConfig={};searchConfig={};tableConfig={};editorConfig={};searchFormMap=new Map;cloneSearchForm="{}";cloneFormData="{}";dictionaryMap=new Map;columnMap=new Map;constructor({serverConfig:t}){this.serverConfig=t}setConfig({curdConfig:t,searchConfig:n,tableConfig:r,editorConfig:i}){this.curdConfig=t||this.curdConfig,this.searchConfig=n||this.searchConfig,this.tableConfig=r||this.tableConfig,this.editorConfig=i||this.editorConfig,this.columnMap?.clear(),this.tableConfig?.columns?.forEach(o=>{this.columnMap?.set(o.columnProperty,o)})}async loadDictionary(){if(!this.tableConfig?.columns)return this.dictionaryMap;const t=this.tableConfig.columns.filter(n=>["code","table"].includes(n.dictType||"")&&n.dictService).map(n=>{let r=n.fieldType||"String";r==="integer"&&(r="Integer");let i,o;return n.dictType==="code"?(o=this.serverConfig?.dict({dictCode:n.dictService,itemIdType:r}),i=n.dictService||""):(o=this.serverConfig?.dictServer(n.dictService,{key:n.dictionary?.name||""}),i=`${n.dictService}-${n.dictionary?.name||""}`),o.then(a=>{a&&i&&this.dictionaryMap.set(i,a||[])}).catch(a=>{console.error(`加载字典 ${n.dictService} 失败:`,a)})});return await Promise.all(t),this.dictionaryMap}getDictOptionsByCode(t){return t?this.dictionaryMap.get(t)||[]:[]}getDictOptionsByColumnProperty(t){if(!t)return[];const n=this.tableConfig?.columns?.find(r=>r.columnProperty===t);return this.getDictOptionsByCode(n?.dictType==="code"?n?.dictService||"":`${n?.dictService||""}-${n?.dictionary?.name||""}`)}formatColumnValue(t,n){if(n==null||n==="")return n;if(t.dictType&&t.dictService){let r=t.dictType==="code"?t.dictService||"":`${t.dictService}-${t.dictionary?.name||""}`;const i=this.dictionaryMap.get(r)||[];if(!i||i.length===0)return n;const o=i.find(a=>a.id===n);return o?o.name:n}if(!t.formatter||t.formatter==="")return n;switch(t.fieldType){case"date":return n?B.dayjs(n).format(t.formatter||"YYYY-MM-DD"):"";case"datetime":return n?B.dayjs(n).format(t.formatter||"YYYY-MM-DD HH:mm:ss"):"";default:return n}}formatFormRules(){const t={};return(this.editorConfig?.columns||[]).forEach(n=>{t[n.columnProperty]=[],n.isRequired&&t[n.columnProperty].push({required:!0,message:"请输入"+n.columnLabel,trigger:"blur"})}),t}formatSearchConfigForm(){this.searchConfig.columns=this.tableConfig?.columns?.filter(n=>n.searchable!="no")||[],this.searchConfig?.columns.forEach(n=>{this.searchFormMap.set(n.columnProperty,n)});const t={};return this.searchConfig?.columns.forEach(n=>{let r=n.searchDefaultValue;r!=null&&r!==""&&(r=this.formatValueByColumnProperty(r,n.columnProperty)),t[n.columnProperty]=r}),this.cloneSearchForm=JSON.stringify(t),t}formatFormConfigData(){const t={};return(this.editorConfig?.columns||[]).filter(r=>r.columnProperty===this.curdConfig?.priKey?!0:r.type!=="hidden").forEach(r=>{let i=r.defaultValue;i!=null&&i!==""&&(i=this.formatValueByColumnProperty(i,r.columnProperty)),t[r.columnProperty]=i}),this.cloneFormData=JSON.stringify(t),t}formatSearchForm(t){const n={};return this.searchFormMap.forEach((r,i)=>{const o=t[i];if(o!=null&&o!==""){let a="";switch(r.searchable){case"=":a=`= '${o}'`;break;case"like":a=`like '%${o}%'`;break;case"in":a=`in (${o})`;break}n[i]=a}}),n}formatFormData(t){if(!t||Object.keys(t).length===0)return{};let n={};return(this.tableConfig?.columns||[]).forEach(r=>{r?.fieldType==="integer"?n[r.columnProperty]=Number(t[r.columnProperty]):n[r.columnProperty]=t[r.columnProperty]}),t.wktstr&&(n.wktstr=t.wktstr),n}initVisibleColumns(){return(this.tableConfig?.columns||[]).filter(t=>t.showMethod!="hidden").map(t=>t.columnProperty)}getFormItems(t=""){let n=[];switch(t){case"details":n=(this.editorConfig?.columns||[]).filter(r=>r.type!=="hidden"&&r.updateFormStatus!=="hidden"&&r.type!=="shape");break;case"add":n=(this.editorConfig?.columns||[]).filter(r=>r.type!=="hidden"&&r.createFormStatus!=="hidden"&&r.type!=="shape");break;case"update":n=(this.editorConfig?.columns||[]).filter(r=>r.type!=="hidden"&&r.updateFormStatus!=="hidden"&&r.type!=="shape");break}return n}hasGeometryField(){return(this.editorConfig?.columns||[]).find(n=>n.type==="shape")||void 0}formatValueByColumnProperty(t,n){const r=this.columnMap?.get(n);if(!r)return t;switch(r?.fieldType){case"integer":case"float":case"double":case"number":return Number(t);default:return t}}}const c4={class:"curd-container"},d4={class:"curd-search"},u4={key:0,class:"table-actions"},p4={class:"table-actions-left"},m4={class:"table-actions-right"},h4={key:1,class:"curd-pagination"},_4={name:"CurdForm"},g4=g.defineComponent({..._4,props:{size:{type:String,default:"default"},title:{type:String,default:"信息管理"},permissions:{type:Object,default:()=>({add:!1,edit:!1,delete:!1,deleteBatch:!1,export:!1})},serverConfig:{type:Object,default:()=>({init:Function,list:Function,view:Function,add:Function,delete:Function,deleteBatch:Function,update:Function,dict:Function,dictServer:Function,upload:Function,download:Function,headers:Function})},mapViewData:{type:Object,default:()=>({})}},emits:["loadDataSuccess","switchChange"],setup(e,{expose:t,emit:n}){const r=e,i=g.ref(!1),o=g.ref(null),a=g.ref(null),s=n,l=g.ref(),c=new l4({serverConfig:r.serverConfig}),d=g.ref(""),u=g.ref("details"),p=g.reactive({priKey:"id",priKeyType:"string",sortField:"id",sortOrder:0,geomType:"point",webFunction:[],dataExt:"{}"}),m=g.reactive({showIndex:!0,indexWidth:50,showCheckbox:!0,showOperation:!0,operationWidth:120,operationLocation:"right",operationButtons:[],visibleOperationButtons:[],operationAlign:"center",showPagination:!0,defaultPageSize:10,pageUISize:"default",showExpand:!1,columns:[]}),h=g.reactive({total:0,pageSize:m.defaultPageSize,currentPage:1}),_=g.reactive({title:"弹框表单",formDialogWidth:"800px",labelWidth:"120px"}),f=g.reactive({columns:[],formColumns:[]}),b=g.reactive({searchLabelWidth:"80",searchFormWidth:"290",columns:[]}),S=g.ref({}),y=g.ref(!1),E=g.ref([]),C=g.reactive({data:{}}),v=g.ref({}),N=g.ref(!1),w=g.ref(!1),O=g.ref(),L=g.ref([]),H=async()=>{if(r.serverConfig?.list)try{i.value=!0;const G=await r.serverConfig?.list({whereClause:c.formatSearchForm(S.value),orderParam:[{fieldName:p.sortField,asc:p.sortOrder===0}],pageParam:{pageNum:h.currentPage,pageSize:h.pageSize}});if(G){const j=G.data;E.value=j.dataList||[],h.total=j.totalCount,s("loadDataSuccess",E.value)}}catch{}finally{i.value=!1}},V=()=>{S.value=JSON.parse(c.cloneSearchForm),H()},q=async()=>{r.serverConfig?.add&&(u.value="add",f.formColumns=c.getFormItems("add"),_.title="新增信息",y.value=!0,C.data=JSON.parse(c.cloneFormData))},K=async()=>{if(r.serverConfig?.deleteBatch&&a?.value){const G=a.value.getSelectionRows();if(G.length===0){B.ElMessage.warning("请选择要删除的项");return}const j=G.map(k=>k[p.priKey||"id"]);j.length>0&&B.ElMessageBox.confirm("确定删除选中项吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(async()=>{await r.serverConfig?.deleteBatch?.(j.join(","))?B.ElMessage.success("删除成功"):B.ElMessage.error("删除失败"),H()})}},Q=G=>{h.pageSize=Number(G),H()},A=G=>{h.currentPage=G,H()},T=async G=>{if(r.serverConfig?.view){u.value="details",f.formColumns=c.getFormItems("details"),_.title="查看详情";try{const j=G[p.priKey||"id"];if(!j){B.ElMessage.error("查看失败,未获取到主键值");return}const k=await r.serverConfig?.view?.({key:j});debugger;k.success&&k.data?(C.data={...k.data},y.value=!0):B.ElMessage.error("查询失败")}catch{B.ElMessage.error("查询失败")}}},R=async G=>{r.serverConfig?.update&&(u.value="update",f.formColumns=c.getFormItems("update"),_.title="编辑信息",y.value=!0,C.data={...G})},P=G=>{r.serverConfig?.delete&&B.ElMessageBox.confirm("确定删除选中项吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(async()=>{const j=G[p.priKey||"id"];if(!j){B.ElMessage.error("删除失败,未获取到主键值");return}await r.serverConfig?.delete?.(j)?(B.ElMessage.success("删除成功"),H()):B.ElMessage.error("删除失败")})},Y=()=>{N.value=!0,l.value?.validate(async(G,j)=>{if(G){let k=u.value==="add"?r.serverConfig?.add:r.serverConfig?.update;if(k)try{const le=await k({params:{...c.formatFormData(C.data)}});le.success?(B.ElMessage.success(u.value==="add"?"新增成功":"编辑成功"),y.value=!1,H()):B.ElMessage.error("保存失败"+le.msg)}catch(le){B.ElMessage.error("保存失败"+le.message)}finally{N.value=!1}}else N.value=!1})},X=G=>{s("switchChange",G)};g.onMounted(async()=>{if(r.serverConfig?.init){const G=await r.serverConfig.init();if(G.success&&G.data){const j=G.data||{},k=j.dataExt?JSON.parse(j.dataExt):{};Object.assign(p,j||{}),Object.assign(m,k?.tableConfig||{}),Object.assign(_,k?.dialogConfig||{}),Object.assign(f?.columns||[],k?.editorConfig||{}),h.pageSize=m.defaultPageSize||h.pageSize,m.visibleOperationButtons=(m.operationButtons||[]).map(le=>le.type),console.log("curdConfig",p),console.log("tableConfig",m),console.log("dialogConfig",_),console.log("editorConfig",f),b.searchFormWidth=m.searchFormWidth&&m.searchFormWidth!==""?m.searchFormWidth:b.searchFormWidth,b.searchLabelWidth=m.searchLabelWidth&&m.searchLabelWidth!==""?m.searchLabelWidth:b.searchLabelWidth,c.setConfig({curdConfig:p,searchConfig:b,tableConfig:m,editorConfig:f}),await c.loadDictionary(),L.value=c.initVisibleColumns(),S.value=c.formatSearchConfigForm(),C.data=c.formatFormConfigData(),v.value=c.formatFormRules(),O.value=c.hasGeometryField(),await c.loadDictionary(),requestAnimationFrame(()=>{d.value=o.value?.clientHeight+"px"}),setTimeout(()=>{H()},500)}else B.ElMessage.error("未查询到有效配置")}else B.ElMessage.error("请配置init方法");window.addEventListener("resize",se)});const se=()=>{d.value="100px",requestAnimationFrame(()=>{d.value=o.value?.clientHeight+"px"})};g.onUnmounted(()=>{window.removeEventListener("resize",se)}),g.watch(y,G=>{G?g.nextTick(()=>{w.value=!0}):w.value=!1});const Ce=G=>{E.value=G},Se=G=>{m.columns=G};return t({setTableData:Ce,getTableData:()=>E.value}),(G,j)=>(g.openBlock(),g.createElementBlock(g.Fragment,null,[g.createElementVNode("div",c4,[g.createElementVNode("div",d4,[g.createVNode(g.unref(B.ElForm),{inline:!0,class:"form-inline","label-width":b.searchLabelWidth},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(b.columns,k=>(g.openBlock(),g.createBlock(g.unref(B.ElFormItem),{key:k.columnProperty,label:k.searchFormLabel||k.columnLabel,style:g.normalizeStyle(`width: ${b.searchFormWidth}px;`)},{default:g.withCtx(()=>[k.showMethod==="slot"?g.renderSlot(G.$slots,"search-"+k.columnProperty,{key:0,scope:{...G.scope,searchForm:S.value,data:S.value[k.columnProperty]}},void 0,!0):(g.openBlock(),g.createBlock(ou,{key:1,modelValue:S.value[k.columnProperty],"onUpdate:modelValue":le=>S.value[k.columnProperty]=le,item:k,dropdownOptions:g.unref(c).getDictOptionsByCode(k.dictService)},null,8,["modelValue","onUpdate:modelValue","item","dropdownOptions"]))]),_:2},1032,["label","style"]))),128)),g.createVNode(g.unref(B.ElFormItem),{style:{"margin-left":"10px"}},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElButton),{type:"primary",size:e.size,icon:"Search",onClick:H},{default:g.withCtx(()=>[...j[6]||(j[6]=[g.createTextVNode("查询",-1)])]),_:1},8,["size"]),g.createVNode(g.unref(B.ElButton),{type:"default",size:e.size,icon:"Refresh",onClick:V},{default:g.withCtx(()=>[...j[7]||(j[7]=[g.createTextVNode("重置",-1)])]),_:1},8,["size"])]),_:1})]),_:3},8,["label-width"])]),p.webFunction.length>0?(g.openBlock(),g.createElementBlock("div",u4,[g.createElementVNode("div",p4,[e.permissions.add&&p.webFunction.includes("add")?(g.openBlock(),g.createBlock(g.unref(B.ElButton),{key:0,type:"primary",size:e.size,icon:"CirclePlus",onClick:q},{default:g.withCtx(()=>[...j[8]||(j[8]=[g.createTextVNode("新增",-1)])]),_:1},8,["size"])):g.createCommentVNode("",!0),e.permissions.delete&&p.webFunction.includes("batchDelete")?(g.openBlock(),g.createBlock(g.unref(B.ElButton),{key:1,type:"danger",size:e.size,icon:"Delete",onClick:K},{default:g.withCtx(()=>[...j[9]||(j[9]=[g.createTextVNode("批量删除",-1)])]),_:1},8,["size"])):g.createCommentVNode("",!0),g.renderSlot(G.$slots,"table-actions",{},void 0,!0)]),g.createElementVNode("div",m4,[g.renderSlot(G.$slots,"table-actions-right",{},void 0,!0),p.webFunction.includes("export")?(g.openBlock(),g.createBlock(r4,{key:0,columns:m.columns,"visible-columns":L.value,data:E.value},null,8,["columns","visible-columns","data"])):g.createCommentVNode("",!0),g.createVNode(s4,{"table-columns":m.columns,"visible-columns":L.value,"onUpdate:visibleColumns":j[0]||(j[0]=k=>L.value=k),"onUpdate:columns":Se},null,8,["table-columns","visible-columns"])])])):g.createCommentVNode("",!0),g.createElementVNode("div",{ref_key:"curdTableContainerRef",ref:o,class:"curd-table"},[g.createVNode(g.unref(B.ElTable),{ref_key:"tableRef",ref:a,data:E.value,border:"",stripe:"",size:e.size,height:d.value,"header-cell-style":{background:"#F5F7FA"}},{default:g.withCtx(()=>[m.showIndex?(g.openBlock(),g.createBlock(g.unref(B.ElTableColumn),{key:0,type:"index",width:m.indexWidth,label:"#",align:"center"},null,8,["width"])):g.createCommentVNode("",!0),e.permissions.delete&&p.webFunction.includes("batchDelete")?(g.openBlock(),g.createBlock(g.unref(B.ElTableColumn),{key:1,type:"selection",width:"55",align:"center"})):g.createCommentVNode("",!0),(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(m.columns,k=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:k.prop},[L.value.includes(k.columnProperty)?(g.openBlock(),g.createBlock(g.unref(B.ElTableColumn),{key:0,label:k.columnLabel,width:(k.width||"")+"px",fixed:k.fixed,"show-overflow-tooltip":k.noWrap,align:k.align,"header-align":k.headerAlign},{default:g.withCtx(le=>[k.showMethod==="slot"?g.renderSlot(G.$slots,"table-column-"+k.columnProperty,{key:0,scope:le},void 0,!0):k.showMethod==="upload"?(g.openBlock(),g.createBlock(Ws,{key:1,item:k,modelValue:le.row[k.columnProperty],"onUpdate:modelValue":ot=>le.row[k.columnProperty]=ot,currentOperationType:"column",headers:e.serverConfig.headers(),download:e.serverConfig.download()},null,8,["item","modelValue","onUpdate:modelValue","headers","download"])):k.showMethod==="tag"?(g.openBlock(),g.createBlock(g.unref(B.ElTag),{key:2,type:le?.row[k.columnProperty]===1||le?.row[k.columnProperty]==="1"?"success":k.tagType||"info"},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(g.unref(c).formatColumnValue(k,le?.row[k.columnProperty])),1)]),_:2},1032,["type"])):k.showMethod==="switch"?(g.openBlock(),g.createBlock(g.unref(B.ElSwitch),{key:3,modelValue:le.row[k.columnProperty],"onUpdate:modelValue":ot=>le.row[k.columnProperty]=ot,"active-value":"1","inactive-value":"0","active-text":"是","inactive-text":"否",onChange:ot=>X(le)},null,8,["modelValue","onUpdate:modelValue","onChange"])):(g.openBlock(),g.createElementBlock(g.Fragment,{key:4},[g.createTextVNode(g.toDisplayString(g.unref(c).formatColumnValue(k,le?.row[k.columnProperty])),1)],64))]),_:2},1032,["label","width","fixed","show-overflow-tooltip","align","header-align"])):g.createCommentVNode("",!0)],64))),128)),g.createVNode(g.unref(B.ElTableColumn),{align:m.operationAlign,fixed:"right",width:m.operationWidth,label:"操作"},{default:g.withCtx(k=>[m.visibleOperationButtons.includes("detail")?(g.openBlock(),g.createBlock(g.unref(B.ElButton),{key:0,type:"primary",plain:"",size:m.operationSize,onClick:le=>T(k.row)},{default:g.withCtx(()=>[...j[10]||(j[10]=[g.createTextVNode("详情",-1)])]),_:1},8,["size","onClick"])):g.createCommentVNode("",!0),m.visibleOperationButtons.includes("edit")&&e.permissions.edit?(g.openBlock(),g.createBlock(g.unref(B.ElButton),{key:1,type:"success",plain:"",size:m.operationSize,onClick:le=>R(k.row)},{default:g.withCtx(()=>[...j[11]||(j[11]=[g.createTextVNode("编辑",-1)])]),_:1},8,["size","onClick"])):g.createCommentVNode("",!0),m.visibleOperationButtons.includes("delete")&&e.permissions.delete?(g.openBlock(),g.createBlock(g.unref(B.ElButton),{key:2,type:"danger",plain:"",size:m.operationSize,onClick:le=>P(k.row)},{default:g.withCtx(()=>[...j[12]||(j[12]=[g.createTextVNode("删除",-1)])]),_:1},8,["size","onClick"])):g.createCommentVNode("",!0),g.renderSlot(G.$slots,"table-column-action",{scope:k},void 0,!0)]),_:3},8,["align","width"])]),_:3},8,["data","size","height"])],512),m.showPagination?(g.openBlock(),g.createElementBlock("div",h4,[g.createVNode(g.unref(B.ElPagination),{"current-page":h.currentPage,"onUpdate:currentPage":j[1]||(j[1]=k=>h.currentPage=k),"page-size":h.pageSize,"onUpdate:pageSize":j[2]||(j[2]=k=>h.pageSize=k),total:h.total,layout:"total, sizes, prev, pager, next",background:"",size:e.size,onSizeChange:Q,onCurrentChange:A},null,8,["current-page","page-size","total","size"])])):g.createCommentVNode("",!0)]),g.createVNode(g.unref(B.ElDialog),{title:_.title,"close-on-click-modal":!1,"close-on-press-escape":!1,width:_.formDialogWidth,modelValue:y.value,"onUpdate:modelValue":j[5]||(j[5]=k=>y.value=k),"destroy-on-close":!0,draggable:"","append-to-body":!0,"align-center":""},g.createSlots({default:g.withCtx(()=>[g.createVNode(g.unref(B.ElRow),null,{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElCol),{span:O.value?24-O.value.span:24},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElForm),{ref_key:"formRef",ref:l,model:C.data,rules:v.value,size:"default","label-width":_.labelWidth,"label-suffix":":",class:g.normalizeClass({"curd-form-details":u.value==="details"})},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElRow),null,{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElCol),{span:24},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElRow),null,{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(f.formColumns,k=>(g.openBlock(),g.createBlock(g.unref(B.ElCol),{key:k.columnProperty,span:k.span||12},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElFormItem),{label:k.columnLabel,prop:k.columnProperty},{default:g.withCtx(()=>[u.value==="details"?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[k.type==="upload"?(g.openBlock(),g.createBlock(Ws,{key:0,item:k,modelValue:C.data[k.columnProperty],"onUpdate:modelValue":le=>C.data[k.columnProperty]=le,currentOperationType:u.value,headers:e.serverConfig.headers(),upload:e.serverConfig.upload(),download:e.serverConfig.download()},null,8,["item","modelValue","onUpdate:modelValue","currentOperationType","headers","upload","download"])):(g.openBlock(),g.createBlock(U3,{key:1,item:k,modelValue:C.data[k.columnProperty],"onUpdate:modelValue":le=>C.data[k.columnProperty]=le,dropdownOptions:g.unref(c).getDictOptionsByColumnProperty(k.columnProperty)},null,8,["item","modelValue","onUpdate:modelValue","dropdownOptions"]))],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[k.showMethod==="slot"?g.renderSlot(G.$slots,"form-"+k.columnProperty,{key:0,item:k,scope:{...G.scope,formData:C.data,data:C.data[k.columnProperty]}},void 0,!0):k.type==="upload"?(g.openBlock(),g.createBlock(Ws,{key:1,item:k,modelValue:C.data[k.columnProperty],"onUpdate:modelValue":le=>C.data[k.columnProperty]=le,currentOperationType:u.value,headers:e.serverConfig.headers(),upload:e.serverConfig.upload(),download:e.serverConfig.download()},null,8,["item","modelValue","onUpdate:modelValue","currentOperationType","headers","upload","download"])):k.type==="editor"?(g.openBlock(),g.createBlock(F3,{key:2,item:k,modelValue:C.data[k.columnProperty],"onUpdate:modelValue":le=>C.data[k.columnProperty]=le,currentOperationType:u.value},null,8,["item","modelValue","onUpdate:modelValue","currentOperationType"])):(g.openBlock(),g.createBlock(ou,{key:3,item:k,modelValue:C.data[k.columnProperty],"onUpdate:modelValue":le=>C.data[k.columnProperty]=le,dropdownOptions:g.unref(c).getDictOptionsByColumnProperty(k.columnProperty),currentOperationType:u.value},null,8,["item","modelValue","onUpdate:modelValue","dropdownOptions","currentOperationType"]))],64))]),_:2},1032,["label","prop"])]),_:2},1032,["span"]))),128))]),_:3})]),_:3})]),_:3})]),_:3},8,["model","rules","label-width","class"])]),_:3},8,["span"]),O.value?(g.openBlock(),g.createBlock(g.unref(B.ElCol),{key:0,span:O.value?O.value.span:0,style:{padding:"0 10px"}},{default:g.withCtx(()=>[w.value?(g.openBlock(),g.createBlock(J3,{key:0,modelValue:C.data.wktstr,"onUpdate:modelValue":j[3]||(j[3]=k=>C.data.wktstr=k),currentOperationType:u.value,mapViewData:e.mapViewData,geomType:p.geomType},null,8,["modelValue","currentOperationType","mapViewData","geomType"])):g.createCommentVNode("",!0)]),_:1},8,["span"])):g.createCommentVNode("",!0)]),_:3})]),_:2},[u.value!=="details"?{name:"footer",fn:g.withCtx(()=>[g.createVNode(g.unref(B.ElButton),{type:"primary",onClick:Y,loading:N.value},{default:g.withCtx(()=>[...j[13]||(j[13]=[g.createTextVNode("确定",-1)])]),_:1},8,["loading"]),g.createVNode(g.unref(B.ElButton),{onClick:j[4]||(j[4]=k=>y.value=!1)},{default:g.withCtx(()=>[...j[14]||(j[14]=[g.createTextVNode("取消",-1)])]),_:1})]),key:"0"}:void 0]),1032,["title","width","modelValue"])],64))}}),qE=Rr(g4,[["__scopeId","data-v-2a77cfe9"]]);qt.CurdForm=qE,qt.default=qE,Object.defineProperties(qt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
677
|
+
`)};return(c,d)=>(g.openBlock(),g.createElementBlock("div",null,[g.createVNode(g.unref(B.ElButton),{type:"default",round:"",onClick:d[0]||(d[0]=u=>r.value=!0)},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(nS))]),_:1})]),_:1}),g.createVNode(g.unref(B.ElDialog),{modelValue:r.value,"onUpdate:modelValue":d[4]||(d[4]=u=>r.value=u),title:"导出数据",width:"400px","close-on-click-modal":!1},{footer:g.withCtx(()=>[g.createVNode(g.unref(B.ElButton),{onClick:d[3]||(d[3]=u=>r.value=!1)},{default:g.withCtx(()=>[...d[5]||(d[5]=[g.createTextVNode("取消",-1)])]),_:1}),g.createVNode(g.unref(B.ElButton),{type:"primary",onClick:s},{default:g.withCtx(()=>[...d[6]||(d[6]=[g.createTextVNode("导出",-1)])]),_:1})]),default:g.withCtx(()=>[g.createVNode(g.unref(B.ElForm),{ref_key:"exportFormRef",ref:n,model:i,"label-width":"100px",rules:o},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElFormItem),{label:"文件名称",prop:"filename"},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElInput),{modelValue:i.filename,"onUpdate:modelValue":d[1]||(d[1]=u=>i.filename=u),placeholder:"请输入文件名称"},null,8,["modelValue"])]),_:1}),g.createVNode(g.unref(B.ElFormItem),{label:"选择字段"},{default:g.withCtx(()=>[g.createElementVNode("div",e4,[g.createVNode(g.unref(B.ElCheckboxGroup),{modelValue:i.selectedFields,"onUpdate:modelValue":d[2]||(d[2]=u=>i.selectedFields=u)},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(a.value,u=>(g.openBlock(),g.createElementBlock("div",{key:u.columnProperty,class:"column-item"},[g.createVNode(g.unref(B.ElCheckbox),{value:u.columnProperty},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(u.columnLabel),1)]),_:2},1032,["value"])]))),128))]),_:1},8,["modelValue"])])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])]))}}),r4=Rr(n4,[["__scopeId","data-v-551fc665"]]),i4={class:"column-manager"},o4={name:"ColumnManager"},a4=g.defineComponent({...o4,props:{tableColumns:{type:Array,default:()=>({columns:[]})},visibleColumns:{type:Array,default:()=>[]}},emits:["update:visibleColumns","update:columns"],setup(e,{emit:t}){const n=e,r=t,i=g.ref(!1),o=g.ref([...n.visibleColumns]),a=(s,l)=>{l?o.value.push(s):o.value=o.value.filter(c=>c!==s),r("update:visibleColumns",o.value)};return g.watch(()=>n.visibleColumns,s=>{o.value=[...s]},{deep:!0}),(s,l)=>(g.openBlock(),g.createElementBlock("div",null,[g.createVNode(g.unref(B.ElPopover),{visible:i.value,"onUpdate:visible":l[0]||(l[0]=c=>i.value=c),placement:"bottom-end",width:220,trigger:"click","popper-class":"column-manager-popover"},{reference:g.withCtx(()=>[g.createVNode(g.unref(B.ElButton),{type:"default",round:""},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(cS))]),_:1})]),_:1})]),default:g.withCtx(()=>[g.createElementVNode("div",i4,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.tableColumns,c=>(g.openBlock(),g.createElementBlock("div",{class:"column-item",key:c.columnProperty},[g.createVNode(g.unref(B.ElCheckbox),{modelValue:o.value.includes(c.columnProperty),onChange:d=>a(c.columnProperty,d)},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(c.columnLabel||c.columnProperty),1)]),_:2},1032,["modelValue","onChange"])]))),128))])]),_:1},8,["visible"])]))}}),s4=Rr(a4,[["__scopeId","data-v-3bb66278"]]);class l4{serverConfig;curdConfig={};searchConfig={};tableConfig={};editorConfig={};searchFormMap=new Map;cloneSearchForm="{}";cloneFormData="{}";dictionaryMap=new Map;columnMap=new Map;constructor({serverConfig:t}){this.serverConfig=t}setConfig({curdConfig:t,searchConfig:n,tableConfig:r,editorConfig:i}){this.curdConfig=t||this.curdConfig,this.searchConfig=n||this.searchConfig,this.tableConfig=r||this.tableConfig,this.editorConfig=i||this.editorConfig,this.columnMap?.clear(),this.tableConfig?.columns?.forEach(o=>{this.columnMap?.set(o.columnProperty,o)})}async loadDictionary(){if(!this.tableConfig?.columns)return this.dictionaryMap;const t=this.tableConfig.columns.filter(n=>["code","table"].includes(n.dictType||"")&&n.dictService).map(n=>{let r=n.fieldType||"String";r==="integer"&&(r="Integer");let i,o;return n.dictType==="code"?(o=this.serverConfig?.dict({dictCode:n.dictService,itemIdType:r}),i=n.dictService||""):(o=this.serverConfig?.dictServer(n.dictService,{key:n.dictionary?.name||""}),i=`${n.dictService}-${n.dictionary?.name||""}`),o.then(a=>{a&&i&&this.dictionaryMap.set(i,a||[])}).catch(a=>{console.error(`加载字典 ${n.dictService} 失败:`,a)})});return await Promise.all(t),this.dictionaryMap}getDictOptionsByCode(t){return t?this.dictionaryMap.get(t)||[]:[]}getDictOptionsByColumnProperty(t){if(!t)return[];const n=this.tableConfig?.columns?.find(r=>r.columnProperty===t);return this.getDictOptionsByCode(n?.dictType==="code"?n?.dictService||"":`${n?.dictService||""}-${n?.dictionary?.name||""}`)}formatColumnValue(t,n){if(n==null||n==="")return n;if(t.dictType&&t.dictService){let r=t.dictType==="code"?t.dictService||"":`${t.dictService}-${t.dictionary?.name||""}`;const i=this.dictionaryMap.get(r)||[];if(!i||i.length===0)return n;if(t.showMethod==="multi-select")return n.map(a=>{const s=i.find(l=>l.id===a);return s?s.name:a}).join(", ");const o=i.find(a=>a.id===n);return o?o.name:n}if(!t.formatter||t.formatter==="")return n;switch(t.fieldType){case"date":return n?B.dayjs(n).format(t.formatter||"YYYY-MM-DD"):"";case"datetime":return n?B.dayjs(n).format(t.formatter||"YYYY-MM-DD HH:mm:ss"):"";default:return n}}formatFormRules(){const t={};return(this.editorConfig?.columns||[]).forEach(n=>{t[n.columnProperty]=[],n.isRequired&&t[n.columnProperty].push({required:!0,message:"请输入"+n.columnLabel,trigger:"blur"})}),t}formatSearchConfigForm(){this.searchConfig.columns=this.tableConfig?.columns?.filter(n=>n.searchable!="no")||[],this.searchConfig?.columns.forEach(n=>{this.searchFormMap.set(n.columnProperty,n)});const t={};return this.searchConfig?.columns.forEach(n=>{let r=n.searchDefaultValue;r!=null&&r!==""&&(r=this.formatValueByColumnProperty(r,n.columnProperty)),t[n.columnProperty]=r}),this.cloneSearchForm=JSON.stringify(t),t}formatFormConfigData(){const t={};return(this.editorConfig?.columns||[]).filter(r=>r.columnProperty===this.curdConfig?.priKey?!0:r.type!=="hidden").forEach(r=>{let i=r.defaultValue;i!=null&&i!==""&&(i=this.formatValueByColumnProperty(i,r.columnProperty)),t[r.columnProperty]=i}),this.cloneFormData=JSON.stringify(t),t}formatSearchForm(t){const n={};return this.searchFormMap.forEach((r,i)=>{const o=t[i];if(o!=null&&o!==""){let a="";switch(r.searchable){case"=":a=`= '${o}'`;break;case"like":a=`like '%${o}%'`;break;case"in":a=`in (${o})`;break}n[i]=a}}),n}formatFormData(t){if(!t||Object.keys(t).length===0)return{};let n={};return(this.tableConfig?.columns||[]).forEach(r=>{r?.fieldType==="integer"?n[r.columnProperty]=Number(t[r.columnProperty]):n[r.columnProperty]=t[r.columnProperty]}),t.wktstr&&(n.wktstr=t.wktstr),n}initVisibleColumns(){return(this.tableConfig?.columns||[]).filter(t=>t.showMethod!="hidden").map(t=>t.columnProperty)}getFormItems(t=""){let n=[];switch(t){case"details":n=(this.editorConfig?.columns||[]).filter(r=>r.type!=="hidden"&&r.updateFormStatus!=="hidden"&&r.type!=="shape");break;case"add":n=(this.editorConfig?.columns||[]).filter(r=>r.type!=="hidden"&&r.createFormStatus!=="hidden"&&r.type!=="shape");break;case"update":n=(this.editorConfig?.columns||[]).filter(r=>r.type!=="hidden"&&r.updateFormStatus!=="hidden"&&r.type!=="shape");break}return n}hasGeometryField(){return(this.editorConfig?.columns||[]).find(n=>n.type==="shape")||void 0}formatValueByColumnProperty(t,n){const r=this.columnMap?.get(n);if(!r)return t;switch(r?.fieldType){case"integer":case"float":case"double":case"number":return Number(t);default:return t}}}const c4={class:"curd-container"},d4={class:"curd-search"},u4={key:0,class:"table-actions"},p4={class:"table-actions-left"},m4={class:"table-actions-right"},h4={key:1,class:"curd-pagination"},_4={name:"CurdForm"},g4=g.defineComponent({..._4,props:{size:{type:String,default:"default"},title:{type:String,default:"信息管理"},permissions:{type:Object,default:()=>({add:!1,edit:!1,delete:!1,deleteBatch:!1,export:!1})},serverConfig:{type:Object,default:()=>({init:Function,list:Function,view:Function,add:Function,delete:Function,deleteBatch:Function,update:Function,dict:Function,dictServer:Function,upload:Function,download:Function,headers:Function})},mapViewData:{type:Object,default:()=>({})}},emits:["loadDataSuccess","switchChange"],setup(e,{expose:t,emit:n}){const r=e,i=g.ref(!1),o=g.ref(null),a=g.ref(null),s=n,l=g.ref(),c=new l4({serverConfig:r.serverConfig}),d=g.ref(""),u=g.ref("details"),p=g.reactive({priKey:"id",priKeyType:"string",sortField:"id",sortOrder:0,geomType:"point",webFunction:[],dataExt:"{}"}),m=g.reactive({showIndex:!0,indexWidth:50,showCheckbox:!0,showOperation:!0,operationWidth:120,operationLocation:"right",operationButtons:[],visibleOperationButtons:[],operationAlign:"center",showPagination:!0,defaultPageSize:10,pageUISize:"default",showExpand:!1,columns:[]}),h=g.reactive({total:0,pageSize:m.defaultPageSize,currentPage:1}),_=g.reactive({title:"弹框表单",formDialogWidth:"800px",labelWidth:"120px"}),f=g.reactive({columns:[],formColumns:[]}),b=g.reactive({searchLabelWidth:"80",searchFormWidth:"290",columns:[]}),S=g.ref({}),y=g.ref(!1),E=g.ref([]),C=g.reactive({data:{}}),v=g.ref({}),N=g.ref(!1),w=g.ref(!1),O=g.ref(),L=g.ref([]),H=async()=>{if(r.serverConfig?.list)try{i.value=!0;const G=await r.serverConfig?.list({whereClause:c.formatSearchForm(S.value),orderParam:[{fieldName:p.sortField,asc:p.sortOrder===0}],pageParam:{pageNum:h.currentPage,pageSize:h.pageSize}});if(G){const j=G.data;E.value=j.dataList||[],h.total=j.totalCount,s("loadDataSuccess",E.value)}}catch{}finally{i.value=!1}},V=()=>{S.value=JSON.parse(c.cloneSearchForm),H()},q=async()=>{r.serverConfig?.add&&(u.value="add",f.formColumns=c.getFormItems("add"),_.title="新增信息",y.value=!0,C.data=JSON.parse(c.cloneFormData))},K=async()=>{if(r.serverConfig?.deleteBatch&&a?.value){const G=a.value.getSelectionRows();if(G.length===0){B.ElMessage.warning("请选择要删除的项");return}const j=G.map(k=>k[p.priKey||"id"]);j.length>0&&B.ElMessageBox.confirm("确定删除选中项吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(async()=>{await r.serverConfig?.deleteBatch?.(j.join(","))?B.ElMessage.success("删除成功"):B.ElMessage.error("删除失败"),H()})}},Q=G=>{h.pageSize=Number(G),H()},A=G=>{h.currentPage=G,H()},T=async G=>{if(r.serverConfig?.view){u.value="details",f.formColumns=c.getFormItems("details"),_.title="查看详情";try{const j=G[p.priKey||"id"];if(!j){B.ElMessage.error("查看失败,未获取到主键值");return}const k=await r.serverConfig?.view?.({key:j});debugger;k.success&&k.data?(C.data={...k.data},y.value=!0):B.ElMessage.error("查询失败")}catch{B.ElMessage.error("查询失败")}}},R=async G=>{r.serverConfig?.update&&(u.value="update",f.formColumns=c.getFormItems("update"),_.title="编辑信息",y.value=!0,C.data={...G})},P=G=>{r.serverConfig?.delete&&B.ElMessageBox.confirm("确定删除选中项吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(async()=>{const j=G[p.priKey||"id"];if(!j){B.ElMessage.error("删除失败,未获取到主键值");return}await r.serverConfig?.delete?.(j)?(B.ElMessage.success("删除成功"),H()):B.ElMessage.error("删除失败")})},Y=()=>{N.value=!0,l.value?.validate(async(G,j)=>{if(G){let k=u.value==="add"?r.serverConfig?.add:r.serverConfig?.update;if(k)try{const le=await k({params:{...c.formatFormData(C.data)}});le.success?(B.ElMessage.success(u.value==="add"?"新增成功":"编辑成功"),y.value=!1,H()):B.ElMessage.error("保存失败"+le.msg)}catch(le){B.ElMessage.error("保存失败"+le.message)}finally{N.value=!1}}else N.value=!1})},X=G=>{s("switchChange",G)};g.onMounted(async()=>{if(r.serverConfig?.init){const G=await r.serverConfig.init();if(G.success&&G.data){const j=G.data||{},k=j.dataExt?JSON.parse(j.dataExt):{};Object.assign(p,j||{}),Object.assign(m,k?.tableConfig||{}),Object.assign(_,k?.dialogConfig||{}),Object.assign(f?.columns||[],k?.editorConfig||{}),h.pageSize=m.defaultPageSize||h.pageSize,m.visibleOperationButtons=(m.operationButtons||[]).map(le=>le.type),console.log("curdConfig",p),console.log("tableConfig",m),console.log("dialogConfig",_),console.log("editorConfig",f),b.searchFormWidth=m.searchFormWidth&&m.searchFormWidth!==""?m.searchFormWidth:b.searchFormWidth,b.searchLabelWidth=m.searchLabelWidth&&m.searchLabelWidth!==""?m.searchLabelWidth:b.searchLabelWidth,c.setConfig({curdConfig:p,searchConfig:b,tableConfig:m,editorConfig:f}),await c.loadDictionary(),L.value=c.initVisibleColumns(),S.value=c.formatSearchConfigForm(),C.data=c.formatFormConfigData(),v.value=c.formatFormRules(),O.value=c.hasGeometryField(),await c.loadDictionary(),requestAnimationFrame(()=>{d.value=o.value?.clientHeight+"px"}),setTimeout(()=>{H()},500)}else B.ElMessage.error("未查询到有效配置")}else B.ElMessage.error("请配置init方法");window.addEventListener("resize",se)});const se=()=>{d.value="100px",requestAnimationFrame(()=>{d.value=o.value?.clientHeight+"px"})};g.onUnmounted(()=>{window.removeEventListener("resize",se)}),g.watch(y,G=>{G?g.nextTick(()=>{w.value=!0}):w.value=!1});const Ce=G=>{E.value=G},Se=G=>{m.columns=G};return t({setTableData:Ce,getTableData:()=>E.value}),(G,j)=>(g.openBlock(),g.createElementBlock(g.Fragment,null,[g.createElementVNode("div",c4,[g.createElementVNode("div",d4,[g.createVNode(g.unref(B.ElForm),{inline:!0,class:"form-inline","label-width":b.searchLabelWidth},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(b.columns,k=>(g.openBlock(),g.createBlock(g.unref(B.ElFormItem),{key:k.columnProperty,label:k.searchFormLabel||k.columnLabel,style:g.normalizeStyle(`width: ${b.searchFormWidth}px;`)},{default:g.withCtx(()=>[k.showMethod==="slot"?g.renderSlot(G.$slots,"search-"+k.columnProperty,{key:0,scope:{...G.scope,searchForm:S.value,data:S.value[k.columnProperty]}},void 0,!0):(g.openBlock(),g.createBlock(ou,{key:1,modelValue:S.value[k.columnProperty],"onUpdate:modelValue":le=>S.value[k.columnProperty]=le,item:k,dropdownOptions:g.unref(c).getDictOptionsByCode(k.dictService)},null,8,["modelValue","onUpdate:modelValue","item","dropdownOptions"]))]),_:2},1032,["label","style"]))),128)),g.createVNode(g.unref(B.ElFormItem),{style:{"margin-left":"10px"}},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElButton),{type:"primary",size:e.size,icon:"Search",onClick:H},{default:g.withCtx(()=>[...j[6]||(j[6]=[g.createTextVNode("查询",-1)])]),_:1},8,["size"]),g.createVNode(g.unref(B.ElButton),{type:"default",size:e.size,icon:"Refresh",onClick:V},{default:g.withCtx(()=>[...j[7]||(j[7]=[g.createTextVNode("重置",-1)])]),_:1},8,["size"])]),_:1})]),_:3},8,["label-width"])]),p.webFunction.length>0?(g.openBlock(),g.createElementBlock("div",u4,[g.createElementVNode("div",p4,[e.permissions.add&&p.webFunction.includes("add")?(g.openBlock(),g.createBlock(g.unref(B.ElButton),{key:0,type:"primary",size:e.size,icon:"CirclePlus",onClick:q},{default:g.withCtx(()=>[...j[8]||(j[8]=[g.createTextVNode("新增",-1)])]),_:1},8,["size"])):g.createCommentVNode("",!0),e.permissions.delete&&p.webFunction.includes("batchDelete")?(g.openBlock(),g.createBlock(g.unref(B.ElButton),{key:1,type:"danger",size:e.size,icon:"Delete",onClick:K},{default:g.withCtx(()=>[...j[9]||(j[9]=[g.createTextVNode("批量删除",-1)])]),_:1},8,["size"])):g.createCommentVNode("",!0),g.renderSlot(G.$slots,"table-actions",{},void 0,!0)]),g.createElementVNode("div",m4,[g.renderSlot(G.$slots,"table-actions-right",{},void 0,!0),p.webFunction.includes("export")?(g.openBlock(),g.createBlock(r4,{key:0,columns:m.columns,"visible-columns":L.value,data:E.value},null,8,["columns","visible-columns","data"])):g.createCommentVNode("",!0),g.createVNode(s4,{"table-columns":m.columns,"visible-columns":L.value,"onUpdate:visibleColumns":j[0]||(j[0]=k=>L.value=k),"onUpdate:columns":Se},null,8,["table-columns","visible-columns"])])])):g.createCommentVNode("",!0),g.createElementVNode("div",{ref_key:"curdTableContainerRef",ref:o,class:"curd-table"},[g.createVNode(g.unref(B.ElTable),{ref_key:"tableRef",ref:a,data:E.value,border:"",stripe:"",size:e.size,height:d.value,"header-cell-style":{background:"#F5F7FA"}},{default:g.withCtx(()=>[m.showIndex?(g.openBlock(),g.createBlock(g.unref(B.ElTableColumn),{key:0,type:"index",width:m.indexWidth,label:"#",align:"center"},null,8,["width"])):g.createCommentVNode("",!0),e.permissions.delete&&p.webFunction.includes("batchDelete")?(g.openBlock(),g.createBlock(g.unref(B.ElTableColumn),{key:1,type:"selection",width:"55",align:"center"})):g.createCommentVNode("",!0),(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(m.columns,k=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:k.prop},[L.value.includes(k.columnProperty)?(g.openBlock(),g.createBlock(g.unref(B.ElTableColumn),{key:0,label:k.columnLabel,width:(k.width||"")+"px",fixed:k.fixed,"show-overflow-tooltip":k.noWrap,align:k.align,"header-align":k.headerAlign},{default:g.withCtx(le=>[k.showMethod==="slot"?g.renderSlot(G.$slots,"table-column-"+k.columnProperty,{key:0,scope:le},void 0,!0):k.showMethod==="upload"?(g.openBlock(),g.createBlock(Ws,{key:1,item:k,modelValue:le.row[k.columnProperty],"onUpdate:modelValue":ot=>le.row[k.columnProperty]=ot,currentOperationType:"column",headers:e.serverConfig.headers(),download:e.serverConfig.download()},null,8,["item","modelValue","onUpdate:modelValue","headers","download"])):k.showMethod==="tag"?(g.openBlock(),g.createBlock(g.unref(B.ElTag),{key:2,type:le?.row[k.columnProperty]===1||le?.row[k.columnProperty]==="1"?"success":k.tagType||"info"},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(g.unref(c).formatColumnValue(k,le?.row[k.columnProperty])),1)]),_:2},1032,["type"])):k.showMethod==="switch"?(g.openBlock(),g.createBlock(g.unref(B.ElSwitch),{key:3,modelValue:le.row[k.columnProperty],"onUpdate:modelValue":ot=>le.row[k.columnProperty]=ot,"active-value":"1","inactive-value":"0","active-text":"是","inactive-text":"否",onChange:ot=>X(le)},null,8,["modelValue","onUpdate:modelValue","onChange"])):(g.openBlock(),g.createElementBlock(g.Fragment,{key:4},[g.createTextVNode(g.toDisplayString(g.unref(c).formatColumnValue(k,le?.row[k.columnProperty])),1)],64))]),_:2},1032,["label","width","fixed","show-overflow-tooltip","align","header-align"])):g.createCommentVNode("",!0)],64))),128)),g.createVNode(g.unref(B.ElTableColumn),{align:m.operationAlign,fixed:"right",width:m.operationWidth,label:"操作"},{default:g.withCtx(k=>[m.visibleOperationButtons.includes("detail")?(g.openBlock(),g.createBlock(g.unref(B.ElButton),{key:0,type:"primary",plain:"",size:m.operationSize,onClick:le=>T(k.row)},{default:g.withCtx(()=>[...j[10]||(j[10]=[g.createTextVNode("详情",-1)])]),_:1},8,["size","onClick"])):g.createCommentVNode("",!0),m.visibleOperationButtons.includes("edit")&&e.permissions.edit?(g.openBlock(),g.createBlock(g.unref(B.ElButton),{key:1,type:"success",plain:"",size:m.operationSize,onClick:le=>R(k.row)},{default:g.withCtx(()=>[...j[11]||(j[11]=[g.createTextVNode("编辑",-1)])]),_:1},8,["size","onClick"])):g.createCommentVNode("",!0),m.visibleOperationButtons.includes("delete")&&e.permissions.delete?(g.openBlock(),g.createBlock(g.unref(B.ElButton),{key:2,type:"danger",plain:"",size:m.operationSize,onClick:le=>P(k.row)},{default:g.withCtx(()=>[...j[12]||(j[12]=[g.createTextVNode("删除",-1)])]),_:1},8,["size","onClick"])):g.createCommentVNode("",!0),g.renderSlot(G.$slots,"table-column-action",{scope:k},void 0,!0)]),_:3},8,["align","width"])]),_:3},8,["data","size","height"])],512),m.showPagination?(g.openBlock(),g.createElementBlock("div",h4,[g.createVNode(g.unref(B.ElPagination),{"current-page":h.currentPage,"onUpdate:currentPage":j[1]||(j[1]=k=>h.currentPage=k),"page-size":h.pageSize,"onUpdate:pageSize":j[2]||(j[2]=k=>h.pageSize=k),total:h.total,layout:"total, sizes, prev, pager, next",background:"",size:e.size,onSizeChange:Q,onCurrentChange:A},null,8,["current-page","page-size","total","size"])])):g.createCommentVNode("",!0)]),g.createVNode(g.unref(B.ElDialog),{title:_.title,"close-on-click-modal":!1,"close-on-press-escape":!1,width:_.formDialogWidth,modelValue:y.value,"onUpdate:modelValue":j[5]||(j[5]=k=>y.value=k),"destroy-on-close":!0,draggable:"","append-to-body":!0,"align-center":""},g.createSlots({default:g.withCtx(()=>[g.createVNode(g.unref(B.ElRow),null,{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElCol),{span:O.value?24-O.value.span:24},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElForm),{ref_key:"formRef",ref:l,model:C.data,rules:v.value,size:"default","label-width":_.labelWidth,"label-suffix":":",class:g.normalizeClass({"curd-form-details":u.value==="details"})},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElRow),null,{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElCol),{span:24},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElRow),null,{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(f.formColumns,k=>(g.openBlock(),g.createBlock(g.unref(B.ElCol),{key:k.columnProperty,span:k.span||12},{default:g.withCtx(()=>[g.createVNode(g.unref(B.ElFormItem),{label:k.columnLabel,prop:k.columnProperty},{default:g.withCtx(()=>[u.value==="details"?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[k.type==="upload"?(g.openBlock(),g.createBlock(Ws,{key:0,item:k,modelValue:C.data[k.columnProperty],"onUpdate:modelValue":le=>C.data[k.columnProperty]=le,currentOperationType:u.value,headers:e.serverConfig.headers(),upload:e.serverConfig.upload(),download:e.serverConfig.download()},null,8,["item","modelValue","onUpdate:modelValue","currentOperationType","headers","upload","download"])):(g.openBlock(),g.createBlock(U3,{key:1,item:k,modelValue:C.data[k.columnProperty],"onUpdate:modelValue":le=>C.data[k.columnProperty]=le,dropdownOptions:g.unref(c).getDictOptionsByColumnProperty(k.columnProperty)},null,8,["item","modelValue","onUpdate:modelValue","dropdownOptions"]))],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[k.showMethod==="slot"?g.renderSlot(G.$slots,"form-"+k.columnProperty,{key:0,item:k,scope:{...G.scope,formData:C.data,data:C.data[k.columnProperty]}},void 0,!0):k.type==="upload"?(g.openBlock(),g.createBlock(Ws,{key:1,item:k,modelValue:C.data[k.columnProperty],"onUpdate:modelValue":le=>C.data[k.columnProperty]=le,currentOperationType:u.value,headers:e.serverConfig.headers(),upload:e.serverConfig.upload(),download:e.serverConfig.download()},null,8,["item","modelValue","onUpdate:modelValue","currentOperationType","headers","upload","download"])):k.type==="editor"?(g.openBlock(),g.createBlock(F3,{key:2,item:k,modelValue:C.data[k.columnProperty],"onUpdate:modelValue":le=>C.data[k.columnProperty]=le,currentOperationType:u.value},null,8,["item","modelValue","onUpdate:modelValue","currentOperationType"])):(g.openBlock(),g.createBlock(ou,{key:3,item:k,modelValue:C.data[k.columnProperty],"onUpdate:modelValue":le=>C.data[k.columnProperty]=le,dropdownOptions:g.unref(c).getDictOptionsByColumnProperty(k.columnProperty),currentOperationType:u.value},null,8,["item","modelValue","onUpdate:modelValue","dropdownOptions","currentOperationType"]))],64))]),_:2},1032,["label","prop"])]),_:2},1032,["span"]))),128))]),_:3})]),_:3})]),_:3})]),_:3},8,["model","rules","label-width","class"])]),_:3},8,["span"]),O.value?(g.openBlock(),g.createBlock(g.unref(B.ElCol),{key:0,span:O.value?O.value.span:0,style:{padding:"0 10px"}},{default:g.withCtx(()=>[w.value?(g.openBlock(),g.createBlock(J3,{key:0,modelValue:C.data.wktstr,"onUpdate:modelValue":j[3]||(j[3]=k=>C.data.wktstr=k),currentOperationType:u.value,mapViewData:e.mapViewData,geomType:p.geomType},null,8,["modelValue","currentOperationType","mapViewData","geomType"])):g.createCommentVNode("",!0)]),_:1},8,["span"])):g.createCommentVNode("",!0)]),_:3})]),_:2},[u.value!=="details"?{name:"footer",fn:g.withCtx(()=>[g.createVNode(g.unref(B.ElButton),{type:"primary",onClick:Y,loading:N.value},{default:g.withCtx(()=>[...j[13]||(j[13]=[g.createTextVNode("确定",-1)])]),_:1},8,["loading"]),g.createVNode(g.unref(B.ElButton),{onClick:j[4]||(j[4]=k=>y.value=!1)},{default:g.withCtx(()=>[...j[14]||(j[14]=[g.createTextVNode("取消",-1)])]),_:1})]),key:"0"}:void 0]),1032,["title","width","modelValue"])],64))}}),qE=Rr(g4,[["__scopeId","data-v-2a77cfe9"]]);qt.CurdForm=qE,qt.default=qE,Object.defineProperties(qt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|