hongshu-view 1.0.24 → 1.0.26

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/README.md CHANGED
@@ -1,6 +1,14 @@
1
1
  ## hongshu-view
2
2
  城市大脑鸿书产品web端业务组件库
3
3
 
4
+ ### 1.0.26
5
+ 1.修改Photo组件,添加function
6
+ 2026年4月13日16:37:00
7
+
8
+ ### 1.0.25
9
+ 1.修改Photo组件,添加function
10
+ 2026年4月13日15:54:00
11
+
4
12
  ### 1.0.24
5
13
  1.修改Photo组件,添加function
6
14
  2026年4月13日15:35:00
@@ -83307,6 +83307,9 @@ const RWe = /* @__PURE__ */ Ae(
83307
83307
  maxSize: {
83308
83308
  type: Number,
83309
83309
  default: 100
83310
+ },
83311
+ beforeUpload: {
83312
+ type: Function
83310
83313
  }
83311
83314
  },
83312
83315
  emits: ["update:modelValue", "scuccess", "cancel", "error"],
@@ -83399,6 +83402,7 @@ const RWe = /* @__PURE__ */ Ae(
83399
83402
  "http-request": E,
83400
83403
  "show-file-list": !1,
83401
83404
  "auto-upload": !0,
83405
+ "before-upload": e.beforeUpload,
83402
83406
  accept: e.accept,
83403
83407
  name: "file",
83404
83408
  multiple: !1
@@ -83408,7 +83412,7 @@ const RWe = /* @__PURE__ */ Ae(
83408
83412
  ]),
83409
83413
  _: 1
83410
83414
  /* STABLE */
83411
- }, 8, ["class", "accept"])) : _t("v-if", !0)
83415
+ }, 8, ["class", "before-upload", "accept"])) : _t("v-if", !0)
83412
83416
  ],
83413
83417
  2
83414
83418
  /* CLASS */
@@ -83433,6 +83437,7 @@ const RWe = /* @__PURE__ */ Ae(
83433
83437
  accept: e.accept,
83434
83438
  name: "file",
83435
83439
  multiple: !1,
83440
+ "before-upload": e.beforeUpload,
83436
83441
  "http-request": E,
83437
83442
  "show-file-list": !1,
83438
83443
  style: { display: "inline-block", "vertical-align": "top" }
@@ -83451,7 +83456,7 @@ const RWe = /* @__PURE__ */ Ae(
83451
83456
  ]),
83452
83457
  _: 1
83453
83458
  /* STABLE */
