ablok-components 0.1.103 → 0.1.104
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.
|
@@ -260,17 +260,17 @@ const VG = /* @__PURE__ */ CS(yS, [["render", QS]]), ES = ["type", "disabled"],
|
|
|
260
260
|
"x-small": t.size === "x-small"
|
|
261
261
|
}])
|
|
262
262
|
}, [
|
|
263
|
+
t.pending ? ae(n.$slots, "pending-icon", { key: 0 }, () => [
|
|
264
|
+
zA(i)
|
|
265
|
+
]) : ce("", !0),
|
|
263
266
|
ae(n.$slots, "default", {}, () => [
|
|
264
|
-
t.pending ? ae(n.$slots, "pending-icon", { key: 0 }, () => [
|
|
265
|
-
zA(i, { class: "h-100" })
|
|
266
|
-
]) : ce("", !0),
|
|
267
267
|
t.icon ? (Z(), Ul(s, {
|
|
268
|
-
key:
|
|
268
|
+
key: 0,
|
|
269
269
|
symbol: t.icon,
|
|
270
270
|
class: "base-button__caption"
|
|
271
271
|
}, null, 8, ["symbol"])) : ce("", !0),
|
|
272
272
|
e.value ? (Z(), tA("span", {
|
|
273
|
-
key:
|
|
273
|
+
key: 1,
|
|
274
274
|
class: bA(["base-button__caption", { "icon-padding": t.icon }])
|
|
275
275
|
}, Qe(t.caption), 3)) : ce("", !0)
|
|
276
276
|
])
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(DA,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue"),require("@popperjs/core")):typeof define=="function"&&define.amd?define(["exports","vue","@popperjs/core"],p):(DA=typeof globalThis<"u"?globalThis:DA||self,p(DA.AblokComponents={},DA.Vue,DA.core))})(this,function(DA,p,sh){"use strict";const qy={class:"icon",preserveAspectRatio:"xMaxYMin"},Zy=["xlink:href"],jy=p.defineComponent({__name:"svg-icon",props:{basePath:{type:String,default:"/symbol-defs.svg"},prefix:{type:String,default:"icon-"},symbol:{type:String,default:""},size:{type:String,default:"default"}},setup(t){return(A,e)=>(p.openBlock(),p.createElementBlock("i",{class:p.normalizeClass(["svg-icon",{[`svg-icon--${t.size}`]:t.size}])},[(p.openBlock(),p.createElementBlock("svg",qy,[p.createElementVNode("use",{"xlink:href":`${t.basePath}#${t.prefix}${t.symbol}`,"xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0",y:"0"},null,8,Zy)]))],2))}}),oG="",AE={class:"loading-spinner d-block"},eE=p.createElementVNode("span",{class:"loading-spinner__animation"},[p.createElementVNode("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100"},[p.createElementVNode("path",{d:"M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50"},[p.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",dur:"1s",from:"0 50 50",to:"360 50 50",repeatCount:"indefinite"})])])],-1),tE=p.defineComponent({__name:"loading-spinner",props:{color:{type:String,default:"#fff"}},setup(t){return(A,e)=>(p.openBlock(),p.createElementBlock("span",AE,[eE,p.renderSlot(A.$slots,"default")]))}}),aG="",nE=p.defineComponent({__name:"base-headline",props:{tag:{},size:{},variant:{},text:{},className:{}},setup(t){const A=t,e=p.computed(()=>A.tag||"p");return(n,r)=>(p.openBlock(),p.createBlock(p.resolveDynamicComponent(e.value),{class:p.normalizeClass(["headline",`${n.size} headline--${n.size}${n.className||""}`])},{default:p.withCtx(()=>[p.renderSlot(n.$slots,"default",{},()=>[p.createTextVNode(p.toDisplayString(n.text),1)])]),_:3},8,["class"]))}}),rE=["innerHTML"],iE=p.defineComponent({__name:"base-paragraph",props:{size:{},variant:{},text:{},className:{}},setup(t){return(A,e)=>(p.openBlock(),p.createElementBlock("p",{class:p.normalizeClass(["base-paragraph",`${A.size||""} ${A.className||""}`]),innerHTML:A.text},null,10,rE))}});function Qe(){return(new Date().valueOf()+Math.random()).toString(36).replace(".","")}const sE={class:"accordion-item"},oE=["id"],aE=["data-bs-target","aria-controls"],lE={class:"flex-grow-1"},cE=["id","aria-labelledby","data-bs-parent"],uE={class:"accordion-body"},fE=["innerHTML"],dE=p.defineComponent({__name:"accordion-item",props:{id:{type:String,default:()=>Qe()},modelValue:{type:Boolean,default:!1},title:{type:String,default:"Accordion Title"},body:{type:String,default:"<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nisi aut, nobis inventore repudiandae quo laboriosam. Dicta placeat ullam harum optio expedita. Harum fugiat suscipit sapiente quos, molestias neque eaque omnis?</p>"},parent:{type:String,default:""}},emits:["update:modelValue"],setup(t,{emit:A}){const e=t,n=A;function r(){n("update:modelValue",!e.modelValue)}return(i,s)=>(p.openBlock(),p.createElementBlock("div",sE,[p.createElementVNode("div",{class:"accordion-header",id:`heading${t.id}`},[p.createElementVNode("button",{class:p.normalizeClass(["accordion-button",!t.modelValue&&"collapsed"]),type:"button","data-bs-toggle":"collapse","data-bs-target":`#target${t.id}`,"aria-expanded":"true","aria-controls":`target${t.id}`,onClick:r},[p.renderSlot(i.$slots,"toggle",{},()=>[p.createElementVNode("span",lE,p.toDisplayString(t.title),1)])],10,aE)],8,oE),p.createElementVNode("div",{class:p.normalizeClass(["accordion-collapse collapse",t.modelValue&&"show"]),id:`target${t.id}`,"aria-labelledby":`heading${t.id}`,"data-bs-parent":t.parent},[p.createElementVNode("div",uE,[p.renderSlot(i.$slots,"body",{},()=>[p.createElementVNode("article",{innerHTML:t.body},null,8,fE)])])],10,cE)]))}}),lG="",hE=(t,A)=>{const e=t.__vccOpts||t;for(const[n,r]of A)e[n]=r;return e},pE={},gE={class:"accordion"};function BE(t,A){return p.openBlock(),p.createElementBlock("div",gE,[p.renderSlot(t.$slots,"default")])}const mE=hE(pE,[["render",BE]]),wE=["type","disabled"],CE=p.defineComponent({__name:"base-button",props:{type:{type:null},caption:{type:String},variant:{type:String},color:{type:String,default:"primary"},size:{type:String},icon:{type:String},disabled:{type:Boolean,default:!1},pending:{type:Boolean,default:!0},success:{type:Boolean,default:!1},error:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},circle:{type:Boolean,default:!1}},setup(t){const A=t,e=p.computed(()=>A.caption&&!A.circle);return(n,r)=>{const i=p.resolveComponent("loading-spinner"),s=p.resolveComponent("svg-icon");return p.openBlock(),p.createElementBlock("button",{type:t.type,disabled:t.disabled,class:p.normalizeClass(["btn",{disabled:t.disabled,pending:t.pending,rounded:t.rounded,"rounded-circle":t.circle,[`btn-${t.color}`]:!t.outlined,[`btn-outline-${t.color}`]:t.outlined,"x-large":t.size==="x-large",large:t.size==="large",small:t.size==="small","x-small":t.size==="x-small"}])},[p.renderSlot(n.$slots,"default",{},()=>[t.pending?p.renderSlot(n.$slots,"pending-icon",{key:0},()=>[p.createVNode(i,{class:"h-100"})]):p.createCommentVNode("",!0),t.icon?(p.openBlock(),p.createBlock(s,{key:1,symbol:t.icon,class:"base-button__caption"},null,8,["symbol"])):p.createCommentVNode("",!0),e.value?(p.openBlock(),p.createElementBlock("span",{key:2,class:p.normalizeClass(["base-button__caption",{"icon-padding":t.icon}])},p.toDisplayString(t.caption),3)):p.createCommentVNode("",!0)])],10,wE)}}}),cG="",yE={class:"input-group input__input-group"},EE=["type","id","name","placeholder","pattern","disabled","read-only","required","maxlength","true-value","false-value","aria-label","role","autocomplete"],QE=["for","innerHTML"],FE=p.defineComponent({__name:"base-input",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>Qe()},id:{type:String,default:()=>Qe()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},maxlength:{type:Number},pattern:{type:String,default:null},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},role:{type:String,default:"presentation"},autocomplete:{type:String,default:"off"}},emits:["update:modelValue"],setup(t,{emit:A}){const e=t,n=A,r=p.computed({get(){return e.modelValue},set(i){n("update:modelValue",i)}});return(i,s)=>(p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["input",`input--${t.type}`])},[p.createElementVNode("div",yE,[p.renderSlot(i.$slots,"input-prepend",{slotScope:"props"}),p.withDirectives(p.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=a=>r.value=a),type:t.type==="color"?"text":t.type,id:t.id,name:t.name,placeholder:t.placeholder,pattern:t.pattern,disabled:t.disabled,"read-only":t.readOnly,required:t.required,maxlength:t.maxlength,"true-value":t.trueValue,"false-value":t.falseValue,class:p.normalizeClass(["form-control",{"form-check-input":t.type==="checkbox"}]),"aria-label":t.label,role:t.role,autocomplete:t.autocomplete},null,10,EE),[[p.vModelDynamic,r.value]]),p.renderSlot(i.$slots,"input-append",{slotScope:"props"})]),p.renderSlot(i.$slots,"label",{},()=>[t.label?(p.openBlock(),p.createElementBlock("label",{key:0,for:t.id,class:p.normalizeClass(["input__label",{"form-check-label":t.type==="checkbox"}]),innerHTML:`${t.label}${t.required?" *":""}`},null,10,QE)):p.createCommentVNode("",!0)])],2))}}),uG="",UE={class:"input input--textarea"},bE=["type","id","name","placeholder","pattern","disabled","read-only","required","maxlength","aria-label"],vE=["for","innerHTML"],IE=p.defineComponent({__name:"input-textarea",props:{modelValue:{type:String,default:""},type:{type:String,default:"text"},name:{type:String,default:()=>Qe()},id:{type:String,default:()=>Qe()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},maxlength:{type:Number},pattern:{type:String,default:null},checked:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:A}){const e=t,n=A,r=p.computed({get(){return e.modelValue},set(i){n("update:modelValue",i)}});return(i,s)=>(p.openBlock(),p.createElementBlock("div",UE,[p.renderSlot(i.$slots,"input-prepend"),p.withDirectives(p.createElementVNode("textarea",{"onUpdate:modelValue":s[0]||(s[0]=a=>r.value=a),type:t.type,id:t.id,name:t.name,placeholder:t.placeholder,pattern:t.pattern,disabled:t.disabled,"read-only":t.readOnly,required:t.required,maxlength:t.maxlength,class:p.normalizeClass(["form-control",{}]),"aria-label":t.label},null,8,bE),[[p.vModelText,r.value]]),p.renderSlot(i.$slots,"input-append"),p.renderSlot(i.$slots,"label",{},()=>[p.createElementVNode("label",{for:t.id,class:p.normalizeClass(["input__label",{"form-check-label":t.type==="checkbox"}]),innerHTML:`${t.label}${t.required?" *":""}`},null,10,vE)])]))}}),SE=["value","id","name","required","disabled","true-value","false-value"],TE=["for","innerHTML"],_E=p.createElementVNode("span",{class:"input__error"},"error",-1),xE=p.defineComponent({__name:"input-checkbox",props:{id:{type:String},name:{type:String},label:{type:String},error:{type:String},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},modelValue:{type:[Boolean,Array]},value:{type:[String,Object]},checked:{type:Boolean},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1}},emits:["update:modelValue","update:checked"],setup(t,{emit:A}){const e=t,n=A,r=p.computed({get(){return e.modelValue||e.checked},set(i){n("update:checked",i),n("update:modelValue",i)}});return(i,s)=>(p.openBlock(),p.createElementBlock("div",{class:"form-check input input--checkbox",onClick:s[1]||(s[1]=p.withModifiers(a=>i.void,["stop"]))},[p.withDirectives(p.createElementVNode("input",{ref:"input","onUpdate:modelValue":s[0]||(s[0]=a=>r.value=a),value:t.value,id:t.id,name:t.name,type:"checkbox",required:t.required,disabled:t.disabled,class:"form-check-input","true-value":t.trueValue,"false-value":t.falseValue},null,8,SE),[[p.vModelCheckbox,r.value]]),p.createElementVNode("label",{class:"input__label form-check-label",for:t.id,innerHTML:t.label},null,8,TE),_E]))}}),fG=`:root,*:before,*:after{--border-color: #ced4da;--border-radius: .25rem}.input--checkbox{flex-flow:row;gap:.5rem}.input--checkbox input{order:0}
|
|
1
|
+
(function(DA,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue"),require("@popperjs/core")):typeof define=="function"&&define.amd?define(["exports","vue","@popperjs/core"],p):(DA=typeof globalThis<"u"?globalThis:DA||self,p(DA.AblokComponents={},DA.Vue,DA.core))})(this,function(DA,p,sh){"use strict";const qy={class:"icon",preserveAspectRatio:"xMaxYMin"},Zy=["xlink:href"],jy=p.defineComponent({__name:"svg-icon",props:{basePath:{type:String,default:"/symbol-defs.svg"},prefix:{type:String,default:"icon-"},symbol:{type:String,default:""},size:{type:String,default:"default"}},setup(t){return(A,e)=>(p.openBlock(),p.createElementBlock("i",{class:p.normalizeClass(["svg-icon",{[`svg-icon--${t.size}`]:t.size}])},[(p.openBlock(),p.createElementBlock("svg",qy,[p.createElementVNode("use",{"xlink:href":`${t.basePath}#${t.prefix}${t.symbol}`,"xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0",y:"0"},null,8,Zy)]))],2))}}),oG="",AE={class:"loading-spinner d-block"},eE=p.createElementVNode("span",{class:"loading-spinner__animation"},[p.createElementVNode("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100"},[p.createElementVNode("path",{d:"M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50"},[p.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",dur:"1s",from:"0 50 50",to:"360 50 50",repeatCount:"indefinite"})])])],-1),tE=p.defineComponent({__name:"loading-spinner",props:{color:{type:String,default:"#fff"}},setup(t){return(A,e)=>(p.openBlock(),p.createElementBlock("span",AE,[eE,p.renderSlot(A.$slots,"default")]))}}),aG="",nE=p.defineComponent({__name:"base-headline",props:{tag:{},size:{},variant:{},text:{},className:{}},setup(t){const A=t,e=p.computed(()=>A.tag||"p");return(n,r)=>(p.openBlock(),p.createBlock(p.resolveDynamicComponent(e.value),{class:p.normalizeClass(["headline",`${n.size} headline--${n.size}${n.className||""}`])},{default:p.withCtx(()=>[p.renderSlot(n.$slots,"default",{},()=>[p.createTextVNode(p.toDisplayString(n.text),1)])]),_:3},8,["class"]))}}),rE=["innerHTML"],iE=p.defineComponent({__name:"base-paragraph",props:{size:{},variant:{},text:{},className:{}},setup(t){return(A,e)=>(p.openBlock(),p.createElementBlock("p",{class:p.normalizeClass(["base-paragraph",`${A.size||""} ${A.className||""}`]),innerHTML:A.text},null,10,rE))}});function Qe(){return(new Date().valueOf()+Math.random()).toString(36).replace(".","")}const sE={class:"accordion-item"},oE=["id"],aE=["data-bs-target","aria-controls"],lE={class:"flex-grow-1"},cE=["id","aria-labelledby","data-bs-parent"],uE={class:"accordion-body"},fE=["innerHTML"],dE=p.defineComponent({__name:"accordion-item",props:{id:{type:String,default:()=>Qe()},modelValue:{type:Boolean,default:!1},title:{type:String,default:"Accordion Title"},body:{type:String,default:"<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nisi aut, nobis inventore repudiandae quo laboriosam. Dicta placeat ullam harum optio expedita. Harum fugiat suscipit sapiente quos, molestias neque eaque omnis?</p>"},parent:{type:String,default:""}},emits:["update:modelValue"],setup(t,{emit:A}){const e=t,n=A;function r(){n("update:modelValue",!e.modelValue)}return(i,s)=>(p.openBlock(),p.createElementBlock("div",sE,[p.createElementVNode("div",{class:"accordion-header",id:`heading${t.id}`},[p.createElementVNode("button",{class:p.normalizeClass(["accordion-button",!t.modelValue&&"collapsed"]),type:"button","data-bs-toggle":"collapse","data-bs-target":`#target${t.id}`,"aria-expanded":"true","aria-controls":`target${t.id}`,onClick:r},[p.renderSlot(i.$slots,"toggle",{},()=>[p.createElementVNode("span",lE,p.toDisplayString(t.title),1)])],10,aE)],8,oE),p.createElementVNode("div",{class:p.normalizeClass(["accordion-collapse collapse",t.modelValue&&"show"]),id:`target${t.id}`,"aria-labelledby":`heading${t.id}`,"data-bs-parent":t.parent},[p.createElementVNode("div",uE,[p.renderSlot(i.$slots,"body",{},()=>[p.createElementVNode("article",{innerHTML:t.body},null,8,fE)])])],10,cE)]))}}),lG="",hE=(t,A)=>{const e=t.__vccOpts||t;for(const[n,r]of A)e[n]=r;return e},pE={},gE={class:"accordion"};function BE(t,A){return p.openBlock(),p.createElementBlock("div",gE,[p.renderSlot(t.$slots,"default")])}const mE=hE(pE,[["render",BE]]),wE=["type","disabled"],CE=p.defineComponent({__name:"base-button",props:{type:{type:null},caption:{type:String},variant:{type:String},color:{type:String,default:"primary"},size:{type:String},icon:{type:String},disabled:{type:Boolean,default:!1},pending:{type:Boolean,default:!0},success:{type:Boolean,default:!1},error:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},circle:{type:Boolean,default:!1}},setup(t){const A=t,e=p.computed(()=>A.caption&&!A.circle);return(n,r)=>{const i=p.resolveComponent("loading-spinner"),s=p.resolveComponent("svg-icon");return p.openBlock(),p.createElementBlock("button",{type:t.type,disabled:t.disabled,class:p.normalizeClass(["btn",{disabled:t.disabled,pending:t.pending,rounded:t.rounded,"rounded-circle":t.circle,[`btn-${t.color}`]:!t.outlined,[`btn-outline-${t.color}`]:t.outlined,"x-large":t.size==="x-large",large:t.size==="large",small:t.size==="small","x-small":t.size==="x-small"}])},[t.pending?p.renderSlot(n.$slots,"pending-icon",{key:0},()=>[p.createVNode(i)]):p.createCommentVNode("",!0),p.renderSlot(n.$slots,"default",{},()=>[t.icon?(p.openBlock(),p.createBlock(s,{key:0,symbol:t.icon,class:"base-button__caption"},null,8,["symbol"])):p.createCommentVNode("",!0),e.value?(p.openBlock(),p.createElementBlock("span",{key:1,class:p.normalizeClass(["base-button__caption",{"icon-padding":t.icon}])},p.toDisplayString(t.caption),3)):p.createCommentVNode("",!0)])],10,wE)}}}),cG="",yE={class:"input-group input__input-group"},EE=["type","id","name","placeholder","pattern","disabled","read-only","required","maxlength","true-value","false-value","aria-label","role","autocomplete"],QE=["for","innerHTML"],FE=p.defineComponent({__name:"base-input",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>Qe()},id:{type:String,default:()=>Qe()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},maxlength:{type:Number},pattern:{type:String,default:null},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},role:{type:String,default:"presentation"},autocomplete:{type:String,default:"off"}},emits:["update:modelValue"],setup(t,{emit:A}){const e=t,n=A,r=p.computed({get(){return e.modelValue},set(i){n("update:modelValue",i)}});return(i,s)=>(p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["input",`input--${t.type}`])},[p.createElementVNode("div",yE,[p.renderSlot(i.$slots,"input-prepend",{slotScope:"props"}),p.withDirectives(p.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=a=>r.value=a),type:t.type==="color"?"text":t.type,id:t.id,name:t.name,placeholder:t.placeholder,pattern:t.pattern,disabled:t.disabled,"read-only":t.readOnly,required:t.required,maxlength:t.maxlength,"true-value":t.trueValue,"false-value":t.falseValue,class:p.normalizeClass(["form-control",{"form-check-input":t.type==="checkbox"}]),"aria-label":t.label,role:t.role,autocomplete:t.autocomplete},null,10,EE),[[p.vModelDynamic,r.value]]),p.renderSlot(i.$slots,"input-append",{slotScope:"props"})]),p.renderSlot(i.$slots,"label",{},()=>[t.label?(p.openBlock(),p.createElementBlock("label",{key:0,for:t.id,class:p.normalizeClass(["input__label",{"form-check-label":t.type==="checkbox"}]),innerHTML:`${t.label}${t.required?" *":""}`},null,10,QE)):p.createCommentVNode("",!0)])],2))}}),uG="",UE={class:"input input--textarea"},bE=["type","id","name","placeholder","pattern","disabled","read-only","required","maxlength","aria-label"],vE=["for","innerHTML"],IE=p.defineComponent({__name:"input-textarea",props:{modelValue:{type:String,default:""},type:{type:String,default:"text"},name:{type:String,default:()=>Qe()},id:{type:String,default:()=>Qe()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},maxlength:{type:Number},pattern:{type:String,default:null},checked:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:A}){const e=t,n=A,r=p.computed({get(){return e.modelValue},set(i){n("update:modelValue",i)}});return(i,s)=>(p.openBlock(),p.createElementBlock("div",UE,[p.renderSlot(i.$slots,"input-prepend"),p.withDirectives(p.createElementVNode("textarea",{"onUpdate:modelValue":s[0]||(s[0]=a=>r.value=a),type:t.type,id:t.id,name:t.name,placeholder:t.placeholder,pattern:t.pattern,disabled:t.disabled,"read-only":t.readOnly,required:t.required,maxlength:t.maxlength,class:p.normalizeClass(["form-control",{}]),"aria-label":t.label},null,8,bE),[[p.vModelText,r.value]]),p.renderSlot(i.$slots,"input-append"),p.renderSlot(i.$slots,"label",{},()=>[p.createElementVNode("label",{for:t.id,class:p.normalizeClass(["input__label",{"form-check-label":t.type==="checkbox"}]),innerHTML:`${t.label}${t.required?" *":""}`},null,10,vE)])]))}}),SE=["value","id","name","required","disabled","true-value","false-value"],TE=["for","innerHTML"],_E=p.createElementVNode("span",{class:"input__error"},"error",-1),xE=p.defineComponent({__name:"input-checkbox",props:{id:{type:String},name:{type:String},label:{type:String},error:{type:String},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},modelValue:{type:[Boolean,Array]},value:{type:[String,Object]},checked:{type:Boolean},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1}},emits:["update:modelValue","update:checked"],setup(t,{emit:A}){const e=t,n=A,r=p.computed({get(){return e.modelValue||e.checked},set(i){n("update:checked",i),n("update:modelValue",i)}});return(i,s)=>(p.openBlock(),p.createElementBlock("div",{class:"form-check input input--checkbox",onClick:s[1]||(s[1]=p.withModifiers(a=>i.void,["stop"]))},[p.withDirectives(p.createElementVNode("input",{ref:"input","onUpdate:modelValue":s[0]||(s[0]=a=>r.value=a),value:t.value,id:t.id,name:t.name,type:"checkbox",required:t.required,disabled:t.disabled,class:"form-check-input","true-value":t.trueValue,"false-value":t.falseValue},null,8,SE),[[p.vModelCheckbox,r.value]]),p.createElementVNode("label",{class:"input__label form-check-label",for:t.id,innerHTML:t.label},null,8,TE),_E]))}}),fG=`:root,*:before,*:after{--border-color: #ced4da;--border-radius: .25rem}.input--checkbox{flex-flow:row;gap:.5rem}.input--checkbox input{order:0}
|
|
2
2
|
`,OE={class:"check-group"},LE=["id","name","value","disabled","read-only","required"],HE=["for","innerHTML"],ME=p.defineComponent({__name:"check-group",props:{modelValue:{type:null,default:()=>[]},options:{type:Array,required:!0},name:{type:String,default:()=>Qe()},id:{type:String,default:()=>Qe()},label:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:A}){const e=t,n=A;p.ref([]);const r=p.computed({get(){return e.modelValue},set(s){n("update:modelValue",s)}}),i=p.computed(()=>e.options&&e.options.map(s=>(s=typeof s=="string"?{text:s,value:s}:s,{...s,active:e.modelValue&&e.modelValue.includes(s.value)})));return(s,a)=>(p.openBlock(),p.createElementBlock("div",OE,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(i.value,(c,u)=>(p.openBlock(),p.createElementBlock("div",{key:u,class:"form-check"},[p.withDirectives(p.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[0]||(a[0]=f=>r.value=f),id:`${t.id}-${u}`,name:t.name,class:"form-check-input",value:c.value||c,disabled:t.disabled,"read-only":t.readOnly,required:t.required},null,8,LE),[[p.vModelCheckbox,r.value]]),p.createElementVNode("label",{class:"form-check-label",for:`${t.id}-${u}`,innerHTML:c.text},null,8,HE)]))),128))]))}}),dG="",NE={class:"input radio-group"},DE=["id","name","value","checked","disabled","read-only","required","onChange"],kE=["for","innerHTML"],RE=["for"],KE=p.defineComponent({__name:"radio-group",props:{modelValue:{default:!1},options:{type:Array,default:[]},name:{type:String,default:()=>Qe()},id:{type:String,default:()=>Qe()},label:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},emits:["change","update:modelValue"],setup(t,{emit:A}){const e=t,n=A;p.ref(e.options.map(i=>i.value===e.modelValue));function r(i){console.log("asdfa",i),n("update:modelValue",i)}return p.onBeforeMount(()=>{}),(i,s)=>(p.openBlock(),p.createElementBlock("div",NE,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(t.options,(a,c)=>(p.openBlock(),p.createElementBlock("div",{key:c,class:"form-check"},[p.createElementVNode("input",{type:"radio",id:`${t.id}-${c}`,name:t.name,class:"form-check-input",value:a.value||a,checked:a.value?a.value===t.modelValue:a===t.modelValue,disabled:t.disabled,"read-only":t.readOnly,required:t.required,onChange:u=>r(a)},null,40,DE),p.createElementVNode("label",{class:"form-check-label",for:`${t.id}-${c}`,innerHTML:t.label},null,8,kE)]))),128)),p.renderSlot(i.$slots,"label",{},()=>[t.label?(p.openBlock(),p.createElementBlock("label",{key:0,for:t.id},p.toDisplayString(t.label),9,RE)):p.createCommentVNode("",!0)])]))}}),hG="",PE=["id","name","multiple","accept","disabled"],VE={class:"input__input-group input-group"},GE=["value","id","name","disabled"],WE=["for","disabled"],$E=p.createElementVNode("span",{class:"btn btn-outline-dark"},"Select File",-1),JE=["for"],XE=["innerHTML"],YE=p.defineComponent({__name:"input-file",props:{modelValue:{type:Array,default:[]},name:{type:String,default:()=>Qe()},id:{type:String,default:()=>Qe()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},pattern:{type:String,default:null},multiple:{type:Boolean,default:!1},accept:{type:String}},emits:["update:modelValue"],setup(t,{emit:A}){const e=t,n=A;function r(c){const u=c.target&&c.target.files;u&&(s.splice(0,s.length),Array.from(u).forEach(f=>{s.push(f)}))}const i=p.ref(),s=p.reactive([]),a=p.computed(()=>s&&s.map(c=>c.name));return p.computed(()=>s.map(c=>URL.createObjectURL(c))),p.watch(()=>e.modelValue,(c,u)=>{c.length===0&&(i.value.value=null)},{deep:!0}),p.watch(()=>s,(c,u)=>{n("update:modelValue",c)},{deep:!0}),(c,u)=>(p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["input input-file","input-file--primary"])},[p.createElementVNode("input",{ref_key:"input",ref:i,type:"file",id:t.id,name:t.name,class:"d-none",onChange:r,multiple:t.multiple,accept:t.accept,disabled:t.disabled},null,40,PE),p.createElementVNode("div",VE,[p.renderSlot(c.$slots,"input-prepend"),p.createElementVNode("input",{type:"text",value:a.value,id:t.id,name:t.name,class:"form-control",disabled:t.disabled},null,8,GE),p.renderSlot(c.$slots,"input-append",{},()=>[p.createElementVNode("label",{for:t.id,disabled:t.disabled},[p.renderSlot(c.$slots,"button",{},()=>[$E])],8,WE)])]),p.createElementVNode("label",{for:t.id},[p.renderSlot(c.$slots,"label",{},()=>[p.createElementVNode("span",{class:"input__label",innerHTML:`${t.label}${t.required?" *":""}`},null,8,XE)])],8,JE)]))}});function He(t){this.content=t}He.prototype={constructor:He,find:function(t){for(var A=0;A<this.content.length;A+=2)if(this.content[A]===t)return A;return-1},get:function(t){var A=this.find(t);return A==-1?void 0:this.content[A+1]},update:function(t,A,e){var n=e&&e!=t?this.remove(e):this,r=n.find(t),i=n.content.slice();return r==-1?i.push(e||t,A):(i[r+1]=A,e&&(i[r]=e)),new He(i)},remove:function(t){var A=this.find(t);if(A==-1)return this;var e=this.content.slice();return e.splice(A,2),new He(e)},addToStart:function(t,A){return new He([t,A].concat(this.remove(t).content))},addToEnd:function(t,A){var e=this.remove(t).content.slice();return e.push(t,A),new He(e)},addBefore:function(t,A,e){var n=this.remove(A),r=n.content.slice(),i=n.find(t);return r.splice(i==-1?r.length:i,0,A,e),new He(r)},forEach:function(t){for(var A=0;A<this.content.length;A+=2)t(this.content[A],this.content[A+1])},prepend:function(t){return t=He.from(t),t.size?new He(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=He.from(t),t.size?new He(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var A=this;t=He.from(t);for(var e=0;e<t.content.length;e+=2)A=A.remove(t.content[e]);return A},toObject:function(){var t={};return this.forEach(function(A,e){t[A]=e}),t},get size(){return this.content.length>>1}},He.from=function(t){if(t instanceof He)return t;var A=[];if(t)for(var e in t)A.push(e,t[e]);return new He(A)};function oh(t,A,e){for(let n=0;;n++){if(n==t.childCount||n==A.childCount)return t.childCount==A.childCount?null:e;let r=t.child(n),i=A.child(n);if(r==i){e+=r.nodeSize;continue}if(!r.sameMarkup(i))return e;if(r.isText&&r.text!=i.text){for(let s=0;r.text[s]==i.text[s];s++)e++;return e}if(r.content.size||i.content.size){let s=oh(r.content,i.content,e+1);if(s!=null)return s}e+=r.nodeSize}}function ah(t,A,e,n){for(let r=t.childCount,i=A.childCount;;){if(r==0||i==0)return r==i?null:{a:e,b:n};let s=t.child(--r),a=A.child(--i),c=s.nodeSize;if(s==a){e-=c,n-=c;continue}if(!s.sameMarkup(a))return{a:e,b:n};if(s.isText&&s.text!=a.text){let u=0,f=Math.min(s.text.length,a.text.length);for(;u<f&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,e--,n--;return{a:e,b:n}}if(s.content.size||a.content.size){let u=ah(s.content,a.content,e-1,n-1);if(u)return u}e-=c,n-=c}}class J{constructor(A,e){if(this.content=A,this.size=e||0,e==null)for(let n=0;n<A.length;n++)this.size+=A[n].nodeSize}nodesBetween(A,e,n,r=0,i){for(let s=0,a=0;a<e;s++){let c=this.content[s],u=a+c.nodeSize;if(u>A&&n(c,r+a,i||null,s)!==!1&&c.content.size){let f=a+1;c.nodesBetween(Math.max(0,A-f),Math.min(c.content.size,e-f),n,r+f)}a=u}}descendants(A){this.nodesBetween(0,this.size,A)}textBetween(A,e,n,r){let i="",s=!0;return this.nodesBetween(A,e,(a,c)=>{a.isText?(i+=a.text.slice(Math.max(A,c)-c,e-c),s=!n):a.isLeaf?(r?i+=typeof r=="function"?r(a):r:a.type.spec.leafText&&(i+=a.type.spec.leafText(a)),s=!n):!s&&a.isBlock&&(i+=n,s=!0)},0),i}append(A){if(!A.size)return this;if(!this.size)return A;let e=this.lastChild,n=A.firstChild,r=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),i=1);i<A.content.length;i++)r.push(A.content[i]);return new J(r,this.size+A.size)}cut(A,e=this.size){if(A==0&&e==this.size)return this;let n=[],r=0;if(e>A)for(let i=0,s=0;s<e;i++){let a=this.content[i],c=s+a.nodeSize;c>A&&((s<A||c>e)&&(a.isText?a=a.cut(Math.max(0,A-s),Math.min(a.text.length,e-s)):a=a.cut(Math.max(0,A-s-1),Math.min(a.content.size,e-s-1))),n.push(a),r+=a.nodeSize),s=c}return new J(n,r)}cutByIndex(A,e){return A==e?J.empty:A==0&&e==this.content.length?this:new J(this.content.slice(A,e))}replaceChild(A,e){let n=this.content[A];if(n==e)return this;let r=this.content.slice(),i=this.size+e.nodeSize-n.nodeSize;return r[A]=e,new J(r,i)}addToStart(A){return new J([A].concat(this.content),this.size+A.nodeSize)}addToEnd(A){return new J(this.content.concat(A),this.size+A.nodeSize)}eq(A){if(this.content.length!=A.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(A.content[e]))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(A){let e=this.content[A];if(!e)throw new RangeError("Index "+A+" out of range for "+this);return e}maybeChild(A){return this.content[A]||null}forEach(A){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];A(r,n,e),n+=r.nodeSize}}findDiffStart(A,e=0){return oh(this,A,e)}findDiffEnd(A,e=this.size,n=A.size){return ah(this,A,e,n)}findIndex(A,e=-1){if(A==0)return Ho(0,A);if(A==this.size)return Ho(this.content.length,A);if(A>this.size||A<0)throw new RangeError(`Position ${A} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=A)return s==A||e>0?Ho(n+1,s):Ho(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(A=>A.toJSON()):null}static fromJSON(A,e){if(!e)return J.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new J(e.map(A.nodeFromJSON))}static fromArray(A){if(!A.length)return J.empty;let e,n=0;for(let r=0;r<A.length;r++){let i=A[r];n+=i.nodeSize,r&&i.isText&&A[r-1].sameMarkup(i)?(e||(e=A.slice(0,r)),e[e.length-1]=i.withText(e[e.length-1].text+i.text)):e&&e.push(i)}return new J(e||A,n)}static from(A){if(!A)return J.empty;if(A instanceof J)return A;if(Array.isArray(A))return this.fromArray(A);if(A.attrs)return new J([A],A.nodeSize);throw new RangeError("Can not convert "+A+" to a Fragment"+(A.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}J.empty=new J([],0);const oc={index:0,offset:0};function Ho(t,A){return oc.index=t,oc.offset=A,oc}function Mo(t,A){if(t===A)return!0;if(!(t&&typeof t=="object")||!(A&&typeof A=="object"))return!1;let e=Array.isArray(t);if(Array.isArray(A)!=e)return!1;if(e){if(t.length!=A.length)return!1;for(let n=0;n<t.length;n++)if(!Mo(t[n],A[n]))return!1}else{for(let n in t)if(!(n in A)||!Mo(t[n],A[n]))return!1;for(let n in A)if(!(n in t))return!1}return!0}let qA=class nh{constructor(A,e){this.type=A,this.attrs=e}addToSet(A){let e,n=!1;for(let r=0;r<A.length;r++){let i=A[r];if(this.eq(i))return A;if(this.type.excludes(i.type))e||(e=A.slice(0,r));else{if(i.type.excludes(this.type))return A;!n&&i.type.rank>this.type.rank&&(e||(e=A.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=A.slice()),n||e.push(this),e}removeFromSet(A){for(let e=0;e<A.length;e++)if(this.eq(A[e]))return A.slice(0,e).concat(A.slice(e+1));return A}isInSet(A){for(let e=0;e<A.length;e++)if(this.eq(A[e]))return!0;return!1}eq(A){return this==A||this.type==A.type&&Mo(this.attrs,A.attrs)}toJSON(){let A={type:this.type.name};for(let e in this.attrs){A.attrs=this.attrs;break}return A}static fromJSON(A,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=A.marks[e.type];if(!n)throw new RangeError(`There is no mark type ${e.type} in this schema`);return n.create(e.attrs)}static sameSet(A,e){if(A==e)return!0;if(A.length!=e.length)return!1;for(let n=0;n<A.length;n++)if(!A[n].eq(e[n]))return!1;return!0}static setFrom(A){if(!A||Array.isArray(A)&&A.length==0)return nh.none;if(A instanceof nh)return[A];let e=A.slice();return e.sort((n,r)=>n.type.rank-r.type.rank),e}};qA.none=[];class No extends Error{}class j{constructor(A,e,n){this.content=A,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(A,e){let n=ch(this.content,A+this.openStart,e);return n&&new j(n,this.openStart,this.openEnd)}removeBetween(A,e){return new j(lh(this.content,A+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(A){return this.content.eq(A.content)&&this.openStart==A.openStart&&this.openEnd==A.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let A={content:this.content.toJSON()};return this.openStart>0&&(A.openStart=this.openStart),this.openEnd>0&&(A.openEnd=this.openEnd),A}static fromJSON(A,e){if(!e)return j.empty;let n=e.openStart||0,r=e.openEnd||0;if(typeof n!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new j(J.fromJSON(A,e.content),n,r)}static maxOpen(A,e=!0){let n=0,r=0;for(let i=A.firstChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=A.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new j(A,n,r)}}j.empty=new j(J.empty,0,0);function lh(t,A,e){let{index:n,offset:r}=t.findIndex(A),i=t.maybeChild(n),{index:s,offset:a}=t.findIndex(e);if(r==A||i.isText){if(a!=e&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,A).append(t.cut(e))}if(n!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(n,i.copy(lh(i.content,A-r-1,e-r-1)))}function ch(t,A,e,n){let{index:r,offset:i}=t.findIndex(A),s=t.maybeChild(r);if(i==A||s.isText)return n&&!n.canReplace(r,r,e)?null:t.cut(0,A).append(e).append(t.cut(A));let a=ch(s.content,A-i-1,e);return a&&t.replaceChild(r,s.copy(a))}function zE(t,A,e){if(e.openStart>t.depth)throw new No("Inserted content deeper than insertion position");if(t.depth-e.openStart!=A.depth-e.openEnd)throw new No("Inconsistent open depths");return uh(t,A,e,0)}function uh(t,A,e,n){let r=t.index(n),i=t.node(n);if(r==A.index(n)&&n<t.depth-e.openStart){let s=uh(t,A,e,n+1);return i.copy(i.content.replaceChild(r,s))}else if(e.content.size)if(!e.openStart&&!e.openEnd&&t.depth==n&&A.depth==n){let s=t.parent,a=s.content;return Gr(s,a.cut(0,t.parentOffset).append(e.content).append(a.cut(A.parentOffset)))}else{let{start:s,end:a}=qE(e,t);return Gr(i,dh(t,s,a,A,n))}else return Gr(i,Do(t,A,n))}function fh(t,A){if(!A.type.compatibleContent(t.type))throw new No("Cannot join "+A.type.name+" onto "+t.type.name)}function ac(t,A,e){let n=t.node(e);return fh(n,A.node(e)),n}function Vr(t,A){let e=A.length-1;e>=0&&t.isText&&t.sameMarkup(A[e])?A[e]=t.withText(A[e].text+t.text):A.push(t)}function ys(t,A,e,n){let r=(A||t).node(e),i=0,s=A?A.index(e):r.childCount;t&&(i=t.index(e),t.depth>e?i++:t.textOffset&&(Vr(t.nodeAfter,n),i++));for(let a=i;a<s;a++)Vr(r.child(a),n);A&&A.depth==e&&A.textOffset&&Vr(A.nodeBefore,n)}function Gr(t,A){return t.type.checkContent(A),t.copy(A)}function dh(t,A,e,n,r){let i=t.depth>r&&ac(t,A,r+1),s=n.depth>r&&ac(e,n,r+1),a=[];return ys(null,t,r,a),i&&s&&A.index(r)==e.index(r)?(fh(i,s),Vr(Gr(i,dh(t,A,e,n,r+1)),a)):(i&&Vr(Gr(i,Do(t,A,r+1)),a),ys(A,e,r,a),s&&Vr(Gr(s,Do(e,n,r+1)),a)),ys(n,null,r,a),new J(a)}function Do(t,A,e){let n=[];if(ys(null,t,e,n),t.depth>e){let r=ac(t,A,e+1);Vr(Gr(r,Do(t,A,e+1)),n)}return ys(A,null,e,n),new J(n)}function qE(t,A){let e=A.depth-t.openStart,r=A.node(e).copy(t.content);for(let i=e-1;i>=0;i--)r=A.node(i).copy(J.from(r));return{start:r.resolveNoCache(t.openStart+e),end:r.resolveNoCache(r.content.size-t.openEnd-e)}}class Es{constructor(A,e,n){this.pos=A,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(A){return A==null?this.depth:A<0?this.depth+A:A}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(A){return this.path[this.resolveDepth(A)*3]}index(A){return this.path[this.resolveDepth(A)*3+1]}indexAfter(A){return A=this.resolveDepth(A),this.index(A)+(A==this.depth&&!this.textOffset?0:1)}start(A){return A=this.resolveDepth(A),A==0?0:this.path[A*3-1]+1}end(A){return A=this.resolveDepth(A),this.start(A)+this.node(A).content.size}before(A){if(A=this.resolveDepth(A),!A)throw new RangeError("There is no position before the top-level node");return A==this.depth+1?this.pos:this.path[A*3-1]}after(A){if(A=this.resolveDepth(A),!A)throw new RangeError("There is no position after the top-level node");return A==this.depth+1?this.pos:this.path[A*3-1]+this.path[A*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let A=this.parent,e=this.index(this.depth);if(e==A.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=A.child(e);return n?A.child(e).cut(n):r}get nodeBefore(){let A=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(A).cut(0,e):A==0?null:this.parent.child(A-1)}posAtIndex(A,e){e=this.resolveDepth(e);let n=this.path[e*3],r=e==0?0:this.path[e*3-1]+1;for(let i=0;i<A;i++)r+=n.child(i).nodeSize;return r}marks(){let A=this.parent,e=this.index();if(A.content.size==0)return qA.none;if(this.textOffset)return A.child(e).marks;let n=A.maybeChild(e-1),r=A.maybeChild(e);if(!n){let a=n;n=r,r=a}let i=n.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!r||!i[s].isInSet(r.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(A){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=A.parent.maybeChild(A.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(A){for(let e=this.depth;e>0;e--)if(this.start(e)<=A&&this.end(e)>=A)return e;return 0}blockRange(A=this,e){if(A.pos<this.pos)return A.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==A.pos?1:0);n>=0;n--)if(A.pos<=this.end(n)&&(!e||e(this.node(n))))return new ko(this,A,n);return null}sameParent(A){return this.pos-this.parentOffset==A.pos-A.parentOffset}max(A){return A.pos>this.pos?A:this}min(A){return A.pos<this.pos?A:this}toString(){let A="";for(let e=1;e<=this.depth;e++)A+=(A?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return A+":"+this.parentOffset}static resolve(A,e){if(!(e>=0&&e<=A.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let s=A;;){let{index:a,offset:c}=s.content.findIndex(i),u=i-c;if(n.push(s,a,r+c),!u||(s=s.child(a),s.isText))break;i=u-1,r+=c+1}return new Es(e,n,i)}static resolveCached(A,e){for(let r=0;r<lc.length;r++){let i=lc[r];if(i.pos==e&&i.doc==A)return i}let n=lc[cc]=Es.resolve(A,e);return cc=(cc+1)%ZE,n}}let lc=[],cc=0,ZE=12;class ko{constructor(A,e,n){this.$from=A,this.$to=e,this.depth=n}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 jE=Object.create(null);let Wr=class rh{constructor(A,e,n,r=qA.none){this.type=A,this.attrs=e,this.marks=r,this.content=n||J.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(A){return this.content.child(A)}maybeChild(A){return this.content.maybeChild(A)}forEach(A){this.content.forEach(A)}nodesBetween(A,e,n,r=0){this.content.nodesBetween(A,e,n,r,this)}descendants(A){this.nodesBetween(0,this.content.size,A)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(A,e,n,r){return this.content.textBetween(A,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(A){return this==A||this.sameMarkup(A)&&this.content.eq(A.content)}sameMarkup(A){return this.hasMarkup(A.type,A.attrs,A.marks)}hasMarkup(A,e,n){return this.type==A&&Mo(this.attrs,e||A.defaultAttrs||jE)&&qA.sameSet(this.marks,n||qA.none)}copy(A=null){return A==this.content?this:new rh(this.type,this.attrs,A,this.marks)}mark(A){return A==this.marks?this:new rh(this.type,this.attrs,this.content,A)}cut(A,e=this.content.size){return A==0&&e==this.content.size?this:this.copy(this.content.cut(A,e))}slice(A,e=this.content.size,n=!1){if(A==e)return j.empty;let r=this.resolve(A),i=this.resolve(e),s=n?0:r.sharedDepth(e),a=r.start(s),u=r.node(s).content.cut(r.pos-a,i.pos-a);return new j(u,r.depth-s,i.depth-s)}replace(A,e,n){return zE(this.resolve(A),this.resolve(e),n)}nodeAt(A){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(A);if(e=e.maybeChild(n),!e)return null;if(r==A||e.isText)return e;A-=r+1}}childAfter(A){let{index:e,offset:n}=this.content.findIndex(A);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(A){if(A==0)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(A);if(n<A)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(A){return Es.resolveCached(this,A)}resolveNoCache(A){return Es.resolve(this,A)}rangeHasMark(A,e,n){let r=!1;return e>A&&this.nodesBetween(A,e,i=>(n.isInSet(i.marks)&&(r=!0),!r)),r}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 A=this.type.name;return this.content.size&&(A+="("+this.content.toStringInner()+")"),hh(this.marks,A)}contentMatchAt(A){let e=this.type.contentMatch.matchFragment(this.content,0,A);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(A,e,n=J.empty,r=0,i=n.childCount){let s=this.contentMatchAt(A).matchFragment(n,r,i),a=s&&s.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(let c=r;c<i;c++)if(!this.type.allowsMarks(n.child(c).marks))return!1;return!0}canReplaceWith(A,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(A).matchType(n),s=i&&i.matchFragment(this.content,e);return s?s.validEnd:!1}canAppend(A){return A.content.size?this.canReplace(this.childCount,this.childCount,A.content):this.type.compatibleContent(A.type)}check(){this.type.checkContent(this.content);let A=qA.none;for(let e=0;e<this.marks.length;e++)A=this.marks[e].addToSet(A);if(!qA.sameSet(A,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let A={type:this.type.name};for(let e in this.attrs){A.attrs=this.attrs;break}return this.content.size&&(A.content=this.content.toJSON()),this.marks.length&&(A.marks=this.marks.map(e=>e.toJSON())),A}static fromJSON(A,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(A.markFromJSON)}if(e.type=="text"){if(typeof e.text!="string")throw new RangeError("Invalid text node in JSON");return A.text(e.text,n)}let r=J.fromJSON(A,e.content);return A.nodeType(e.type).create(e.attrs,r,n)}};Wr.prototype.text=void 0;class Ro extends Wr{constructor(A,e,n,r){if(super(A,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):hh(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(A,e){return this.text.slice(A,e)}get nodeSize(){return this.text.length}mark(A){return A==this.marks?this:new Ro(this.type,this.attrs,this.text,A)}withText(A){return A==this.text?this:new Ro(this.type,this.attrs,A,this.marks)}cut(A=0,e=this.text.length){return A==0&&e==this.text.length?this:this.withText(this.text.slice(A,e))}eq(A){return this.sameMarkup(A)&&this.text==A.text}toJSON(){let A=super.toJSON();return A.text=this.text,A}}function hh(t,A){for(let e=t.length-1;e>=0;e--)A=t[e].type.name+"("+A+")";return A}class $r{constructor(A){this.validEnd=A,this.next=[],this.wrapCache=[]}static parse(A,e){let n=new AQ(A,e);if(n.next==null)return $r.empty;let r=ph(n);n.next&&n.err("Unexpected trailing text");let i=oQ(sQ(r));return aQ(i,n),i}matchType(A){for(let e=0;e<this.next.length;e++)if(this.next[e].type==A)return this.next[e].next;return null}matchFragment(A,e=0,n=A.childCount){let r=this;for(let i=e;r&&i<n;i++)r=r.matchType(A.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let A=0;A<this.next.length;A++){let{type:e}=this.next[A];if(!(e.isText||e.hasRequiredAttrs()))return e}return null}compatible(A){for(let e=0;e<this.next.length;e++)for(let n=0;n<A.next.length;n++)if(this.next[e].type==A.next[n].type)return!0;return!1}fillBefore(A,e=!1,n=0){let r=[this];function i(s,a){let c=s.matchFragment(A,n);if(c&&(!e||c.validEnd))return J.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:f,next:h}=s.next[u];if(!(f.isText||f.hasRequiredAttrs())&&r.indexOf(h)==-1){r.push(h);let g=i(h,a.concat(f));if(g)return g}}return null}return i(this,[])}findWrapping(A){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==A)return this.wrapCache[n+1];let e=this.computeWrapping(A);return this.wrapCache.push(A,e),e}computeWrapping(A){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(A)){let s=[];for(let a=r;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:c}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in e)&&(!r.type||c.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),e[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(A){if(A>=this.next.length)throw new RangeError(`There's no ${A}th edge in this content match`);return this.next[A]}toString(){let A=[];function e(n){A.push(n);for(let r=0;r<n.next.length;r++)A.indexOf(n.next[r].next)==-1&&e(n.next[r].next)}return e(this),A.map((n,r)=>{let i=r+(n.validEnd?"*":" ")+" ";for(let s=0;s<n.next.length;s++)i+=(s?", ":"")+n.next[s].type.name+"->"+A.indexOf(n.next[s].next);return i}).join(`
|
|
3
3
|
`)}}$r.empty=new $r(!0);class AQ{constructor(A,e){this.string=A,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=A.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(A){return this.next==A&&(this.pos++||!0)}err(A){throw new SyntaxError(A+" (in content expression '"+this.string+"')")}}function ph(t){let A=[];do A.push(eQ(t));while(t.eat("|"));return A.length==1?A[0]:{type:"choice",exprs:A}}function eQ(t){let A=[];do A.push(tQ(t));while(t.next&&t.next!=")"&&t.next!="|");return A.length==1?A[0]:{type:"seq",exprs:A}}function tQ(t){let A=iQ(t);for(;;)if(t.eat("+"))A={type:"plus",expr:A};else if(t.eat("*"))A={type:"star",expr:A};else if(t.eat("?"))A={type:"opt",expr:A};else if(t.eat("{"))A=nQ(t,A);else break;return A}function gh(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let A=Number(t.next);return t.pos++,A}function nQ(t,A){let e=gh(t),n=e;return t.eat(",")&&(t.next!="}"?n=gh(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:e,max:n,expr:A}}function rQ(t,A){let e=t.nodeTypes,n=e[A];if(n)return[n];let r=[];for(let i in e){let s=e[i];s.groups.indexOf(A)>-1&&r.push(s)}return r.length==0&&t.err("No node type or group '"+A+"' found"),r}function iQ(t){if(t.eat("(")){let A=ph(t);return t.eat(")")||t.err("Missing closing paren"),A}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let A=rQ(t,t.next).map(e=>(t.inline==null?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,A.length==1?A[0]:{type:"choice",exprs:A}}}function sQ(t){let A=[[]];return r(i(t,0),e()),A;function e(){return A.push([])-1}function n(s,a,c){let u={term:c,to:a};return A[s].push(u),u}function r(s,a){s.forEach(c=>c.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((c,u)=>c.concat(i(u,a)),[]);if(s.type=="seq")for(let c=0;;c++){let u=i(s.exprs[c],a);if(c==s.exprs.length-1)return u;r(u,a=e())}else if(s.type=="star"){let c=e();return n(a,c),r(i(s.expr,c),c),[n(c)]}else if(s.type=="plus"){let c=e();return r(i(s.expr,a),c),r(i(s.expr,c),c),[n(c)]}else{if(s.type=="opt")return[n(a)].concat(i(s.expr,a));if(s.type=="range"){let c=a;for(let u=0;u<s.min;u++){let f=e();r(i(s.expr,c),f),c=f}if(s.max==-1)r(i(s.expr,c),c);else for(let u=s.min;u<s.max;u++){let f=e();n(c,f),r(i(s.expr,c),f),c=f}return[n(c)]}else{if(s.type=="name")return[n(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Bh(t,A){return A-t}function mh(t,A){let e=[];return n(A),e.sort(Bh);function n(r){let i=t[r];if(i.length==1&&!i[0].term)return n(i[0].to);e.push(r);for(let s=0;s<i.length;s++){let{term:a,to:c}=i[s];!a&&e.indexOf(c)==-1&&n(c)}}}function oQ(t){let A=Object.create(null);return e(mh(t,0));function e(n){let r=[];n.forEach(s=>{t[s].forEach(({term:a,to:c})=>{if(!a)return;let u;for(let f=0;f<r.length;f++)r[f][0]==a&&(u=r[f][1]);mh(t,c).forEach(f=>{u||r.push([a,u=[]]),u.indexOf(f)==-1&&u.push(f)})})});let i=A[n.join(",")]=new $r(n.indexOf(t.length-1)>-1);for(let s=0;s<r.length;s++){let a=r[s][1].sort(Bh);i.next.push({type:r[s][0],next:A[a.join(",")]||e(a)})}return i}}function aQ(t,A){for(let e=0,n=[t];e<n.length;e++){let r=n[e],i=!r.validEnd,s=[];for(let a=0;a<r.next.length;a++){let{type:c,next:u}=r.next[a];s.push(c.name),i&&!(c.isText||c.hasRequiredAttrs())&&(i=!1),n.indexOf(u)==-1&&n.push(u)}i&&A.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function wh(t){let A=Object.create(null);for(let e in t){let n=t[e];if(!n.hasDefault)return null;A[e]=n.default}return A}function Ch(t,A){let e=Object.create(null);for(let n in t){let r=A&&A[n];if(r===void 0){let i=t[n];if(i.hasDefault)r=i.default;else throw new RangeError("No value supplied for attribute "+n)}e[n]=r}return e}function yh(t){let A=Object.create(null);if(t)for(let e in t)A[e]=new lQ(t[e]);return A}let Eh=class zy{constructor(A,e,n){this.name=A,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=yh(n.attrs),this.defaultAttrs=wh(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||A=="text"),this.isText=A=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==$r.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let A in this.attrs)if(this.attrs[A].isRequired)return!0;return!1}compatibleContent(A){return this==A||this.contentMatch.compatible(A.contentMatch)}computeAttrs(A){return!A&&this.defaultAttrs?this.defaultAttrs:Ch(this.attrs,A)}create(A=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Wr(this,this.computeAttrs(A),J.from(e),qA.setFrom(n))}createChecked(A=null,e,n){return e=J.from(e),this.checkContent(e),new Wr(this,this.computeAttrs(A),e,qA.setFrom(n))}createAndFill(A=null,e,n){if(A=this.computeAttrs(A),e=J.from(e),e.size){let s=this.contentMatch.fillBefore(e);if(!s)return null;e=s.append(e)}let r=this.contentMatch.matchFragment(e),i=r&&r.fillBefore(J.empty,!0);return i?new Wr(this,A,e.append(i),qA.setFrom(n)):null}validContent(A){let e=this.contentMatch.matchFragment(A);if(!e||!e.validEnd)return!1;for(let n=0;n<A.childCount;n++)if(!this.allowsMarks(A.child(n).marks))return!1;return!0}checkContent(A){if(!this.validContent(A))throw new RangeError(`Invalid content for node ${this.name}: ${A.toString().slice(0,50)}`)}allowsMarkType(A){return this.markSet==null||this.markSet.indexOf(A)>-1}allowsMarks(A){if(this.markSet==null)return!0;for(let e=0;e<A.length;e++)if(!this.allowsMarkType(A[e].type))return!1;return!0}allowedMarks(A){if(this.markSet==null)return A;let e;for(let n=0;n<A.length;n++)this.allowsMarkType(A[n].type)?e&&e.push(A[n]):e||(e=A.slice(0,n));return e?e.length?e:qA.none:A}static compile(A,e){let n=Object.create(null);A.forEach((i,s)=>n[i]=new zy(i,e,s));let r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};class lQ{constructor(A){this.hasDefault=Object.prototype.hasOwnProperty.call(A,"default"),this.default=A.default}get isRequired(){return!this.hasDefault}}class Ko{constructor(A,e,n,r){this.name=A,this.rank=e,this.schema=n,this.spec=r,this.attrs=yh(r.attrs),this.excluded=null;let i=wh(this.attrs);this.instance=i?new qA(this,i):null}create(A=null){return!A&&this.instance?this.instance:new qA(this,Ch(this.attrs,A))}static compile(A,e){let n=Object.create(null),r=0;return A.forEach((i,s)=>n[i]=new Ko(i,r++,e,s)),n}removeFromSet(A){for(var e=0;e<A.length;e++)A[e].type==this&&(A=A.slice(0,e).concat(A.slice(e+1)),e--);return A}isInSet(A){for(let e=0;e<A.length;e++)if(A[e].type==this)return A[e]}excludes(A){return this.excluded.indexOf(A)>-1}}class cQ{constructor(A){this.cached=Object.create(null);let e=this.spec={};for(let r in A)e[r]=A[r];e.nodes=He.from(A.nodes),e.marks=He.from(A.marks||{}),this.nodes=Eh.compile(this.spec.nodes,this),this.marks=Ko.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let i=this.nodes[r],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=$r.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?Qh(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let r in this.marks){let i=this.marks[r],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:Qh(this,s.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(A,e=null,n,r){if(typeof A=="string")A=this.nodeType(A);else if(A instanceof Eh){if(A.schema!=this)throw new RangeError("Node type from different schema used ("+A.name+")")}else throw new RangeError("Invalid node type: "+A);return A.createChecked(e,n,r)}text(A,e){let n=this.nodes.text;return new Ro(n,n.defaultAttrs,A,qA.setFrom(e))}mark(A,e){return typeof A=="string"&&(A=this.marks[A]),A.create(e)}nodeFromJSON(A){return Wr.fromJSON(this,A)}markFromJSON(A){return qA.fromJSON(this,A)}nodeType(A){let e=this.nodes[A];if(!e)throw new RangeError("Unknown node type: "+A);return e}}function Qh(t,A){let e=[];for(let n=0;n<A.length;n++){let r=A[n],i=t.marks[r],s=i;if(i)e.push(i);else for(let a in t.marks){let c=t.marks[a];(r=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(r)>-1)&&e.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+A[n]+"'")}return e}class Ei{constructor(A,e){this.schema=A,this.rules=e,this.tags=[],this.styles=[],e.forEach(n=>{n.tag?this.tags.push(n):n.style&&this.styles.push(n)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let r=A.nodes[n.node];return r.contentMatch.matchType(r)})}parse(A,e={}){let n=new vh(this,e,!1);return n.addAll(A,e.from,e.to),n.finish()}parseSlice(A,e={}){let n=new vh(this,e,!0);return n.addAll(A,e.from,e.to),j.maxOpen(n.finish())}matchTag(A,e,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let i=this.tags[r];if(dQ(A,i.tag)&&(i.namespace===void 0||A.namespaceURI==i.namespace)&&(!i.context||e.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(A);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(A,e,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(A)!=0||s.context&&!n.matchesContext(s.context)||a.length>A.length&&(a.charCodeAt(A.length)!=61||a.slice(A.length+1)!=e))){if(s.getAttrs){let c=s.getAttrs(e);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(A){let e=[];function n(r){let i=r.priority==null?50:r.priority,s=0;for(;s<e.length;s++){let a=e[s];if((a.priority==null?50:a.priority)<i)break}e.splice(s,0,r)}for(let r in A.marks){let i=A.marks[r].spec.parseDOM;i&&i.forEach(s=>{n(s=Ih(s)),s.mark||s.ignore||s.clearMark||(s.mark=r)})}for(let r in A.nodes){let i=A.nodes[r].spec.parseDOM;i&&i.forEach(s=>{n(s=Ih(s)),s.node||s.ignore||s.mark||(s.node=r)})}return e}static fromSchema(A){return A.cached.domParser||(A.cached.domParser=new Ei(A,Ei.schemaRules(A)))}}const Fh={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},uQ={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Uh={ol:!0,ul:!0},Po=1,Vo=2,Qs=4;function bh(t,A,e){return A!=null?(A?Po:0)|(A==="full"?Vo:0):t&&t.whitespace=="pre"?Po|Vo:e&~Qs}class Go{constructor(A,e,n,r,i,s,a){this.type=A,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=qA.none,this.stashMarks=[],this.match=s||(a&Qs?null:A.contentMatch)}findWrapping(A){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(J.from(A));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let n=this.type.contentMatch,r;return(r=n.findWrapping(A.type))?(this.match=n,r):null}}return this.match.findWrapping(A.type)}finish(A){if(!(this.options&Po)){let n=this.content[this.content.length-1],r;if(n&&n.isText&&(r=/[ \t\r\n\u000c]+$/.exec(n.text))){let i=n;n.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-r[0].length))}}let e=J.from(this.content);return!A&&this.match&&(e=e.append(this.match.fillBefore(J.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(A){for(let e=this.stashMarks.length-1;e>=0;e--)if(A.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(A){for(let e=0,n=this.pendingMarks;e<n.length;e++){let r=n[e];(this.type?this.type.allowsMarkType(r.type):pQ(r.type,A))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(A){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:A.parentNode&&!Fh.hasOwnProperty(A.parentNode.nodeName.toLowerCase())}}class vh{constructor(A,e,n){this.parser=A,this.options=e,this.isOpen=n,this.open=0;let r=e.topNode,i,s=bh(null,e.preserveWhitespace,0)|(n?Qs:0);r?i=new Go(r.type,r.attrs,qA.none,qA.none,!0,e.topMatch||r.type.contentMatch,s):n?i=new Go(null,null,qA.none,qA.none,!0,null,s):i=new Go(A.schema.topNodeType,null,qA.none,qA.none,!0,null,s),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(A){A.nodeType==3?this.addTextNode(A):A.nodeType==1&&this.addElement(A)}withStyleRules(A,e){let n=A.getAttribute("style");if(!n)return e();let r=this.readStyles(hQ(n));if(!r)return;let[i,s]=r,a=this.top;for(let c=0;c<s.length;c++)this.removePendingMark(s[c],a);for(let c=0;c<i.length;c++)this.addPendingMark(i[c]);e();for(let c=0;c<i.length;c++)this.removePendingMark(i[c],a);for(let c=0;c<s.length;c++)this.addPendingMark(s[c])}addTextNode(A){let e=A.nodeValue,n=this.top;if(n.options&Vo||n.inlineContext(A)||/[^ \t\r\n\u000c]/.test(e)){if(n.options&Po)n.options&Vo?e=e.replace(/\r\n?/g,`
|
|
4
4
|
`):e=e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=A.previousSibling;(!r||i&&i.nodeName=="BR"||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(A)}else this.findInside(A)}addElement(A,e){let n=A.nodeName.toLowerCase(),r;Uh.hasOwnProperty(n)&&this.parser.normalizeLists&&fQ(A);let i=this.options.ruleFromNode&&this.options.ruleFromNode(A)||(r=this.parser.matchTag(A,this,e));if(i?i.ignore:uQ.hasOwnProperty(n))this.findInside(A),this.ignoreFallback(A);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(A=i.skip);let s,a=this.top,c=this.needsBlock;if(Fh.hasOwnProperty(n))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!A.firstChild){this.leafFallback(A);return}i&&i.skip?this.addAll(A):this.withStyleRules(A,()=>this.addAll(A)),s&&this.sync(a),this.needsBlock=c}else this.withStyleRules(A,()=>{this.addElementByRule(A,i,i.consuming===!1?r:void 0)})}leafFallback(A){A.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(A.ownerDocument.createTextNode(`
|