83454
- }, 8, ["class", "accept"])) : (ve(), Ve(
83459
+ }, 8, ["class", "accept", "before-upload"])) : (ve(), Ve(
83455
83460
  "div",
83456
83461
  {
83457
83462
  key: 1,
@@ -167,7 +167,7 @@ Required: `+Z.join(", "));return Ls[Kt].apply(null,fo)},log:Ls=>{console.log(Ls,
167
167
  <img src=${a.url} style="width: ${this.trueWidth}px; height: ${this.trueHeight}px; transform:
168
168
  scale(${s})translate3d(${c}px, ${f}px, ${p}px)rotateZ(${this.rotate*90}deg)">
169
169
  </div>
170
- </div>`,this.$emit("real-time",a)},reload(){let e=new Image;e.onload=()=>{this.w=parseFloat(window.getComputedStyle(this.$refs.cropper).width),this.h=parseFloat(window.getComputedStyle(this.$refs.cropper).height),this.trueWidth=e.width,this.trueHeight=e.height,this.original?this.scale=1:this.scale=this.checkedMode(),this.$nextTick(()=>{this.x=-(this.trueWidth-this.trueWidth*this.scale)/2+(this.w-this.trueWidth*this.scale)/2,this.y=-(this.trueHeight-this.trueHeight*this.scale)/2+(this.h-this.trueHeight*this.scale)/2,this.loading=!1,this.autoCrop&&this.goAutoCrop(),this.$emit("img-load","success"),setTimeout(()=>{this.showPreview()},20)})},e.onerror=()=>{this.$emit("img-load","error")},e.src=this.imgs},checkedMode(){let e=1,n=this.trueWidth,s=this.trueHeight;const a=this.mode.split(" ");switch(a[0]){case"contain":this.trueWidth>this.w&&(e=this.w/this.trueWidth),this.trueHeight*e>this.h&&(e=this.h/this.trueHeight);break;case"cover":n=this.w,e=n/this.trueWidth,s=s*e,s<this.h&&(s=this.h,e=s/this.trueHeight);break;default:try{let c=a[0];if(c.search("px")!==-1){c=c.replace("px",""),n=parseFloat(c);const f=n/this.trueWidth;let p=1,g=a[1];g.search("px")!==-1&&(g=g.replace("px",""),s=parseFloat(g),p=s/this.trueHeight),e=Math.min(f,p)}if(c.search("%")!==-1&&(c=c.replace("%",""),n=parseFloat(c)/100*this.w,e=n/this.trueWidth),a.length===2&&c==="auto"){let f=a[1];f.search("px")!==-1&&(f=f.replace("px",""),s=parseFloat(f),e=s/this.trueHeight),f.search("%")!==-1&&(f=f.replace("%",""),s=parseFloat(f)/100*this.h,e=s/this.trueHeight)}}catch(c){e=1}}return e},goAutoCrop(e,n){if(this.imgs===""||this.imgs===null)return;this.clearCrop(),this.cropping=!0;let s=this.w,a=this.h;if(this.centerBox){const p=Math.abs(this.rotate)%2>0;let g=(p?this.trueHeight:this.trueWidth)*this.scale,v=(p?this.trueWidth:this.trueHeight)*this.scale;s=g<s?g:s,a=v<a?v:a}var c=e||parseFloat(this.autoCropWidth),f=n||parseFloat(this.autoCropHeight);(c===0||f===0)&&(c=s*.8,f=a*.8),c=c>s?s:c,f=f>a?a:f,this.fixed&&(f=c/this.fixedNumber[0]*this.fixedNumber[1]),f>this.h&&(f=this.h,c=f/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(c,f)},changeCrop(e,n){if(this.centerBox){let s=this.getImgAxis();e>s.x2-s.x1&&(e=s.x2-s.x1,n=e/this.fixedNumber[0]*this.fixedNumber[1]),n>s.y2-s.y1&&(n=s.y2-s.y1,e=n/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=e,this.cropH=n,this.checkCropLimitSize(),this.$nextTick(()=>{this.cropOffsertX=(this.w-this.cropW)/2,this.cropOffsertY=(this.h-this.cropH)/2,this.centerBox&&this.moveCrop(null,!0)})},refresh(){this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.clearCrop(),this.$nextTick(()=>{this.checkedImg()})},rotateLeft(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight(){this.rotate=this.rotate>=3?0:this.rotate+1},rotateClear(){this.rotate=0},checkoutImgAxis(e,n,s){e=e||this.x,n=n||this.y,s=s||this.scale;let a=!0;if(this.centerBox){let c=this.getImgAxis(e,n,s),f=this.getCropAxis();c.x1>=f.x1&&(a=!1),c.x2<=f.x2&&(a=!1),c.y1>=f.y1&&(a=!1),c.y2<=f.y2&&(a=!1)}return a}},mounted(){this.support="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let e=this;var n=navigator.userAgent;this.isIOS=!!n.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(s,a,c){for(var f=atob(this.toDataURL(a,c).split(",")[1]),p=f.length,g=new Uint8Array(p),v=0;v<p;v++)g[v]=f.charCodeAt(v);s(new Blob([g],{type:e.type||"image/png"}))}}),this.showPreview(),this.checkedImg()},unmounted(){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.cancelScale()}}),n9e={key:0,class:"cropper-box"},o9e=["src"],s9e={class:"cropper-view-box"},r9e=["src"],i9e={key:1};function a9e(e,n,s,a,c,f){return l.openBlock(),l.createElementBlock("div",{class:"vue-cropper",ref:"cropper",onMouseover:n[28]||(n[28]=(...p)=>e.scaleImg&&e.scaleImg(...p)),onMouseout:n[29]||(n[29]=(...p)=>e.cancelScale&&e.cancelScale(...p))},[e.imgs?(l.openBlock(),l.createElementBlock("div",n9e,[l.withDirectives(l.createElementVNode("div",{class:"cropper-box-canvas",style:l.normalizeStyle({width:e.trueWidth+"px",height:e.trueHeight+"px",transform:"scale("+e.scale+","+e.scale+") translate3d("+e.x/e.scale+"px,"+e.y/e.scale+"px,0)rotateZ("+e.rotate*90+"deg)"})},[l.createElementVNode("img",{src:e.imgs,alt:"cropper-img",ref:"cropperImg"},null,8,o9e)],4),[[l.vShow,!e.loading]])])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["cropper-drag-box",{"cropper-move":e.move&&!e.crop,"cropper-crop":e.crop,"cropper-modal":e.cropping}]),onMousedown:n[0]||(n[0]=(...p)=>e.startMove&&e.startMove(...p)),onTouchstart:n[1]||(n[1]=(...p)=>e.startMove&&e.startMove(...p))},null,34),l.withDirectives(l.createElementVNode("div",{class:"cropper-crop-box",style:l.normalizeStyle({width:e.cropW+"px",height:e.cropH+"px",transform:"translate3d("+e.cropOffsertX+"px,"+e.cropOffsertY+"px,0)"})},[l.createElementVNode("span",s9e,[l.createElementVNode("img",{style:l.normalizeStyle({width:e.trueWidth+"px",height:e.trueHeight+"px",transform:"scale("+e.scale+","+e.scale+") translate3d("+(e.x-e.cropOffsertX)/e.scale+"px,"+(e.y-e.cropOffsertY)/e.scale+"px,0)rotateZ("+e.rotate*90+"deg)"}),src:e.imgs,alt:"cropper-img"},null,12,r9e)]),l.createElementVNode("span",{class:"cropper-face cropper-move",onMousedown:n[2]||(n[2]=(...p)=>e.cropMove&&e.cropMove(...p)),onTouchstart:n[3]||(n[3]=(...p)=>e.cropMove&&e.cropMove(...p))},null,32),e.info?(l.openBlock(),l.createElementBlock("span",{key:0,class:"crop-info",style:l.normalizeStyle({top:e.cropInfo.top})},l.toDisplayString(e.cropInfo.width)+" × "+l.toDisplayString(e.cropInfo.height),5)):l.createCommentVNode("",!0),e.fixedBox?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("span",i9e,[l.createElementVNode("span",{class:"crop-line line-w",onMousedown:n[4]||(n[4]=p=>e.changeCropSize(p,!1,!0,0,1)),onTouchstart:n[5]||(n[5]=p=>e.changeCropSize(p,!1,!0,0,1))},null,32),l.createElementVNode("span",{class:"crop-line line-a",onMousedown:n[6]||(n[6]=p=>e.changeCropSize(p,!0,!1,1,0)),onTouchstart:n[7]||(n[7]=p=>e.changeCropSize(p,!0,!1,1,0))},null,32),l.createElementVNode("span",{class:"crop-line line-s",onMousedown:n[8]||(n[8]=p=>e.changeCropSize(p,!1,!0,0,2)),onTouchstart:n[9]||(n[9]=p=>e.changeCropSize(p,!1,!0,0,2))},null,32),l.createElementVNode("span",{class:"crop-line line-d",onMousedown:n[10]||(n[10]=p=>e.changeCropSize(p,!0,!1,2,0)),onTouchstart:n[11]||(n[11]=p=>e.changeCropSize(p,!0,!1,2,0))},null,32),l.createElementVNode("span",{class:"crop-point point1",onMousedown:n[12]||(n[12]=p=>e.changeCropSize(p,!0,!0,1,1)),onTouchstart:n[13]||(n[13]=p=>e.changeCropSize(p,!0,!0,1,1))},null,32),l.createElementVNode("span",{class:"crop-point point2",onMousedown:n[14]||(n[14]=p=>e.changeCropSize(p,!1,!0,0,1)),onTouchstart:n[15]||(n[15]=p=>e.changeCropSize(p,!1,!0,0,1))},null,32),l.createElementVNode("span",{class:"crop-point point3",onMousedown:n[16]||(n[16]=p=>e.changeCropSize(p,!0,!0,2,1)),onTouchstart:n[17]||(n[17]=p=>e.changeCropSize(p,!0,!0,2,1))},null,32),l.createElementVNode("span",{class:"crop-point point4",onMousedown:n[18]||(n[18]=p=>e.changeCropSize(p,!0,!1,1,0)),onTouchstart:n[19]||(n[19]=p=>e.changeCropSize(p,!0,!1,1,0))},null,32),l.createElementVNode("span",{class:"crop-point point5",onMousedown:n[20]||(n[20]=p=>e.changeCropSize(p,!0,!1,2,0)),onTouchstart:n[21]||(n[21]=p=>e.changeCropSize(p,!0,!1,2,0))},null,32),l.createElementVNode("span",{class:"crop-point point6",onMousedown:n[22]||(n[22]=p=>e.changeCropSize(p,!0,!0,1,2)),onTouchstart:n[23]||(n[23]=p=>e.changeCropSize(p,!0,!0,1,2))},null,32),l.createElementVNode("span",{class:"crop-point point7",onMousedown:n[24]||(n[24]=p=>e.changeCropSize(p,!1,!0,0,2)),onTouchstart:n[25]||(n[25]=p=>e.changeCropSize(p,!1,!0,0,2))},null,32),l.createElementVNode("span",{class:"crop-point point8",onMousedown:n[26]||(n[26]=p=>e.changeCropSize(p,!0,!0,2,2)),onTouchstart:n[27]||(n[27]=p=>e.changeCropSize(p,!0,!0,2,2))},null,32)]))],4),[[l.vShow,e.cropping]])],544)}const l9e=e9e(t9e,[["render",a9e],["__scopeId","data-v-69939069"]]),d0=qg("components.Avatar"),c9e=d0("imageCropper"),u9e=d0("reset"),d9e=d0("rotate"),f9e=d0("preview"),p9e=d0("cancel"),m9e=d0("complete"),h9e=d0("origin"),g9e=d0("placeholder"),b9e=d0("empty"),y9e=l.createElementVNode("div",null,[l.createElementVNode("i",{class:"zy-font"},"")],-1),v9e=["src"],w9e=l.createElementVNode("i",{class:"zy-font"},"",-1),C9e={key:1},S9e=["title"],x9e=["title"],k9e=["src"],E9e=l.defineComponent({name:"Avatar"}),Q5=l.defineComponent(We(te({},E9e),{props:{title:{type:String,default:g9e},nullTip:{type:String,default:b9e},modelValue:{type:String},size:{type:Number,default:100},shape:{type:String,default:"circle"},opt:{type:Boolean,default:!1},accept:{type:String,default:"image/*"},uploadPath:{type:String,required:!0},appendToken:{type:Boolean,default:!1},direct:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},srcField:{type:String,default:"requestPath"},trigger:{type:String,default:"hover"}},emits:["update:modelValue","scuccess","cancel","error"],setup(e,{expose:n,emit:s}){const a=e,c=l.ref(!1),f=l.ref(null),p=l.ref(null);l.ref(null);const g=l.ref(null),v=l.ref({}),C=l.ref({}),E=Ca("zy-avatar");l.computed(()=>!!a.opt);const O=()=>{M3({images:[a.modelValue],options:{initialViewIndex:0}})},_=l.computed(()=>({cursor:a.trigger=="click"?"pointer":"",width:a.size+"px",height:a.size+"px",borderRadius:a.shape=="circle"?"50%":"4px"})),D=()=>{p.value.rotateRight()},M=()=>{p.value.refresh()},R=ce=>{v.value=ce.img,C.value={zoom:120/ce.w,width:ce.w+"px",height:ce.h+"px",borderRadius:a.shape=="circle"?"50%":"4px"}};function I(ce){return new Promise((ve,Ce)=>{const ke=new FileReader;ke.onload=()=>{const ue=ke.result;ve(ue)},ke.onerror=Ce,ke.readAsDataURL(ce)})}const V=(ce,ve)=>{const Ce=ce.split(","),ke=Ce[0].match(/:(.*?);/)[1],ue=atob(Ce[1]);let $e=ue.length;const tt=new Uint8Array($e);for(;$e--;)tt[$e]=ue.charCodeAt($e);return new File([tt],ve,{type:ke})},J=ce=>ur(this,null,function*(){if(a.disabled)return console.warn("Avatar是disabled"),!1;let ve=yield I(ce.file);if(f.value=ve,a.direct){le();return}return l.nextTick(()=>{c.value=!0}),!1}),H=()=>{s("cancel"),p.value&&p.value.clearCrop(),l.nextTick(()=>{f.value=null,c.value=!1})},U=ce=>ur(this,null,function*(){try{let ve=yield ld(a.uploadPath,{file:ce},{fd:!0,loading:!1,appendToken:a.appendToken});if(ve){let{data:Ce}=ve;s("update:modelValue",Ce[a.srcField]||Ce.requestPath),s("scuccess",Ce[a.srcField]||Ce.requestPath),!a.direct&&p.value.clearCrop(),l.nextTick(()=>{f.value=null,c.value=!1})}else return}catch(ve){s("error",ve)}}),le=()=>{U(V(f.value,"images.png"))},ne=()=>{p.value&&p.value.getCropData(ce=>ur(this,null,function*(){try{const ve=V(ce,"images.png");U(ve)}catch(ve){s("error",ve)}}))},K=()=>{!a.opt||a.trigger!="click"||g.value.$el.querySelector(".el-upload").click()};return n({Crop:()=>{if(!a.opt){console.warn("当前状态不可上传");return}g.value.$el&&g.value.$el.querySelector(".el-upload").click()}}),(ce,ve)=>{const Ce=XF,ke=Ep,ue=M2;return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",{class:l.normalizeClass(l.unref(E)())},[e.modelValue?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(E)("upload-imgcon")),style:l.normalizeStyle(_.value),onClick:K},[l.createElementVNode("img",{src:e.modelValue},null,8,v9e),e.trigger=="hover"?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(l.unref(E)("upload-imgcon-optmask"))},[l.createElementVNode("i",{class:"zy-font",onClick:ve[0]||(ve[0]=$e=>O())},""),e.opt?(l.openBlock(),l.createBlock(Ce,{key:0,ref_key:"uploadHoder",ref:g,class:l.normalizeClass(l.unref(E)("upload-imgcon-upload")),"http-request":J,"show-file-list":!1,"auto-upload":!0,accept:e.accept,name:"file",multiple:!1},{default:l.withCtx(()=>[w9e]),_:1},8,["class","accept"])):l.createCommentVNode("v-if",!0)],2)):e.trigger=="click"?(l.openBlock(),l.createElementBlock("div",C9e,[e.opt?(l.openBlock(),l.createBlock(Ce,{key:0,ref_key:"uploadHoder",ref:g,class:l.normalizeClass(l.unref(E)("upload-imgcon-upload-none")),"http-request":J,"show-file-list":!1,"auto-upload":!0,accept:e.accept,name:"file",multiple:!1},null,8,["class","accept"])):l.createCommentVNode("v-if",!0)])):l.createCommentVNode("v-if",!0)],6)):(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(l.unref(E)("upload-btn")),style:l.normalizeStyle(_.value)},[e.opt?(l.openBlock(),l.createBlock(Ce,{key:0,ref_key:"uploadHoder",ref:g,"auto-upload":!0,class:l.normalizeClass(l.unref(E)("upload-btn-upload")),accept:e.accept,name:"file",multiple:!1,"http-request":J,"show-file-list":!1,style:{display:"inline-block","vertical-align":"top"}},{default:l.withCtx(()=>[y9e,l.createElementVNode("div",null,l.toDisplayString(e.title),1)]),_:1},8,["class","accept"])):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(E)("upload-imgcon")),style:l.normalizeStyle([{border:"none"},_.value])},l.toDisplayString(e.nullTip),7))],6))],2),l.createCommentVNode(" 选择器 "),l.createVNode(ue,{title:l.unref(c9e),modelValue:c.value,"onUpdate:modelValue":ve[1]||(ve[1]=$e=>c.value=$e),width:800,"append-to-body":!0,"close-on-click-modal":!1},{footer:l.withCtx(()=>[l.createVNode(ke,{onClick:H},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(p9e)),1)]),_:1}),l.createVNode(ke,{onClick:ne,type:"primary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(m9e)),1)]),_:1}),l.createVNode(ke,{onClick:le,type:"primary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(h9e)),1)]),_:1})]),default:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(l.unref(E)("croppercon"))},[l.createElementVNode("div",{class:l.normalizeClass(l.unref(E)("croppercon-cropper"))},[c.value?(l.openBlock(),l.createBlock(l.unref(l9e),{key:0,autoCrop:!0,fixed:!0,ref_key:"cropperRef",ref:p,img:f.value,autoCropWidth:300,autoCropHeight:300,centerBox:!0,outputType:"png",onRealTime:R,infoTrue:!0},null,8,["img"])):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{class:l.normalizeClass(l.unref(E)("trans-btns"))},[l.createElementVNode("i",{class:"zy-font",title:l.unref(u9e),onClick:M},"",8,S9e),l.createElementVNode("i",{class:"zy-font",style:{"font-size":"22px"},title:l.unref(d9e),onClick:D},"",8,x9e)],2)],2),l.createElementVNode("div",{class:l.normalizeClass(l.unref(E)("croppercon-preview"))},[l.createElementVNode("div",{class:l.normalizeClass(l.unref(E)("croppercon-preview-title"))},l.toDisplayString(l.unref(f9e)),3),l.createElementVNode("div",{class:l.normalizeClass(l.unref(E)("croppercon-pimage")),style:l.normalizeStyle(C.value)},[l.createElementVNode("img",{style:l.normalizeStyle(v.value),src:f.value},null,12,k9e)],6)],2)],2)]),_:1},8,["title","modelValue"])],64)}}}));Q5.install=e=>{e.component(Q5.name,Q5)};const Let="",Fet="",zet="",T9e={class:"custom-tree-node"},O9e={key:0,class:"zy-font"},N9e={key:1,class:"zy-font"},_9e=l.defineComponent({name:"DeptSelect"}),e6=l.defineComponent(We(te({},_9e),{props:{loadDataApi:{type:String,default:"",required:!0},appendToken:{type:Boolean,default:!0},method:{type:String,default:"get"},labelKey:{type:String,default:"n"},valueKey:{type:String,default:"id"},childrenKey:{type:String,default:"chd"},placeholder:{type:String,default:"请选择部门"},showCheckbox:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},modelValue:{type:Array,default(){return[]}},filterable:{type:Boolean,default:!1}},emits:["update:modelValue","check-change"],setup(e,{expose:n,emit:s}){const a=e,c=l.ref(null),f=Ca("zy-deptselect"),p=l.ref([]),g=l.ref([]),v=l.ref([]);function C(M){return M.map(R=>{let I=null;return R[a.childrenKey]&&R[a.childrenKey].length>0&&(I=C(R[a.childrenKey])),{label:R[a.labelKey],value:R[a.valueKey],t:R.t,children:I}})}const E=(M,R,I)=>{s("check-change",M,R);let V=[...a.modelValue];if(R)a.multiple?(d3(V,{label:M.label,value:M.value},"value"),p.value.indexOf(M.value)<0&&p.value.push(M.value)):(V=[{label:M.label,value:M.value}],p.value=[M.value]);else{I2(V,{label:M.label,value:M.value},"value");let J=p.value.indexOf(M.value);J>-1&&p.value.splice(J,1)}s("update:modelValue",V)},O=M=>{let R=[...a.modelValue];I2(R,{label:"",value:M},"value");let I=p.value.indexOf(M);I>-1&&p.value.splice(I,1)},_=()=>{if(!a.loadDataApi){console.warn("DeptSelect未配置loadDataApi");return}ld(a.loadDataApi,{},{handleError:!1,appendToken:a.appendToken,method:a.method}).then(({data:M})=>{let R=C(M);R.length<4&&(v.value=R.map(I=>I.value)),g.value=R})};l.onMounted(()=>{_()});const D=l.toRef(a,"modelValue");return l.watch(D,(M,R)=>{p.value=M.map(I=>I.value)}),p.value=a.modelValue.map(M=>M.value),n({getCheckedNodes:(M=!1,R=!1)=>c.value?c.value.getCheckedNodes(M,R):(console.warn("treeSelectRef.value是空"),null),setCheckedNodes:M=>c.value?c.value.setCheckedNodes(M):(console.warn("treeSelectRef.value是空"),null),getCheckedKeys:M=>c.value?c.value.getCheckedKeys(M):(console.warn("treeSelectRef.value是空"),null),setCheckedKeys:(M,R)=>{if(!c.value)return console.warn("treeSelectRef.value是空"),null;l.nextTick(()=>c.value.setCheckedKeys(M,R))}}),(M,R)=>{const I=q4e;return l.openBlock(),l.createBlock(I,{class:l.normalizeClass(l.unref(f)()),data:g.value,"render-after-expand":!1,"show-checkbox":e.showCheckbox,label:"n",children:"chd","node-key":"value",placeholder:e.placeholder,"check-strictly":!0,"model-value":p.value,multiple:!0,onCheckChange:E,onNodeClick:E,onRemoveTag:O,filterable:e.filterable,"default-expanded-keys":v.value,ref_key:"treeSelectRef",ref:c},{default:l.withCtx(({node:V,data:J})=>[l.createElementVNode("span",T9e,[J.t==1?(l.openBlock(),l.createElementBlock("i",O9e,"")):J.t==2?(l.openBlock(),l.createElementBlock("i",N9e,"")):l.createCommentVNode("v-if",!0),l.createElementVNode("span",{class:l.normalizeClass(l.unref(f)("label"))},l.toDisplayString(V.label),3)])]),_:1},8,["class","data","show-checkbox","placeholder","model-value","filterable","default-expanded-keys"])}}}));e6.install=e=>{e.component(e6.name,e6)};const A9e=l.createElementVNode("div",null,[l.createElementVNode("i",{class:"zy-font"},"")],-1),M9e=["src"],B9e=l.createElementVNode("i",{class:"zy-font"},"",-1),D9e=l.defineComponent({name:"Photo"}),t6=l.defineComponent(We(te({},D9e),{props:{title:{type:String,default:"上传一寸照片"},nullTip:{type:String,default:"未上传"},modelValue:{type:String},width:{type:Number,default:125},height:{type:Number,default:175},opt:{type:Boolean,default:!1},accept:{type:String,default:"image/*"},uploadPath:{type:String,required:!0},appendToken:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},maxSize:{type:Number,default:100}},emits:["update:modelValue","scuccess","cancel","error"],setup(e,{expose:n,emit:s}){const a=e,c=l.ref(!1),f=l.ref(null);l.ref(null),l.ref(null);const p=l.ref(null);l.ref(!1);const g=Ca("zy-photo");l.computed(()=>!!a.opt);const v=()=>{M3({images:[a.modelValue],options:{initialViewIndex:0}})},C=l.computed(()=>({width:a.width+"px",height:a.height+"px",borderRadius:"2px"})),E=O=>ur(this,null,function*(){try{if(a.maxSize>0&&O.file.size>a.maxSize*1024){Dl({type:"warning",grouping:!0,message:`文件限制为:${a.maxSize}K`});return}let _=yield ld(a.uploadPath,{file:O.file},{fd:!0,loading:!1,appendToken:a.appendToken});if(_){let{data:D}=_;s("update:modelValue",D.requestPath),s("scuccess",D.requestPath),l.nextTick(()=>{f.value=null,c.value=!1})}else return}catch(_){s("error",_)}});return n({Crop:()=>{if(!a.opt){console.warn("当前状态不可上传");return}p.value.$el&&p.value.$el.querySelector(".el-upload").click()}}),(O,_)=>{const D=XF;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(g)())},[e.modelValue?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(g)("upload-imgcon")),style:l.normalizeStyle(C.value)},[l.createElementVNode("img",{src:e.modelValue},null,8,M9e),l.createElementVNode("div",{class:l.normalizeClass(l.unref(g)("upload-imgcon-optmask"))},[l.createElementVNode("i",{class:"zy-font",onClick:_[0]||(_[0]=M=>v())},""),e.opt?(l.openBlock(),l.createBlock(D,{key:0,ref_key:"uploadHoder",ref:p,class:l.normalizeClass(l.unref(g)("upload-imgcon-upload")),"http-request":E,"show-file-list":!1,"auto-upload":!0,accept:e.accept,name:"file",multiple:!1},{default:l.withCtx(()=>[B9e]),_:1},8,["class","accept"])):l.createCommentVNode("v-if",!0)],2)],6)):(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(l.unref(g)("upload-btn")),style:l.normalizeStyle(C.value)},[e.opt?(l.openBlock(),l.createBlock(D,{key:0,ref_key:"uploadHoder",ref:p,"auto-upload":!0,class:l.normalizeClass(l.unref(g)("upload-btn-upload")),accept:e.accept,name:"file",multiple:!1,"http-request":E,"show-file-list":!1,style:{display:"inline-block","vertical-align":"top"}},{default:l.withCtx(()=>[A9e,l.createElementVNode("div",{class:l.normalizeClass(l.unref(g)("title"))},l.toDisplayString(e.title),3)]),_:1},8,["class","accept"])):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(g)("upload-imgcon")),style:l.normalizeStyle([{border:"none"},C.value])},l.toDisplayString(e.nullTip),7))],6))],2)}}}));t6.install=e=>{e.component(t6.name,t6)};function cd(e){this.content=e}cd.prototype={constructor:cd,find:function(e){for(var n=0;n<this.content.length;n+=2)if(this.content[n]===e)return n;return-1},get:function(e){var n=this.find(e);return n==-1?void 0:this.content[n+1]},update:function(e,n,s){var a=s&&s!=e?this.remove(s):this,c=a.find(e),f=a.content.slice();return c==-1?f.push(s||e,n):(f[c+1]=n,s&&(f[c]=s)),new cd(f)},remove:function(e){var n=this.find(e);if(n==-1)return this;var s=this.content.slice();return s.splice(n,2),new cd(s)},addToStart:function(e,n){return new cd([e,n].concat(this.remove(e).content))},addToEnd:function(e,n){var s=this.remove(e).content.slice();return s.push(e,n),new cd(s)},addBefore:function(e,n,s){var a=this.remove(n),c=a.content.slice(),f=a.find(e);return c.splice(f==-1?c.length:f,0,n,s),new cd(c)},forEach:function(e){for(var n=0;n<this.content.length;n+=2)e(this.content[n],this.content[n+1])},prepend:function(e){return e=cd.from(e),e.size?new cd(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=cd.from(e),e.size?new cd(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var n=this;e=cd.from(e);for(var s=0;s<e.content.length;s+=2)n=n.remove(e.content[s]);return n},toObject:function(){var e={};return this.forEach(function(n,s){e[n]=s}),e},get size(){return this.content.length>>1}},cd.from=function(e){if(e instanceof cd)return e;var n=[];if(e)for(var s in e)n.push(s,e[s]);return new cd(n)};function zge(e,n,s){for(let a=0;;a++){if(a==e.childCount||a==n.childCount)return e.childCount==n.childCount?null:s;let c=e.child(a),f=n.child(a);if(c==f){s+=c.nodeSize;continue}if(!c.sameMarkup(f))return s;if(c.isText&&c.text!=f.text){for(let p=0;c.text[p]==f.text[p];p++)s++;return s}if(c.content.size||f.content.size){let p=zge(c.content,f.content,s+1);if(p!=null)return p}s+=c.nodeSize}}function Vge(e,n,s,a){for(let c=e.childCount,f=n.childCount;;){if(c==0||f==0)return c==f?null:{a:s,b:a};let p=e.child(--c),g=n.child(--f),v=p.nodeSize;if(p==g){s-=v,a-=v;continue}if(!p.sameMarkup(g))return{a:s,b:a};if(p.isText&&p.text!=g.text){let C=0,E=Math.min(p.text.length,g.text.length);for(;C<E&&p.text[p.text.length-C-1]==g.text[g.text.length-C-1];)C++,s--,a--;return{a:s,b:a}}if(p.content.size||g.content.size){let C=Vge(p.content,g.content,s-1,a-1);if(C)return C}s-=v,a-=v}}class kn{constructor(n,s){if(this.content=n,this.size=s||0,s==null)for(let a=0;a<n.length;a++)this.size+=n[a].nodeSize}nodesBetween(n,s,a,c=0,f){for(let p=0,g=0;g<s;p++){let v=this.content[p],C=g+v.nodeSize;if(C>n&&a(v,c+g,f||null,p)!==!1&&v.content.size){let E=g+1;v.nodesBetween(Math.max(0,n-E),Math.min(v.content.size,s-E),a,c+E)}g=C}}descendants(n){this.nodesBetween(0,this.size,n)}textBetween(n,s,a,c){let f="",p=!0;return this.nodesBetween(n,s,(g,v)=>{let C=g.isText?g.text.slice(Math.max(n,v)-v,s-v):g.isLeaf?c?typeof c=="function"?c(g):c:g.type.spec.leafText?g.type.spec.leafText(g):"":"";g.isBlock&&(g.isLeaf&&C||g.isTextblock)&&a&&(p?p=!1:f+=a),f+=C},0),f}append(n){if(!n.size)return this;if(!this.size)return n;let s=this.lastChild,a=n.firstChild,c=this.content.slice(),f=0;for(s.isText&&s.sameMarkup(a)&&(c[c.length-1]=s.withText(s.text+a.text),f=1);f<n.content.length;f++)c.push(n.content[f]);return new kn(c,this.size+n.size)}cut(n,s=this.size){if(n==0&&s==this.size)return this;let a=[],c=0;if(s>n)for(let f=0,p=0;p<s;f++){let g=this.content[f],v=p+g.nodeSize;v>n&&((p<n||v>s)&&(g.isText?g=g.cut(Math.max(0,n-p),Math.min(g.text.length,s-p)):g=g.cut(Math.max(0,n-p-1),Math.min(g.content.size,s-p-1))),a.push(g),c+=g.nodeSize),p=v}return new kn(a,c)}cutByIndex(n,s){return n==s?kn.empty:n==0&&s==this.content.length?this:new kn(this.content.slice(n,s))}replaceChild(n,s){let a=this.content[n];if(a==s)return this;let c=this.content.slice(),f=this.size+s.nodeSize-a.nodeSize;return c[n]=s,new kn(c,f)}addToStart(n){return new kn([n].concat(this.content),this.size+n.nodeSize)}addToEnd(n){return new kn(this.content.concat(n),this.size+n.nodeSize)}eq(n){if(this.content.length!=n.content.length)return!1;for(let s=0;s<this.content.length;s++)if(!this.content[s].eq(n.content[s]))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(n){let s=this.content[n];if(!s)throw new RangeError("Index "+n+" out of range for "+this);return s}maybeChild(n){return this.content[n]||null}forEach(n){for(let s=0,a=0;s<this.content.length;s++){let c=this.content[s];n(c,a,s),a+=c.nodeSize}}findDiffStart(n,s=0){return zge(this,n,s)}findDiffEnd(n,s=this.size,a=n.size){return Vge(this,n,s,a)}findIndex(n,s=-1){if(n==0)return n6(0,n);if(n==this.size)return n6(this.content.length,n);if(n>this.size||n<0)throw new RangeError(`Position ${n} outside of fragment (${this})`);for(let a=0,c=0;;a++){let f=this.child(a),p=c+f.nodeSize;if(p>=n)return p==n||s>0?n6(a+1,p):n6(a,c);c=p}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(n=>n.toJSON()):null}static fromJSON(n,s){if(!s)return kn.empty;if(!Array.isArray(s))throw new RangeError("Invalid input for Fragment.fromJSON");return new kn(s.map(n.nodeFromJSON))}static fromArray(n){if(!n.length)return kn.empty;let s,a=0;for(let c=0;c<n.length;c++){let f=n[c];a+=f.nodeSize,c&&f.isText&&n[c-1].sameMarkup(f)?(s||(s=n.slice(0,c)),s[s.length-1]=f.withText(s[s.length-1].text+f.text)):s&&s.push(f)}return new kn(s||n,a)}static from(n){if(!n)return kn.empty;if(n instanceof kn)return n;if(Array.isArray(n))return this.fromArray(n);if(n.attrs)return new kn([n],n.nodeSize);throw new RangeError("Can not convert "+n+" to a Fragment"+(n.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}kn.empty=new kn([],0);const vG={index:0,offset:0};function n6(e,n){return vG.index=e,vG.offset=n,vG}function o6(e,n){if(e===n)return!0;if(!(e&&typeof e=="object")||!(n&&typeof n=="object"))return!1;let s=Array.isArray(e);if(Array.isArray(n)!=s)return!1;if(s){if(e.length!=n.length)return!1;for(let a=0;a<e.length;a++)if(!o6(e[a],n[a]))return!1}else{for(let a in e)if(!(a in n)||!o6(e[a],n[a]))return!1;for(let a in n)if(!(a in e))return!1}return!0}let za=class Vle{constructor(n,s){this.type=n,this.attrs=s}addToSet(n){let s,a=!1;for(let c=0;c<n.length;c++){let f=n[c];if(this.eq(f))return n;if(this.type.excludes(f.type))s||(s=n.slice(0,c));else{if(f.type.excludes(this.type))return n;!a&&f.type.rank>this.type.rank&&(s||(s=n.slice(0,c)),s.push(this),a=!0),s&&s.push(f)}}return s||(s=n.slice()),a||s.push(this),s}removeFromSet(n){for(let s=0;s<n.length;s++)if(this.eq(n[s]))return n.slice(0,s).concat(n.slice(s+1));return n}isInSet(n){for(let s=0;s<n.length;s++)if(this.eq(n[s]))return!0;return!1}eq(n){return this==n||this.type==n.type&&o6(this.attrs,n.attrs)}toJSON(){let n={type:this.type.name};for(let s in this.attrs){n.attrs=this.attrs;break}return n}static fromJSON(n,s){if(!s)throw new RangeError("Invalid input for Mark.fromJSON");let a=n.marks[s.type];if(!a)throw new RangeError(`There is no mark type ${s.type} in this schema`);let c=a.create(s.attrs);return a.checkAttrs(c.attrs),c}static sameSet(n,s){if(n==s)return!0;if(n.length!=s.length)return!1;for(let a=0;a<n.length;a++)if(!n[a].eq(s[a]))return!1;return!0}static setFrom(n){if(!n||Array.isArray(n)&&n.length==0)return Vle.none;if(n instanceof Vle)return[n];let s=n.slice();return s.sort((a,c)=>a.type.rank-c.type.rank),s}};za.none=[];class s6 extends Error{}class lo{constructor(n,s,a){this.content=n,this.openStart=s,this.openEnd=a}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(n,s){let a=Uge(this.content,n+this.openStart,s);return a&&new lo(a,this.openStart,this.openEnd)}removeBetween(n,s){return new lo(Hge(this.content,n+this.openStart,s+this.openStart),this.openStart,this.openEnd)}eq(n){return this.content.eq(n.content)&&this.openStart==n.openStart&&this.openEnd==n.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let n={content:this.content.toJSON()};return this.openStart>0&&(n.openStart=this.openStart),this.openEnd>0&&(n.openEnd=this.openEnd),n}static fromJSON(n,s){if(!s)return lo.empty;let a=s.openStart||0,c=s.openEnd||0;if(typeof a!="number"||typeof c!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new lo(kn.fromJSON(n,s.content),a,c)}static maxOpen(n,s=!0){let a=0,c=0;for(let f=n.firstChild;f&&!f.isLeaf&&(s||!f.type.spec.isolating);f=f.firstChild)a++;for(let f=n.lastChild;f&&!f.isLeaf&&(s||!f.type.spec.isolating);f=f.lastChild)c++;return new lo(n,a,c)}}lo.empty=new lo(kn.empty,0,0);function Hge(e,n,s){let{index:a,offset:c}=e.findIndex(n),f=e.maybeChild(a),{index:p,offset:g}=e.findIndex(s);if(c==n||f.isText){if(g!=s&&!e.child(p).isText)throw new RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(s))}if(a!=p)throw new RangeError("Removing non-flat range");return e.replaceChild(a,f.copy(Hge(f.content,n-c-1,s-c-1)))}function Uge(e,n,s,a){let{index:c,offset:f}=e.findIndex(n),p=e.maybeChild(c);if(f==n||p.isText)return a&&!a.canReplace(c,c,s)?null:e.cut(0,n).append(s).append(e.cut(n));let g=Uge(p.content,n-f-1,s);return g&&e.replaceChild(c,p.copy(g))}function R9e(e,n,s){if(s.openStart>e.depth)throw new s6("Inserted content deeper than insertion position");if(e.depth-s.openStart!=n.depth-s.openEnd)throw new s6("Inconsistent open depths");return Wge(e,n,s,0)}function Wge(e,n,s,a){let c=e.index(a),f=e.node(a);if(c==n.index(a)&&a<e.depth-s.openStart){let p=Wge(e,n,s,a+1);return f.copy(f.content.replaceChild(c,p))}else if(s.content.size)if(!s.openStart&&!s.openEnd&&e.depth==a&&n.depth==a){let p=e.parent,g=p.content;return K2(p,g.cut(0,e.parentOffset).append(s.content).append(g.cut(n.parentOffset)))}else{let{start:p,end:g}=$9e(s,e);return K2(f,Kge(e,p,g,n,a))}else return K2(f,r6(e,n,a))}function jge(e,n){if(!n.type.compatibleContent(e.type))throw new s6("Cannot join "+n.type.name+" onto "+e.type.name)}function wG(e,n,s){let a=e.node(s);return jge(a,n.node(s)),a}function j2(e,n){let s=n.length-1;s>=0&&e.isText&&e.sameMarkup(n[s])?n[s]=e.withText(n[s].text+e.text):n.push(e)}function $3(e,n,s,a){let c=(n||e).node(s),f=0,p=n?n.index(s):c.childCount;e&&(f=e.index(s),e.depth>s?f++:e.textOffset&&(j2(e.nodeAfter,a),f++));for(let g=f;g<p;g++)j2(c.child(g),a);n&&n.depth==s&&n.textOffset&&j2(n.nodeBefore,a)}function K2(e,n){return e.type.checkContent(n),e.copy(n)}function Kge(e,n,s,a,c){let f=e.depth>c&&wG(e,n,c+1),p=a.depth>c&&wG(s,a,c+1),g=[];return $3(null,e,c,g),f&&p&&n.index(c)==s.index(c)?(jge(f,p),j2(K2(f,Kge(e,n,s,a,c+1)),g)):(f&&j2(K2(f,r6(e,n,c+1)),g),$3(n,s,c,g),p&&j2(K2(p,r6(s,a,c+1)),g)),$3(a,null,c,g),new kn(g)}function r6(e,n,s){let a=[];if($3(null,e,s,a),e.depth>s){let c=wG(e,n,s+1);j2(K2(c,r6(e,n,s+1)),a)}return $3(n,null,s,a),new kn(a)}function $9e(e,n){let s=n.depth-e.openStart,c=n.node(s).copy(e.content);for(let f=s-1;f>=0;f--)c=n.node(f).copy(kn.from(c));return{start:c.resolveNoCache(e.openStart+s),end:c.resolveNoCache(c.content.size-e.openEnd-s)}}class P3{constructor(n,s,a){this.pos=n,this.path=s,this.parentOffset=a,this.depth=s.length/3-1}resolveDepth(n){return n==null?this.depth:n<0?this.depth+n:n}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(n){return this.path[this.resolveDepth(n)*3]}index(n){return this.path[this.resolveDepth(n)*3+1]}indexAfter(n){return n=this.resolveDepth(n),this.index(n)+(n==this.depth&&!this.textOffset?0:1)}start(n){return n=this.resolveDepth(n),n==0?0:this.path[n*3-1]+1}end(n){return n=this.resolveDepth(n),this.start(n)+this.node(n).content.size}before(n){if(n=this.resolveDepth(n),!n)throw new RangeError("There is no position before the top-level node");return n==this.depth+1?this.pos:this.path[n*3-1]}after(n){if(n=this.resolveDepth(n),!n)throw new RangeError("There is no position after the top-level node");return n==this.depth+1?this.pos:this.path[n*3-1]+this.path[n*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let n=this.parent,s=this.index(this.depth);if(s==n.childCount)return null;let a=this.pos-this.path[this.path.length-1],c=n.child(s);return a?n.child(s).cut(a):c}get nodeBefore(){let n=this.index(this.depth),s=this.pos-this.path[this.path.length-1];return s?this.parent.child(n).cut(0,s):n==0?null:this.parent.child(n-1)}posAtIndex(n,s){s=this.resolveDepth(s);let a=this.path[s*3],c=s==0?0:this.path[s*3-1]+1;for(let f=0;f<n;f++)c+=a.child(f).nodeSize;return c}marks(){let n=this.parent,s=this.index();if(n.content.size==0)return za.none;if(this.textOffset)return n.child(s).marks;let a=n.maybeChild(s-1),c=n.maybeChild(s);if(!a){let g=a;a=c,c=g}let f=a.marks;for(var p=0;p<f.length;p++)f[p].type.spec.inclusive===!1&&(!c||!f[p].isInSet(c.marks))&&(f=f[p--].removeFromSet(f));return f}marksAcross(n){let s=this.parent.maybeChild(this.index());if(!s||!s.isInline)return null;let a=s.marks,c=n.parent.maybeChild(n.index());for(var f=0;f<a.length;f++)a[f].type.spec.inclusive===!1&&(!c||!a[f].isInSet(c.marks))&&(a=a[f--].removeFromSet(a));return a}sharedDepth(n){for(let s=this.depth;s>0;s--)if(this.start(s)<=n&&this.end(s)>=n)return s;return 0}blockRange(n=this,s){if(n.pos<this.pos)return n.blockRange(this);for(let a=this.depth-(this.parent.inlineContent||this.pos==n.pos?1:0);a>=0;a--)if(n.pos<=this.end(a)&&(!s||s(this.node(a))))return new i6(this,n,a);return null}sameParent(n){return this.pos-this.parentOffset==n.pos-n.parentOffset}max(n){return n.pos>this.pos?n:this}min(n){return n.pos<this.pos?n:this}toString(){let n="";for(let s=1;s<=this.depth;s++)n+=(n?"/":"")+this.node(s).type.name+"_"+this.index(s-1);return n+":"+this.parentOffset}static resolve(n,s){if(!(s>=0&&s<=n.content.size))throw new RangeError("Position "+s+" out of range");let a=[],c=0,f=s;for(let p=n;;){let{index:g,offset:v}=p.content.findIndex(f),C=f-v;if(a.push(p,g,c+v),!C||(p=p.child(g),p.isText))break;f=C-1,c+=v+1}return new P3(s,a,f)}static resolveCached(n,s){let a=qge.get(n);if(a)for(let f=0;f<a.elts.length;f++){let p=a.elts[f];if(p.pos==s)return p}else qge.set(n,a=new P9e);let c=a.elts[a.i]=P3.resolve(n,s);return a.i=(a.i+1)%I9e,c}}class P9e{constructor(){this.elts=[],this.i=0}}const I9e=12,qge=new WeakMap;class i6{constructor(n,s,a){this.$from=n,this.$to=s,this.depth=a}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 L9e=Object.create(null);let $w=class Hle{constructor(n,s,a,c=za.none){this.type=n,this.attrs=s,this.marks=c,this.content=a||kn.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(n){return this.content.child(n)}maybeChild(n){return this.content.maybeChild(n)}forEach(n){this.content.forEach(n)}nodesBetween(n,s,a,c=0){this.content.nodesBetween(n,s,a,c,this)}descendants(n){this.nodesBetween(0,this.content.size,n)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(n,s,a,c){return this.content.textBetween(n,s,a,c)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(n){return this==n||this.sameMarkup(n)&&this.content.eq(n.content)}sameMarkup(n){return this.hasMarkup(n.type,n.attrs,n.marks)}hasMarkup(n,s,a){return this.type==n&&o6(this.attrs,s||n.defaultAttrs||L9e)&&za.sameSet(this.marks,a||za.none)}copy(n=null){return n==this.content?this:new Hle(this.type,this.attrs,n,this.marks)}mark(n){return n==this.marks?this:new Hle(this.type,this.attrs,this.content,n)}cut(n,s=this.content.size){return n==0&&s==this.content.size?this:this.copy(this.content.cut(n,s))}slice(n,s=this.content.size,a=!1){if(n==s)return lo.empty;let c=this.resolve(n),f=this.resolve(s),p=a?0:c.sharedDepth(s),g=c.start(p),C=c.node(p).content.cut(c.pos-g,f.pos-g);return new lo(C,c.depth-p,f.depth-p)}replace(n,s,a){return R9e(this.resolve(n),this.resolve(s),a)}nodeAt(n){for(let s=this;;){let{index:a,offset:c}=s.content.findIndex(n);if(s=s.maybeChild(a),!s)return null;if(c==n||s.isText)return s;n-=c+1}}childAfter(n){let{index:s,offset:a}=this.content.findIndex(n);return{node:this.content.maybeChild(s),index:s,offset:a}}childBefore(n){if(n==0)return{node:null,index:0,offset:0};let{index:s,offset:a}=this.content.findIndex(n);if(a<n)return{node:this.content.child(s),index:s,offset:a};let c=this.content.child(s-1);return{node:c,index:s-1,offset:a-c.nodeSize}}resolve(n){return P3.resolveCached(this,n)}resolveNoCache(n){return P3.resolve(this,n)}rangeHasMark(n,s,a){let c=!1;return s>n&&this.nodesBetween(n,s,f=>(a.isInSet(f.marks)&&(c=!0),!c)),c}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 n=this.type.name;return this.content.size&&(n+="("+this.content.toStringInner()+")"),Zge(this.marks,n)}contentMatchAt(n){let s=this.type.contentMatch.matchFragment(this.content,0,n);if(!s)throw new Error("Called contentMatchAt on a node with invalid content");return s}canReplace(n,s,a=kn.empty,c=0,f=a.childCount){let p=this.contentMatchAt(n).matchFragment(a,c,f),g=p&&p.matchFragment(this.content,s);if(!g||!g.validEnd)return!1;for(let v=c;v<f;v++)if(!this.type.allowsMarks(a.child(v).marks))return!1;return!0}canReplaceWith(n,s,a,c){if(c&&!this.type.allowsMarks(c))return!1;let f=this.contentMatchAt(n).matchType(a),p=f&&f.matchFragment(this.content,s);return p?p.validEnd:!1}canAppend(n){return n.content.size?this.canReplace(this.childCount,this.childCount,n.content):this.type.compatibleContent(n.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let n=za.none;for(let s=0;s<this.marks.length;s++){let a=this.marks[s];a.type.checkAttrs(a.attrs),n=a.addToSet(n)}if(!za.sameSet(n,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(s=>s.type.name)}`);this.content.forEach(s=>s.check())}toJSON(){let n={type:this.type.name};for(let s in this.attrs){n.attrs=this.attrs;break}return this.content.size&&(n.content=this.content.toJSON()),this.marks.length&&(n.marks=this.marks.map(s=>s.toJSON())),n}static fromJSON(n,s){if(!s)throw new RangeError("Invalid input for Node.fromJSON");let a;if(s.marks){if(!Array.isArray(s.marks))throw new RangeError("Invalid mark data for Node.fromJSON");a=s.marks.map(n.markFromJSON)}if(s.type=="text"){if(typeof s.text!="string")throw new RangeError("Invalid text node in JSON");return n.text(s.text,a)}let c=kn.fromJSON(n,s.content),f=n.nodeType(s.type).create(s.attrs,c,a);return f.type.checkAttrs(f.attrs),f}};$w.prototype.text=void 0;class a6 extends $w{constructor(n,s,a,c){if(super(n,s,null,c),!a)throw new RangeError("Empty text nodes are not allowed");this.text=a}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Zge(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(n,s){return this.text.slice(n,s)}get nodeSize(){return this.text.length}mark(n){return n==this.marks?this:new a6(this.type,this.attrs,this.text,n)}withText(n){return n==this.text?this:new a6(this.type,this.attrs,n,this.marks)}cut(n=0,s=this.text.length){return n==0&&s==this.text.length?this:this.withText(this.text.slice(n,s))}eq(n){return this.sameMarkup(n)&&this.text==n.text}toJSON(){let n=super.toJSON();return n.text=this.text,n}}function Zge(e,n){for(let s=e.length-1;s>=0;s--)n=e[s].type.name+"("+n+")";return n}class q2{constructor(n){this.validEnd=n,this.next=[],this.wrapCache=[]}static parse(n,s){let a=new F9e(n,s);if(a.next==null)return q2.empty;let c=Gge(a);a.next&&a.err("Unexpected trailing text");let f=K9e(j9e(c));return q9e(f,a),f}matchType(n){for(let s=0;s<this.next.length;s++)if(this.next[s].type==n)return this.next[s].next;return null}matchFragment(n,s=0,a=n.childCount){let c=this;for(let f=s;c&&f<a;f++)c=c.matchType(n.child(f).type);return c}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let n=0;n<this.next.length;n++){let{type:s}=this.next[n];if(!(s.isText||s.hasRequiredAttrs()))return s}return null}compatible(n){for(let s=0;s<this.next.length;s++)for(let a=0;a<n.next.length;a++)if(this.next[s].type==n.next[a].type)return!0;return!1}fillBefore(n,s=!1,a=0){let c=[this];function f(p,g){let v=p.matchFragment(n,a);if(v&&(!s||v.validEnd))return kn.from(g.map(C=>C.createAndFill()));for(let C=0;C<p.next.length;C++){let{type:E,next:O}=p.next[C];if(!(E.isText||E.hasRequiredAttrs())&&c.indexOf(O)==-1){c.push(O);let _=f(O,g.concat(E));if(_)return _}}return null}return f(this,[])}findWrapping(n){for(let a=0;a<this.wrapCache.length;a+=2)if(this.wrapCache[a]==n)return this.wrapCache[a+1];let s=this.computeWrapping(n);return this.wrapCache.push(n,s),s}computeWrapping(n){let s=Object.create(null),a=[{match:this,type:null,via:null}];for(;a.length;){let c=a.shift(),f=c.match;if(f.matchType(n)){let p=[];for(let g=c;g.type;g=g.via)p.push(g.type);return p.reverse()}for(let p=0;p<f.next.length;p++){let{type:g,next:v}=f.next[p];!g.isLeaf&&!g.hasRequiredAttrs()&&!(g.name in s)&&(!c.type||v.validEnd)&&(a.push({match:g.contentMatch,type:g,via:c}),s[g.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(n){if(n>=this.next.length)throw new RangeError(`There's no ${n}th edge in this content match`);return this.next[n]}toString(){let n=[];function s(a){n.push(a);for(let c=0;c<a.next.length;c++)n.indexOf(a.next[c].next)==-1&&s(a.next[c].next)}return s(this),n.map((a,c)=>{let f=c+(a.validEnd?"*":" ")+" ";for(let p=0;p<a.next.length;p++)f+=(p?", ":"")+a.next[p].type.name+"->"+n.indexOf(a.next[p].next);return f}).join(`
170
+ </div>`,this.$emit("real-time",a)},reload(){let e=new Image;e.onload=()=>{this.w=parseFloat(window.getComputedStyle(this.$refs.cropper).width),this.h=parseFloat(window.getComputedStyle(this.$refs.cropper).height),this.trueWidth=e.width,this.trueHeight=e.height,this.original?this.scale=1:this.scale=this.checkedMode(),this.$nextTick(()=>{this.x=-(this.trueWidth-this.trueWidth*this.scale)/2+(this.w-this.trueWidth*this.scale)/2,this.y=-(this.trueHeight-this.trueHeight*this.scale)/2+(this.h-this.trueHeight*this.scale)/2,this.loading=!1,this.autoCrop&&this.goAutoCrop(),this.$emit("img-load","success"),setTimeout(()=>{this.showPreview()},20)})},e.onerror=()=>{this.$emit("img-load","error")},e.src=this.imgs},checkedMode(){let e=1,n=this.trueWidth,s=this.trueHeight;const a=this.mode.split(" ");switch(a[0]){case"contain":this.trueWidth>this.w&&(e=this.w/this.trueWidth),this.trueHeight*e>this.h&&(e=this.h/this.trueHeight);break;case"cover":n=this.w,e=n/this.trueWidth,s=s*e,s<this.h&&(s=this.h,e=s/this.trueHeight);break;default:try{let c=a[0];if(c.search("px")!==-1){c=c.replace("px",""),n=parseFloat(c);const f=n/this.trueWidth;let p=1,g=a[1];g.search("px")!==-1&&(g=g.replace("px",""),s=parseFloat(g),p=s/this.trueHeight),e=Math.min(f,p)}if(c.search("%")!==-1&&(c=c.replace("%",""),n=parseFloat(c)/100*this.w,e=n/this.trueWidth),a.length===2&&c==="auto"){let f=a[1];f.search("px")!==-1&&(f=f.replace("px",""),s=parseFloat(f),e=s/this.trueHeight),f.search("%")!==-1&&(f=f.replace("%",""),s=parseFloat(f)/100*this.h,e=s/this.trueHeight)}}catch(c){e=1}}return e},goAutoCrop(e,n){if(this.imgs===""||this.imgs===null)return;this.clearCrop(),this.cropping=!0;let s=this.w,a=this.h;if(this.centerBox){const p=Math.abs(this.rotate)%2>0;let g=(p?this.trueHeight:this.trueWidth)*this.scale,v=(p?this.trueWidth:this.trueHeight)*this.scale;s=g<s?g:s,a=v<a?v:a}var c=e||parseFloat(this.autoCropWidth),f=n||parseFloat(this.autoCropHeight);(c===0||f===0)&&(c=s*.8,f=a*.8),c=c>s?s:c,f=f>a?a:f,this.fixed&&(f=c/this.fixedNumber[0]*this.fixedNumber[1]),f>this.h&&(f=this.h,c=f/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(c,f)},changeCrop(e,n){if(this.centerBox){let s=this.getImgAxis();e>s.x2-s.x1&&(e=s.x2-s.x1,n=e/this.fixedNumber[0]*this.fixedNumber[1]),n>s.y2-s.y1&&(n=s.y2-s.y1,e=n/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=e,this.cropH=n,this.checkCropLimitSize(),this.$nextTick(()=>{this.cropOffsertX=(this.w-this.cropW)/2,this.cropOffsertY=(this.h-this.cropH)/2,this.centerBox&&this.moveCrop(null,!0)})},refresh(){this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.clearCrop(),this.$nextTick(()=>{this.checkedImg()})},rotateLeft(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight(){this.rotate=this.rotate>=3?0:this.rotate+1},rotateClear(){this.rotate=0},checkoutImgAxis(e,n,s){e=e||this.x,n=n||this.y,s=s||this.scale;let a=!0;if(this.centerBox){let c=this.getImgAxis(e,n,s),f=this.getCropAxis();c.x1>=f.x1&&(a=!1),c.x2<=f.x2&&(a=!1),c.y1>=f.y1&&(a=!1),c.y2<=f.y2&&(a=!1)}return a}},mounted(){this.support="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let e=this;var n=navigator.userAgent;this.isIOS=!!n.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(s,a,c){for(var f=atob(this.toDataURL(a,c).split(",")[1]),p=f.length,g=new Uint8Array(p),v=0;v<p;v++)g[v]=f.charCodeAt(v);s(new Blob([g],{type:e.type||"image/png"}))}}),this.showPreview(),this.checkedImg()},unmounted(){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.cancelScale()}}),n9e={key:0,class:"cropper-box"},o9e=["src"],s9e={class:"cropper-view-box"},r9e=["src"],i9e={key:1};function a9e(e,n,s,a,c,f){return l.openBlock(),l.createElementBlock("div",{class:"vue-cropper",ref:"cropper",onMouseover:n[28]||(n[28]=(...p)=>e.scaleImg&&e.scaleImg(...p)),onMouseout:n[29]||(n[29]=(...p)=>e.cancelScale&&e.cancelScale(...p))},[e.imgs?(l.openBlock(),l.createElementBlock("div",n9e,[l.withDirectives(l.createElementVNode("div",{class:"cropper-box-canvas",style:l.normalizeStyle({width:e.trueWidth+"px",height:e.trueHeight+"px",transform:"scale("+e.scale+","+e.scale+") translate3d("+e.x/e.scale+"px,"+e.y/e.scale+"px,0)rotateZ("+e.rotate*90+"deg)"})},[l.createElementVNode("img",{src:e.imgs,alt:"cropper-img",ref:"cropperImg"},null,8,o9e)],4),[[l.vShow,!e.loading]])])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["cropper-drag-box",{"cropper-move":e.move&&!e.crop,"cropper-crop":e.crop,"cropper-modal":e.cropping}]),onMousedown:n[0]||(n[0]=(...p)=>e.startMove&&e.startMove(...p)),onTouchstart:n[1]||(n[1]=(...p)=>e.startMove&&e.startMove(...p))},null,34),l.withDirectives(l.createElementVNode("div",{class:"cropper-crop-box",style:l.normalizeStyle({width:e.cropW+"px",height:e.cropH+"px",transform:"translate3d("+e.cropOffsertX+"px,"+e.cropOffsertY+"px,0)"})},[l.createElementVNode("span",s9e,[l.createElementVNode("img",{style:l.normalizeStyle({width:e.trueWidth+"px",height:e.trueHeight+"px",transform:"scale("+e.scale+","+e.scale+") translate3d("+(e.x-e.cropOffsertX)/e.scale+"px,"+(e.y-e.cropOffsertY)/e.scale+"px,0)rotateZ("+e.rotate*90+"deg)"}),src:e.imgs,alt:"cropper-img"},null,12,r9e)]),l.createElementVNode("span",{class:"cropper-face cropper-move",onMousedown:n[2]||(n[2]=(...p)=>e.cropMove&&e.cropMove(...p)),onTouchstart:n[3]||(n[3]=(...p)=>e.cropMove&&e.cropMove(...p))},null,32),e.info?(l.openBlock(),l.createElementBlock("span",{key:0,class:"crop-info",style:l.normalizeStyle({top:e.cropInfo.top})},l.toDisplayString(e.cropInfo.width)+" × "+l.toDisplayString(e.cropInfo.height),5)):l.createCommentVNode("",!0),e.fixedBox?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("span",i9e,[l.createElementVNode("span",{class:"crop-line line-w",onMousedown:n[4]||(n[4]=p=>e.changeCropSize(p,!1,!0,0,1)),onTouchstart:n[5]||(n[5]=p=>e.changeCropSize(p,!1,!0,0,1))},null,32),l.createElementVNode("span",{class:"crop-line line-a",onMousedown:n[6]||(n[6]=p=>e.changeCropSize(p,!0,!1,1,0)),onTouchstart:n[7]||(n[7]=p=>e.changeCropSize(p,!0,!1,1,0))},null,32),l.createElementVNode("span",{class:"crop-line line-s",onMousedown:n[8]||(n[8]=p=>e.changeCropSize(p,!1,!0,0,2)),onTouchstart:n[9]||(n[9]=p=>e.changeCropSize(p,!1,!0,0,2))},null,32),l.createElementVNode("span",{class:"crop-line line-d",onMousedown:n[10]||(n[10]=p=>e.changeCropSize(p,!0,!1,2,0)),onTouchstart:n[11]||(n[11]=p=>e.changeCropSize(p,!0,!1,2,0))},null,32),l.createElementVNode("span",{class:"crop-point point1",onMousedown:n[12]||(n[12]=p=>e.changeCropSize(p,!0,!0,1,1)),onTouchstart:n[13]||(n[13]=p=>e.changeCropSize(p,!0,!0,1,1))},null,32),l.createElementVNode("span",{class:"crop-point point2",onMousedown:n[14]||(n[14]=p=>e.changeCropSize(p,!1,!0,0,1)),onTouchstart:n[15]||(n[15]=p=>e.changeCropSize(p,!1,!0,0,1))},null,32),l.createElementVNode("span",{class:"crop-point point3",onMousedown:n[16]||(n[16]=p=>e.changeCropSize(p,!0,!0,2,1)),onTouchstart:n[17]||(n[17]=p=>e.changeCropSize(p,!0,!0,2,1))},null,32),l.createElementVNode("span",{class:"crop-point point4",onMousedown:n[18]||(n[18]=p=>e.changeCropSize(p,!0,!1,1,0)),onTouchstart:n[19]||(n[19]=p=>e.changeCropSize(p,!0,!1,1,0))},null,32),l.createElementVNode("span",{class:"crop-point point5",onMousedown:n[20]||(n[20]=p=>e.changeCropSize(p,!0,!1,2,0)),onTouchstart:n[21]||(n[21]=p=>e.changeCropSize(p,!0,!1,2,0))},null,32),l.createElementVNode("span",{class:"crop-point point6",onMousedown:n[22]||(n[22]=p=>e.changeCropSize(p,!0,!0,1,2)),onTouchstart:n[23]||(n[23]=p=>e.changeCropSize(p,!0,!0,1,2))},null,32),l.createElementVNode("span",{class:"crop-point point7",onMousedown:n[24]||(n[24]=p=>e.changeCropSize(p,!1,!0,0,2)),onTouchstart:n[25]||(n[25]=p=>e.changeCropSize(p,!1,!0,0,2))},null,32),l.createElementVNode("span",{class:"crop-point point8",onMousedown:n[26]||(n[26]=p=>e.changeCropSize(p,!0,!0,2,2)),onTouchstart:n[27]||(n[27]=p=>e.changeCropSize(p,!0,!0,2,2))},null,32)]))],4),[[l.vShow,e.cropping]])],544)}const l9e=e9e(t9e,[["render",a9e],["__scopeId","data-v-69939069"]]),d0=qg("components.Avatar"),c9e=d0("imageCropper"),u9e=d0("reset"),d9e=d0("rotate"),f9e=d0("preview"),p9e=d0("cancel"),m9e=d0("complete"),h9e=d0("origin"),g9e=d0("placeholder"),b9e=d0("empty"),y9e=l.createElementVNode("div",null,[l.createElementVNode("i",{class:"zy-font"},"")],-1),v9e=["src"],w9e=l.createElementVNode("i",{class:"zy-font"},"",-1),C9e={key:1},S9e=["title"],x9e=["title"],k9e=["src"],E9e=l.defineComponent({name:"Avatar"}),Q5=l.defineComponent(We(te({},E9e),{props:{title:{type:String,default:g9e},nullTip:{type:String,default:b9e},modelValue:{type:String},size:{type:Number,default:100},shape:{type:String,default:"circle"},opt:{type:Boolean,default:!1},accept:{type:String,default:"image/*"},uploadPath:{type:String,required:!0},appendToken:{type:Boolean,default:!1},direct:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},srcField:{type:String,default:"requestPath"},trigger:{type:String,default:"hover"}},emits:["update:modelValue","scuccess","cancel","error"],setup(e,{expose:n,emit:s}){const a=e,c=l.ref(!1),f=l.ref(null),p=l.ref(null);l.ref(null);const g=l.ref(null),v=l.ref({}),C=l.ref({}),E=Ca("zy-avatar");l.computed(()=>!!a.opt);const O=()=>{M3({images:[a.modelValue],options:{initialViewIndex:0}})},_=l.computed(()=>({cursor:a.trigger=="click"?"pointer":"",width:a.size+"px",height:a.size+"px",borderRadius:a.shape=="circle"?"50%":"4px"})),D=()=>{p.value.rotateRight()},M=()=>{p.value.refresh()},R=ce=>{v.value=ce.img,C.value={zoom:120/ce.w,width:ce.w+"px",height:ce.h+"px",borderRadius:a.shape=="circle"?"50%":"4px"}};function I(ce){return new Promise((ve,Ce)=>{const ke=new FileReader;ke.onload=()=>{const ue=ke.result;ve(ue)},ke.onerror=Ce,ke.readAsDataURL(ce)})}const V=(ce,ve)=>{const Ce=ce.split(","),ke=Ce[0].match(/:(.*?);/)[1],ue=atob(Ce[1]);let $e=ue.length;const tt=new Uint8Array($e);for(;$e--;)tt[$e]=ue.charCodeAt($e);return new File([tt],ve,{type:ke})},J=ce=>ur(this,null,function*(){if(a.disabled)return console.warn("Avatar是disabled"),!1;let ve=yield I(ce.file);if(f.value=ve,a.direct){le();return}return l.nextTick(()=>{c.value=!0}),!1}),H=()=>{s("cancel"),p.value&&p.value.clearCrop(),l.nextTick(()=>{f.value=null,c.value=!1})},U=ce=>ur(this,null,function*(){try{let ve=yield ld(a.uploadPath,{file:ce},{fd:!0,loading:!1,appendToken:a.appendToken});if(ve){let{data:Ce}=ve;s("update:modelValue",Ce[a.srcField]||Ce.requestPath),s("scuccess",Ce[a.srcField]||Ce.requestPath),!a.direct&&p.value.clearCrop(),l.nextTick(()=>{f.value=null,c.value=!1})}else return}catch(ve){s("error",ve)}}),le=()=>{U(V(f.value,"images.png"))},ne=()=>{p.value&&p.value.getCropData(ce=>ur(this,null,function*(){try{const ve=V(ce,"images.png");U(ve)}catch(ve){s("error",ve)}}))},K=()=>{!a.opt||a.trigger!="click"||g.value.$el.querySelector(".el-upload").click()};return n({Crop:()=>{if(!a.opt){console.warn("当前状态不可上传");return}g.value.$el&&g.value.$el.querySelector(".el-upload").click()}}),(ce,ve)=>{const Ce=XF,ke=Ep,ue=M2;return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",{class:l.normalizeClass(l.unref(E)())},[e.modelValue?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(E)("upload-imgcon")),style:l.normalizeStyle(_.value),onClick:K},[l.createElementVNode("img",{src:e.modelValue},null,8,v9e),e.trigger=="hover"?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(l.unref(E)("upload-imgcon-optmask"))},[l.createElementVNode("i",{class:"zy-font",onClick:ve[0]||(ve[0]=$e=>O())},""),e.opt?(l.openBlock(),l.createBlock(Ce,{key:0,ref_key:"uploadHoder",ref:g,class:l.normalizeClass(l.unref(E)("upload-imgcon-upload")),"http-request":J,"show-file-list":!1,"auto-upload":!0,accept:e.accept,name:"file",multiple:!1},{default:l.withCtx(()=>[w9e]),_:1},8,["class","accept"])):l.createCommentVNode("v-if",!0)],2)):e.trigger=="click"?(l.openBlock(),l.createElementBlock("div",C9e,[e.opt?(l.openBlock(),l.createBlock(Ce,{key:0,ref_key:"uploadHoder",ref:g,class:l.normalizeClass(l.unref(E)("upload-imgcon-upload-none")),"http-request":J,"show-file-list":!1,"auto-upload":!0,accept:e.accept,name:"file",multiple:!1},null,8,["class","accept"])):l.createCommentVNode("v-if",!0)])):l.createCommentVNode("v-if",!0)],6)):(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(l.unref(E)("upload-btn")),style:l.normalizeStyle(_.value)},[e.opt?(l.openBlock(),l.createBlock(Ce,{key:0,ref_key:"uploadHoder",ref:g,"auto-upload":!0,class:l.normalizeClass(l.unref(E)("upload-btn-upload")),accept:e.accept,name:"file",multiple:!1,"http-request":J,"show-file-list":!1,style:{display:"inline-block","vertical-align":"top"}},{default:l.withCtx(()=>[y9e,l.createElementVNode("div",null,l.toDisplayString(e.title),1)]),_:1},8,["class","accept"])):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(E)("upload-imgcon")),style:l.normalizeStyle([{border:"none"},_.value])},l.toDisplayString(e.nullTip),7))],6))],2),l.createCommentVNode(" 选择器 "),l.createVNode(ue,{title:l.unref(c9e),modelValue:c.value,"onUpdate:modelValue":ve[1]||(ve[1]=$e=>c.value=$e),width:800,"append-to-body":!0,"close-on-click-modal":!1},{footer:l.withCtx(()=>[l.createVNode(ke,{onClick:H},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(p9e)),1)]),_:1}),l.createVNode(ke,{onClick:ne,type:"primary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(m9e)),1)]),_:1}),l.createVNode(ke,{onClick:le,type:"primary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(h9e)),1)]),_:1})]),default:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(l.unref(E)("croppercon"))},[l.createElementVNode("div",{class:l.normalizeClass(l.unref(E)("croppercon-cropper"))},[c.value?(l.openBlock(),l.createBlock(l.unref(l9e),{key:0,autoCrop:!0,fixed:!0,ref_key:"cropperRef",ref:p,img:f.value,autoCropWidth:300,autoCropHeight:300,centerBox:!0,outputType:"png",onRealTime:R,infoTrue:!0},null,8,["img"])):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{class:l.normalizeClass(l.unref(E)("trans-btns"))},[l.createElementVNode("i",{class:"zy-font",title:l.unref(u9e),onClick:M},"",8,S9e),l.createElementVNode("i",{class:"zy-font",style:{"font-size":"22px"},title:l.unref(d9e),onClick:D},"",8,x9e)],2)],2),l.createElementVNode("div",{class:l.normalizeClass(l.unref(E)("croppercon-preview"))},[l.createElementVNode("div",{class:l.normalizeClass(l.unref(E)("croppercon-preview-title"))},l.toDisplayString(l.unref(f9e)),3),l.createElementVNode("div",{class:l.normalizeClass(l.unref(E)("croppercon-pimage")),style:l.normalizeStyle(C.value)},[l.createElementVNode("img",{style:l.normalizeStyle(v.value),src:f.value},null,12,k9e)],6)],2)],2)]),_:1},8,["title","modelValue"])],64)}}}));Q5.install=e=>{e.component(Q5.name,Q5)};const Let="",Fet="",zet="",T9e={class:"custom-tree-node"},O9e={key:0,class:"zy-font"},N9e={key:1,class:"zy-font"},_9e=l.defineComponent({name:"DeptSelect"}),e6=l.defineComponent(We(te({},_9e),{props:{loadDataApi:{type:String,default:"",required:!0},appendToken:{type:Boolean,default:!0},method:{type:String,default:"get"},labelKey:{type:String,default:"n"},valueKey:{type:String,default:"id"},childrenKey:{type:String,default:"chd"},placeholder:{type:String,default:"请选择部门"},showCheckbox:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},modelValue:{type:Array,default(){return[]}},filterable:{type:Boolean,default:!1}},emits:["update:modelValue","check-change"],setup(e,{expose:n,emit:s}){const a=e,c=l.ref(null),f=Ca("zy-deptselect"),p=l.ref([]),g=l.ref([]),v=l.ref([]);function C(M){return M.map(R=>{let I=null;return R[a.childrenKey]&&R[a.childrenKey].length>0&&(I=C(R[a.childrenKey])),{label:R[a.labelKey],value:R[a.valueKey],t:R.t,children:I}})}const E=(M,R,I)=>{s("check-change",M,R);let V=[...a.modelValue];if(R)a.multiple?(d3(V,{label:M.label,value:M.value},"value"),p.value.indexOf(M.value)<0&&p.value.push(M.value)):(V=[{label:M.label,value:M.value}],p.value=[M.value]);else{I2(V,{label:M.label,value:M.value},"value");let J=p.value.indexOf(M.value);J>-1&&p.value.splice(J,1)}s("update:modelValue",V)},O=M=>{let R=[...a.modelValue];I2(R,{label:"",value:M},"value");let I=p.value.indexOf(M);I>-1&&p.value.splice(I,1)},_=()=>{if(!a.loadDataApi){console.warn("DeptSelect未配置loadDataApi");return}ld(a.loadDataApi,{},{handleError:!1,appendToken:a.appendToken,method:a.method}).then(({data:M})=>{let R=C(M);R.length<4&&(v.value=R.map(I=>I.value)),g.value=R})};l.onMounted(()=>{_()});const D=l.toRef(a,"modelValue");return l.watch(D,(M,R)=>{p.value=M.map(I=>I.value)}),p.value=a.modelValue.map(M=>M.value),n({getCheckedNodes:(M=!1,R=!1)=>c.value?c.value.getCheckedNodes(M,R):(console.warn("treeSelectRef.value是空"),null),setCheckedNodes:M=>c.value?c.value.setCheckedNodes(M):(console.warn("treeSelectRef.value是空"),null),getCheckedKeys:M=>c.value?c.value.getCheckedKeys(M):(console.warn("treeSelectRef.value是空"),null),setCheckedKeys:(M,R)=>{if(!c.value)return console.warn("treeSelectRef.value是空"),null;l.nextTick(()=>c.value.setCheckedKeys(M,R))}}),(M,R)=>{const I=q4e;return l.openBlock(),l.createBlock(I,{class:l.normalizeClass(l.unref(f)()),data:g.value,"render-after-expand":!1,"show-checkbox":e.showCheckbox,label:"n",children:"chd","node-key":"value",placeholder:e.placeholder,"check-strictly":!0,"model-value":p.value,multiple:!0,onCheckChange:E,onNodeClick:E,onRemoveTag:O,filterable:e.filterable,"default-expanded-keys":v.value,ref_key:"treeSelectRef",ref:c},{default:l.withCtx(({node:V,data:J})=>[l.createElementVNode("span",T9e,[J.t==1?(l.openBlock(),l.createElementBlock("i",O9e,"")):J.t==2?(l.openBlock(),l.createElementBlock("i",N9e,"")):l.createCommentVNode("v-if",!0),l.createElementVNode("span",{class:l.normalizeClass(l.unref(f)("label"))},l.toDisplayString(V.label),3)])]),_:1},8,["class","data","show-checkbox","placeholder","model-value","filterable","default-expanded-keys"])}}}));e6.install=e=>{e.component(e6.name,e6)};const A9e=l.createElementVNode("div",null,[l.createElementVNode("i",{class:"zy-font"},"")],-1),M9e=["src"],B9e=l.createElementVNode("i",{class:"zy-font"},"",-1),D9e=l.defineComponent({name:"Photo"}),t6=l.defineComponent(We(te({},D9e),{props:{title:{type:String,default:"上传一寸照片"},nullTip:{type:String,default:"未上传"},modelValue:{type:String},width:{type:Number,default:125},height:{type:Number,default:175},opt:{type:Boolean,default:!1},accept:{type:String,default:"image/*"},uploadPath:{type:String,required:!0},appendToken:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},maxSize:{type:Number,default:100},beforeUpload:{type:Function}},emits:["update:modelValue","scuccess","cancel","error"],setup(e,{expose:n,emit:s}){const a=e,c=l.ref(!1),f=l.ref(null);l.ref(null),l.ref(null);const p=l.ref(null);l.ref(!1);const g=Ca("zy-photo");l.computed(()=>!!a.opt);const v=()=>{M3({images:[a.modelValue],options:{initialViewIndex:0}})},C=l.computed(()=>({width:a.width+"px",height:a.height+"px",borderRadius:"2px"})),E=O=>ur(this,null,function*(){try{if(a.maxSize>0&&O.file.size>a.maxSize*1024){Dl({type:"warning",grouping:!0,message:`文件限制为:${a.maxSize}K`});return}let _=yield ld(a.uploadPath,{file:O.file},{fd:!0,loading:!1,appendToken:a.appendToken});if(_){let{data:D}=_;s("update:modelValue",D.requestPath),s("scuccess",D.requestPath),l.nextTick(()=>{f.value=null,c.value=!1})}else return}catch(_){s("error",_)}});return n({Crop:()=>{if(!a.opt){console.warn("当前状态不可上传");return}p.value.$el&&p.value.$el.querySelector(".el-upload").click()}}),(O,_)=>{const D=XF;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(g)())},[e.modelValue?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(g)("upload-imgcon")),style:l.normalizeStyle(C.value)},[l.createElementVNode("img",{src:e.modelValue},null,8,M9e),l.createElementVNode("div",{class:l.normalizeClass(l.unref(g)("upload-imgcon-optmask"))},[l.createElementVNode("i",{class:"zy-font",onClick:_[0]||(_[0]=M=>v())},""),e.opt?(l.openBlock(),l.createBlock(D,{key:0,ref_key:"uploadHoder",ref:p,class:l.normalizeClass(l.unref(g)("upload-imgcon-upload")),"http-request":E,"show-file-list":!1,"auto-upload":!0,"before-upload":e.beforeUpload,accept:e.accept,name:"file",multiple:!1},{default:l.withCtx(()=>[B9e]),_:1},8,["class","before-upload","accept"])):l.createCommentVNode("v-if",!0)],2)],6)):(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(l.unref(g)("upload-btn")),style:l.normalizeStyle(C.value)},[e.opt?(l.openBlock(),l.createBlock(D,{key:0,ref_key:"uploadHoder",ref:p,"auto-upload":!0,class:l.normalizeClass(l.unref(g)("upload-btn-upload")),accept:e.accept,name:"file",multiple:!1,"before-upload":e.beforeUpload,"http-request":E,"show-file-list":!1,style:{display:"inline-block","vertical-align":"top"}},{default:l.withCtx(()=>[A9e,l.createElementVNode("div",{class:l.normalizeClass(l.unref(g)("title"))},l.toDisplayString(e.title),3)]),_:1},8,["class","accept","before-upload"])):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(g)("upload-imgcon")),style:l.normalizeStyle([{border:"none"},C.value])},l.toDisplayString(e.nullTip),7))],6))],2)}}}));t6.install=e=>{e.component(t6.name,t6)};function cd(e){this.content=e}cd.prototype={constructor:cd,find:function(e){for(var n=0;n<this.content.length;n+=2)if(this.content[n]===e)return n;return-1},get:function(e){var n=this.find(e);return n==-1?void 0:this.content[n+1]},update:function(e,n,s){var a=s&&s!=e?this.remove(s):this,c=a.find(e),f=a.content.slice();return c==-1?f.push(s||e,n):(f[c+1]=n,s&&(f[c]=s)),new cd(f)},remove:function(e){var n=this.find(e);if(n==-1)return this;var s=this.content.slice();return s.splice(n,2),new cd(s)},addToStart:function(e,n){return new cd([e,n].concat(this.remove(e).content))},addToEnd:function(e,n){var s=this.remove(e).content.slice();return s.push(e,n),new cd(s)},addBefore:function(e,n,s){var a=this.remove(n),c=a.content.slice(),f=a.find(e);return c.splice(f==-1?c.length:f,0,n,s),new cd(c)},forEach:function(e){for(var n=0;n<this.content.length;n+=2)e(this.content[n],this.content[n+1])},prepend:function(e){return e=cd.from(e),e.size?new cd(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=cd.from(e),e.size?new cd(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var n=this;e=cd.from(e);for(var s=0;s<e.content.length;s+=2)n=n.remove(e.content[s]);return n},toObject:function(){var e={};return this.forEach(function(n,s){e[n]=s}),e},get size(){return this.content.length>>1}},cd.from=function(e){if(e instanceof cd)return e;var n=[];if(e)for(var s in e)n.push(s,e[s]);return new cd(n)};function zge(e,n,s){for(let a=0;;a++){if(a==e.childCount||a==n.childCount)return e.childCount==n.childCount?null:s;let c=e.child(a),f=n.child(a);if(c==f){s+=c.nodeSize;continue}if(!c.sameMarkup(f))return s;if(c.isText&&c.text!=f.text){for(let p=0;c.text[p]==f.text[p];p++)s++;return s}if(c.content.size||f.content.size){let p=zge(c.content,f.content,s+1);if(p!=null)return p}s+=c.nodeSize}}function Vge(e,n,s,a){for(let c=e.childCount,f=n.childCount;;){if(c==0||f==0)return c==f?null:{a:s,b:a};let p=e.child(--c),g=n.child(--f),v=p.nodeSize;if(p==g){s-=v,a-=v;continue}if(!p.sameMarkup(g))return{a:s,b:a};if(p.isText&&p.text!=g.text){let C=0,E=Math.min(p.text.length,g.text.length);for(;C<E&&p.text[p.text.length-C-1]==g.text[g.text.length-C-1];)C++,s--,a--;return{a:s,b:a}}if(p.content.size||g.content.size){let C=Vge(p.content,g.content,s-1,a-1);if(C)return C}s-=v,a-=v}}class kn{constructor(n,s){if(this.content=n,this.size=s||0,s==null)for(let a=0;a<n.length;a++)this.size+=n[a].nodeSize}nodesBetween(n,s,a,c=0,f){for(let p=0,g=0;g<s;p++){let v=this.content[p],C=g+v.nodeSize;if(C>n&&a(v,c+g,f||null,p)!==!1&&v.content.size){let E=g+1;v.nodesBetween(Math.max(0,n-E),Math.min(v.content.size,s-E),a,c+E)}g=C}}descendants(n){this.nodesBetween(0,this.size,n)}textBetween(n,s,a,c){let f="",p=!0;return this.nodesBetween(n,s,(g,v)=>{let C=g.isText?g.text.slice(Math.max(n,v)-v,s-v):g.isLeaf?c?typeof c=="function"?c(g):c:g.type.spec.leafText?g.type.spec.leafText(g):"":"";g.isBlock&&(g.isLeaf&&C||g.isTextblock)&&a&&(p?p=!1:f+=a),f+=C},0),f}append(n){if(!n.size)return this;if(!this.size)return n;let s=this.lastChild,a=n.firstChild,c=this.content.slice(),f=0;for(s.isText&&s.sameMarkup(a)&&(c[c.length-1]=s.withText(s.text+a.text),f=1);f<n.content.length;f++)c.push(n.content[f]);return new kn(c,this.size+n.size)}cut(n,s=this.size){if(n==0&&s==this.size)return this;let a=[],c=0;if(s>n)for(let f=0,p=0;p<s;f++){let g=this.content[f],v=p+g.nodeSize;v>n&&((p<n||v>s)&&(g.isText?g=g.cut(Math.max(0,n-p),Math.min(g.text.length,s-p)):g=g.cut(Math.max(0,n-p-1),Math.min(g.content.size,s-p-1))),a.push(g),c+=g.nodeSize),p=v}return new kn(a,c)}cutByIndex(n,s){return n==s?kn.empty:n==0&&s==this.content.length?this:new kn(this.content.slice(n,s))}replaceChild(n,s){let a=this.content[n];if(a==s)return this;let c=this.content.slice(),f=this.size+s.nodeSize-a.nodeSize;return c[n]=s,new kn(c,f)}addToStart(n){return new kn([n].concat(this.content),this.size+n.nodeSize)}addToEnd(n){return new kn(this.content.concat(n),this.size+n.nodeSize)}eq(n){if(this.content.length!=n.content.length)return!1;for(let s=0;s<this.content.length;s++)if(!this.content[s].eq(n.content[s]))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(n){let s=this.content[n];if(!s)throw new RangeError("Index "+n+" out of range for "+this);return s}maybeChild(n){return this.content[n]||null}forEach(n){for(let s=0,a=0;s<this.content.length;s++){let c=this.content[s];n(c,a,s),a+=c.nodeSize}}findDiffStart(n,s=0){return zge(this,n,s)}findDiffEnd(n,s=this.size,a=n.size){return Vge(this,n,s,a)}findIndex(n,s=-1){if(n==0)return n6(0,n);if(n==this.size)return n6(this.content.length,n);if(n>this.size||n<0)throw new RangeError(`Position ${n} outside of fragment (${this})`);for(let a=0,c=0;;a++){let f=this.child(a),p=c+f.nodeSize;if(p>=n)return p==n||s>0?n6(a+1,p):n6(a,c);c=p}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(n=>n.toJSON()):null}static fromJSON(n,s){if(!s)return kn.empty;if(!Array.isArray(s))throw new RangeError("Invalid input for Fragment.fromJSON");return new kn(s.map(n.nodeFromJSON))}static fromArray(n){if(!n.length)return kn.empty;let s,a=0;for(let c=0;c<n.length;c++){let f=n[c];a+=f.nodeSize,c&&f.isText&&n[c-1].sameMarkup(f)?(s||(s=n.slice(0,c)),s[s.length-1]=f.withText(s[s.length-1].text+f.text)):s&&s.push(f)}return new kn(s||n,a)}static from(n){if(!n)return kn.empty;if(n instanceof kn)return n;if(Array.isArray(n))return this.fromArray(n);if(n.attrs)return new kn([n],n.nodeSize);throw new RangeError("Can not convert "+n+" to a Fragment"+(n.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}kn.empty=new kn([],0);const vG={index:0,offset:0};function n6(e,n){return vG.index=e,vG.offset=n,vG}function o6(e,n){if(e===n)return!0;if(!(e&&typeof e=="object")||!(n&&typeof n=="object"))return!1;let s=Array.isArray(e);if(Array.isArray(n)!=s)return!1;if(s){if(e.length!=n.length)return!1;for(let a=0;a<e.length;a++)if(!o6(e[a],n[a]))return!1}else{for(let a in e)if(!(a in n)||!o6(e[a],n[a]))return!1;for(let a in n)if(!(a in e))return!1}return!0}let za=class Vle{constructor(n,s){this.type=n,this.attrs=s}addToSet(n){let s,a=!1;for(let c=0;c<n.length;c++){let f=n[c];if(this.eq(f))return n;if(this.type.excludes(f.type))s||(s=n.slice(0,c));else{if(f.type.excludes(this.type))return n;!a&&f.type.rank>this.type.rank&&(s||(s=n.slice(0,c)),s.push(this),a=!0),s&&s.push(f)}}return s||(s=n.slice()),a||s.push(this),s}removeFromSet(n){for(let s=0;s<n.length;s++)if(this.eq(n[s]))return n.slice(0,s).concat(n.slice(s+1));return n}isInSet(n){for(let s=0;s<n.length;s++)if(this.eq(n[s]))return!0;return!1}eq(n){return this==n||this.type==n.type&&o6(this.attrs,n.attrs)}toJSON(){let n={type:this.type.name};for(let s in this.attrs){n.attrs=this.attrs;break}return n}static fromJSON(n,s){if(!s)throw new RangeError("Invalid input for Mark.fromJSON");let a=n.marks[s.type];if(!a)throw new RangeError(`There is no mark type ${s.type} in this schema`);let c=a.create(s.attrs);return a.checkAttrs(c.attrs),c}static sameSet(n,s){if(n==s)return!0;if(n.length!=s.length)return!1;for(let a=0;a<n.length;a++)if(!n[a].eq(s[a]))return!1;return!0}static setFrom(n){if(!n||Array.isArray(n)&&n.length==0)return Vle.none;if(n instanceof Vle)return[n];let s=n.slice();return s.sort((a,c)=>a.type.rank-c.type.rank),s}};za.none=[];class s6 extends Error{}class lo{constructor(n,s,a){this.content=n,this.openStart=s,this.openEnd=a}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(n,s){let a=Uge(this.content,n+this.openStart,s);return a&&new lo(a,this.openStart,this.openEnd)}removeBetween(n,s){return new lo(Hge(this.content,n+this.openStart,s+this.openStart),this.openStart,this.openEnd)}eq(n){return this.content.eq(n.content)&&this.openStart==n.openStart&&this.openEnd==n.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let n={content:this.content.toJSON()};return this.openStart>0&&(n.openStart=this.openStart),this.openEnd>0&&(n.openEnd=this.openEnd),n}static fromJSON(n,s){if(!s)return lo.empty;let a=s.openStart||0,c=s.openEnd||0;if(typeof a!="number"||typeof c!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new lo(kn.fromJSON(n,s.content),a,c)}static maxOpen(n,s=!0){let a=0,c=0;for(let f=n.firstChild;f&&!f.isLeaf&&(s||!f.type.spec.isolating);f=f.firstChild)a++;for(let f=n.lastChild;f&&!f.isLeaf&&(s||!f.type.spec.isolating);f=f.lastChild)c++;return new lo(n,a,c)}}lo.empty=new lo(kn.empty,0,0);function Hge(e,n,s){let{index:a,offset:c}=e.findIndex(n),f=e.maybeChild(a),{index:p,offset:g}=e.findIndex(s);if(c==n||f.isText){if(g!=s&&!e.child(p).isText)throw new RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(s))}if(a!=p)throw new RangeError("Removing non-flat range");return e.replaceChild(a,f.copy(Hge(f.content,n-c-1,s-c-1)))}function Uge(e,n,s,a){let{index:c,offset:f}=e.findIndex(n),p=e.maybeChild(c);if(f==n||p.isText)return a&&!a.canReplace(c,c,s)?null:e.cut(0,n).append(s).append(e.cut(n));let g=Uge(p.content,n-f-1,s);return g&&e.replaceChild(c,p.copy(g))}function R9e(e,n,s){if(s.openStart>e.depth)throw new s6("Inserted content deeper than insertion position");if(e.depth-s.openStart!=n.depth-s.openEnd)throw new s6("Inconsistent open depths");return Wge(e,n,s,0)}function Wge(e,n,s,a){let c=e.index(a),f=e.node(a);if(c==n.index(a)&&a<e.depth-s.openStart){let p=Wge(e,n,s,a+1);return f.copy(f.content.replaceChild(c,p))}else if(s.content.size)if(!s.openStart&&!s.openEnd&&e.depth==a&&n.depth==a){let p=e.parent,g=p.content;return K2(p,g.cut(0,e.parentOffset).append(s.content).append(g.cut(n.parentOffset)))}else{let{start:p,end:g}=$9e(s,e);return K2(f,Kge(e,p,g,n,a))}else return K2(f,r6(e,n,a))}function jge(e,n){if(!n.type.compatibleContent(e.type))throw new s6("Cannot join "+n.type.name+" onto "+e.type.name)}function wG(e,n,s){let a=e.node(s);return jge(a,n.node(s)),a}function j2(e,n){let s=n.length-1;s>=0&&e.isText&&e.sameMarkup(n[s])?n[s]=e.withText(n[s].text+e.text):n.push(e)}function $3(e,n,s,a){let c=(n||e).node(s),f=0,p=n?n.index(s):c.childCount;e&&(f=e.index(s),e.depth>s?f++:e.textOffset&&(j2(e.nodeAfter,a),f++));for(let g=f;g<p;g++)j2(c.child(g),a);n&&n.depth==s&&n.textOffset&&j2(n.nodeBefore,a)}function K2(e,n){return e.type.checkContent(n),e.copy(n)}function Kge(e,n,s,a,c){let f=e.depth>c&&wG(e,n,c+1),p=a.depth>c&&wG(s,a,c+1),g=[];return $3(null,e,c,g),f&&p&&n.index(c)==s.index(c)?(jge(f,p),j2(K2(f,Kge(e,n,s,a,c+1)),g)):(f&&j2(K2(f,r6(e,n,c+1)),g),$3(n,s,c,g),p&&j2(K2(p,r6(s,a,c+1)),g)),$3(a,null,c,g),new kn(g)}function r6(e,n,s){let a=[];if($3(null,e,s,a),e.depth>s){let c=wG(e,n,s+1);j2(K2(c,r6(e,n,s+1)),a)}return $3(n,null,s,a),new kn(a)}function $9e(e,n){let s=n.depth-e.openStart,c=n.node(s).copy(e.content);for(let f=s-1;f>=0;f--)c=n.node(f).copy(kn.from(c));return{start:c.resolveNoCache(e.openStart+s),end:c.resolveNoCache(c.content.size-e.openEnd-s)}}class P3{constructor(n,s,a){this.pos=n,this.path=s,this.parentOffset=a,this.depth=s.length/3-1}resolveDepth(n){return n==null?this.depth:n<0?this.depth+n:n}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(n){return this.path[this.resolveDepth(n)*3]}index(n){return this.path[this.resolveDepth(n)*3+1]}indexAfter(n){return n=this.resolveDepth(n),this.index(n)+(n==this.depth&&!this.textOffset?0:1)}start(n){return n=this.resolveDepth(n),n==0?0:this.path[n*3-1]+1}end(n){return n=this.resolveDepth(n),this.start(n)+this.node(n).content.size}before(n){if(n=this.resolveDepth(n),!n)throw new RangeError("There is no position before the top-level node");return n==this.depth+1?this.pos:this.path[n*3-1]}after(n){if(n=this.resolveDepth(n),!n)throw new RangeError("There is no position after the top-level node");return n==this.depth+1?this.pos:this.path[n*3-1]+this.path[n*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let n=this.parent,s=this.index(this.depth);if(s==n.childCount)return null;let a=this.pos-this.path[this.path.length-1],c=n.child(s);return a?n.child(s).cut(a):c}get nodeBefore(){let n=this.index(this.depth),s=this.pos-this.path[this.path.length-1];return s?this.parent.child(n).cut(0,s):n==0?null:this.parent.child(n-1)}posAtIndex(n,s){s=this.resolveDepth(s);let a=this.path[s*3],c=s==0?0:this.path[s*3-1]+1;for(let f=0;f<n;f++)c+=a.child(f).nodeSize;return c}marks(){let n=this.parent,s=this.index();if(n.content.size==0)return za.none;if(this.textOffset)return n.child(s).marks;let a=n.maybeChild(s-1),c=n.maybeChild(s);if(!a){let g=a;a=c,c=g}let f=a.marks;for(var p=0;p<f.length;p++)f[p].type.spec.inclusive===!1&&(!c||!f[p].isInSet(c.marks))&&(f=f[p--].removeFromSet(f));return f}marksAcross(n){let s=this.parent.maybeChild(this.index());if(!s||!s.isInline)return null;let a=s.marks,c=n.parent.maybeChild(n.index());for(var f=0;f<a.length;f++)a[f].type.spec.inclusive===!1&&(!c||!a[f].isInSet(c.marks))&&(a=a[f--].removeFromSet(a));return a}sharedDepth(n){for(let s=this.depth;s>0;s--)if(this.start(s)<=n&&this.end(s)>=n)return s;return 0}blockRange(n=this,s){if(n.pos<this.pos)return n.blockRange(this);for(let a=this.depth-(this.parent.inlineContent||this.pos==n.pos?1:0);a>=0;a--)if(n.pos<=this.end(a)&&(!s||s(this.node(a))))return new i6(this,n,a);return null}sameParent(n){return this.pos-this.parentOffset==n.pos-n.parentOffset}max(n){return n.pos>this.pos?n:this}min(n){return n.pos<this.pos?n:this}toString(){let n="";for(let s=1;s<=this.depth;s++)n+=(n?"/":"")+this.node(s).type.name+"_"+this.index(s-1);return n+":"+this.parentOffset}static resolve(n,s){if(!(s>=0&&s<=n.content.size))throw new RangeError("Position "+s+" out of range");let a=[],c=0,f=s;for(let p=n;;){let{index:g,offset:v}=p.content.findIndex(f),C=f-v;if(a.push(p,g,c+v),!C||(p=p.child(g),p.isText))break;f=C-1,c+=v+1}return new P3(s,a,f)}static resolveCached(n,s){let a=qge.get(n);if(a)for(let f=0;f<a.elts.length;f++){let p=a.elts[f];if(p.pos==s)return p}else qge.set(n,a=new P9e);let c=a.elts[a.i]=P3.resolve(n,s);return a.i=(a.i+1)%I9e,c}}class P9e{constructor(){this.elts=[],this.i=0}}const I9e=12,qge=new WeakMap;class i6{constructor(n,s,a){this.$from=n,this.$to=s,this.depth=a}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 L9e=Object.create(null);let $w=class Hle{constructor(n,s,a,c=za.none){this.type=n,this.attrs=s,this.marks=c,this.content=a||kn.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(n){return this.content.child(n)}maybeChild(n){return this.content.maybeChild(n)}forEach(n){this.content.forEach(n)}nodesBetween(n,s,a,c=0){this.content.nodesBetween(n,s,a,c,this)}descendants(n){this.nodesBetween(0,this.content.size,n)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(n,s,a,c){return this.content.textBetween(n,s,a,c)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(n){return this==n||this.sameMarkup(n)&&this.content.eq(n.content)}sameMarkup(n){return this.hasMarkup(n.type,n.attrs,n.marks)}hasMarkup(n,s,a){return this.type==n&&o6(this.attrs,s||n.defaultAttrs||L9e)&&za.sameSet(this.marks,a||za.none)}copy(n=null){return n==this.content?this:new Hle(this.type,this.attrs,n,this.marks)}mark(n){return n==this.marks?this:new Hle(this.type,this.attrs,this.content,n)}cut(n,s=this.content.size){return n==0&&s==this.content.size?this:this.copy(this.content.cut(n,s))}slice(n,s=this.content.size,a=!1){if(n==s)return lo.empty;let c=this.resolve(n),f=this.resolve(s),p=a?0:c.sharedDepth(s),g=c.start(p),C=c.node(p).content.cut(c.pos-g,f.pos-g);return new lo(C,c.depth-p,f.depth-p)}replace(n,s,a){return R9e(this.resolve(n),this.resolve(s),a)}nodeAt(n){for(let s=this;;){let{index:a,offset:c}=s.content.findIndex(n);if(s=s.maybeChild(a),!s)return null;if(c==n||s.isText)return s;n-=c+1}}childAfter(n){let{index:s,offset:a}=this.content.findIndex(n);return{node:this.content.maybeChild(s),index:s,offset:a}}childBefore(n){if(n==0)return{node:null,index:0,offset:0};let{index:s,offset:a}=this.content.findIndex(n);if(a<n)return{node:this.content.child(s),index:s,offset:a};let c=this.content.child(s-1);return{node:c,index:s-1,offset:a-c.nodeSize}}resolve(n){return P3.resolveCached(this,n)}resolveNoCache(n){return P3.resolve(this,n)}rangeHasMark(n,s,a){let c=!1;return s>n&&this.nodesBetween(n,s,f=>(a.isInSet(f.marks)&&(c=!0),!c)),c}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 n=this.type.name;return this.content.size&&(n+="("+this.content.toStringInner()+")"),Zge(this.marks,n)}contentMatchAt(n){let s=this.type.contentMatch.matchFragment(this.content,0,n);if(!s)throw new Error("Called contentMatchAt on a node with invalid content");return s}canReplace(n,s,a=kn.empty,c=0,f=a.childCount){let p=this.contentMatchAt(n).matchFragment(a,c,f),g=p&&p.matchFragment(this.content,s);if(!g||!g.validEnd)return!1;for(let v=c;v<f;v++)if(!this.type.allowsMarks(a.child(v).marks))return!1;return!0}canReplaceWith(n,s,a,c){if(c&&!this.type.allowsMarks(c))return!1;let f=this.contentMatchAt(n).matchType(a),p=f&&f.matchFragment(this.content,s);return p?p.validEnd:!1}canAppend(n){return n.content.size?this.canReplace(this.childCount,this.childCount,n.content):this.type.compatibleContent(n.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let n=za.none;for(let s=0;s<this.marks.length;s++){let a=this.marks[s];a.type.checkAttrs(a.attrs),n=a.addToSet(n)}if(!za.sameSet(n,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(s=>s.type.name)}`);this.content.forEach(s=>s.check())}toJSON(){let n={type:this.type.name};for(let s in this.attrs){n.attrs=this.attrs;break}return this.content.size&&(n.content=this.content.toJSON()),this.marks.length&&(n.marks=this.marks.map(s=>s.toJSON())),n}static fromJSON(n,s){if(!s)throw new RangeError("Invalid input for Node.fromJSON");let a;if(s.marks){if(!Array.isArray(s.marks))throw new RangeError("Invalid mark data for Node.fromJSON");a=s.marks.map(n.markFromJSON)}if(s.type=="text"){if(typeof s.text!="string")throw new RangeError("Invalid text node in JSON");return n.text(s.text,a)}let c=kn.fromJSON(n,s.content),f=n.nodeType(s.type).create(s.attrs,c,a);return f.type.checkAttrs(f.attrs),f}};$w.prototype.text=void 0;class a6 extends $w{constructor(n,s,a,c){if(super(n,s,null,c),!a)throw new RangeError("Empty text nodes are not allowed");this.text=a}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Zge(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(n,s){return this.text.slice(n,s)}get nodeSize(){return this.text.length}mark(n){return n==this.marks?this:new a6(this.type,this.attrs,this.text,n)}withText(n){return n==this.text?this:new a6(this.type,this.attrs,n,this.marks)}cut(n=0,s=this.text.length){return n==0&&s==this.text.length?this:this.withText(this.text.slice(n,s))}eq(n){return this.sameMarkup(n)&&this.text==n.text}toJSON(){let n=super.toJSON();return n.text=this.text,n}}function Zge(e,n){for(let s=e.length-1;s>=0;s--)n=e[s].type.name+"("+n+")";return n}class q2{constructor(n){this.validEnd=n,this.next=[],this.wrapCache=[]}static parse(n,s){let a=new F9e(n,s);if(a.next==null)return q2.empty;let c=Gge(a);a.next&&a.err("Unexpected trailing text");let f=K9e(j9e(c));return q9e(f,a),f}matchType(n){for(let s=0;s<this.next.length;s++)if(this.next[s].type==n)return this.next[s].next;return null}matchFragment(n,s=0,a=n.childCount){let c=this;for(let f=s;c&&f<a;f++)c=c.matchType(n.child(f).type);return c}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let n=0;n<this.next.length;n++){let{type:s}=this.next[n];if(!(s.isText||s.hasRequiredAttrs()))return s}return null}compatible(n){for(let s=0;s<this.next.length;s++)for(let a=0;a<n.next.length;a++)if(this.next[s].type==n.next[a].type)return!0;return!1}fillBefore(n,s=!1,a=0){let c=[this];function f(p,g){let v=p.matchFragment(n,a);if(v&&(!s||v.validEnd))return kn.from(g.map(C=>C.createAndFill()));for(let C=0;C<p.next.length;C++){let{type:E,next:O}=p.next[C];if(!(E.isText||E.hasRequiredAttrs())&&c.indexOf(O)==-1){c.push(O);let _=f(O,g.concat(E));if(_)return _}}return null}return f(this,[])}findWrapping(n){for(let a=0;a<this.wrapCache.length;a+=2)if(this.wrapCache[a]==n)return this.wrapCache[a+1];let s=this.computeWrapping(n);return this.wrapCache.push(n,s),s}computeWrapping(n){let s=Object.create(null),a=[{match:this,type:null,via:null}];for(;a.length;){let c=a.shift(),f=c.match;if(f.matchType(n)){let p=[];for(let g=c;g.type;g=g.via)p.push(g.type);return p.reverse()}for(let p=0;p<f.next.length;p++){let{type:g,next:v}=f.next[p];!g.isLeaf&&!g.hasRequiredAttrs()&&!(g.name in s)&&(!c.type||v.validEnd)&&(a.push({match:g.contentMatch,type:g,via:c}),s[g.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(n){if(n>=this.next.length)throw new RangeError(`There's no ${n}th edge in this content match`);return this.next[n]}toString(){let n=[];function s(a){n.push(a);for(let c=0;c<a.next.length;c++)n.indexOf(a.next[c].next)==-1&&s(a.next[c].next)}return s(this),n.map((a,c)=>{let f=c+(a.validEnd?"*":" ")+" ";for(let p=0;p<a.next.length;p++)f+=(p?", ":"")+a.next[p].type.name+"->"+n.indexOf(a.next[p].next);return f}).join(`
171
171
  `)}}q2.empty=new q2(!0);class F9e{constructor(n,s){this.string=n,this.nodeTypes=s,this.inline=null,this.pos=0,this.tokens=n.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(n){return this.next==n&&(this.pos++||!0)}err(n){throw new SyntaxError(n+" (in content expression '"+this.string+"')")}}function Gge(e){let n=[];do n.push(z9e(e));while(e.eat("|"));return n.length==1?n[0]:{type:"choice",exprs:n}}function z9e(e){let n=[];do n.push(V9e(e));while(e.next&&e.next!=")"&&e.next!="|");return n.length==1?n[0]:{type:"seq",exprs:n}}function V9e(e){let n=W9e(e);for(;;)if(e.eat("+"))n={type:"plus",expr:n};else if(e.eat("*"))n={type:"star",expr:n};else if(e.eat("?"))n={type:"opt",expr:n};else if(e.eat("{"))n=H9e(e,n);else break;return n}function Yge(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let n=Number(e.next);return e.pos++,n}function H9e(e,n){let s=Yge(e),a=s;return e.eat(",")&&(e.next!="}"?a=Yge(e):a=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:s,max:a,expr:n}}function U9e(e,n){let s=e.nodeTypes,a=s[n];if(a)return[a];let c=[];for(let f in s){let p=s[f];p.isInGroup(n)&&c.push(p)}return c.length==0&&e.err("No node type or group '"+n+"' found"),c}function W9e(e){if(e.eat("(")){let n=Gge(e);return e.eat(")")||e.err("Missing closing paren"),n}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let n=U9e(e,e.next).map(s=>(e.inline==null?e.inline=s.isInline:e.inline!=s.isInline&&e.err("Mixing inline and block content"),{type:"name",value:s}));return e.pos++,n.length==1?n[0]:{type:"choice",exprs:n}}}function j9e(e){let n=[[]];return c(f(e,0),s()),n;function s(){return n.push([])-1}function a(p,g,v){let C={term:v,to:g};return n[p].push(C),C}function c(p,g){p.forEach(v=>v.to=g)}function f(p,g){if(p.type=="choice")return p.exprs.reduce((v,C)=>v.concat(f(C,g)),[]);if(p.type=="seq")for(let v=0;;v++){let C=f(p.exprs[v],g);if(v==p.exprs.length-1)return C;c(C,g=s())}else if(p.type=="star"){let v=s();return a(g,v),c(f(p.expr,v),v),[a(v)]}else if(p.type=="plus"){let v=s();return c(f(p.expr,g),v),c(f(p.expr,v),v),[a(v)]}else{if(p.type=="opt")return[a(g)].concat(f(p.expr,g));if(p.type=="range"){let v=g;for(let C=0;C<p.min;C++){let E=s();c(f(p.expr,v),E),v=E}if(p.max==-1)c(f(p.expr,v),v);else for(let C=p.min;C<p.max;C++){let E=s();a(v,E),c(f(p.expr,v),E),v=E}return[a(v)]}else{if(p.type=="name")return[a(g,void 0,p.value)];throw new Error("Unknown expr type")}}}}function Xge(e,n){return n-e}function Jge(e,n){let s=[];return a(n),s.sort(Xge);function a(c){let f=e[c];if(f.length==1&&!f[0].term)return a(f[0].to);s.push(c);for(let p=0;p<f.length;p++){let{term:g,to:v}=f[p];!g&&s.indexOf(v)==-1&&a(v)}}}function K9e(e){let n=Object.create(null);return s(Jge(e,0));function s(a){let c=[];a.forEach(p=>{e[p].forEach(({term:g,to:v})=>{if(!g)return;let C;for(let E=0;E<c.length;E++)c[E][0]==g&&(C=c[E][1]);Jge(e,v).forEach(E=>{C||c.push([g,C=[]]),C.indexOf(E)==-1&&C.push(E)})})});let f=n[a.join(",")]=new q2(a.indexOf(e.length-1)>-1);for(let p=0;p<c.length;p++){let g=c[p][1].sort(Xge);f.next.push({type:c[p][0],next:n[g.join(",")]||s(g)})}return f}}function q9e(e,n){for(let s=0,a=[e];s<a.length;s++){let c=a[s],f=!c.validEnd,p=[];for(let g=0;g<c.next.length;g++){let{type:v,next:C}=c.next[g];p.push(v.name),f&&!(v.isText||v.hasRequiredAttrs())&&(f=!1),a.indexOf(C)==-1&&a.push(C)}f&&n.err("Only non-generatable nodes ("+p.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Qge(e){let n=Object.create(null);for(let s in e){let a=e[s];if(!a.hasDefault)return null;n[s]=a.default}return n}function ebe(e,n){let s=Object.create(null);for(let a in e){let c=n&&n[a];if(c===void 0){let f=e[a];if(f.hasDefault)c=f.default;else throw new RangeError("No value supplied for attribute "+a)}s[a]=c}return s}function tbe(e,n,s,a){for(let c in n)if(!(c in e))throw new RangeError(`Unsupported attribute ${c} for ${s} of type ${c}`);for(let c in e){let f=e[c];f.validate&&f.validate(n[c])}}function nbe(e,n){let s=Object.create(null);if(n)for(let a in n)s[a]=new G9e(e,a,n[a]);return s}let obe=class Swe{constructor(n,s,a){this.name=n,this.schema=s,this.spec=a,this.markSet=null,this.groups=a.group?a.group.split(" "):[],this.attrs=nbe(n,a.attrs),this.defaultAttrs=Qge(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(a.inline||n=="text"),this.isText=n=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==q2.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(n){return this.groups.indexOf(n)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let n in this.attrs)if(this.attrs[n].isRequired)return!0;return!1}compatibleContent(n){return this==n||this.contentMatch.compatible(n.contentMatch)}computeAttrs(n){return!n&&this.defaultAttrs?this.defaultAttrs:ebe(this.attrs,n)}create(n=null,s,a){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new $w(this,this.computeAttrs(n),kn.from(s),za.setFrom(a))}createChecked(n=null,s,a){return s=kn.from(s),this.checkContent(s),new $w(this,this.computeAttrs(n),s,za.setFrom(a))}createAndFill(n=null,s,a){if(n=this.computeAttrs(n),s=kn.from(s),s.size){let p=this.contentMatch.fillBefore(s);if(!p)return null;s=p.append(s)}let c=this.contentMatch.matchFragment(s),f=c&&c.fillBefore(kn.empty,!0);return f?new $w(this,n,s.append(f),za.setFrom(a)):null}validContent(n){let s=this.contentMatch.matchFragment(n);if(!s||!s.validEnd)return!1;for(let a=0;a<n.childCount;a++)if(!this.allowsMarks(n.child(a).marks))return!1;return!0}checkContent(n){if(!this.validContent(n))throw new RangeError(`Invalid content for node ${this.name}: ${n.toString().slice(0,50)}`)}checkAttrs(n){tbe(this.attrs,n,"node",this.name)}allowsMarkType(n){return this.markSet==null||this.markSet.indexOf(n)>-1}allowsMarks(n){if(this.markSet==null)return!0;for(let s=0;s<n.length;s++)if(!this.allowsMarkType(n[s].type))return!1;return!0}allowedMarks(n){if(this.markSet==null)return n;let s;for(let a=0;a<n.length;a++)this.allowsMarkType(n[a].type)?s&&s.push(n[a]):s||(s=n.slice(0,a));return s?s.length?s:za.none:n}static compile(n,s){let a=Object.create(null);n.forEach((f,p)=>a[f]=new Swe(f,s,p));let c=s.spec.topNode||"doc";if(!a[c])throw new RangeError("Schema is missing its top node type ('"+c+"')");if(!a.text)throw new RangeError("Every schema needs a 'text' type");for(let f in a.text.attrs)throw new RangeError("The text node type should not have attributes");return a}};function Z9e(e,n,s){let a=s.split("|");return c=>{let f=c===null?"null":typeof c;if(a.indexOf(f)<0)throw new RangeError(`Expected value of type ${a} for attribute ${n} on type ${e}, got ${f}`)}}class G9e{constructor(n,s,a){this.hasDefault=Object.prototype.hasOwnProperty.call(a,"default"),this.default=a.default,this.validate=typeof a.validate=="string"?Z9e(n,s,a.validate):a.validate}get isRequired(){return!this.hasDefault}}class l6{constructor(n,s,a,c){this.name=n,this.rank=s,this.schema=a,this.spec=c,this.attrs=nbe(n,c.attrs),this.excluded=null;let f=Qge(this.attrs);this.instance=f?new za(this,f):null}create(n=null){return!n&&this.instance?this.instance:new za(this,ebe(this.attrs,n))}static compile(n,s){let a=Object.create(null),c=0;return n.forEach((f,p)=>a[f]=new l6(f,c++,s,p)),a}removeFromSet(n){for(var s=0;s<n.length;s++)n[s].type==this&&(n=n.slice(0,s).concat(n.slice(s+1)),s--);return n}isInSet(n){for(let s=0;s<n.length;s++)if(n[s].type==this)return n[s]}checkAttrs(n){tbe(this.attrs,n,"mark",this.name)}excludes(n){return this.excluded.indexOf(n)>-1}}class sbe{constructor(n){this.linebreakReplacement=null,this.cached=Object.create(null);let s=this.spec={};for(let c in n)s[c]=n[c];s.nodes=cd.from(n.nodes),s.marks=cd.from(n.marks||{}),this.nodes=obe.compile(this.spec.nodes,this),this.marks=l6.compile(this.spec.marks,this);let a=Object.create(null);for(let c in this.nodes){if(c in this.marks)throw new RangeError(c+" can not be both a node and a mark");let f=this.nodes[c],p=f.spec.content||"",g=f.spec.marks;if(f.contentMatch=a[p]||(a[p]=q2.parse(p,this.nodes)),f.inlineContent=f.contentMatch.inlineContent,f.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!f.isInline||!f.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=f}f.markSet=g=="_"?null:g?rbe(this,g.split(" ")):g==""||!f.inlineContent?[]:null}for(let c in this.marks){let f=this.marks[c],p=f.spec.excludes;f.excluded=p==null?[f]:p==""?[]:rbe(this,p.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(n,s=null,a,c){if(typeof n=="string")n=this.nodeType(n);else if(n instanceof obe){if(n.schema!=this)throw new RangeError("Node type from different schema used ("+n.name+")")}else throw new RangeError("Invalid node type: "+n);return n.createChecked(s,a,c)}text(n,s){let a=this.nodes.text;return new a6(a,a.defaultAttrs,n,za.setFrom(s))}mark(n,s){return typeof n=="string"&&(n=this.marks[n]),n.create(s)}nodeFromJSON(n){return $w.fromJSON(this,n)}markFromJSON(n){return za.fromJSON(this,n)}nodeType(n){let s=this.nodes[n];if(!s)throw new RangeError("Unknown node type: "+n);return s}}function rbe(e,n){let s=[];for(let a=0;a<n.length;a++){let c=n[a],f=e.marks[c],p=f;if(f)s.push(f);else for(let g in e.marks){let v=e.marks[g];(c=="_"||v.spec.group&&v.spec.group.split(" ").indexOf(c)>-1)&&s.push(p=v)}if(!p)throw new SyntaxError("Unknown mark type: '"+n[a]+"'")}return s}function Y9e(e){return e.tag!=null}function X9e(e){return e.style!=null}let I3=class Ule{constructor(n,s){this.schema=n,this.rules=s,this.tags=[],this.styles=[];let a=this.matchedStyles=[];s.forEach(c=>{if(Y9e(c))this.tags.push(c);else if(X9e(c)){let f=/[^=]*/.exec(c.style)[0];a.indexOf(f)<0&&a.push(f),this.styles.push(c)}}),this.normalizeLists=!this.tags.some(c=>{if(!/^(ul|ol)\b/.test(c.tag)||!c.node)return!1;let f=n.nodes[c.node];return f.contentMatch.matchType(f)})}parse(n,s={}){let a=new cbe(this,s,!1);return a.addAll(n,za.none,s.from,s.to),a.finish()}parseSlice(n,s={}){let a=new cbe(this,s,!0);return a.addAll(n,za.none,s.from,s.to),lo.maxOpen(a.finish())}matchTag(n,s,a){for(let c=a?this.tags.indexOf(a)+1:0;c<this.tags.length;c++){let f=this.tags[c];if(eUe(n,f.tag)&&(f.namespace===void 0||n.namespaceURI==f.namespace)&&(!f.context||s.matchesContext(f.context))){if(f.getAttrs){let p=f.getAttrs(n);if(p===!1)continue;f.attrs=p||void 0}return f}}}matchStyle(n,s,a,c){for(let f=c?this.styles.indexOf(c)+1:0;f<this.styles.length;f++){let p=this.styles[f],g=p.style;if(!(g.indexOf(n)!=0||p.context&&!a.matchesContext(p.context)||g.length>n.length&&(g.charCodeAt(n.length)!=61||g.slice(n.length+1)!=s))){if(p.getAttrs){let v=p.getAttrs(s);if(v===!1)continue;p.attrs=v||void 0}return p}}}static schemaRules(n){let s=[];function a(c){let f=c.priority==null?50:c.priority,p=0;for(;p<s.length;p++){let g=s[p];if((g.priority==null?50:g.priority)<f)break}s.splice(p,0,c)}for(let c in n.marks){let f=n.marks[c].spec.parseDOM;f&&f.forEach(p=>{a(p=ube(p)),p.mark||p.ignore||p.clearMark||(p.mark=c)})}for(let c in n.nodes){let f=n.nodes[c].spec.parseDOM;f&&f.forEach(p=>{a(p=ube(p)),p.node||p.ignore||p.mark||(p.node=c)})}return s}static fromSchema(n){return n.cached.domParser||(n.cached.domParser=new Ule(n,Ule.schemaRules(n)))}};const ibe={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},J9e={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},abe={ol:!0,ul:!0},L3=1,CG=2,F3=4;function lbe(e,n,s){return n!=null?(n?L3:0)|(n==="full"?CG:0):e&&e.whitespace=="pre"?L3|CG:s&~F3}class c6{constructor(n,s,a,c,f,p){this.type=n,this.attrs=s,this.marks=a,this.solid=c,this.options=p,this.content=[],this.activeMarks=za.none,this.match=f||(p&F3?null:n.contentMatch)}findWrapping(n){if(!this.match){if(!this.type)return[];let s=this.type.contentMatch.fillBefore(kn.from(n));if(s)this.match=this.type.contentMatch.matchFragment(s);else{let a=this.type.contentMatch,c;return(c=a.findWrapping(n.type))?(this.match=a,c):null}}return this.match.findWrapping(n.type)}finish(n){if(!(this.options&L3)){let a=this.content[this.content.length-1],c;if(a&&a.isText&&(c=/[ \t\r\n\u000c]+$/.exec(a.text))){let f=a;a.text.length==c[0].length?this.content.pop():this.content[this.content.length-1]=f.withText(f.text.slice(0,f.text.length-c[0].length))}}let s=kn.from(this.content);return!n&&this.match&&(s=s.append(this.match.fillBefore(kn.empty,!0))),this.type?this.type.create(this.attrs,s,this.marks):s}inlineContext(n){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:n.parentNode&&!ibe.hasOwnProperty(n.parentNode.nodeName.toLowerCase())}}class cbe{constructor(n,s,a){this.parser=n,this.options=s,this.isOpen=a,this.open=0,this.localPreserveWS=!1;let c=s.topNode,f,p=lbe(null,s.preserveWhitespace,0)|(a?F3:0);c?f=new c6(c.type,c.attrs,za.none,!0,s.topMatch||c.type.contentMatch,p):a?f=new c6(null,null,za.none,!0,null,p):f=new c6(n.schema.topNodeType,null,za.none,!0,null,p),this.nodes=[f],this.find=s.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(n,s){n.nodeType==3?this.addTextNode(n,s):n.nodeType==1&&this.addElement(n,s)}addTextNode(n,s){let a=n.nodeValue,c=this.top,f=c.options&CG?"full":this.localPreserveWS||(c.options&L3)>0;if(f==="full"||c.inlineContext(n)||/[^ \t\r\n\u000c]/.test(a)){if(f)f!=="full"?a=a.replace(/\r?\n|\r/g," "):a=a.replace(/\r\n?/g,`
172
172
  `);else if(a=a.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(a)&&this.open==this.nodes.length-1){let p=c.content[c.content.length-1],g=n.previousSibling;(!p||g&&g.nodeName=="BR"||p.isText&&/[ \t\r\n\u000c]$/.test(p.text))&&(a=a.slice(1))}a&&this.insertNode(this.parser.schema.text(a),s,!/\S/.test(a)),this.findInText(n)}else this.findInside(n)}addElement(n,s,a){let c=this.localPreserveWS,f=this.top;(n.tagName=="PRE"||/pre/.test(n.style&&n.style.whiteSpace))&&(this.localPreserveWS=!0);let p=n.nodeName.toLowerCase(),g;abe.hasOwnProperty(p)&&this.parser.normalizeLists&&Q9e(n);let v=this.options.ruleFromNode&&this.options.ruleFromNode(n)||(g=this.parser.matchTag(n,this,a));e:if(v?v.ignore:J9e.hasOwnProperty(p))this.findInside(n),this.ignoreFallback(n,s);else if(!v||v.skip||v.closeParent){v&&v.closeParent?this.open=Math.max(0,this.open-1):v&&v.skip.nodeType&&(n=v.skip);let C,E=this.needsBlock;if(ibe.hasOwnProperty(p))f.content.length&&f.content[0].isInline&&this.open&&(this.open--,f=this.top),C=!0,f.type||(this.needsBlock=!0);else if(!n.firstChild){this.leafFallback(n,s);break e}let O=v&&v.skip?s:this.readStyles(n,s);O&&this.addAll(n,O),C&&this.sync(f),this.needsBlock=E}else{let C=this.readStyles(n,s);C&&this.addElementByRule(n,v,C,v.consuming===!1?g:void 0)}this.localPreserveWS=c}leafFallback(n,s){n.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(n.ownerDocument.createTextNode(`
173
173
  `),s)}ignoreFallback(n,s){n.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),s,!0)}readStyles(n,s){let a=n.style;if(a&&a.length)for(let c=0;c<this.parser.matchedStyles.length;c++){let f=this.parser.matchedStyles[c],p=a.getPropertyValue(f);if(p)for(let g=void 0;;){let v=this.parser.matchStyle(f,p,this,g);if(!v)break;if(v.ignore)return null;if(v.clearMark?s=s.filter(C=>!v.clearMark(C)):s=s.concat(this.parser.schema.marks[v.mark].create(v.attrs)),v.consuming===!1)g=v;else break}}return s}addElementByRule(n,s,a,c){let f,p;if(s.node)if(p=this.parser.schema.nodes[s.node],p.isLeaf)this.insertNode(p.create(s.attrs),a,n.nodeName=="BR")||this.leafFallback(n,a);else{let v=this.enter(p,s.attrs||null,a,s.preserveWhitespace);v&&(f=!0,a=v)}else{let v=this.parser.schema.marks[s.mark];a=a.concat(v.create(s.attrs))}let g=this.top;if(p&&p.isLeaf)this.findInside(n);else if(c)this.addElement(n,a,c);else if(s.getContent)this.findInside(n),s.getContent(n,this.parser.schema).forEach(v=>this.insertNode(v,a,!1));else{let v=n;typeof s.contentElement=="string"?v=n.querySelector(s.contentElement):typeof s.contentElement=="function"?v=s.contentElement(n):s.contentElement&&(v=s.contentElement),this.findAround(n,v,!0),this.addAll(v,a),this.findAround(n,v,!1)}f&&this.sync(g)&&this.open--}addAll(n,s,a,c){let f=a||0;for(let p=a?n.childNodes[a]:n.firstChild,g=c==null?null:n.childNodes[c];p!=g;p=p.nextSibling,++f)this.findAtPoint(n,f),this.addDOM(p,s);this.findAtPoint(n,f)}findPlace(n,s,a){let c,f;for(let p=this.open,g=0;p>=0;p--){let v=this.nodes[p],C=v.findWrapping(n);if(C&&(!c||c.length>C.length+g)&&(c=C,f=v,!C.length))break;if(v.solid){if(a)break;g+=2}}if(!c)return null;this.sync(f);for(let p=0;p<c.length;p++)s=this.enterInner(c[p],null,s,!1);return s}insertNode(n,s,a){if(n.isInline&&this.needsBlock&&!this.top.type){let f=this.textblockFromContext();f&&(s=this.enterInner(f,null,s))}let c=this.findPlace(n,s,a);if(c){this.closeExtra();let f=this.top;f.match&&(f.match=f.match.matchType(n.type));let p=za.none;for(let g of c.concat(n.marks))(f.type?f.type.allowsMarkType(g.type):dbe(g.type,n.type))&&(p=g.addToSet(p));return f.content.push(n.mark(p)),!0}return!1}enter(n,s,a,c){let f=this.findPlace(n.create(s),a,!1);return f&&(f=this.enterInner(n,s,a,!0,c)),f}enterInner(n,s,a,c=!1,f){this.closeExtra();let p=this.top;p.match=p.match&&p.match.matchType(n);let g=lbe(n,f,p.options);p.options&F3&&p.content.length==0&&(g|=F3);let v=za.none;return a=a.filter(C=>(p.type?p.type.allowsMarkType(C.type):dbe(C.type,n))?(v=C.addToSet(v),!1):!0),this.nodes.push(new c6(n,s,v,c,null,g)),this.open++,a}closeExtra(n=!1){let s=this.nodes.length-1;if(s>this.open){for(;s>this.open;s--)this.nodes[s-1].content.push(this.nodes[s].finish(n));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(n){for(let s=this.open;s>=0;s--){if(this.nodes[s]==n)return this.open=s,!0;this.localPreserveWS&&(this.nodes[s].options|=L3)}return!1}get currentPos(){this.closeExtra();let n=0;for(let s=this.open;s>=0;s--){let a=this.nodes[s].content;for(let c=a.length-1;c>=0;c--)n+=a[c].nodeSize;s&&n++}return n}findAtPoint(n,s){if(this.find)for(let a=0;a<this.find.length;a++)this.find[a].node==n&&this.find[a].offset==s&&(this.find[a].pos=this.currentPos)}findInside(n){if(this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&n.nodeType==1&&n.contains(this.find[s].node)&&(this.find[s].pos=this.currentPos)}findAround(n,s,a){if(n!=s&&this.find)for(let c=0;c<this.find.length;c++)this.find[c].pos==null&&n.nodeType==1&&n.contains(this.find[c].node)&&s.compareDocumentPosition(this.find[c].node)&(a?2:4)&&(this.find[c].pos=this.currentPos)}findInText(n){if(this.find)for(let s=0;s<this.find.length;s++)this.find[s].node==n&&(this.find[s].pos=this.currentPos-(n.nodeValue.length-this.find[s].offset))}matchesContext(n){if(n.indexOf("|")>-1)return n.split(/\s*\|\s*/).some(this.matchesContext,this);let s=n.split("/"),a=this.options.context,c=!this.isOpen&&(!a||a.parent.type==this.nodes[0].type),f=-(a?a.depth+1:0)+(c?0:1),p=(g,v)=>{for(;g>=0;g--){let C=s[g];if(C==""){if(g==s.length-1||g==0)continue;for(;v>=f;v--)if(p(g-1,v))return!0;return!1}else{let E=v>0||v==0&&c?this.nodes[v].type:a&&v>=f?a.node(v-f).type:null;if(!E||E.name!=C&&!E.isInGroup(C))return!1;v--}}return!0};return p(s.length-1,this.open)}textblockFromContext(){let n=this.options.context;if(n)for(let s=n.depth;s>=0;s--){let a=n.node(s).contentMatchAt(n.indexAfter(s)).defaultType;if(a&&a.isTextblock&&a.defaultAttrs)return a}for(let s in this.parser.schema.nodes){let a=this.parser.schema.nodes[s];if(a.isTextblock&&a.defaultAttrs)return a}}}function Q9e(e){for(let n=e.firstChild,s=null;n;n=n.nextSibling){let a=n.nodeType==1?n.nodeName.toLowerCase():null;a&&abe.hasOwnProperty(a)&&s?(s.appendChild(n),n=s):a=="li"?s=n:a&&(s=null)}}function eUe(e,n){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,n)}function ube(e){let n={};for(let s in e)n[s]=e[s];return n}function dbe(e,n){let s=n.schema.nodes;for(let a in s){let c=s[a];if(!c.allowsMarkType(e))continue;let f=[],p=g=>{f.push(g);for(let v=0;v<g.edgeCount;v++){let{type:C,next:E}=g.edge(v);if(C==n||f.indexOf(E)<0&&p(E))return!0}};if(p(c.contentMatch))return!0}}class Z2{constructor(n,s){this.nodes=n,this.marks=s}serializeFragment(n,s={},a){a||(a=SG(s).createDocumentFragment());let c=a,f=[];return n.forEach(p=>{if(f.length||p.marks.length){let g=0,v=0;for(;g<f.length&&v<p.marks.length;){let C=p.marks[v];if(!this.marks[C.type.name]){v++;continue}if(!C.eq(f[g][0])||C.type.spec.spanning===!1)break;g++,v++}for(;g<f.length;)c=f.pop()[1];for(;v<p.marks.length;){let C=p.marks[v++],E=this.serializeMark(C,p.isInline,s);E&&(f.push([C,c]),c.appendChild(E.dom),c=E.contentDOM||E.dom)}}c.appendChild(this.serializeNodeInner(p,s))}),a}serializeNodeInner(n,s){let{dom:a,contentDOM:c}=u6(SG(s),this.nodes[n.type.name](n),null,n.attrs);if(c){if(n.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(n.content,s,c)}return a}serializeNode(n,s={}){let a=this.serializeNodeInner(n,s);for(let c=n.marks.length-1;c>=0;c--){let f=this.serializeMark(n.marks[c],n.isInline,s);f&&((f.contentDOM||f.dom).appendChild(a),a=f.dom)}return a}serializeMark(n,s,a={}){let c=this.marks[n.type.name];return c&&u6(SG(a),c(n,s),null,n.attrs)}static renderSpec(n,s,a=null,c){return u6(n,s,a,c)}static fromSchema(n){return n.cached.domSerializer||(n.cached.domSerializer=new Z2(this.nodesFromSchema(n),this.marksFromSchema(n)))}static nodesFromSchema(n){let s=fbe(n.nodes);return s.text||(s.text=a=>a.text),s}static marksFromSchema(n){return fbe(n.marks)}}function fbe(e){let n={};for(let s in e){let a=e[s].spec.toDOM;a&&(n[s]=a)}return n}function SG(e){return e.document||window.document}const pbe=new WeakMap;function tUe(e){let n=pbe.get(e);return n===void 0&&pbe.set(e,n=nUe(e)),n}function nUe(e){let n=null;function s(a){if(a&&typeof a=="object")if(Array.isArray(a))if(typeof a[0]=="string")n||(n=[]),n.push(a);else for(let c=0;c<a.length;c++)s(a[c]);else for(let c in a)s(a[c])}return s(e),n}function u6(e,n,s,a){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let c=n[0],f;if(typeof c!="string")throw new RangeError("Invalid array passed to renderSpec");if(a&&(f=tUe(a))&&f.indexOf(n)>-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 p=c.indexOf(" ");p>0&&(s=c.slice(0,p),c=c.slice(p+1));let g,v=s?e.createElementNS(s,c):e.createElement(c),C=n[1],E=1;if(C&&typeof C=="object"&&C.nodeType==null&&!Array.isArray(C)){E=2;for(let O in C)if(C[O]!=null){let _=O.indexOf(" ");_>0?v.setAttributeNS(O.slice(0,_),O.slice(_+1),C[O]):v.setAttribute(O,C[O])}}for(let O=E;O<n.length;O++){let _=n[O];if(_===0){if(O<n.length-1||O>E)throw new RangeError("Content hole must be the only child of its parent node");return{dom:v,contentDOM:v}}else{let{dom:D,contentDOM:M}=u6(e,_,s,a);if(v.appendChild(D),M){if(g)throw new RangeError("Multiple content holes");g=M}}}return{dom:v,contentDOM:g}}const mbe=65535,hbe=Math.pow(2,16);function oUe(e,n){return e+n*hbe}function gbe(e){return e&mbe}function sUe(e){return(e-(e&mbe))/hbe}const bbe=1,ybe=2,d6=4,vbe=8;class xG{constructor(n,s,a){this.pos=n,this.delInfo=s,this.recover=a}get deleted(){return(this.delInfo&vbe)>0}get deletedBefore(){return(this.delInfo&(bbe|d6))>0}get deletedAfter(){return(this.delInfo&(ybe|d6))>0}get deletedAcross(){return(this.delInfo&d6)>0}}class Fm{constructor(n,s=!1){if(this.ranges=n,this.inverted=s,!n.length&&Fm.empty)return Fm.empty}recover(n){let s=0,a=gbe(n);if(!this.inverted)for(let c=0;c<a;c++)s+=this.ranges[c*3+2]-this.ranges[c*3+1];return this.ranges[a*3]+s+sUe(n)}mapResult(n,s=1){return this._map(n,s,!1)}map(n,s=1){return this._map(n,s,!0)}_map(n,s,a){let c=0,f=this.inverted?2:1,p=this.inverted?1:2;for(let g=0;g<this.ranges.length;g+=3){let v=this.ranges[g]-(this.inverted?c:0);if(v>n)break;let C=this.ranges[g+f],E=this.ranges[g+p],O=v+C;if(n<=O){let _=C?n==v?-1:n==O?1:s:s,D=v+c+(_<0?0:E);if(a)return D;let M=n==(s<0?v:O)?null:oUe(g/3,n-v),R=n==v?ybe:n==O?bbe:d6;return(s<0?n!=v:n!=O)&&(R|=vbe),new xG(D,R,M)}c+=E-C}return a?n+c:new xG(n+c,0,null)}touches(n,s){let a=0,c=gbe(s),f=this.inverted?2:1,p=this.inverted?1:2;for(let g=0;g<this.ranges.length;g+=3){let v=this.ranges[g]-(this.inverted?a:0);if(v>n)break;let C=this.ranges[g+f],E=v+C;if(n<=E&&g==c*3)return!0;a+=this.ranges[g+p]-C}return!1}forEach(n){let s=this.inverted?2:1,a=this.inverted?1:2;for(let c=0,f=0;c<this.ranges.length;c+=3){let p=this.ranges[c],g=p-(this.inverted?f:0),v=p+(this.inverted?0:f),C=this.ranges[c+s],E=this.ranges[c+a];n(g,g+C,v,v+E),f+=E-C}}invert(){return new Fm(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(n){return n==0?Fm.empty:new Fm(n<0?[0,-n,0]:[0,0,n])}}Fm.empty=new Fm([]);class z3{constructor(n,s,a=0,c=n?n.length:0){this.mirror=s,this.from=a,this.to=c,this._maps=n||[],this.ownData=!(n||s)}get maps(){return this._maps}slice(n=0,s=this.maps.length){return new z3(this._maps,this.mirror,n,s)}appendMap(n,s){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(n),s!=null&&this.setMirror(this._maps.length-1,s)}appendMapping(n){for(let s=0,a=this._maps.length;s<n._maps.length;s++){let c=n.getMirror(s);this.appendMap(n._maps[s],c!=null&&c<s?a+c:void 0)}}getMirror(n){if(this.mirror){for(let s=0;s<this.mirror.length;s++)if(this.mirror[s]==n)return this.mirror[s+(s%2?-1:1)]}}setMirror(n,s){this.mirror||(this.mirror=[]),this.mirror.push(n,s)}appendMappingInverted(n){for(let s=n.maps.length-1,a=this._maps.length+n._maps.length;s>=0;s--){let c=n.getMirror(s);this.appendMap(n._maps[s].invert(),c!=null&&c>s?a-c-1:void 0)}}invert(){let n=new z3;return n.appendMappingInverted(this),n}map(n,s=1){if(this.mirror)return this._map(n,s,!0);for(let a=this.from;a<this.to;a++)n=this._maps[a].map(n,s);return n}mapResult(n,s=1){return this._map(n,s,!1)}_map(n,s,a){let c=0;for(let f=this.from;f<this.to;f++){let p=this._maps[f],g=p.mapResult(n,s);if(g.recover!=null){let v=this.getMirror(f);if(v!=null&&v>f&&v<this.to){f=v,n=this._maps[v].recover(g.recover);continue}}c|=g.delInfo,n=g.pos}return a?n:new xG(n,c,null)}}const kG=Object.create(null);class jd{getMap(){return Fm.empty}merge(n){return null}static fromJSON(n,s){if(!s||!s.stepType)throw new RangeError("Invalid input for Step.fromJSON");let a=kG[s.stepType];if(!a)throw new RangeError(`No step type ${s.stepType} defined`);return a.fromJSON(n,s)}static jsonID(n,s){if(n in kG)throw new RangeError("Duplicate use of step JSON ID "+n);return kG[n]=s,s.prototype.jsonID=n,s}}class Kc{constructor(n,s){this.doc=n,this.failed=s}static ok(n){return new Kc(n,null)}static fail(n){return new Kc(null,n)}static fromReplace(n,s,a,c){try{return Kc.ok(n.replace(s,a,c))}catch(f){if(f instanceof s6)return Kc.fail(f.message);throw f}}}function EG(e,n,s){let a=[];for(let c=0;c<e.childCount;c++){let f=e.child(c);f.content.size&&(f=f.copy(EG(f.content,n,f))),f.isInline&&(f=n(f,s,c)),a.push(f)}return kn.fromArray(a)}class Pw extends jd{constructor(n,s,a){super(),this.from=n,this.to=s,this.mark=a}apply(n){let s=n.slice(this.from,this.to),a=n.resolve(this.from),c=a.node(a.sharedDepth(this.to)),f=new lo(EG(s.content,(p,g)=>!p.isAtom||!g.type.allowsMarkType(this.mark.type)?p:p.mark(this.mark.addToSet(p.marks)),c),s.openStart,s.openEnd);return Kc.fromReplace(n,this.from,this.to,f)}invert(){return new py(this.from,this.to,this.mark)}map(n){let s=n.mapResult(this.from,1),a=n.mapResult(this.to,-1);return s.deleted&&a.deleted||s.pos>=a.pos?null:new Pw(s.pos,a.pos,this.mark)}merge(n){return n instanceof Pw&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from?new Pw(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(n,s){if(typeof s.from!="number"||typeof s.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Pw(s.from,s.to,n.markFromJSON(s.mark))}}jd.jsonID("addMark",Pw);class py extends jd{constructor(n,s,a){super(),this.from=n,this.to=s,this.mark=a}apply(n){let s=n.slice(this.from,this.to),a=new lo(EG(s.content,c=>c.mark(this.mark.removeFromSet(c.marks)),n),s.openStart,s.openEnd);return Kc.fromReplace(n,this.from,this.to,a)}invert(){return new Pw(this.from,this.to,this.mark)}map(n){let s=n.mapResult(this.from,1),a=n.mapResult(this.to,-1);return s.deleted&&a.deleted||s.pos>=a.pos?null:new py(s.pos,a.pos,this.mark)}merge(n){return n instanceof py&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from?new py(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(n,s){if(typeof s.from!="number"||typeof s.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new py(s.from,s.to,n.markFromJSON(s.mark))}}jd.jsonID("removeMark",py);class Iw extends jd{constructor(n,s){super(),this.pos=n,this.mark=s}apply(n){let s=n.nodeAt(this.pos);if(!s)return Kc.fail("No node at mark step's position");let a=s.type.create(s.attrs,null,this.mark.addToSet(s.marks));return Kc.fromReplace(n,this.pos,this.pos+1,new lo(kn.from(a),0,s.isLeaf?0:1))}invert(n){let s=n.nodeAt(this.pos);if(s){let a=this.mark.addToSet(s.marks);if(a.length==s.marks.length){for(let c=0;c<s.marks.length;c++)if(!s.marks[c].isInSet(a))return new Iw(this.pos,s.marks[c]);return new Iw(this.pos,this.mark)}}return new G2(this.pos,this.mark)}map(n){let s=n.mapResult(this.pos,1);return s.deletedAfter?null:new Iw(s.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(n,s){if(typeof s.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Iw(s.pos,n.markFromJSON(s.mark))}}jd.jsonID("addNodeMark",Iw);class G2 extends jd{constructor(n,s){super(),this.pos=n,this.mark=s}apply(n){let s=n.nodeAt(this.pos);if(!s)return Kc.fail("No node at mark step's position");let a=s.type.create(s.attrs,null,this.mark.removeFromSet(s.marks));return Kc.fromReplace(n,this.pos,this.pos+1,new lo(kn.from(a),0,s.isLeaf?0:1))}invert(n){let s=n.nodeAt(this.pos);return!s||!this.mark.isInSet(s.marks)?this:new Iw(this.pos,this.mark)}map(n){let s=n.mapResult(this.pos,1);return s.deletedAfter?null:new G2(s.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(n,s){if(typeof s.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new G2(s.pos,n.markFromJSON(s.mark))}}jd.jsonID("removeNodeMark",G2);class Fu extends jd{constructor(n,s,a,c=!1){super(),this.from=n,this.to=s,this.slice=a,this.structure=c}apply(n){return this.structure&&TG(n,this.from,this.to)?Kc.fail("Structure replace would overwrite content"):Kc.fromReplace(n,this.from,this.to,this.slice)}getMap(){return new Fm([this.from,this.to-this.from,this.slice.size])}invert(n){return new Fu(this.from,this.from+this.slice.size,n.slice(this.from,this.to))}map(n){let s=n.mapResult(this.from,1),a=n.mapResult(this.to,-1);return s.deletedAcross&&a.deletedAcross?null:new Fu(s.pos,Math.max(s.pos,a.pos),this.slice,this.structure)}merge(n){if(!(n instanceof Fu)||n.structure||this.structure)return null;if(this.from+this.slice.size==n.from&&!this.slice.openEnd&&!n.slice.openStart){let s=this.slice.size+n.slice.size==0?lo.empty:new lo(this.slice.content.append(n.slice.content),this.slice.openStart,n.slice.openEnd);return new Fu(this.from,this.to+(n.to-n.from),s,this.structure)}else if(n.to==this.from&&!this.slice.openStart&&!n.slice.openEnd){let s=this.slice.size+n.slice.size==0?lo.empty:new lo(n.slice.content.append(this.slice.content),n.slice.openStart,this.slice.openEnd);return new Fu(n.from,this.to,s,this.structure)}else return null}toJSON(){let n={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n}static fromJSON(n,s){if(typeof s.from!="number"||typeof s.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Fu(s.from,s.to,lo.fromJSON(n,s.slice),!!s.structure)}}jd.jsonID("replace",Fu);class zu extends jd{constructor(n,s,a,c,f,p,g=!1){super(),this.from=n,this.to=s,this.gapFrom=a,this.gapTo=c,this.slice=f,this.insert=p,this.structure=g}apply(n){if(this.structure&&(TG(n,this.from,this.gapFrom)||TG(n,this.gapTo,this.to)))return Kc.fail("Structure gap-replace would overwrite content");let s=n.slice(this.gapFrom,this.gapTo);if(s.openStart||s.openEnd)return Kc.fail("Gap is not a flat range");let a=this.slice.insertAt(this.insert,s.content);return a?Kc.fromReplace(n,this.from,this.to,a):Kc.fail("Content does not fit in gap")}getMap(){return new Fm([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(n){let s=this.gapTo-this.gapFrom;return new zu(this.from,this.from+this.slice.size+s,this.from+this.insert,this.from+this.insert+s,n.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(n){let s=n.mapResult(this.from,1),a=n.mapResult(this.to,-1),c=this.from==this.gapFrom?s.pos:n.map(this.gapFrom,-1),f=this.to==this.gapTo?a.pos:n.map(this.gapTo,1);return s.deletedAcross&&a.deletedAcross||c<s.pos||f>a.pos?null:new zu(s.pos,a.pos,c,f,this.slice,this.insert,this.structure)}toJSON(){let n={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n}static fromJSON(n,s){if(typeof s.from!="number"||typeof s.to!="number"||typeof s.gapFrom!="number"||typeof s.gapTo!="number"||typeof s.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new zu(s.from,s.to,s.gapFrom,s.gapTo,lo.fromJSON(n,s.slice),s.insert,!!s.structure)}}jd.jsonID("replaceAround",zu);function TG(e,n,s){let a=e.resolve(n),c=s-n,f=a.depth;for(;c>0&&f>0&&a.indexAfter(f)==a.node(f).childCount;)f--,c--;if(c>0){let p=a.node(f).maybeChild(a.indexAfter(f));for(;c>0;){if(!p||p.isLeaf)return!0;p=p.firstChild,c--}}return!1}function rUe(e,n,s,a){let c=[],f=[],p,g;e.doc.nodesBetween(n,s,(v,C,E)=>{if(!v.isInline)return;let O=v.marks;if(!a.isInSet(O)&&E.type.allowsMarkType(a.type)){let _=Math.max(C,n),D=Math.min(C+v.nodeSize,s),M=a.addToSet(O);for(let R=0;R<O.length;R++)O[R].isInSet(M)||(p&&p.to==_&&p.mark.eq(O[R])?p.to=D:c.push(p=new py(_,D,O[R])));g&&g.to==_?g.to=D:f.push(g=new Pw(_,D,a))}}),c.forEach(v=>e.step(v)),f.forEach(v=>e.step(v))}function iUe(e,n,s,a){let c=[],f=0;e.doc.nodesBetween(n,s,(p,g)=>{if(!p.isInline)return;f++;let v=null;if(a instanceof l6){let C=p.marks,E;for(;E=a.isInSet(C);)(v||(v=[])).push(E),C=E.removeFromSet(C)}else a?a.isInSet(p.marks)&&(v=[a]):v=p.marks;if(v&&v.length){let C=Math.min(g+p.nodeSize,s);for(let E=0;E<v.length;E++){let O=v[E],_;for(let D=0;D<c.length;D++){let M=c[D];M.step==f-1&&O.eq(c[D].style)&&(_=M)}_?(_.to=C,_.step=f):c.push({style:O,from:Math.max(g,n),to:C,step:f})}}}),c.forEach(p=>e.step(new py(p.from,p.to,p.style)))}function OG(e,n,s,a=s.contentMatch,c=!0){let f=e.doc.nodeAt(n),p=[],g=n+1;for(let v=0;v<f.childCount;v++){let C=f.child(v),E=g+C.nodeSize,O=a.matchType(C.type);if(!O)p.push(new Fu(g,E,lo.empty));else{a=O;for(let _=0;_<C.marks.length;_++)s.allowsMarkType(C.marks[_].type)||e.step(new py(g,E,C.marks[_]));if(c&&C.isText&&s.whitespace!="pre"){let _,D=/\r?\n|\r/g,M;for(;_=D.exec(C.text);)M||(M=new lo(kn.from(s.schema.text(" ",s.allowedMarks(C.marks))),0,0)),p.push(new Fu(g+_.index,g+_.index+_[0].length,M))}}g=E}if(!a.validEnd){let v=a.fillBefore(kn.empty,!0);e.replace(g,g,new lo(v,0,0))}for(let v=p.length-1;v>=0;v--)e.step(p[v])}function aUe(e,n,s){return(n==0||e.canReplace(n,e.childCount))&&(s==e.childCount||e.canReplace(0,s))}function SO(e){let s=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let a=e.depth;;--a){let c=e.$from.node(a),f=e.$from.index(a),p=e.$to.indexAfter(a);if(a<e.depth&&c.canReplace(f,p,s))return a;if(a==0||c.type.spec.isolating||!aUe(c,f,p))break}return null}function lUe(e,n,s){let{$from:a,$to:c,depth:f}=n,p=a.before(f+1),g=c.after(f+1),v=p,C=g,E=kn.empty,O=0;for(let M=f,R=!1;M>s;M--)R||a.index(M)>0?(R=!0,E=kn.from(a.node(M).copy(E)),O++):v--;let _=kn.empty,D=0;for(let M=f,R=!1;M>s;M--)R||c.after(M+1)<c.end(M)?(R=!0,_=kn.from(c.node(M).copy(_)),D++):C++;e.step(new zu(v,C,p,g,new lo(E.append(_),O,D),E.size-O,!0))}function NG(e,n,s=null,a=e){let c=cUe(e,n),f=c&&uUe(a,n);return f?c.map(wbe).concat({type:n,attrs:s}).concat(f.map(wbe)):null}function wbe(e){return{type:e,attrs:null}}function cUe(e,n){let{parent:s,startIndex:a,endIndex:c}=e,f=s.contentMatchAt(a).findWrapping(n);if(!f)return null;let p=f.length?f[0]:n;return s.canReplaceWith(a,c,p)?f:null}function uUe(e,n){let{parent:s,startIndex:a,endIndex:c}=e,f=s.child(a),p=n.contentMatch.findWrapping(f.type);if(!p)return null;let v=(p.length?p[p.length-1]:n).contentMatch;for(let C=a;v&&C<c;C++)v=v.matchType(s.child(C).type);return!v||!v.validEnd?null:p}function dUe(e,n,s){let a=kn.empty;for(let p=s.length-1;p>=0;p--){if(a.size){let g=s[p].type.contentMatch.matchFragment(a);if(!g||!g.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}a=kn.from(s[p].type.create(s[p].attrs,a))}let c=n.start,f=n.end;e.step(new zu(c,f,c,f,new lo(a,0,0),s.length,!0))}function fUe(e,n,s,a,c){if(!a.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let f=e.steps.length;e.doc.nodesBetween(n,s,(p,g)=>{let v=typeof c=="function"?c(p):c;if(p.isTextblock&&!p.hasMarkup(a,v)&&pUe(e.doc,e.mapping.slice(f).map(g),a)){let C=null;if(a.schema.linebreakReplacement){let D=a.whitespace=="pre",M=!!a.contentMatch.matchType(a.schema.linebreakReplacement);D&&!M?C=!1:!D&&M&&(C=!0)}C===!1&&Sbe(e,p,g,f),OG(e,e.mapping.slice(f).map(g,1),a,void 0,C===null);let E=e.mapping.slice(f),O=E.map(g,1),_=E.map(g+p.nodeSize,1);return e.step(new zu(O,_,O+1,_-1,new lo(kn.from(a.create(v,null,p.marks)),0,0),1,!0)),C===!0&&Cbe(e,p,g,f),!1}})}function Cbe(e,n,s,a){n.forEach((c,f)=>{if(c.isText){let p,g=/\r?\n|\r/g;for(;p=g.exec(c.text);){let v=e.mapping.slice(a).map(s+1+f+p.index);e.replaceWith(v,v+1,n.type.schema.linebreakReplacement.create())}}})}function Sbe(e,n,s,a){n.forEach((c,f)=>{if(c.type==c.type.schema.linebreakReplacement){let p=e.mapping.slice(a).map(s+1+f);e.replaceWith(p,p+1,n.type.schema.text(`
package/package.json CHANGED
@@ -1,107 +1,25 @@
1
- {
2
- "name": "hongshu-view",
3
- "private": false,
4
- "version": "1.0.24",
5
- "license": "MIT",
6
- "author": {
7
- "name": "csdn"
8
- },
9
- "main": "./lib/dist/hongshu-view.umd.js",
10
- "module": "./lib/dist/hongshu-view.mjs",
11
- "types": "./lib/index.d.ts",
12
- "scripts": {
13
- "dev": "vite --config vite.config.js",
14
- "build": "npm run build:clean && npm run build:prod && npm run build:style",
15
- "build:prod": "tsx scripts/build-js.js",
16
- "preview": "vite preview",
17
- "build:clean": "rimraf lib",
18
- "build:style": "gulp --gulpfile scripts/build-style.cjs",
19
- "publish:pre": "tsx scripts/publish-pre.ts",
20
- "publish:push": "tsx scripts/publish.ts",
21
- "publish": "npm run publish:pre && npm run publish:push"
22
- },
23
- "dependencies": {
24
- "@tinymce/tinymce-vue": "^5.1.0",
25
- "@tiptap/core": "^2.10.3",
26
- "@tiptap/extension-bold": "^2.10.3",
27
- "@tiptap/extension-bubble-menu": "^2.10.3",
28
- "@tiptap/extension-bullet-list": "^2.10.3",
29
- "@tiptap/extension-character-count": "^2.10.3",
30
- "@tiptap/extension-code": "^2.10.3",
31
- "@tiptap/extension-code-block": "^2.10.3",
32
- "@tiptap/extension-color": "^2.10.3",
33
- "@tiptap/extension-document": "^2.10.3",
34
- "@tiptap/extension-dropcursor": "^2.10.3",
35
- "@tiptap/extension-gapcursor": "^2.10.3",
36
- "@tiptap/extension-hard-break": "^2.10.3",
37
- "@tiptap/extension-heading": "^2.10.3",
38
- "@tiptap/extension-highlight": "^2.10.3",
39
- "@tiptap/extension-history": "^2.10.3",
40
- "@tiptap/extension-horizontal-rule": "^2.10.3",
41
- "@tiptap/extension-image": "^2.10.3",
42
- "@tiptap/extension-italic": "^2.10.3",
43
- "@tiptap/extension-link": "^2.10.3",
44
- "@tiptap/extension-list-item": "^2.10.3",
45
- "@tiptap/extension-mention": "^2.10.3",
46
- "@tiptap/extension-ordered-list": "^2.10.3",
47
- "@tiptap/extension-paragraph": "^2.10.3",
48
- "@tiptap/extension-placeholder": "^2.10.3",
49
- "@tiptap/extension-strike": "^2.10.3",
50
- "@tiptap/extension-table": "^2.10.3",
51
- "@tiptap/extension-table-cell": "^2.10.3",
52
- "@tiptap/extension-table-header": "^2.10.3",
53
- "@tiptap/extension-table-row": "^2.10.3",
54
- "@tiptap/extension-task-item": "^2.10.3",
55
- "@tiptap/extension-task-list": "^2.10.3",
56
- "@tiptap/extension-text": "^2.10.3",
57
- "@tiptap/extension-text-align": "^2.10.3",
58
- "@tiptap/extension-text-style": "^2.10.3",
59
- "@tiptap/extension-underline": "^2.10.3",
60
- "@tiptap/pm": "^2.10.3",
61
- "@tiptap/starter-kit": "^2.10.3",
62
- "@tiptap/vue-3": "^2.10.3",
63
- "@venegrad/vue3-click-outside": "^1.0.1",
64
- "@vueuse/core": "^10.1.2",
65
- "axios": "^1.3.3",
66
- "element-plus": "^2.13.0",
67
- "gulp-path-alias": "^1.2.1",
68
- "gulp-style-aliases": "^1.1.11",
69
- "mitt": "^3.0.1",
70
- "qs": "^6.11.0",
71
- "tinymce": "^6.6.0",
72
- "tiptap-extension-font-size": "^1.2.0",
73
- "tiptap-extension-resize-image": "^1.2.1",
74
- "v-viewer": "^3.0.11",
75
- "vue": "^3.2.45",
76
- "vue-cropper": "^1.1.1",
77
- "vue-router": "^4.1.6",
78
- "vue-spinner": "^1.0.4"
79
- },
80
- "devDependencies": {
81
- "@types/node": "^18.13.0",
82
- "@vitejs/plugin-legacy": "^3.0.1",
83
- "@vitejs/plugin-vue": "^4.0.0",
84
- "@vitejs/plugin-vue-jsx": "^3.0.1",
85
- "chalk": "^5.2.0",
86
- "consola": "^2.15.3",
87
- "fs-extra": "^11.1.0",
88
- "gulp": "^4.0.2",
89
- "gulp-autoprefixer": "^8.0.0",
90
- "gulp-clean-css": "^4.3.0",
91
- "gulp-less": "^5.0.0",
92
- "gulp-rename": "^2.0.0",
93
- "less": "^4.1.3",
94
- "pinia": "^2.0.32",
95
- "rimraf": "^3.0.2",
96
- "terser": "^5.16.1",
97
- "ts-node": "^10.9.1",
98
- "tslib": "^2.5.0",
99
- "tsx": "^3.14.0",
100
- "typescript": "^4.9.5",
101
- "unplugin-auto-import": "^0.15.0",
102
- "unplugin-vue-components": "^0.24.0",
103
- "vite": "^4.0.0",
104
- "vite-plugin-html": "^3.2.0",
105
- "vite-plugin-vue-setup-extend": "^0.4.0"
106
- }
1
+ {
2
+ "name": "hongshu-view",
3
+ "private": false,
4
+ "version": "1.0.26",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "csdn"
8
+ },
9
+ "description": "鸿书组件库",
10
+ "main": "dist/hongshu-view.umd.js",
11
+ "module": "dist/hongshu-view.mjs",
12
+ "types": "index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "require": "./dist/hongshu-view.umd.js",
16
+ "import": "./dist/hongshu-view.mjs"
17
+ },
18
+ "./*": "./*"
19
+ },
20
+ "peerDependencies": {
21
+ "element-plus": "^2.2.27",
22
+ "vue": "^3.2.45"
23
+ },
24
+ "devDependencies": {}
107
25
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 csdn
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/auto-imports.d.ts DELETED
@@ -1,9 +0,0 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- // @ts-nocheck
4
- // Generated by unplugin-auto-import
5
- export {}
6
- declare global {
7
- const ElMessage: typeof import('element-plus/es')['ElMessage']
8
- const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
9
- }
package/components.d.ts DELETED
@@ -1,44 +0,0 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- // @ts-nocheck
4
- // Generated by unplugin-vue-components
5
- // Read more: https://github.com/vuejs/core/pull/3399
6
- import '@vue/runtime-core'
7
-
8
- export {}
9
-
10
- declare module '@vue/runtime-core' {
11
- export interface GlobalComponents {
12
- ElBadge: typeof import('element-plus/es')['ElBadge']
13
- ElButton: typeof import('element-plus/es')['ElButton']
14
- ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
15
- ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
16
- ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
17
- ElDialog: typeof import('element-plus/es')['ElDialog']
18
- ElDropdown: typeof import('element-plus/es')['ElDropdown']
19
- ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
20
- ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
21
- ElForm: typeof import('element-plus/es')['ElForm']
22
- ElFormItem: typeof import('element-plus/es')['ElFormItem']
23
- ElImage: typeof import('element-plus/es')['ElImage']
24
- ElInput: typeof import('element-plus/es')['ElInput']
25
- ElMenu: typeof import('element-plus/es')['ElMenu']
26
- ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
27
- ElOption: typeof import('element-plus/es')['ElOption']
28
- ElPagination: typeof import('element-plus/es')['ElPagination']
29
- ElPopover: typeof import('element-plus/es')['ElPopover']
30
- ElRadio: typeof import('element-plus/es')['ElRadio']
31
- ElSelect: typeof import('element-plus/es')['ElSelect']
32
- ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
33
- ElTable: typeof import('element-plus/es')['ElTable']
34
- ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
35
- ElTabPane: typeof import('element-plus/es')['ElTabPane']
36
- ElTabs: typeof import('element-plus/es')['ElTabs']
37
- ElTag: typeof import('element-plus/es')['ElTag']
38
- ElTooltip: typeof import('element-plus/es')['ElTooltip']
39
- ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
40
- ElUpload: typeof import('element-plus/es')['ElUpload']
41
- RouterLink: typeof import('vue-router')['RouterLink']
42
- RouterView: typeof import('vue-router')['RouterView']
43
- }
44
- }
@@ -1,8 +0,0 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- // @ts-nocheck
4
- // Generated by unplugin-auto-import
5
- export {}
6
- declare global {
7
-
8
- }
@@ -1,15 +0,0 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- // @ts-nocheck
4
- // Generated by unplugin-vue-components
5
- // Read more: https://github.com/vuejs/core/pull/3399
6
- import '@vue/runtime-core'
7
-
8
- export {}
9
-
10
- declare module '@vue/runtime-core' {
11
- export interface GlobalComponents {
12
- RouterLink: typeof import('vue-router')['RouterLink']
13
- RouterView: typeof import('vue-router')['RouterView']
14
- }
15
- }
package/lib/README.md DELETED
@@ -1,92 +0,0 @@
1
- ## hongshu-view
2
- 城市大脑鸿书产品web端业务组件库
3
-
4
- ### 1.0.24
5
- 1.修改Photo组件,添加function
6
- 2026年4月13日15:35:00
7
-
8
- ### 1.0.23
9
- 1.修改el-message的定位问题
10
- 2026年1月14日11:27:00
11
-
12
- ### 1.0.22
13
- 1.修改el-message的定位问题
14
- 2026年1月13日11:27:00
15
-
16
-
17
-
18
- ### 1.0.21
19
- 1.修改token失效后跳转登录页会带有引号的问题
20
- 2026年1月13日10:27:00
21
-
22
- ### 1.0.20
23
- 1.分页添加直接跳转页码的功能
24
- 2025年12月17日10:45:00
25
-
26
- ### 1.0.17
27
- 1.处理刷新token失败回到登录
28
- 2025年10月30日10:40:00
29
-
30
- ### 1.0.14
31
- 1.修改图标
32
- 2025年7月10日16:01:00
33
-
34
- ### 1.0.14
35
- 1.增加了跳转到帮助
36
- 2025年7月10日14:45:00
37
-
38
- ### 1.0.13
39
- 1.增加了跳转到我的文件(正确地址)
40
- 2025年6月20日09:53:25
41
-
42
- ### 1.0.12
43
- 1.增加了跳转到我的文件
44
- 2025年6月6日17:03:09
45
-
46
- ### 1.0.11
47
- 文档交接时测试用过,注意:版本号相同发布会失败
48
-
49
- ### 1.0.10
50
- 1.强化了2个小时不使用过期
51
- 2.修复了ElMessage不是暗黑系的bug
52
- 2025年5月27日16:37:03
53
- ### 1.0.9
54
- 1.修复了AppBlock应用名过长溢出的问题
55
- 2025年4月14日14:54:56
56
-
57
- ### 1.0.8
58
- 1.修复了Avatar组件在trigger=hover模式下选择图片重复选择的问题
59
- 2025年1月23日10:44:39
60
-
61
- ### 1.0.6
62
- 1.增加了 ZyEditor
63
- 2024年12月11日13:45:23
64
- ### 1.0.4
65
- 1.修复Message在设置plain:true的时候字体颜色为白色
66
- 2.修复SuccessAjax中SuccssMsg层级低,被弹窗遮挡的的问题,z-index设置为1992110601
67
- 2024年11月26日17:20:54
68
-
69
- ### 1.0.3
70
- 1.修复非全屏状态下header没有两面边距
71
- 2024年11月19日19:20:35
72
-
73
-
74
- ### 1.0.2
75
- 1.把默认全屏改回了非全屏。佩服产品
76
- 2.更新AppBlock组件获取应用名的方法
77
- 2024年11月19日17:14:23
78
-
79
- ### 1.0.1
80
- 配合新版cimos5使用暗黑风格
81
-
82
- ### .0.6.25
83
- 1.适配物业系统,当没有BaseAppLayout没有 header slot,不渲染head区域
84
- #### 0.6.24
85
- 1.给Avatar添加 trigger prop,可以为hover,trigger
86
-
87
- #### 0.6.23
88
- 1.给他UserSelectDialog添加mainKey prop,可以自定义主键
89
-
90
-
91
-
92
-
package/lib/package.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "name": "hongshu-view",
3
- "private": false,
4
- "version": "1.0.24",
5
- "license": "MIT",
6
- "author": {
7
- "name": "csdn"
8
- },
9
- "description": "鸿书组件库",
10
- "main": "dist/hongshu-view.umd.js",
11
- "module": "dist/hongshu-view.mjs",
12
- "types": "index.d.ts",
13
- "exports": {
14
- ".": {
15
- "require": "./dist/hongshu-view.umd.js",
16
- "import": "./dist/hongshu-view.mjs"
17
- },
18
- "./*": "./*"
19
- },
20
- "peerDependencies": {
21
- "element-plus": "^2.2.27",
22
- "vue": "^3.2.45"
23
- },
24
- "devDependencies": {}
25
- }
@@ -1,80 +0,0 @@
1
- import { defineConfig, build } from 'vite'
2
- import vue from '@vitejs/plugin-vue';
3
- import { resolve } from "path";
4
- import vueSetupExtend from 'vite-plugin-vue-setup-extend';
5
-
6
- import AutoImport from 'unplugin-auto-import/vite'
7
- import Components from 'unplugin-vue-components/vite'
8
- import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
9
- import vueJsx from '@vitejs/plugin-vue-jsx'
10
-
11
- import { fileURLToPath } from 'url';
12
- import { dirname } from 'path';
13
- const __filename = fileURLToPath(import.meta.url);
14
- const __dirname = dirname(__filename);
15
-
16
-
17
- const DIST_PATH = resolve(__dirname, "../lib/dist");
18
-
19
- const rollupOptions = {
20
- context: 'globalThis',
21
- preserveEntrySignatures: 'strict',
22
- external: ['vue'],
23
- output: {
24
-
25
- sourcemap: false,
26
-
27
- globals: { vue: 'Vue' }
28
- }
29
- }
30
-
31
- const baseConfig = {
32
- configFile: false,
33
- publicDir: false,
34
- plugins: [vue(), vueSetupExtend(),
35
- AutoImport({
36
- resolvers: [ElementPlusResolver()],
37
- }),
38
- Components({
39
- resolvers: [ElementPlusResolver()],
40
- }),
41
- vueJsx({
42
- // options are passed on to @vue/babel-plugin-jsx
43
- }),
44
- ],
45
- build: {
46
- target:["es2015",'edge88', 'firefox78', 'chrome87', 'safari14'],
47
- cssCodeSplit:false,
48
- outDir: DIST_PATH,
49
- lib: {
50
- entry: resolve(__dirname, "../packages/index.ts"),
51
- name: "hongshuView",
52
- fileName: "hongshu-view",
53
- formats: ['es', 'umd'],
54
-
55
-
56
- },
57
- rollupOptions,
58
- },
59
-
60
- resolve: {
61
- alias: {
62
- "~": resolve(__dirname, "../packages"),
63
- "~tools": resolve(__dirname, "../packages/tools"),
64
- "~utils": resolve(__dirname, "../packages/utils"),
65
- "~locale": resolve(__dirname, "../packages/locale"),
66
- },
67
- extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
68
- }
69
- }
70
-
71
-
72
- async function doBuild() {
73
-
74
- await build(defineConfig({
75
- ...baseConfig
76
- }))
77
-
78
- }
79
-
80
- doBuild();
@@ -1,35 +0,0 @@
1
- const gulp = require('gulp');
2
- const cleanCSS = require('gulp-clean-css');
3
- const less = require('gulp-less');
4
- const rename = require('gulp-rename');
5
- const autoprefixer = require('gulp-autoprefixer');
6
-
7
-
8
- // 编译less
9
- gulp.task('css', function () {
10
- return gulp
11
-
12
- .src('../packages/styles/index.less')
13
-
14
- .pipe(less({
15
- javascriptEnabled: true,
16
-
17
- }))
18
- .pipe(
19
- autoprefixer({
20
- overrideBrowserslist: ['last 2 versions', 'ie > 8']
21
- })
22
- )
23
- .pipe(cleanCSS())
24
- .pipe(rename('hongshu.css'))
25
- .pipe(gulp.dest('../lib/styles'));
26
- });
27
-
28
- // 拷贝字体文件
29
- gulp.task('fonts', function () {
30
- return gulp.src('../packages/styles/iconfont/fonts/*.*')
31
- .pipe(gulp.dest('../lib/styles/fonts'));
32
- });
33
-
34
- gulp.task('default', gulp.parallel('css', 'fonts'));
35
-
@@ -1,44 +0,0 @@
1
- import { cp, readFile, writeFile,copyFile } from "node:fs/promises";
2
- import { resolve } from "path";
3
-
4
-
5
- //将要发布的属性文件复制到lib
6
- async function copyDirectory() {
7
- let sourcePath = resolve(process.cwd(), "packages/hongshu-view");
8
- let targetPath = resolve(process.cwd(), "lib");
9
-
10
- await cp(sourcePath, targetPath, { force: true, recursive: true })
11
-
12
- }
13
-
14
- async function updateVersion() {
15
- let mainPkBuf = await readFile(resolve(process.cwd(), "package.json"), {
16
- encoding: "utf-8"
17
- })
18
- let mainPk = JSON.parse(mainPkBuf);
19
- let publishPkBuf = await readFile(resolve(process.cwd(), "packages/hongshu-view/package.json"), {
20
- encoding: "utf8"
21
- });
22
- let publishPk = JSON.parse(publishPkBuf);
23
- publishPk.version = mainPk.version;
24
- await writeFile(resolve(process.cwd(), "lib/package.json"), JSON.stringify(publishPk, null, 4))
25
-
26
- }
27
-
28
- async function copyREADME() {
29
- let sourcePath = resolve(process.cwd(), "README.md");
30
- let targetPath = resolve(process.cwd(), "lib/README.md");
31
- await copyFile(sourcePath,targetPath);
32
-
33
- }
34
-
35
-
36
-
37
- async function main() {
38
- await copyDirectory();
39
- await copyREADME();
40
- await updateVersion()
41
-
42
- }
43
-
44
- main();
@@ -1,17 +0,0 @@
1
- import { execSync } from "child_process";
2
- import { resolve } from "path";
3
-
4
-
5
-
6
- async function publish() {
7
- let subprocess = execSync("npm publish", {
8
- cwd: resolve(__dirname, "../lib"),
9
- stdio: [0, 1, 2]
10
- })
11
-
12
- }
13
-
14
-
15
- publish()
16
-
17
- // console.log(process.env)
package/vite.config.js DELETED
@@ -1,50 +0,0 @@
1
- import { defineConfig } from 'vite'
2
- import vue from '@vitejs/plugin-vue';
3
- import { resolve } from "path";
4
- import { createHtmlPlugin } from 'vite-plugin-html';
5
-
6
- import vueSetupExtend from 'vite-plugin-vue-setup-extend';
7
-
8
- import AutoImport from 'unplugin-auto-import/vite'
9
- import Components from 'unplugin-vue-components/vite'
10
- import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
11
- import vueJsx from '@vitejs/plugin-vue-jsx'
12
-
13
-
14
- // https://vitejs.dev/config/
15
- export default defineConfig({
16
-
17
- plugins: [
18
- vue(),
19
- vueSetupExtend(),
20
- createHtmlPlugin({
21
- entry: resolve(__dirname, "public/index.html")
22
- }),
23
- AutoImport({
24
- resolvers: [ElementPlusResolver()],
25
- }),
26
- Components({
27
- resolvers: [ElementPlusResolver()],
28
- }),
29
- vueJsx({
30
- // options are passed on to @vue/babel-plugin-jsx
31
- }),
32
- ],
33
-
34
- build:{
35
- sourcemap:true,
36
- },
37
-
38
- server: {
39
- port: 3001
40
- },
41
- resolve: {
42
- alias: {
43
- "~": resolve(__dirname, "packages"),
44
- "~tools": resolve(__dirname, "packages/tools"),
45
- "~utils": resolve(__dirname, "packages/utils"),
46
- "~locale": resolve(__dirname, "packages/locale"),
47
- },
48
- extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
49
- }
50
- })
File without changes
File without changes
File without changes
File without changes
File without changes