ablok-components 0.3.36 → 0.3.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ablok-components.es.js +2 -3
- package/dist/ablok-components.umd.js +4 -107
- package/package.json +3 -1
- package/dist/index-C2xADkRL.mjs +0 -94
- package/dist/index-_eTitAbu.mjs +0 -13899
|
@@ -1,107 +1,4 @@
|
|
|
1
|
-
(function(B,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("dompurify"),require("vue-i18n"),require("lodash"),require("ofetch"),require("vue-advanced-cropper"),require("html2canvas"),require("qr-code-styling")):typeof define=="function"&&define.amd?define(["exports","vue","dompurify","vue-i18n","lodash","ofetch","vue-advanced-cropper","html2canvas","qr-code-styling"],a):(B=typeof globalThis<"u"?globalThis:B||self,a(B.AblokComponents={},B.Vue,B.DOMPurify,B.VueI18n,B._,B.ofetch,B.VueAdvancedCropper,B.html2canvas,B.QRCodeStyling))})(this,(function(B,a,Xo,Mr,Nr,Mn,ac,lc,Zo){"use strict";const cc={class:"icon",preserveAspectRatio:"xMaxYMin"},dc=["xlink:href"],O=a.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(n){return(e,t)=>(a.openBlock(),a.createElementBlock("i",{class:a.normalizeClass(["svg-icon",{[`svg-icon--${n.size}`]:n.size}])},[(a.openBlock(),a.createElementBlock("svg",cc,[a.createElementVNode("use",{"xlink:href":`${n.basePath}#${n.prefix}${n.symbol}`,"xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0",y:"0"},null,8,dc)]))],2))}}),uc={class:"loading-spinner d-block"},Nn=a.defineComponent({__name:"loading-spinner",props:{color:{type:String,default:"#fff"}},setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("span",uc,[t[0]||(t[0]=a.createElementVNode("span",{class:"loading-spinner__animation"},[a.createElementVNode("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100"},[a.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"},[a.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",dur:"1s",from:"0 50 50",to:"360 50 50",repeatCount:"indefinite"})])])],-1)),a.renderSlot(e.$slots,"default")]))}}),fc=["src","alt"],ut=a.defineComponent({__name:"base-image",props:{src:{type:String,default:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>',required:!0},alt:{type:String,default:""},spinner:{type:Boolean,default:!1},zoom:{type:Boolean,default:!1},animate:{type:Boolean,default:!0},ready:{type:Boolean,default:!1},pending:{type:Boolean,default:!1},emitPending:{type:Boolean,default:!0}},emits:["update:ready","update:pending"],setup(n,{emit:e}){const t=n,r=e,o=a.useTemplateRef("image"),i=a.ref(!1);function s(){i.value=!0,o.value?.addEventListener("transitionend",l,{once:!0})}function l(){r("update:ready",!0),t.emitPending&&r("update:pending",!1)}return a.onBeforeMount(()=>{t.emitPending&&r("update:pending",!0)}),(c,d)=>n.src?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["base-image",{"base-image--zoom":n.zoom}])},[n.spinner&&!i.value?(a.openBlock(),a.createBlock(Nn,{key:0})):a.createCommentVNode("",!0),a.createElementVNode("img",{ref_key:"image",ref:o,class:a.normalizeClass(["",{"opacity-0":n.animate&&!i.value,"opacity-1":!n.animate||i.value}]),src:n.src,alt:n.alt,onLoad:s},null,42,fc)],2)):a.createCommentVNode("",!0)}}),hc=["innerHTML"],pc=a.defineComponent({__name:"base-headline",props:{tag:{},size:{},variant:{},text:{},className:{}},setup(n){const e=n,t=a.computed(()=>e.tag||"p");return(r,o)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.value),{class:a.normalizeClass(["headline",`${n.size} headline--${n.size}${n.className||""}`])},{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default",{},()=>[a.createElementVNode("span",{class:"headline__text",innerHTML:n.text},null,8,hc)])]),_:3},8,["class"]))}});function Bn(n){return a.computed(()=>{const e=typeof n=="function"?n():typeof n=="string"?n:n.value;return Xo.sanitize(e,{ALLOWED_TAGS:["b","i","em","strong","u","span","p","br","a","ul","ol","li","h1","h2","h3","h4","h5","h6","article","div","label"],ALLOWED_ATTR:["class","id","href","target","rel","title","data-countdown"],ALLOW_DATA_ATTR:!0})})}function ue(n){return Xo.sanitize(n,{ALLOWED_TAGS:["b","i","em","strong","u","span","p","br","a","ul","ol","li","h1","h2","h3","h4","h5","h6","article","div","label"],ALLOWED_ATTR:["class","id","href","target","rel","title","data-countdown","v-modal"],ALLOW_DATA_ATTR:!0})}const mc=["innerHTML"],Ac=a.defineComponent({__name:"base-paragraph",props:{size:{},variant:{},text:{},className:{}},setup(n){const e=n;return Bn(()=>e.text||""),(t,r)=>(a.openBlock(),a.createElementBlock("p",{class:a.normalizeClass(["base-paragraph",`${n.size||""} ${n.className||""}`]),innerHTML:n.text},null,10,mc))}});function W(){return Math.random().toString(16).slice(2)}async function vn(n){return await new Promise(e=>{let t=new FileReader;t.onload=()=>e(t.result),t.readAsDataURL(n)})}function gc(n){const e=atob(n.split(",")[1]),t=new ArrayBuffer(e.length),r=new Uint8Array(t);for(let o=0;o<e.length;o++)r[o]=e.charCodeAt(o);return new Blob([t],{type:"image/png"})}function yc(n){return{"image/jpeg":"jpg","image/jpg":"jpg","image/png":"png","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","application/pdf":"pdf","video/mp4":"mp4","video/webm":"webm","video/ogg":"ogg"}[n]||"bin"}async function ei(n,e,t){const r=yc(t),i=e.includes(".")?e:`${e}.${r}`;return fetch(n).then(function(s){return s.arrayBuffer()}).then(function(s){return new File([s],i,{type:t})})}async function bc(n){return await new Promise((e,t)=>{const r=new Image;r.onload=()=>e(r),r.onerror=o=>t(o),r.src=n})}function ti(n,e,t,r="image/png",o){const i=document.createElement("canvas");i.width=e,i.height=t;const s=i.getContext("2d");return s?(s.drawImage(n,0,0,e,t),i.toDataURL(r,o)):n.src}async function kc(n,e,t){const r=(n.type||"").toLowerCase();if(!(r.startsWith("image/")&&r!=="image/svg+xml"))return n;const i=await vn(n),s=await bc(i),l=s.naturalWidth,c=s.naturalHeight;if(!l||l<=e)return n;const d=Math.round(e),u=c/l,f=Math.round(d*u),h=ti(s,d,f,n.type||"image/png",t);return await ei(h,n.name,n.type||"image/png")}function ni(n){return!n||typeof n!="string"?"":n.replace(/\0/g,"").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/on\w+\s*=\s*["'][^"']*["']/gi,"").replace(/on\w+\s*=\s*[^\s>]*/gi,"").replace(/javascript:/gi,"").replace(/data:text\/html/gi,"")}const wc={class:"accordion-item"},Sc=["id"],Cc=["data-bs-target","aria-controls"],Ec={class:"flex-grow-1"},xc=["id","aria-labelledby","data-bs-parent"],Mc=["innerHTML"],Nc=a.defineComponent({__name:"accordion-item",props:{id:{type:String,default:()=>W()},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:""},noPadding:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=Bn(()=>t.body);function i(){r("update:modelValue",!t.modelValue)}return(s,l)=>(a.openBlock(),a.createElementBlock("div",wc,[a.createElementVNode("div",{class:"accordion-header",id:`heading-${n.id}`},[a.createElementVNode("button",{class:a.normalizeClass(["accordion-button",!n.modelValue&&"collapsed"]),type:"button","data-bs-toggle":"collapse","data-bs-target":`#target${n.id}`,"aria-expanded":"true","aria-controls":`target${n.id}`,onClick:i},[a.renderSlot(s.$slots,"toggle",{},()=>[a.createElementVNode("span",Ec,a.toDisplayString(n.title),1)])],10,Cc)],8,Sc),a.createElementVNode("div",{class:a.normalizeClass(["accordion-collapse collapse",n.modelValue&&"show"]),id:`target${n.id}`,"aria-labelledby":`heading${n.id}`,"data-bs-parent":n.parent},[a.createElementVNode("div",{class:a.normalizeClass(["accordion-body",n.noPadding?"p-0":""])},[a.renderSlot(s.$slots,"body",{},()=>[a.createElementVNode("article",{innerHTML:a.unref(o)},null,8,Mc)])],2)],10,xc)]))}}),Bc=(n,e)=>{const t=n.__vccOpts||n;for(const[r,o]of e)t[r]=o;return t},vc={},Tc={class:"accordion"};function Dc(n,e){return a.openBlock(),a.createElementBlock("div",Tc,[a.renderSlot(n.$slots,"default")])}const Vc=Bc(vc,[["render",Dc]]),$c=["type","disabled"],ri=a.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:!1},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(n){const e=n,t=a.computed(()=>e.caption&&!e.circle);return(r,o)=>(a.openBlock(),a.createElementBlock("button",{type:n.type,disabled:n.disabled,class:a.normalizeClass(["btn",{disabled:n.disabled,pending:n.pending,rounded:n.rounded,"rounded-circle":n.circle,[`btn-${n.color}`]:!n.outlined,[`btn-outline-${n.color}`]:n.outlined,"btn-lg":n.size==="large","btn-sm":n.size==="small"}])},[n.pending?a.renderSlot(r.$slots,"pending-icon",{key:0},()=>[a.createVNode(Nn)]):a.createCommentVNode("",!0),a.renderSlot(r.$slots,"default",{},()=>[n.icon?(a.openBlock(),a.createBlock(O,{key:0,symbol:n.icon,class:"base-button__caption"},null,8,["symbol"])):a.createCommentVNode("",!0),t.value?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(["base-button__caption",{"icon-padding":n.icon}])},a.toDisplayString(n.caption),3)):a.createCommentVNode("",!0)])],10,$c))}}),Oc={class:"input-group input__input-group"},Ic=["type","id","name","placeholder","pattern","disabled","readonly","required","maxlength","true-value","false-value","aria-label","role","autocomplete"],Pc=["for","innerHTML"],Rc={key:0,class:"input__error alert alert-danger mt-3"},Nt=a.defineComponent({__name:"base-input",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},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},min:{type:Number},max:{type:Number},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"},validate:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},sanitize:{type:Boolean,default:!0}},emits:["update:modelValue","update:valid"],setup(n,{emit:e}){const t=n,r=e,o=a.useTemplateRef("input"),i=a.ref(t.valid),s=a.ref(),l=a.computed(()=>ue(`${t.label}${t.required?" *":""}`)),c=a.computed({get(){return t.modelValue},set(f){f=t.type==="number"?t.max&&Number(f)>t.max?t.max:t.min!==void 0&&Number(f)<t.min?t.min:Number(f):f,t.sanitize&&typeof f=="string"&&!["checkbox","radio","number","date","datetime-local","time","month","week","email","tel","url"].includes(t.type)&&(f=ni(f)),r("update:modelValue",f)}}),d=a.computed(()=>{if(t.type==="number"){const{min:f,max:h}=t;return{...f!==void 0?{min:f}:{},...h!==void 0?{max:h}:{}}}return{}});function u(){t.validate&&o.value&&(i.value=o.value.checkValidity(),i.value?s.value=void 0:s.value=o.value.validationMessage,r("update:valid",i.value))}return a.watch(()=>t.modelValue,()=>{i.value===!1&&u()}),a.onMounted(()=>{let f=h=>{c.value=typeof h.detail=="string"||typeof h.detail=="number"?`${h.detail}`:""};o.value?.addEventListener("focusin",h=>{window.addEventListener("update-focussed-input",f)}),o.value?.addEventListener("focusout",h=>{window.removeEventListener("update-focussed-input",f)}),u()}),(f,h)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input",`input--${n.type}${i.value?"":" input--invalid"}`])},[a.createElementVNode("div",Oc,[a.renderSlot(f.$slots,"input-prepend",{slotScope:"props"}),a.withDirectives(a.createElementVNode("input",a.mergeProps({ref_key:"input",ref:o,"onUpdate:modelValue":h[0]||(h[0]=p=>c.value=p),type:n.type==="color"?"text":n.type,id:n.id,name:n.name,placeholder:n.placeholder,pattern:n.pattern,disabled:n.disabled,readonly:n.readOnly,required:n.required,maxlength:n.maxlength},d.value,{"true-value":n.trueValue,"false-value":n.falseValue,class:["form-control",{"form-check-input":n.type==="checkbox"}],"aria-label":n.label,role:n.role,autocomplete:n.autocomplete,onChange:u}),null,16,Ic),[[a.vModelDynamic,c.value]]),a.renderSlot(f.$slots,"input-append",{slotScope:"props"})]),a.renderSlot(f.$slots,"label",{},()=>[n.label?(a.openBlock(),a.createElementBlock("label",{key:0,for:n.id,class:a.normalizeClass(["input__label",{"form-check-label":n.type==="checkbox"}]),innerHTML:l.value},null,10,Pc)):a.createCommentVNode("",!0)]),a.createVNode(a.Transition,{name:"fade"},{default:a.withCtx(()=>[!i.value&&s.value?(a.openBlock(),a.createElementBlock("div",Rc,a.toDisplayString(s.value),1)):a.createCommentVNode("",!0)]),_:1})],2))}}),Lc={class:"input input--textarea"},zc=["type","id","name","placeholder","pattern","disabled","read-only","required","maxlength","aria-label"],Fc=["for","innerHTML"],Hc=a.defineComponent({__name:"input-textarea",props:{modelValue:{type:String,default:""},type:{type:String,default:"text"},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},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},sanitize:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=a.computed({get(){return t.modelValue},set(i){t.sanitize&&typeof i=="string"&&(i=ni(i)),r("update:modelValue",i)}});return(i,s)=>(a.openBlock(),a.createElementBlock("div",Lc,[a.renderSlot(i.$slots,"input-prepend"),a.withDirectives(a.createElementVNode("textarea",{"onUpdate:modelValue":s[0]||(s[0]=l=>o.value=l),type:n.type,id:n.id,name:n.name,placeholder:n.placeholder,pattern:n.pattern,disabled:n.disabled,"read-only":n.readOnly,required:n.required,maxlength:n.maxlength,class:a.normalizeClass(["form-control",{}]),"aria-label":n.label},null,8,zc),[[a.vModelText,o.value]]),a.renderSlot(i.$slots,"input-append"),a.renderSlot(i.$slots,"label",{},()=>[a.createElementVNode("label",{for:n.id,class:a.normalizeClass(["input__label",{"form-check-label":n.type==="checkbox"}]),innerHTML:`${n.label}${n.required?" *":""}`},null,10,Fc)])]))}}),Wc={class:"form-check input input--checkbox"},qc=["value","id","name","required","disabled","true-value","false-value"],jc=["for","innerHTML"],Uc=a.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(n,{emit:e}){const t=n,r=e,o=a.computed({get(){return t.modelValue||t.checked},set(i){r("update:checked",i),r("update:modelValue",i)}});return(i,s)=>(a.openBlock(),a.createElementBlock("div",Wc,[a.withDirectives(a.createElementVNode("input",{ref:"input","onUpdate:modelValue":s[0]||(s[0]=l=>o.value=l),value:n.value,id:n.id,name:n.name,type:"checkbox",required:n.required,disabled:n.disabled,class:"form-check-input","true-value":n.trueValue,"false-value":n.falseValue},null,8,qc),[[a.vModelCheckbox,o.value]]),a.createElementVNode("label",{class:"input__label form-check-label",for:n.id,innerHTML:a.unref(ue)(n.label||"")},null,8,jc)]))}}),_c={class:"input-group input__input-group"},Qc=["id","name","placeholder","pattern","disabled","read-only","required","aria-label"],Jc=["for","innerHTML"],Kc=a.defineComponent({__name:"input-datetime",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},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}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=a.computed({get(){const i=t.modelValue&&new Date(`${t.modelValue}Z`),s=i&&new Date(i.getTime()+new Date().getTimezoneOffset()*-60*1e3).toISOString();return s&&s.replace("Z","")},set(i){const s=i&&new Date(i);i=s&&s.toISOString(),r("update:modelValue",i&&i.replace("Z",""))}});return(i,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input",`input--${n.type}`])},[a.createElementVNode("div",_c,[a.renderSlot(i.$slots,"input-prepend",{slotScope:"props"}),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=l=>o.value=l),type:"datetime-local",id:n.id,name:n.name,placeholder:n.placeholder,pattern:n.pattern,disabled:n.disabled,"read-only":n.readOnly,required:n.required,class:"form-control","aria-label":n.label},null,8,Qc),[[a.vModelText,o.value]]),a.renderSlot(i.$slots,"input-append",{slotScope:"props"})]),a.renderSlot(i.$slots,"label",{},()=>[n.label?(a.openBlock(),a.createElementBlock("label",{key:0,for:n.id,class:"input__label",innerHTML:a.unref(ue)(`${n.label}${n.required?" *":""}`)},null,8,Jc)):a.createCommentVNode("",!0)])],2))}});function He(n){return(e={})=>{const t=e.width?String(e.width):n.defaultWidth;return n.formats[t]||n.formats[n.defaultWidth]}}function fe(n){return(e,t)=>{const r=t?.context?String(t.context):"standalone";let o;if(r==="formatting"&&n.formattingValues){const s=n.defaultFormattingWidth||n.defaultWidth,l=t?.width?String(t.width):s;o=n.formattingValues[l]||n.formattingValues[s]}else{const s=n.defaultWidth,l=t?.width?String(t.width):n.defaultWidth;o=n.values[l]||n.values[s]}const i=n.argumentCallback?n.argumentCallback(e):e;return o[i]}}function he(n){return(e,t={})=>{const r=t.width,o=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],i=e.match(o);if(!i)return null;const s=i[0],l=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],c=Array.isArray(l)?Yc(l,f=>f.test(s)):Gc(l,f=>f.test(s));let d;d=n.valueCallback?n.valueCallback(c):c,d=t.valueCallback?t.valueCallback(d):d;const u=e.slice(s.length);return{value:d,rest:u}}}function Gc(n,e){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&e(n[t]))return t}function Yc(n,e){for(let t=0;t<n.length;t++)if(e(n[t]))return t}function Br(n){return(e,t={})=>{const r=e.match(n.matchPattern);if(!r)return null;const o=r[0],i=e.match(n.parsePattern);if(!i)return null;let s=n.valueCallback?n.valueCallback(i[0]):i[0];s=t.valueCallback?t.valueCallback(s):s;const l=e.slice(o.length);return{value:s,rest:l}}}const oi={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},Xc=(n,e,t)=>{let r;const o=t?.addSuffix?oi[n].withPreposition:oi[n].standalone;return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",String(e)),t?.addSuffix?t.comparison&&t.comparison>0?"in "+r:"vor "+r:r},Zc={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},ed={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},td={full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},nd={date:He({formats:Zc,defaultWidth:"full"}),time:He({formats:ed,defaultWidth:"full"}),dateTime:He({formats:td,defaultWidth:"full"})},rd={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},od=(n,e,t,r)=>rd[n],id={narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},sd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},vr={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},ad={narrow:vr.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:vr.wide},ld={narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},cd={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},dd={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},ud={ordinalNumber:n=>Number(n)+".",era:fe({values:id,defaultWidth:"wide"}),quarter:fe({values:sd,defaultWidth:"wide",argumentCallback:n=>n-1}),month:fe({values:vr,formattingValues:ad,defaultWidth:"wide"}),day:fe({values:ld,defaultWidth:"wide"}),dayPeriod:fe({values:cd,defaultWidth:"wide",formattingValues:dd,defaultFormattingWidth:"wide"})},fd=/^(\d+)(\.)?/i,hd=/\d+/i,pd={narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},md={any:[/^v/i,/^n/i]},Ad={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},gd={any:[/1/i,/2/i,/3/i,/4/i]},yd={narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},bd={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},kd={narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},wd={any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},Sd={narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},Cd={any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},Ed={ordinalNumber:Br({matchPattern:fd,parsePattern:hd,valueCallback:n=>parseInt(n)}),era:he({matchPatterns:pd,defaultMatchWidth:"wide",parsePatterns:md,defaultParseWidth:"any"}),quarter:he({matchPatterns:Ad,defaultMatchWidth:"wide",parsePatterns:gd,defaultParseWidth:"any",valueCallback:n=>n+1}),month:he({matchPatterns:yd,defaultMatchWidth:"wide",parsePatterns:bd,defaultParseWidth:"any"}),day:he({matchPatterns:kd,defaultMatchWidth:"wide",parsePatterns:wd,defaultParseWidth:"any"}),dayPeriod:he({matchPatterns:Sd,defaultMatchWidth:"wide",parsePatterns:Cd,defaultParseWidth:"any"})},xd={code:"de",formatDistance:Xc,formatLong:nd,formatRelative:od,localize:ud,match:Ed,options:{weekStartsOn:1,firstWeekContainsDate:4}},Md={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Nd=(n,e,t)=>{let r;const o=Md[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",e.toString()),t?.addSuffix?t.comparison&&t.comparison>0?"in "+r:r+" ago":r},Bd={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vd=(n,e,t,r)=>Bd[n],Td={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Dd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Vd={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$d={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Od={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Id={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Pd={ordinalNumber:(n,e)=>{const t=Number(n),r=t%100;if(r>20||r<10)switch(r%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:fe({values:Td,defaultWidth:"wide"}),quarter:fe({values:Dd,defaultWidth:"wide",argumentCallback:n=>n-1}),month:fe({values:Vd,defaultWidth:"wide"}),day:fe({values:$d,defaultWidth:"wide"}),dayPeriod:fe({values:Od,defaultWidth:"wide",formattingValues:Id,defaultFormattingWidth:"wide"})},Rd=/^(\d+)(th|st|nd|rd)?/i,Ld=/\d+/i,zd={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Fd={any:[/^b/i,/^(a|c)/i]},Hd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wd={any:[/1/i,/2/i,/3/i,/4/i]},qd={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},jd={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ud={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},_d={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Qd={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Jd={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Kd={ordinalNumber:Br({matchPattern:Rd,parsePattern:Ld,valueCallback:n=>parseInt(n,10)}),era:he({matchPatterns:zd,defaultMatchWidth:"wide",parsePatterns:Fd,defaultParseWidth:"any"}),quarter:he({matchPatterns:Hd,defaultMatchWidth:"wide",parsePatterns:Wd,defaultParseWidth:"any",valueCallback:n=>n+1}),month:he({matchPatterns:qd,defaultMatchWidth:"wide",parsePatterns:jd,defaultParseWidth:"any"}),day:he({matchPatterns:Ud,defaultMatchWidth:"wide",parsePatterns:_d,defaultParseWidth:"any"}),dayPeriod:he({matchPatterns:Qd,defaultMatchWidth:"any",parsePatterns:Jd,defaultParseWidth:"any"})},Gd={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Yd={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Xd={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Zd={date:He({formats:Gd,defaultWidth:"full"}),time:He({formats:Yd,defaultWidth:"full"}),dateTime:He({formats:Xd,defaultWidth:"full"})},ii={code:"en-US",formatDistance:Nd,formatLong:Zd,formatRelative:vd,localize:Pd,match:Kd,options:{weekStartsOn:0,firstWeekContainsDate:1}},eu={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},tu=(n,e,t)=>{let r;const o=eu[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",String(e)),t?.addSuffix?t.comparison&&t.comparison>0?"dans "+r:"il y a "+r:r},nu={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},ru={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},ou={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iu={date:He({formats:nu,defaultWidth:"full"}),time:He({formats:ru,defaultWidth:"full"}),dateTime:He({formats:ou,defaultWidth:"full"})},su={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},au=(n,e,t,r)=>su[n],lu={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},cu={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},du={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},uu={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},fu={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},hu=(n,e)=>{const t=Number(n),r=e?.unit;if(t===0)return"0";const o=["year","week","hour","minute","second"];let i;return t===1?i=r&&o.includes(r)?"ère":"er":i="ème",t+i},pu=["MMM","MMMM"],mu={preprocessor:(n,e)=>n.getDate()===1||!e.some(r=>r.isToken&&pu.includes(r.value))?e:e.map(r=>r.isToken&&r.value==="do"?{isToken:!0,value:"d"}:r),ordinalNumber:hu,era:fe({values:lu,defaultWidth:"wide"}),quarter:fe({values:cu,defaultWidth:"wide",argumentCallback:n=>n-1}),month:fe({values:du,defaultWidth:"wide"}),day:fe({values:uu,defaultWidth:"wide"}),dayPeriod:fe({values:fu,defaultWidth:"wide"})},Au=/^(\d+)(ième|ère|ème|er|e)?/i,gu=/\d+/i,yu={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},bu={any:[/^av/i,/^ap/i]},ku={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},wu={any:[/1/i,/2/i,/3/i,/4/i]},Su={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},Cu={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},Eu={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},xu={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},Mu={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},Nu={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},Bu={ordinalNumber:Br({matchPattern:Au,parsePattern:gu,valueCallback:n=>parseInt(n)}),era:he({matchPatterns:yu,defaultMatchWidth:"wide",parsePatterns:bu,defaultParseWidth:"any"}),quarter:he({matchPatterns:ku,defaultMatchWidth:"wide",parsePatterns:wu,defaultParseWidth:"any",valueCallback:n=>n+1}),month:he({matchPatterns:Su,defaultMatchWidth:"wide",parsePatterns:Cu,defaultParseWidth:"any"}),day:he({matchPatterns:Eu,defaultMatchWidth:"wide",parsePatterns:xu,defaultParseWidth:"any"}),dayPeriod:he({matchPatterns:Mu,defaultMatchWidth:"any",parsePatterns:Nu,defaultParseWidth:"any"})},vu={code:"fr",formatDistance:tu,formatLong:iu,formatRelative:au,localize:mu,match:Bu,options:{weekStartsOn:1,firstWeekContainsDate:4}},Tu={class:"row"},Du={class:"col-12"},Vu=["for","innerHTML"],$u={key:0},Ou={class:"input-group justify-content-center"},Iu={key:0,class:"row"},Pu={class:"col-12 col-md-6"},Ru={class:"col-12 col-md-6"},Lu={key:1,class:"row"},zu={class:"col-12"},Fu=a.defineComponent({__name:"input-datepicker",props:{modelValue:{type:null,default:""},from:{type:[String,Number,Boolean,Date],default:""},to:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"datetime-local"},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},label:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},range:{type:Boolean,default:!1},textRange:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},textInput:{type:Boolean,default:!0},picker:{type:Boolean,default:!0},locale:{type:String,default:"en"},utcStore:{type:Boolean,default:!1}},emits:["update:modelValue","update:from","update:to"],setup(n,{emit:e}){const t=a.shallowRef(null);a.onMounted(async()=>{const{VueDatePicker:y}=await import("@vuepic/vue-datepicker");t.value=y});const r=n,o=e,{t:i,locale:s}=Mr.useI18n(),l={en:ii,de:xd,fr:vu},c=a.computed(()=>{const y=r.locale||s.value;return l[y]||ii}),d=a.computed(()=>r.inline||!r.picker?{openMenu:!1,format:c.value}:!0),u=a.computed({get(){if(r.range){let y=r.from||(Array.isArray(r.modelValue)?r.modelValue[0]:null),b=r.to||(Array.isArray(r.modelValue)?r.modelValue[1]:null);return r.utcStore?(y=y?m(y):null,b=b?m(b):null):(y=y?new Date(`${y}Z`).toISOString().replace("Z",""):null,b=b?new Date(`${b}Z`).toISOString().replace("Z",""):null),[...y?[y]:[],...b?[b]:[]]}else{if(r.utcStore){const k=r.modelValue;return k&&m(k)||""}const y=r.modelValue?new Date(`${r.modelValue}Z`):null,b=y&&y.toISOString();return b&&b.replace("Z","")}},set(y){if(r.range&&Array.isArray(y)){let[b,k]=y;r.utcStore?(b=A(b)||null,k=A(k)||null):(b=b&&new Date(b),b?.setUTCHours(b.getHours()),b=b?.toISOString()?.replace("Z",""),k=k&&new Date(k),k?.setUTCHours(k.getHours()),k=k?.toISOString()?.replace("Z","")),o("update:modelValue",[b,k]),o("update:from",b),o("update:to",k)}else if(r.utcStore){const b=A(y);o("update:modelValue",b)}else{const b=y&&new Date(y);b?.setUTCHours(b?.getHours()),y=b&&b.toISOString(),o("update:modelValue",y&&y.replace("Z",""))}}}),f=a.computed({get(){return Array.isArray(u.value)?u.value[0]:u.value},set(y){u.value=Array.isArray(u.value)?[y,u.value[0]]:y}}),h=a.computed({get(){return Array.isArray(u.value)?u.value[1]:u.value},set(y){u.value=Array.isArray(u.value)?[u.value[0],y]:y}});a.watch(()=>[f.value,h.value],(y,b)=>{r.range&&y.some(k=>k===void 0)&&b.every(Boolean)&&(u.value=[])});function p(y){if(!y)return;const b=y.getDate(),k=y.getMonth()+1,E=y.getFullYear(),S=y.getMinutes(),x=y.getHours();switch(c.value){case"de":return`${b}.${k}.${E} ${x<10?"0"+x:x}:${S<10?"0"+S:S}`;case"fr":return`${b}/${k}/${E} ${x<10?"0"+x:x}:${S<10?"0"+S:S}`;default:return`${k}/${b}/${E} ${x<10?"0"+x:x}:${S<10?"0"+S:S}`}}function m(y){if(!y)return null;const b=y instanceof Date?new Date(y):new Date(`${y}Z`),k=b.getFullYear(),E=String(b.getMonth()+1).padStart(2,"0"),S=String(b.getDate()).padStart(2,"0"),x=String(b.getHours()).padStart(2,"0"),D=String(b.getMinutes()).padStart(2,"0"),P=String(b.getSeconds()).padStart(2,"0");return`${k}-${E}-${S}T${x}:${D}:${P}`}function A(y){return y?(y instanceof Date?new Date(y):new Date(String(y))).toISOString().split(".")[0]:null}const g=y=>(Array.isArray(y)?y=y.map(b=>p(b)).join(" - "):y=p(y),y);return(y,b)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input","input--datepicker"])},[a.renderSlot(y.$slots,"label",{},()=>[a.createElementVNode("div",Tu,[a.createElementVNode("div",Du,[n.label?(a.openBlock(),a.createElementBlock("label",{key:0,for:n.id,class:"input__label",innerHTML:a.unref(ue)(`${n.label}${n.required?" *":""}`)},null,8,Vu)):a.createCommentVNode("",!0)])])]),n.textInput?(a.openBlock(),a.createElementBlock("div",$u,[a.createElementVNode("div",Ou,[a.renderSlot(y.$slots,"input-prepend",{slotScope:"props"}),n.range&&!n.textRange?(a.openBlock(),a.createElementBlock("div",Iu,[a.createElementVNode("div",Pu,[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.value),{uid:`${n.id}-from`,modelValue:f.value,"onUpdate:modelValue":b[0]||(b[0]=k=>f.value=k),locale:c.value,format:g,"text-input":d.value,disabled:n.disabled,"read-only":n.readOnly,required:n.required,"auto-apply":!0},null,8,["uid","modelValue","locale","text-input","disabled","read-only","required"]))]),a.createElementVNode("div",Ru,[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.value),{uid:`${n.id}-to`,modelValue:h.value,"onUpdate:modelValue":b[1]||(b[1]=k=>h.value=k),locale:c.value,format:g,"text-input":d.value,disabled:n.disabled,"read-only":n.readOnly,required:n.required,"auto-apply":!0},null,8,["uid","modelValue","locale","text-input","disabled","read-only","required"]))])])):(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.value),{key:1,uid:`${n.id}-input-to`,modelValue:u.value,"onUpdate:modelValue":b[2]||(b[2]=k=>u.value=k),format:g,locale:c.value,range:n.textRange,"text-input":d.value,disabled:n.disabled,"read-only":n.readOnly,required:n.required,"auto-apply":!0},null,8,["uid","modelValue","locale","range","text-input","disabled","read-only","required"])),a.renderSlot(y.$slots,"input-append",{slotScope:"props"})])])):a.createCommentVNode("",!0),n.inline?(a.openBlock(),a.createElementBlock("div",Lu,[a.createElementVNode("div",zu,[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.value),{uid:`${n.id}-inline`,modelValue:u.value,"onUpdate:modelValue":b[3]||(b[3]=k=>u.value=k),locale:c.value,cancelText:"abbrechen",selectText:"auswählen",range:n.range,"multi-calendars":n.range,inline:{input:!1},"auto-apply":!0,"partial-range":n.range,"partial-flow":!0,"start-time":{hours:0,minutes:0},class:"justify-content-center",disabled:n.disabled,"read-only":n.readOnly,required:n.required,"month-name-format":"long"},null,8,["uid","modelValue","locale","range","multi-calendars","partial-range","disabled","read-only","required"]))])])):a.createCommentVNode("",!0)]))}}),Hu={class:"input-group input__input-group"},si=a.defineComponent({__name:"input-password",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},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},role:{type:String,default:"presentation"},autocomplete:{type:String,default:"off"},password:{type:String,default:""},confirm:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=a.computed({get(){return t.modelValue},set(i){t.password===i||!t.password?r("update:modelValue",i):r("update:modelValue","")}});return(i,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input","input-password"])},[a.createElementVNode("div",Hu,[a.createVNode(Nt,{modelValue:o.value,"onUpdate:modelValue":s[0]||(s[0]=l=>o.value=l),type:"password",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readOnly,required:n.required,label:n.label},{"input-prepend":a.withCtx(l=>[a.renderSlot(i.$slots,"input-prepend",{slotScope:"props"})]),"input-append":a.withCtx(l=>[a.renderSlot(i.$slots,"input-append",{slotScope:"props"},()=>[n.confirm&&n.modelValue===n.password?(a.openBlock(),a.createBlock(O,{key:0,symbol:"check",class:"ms-2"})):a.createCommentVNode("",!0)])]),_:3},8,["modelValue","placeholder","disabled","readonly","required","label"])])]))}}),Wu={class:"input-group input__input-group"},qu=["onUpdate:modelValue","disabled","readonly","onPaste","onInput","onKeydown"],ju=a.defineComponent({__name:"input-passcode",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},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},role:{type:String,default:"presentation"},autocomplete:{type:String,default:"off"},passcodeMatch:{type:String,default:""},confirm:{type:Boolean,default:!1},splitInput:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:e}){const t=a.ref([]),r=a.ref([]),o=n,i=e,s=a.computed({get(){return o.modelValue},set(u){o.passcodeMatch===u||!o.passcodeMatch?i("update:modelValue",u):i("update:modelValue","")}});a.watch(()=>o.modelValue,u=>{const f=u?.toString()||"";for(r.value=f.split("").slice(0,o.passcodeMatch?.length||6);r.value.length<(o.passcodeMatch?.length||6);)r.value.push("")},{immediate:!0}),a.watch(()=>r.value,u=>{const f=u.join("");o.passcodeMatch===f||!o.passcodeMatch?i("update:modelValue",f):i("update:modelValue","")},{deep:!0});const l=(u,f)=>{u.preventDefault();const h=u.clipboardData?.getData("text")||"";console.log("Paste detected:",h);const p=h.split(""),m=o.passcodeMatch?.length||6;p.forEach((g,y)=>{const b=f+y;b<m&&(r.value[b]=g)});const A=Math.min(f+p.length,m-1);setTimeout(()=>t.value[A]?.focus(),0)},c=(u,f)=>{o.passcodeMatch?.length,u.key==="Backspace"&&!r.value[f]&&f>0&&t.value[f-1]?.focus()},d=(u,f)=>{let p=u.target.value;p.length>1&&(p=p.slice(-1)),r.value[f]=p;const m=o.passcodeMatch?.length||6;p&&f<m-1&&setTimeout(()=>t.value[f+1]?.focus(),0)};return(u,f)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input","input-passcode"])},[a.createElementVNode("div",Wu,[n.splitInput?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:1},a.renderList(n.passcodeMatch,(h,p)=>a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:p,"onUpdate:modelValue":m=>r.value[p]=m,type:"text",ref_for:!0,ref:m=>t.value[p]=m,maxlength:1,disabled:n.disabled,readonly:n.readOnly,onPaste:m=>l(m,p),onInput:m=>d(m,p),onKeydown:m=>c(m,p),size:"1",class:"form-control text-center"},null,40,qu)),[[a.vModelText,r.value[p]]])),128)):(a.openBlock(),a.createBlock(si,{key:0,modelValue:s.value,"onUpdate:modelValue":f[0]||(f[0]=h=>s.value=h),type:n.type,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readOnly,required:n.required,label:n.label},null,8,["modelValue","type","placeholder","disabled","readonly","required","label"]))])]))}}),Uu={class:"check-group"},_u=["id","name","value","disabled","read-only","required"],Qu=["for","innerHTML"],Ju=a.defineComponent({__name:"check-group",props:{modelValue:{type:null,default:()=>[]},options:{type:Array,required:!0},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},label:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e;a.ref([]);const o=a.computed({get(){return t.modelValue},set(s){r("update:modelValue",s)}}),i=a.computed(()=>t.options&&t.options.map(s=>(s=typeof s=="string"?{text:s,value:s}:s,{...s,active:t.modelValue&&t.modelValue.includes(s.value)})));return(s,l)=>(a.openBlock(),a.createElementBlock("div",Uu,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,(c,d)=>(a.openBlock(),a.createElementBlock("div",{key:d,class:"form-check"},[a.withDirectives(a.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":l[0]||(l[0]=u=>o.value=u),id:`${n.id}-${d}`,name:n.name,class:"form-check-input",value:c.value||c,disabled:n.disabled,"read-only":n.readOnly,required:n.required},null,8,_u),[[a.vModelCheckbox,o.value]]),a.createElementVNode("label",{class:"form-check-label",for:`${n.id}-${d}`,innerHTML:c.text},null,8,Qu)]))),128))]))}}),Ku={class:"input radio-group"},Gu=["id","name","value","checked","disabled","read-only","required","onChange"],Yu=["for","innerHTML"],Xu=["for"],Tn=a.defineComponent({__name:"radio-group",props:{modelValue:{type:null},options:{type:Array,default:[]},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},label:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},keyOption:{type:null},itemClass:{type:String,default:""}},emits:["change","update:modelValue"],setup(n,{emit:e}){const t=e;function r(o){t("update:modelValue",o)}return(o,i)=>(a.openBlock(),a.createElementBlock("div",Ku,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.options,(s,l)=>(a.openBlock(),a.createElementBlock("div",{key:l,class:a.normalizeClass(["form-check",n.itemClass])},[a.createElementVNode("input",{type:"radio",id:`${n.id}-${l}`,name:n.name,class:a.normalizeClass(["form-check-input",`
|
|
2
|
-
${
|
|
3
|
-
${(
|
|
4
|
-
`]),value:s.value||s,checked:s.value?s.value===n.modelValue?.value:s===n.modelValue,disabled:n.disabled,"read-only":n.readOnly,required:n.required,onChange:c=>r(s)},null,42,Gu),a.renderSlot(o.$slots,"option-label",{option:s,index:l},()=>[a.createElementVNode("label",{class:"form-check-label",for:`${n.id}-${l}`,innerHTML:a.unref(ue)(s.text||"")},null,8,Yu)])],2))),128)),a.renderSlot(o.$slots,"label",{},()=>[n.label?(a.openBlock(),a.createElementBlock("label",{key:0,for:n.id},a.toDisplayString(n.label),9,Xu)):a.createCommentVNode("",!0)])]))}}),Zu={class:"radio-buttons"},ef=["for"],tf=a.defineComponent({__name:"radio-buttons",props:{modelValue:{type:null,default:""},options:{type:Array,default:[]},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},label:{type:String},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},keyOption:{type:null},itemClass:{type:String,default:""}},emits:["update:modelValue","update:selection"],setup(n,{emit:e}){const t=n,r=e,o=a.computed({get(){return t.modelValue},set(i){r("update:modelValue",i)}});return(i,s)=>(a.openBlock(),a.createElementBlock("div",Zu,[a.createVNode(Tn,{modelValue:o.value,"onUpdate:modelValue":s[0]||(s[0]=l=>o.value=l),options:n.options,name:n.name,id:n.id,disabled:n.disabled,required:n.required,class:"d-flex flex-column gap-3 justify-content-center"},{"option-label":a.withCtx(l=>[a.createElementVNode("label",{for:`${n.id}-${l.index}`,class:"d-block btn btn-outline-primary p-3 fw-bold",role:"button"},a.toDisplayString(l.option.text),9,ef)]),_:1},8,["modelValue","options","name","id","disabled","required"])]))}}),nf=["id","name","multiple","accept","disabled"],rf={class:"input__input-group input-group"},of=["value","id","name","disabled"],sf=["for","disabled"],af={class:"btn btn-outline-contrast"},lf=["for"],cf=["innerHTML"],Tr=a.defineComponent({__name:"input-file",props:{modelValue:{type:Array,default:[]},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},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},maxFileSize:{type:Number,default:0},dropzone:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e;function o(c){const d=c.target&&c.target.files;d&&(s.splice(0,s.length),Array.from(d).forEach(u=>{if(t.maxFileSize&&u.size>t.maxFileSize){console.warn(`File ${u.name} exceeds the ${t.maxFileSize} bytes size limit and will not be added.`);return}s.push(u)}))}const i=a.ref(),s=a.reactive([]),l=a.computed(()=>s&&s.map(c=>c.name));return a.watch(()=>t.modelValue,(c,d)=>{c.length===0&&(i.value.value=null)},{deep:!0}),a.watch(()=>s,(c,d)=>{r("update:modelValue",c)},{deep:!0}),(c,d)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input input-file","input-file--primary"])},[a.createElementVNode("input",{ref_key:"input",ref:i,type:"file",id:n.id,name:n.name,class:"d-none",onChange:o,multiple:n.multiple,accept:n.accept,disabled:n.disabled},null,40,nf),a.createElementVNode("div",rf,[a.renderSlot(c.$slots,"input-prepend"),a.createElementVNode("input",{type:"text",value:l.value,id:n.id,name:n.name,class:"form-control",disabled:n.disabled},null,8,of),a.renderSlot(c.$slots,"input-append",{},()=>[a.createElementVNode("label",{for:n.id,disabled:n.disabled},[a.renderSlot(c.$slots,"button",{},()=>[a.createElementVNode("span",af,a.toDisplayString(c.$t("common.selectFile")),1)])],8,sf)])]),a.createElementVNode("label",{for:n.id},[a.renderSlot(c.$slots,"label",{},()=>[a.createElementVNode("span",{class:"input__label",innerHTML:a.unref(ue)(`${n.label}${n.required?" *":""}`)},null,8,cf)])],8,lf)]))}}),df={key:0,class:"custom-html"},uf=["innerHTML"],ff=a.defineComponent({__name:"custom-html",props:{content:{}},setup(n){const e=a.ref(!1);return a.onMounted(()=>{window!==void 0&&(e.value=!0)}),(t,r)=>e.value?(a.openBlock(),a.createElementBlock("div",df,[a.renderSlot(t.$slots,"default",{},()=>[a.createElementVNode("div",{class:"custom-html__content",innerHTML:n.content},null,8,uf)])])):a.createCommentVNode("",!0)}}),hf={class:"select-media"},pf=["for"],mf=a.defineComponent({__name:"select-media",props:{modelValue:{type:null,default:""},assets:{type:Array,default:[]},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},label:{type:String},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},emitKey:{type:String,default:"src"}},emits:["update:modelValue","update:selection"],setup(n,{emit:e}){const t=n,r=e,o=a.computed({get(){return t.modelValue},set(i){const s=t.assets.find(l=>l.id===i);r("update:modelValue",t.emitKey?s[t.emitKey]:s),t.emitKey&&t.emitKey!=="id"&&r("update:selection",s.id)}});return(i,s)=>(a.openBlock(),a.createElementBlock("div",hf,[a.createVNode(Tn,{modelValue:o.value,"onUpdate:modelValue":s[0]||(s[0]=l=>o.value=l),options:n.assets.map(l=>l.id),name:n.name,id:n.id,disabled:n.disabled,required:n.required,class:"d-flex flex-wrap flex-row justify-content-center",itemClass:"col-6 p-2"},{"option-label":a.withCtx(l=>[a.createElementVNode("label",{for:`${n.id}-${l.index}`,class:a.normalizeClass(["w-100",{"is-active":n.assets[l.index].id===o.value}]),role:"button"},[n.assets[l.index].thumbnail?(a.openBlock(),a.createBlock(ut,{key:0,src:n.assets[l.index].thumbnail,alt:n.assets[l.index].id},null,8,["src","alt"])):a.createCommentVNode("",!0)],10,pf)]),_:1},8,["modelValue","options","name","id","disabled","required"])]))}}),Af={class:"rte-editor"},gf={key:0,class:"rte-editor__controls mb-2"},yf=["disabled"],bf=["disabled"],kf={class:"btn-group"},wf=["disabled"],Sf=["disabled"],Cf={class:"btn-group"},Ef={class:"dropdown"},xf={class:"btn dropdown-toggle btn-light","data-bs-toggle":"dropdown",role:"button",type:"button"},Mf={class:"dropdown-menu"},Nf={class:"dropdown"},Bf={class:"btn dropdown-toggle btn-light","data-bs-toggle":"dropdown",role:"button",type:"button"},vf={class:"dropdown-menu"},Tf={class:"btn-group"},Df=["disabled"],Vf=["disabled"],$f=a.defineComponent({__name:"rte-editor",props:{modelValue:{type:String,default:""},disabled:{type:Boolean,default:!1},iconBasePath:{type:String,default:"/rte-icons-defs.svg"}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=a.ref(!1),i=a.shallowRef(void 0),s=a.shallowRef(null);a.onMounted(async()=>{const[{Editor:u,mergeAttributes:f},{EditorContent:h},{default:p},{default:m},{default:A},{default:g},{default:y}]=await Promise.all([Promise.resolve().then(()=>U0),import("@tiptap/vue-3"),import("@tiptap/extension-highlight"),import("@tiptap/extension-text-align"),import("@tiptap/extension-link"),import("@tiptap/starter-kit"),Promise.resolve().then(()=>Q0)]);s.value=h,i.value=new u({content:t.modelValue,onUpdate:()=>{r("update:modelValue",i.value?.getHTML())},extensions:[g.configure({bold:!1}),y.extend({addAttributes(){return{class:{default:null}}},parseHTML(){return[{tag:"strong"},{tag:"b"}]},renderHTML({HTMLAttributes:b}){return["strong",f(this.options.HTMLAttributes,b),0]}}),m.configure({types:["heading","paragraph"]}),p,A.extend({addAttributes(){return{...this.parent?.(),class:{default:null},id:{default:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:b=>({href:b.getAttribute("href"),target:b.getAttribute("target"),rel:b.getAttribute("rel"),class:b.getAttribute("class"),id:b.getAttribute("id"),title:b.getAttribute("title")})},{tag:"a:not([href])",getAttrs:b=>({href:null,target:b.getAttribute("target"),rel:b.getAttribute("rel"),class:b.getAttribute("class"),id:b.getAttribute("id"),title:b.getAttribute("title")})}]},renderHTML({HTMLAttributes:b}){if(!b.href){const{href:k,target:E,rel:S,...x}=b;return["a",f(x),0]}return["a",f(this.options.HTMLAttributes,b),0]}}).configure({openOnClick:!1,autolink:!0,defaultProtocol:"https",protocols:["http","https"],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}})]})}),a.onBeforeUnmount(()=>{i.value?.destroy()}),a.watch(()=>t.modelValue,(u,f)=>{if(i.value){if(i.value.getHTML()===u)return;i.value.commands.setContent(u)}});function l(){const u=i.value?.getAttributes("link").href,f=window.prompt("URL",u);if(f!==null){if(f===""){i.value?.chain().focus().extendMarkRange("link").unsetLink().run();return}try{i.value?.chain().focus().extendMarkRange("link").setLink({href:f}).run()}catch(h){alert(h.message)}}}const c=()=>{i.value?.commands.setContent(`<textarea>${i.value.getHTML()}</textarea>`),o.value=!0},d=()=>{i.value?.commands.setContent(i.value.getText()),o.value=!1};return(u,f)=>(a.openBlock(),a.createElementBlock("div",Af,[i.value?(a.openBlock(),a.createElementBlock("div",gf,[o.value?(a.openBlock(),a.createElementBlock("button",{key:1,class:"btn btn-sm btn-light is-active",onClick:d,disabled:!i.value.can().chain().focus().toggleCode().run(),title:"Toggle Source"},[a.createVNode(O,{symbol:"source","base-path":n.iconBasePath},null,8,["base-path"])],8,bf)):(a.openBlock(),a.createElementBlock("button",{key:0,class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive("code")}]),onClick:c,disabled:!i.value.can().chain().focus().toggleCode().run(),title:"Toggle Source"},[a.createVNode(O,{symbol:"source","base-path":n.iconBasePath},null,8,["base-path"])],10,yf)),a.createElementVNode("div",kf,[a.createElementVNode("button",{class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive("bold")}]),onClick:f[0]||(f[0]=h=>i.value?.chain().focus().toggleBold().run()),disabled:!i.value.can().chain().focus().toggleBold().run(),title:"Toggle Bold"},[a.createVNode(O,{symbol:"bold","base-path":n.iconBasePath},null,8,["base-path"])],10,wf),a.createElementVNode("button",{class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive("italic")}]),onClick:f[1]||(f[1]=h=>i.value?.chain().focus().toggleItalic().run()),disabled:!i.value.can().chain().focus().toggleItalic().run(),title:"Toggle Italic"},[a.createVNode(O,{symbol:"italic","base-path":n.iconBasePath},null,8,["base-path"])],10,Sf)]),a.createElementVNode("div",Cf,[a.createElementVNode("div",Ef,[a.createElementVNode("button",xf,[i.value.isActive("heading",{level:1})?(a.openBlock(),a.createBlock(O,{key:0,symbol:"h1","base-path":n.iconBasePath},null,8,["base-path"])):i.value.isActive("heading",{level:2})?(a.openBlock(),a.createBlock(O,{key:1,symbol:"h2","base-path":n.iconBasePath},null,8,["base-path"])):i.value.isActive("heading",{level:3})?(a.openBlock(),a.createBlock(O,{key:2,symbol:"h3","base-path":n.iconBasePath},null,8,["base-path"])):i.value.isActive("heading",{level:4})?(a.openBlock(),a.createBlock(O,{key:3,symbol:"h4","base-path":n.iconBasePath},null,8,["base-path"])):(a.openBlock(),a.createBlock(O,{key:4,symbol:"headline","base-path":n.iconBasePath},null,8,["base-path"]))]),a.createElementVNode("ul",Mf,[a.createElementVNode("li",null,[a.createElementVNode("button",{class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive("heading",{level:1})}]),onClick:f[2]||(f[2]=h=>i.value?.chain().focus().setHeading({level:1}).run()),title:"Set Heading 1"},[a.createVNode(O,{symbol:"h1","base-path":n.iconBasePath},null,8,["base-path"])],2)]),a.createElementVNode("li",null,[a.createElementVNode("button",{class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive("heading",{level:2})}]),onClick:f[3]||(f[3]=h=>i.value?.chain().focus().setHeading({level:2}).run()),title:"Set Heading 2"},[a.createVNode(O,{symbol:"h2","base-path":n.iconBasePath},null,8,["base-path"])],2)]),a.createElementVNode("li",null,[a.createElementVNode("button",{class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive("heading",{level:3})}]),onClick:f[4]||(f[4]=h=>i.value?.chain().focus().setHeading({level:3}).run()),title:"Set Heading 3"},[a.createVNode(O,{symbol:"h3","base-path":n.iconBasePath},null,8,["base-path"])],2)]),a.createElementVNode("li",null,[a.createElementVNode("button",{class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive("heading",{level:4})}]),onClick:f[5]||(f[5]=h=>i.value?.chain().focus().setHeading({level:4}).run()),title:"Set Heading 4"},[a.createVNode(O,{symbol:"h4","base-path":n.iconBasePath},null,8,["base-path"])],2)])])]),a.createElementVNode("button",{class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive("paragraph")}]),onClick:f[6]||(f[6]=h=>i.value?.chain().focus().setParagraph().run()),title:"Set Paragraph"},[a.createVNode(O,{symbol:"paragraph","base-path":n.iconBasePath},null,8,["base-path"])],2),a.createElementVNode("button",{class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive("bulletList")}]),onClick:f[7]||(f[7]=h=>i.value?.chain().focus().toggleBulletList().run()),title:"Toggle Bullet List"},[a.createVNode(O,{symbol:"list","base-path":n.iconBasePath},null,8,["base-path"])],2),a.createElementVNode("button",{class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive("orderedList")}]),onClick:f[8]||(f[8]=h=>i.value?.chain().focus().toggleOrderedList().run()),title:"Toggle Ordered List"},[a.createVNode(O,{symbol:"ordered-list","base-path":n.iconBasePath},null,8,["base-path"])],2)]),a.createElementVNode("div",Nf,[a.createElementVNode("button",Bf,[i.value.isActive({textAlign:"center"})?(a.openBlock(),a.createBlock(O,{key:0,symbol:"align-center","base-path":n.iconBasePath},null,8,["base-path"])):i.value.isActive({textAlign:"left"})?(a.openBlock(),a.createBlock(O,{key:1,symbol:"align-left","base-path":n.iconBasePath},null,8,["base-path"])):i.value.isActive({textAlign:"right"})?(a.openBlock(),a.createBlock(O,{key:2,symbol:"align-right","base-path":n.iconBasePath},null,8,["base-path"])):(a.openBlock(),a.createBlock(O,{key:3,symbol:"align-justify","base-path":n.iconBasePath},null,8,["base-path"]))]),a.createElementVNode("ul",vf,[a.createElementVNode("li",null,[a.createElementVNode("button",{class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive({textAlign:"left"})}]),onClick:f[9]||(f[9]=h=>i.value?.chain().focus().setTextAlign("left").run())},[a.createVNode(O,{symbol:"align-left","base-path":n.iconBasePath},null,8,["base-path"])],2)]),a.createElementVNode("li",null,[a.createElementVNode("button",{class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive({textAlign:"center"})}]),onClick:f[10]||(f[10]=h=>i.value?.chain().focus().setTextAlign("center").run())},[a.createVNode(O,{symbol:"align-center","base-path":n.iconBasePath},null,8,["base-path"])],2)]),a.createElementVNode("li",null,[a.createElementVNode("button",{class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive({textAlign:"right"})}]),onClick:f[11]||(f[11]=h=>i.value?.chain().focus().setTextAlign("right").run())},[a.createVNode(O,{symbol:"align-right","base-path":n.iconBasePath},null,8,["base-path"])],2)]),a.createElementVNode("li",null,[a.createElementVNode("button",{class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive({textAlign:"pretty"})}]),onClick:f[12]||(f[12]=h=>i.value?.chain().focus().setTextAlign("right").run())},[a.createVNode(O,{symbol:"align-justify","base-path":n.iconBasePath},null,8,["base-path"])],2)])])]),i.value.isActive("link")?(a.openBlock(),a.createElementBlock("button",{key:3,class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive("link")}]),onClick:f[13]||(f[13]=h=>i.value.chain().focus().unsetLink().run()),title:"Unset Link"},[a.createVNode(O,{symbol:"unlink","base-path":n.iconBasePath},null,8,["base-path"])],2)):(a.openBlock(),a.createElementBlock("button",{key:2,class:a.normalizeClass(["btn btn-sm btn-light",{"is-active":i.value.isActive("link")}]),onClick:l,title:"Set Link"},[a.createVNode(O,{symbol:"link","base-path":n.iconBasePath},null,8,["base-path"])],2)),a.createElementVNode("div",Tf,[a.createElementVNode("button",{class:"btn btn-sm btn-light",onClick:f[14]||(f[14]=h=>i.value?.chain().focus().undo().run()),disabled:!i.value.can().chain().focus().undo().run(),title:"Undo"},[a.createVNode(O,{symbol:"undo","base-path":n.iconBasePath},null,8,["base-path"])],8,Df),a.createElementVNode("button",{class:"btn btn-sm btn-light",onClick:f[15]||(f[15]=h=>i.value?.chain().focus().redo().run()),disabled:!i.value.can().chain().focus().redo().run(),title:"Redo"},[a.createVNode(O,{symbol:"redo","base-path":n.iconBasePath},null,8,["base-path"])],8,Vf)])])):a.createCommentVNode("",!0),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(s.value),{class:"rte-editor__content",editor:i.value},null,8,["editor"]))]))}}),Of={class:"input-color"},If={class:"base-input__color-swatch"},Pf=["name","id","disabled","read-only","required","aria-label"],Rf=a.defineComponent({__name:"input-color",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},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}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=a.computed({get(){return t.modelValue},set(i){r("update:modelValue",i)}});return(i,s)=>(a.openBlock(),a.createElementBlock("div",Of,[a.createVNode(Nt,{modelValue:o.value,"onUpdate:modelValue":s[1]||(s[1]=l=>o.value=l),type:n.type==="color"?"text":n.type,id:n.id,name:n.name,placeholder:n.placeholder,pattern:n.pattern,label:n.label,disabled:n.disabled,"read-only":n.readOnly,required:n.required,maxlength:n.maxlength},{"input-append":a.withCtx(l=>[a.createElementVNode("span",If,[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=c=>o.value=c),type:"color",name:`${n.name}-color`,id:`${n.id}-color`,disabled:n.disabled,"read-only":n.readOnly,required:n.required,class:"form-control","aria-label":n.label},null,8,Pf),[[a.vModelText,o.value]])])]),_:1},8,["modelValue","type","id","name","placeholder","pattern","label","disabled","read-only","required","maxlength"])]))}}),Lf={class:"color-palette"},zf=["for"],Ff=a.defineComponent({__name:"color-palette",props:{modelValue:{type:[String],default:""},colors:{type:Array,default:["#000000","#FFFFFF"]},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},label:{type:String},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=a.computed({get(){return t.modelValue},set(i){r("update:modelValue",i)}});return(i,s)=>(a.openBlock(),a.createElementBlock("div",Lf,[a.createVNode(Tn,{modelValue:o.value,"onUpdate:modelValue":s[0]||(s[0]=l=>o.value=l),options:n.colors,name:n.name,id:n.id,label:n.label,disabled:n.disabled,required:n.required,class:"d-flex flex-wrap flex-row gap-2"},{"option-label":a.withCtx(l=>[a.createElementVNode("label",{for:`${n.id}-${l.index}`,class:"d-block rounded-circle",style:a.normalizeStyle({backgroundColor:l.option})},null,12,zf)]),_:1},8,["modelValue","options","name","id","label","disabled","required"])]))}}),Hf=["id"],Wf=["for","innerHTML"],qf={class:"dropdown"},jf={class:"caption"},Uf=["innerHTML"],_f={class:"caption__text"},Qf={class:"d-block text-truncate"},Jf={class:"dropdown-menu"},Kf={class:"form-check d-flex"},Gf=["value","id","name","label","required","disabled"],Yf=["value","id","name","label","required","disabled"],Xf=["for"],Dn=a.defineComponent({__name:"input-dropdown",props:{id:{type:String},name:{type:String,default:()=>`dropdown-${W()}`},label:{type:String},error:{type:String},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},modelValue:{type:null},options:{type:Array,required:!0},multiple:{type:Boolean,default:!1},showSelectionCount:{type:Boolean,default:!1},toggleCaption:{type:String},placeholder:{type:String,default:""},icon:{default:"chevron-down",type:String},variant:{type:String,default:""},color:{type:String,default:""},outlined:{type:Boolean,default:!1},exactMatch:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:e}){const{t}=Mr.useI18n(),r=n,o=e,i=a.computed({get(){return r.multiple&&!r.modelValue?[]:r.modelValue},set(c){o("update:modelValue",c)}}),s=a.computed(()=>r.options&&r.options.map(c=>(c=typeof c=="string"?{text:c,value:c}:c,{...c,active:r.modelValue&&c.value&&(r.exactMatch?r.modelValue===c.value:r.multiple?r.modelValue.includes(c.value):r.modelValue===c.value)}))),l=a.computed(()=>{if(!r.modelValue)return r.placeholder||`${t("common.select")}`;if(r.multiple&&Array.isArray(r.modelValue)&&r.modelValue.length)return s.value.reduce((c,d)=>r.modelValue.includes(d.value)?`${c}${c?", ":""}${d.text}`:c,"");if(!r.multiple){const c=s.value.find(d=>typeof d.value=="object"&&d.value!==null?JSON.stringify(d.value)===JSON.stringify(r.modelValue):d.value===r.modelValue);return c?c.text:r.placeholder||`${t("common.select")}`}return r.placeholder||`${t("common.select")}`});return(c,d)=>(a.openBlock(),a.createElementBlock("div",{class:"input input-dropdown",id:`${n.id||n.name}`},[a.renderSlot(c.$slots,"label",{},()=>[n.label?(a.openBlock(),a.createElementBlock("label",{key:0,for:`${n.id||n.name}--dropdown-toggle`,class:"input__label",innerHTML:`${n.label}${n.required?" *":""}`},null,8,Wf)):a.createCommentVNode("",!0)]),a.createElementVNode("div",qf,[a.createVNode(ri,{id:`${n.id||n.name}--dropdown-toggle`,"data-bs-toggle":"dropdown",role:"button",type:"button",title:l.value,class:"btn dropdown-toggle",color:n.color,outlined:n.outlined,disabled:n.disabled},{default:a.withCtx(()=>[a.createElementVNode("span",jf,[a.createVNode(a.Transition,{name:"bounce"},{default:a.withCtx(()=>[n.showSelectionCount&&n.modelValue.length?(a.openBlock(),a.createElementBlock("i",{key:0,class:"caption__count",innerHTML:n.modelValue.length},null,8,Uf)):a.createCommentVNode("",!0)]),_:1}),a.createElementVNode("span",_f,[a.createElementVNode("span",Qf,a.toDisplayString(n.toggleCaption||l.value),1)])])]),_:1},8,["id","title","color","outlined","disabled"]),a.createElementVNode("ul",Jf,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.value,(u,f)=>(a.openBlock(),a.createElementBlock("li",{key:`${u.value}-${f}`},[a.createElementVNode("div",{class:a.normalizeClass(["dropdown-item",u.active&&"active"])},[a.createElementVNode("div",Kf,[n.multiple?a.withDirectives((a.openBlock(),a.createElementBlock("input",{type:"checkbox","onUpdate:modelValue":d[0]||(d[0]=h=>i.value=h),value:u.value,key:`${n.name}-${u.value}-${f}__if`,id:`${n.name}-${u.value}-${f}`,name:n.name,label:u.text,required:n.required,disabled:u.selectable===!1,class:"form-check-input"},null,8,Gf)),[[a.vModelCheckbox,i.value]]):a.withDirectives((a.openBlock(),a.createElementBlock("input",{type:"radio","onUpdate:modelValue":d[1]||(d[1]=h=>i.value=h),value:u.value,key:`${n.name}-${u.value}-${f}__else`,id:`${n.name}-${u.value}-${f}`,name:n.name,label:u.text,required:n.required,disabled:u.selectable===!1,class:"form-check-input visually-hidden"},null,8,Yf)),[[a.vModelRadio,i.value]]),a.createElementVNode("label",{class:"form-check-label flex-grow-1",onclick:"event.stopPropagation",for:`${n.name}-${u.value}-${f}`},a.toDisplayString(u.text),9,Xf)])],2)]))),128))])])],8,Hf))}}),Zf={key:0,class:"auto-suggest__suggestions position-relative"},eh={class:"suggestions dropdown-menu show w-100 mt-2"},th=["onClick"],nh=["innerHTML"],ai=a.defineComponent({__name:"auto-suggest",props:{modelValue:{type:String},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},options:{type:Array,default:[]},placeholder:{type:String,default:""},color:{type:String,default:""},outlined:{type:Boolean,default:!1},selection:{type:String}},emits:["update:modelValue","update:selection"],setup(n,{emit:e}){const t=n,r=e,o=a.ref(),i=a.ref(!1),s=a.computed({get(){return t.modelValue},set(p){r("update:modelValue",p)}}),l=a.computed(()=>{const p=new RegExp(`(${s.value})`,"i");return s.value?t.options.filter(m=>p.test(m)):t.options}),c=a.computed(()=>{const p=new RegExp(`(${s.value})`,"i");return l.value.map(m=>{const A=m.replace(p,"<strong>$1</strong>");return ue(A)})});a.watch(()=>t.options,(p,m)=>{p.length&&(i.value=!0)},{deep:!0});function d(){t.options.length&&(i.value=!0)}function u(p){i.value=!1;const m=l.value[p];r("update:modelValue",m),r("update:selection",m)}const f=a.ref();function h(p){const m=p.target;i.value&&m&&!o.value.contains(m)&&(i.value=!1)}return a.onBeforeMount(()=>{f.value=document.addEventListener("click",h)}),a.onBeforeUnmount(()=>{document.removeEventListener("click",f.value)}),(p,m)=>(a.openBlock(),a.createElementBlock("div",{class:"auto-suggest",ref_key:"container",ref:o},[a.createElementVNode("div",{class:"auto-suggest__input",onFocusCapture:d},[a.renderSlot(p.$slots,"default",{},()=>[a.createVNode(Nt,a.mergeProps({modelValue:s.value,"onUpdate:modelValue":m[0]||(m[0]=A=>s.value=A)},p.$props),null,16,["modelValue"])])],32),i.value&&l.value.length?(a.openBlock(),a.createElementBlock("div",Zf,[a.createElementVNode("ul",eh,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.value,(A,g)=>(a.openBlock(),a.createElementBlock("li",{key:A,class:"suggestions__item dropdown-item",onClick:a.withModifiers(y=>u(g),["prevent"])},[a.createElementVNode("p",{class:"text-truncate my-2",innerHTML:A},null,8,nh)],8,th))),128))])])):a.createCommentVNode("",!0)],512))}});function li(n){const e=a.computed(()=>{if(!n.tintColor)return null;const s=n.tintColor.replace("#",""),l=parseInt(s.substring(0,2),16),c=parseInt(s.substring(2,4),16),d=parseInt(s.substring(4,6),16);return{r:l,g:c,b:d}});function t(s,l,c){if(n.filter==="none"&&!n.tintColor)return;const d=s.getImageData(0,0,l,c),u=d.data;if(n.filter==="grayscale")for(let f=0;f<u.length;f+=4){const h=.299*u[f]+.587*u[f+1]+.114*u[f+2];u[f]=h,u[f+1]=h,u[f+2]=h}else if(n.filter==="sepia")for(let f=0;f<u.length;f+=4){const h=u[f],p=u[f+1],m=u[f+2];u[f]=Math.min(255,.393*h+.769*p+.189*m),u[f+1]=Math.min(255,.349*h+.686*p+.168*m),u[f+2]=Math.min(255,.272*h+.534*p+.131*m)}if(n.tintColor&&e.value){const{r:f,g:h,b:p}=e.value,m=n.tintIntensity;for(let A=0;A<u.length;A+=4){const g=u[A],y=u[A+1],b=u[A+2],k=g*f/255,E=y*h/255,S=b*p/255;u[A]=g+(k-g)*m,u[A+1]=y+(E-y)*m,u[A+2]=b+(S-b)*m}}s.putImageData(d,0,0)}async function r(s){if(typeof s!="string")return s.complete&&s.naturalWidth>0||await new Promise((c,d)=>{s.onload=()=>c(),s.onerror=()=>d(new Error("Failed to load image element"))}),s;const l=new Image;return await new Promise((c,d)=>{l.onload=()=>c(),l.onerror=()=>d(new Error("Failed to load image source")),l.src=s}),l}async function o(s,l={}){const c=await r(s),d=document.createElement("canvas"),u=l.width||c.naturalWidth||c.width,f=l.height||c.naturalHeight||c.height;d.width=u,d.height=f;const h=d.getContext("2d");if(!h)throw new Error("Could not create canvas context");return h.drawImage(c,0,0,u,f),t(h,u,f),d.toDataURL(l.mimeType||"image/png",l.quality)}async function i(s,l={}){const c=await o(s,l);return(await fetch(c)).blob()}return{tintRgb:e,applyFilterToCanvas:t,applyFilterToImage:o,applyFilterToImageBlob:i}}const rh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAYAAAB/HSuDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAHkJJREFUeNrs3Q1u8zaXgNHS8JK4/xVwTyzytgnS1HZsixR/7jlAgZkMBl+hT6Z1H1FyqrX+BQAAAOzt4hAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAEA0V4cAANaTc64j//NLKcl/CwCwllRrdRQAwJDfjDgAAHPyCAAAGP79uwOAAAAAAAAIAAAAAIAAAAAAAAgAAAAAwEn8CgAATOq3l+mNetv+rP9eAIAAAAAAAOF5BAAAAAAEAAAAAEAAAAAAAJZwdQgA2N2tl9Z5UZ1zwjkBQDReAghAmAHPwIdzA4DI7AAAINxwB8+eR0IAADuxAwCA0IO/Ac954jwBQAAAgE2HOUOd88Z5A0BEHgEAINwABy3OPyEAgNXYAQBAyMHf8OZcci4BIAAAwKbDmkEN5xcAAgAAGMxwvjnfABAAAGC1QcwQhnMQAAQAAAxd4JwEQAAAAEMWOEcBEAAAYKrBylCF8xUABAAANh2kDFE4hwFAAADA0ATOaQC44eIQAGBQgvcdOTdb/fQgADzDDgAADP7gXAdAAACAMQORYQjnPQAIAAAYgMDnAAAEAAAMPLD+58JnAgABAADDP/h8AIAAAMA6w43BBp8VnxUABAAADDPgs+OzA0BDF4cAgDMZYMBnAYAxrg4BAIYdGPu5ePf9AADwCjsAADD8g88IAAHYAQCAoQYm+rzYDQBAL3YAAGD4B58dAALwKwAANPF519LwAj5XAAgAAAAAwCAeAQAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAiyznXj38cCcA6A8AjqVZrOcCqF+S3/l5KSY4OYJ0B4Cc7AAA2uigHsAYBIAAAuDAHsJYACAAAuCgHsBYBCAAALHPB7dlcoIVn1hIRAEAAAGDQ8A9gbQJAAAAIcIHt7j/Q0rNriggAIAAAMOGFOoC1BUAAAGBCnvsHVogAdgEACAAAGP4BEQAAAQAAAAAQAAACc/cfmI1dAAACAACGf0AEEAEABAAADP+ACACAAAAAAAAIAACRuPsPrMIuAAABAADDPyACiAAAAgAAAAAgAAAE5e4/sCq7AAAEAAAM/4AIIAIACAAAAACAAAAQhLv/wC7sAgAQAADofEENYM0CQAAAmJg7YYC1DwABAMAFsDtpwJI8CgAgAADQ+AIawBoGgAAAMDF3vgCshQACAADunAHWMgAEAIDVueMFYE0EEAAAXOi6YwZsxQsBAQQAAAz/gLUNAAEAYD/ucAFYIwEEAADcIQOscQAIAACrc2cLwFoJIAAA4M4YYK0DQAAAWJ07WgDWTAABAAB3xABrHgACAMDq3MkCsHYCCAAAuBMGWPsAEAAAVvfbHSwXwIAI8P4aCoAAAAAAAAgAAHNw9x/AWgggAAAAAAACAMDq3PECsCYCCAAAAABAN6lWL1kF6OXzTdbucgFYLwEEAAAAAKA7jwAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAACgEMAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAIAAAAAAAAgAAJHknOvHP44EgHUaYGWpVmslwL0Lyp9/K6UkRwbAWg2wIjsAAJ68oHz0dwCs1QACAAAAACAAAAAAAAIAwOlsHQWwlgMIAADBebEUAAACAAAAnEiUBRAAAAAAAAEA4D7PjAJY0wEEAAAAAEAAANidZ00BrM0AAgAAAAAgAAAAAAACAMAUvCwKwNoOIAAAAAAAAgDA7rxkCsAaDSAAAAAAAAIAAAAAIAAATMFLogCs8QACAAAAACAAAOzOy6UArNUAAgAAAAAgAAAAAAACAAAAACAAAJzD26EBrPUAAgAAAAAgAADszlulAazZAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAEAjfhYKwJoPIAAAAAAAAgDA7vycFIC1G0AAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAPiSc66OAoC1H0AAAAjM70gDWMMBBAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAAAQAAAAAAABACCMUkpyFACs5QACAICLQwCs/QDLSbVWRwEAAAA2ZwcAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgADgEAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAABAc1eHAIgs51x//q2UkhwZAGs8wG7sAABcGD75dwCs8QACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAFH5nWgAaziAAACwiVJKchQArP0AAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAIAAAMC/cs7VUQCwdgMIAAAbKKUkRwHAmg8gAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAA04fekAazZAAIAwCb8LjSAtR5AAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAABoxu9KA1irAQQAgE34fWgAAAQAAABYmMgLIAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAMBu/Lw1gjQYQAAA24WeiAKztAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAwEv8XBSANR1AAABwEQmANRpgWanW6igAAADA5uwAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAABACHAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAgLNdHQKA1+Wc6+f/XEpJjgiAtRdgdqnW6igAvHHx+Z0LUQDrL8DsPAIA0PHCFABrLIAAAAAAAAgAAAAAgAAAAAAACAAAAOzA8/8AAgCAi1QAABAAAPrwc1MA1mQAAQAAAAAQAAAAAAABAAAAABAAANbgRYAA1lQAAQBgE146BWAtBhAAAAAAAAEAAAAAEAAAtuCZVQBrKYAAAAAAAAgAAKvw8ikAazCAAAAAAAAIAAAAAIAAALAFL68CsIYCCAAAAACAAACwCi+hArD2AggAAAAAgAAAAAAACAAAW/ASKwBrJ4AAALAJz6ICWHMBBAAAAABAAAAAAAAEAIAteJYVwJoJIAAAAAAAAgDAKryUCsBaCyAAAAAAAAIAQASeaQWwVgIIAAAAAIAAALAKz6YCWGMBBAAAAABAAACIwLOtAAAIAAAAhCaSAggAAEvxjCqAtRVAAAAAAAAEAAAAAEAAANiCZ1wBrI0AAgDAJjyrCmBNBRAAAAAAAAEAIAJbXQGsiQACAAAAACAAAKzCM6sA1lIAAQAAAAAQAAAAAAABAGAZ97au2tIKYK0EEAAANr+wdUELYK0EGCnV6tdXAAAAYHd2AAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAKAQwAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAgAAAAAAACAAAAACAAADAQTnn+vGPIwFYvwBoJdVqfQaY6cL51t9LKcnRAaxfABxhBwAAAAAIAADMwHZawBoFgAAAAAAACAAAu3CHDbA2ASAAAAAAAAIAwCq8LRuwpgEgAABgqy1gTQJAAAAAAAAEAIBl2DILWMsAEAAAsOUWsBYBIAAAAAAAAgDAMn7bOuvOGzDSb2uQ7f8AAgAAAAAgAAAAAAACAEAwHgMAZmT7P4AAAAAAAAgAALzDnTTAmgWAAACAxwAAaw4AAgAAAAAgAAAsw8sAgRl4+R+AAAAAAAAIAAC04M4aYI0CQAAAwGMAgDUGAAEAAAAAEAAAluFlgMAIXv4HIAAAAAAAAgAAPdgFAJzJ3X8AAQAAAAAQAAAAAAABAIBDPAYAnMH2fwABAAAAABAAADiDXQBAT+7+AwgAAAAAgAAAwJnsAgB6cPcfQAAAAAAABAAAAABAAACgC48BAC3Z/g8gAAAAAAACAAAj2QUAtODuP4AAAAAAAAgAAMzALgDgCHf/AQQAAAAAQAAAYCZ2AQDvcPcfQAAAAAAABAAAZuROHWBNAUAAAAAAAAEAAAAAEAAAWIYtu4C1BIBbUq1eCg0AAAC7swMAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAAAQABwCAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAEAAD4JudcP/5xJMDnE4B1pVp9XwBwf7D4+bdSSnJkwGcUgPXYAQDA04PFo78DPqMACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAAAgAAQfkZMfAZBkAAAAAAAAQAAHZXSkmOAvgsAiAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAABAHDnn6igAIAAAYGgAABAAAOA2vzsOPpMACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAfMk5V0cBfKYBEAAACMzvjYPPJgACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAABf/F44+GwDIAAAAAAAAgAAuyulJEcBfEYBEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAA+CPnXB0F8BkHQAAAIDC/Lw4+qwAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAA8xc+Kgc8sAAIAAAAAsJBUa3UUAPgj5/z1peBOIvgsAyAAAAAAAIvxCAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAADAIVeHAGAeOef682+llOTIANYwAI5KtVZHAWCSC+V7XEAD1jQAjrIDAGCyC2OAiGuiKAAgAAAY9AECr5/CAIAAAGDQBwi83goDAAIAgCEfIPgaLQ4A3OYlgICLyMkHfReygPXUegogAABsdGHqAhWw7lp3AQQAABeeANZl6zKAAACwykWmi0qANdZs6zWwIy8BBHDhCDDdmulFrAACAIAhHyD4GisOAAgAAAZ9gMDrsjAAIAAAGPQBAq/jwgDAP7wEENjWvQs+gz4AvicAAQAAAADY0sUhAAAAAAEAAAAAEAAAAACAFfgVAOBXt16S5AVJAOC7GViLlwACT11U3OJCAwB8TwPrsAMA8PvIABDg+10QAAQAcEEAAAgCgAAAGPgBAEEAEAAAAz8AIAgAS/ASQDD0v8VFAQD43gcEAGDDL35f/gDgmsA1AQgAgC93AMA1AyAAAL68AQDXFIAAAPhyBgBccwACAPjy9eULALgmAQQA8CXryxUAcK0CCAAQ6wvVlygA4PoFuOfqEMC6fGECAGdfb4x4ZAAQAMDADwAgCAACABj4AQAEAeCTdwDAyR59KRr4AQDXPoAAAAAAALzt4hAAAACAAAAAAAAIAAAAAIAAACf4eLGMt80CAOB6Ex7zEkCWXIAf/d+9TRYAANed8H9Xh4AdFl8AABh5jSoGIACAoR8AADEABAAw9AMAIAaAAIChHwAAxAAQADD0AwCAGADP8isAbDH0W0ABAHAtCwIAFkoAAHCNiwAgALDSomhBBADAdS8IAFj8AADA9TAIAKy00FnkAABwjewaGQGATRc1CxoAAK6bXTcjAGDxAgAA19OupxEAWGmhskgBAIBrbAQALEoAAOCa2zU3AgCrLUIWIAAAcB2OAIAFBwAAcF2OAMBqi4zFBQAAXKczr6tDwFEWFAAA6H+93foXBBAAwOAPAABCAAIAGPwBAEAIYEXeAcB/3FtEDP0AAOA6HgGAjRcPCwYAALiWRwAAAAAAFnFxCAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAACAG64OwRg55/r5P5dSkiMCAACYgegp1VodhUEn/Xc+AAAAgDmInjwCMMFJDwAAYEaiN48AOKkBAACGz0t2A/RnB4DhHwAAwOwkAOAEBgAAMEMJADQ5cW11AQAAdvbKzCMC9ONXAAYO/oZ/AADAvGReOosdAE5mAACAU7w6A9kNIAAY/gEAAEQAXuQRgJOHf4M/AACAWWoEOwCcsAAAAEN4OaAAYPgHAAAQAUQAAcDwDwAAIALwKu8A6Dj4G/4BAADMWwLA5iejExEAAMDsNROPADgBAQAApuKRAAHA8A8AACACiAACgOEfAABABEAAMPwDAACIAAIAhn8AAAARQAAw/Bv+AQAARAABwPAPAACACCAAGP4BAAAQAQQAwz8AAAAigABg+AcAAEAEEAAM/wAAACKACCAAGP4BAABEABEgcgAw/AMAAIgAAgCGfwAAALObALC6Z4uPEwgAAGC/CBB1F0C4AGD4BwAAEAEiRoBQAcDwDwAAIAJEjQBhAoDhHwAAQASIHAG8BNDwDwAAYMYTAJwYAAAAmPUEACcEAAAAZj4BwIkAAACA2U8AGP5fthMAAAAgdgSINBemWquzAAAAADbnHQAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAIAA4BAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAANHId/S+Qc64//1ZKSf6rAQAAYFUzzrqX2Q7Io78DAADAisP/DLOuRwAAAAAggGEBwF1+AAAAohk5C9sBAAAAAAEMCQC/FQ8vAQQAAGBXo3YB2AEAAAAADc16U/v0AODuPwAAANEjwIhdAHYAAAAAQACnBgB3/wEAAIhitl0AdgAAAABAAKcFAHf/AQAAiGamXQB2AAAAAEAApwQAd/8BAACIapZdAHYAAAAAQADdA8CI3zYEAACAlZwxOw/fAWD7PwAAALubYfb1CAAAAAAE0DUAePkfAAAAPDcD934MwA4AAAAACKBbAHD3HwAAAF6bhXvuArADAAAAAAIYEgDc/QcAACCqUTNxlwBwxu8XAgAAwI56zdQeAQAAAIAAmgcAL/8DAACAx0a8DNAOAAAAAAjg1ADg7j8AAACMmZGbBgAv/wMAAIA5Z2yPAAAAAEAApwUA2/8BAABg3KzcLADY/g8AAABttZy1PQIAAAAAAZwSAGz/BwAAgLEzc5MAYPs/AAAA9NFq5vYIAAAAAATQPQDY/g8AAADjZ+fDAcD2fwAAAOirxeztEQAAAAAIoGsAsP0fAAAA5pihDwUA2/8BAADgHEdncI8AAAAAQADdAoDt/wAAADDPLG0HAAAAAATwdgDw/D8AAACc68gsbgcAAAAABNAlAHj+HwAAAOaaqe0AAAAAgADeDgD3ioS7/wAAAHBMj5n70vJfyPAPAAAAfSLA0Zk71epl/gAAALA77wAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAEAIcAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAACAs13f+X/KOdfv/3spJTmUAAAA0EeLOfxy9D/03t8AAACA9sP/u3O4RwAAAAAggJcCgDv9AAAAMIdXZ3Q7AAAAACAAAQAAAAAEAAAAAEAAAADgb3bsWAAAAABgkL/1IPYWRgAgAAAAAAABAAAAAAgAAAAAQAAAAAAAAgAAAAAQAAAAACAAAAAAAAEAAAAACAAAAABAAAAAAAACAAAAABAAAAAAgAAAAAAABAAAAAAIAAAAAEAAAAAAAAIAAAAAEAAAAACAAAAAAAAEAAAAALAkwACd6iSVhnRezwAAAABJRU5ErkJggg==",oh={class:"camera__preview"},ih={key:0,class:"camera__bg-notification"},sh=["innerHTML"],ah=["width","height"],lh={key:1,class:"camera__countdown-overlay"},ch=["innerHTML","data-countdown"],dh=["src"],uh={class:"camera__controls"},fh={class:"container"},hh={class:"row"},ph={class:"col"},mh={class:"btn-group"},Ah={key:0},gh={key:1},yh={key:0,class:"camera__switch-cam"},bh={key:1,class:"base-camera__devices"},kh={name:"BaseCamera",inheritAttrs:!1},ci={"1x1":{width:720,height:720},"2x3":{width:720,height:1080},"3x2":{width:1080,height:720},"3x4":{width:720,height:960},"4x3":{width:960,height:720},"4x5":{width:960,height:1200},"5x4":{width:1200,height:960},"16x9":{width:1280,height:720},"9x16":{width:720,height:1280}},wh=a.defineComponent({...kh,props:{modelValue:{type:null},enableSwitchCamera:{type:Boolean,default:!0},defaultRearCamera:{type:Boolean,default:!1},enableMirrorCamera:{type:Boolean,default:!1},enableGuide:{type:Boolean,default:!0},guideSrc:{type:String,default:()=>rh},countdown:{type:Number,default:0},ratio:{type:String,default:""},filter:{type:String,default:"none",validator:n=>["none","grayscale","sepia"].includes(n)},tintColor:{type:String,default:""},tintIntensity:{type:Number,default:.3},enableAudio:{type:Boolean,default:!1},enableSelectDevice:{type:Boolean,default:!1},enableCropImage:{type:Boolean,default:!0},resolutions:{type:Object,default:()=>ci}},emits:["update:modelValue"],setup(n,{expose:e,emit:t}){const r=n,o=t,i=a.ref(),s=a.ref(),l=a.ref(!1),c=a.ref([]),d=a.ref(),u=a.ref(),f=a.ref(!1),h=a.ref(!1),p=a.ref(0),m=a.ref(0),A=a.ref(),g=a.computed(()=>({...ci,...r.resolutions})),y=a.computed(()=>Object.values(g.value)[0]);function b(v){return String(v||"").trim().toLowerCase().replace(/\s+/g,"").replace(/[:/]/g,"x")}const k=a.computed(()=>{if(g.value[r.ratio])return r.ratio;const v=b(r.ratio);if(g.value[v])return v}),E=a.computed(()=>k.value?g.value[k.value]:y.value),S=a.computed(()=>{const v=k.value?g.value[k.value]:void 0;return v?`${v.width} / ${v.height}`:void 0}),x=a.computed(()=>c.value.filter(v=>v.kind==="videoinput")),D=a.computed(()=>c.value.filter(v=>v.kind==="audioinput")),P=a.computed({get(){return d.value&&d.value.deviceId},set(v){d.value=x.value.find(F=>F.deviceId===v)}}),R=a.computed({get(){return u.value&&u.value.deviceId},set(v){u.value=D.value.find(F=>F.deviceId===v)}}),J=a.computed(()=>{const v=d.value&&x.value.findIndex(F=>F.deviceId===d.value.deviceId);return r.enableMirrorCamera&&v===0?"mirror-cam":""}),Ve=a.computed(()=>{const v=d.value&&c.value.findIndex(F=>F.deviceId===d.value.deviceId);return J.value?`${J.value} mirror-device-${v}`:""}),{tintRgb:Me,applyFilterToCanvas:H}=li(r);function G(){if(k.value&&E.value){p.value=E.value.width,m.value=E.value.height;return}p.value=i.value.parentElement&&i.value.parentElement.clientWidth,m.value=i.value.parentElement&&i.value.parentElement.clientHeight}const N=Nr.debounce(()=>{G()},300,{trailing:!0,leading:!1});async function L(){const v=E.value?{width:E.value.width,height:E.value.height}:void 0,F=v?v.width/v.height:void 0,K={audio:r.enableAudio&&{...u.value?{deviceId:u.value.deviceId}:{}},video:{...d.value?{deviceId:d.value.deviceId}:{},width:{ideal:v?.width},...k.value&&v?.height?{height:{ideal:v.height}}:{},...k.value&&F?{aspectRatio:{ideal:F}}:{}}};return navigator.mediaDevices.getUserMedia(K).catch(ge=>{console.error(ge,"navigator.mediaDevices.getUserMedia: failed")})}function j(){i.value&&i.value.srcObject&&i.value.srcObject.getTracks().forEach(F=>{F.stop()})}async function ae(){return i.value.srcObject=await L(),c.value=await navigator.mediaDevices.enumerateDevices(),{stream:i.value.srcObject,devices:c.value}}function Le(){f.value?(f.value=!1,h.value=!1,j()):(f.value=!0,ae())}function Sn(){c.value.length>1&&(j(),d.value=d.value&&d.value.deviceId===x.value[0].deviceId?x.value[x.value.length-1]:x.value[0],ae())}async function wr(v,F){j(),v&&(!F||v.deviceId!==F.deviceId)&&await ae()}a.watch(()=>d.value,wr),a.watch(()=>u.value,wr);function Cn(){r.countdown?(A.value=A.value?A.value-1:r.countdown,A.value?setTimeout(Cn,1e3):Sr()):Sr()}e({onCapture:Cn,camera:i.value});function Sr(){h.value=!0;const v=s.value.getContext("2d"),F=i.value,K=F&&F.srcObject&&F.srcObject.getTracks(),{aspectRatio:ge,width:Cr,height:Mt}=K.length&&K[0].getSettings(),Ne=F?.videoWidth||Cr||p.value,we=F?.videoHeight||Mt||m.value,ze=Ne&&we?Ne/we:ge,at=E.value||{width:Ne,height:we},En=at?.width||Ne,Er=k.value?at?.height||we:Math.round(En/ze),lt=En/Er;if(s.value.width=En,s.value.height=Er,!Ne||!we||!ze)return;if(v.save(),J.value&&(v.translate(s.value.width,0),v.scale(-1,1)),r.enableCropImage){let $e=0,ct=0,Fe=Ne,dt=we;ze>lt?(Fe=we*lt,$e=(Ne-Fe)/2):ze<lt&&(dt=Ne/lt,ct=(we-dt)/2),v.drawImage(F,$e,ct,Fe,dt,0,0,s.value.width,s.value.height)}else{let $e=s.value.width,ct=s.value.height,Fe=0,dt=0;ze>lt?(ct=s.value.width/ze,dt=(s.value.height-ct)/2):ze<lt&&($e=s.value.height*ze,Fe=(s.value.width-$e)/2),J.value&&(Fe=s.value.width-Fe-$e),v.drawImage(F,0,0,Ne,we,Fe,dt,$e,ct)}v.restore(),H(v,s.value.width,s.value.height);const _t=s.value.toDataURL("image/png");Y(_t)}function Y(v){const F=gc(v);o("update:modelValue",{name:`cam-pic-${new Date().toISOString()}`,id:`cam-pic-${new Date().toISOString()}`,blob:F,size:F.size})}return a.onMounted(async()=>{j(),await ae(),d.value=x.value[0],r.enableAudio&&(u.value=D.value[0]),navigator.mediaDevices.addEventListener("devicechange",async v=>{await ae()}),r.defaultRearCamera&&Sn(),Le(),window.addEventListener("resize",N),G(),await a.nextTick(),l.value=!0}),a.onBeforeUnmount(()=>{f.value=!1,h.value=!1,j(),window.removeEventListener("resize",N)}),(v,F)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["camera",Ve.value])},[a.createElementVNode("div",oh,[l.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",ih,[a.createVNode(Nn,{color:"#000"},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass("d-block text-center"),innerHTML:v.$t("camera.waitForCameraNotification")},null,8,sh)]),_:1})])),a.withDirectives(a.createElementVNode("div",{class:a.normalizeClass(["camera__video-wrapper",k.value?`aspect-ratio--${k.value}`:""]),style:a.normalizeStyle(S.value?{aspectRatio:S.value}:void 0)},[a.createElementVNode("video",{ref_key:"camera",ref:i,class:"camera__video",style:a.normalizeStyle({filter:r.filter==="grayscale"?"grayscale(100%)":r.filter==="sepia"?"sepia(100%)":"none"}),autoplay:"",playsinline:""},null,4),n.tintColor?(a.openBlock(),a.createElementBlock("div",{key:0,class:"camera__tint-overlay",style:a.normalizeStyle({backgroundColor:n.tintColor,opacity:n.tintIntensity,mixBlendMode:"multiply"})},null,4)):a.createCommentVNode("",!0)],6),[[a.vShow,l.value]]),a.withDirectives(a.createElementVNode("canvas",{ref_key:"canvas",ref:s,class:"camera__canvas",width:p.value,height:m.value},null,8,ah),[[a.vShow,h.value]]),A.value?(a.openBlock(),a.createElementBlock("div",lh,[(a.openBlock(),a.createElementBlock("p",{class:"countdown",key:A.value,innerHTML:A.value,"data-countdown":A.value},null,8,ch))])):a.createCommentVNode("",!0),n.enableGuide&&f.value&&l.value?(a.openBlock(),a.createElementBlock("img",{key:2,class:"camera__guide",src:n.guideSrc},null,8,dh)):a.createCommentVNode("",!0)]),a.createElementVNode("div",uh,[a.createElementVNode("div",fh,[a.createElementVNode("div",hh,[a.createElementVNode("div",ph,[a.createElementVNode("div",mh,[a.createElementVNode("button",{type:"button",class:"camera__toggle btn btn-primary",onClick:Le},[f.value?(a.openBlock(),a.createElementBlock("span",gh,a.toDisplayString(v.$t("common.pause")),1)):(a.openBlock(),a.createElementBlock("span",Ah,a.toDisplayString(v.$t("common.play")),1))]),a.createElementVNode("button",{type:"button",class:"camera__capture btn btn-primary",onClick:Cn},a.toDisplayString(v.$t("camera.capture")),1)])])])])]),n.enableSwitchCamera&&x.value&&x.value.length>1?(a.openBlock(),a.createElementBlock("div",yh,[a.createElementVNode("button",{class:"btn",onClick:a.withModifiers(Sn,["prevent"])},[a.createVNode(O,{symbol:"switch-camera"})])])):a.createCommentVNode("",!0),n.enableSelectDevice?(a.openBlock(),a.createElementBlock("div",bh,[D.value.length&&u.value?(a.openBlock(),a.createBlock(Dn,{key:0,modelValue:R.value,"onUpdate:modelValue":F[0]||(F[0]=K=>R.value=K),options:D.value.map((K,ge)=>({text:K.label||`Microphone ${ge+1}`,value:K.deviceId}))},null,8,["modelValue","options"])):a.createCommentVNode("",!0),x.value.length?(a.openBlock(),a.createBlock(Dn,{key:1,modelValue:P.value,"onUpdate:modelValue":F[1]||(F[1]=K=>P.value=K),options:x.value.map((K,ge)=>({text:K.label||`Camera ${ge+1}`,value:K.deviceId}))},null,8,["modelValue","options"])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)],2))}}),Sh={class:"base-map"},Ch={key:0,class:"base-map__label"},Eh={key:0,class:"base-map__hint"},di=a.defineComponent({__name:"base-map",props:{label:{type:String,default:""},modelValue:{type:Object,default:null},center:{type:Object,default:()=>({lat:48.8566,lng:2.3522})},zoom:{type:Number,default:13},markers:{type:Array,default:()=>[]},routeCoordinates:{type:Array,default:()=>[]},routeColor:{type:String,default:"#2563eb"},routeWeight:{type:Number,default:5},selectionRadius:{type:Number,default:0},selectionRadiusCenter:{type:Object,default:null},selectionRadiusColor:{type:String,default:"#2563eb"},selectionRadiusFillColor:{type:String,default:"#60a5fa"},selectionRadiusFillOpacity:{type:Number,default:.14},selectionRadiusOpacity:{type:Number,default:.65},selectionRadiusStrokeWeight:{type:Number,default:2},userLocation:{type:Object,default:null},userLocationLabel:{type:String,default:"Your location"},selectedLocationLabel:{type:String,default:"Selected location"},height:{type:String,default:"20rem"},interactive:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},showSelectedMarker:{type:Boolean,default:!0},helperText:{type:String,default:""},mapStyle:{type:String,default:"streets"},tileLayerUrl:{type:String,default:""},tileLayerAttribution:{type:String,default:""}},emits:["update:modelValue","update:center","update:zoom","map-click","marker-click"],setup(n,{emit:e}){function t(N,L){return L({className:"base-map__marker-wrapper",html:`<span class="base-map__marker-pin base-map__marker-pin--${N}"><span class="base-map__marker-core"></span></span>`,iconSize:[24,24],iconAnchor:[12,24],popupAnchor:[0,-20]})}const r={lat:48.8566,lng:2.3522},o={streets:{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'},light:{url:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>'},dark:{url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>'},minimal:{url:"https://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}{r}.png",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>'},popover:{url:"https://{s}.basemaps.cartocdn.com/rastertiles/voyager_nolabels/{z}/{x}/{y}{r}.png",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>'}},i=n,s=e,l=a.shallowRef(null),c=a.ref(null),d=a.ref(null),u=a.ref(i.zoom),f=a.ref(S(i.modelValue));a.onMounted(async()=>{if(typeof window>"u")return;const[N,L]=await Promise.all([import("@vue-leaflet/vue-leaflet"),import("leaflet")]);l.value=a.markRaw({LCircle:a.markRaw(N.LCircle),LMap:a.markRaw(N.LMap),LMarker:a.markRaw(N.LMarker),LPopup:a.markRaw(N.LPopup),LPolyline:a.markRaw(N.LPolyline),LTileLayer:a.markRaw(N.LTileLayer)}),c.value={list:t("list",L.divIcon),selected:t("selected",L.divIcon),search:t("search",L.divIcon),user:t("user",L.divIcon)}}),a.watch(()=>i.zoom,N=>{u.value=N}),a.watch(()=>i.modelValue,N=>{f.value=S(N)}),a.watch(()=>i.center,N=>{const L=S(N);L&&R(L)},{deep:!0}),a.watch(()=>[i.height,i.markers.length,i.routeCoordinates.length,i.center?.lat,i.center?.lng,i.modelValue?.lat,i.modelValue?.lng,i.userLocation?.lat,i.userLocation?.lng],()=>{P()},{flush:"post"});const h=a.computed(()=>S(i.userLocation)),p=a.computed(()=>S(i.selectionRadiusCenter)||f.value),m=a.computed(()=>{const N=(i.markers||[]).map(L=>{const j=S(L);return j?{...L,...j,type:L.type||(f.value&&D(L,f.value)?"selected":"list")}:null}).filter(L=>!!L);return i.showSelectedMarker&&f.value&&!N.some(L=>D(L,f.value))&&N.push({id:"selected-location",label:i.selectedLocationLabel,type:"search",...f.value}),N}),A=a.computed(()=>(i.routeCoordinates||[]).map(N=>x(N)).filter(N=>!!N)),g=a.computed(()=>{const N=S(i.center)||f.value||S(i.markers[0])||r;return[N.lat,N.lng]}),y=a.computed(()=>{if(i.tileLayerUrl.trim())return i.tileLayerUrl;const N=i.mapStyle==="custom"?"streets":i.mapStyle;return o[N].url}),b=a.computed(()=>{if(i.tileLayerAttribution.trim())return i.tileLayerAttribution;const N=i.mapStyle==="custom"?"streets":i.mapStyle;return o[N].attribution});function k(N="list"){if(c.value)return c.value[N]||c.value.list}function E(N="list"){switch(N){case"user":return 450;case"selected":return 350;case"search":return 250;default:return 150}}function S(N){if(!N)return null;const L=Number(N.lat),j=Number(N.lng);return Number.isNaN(L)||Number.isNaN(j)?null:{lat:L,lng:j}}function x(N){if(Array.isArray(N)){const j=Number(N[0]),ae=Number(N[1]);return Number.isFinite(j)&&Number.isFinite(ae)?[j,ae]:null}const L=S(N);return L?[L.lat,L.lng]:null}function D(N,L){const j=S(N),ae=S(L);return!j||!ae?!1:Math.abs(j.lat-ae.lat)<1e-6&&Math.abs(j.lng-ae.lng)<1e-6}async function P(){await a.nextTick(),d.value?.invalidateSize()}function R(N){d.value?.panTo([N.lat,N.lng])}function J(N){d.value=N,R(S(i.center)||f.value||r),P()}function Ve(N){u.value=N,s("update:zoom",N)}function Me(N){const L=S(N);L&&(R(L),s("update:center",L))}function H(N){if(!i.interactive||i.disabled)return;const L={lat:Number(N.latlng.lat.toFixed(6)),lng:Number(N.latlng.lng.toFixed(6))};f.value=L,R(L),s("update:modelValue",L),s("update:center",L),s("map-click",L)}function G(N){f.value={lat:Number(N.lat),lng:Number(N.lng)},R(f.value),s("update:modelValue",f.value),s("update:center",f.value),s("marker-click",N)}return(N,L)=>(a.openBlock(),a.createElementBlock("div",Sh,[a.renderSlot(N.$slots,"label",{},()=>[n.label?(a.openBlock(),a.createElementBlock("label",Ch,a.toDisplayString(n.label),1)):a.createCommentVNode("",!0)]),a.createElementVNode("div",{class:a.normalizeClass(["base-map__frame",{"base-map__frame--interactive":n.interactive&&!n.disabled,"base-map__frame--disabled":n.disabled}]),style:a.normalizeStyle({height:n.height}),"data-testid":"base-map"},[l.value?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(l.value?.LMap),{key:0,class:"base-map__canvas","use-global-leaflet":!1,zoom:u.value,center:g.value,onReady:J,onClick:H,"onUpdate:zoom":Ve,"onUpdate:center":Me},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(l.value.LTileLayer),{url:y.value,attribution:b.value,"layer-type":"base",name:"OpenStreetMap"},null,8,["url","attribution"])),A.value.length>1?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(l.value.LPolyline),{key:0,"lat-lngs":A.value,color:n.routeColor,weight:n.routeWeight},null,8,["lat-lngs","color","weight"])):a.createCommentVNode("",!0),p.value&&n.selectionRadius>0?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(l.value.LCircle),{key:1,"lat-lng":[p.value.lat,p.value.lng],radius:n.selectionRadius,color:n.selectionRadiusColor,"fill-color":n.selectionRadiusFillColor,"fill-opacity":n.selectionRadiusFillOpacity,opacity:n.selectionRadiusOpacity,weight:n.selectionRadiusStrokeWeight},null,8,["lat-lng","radius","color","fill-color","fill-opacity","opacity","weight"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(m.value,(j,ae)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(l.value.LMarker),{key:j.id??`${j.lat}-${j.lng}-${ae}`,"lat-lng":[j.lat,j.lng],icon:k(j.type),"z-index-offset":E(j.type),onClick:Le=>G(j)},{default:a.withCtx(()=>[j.label?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(l.value.LPopup),{key:0},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(j.label),1)]),_:2},1024)):a.createCommentVNode("",!0)]),_:2},1032,["lat-lng","icon","z-index-offset","onClick"]))),128)),h.value?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(l.value.LMarker),{key:2,"lat-lng":[h.value.lat,h.value.lng],icon:k("user"),"z-index-offset":E("user"),onClick:L[0]||(L[0]=j=>G({id:"user-location",label:n.userLocationLabel,type:"user",...h.value}))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(l.value.LPopup),null,{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(n.userLocationLabel),1)]),_:1}))]),_:1},8,["lat-lng","icon","z-index-offset"])):a.createCommentVNode("",!0)]),_:1},40,["zoom","center"])):a.createCommentVNode("",!0)],6),n.interactive&&n.helperText?(a.openBlock(),a.createElementBlock("p",Eh,a.toDisplayString(n.helperText),1)):a.createCommentVNode("",!0)]))}}),xh={class:"location-list","data-testid":"location-list"},Mh={key:0,class:"location-list__label"},Nh={key:1,class:"location-list__items"},Bh=["data-testid","onClick"],vh={class:"location-list__title"},Th={key:0,class:"location-list__description"},Dh={key:1,class:"location-list__distance"},Vh={key:2,class:"location-list__empty"},ui=a.defineComponent({__name:"location-list",props:{modelValue:{type:null,default:null},locations:{type:Array,default:()=>[]},label:{type:String,default:""},titleKey:{type:String,default:"title"},descriptionKey:{type:String,default:"address"},emptyText:{type:String,default:"No locations found."},showDistance:{type:Boolean,default:!0}},emits:["update:modelValue","select"],setup(n,{emit:e}){const t=n,r=e;function o(f){return f?.[t.titleKey]||f?.label||f?.name||"Location"}function i(f){return f?.[t.descriptionKey]||f?.description||f?.subtitle||""}function s(f,h=0){return f?typeof f!="object"?f:f.id??f.value??o(f)??h:h}function l(f,h=0){return`${s(f,h)}`.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function c(f,h=0){return s(t.modelValue)===s(f,h)}function d(f){return Number.isFinite(f)?f>=1e3?`${(f/1e3).toFixed(1)} km`:`${Math.round(f)} m`:"—"}function u(f){r("update:modelValue",f),r("select",f)}return(f,h)=>(a.openBlock(),a.createElementBlock("div",xh,[n.label?(a.openBlock(),a.createElementBlock("p",Mh,a.toDisplayString(n.label),1)):a.createCommentVNode("",!0),n.locations.length?(a.openBlock(),a.createElementBlock("div",Nh,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.locations,(p,m)=>(a.openBlock(),a.createElementBlock("button",{key:s(p,m),type:"button",class:a.normalizeClass(["location-list__item",{"location-list__item--active":c(p,m)}]),"data-testid":`location-option-${l(p,m)}`,onClick:A=>u(p)},[a.createElementVNode("strong",vh,a.toDisplayString(o(p)),1),i(p)?(a.openBlock(),a.createElementBlock("small",Th,a.toDisplayString(i(p)),1)):a.createCommentVNode("",!0),n.showDistance&&p?.distance!==void 0&&p?.distance!==null?(a.openBlock(),a.createElementBlock("small",Dh,a.toDisplayString(d(Number(p.distance)))+" away ",1)):a.createCommentVNode("",!0)],10,Bh))),128))])):(a.openBlock(),a.createElementBlock("p",Vh,a.toDisplayString(n.emptyText),1))]))}});function fi(n=null,e){const t=a.ref(!1),r=a.ref([]),o=a.ref([]),i=a.ref(!1),s=a.ref(!1),l=a.computed(()=>n.modelValue?.length?n.modelValue:n.src?[{type:"",src:n.src}]:o.value);async function c(A){const g=new FormData;g.append("file",A),t.value=!0;const b=await(n.customFetch||Mn.ofetch)(n.endpoint,{method:"POST",...n.customFetch?{}:{headers:{Accept:"application/json",...n.authToken?{Authorization:`Bearer ${n.authToken}`}:{}}},body:g}).catch(E=>{console.error("Error",E)});return t.value=!1,`${n.baseResponsePath||"/api/v1/assets"}/${b.path}`}function d(A){const g=typeof A=="string"?parseInt(A,10):A,y=Array.isArray(n.modelValue)&&n.modelValue.length>0,b=Array.isArray(o.value)&&o.value.length>0;if(b&&g<o.value.length&&o.value.splice(g,1),y){const k=[...n.modelValue];g<k.length&&k.splice(g,1),e?.("update:modelValue",k),n.multiple||e?.("update:src",k[0]?.src||"")}else if(b){const k=n.multiple?o.value:o.value[0];e?.("update:modelValue",k),n.multiple||e?.("update:src",o.value[0]?.src||"")}else e?.("update:modelValue",n.multiple?[]:void 0),e?.("update:src","");r.value.splice(g,1),i.value=!1}function u(A){A.preventDefault(),s.value=!0}function f(A){A.preventDefault(),s.value=!1}function h(A){A.preventDefault(),s.value=!1;const g=A.dataTransfer,y=g&&Array.from(g.files||[]);r.value=y||[]}function p(){n.dropFiles&&(["dragenter","dragover"].forEach(A=>{document.body.addEventListener(A,u,!1)}),["dragleave","drop"].forEach(A=>{document.body.addEventListener(A,f,!1)}),document.body.addEventListener("drop",h,!1))}function m(){n.dropFiles&&(["dragenter","dragover"].forEach(A=>{document.body.removeEventListener(A,u,!1)}),["dragleave","drop"].forEach(A=>{document.body.removeEventListener(A,f,!1)}),document.body.removeEventListener("drop",h,!1))}return a.onMounted(()=>{p()}),a.onBeforeUnmount(()=>{m()}),{pending:t,files:r,dataUrls:o,imgLoaded:i,isDragging:s,thumbnails:l,uploadFile:c,removeFile:d,dragStart:u,dragStop:f,dragDrop:h,setupDragAndDrop:p,cleanupDragAndDrop:m}}const $h=["src"],Oh=["onClick"],Ih=["onClick"],Ph=["for"],Rh=["innerHTML"],Lh={key:0,class:"file-upload__loading-spinner"},hi=a.defineComponent({__name:"file-upload",props:{modelValue:{type:Array,default:[]},src:{type:String},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},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},maxFileSize:{type:Number,default:0},endpoint:{type:String,default:""},toDataUrl:{type:Boolean,default:!0},authToken:{type:String,default:""},customFetch:null,baseResponsePath:{type:String,default:"/api/v1/assets"},enablePreview:{type:Boolean,default:!0},previewWidth:{type:Number,default:0},dropFiles:{type:Boolean,default:!1}},emits:["update:modelValue","update:src"],setup(n,{emit:e}){const t=n,r=e,{pending:o,files:i,dataUrls:s,isDragging:l,thumbnails:c,uploadFile:d,removeFile:u}=fi(t,r);return a.watch(()=>i.value,async f=>{s.value=await Promise.all(f.map(async h=>({src:t.toDataUrl?await vn(h):await d(h),type:h.type})))},{deep:!0}),a.watch(()=>s.value,async f=>{const h=t.multiple?f:f[0];r("update:modelValue",h),t.multiple||r("update:src",f[0]&&f[0].src)},{deep:!0}),(f,h)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["file-upload",{"has-dragging":n.dropFiles,"is-dragging":a.unref(l)}])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(c),(p,m)=>(a.openBlock(),a.createElementBlock("div",{key:p.src,class:a.normalizeClass(n.enablePreview?"file-upload__thumbnail":"file-upload__reset")},[n.enablePreview?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("img",{src:`${p.src}${n.previewWidth?`?width=${n.previewWidth}`:""}`,class:"img-thumbnail rounded"},null,8,$h),a.createElementVNode("button",{onClick:a.withModifiers(A=>a.unref(u)(m),["prevent"]),class:"btn btn--close"},[a.createVNode(O,{symbol:"x"})],8,Oh)],64)):(a.openBlock(),a.createElementBlock("button",{key:1,onClick:a.withModifiers(A=>a.unref(u)(m),["prevent"]),class:"btn btn--close btn-outline-contrast"},[a.createVNode(O,{symbol:"x"})],8,Ih))],2))),128)),a.createVNode(Tr,{modelValue:a.unref(i),"onUpdate:modelValue":h[0]||(h[0]=p=>a.isRef(i)?i.value=p:null),id:n.id,name:n.name,accept:n.accept,"max-file-size":n.maxFileSize,class:"d-none"},null,8,["modelValue","id","name","accept","max-file-size"]),a.createElementVNode("label",{for:n.id,class:"file-upload__label"},[a.renderSlot(f.$slots,"button",{},()=>[a.createElementVNode("span",{class:"btn btn-outline-contrast",innerHTML:n.label||f.$t("common.selectFile")},null,8,Rh)]),a.createVNode(a.Transition,{name:"fade"},{default:a.withCtx(()=>[a.unref(o)?(a.openBlock(),a.createElementBlock("span",Lh,[...h[1]||(h[1]=[a.createElementVNode("span",{class:"spinner-border",role:"status"},[a.createElementVNode("span",{class:"visually-hidden"},"Loading...")],-1)])])):a.createCommentVNode("",!0)]),_:1})],8,Ph)],2))}}),zh=["onDragenter","onDragover","onDragleave","onDragend","onDrop","innerHTML"],Fh=["onDragstart","onDrag","onDragenter","onDragover","onDragleave","onDragend","onDrop"],Hh={key:0,class:"sortable-list__drag-handle"},Wh={type:"button",class:"btn",draggable:"true"},qh={key:0,class:"sortable-list__item"},pi=a.defineComponent({__name:"sortable-list",props:{modelValue:{type:Array,default:()=>[]},config:{type:Object,default:null},messages:{type:Object,default:{}},vertical:{type:Boolean,default:!0},showDragHandle:{type:Boolean,default:!1},showPreview:{type:Boolean,default:!0}},emits:["update:modelValue","update:isDragging","update:dragIndex","update:dragOverIndex"],setup(n,{emit:e}){const t=n,r=a.ref(!1),o=a.ref(null),i=a.ref(null),s=e,l=a.computed({get(){return t.modelValue},set(b){s("update:modelValue",b)}}),c=a.computed(()=>{const b=document.querySelector(".is-drag-item")?.outerHTML;return b?ue(b):""}),d=a.useSlots(),u=a.computed(()=>d["list-append"]);function f(b,k){b.dataTransfer&&(b.dataTransfer.dropEffect="move",b.dataTransfer.effectAllowed="move",b.dataTransfer.setData("index",k.toLocaleString()),r.value=!0,o.value=k)}function h(b,k){r.value=!1,o.value=null,i.value=null}function p(b,k){}function m(b,k){i.value=o.value!==k?k:null}function A(b,k){i.value=o.value!==k?k:null}function g(b,k){}function y(b,k){if(b.dataTransfer){b.preventDefault();const E=Number(b.dataTransfer.getData("index")),S=k,x=[...l.value];(S||S===0)&&(E||E===0)&&x.splice(S,0,x.splice(E,1)[0]),l.value=x}}return a.watch(()=>r.value,b=>{s("update:isDragging",b)},{immediate:!0}),a.watch(()=>o.value,b=>{s("update:dragIndex",b)},{immediate:!0}),a.watch(()=>i.value,b=>{s("update:dragOverIndex",b)},{immediate:!0}),(b,k)=>(a.openBlock(),a.createBlock(a.TransitionGroup,{name:"list",tag:"ul",class:a.normalizeClass(["sortable-list p-0 d-flex gap-2",{"flex-column":n.vertical,"flex-row flex-wrap":!n.vertical}]),onDragover:k[0]||(k[0]=a.withModifiers(()=>{},["prevent"])),onDragenter:k[1]||(k[1]=a.withModifiers(()=>{},["prevent"]))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,(E,S)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:S},[n.showPreview&&r.value&&i.value===S?(a.openBlock(),a.createElementBlock("li",{key:0,class:"sortable-list__item is-drop-target",onDragenter:x=>m(x,S),onDragover:x=>A(x,S),onDragleave:x=>void 0,onDragend:x=>h(),onDrop:x=>y(x,S),innerHTML:c.value},null,40,zh)):a.createCommentVNode("",!0),a.createElementVNode("li",{class:a.normalizeClass(["sortable-list__item d-flex",{"is-drag-item":r.value&&o.value===S,"is-drop-target":r.value&&i.value===S&&!n.showPreview,"align-items-center gap-2":n.vertical}]),draggable:!0,onDragstart:x=>f(x,S),onDrag:x=>void 0,onDragenter:x=>m(x,S),onDragover:x=>A(x,S),onDragleave:x=>void 0,onDragend:x=>h(),onDrop:x=>y(x,S)},[n.showDragHandle?(a.openBlock(),a.createElementBlock("div",Hh,[a.createElementVNode("button",Wh,[a.createVNode(O,{symbol:"drag"})])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["sortable-list__item-content",{"flex-grow-1":n.vertical}])},[a.renderSlot(b.$slots,"list-item",{item:E,index:S},()=>[a.createTextVNode(a.toDisplayString(E),1)])],2)],42,Fh)],64))),128)),u.value?(a.openBlock(),a.createElementBlock("li",qh,[a.renderSlot(b.$slots,"list-append")])):a.createCommentVNode("",!0)]),_:3},8,["class"]))}}),jh={key:0,class:"image-editor position-relative"},Uh={class:"row mb-3"},_h={class:"col"},Qh={class:"row gap-2 mb-4"},Jh={class:"col-12"},Kh={class:"input mb-2"},Gh={class:"col"},Yh={class:"input mb-0"},Xh={class:"col"},Zh={class:"input mb-0"},ep={class:"row"},tp={class:"col d-flex justify-content-end gap-2"},np=["disabled"],mi=a.defineComponent({__name:"image-resize",props:{modelValue:{type:String,default:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>',required:!0},spinner:{type:Boolean,default:!1},ready:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:e}){const t=e,r=a.useTemplateRef("image"),o=a.ref(1),i=a.ref(0),s=a.ref(0),l=a.ref(null),c=a.ref(0),d=a.ref(0);function u(){l.value&&(t("update:modelValue",l.value),o.value=1)}const f=()=>{if(!c.value||!d.value)return;i.value=Math.round(c.value*o.value);const p=d.value/c.value;s.value=Math.round(i.value*p);const m=r.value?.$el;if(!m)return;const A=m.querySelector("img");A&&(l.value=ti(A,i.value,s.value,"image/png"))},h=Nr.debounce(f,300);return a.watch(o,()=>{c.value&&(i.value=Math.round(c.value*o.value),h())}),a.watch(i,()=>{if(!c.value||i.value===0)return;const p=i.value/c.value;Math.abs(p-o.value)>1e-4&&(o.value=Number(p.toFixed(4)));const m=d.value/c.value;s.value=Math.round(i.value*m),h()}),a.watch(s,()=>{if(!d.value||s.value===0)return;const p=s.value/d.value;Math.abs(p-o.value)>1e-4&&(o.value=Number(p.toFixed(4)));const m=c.value/d.value;i.value=Math.round(s.value*m),h()}),a.onMounted(()=>{const p=r.value?.$el;if(!p)return;const m=p.querySelector("img");if(!m)return;const A=()=>{c.value=m.naturalWidth,d.value=m.naturalHeight,f()};m.complete?A():m.addEventListener("load",A)}),(p,m)=>n.modelValue?(a.openBlock(),a.createElementBlock("div",jh,[a.createElementVNode("div",Uh,[a.createElementVNode("div",_h,[a.createVNode(ut,{ref_key:"image",ref:r,class:"d-none",src:n.modelValue,animate:!1},null,8,["src"]),l.value?(a.openBlock(),a.createBlock(ut,{key:0,ref:"targetImage",class:"",src:l.value,animate:!1},null,8,["src"])):a.createCommentVNode("",!0)])]),a.createElementVNode("div",Qh,[a.createElementVNode("div",Jh,[a.createElementVNode("div",Kh,[a.withDirectives(a.createElementVNode("input",{type:"range",class:"form-range",id:"scaleRange","onUpdate:modelValue":m[0]||(m[0]=A=>o.value=A),min:"0",max:"2",step:"0.0001"},null,512),[[a.vModelText,o.value]])])]),a.createElementVNode("div",Gh,[a.createElementVNode("div",Yh,[a.createVNode(Nt,{type:"number",class:"form-input mb-0",id:"targetWidth",modelValue:i.value,"onUpdate:modelValue":m[1]||(m[1]=A=>i.value=A)},null,8,["modelValue"])])]),m[3]||(m[3]=a.createElementVNode("div",{class:"col-auto d-flex align-items-center"},[a.createElementVNode("output",null,"×")],-1)),a.createElementVNode("div",Xh,[a.createElementVNode("div",Zh,[a.createVNode(Nt,{type:"number",class:"form-input mb-0",id:"targetHeight",modelValue:s.value,"onUpdate:modelValue":m[2]||(m[2]=A=>s.value=A)},null,8,["modelValue"])])])]),a.createElementVNode("div",ep,[a.createElementVNode("div",tp,[a.renderSlot(p.$slots,"actions"),a.createElementVNode("button",{class:"btn btn-sm btn-primary",disabled:!l.value,onClick:a.withModifiers(u,["prevent","stop"])},a.toDisplayString(p.$t("common.apply")),9,np)])])])):a.createCommentVNode("",!0)}}),rp={key:0,class:"image-crop"},op={class:"row mb-4"},ip={class:"col"},sp={class:"row"},ap={class:"col d-flex gap-2 justify-content-end gap-2"},Ai=a.defineComponent({__name:"image-crop",props:{modelValue:{type:String,default:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>',required:!0},spinner:{type:Boolean,default:!1},ready:{type:Boolean,default:!1},aspectRatioOptions:{type:Array,default:()=>[{value:0,text:"Free"},{value:1,text:"1:1"},{value:4/3,text:"4:3"},{value:16/9,text:"16:9"},{value:3/4,text:"3:4"},{value:9/16,text:"9:16"}]},suggestedAspectRatio:Number},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=a.useTemplateRef("cropper"),i=a.ref(0);function s(){const{canvas:l}=o.value?.getResult(),c=l.toDataURL();r("update:modelValue",c)}return a.onBeforeMount(()=>{i.value=t.suggestedAspectRatio||0}),(l,c)=>n.modelValue?(a.openBlock(),a.createElementBlock("div",rp,[a.createElementVNode("div",op,[a.createElementVNode("div",ip,[a.createVNode(a.unref(ac.Cropper),{ref:"cropper",class:"cropper",src:n.modelValue,"stencil-props":{...i.value!==0?{aspectRatio:i.value}:{}},"resize-image":!1},null,8,["src","stencil-props"])])]),c[1]||(c[1]=a.createElementVNode("hr",null,null,-1)),a.createElementVNode("div",sp,[a.createElementVNode("div",ap,[a.createVNode(Dn,{modelValue:i.value,"onUpdate:modelValue":c[0]||(c[0]=d=>i.value=d),options:n.aspectRatioOptions,class:"mb-0"},null,8,["modelValue","options"]),a.renderSlot(l.$slots,"actions"),a.createElementVNode("button",{class:"btn btn-sm btn-primary",onClick:a.withModifiers(s,["prevent","stop"])},a.toDisplayString(l.$t("common.apply")),1)])])])):a.createCommentVNode("",!0)}}),lp={key:0,class:"image-crop-resize position-relative"},cp={class:"row"},dp={class:"col"},up={key:3,class:"alert alert-warning mt-4 small p-2"},fp={key:4},hp={class:"row"},pp={class:"col-12"},mp={class:"d-flex"},Ap={key:0,class:"d-flex gap-3"},gp={class:"caption"},yp={class:"caption"},bp={key:1,class:"ms-auto"},gi=a.defineComponent({__name:"image-crop-resize",props:{modelValue:{type:String,default:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>',required:!0},spinner:{type:Boolean,default:!1},ready:{type:Boolean,default:!1},aspectRatio:Number},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=a.ref(!1),i=a.ref(!1),s=a.computed({get:()=>t.modelValue,set:c=>r("update:modelValue",c)}),l=a.computed(()=>t.modelValue.startsWith("data:image/svg+xml"));return a.watch(()=>[o.value,s.value],(c,d)=>{c[0]&&c[0]===d[0]&&(o.value=!1)}),a.watch(()=>[i.value,s.value],(c,d)=>{c[0]&&c[0]===d[0]&&(i.value=!1)}),a.onMounted(()=>{}),(c,d)=>n.modelValue?(a.openBlock(),a.createElementBlock("div",lp,[a.createElementVNode("div",cp,[a.createElementVNode("div",dp,[o.value||i.value?o.value?(a.openBlock(),a.createBlock(mi,{key:1,modelValue:s.value,"onUpdate:modelValue":d[1]||(d[1]=u=>s.value=u)},{actions:a.withCtx(()=>[a.createElementVNode("button",{class:"btn btn-outline-ccontrast",onClick:d[0]||(d[0]=a.withModifiers(u=>o.value=!1,["prevent","stop"]))},a.toDisplayString(c.$t("common.cancel")),1)]),_:1},8,["modelValue"])):i.value?(a.openBlock(),a.createBlock(Ai,{key:2,modelValue:s.value,"onUpdate:modelValue":d[3]||(d[3]=u=>s.value=u),"suggested-aspect-ratio":n.aspectRatio},{actions:a.withCtx(()=>[a.createElementVNode("button",{class:"btn btn-sm btn-outline-ccontrast",onClick:d[2]||(d[2]=a.withModifiers(u=>i.value=!1,["prevent","stop"]))},a.toDisplayString(c.$t("common.cancel")),1)]),_:1},8,["modelValue","suggested-aspect-ratio"])):a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(ut,{key:0,ref:"targetImage",class:"",animate:!1,src:n.modelValue},null,8,["src"])),l.value?(a.openBlock(),a.createElementBlock("div",up,a.toDisplayString(c.$t("common.svgWarning")),1)):a.createCommentVNode("",!0),!i.value&&!o.value?(a.openBlock(),a.createElementBlock("hr",fp)):a.createCommentVNode("",!0),a.createElementVNode("div",hp,[a.createElementVNode("div",pp,[a.createElementVNode("div",mp,[!i.value&&!o.value?(a.openBlock(),a.createElementBlock("div",Ap,[a.createElementVNode("button",{type:"button",class:"btn btn-light",onClick:d[4]||(d[4]=a.withModifiers(u=>i.value=!i.value,["prevent","stop"]))},[a.createVNode(O,{symbol:"crop"}),a.createElementVNode("span",gp,a.toDisplayString(c.$t("common.crop")),1)]),a.createElementVNode("button",{type:"button",class:"btn btn-light",onClick:d[5]||(d[5]=a.withModifiers(u=>o.value=!o.value,["prevent","stop"]))},[a.createVNode(O,{symbol:"image-upscale"}),a.createElementVNode("span",yp,a.toDisplayString(c.$t("common.resize")),1)])])):a.createCommentVNode("",!0),!i.value&&!o.value?(a.openBlock(),a.createElementBlock("div",bp,[a.renderSlot(c.$slots,"submit")])):a.createCommentVNode("",!0)])])])])])])):a.createCommentVNode("",!0)}}),kp={class:"modal-dialog__content d-flex flex-column"},wp={class:"modal-dialog__header d-flex p-3 border-bottom"},Sp={key:0,class:"modal-dialog__title",id:"exampleModalLabel"},Cp={class:"modal-dialog__body"},Ep={key:0,class:"modal-dialog__footer d-flex p-3 border-top"},yi=a.defineComponent({__name:"modal-dialog",props:{modelValue:{type:Boolean,default:!1},modal:{type:Boolean,default:!0},size:{type:String,default:"md"},dismiss:{type:Boolean,default:!0},title:{type:String,default:""},footer:{type:Boolean,default:!0},classes:{type:String,default:""}},emits:["update:modelValue","confirm","cancel"],setup(n,{expose:e,emit:t}){const r=n,o=t,i=a.ref();function s(){document.documentElement.style.setProperty("--scroll-position",`${Math.round(document.documentElement.scrollTop)}px`),r.modal?i.value?.showModal():i.value?.show(),o("update:modelValue",!0)}function l(){const h=i.value&&new KeyframeEffect(i.value,[{translate:"0 -100%",opacity:"0"}],{duration:320,easing:"ease",direction:"normal"}),p=new Animation(h,document.timeline);p.play(),p.addEventListener("finish",()=>{i.value?.close(),c()}),o("update:modelValue",!1)}function c(){const h=getComputedStyle(document.documentElement).getPropertyValue("--scroll-position");document.documentElement.scrollTo({top:parseInt(h,10),behavior:"instant"}),o("update:modelValue",!1)}function d(h){s(),o("confirm",h)}function u(){l(),o("cancel")}function f(h){const p=h.target;p&&p.nodeName==="DIALOG"&&l()}return a.watch(()=>r.modelValue,(h,p)=>{h&&h!==p?s():p&&l()},{immediate:!0}),a.onMounted(()=>{i.value?.addEventListener("cancel",h=>{h.preventDefault(),l()}),r.dismiss&&document.addEventListener("click",f),r.modelValue&&s()}),a.onBeforeUnmount(()=>{r.dismiss&&document.removeEventListener("click",f)}),e({show:s,close:l,confirm:d,cancel:u}),(h,p)=>(a.openBlock(),a.createElementBlock("dialog",{ref_key:"dialog",ref:i,class:a.normalizeClass(["modal-dialog",{[`modal-dialog--${n.size}`]:n.size}]),onClose:c},[a.createElementVNode("div",kp,[a.createElementVNode("div",wp,[n.title?(a.openBlock(),a.createElementBlock("h5",Sp,a.toDisplayString(n.title),1)):a.createCommentVNode("",!0),a.createElementVNode("button",{type:"button",class:"btn-close ms-auto border-radius-none","aria-label":"Close",onClick:l})]),a.createElementVNode("div",Cp,[a.renderSlot(h.$slots,"default")]),n.footer?(a.openBlock(),a.createElementBlock("div",Ep,[a.renderSlot(h.$slots,"footer"),a.createElementVNode("button",{type:"button",class:"btn ms-auto",onClick:l},a.toDisplayString(h.$t("common.close")),1)])):a.createCommentVNode("",!0)])],34))}}),xp={class:"image-upload__controls"},Mp={class:"d-flex gap-1 align-items-center"},Np={key:1,class:"image-upload__controls"},Bp=["for"],vp=["innerHTML"],Tp={key:0,class:"image-upload__loading-spinner"},bi=a.defineComponent({__name:"image-upload",props:{modelValue:{type:Object,default:void 0},src:{type:String},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},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},accept:{type:String,default:"image/*"},maxFileSize:{type:Number,default:0},endpoint:{type:String,default:""},toDataUrl:{type:Boolean,default:!0},authToken:{type:String,default:""},customFetch:null,baseResponsePath:{type:String,default:"/api/v1/assets"},enablePreview:{type:Boolean,default:!0},previewWidth:{type:Number,default:0},dropFiles:{type:Boolean,default:!1},enableReview:{type:Boolean,default:!0},maxImageWidth:{type:Number,default:4096},aspectRatio:Number},emits:["update:modelValue","update:src"],setup(n,{emit:e}){const t=n,r=e,o=a.ref(!1),i=a.ref(null),s=a.ref(null),l=a.ref(null),{pending:c,files:d,imgLoaded:u,isDragging:f,uploadFile:h,setupDragAndDrop:p,cleanupDragAndDrop:m}=fi(t,r),A=a.computed(()=>t.modelValue?t.modelValue:t.src?{type:"",src:t.src}:i.value);function g(){i.value=null,d.value=[],u.value=!1,r("update:modelValue",void 0),r("update:src","")}function y(){g()}a.watch(()=>d.value,async E=>{if(!E||!E.length||!E[0])return;u.value=!1;const S=await kc(E[0],t.maxImageWidth);t.enableReview?(s.value={src:await vn(S),type:S.type},o.value=!0):i.value={src:t.toDataUrl?await vn(S):await h(S),type:S.type}}),a.watch(()=>i.value,E=>{r("update:modelValue",E||void 0),r("update:src",E?.src||"")}),a.watch(()=>l.value,async E=>{E&&(i.value={src:await h(E),type:E.type},l.value=null)}),a.watch(()=>o.value,(E,S)=>{!E&&S&&s.value&&(s.value=null,y())}),a.watch(()=>t.src,E=>{!E&&i.value&&y()});function b(E,S){s.value={src:E,type:S},o.value=!0}async function k(){s.value&&(l.value=await ei(s.value.src,"file",s.value.type)),s.value=null,o.value=!1}return a.onMounted(()=>{p()}),a.onBeforeUnmount(()=>{m()}),(E,S)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["image-upload",{"has-dragging":n.dropFiles,"is-dragging":a.unref(f)}])},[!o.value&&A.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["mb-2",n.enablePreview?"image-upload__thumbnail":"image-upload__reset"])},[n.enablePreview?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(ut,{src:`${A.value.src}${n.previewWidth?`?width=${n.previewWidth}`:""}`,class:"img-thumbnail rounded",ready:a.unref(u),"onUpdate:ready":S[0]||(S[0]=x=>a.isRef(u)?u.value=x:null),animate:!1,style:a.normalizeStyle({maxWidth:n.previewWidth?`${n.previewWidth}px`:"auto",height:"auto"})},null,8,["src","ready","style"]),a.createElementVNode("div",xp,[a.createElementVNode("div",Mp,[a.createElementVNode("button",{type:"button",onClick:S[1]||(S[1]=a.withModifiers(x=>b(A.value.src,A.value.type),["prevent","stop"])),class:"btn btn--edit btn-sm btn-light"},[a.createVNode(O,{symbol:"edit-2"})]),a.createElementVNode("button",{type:"button",onClick:S[2]||(S[2]=a.withModifiers(x=>g(),["prevent","stop"])),class:"btn btn--close btn-sm btn-light"},[a.createVNode(O,{symbol:"x"})])])])],64)):(a.openBlock(),a.createElementBlock("div",Np,[a.createElementVNode("button",{onClick:S[3]||(S[3]=a.withModifiers(x=>g(),["prevent","stop"])),class:"btn btn--close btn-outline-contrast"},[a.createVNode(O,{symbol:"x"})])]))],2)):a.createCommentVNode("",!0),a.createVNode(Tr,{modelValue:a.unref(d),"onUpdate:modelValue":S[4]||(S[4]=x=>a.isRef(d)?d.value=x:null),id:n.id,name:n.name,accept:n.accept,"max-file-size":n.maxFileSize,class:"d-none"},null,8,["modelValue","id","name","accept","max-file-size"]),n.src?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("label",{key:1,for:n.id,class:"image-upload__label"},[a.renderSlot(E.$slots,"button",{},()=>[a.createElementVNode("span",{class:"btn btn-outline-contrast",innerHTML:n.label||E.$t("common.selectFile")},null,8,vp)]),a.createVNode(a.Transition,{name:"fade"},{default:a.withCtx(()=>[a.unref(c)?(a.openBlock(),a.createElementBlock("span",Tp,[...S[7]||(S[7]=[a.createElementVNode("span",{class:"spinner-border",role:"status"},[a.createElementVNode("span",{class:"visually-hidden"},"Loading...")],-1)])])):a.createCommentVNode("",!0)]),_:1})],8,Bp)),a.createVNode(yi,{modelValue:o.value,"onUpdate:modelValue":S[6]||(S[6]=x=>o.value=x),footer:!1},{default:a.withCtx(()=>[o.value&&s.value?(a.openBlock(),a.createBlock(gi,{key:0,modelValue:s.value.src,"onUpdate:modelValue":S[5]||(S[5]=x=>s.value.src=x),"aspect-ratio":n.aspectRatio},{submit:a.withCtx(()=>[a.createElementVNode("button",{class:"btn btn-primary",onClick:a.withModifiers(k,["prevent","stop"])},a.toDisplayString(E.$t("common.save")),1)]),_:1},8,["modelValue","aspect-ratio"])):a.createCommentVNode("",!0)]),_:1},8,["modelValue"])],2))}}),Dp={class:"upload-group"},Vp=["innerHTML"],$p={class:"upload-group__list"},Op={class:"img-container"},Ip=["src"],Pp=["onClick"],Rp={role:"button",class:"img-thumbnail d-flex justify-content-center align-items-center"},Lp={role:"button",class:"img-thumbnail d-flex justify-content-center align-items-center"},ki=a.defineComponent({__name:"upload-group",props:{modelValue:{type:Array,default:()=>[]},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},label:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},accept:{type:String},maxFileSize:{type:Number,default:0},endpoint:{type:String,default:""},authToken:{type:String,default:""},customFetch:null,baseResponsePath:{type:String,default:"/api/v1/assets"},previewWidth:{type:Number,default:0},useImageUpload:{type:Boolean,default:!1},maxImageWidth:{type:Number,default:0},aspectRatio:Number},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=a.ref(""),i=a.computed({get(){return t.modelValue},set(l){r("update:modelValue",l)}});function s(l){i.value.splice(l,1),r("update:modelValue",i.value)}return a.watch(o,async(l,c)=>{l&&c!==l&&(r("update:modelValue",[...i.value,l]),await a.nextTick(),o.value="")}),(l,c)=>(a.openBlock(),a.createElementBlock("div",Dp,[n.label?(a.openBlock(),a.createElementBlock("label",{key:0,innerHTML:a.unref(ue)(n.label)},null,8,Vp)):a.createCommentVNode("",!0),a.createElementVNode("div",$p,[a.createVNode(pi,{modelValue:i.value,"onUpdate:modelValue":c[2]||(c[2]=d=>i.value=d),vertical:!1,class:"mb-3"},{"list-item":a.withCtx(({item:d,index:u})=>[a.createElementVNode("div",Op,[a.createElementVNode("img",{src:`${d}${n.previewWidth?`?width=${n.previewWidth}`:""}`,class:"img-thumbnail"},null,8,Ip),a.createElementVNode("button",{onClick:a.withModifiers(f=>s(u),["prevent"]),class:"btn btn--close"},[a.createVNode(O,{symbol:"x"})],8,Pp)])]),"list-append":a.withCtx(()=>[n.useImageUpload?(a.openBlock(),a.createBlock(bi,{key:0,src:o.value,"onUpdate:src":c[0]||(c[0]=d=>o.value=d),endpoint:n.endpoint,"custom-fetch":n.customFetch,"to-data-url":!n.endpoint,"auth-token":n.authToken,disabled:n.disabled,"base-response-path":n.baseResponsePath,accept:n.accept,"max-file-size":n.maxFileSize,"max-image-width":n.maxImageWidth,"enable-preview":!1,"aspect-ratio":n.aspectRatio},{button:a.withCtx(()=>[a.createElementVNode("span",Rp,[a.createVNode(O,{symbol:"plus"})])]),_:1},8,["src","endpoint","custom-fetch","to-data-url","auth-token","disabled","base-response-path","accept","max-file-size","max-image-width","aspect-ratio"])):(a.openBlock(),a.createBlock(hi,{key:1,src:o.value,"onUpdate:src":c[1]||(c[1]=d=>o.value=d),multiple:!1,endpoint:n.endpoint,"custom-fetch":n.customFetch,"to-data-url":!n.endpoint,"auth-token":n.authToken,disabled:n.disabled,"base-response-path":n.baseResponsePath,accept:n.accept,"max-file-size":n.maxFileSize,"max-image-width":n.maxImageWidth},{button:a.withCtx(()=>[a.createElementVNode("span",Lp,[a.createVNode(O,{symbol:"plus"})])]),_:1},8,["src","endpoint","custom-fetch","to-data-url","auth-token","disabled","base-response-path","accept","max-file-size","max-image-width"]))]),_:1},8,["modelValue"])])]))}}),zp={class:"asset-uploader"},Fp=["innerHTML"],Hp=a.defineComponent({__name:"asset-uploader",props:{modelValue:{type:Array,default:()=>[]},name:{type:String,default:()=>W()},id:{type:String,default:()=>W()},type:{type:String,default:""},label:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},accept:{type:String},maxFileSize:{type:Number,default:0},endpoint:{type:String,default:""},authToken:{type:String,default:""},customFetch:null,mediaTypeMap:{type:Object,default:()=>({svg:"Svg",png:"Image",jpg:"Image"})},baseResponsePath:{type:String,default:"/api/v1/assets"},previewWidth:{type:Number,default:0},useImageUpload:{type:Boolean,default:!1},maxImageWidth:{type:Number,default:0},aspectRatio:Number},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=a.computed({get(){return t.modelValue.map(i=>i.src)},set(i){r("update:modelValue",i.map((s,l)=>({mediaType:t.modelValue[l]&&t.modelValue[l].mediaType||s.includes("data:image")?s.includes("data:image/svg")?"Svg":"Image":t.mediaTypeMap[s.split(".")[1]],src:s,name:t.modelValue[l]&&t.modelValue[l].name||`${t.name}-${l}`,...t.type?{type:t.type}:{}})))}});return(i,s)=>(a.openBlock(),a.createElementBlock("div",zp,[n.label?(a.openBlock(),a.createElementBlock("label",{key:0,innerHTML:a.unref(ue)(n.label)},null,8,Fp)):a.createCommentVNode("",!0),a.createVNode(ki,{modelValue:o.value,"onUpdate:modelValue":s[0]||(s[0]=l=>o.value=l),endpoint:n.endpoint,"custom-fetch":n.customFetch,"auth-token":n.authToken,disabled:n.disabled,"preview-width":n.previewWidth,"base-response-path":n.baseResponsePath,accept:n.accept,"max-file-size":n.maxFileSize,"use-image-upload":n.useImageUpload,"max-image-width":n.maxImageWidth,"aspect-ratio":n.aspectRatio},null,8,["modelValue","endpoint","custom-fetch","auth-token","disabled","preview-width","base-response-path","accept","max-file-size","use-image-upload","max-image-width","aspect-ratio"])]))}}),Wp="https://router.project-osrm.org/route/v1";function wi(){const n=a.ref([]),e=a.ref(null),t=a.ref(null),r=a.ref([]),o=a.ref(!1),i=a.ref(""),s=a.computed(()=>n.value.length>1);function l(){n.value=[],e.value=null,t.value=null,r.value=[],i.value=""}async function c(d,u,f={}){if(!d||!u)return l(),null;o.value=!0;const h=f.customFetch||Mn.ofetch,p=(f.endpoint||Wp).replace(/\/$/,""),m=f.profile||"driving";try{const g=(await h(`${p}/${m}/${d.lng},${d.lat};${u.lng},${u.lat}`,{method:"GET",query:{alternatives:!1,overview:"full",steps:!0,geometries:"geojson"}}))?.routes?.[0];if(!g)throw new Error("No route available for these points.");return n.value=Array.isArray(g?.geometry?.coordinates)?g.geometry.coordinates.map(y=>[Number(y[1]),Number(y[0])]).filter(y=>Number.isFinite(y[0])&&Number.isFinite(y[1])):[],e.value=Number.isFinite(g?.distance)?Number(g.distance):null,t.value=Number.isFinite(g?.duration)?Number(g.duration):null,r.value=Array.isArray(g?.legs)?g.legs.flatMap(y=>Array.isArray(y?.steps)?y.steps.map(b=>qp(b)):[]):[],i.value="",g}catch(A){return l(),i.value=A?.message||"Unable to load directions right now.",null}finally{o.value=!1}}return{routeCoordinates:n,distanceMeters:e,durationSeconds:t,steps:r,pending:o,error:i,hasRoute:s,fetchRoute:c,clearRoute:l}}function qp(n){const e=`${n?.maneuver?.type||"continue"}`,t=n?.maneuver?.modifier?` ${n.maneuver.modifier}`:"",r=`${n?.name||""}`;return{instruction:`${jp(e)}${t}${r?` on ${r}`:""}`.trim(),name:r,distance:Number.isFinite(n?.distance)?Number(n.distance):0,duration:Number.isFinite(n?.duration)?Number(n.duration):0}}function jp(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Up="https://nominatim.openstreetmap.org/search",_p="https://nominatim.openstreetmap.org/reverse";function Si(){const n=a.ref([]),e=a.ref(!1),t=a.ref("");function r(){n.value=[],t.value=""}async function o(s,l={}){if(!s.trim())return r(),[];e.value=!0;const c=l.customFetch||Mn.ofetch;try{const d=await c(l.endpoint||Up,{method:"GET",headers:{Accept:"application/json",...l.language?{"Accept-Language":l.language}:{}},query:{q:s,format:"jsonv2",addressdetails:1,limit:l.limit||5}});return n.value=Array.isArray(d)?d.map((u,f)=>Ci(u,f,"geocoder")).filter(u=>!!u):[],t.value="",n.value}catch(d){return t.value=d?.message||"Unable to search locations right now.",n.value=[],[]}finally{e.value=!1}}async function i(s,l={}){e.value=!0;const c=l.customFetch||Mn.ofetch;try{const d=await c(l.reverseEndpoint||_p,{method:"GET",headers:{Accept:"application/json",...l.language?{"Accept-Language":l.language}:{}},query:{lat:s.lat,lon:s.lng,format:"jsonv2",addressdetails:1}}),u=Ci(d,0,"reverse-geocoder");return t.value="",u}catch(d){return t.value=d?.message||"Unable to resolve this location right now.",null}finally{e.value=!1}}return{results:n,pending:e,error:t,search:o,reverse:i,clearResults:r}}function Ci(n,e,t){const r=Number(n?.lat),o=Number(n?.lon??n?.lng);if(!Number.isFinite(r)||!Number.isFinite(o))return null;const i=`${n?.display_name||n?.name||"Location"}`,s=`${n?.name||i.split(",")[0]||"Location"}`.trim();return{id:`${t==="reverse-geocoder"?"reverse":"geo"}-${n?.place_id??e}`,title:s,address:i,lat:r,lng:o,source:t,raw:n}}function Ei(n={}){const e=a.ref(null),t=a.ref(""),r=a.ref(!1),o=a.ref(!1),i=typeof window<"u"&&typeof navigator<"u"&&"geolocation"in navigator,s={enableHighAccuracy:!0,timeout:1e4,maximumAge:1e4,...n};let l=null;function c(p){e.value={lat:Number(p.latitude),lng:Number(p.longitude),accuracy:Number.isFinite(p.accuracy)?Number(p.accuracy):null},r.value=!1,t.value=""}function d(p){t.value=typeof p=="string"?p:p instanceof Error?p.message:p.message||"Unable to retrieve your location.",r.value=!1}async function u(){return i?(r.value=!0,new Promise(p=>{navigator.geolocation.getCurrentPosition(({coords:m})=>{c(m),p(e.value)},m=>{d(m),p(null)},s)})):(d("Geolocation is not supported in this browser."),null)}function f(){if(!i){d("Geolocation is not supported in this browser.");return}l===null&&(r.value=!0,o.value=!0,l=navigator.geolocation.watchPosition(({coords:p})=>{c(p)},p=>{d(p),o.value=!1},s))}function h(){if(!i||l===null){o.value=!1,r.value=!1;return}navigator.geolocation.clearWatch(l),l=null,o.value=!1,r.value=!1}return a.onBeforeUnmount(()=>{h()}),{supported:i,position:a.computed(()=>e.value),accuracy:a.computed(()=>e.value?.accuracy??null),error:t,pending:r,isTracking:o,locate:u,startTracking:f,stopTracking:h}}const Qp={class:"location-finder","data-testid":"location-finder"},Jp={class:"location-finder__actions"},Kp=["disabled"],Gp={key:1,class:"location-finder__notice","data-testid":"location-finder-error"},Yp={class:"location-finder__map-panel"},Xp=["aria-label"],Zp={class:"location-finder__legend-item"},em={class:"location-finder__legend-item"},tm={class:"location-finder__legend-item"},nm={class:"location-finder__legend-item"},rm={key:0,class:"location-finder__sidebar"},om={key:1,class:"location-finder__summary","data-testid":"location-finder-directions"},im={class:"location-finder__summary-title"},sm={key:0,class:"location-finder__summary-copy"},am={class:"location-finder__summary-grid"},lm={class:"location-finder__summary-label"},cm={"data-testid":"location-finder-distance"},dm={class:"location-finder__summary-label"},um={"data-testid":"location-finder-duration"},fm={key:0,class:"location-finder__steps"},hm={key:0},pm={key:2,class:"location-finder__summary-copy"},mm=a.defineComponent({__name:"location-finder",props:{modelValue:{type:Object,default:null},locations:{type:Array,default:()=>[]},center:{type:Object,default:null},distance:{type:Number,default:null},userLocation:{type:Object,default:null},messages:{type:Object,default:()=>({})},mapHeight:{type:String,default:"26rem"},searchLabel:{type:String,default:""},searchPlaceholder:{type:String,default:""},resultsLabel:{type:String,default:""},emptyText:{type:String,default:""},locateButtonLabel:{type:String,default:""},stopTrackingLabel:{type:String,default:""},mapHelperText:{type:String,default:""},enableGeocoding:{type:Boolean,default:!1},geocodingEndpoint:{type:String,default:"https://nominatim.openstreetmap.org/search"},reverseGeocodingEndpoint:{type:String,default:"https://nominatim.openstreetmap.org/reverse"},geocodingLimit:{type:Number,default:5},geocodingMinQueryLength:{type:Number,default:3},customGeocodingFetch:null,enableDirections:{type:Boolean,default:!1},directionsEndpoint:{type:String,default:"https://router.project-osrm.org/route/v1"},routeProfile:{type:String,default:"driving"},customDirectionsFetch:null,showDirectionsSummary:{type:Boolean,default:!0},showDirectionsSteps:{type:Boolean,default:!0},directionsTitle:{type:String,default:""},directionsEmptyText:{type:String,default:""},distanceLabel:{type:String,default:""},durationLabel:{type:String,default:""},routeColor:{type:String,default:"#2563eb"},routeWeight:{type:Number,default:5},selectionRadius:{type:Number,default:0},selectionRadiusColor:{type:String,default:"#2563eb"},selectionRadiusFillColor:{type:String,default:"#60a5fa"},mapStyle:{type:String,default:"streets"},tileLayerUrl:{type:String,default:""},tileLayerAttribution:{type:String,default:""},disabled:{type:Boolean,default:!1},interactive:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!0},showLegend:{type:Boolean,default:!0},showSidebar:{type:Boolean,default:!0},showTrackButton:{type:Boolean,default:!0},trackUser:{type:Boolean,default:!0},autoLocate:{type:Boolean,default:!1}},emits:["update:modelValue","update:distance","select","search","track-user"],setup(n,{emit:e}){const t={lat:48.8566,lng:2.3522},r={searchLabel:"Search locations",searchPlaceholder:"Search by name or address",resultsLabel:"Locations",emptyText:"No locations found.",locateButtonLabel:"Use my location",stopTrackingLabel:"Stop tracking",mapHelperText:"Select a location from the list or use the map.",directionsTitle:"Directions",directionsEmptyText:"Select a destination and share your location to preview a route.",distanceLabel:"Distance",durationLabel:"ETA",loadingRoute:"Loading route…",legendAriaLabel:"Map marker types",legendLocations:"Locations",legendSelected:"Selected",legendSearchResult:"Search result",userLocationLabel:"Your location",pinnedLocationTitle:"Pinned location",selectedLocationLabel:"Selected location"},o=n,i=e,{t:s,te:l}=Mr.useI18n({useScope:"global"}),c=Ei(),d=Si(),u=wi(),f=a.ref(""),h=a.ref(ge(F(o.modelValue))),p=a.ref(ge(F(o.modelValue))?null:F(o.modelValue)),m=a.ref(v(o.modelValue)||v(o.center)||v(o.locations[0])||t),A=a.ref(!1),g=a.computed(()=>v(o.userLocation)),y=a.computed(()=>c.position.value||g.value),b=a.computed(()=>v(p.value)),k=a.computed(()=>v(h.value)),E=a.computed(()=>y.value||b.value),S=a.computed(()=>!E.value||!k.value?null:En(E.value,k.value)),x=a.computed(()=>v(o.modelValue)||b.value||k.value),D=a.computed(()=>c.error.value||d.error.value||u.error.value||""),P=a.computed(()=>o.showSearch||o.trackUser&&o.showTrackButton),R=a.computed(()=>o.enableDirections&&o.showDirectionsSummary),J=a.computed(()=>o.showSidebar||R.value),Ve=a.computed(()=>Er(u.distanceMeters.value)),Me=a.computed(()=>lt(u.durationSeconds.value)),H=a.computed(()=>({searchLabel:Y("searchLabel",o.searchLabel),searchPlaceholder:Y("searchPlaceholder",o.searchPlaceholder),resultsLabel:Y("resultsLabel",o.resultsLabel),emptyText:Y("emptyText",o.emptyText),locateButtonLabel:Y("locateButtonLabel",o.locateButtonLabel),stopTrackingLabel:Y("stopTrackingLabel",o.stopTrackingLabel),mapHelperText:Y("mapHelperText",o.mapHelperText),directionsTitle:Y("directionsTitle",o.directionsTitle),directionsEmptyText:Y("directionsEmptyText",o.directionsEmptyText),distanceLabel:Y("distanceLabel",o.distanceLabel),durationLabel:Y("durationLabel",o.durationLabel),loadingRoute:Y("loadingRoute"),legendAriaLabel:Y("legendAriaLabel"),legendLocations:Y("legendLocations"),legendSelected:Y("legendSelected"),legendSearchResult:Y("legendSearchResult"),userLocationLabel:Y("userLocationLabel"),pinnedLocationTitle:Y("pinnedLocationTitle"),selectedLocationLabel:Y("selectedLocationLabel")})),G=a.computed(()=>p.value?Mt(p.value):H.value.selectedLocationLabel),N=a.computed(()=>c.isTracking.value&&A.value?H.value.stopTrackingLabel:H.value.locateButtonLabel);a.watch(()=>o.modelValue,w=>{const M=F(w),V=ge(M);V?(h.value=V,p.value=null):M&&(p.value=M);const _=v(w);_&&(m.value=_)},{immediate:!0}),a.watch(()=>o.center,w=>{const M=v(w);M&&(m.value=M)},{deep:!0}),a.watch(y,w=>{w&&A.value&&(m.value=w)},{deep:!0}),a.watch(S,w=>{i("update:distance",w)},{immediate:!0}),a.watch(f,async w=>{if(i("search",w),!o.enableGeocoding){d.clearResults();return}const M=w.trim();if(M.length<o.geocodingMinQueryLength){d.clearResults();return}await d.search(M,{endpoint:o.geocodingEndpoint,customFetch:o.customGeocodingFetch,limit:o.geocodingLimit})}),a.watch(()=>({enabled:o.enableDirections,origin:y.value,destination:x.value,profile:o.routeProfile}),async({enabled:w,origin:M,destination:V,profile:_})=>{if(!w||!M||!V||at(M,V)){u.clearRoute();return}await u.fetchRoute(M,V,{endpoint:o.directionsEndpoint,profile:_,customFetch:o.customDirectionsFetch})},{immediate:!0,deep:!0}),a.onMounted(async()=>{o.autoLocate&&o.trackUser&&await ec()});const L=a.computed(()=>{const w=Cr(f.value).trim();return w?o.locations.filter(M=>[Mt(M),Ne(M)].filter(Boolean).some(V=>Cr(V).includes(w))):o.locations}),j=a.computed(()=>d.results.value.map(w=>({id:w.id,title:w.title,address:w.address,lat:w.lat,lng:w.lng,source:w.source}))),ae=a.computed(()=>{if(!f.value.trim())return o.locations;const w=L.value;return w.length?w:o.locations}),Le=a.computed(()=>ae.value),Sn=a.computed(()=>ze(ae.value,o.enableGeocoding?j.value:[])),wr=a.computed(()=>Array.from(new Set(Sn.value.map(w=>we(w))))),Cn=a.computed(()=>Le.value.map(w=>{const M=v(w);return M?{id:K(w),label:Mt(w),...M,type:k.value&&at(M,k.value)?"selected":"list"}:null}).filter(w=>!!w)),Sr=a.computed(()=>A.value&&y.value?y.value:m.value||x.value||y.value||v(Le.value[0])||t);function Y(w,M){const V=o.messages?.[w];if(typeof V=="string"&&V.trim())return V;if(typeof M=="string"&&M.trim())return M;const _=`locationFinder.${String(w)}`;return l(_)?String(s(_)):r[w]}function v(w){if(!w)return null;const M=Number(w.lat),V=Number(w.lng);return!Number.isFinite(M)||!Number.isFinite(V)?null:{lat:M,lng:V}}function F(w){if(!w)return null;const M=v(w);return M?{...w,...M}:null}function K(w){return w?typeof w!="object"?w:w.id??w.value??we(w):null}function ge(w){return w&&o.locations.find(M=>K(M)===K(w)||at(v(M),v(w)))||null}function Cr(w){return`${w??""}`.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function Mt(w){return`${w.title||w.label||w.name||"Location"}`}function Ne(w){return`${w.address||w.description||w.subtitle||""}`}function we(w){const M=Mt(w),V=Ne(w);return V?`${M} — ${V}`:M}function ze(w,M){const V=[...w];return M.forEach(_=>{V.some(xr=>K(xr)===K(_)||at(v(xr),v(_)))||V.push(_)}),V}function at(w,M){return!w||!M?!1:Math.abs(w.lat-M.lat)<1e-6&&Math.abs(w.lng-M.lng)<1e-6}function En(w,M){const V=Z0=>Z0*(Math.PI/180),Qt=V(M.lat-w.lat),xr=V(M.lng-w.lng),G0=V(w.lat),Y0=V(M.lat),tc=Math.sin(Qt/2)**2+Math.cos(G0)*Math.cos(Y0)*Math.sin(xr/2)**2,X0=2*Math.atan2(Math.sqrt(tc),Math.sqrt(1-tc));return Math.round(6371e3*X0)}function Er(w){return w===null||!Number.isFinite(w)?"—":w>=1e3?`${(w/1e3).toFixed(1)} km`:`${Math.round(w)} m`}function lt(w){if(w===null||!Number.isFinite(w))return"—";const M=Math.max(1,Math.round(w/60));if(M<60)return`${M} min`;const V=Math.floor(M/60),_=M%60;return _?`${V} h ${_} min`:`${V} h`}function _t(w){const M=F(w),V=ge(M);if(A.value=!1,!M){i("update:modelValue",null);return}h.value=V||M;const _=v(M);_&&(m.value=_),i("update:modelValue",M),i("select",M)}function $e(w){const M=F(w),V=ge(M);if(A.value=!1,!M){i("update:modelValue",null);return}V?(h.value=V,p.value=null):p.value=M;const _=v(M);_&&(m.value=_),i("update:modelValue",M),i("select",M)}function ct(w){const M=Sn.value.find(V=>we(V)===w||Mt(V)===w);if(M){if(ge(M)){_t(M),p.value=null;return}$e(M)}}function Fe(w){_t(w)}function dt(w){if(w.id==="user-location"&&y.value){m.value=y.value,A.value=!0,i("track-user",y.value);return}const M=Le.value.find(V=>K(V)===w.id)||Le.value.find(V=>{const _=v(V);return _&&Math.abs(_.lat-w.lat)<1e-6&&Math.abs(_.lng-w.lng)<1e-6});if(M){_t(M);return}p.value&&(K(p.value)===w.id||at(v(p.value),{lat:w.lat,lng:w.lng}))&&$e(p.value)}async function J0(w){if(m.value=w,A.value=!1,!o.interactive)return;const M=Le.value.find(_=>{const Qt=v(_);return Qt&&Math.abs(Qt.lat-w.lat)<1e-6&&Math.abs(Qt.lng-w.lng)<1e-6});if(M){_t(M);return}const V=await K0(w,H.value.pinnedLocationTitle);$e(V)}async function K0(w,M){if(!o.enableGeocoding)return{id:`pin-${w.lat}-${w.lng}`,title:M,lat:w.lat,lng:w.lng};const V=await d.reverse(w,{reverseEndpoint:o.reverseGeocodingEndpoint,customFetch:o.customGeocodingFetch});return V?{id:V.id,title:V.title||M,address:V.address,lat:V.lat,lng:V.lng,source:V.source}:{id:`pin-${w.lat}-${w.lng}`,title:M,lat:w.lat,lng:w.lng}}async function ec(){if(c.isTracking.value&&A.value){c.stopTracking(),A.value=!1;return}if(y.value){m.value=y.value,A.value=!0,i("track-user",y.value),!c.isTracking.value&&!g.value&&c.startTracking();return}const w=await c.locate();w&&(m.value=w,A.value=!0,i("track-user",w),c.startTracking())}return(w,M)=>(a.openBlock(),a.createElementBlock("div",Qp,[P.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["location-finder__toolbar",{"location-finder__toolbar--actions-only":!o.showSearch}])},[o.showSearch?(a.openBlock(),a.createBlock(ai,{key:0,modelValue:f.value,"onUpdate:modelValue":M[0]||(M[0]=V=>f.value=V),class:"location-finder__search",label:H.value.searchLabel,placeholder:H.value.searchPlaceholder,options:wr.value,disabled:n.disabled,"onUpdate:selection":ct},null,8,["modelValue","label","placeholder","options","disabled"])):a.createCommentVNode("",!0),a.createElementVNode("div",Jp,[n.trackUser&&o.showTrackButton?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"btn btn-outline-primary btn-sm location-finder__locate",disabled:n.disabled||a.unref(c).pending.value,"data-testid":"location-finder-locate",onClick:ec},a.toDisplayString(N.value),9,Kp)):a.createCommentVNode("",!0)])],2)):a.createCommentVNode("",!0),D.value?(a.openBlock(),a.createElementBlock("p",Gp,a.toDisplayString(D.value),1)):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["location-finder__layout",{"location-finder__layout--with-summary":R.value,"location-finder__layout--full-width":!J.value}])},[a.createElementVNode("div",Yp,[a.createVNode(di,{class:"location-finder__map",center:Sr.value,markers:Cn.value,"model-value":b.value,"user-location":y.value,"user-location-label":H.value.userLocationLabel,"selected-location-label":G.value,"route-coordinates":a.unref(u).routeCoordinates.value,"route-color":n.routeColor,"route-weight":n.routeWeight,"selection-radius":n.selectionRadius,"selection-radius-center":x.value,"selection-radius-color":n.selectionRadiusColor,"selection-radius-fill-color":n.selectionRadiusFillColor,"map-style":n.mapStyle,"tile-layer-url":n.tileLayerUrl,"tile-layer-attribution":n.tileLayerAttribution,height:n.mapHeight,interactive:n.interactive,disabled:n.disabled,"helper-text":H.value.mapHelperText,"onUpdate:modelValue":J0,onMarkerClick:dt},null,8,["center","markers","model-value","user-location","user-location-label","selected-location-label","route-coordinates","route-color","route-weight","selection-radius","selection-radius-center","selection-radius-color","selection-radius-fill-color","map-style","tile-layer-url","tile-layer-attribution","height","interactive","disabled","helper-text"]),o.showLegend?(a.openBlock(),a.createElementBlock("div",{key:0,class:"location-finder__legend","data-testid":"location-finder-legend","aria-label":H.value.legendAriaLabel},[a.createElementVNode("span",Zp,[M[2]||(M[2]=a.createElementVNode("span",{class:"location-finder__legend-swatch location-finder__legend-swatch--list"},null,-1)),a.createTextVNode(" "+a.toDisplayString(H.value.legendLocations),1)]),a.createElementVNode("span",em,[M[3]||(M[3]=a.createElementVNode("span",{class:"location-finder__legend-swatch location-finder__legend-swatch--selected"},null,-1)),a.createTextVNode(" "+a.toDisplayString(H.value.legendSelected),1)]),a.createElementVNode("span",tm,[M[4]||(M[4]=a.createElementVNode("span",{class:"location-finder__legend-swatch location-finder__legend-swatch--search"},null,-1)),a.createTextVNode(" "+a.toDisplayString(H.value.legendSearchResult),1)]),a.createElementVNode("span",nm,[M[5]||(M[5]=a.createElementVNode("span",{class:"location-finder__legend-swatch location-finder__legend-swatch--user"},null,-1)),a.createTextVNode(" "+a.toDisplayString(H.value.userLocationLabel),1)])],8,Xp)):a.createCommentVNode("",!0)]),J.value?(a.openBlock(),a.createElementBlock("aside",rm,[o.showSidebar?(a.openBlock(),a.createBlock(ui,{key:0,modelValue:h.value,"onUpdate:modelValue":M[1]||(M[1]=V=>h.value=V),class:"location-finder__results",locations:Le.value,label:H.value.resultsLabel,"empty-text":H.value.emptyText,onSelect:Fe},null,8,["modelValue","locations","label","empty-text"])):a.createCommentVNode("",!0),R.value?(a.openBlock(),a.createElementBlock("div",om,[a.createElementVNode("p",im,a.toDisplayString(H.value.directionsTitle),1),a.unref(u).pending.value?(a.openBlock(),a.createElementBlock("p",sm,a.toDisplayString(H.value.loadingRoute),1)):a.unref(u).hasRoute.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createElementVNode("div",am,[a.createElementVNode("div",null,[a.createElementVNode("p",lm,a.toDisplayString(H.value.distanceLabel),1),a.createElementVNode("strong",cm,a.toDisplayString(Ve.value),1)]),a.createElementVNode("div",null,[a.createElementVNode("p",dm,a.toDisplayString(H.value.durationLabel),1),a.createElementVNode("strong",um,a.toDisplayString(Me.value),1)])]),n.showDirectionsSteps&&a.unref(u).steps.value.length?(a.openBlock(),a.createElementBlock("ol",fm,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(u).steps.value.slice(0,5),(V,_)=>(a.openBlock(),a.createElementBlock("li",{key:`${V.instruction}-${_}`},[a.createElementVNode("span",null,a.toDisplayString(V.instruction),1),V.name?(a.openBlock(),a.createElementBlock("small",hm,a.toDisplayString(V.name),1)):a.createCommentVNode("",!0)]))),128))])):a.createCommentVNode("",!0)],64)):(a.openBlock(),a.createElementBlock("p",pm,a.toDisplayString(H.value.directionsEmptyText),1))])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)],2)]))}}),Am={class:"carousel d-flex"},gm=["onClick"],xi=a.defineComponent({__name:"base-carousel",props:{modelValue:{type:Number,default:-1},config:{type:Object,default:null},messages:{type:Object,default:{}},items:{type:Array,default:[]},navigation:{type:Boolean,default:!0}},emits:["update:modelValue","select"],setup(n,{emit:e}){const t=e,r=a.ref(),o=a.ref();function i(){r.value.scrollTo({top:0,left:r.value.scrollLeft-r.value.clientWidth>0?r.value.scrollLeft-r.value.clientWidth:0,behavior:"smooth"})}function s(){r.value.scrollTo({top:0,left:r.value.scrollLeft-r.value.clientWidth<=o.value.clientWidth?r.value.scrollLeft+r.value.clientWidth:o.value.clientWidth,behavior:"smooth"})}function l(c){t("update:modelValue",c)}return(c,d)=>(a.openBlock(),a.createElementBlock("div",Am,[n.navigation?(a.openBlock(),a.createElementBlock("button",{key:0,class:"carousel__control btn btn-link text-light",type:"button",onClick:a.withModifiers(i,["prevent","stop"])},[a.createVNode(O,{symbol:"chevron-left"})])):a.createCommentVNode("",!0),a.createElementVNode("div",{ref_key:"viewport",ref:r,class:"carousel__viewport flex-grow-1"},[a.createElementVNode("div",{ref_key:"track",ref:o,class:"carousel__track d-flex justify-center align-items-center"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.items,(u,f)=>a.renderSlot(c.$slots,"carousel-item",{key:u.src,item:u,index:f},()=>[a.createElementVNode("div",{class:a.normalizeClass(["carousel__item",f===n.modelValue?"selected":""]),onClick:h=>l(f)},a.toDisplayString(u),11,gm)])),128))],512)],512),n.navigation?(a.openBlock(),a.createElementBlock("button",{key:1,class:"carousel__control btn btn-link text-light",type:"button",onClick:a.withModifiers(s,["prevent","stop"])},[a.createVNode(O,{symbol:"chevron-right"})])):a.createCommentVNode("",!0)]))}}),ym={class:"media-thumbnails"},bm=["onClick"],km={class:"img-container"},wm=a.defineComponent({__name:"media-thumbnails",props:{modelValue:{default:null},config:{type:Object,default:null},messages:{type:Object,default:{}},assets:{type:Array,default:[]}},emits:["update:modelValue","select"],setup(n,{emit:e}){const t=e,r=a.ref(-1);function o(i){r.value=i,t("update:modelValue",i),t("select",i)}return(i,s)=>(a.openBlock(),a.createElementBlock("div",ym,[a.createVNode(xi,{items:n.assets},{"carousel-item":a.withCtx(l=>[a.createElementVNode("a",{role:"button",class:a.normalizeClass(["carousel__item media-thumbnails__thumbnail",l.index===n.modelValue||l.index===r.value?"is-active":""]),onClick:c=>o(l.index)},[a.createElementVNode("div",km,[a.createVNode(ut,{src:l.item.thumbnail||l.item.src,class:"img-fluid"},null,8,["src"])])],10,bm)]),_:1},8,["items"])]))}}),Sm={class:"progress-steps"},Cm={class:"progress-steps__list"},Em={class:"progress-step"},xm=["checked","id","value","disabled","read-only","required","onChange"],Mm=["for"],Nm=["innerHTML"],Bm=["for"],vm=["innerHTML"],Tm=a.defineComponent({__name:"progress-steps",props:{modelValue:{type:Number,default:0},progress:{type:Number,default:0},steps:{type:Array},label:{type:String,default:""},reveal:{type:Boolean,default:!1}},emits:["update:modelValue","update:progress"],setup(n,{emit:e}){const t=n,r=e;function o(i){r("update:modelValue",i),i>=t.progress&&r("update:progress",i)}return(i,s)=>(a.openBlock(),a.createElementBlock("div",Sm,[a.createElementVNode("ul",Cm,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.steps,(l,c)=>(a.openBlock(),a.createElementBlock("li",{key:c,class:a.normalizeClass(["progress-steps__step",{"progress-steps__step--disabled":c>n.progress+(n.reveal?1:0),"progress-steps__step--active":c===(n.modelValue||0)}])},[a.renderSlot(i.$slots,"step",{},()=>[a.createElementVNode("div",Em,[a.createElementVNode("input",{type:"radio",checked:c<=(n.progress||0),id:`step-${c}`,name:"step",class:"form-check-input",value:l.value,disabled:l.disabled||c>n.progress+(n.reveal?1:0),"read-only":l.readOnly,required:l.required,onChange:d=>o(c)},null,40,xm),a.createElementVNode("label",{for:`step-${c}`},[a.renderSlot(i.$slots,"button",{step:l},()=>[a.createElementVNode("span",{class:"btn rounded-circle",innerHTML:a.unref(ue)(l.text||"")},null,8,Nm)])],8,Mm),a.createElementVNode("label",{for:`step-${c}`},[a.renderSlot(i.$slots,"label",{step:l},()=>[a.createElementVNode("span",{class:"form-check-label",innerHTML:a.unref(ue)(l.label||"")},null,8,vm)])],8,Bm)])])],2))),128))])]))}}),Dm={class:"hint-system"},Vm=["innerHTML"],$m=["innerHTML"],Om={key:1,class:"hint-system__hint-content"},Im=["disabled"],Pm=a.defineComponent({__name:"hint-system",props:{modelValue:{type:Number,default:0},hints:{type:Array,default:()=>[]},penalty:{type:Number,default:1},maxHints:{type:Number,default:void 0},htmlContent:{type:Boolean,default:!1},label:{type:String,default:"Show hint"},description:{type:String,default:""}},emits:["update:modelValue","hint-revealed"],setup(n,{emit:e}){const t=n,r=e,o=a.ref(t.modelValue);a.watch(()=>t.modelValue,d=>{o.value=d});const i=a.computed(()=>t.maxHints!==void 0?t.maxHints:t.hints.length),s=a.computed(()=>o.value<i.value),l=a.computed(()=>t.hints.slice(0,o.value));function c(){if(!s.value)return;const d=o.value;o.value++,r("update:modelValue",o.value),r("hint-revealed",{hint:t.hints[d],index:d,penaltyTotal:o.value*t.penalty})}return(d,u)=>(a.openBlock(),a.createElementBlock("div",Dm,[n.description?(a.openBlock(),a.createElementBlock("div",{key:0,innerHTML:a.unref(ue)(n.description),class:"hint-system__description"},null,8,Vm)):a.createCommentVNode("",!0),l.value.length?(a.openBlock(),a.createBlock(a.TransitionGroup,{key:1,name:"hint-reveal",tag:"ol",class:"hint-system__list"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,(f,h)=>(a.openBlock(),a.createElementBlock("li",{key:h,class:"hint-system__hint"},[a.renderSlot(d.$slots,"hint",{hint:f,index:h,isNew:h===o.value-1},()=>[n.htmlContent?(a.openBlock(),a.createElementBlock("div",{key:0,class:"hint-system__hint-content",innerHTML:a.unref(ue)(f.content||"")},null,8,$m)):(a.openBlock(),a.createElementBlock("div",Om,a.toDisplayString(f.content),1))])]))),128))]),_:3})):a.createCommentVNode("",!0),s.value?a.renderSlot(d.$slots,"trigger",{key:2,revealNext:c,canReveal:s.value,revealedCount:o.value,total:i.value},()=>[a.createElementVNode("button",{type:"button",class:"hint-system__trigger d-block w-100 text-center",disabled:!s.value,onClick:c},a.toDisplayString(n.label),9,Im)]):a.createCommentVNode("",!0)]))}}),Rm=["id","popover"],Dr=a.defineComponent({__name:"popover-dialog",props:{modelValue:{type:Boolean,default:!1},type:{type:String,default:"auto"},id:{type:String,default:()=>`popover-dialog-${Math.random().toString(36).substr(2,9)}`},title:{type:String,default:""},header:{type:Boolean,default:!1},footer:{type:Boolean,default:!1},classes:{type:String,default:""},hover:{type:Boolean,default:!1},hoverDelay:{type:Number,default:400},closeTimeout:{type:Number,default:0}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=a.ref(),i=a.ref(),s=a.ref(!1),l=a.computed(()=>"ontouchstart"in window||navigator.maxTouchPoints>0);function c(){clearTimeout(i.value),t.hover&&o.value?.showPopover()}function d(){s.value=!0,clearTimeout(i.value),c()}function u(){s.value=!1,(t.hover||t.closeTimeout)&&(i.value=setTimeout(()=>{o.value?.hidePopover()},t.closeTimeout||t.hoverDelay))}a.watch(()=>t.modelValue,(h,p)=>{h&&!p?o.value?.matches(":popover-open")||o.value?.showPopover():!h&&p&&o.value?.matches(":popover-open")&&o.value?.hidePopover()});function f(h){h.newState==="open"?(t.closeTimeout&&!s.value&&(clearTimeout(i.value),i.value=setTimeout(()=>{s.value||o.value?.hidePopover()},t.closeTimeout)),t.modelValue||r("update:modelValue",!0)):h.newState==="closed"&&(s.value=!1,t.modelValue&&r("update:modelValue",!1))}return a.onMounted(()=>{if(o.value?.addEventListener("toggle",f),t.modelValue&&o.value?.showPopover(),!l.value){o.value?.addEventListener("mouseenter",d),o.value?.addEventListener("mouseleave",u);const h=document.querySelector(`[popovertarget="${t.id}"]`);h&&(h.addEventListener("mouseenter",d),h.addEventListener("mouseleave",u))}}),a.onBeforeUnmount(()=>{if(clearTimeout(i.value),o.value?.removeEventListener("toggle",f),!l.value){o.value?.removeEventListener("mouseenter",d),o.value?.removeEventListener("mouseleave",u);const h=document.querySelector(`[popovertarget="${t.id}"]`);h&&(h.removeEventListener("mouseenter",d),h.removeEventListener("mouseleave",u))}}),(h,p)=>(a.openBlock(),a.createElementBlock("span",{class:"popover-dialog",id:n.id,popover:n.type,ref_key:"popover",ref:o},[a.renderSlot(h.$slots,"default",{},()=>[p[0]||(p[0]=a.createTextVNode(" Popover content goes here. ",-1))])],8,Rm))}}),Lm={class:"popover-tooltip"},zm=["popovertarget","disabled","aria-describedby","aria-label"],Fm={class:"popover-tooltip__content d-flex flex-column"},Hm={key:0,class:"popover-tooltip__header d-flex p-3 border-bottom"},Wm=["innerHTML"],qm={class:"popover-tooltip__body"},jm=["innerHTML"],Um={key:1,class:"popover-tooltip__footer d-flex p-3 border-top"},_m=a.defineComponent({__name:"popover-tooltip",props:{modelValue:{type:Boolean,default:!1},id:{type:String,default:()=>`popover-tooltip-${Math.random().toString(36).substr(2,9)}`},size:{type:String},exclusive:{type:Boolean,default:!0},header:{type:Boolean,default:!1},footer:{type:Boolean,default:!1},title:{type:String,default:""},content:{type:String,default:""},hover:{type:Boolean,default:!0},hoverDelay:{type:Number,default:400},disabled:{type:Boolean,default:!1},ariaLabel:{type:String,default:""}},emits:["update:modelValue","confirm","cancel"],setup(n,{emit:e}){const t=n,r=e,o=Bn(()=>t.title),i=Bn(()=>t.content),s=a.computed({get(){return t.modelValue},set(d){r("update:modelValue",d)}}),l=a.ref(),c=a.ref();return(d,u)=>(a.openBlock(),a.createElementBlock("span",Lm,[a.createElementVNode("button",{type:"button",popovertarget:n.id,disabled:n.disabled,"aria-describedby":n.id,"aria-label":n.ariaLabel||d.$te("common.moreInfo")?d.$t("common.moreInfo"):void 0,ref_key:"trigger",ref:l},[a.renderSlot(d.$slots,"button",{},()=>[u[3]||(u[3]=a.createElementVNode("span",{class:"popover-tooltip__trigger"}," i ",-1))])],8,zm),a.createVNode(Dr,{id:n.id,modelValue:s.value,"onUpdate:modelValue":u[2]||(u[2]=f=>s.value=f),hover:n.hover,"hover-delay":n.hoverDelay,ref_key:"dialog",ref:c,role:"tooltip",class:a.normalizeClass(n.size?`popover-tooltip--${n.size}`:"")},{default:a.withCtx(()=>[a.createElementVNode("div",Fm,[n.header?(a.openBlock(),a.createElementBlock("div",Hm,[n.title?(a.openBlock(),a.createElementBlock("h5",{key:0,class:"popover-tooltip__title",innerHTML:a.unref(o)},null,8,Wm)):a.createCommentVNode("",!0),a.createElementVNode("button",{type:"button",class:"btn-close ms-auto border-radius-none","aria-label":"Close",onClick:u[0]||(u[0]=f=>s.value=!1)})])):a.createCommentVNode("",!0),a.createElementVNode("div",qm,[a.renderSlot(d.$slots,"default",{},()=>[a.createElementVNode("span",{innerHTML:a.unref(i)},null,8,jm)])]),n.footer?(a.openBlock(),a.createElementBlock("div",Um,[a.renderSlot(d.$slots,"footer"),a.createElementVNode("button",{type:"button",class:"btn ms-auto",onClick:u[1]||(u[1]=f=>s.value=!1)},a.toDisplayString(d.$t("common.close")),1)])):a.createCommentVNode("",!0)])]),_:3},8,["id","modelValue","hover","hover-delay","class"])]))}}),Qm={class:"popover-notification__header d-flex justify-content-between mb-2"},Jm={class:"popover-notification__title"},Km=["onClick"],Gm=["innerHTML"],Ym=a.defineComponent({__name:"popover-notifications",props:{modelValue:{type:Boolean,default:!1},id:{type:String,default:()=>`popover-notifications-${Math.random().toString(36).substr(2,9)}`},items:{type:Array,default:()=>[]},debounceItem:{type:Number,default:0},closeTimeout:{type:Number,default:8e3},collapsible:{type:Boolean,default:!0}},setup(n,{expose:e}){const t=n,r=a.ref([]),o=a.ref([]),i=a.computed(()=>r.value.map(h=>({...h,content:ue(h.content||"")}))),s=a.ref(!1),l=a.computed(()=>t.collapsible&&r.value.length>3);function c(h,p){r.value=r.value.filter(m=>m.id!==h.id)}a.watch(()=>t.items,(h,p)=>{const m=h.filter(A=>!p.some(g=>g.id===A.id));o.value=[...o.value,...m]});function d(){setTimeout(()=>{console.log("Queueing item:",o.value);const h=o.value.shift();h&&r.value.push({...h,closeTimeout:t.closeTimeout,visible:!0}),o.value.length>0&&d()},r.value.length?t.debounceItem:0)}function u(h){l.value&&(h.preventDefault(),h.stopPropagation(),s.value=!s.value)}function f(h){console.log("Adding item:",h),o.value.push(h),d()}return a.onMounted(()=>{o.value=t.items,o.value.length>3&&(s.value=!0),d()}),e({addItem:f}),(h,p)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["popover-notifications",{"popover-notifications--collapsed":s.value}]),style:{anchorName:"--popover-notifications"}},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,(m,A)=>(a.openBlock(),a.createBlock(Dr,{key:m.id,id:m.id,"close-timeout":m.closeTimeout,type:"manual",class:"popover-notification",modelValue:m.visible,"onUpdate:modelValue":[g=>m.visible=g,g=>c(m)],onClick:u},{default:a.withCtx(()=>[a.renderSlot(h.$slots,"item",{item:m},()=>[a.createElementVNode("div",Qm,[a.createElementVNode("span",Jm,a.toDisplayString(m.title),1),a.createElementVNode("button",{type:"button",class:"btn btn-close p-0",onClick:a.withModifiers(g=>m.visible=!1,["stop"]),"aria-label":"Close notification"},null,8,Km)]),a.createElementVNode("span",{innerHTML:m.content},null,8,Gm)])]),_:2},1032,["id","close-timeout","modelValue","onUpdate:modelValue"]))),128))],2))}}),Xm=a.defineComponent({__name:"dom-renderer",props:{modelValue:{type:String,default:""},fixedWidth:{type:Number,default:0},renderUpdates:{type:Boolean,default:!1},exportToSvg:{type:Boolean,default:!1},options:{type:Object,default:()=>({})},pending:{type:Boolean,default:!1},emitPending:{type:Boolean,default:!1},debug:{type:Boolean,default:!1}},emits:["update:modelValue","update:pending"],setup(n,{emit:e}){const t=n,r=e,o=a.ref(),i=a.ref(""),s=a.ref(),l=a.ref(!0);async function c(){if(!o.value||!l.value)return"";const u=o.value;if(!u.isConnected)return"";try{t.emitPending&&r("update:pending",!0);const f=u.firstElementChild;if(!f)return"";const h=await lc(f,{backgroundColor:"rgba(0, 0, 0, 0)",scale:1,...t.options});if(!l.value||!o.value||!u.isConnected)return"";const p=h.toDataURL();if(r("update:modelValue",p),t.emitPending&&r("update:pending",!1),t.debug){const m=new Image;m.src=p,document.body.appendChild(m)}return p}catch(f){return l.value&&t.emitPending&&r("update:pending",!1),console.warn("dom-renderer: Render failed",f),""}}const d=Nr.debounce(async()=>{i.value=await c()},300,{trailing:!0,leading:!1});return a.onMounted(()=>{const u=o.value;t.renderUpdates&&(s.value=new MutationObserver(async f=>{!l.value||!u.isConnected||(t.emitPending&&r("update:pending",!0),d())}),s.value.observe(u,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),setTimeout(()=>{t.emitPending&&r("update:pending",!0),d()},500)}),a.onBeforeUnmount(()=>{l.value=!1,s.value&&s.value.disconnect(),d.cancel()}),(u,f)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["dom-renderer",{"off-screen":!n.debug}]),ref_key:"renderer",ref:o,style:a.normalizeStyle(n.fixedWidth>0?{width:`${n.fixedWidth}px`}:{})},[a.renderSlot(u.$slots,"default")],6))}}),Zm={class:"qr-code"},eA=["innerHTML"],tA=a.defineComponent({__name:"qr-code",props:{data:null,image:null,download:{type:Boolean,default:!1},filename:{type:String,default:"qr-code"}},emits:["update:dataUrl"],setup(n,{expose:e,emit:t}){const r=n,o=a.ref(),i=a.computed(()=>({width:300,height:300,type:"canvas",data:r.data,...r.image?{image:r.image}:{},margin:10,qrOptions:{typeNumber:0,mode:"Byte",errorCorrectionLevel:"Q"},imageOptions:{hideBackgroundDots:!0,imageSize:.4,margin:20,crossOrigin:"anonymous"},dotsOptions:{type:"rounded"},backgroundOptions:{color:"#ffffff"},cornersSquareOptions:{color:"#333333",type:"extra-rounded"},cornersDotOptions:{color:"#333333",type:"dot"}}));function s(c=null,d=null){typeof window<"u"&&(o.value&&(o.value.innerHTML=""),new Zo(c||i.value).append(o.value))}function l(){new Zo({...i.value,width:1200,height:1200}).download({name:r.filename,extension:"png"})}return a.watch(()=>i.value,s,{deep:!0,immediate:!0}),a.onMounted(()=>{typeof window<"u"&&s()}),e({download:l}),(c,d)=>(a.openBlock(),a.createElementBlock("div",Zm,[r.download?(a.openBlock(),a.createElementBlock("button",{key:0,class:"btn btn-outline-contrast mb-3",onClick:l,innerHTML:c.$t("qrlink.download")},null,8,eA)):(a.openBlock(),a.createElementBlock("div",{key:1,ref_key:"canvas",ref:o},null,512))]))}}),nA={class:"link-sharing"},rA={key:0,class:"link-sharing__links container"},oA={class:"row"},iA={key:0,class:"col-12 col-md-6"},sA=["href"],aA={class:"caption"},lA={key:1,class:"col-12 col-md-6"},cA=["href"],dA={class:"caption"},uA={key:2,class:"col-12 col-md-6"},fA={class:"caption"},hA={key:3,class:"col-12 col-md-6"},pA=["href"],mA={class:"caption"},AA={key:4,class:"col-12 col-md-6"},gA=["href"],yA={class:"caption"},bA={key:5,class:"col-12 col-md-6"},kA={class:"caption"},wA={key:6,class:"col-12 col-md-6"},SA=["href"],CA={class:"caption"},EA={key:1,class:"link-sharing__instructions pt-5"},xA={class:"row"},MA={class:"col-12 text-center py-0"},NA={class:"mb-5"},BA=n=>n.replace(/<(?:.|\n)*?>/gm,""),vA=a.defineComponent({__name:"link-sharing",props:{url:{type:String,default:""},subject:{type:String,default:""},hashtags:Array,text:{type:String,default:""},media:{type:String,default:""},services:{type:Object,default:{facebook:!0,instagram:!0,linkedin:!0,whatsapp:!0,mailto:!0,clipboard:!0,bluesky:!0}}},setup(n){const e=n,t=a.ref(!1),r=a.computed(()=>encodeURIComponent(e.url));a.computed(()=>encodeURIComponent(e.media));const o=a.computed(()=>BA(e.text)),i=a.computed(()=>!!(navigator&&navigator.userAgent&&/Mobi|Android/i.test(navigator.userAgent)));async function s(){const l=document.createElement("textarea");document.body.appendChild(l),l.value=e.url,l.select(),l.setSelectionRange(0,99999),navigator.clipboard.writeText(l.value),document.body.removeChild(l)}return(l,c)=>(a.openBlock(),a.createElementBlock("div",nA,[t.value?(a.openBlock(),a.createElementBlock("div",EA,[a.createElementVNode("div",xA,[a.createElementVNode("div",MA,[a.createElementVNode("div",NA,[a.createElementVNode("p",null,a.toDisplayString(l.$t("sharing.instructions",{service:"Instagram"})),1),a.createElementVNode("p",null,[a.createElementVNode("strong",null,a.toDisplayString(Array.isArray(n.hashtags)?n.hashtags.join(", "):n.hashtags),1)]),a.createElementVNode("button",{type:"button",class:"btn btn-text",onClick:c[1]||(c[1]=a.withModifiers(d=>t.value=!t.value,["prevent"]))},[a.createVNode(O,{symbol:"arrow-left"}),a.createTextVNode(" "+a.toDisplayString(l.$t("common.back")),1)])])])])])):(a.openBlock(),a.createElementBlock("div",rA,[a.createElementVNode("div",oA,[n.services.facebook?(a.openBlock(),a.createElementBlock("div",iA,[a.createElementVNode("a",{class:"link-sharing__link btn btn-primary",href:`https://www.facebook.com/sharer.php?u=${r.value}`,target:"_blank",rel:"noopener"},[a.createVNode(O,{symbol:"facebook"}),a.createElementVNode("span",aA,a.toDisplayString(l.$t("sharing.facebook")),1)],8,sA)])):a.createCommentVNode("",!0),n.services.bluesky?(a.openBlock(),a.createElementBlock("div",lA,[a.createElementVNode("a",{class:"link-sharing__link btn btn-primary",href:`https://bsky.app/intent/compose?text=${o.value}${o.value?"%20":""}${n.url}`,target:"_blank",rel:"noopener"},[a.createVNode(O,{symbol:"bluesky-logo"}),a.createElementVNode("span",dA,a.toDisplayString(l.$t("sharing.bluesky")),1)],8,cA)])):a.createCommentVNode("",!0),n.services.instagram?(a.openBlock(),a.createElementBlock("div",uA,[a.createElementVNode("button",{type:"button",class:"link-sharing__link btn btn-primary",onClick:c[0]||(c[0]=a.withModifiers(d=>t.value=!t.value,["prevent"]))},[a.createVNode(O,{symbol:"instagram"}),a.createElementVNode("span",fA,a.toDisplayString(l.$t("sharing.instagram")),1)])])):a.createCommentVNode("",!0),n.services.linkedin?(a.openBlock(),a.createElementBlock("div",hA,[a.createElementVNode("a",{class:"link-sharing__link btn btn-primary",href:`https://www.linkedin.com/shareArticle?mini=true&url=${r.value}&title=${n.subject}`,target:"_blank",rel:"noopener"},[a.createVNode(O,{symbol:"linkedin"}),a.createElementVNode("span",mA,a.toDisplayString(l.$t("sharing.linkedin")),1)],8,pA)])):a.createCommentVNode("",!0),n.services.whatsapp&&i.value?(a.openBlock(),a.createElementBlock("div",AA,[a.createElementVNode("a",{class:"link-sharing__link btn btn-primary",href:`whatsapp://send?text=${r.value}`,target:"_blank",rel:"noopener"},[a.createVNode(O,{symbol:"whatsapp"}),a.createElementVNode("span",yA,a.toDisplayString(l.$t("sharing.whatsapp")),1)],8,gA)])):a.createCommentVNode("",!0),n.services.clipboard?(a.openBlock(),a.createElementBlock("div",bA,[a.createElementVNode("button",{type:"button",class:"link-sharing__link btn btn-primary",onClick:a.withModifiers(s,["prevent","stop"])},[a.createVNode(O,{symbol:"copy"}),a.createElementVNode("span",kA,a.toDisplayString(l.$t("sharing.clipboard")),1)])])):a.createCommentVNode("",!0),n.services.mailto?(a.openBlock(),a.createElementBlock("div",wA,[a.createElementVNode("a",{class:"link-sharing__link btn btn-primary",href:`mailto:?subject=${n.subject}&body=${o.value}%0D%0A${n.url}`,target:"_blank",rel:"noopener"},[a.createVNode(O,{symbol:"mail"}),a.createElementVNode("span",CA,a.toDisplayString(l.$t("sharing.mailto")),1)],8,SA)])):a.createCommentVNode("",!0)])]))]))}}),TA={class:"base-form"},DA=a.defineComponent({__name:"base-form",props:{id:{},name:{},variant:{},disabled:{type:Boolean},pending:{type:Boolean}},setup(n){function e(o){console.log("input",o)}function t(o){console.log("reset",o)}function r(o){console.log("submit",o)}return(o,i)=>(a.openBlock(),a.createElementBlock("div",TA,[a.createElementVNode("form",{ref:"form",onInput:e,onReset:t,onSubmit:a.withModifiers(r,["prevent"])},[a.renderSlot(o.$slots,"default")],544)]))}}),VA={class:"touch-wrapper__controls"},$A={class:"btn-group",role:"group"},OA=a.defineComponent({__name:"touch-wrapper",props:{modelValue:{type:Number,default:1}},emits:["update:modelValue"],setup(n,{emit:e}){const t=a.getCurrentInstance(),r=t&&t.appContext.config.globalProperties.$config,o=n,i=e,s=a.ref();function l(u){const f=o.modelValue+u;i("update:modelValue",u===0?1:f>=1?f:1)}function c(u){if(u.ctrlKey){u.preventDefault();const f=0-u.deltaY*.01;l(f)}}function d(u){u.preventDefault();const{scale:f}=u,h=f>1?f*.01:0-f;l(h)}return a.onMounted(()=>{s.value&&(s.value.addEventListener("wheel",c,!1),s.value.addEventListener("gesturestart",d,!1),s.value.addEventListener("gesturechange",d,!1),s.value.addEventListener("gestureend",d,!1))}),(u,f)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"touchElement",ref:s,class:"touch-wrapper"},[a.renderSlot(u.$slots,"controls",{on:{setScale:l}},()=>[a.createElementVNode("div",VA,[a.createElementVNode("div",$A,[a.createElementVNode("button",{type:"button",class:"btn",onClick:f[0]||(f[0]=h=>l(-1))},[a.createVNode(O,{symbol:"minus","base-path":a.unref(r).iconSprite},null,8,["base-path"])]),a.createElementVNode("button",{type:"button",class:"btn",onClick:f[1]||(f[1]=h=>l(0))},[a.createVNode(O,{symbol:"maximize","base-path":a.unref(r).iconSprite},null,8,["base-path"])]),a.createElementVNode("button",{type:"button",class:"btn",onClick:f[2]||(f[2]=h=>l(1))},[a.createVNode(O,{symbol:"plus","base-path":a.unref(r).iconSprite},null,8,["base-path"])])])])]),a.renderSlot(u.$slots,"default")],512))}});let Vn=null;async function IA(){if(typeof window>"u")return null;if(Vn)return Vn;const n=await import("canvas-confetti");return Vn=n.default||n,Vn}const Mi={default:{items:[{particleCount:80,spread:120,origin:{y:.625,x:.5}},{timeout:400,particleCount:80,spread:120,origin:{y:.625,x:.625}},{timeout:800,particleCount:80,spread:120,origin:{y:.625,x:.375}}]},randomDirection:{items:[{angle:Vr(55,125),spread:Vr(50,70),particleCount:Vr(50,100),origin:{y:.6}}]},pride:{items:[{timeout:20,particleCount:2,spread:32,origin:{x:0},colors:["#ff0000"]},{timeout:20,particleCount:2,spread:32,origin:{x:1},colors:["#ff0000"]}]}};function Vr(n,e){return Math.random()*(e-n)+n}const PA=a.defineComponent({__name:"canvas-confetti",props:{preset:{type:String,default:"default"},items:{default:()=>[{}]},colors:{type:Array,default:()=>[]},loop:{type:Boolean,default:!1}},setup(n){const e=n,t=a.ref(null),r=a.computed(()=>({...Mi[e.preset],items:Mi[e.preset].items.map((s,l)=>({...s,...e.items[l],...e.colors.length?{colors:e.colors}:{}}))}));async function o(s){return new Promise(l=>{(typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):d=>setTimeout(d,16))(()=>t.value?.confetti?.(JSON.parse(JSON.stringify(s)))),setTimeout(()=>l(),0)})}async function i(){await Promise.all(r.value.items.map(s=>new Promise(l=>setTimeout(()=>{l(o(s))},s.timeout||0)))),e.loop&&i()}return a.onMounted(async()=>{if(typeof window<"u"&&t.value){const s=await IA();if(!s)return;t.value.confetti=t.value?.confetti||s.create(t.value,{resize:!0}),i()}}),(s,l)=>(a.openBlock(),a.createElementBlock("canvas",{class:"canvas-confetti",ref_key:"canvas",ref:t},null,512))}});function re(n){this.content=n}re.prototype={constructor:re,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,o=r.find(n),i=r.content.slice();return o==-1?i.push(t||n,e):(i[o+1]=e,t&&(i[o]=t)),new re(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new re(t)},addToStart:function(n,e){return new re([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new re(t)},addBefore:function(n,e,t){var r=this.remove(e),o=r.content.slice(),i=r.find(n);return o.splice(i==-1?o.length:i,0,e,t),new re(o)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=re.from(n),n.size?new re(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=re.from(n),n.size?new re(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=re.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}},re.from=function(n){if(n instanceof re)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new re(e)};function Ni(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let o=n.child(r),i=e.child(r);if(o==i){t+=o.nodeSize;continue}if(!o.sameMarkup(i))return t;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)t++;return t}if(o.content.size||i.content.size){let s=Ni(o.content,i.content,t+1);if(s!=null)return s}t+=o.nodeSize}}function Bi(n,e,t,r){for(let o=n.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:t,b:r};let s=n.child(--o),l=e.child(--i),c=s.nodeSize;if(s==l){t-=c,r-=c;continue}if(!s.sameMarkup(l))return{a:t,b:r};if(s.isText&&s.text!=l.text){let d=0,u=Math.min(s.text.length,l.text.length);for(;d<u&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(s.content.size||l.content.size){let d=Bi(s.content,l.content,t-1,r-1);if(d)return d}t-=c,r-=c}}class C{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,o=0,i){for(let s=0,l=0;l<t;s++){let c=this.content[s],d=l+c.nodeSize;if(d>e&&r(c,o+l,i||null,s)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,t-u),r,o+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,o){let i="",s=!0;return this.nodesBetween(e,t,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,t-c):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:i+=r),i+=d},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(o[o.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new C(o,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],o=0;if(t>e)for(let i=0,s=0;s<t;i++){let l=this.content[i],c=s+l.nodeSize;c>e&&((s<e||c>t)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,t-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,t-s-1))),r.push(l),o+=l.nodeSize),s=c}return new C(r,o)}cutByIndex(e,t){return e==t?C.empty:e==0&&t==this.content.length?this:new C(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let o=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return o[e]=t,new C(o,i)}addToStart(e){return new C([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new C(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let o=this.content[t];e(o,r,t),r+=o.nodeSize}}findDiffStart(e,t=0){return Ni(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Bi(this,e,t,r)}findIndex(e){if(e==0)return $n(0,e);if(e==this.size)return $n(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let o=this.child(t),i=r+o.nodeSize;if(i>=e)return i==e?$n(t+1,i):$n(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return C.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new C(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return C.empty;let t,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(t||(t=e.slice(0,o)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new C(t||e,r)}static from(e){if(!e)return C.empty;if(e instanceof C)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new C([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}C.empty=new C([],0);const $r={index:0,offset:0};function $n(n,e){return $r.index=n,$r.offset=e,$r}function On(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!On(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!On(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Q=class Yo{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,o)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&On(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let o=r.create(t.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Yo.none;if(e instanceof Yo)return[e];let t=e.slice();return t.sort((r,o)=>r.type.rank-o.type.rank),t}};Q.none=[];class In extends Error{}class T{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Ti(this.content,e+this.openStart,t);return r&&new T(r,this.openStart,this.openEnd)}removeBetween(e,t){return new T(vi(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return T.empty;let r=t.openStart||0,o=t.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new T(C.fromJSON(e,t.content),r,o)}static maxOpen(e,t=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)o++;return new T(e,r,o)}}T.empty=new T(C.empty,0,0);function vi(n,e,t){let{index:r,offset:o}=n.findIndex(e),i=n.maybeChild(r),{index:s,offset:l}=n.findIndex(t);if(o==e||i.isText){if(l!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(vi(i.content,e-o-1,t-o-1)))}function Ti(n,e,t,r){let{index:o,offset:i}=n.findIndex(e),s=n.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=Ti(s.content,e-i-1,t,s);return l&&n.replaceChild(o,s.copy(l))}function RA(n,e,t){if(t.openStart>n.depth)throw new In("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new In("Inconsistent open depths");return Di(n,e,t,0)}function Di(n,e,t,r){let o=n.index(r),i=n.node(r);if(o==e.index(r)&&r<n.depth-t.openStart){let s=Di(n,e,t,r+1);return i.copy(i.content.replaceChild(o,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,l=s.content;return ht(s,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=LA(t,n);return ht(i,$i(n,s,l,e,r))}else return ht(i,Pn(n,e,r))}function Vi(n,e){if(!e.type.compatibleContent(n.type))throw new In("Cannot join "+e.type.name+" onto "+n.type.name)}function Or(n,e,t){let r=n.node(t);return Vi(r,e.node(t)),r}function ft(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Jt(n,e,t,r){let o=(e||n).node(t),i=0,s=e?e.index(t):o.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(ft(n.nodeAfter,r),i++));for(let l=i;l<s;l++)ft(o.child(l),r);e&&e.depth==t&&e.textOffset&&ft(e.nodeBefore,r)}function ht(n,e){return n.type.checkContent(e),n.copy(e)}function $i(n,e,t,r,o){let i=n.depth>o&&Or(n,e,o+1),s=r.depth>o&&Or(t,r,o+1),l=[];return Jt(null,n,o,l),i&&s&&e.index(o)==t.index(o)?(Vi(i,s),ft(ht(i,$i(n,e,t,r,o+1)),l)):(i&&ft(ht(i,Pn(n,e,o+1)),l),Jt(e,t,o,l),s&&ft(ht(s,Pn(t,r,o+1)),l)),Jt(r,null,o,l),new C(l)}function Pn(n,e,t){let r=[];if(Jt(null,n,t,r),n.depth>t){let o=Or(n,e,t+1);ft(ht(o,Pn(n,e,t+1)),r)}return Jt(e,null,t,r),new C(r)}function LA(n,e){let t=e.depth-n.openStart,o=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)o=e.node(i).copy(C.from(o));return{start:o.resolveNoCache(n.openStart+t),end:o.resolveNoCache(o.content.size-n.openEnd-t)}}class Kt{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(t);return r?e.child(t).cut(r):o}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],o=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Q.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),o=e.maybeChild(t);if(!r){let l=r;r=o,o=l}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Rn(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],o=0,i=t;for(let s=e;;){let{index:l,offset:c}=s.content.findIndex(i),d=i-c;if(r.push(s,l,o+c),!d||(s=s.child(l),s.isText))break;i=d-1,o+=c+1}return new Kt(t,r,i)}static resolveCached(e,t){let r=Oi.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==t)return s}else Oi.set(e,r=new zA);let o=r.elts[r.i]=Kt.resolve(e,t);return r.i=(r.i+1)%FA,o}}class zA{constructor(){this.elts=[],this.i=0}}const FA=12,Oi=new WeakMap;class Rn{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const HA=Object.create(null);class ye{constructor(e,t,r,o=Q.none){this.type=e,this.attrs=t,this.marks=o,this.content=r||C.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,o=0){this.content.nodesBetween(e,t,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,o){return this.content.textBetween(e,t,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&On(this.attrs,t||e.defaultAttrs||HA)&&Q.sameSet(this.marks,r||Q.none)}copy(e=null){return e==this.content?this:new ye(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ye(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return T.empty;let o=this.resolve(e),i=this.resolve(t),s=r?0:o.sharedDepth(t),l=o.start(s),d=o.node(s).content.cut(o.pos-l,i.pos-l);return new T(d,o.depth-s,i.depth-s)}replace(e,t,r){return RA(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:o}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(o==e||t.isText)return t;e-=o+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let o=this.content.child(t-1);return{node:o,index:t-1,offset:r-o.nodeSize}}resolve(e){return Kt.resolveCached(this,e)}resolveNoCache(e){return Kt.resolve(this,e)}rangeHasMark(e,t,r){let o=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ii(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=C.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let c=o;c<i;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,t,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,t);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Q.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Q.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let o=C.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,o,r);return i.type.checkAttrs(i.attrs),i}}ye.prototype.text=void 0;class Ln extends ye{constructor(e,t,r,o){if(super(e,t,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ii(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ln(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ln(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ii(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class pt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new WA(e,t);if(r.next==null)return pt.empty;let o=Pi(r);r.next&&r.err("Unexpected trailing text");let i=KA(JA(o));return GA(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let o=this;for(let i=t;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let o=[this];function i(s,l){let c=s.matchFragment(e,r);if(c&&(!t||c.validEnd))return C.from(l.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(f)==-1){o.push(f);let h=i(f,l.concat(u));if(h)return h}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let l=o;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:l,next:c}=i.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!o.type||c.validEnd)&&(r.push({match:l.contentMatch,type:l,via:o}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&t(r.next[o].next)}return t(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
|
|
5
|
-
`)}}pt.empty=new pt(!0);class WA{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.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(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Pi(n){let e=[];do e.push(qA(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function qA(n){let e=[];do e.push(jA(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function jA(n){let e=QA(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=UA(n,e);else break;return e}function Ri(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function UA(n,e){let t=Ri(n),r=t;return n.eat(",")&&(n.next!="}"?r=Ri(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function _A(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let o=[];for(let i in t){let s=t[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&n.err("No node type or group '"+e+"' found"),o}function QA(n){if(n.eat("(")){let e=Pi(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=_A(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function JA(n){let e=[[]];return o(i(n,0),t()),e;function t(){return e.push([])-1}function r(s,l,c){let d={term:c,to:l};return e[s].push(d),d}function o(s,l){s.forEach(c=>c.to=l)}function i(s,l){if(s.type=="choice")return s.exprs.reduce((c,d)=>c.concat(i(d,l)),[]);if(s.type=="seq")for(let c=0;;c++){let d=i(s.exprs[c],l);if(c==s.exprs.length-1)return d;o(d,l=t())}else if(s.type=="star"){let c=t();return r(l,c),o(i(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=t();return o(i(s.expr,l),c),o(i(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(l)].concat(i(s.expr,l));if(s.type=="range"){let c=l;for(let d=0;d<s.min;d++){let u=t();o(i(s.expr,c),u),c=u}if(s.max==-1)o(i(s.expr,c),c);else for(let d=s.min;d<s.max;d++){let u=t();r(c,u),o(i(s.expr,c),u),c=u}return[r(c)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Li(n,e){return e-n}function zi(n,e){let t=[];return r(e),t.sort(Li);function r(o){let i=n[o];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(o);for(let s=0;s<i.length;s++){let{term:l,to:c}=i[s];!l&&t.indexOf(c)==-1&&r(c)}}}function KA(n){let e=Object.create(null);return t(zi(n,0));function t(r){let o=[];r.forEach(s=>{n[s].forEach(({term:l,to:c})=>{if(!l)return;let d;for(let u=0;u<o.length;u++)o[u][0]==l&&(d=o[u][1]);zi(n,c).forEach(u=>{d||o.push([l,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let i=e[r.join(",")]=new pt(r.indexOf(n.length-1)>-1);for(let s=0;s<o.length;s++){let l=o[s][1].sort(Li);i.next.push({type:o[s][0],next:e[l.join(",")]||t(l)})}return i}}function GA(n,e){for(let t=0,r=[n];t<r.length;t++){let o=r[t],i=!o.validEnd,s=[];for(let l=0;l<o.next.length;l++){let{type:c,next:d}=o.next[l];s.push(c.name),i&&!(c.isText||c.hasRequiredAttrs())&&(i=!1),r.indexOf(d)==-1&&r.push(d)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Fi(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Hi(n,e){let t=Object.create(null);for(let r in n){let o=e&&e[r];if(o===void 0){let i=n[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=o}return t}function Wi(n,e,t,r){for(let o in e)if(!(o in n))throw new RangeError(`Unsupported attribute ${o} for ${t} of type ${o}`);for(let o in n){let i=n[o];i.validate&&i.validate(e[o])}}function qi(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new XA(n,r,e[r]);return t}let ji=class nc{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=qi(e,r.attrs),this.defaultAttrs=Fi(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==pt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Hi(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ye(this,this.computeAttrs(e),C.from(t),Q.setFrom(r))}createChecked(e=null,t,r){return t=C.from(t),this.checkContent(t),new ye(this,this.computeAttrs(e),t,Q.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=C.from(t),t.size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let o=this.contentMatch.matchFragment(t),i=o&&o.fillBefore(C.empty,!0);return i?new ye(this,e,t.append(i),Q.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Wi(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Q.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,s)=>r[i]=new nc(i,t,s));let o=t.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function YA(n,e,t){let r=t.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${i}`)}}class XA{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?YA(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class zn{constructor(e,t,r,o){this.name=e,this.rank=t,this.schema=r,this.spec=o,this.attrs=qi(e,o.attrs),this.excluded=null;let i=Fi(this.attrs);this.instance=i?new Q(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Q(this,Hi(this.attrs,e))}static compile(e,t){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new zn(i,o++,t,s)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Wi(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Ui{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let o in e)t[o]=e[o];t.nodes=re.from(e.nodes),t.marks=re.from(e.marks||{}),this.nodes=ji.compile(this.spec.nodes,this),this.marks=zn.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=pt.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?_i(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:_i(this,s.split(" "))}this.nodeFromJSON=o=>ye.fromJSON(this,o),this.markFromJSON=o=>Q.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof ji){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,o)}text(e,t){let r=this.nodes.text;return new Ln(r,r.defaultAttrs,e,Q.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function _i(n,e){let t=[];for(let r=0;r<e.length;r++){let o=e[r],i=n.marks[o],s=i;if(i)t.push(i);else for(let l in n.marks){let c=n.marks[l];(o=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&t.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function ZA(n){return n.tag!=null}function eg(n){return n.style!=null}class We{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(o=>{if(ZA(o))this.tags.push(o);else if(eg(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new Gi(this,t,!1);return r.addAll(e,Q.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Gi(this,t,!0);return r.addAll(e,Q.none,t.from,t.to),T.maxOpen(r.finish())}matchTag(e,t,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(rg(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,t,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],l=s.style;if(!(l.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(s.getAttrs){let c=s.getAttrs(t);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(e){let t=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<t.length;s++){let l=t[s];if((l.priority==null?50:l.priority)<i)break}t.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=Yi(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=Yi(s)),s.node||s.ignore||s.mark||(s.node=o)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new We(e,We.schemaRules(e)))}}const Qi={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},tg={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ji={ol:!0,ul:!0},Gt=1,Ir=2,Yt=4;function Ki(n,e,t){return e!=null?(e?Gt:0)|(e==="full"?Ir:0):n&&n.whitespace=="pre"?Gt|Ir:t&~Yt}class Fn{constructor(e,t,r,o,i,s){this.type=e,this.attrs=t,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=Q.none,this.match=i||(s&Yt?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(C.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Gt)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let t=C.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(C.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Qi.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Gi{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=t.topNode,i,s=Ki(null,t.preserveWhitespace,0)|(r?Yt:0);o?i=new Fn(o.type,o.attrs,Q.none,!0,t.topMatch||o.type.contentMatch,s):r?i=new Fn(null,null,Q.none,!0,null,s):i=new Fn(e.schema.topNodeType,null,Q.none,!0,null,s),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,o=this.top,i=o.options&Ir?"full":this.localPreserveWS||(o.options&Gt)>0,{schema:s}=this.parser;if(i==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
|
|
6
|
-
`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let c=0;c<l.length;c++)c&&this.insertNode(s.linebreakReplacement.create(),t,!0),l[c]&&this.insertNode(s.text(l[c]),t,!/\S/.test(l[c]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=o.content[o.content.length-1],c=e.previousSibling;(!l||c&&c.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;Ji.hasOwnProperty(s)&&this.parser.normalizeLists&&ng(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(c?c.ignore:tg.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let d,u=this.needsBlock;if(Qi.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),d=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let f=c&&c.skip?t:this.readStyles(e,t);f&&this.addAll(e,f),d&&this.sync(i),this.needsBlock=u}else{let d=this.readStyles(e,t);d&&this.addElementByRule(e,c,d,c.consuming===!1?l:void 0)}this.localPreserveWS=o}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
7
|
-
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=r.getPropertyValue(i);if(s)for(let l=void 0;;){let c=this.parser.matchStyle(i,s,this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?t=t.filter(d=>!c.clearMark(d)):t=t.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return t}addElementByRule(e,t,r,o){let i,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let c=this.enter(s,t.attrs||null,r,t.preserveWhitespace);c&&(i=!0,r=c)}else{let c=this.parser.schema.marks[t.mark];r=r.concat(c.create(t.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r,!1));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=o==null?null:e.childNodes[o];s!=l;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,t);this.findAtPoint(e,i)}findPlace(e,t,r){let o,i;for(let s=this.open,l=0;s>=0;s--){let c=this.nodes[s],d=c.findWrapping(e);if(d&&(!o||o.length>d.length+l)&&(o=d,i=c,!d.length))break;if(c.solid){if(r)break;l+=2}}if(!o)return null;this.sync(i);for(let s=0;s<o.length;s++)t=this.enterInner(o[s],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let o=this.findPlace(e,t,r);if(o){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=Q.none;for(let l of o.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):Xi(l.type,e.type))&&(s=l.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,t,r,o){let i=this.findPlace(e.create(t),r,!1);return i&&(i=this.enterInner(e,t,r,!0,o)),i}enterInner(e,t,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let l=Ki(e,i,s.options);s.options&Yt&&s.content.length==0&&(l|=Yt);let c=Q.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):Xi(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new Fn(e,t,c,o,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));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(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=Gt)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&t.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(l,c)=>{for(;l>=0;l--){let d=t[l];if(d==""){if(l==t.length-1||l==0)continue;for(;c>=i;c--)if(s(l-1,c))return!0;return!1}else{let u=c>0||c==0&&o?this.nodes[c].type:r&&c>=i?r.node(c-i).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function ng(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Ji.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function rg(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Yi(n){let e={};for(let t in n)e[t]=n[t];return e}function Xi(n,e){let t=e.schema.nodes;for(let r in t){let o=t[r];if(!o.allowsMarkType(n))continue;let i=[],s=l=>{i.push(l);for(let c=0;c<l.edgeCount;c++){let{type:d,next:u}=l.edge(c);if(d==e||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}class mt{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Pr(t).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let l=0,c=0;for(;l<i.length&&c<s.marks.length;){let d=s.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(i[l][0])||d.type.spec.spanning===!1)break;l++,c++}for(;l<i.length;)o=i.pop()[1];for(;c<s.marks.length;){let d=s.marks[c++],u=this.serializeMark(d,s.isInline,t);u&&(i.push([d,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:o}=Hn(Pr(t),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,o)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let o=this.marks[e.type.name];return o&&Hn(Pr(r),o(e,t),null,e.attrs)}static renderSpec(e,t,r=null,o){return Hn(e,t,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new mt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Zi(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Zi(e.marks)}}function Zi(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Pr(n){return n.document||window.document}const es=new WeakMap;function og(n){let e=es.get(n);return e===void 0&&es.set(n,e=ig(n)),e}function ig(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)t(r[o]);else for(let o in r)t(r[o])}return t(n),e}function Hn(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=og(r))&&i.indexOf(e)>-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 s=o.indexOf(" ");s>0&&(t=o.slice(0,s),o=o.slice(s+1));let l,c=t?n.createElementNS(t,o):n.createElement(o),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let f in d)if(d[f]!=null){let h=f.indexOf(" ");h>0?c.setAttributeNS(f.slice(0,h),f.slice(h+1),d[f]):f=="style"&&c.style?c.style.cssText=d[f]:c.setAttribute(f,d[f])}}for(let f=u;f<e.length;f++){let h=e[f];if(h===0){if(f<e.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:p,contentDOM:m}=Hn(n,h,t,r);if(c.appendChild(p),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:c,contentDOM:l}}const ts=65535,ns=Math.pow(2,16);function sg(n,e){return n+e*ns}function rs(n){return n&ts}function ag(n){return(n-(n&ts))/ns}const is=1,ss=2,Wn=4,as=8;class Rr{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&as)>0}get deletedBefore(){return(this.delInfo&(is|Wn))>0}get deletedAfter(){return(this.delInfo&(ss|Wn))>0}get deletedAcross(){return(this.delInfo&Wn)>0}}class be{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&be.empty)return be.empty}recover(e){let t=0,r=rs(e);if(!this.inverted)for(let o=0;o<r;o++)t+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+t+ag(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?o:0);if(c>e)break;let d=this.ranges[l+i],u=this.ranges[l+s],f=c+d;if(e<=f){let h=d?e==c?-1:e==f?1:t:t,p=c+o+(h<0?0:u);if(r)return p;let m=e==(t<0?c:f)?null:sg(l/3,e-c),A=e==c?ss:e==f?is:Wn;return(t<0?e!=c:e!=f)&&(A|=as),new Rr(p,A,m)}o+=u-d}return r?e+o:new Rr(e+o,0,null)}touches(e,t){let r=0,o=rs(t),i=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[l+i],u=c+d;if(e<=u&&l==o*3)return!0;r+=this.ranges[l+s]-d}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],l=s-(this.inverted?i:0),c=s+(this.inverted?0:i),d=this.ranges[o+t],u=this.ranges[o+r];e(l,l+d,c,c+u),i+=u-d}}invert(){return new be(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?be.empty:new be(e<0?[0,-e,0]:[0,0,e])}}be.empty=new be([]);class qn{constructor(e,t,r=0,o=e?e.length:0){this.mirror=t,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new qn(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let o=e.getMirror(t);this.appendMap(e._maps[t],o!=null&&o<t?r+o:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let o=e.getMirror(t);this.appendMap(e._maps[t].invert(),o!=null&&o>t?r-o-1:void 0)}}invert(){let e=new qn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],l=s.mapResult(e,t);if(l.recover!=null){let c=this.getMirror(i);if(c!=null&&c>i&&c<this.to){i=c,e=this._maps[c].recover(l.recover);continue}}o|=l.delInfo,e=l.pos}return r?e:new Rr(e,o,null)}}const Lr=Object.create(null);class le{getMap(){return be.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Lr[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Lr)throw new RangeError("Duplicate use of step JSON ID "+e);return Lr[e]=t,t.prototype.jsonID=e,t}}class X{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new X(e,null)}static fail(e){return new X(null,e)}static fromReplace(e,t,r,o){try{return X.ok(e.replace(t,r,o))}catch(i){if(i instanceof In)return X.fail(i.message);throw i}}}function zr(n,e,t){let r=[];for(let o=0;o<n.childCount;o++){let i=n.child(o);i.content.size&&(i=i.copy(zr(i.content,e,i))),i.isInline&&(i=e(i,t,o)),r.push(i)}return C.fromArray(r)}class Je extends le{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new T(zr(t.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),t.openStart,t.openEnd);return X.fromReplace(e,this.from,this.to,i)}invert(){return new Be(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Je(t.pos,r.pos,this.mark)}merge(e){return e instanceof Je&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Je(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Je(t.from,t.to,e.markFromJSON(t.mark))}}le.jsonID("addMark",Je);class Be extends le{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new T(zr(t.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),t.openStart,t.openEnd);return X.fromReplace(e,this.from,this.to,r)}invert(){return new Je(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Be(t.pos,r.pos,this.mark)}merge(e){return e instanceof Be&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Be(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Be(t.from,t.to,e.markFromJSON(t.mark))}}le.jsonID("removeMark",Be);class Ke extends le{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return X.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return X.fromReplace(e,this.pos,this.pos+1,new T(C.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let o=0;o<t.marks.length;o++)if(!t.marks[o].isInSet(r))return new Ke(this.pos,t.marks[o]);return new Ke(this.pos,this.mark)}}return new At(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ke(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ke(t.pos,e.markFromJSON(t.mark))}}le.jsonID("addNodeMark",Ke);class At extends le{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return X.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return X.fromReplace(e,this.pos,this.pos+1,new T(C.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Ke(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new At(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new At(t.pos,e.markFromJSON(t.mark))}}le.jsonID("removeNodeMark",At);class Z extends le{constructor(e,t,r,o=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=o}apply(e){return this.structure&&Fr(e,this.from,this.to)?X.fail("Structure replace would overwrite content"):X.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new be([this.from,this.to-this.from,this.slice.size])}invert(e){return new Z(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&Z.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new Z(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Z)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?T.empty:new T(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Z(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?T.empty:new T(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Z(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Z(t.from,t.to,T.fromJSON(e,t.slice),!!t.structure)}}Z.MAP_BIAS=1,le.jsonID("replace",Z);class te extends le{constructor(e,t,r,o,i,s,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=l}apply(e){if(this.structure&&(Fr(e,this.from,this.gapFrom)||Fr(e,this.gapTo,this.to)))return X.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return X.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?X.fromReplace(e,this.from,this.to,r):X.fail("Content does not fit in gap")}getMap(){return new be([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new te(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||o<t.pos||i>r.pos?null:new te(t.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new te(t.from,t.to,t.gapFrom,t.gapTo,T.fromJSON(e,t.slice),t.insert,!!t.structure)}}le.jsonID("replaceAround",te);function Fr(n,e,t){let r=n.resolve(e),o=t-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function lg(n,e,t,r){let o=[],i=[],s,l;n.doc.nodesBetween(e,t,(c,d,u)=>{if(!c.isInline)return;let f=c.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let h=Math.max(d,e),p=Math.min(d+c.nodeSize,t),m=r.addToSet(f);for(let A=0;A<f.length;A++)f[A].isInSet(m)||(s&&s.to==h&&s.mark.eq(f[A])?s.to=p:o.push(s=new Be(h,p,f[A])));l&&l.to==h?l.to=p:i.push(l=new Je(h,p,r))}}),o.forEach(c=>n.step(c)),i.forEach(c=>n.step(c))}function cg(n,e,t,r){let o=[],i=0;n.doc.nodesBetween(e,t,(s,l)=>{if(!s.isInline)return;i++;let c=null;if(r instanceof zn){let d=s.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let d=Math.min(l+s.nodeSize,t);for(let u=0;u<c.length;u++){let f=c[u],h;for(let p=0;p<o.length;p++){let m=o[p];m.step==i-1&&f.eq(o[p].style)&&(h=m)}h?(h.to=d,h.step=i):o.push({style:f,from:Math.max(l,e),to:d,step:i})}}}),o.forEach(s=>n.step(new Be(s.from,s.to,s.style)))}function Hr(n,e,t,r=t.contentMatch,o=!0){let i=n.doc.nodeAt(e),s=[],l=e+1;for(let c=0;c<i.childCount;c++){let d=i.child(c),u=l+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new Z(l,u,T.empty));else{r=f;for(let h=0;h<d.marks.length;h++)t.allowsMarkType(d.marks[h].type)||n.step(new Be(l,u,d.marks[h]));if(o&&d.isText&&t.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(d.text);)m||(m=new T(C.from(t.schema.text(" ",t.allowedMarks(d.marks))),0,0)),s.push(new Z(l+h.index,l+h.index+h[0].length,m))}}l=u}if(!r.validEnd){let c=r.fillBefore(C.empty,!0);n.replace(l,l,new T(c,0,0))}for(let c=s.length-1;c>=0;c--)n.step(s[c])}function dg(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Bt(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,o=0,i=0;;--r){let s=n.$from.node(r),l=n.$from.index(r)+o,c=n.$to.indexAfter(r)-i;if(r<n.depth&&s.canReplace(l,c,t))return r;if(r==0||s.type.spec.isolating||!dg(s,l,c))break;l&&(o=1),c<s.childCount&&(i=1)}return null}function ug(n,e,t){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),l=o.after(i+1),c=s,d=l,u=C.empty,f=0;for(let m=i,A=!1;m>t;m--)A||r.index(m)>0?(A=!0,u=C.from(r.node(m).copy(u)),f++):c--;let h=C.empty,p=0;for(let m=i,A=!1;m>t;m--)A||o.after(m+1)<o.end(m)?(A=!0,h=C.from(o.node(m).copy(h)),p++):d++;n.step(new te(c,d,s,l,new T(u.append(h),f,p),u.size-f,!0))}function Wr(n,e,t=null,r=n){let o=fg(n,e),i=o&&hg(r,e);return i?o.map(ls).concat({type:e,attrs:t}).concat(i.map(ls)):null}function ls(n){return{type:n,attrs:null}}function fg(n,e){let{parent:t,startIndex:r,endIndex:o}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return t.canReplaceWith(r,o,s)?i:null}function hg(n,e){let{parent:t,startIndex:r,endIndex:o}=n,i=t.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let c=(s.length?s[s.length-1]:e).contentMatch;for(let d=r;c&&d<o;d++)c=c.matchType(t.child(d).type);return!c||!c.validEnd?null:s}function pg(n,e,t){let r=C.empty;for(let s=t.length-1;s>=0;s--){if(r.size){let l=t[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=C.from(t[s].type.create(t[s].attrs,r))}let o=e.start,i=e.end;n.step(new te(o,i,o,i,new T(r,0,0),t.length,!0))}function mg(n,e,t,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(s,l)=>{let c=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,c)&&Ag(n.doc,n.mapping.slice(i).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?d=!1:!p&&m&&(d=!0)}d===!1&&ds(n,s,l,i),Hr(n,n.mapping.slice(i).map(l,1),r,void 0,d===null);let u=n.mapping.slice(i),f=u.map(l,1),h=u.map(l+s.nodeSize,1);return n.step(new te(f,h,f+1,h-1,new T(C.from(r.create(c,null,s.marks)),0,0),1,!0)),d===!0&&cs(n,s,l,i),!1}})}function cs(n,e,t,r){e.forEach((o,i)=>{if(o.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(o.text);){let c=n.mapping.slice(r).map(t+1+i+s.index);n.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function ds(n,e,t,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+i);n.replaceWith(s,s+1,e.type.schema.text(`
|
|
8
|
-
`))}})}function Ag(n,e,t){let r=n.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,t)}function gg(n,e,t,r,o){let i=n.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);let s=t.create(r,null,o||i.marks);if(i.isLeaf)return n.replaceWith(e,e+i.nodeSize,s);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new te(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new T(C.from(s),0,0),1,!0))}function qe(n,e,t=1,r){let o=n.resolve(e),i=o.depth-t,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let d=o.depth-1,u=t-2;d>i;d--,u--){let f=o.node(d),h=o.index(d);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let A=r&&r[u]||f;if(!f.canReplace(h+1,f.childCount)||!A.type.validContent(p))return!1}let l=o.indexAfter(i),c=r&&r[0];return o.node(i).canReplaceWith(l,l,c?c.type:o.node(i+1).type)}function yg(n,e,t=1,r){let o=n.doc.resolve(e),i=C.empty,s=C.empty;for(let l=o.depth,c=o.depth-t,d=t-1;l>c;l--,d--){i=C.from(o.node(l).copy(i));let u=r&&r[d];s=C.from(u?u.type.create(u.attrs,s):o.node(l).copy(s))}n.step(new Z(e,e,new T(i.append(s),t,t),!0))}function Ge(n,e){let t=n.resolve(e),r=t.index();return us(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function bg(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?n.type.schema.nodes.text:i.type;if(t=t.matchType(s),!t||!n.type.allowsMarks(i.marks))return!1}return t.validEnd}function us(n,e){return!!(n&&e&&!n.isLeaf&&bg(n,e))}function jn(n,e,t=-1){let r=n.resolve(e);for(let o=r.depth;;o--){let i,s,l=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):t>0?(i=r.node(o+1),l++,s=r.node(o).maybeChild(l)):(i=r.node(o).maybeChild(l-1),s=r.node(o+1)),i&&!i.isTextblock&&us(i,s)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=t<0?r.before(o):r.after(o)}}function kg(n,e,t){let r=null,{linebreakReplacement:o}=n.doc.type.schema,i=n.doc.resolve(e-t),s=i.node().type;if(o&&s.inlineContent){let u=s.whitespace=="pre",f=!!s.contentMatch.matchType(o);u&&!f?r=!1:!u&&f&&(r=!0)}let l=n.steps.length;if(r===!1){let u=n.doc.resolve(e+t);ds(n,u.node(),u.before(),l)}s.inlineContent&&Hr(n,e+t-1,s,i.node().contentMatchAt(i.index()),r==null);let c=n.mapping.slice(l),d=c.map(e-t);if(n.step(new Z(d,c.map(e+t,-1),T.empty,!0)),r===!0){let u=n.doc.resolve(d);cs(n,u.node(),u.before(),n.steps.length)}return n}function wg(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,t))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,t))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function Sg(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let o=t.content;for(let i=0;i<t.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(t.openStart==0&&t.size?2:1);i++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(l>0?1:0),d=r.node(s),u=!1;if(i==1)u=d.canReplace(c,c,o);else{let f=d.contentMatchAt(c).findWrapping(o.firstChild.type);u=f&&d.canReplaceWith(c,c,f[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Un(n,e,t=e,r=T.empty){if(e==t&&!r.size)return null;let o=n.resolve(e),i=n.resolve(t);return fs(o,i,r)?new Z(e,t,r):new Cg(o,i,r).fit()}function fs(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class Cg{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=C.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=C.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,l=o.depth;for(;s&&l&&i.childCount==1;)i=i.firstChild.content,s--,l--;let c=new T(i,s,l);return e>-1?new te(r.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||r.pos!=this.$to.pos?new Z(r.pos,o.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=t.firstChild;if(t.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=qr(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:d}=this.frontier[l],u,f=null;if(t==1&&(s?d.matchType(s.type)||(f=d.fillBefore(C.from(s),!1)):i&&c.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:l,parent:i,inject:f};if(t==2&&s&&(u=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:i,wrap:u};if(i&&d.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=qr(e,t);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new T(e,t+1,Math.max(r,o.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=qr(e,t);if(o.childCount<=1&&t>0){let i=e.size-t<=t+o.size;this.unplaced=new T(Xt(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new T(Xt(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:o,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let A=0;A<i.length;A++)this.openFrontierNode(i[A]);let s=this.unplaced,l=r?r.content:s.content,c=s.openStart-e,d=0,u=[],{match:f,type:h}=this.frontier[t];if(o){for(let A=0;A<o.childCount;A++)u.push(o.child(A));f=f.matchFragment(o)}let p=l.size+e-(s.content.size-s.openEnd);for(;d<l.childCount;){let A=l.child(d),g=f.matchType(A.type);if(!g)break;d++,(d>1||c==0||A.content.size)&&(f=g,u.push(hs(A.mark(h.allowedMarks(A.marks)),d==1?c:0,d==l.childCount?p:-1)))}let m=d==l.childCount;m||(p=-1),this.placed=Zt(this.placed,t,C.from(u)),this.frontier[t].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let A=0,g=l;A<p;A++){let y=g.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),g=y.content}this.unplaced=m?e==0?T.empty:new T(Xt(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new T(Xt(s.content,e,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!jr(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:o}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=jr(e,t,o,r,i);if(s){for(let l=t-1;l>=0;l--){let{match:c,type:d}=this.frontier[l],u=jr(e,l,d,c,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Zt(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,t=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Zt(this.placed,this.depth,C.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(C.empty,!0);t.childCount&&(this.placed=Zt(this.placed,this.frontier.length,t))}}function Xt(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Xt(n.firstChild.content,e-1,t)))}function Zt(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Zt(n.lastChild.content,e-1,t)))}function qr(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function hs(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,hs(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(C.empty,!0)))),n.copy(r)}function jr(n,e,t,r,o){let i=n.node(e),s=o?n.indexAfter(e):n.index(e);if(s==i.childCount&&!t.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,s);return l&&!Eg(t,i.content,s)?l:null}function Eg(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function xg(n){return n.spec.defining||n.spec.definingForContent}function Mg(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let o=n.doc.resolve(e),i=n.doc.resolve(t);if(fs(o,i,r))return n.step(new Z(e,t,r));let s=ms(o,i);s[s.length-1]==0&&s.pop();let l=-(o.depth+1);s.unshift(l);for(let h=o.depth,p=o.pos-1;h>0;h--,p--){let m=o.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(h)>-1?l=h:o.before(h)==p&&s.splice(1,0,-h)}let c=s.indexOf(l),d=[],u=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(d.push(m),p==r.openStart)break;h=m.content}for(let h=u-1;h>=0;h--){let p=d[h],m=xg(p.type);if(m&&!p.sameMarkup(o.node(Math.abs(l)-1)))u=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+u+1)%(r.openStart+1),m=d[p];if(m)for(let A=0;A<s.length;A++){let g=s[(A+c)%s.length],y=!0;g<0&&(y=!1,g=-g);let b=o.node(g-1),k=o.index(g-1);if(b.canReplaceWith(k,k,m.type,m.marks))return n.replace(o.before(g),y?i.after(g):t,new T(ps(r.content,0,r.openStart,p),p,r.openEnd))}}let f=n.steps.length;for(let h=s.length-1;h>=0&&(n.replace(e,t,r),!(n.steps.length>f));h--){let p=s[h];p<0||(e=o.before(p),t=i.after(p))}}function ps(n,e,t,r,o){if(e<t){let i=n.firstChild;n=n.replaceChild(0,i.copy(ps(i.content,e+1,t,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(n).append(n);n=s.append(i.matchFragment(s).fillBefore(C.empty,!0))}return n}function Ng(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let o=wg(n.doc,e,r.type);o!=null&&(e=t=o)}n.replaceRange(e,t,new T(C.from(r),0,0))}function Bg(n,e,t){let r=n.doc.resolve(e),o=n.doc.resolve(t);if(r.parent.isTextblock&&o.parent.isTextblock&&r.start()!=o.start()&&r.parentOffset==0&&o.parentOffset==0){let s=r.sharedDepth(t),l=!1;for(let c=r.depth;c>s;c--)r.node(c).type.spec.isolating&&(l=!0);for(let c=o.depth;c>s;c--)o.node(c).type.spec.isolating&&(l=!0);if(!l){for(let c=r.depth;c>0&&e==r.start(c);c--)e=r.before(c);for(let c=o.depth;c>0&&t==o.start(c);c--)t=o.before(c);r=n.doc.resolve(e),o=n.doc.resolve(t)}}let i=ms(r,o);for(let s=0;s<i.length;s++){let l=i[s],c=s==i.length-1;if(c&&l==0||r.node(l).type.contentMatch.validEnd)return n.delete(r.start(l),o.end(l));if(l>0&&(c||r.node(l-1).canReplace(r.index(l-1),o.indexAfter(l-1))))return n.delete(r.before(l),o.after(l))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&t>r.end(s)&&o.end(s)-t!=o.depth-s&&r.start(s-1)==o.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),o.index(s-1)))return n.delete(r.before(s),t);n.delete(e,t)}function ms(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let o=r;o>=0;o--){let i=n.start(o);if(i<n.pos-(n.depth-o)||e.end(o)>e.pos+(e.depth-o)||n.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==n.depth&&o==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&t.push(o)}return t}class vt extends le{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return X.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let o=t.type.create(r,null,t.marks);return X.fromReplace(e,this.pos,this.pos+1,new T(C.from(o),0,t.isLeaf?0:1))}getMap(){return be.empty}invert(e){return new vt(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new vt(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new vt(t.pos,t.attr,t.value)}}le.jsonID("attr",vt);class en extends le{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let o in e.attrs)t[o]=e.attrs[o];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return X.ok(r)}getMap(){return be.empty}invert(e){return new en(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new en(t.attr,t.value)}}le.jsonID("docAttr",en);let Tt=class extends Error{};Tt=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},Tt.prototype=Object.create(Error.prototype),Tt.prototype.constructor=Tt,Tt.prototype.name="TransformError";class As{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new qn}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Tt(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let o=this.mapping.maps[r];r&&(e=o.map(e,1),t=o.map(t,-1)),o.forEach((i,s,l,c)=>{e=Math.min(e,l),t=Math.max(t,c)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=T.empty){let o=Un(this.doc,e,t,r);return o&&this.step(o),this}replaceWith(e,t,r){return this.replace(e,t,new T(C.from(r),0,0))}delete(e,t){return this.replace(e,t,T.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return Mg(this,e,t,r),this}replaceRangeWith(e,t,r){return Ng(this,e,t,r),this}deleteRange(e,t){return Bg(this,e,t),this}lift(e,t){return ug(this,e,t),this}join(e,t=1){return kg(this,e,t),this}wrap(e,t){return pg(this,e,t),this}setBlockType(e,t=e,r,o=null){return mg(this,e,t,r,o),this}setNodeMarkup(e,t,r=null,o){return gg(this,e,t,r,o),this}setNodeAttribute(e,t,r){return this.step(new vt(e,t,r)),this}setDocAttribute(e,t){return this.step(new en(e,t)),this}addNodeMark(e,t){return this.step(new Ke(e,t)),this}removeNodeMark(e,t){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t instanceof Q)t.isInSet(r.marks)&&this.step(new At(e,t));else{let o=r.marks,i,s=[];for(;i=t.isInSet(o);)s.push(new At(e,i)),o=i.removeFromSet(o);for(let l=s.length-1;l>=0;l--)this.step(s[l])}return this}split(e,t=1,r){return yg(this,e,t,r),this}addMark(e,t,r){return lg(this,e,t,r),this}removeMark(e,t,r){return cg(this,e,t,r),this}clearIncompatible(e,t,r){return Hr(this,e,t,r),this}}const Ur=Object.create(null);class q{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new vg(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=T.empty){let r=t.content.lastChild,o=null;for(let l=0;l<t.openEnd;l++)o=r,r=r.lastChild;let i=e.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:c,$to:d}=s[l],u=e.mapping.slice(i);e.replaceRange(u.map(c.pos),u.map(d.pos),l?T.empty:t),l==0&&bs(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:l}=o[i],c=e.mapping.slice(r),d=c.map(s.pos),u=c.map(l.pos);i?e.deleteRange(d,u):(e.replaceRangeWith(d,u,t),bs(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let o=e.parent.inlineContent?new z(e):Dt(e.node(0),e.parent,e.pos,e.index(),t,r);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=t<0?Dt(e.node(0),e.node(i),e.before(i+1),e.index(i),t,r):Dt(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new ke(e.node(0))}static atStart(e){return Dt(e,e,0,0,1)||new ke(e)}static atEnd(e){return Dt(e,e,e.content.size,e.childCount,-1)||new ke(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Ur[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Ur)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ur[e]=t,t.prototype.jsonID=e,t}getBookmark(){return z.between(this.$anchor,this.$head).getBookmark()}}q.prototype.visible=!0;class vg{constructor(e,t){this.$from=e,this.$to=t}}let gs=!1;function ys(n){!gs&&!n.parent.inlineContent&&(gs=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class z extends q{constructor(e,t=e){ys(e),ys(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return q.near(r);let o=e.resolve(t.map(this.anchor));return new z(o.parent.inlineContent?o:r,r)}replace(e,t=T.empty){if(super.replace(e,t),t==T.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof z&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new _n(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new z(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let o=e.resolve(t);return new this(o,r==t?o:e.resolve(r))}static between(e,t,r){let o=e.pos-t.pos;if((!r||o)&&(r=o>=0?1:-1),!t.parent.inlineContent){let i=q.findFrom(t,r,!0)||q.findFrom(t,-r,!0);if(i)t=i.$head;else return q.near(t,r)}return e.parent.inlineContent||(o==0?e=t:(e=(q.findFrom(e,-r,!0)||q.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=o<0&&(e=t))),new z(e,t)}}q.jsonID("text",z);class _n{constructor(e,t){this.anchor=e,this.head=t}map(e){return new _n(e.map(this.anchor),e.map(this.head))}resolve(e){return z.between(e.resolve(this.anchor),e.resolve(this.head))}}class I extends q{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:o}=t.mapResult(this.anchor),i=e.resolve(o);return r?q.near(i):new I(i)}content(){return new T(C.from(this.node),0,0)}eq(e){return e instanceof I&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new _r(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new I(e.resolve(t.anchor))}static create(e,t){return new I(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}I.prototype.visible=!1,q.jsonID("node",I);class _r{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new _n(r,r):new _r(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&I.isSelectable(r)?new I(t):q.near(t)}}class ke extends q{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=T.empty){if(t==T.empty){e.delete(0,e.doc.content.size);let r=q.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new ke(e)}map(e){return new ke(e)}eq(e){return e instanceof ke}getBookmark(){return Tg}}q.jsonID("all",ke);const Tg={map(){return this},resolve(n){return new ke(n)}};function Dt(n,e,t,r,o,i=!1){if(e.inlineContent)return z.create(n,t);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let l=e.child(s);if(l.isAtom){if(!i&&I.isSelectable(l))return I.create(n,t-(o<0?l.nodeSize:0))}else{let c=Dt(n,l,t+o,o<0?l.childCount:0,o,i);if(c)return c}t+=l.nodeSize*o}return null}function bs(n,e,t){let r=n.steps.length-1;if(r<e)return;let o=n.steps[r];if(!(o instanceof Z||o instanceof te))return;let i=n.mapping.maps[r],s;i.forEach((l,c,d,u)=>{s==null&&(s=u)}),n.setSelection(q.near(n.doc.resolve(s),t))}const ks=1,Qn=2,ws=4;class Dg extends As{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|ks)&~Qn,this.storedMarks=null,this}get selectionSet(){return(this.updated&ks)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Qn,this}ensureMarks(e){return Q.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Qn)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Qn,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Q.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let o=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),!e)return this.deleteRange(t,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(t);i=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,o.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(q.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=ws,this}get scrolledIntoView(){return(this.updated&ws)>0}}function Ss(n,e){return!e||!n?n:n.bind(e)}class tn{constructor(e,t,r){this.name=e,this.init=Ss(t.init,r),this.apply=Ss(t.apply,r)}}const Vg=[new tn("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new tn("selection",{init(n,e){return n.selection||q.atStart(e.doc)},apply(n){return n.selection}}),new tn("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new tn("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class Qr{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Vg.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new tn(r.key,r.spec.state,r))})}}class Vt{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let l=this.config.plugins[s];if(l.spec.appendTransaction){let c=o?o[s].n:0,d=o?o[s].state:this,u=c<t.length&&l.spec.appendTransaction.call(l,c?t.slice(c):t,d,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let f=0;f<this.config.plugins.length;f++)o.push(f<s?{state:r,n:t.length}:{state:this,n:0})}t.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:t.length})}}if(!i)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Vt(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new Dg(this)}static create(e){let t=new Qr(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Vt(t);for(let o=0;o<t.fields.length;o++)r[t.fields[o].name]=t.fields[o].init(e,r);return r}reconfigure(e){let t=new Qr(this.schema,e.plugins),r=t.fields,o=new Vt(t);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(e,o)}return o}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],i=o.spec.state;i&&i.toJSON&&(t[r]=i.toJSON.call(o,this[o.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new Qr(e.schema,e.plugins),i=new Vt(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=ye.fromJSON(e.schema,t.doc);else if(s.name=="selection")i.selection=q.fromJSON(i.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let c=r[l],d=c.spec.state;if(c.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){i[s.name]=d.fromJSON.call(c,e,t[l],i);return}}i[s.name]=s.init(e,i)}}),i}}function Cs(n,e,t){for(let r in n){let o=n[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=Cs(o,e,{})),t[r]=o}return t}class ve{constructor(e){this.spec=e,this.props={},e.props&&Cs(e.props,this,this.props),this.key=e.key?e.key.key:Es("plugin")}getState(e){return e[this.key]}}const Jr=Object.create(null);function Es(n){return n in Jr?n+"$"+ ++Jr[n]:(Jr[n]=0,n+"$")}class Ye{constructor(e="key"){this.key=Es(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Kr=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function xs(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const Ms=(n,e,t)=>{let r=xs(n,t);if(!r)return!1;let o=Gr(r);if(!o){let s=r.blockRange(),l=s&&Bt(s);return l==null?!1:(e&&e(n.tr.lift(s,l).scrollIntoView()),!0)}let i=o.nodeBefore;if(Is(n,o,e,-1))return!0;if(r.parent.content.size==0&&($t(i,"end")||I.isSelectable(i)))for(let s=r.depth;;s--){let l=Un(n.doc,r.before(s),r.after(s),T.empty);if(l&&l.slice.size<l.to-l.from){if(e){let c=n.tr.step(l);c.setSelection($t(i,"end")?q.findFrom(c.doc.resolve(c.mapping.map(o.pos,-1)),-1):I.create(c.doc,o.pos-i.nodeSize)),e(c.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(e&&e(n.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},$g=(n,e,t)=>{let r=xs(n,t);if(!r)return!1;let o=Gr(r);return o?Ns(n,o,e):!1},Og=(n,e,t)=>{let r=vs(n,t);if(!r)return!1;let o=Yr(r);return o?Ns(n,o,e):!1};function Ns(n,e,t){let r=e.nodeBefore,o=r,i=e.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let u=o.lastChild;if(!u)return!1;o=u}let s=e.nodeAfter,l=s,c=e.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let d=Un(n.doc,i,c,T.empty);if(!d||d.from!=i||d instanceof Z&&d.slice.size>=c-i)return!1;if(t){let u=n.tr.step(d);u.setSelection(z.create(u.doc,i)),t(u.scrollIntoView())}return!0}function $t(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const Bs=(n,e,t)=>{let{$head:r,empty:o}=n.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;i=Gr(r)}let s=i&&i.nodeBefore;return!s||!I.isSelectable(s)?!1:(e&&e(n.tr.setSelection(I.create(n.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function Gr(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function vs(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const Ts=(n,e,t)=>{let r=vs(n,t);if(!r)return!1;let o=Yr(r);if(!o)return!1;let i=o.nodeAfter;if(Is(n,o,e,1))return!0;if(r.parent.content.size==0&&($t(i,"start")||I.isSelectable(i))){let s=Un(n.doc,r.before(),r.after(),T.empty);if(s&&s.slice.size<s.to-s.from){if(e){let l=n.tr.step(s);l.setSelection($t(i,"start")?q.findFrom(l.doc.resolve(l.mapping.map(o.pos)),1):I.create(l.doc,l.mapping.map(o.pos))),e(l.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(n.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},Ds=(n,e,t)=>{let{$head:r,empty:o}=n.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;i=Yr(r)}let s=i&&i.nodeAfter;return!s||!I.isSelectable(s)?!1:(e&&e(n.tr.setSelection(I.create(n.doc,i.pos)).scrollIntoView()),!0)};function Yr(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const Ig=(n,e)=>{let t=n.selection,r=t instanceof I,o;if(r){if(t.node.isTextblock||!Ge(n.doc,t.from))return!1;o=t.from}else if(o=jn(n.doc,t.from,-1),o==null)return!1;if(e){let i=n.tr.join(o);r&&i.setSelection(I.create(i.doc,o-n.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},Pg=(n,e)=>{let t=n.selection,r;if(t instanceof I){if(t.node.isTextblock||!Ge(n.doc,t.to))return!1;r=t.to}else if(r=jn(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},Rg=(n,e)=>{let{$from:t,$to:r}=n.selection,o=t.blockRange(r),i=o&&Bt(o);return i==null?!1:(e&&e(n.tr.lift(o,i).scrollIntoView()),!0)},Vs=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
9
|
-
`).scrollIntoView()),!0)};function Xr(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const Lg=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let o=t.node(-1),i=t.indexAfter(-1),s=Xr(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let l=t.after(),c=n.tr.replaceWith(l,l,s.createAndFill());c.setSelection(q.near(c.doc.resolve(l),1)),e(c.scrollIntoView())}return!0},$s=(n,e)=>{let t=n.selection,{$from:r,$to:o}=t;if(t instanceof ke||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Xr(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=n.tr.insert(s,i.createAndFill());l.setSelection(z.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},Os=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let i=t.before();if(qe(n.doc,i))return e&&e(n.tr.split(i).scrollIntoView()),!0}let r=t.blockRange(),o=r&&Bt(r);return o==null?!1:(e&&e(n.tr.lift(r,o).scrollIntoView()),!0)};function zg(n){return(e,t)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof I&&e.selection.node.isBlock)return!r.parentOffset||!qe(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],s,l,c=!1,d=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){c=r.end(p)==r.pos+(r.depth-p),d=r.start(p)==r.pos-(r.depth-p),l=Xr(r.node(p-1).contentMatchAt(r.indexAfter(p-1))),i.unshift(c&&l?{type:l}:null),s=p;break}else{if(p==1)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof z||e.selection instanceof ke)&&u.deleteSelection();let f=u.mapping.map(r.pos),h=qe(u.doc,f,i.length,i);if(h||(i[0]=l?{type:l}:null,h=qe(u.doc,f,i.length,i)),!h)return!1;if(u.split(f,i.length,i),!c&&d&&r.node(s).type!=l){let p=u.mapping.map(r.before(s)),m=u.doc.resolve(p);l&&r.node(s-1).canReplaceWith(m.index(),m.index()+1,l)&&u.setNodeMarkup(u.mapping.map(r.before(s)),l)}return t&&t(u.scrollIntoView()),!0}}const Fg=zg(),Hg=(n,e)=>{let{$from:t,to:r}=n.selection,o,i=t.sharedDepth(r);return i==0?!1:(o=t.before(i),e&&e(n.tr.setSelection(I.create(n.doc,o))),!0)};function Wg(n,e,t){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||Ge(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function Is(n,e,t,r){let o=e.nodeBefore,i=e.nodeAfter,s,l,c=o.type.spec.isolating||i.type.spec.isolating;if(!c&&Wg(n,e,t))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(s=(l=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&l.matchType(s[0]||i.type).validEnd){if(t){let p=e.pos+i.nodeSize,m=C.empty;for(let y=s.length-1;y>=0;y--)m=C.from(s[y].create(null,m));m=C.from(o.copy(m));let A=n.tr.step(new te(e.pos-1,p,e.pos,p,new T(m,1,0),s.length,!0)),g=A.doc.resolve(p+2*s.length);g.nodeAfter&&g.nodeAfter.type==o.type&&Ge(A.doc,g.pos)&&A.join(g.pos),t(A.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&c?null:q.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),h=f&&Bt(f);if(h!=null&&h>=e.depth)return t&&t(n.tr.lift(f,h).scrollIntoView()),!0;if(d&&$t(i,"start",!0)&&$t(o,"end")){let p=o,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let A=i,g=1;for(;!A.isTextblock;A=A.firstChild)g++;if(p.canReplace(p.childCount,p.childCount,A.content)){if(t){let y=C.empty;for(let k=m.length-1;k>=0;k--)y=C.from(m[k].copy(y));let b=n.tr.step(new te(e.pos-m.length,e.pos+i.nodeSize,e.pos+g,e.pos+i.nodeSize-g,new T(y,m.length,0),0,!0));t(b.scrollIntoView())}return!0}}return!1}function Ps(n){return function(e,t){let r=e.selection,o=n<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(t&&t(e.tr.setSelection(z.create(e.doc,n<0?o.start(i):o.end(i)))),!0):!1}}const qg=Ps(-1),jg=Ps(1);function Ug(n,e=null){return function(t,r){let{$from:o,$to:i}=t.selection,s=o.blockRange(i),l=s&&Wr(s,n,e);return l?(r&&r(t.tr.wrap(s,l).scrollIntoView()),!0):!1}}function Rs(n,e=null){return function(t,r){let o=!1;for(let i=0;i<t.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:l}}=t.selection.ranges[i];t.doc.nodesBetween(s,l,(c,d)=>{if(o)return!1;if(!(!c.isTextblock||c.hasMarkup(n,e)))if(c.type==n)o=!0;else{let u=t.doc.resolve(d),f=u.index();o=u.parent.canReplaceWith(f,f+1,n)}})}if(!o)return!1;if(r){let i=t.tr;for(let s=0;s<t.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:c}}=t.selection.ranges[s];i.setBlockType(l,c,n,e)}r(i.scrollIntoView())}return!0}}function Zr(...n){return function(e,t,r){for(let o=0;o<n.length;o++)if(n[o](e,t,r))return!0;return!1}}Zr(Kr,Ms,Bs),Zr(Kr,Ts,Ds),Zr(Vs,$s,Os,Fg),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function _g(n,e=null){return function(t,r){let{$from:o,$to:i}=t.selection,s=o.blockRange(i);if(!s)return!1;let l=r?t.tr:null;return Qg(l,s,n,e)?(r&&r(l.scrollIntoView()),!0):!1}}function Qg(n,e,t,r=null){let o=!1,i=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=s.resolve(e.start-2);i=new Rn(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new Rn(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let l=Wr(i,t,r,e);return l?(n&&Jg(n,e,l,o,t),!0):!1}function Jg(n,e,t,r,o){let i=C.empty;for(let u=t.length-1;u>=0;u--)i=C.from(t[u].type.create(t[u].attrs,i));n.step(new te(e.start-(r?2:0),e.end,e.start,e.end,new T(i,0,0),t.length,!0));let s=0;for(let u=0;u<t.length;u++)t[u].type==o&&(s=u+1);let l=t.length-s,c=e.start+t.length-(r?2:0),d=e.parent;for(let u=e.startIndex,f=e.endIndex,h=!0;u<f;u++,h=!1)!h&&qe(n.doc,c,l)&&(n.split(c,l),c+=2*l),c+=d.child(u).nodeSize;return n}function Kg(n){return function(e,t){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==n);return i?t?r.node(i.depth-1).type==n?Gg(e,t,n,i):Yg(e,t,i):!0:!1}}function Gg(n,e,t,r){let o=n.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new te(i-1,s,i,s,new T(C.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new Rn(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const l=Bt(r);if(l==null)return!1;o.lift(r,l);let c=o.doc.resolve(o.mapping.map(i,-1)-1);return Ge(o.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&o.join(c.pos),e(o.scrollIntoView()),!0}function Yg(n,e,t){let r=n.tr,o=t.parent;for(let p=t.end,m=t.endIndex-1,A=t.startIndex;m>A;m--)p-=o.child(m).nodeSize,r.delete(p-1,p+1);let i=r.doc.resolve(t.start),s=i.nodeAfter;if(r.mapping.map(t.end)!=t.start+i.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,c=t.endIndex==o.childCount,d=i.node(-1),u=i.index(-1);if(!d.canReplace(u+(l?0:1),u+1,s.content.append(c?C.empty:C.from(o))))return!1;let f=i.pos,h=f+s.nodeSize;return r.step(new te(f-(l?1:0),h+(c?1:0),f+1,h-1,new T((l?C.empty:C.from(o.copy(C.empty))).append(c?C.empty:C.from(o.copy(C.empty))),l?0:1,c?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Xg(n){return function(e,t){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,d=>d.childCount>0&&d.firstChild.type==n);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let l=i.parent,c=l.child(s-1);if(c.type!=n)return!1;if(t){let d=c.lastChild&&c.lastChild.type==l.type,u=C.from(d?n.create():null),f=new T(C.from(n.create(null,C.from(l.type.create(null,u)))),d?3:1,0),h=i.start,p=i.end;t(e.tr.step(new te(h-(d?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}const oe=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Ot=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let eo=null;const je=function(n,e,t){let r=eo||(eo=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Zg=function(){eo=null},gt=function(n,e,t,r){return t&&(Ls(n,e,t,r,-1)||Ls(n,e,t,r,1))},ey=/^(img|br|input|textarea|hr)$/i;function Ls(n,e,t,r,o){for(var i;;){if(n==t&&e==r)return!0;if(e==(o<0?0:Se(n))){let s=n.parentNode;if(!s||s.nodeType!=1||nn(n)||ey.test(n.nodeName)||n.contentEditable=="false")return!1;e=oe(n)+(o<0?0:1),n=s}else if(n.nodeType==1){let s=n.childNodes[e+(o<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((i=s.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=o;else return!1;else n=s,e=o<0?Se(n):0}else return!1}}function Se(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function ty(n,e){for(;;){if(n.nodeType==3&&e)return n;if(n.nodeType==1&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=Se(n)}else if(n.parentNode&&!nn(n))e=oe(n),n=n.parentNode;else return null}}function ny(n,e){for(;;){if(n.nodeType==3&&e<n.nodeValue.length)return n;if(n.nodeType==1&&e<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[e],e=0}else if(n.parentNode&&!nn(n))e=oe(n)+1,n=n.parentNode;else return null}}function ry(n,e,t){for(let r=e==0,o=e==Se(n);r||o;){if(n==t)return!0;let i=oe(n);if(n=n.parentNode,!n)return!1;r=r&&i==0,o=o&&i==Se(n)}}function nn(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Jn=function(n){return n.focusNode&>(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function yt(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function oy(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function iy(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:Math.min(Se(r.offsetNode),r.offset)}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:Math.min(Se(r.startContainer),r.startOffset)}}}const Oe=typeof navigator<"u"?navigator:null,zs=typeof document<"u"?document:null,Xe=Oe&&Oe.userAgent||"",to=/Edge\/(\d+)/.exec(Xe),Fs=/MSIE \d/.exec(Xe),no=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Xe),Ae=!!(Fs||no||to),Ze=Fs?document.documentMode:no?+no[1]:to?+to[1]:0,Ce=!Ae&&/gecko\/(\d+)/i.test(Xe);Ce&&+(/Firefox\/(\d+)/.exec(Xe)||[0,0])[1];const ro=!Ae&&/Chrome\/(\d+)/.exec(Xe),ie=!!ro,Hs=ro?+ro[1]:0,ce=!Ae&&!!Oe&&/Apple Computer/.test(Oe.vendor),It=ce&&(/Mobile\/\w+/.test(Xe)||!!Oe&&Oe.maxTouchPoints>2),Ee=It||(Oe?/Mac/.test(Oe.platform):!1),Ws=Oe?/Win/.test(Oe.platform):!1,Ue=/Android \d/.test(Xe),rn=!!zs&&"webkitFontSmoothing"in zs.documentElement.style,sy=rn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function ay(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function _e(n,e){return typeof n=="number"?n:n[e]}function ly(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function qs(n,e,t){let r=n.someProp("scrollThreshold")||0,o=n.someProp("scrollMargin")||5,i=n.dom.ownerDocument;for(let s=t||n.dom;s;){if(s.nodeType!=1){s=Ot(s);continue}let l=s,c=l==i.body,d=c?ay(i):ly(l),u=0,f=0;if(e.top<d.top+_e(r,"top")?f=-(d.top-e.top+_e(o,"top")):e.bottom>d.bottom-_e(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+_e(o,"top")-d.top:e.bottom-d.bottom+_e(o,"bottom")),e.left<d.left+_e(r,"left")?u=-(d.left-e.left+_e(o,"left")):e.right>d.right-_e(r,"right")&&(u=e.right-d.right+_e(o,"right")),u||f)if(c)i.defaultView.scrollBy(u,f);else{let p=l.scrollLeft,m=l.scrollTop;f&&(l.scrollTop+=f),u&&(l.scrollLeft+=u);let A=l.scrollLeft-p,g=l.scrollTop-m;e={left:e.left-A,top:e.top-g,right:e.right-A,bottom:e.bottom-g}}let h=c?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(h))break;s=h=="absolute"?s.offsetParent:Ot(s)}}function cy(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=t+1;s<Math.min(innerHeight,e.bottom);s+=5){let l=n.root.elementFromPoint(i,s);if(!l||l==n.dom||!n.dom.contains(l))continue;let c=l.getBoundingClientRect();if(c.top>=t-20){r=l,o=c.top;break}}return{refDOM:r,refTop:o,stack:js(n.dom)}}function js(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=Ot(r));return e}function dy({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;Us(t,r==0?0:r-e)}function Us(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:o,left:i}=n[t];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let Pt=null;function uy(n){if(n.setActive)return n.setActive();if(Pt)return n.focus(Pt);let e=js(n);n.focus(Pt==null?{get preventScroll(){return Pt={preventScroll:!0},!0}}:void 0),Pt||(Pt=!1,Us(e,0))}function _s(n,e){let t,r=2e8,o,i=0,s=e.top,l=e.top,c,d;for(let u=n.firstChild,f=0;u;u=u.nextSibling,f++){let h;if(u.nodeType==1)h=u.getClientRects();else if(u.nodeType==3)h=je(u).getClientRects();else continue;for(let p=0;p<h.length;p++){let m=h[p];if(m.top<=s&&m.bottom>=l){s=Math.max(m.bottom,s),l=Math.min(m.top,l);let A=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(A<r){t=u,r=A,o=A&&t.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&A&&(i=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!c&&m.left<=e.left&&m.right>=e.left&&(c=u,d={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=f+1)}}return!t&&c&&(t=c,o=d,r=0),t&&t.nodeType==3?fy(t,o):!t||r&&t.nodeType==1?{node:n,offset:i}:_s(t,o)}function fy(n,e){let t=n.nodeValue.length,r=document.createRange(),o;for(let i=0;i<t;i++){r.setEnd(n,i+1),r.setStart(n,i);let s=et(r,1);if(s.top!=s.bottom&&oo(e,s)){o={node:n,offset:i+(e.left>=(s.left+s.right)/2?1:0)};break}}return r.detach(),o||{node:n,offset:0}}function oo(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function hy(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<n.getBoundingClientRect().left?t:n}function py(n,e,t){let{node:r,offset:o}=_s(e,t),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&t.left>(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,o,i)}function my(n,e,t,r){let o=-1;for(let i=e,s=!1;i!=n.dom;){let l=n.docView.nearestDesc(i,!0),c;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((c=l.dom.getBoundingClientRect()).width||c.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!s&&c.left>r.left||c.top>r.top?o=l.posBefore:(!s&&c.right<r.left||c.bottom<r.top)&&(o=l.posAfter),s=!0),!l.contentDOM&&o<0&&!l.node.isText))return(l.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?l.posBefore:l.posAfter;i=l.dom.parentNode}return o>-1?o:n.docView.posFromDOM(e,t,-1)}function Qs(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),i=o;;){let s=n.childNodes[i];if(s.nodeType==1){let l=s.getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(oo(e,d))return Qs(s,e,d)}}if((i=(i+1)%r)==o)break}return n}function Ay(n,e){let t=n.dom.ownerDocument,r,o=0,i=iy(t,e.left,e.top);i&&({node:r,offset:o}=i);let s=(n.root.elementFromPoint?n.root:t).elementFromPoint(e.left,e.top),l;if(!s||!n.dom.contains(s.nodeType!=1?s.parentNode:s)){let d=n.dom.getBoundingClientRect();if(!oo(e,d)||(s=Qs(n.dom,e,d),!s))return null}if(ce)for(let d=s;r&&d;d=Ot(d))d.draggable&&(r=void 0);if(s=hy(s,e),r){if(Ce&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&o++}let d;rn&&o&&r.nodeType==1&&(d=r.childNodes[o-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&o--,r==n.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(l=my(n,r,o,e))}l==null&&(l=py(n,s,e));let c=n.docView.nearestDesc(s,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function Js(n){return n.top<n.bottom||n.left<n.right}function et(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(Js(r))return r}return Array.prototype.find.call(t,Js)||n.getBoundingClientRect()}const gy=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ks(n,e,t){let{node:r,offset:o,atom:i}=n.docView.domFromPos(e,t<0?-1:1),s=rn||Ce;if(r.nodeType==3)if(s&&(gy.test(r.nodeValue)||(t<0?!o:o==r.nodeValue.length))){let c=et(je(r,o,o),t);if(Ce&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let d=et(je(r,o-1,o-1),-1);if(d.top==c.top){let u=et(je(r,o,o+1),-1);if(u.top!=c.top)return on(u,u.left<d.left)}}return c}else{let c=o,d=o,u=t<0?1:-1;return t<0&&!o?(d++,u=-1):t>=0&&o==r.nodeValue.length?(c--,u=1):t<0?c--:d++,on(et(je(r,c,d),u),u<0)}if(!n.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(t<0||o==Se(r))){let c=r.childNodes[o-1];if(c.nodeType==1)return io(c.getBoundingClientRect(),!1)}if(i==null&&o<Se(r)){let c=r.childNodes[o];if(c.nodeType==1)return io(c.getBoundingClientRect(),!0)}return io(r.getBoundingClientRect(),t>=0)}if(i==null&&o&&(t<0||o==Se(r))){let c=r.childNodes[o-1],d=c.nodeType==3?je(c,Se(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return on(et(d,1),!1)}if(i==null&&o<Se(r)){let c=r.childNodes[o];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?je(c,0,s?0:1):c.nodeType==1?c:null:null;if(d)return on(et(d,-1),!0)}return on(et(r.nodeType==3?je(r):r,-t),t>=0)}function on(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function io(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function Gs(n,e,t){let r=n.state,o=n.root.activeElement;r!=e&&n.updateState(e),o!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),o!=n.dom&&o&&o.focus()}}function yy(n,e,t){let r=e.selection,o=t=="up"?r.$from:r.$to;return Gs(n,e,()=>{let{node:i}=n.docView.domFromPos(o.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(i,!0);if(!l)break;if(l.node.isBlock){i=l.contentDOM||l.dom;break}i=l.dom.parentNode}let s=Ks(n,o.pos,1);for(let l=i.firstChild;l;l=l.nextSibling){let c;if(l.nodeType==1)c=l.getClientRects();else if(l.nodeType==3)c=je(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let u=c[d];if(u.bottom>u.top+1&&(t=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const by=/[\u0590-\u08ac]/;function ky(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,l=n.domSelection();return l?!by.test(r.parent.textContent)||!l.modify?t=="left"||t=="backward"?i:s:Gs(n,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:f}=n.domSelectionRange(),h=l.caretBidiLevel;l.modify("move",t,"character");let p=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:m,focusOffset:A}=n.domSelectionRange(),g=m&&!p.contains(m.nodeType==1?m:m.parentNode)||c==m&&d==A;try{l.collapse(u,f),c&&(c!=u||d!=f)&&l.extend&&l.extend(c,d)}catch{}return h!=null&&(l.caretBidiLevel=h),g}):r.pos==r.start()||r.pos==r.end()}let Ys=null,Xs=null,Zs=!1;function wy(n,e,t){return Ys==e&&Xs==t?Zs:(Ys=e,Xs=t,Zs=t=="up"||t=="down"?yy(n,e,t):ky(n,e,t))}const xe=0,ea=1,bt=2,Ie=3;class sn{constructor(e,t,r,o){this.parent=e,this.children=t,this.dom=r,this.contentDOM=o,this.dirty=xe,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let o=this.children[t];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,s;if(e==this.contentDOM)i=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(e==this.contentDOM)i=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=t>oe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&t==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!t||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let o=this.children[t],i=r+o.size;if(r==e&&i!=r){for(;!o.border&&o.children.length;)for(let s=0;s<o.children.length;s++){let l=o.children[s];if(l.size){o=l;break}}return o}if(e<i)return o.descAt(e-r-o.border);r=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],l=i+s.size;if(l>e||s instanceof ra){o=e-i;break}i=l}if(o)return this.children[r].domFromPos(o-this.children[r].border,t);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof ta&&i.side>=0;r--);if(t<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&t&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,t):{node:this.contentDOM,offset:i?oe(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,t):{node:this.contentDOM,offset:i?oe(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,l=0;;l++){let c=this.children[l],d=s+c.size;if(o==-1&&e<=d){let u=s+c.border;if(e>=u&&t<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,t,u);e=s;for(let f=l;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){o=oe(h.dom)+1;break}e-=h.size}o==-1&&(o=0)}if(o>-1&&(d>t||l==this.children.length-1)){t=d;for(let u=l+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){i=oe(f.dom);break}t+=f.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=d}return{node:this.contentDOM,from:e,to:t,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,o=!1){let i=Math.min(e,t),s=Math.max(e,t);for(let p=0,m=0;p<this.children.length;p++){let A=this.children[p],g=m+A.size;if(i>m&&s<g)return A.setSelection(e-m-A.border,t-m-A.border,r,o);m=g}let l=this.domFromPos(e,e?-1:1),c=t==e?l:this.domFromPos(t,t?-1:1),d=r.root.getSelection(),u=r.domSelectionRange(),f=!1;if((Ce||ce)&&e==t){let{node:p,offset:m}=l;if(p.nodeType==3){if(f=!!(m&&p.nodeValue[m-1]==`
|
|
10
|
-
`),f&&m==p.nodeValue.length)for(let A=p,g;A;A=A.parentNode){if(g=A.nextSibling){g.nodeName=="BR"&&(l=c={node:g.parentNode,offset:oe(g)+1});break}let y=A.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let A=p.childNodes[m-1];f=A&&(A.nodeName=="BR"||A.contentEditable=="false")}}if(Ce&&u.focusNode&&u.focusNode!=c.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(o=!0)}if(!(o||f&&ce)&>(l.node,l.offset,u.anchorNode,u.anchorOffset)&>(c.node,c.offset,u.focusNode,u.focusOffset))return;let h=!1;if((d.extend||e==t)&&!(f&&Ce)){d.collapse(l.node,l.offset);try{e!=t&&d.extend(c.node,c.offset),h=!0}catch{}}if(!h){if(e>t){let m=l;l=c,c=m}let p=document.createRange();p.setEnd(c.node,c.offset),p.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&t>=r:e<s&&t>r){let l=r+i.border,c=s-i.border;if(e>=l&&t<=c){this.dirty=e==r||t==s?bt:ea,e==l&&t==c&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Ie:i.markDirty(e-l,t-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?bt:Ie}r=s}this.dirty=bt}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?bt:ea;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class ta extends sn{constructor(e,t,r,o){let i,s=t.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==xe&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Sy extends sn{constructor(e,t,r,o){super(e,[],t,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class kt extends sn{constructor(e,t,r,o,i){super(e,[],r,o),this.mark=t,this.spec=i}static create(e,t,r,o){let i=o.nodeViews[t.type.name],s=i&&i(t,o,r);return(!s||!s.dom)&&(s=mt.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new kt(e,t,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Ie||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ie&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=xe){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=xe}}slice(e,t,r){let o=kt.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;t<s&&(i=ao(i,t,s,r)),e>0&&(i=ao(i,0,e,r));for(let l=0;l<i.length;l++)i[l].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class tt extends sn{constructor(e,t,r,o,i,s,l,c,d){super(e,[],i,s),this.node=t,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=l}static create(e,t,r,o,i,s){let l=i.nodeViews[t.type.name],c,d=l&&l(t,i,()=>{if(!c)return s;if(c.parent)return c.parent.posBeforeChild(c)},r,o),u=d&&d.dom,f=d&&d.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=mt.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!f&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let h=u;return u=sa(u,r,t),d?c=new Cy(e,t,r,o,u,f||null,h,d,i,s+1):t.isText?new Kn(e,t,r,o,u,h,i):new tt(e,t,r,o,u,f||null,h,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>C.empty)}return e}matchesNode(e,t,r){return this.dirty==xe&&e.eq(this.node)&&Gn(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,o=t,i=e.composing?this.localCompositionInfo(e,t):null,s=i&&i.pos>-1?i:null,l=i&&i.pos<0,c=new xy(this,s&&s.node,e);By(this.node,this.innerDeco,(d,u,f)=>{d.spec.marks?c.syncToMarks(d.spec.marks,r,e,u):d.type.side>=0&&!f&&c.syncToMarks(u==this.node.childCount?Q.none:this.node.child(u).marks,r,e,u),c.placeWidget(d,e,o)},(d,u,f,h)=>{c.syncToMarks(d.marks,r,e,h);let p;c.findNodeMatch(d,u,f,h)||l&&e.state.selection.from>o&&e.state.selection.to<o+d.nodeSize&&(p=c.findIndexWithChild(i.node))>-1&&c.updateNodeAt(d,u,f,p,e)||c.updateNextNode(d,u,f,e,h,o)||c.addNode(d,u,f,e,o),o+=d.nodeSize}),c.syncToMarks([],r,e,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==bt)&&(s&&this.protectLocalComposition(e,s),oa(this.contentDOM,this.children,e),It&&vy(this.dom))}localCompositionInfo(e,t){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof z)||r<t||o>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,l=Ty(this.node.content,s,r-t,o-t);return l<0?null:{node:i,pos:l,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:o}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new Sy(this,i,t,o);e.input.compositionNodes.push(s),this.children=ao(this.children,r,r+o.length,e,s)}update(e,t,r,o){return this.dirty==Ie||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,o),!0)}updateInner(e,t,r,o){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=xe}updateOuterDeco(e){if(Gn(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=ia(this.dom,this.nodeDOM,so(this.outerDeco,this.node,t),so(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function na(n,e,t,r,o){sa(r,e,n);let i=new tt(void 0,n,e,t,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Kn extends tt{constructor(e,t,r,o,i,s,l){super(e,t,r,o,i,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,o){return this.dirty==Ie||this.dirty!=xe&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=xe||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=xe,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let o=this.node.cut(e,t),i=document.createTextNode(o.text);return new Kn(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Ie)}get domAtom(){return!1}isText(e){return this.node.text==e}}class ra extends sn{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==xe&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Cy extends tt{constructor(e,t,r,o,i,s,l,c,d,u){super(e,t,r,o,i,s,l,d,u),this.spec=c}update(e,t,r,o){if(this.dirty==Ie)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,r);return i&&this.updateInner(e,t,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,o){this.spec.setSelection?this.spec.setSelection(e,t,r.root):super.setSelection(e,t,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function oa(n,e,t){let r=n.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],l=s.dom;if(l.parentNode==n){for(;l!=r;)r=aa(r),o=!0;r=r.nextSibling}else o=!0,n.insertBefore(l,r);if(s instanceof kt){let c=r?r.previousSibling:n.lastChild;oa(s.contentDOM,s.children,t),r=c?c.nextSibling:n.firstChild}}for(;r;)r=aa(r),o=!0;o&&t.trackWrites==n&&(t.trackWrites=null)}const an=function(n){n&&(this.nodeName=n)};an.prototype=Object.create(null);const wt=[new an];function so(n,e,t){if(n.length==0)return wt;let r=t?wt[0]:new an,o=[r];for(let i=0;i<n.length;i++){let s=n[i].type.attrs;if(s){s.nodeName&&o.push(r=new an(s.nodeName));for(let l in s){let c=s[l];c!=null&&(t&&o.length==1&&o.push(r=new an(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+c:l=="style"?r.style=(r.style?r.style+";":"")+c:l!="nodeName"&&(r[l]=c))}}}return o}function ia(n,e,t,r){if(t==wt&&r==wt)return e;let o=e;for(let i=0;i<r.length;i++){let s=r[i],l=t[i];if(i){let c;l&&l.nodeName==s.nodeName&&o!=n&&(c=o.parentNode)&&c.nodeName.toLowerCase()==s.nodeName||(c=document.createElement(s.nodeName),c.pmIsDeco=!0,c.appendChild(o),l=wt[0]),o=c}Ey(o,l||wt[0],s)}return o}function Ey(n,e,t){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in t)&&n.removeAttribute(r);for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&t[r]!=e[r]&&n.setAttribute(r,t[r]);if(e.class!=t.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=t.class?t.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&n.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&n.classList.add(o[i]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)n.style.removeProperty(o[1])}t.style&&(n.style.cssText+=t.style)}}function sa(n,e,t){return ia(n,n,wt,so(e,t,n.nodeType!=1))}function Gn(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function aa(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class xy{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=My(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,r,o){let i=0,s=this.stack.length>>1,l=Math.min(s,e.length);for(;i<l&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=xe,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let c=-1,d=this.top.children.length;o<this.preMatch.index&&(d=Math.min(this.index+3,d));for(let u=this.index;u<d;u++){let f=this.top.children[u];if(f.matchesMark(e[s])&&!this.isLocked(f.dom)){c=u;break}}if(c>-1)c>this.index&&(this.changed=!0,this.destroyBetween(this.index,c)),this.top=this.top.children[this.index];else{let u=kt.create(this.top,e[s],t,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,s++}}findNodeMatch(e,t,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,t,r))i=this.top.children.indexOf(s,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l<c;l++){let d=this.top.children[l];if(d.matchesNode(e,t,r)&&!this.preMatch.matched.has(d)){i=l;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,r,o,i){let s=this.top.children[o];return s.dirty==Ie&&s.dom==s.contentDOM&&(s.dirty=bt),s.update(e,t,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=t}}updateNextNode(e,t,r,o,i,s){for(let l=this.index;l<this.top.children.length;l++){let c=this.top.children[l];if(c instanceof tt){let d=this.preMatch.matched.get(c);if(d!=null&&d!=i)return!1;let u=c.dom,f,h=this.isLocked(u)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=Ie&&Gn(t,c.outerDeco));if(!h&&c.update(e,t,r,o))return this.destroyBetween(this.index,l),c.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(f=this.recreateWrapper(c,e,t,r,o,s)))return this.destroyBetween(this.index,l),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=bt,f.updateChildren(o,s+1),f.dirty=xe),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,o,i,s){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Gn(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let l=tt.create(this.top,t,r,o,i,s);if(l.contentDOM){l.children=e.children,e.children=[];for(let c of l.children)c.parent=l}return e.destroy(),l}addNode(e,t,r,o,i){let s=tt.create(this.top,e,t,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,t,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new ta(this.top,e,t,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof kt;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Kn)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((ce||ie)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new ra(this.top,[],r,null);t!=this.top?t.children.push(o):t.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function My(n,e){let t=e,r=t.children.length,o=n.childCount,i=new Map,s=[];e:for(;o>0;){let l;for(;;)if(r){let d=t.children[r-1];if(d instanceof kt)t=d,r=d.children.length;else{l=d,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let c=l.node;if(c){if(c!=n.child(o-1))break;--o,i.set(l,o),s.push(l)}}return{index:o,matched:i,matches:s.reverse()}}function Ny(n,e){return n.type.side-e.type.side}function By(n,e,t,r){let o=e.locals(n),i=0;if(o.length==0){for(let d=0;d<n.childCount;d++){let u=n.child(d);r(u,o,e.forChild(i,u),d),i+=u.nodeSize}return}let s=0,l=[],c=null;for(let d=0;;){let u,f;for(;s<o.length&&o[s].to==i;){let g=o[s++];g.widget&&(u?(f||(f=[u])).push(g):u=g)}if(u)if(f){f.sort(Ny);for(let g=0;g<f.length;g++)t(f[g],d,!!c)}else t(u,d,!!c);let h,p;if(c)p=-1,h=c,c=null;else if(d<n.childCount)p=d,h=n.child(d++);else break;for(let g=0;g<l.length;g++)l[g].to<=i&&l.splice(g--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)l.push(o[s++]);let m=i+h.nodeSize;if(h.isText){let g=m;s<o.length&&o[s].from<g&&(g=o[s].from);for(let y=0;y<l.length;y++)l[y].to<g&&(g=l[y].to);g<m&&(c=h.cut(g-i),h=h.cut(0,g-i),m=g,p=-1)}else for(;s<o.length&&o[s].to<m;)s++;let A=h.isInline&&!h.isLeaf?l.filter(g=>!g.inline):l.slice();r(h,A,e.forChild(i,h),p),i=m}}function vy(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function Ty(n,e,t,r){for(let o=0,i=0;o<n.childCount&&i<=r;){let s=n.child(o++),l=i;if(i+=s.nodeSize,!s.isText)continue;let c=s.text;for(;o<n.childCount;){let d=n.child(o++);if(i+=d.nodeSize,!d.isText)break;c+=d.text}if(i>=t){if(i>=r&&c.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l<r?c.lastIndexOf(e,r-l-1):-1;if(d>=0&&d+e.length+l>=t)return l+d;if(t==r&&c.length>=r+e.length-l&&c.slice(r-l,r-l+e.length)==e)return r}}return-1}function ao(n,e,t,r,o){let i=[];for(let s=0,l=0;s<n.length;s++){let c=n[s],d=l,u=l+=c.size;d>=t||u<=e?i.push(c):(d<e&&i.push(c.slice(0,e-d,r)),o&&(i.push(o),o=void 0),u>t&&i.push(c.slice(t-d,c.size,r)))}return i}function lo(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let o=n.docView.nearestDesc(t.focusNode),i=o&&o.size==0,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let l=r.resolve(s),c,d;if(Jn(t)){for(c=s;o&&!o.node;)o=o.parent;let f=o.node;if(o&&f.isAtom&&I.isSelectable(f)&&o.parent&&!(f.isInline&&ry(t.focusNode,t.focusOffset,o.dom))){let h=o.posBefore;d=new I(s==h?l:r.resolve(h))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let f=s,h=s;for(let p=0;p<t.rangeCount;p++){let m=t.getRangeAt(p);f=Math.min(f,n.docView.posFromDOM(m.startContainer,m.startOffset,1)),h=Math.max(h,n.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(f<0)return null;[c,s]=h==n.state.selection.anchor?[h,f]:[f,h],l=r.resolve(s)}else c=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!d){let f=e=="pointer"||n.state.selection.head<l.pos&&!i?1:-1;d=uo(n,u,l,f)}return d}function la(n){return n.editable?n.hasFocus():ma(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Qe(n,e=!1){let t=n.state.selection;if(fa(n,t),!!la(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&ie){let r=n.domSelectionRange(),o=n.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&>(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)Vy(n);else{let{anchor:r,head:o}=t,i,s;ca&&!(t instanceof z)&&(t.$from.parent.inlineContent||(i=da(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(s=da(n,t.to))),n.docView.setSelection(r,o,n,e),ca&&(i&&ua(i),s&&ua(s)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Dy(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const ca=ce||ie&&Hs<63;function da(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),o=r<t.childNodes.length?t.childNodes[r]:null,i=r?t.childNodes[r-1]:null;if(ce&&o&&o.contentEditable=="false")return co(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return co(o);if(i)return co(i)}}function co(n){return n.contentEditable="true",ce&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function ua(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function Dy(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,o=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=o)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!la(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function Vy(n){let e=n.domSelection();if(!e)return;let t=n.cursorWrapper.dom,r=t.nodeName=="IMG";r?e.collapse(t.parentNode,oe(t)+1):e.collapse(t,0),!r&&!n.state.selection.visible&&Ae&&Ze<=11&&(t.disabled=!0,t.disabled=!1)}function fa(n,e){if(e instanceof I){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(ha(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else ha(n)}function ha(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function uo(n,e,t,r){return n.someProp("createSelectionBetween",o=>o(n,e,t))||z.between(e,t,r)}function pa(n){return n.editable&&!n.hasFocus()?!1:ma(n)}function ma(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function $y(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return gt(e.node,e.offset,t.anchorNode,t.anchorOffset)}function fo(n,e){let{$anchor:t,$head:r}=n.selection,o=e>0?t.max(r):t.min(r),i=o.parent.inlineContent?o.depth?n.doc.resolve(e>0?o.after():o.before()):null:o;return i&&q.findFrom(i,e)}function nt(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Aa(n,e,t){let r=n.state.selection;if(r instanceof z)if(t.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=n.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return nt(n,new z(r.$anchor,s))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let o=fo(n.state,e);return o&&o instanceof I?nt(n,o):!1}else if(!(Ee&&t.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let l=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=n.docView.descAt(l))&&!s.contentDOM?I.isSelectable(i)?nt(n,new I(e<0?n.state.doc.resolve(o.pos-i.nodeSize):o)):rn?nt(n,new z(n.state.doc.resolve(e<0?l:l+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof I&&r.node.isInline)return nt(n,new z(e>0?r.$to:r.$from));{let o=fo(n.state,e);return o?nt(n,o):!1}}}function Yn(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function ln(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Rt(n,e){return e<0?Oy(n):Iy(n)}function Oy(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let o,i,s=!1;for(Ce&&t.nodeType==1&&r<Yn(t)&&ln(t.childNodes[r],-1)&&(s=!0);;)if(r>0){if(t.nodeType!=1)break;{let l=t.childNodes[r-1];if(ln(l,-1))o=t,i=--r;else if(l.nodeType==3)t=l,r=t.nodeValue.length;else break}}else{if(ga(t))break;{let l=t.previousSibling;for(;l&&ln(l,-1);)o=t.parentNode,i=oe(l),l=l.previousSibling;if(l)t=l,r=Yn(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}s?ho(n,t,r):o&&ho(n,o,i)}function Iy(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let o=Yn(t),i,s;for(;;)if(r<o){if(t.nodeType!=1)break;let l=t.childNodes[r];if(ln(l,1))i=t,s=++r;else break}else{if(ga(t))break;{let l=t.nextSibling;for(;l&&ln(l,1);)i=l.parentNode,s=oe(l)+1,l=l.nextSibling;if(l)t=l,r=0,o=Yn(t);else{if(t=t.parentNode,t==n.dom)break;r=o=0}}}i&&ho(n,i,s)}function ga(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function Py(n,e){for(;n&&e==n.childNodes.length&&!nn(n);)e=oe(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function Ry(n,e){for(;n&&!e&&!nn(n);)e=oe(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function ho(n,e,t){if(e.nodeType!=3){let i,s;(s=Py(e,t))?(e=s,t=0):(i=Ry(e,t))&&(e=i,t=i.nodeValue.length)}let r=n.domSelection();if(!r)return;if(Jn(r)){let i=document.createRange();i.setEnd(e,t),i.setStart(e,t),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:o}=n;setTimeout(()=>{n.state==o&&Qe(n)},50)}function ya(n,e){let t=n.state.doc.resolve(e);if(!(ie||Ws)&&t.parent.inlineContent){let o=n.coordsAtPos(e);if(e>t.start()){let i=n.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(e<t.end()){let i=n.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function ba(n,e,t){let r=n.state.selection;if(r instanceof z&&!r.empty||t.indexOf("s")>-1||Ee&&t.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=fo(n.state,e);if(s&&s instanceof I)return nt(n,s)}if(!o.parent.inlineContent){let s=e<0?o:i,l=r instanceof ke?q.near(s,e):q.findFrom(s,e);return l?nt(n,l):!1}return!1}function ka(n,e){if(!(n.state.selection instanceof z))return!0;let{$head:t,$anchor:r,empty:o}=n.state.selection;if(!t.sameParent(r))return!0;if(!o)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(i&&!i.isText){let s=n.state.tr;return e<0?s.delete(t.pos-i.nodeSize,t.pos):s.delete(t.pos,t.pos+i.nodeSize),n.dispatch(s),!0}return!1}function wa(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function Ly(n){if(!ce||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;wa(n,r,"true"),setTimeout(()=>wa(n,r,"false"),20)}return!1}function zy(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function Fy(n,e){let t=e.keyCode,r=zy(e);if(t==8||Ee&&t==72&&r=="c")return ka(n,-1)||Rt(n,-1);if(t==46&&!e.shiftKey||Ee&&t==68&&r=="c")return ka(n,1)||Rt(n,1);if(t==13||t==27)return!0;if(t==37||Ee&&t==66&&r=="c"){let o=t==37?ya(n,n.state.selection.from)=="ltr"?-1:1:-1;return Aa(n,o,r)||Rt(n,o)}else if(t==39||Ee&&t==70&&r=="c"){let o=t==39?ya(n,n.state.selection.from)=="ltr"?1:-1:1;return Aa(n,o,r)||Rt(n,o)}else{if(t==38||Ee&&t==80&&r=="c")return ba(n,-1,r)||Rt(n,-1);if(t==40||Ee&&t==78&&r=="c")return Ly(n)||ba(n,1,r)||Rt(n,1);if(r==(Ee?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function po(n,e){n.someProp("transformCopied",p=>{e=p(e,n)});let t=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let p=r.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=n.someProp("clipboardSerializer")||mt.fromSchema(n.state.schema),l=va(),c=l.createElement("div");c.appendChild(s.serializeFragment(r,{document:l}));let d=c.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=Na[d.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=l.createElement(u[p]);for(;c.firstChild;)m.appendChild(c.firstChild);c.appendChild(m),f++}d=c.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${o} ${i}${f?` -${f}`:""} ${JSON.stringify(t)}`);let h=n.someProp("clipboardTextSerializer",p=>p(e,n))||e.content.textBetween(0,e.content.size,`
|
|
11
|
-
|
|
12
|
-
`);return{dom:c,text:h,slice:e}}function Sa(n,e,t,r,o){let i=o.parent.type.spec.code,s,l;if(!t&&!e)return null;let c=!!e&&(r||i||!t);if(c){if(n.someProp("transformPastedText",h=>{e=h(e,i||r,n)}),i)return l=new T(C.from(n.state.schema.text(e.replace(/\r\n?/g,`
|
|
13
|
-
`))),0,0),n.someProp("transformPasted",h=>{l=h(l,n,!0)}),l;let f=n.someProp("clipboardTextParser",h=>h(e,o,r,n));if(f)l=f;else{let h=o.marks(),{schema:p}=n.state,m=mt.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(A=>{let g=s.appendChild(document.createElement("p"));A&&g.appendChild(m.serializeNode(p.text(A,h)))})}}else n.someProp("transformPastedHTML",f=>{t=f(t,n)}),s=jy(t),rn&&Uy(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||We.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||u),context:o,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!Hy.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)l=_y(Ma(l,+u[1],+u[2]),u[4]);else if(l=T.maxOpen(Wy(l.content,o),!0),l.openStart||l.openEnd){let f=0,h=0;for(let p=l.content.firstChild;f<l.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=l.content.lastChild;h<l.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);l=Ma(l,f,h)}return n.someProp("transformPasted",f=>{l=f(l,n,c)}),l}const Hy=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Wy(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let o=e.node(t).contentMatchAt(e.index(t)),i,s=[];if(n.forEach(l=>{if(!s)return;let c=o.findWrapping(l.type),d;if(!c)return s=null;if(d=s.length&&i.length&&Ea(c,i,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=xa(s[s.length-1],i.length));let u=Ca(l,c);s.push(u),o=o.matchType(u.type),i=c}}),s)return C.from(s)}return n}function Ca(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,C.from(n));return n}function Ea(n,e,t,r,o){if(o<n.length&&o<e.length&&n[o]==e[o]){let i=Ea(n,e,t,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==n.length-1?t.type:n[o+1]))return r.copy(r.content.append(C.from(Ca(t,n,o+1))))}}function xa(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,xa(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(C.empty,!0);return n.copy(t.append(r))}function mo(n,e,t,r,o,i){let s=e<0?n.firstChild:n.lastChild,l=s.content;return n.childCount>1&&(i=0),o<r-1&&(l=mo(l,e,t,r,o+1,i)),o>=t&&(l=e<0?s.contentMatchAt(0).fillBefore(l,i<=o).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(C.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(l))}function Ma(n,e,t){return e<n.openStart&&(n=new T(mo(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new T(mo(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const Na={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Ba=null;function va(){return Ba||(Ba=document.implementation.createHTMLDocument("title"))}let Ao=null;function qy(n){let e=window.trustedTypes;return e?(Ao||(Ao=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),Ao.createHTML(n)):n}function jy(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=va().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),o;if((o=r&&Na[r[1].toLowerCase()])&&(n=o.map(i=>"<"+i+">").join("")+n+o.map(i=>"</"+i+">").reverse().join("")),t.innerHTML=qy(n),o)for(let i=0;i<o.length;i++)t=t.querySelector(o[i])||t;return t}function Uy(n){let e=n.querySelectorAll(ie?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function _y(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:o,openStart:i,openEnd:s}=n;for(let l=r.length-2;l>=0;l-=2){let c=t.nodes[r[l]];if(!c||c.hasRequiredAttrs())break;o=C.from(c.create(r[l+1],o)),i++,s++}return new T(o,i,s)}const pe={},me={},Qy={touchstart:!0,touchmove:!0};class Jy{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Ky(n){for(let e in pe){let t=pe[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{Yy(n,r)&&!yo(n,r)&&(n.editable||!(r.type in me))&&t(n,r)},Qy[e]?{passive:!0}:void 0)}ce&&n.dom.addEventListener("input",()=>null),go(n)}function rt(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function Gy(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function go(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>yo(n,r))})}function yo(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function Yy(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Xy(n,e){!yo(n,e)&&pe[e.type]&&(n.editable||!(e.type in me))&&pe[e.type](n,e)}me.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Da(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Ue&&ie&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),It&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",o=>o(n,yt(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Fy(n,t)?t.preventDefault():rt(n,"key")},me.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},me.keypress=(n,e)=>{let t=e;if(Da(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Ee&&t.metaKey)return;if(n.someProp("handleKeyPress",o=>o(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof z)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(t.charCode),i=()=>n.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!n.someProp("handleTextInput",s=>s(n,r.$from.pos,r.$to.pos,o,i))&&n.dispatch(i()),t.preventDefault()}};function Xn(n){return{left:n.clientX,top:n.clientY}}function Zy(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function bo(n,e,t,r,o){if(r==-1)return!1;let i=n.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(n.someProp(e,l=>s>i.depth?l(n,t,i.nodeAfter,i.before(s),o,!0):l(n,t,i.node(s),i.before(s),o,!1)))return!0;return!1}function Lt(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function eb(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&I.isSelectable(r)?(Lt(n,new I(t)),!0):!1}function tb(n,e){if(e==-1)return!1;let t=n.state.selection,r,o;t instanceof I&&(r=t.node);let i=n.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let l=s>i.depth?i.nodeAfter:i.node(s);if(I.isSelectable(l)){r&&t.$from.depth>0&&s>=t.$from.depth&&i.before(t.$from.depth+1)==t.$from.pos?o=i.before(t.$from.depth):o=i.before(s);break}}return o!=null?(Lt(n,I.create(n.state.doc,o)),!0):!1}function nb(n,e,t,r,o){return bo(n,"handleClickOn",e,t,r)||n.someProp("handleClick",i=>i(n,e,r))||(o?tb(n,t):eb(n,t))}function rb(n,e,t,r){return bo(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",o=>o(n,e,r))}function ob(n,e,t,r){return bo(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",o=>o(n,e,r))||ib(n,t,r)}function ib(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Lt(n,z.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),l=o.before(i);if(s.inlineContent)Lt(n,z.create(r,l+1,l+1+s.content.size));else if(I.isSelectable(s))Lt(n,I.create(r,l));else continue;return!0}}function ko(n){return Zn(n)}const Ta=Ee?"metaKey":"ctrlKey";pe.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=ko(n),o=Date.now(),i="singleClick";o-n.input.lastClick.time<500&&Zy(t,n.input.lastClick)&&!t[Ta]&&n.input.lastClick.button==t.button&&(n.input.lastClick.type=="singleClick"?i="doubleClick":n.input.lastClick.type=="doubleClick"&&(i="tripleClick")),n.input.lastClick={time:o,x:t.clientX,y:t.clientY,type:i,button:t.button};let s=n.posAtCoords(Xn(t));s&&(i=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new sb(n,s,t,!!r)):(i=="doubleClick"?rb:ob)(n,s.pos,s.inside,t)?t.preventDefault():rt(n,"pointer"))};class sb{constructor(e,t,r,o){this.view=e,this.pos=t,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Ta],this.allowDefault=r.shiftKey;let i,s;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),s=t.inside;else{let u=e.state.doc.resolve(t.pos);i=u.parent,s=u.depth?u.before():0}const l=o?null:r.target,c=l?e.docView.nearestDesc(l,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:d}=e.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||d instanceof I&&d.from<=s&&d.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ce&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),rt(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Qe(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Xn(e))),this.updateAllowDefault(e),this.allowDefault||!t?rt(this.view,"pointer"):nb(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ce&&this.mightDrag&&!this.mightDrag.node.isAtom||ie&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Lt(this.view,q.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):rt(this.view,"pointer")}move(e){this.updateAllowDefault(e),rt(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}pe.touchstart=n=>{n.input.lastTouch=Date.now(),ko(n),rt(n,"pointer")},pe.touchmove=n=>{n.input.lastTouch=Date.now(),rt(n,"pointer")},pe.contextmenu=n=>ko(n);function Da(n,e){return n.composing?!0:ce&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const ab=Ue?5e3:-1;me.compositionstart=me.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof z&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||ie&&Ws&&lb(n)))n.markCursor=n.state.storedMarks||t.marks(),Zn(n,!0),n.markCursor=null;else if(Zn(n,!e.selection.empty),Ce&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){let l=n.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else o=s,i=-1}}n.input.composing=!0}Va(n,ab)};function lb(n){let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let r=e.childNodes[t];return r.nodeType==1&&r.contentEditable=="false"}me.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.badSafariComposition?n.domObserver.forceFlush():n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,Va(n,20))};function Va(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Zn(n),e))}function $a(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=db());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function cb(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=ty(e.focusNode,e.focusOffset),r=ny(e.focusNode,e.focusOffset);if(t&&r&&t!=r){let o=r.pmViewDesc,i=n.domObserver.lastChangedTextNode;if(t==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(n.input.compositionNode==r){let s=t.pmViewDesc;if(!(!s||!s.isText(t.nodeValue)))return r}}return t||r}function db(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Zn(n,e=!1){if(!(Ue&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),$a(n),e||n.docView&&n.docView.dirty){let t=lo(n),r=n.state.selection;return t&&!t.eq(r)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function ub(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const cn=Ae&&Ze<15||It&&sy<604;pe.copy=me.cut=(n,e)=>{let t=e,r=n.state.selection,o=t.type=="cut";if(r.empty)return;let i=cn?null:t.clipboardData,s=r.content(),{dom:l,text:c}=po(n,s);i?(t.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",c)):ub(n,l),o&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function fb(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function hb(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?dn(n,r.value,null,o,e):dn(n,r.textContent,r.innerHTML,o,e)},50)}function dn(n,e,t,r,o){let i=Sa(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,o,i||T.empty)))return!0;if(!i)return!1;let s=fb(i),l=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(i);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Oa(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}me.paste=(n,e)=>{let t=e;if(n.composing&&!Ue)return;let r=cn?null:t.clipboardData,o=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&dn(n,Oa(r),r.getData("text/html"),o,t)?t.preventDefault():hb(n,t)};class Ia{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const pb=Ee?"altKey":"ctrlKey";function Pa(n,e){let t;return n.someProp("dragCopies",r=>{t=t||r(e)}),t!=null?!t:!e[pb]}pe.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let o=n.state.selection,i=o.empty?null:n.posAtCoords(Xn(t)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof I?o.to-1:o.to))){if(r&&r.mightDrag)s=I.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let f=n.docView.nearestDesc(t.target,!0);f&&f.node.type.spec.draggable&&f!=n.docView&&(s=I.create(n.state.doc,f.posBefore))}}let l=(s||n.state.selection).content(),{dom:c,text:d,slice:u}=po(n,l);(!t.dataTransfer.files.length||!ie||Hs>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(cn?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",cn||t.dataTransfer.setData("text/plain",d),n.dragging=new Ia(u,Pa(n,t),s)},pe.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},me.dragover=me.dragenter=(n,e)=>e.preventDefault(),me.drop=(n,e)=>{try{mb(n,e,n.dragging)}finally{n.dragging=null}};function mb(n,e,t){if(!e.dataTransfer)return;let r=n.posAtCoords(Xn(e));if(!r)return;let o=n.state.doc.resolve(r.pos),i=t&&t.slice;i?n.someProp("transformPasted",p=>{i=p(i,n,!1)}):i=Sa(n,Oa(e.dataTransfer),cn?null:e.dataTransfer.getData("text/html"),!1,o);let s=!!(t&&Pa(n,e));if(n.someProp("handleDrop",p=>p(n,e,i||T.empty,s))){e.preventDefault();return}if(!i)return;e.preventDefault();let l=i?Sg(n.state.doc,o.pos,i):o.pos;l==null&&(l=o.pos);let c=n.state.tr;if(s){let{node:p}=t;p?p.replace(c):c.deleteSelection()}let d=c.mapping.map(l),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,f=c.doc;if(u?c.replaceRangeWith(d,d,i.content.firstChild):c.replaceRange(d,d,i),c.doc.eq(f))return;let h=c.doc.resolve(d);if(u&&I.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new I(h));else{let p=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,A,g,y)=>p=y),c.setSelection(uo(n,h,c.doc.resolve(p)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))}pe.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Qe(n)},20))},pe.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},pe.beforeinput=(n,e)=>{if(ie&&Ue&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",i=>i(n,yt(8,"Backspace")))))return;let{$cursor:o}=n.state.selection;o&&o.pos>0&&n.dispatch(n.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let n in me)pe[n]=me[n];function un(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class er{constructor(e,t){this.toDOM=e,this.spec=t||St,this.side=this.spec.side||0}map(e,t,r,o){let{pos:i,deleted:s}=e.mapResult(t.from+o,this.side<0?-1:1);return s?null:new Te(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof er&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&un(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ot{constructor(e,t){this.attrs=e,this.spec=t||St}map(e,t,r,o){let i=e.map(t.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new Te(i,s,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof ot&&un(this.attrs,e.attrs)&&un(this.spec,e.spec)}static is(e){return e.type instanceof ot}destroy(){}}class wo{constructor(e,t){this.attrs=e,this.spec=t||St}map(e,t,r,o){let i=e.mapResult(t.from+o,1);if(i.deleted)return null;let s=e.mapResult(t.to+o,-1);return s.deleted||s.pos<=i.pos?null:new Te(i.pos-r,s.pos-r,this)}valid(e,t){let{index:r,offset:o}=e.content.findIndex(t.from),i;return o==t.from&&!(i=e.child(r)).isText&&o+i.nodeSize==t.to}eq(e){return this==e||e instanceof wo&&un(this.attrs,e.attrs)&&un(this.spec,e.spec)}destroy(){}}class Te{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new Te(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new Te(e,e,new er(t,r))}static inline(e,t,r,o){return new Te(e,t,new ot(r,o))}static node(e,t,r,o){return new Te(e,t,new wo(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof ot}get widget(){return this.type instanceof er}}const zt=[],St={};class ne{constructor(e,t){this.local=e.length?e:zt,this.children=t.length?t:zt}static create(e,t){return t.length?tr(t,e,0,St):de}find(e,t,r){let o=[];return this.findInner(e??0,t??1e9,o,0,r),o}findInner(e,t,r,o,i){for(let s=0;s<this.local.length;s++){let l=this.local[s];l.from<=t&&l.to>=e&&(!i||i(l.spec))&&r.push(l.copy(l.from+o,l.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){let l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,r,o+l,i)}}map(e,t,r){return this==de||e.maps.length==0?this:this.mapInner(e,t,0,0,r||St)}mapInner(e,t,r,o,i){let s;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(e,r,o);c&&c.type.valid(t,c)?(s||(s=[])).push(c):i.onRemove&&i.onRemove(this.local[l].spec)}return this.children.length?Ab(this.children,s||[],e,t,r,o,i):s?new ne(s.sort(Ct),zt):de}add(e,t){return t.length?this==de?ne.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let o,i=0;e.forEach((l,c)=>{let d=c+r,u;if(u=La(t,l,d)){for(o||(o=this.children.slice());i<o.length&&o[i]<c;)i+=3;o[i]==c?o[i+2]=o[i+2].addInner(l,u,d+1):o.splice(i,0,c,c+l.nodeSize,tr(u,l,d+1,St)),i+=3}});let s=Ra(i?za(t):t,-r);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||s.splice(l--,1);return new ne(s.length?this.local.concat(s).sort(Ct):this.local,o||this.children)}remove(e){return e.length==0||this==de?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,l=r[i]+t,c=r[i+1]+t;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>l&&f.to<c&&(e[u]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let d=r[i+2].removeInner(s,l+1);d!=de?r[i+2]=d:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<e.length;i++)if(s=e[i])for(let l=0;l<o.length;l++)o[l].eq(s,t)&&(o==this.local&&(o=this.local.slice()),o.splice(l--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new ne(o,r):de}forChild(e,t){if(this==de)return this;if(t.isLeaf)return ne.empty;let r,o;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let i=e+1,s=i+t.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<s&&c.to>i&&c.type instanceof ot){let d=Math.max(i,c.from)-i,u=Math.min(s,c.to)-i;d<u&&(o||(o=[])).push(c.copy(d,u))}}if(o){let l=new ne(o.sort(Ct),zt);return r?new it([l,r]):l}return r||de}eq(e){if(this==e)return!0;if(!(e instanceof ne)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return So(this.localsInner(e))}localsInner(e){if(this==de)return zt;if(e.inlineContent||!this.local.some(ot.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ot||t.push(this.local[r]);return t}forEachSet(e){e(this)}}ne.empty=new ne([],[]),ne.removeOverlap=So;const de=ne.empty;class it{constructor(e){this.members=e}map(e,t){const r=this.members.map(o=>o.map(e,t,St));return it.from(r)}forChild(e,t){if(t.isLeaf)return ne.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,t);i!=de&&(i instanceof it?r=r.concat(i.members):r.push(i))}return it.from(r)}eq(e){if(!(e instanceof it)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(!t)t=i;else{r&&(t=t.slice(),r=!1);for(let s=0;s<i.length;s++)t.push(i[s])}}return t?So(r?t:t.sort(Ct)):zt}static from(e){switch(e.length){case 0:return de;case 1:return e[0];default:return new it(e.every(t=>t instanceof ne)?e:e.reduce((t,r)=>t.concat(r instanceof ne?r:r.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function Ab(n,e,t,r,o,i,s){let l=n.slice();for(let d=0,u=i;d<t.maps.length;d++){let f=0;t.maps[d].forEach((h,p,m,A)=>{let g=A-m-(p-h);for(let y=0;y<l.length;y+=3){let b=l[y+1];if(b<0||h>b+u-f)continue;let k=l[y]+u-f;p>=k?l[y+1]=h<=k?-2:-1:h>=u&&g&&(l[y]+=g,l[y+1]+=g)}f+=g}),u=t.maps[d].map(u,-1)}let c=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){c=!0,l[d+1]=-1;continue}let u=t.map(n[d]+i),f=u-o;if(f<0||f>=r.content.size){c=!0;continue}let h=t.map(n[d+1]+i,-1),p=h-o,{index:m,offset:A}=r.content.findIndex(f),g=r.maybeChild(m);if(g&&A==f&&A+g.nodeSize==p){let y=l[d+2].mapInner(t,g,u+1,n[d]+i+1,s);y!=de?(l[d]=f,l[d+1]=p,l[d+2]=y):(l[d+1]=-2,c=!0)}else c=!0}if(c){let d=gb(l,n,e,t,o,i,s),u=tr(d,r,0,s);e=u.local;for(let f=0;f<l.length;f+=3)l[f+1]<0&&(l.splice(f,3),f-=3);for(let f=0,h=0;f<u.children.length;f+=3){let p=u.children[f];for(;h<l.length&&l[h]<p;)h+=3;l.splice(h,0,u.children[f],u.children[f+1],u.children[f+2])}}return new ne(e.sort(Ct),l)}function Ra(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let o=n[r];t.push(new Te(o.from+e,o.to+e,o.type))}return t}function gb(n,e,t,r,o,i,s){function l(c,d){for(let u=0;u<c.local.length;u++){let f=c.local[u].map(r,o,d);f?t.push(f):s.onRemove&&s.onRemove(c.local[u].spec)}for(let u=0;u<c.children.length;u+=3)l(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<n.length;c+=3)n[c+1]==-1&&l(n[c+2],e[c]+i+1);return t}function La(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,o=null;for(let i=0,s;i<n.length;i++)(s=n[i])&&s.from>t&&s.to<r&&((o||(o=[])).push(s),n[i]=null);return o}function za(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function tr(n,e,t,r){let o=[],i=!1;e.forEach((l,c)=>{let d=La(n,l,c+t);if(d){i=!0;let u=tr(d,l,t+c+1,r);u!=de&&o.push(c,c+l.nodeSize,u)}});let s=Ra(i?za(n):n,-t).sort(Ct);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||(r.onRemove&&r.onRemove(s[l].spec),s.splice(l--,1));return s.length||o.length?new ne(s,o):de}function Ct(n,e){return n.from-e.from||n.to-e.to}function So(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let o=t+1;o<e.length;o++){let i=e[o];if(i.from==r.from){i.to!=r.to&&(e==n&&(e=n.slice()),e[o]=i.copy(i.from,r.to),Fa(e,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,i.from),Fa(e,o,r.copy(i.from,r.to)));break}}}return e}function Fa(n,e,t){for(;e<n.length&&Ct(t,n[e])>0;)e++;n.splice(e,0,t)}function Co(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=de&&e.push(r)}),n.cursorWrapper&&e.push(ne.create(n.state.doc,[n.cursorWrapper.deco])),it.from(e)}const yb={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},bb=Ae&&Ze<=11;class kb{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class wb{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new kb,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);Ae&&Ze<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():ce&&e.composing&&r.some(o=>o.type=="childList"&&o.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),bb&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,yb)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(pa(this.view)){if(this.suppressingSelectionUpdates)return Qe(this.view);if(Ae&&Ze<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&>(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let i=e.focusNode;i;i=Ot(i))t.add(i);for(let i=e.anchorNode;i;i=Ot(i))if(t.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&pa(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,l=!1,c=[];if(e.editable)for(let u=0;u<t.length;u++){let f=this.registerMutation(t[u],c);f&&(i=i<0?f.from:Math.min(f.from,i),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(l=!0))}if(c.some(u=>u.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let u of c)if(u.nodeName=="BR"&&u.parentNode){let f=u.nextSibling;for(;f&&f.nodeType==1;){if(f.contentEditable=="false"){u.parentNode.removeChild(u);break}f=f.firstChild}}}else if(Ce&&c.length){let u=c.filter(f=>f.nodeName=="BR");if(u.length==2){let[f,h]=u;f.parentNode&&f.parentNode.parentNode==h.parentNode?h.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let h of u){let p=h.parentNode;p&&p.nodeName=="LI"&&(!f||Eb(e,f)!=p)&&h.remove()}}}let d=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Jn(r)&&(d=lo(e))&&d.eq(q.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Qe(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),Sb(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,xb(e,c)),this.handleDOMChange(i,s,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Qe(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let f=e.addedNodes[u];t.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,i=e.nextSibling;if(Ae&&Ze<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:h}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(o=f),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(i=h)}let s=o&&o.parentNode==e.target?oe(o)+1:0,l=r.localPosFromDOM(e.target,s,-1),c=i&&i.parentNode==e.target?oe(i):e.target.childNodes.length,d=r.localPosFromDOM(e.target,c,1);return{from:l,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Ha=new WeakMap,Wa=!1;function Sb(n){if(!Ha.has(n)&&(Ha.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=Ce,Wa)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Wa=!0}}function qa(n,e){let t=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=n.domAtPos(n.state.selection.anchor);return gt(s.node,s.offset,o,i)&&([t,r,o,i]=[o,i,t,r]),{anchorNode:t,anchorOffset:r,focusNode:o,focusOffset:i}}function Cb(n,e){if(e.getComposedRanges){let o=e.getComposedRanges(n.root)[0];if(o)return qa(n,o)}let t;function r(o){o.preventDefault(),o.stopImmediatePropagation(),t=o.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",r,!0),t?qa(n,t):null}function Eb(n,e){for(let t=e.parentNode;t&&t!=n.dom;t=t.parentNode){let r=n.docView.nearestDesc(t,!0);if(r&&r.node.isBlock)return t}return null}function xb(n,e){var t;let{focusNode:r,focusOffset:o}=n.domSelectionRange();for(let i of e)if(((t=i.parentNode)===null||t===void 0?void 0:t.nodeName)=="TR"){let s=i.nextSibling;for(;s&&s.nodeName!="TD"&&s.nodeName!="TH";)s=s.nextSibling;if(s){let l=s;for(;;){let c=l.firstChild;if(!c||c.nodeType!=1||c.contentEditable=="false"||/^(BR|IMG)$/.test(c.nodeName))break;l=c}l.insertBefore(i,l.firstChild),r==i&&n.domSelection().collapse(i,o)}else i.parentNode.removeChild(i)}}function Mb(n,e,t){let{node:r,fromOffset:o,toOffset:i,from:s,to:l}=n.docView.parseRange(e,t),c=n.domSelectionRange(),d,u=c.anchorNode;if(u&&n.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],Jn(c)||d.push({node:c.focusNode,offset:c.focusOffset})),ie&&n.input.lastKeyCode===8)for(let g=i;g>o;g--){let y=r.childNodes[g-1],b=y.pmViewDesc;if(y.nodeName=="BR"&&!b){i=g;break}if(!b||b.size)break}let f=n.state.doc,h=n.someProp("domParser")||We.fromSchema(n.state.schema),p=f.resolve(s),m=null,A=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:Nb,context:p});if(d&&d[0].pos!=null){let g=d[0].pos,y=d[1]&&d[1].pos;y==null&&(y=g),m={anchor:g+s,head:y+s}}return{doc:A,sel:m,from:s,to:l}}function Nb(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(ce&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||ce&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Bb=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function vb(n,e,t,r,o){let i=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let D=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,P=lo(n,D);if(P&&!n.state.selection.eq(P)){if(ie&&Ue&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",J=>J(n,yt(13,"Enter"))))return;let R=n.state.tr.setSelection(P);D=="pointer"?R.setMeta("pointer",!0):D=="key"&&R.scrollIntoView(),i&&R.setMeta("composition",i),n.dispatch(R)}return}let s=n.state.doc.resolve(e),l=s.sharedDepth(t);e=s.before(l+1),t=n.state.doc.resolve(t).after(l+1);let c=n.state.selection,d=Mb(n,e,t),u=n.state.doc,f=u.slice(d.from,d.to),h,p;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(h=n.state.selection.to,p="end"):(h=n.state.selection.from,p="start"),n.input.lastKeyCode=null;let m=Vb(f.content,d.doc.content,d.from,h,p);if(m&&n.input.domChangeCount++,(It&&n.input.lastIOSEnter>Date.now()-225||Ue)&&o.some(D=>D.nodeType==1&&!Bb.test(D.nodeName))&&(!m||m.endA>=m.endB)&&n.someProp("handleKeyDown",D=>D(n,yt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof z&&!c.empty&&c.$head.sameParent(c.$anchor)&&!n.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let D=ja(n,n.state.doc,d.sel);if(D&&!D.eq(n.state.selection)){let P=n.state.tr.setSelection(D);i&&P.setMeta("composition",i),n.dispatch(P)}}return}n.state.selection.from<n.state.selection.to&&m.start==m.endB&&n.state.selection instanceof z&&(m.start>n.state.selection.from&&m.start<=n.state.selection.from+2&&n.state.selection.from>=d.from?m.start=n.state.selection.from:m.endA<n.state.selection.to&&m.endA>=n.state.selection.to-2&&n.state.selection.to<=d.to&&(m.endB+=n.state.selection.to-m.endA,m.endA=n.state.selection.to)),Ae&&Ze<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)==" "&&(m.start--,m.endA--,m.endB--);let A=d.doc.resolveNoCache(m.start-d.from),g=d.doc.resolveNoCache(m.endB-d.from),y=u.resolve(m.start),b=A.sameParent(g)&&A.parent.inlineContent&&y.end()>=m.endA;if((It&&n.input.lastIOSEnter>Date.now()-225&&(!b||o.some(D=>D.nodeName=="DIV"||D.nodeName=="P"))||!b&&A.pos<d.doc.content.size&&(!A.sameParent(g)||!A.parent.inlineContent)&&A.pos<g.pos&&!/\S/.test(d.doc.textBetween(A.pos,g.pos,"","")))&&n.someProp("handleKeyDown",D=>D(n,yt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>m.start&&Db(u,m.start,m.endA,A,g)&&n.someProp("handleKeyDown",D=>D(n,yt(8,"Backspace")))){Ue&&ie&&n.domObserver.suppressSelectionUpdates();return}ie&&m.endB==m.start&&(n.input.lastChromeDelete=Date.now()),Ue&&!b&&A.start()!=g.start()&&g.parentOffset==0&&A.depth==g.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,g=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{n.someProp("handleKeyDown",function(D){return D(n,yt(13,"Enter"))})},20));let k=m.start,E=m.endA,S=D=>{let P=D||n.state.tr.replace(k,E,d.doc.slice(m.start-d.from,m.endB-d.from));if(d.sel){let R=ja(n,P.doc,d.sel);R&&!(ie&&n.composing&&R.empty&&(m.start!=m.endB||n.input.lastChromeDelete<Date.now()-100)&&(R.head==k||R.head==P.mapping.map(E)-1)||Ae&&R.empty&&R.head==k)&&P.setSelection(R)}return i&&P.setMeta("composition",i),P.scrollIntoView()},x;if(b)if(A.pos==g.pos){Ae&&Ze<=11&&A.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>Qe(n),20));let D=S(n.state.tr.delete(k,E)),P=u.resolve(m.start).marksAcross(u.resolve(m.endA));P&&D.ensureMarks(P),n.dispatch(D)}else if(m.endA==m.endB&&(x=Tb(A.parent.content.cut(A.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start())))){let D=S(n.state.tr);x.type=="add"?D.addMark(k,E,x.mark):D.removeMark(k,E,x.mark),n.dispatch(D)}else if(A.parent.child(A.index()).isText&&A.index()==g.index()-(g.textOffset?0:1)){let D=A.parent.textBetween(A.parentOffset,g.parentOffset),P=()=>S(n.state.tr.insertText(D,k,E));n.someProp("handleTextInput",R=>R(n,k,E,D,P))||n.dispatch(P())}else n.dispatch(S());else n.dispatch(S())}function ja(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:uo(n,e.resolve(t.anchor),e.resolve(t.head))}function Tb(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,o=t,i=r,s,l,c;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<t.length;u++)i=t[u].removeFromSet(i);if(o.length==1&&i.length==0)l=o[0],s="add",c=u=>u.mark(l.addToSet(u.marks));else if(o.length==0&&i.length==1)l=i[0],s="remove",c=u=>u.mark(l.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(c(e.child(u)));if(C.from(d).eq(n))return{mark:l,type:s}}function Db(n,e,t,r,o){if(t-e<=o.pos-r.pos||Eo(r,!0,!1)<o.pos)return!1;let i=n.resolve(e);if(!r.parent.isTextblock){let l=i.nodeAfter;return l!=null&&t==e+l.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=n.resolve(Eo(i,!0,!0));return!s.parent.isTextblock||s.pos>t||Eo(s,!0,!1)<t?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Eo(n,e,t){let r=n.depth,o=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,o++,e=!1;if(t){let i=n.node(r).maybeChild(n.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function Vb(n,e,t,r,o){let i=n.findDiffStart(e,t);if(i==null)return null;let{a:s,b:l}=n.findDiffEnd(e,t+n.size,t+e.size);if(o=="end"){let c=Math.max(0,i-Math.min(s,l));r-=s+c-i}if(s<i&&n.size<e.size){let c=r<=i&&r>=s?i-r:0;i-=c,i&&i<e.size&&Ua(e.textBetween(i-1,i+1))&&(i+=c?1:-1),l=i+(l-s),s=i}else if(l<i){let c=r<=i&&r>=l?i-r:0;i-=c,i&&i<n.size&&Ua(n.textBetween(i-1,i+1))&&(i+=c?1:-1),s=i+(s-l),l=i}return{start:i,endA:s,endB:l}}function Ua(n){if(n.length!=2)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class _a{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Jy,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Ya),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Ka(this),Ja(this),this.nodeViews=Ga(this),this.docView=na(this.state.doc,Qa(this),Co(this),this.dom,this),this.domObserver=new wb(this,(r,o,i,s)=>vb(this,r,o,i,s)),this.domObserver.start(),Ky(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&go(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Ya),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&($a(this),s=!0),this.state=e;let l=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=Ga(this);Ob(p,this.nodeViews)&&(this.nodeViews=p,i=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&go(this),this.editable=Ka(this),Ja(this);let c=Co(this),d=Qa(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",f=i||!this.docView.matchesNode(e.doc,d,c);(f||!e.selection.eq(o.selection))&&(s=!0);let h=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&cy(this);if(s){this.domObserver.stop();let p=f&&(Ae||ie)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&$b(o.selection,e.selection);if(f){let m=ie?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=cb(this)),(i||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=na(e.doc,d,c,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&$y(this))?Qe(this,p):(fa(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&dy(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof I){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&qs(this,t.getBoundingClientRect(),e)}else qs(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}}updateDraggedNode(e,t){let r=e.node,o=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-t.doc.content.size);(i>0&&i<this.state.doc.content.size&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new Ia(e.slice,e.move,o<0?void 0:I.create(this.state.doc,o))}someProp(e,t){let r=this._props&&this._props[e],o;if(r!=null&&(o=t?t(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let l=this.directPlugins[s].props[e];if(l!=null&&(o=t?t(l):l))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let l=i[s].props[e];if(l!=null&&(o=t?t(l):l))return o}}hasFocus(){if(Ae){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&uy(this.dom),Qe(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Ay(this,e)}coordsAtPos(e,t=1){return Ks(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let o=this.docView.posFromDOM(e,t,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,t){return wy(this,t||this.state,e)}pasteHTML(e,t){return dn(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return dn(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return po(this,e)}destroy(){this.docView&&(Gy(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Co(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Zg())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Xy(this,e)}domSelectionRange(){let e=this.domSelection();return e?ce&&this.root.nodeType===11&&oy(this.dom.ownerDocument)==this.dom&&Cb(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}_a.prototype.dispatch=function(n){let e=this._props.dispatchTransaction;e?e.call(this,n):this.updateState(this.state.apply(n))};function Qa(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[Te.node(0,n.state.doc.content.size,e)]}function Ja(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Te.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function Ka(n){return!n.someProp("editable",e=>e(n.state)===!1)}function $b(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function Ga(n){let e=Object.create(null);function t(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function Ob(n,e){let t=0,r=0;for(let o in n){if(n[o]!=e[o])return!0;t++}for(let o in e)r++;return t!=r}function Ya(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var st={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},nr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ib=typeof navigator<"u"&&/Mac/.test(navigator.platform),Pb=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),se=0;se<10;se++)st[48+se]=st[96+se]=String(se);for(var se=1;se<=24;se++)st[se+111]="F"+se;for(var se=65;se<=90;se++)st[se]=String.fromCharCode(se+32),nr[se]=String.fromCharCode(se);for(var xo in st)nr.hasOwnProperty(xo)||(nr[xo]=st[xo]);function Rb(n){var e=Ib&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Pb&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?nr:st)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const Lb=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),zb=typeof navigator<"u"&&/Win/.test(navigator.platform);function Fb(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,o,i,s;for(let l=0;l<e.length-1;l++){let c=e[l];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))i=!0;else if(/^mod$/i.test(c))Lb?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(t="Alt-"+t),o&&(t="Ctrl-"+t),s&&(t="Meta-"+t),i&&(t="Shift-"+t),t}function Hb(n){let e=Object.create(null);for(let t in n)e[Fb(t)]=n[t];return e}function Mo(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function Wb(n){return new ve({props:{handleKeyDown:qb(n)}})}function qb(n){let e=Hb(n);return function(t,r){let o=Rb(r),i,s=e[Mo(o,r)];if(s&&s(t.state,t.dispatch,t))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let l=e[Mo(o,r,!1)];if(l&&l(t.state,t.dispatch,t))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(zb&&r.ctrlKey&&r.altKey)&&(i=st[r.keyCode])&&i!=o){let l=e[Mo(i,r)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1}}var jb=Object.defineProperty,No=(n,e)=>{for(var t in e)jb(n,t,{get:e[t],enumerable:!0})};function fn(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:o}=t,{storedMarks:i}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=t.selection,o=t.doc,i=t.storedMarks,t}}}var hn=class{constructor(n){this.editor=n.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=n.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:n,editor:e,state:t}=this,{view:r}=e,{tr:o}=t,i=this.buildProps(o);return Object.fromEntries(Object.entries(n).map(([s,l])=>[s,(...d)=>{const u=l(...d)(i);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(o),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(n,e=!0){const{rawCommands:t,editor:r,state:o}=this,{view:i}=r,s=[],l=!!n,c=n||o.tr,d=()=>(!l&&e&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(c),s.every(f=>f===!0)),u={...Object.fromEntries(Object.entries(t).map(([f,h])=>[f,(...m)=>{const A=this.buildProps(c,e),g=h(...m)(A);return s.push(g),u}])),run:d};return u}createCan(n){const{rawCommands:e,state:t}=this,r=!1,o=n||t.tr,i=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(e).map(([l,c])=>[l,(...d)=>c(...d)({...i,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(n,e=!0){const{rawCommands:t,editor:r,state:o}=this,{view:i}=r,s={tr:n,editor:r,view:i,state:fn({state:o,transaction:n}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(n,e),can:()=>this.createCan(n),get commands(){return Object.fromEntries(Object.entries(t).map(([l,c])=>[l,(...d)=>c(...d)(s)]))}};return s}},Bo={};No(Bo,{blur:()=>Ub,clearContent:()=>_b,clearNodes:()=>Qb,command:()=>Jb,createParagraphNear:()=>Kb,cut:()=>Gb,deleteCurrentNode:()=>Yb,deleteNode:()=>Xb,deleteRange:()=>Zb,deleteSelection:()=>ek,enter:()=>tk,exitCode:()=>nk,extendMarkRange:()=>rk,first:()=>ok,focus:()=>ik,forEach:()=>sk,insertContent:()=>ak,insertContentAt:()=>ck,joinBackward:()=>fk,joinDown:()=>uk,joinForward:()=>hk,joinItemBackward:()=>pk,joinItemForward:()=>mk,joinTextblockBackward:()=>Ak,joinTextblockForward:()=>gk,joinUp:()=>dk,keyboardShortcut:()=>bk,lift:()=>kk,liftEmptyBlock:()=>wk,liftListItem:()=>Sk,newlineInCode:()=>Ck,resetAttributes:()=>Ek,scrollIntoView:()=>xk,selectAll:()=>Mk,selectNodeBackward:()=>Nk,selectNodeForward:()=>Bk,selectParentNode:()=>vk,selectTextblockEnd:()=>Tk,selectTextblockStart:()=>Dk,setContent:()=>Vk,setMark:()=>Qk,setMeta:()=>Jk,setNode:()=>Kk,setNodeSelection:()=>Gk,setTextDirection:()=>Yk,setTextSelection:()=>Xk,sinkListItem:()=>Zk,splitBlock:()=>e0,splitListItem:()=>t0,toggleList:()=>r0,toggleMark:()=>o0,toggleNode:()=>i0,toggleWrap:()=>s0,undoInputRule:()=>a0,unsetAllMarks:()=>l0,unsetMark:()=>c0,unsetTextDirection:()=>d0,updateAttributes:()=>u0,wrapIn:()=>f0,wrapInList:()=>h0});var Ub=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())==null||t.removeAllRanges())}),!0),_b=(n=!0)=>({commands:e})=>e.setContent("",{emitUpdate:n}),Qb=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:o}=r;return t&&o.forEach(({$from:i,$to:s})=>{n.doc.nodesBetween(i.pos,s.pos,(l,c)=>{if(l.type.isText)return;const{doc:d,mapping:u}=e,f=d.resolve(u.map(c)),h=d.resolve(u.map(c+l.nodeSize)),p=f.blockRange(h);if(!p)return;const m=Bt(p);if(l.type.isTextblock){const{defaultType:A}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,A)}(m||m===0)&&e.lift(p,m)})}),!0},Jb=n=>e=>n(e),Kb=()=>({state:n,dispatch:e})=>$s(n,e),Gb=(n,e)=>({editor:t,tr:r})=>{const{state:o}=t,i=o.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const s=r.mapping.map(e);return r.insert(s,i.content),r.setSelection(new z(r.doc.resolve(Math.max(s-1,0)))),!0},Yb=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const o=n.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(e){const l=o.before(i),c=o.after(i);n.delete(l,c).scrollIntoView()}return!0}return!1};function ee(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}var Xb=n=>({tr:e,state:t,dispatch:r})=>{const o=ee(n,t.schema),i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const c=i.before(s),d=i.after(s);e.delete(c,d).scrollIntoView()}return!0}return!1},Zb=n=>({tr:e,dispatch:t})=>{const{from:r,to:o}=n;return t&&e.delete(r,o),!0},ek=()=>({state:n,dispatch:e})=>Kr(n,e),tk=()=>({commands:n})=>n.keyboardShortcut("Enter"),nk=()=>({state:n,dispatch:e})=>Lg(n,e);function rr(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function pn(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>t.strict?e[o]===n[o]:rr(e[o])?e[o].test(n[o]):e[o]===n[o]):!0}function Xa(n,e,t={}){return n.find(r=>r.type===e&&pn(Object.fromEntries(Object.keys(t).map(o=>[o,r.attrs[o]])),t))}function Za(n,e,t={}){return!!Xa(n,e,t)}function or(n,e,t){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if((!r.node||!r.node.marks.some(d=>d.type===e))&&(r=n.parent.childBefore(n.parentOffset)),!r.node||!r.node.marks.some(d=>d.type===e))return;if(!t){const d=r.node.marks.find(u=>u.type===e);d&&(t=d.attrs)}if(!Xa([...r.node.marks],e,t))return;let i=r.index,s=n.start()+r.offset,l=i+1,c=s+r.node.nodeSize;for(;i>0&&Za([...n.parent.child(i-1).marks],e,t);)i-=1,s-=n.parent.child(i).nodeSize;for(;l<n.parent.childCount&&Za([...n.parent.child(l).marks],e,t);)c+=n.parent.child(l).nodeSize,l+=1;return{from:s,to:c}}function Pe(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}var rk=(n,e)=>({tr:t,state:r,dispatch:o})=>{const i=Pe(n,r.schema),{doc:s,selection:l}=t,{$from:c,from:d,to:u}=l;if(o){const f=or(c,i,e);if(f&&f.from<=d&&f.to>=u){const h=z.create(s,f.from,f.to);t.setSelection(h)}}return!0},ok=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function vo(n){return n instanceof z}function Re(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function To(n,e=null){if(!e)return null;const t=q.atStart(n),r=q.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const o=t.from,i=r.to;return e==="all"?z.create(n,Re(0,o,i),Re(n.content.size,o,i)):z.create(n,Re(e,o,i),Re(e,o,i))}function mn(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Et(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function el(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var ik=(n=null,e={})=>({editor:t,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{(Et()||mn())&&r.dom.focus(),el()&&!Et()&&!mn()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};try{if(r.hasFocus()&&n===null||n===!1)return!0}catch{return!1}if(i&&n===null&&!vo(t.state.selection))return s(),!0;const l=To(o.doc,n)||t.state.selection,c=t.state.selection.eq(l);return i&&(c||o.setSelection(l),c&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},sk=(n,e)=>t=>n.every((r,o)=>e(r,{...t,index:o})),ak=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),tl=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&tl(r)}return n};function Ft(n){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return tl(t)}function Ht(n,e,t){if(n instanceof ye||n instanceof C)return n;t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,o=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return C.fromArray(n.map(l=>e.nodeFromJSON(l)));const s=e.nodeFromJSON(n);return t.errorOnInvalidContent&&s.check(),s}catch(i){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",i),Ht("",e,t)}if(o){if(t.errorOnInvalidContent){let s=!1,l="";const c=new Ui({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(s=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(t.slice?We.fromSchema(c).parseSlice(Ft(n),t.parseOptions):We.fromSchema(c).parse(Ft(n),t.parseOptions),t.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const i=We.fromSchema(e);return t.slice?i.parseSlice(Ft(n),t.parseOptions).content:i.parse(Ft(n),t.parseOptions)}return Ht("",e,t)}function nl(n,e,t){const r=n.steps.length-1;if(r<e)return;const o=n.steps[r];if(!(o instanceof Z||o instanceof te))return;const i=n.mapping.maps[r];let s=0;i.forEach((l,c,d,u)=>{s===0&&(s=u)}),n.setSelection(q.near(n.doc.resolve(s),t))}var lk=n=>!("type"in n),ck=(n,e,t)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){t={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let l;const c=g=>{i.emit("contentError",{editor:i,error:g,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{Ht(e,i.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(g){c(g)}try{l=Ht(e,i.schema,{parseOptions:d,errorOnInvalidContent:(s=t.errorOnInvalidContent)!=null?s:i.options.enableContentCheck})}catch(g){return c(g),!1}let{from:u,to:f}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},h=!0,p=!0;if((lk(l)?l:[l]).forEach(g=>{g.check(),h=h?g.isText&&g.marks.length===0:!1,p=p?g.isBlock:!1}),u===f&&p){const{parent:g}=r.doc.resolve(u);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(u-=1,f+=1)}let A;if(h){if(Array.isArray(e))A=e.map(g=>g.text||"").join("");else if(e instanceof C){let g="";e.forEach(y=>{y.text&&(g+=y.text)}),A=g}else typeof e=="object"&&e&&e.text?A=e.text:A=e;r.insertText(A,u,f)}else{A=l;const g=r.doc.resolve(u),y=g.node(),b=g.parentOffset===0,k=y.isText||y.isTextblock,E=y.content.size>0;b&&k&&E&&p&&(u=Math.max(0,u-1)),r.replaceWith(u,f,A)}t.updateSelection&&nl(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:A}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:A})}return!0},dk=()=>({state:n,dispatch:e})=>Ig(n,e),uk=()=>({state:n,dispatch:e})=>Pg(n,e),fk=()=>({state:n,dispatch:e})=>Ms(n,e),hk=()=>({state:n,dispatch:e})=>Ts(n,e),pk=()=>({state:n,dispatch:e,tr:t})=>{try{const r=jn(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},mk=()=>({state:n,dispatch:e,tr:t})=>{try{const r=jn(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},Ak=()=>({state:n,dispatch:e})=>$g(n,e),gk=()=>({state:n,dispatch:e})=>Og(n,e);function Do(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function yk(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,o,i,s;for(let l=0;l<e.length-1;l+=1){const c=e[l];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))i=!0;else if(/^mod$/i.test(c))Et()||Do()?s=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(t=`Alt-${t}`),o&&(t=`Ctrl-${t}`),s&&(t=`Meta-${t}`),i&&(t=`Shift-${t}`),t}var bk=n=>({editor:e,view:t,tr:r,dispatch:o})=>{const i=yk(n).split(/-(?!$)/),s=i.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",d=>d(t,l))});return c?.steps.forEach(d=>{const u=d.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function Wt(n,e,t={}){const{from:r,to:o,empty:i}=n.selection,s=e?ee(e,n.schema):null,l=[];n.doc.nodesBetween(r,o,(f,h)=>{if(f.isText)return;const p=Math.max(r,h),m=Math.min(o,h+f.nodeSize);l.push({node:f,from:p,to:m})});const c=o-r,d=l.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>pn(f.node.attrs,t,{strict:!1}));return i?!!d.length:d.reduce((f,h)=>f+h.to-h.from,0)>=c}var kk=(n,e={})=>({state:t,dispatch:r})=>{const o=ee(n,t.schema);return Wt(t,o,e)?Rg(t,r):!1},wk=()=>({state:n,dispatch:e})=>Os(n,e),Sk=n=>({state:e,dispatch:t})=>{const r=ee(n,e.schema);return Kg(r)(e,t)},Ck=()=>({state:n,dispatch:e})=>Vs(n,e);function An(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Vo(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,o)=>(t.includes(o)||(r[o]=n[o]),r),{})}var Ek=(n,e)=>({tr:t,state:r,dispatch:o})=>{let i=null,s=null;const l=An(typeof n=="string"?n:n.name,r.schema);if(!l)return!1;l==="node"&&(i=ee(n,r.schema)),l==="mark"&&(s=Pe(n,r.schema));let c=!1;return t.selection.ranges.forEach(d=>{r.doc.nodesBetween(d.$from.pos,d.$to.pos,(u,f)=>{i&&i===u.type&&(c=!0,o&&t.setNodeMarkup(f,void 0,Vo(u.attrs,e))),s&&u.marks.length&&u.marks.forEach(h=>{s===h.type&&(c=!0,o&&t.addMark(f,f+u.nodeSize,s.create(Vo(h.attrs,e))))})})}),c},xk=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),Mk=()=>({tr:n,dispatch:e})=>{if(e){const t=new ke(n.doc);n.setSelection(t)}return!0},Nk=()=>({state:n,dispatch:e})=>Bs(n,e),Bk=()=>({state:n,dispatch:e})=>Ds(n,e),vk=()=>({state:n,dispatch:e})=>Hg(n,e),Tk=()=>({state:n,dispatch:e})=>jg(n,e),Dk=()=>({state:n,dispatch:e})=>qg(n,e);function ir(n,e,t={},r={}){return Ht(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}var Vk=(n,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:r={}}={})=>({editor:o,tr:i,dispatch:s,commands:l})=>{const{doc:c}=i;if(r.preserveWhitespace!=="full"){const d=ir(n,o.schema,r,{errorOnInvalidContent:e??o.options.enableContentCheck});return s&&i.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!t),!0}return s&&i.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:c.content.size},n,{parseOptions:r,errorOnInvalidContent:e??o.options.enableContentCheck})};function $o(n,e){const t=Pe(e,n.schema),{from:r,to:o,empty:i}=n.selection,s=[];i?(n.storedMarks&&s.push(...n.storedMarks),s.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,o,c=>{s.push(...c.marks)});const l=s.find(c=>c.type.name===t.name);return l?{...l.attrs}:{}}function rl(n,e){const t=new As(n);return e.forEach(r=>{r.steps.forEach(o=>{t.step(o)})}),t}function ol(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function $k(n,e){const t=[];return n.descendants((r,o)=>{e(r)&&t.push({node:r,pos:o})}),t}function Ok(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(o,i)=>{t(o)&&r.push({node:o,pos:i})}),r}function il(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function gn(n){return e=>il(e.$from,n)}function $(n,e,t){return n.config[e]===void 0&&n.parent?$(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?$(n.parent,e,t):null}):n.config[e]}function sr(n){return n.map(e=>{const t={name:e.name,options:e.options,storage:e.storage},r=$(e,"addExtensions",t);return r?[e,...sr(r())]:e}).flat(10)}function yn(n,e){const t=mt.fromSchema(e).serializeFragment(n),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(t),o.innerHTML}function Oo(n){return typeof n=="function"}function U(n,e=void 0,...t){return Oo(n)?e?n.bind(e)(...t):n(...t):n}function sl(n={}){return Object.keys(n).length===0&&n.constructor===Object}function xt(n){const e=n.filter(o=>o.type==="extension"),t=n.filter(o=>o.type==="node"),r=n.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function Io(n){const e=[],{nodeExtensions:t,markExtensions:r}=xt(n),o=[...t,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=t.filter(d=>d.name!=="text").map(d=>d.name),l=r.map(d=>d.name),c=[...s,...l];return n.forEach(d=>{const u={name:d.name,options:d.options,storage:d.storage,extensions:o},f=$(d,"addGlobalAttributes",u);if(!f)return;f().forEach(p=>{let m;Array.isArray(p.types)?m=p.types:p.types==="*"?m=c:p.types==="nodes"?m=s:p.types==="marks"?m=l:m=[],m.forEach(A=>{Object.entries(p.attributes).forEach(([g,y])=>{e.push({type:A,name:g,attribute:{...i,...y}})})})})}),o.forEach(d=>{const u={name:d.name,options:d.options,storage:d.storage},f=$(d,"addAttributes",u);if(!f)return;const h=f();Object.entries(h).forEach(([p,m])=>{const A={...i,...m};typeof A?.default=="function"&&(A.default=A.default()),A?.isRequired&&A?.default===void 0&&delete A.default,e.push({type:d.name,name:p,attribute:A})})}),e}function Ik(n){const e=[];let t="",r=!1,o=!1,i=0;const s=n.length;for(let l=0;l<s;l+=1){const c=n[l];if(c==="'"&&!o){r=!r,t+=c;continue}if(c==='"'&&!r){o=!o,t+=c;continue}if(!r&&!o){if(c==="("){i+=1,t+=c;continue}if(c===")"&&i>0){i-=1,t+=c;continue}if(c===";"&&i===0){e.push(t),t="";continue}}t+=c}return t&&e.push(t),e}function al(n){const e=[],t=Ik(n||""),r=t.length;for(let o=0;o<r;o+=1){const i=t[o],s=i.indexOf(":");if(s===-1)continue;const l=i.slice(0,s).trim(),c=i.slice(s+1).trim();l&&c&&e.push([l,c])}return e}function Po(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const l=i?String(i).split(" "):[],c=r[o]?r[o].split(" "):[],d=l.filter(u=>!c.includes(u));r[o]=[...c,...d].join(" ")}else if(o==="style"){const l=new Map([...al(r[o]),...al(i)]);r[o]=Array.from(l.entries()).map(([c,d])=>`${c}: ${d}`).join("; ")}else r[o]=i}),r},{})}function bn(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Po(t,r),{})}function ll(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Ro(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const o=e.reduce((i,s)=>{const l=s.attribute.parseHTML?s.attribute.parseHTML(t):ll(t.getAttribute(s.name));return l==null?i:{...i,[s.name]:l}},{});return{...r,...o}}}}function cl(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&sl(t)?!1:t!=null))}function dl(n){var e,t;const r={};return!((e=n?.attribute)!=null&&e.isRequired)&&"default"in(n?.attribute||{})&&(r.default=n.attribute.default),((t=n?.attribute)==null?void 0:t.validate)!==void 0&&(r.validate=n.attribute.validate),[n.name,r]}function Lo(n,e){var t;const r=Io(n),{nodeExtensions:o,markExtensions:i}=xt(n),s=(t=o.find(d=>$(d,"topNode")))==null?void 0:t.name,l=Object.fromEntries(o.map(d=>{const u=r.filter(y=>y.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=n.reduce((y,b)=>{const k=$(b,"extendNodeSchema",f);return{...y,...k?k(d):{}}},{}),p=cl({...h,content:U($(d,"content",f)),marks:U($(d,"marks",f)),group:U($(d,"group",f)),inline:U($(d,"inline",f)),atom:U($(d,"atom",f)),selectable:U($(d,"selectable",f)),draggable:U($(d,"draggable",f)),code:U($(d,"code",f)),whitespace:U($(d,"whitespace",f)),linebreakReplacement:U($(d,"linebreakReplacement",f)),defining:U($(d,"defining",f)),isolating:U($(d,"isolating",f)),attrs:Object.fromEntries(u.map(dl))}),m=U($(d,"parseHTML",f));m&&(p.parseDOM=m.map(y=>Ro(y,u)));const A=$(d,"renderHTML",f);A&&(p.toDOM=y=>A({node:y,HTMLAttributes:bn(y,u)}));const g=$(d,"renderText",f);return g&&(p.toText=g),[d.name,p]})),c=Object.fromEntries(i.map(d=>{const u=r.filter(g=>g.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=n.reduce((g,y)=>{const b=$(y,"extendMarkSchema",f);return{...g,...b?b(d):{}}},{}),p=cl({...h,inclusive:U($(d,"inclusive",f)),excludes:U($(d,"excludes",f)),group:U($(d,"group",f)),spanning:U($(d,"spanning",f)),code:U($(d,"code",f)),attrs:Object.fromEntries(u.map(dl))}),m=U($(d,"parseHTML",f));m&&(p.parseDOM=m.map(g=>Ro(g,u)));const A=$(d,"renderHTML",f);return A&&(p.toDOM=g=>A({mark:g,HTMLAttributes:bn(g,u)})),[d.name,p]}));return new Ui({topNode:s,nodes:l,marks:c})}function ul(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}function qt(n){return n.sort((t,r)=>{const o=$(t,"priority")||100,i=$(r,"priority")||100;return o>i?-1:o<i?1:0})}function ar(n){const e=qt(sr(n)),t=ul(e.map(r=>r.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function lr(n,e){const t=ar(n);return Lo(t,e)}function Pk(n,e){const t=lr(e),r=ye.fromJSON(t,n);return yn(r.content,t)}function Rk(n,e){const t=lr(e),r=Ft(n);return We.fromSchema(t).parse(r).toJSON()}function zo(n,e,t){const{from:r,to:o}=e,{blockSeparator:i=`
|
|
14
|
-
|
|
15
|
-
`,textSerializers:s={}}=t||{};let l="";return n.nodesBetween(r,o,(c,d,u,f)=>{var h;c.isBlock&&d>r&&(l+=i);const p=s?.[c.type.name];if(p)return u&&(l+=p({node:c,pos:d,parent:u,index:f,range:e})),!1;c.isText&&(l+=(h=c?.text)==null?void 0:h.slice(Math.max(r,d)-d,o-d))}),l}function Fo(n,e){const t={from:0,to:n.content.size};return zo(n,t,e)}function cr(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Lk(n,e,t){const{blockSeparator:r=`
|
|
16
|
-
|
|
17
|
-
`,textSerializers:o={}}=t||{},i=lr(e),s=ye.fromJSON(i,n);return Fo(s,{blockSeparator:r,textSerializers:{...cr(i),...o}})}function fl(n,e){const t=ee(e,n.schema),{from:r,to:o}=n.selection,i=[];n.doc.nodesBetween(r,o,l=>{i.push(l)});const s=i.reverse().find(l=>l.type.name===t.name);return s?{...s.attrs}:{}}function hl(n,e){const t=An(typeof e=="string"?e:e.name,n.schema);return t==="node"?fl(n,e):t==="mark"?$o(n,e):{}}function pl(n,e=JSON.stringify){const t={};return n.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(t,o)?!1:t[o]=!0})}function zk(n){const e=pl(n);return e.length===1?e:e.filter((t,r)=>!e.filter((i,s)=>s!==r).some(i=>t.oldRange.from>=i.oldRange.from&&t.oldRange.to<=i.oldRange.to&&t.newRange.from>=i.newRange.from&&t.newRange.to<=i.newRange.to))}function ml(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((o,i)=>{const s=[];if(o.ranges.length)o.forEach((l,c)=>{s.push({from:l,to:c})});else{const{from:l,to:c}=t[i];if(l===void 0||c===void 0)return;s.push({from:l,to:c})}s.forEach(({from:l,to:c})=>{const d=e.slice(i).map(l,-1),u=e.slice(i).map(c),f=e.invert().map(d,-1),h=e.invert().map(u);r.push({oldRange:{from:f,to:h},newRange:{from:d,to:u}})})}),zk(r)}function Al(n,e=0){const r=n.type===n.type.schema.topNodeType?0:1,o=e,i=o+n.nodeSize,s=n.marks.map(d=>{const u={type:d.type.name};return Object.keys(d.attrs).length&&(u.attrs={...d.attrs}),u}),l={...n.attrs},c={type:n.type.name,from:o,to:i};return Object.keys(l).length&&(c.attrs=l),s.length&&(c.marks=s),n.content.childCount&&(c.content=[],n.forEach((d,u)=>{var f;(f=c.content)==null||f.push(Al(d,e+u+r))})),n.text&&(c.text=n.text),c}function Ho(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(o=>{const i=t.resolve(n),s=or(i,o.type);s&&r.push({mark:o,...s})}):t.nodesBetween(n,e,(o,i)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}var Fk=(n,e,t,r=20)=>{const o=n.doc.resolve(t);let i=r,s=null;for(;i>0&&s===null;){const l=o.node(i);l?.type.name===e?s=l:i-=1}return[s,i]};function jt(n,e){return e.nodes[n]||e.marks[n]||null}function kn(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const o=n.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}var gl=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,l)=>{var c,d;const u=((d=(c=o.type.spec).toText)==null?void 0:d.call(c,{node:o,pos:i,parent:s,index:l}))||o.textContent||"%leaf%";t+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-i))}),t};function dr(n,e,t={}){const{empty:r,ranges:o}=n.selection,i=e?Pe(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(f=>i?i.name===f.type.name:!0).find(f=>pn(f.attrs,t,{strict:!1}));let s=0;const l=[];if(o.forEach(({$from:f,$to:h})=>{const p=f.pos,m=h.pos;n.doc.nodesBetween(p,m,(A,g)=>{if(i&&A.inlineContent&&!A.type.allowsMarkType(i))return!1;if(!A.isText&&!A.marks.length)return;const y=Math.max(p,g),b=Math.min(m,g+A.nodeSize),k=b-y;s+=k,l.push(...A.marks.map(E=>({mark:E,from:y,to:b})))})}),s===0)return!1;const c=l.filter(f=>i?i.name===f.mark.type.name:!0).filter(f=>pn(f.mark.attrs,t,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),d=l.filter(f=>i?f.mark.type!==i&&f.mark.type.excludes(i):!0).reduce((f,h)=>f+h.to-h.from,0);return(c>0?c+d:c)>=s}function yl(n,e,t={}){if(!e)return Wt(n,null,t)||dr(n,null,t);const r=An(e,n.schema);return r==="node"?Wt(n,e,t):r==="mark"?dr(n,e,t):!1}var Hk=(n,e)=>{const{$from:t,$to:r,$anchor:o}=n.selection;if(e){const i=gn(l=>l.type.name===e)(n.selection);if(!i)return!1;const s=n.doc.resolve(i.pos+1);return o.pos+1===s.end()}return!(r.parentOffset<r.parent.nodeSize-2||t.pos!==r.pos)},Wk=n=>{const{$from:e,$to:t}=n.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function Wo(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function ur(n,e){const{nodeExtensions:t}=xt(e),r=t.find(s=>s.name===n);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=U($(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function fr(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return!/\S/.test((r=n.text)!=null?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let o=!0;return n.content.forEach(i=>{o!==!1&&(fr(i,{ignoreWhitespace:t,checkChildren:e})||(o=!1))}),o}return!1}function qk(n){return n instanceof I}var qo=class rc{constructor(e){this.position=e}static fromJSON(e){return new rc(e.position)}toJSON(){return{position:this.position}}};function bl(n,e){const t=e.mapping.mapResult(n.position);return{position:new qo(t.pos),mapResult:t}}function kl(n){return new qo(n)}function jk(n,e,t){const o=n.state.doc.content.size,i=Re(e,0,o),s=Re(t,0,o),l=n.coordsAtPos(i),c=n.coordsAtPos(s,-1),d=Math.min(l.top,c.top),u=Math.max(l.bottom,c.bottom),f=Math.min(l.left,c.left),h=Math.max(l.right,c.right),p=h-f,m=u-d,y={top:d,bottom:u,left:f,right:h,width:p,height:m,x:f,y:d};return{...y,toJSON:()=>y}}function wl({json:n,validMarks:e,validNodes:t,options:r,rewrittenContent:o=[]}){return n.marks&&Array.isArray(n.marks)&&(n.marks=n.marks.filter(i=>{const s=typeof i=="string"?i:i.type;return e.has(s)?!0:(o.push({original:JSON.parse(JSON.stringify(i)),unsupported:s}),!1)})),n.content&&Array.isArray(n.content)&&(n.content=n.content.map(i=>wl({json:i,validMarks:e,validNodes:t,options:r,rewrittenContent:o}).json).filter(i=>i!=null)),n.type&&!t.has(n.type)?(o.push({original:JSON.parse(JSON.stringify(n)),unsupported:n.type}),n.content&&Array.isArray(n.content)&&r?.fallbackToParagraph!==!1?(n.type="paragraph",{json:n,rewrittenContent:o}):{json:null,rewrittenContent:o}):{json:n,rewrittenContent:o}}function Uk(n,e,t){return wl({json:n,validNodes:new Set(Object.keys(e.nodes)),validMarks:new Set(Object.keys(e.marks)),options:t})}function _k(n,e,t){var r;const{selection:o}=e;let i=null;if(vo(o)&&(i=o.$cursor),i){const l=(r=n.storedMarks)!=null?r:i.marks();return i.parent.type.allowsMarkType(t)&&(!!t.isInSet(l)||!l.some(d=>d.type.excludes(t)))}const{ranges:s}=o;return s.some(({$from:l,$to:c})=>{let d=l.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(l.pos,c.pos,(u,f,h)=>{if(d)return!1;if(u.isInline){const p=!h||h.type.allowsMarkType(t),m=!!t.isInSet(u.marks)||!u.marks.some(A=>A.type.excludes(t));d=p&&m}return!d}),d})}var Qk=(n,e={})=>({tr:t,state:r,dispatch:o})=>{const{selection:i}=t,{empty:s,ranges:l}=i,c=Pe(n,r.schema);if(o)if(s){const d=$o(r,c);t.addStoredMark(c.create({...d,...e}))}else l.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(u,f,(h,p)=>{const m=Math.max(p,u),A=Math.min(p+h.nodeSize,f);h.marks.find(y=>y.type===c)?h.marks.forEach(y=>{c===y.type&&t.addMark(m,A,c.create({...y.attrs,...e}))}):t.addMark(m,A,c.create(e))})});return _k(r,t,c)},Jk=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),Kk=(n,e={})=>({state:t,dispatch:r,chain:o})=>{const i=ee(n,t.schema);let s;return t.selection.$anchor.sameParent(t.selection.$head)&&(s=t.selection.$anchor.parent.attrs),i.isTextblock?o().command(({commands:l})=>Rs(i,{...s,...e})(t)?!0:l.clearNodes()).command(({state:l})=>Rs(i,{...s,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Gk=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,o=Re(n,0,r.content.size),i=I.create(r,o);e.setSelection(i)}return!0},Yk=(n,e)=>({tr:t,state:r,dispatch:o})=>{const{selection:i}=r;let s,l;return typeof e=="number"?(s=e,l=e):e&&"from"in e&&"to"in e?(s=e.from,l=e.to):(s=i.from,l=i.to),o&&t.doc.nodesBetween(s,l,(c,d)=>{c.isText||t.setNodeMarkup(d,void 0,{...c.attrs,dir:n})}),!0},Xk=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:o,to:i}=typeof n=="number"?{from:n,to:n}:n,s=z.atStart(r).from,l=z.atEnd(r).to,c=Re(o,s,l),d=Re(i,s,l),u=z.create(r,c,d);e.setSelection(u)}return!0},Zk=n=>({state:e,dispatch:t})=>{const r=ee(n,e.schema);return Xg(r)(e,t)};function Sl(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(o=>e?.includes(o.type.name));n.tr.ensureMarks(r)}}var e0=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:l,$to:c}=i,d=o.extensionManager.attributes,u=kn(d,l.node().type.name,l.node().attrs);if(i instanceof I&&i.node.isBlock)return!l.parentOffset||!qe(s,l.pos)?!1:(r&&(n&&Sl(t,o.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const f=c.parentOffset===c.parent.content.size,h=l.depth===0?void 0:ol(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=f&&h?[{type:h,attrs:u}]:void 0,m=qe(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!m&&qe(e.doc,e.mapping.map(l.pos),1,h?[{type:h}]:void 0)&&(m=!0,p=h?[{type:h,attrs:u}]:void 0),r){if(m&&(i instanceof z&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,p),h&&!f&&!l.parentOffset&&l.parent.type!==h)){const A=e.mapping.map(l.before()),g=e.doc.resolve(A);l.node(-1).canReplaceWith(g.index(),g.index()+1,h)&&e.setNodeMarkup(e.mapping.map(l.before()),h)}n&&Sl(t,o.extensionManager.splittableMarks),e.scrollIntoView()}return m},t0=(n,e={})=>({tr:t,state:r,dispatch:o,editor:i})=>{var s;const l=ee(n,r.schema),{$from:c,$to:d}=r.selection,u=r.selection.node;if(u&&u.isBlock||c.depth<2||!c.sameParent(d))return!1;const f=c.node(-1);if(f.type!==l)return!1;const h=i.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(o){let y=C.empty;const b=c.index(-1)?1:c.index(-2)?2:3;for(let P=c.depth-b;P>=c.depth-3;P-=1)y=C.from(c.node(P).copy(y));const k=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,E={...kn(h,c.node().type.name,c.node().attrs),...e},S=((s=l.contentMatch.defaultType)==null?void 0:s.createAndFill(E))||void 0;y=y.append(C.from(l.createAndFill(null,S)||void 0));const x=c.before(c.depth-(b-1));t.replace(x,c.after(-k),new T(y,4-b,0));let D=-1;t.doc.nodesBetween(x,t.doc.content.size,(P,R)=>{if(D>-1)return!1;P.isTextblock&&P.content.size===0&&(D=R+1)}),D>-1&&t.setSelection(z.near(t.doc.resolve(D))),t.scrollIntoView()}return!0}const p=d.pos===c.end()?f.contentMatchAt(0).defaultType:null,m={...kn(h,f.type.name,f.attrs),...e},A={...kn(h,c.node().type.name,c.node().attrs),...e};t.delete(c.pos,d.pos);const g=p?[{type:l,attrs:m},{type:p,attrs:A}]:[{type:l,attrs:m}];if(!qe(t.doc,c.pos,2))return!1;if(o){const{selection:y,storedMarks:b}=r,{splittableMarks:k}=i.extensionManager,E=b||y.$to.parentOffset&&y.$from.marks();if(t.split(c.pos,2,g).scrollIntoView(),!E||!o)return!0;const S=E.filter(x=>k.includes(x.type.name));t.ensureMarks(S)}return!0},jo=(n,e)=>{const t=gn(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const o=n.doc.nodeAt(r);return t.node.type===o?.type&&Ge(n.doc,t.pos)&&n.join(t.pos),!0},Uo=(n,e)=>{const t=gn(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const o=n.doc.nodeAt(r);return t.node.type===o?.type&&Ge(n.doc,r)&&n.join(r),!0};function n0(n){const e=n.doc,t=e.firstChild;if(!t)return null;const r=e.resolve(1),o=e.resolve(t.nodeSize-1);return z.between(r,o)}var r0=(n,e,t,r={})=>({editor:o,tr:i,state:s,dispatch:l,chain:c,commands:d,can:u})=>{const{extensions:f,splittableMarks:h}=o.extensionManager,p=ee(n,s.schema),m=ee(e,s.schema),{selection:A,storedMarks:g}=s,{$from:y,$to:b}=A,k=y.blockRange(b),E=g||A.$to.parentOffset&&A.$from.marks();if(!k)return!1;const S=gn(H=>ur(H.type.name,f))(A),x=A.from===0&&A.to===s.doc.content.size,D=s.doc.content.content,P=D.length===1?D[0]:null,R=x&&P&&ur(P.type.name,f)?{node:P,pos:0}:null,J=S??R,Ve=!!S&&k.depth>=1&&k.depth-S.depth<=1,Me=!!R;if((Ve||Me)&&J){if(J.node.type===p)return x&&Me?c().command(({tr:H,dispatch:G})=>{const N=n0(H);return N?(H.setSelection(N),G&&G(H),!0):!1}).liftListItem(m).run():d.liftListItem(m);if(ur(J.node.type.name,f)&&p.validContent(J.node.content))return c().command(()=>(i.setNodeMarkup(J.pos,p),!0)).command(()=>jo(i,p)).command(()=>Uo(i,p)).run()}return!t||!E||!l?c().command(()=>u().wrapInList(p,r)?!0:d.clearNodes()).wrapInList(p,r).command(()=>jo(i,p)).command(()=>Uo(i,p)).run():c().command(()=>{const H=u().wrapInList(p,r),G=E.filter(N=>h.includes(N.type.name));return i.ensureMarks(G),H?!0:d.clearNodes()}).wrapInList(p,r).command(()=>jo(i,p)).command(()=>Uo(i,p)).run()},o0=(n,e={},t={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=t,s=Pe(n,r.schema);return dr(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},i0=(n,e,t={})=>({state:r,commands:o})=>{const i=ee(n,r.schema),s=ee(e,r.schema),l=Wt(r,i,t);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),l?o.setNode(s,c):o.setNode(i,{...c,...t})},s0=(n,e={})=>({state:t,commands:r})=>{const o=ee(n,t.schema);return Wt(t,o,e)?r.lift(o):r.wrapIn(o,e)},a0=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const o=t[r];let i;if(o.spec.isInputRules&&(i=o.getState(n))){if(e){const s=n.tr,l=i.transform;for(let c=l.steps.length-1;c>=0;c-=1)s.step(l.steps[c].invert(l.docs[c]));if(i.text){const c=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,n.schema.text(i.text,c))}else s.delete(i.from,i.to)}return!0}}return!1},l0=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:o}=t;return r||e&&o.forEach(i=>{n.removeMark(i.$from.pos,i.$to.pos)}),!0},c0=(n,e={})=>({tr:t,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:l}=t,c=Pe(n,r.schema),{$from:d,empty:u,ranges:f}=l;if(!o)return!0;if(u&&s){let{from:h,to:p}=l;const m=(i=d.marks().find(g=>g.type===c))==null?void 0:i.attrs,A=or(d,c,m);A&&(h=A.from,p=A.to),t.removeMark(h,p,c)}else f.forEach(h=>{t.removeMark(h.$from.pos,h.$to.pos,c)});return t.removeStoredMark(c),!0},d0=n=>({tr:e,state:t,dispatch:r})=>{const{selection:o}=t;let i,s;return typeof n=="number"?(i=n,s=n):n&&"from"in n&&"to"in n?(i=n.from,s=n.to):(i=o.from,s=o.to),r&&e.doc.nodesBetween(i,s,(l,c)=>{if(l.isText)return;const d={...l.attrs};delete d.dir,e.setNodeMarkup(c,void 0,d)}),!0},u0=(n,e={})=>({tr:t,state:r,dispatch:o})=>{let i=null,s=null;const l=An(typeof n=="string"?n:n.name,r.schema);if(!l)return!1;l==="node"&&(i=ee(n,r.schema)),l==="mark"&&(s=Pe(n,r.schema));let c=!1;return t.selection.ranges.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;let h,p,m,A;t.selection.empty?r.doc.nodesBetween(u,f,(g,y)=>{i&&i===g.type&&(c=!0,m=Math.max(y,u),A=Math.min(y+g.nodeSize,f),h=y,p=g)}):r.doc.nodesBetween(u,f,(g,y)=>{y<u&&i&&i===g.type&&(c=!0,m=Math.max(y,u),A=Math.min(y+g.nodeSize,f),h=y,p=g),y>=u&&y<=f&&(i&&i===g.type&&(c=!0,o&&t.setNodeMarkup(y,void 0,{...g.attrs,...e})),s&&g.marks.length&&g.marks.forEach(b=>{if(s===b.type&&(c=!0,o)){const k=Math.max(y,u),E=Math.min(y+g.nodeSize,f);t.addMark(k,E,s.create({...b.attrs,...e}))}}))}),p&&(h!==void 0&&o&&t.setNodeMarkup(h,void 0,{...p.attrs,...e}),s&&p.marks.length&&p.marks.forEach(g=>{s===g.type&&o&&t.addMark(m,A,s.create({...g.attrs,...e}))}))}),c},f0=(n,e={})=>({state:t,dispatch:r})=>{const o=ee(n,t.schema);return Ug(o,e)(t,r)},h0=(n,e={})=>({state:t,dispatch:r})=>{const o=ee(n,t.schema);return _g(o,e)(t,r)},p0=class{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){const t=this.callbacks[n];return t&&t.forEach(r=>r.apply(this,e)),this}off(n,e){const t=this.callbacks[n];return t&&(e?this.callbacks[n]=t.filter(r=>r!==e):delete this.callbacks[n]),this}once(n,e){const t=(...r)=>{this.off(n,t),e.apply(this,r)};return this.on(n,t)}removeAllListeners(){this.callbacks={}}},Ut=class{constructor(n){var e;this.find=n.find,this.handler=n.handler,this.undoable=(e=n.undoable)!=null?e:!0}},m0=(n,e)=>{if(rr(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function hr(n){var e;const{editor:t,from:r,to:o,text:i,rules:s,plugin:l}=n,{view:c}=t;if(c.composing)return!1;const d=c.state.doc.resolve(r);if(d.parent.type.spec.code||(e=d.nodeBefore||d.nodeAfter)!=null&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const f=gl(d)+i;return s.forEach(h=>{if(u)return;const p=m0(f,h.find);if(!p)return;const m=c.state.tr,A=fn({state:c.state,transaction:m}),g={from:r-(p[0].length-i.length),to:o},{commands:y,chain:b,can:k}=new hn({editor:t,state:A});h.handler({state:A,range:g,match:p,commands:y,chain:b,can:k})===null||!m.steps.length||(h.undoable&&m.setMeta(l,{transform:m,from:r,to:o,text:i}),c.dispatch(m),u=!0)}),u}function Cl(n){const{editor:e,rules:t}=n,r=new ve({state:{init(){return null},apply(o,i,s){const l=o.getMeta(r);if(l)return l;const c=o.getMeta("applyInputRules");return c&&setTimeout(()=>{let{text:u}=c;typeof u=="string"?u=u:u=yn(C.from(u),s.schema);const{from:f}=c,h=f+u.length;hr({editor:e,from:f,to:h,text:u,rules:t,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,l){return hr({editor:e,from:i,to:s,text:l,rules:t,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&hr({editor:e,from:i.pos,to:i.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?hr({editor:e,from:s.pos,to:s.pos,text:`
|
|
18
|
-
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function A0(n){return Object.prototype.toString.call(n).slice(8,-1)}function wn(n){return A0(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function _o(n,e){const t={...n};return wn(n)&&wn(e)&&Object.keys(e).forEach(r=>{wn(e[r])&&wn(n[r])?t[r]=_o(n[r],e[r]):t[r]=e[r]}),t}var pr=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...U($(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...U($(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(n={}){const e=this.extend({...this.config,addOptions:()=>_o(this.options,n)});return e.name=this.name,e.parent=this.parent,e}extend(n={}){const e=new this.constructor({...this.config,...n});return e.parent=this,this.child=e,e.name="name"in n?n.name:e.parent.name,e}},Qo=class oc extends pr{constructor(){super(...arguments),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new oc(t)}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const s=o.marks();if(!!!s.find(d=>d?.type.name===t.name))return!1;const c=s.find(d=>d?.type.name===t.name);return c&&r.removeStoredMark(c),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function El(n){return typeof n=="number"}var mr=class{constructor(n){this.find=n.find,this.handler=n.handler}},g0=(n,e,t)=>{if(rr(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(o=>{const i=[o.text];return i.index=o.index,i.input=n,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function y0(n){const{editor:e,state:t,from:r,to:o,rule:i,pasteEvent:s,dropEvent:l}=n,{commands:c,chain:d,can:u}=new hn({editor:e,state:t}),f=[];return t.doc.nodesBetween(r,o,(p,m)=>{var A,g,y,b,k;if((g=(A=p.type)==null?void 0:A.spec)!=null&&g.code||!(p.isText||p.isTextblock||p.isInline))return;const E=(k=(b=(y=p.content)==null?void 0:y.size)!=null?b:p.nodeSize)!=null?k:0,S=Math.max(r,m),x=Math.min(o,m+E);if(S>=x)return;const D=p.isText?p.text||"":p.textBetween(S-m,x-m,void 0,"");g0(D,i.find,s).forEach(R=>{if(R.index===void 0)return;const J=S+R.index+1,Ve=J+R[0].length,Me={from:t.tr.mapping.map(J),to:t.tr.mapping.map(Ve)},H=i.handler({state:t,range:Me,match:R,commands:c,chain:d,can:u,pasteEvent:s,dropEvent:l});f.push(H)})}),f.every(p=>p!==null)}var Ar=null,b0=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)==null||e.setData("text/html",n),t};function xl(n){const{editor:e,rules:t}=n;let r=null,o=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const c=({state:u,from:f,to:h,rule:p,pasteEvt:m})=>{const A=u.tr,g=fn({state:u,transaction:A});if(!(!y0({editor:e,state:g,from:Math.max(f-1,0),to:h.b-1,rule:p,pasteEvent:m,dropEvent:l})||!A.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,A}};return t.map(u=>new ve({view(f){const h=m=>{var A;r=(A=f.dom.parentElement)!=null&&A.contains(m.target)?f.dom.parentElement:null,r&&(Ar=e)},p=()=>{Ar&&(Ar=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(f,h)=>{if(i=r===f.dom.parentElement,l=h,!i){const p=Ar;p?.isEditable&&setTimeout(()=>{const m=p.state.selection;m&&p.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(f,h)=>{var p;const m=(p=h.clipboardData)==null?void 0:p.getData("text/html");return s=h,o=!!m?.includes("data-pm-slice"),!1}}},appendTransaction:(f,h,p)=>{const m=f[0],A=m.getMeta("uiEvent")==="paste"&&!o,g=m.getMeta("uiEvent")==="drop"&&!i,y=m.getMeta("applyPasteRules"),b=!!y;if(!A&&!g&&!b)return;if(b){let{text:S}=y;typeof S=="string"?S=S:S=yn(C.from(S),p.schema);const{from:x}=y,D=x+S.length,P=b0(S);return c({rule:u,state:p,from:x,to:{b:D},pasteEvt:P})}const k=h.doc.content.findDiffStart(p.doc.content),E=h.doc.content.findDiffEnd(p.doc.content);if(!(!El(k)||!E||k===E.b))return c({rule:u,state:p,from:k,to:E,pasteEvt:s})}}))}var gr=class{constructor(n,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=n,this.extensions=ar(n),this.schema=Lo(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((n,e)=>{const t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:jt(e.name,this.schema)},r=$(e,"addCommands",t);return r?{...n,...r()}:n},{})}get plugins(){const{editor:n}=this;return qt([...this.extensions].reverse()).flatMap(r=>{const o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:n,type:jt(r.name,this.schema)},i=[],s=$(r,"addKeyboardShortcuts",o);let l={};if(r.type==="mark"&&$(r,"exitable",o)&&(l.ArrowRight=()=>Qo.handleExit({editor:n,mark:r})),s){const h=Object.fromEntries(Object.entries(s()).map(([p,m])=>[p,()=>m({editor:n})]));l={...l,...h}}const c=Wb(l);i.push(c);const d=$(r,"addInputRules",o);if(Wo(r,n.options.enableInputRules)&&d){const h=d();if(h&&h.length){const p=Cl({editor:n,rules:h}),m=Array.isArray(p)?p:[p];i.push(...m)}}const u=$(r,"addPasteRules",o);if(Wo(r,n.options.enablePasteRules)&&u){const h=u();if(h&&h.length){const p=xl({editor:n,rules:h});i.push(...p)}}const f=$(r,"addProseMirrorPlugins",o);if(f){const h=f();i.push(...h)}return i})}get attributes(){return Io(this.extensions)}get nodeViews(){const{editor:n}=this,{nodeExtensions:e}=xt(this.extensions);return Object.fromEntries(e.filter(t=>!!$(t,"addNodeView")).map(t=>{const r=this.attributes.filter(c=>c.type===t.name),o={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:ee(t.name,this.schema)},i=$(t,"addNodeView",o);if(!i)return[];const s=i();if(!s)return[];const l=(c,d,u,f,h)=>{const p=bn(c,r);return s({node:c,view:d,getPos:u,decorations:f,innerDecorations:h,editor:n,extension:t,HTMLAttributes:p})};return[t.name,l]}))}dispatchTransaction(n){const{editor:e}=this;return qt([...this.extensions].reverse()).reduceRight((r,o)=>{const i={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:jt(o.name,this.schema)},s=$(o,"dispatchTransaction",i);return s?l=>{s.call(i,{transaction:l,next:r})}:r},n)}transformPastedHTML(n){const{editor:e}=this;return qt([...this.extensions]).reduce((r,o)=>{const i={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:jt(o.name,this.schema)},s=$(o,"transformPastedHTML",i);return s?(l,c)=>{const d=r(l,c);return s.call(i,d)}:r},n||(r=>r))}get markViews(){const{editor:n}=this,{markExtensions:e}=xt(this.extensions);return Object.fromEntries(e.filter(t=>!!$(t,"addMarkView")).map(t=>{const r=this.attributes.filter(l=>l.type===t.name),o={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:Pe(t.name,this.schema)},i=$(t,"addMarkView",o);if(!i)return[];const s=(l,c,d)=>{const u=bn(l,r);return i()({mark:l,view:c,inline:d,editor:n,extension:t,HTMLAttributes:u,updateAttributes:f=>{Ko(l,n,f)}})};return[t.name,s]}))}setupExtensions(){const n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(e=>[e.name,e.storage])),n.forEach(e=>{var t;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:jt(e.name,this.schema)};e.type==="mark"&&((t=U($(e,"keepOnSplit",r)))==null||t)&&this.splittableMarks.push(e.name);const o=$(e,"onBeforeCreate",r),i=$(e,"onCreate",r),s=$(e,"onUpdate",r),l=$(e,"onSelectionUpdate",r),c=$(e,"onTransaction",r),d=$(e,"onFocus",r),u=$(e,"onBlur",r),f=$(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}};gr.resolve=ar,gr.sort=qt,gr.flatten=sr;var Ml={};No(Ml,{ClipboardTextSerializer:()=>Nl,Commands:()=>Bl,Delete:()=>vl,Drop:()=>Tl,Editable:()=>Dl,FocusEvents:()=>$l,Keymap:()=>Ol,Paste:()=>Il,Tabindex:()=>Pl,TextDirection:()=>Rl,focusEventsPluginKey:()=>Vl});var De=class ic extends pr{constructor(){super(...arguments),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new ic(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},Nl=De.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ve({key:new Ye("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map(u=>u.$from.pos)),l=Math.max(...i.map(u=>u.$to.pos)),c=cr(t);return zo(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),Bl=De.create({name:"commands",addCommands(){return{...Bo}}}),vl=De.create({name:"delete",onUpdate({transaction:n,appendedTransactions:e}){var t,r,o;const i=()=>{var s,l,c,d;if((d=(c=(l=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:l.filterTransaction)==null?void 0:c.call(l,n))!=null?d:n.getMeta("y-sync$"))return;const u=rl(n.before,[n,...e]);ml(u).forEach(p=>{u.mapping.mapResult(p.oldRange.from).deletedAfter&&u.mapping.mapResult(p.oldRange.to).deletedBefore&&u.before.nodesBetween(p.oldRange.from,p.oldRange.to,(m,A)=>{const g=A+m.nodeSize-2,y=p.oldRange.from<=A&&g<=p.oldRange.to;this.editor.emit("delete",{type:"node",node:m,from:A,to:g,newFrom:u.mapping.map(A),newTo:u.mapping.map(g),deletedRange:p.oldRange,newRange:p.newRange,partial:!y,editor:this.editor,transaction:n,combinedTransform:u})})});const h=u.mapping;u.steps.forEach((p,m)=>{var A,g;if(p instanceof Be){const y=h.slice(m).map(p.from,-1),b=h.slice(m).map(p.to),k=h.invert().map(y,-1),E=h.invert().map(b),S=y>0?(A=u.doc.nodeAt(y-1))==null?void 0:A.marks.some(D=>D.eq(p.mark)):!1,x=(g=u.doc.nodeAt(b))==null?void 0:g.marks.some(D=>D.eq(p.mark));this.editor.emit("delete",{type:"mark",mark:p.mark,from:p.from,to:p.to,deletedRange:{from:k,to:E},newRange:{from:y,to:b},partial:!!(x||S),editor:this.editor,transaction:n,combinedTransform:u})}})};(o=(r=(t=this.editor.options.coreExtensionOptions)==null?void 0:t.delete)==null?void 0:r.async)==null||o?setTimeout(i,0):i()}}),Tl=De.create({name:"drop",addProseMirrorPlugins(){return[new ve({key:new Ye("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),Dl=De.create({name:"editable",addProseMirrorPlugins(){return[new ve({key:new Ye("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Vl=new Ye("focusEvents"),$l=De.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new ve({key:Vl,props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Ol=De.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:c,doc:d}=l,{empty:u,$anchor:f}=c,{pos:h,parent:p}=f,m=f.parent.isTextblock&&h>0?l.doc.resolve(h-1):f,A=m.parent.type.spec.isolating,g=f.pos-f.parentOffset,y=A&&m.parent.childCount===1?g===f.pos:q.atStart(d).from===h;return!u||!p.type.isTextblock||p.textContent.length||!y||y&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Et()||Do()?i:o},addProseMirrorPlugins(){return[new ve({key:new Ye("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(A=>A.getMeta("composition")))return;const r=n.some(A=>A.docChanged)&&!e.doc.eq(t.doc),o=n.some(A=>A.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:s,to:l}=e.selection,c=q.atStart(e.doc).from,d=q.atEnd(e.doc).to;if(i||!(s===c&&l===d)||!fr(t.doc))return;const h=t.tr,p=fn({state:t,transaction:h}),{commands:m}=new hn({editor:this.editor,state:p});if(m.clearNodes(),!!h.steps.length)return h}})]}}),Il=De.create({name:"paste",addProseMirrorPlugins(){return[new ve({key:new Ye("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),Pl=De.create({name:"tabindex",addProseMirrorPlugins(){return[new ve({key:new Ye("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Rl=De.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:n}=xt(this.extensions);return[{types:n.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return t&&(t==="ltr"||t==="rtl"||t==="auto")?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new ve({key:new Ye("textDirection"),props:{attributes:()=>{const n=this.options.direction;return n?{dir:n}:{}}}})]}}),Ll=class xn{constructor(e,t,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,this.currentNode=o}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:t,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new xn(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new xn(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new xn(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,r)=>{const o=t.isBlock&&!t.isTextblock,i=t.isAtom&&!t.isText,s=t.isInline,l=this.pos+r+(i?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const c=this.resolvedPos.doc.resolve(l);if(!o&&!s&&c.depth<=this.depth)return;const d=new xn(c,this.editor,o,o||s?t:null);o&&(d.actualDepth=this.depth+1),e.push(d)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(t).length>0){const i=o.node.attrs,s=Object.keys(t);for(let l=0;l<s.length;l+=1){const c=s[l];if(i[c]!==t[c])break}}else r=o;o=o.parent}return r}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const i=Object.keys(t);return this.children.forEach(s=>{r&&o.length>0||(s.node.type.name===e&&i.every(c=>t[c]===s.node.attrs[c])&&o.push(s),!(r&&o.length>0)&&(o=o.concat(s.querySelectorAll(e,t,r))))}),o}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},k0=`.ProseMirror {
|
|
19
|
-
position: relative;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.ProseMirror {
|
|
23
|
-
word-wrap: break-word;
|
|
24
|
-
white-space: pre-wrap;
|
|
25
|
-
white-space: break-spaces;
|
|
26
|
-
-webkit-font-variant-ligatures: none;
|
|
27
|
-
font-variant-ligatures: none;
|
|
28
|
-
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.ProseMirror [contenteditable="false"] {
|
|
32
|
-
white-space: normal;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
36
|
-
white-space: pre-wrap;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.ProseMirror pre {
|
|
40
|
-
white-space: pre-wrap;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
img.ProseMirror-separator {
|
|
44
|
-
display: inline !important;
|
|
45
|
-
border: none !important;
|
|
46
|
-
margin: 0 !important;
|
|
47
|
-
width: 0 !important;
|
|
48
|
-
height: 0 !important;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.ProseMirror-gapcursor {
|
|
52
|
-
display: none;
|
|
53
|
-
pointer-events: none;
|
|
54
|
-
position: absolute;
|
|
55
|
-
margin: 0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.ProseMirror-gapcursor:after {
|
|
59
|
-
content: "";
|
|
60
|
-
display: block;
|
|
61
|
-
position: absolute;
|
|
62
|
-
top: -2px;
|
|
63
|
-
width: 20px;
|
|
64
|
-
border-top: 1px solid black;
|
|
65
|
-
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
@keyframes ProseMirror-cursor-blink {
|
|
69
|
-
to {
|
|
70
|
-
visibility: hidden;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.ProseMirror-hideselection *::selection {
|
|
75
|
-
background: transparent;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.ProseMirror-hideselection *::-moz-selection {
|
|
79
|
-
background: transparent;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.ProseMirror-hideselection * {
|
|
83
|
-
caret-color: transparent;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
87
|
-
display: block;
|
|
88
|
-
}`;function zl(n,e,t){const r=document.querySelector(`style[data-tiptap-style${t?`-${t}`:""}]`);if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute(`data-tiptap-style${t?`-${t}`:""}`,""),o.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(o),o}var w0=class extends p0{constructor(n={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:bl,createMappablePosition:kl},this.setOptions(n),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:o,moved:i})=>this.options.onDrop(r,o,i)),this.on("paste",({event:r,slice:o})=>this.options.onPaste(r,o)),this.on("delete",this.options.onDelete);const e=this.createDoc(),t=To(e,this.options.autofocus);this.editorState=Vt.create({doc:e,schema:this.schema,selection:t||void 0}),this.options.element&&this.mount(this.options.element)}mount(n){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(n),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const n=this.editorView.dom;n?.editor&&delete n.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(n){console.warn("Failed to remove CSS element:",n)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=zl(k0,this.options.injectNonce))}setOptions(n={}){this.options={...this.options,...n},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(n,e=!0){this.setOptions({editable:n}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:n=>{this.editorState=n},dispatch:n=>{this.dispatchTransaction(n)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(n,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in n)return Reflect.get(n,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(n,e){const t=Oo(e)?e(n,[...this.state.plugins]):[...this.state.plugins,n],r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}unregisterPlugin(n){if(this.isDestroyed)return;const e=this.state.plugins;let t=e;if([].concat(n).forEach(o=>{const i=typeof o=="string"?`${o}$`:o.key;t=t.filter(s=>!s.key.startsWith(i))}),e.length===t.length)return;const r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}createExtensionManager(){var n,e;const r=[...this.options.enableCoreExtensions?[Dl,Nl.configure({blockSeparator:(e=(n=this.options.coreExtensionOptions)==null?void 0:n.clipboardTextSerializer)==null?void 0:e.blockSeparator}),Bl,$l,Ol,Pl,Tl,Il,vl,Rl.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new gr(r,this)}createCommandManager(){this.commandManager=new hn({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let n;try{n=ir(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(t=>t.name!=="collaboration"),this.createExtensionManager()}}),n=ir(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return n}createView(n){const{editorProps:e,enableExtensionDispatchTransaction:t}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),o=t?this.extensionManager.dispatchTransaction(r):r,i=e.transformPastedHTML,s=this.extensionManager.transformPastedHTML(i);this.editorView=new _a(n,{...e,attributes:{role:"textbox",...e?.attributes},dispatchTransaction:o,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS();const c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(n){this.isCapturingTransaction=!0,n(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(n){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=n;return}n.steps.forEach(d=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(d)});return}const{state:e,transactions:t}=this.state.applyTransaction(n),r=!this.state.selection.eq(e.selection),o=t.includes(n),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:n,nextState:e}),!o)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:n,appendedTransactions:t.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:n});const s=t.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),l=s?.getMeta("focus"),c=s?.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:s}),c&&this.emit("blur",{editor:this,event:c.event,transaction:s}),!(n.getMeta("preventUpdate")||!t.some(d=>d.docChanged)||i.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:n,appendedTransactions:t.slice(1)})}getAttributes(n){return hl(this.state,n)}isActive(n,e){const t=typeof n=="string"?n:null,r=typeof n=="string"?e:n;return yl(this.state,t,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return yn(this.state.doc.content,this.schema)}getText(n){const{blockSeparator:e=`
|
|
89
|
-
|
|
90
|
-
`,textSerializers:t={}}=n||{};return Fo(this.state.doc,{blockSeparator:e,textSerializers:{...cr(this.schema),...t}})}get isEmpty(){return fr(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var n,e;return(e=(n=this.editorView)==null?void 0:n.isDestroyed)!=null?e:!0}$node(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelector(n,e))||null}$nodes(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelectorAll(n,e))||null}$pos(n){const e=this.state.doc.resolve(n);return new Ll(e,this)}get $doc(){return this.$pos(0)}};function Jo(n){return new Ut({find:n.find,handler:({state:e,range:t,match:r})=>{const o=U(n.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:i}=e,s=r[r.length-1],l=r[0];if(s){const c=l.search(/\S/),d=t.from+l.indexOf(s),u=d+s.length;if(Ho(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(A=>A===n.type&&A!==p.mark.type)).filter(p=>p.to>d).length)return null;u<t.to&&i.delete(u,t.to),d>t.from&&i.delete(t.from+c,d);const h=t.from+c+s.length;i.addMark(t.from+c,h,n.type.create(o||{})),i.removeStoredMark(n.type)}},undoable:n.undoable})}function S0(n){return new Ut({find:n.find,handler:({state:e,range:t,match:r})=>{const o=U(n.getAttributes,void 0,r)||{},{tr:i}=e,s=t.from;let l=t.to;const c=n.type.create(o);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=s+d;u>l?u=l:l=u+r[1].length;const f=r[0][r[0].length-1];i.insertText(f,s+r[0].length-1),i.replaceWith(u,l,c)}else if(r[0]){const d=n.type.isInline?s:s-1;i.insert(d,n.type.create(o)).delete(i.mapping.map(s),i.mapping.map(l))}i.scrollIntoView()},undoable:n.undoable})}function C0(n){return new Ut({find:n.find,handler:({state:e,range:t,match:r})=>{const o=e.doc.resolve(t.from),i=U(n.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,i)},undoable:n.undoable})}function E0(n){return new Ut({find:n.find,handler:({state:e,range:t,match:r})=>{let o=n.replace,i=t.from;const s=t.to;if(r[1]){const l=r[0].lastIndexOf(r[1]);o+=r[0].slice(l+r[1].length),i+=l;const c=i-s;c>0&&(o=r[0].slice(l-c,l)+o,i=s)}e.tr.insertText(o,i,s)},undoable:n.undoable})}function x0(n){return new Ut({find:n.find,handler:({state:e,range:t,match:r,chain:o})=>{const i=U(n.getAttributes,void 0,r)||{},s=e.tr.delete(t.from,t.to),c=s.doc.resolve(t.from).blockRange(),d=c&&Wr(c,n.type,i);if(!d)return null;if(s.wrap(c,d),n.keepMarks&&n.editor){const{selection:f,storedMarks:h}=e,{splittableMarks:p}=n.editor.extensionManager,m=h||f.$to.parentOffset&&f.$from.marks();if(m){const A=m.filter(g=>p.includes(g.type.name));s.ensureMarks(A)}}if(n.keepAttributes){const f=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(f,i).run()}const u=s.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&Ge(s.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&s.join(t.from-1)},undoable:n.undoable})}function M0(n){return n.children}var Fl=(n,e)=>{if(n==="slot")return 0;if(n instanceof Function)return n(e);const{children:t,...r}=e??{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[n,r,t]},N0=n=>"touches"in n,Hl=class{constructor(n){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=l=>{if(!this.isResizing||!this.activeHandle)return;const c=l.clientX-this.startX,d=l.clientY-this.startY;this.handleResize(c,d)},this.handleTouchMove=l=>{if(!this.isResizing||!this.activeHandle)return;const c=l.touches[0];if(!c)return;const d=c.clientX-this.startX,u=c.clientY-this.startY;this.handleResize(d,u)},this.handleMouseUp=()=>{if(!this.isResizing)return;const l=this.element.offsetWidth,c=this.element.offsetHeight;this.onCommit(l,c),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,t,r,o,i,s;this.node=n.node,this.editor=n.editor,this.element=n.element,this.contentElement=n.contentElement,this.getPos=n.getPos,this.onResize=n.onResize,this.onCommit=n.onCommit,this.onUpdate=n.onUpdate,(e=n.options)!=null&&e.min&&(this.minSize={...this.minSize,...n.options.min}),(t=n.options)!=null&&t.max&&(this.maxSize=n.options.max),(r=n?.options)!=null&&r.directions&&(this.directions=n.options.directions),(o=n.options)!=null&&o.preserveAspectRatio&&(this.preserveAspectRatio=n.options.preserveAspectRatio),(i=n.options)!=null&&i.className&&(this.classNames={container:n.options.className.container||"",wrapper:n.options.className.wrapper||"",handle:n.options.className.handle||"",resizing:n.options.className.resizing||""}),(s=n.options)!=null&&s.createCustomHandle&&(this.createCustomHandle=n.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var n;return(n=this.contentElement)!=null?n:null}handleEditorUpdate(){const n=this.editor.isEditable;n!==this.lastEditableState&&(this.lastEditableState=n,n?n&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(n,e,t){return n.type!==this.node.type?!1:(this.node=n,this.onUpdate?this.onUpdate(n,e,t):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const n=document.createElement("div");return n.dataset.resizeContainer="",n.dataset.node=this.node.type.name,n.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(n.className=this.classNames.container),n.appendChild(this.wrapper),n}createWrapper(){const n=document.createElement("div");return n.style.position="relative",n.style.display="block",n.dataset.resizeWrapper="",this.classNames.wrapper&&(n.className=this.classNames.wrapper),n.appendChild(this.element),n}createHandle(n){const e=document.createElement("div");return e.dataset.resizeHandle=n,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(n,e){const t=e.includes("top"),r=e.includes("bottom"),o=e.includes("left"),i=e.includes("right");t&&(n.style.top="0"),r&&(n.style.bottom="0"),o&&(n.style.left="0"),i&&(n.style.right="0"),(e==="top"||e==="bottom")&&(n.style.left="0",n.style.right="0"),(e==="left"||e==="right")&&(n.style.top="0",n.style.bottom="0")}attachHandles(){this.directions.forEach(n=>{let e;this.createCustomHandle?e=this.createCustomHandle(n):e=this.createHandle(n),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${n}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(n)),this.createCustomHandle||this.positionHandle(e,n),e.addEventListener("mousedown",t=>this.handleResizeStart(t,n)),e.addEventListener("touchstart",t=>this.handleResizeStart(t,n)),this.handleMap.set(n,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(n=>n.remove()),this.handleMap.clear()}applyInitialSize(){const n=this.node.attrs.width,e=this.node.attrs.height;n?(this.element.style.width=`${n}px`,this.initialWidth=n):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(n,e){n.preventDefault(),n.stopPropagation(),this.isResizing=!0,this.activeHandle=e,N0(n)?(this.startX=n.touches[0].clientX,this.startY=n.touches[0].clientY):(this.startX=n.clientX,this.startY=n.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(n,e){if(!this.activeHandle)return;const t=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:o}=this.calculateNewDimensions(this.activeHandle,n,e),i=this.applyConstraints(r,o,t);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(n,e,t){let r=this.startWidth,o=this.startHeight;const i=n.includes("right"),s=n.includes("left"),l=n.includes("bottom"),c=n.includes("top");return i?r=this.startWidth+e:s&&(r=this.startWidth-e),l?o=this.startHeight+t:c&&(o=this.startHeight-t),(n==="right"||n==="left")&&(r=this.startWidth+(i?e:-e)),(n==="top"||n==="bottom")&&(o=this.startHeight+(l?t:-t)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,o,n):{width:r,height:o}}applyConstraints(n,e,t){var r,o,i,s;if(!t){let d=Math.max(this.minSize.width,n),u=Math.max(this.minSize.height,e);return(r=this.maxSize)!=null&&r.width&&(d=Math.min(this.maxSize.width,d)),(o=this.maxSize)!=null&&o.height&&(u=Math.min(this.maxSize.height,u)),{width:d,height:u}}let l=n,c=e;return l<this.minSize.width&&(l=this.minSize.width,c=l/this.aspectRatio),c<this.minSize.height&&(c=this.minSize.height,l=c*this.aspectRatio),(i=this.maxSize)!=null&&i.width&&l>this.maxSize.width&&(l=this.maxSize.width,c=l/this.aspectRatio),(s=this.maxSize)!=null&&s.height&&c>this.maxSize.height&&(c=this.maxSize.height,l=c*this.aspectRatio),{width:l,height:c}}applyAspectRatio(n,e,t){const r=t==="left"||t==="right",o=t==="top"||t==="bottom";return r?{width:n,height:n/this.aspectRatio}:o?{width:e*this.aspectRatio,height:e}:{width:n,height:n/this.aspectRatio}}},B0=Hl;function v0(n,e){const{selection:t}=n,{$from:r}=t;if(t instanceof I){const i=r.index();return r.parent.canReplaceWith(i,i+1,e)}let o=r.depth;for(;o>=0;){const i=r.index(o);if(r.node(o).contentMatchAt(i).matchType(e))return!0;o-=1}return!1}function T0(n){return n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function D0(n){return n.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")}function V0(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function $0(){return typeof navigator<"u"?/Firefox/.test(navigator.userAgent):!1}function O0(n){return typeof n=="string"}var Wl={};No(Wl,{createAtomBlockMarkdownSpec:()=>ql,createBlockMarkdownSpec:()=>jl,createInlineMarkdownSpec:()=>Ul,parseAttributes:()=>yr,parseIndentedBlocks:()=>_l,renderNestedMarkdownContent:()=>Ql,serializeAttributes:()=>br});function yr(n){if(!n?.trim())return{};const e={},t=[],r=n.replace(/["']([^"']*)["']/g,d=>(t.push(d),`__QUOTED_${t.length-1}__`)),o=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(o){const d=o.map(u=>u.trim().slice(1));e.class=d.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(e.id=i[1]);const s=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(s)).forEach(([,d,u])=>{var f;const h=parseInt(((f=u.match(/__QUOTED_(\d+)__/))==null?void 0:f[1])||"0",10),p=t[h];p&&(e[d]=p.slice(1,-1))});const c=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return c&&c.split(/\s+/).filter(Boolean).forEach(u=>{u.match(/^[a-zA-Z][\w-]*$/)&&(e[u]=!0)}),e}function br(n){if(!n||Object.keys(n).length===0)return"";const e=[];return n.class&&String(n.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),n.id&&e.push(`#${n.id}`),Object.entries(n).forEach(([t,r])=>{t==="class"||t==="id"||(r===!0?e.push(t):r!==!1&&r!=null&&e.push(`${t}="${String(r)}"`))}),e.join(" ")}function ql(n){const{nodeName:e,name:t,parseAttributes:r=yr,serializeAttributes:o=br,defaultAttributes:i={},requiredAttributes:s=[],allowedAttributes:l}=n,c=t||e,d=u=>{if(!l)return u;const f={};return l.forEach(h=>{h in u&&(f[h]=u[h])}),f};return{parseMarkdown:(u,f)=>{const h={...i,...u.attributes};return f.createNode(e,h,[])},markdownTokenizer:{name:e,level:"block",start(u){var f;const h=new RegExp(`^:::${c}(?:\\s|$)`,"m"),p=(f=u.match(h))==null?void 0:f.index;return p!==void 0?p:-1},tokenize(u,f,h){const p=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),m=u.match(p);if(!m)return;const A=m[1]||"",g=r(A);if(!s.find(b=>!(b in g)))return{type:e,raw:m[0],attributes:g}}},renderMarkdown:u=>{const f=d(u.attrs||{}),h=o(f),p=h?` {${h}}`:"";return`:::${c}${p} :::`}}}function jl(n){const{nodeName:e,name:t,getContent:r,parseAttributes:o=yr,serializeAttributes:i=br,defaultAttributes:s={},content:l="block",allowedAttributes:c}=n,d=t||e,u=f=>{if(!c)return f;const h={};return c.forEach(p=>{p in f&&(h[p]=f[p])}),h};return{parseMarkdown:(f,h)=>{let p;if(r){const A=r(f);p=typeof A=="string"?[{type:"text",text:A}]:A}else l==="block"?p=h.parseChildren(f.tokens||[]):p=h.parseInline(f.tokens||[]);const m={...s,...f.attributes};return h.createNode(e,m,p)},markdownTokenizer:{name:e,level:"block",start(f){var h;const p=new RegExp(`^:::${d}`,"m"),m=(h=f.match(p))==null?void 0:h.index;return m!==void 0?m:-1},tokenize(f,h,p){var m;const A=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),g=f.match(A);if(!g)return;const[y,b=""]=g,k=o(b);let E=1;const S=y.length;let x="";const D=/^:::([\w-]*)(\s.*)?/gm,P=f.slice(S);for(D.lastIndex=0;;){const R=D.exec(P);if(R===null)break;const J=R.index,Ve=R[1];if(!((m=R[2])!=null&&m.endsWith(":::"))){if(Ve)E+=1;else if(E-=1,E===0){const Me=P.slice(0,J);x=Me.trim();const H=f.slice(0,S+J+R[0].length);let G=[];if(x)if(l==="block")for(G=p.blockTokens(Me),G.forEach(N=>{N.text&&(!N.tokens||N.tokens.length===0)&&(N.tokens=p.inlineTokens(N.text))});G.length>0;){const N=G[G.length-1];if(N.type==="paragraph"&&(!N.text||N.text.trim()===""))G.pop();else break}else G=p.inlineTokens(x);return{type:e,raw:H,attributes:k,content:x,tokens:G}}}}}},renderMarkdown:(f,h)=>{const p=u(f.attrs||{}),m=i(p),A=m?` {${m}}`:"",g=h.renderChildren(f.content||[],`
|
|
91
|
-
|
|
92
|
-
`);return`:::${d}${A}
|
|
93
|
-
|
|
94
|
-
${g}
|
|
95
|
-
|
|
96
|
-
:::`}}}function I0(n){if(!n.trim())return{};const e={},t=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=t.exec(n);for(;r!==null;){const[,o,i,s]=r;e[o]=i||s,r=t.exec(n)}return e}function P0(n){return Object.entries(n).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(" ")}function Ul(n){const{nodeName:e,name:t,getContent:r,parseAttributes:o=I0,serializeAttributes:i=P0,defaultAttributes:s={},selfClosing:l=!1,allowedAttributes:c}=n,d=t||e,u=h=>{if(!c)return h;const p={};return c.forEach(m=>{const A=typeof m=="string"?m:m.name,g=typeof m=="string"?void 0:m.skipIfDefault;if(A in h){const y=h[A];if(g!==void 0&&y===g)return;p[A]=y}}),p},f=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(h,p)=>{const m={...s,...h.attributes};if(l)return p.createNode(e,m);const A=r?r(h):h.content||"";return A?p.createNode(e,m,[p.createTextNode(A)]):p.createNode(e,m,[])},markdownTokenizer:{name:e,level:"inline",start(h){const p=l?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),m=h.match(p),A=m?.index;return A!==void 0?A:-1},tokenize(h,p,m){const A=l?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),g=h.match(A);if(!g)return;let y="",b="";if(l){const[,E]=g;b=E}else{const[,E,S]=g;b=E,y=S||""}const k=o(b.trim());return{type:e,raw:g[0],content:y.trim(),attributes:k}}},renderMarkdown:h=>{let p="";r?p=r(h):h.content&&h.content.length>0&&(p=h.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const m=u(h.attrs||{}),A=i(m),g=A?` ${A}`:"";return l?`[${d}${g}]`:`[${d}${g}]${p}[/${d}]`}}}function _l(n,e,t){var r,o,i,s;const l=n.split(`
|
|
97
|
-
`),c=[];let d="",u=0;const f=e.baseIndentSize||2;for(;u<l.length;){const h=l[u],p=h.match(e.itemPattern);if(!p){if(c.length>0)break;if(h.trim()===""){u+=1,d=`${d}${h}
|
|
98
|
-
`;continue}else return}const m=e.extractItemData(p),{indentLevel:A,mainContent:g}=m;d=`${d}${h}
|
|
99
|
-
`;const y=[g];for(u+=1;u<l.length;){const S=l[u];if(S.trim()===""){const D=l.slice(u+1).findIndex(J=>J.trim()!=="");if(D===-1)break;if((((o=(r=l[u+1+D].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:o.length)||0)>A){y.push(S),d=`${d}${S}
|
|
100
|
-
`,u+=1;continue}else break}if((((s=(i=S.match(/^(\s*)/))==null?void 0:i[1])==null?void 0:s.length)||0)>A)y.push(S),d=`${d}${S}
|
|
101
|
-
`,u+=1;else break}let b;const k=y.slice(1);if(k.length>0){const S=k.map(x=>x.slice(A+f)).join(`
|
|
102
|
-
`);S.trim()&&(e.customNestedParser?b=e.customNestedParser(S):b=t.blockTokens(S))}const E=e.createToken(m,b);c.push(E)}if(c.length!==0)return{items:c,raw:d}}function Ql(n,e,t,r){if(!n||!Array.isArray(n.content))return"";const o=typeof t=="function"?t(r):t,[i,...s]=n.content,l=e.renderChildren([i]);let c=`${o}${l}`;return s&&s.length>0&&s.forEach((d,u)=>{var f,h;const p=(h=(f=e.renderChild)==null?void 0:f.call(e,d,u+1))!=null?h:e.renderChildren([d]);if(p!=null){const m=p.split(`
|
|
103
|
-
`).map(A=>A?e.indent(A):e.indent("")).join(`
|
|
104
|
-
`);c+=d.type==="paragraph"?`
|
|
105
|
-
|
|
106
|
-
${m}`:`
|
|
107
|
-
${m}`}}),c}var kr=new WeakMap;function R0(n,e){let t=kr.get(n);if(!t){const r={callbacks:new Set,rafId:null,handler:()=>{r.rafId!==null&&cancelAnimationFrame(r.rafId),r.rafId=requestAnimationFrame(()=>{r.rafId=null,r.callbacks.forEach(o=>o())})}};kr.set(n,r),n.on("update",r.handler),t=r}t.callbacks.add(e)}function L0(n,e){const t=kr.get(n);t&&(t.callbacks.delete(e),t.callbacks.size===0&&(t.rafId!==null&&cancelAnimationFrame(t.rafId),n.off("update",t.handler),kr.delete(n)))}function Ko(n,e,t={}){const{state:r}=e,{doc:o,tr:i}=r,s=n;o.descendants((l,c)=>{const d=i.mapping.map(c),u=i.mapping.map(c)+l.nodeSize;let f=null;if(l.marks.forEach(p=>{if(p!==s)return!1;f=p}),!f)return;let h=!1;if(Object.keys(t).forEach(p=>{t[p]!==f.attrs[p]&&(h=!0)}),h){const p=n.type.create({...n.attrs,...t});i.removeMark(d,u,n.type),i.addMark(d,u,p)}}),i.docChanged&&e.view.dispatch(i)}var z0=class{constructor(n,e,t){this.component=n,this.editor=e.editor,this.options={...t},this.mark=e.mark,this.HTMLAttributes=e.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(n,e){Ko(e||this.mark,this.editor,n)}ignoreMutation(n){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:n}):n.type==="selection"||this.dom.contains(n.target)&&n.type==="childList"&&(Et()||mn())&&this.editor.isFocused&&[...Array.from(n.addedNodes),...Array.from(n.removedNodes)].every(t=>t.isContentEditable)?!1:this.contentDOM===n.target&&n.type==="attributes"?!0:!this.contentDOM.contains(n.target)}},F0=class sc extends pr{constructor(){super(...arguments),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new sc(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},H0=class{constructor(n,e,t){this.isDragging=!1,this.component=n,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...t},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.innerDecorations=e.innerDecorations,this.view=e.view,this.HTMLAttributes=e.HTMLAttributes,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(n){var e,t,r,o,i,s,l;const{view:c}=this.editor,d=n.target,u=d.nodeType===3?(e=d.parentElement)==null?void 0:e.closest("[data-drag-handle]"):d.closest("[data-drag-handle]");if(!this.dom||(t=this.contentDOM)!=null&&t.contains(d)||!u)return;let f=0,h=0;if(this.dom!==u){const b=this.dom.getBoundingClientRect(),k=u.getBoundingClientRect(),E=(o=n.offsetX)!=null?o:(r=n.nativeEvent)==null?void 0:r.offsetX,S=(s=n.offsetY)!=null?s:(i=n.nativeEvent)==null?void 0:i.offsetY;f=k.x-b.x+E,h=k.y-b.y+S}const p=this.dom.cloneNode(!0);try{const b=this.dom.getBoundingClientRect();p.style.width=`${Math.round(b.width)}px`,p.style.height=`${Math.round(b.height)}px`,p.style.boxSizing="border-box",p.style.pointerEvents="none"}catch{}let m=null;try{m=document.createElement("div"),m.style.position="absolute",m.style.top="-9999px",m.style.left="-9999px",m.style.pointerEvents="none",m.appendChild(p),document.body.appendChild(m),(l=n.dataTransfer)==null||l.setDragImage(p,f,h)}finally{m&&setTimeout(()=>{try{m?.remove()}catch{}},0)}const A=this.getPos();if(typeof A!="number")return;const g=I.create(c.state.doc,A),y=c.state.tr.setSelection(g);c.dispatch(y)}stopEvent(n){var e;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:n});const t=n.target;if(!(this.dom.contains(t)&&!((e=this.contentDOM)!=null&&e.contains(t))))return!1;const o=n.type.startsWith("drag"),i=n.type==="dragover"||n.type==="dragenter",s=n.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(t.tagName)||t.isContentEditable)&&!s&&!o)return!0;const{isEditable:c}=this.editor,{isDragging:d}=this,u=!!this.node.type.spec.draggable,f=I.isSelectable(this.node),h=n.type==="copy",p=n.type==="paste",m=n.type==="cut",A=n.type==="mousedown";if(!u&&f&&o&&n.target===this.dom&&n.preventDefault(),u&&o&&!d&&n.target===this.dom)return n.preventDefault(),!1;if(u&&c&&!d&&A){const g=t.closest("[data-drag-handle]");g&&(this.dom===g||this.dom.contains(g))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(d||i||s||h||p||m||A&&f)}ignoreMutation(n){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:n}):this.node.isLeaf||this.node.isAtom?!0:n.type==="selection"||this.dom.contains(n.target)&&n.type==="childList"&&(Et()||mn())&&this.editor.isFocused&&[...Array.from(n.addedNodes),...Array.from(n.removedNodes)].every(t=>t.isContentEditable)?!1:this.contentDOM===n.target&&n.type==="attributes"?!0:!this.contentDOM.contains(n.target)}updateAttributes(n){this.editor.commands.command(({tr:e})=>{const t=this.getPos();return typeof t!="number"?!1:(e.setNodeMarkup(t,void 0,{...this.node.attrs,...n}),!0)})}deleteNode(){const n=this.getPos();if(typeof n!="number")return;const e=n+this.node.nodeSize;this.editor.commands.deleteRange({from:n,to:e})}};function Go(n){return new mr({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:o})=>{const i=U(n.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:s}=e,l=r[r.length-1],c=r[0];let d=t.to;if(l){const u=c.search(/\S/),f=t.from+c.indexOf(l),h=f+l.length;if(Ho(t.from,t.to,e.doc).filter(A=>A.mark.type.excluded.find(y=>y===n.type&&y!==A.mark.type)).filter(A=>A.to>f).length)return null;h<t.to&&s.delete(h,t.to),f>t.from&&s.delete(t.from+u,f),d=t.from+u+l.length,s.addMark(t.from+u,d,n.type.create(i||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||s.removeStoredMark(n.type)}}})}function W0(n){return new mr({find:n.find,handler({match:e,chain:t,range:r,pasteEvent:o}){const i=U(n.getAttributes,void 0,e,o),s=U(n.getContent,void 0,i);if(i===!1||i===null)return null;const l={type:n.type.name,attrs:i};s&&(l.content=s),e.input&&t().deleteRange(r).insertContentAt(r.from,l)}})}function q0(n){return new mr({find:n.find,handler:({state:e,range:t,match:r})=>{let o=n.replace,i=t.from;const s=t.to;if(r[1]){const l=r[0].lastIndexOf(r[1]);o+=r[0].slice(l+r[1].length),i+=l;const c=i-s;c>0&&(o=r[0].slice(l-c,l)+o,i=s)}e.tr.insertText(o,i,s)}})}var j0=class{constructor(n){this.transaction=n,this.currentStep=this.transaction.steps.length}map(n){let e=!1;return{position:this.transaction.steps.slice(this.currentStep).reduce((r,o)=>{const i=o.getMap().mapResult(r);return i.deleted&&(e=!0),i.pos},n),deleted:e}}};const U0=Object.freeze(Object.defineProperty({__proto__:null,CommandManager:hn,Editor:w0,Extendable:pr,Extension:De,Fragment:M0,InputRule:Ut,MappablePosition:qo,Mark:Qo,MarkView:z0,Node:F0,NodePos:Ll,NodeView:H0,PasteRule:mr,ResizableNodeView:Hl,ResizableNodeview:B0,Tracker:j0,callOrReturn:U,canInsertNode:v0,cancelPositionCheck:L0,combineTransactionSteps:rl,commands:Bo,createAtomBlockMarkdownSpec:ql,createBlockMarkdownSpec:jl,createChainableState:fn,createDocument:ir,createElement:Fl,createInlineMarkdownSpec:Ul,createMappablePosition:kl,createNodeFromContent:Ht,createStyleTag:zl,decodeHtmlEntities:D0,defaultBlockAt:ol,deleteProps:Vo,elementFromString:Ft,encodeHtmlEntities:V0,escapeForRegEx:T0,extensions:Ml,findChildren:$k,findChildrenInRange:Ok,findDuplicates:ul,findParentNode:gn,findParentNodeClosestToPos:il,flattenExtensions:sr,fromString:ll,generateHTML:Pk,generateJSON:Rk,generateText:Lk,getAttributes:hl,getAttributesFromExtensions:Io,getChangedRanges:ml,getDebugJSON:Al,getExtensionField:$,getHTMLFromFragment:yn,getMarkAttributes:$o,getMarkRange:or,getMarkType:Pe,getMarksBetween:Ho,getNodeAtPosition:Fk,getNodeAttributes:fl,getNodeType:ee,getRenderedAttributes:bn,getSchema:lr,getSchemaByResolvedExtensions:Lo,getSchemaTypeByName:jt,getSchemaTypeNameByName:An,getSplittedAttributes:kn,getText:Fo,getTextBetween:zo,getTextContentFromNodes:gl,getTextSerializersFromSchema:cr,getUpdatedPosition:bl,h:Fl,injectExtensionAttributesToParseRule:Ro,inputRulesPlugin:Cl,isActive:yl,isAndroid:mn,isAtEndOfNode:Hk,isAtStartOfNode:Wk,isEmptyObject:sl,isExtensionRulesEnabled:Wo,isFirefox:$0,isFunction:Oo,isList:ur,isMacOS:Do,isMarkActive:dr,isNodeActive:Wt,isNodeEmpty:fr,isNodeSelection:qk,isNumber:El,isPlainObject:wn,isRegExp:rr,isSafari:el,isString:O0,isTextSelection:vo,isiOS:Et,markInputRule:Jo,markPasteRule:Go,markdown:Wl,mergeAttributes:Po,mergeDeep:_o,minMax:Re,nodeInputRule:S0,nodePasteRule:W0,objectIncludes:pn,parseAttributes:yr,parseIndentedBlocks:_l,pasteRulesPlugin:xl,posToDOMRect:jk,removeDuplicates:pl,renderNestedMarkdownContent:Ql,resolveExtensions:ar,resolveFocusPosition:To,rewriteUnknownContent:Uk,schedulePositionCheck:R0,selectionToInsertionEnd:nl,serializeAttributes:br,sortExtensions:qt,splitExtensions:xt,textInputRule:E0,textPasteRule:q0,textblockTypeInputRule:C0,updateMarkViewAttributes:Ko,wrappingInputRule:x0},Symbol.toStringTag,{value:"Module"}));var Jl=(n,e)=>{if(n==="slot")return 0;if(n instanceof Function)return n(e);const{children:t,...r}=e??{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[n,r,t]},Kl=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Gl=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Yl=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Xl=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Zl=Qo.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return Jl("strong",{...Po(this.options.HTMLAttributes,n),children:Jl("slot",{})})},markdownTokenName:"strong",parseMarkdown:(n,e)=>e.applyMark("bold",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(n,e)=>`**${e.renderChildren(n)}**`,addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Jo({find:Kl,type:this.type}),Jo({find:Yl,type:this.type})]},addPasteRules(){return[Go({find:Gl,type:this.type}),Go({find:Xl,type:this.type})]}}),_0=Zl;const Q0=Object.freeze(Object.defineProperty({__proto__:null,Bold:Zl,default:_0,starInputRegex:Kl,starPasteRegex:Gl,underscoreInputRegex:Yl,underscorePasteRegex:Xl},Symbol.toStringTag,{value:"Module"}));B.Accordion=Vc,B.AccordionItem=Nc,B.AssetUploader=Hp,B.AutoSuggest=ai,B.BaseButton=ri,B.BaseCamera=wh,B.BaseCarousel=xi,B.BaseForm=DA,B.BaseHeadline=pc,B.BaseImage=ut,B.BaseInput=Nt,B.BaseMap=di,B.BaseParagraph=Ac,B.CanvasConfetti=PA,B.CheckGroup=Ju,B.ColorPalette=Ff,B.CustomHtml=ff,B.DomRenderer=Xm,B.FileUpload=hi,B.HintSystem=Pm,B.ImageCrop=Ai,B.ImageCropResize=gi,B.ImageResize=mi,B.ImageUpload=bi,B.InputCheckbox=Uc,B.InputColor=Rf,B.InputDatepicker=Fu,B.InputDatetime=Kc,B.InputDropdown=Dn,B.InputFile=Tr,B.InputPasscode=ju,B.InputPassword=si,B.InputTextarea=Hc,B.LinkSharing=vA,B.LoadingSpinner=Nn,B.LocationFinder=mm,B.LocationList=ui,B.MediaThumbnails=wm,B.ModalDialog=yi,B.PopoverDialog=Dr,B.PopoverNotifications=Ym,B.PopoverTooltip=_m,B.ProgressSteps=Tm,B.QrCode=tA,B.RadioButtons=tf,B.RadioGroup=Tn,B.RteEditor=$f,B.SelectMedia=mf,B.SortableList=pi,B.SvgIcon=O,B.TouchWrapper=OA,B.UploadGroup=ki,B.useCameraFilter=li,B.useDirections=wi,B.useGeocoding=Si,B.useGeolocation=Ei,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(C,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("dompurify"),require("vue-i18n"),require("lodash"),require("ofetch"),require("vue-advanced-cropper"),require("html2canvas"),require("qr-code-styling")):typeof define=="function"&&define.amd?define(["exports","vue","dompurify","vue-i18n","lodash","ofetch","vue-advanced-cropper","html2canvas","qr-code-styling"],e):(C=typeof globalThis<"u"?globalThis:C||self,e(C.AblokComponents={},C.Vue,C.DOMPurify,C.VueI18n,C._,C.ofetch,C.VueAdvancedCropper,C.html2canvas,C.QRCodeStyling))})(this,(function(C,e,Te,Ne,Me,pe,ut,mt,xe){"use strict";const ft={class:"icon",preserveAspectRatio:"xMaxYMin"},pt=["xlink:href"],M=e.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(d,l)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(["svg-icon",{[`svg-icon--${t.size}`]:t.size}])},[(e.openBlock(),e.createElementBlock("svg",ft,[e.createElementVNode("use",{"xlink:href":`${t.basePath}#${t.prefix}${t.symbol}`,"xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0",y:"0"},null,8,pt)]))],2))}}),gt={class:"loading-spinner d-block"},ge=e.defineComponent({__name:"loading-spinner",props:{color:{type:String,default:"#fff"}},setup(t){return(d,l)=>(e.openBlock(),e.createElementBlock("span",gt,[l[0]||(l[0]=e.createElementVNode("span",{class:"loading-spinner__animation"},[e.createElementVNode("svg",{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 100 100"},[e.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"},[e.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",dur:"1s",from:"0 50 50",to:"360 50 50",repeatCount:"indefinite"})])])],-1)),e.renderSlot(d.$slots,"default")]))}}),ht=["src","alt"],oe=e.defineComponent({__name:"base-image",props:{src:{type:String,default:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>',required:!0},alt:{type:String,default:""},spinner:{type:Boolean,default:!1},zoom:{type:Boolean,default:!1},animate:{type:Boolean,default:!0},ready:{type:Boolean,default:!1},pending:{type:Boolean,default:!1},emitPending:{type:Boolean,default:!0}},emits:["update:ready","update:pending"],setup(t,{emit:d}){const l=t,o=d,n=e.useTemplateRef("image"),a=e.ref(!1);function i(){a.value=!0,n.value?.addEventListener("transitionend",r,{once:!0})}function r(){o("update:ready",!0),l.emitPending&&o("update:pending",!1)}return e.onBeforeMount(()=>{l.emitPending&&o("update:pending",!0)}),(s,u)=>t.src?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["base-image",{"base-image--zoom":t.zoom}])},[t.spinner&&!a.value?(e.openBlock(),e.createBlock(ge,{key:0})):e.createCommentVNode("",!0),e.createElementVNode("img",{ref_key:"image",ref:n,class:e.normalizeClass(["",{"opacity-0":t.animate&&!a.value,"opacity-1":!t.animate||a.value}]),src:t.src,alt:t.alt,onLoad:i},null,42,ht)],2)):e.createCommentVNode("",!0)}}),yt=["innerHTML"],bt=e.defineComponent({__name:"base-headline",props:{tag:{},size:{},variant:{},text:{},className:{}},setup(t){const d=t,l=e.computed(()=>d.tag||"p");return(o,n)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{class:e.normalizeClass(["headline",`${t.size} headline--${t.size}${t.className||""}`])},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default",{},()=>[e.createElementVNode("span",{class:"headline__text",innerHTML:t.text},null,8,yt)])]),_:3},8,["class"]))}});function he(t){return e.computed(()=>{const d=typeof t=="function"?t():typeof t=="string"?t:t.value;return Te.sanitize(d,{ALLOWED_TAGS:["b","i","em","strong","u","span","p","br","a","ul","ol","li","h1","h2","h3","h4","h5","h6","article","div","label"],ALLOWED_ATTR:["class","id","href","target","rel","title","data-countdown"],ALLOW_DATA_ATTR:!0})})}function F(t){return Te.sanitize(t,{ALLOWED_TAGS:["b","i","em","strong","u","span","p","br","a","ul","ol","li","h1","h2","h3","h4","h5","h6","article","div","label"],ALLOWED_ATTR:["class","id","href","target","rel","title","data-countdown","v-modal"],ALLOW_DATA_ATTR:!0})}const kt=["innerHTML"],wt=e.defineComponent({__name:"base-paragraph",props:{size:{},variant:{},text:{},className:{}},setup(t){const d=t;return he(()=>d.text||""),(l,o)=>(e.openBlock(),e.createElementBlock("p",{class:e.normalizeClass(["base-paragraph",`${t.size||""} ${t.className||""}`]),innerHTML:t.text},null,10,kt))}});function I(){return Math.random().toString(16).slice(2)}async function ye(t){return await new Promise(d=>{let l=new FileReader;l.onload=()=>d(l.result),l.readAsDataURL(t)})}function Bt(t){const d=atob(t.split(",")[1]),l=new ArrayBuffer(d.length),o=new Uint8Array(l);for(let n=0;n<d.length;n++)o[n]=d.charCodeAt(n);return new Blob([l],{type:"image/png"})}function Ct(t){return{"image/jpeg":"jpg","image/jpg":"jpg","image/png":"png","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","application/pdf":"pdf","video/mp4":"mp4","video/webm":"webm","video/ogg":"ogg"}[t]||"bin"}async function ze(t,d,l){const o=Ct(l),a=d.includes(".")?d:`${d}.${o}`;return fetch(t).then(function(i){return i.arrayBuffer()}).then(function(i){return new File([i],a,{type:l})})}async function Vt(t){return await new Promise((d,l)=>{const o=new Image;o.onload=()=>d(o),o.onerror=n=>l(n),o.src=t})}function Re(t,d,l,o="image/png",n){const a=document.createElement("canvas");a.width=d,a.height=l;const i=a.getContext("2d");return i?(i.drawImage(t,0,0,d,l),a.toDataURL(o,n)):t.src}async function Et(t,d,l){const o=(t.type||"").toLowerCase();if(!(o.startsWith("image/")&&o!=="image/svg+xml"))return t;const a=await ye(t),i=await Vt(a),r=i.naturalWidth,s=i.naturalHeight;if(!r||r<=d)return t;const u=Math.round(d),c=s/r,A=Math.round(u*c),m=Re(i,u,A,t.type||"image/png",l);return await ze(m,t.name,t.type||"image/png")}function Qe(t){return!t||typeof t!="string"?"":t.replace(/\0/g,"").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/on\w+\s*=\s*["'][^"']*["']/gi,"").replace(/on\w+\s*=\s*[^\s>]*/gi,"").replace(/javascript:/gi,"").replace(/data:text\/html/gi,"")}const $t={class:"accordion-item"},St=["id"],Nt=["data-bs-target","aria-controls"],Mt={class:"flex-grow-1"},Dt=["id","aria-labelledby","data-bs-parent"],vt=["innerHTML"],Lt=e.defineComponent({__name:"accordion-item",props:{id:{type:String,default:()=>I()},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:""},noPadding:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:d}){const l=t,o=d,n=he(()=>l.body);function a(){o("update:modelValue",!l.modelValue)}return(i,r)=>(e.openBlock(),e.createElementBlock("div",$t,[e.createElementVNode("div",{class:"accordion-header",id:`heading-${t.id}`},[e.createElementVNode("button",{class:e.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:a},[e.renderSlot(i.$slots,"toggle",{},()=>[e.createElementVNode("span",Mt,e.toDisplayString(t.title),1)])],10,Nt)],8,St),e.createElementVNode("div",{class:e.normalizeClass(["accordion-collapse collapse",t.modelValue&&"show"]),id:`target${t.id}`,"aria-labelledby":`heading${t.id}`,"data-bs-parent":t.parent},[e.createElementVNode("div",{class:e.normalizeClass(["accordion-body",t.noPadding?"p-0":""])},[e.renderSlot(i.$slots,"body",{},()=>[e.createElementVNode("article",{innerHTML:e.unref(n)},null,8,vt)])],2)],10,Dt)]))}}),It=(t,d)=>{const l=t.__vccOpts||t;for(const[o,n]of d)l[o]=n;return l},Pt={},Tt={class:"accordion"};function xt(t,d){return e.openBlock(),e.createElementBlock("div",Tt,[e.renderSlot(t.$slots,"default")])}const zt=It(Pt,[["render",xt]]),Rt=["type","disabled"],Fe=e.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:!1},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 d=t,l=e.computed(()=>d.caption&&!d.circle);return(o,n)=>(e.openBlock(),e.createElementBlock("button",{type:t.type,disabled:t.disabled,class:e.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,"btn-lg":t.size==="large","btn-sm":t.size==="small"}])},[t.pending?e.renderSlot(o.$slots,"pending-icon",{key:0},()=>[e.createVNode(ge)]):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default",{},()=>[t.icon?(e.openBlock(),e.createBlock(M,{key:0,symbol:t.icon,class:"base-button__caption"},null,8,["symbol"])):e.createCommentVNode("",!0),l.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["base-button__caption",{"icon-padding":t.icon}])},e.toDisplayString(t.caption),3)):e.createCommentVNode("",!0)])],10,Rt))}}),Qt={class:"input-group input__input-group"},Ft=["type","id","name","placeholder","pattern","disabled","readonly","required","maxlength","true-value","false-value","aria-label","role","autocomplete"],Ot=["for","innerHTML"],Ht={key:0,class:"input__error alert alert-danger mt-3"},Ae=e.defineComponent({__name:"base-input",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},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},min:{type:Number},max:{type:Number},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"},validate:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},sanitize:{type:Boolean,default:!0}},emits:["update:modelValue","update:valid"],setup(t,{emit:d}){const l=t,o=d,n=e.useTemplateRef("input"),a=e.ref(l.valid),i=e.ref(),r=e.computed(()=>F(`${l.label}${l.required?" *":""}`)),s=e.computed({get(){return l.modelValue},set(A){A=l.type==="number"?l.max&&Number(A)>l.max?l.max:l.min!==void 0&&Number(A)<l.min?l.min:Number(A):A,l.sanitize&&typeof A=="string"&&!["checkbox","radio","number","date","datetime-local","time","month","week","email","tel","url"].includes(l.type)&&(A=Qe(A)),o("update:modelValue",A)}}),u=e.computed(()=>{if(l.type==="number"){const{min:A,max:m}=l;return{...A!==void 0?{min:A}:{},...m!==void 0?{max:m}:{}}}return{}});function c(){l.validate&&n.value&&(a.value=n.value.checkValidity(),a.value?i.value=void 0:i.value=n.value.validationMessage,o("update:valid",a.value))}return e.watch(()=>l.modelValue,()=>{a.value===!1&&c()}),e.onMounted(()=>{let A=m=>{s.value=typeof m.detail=="string"||typeof m.detail=="number"?`${m.detail}`:""};n.value?.addEventListener("focusin",m=>{window.addEventListener("update-focussed-input",A)}),n.value?.addEventListener("focusout",m=>{window.removeEventListener("update-focussed-input",A)}),c()}),(A,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input",`input--${t.type}${a.value?"":" input--invalid"}`])},[e.createElementVNode("div",Qt,[e.renderSlot(A.$slots,"input-prepend",{slotScope:"props"}),e.withDirectives(e.createElementVNode("input",e.mergeProps({ref_key:"input",ref:n,"onUpdate:modelValue":m[0]||(m[0]=f=>s.value=f),type:t.type==="color"?"text":t.type,id:t.id,name:t.name,placeholder:t.placeholder,pattern:t.pattern,disabled:t.disabled,readonly:t.readOnly,required:t.required,maxlength:t.maxlength},u.value,{"true-value":t.trueValue,"false-value":t.falseValue,class:["form-control",{"form-check-input":t.type==="checkbox"}],"aria-label":t.label,role:t.role,autocomplete:t.autocomplete,onChange:c}),null,16,Ft),[[e.vModelDynamic,s.value]]),e.renderSlot(A.$slots,"input-append",{slotScope:"props"})]),e.renderSlot(A.$slots,"label",{},()=>[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:e.normalizeClass(["input__label",{"form-check-label":t.type==="checkbox"}]),innerHTML:r.value},null,10,Ot)):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!a.value&&i.value?(e.openBlock(),e.createElementBlock("div",Ht,e.toDisplayString(i.value),1)):e.createCommentVNode("",!0)]),_:1})],2))}}),Wt={class:"input input--textarea"},Ut=["type","id","name","placeholder","pattern","disabled","read-only","required","maxlength","aria-label"],qt=["for","innerHTML"],jt=e.defineComponent({__name:"input-textarea",props:{modelValue:{type:String,default:""},type:{type:String,default:"text"},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},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},sanitize:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:d}){const l=t,o=d,n=e.computed({get(){return l.modelValue},set(a){l.sanitize&&typeof a=="string"&&(a=Qe(a)),o("update:modelValue",a)}});return(a,i)=>(e.openBlock(),e.createElementBlock("div",Wt,[e.renderSlot(a.$slots,"input-prepend"),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r),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:e.normalizeClass(["form-control",{}]),"aria-label":t.label},null,8,Ut),[[e.vModelText,n.value]]),e.renderSlot(a.$slots,"input-append"),e.renderSlot(a.$slots,"label",{},()=>[e.createElementVNode("label",{for:t.id,class:e.normalizeClass(["input__label",{"form-check-label":t.type==="checkbox"}]),innerHTML:`${t.label}${t.required?" *":""}`},null,10,qt)])]))}}),Jt={class:"form-check input input--checkbox"},_t=["value","id","name","required","disabled","true-value","false-value"],Gt=["for","innerHTML"],Yt=e.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:d}){const l=t,o=d,n=e.computed({get(){return l.modelValue||l.checked},set(a){o("update:checked",a),o("update:modelValue",a)}});return(a,i)=>(e.openBlock(),e.createElementBlock("div",Jt,[e.withDirectives(e.createElementVNode("input",{ref:"input","onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r),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,_t),[[e.vModelCheckbox,n.value]]),e.createElementVNode("label",{class:"input__label form-check-label",for:t.id,innerHTML:e.unref(F)(t.label||"")},null,8,Gt)]))}}),Kt={class:"input-group input__input-group"},Zt=["id","name","placeholder","pattern","disabled","read-only","required","aria-label"],Xt=["for","innerHTML"],ea=e.defineComponent({__name:"input-datetime",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},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}},emits:["update:modelValue"],setup(t,{emit:d}){const l=t,o=d,n=e.computed({get(){const a=l.modelValue&&new Date(`${l.modelValue}Z`),i=a&&new Date(a.getTime()+new Date().getTimezoneOffset()*-60*1e3).toISOString();return i&&i.replace("Z","")},set(a){const i=a&&new Date(a);a=i&&i.toISOString(),o("update:modelValue",a&&a.replace("Z",""))}});return(a,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input",`input--${t.type}`])},[e.createElementVNode("div",Kt,[e.renderSlot(a.$slots,"input-prepend",{slotScope:"props"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r),type:"datetime-local",id:t.id,name:t.name,placeholder:t.placeholder,pattern:t.pattern,disabled:t.disabled,"read-only":t.readOnly,required:t.required,class:"form-control","aria-label":t.label},null,8,Zt),[[e.vModelText,n.value]]),e.renderSlot(a.$slots,"input-append",{slotScope:"props"})]),e.renderSlot(a.$slots,"label",{},()=>[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:"input__label",innerHTML:e.unref(F)(`${t.label}${t.required?" *":""}`)},null,8,Xt)):e.createCommentVNode("",!0)])],2))}});function Z(t){return(d={})=>{const l=d.width?String(d.width):t.defaultWidth;return t.formats[l]||t.formats[t.defaultWidth]}}function O(t){return(d,l)=>{const o=l?.context?String(l.context):"standalone";let n;if(o==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,r=l?.width?String(l.width):i;n=t.formattingValues[r]||t.formattingValues[i]}else{const i=t.defaultWidth,r=l?.width?String(l.width):t.defaultWidth;n=t.values[r]||t.values[i]}const a=t.argumentCallback?t.argumentCallback(d):d;return n[a]}}function H(t){return(d,l={})=>{const o=l.width,n=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],a=d.match(n);if(!a)return null;const i=a[0],r=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],s=Array.isArray(r)?aa(r,A=>A.test(i)):ta(r,A=>A.test(i));let u;u=t.valueCallback?t.valueCallback(s):s,u=l.valueCallback?l.valueCallback(u):u;const c=d.slice(i.length);return{value:u,rest:c}}}function ta(t,d){for(const l in t)if(Object.prototype.hasOwnProperty.call(t,l)&&d(t[l]))return l}function aa(t,d){for(let l=0;l<t.length;l++)if(d(t[l]))return l}function De(t){return(d,l={})=>{const o=d.match(t.matchPattern);if(!o)return null;const n=o[0],a=d.match(t.parsePattern);if(!a)return null;let i=t.valueCallback?t.valueCallback(a[0]):a[0];i=l.valueCallback?l.valueCallback(i):i;const r=d.slice(n.length);return{value:i,rest:r}}}const Oe={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},na=(t,d,l)=>{let o;const n=l?.addSuffix?Oe[t].withPreposition:Oe[t].standalone;return typeof n=="string"?o=n:d===1?o=n.one:o=n.other.replace("{{count}}",String(d)),l?.addSuffix?l.comparison&&l.comparison>0?"in "+o:"vor "+o:o},la={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},oa={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},ia={full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},ra={date:Z({formats:la,defaultWidth:"full"}),time:Z({formats:oa,defaultWidth:"full"}),dateTime:Z({formats:ia,defaultWidth:"full"})},Aa={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},sa=(t,d,l,o)=>Aa[t],ca={narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},da={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},ve={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},ua={narrow:ve.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:ve.wide},ma={narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},fa={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},pa={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},ga={ordinalNumber:t=>Number(t)+".",era:O({values:ca,defaultWidth:"wide"}),quarter:O({values:da,defaultWidth:"wide",argumentCallback:t=>t-1}),month:O({values:ve,formattingValues:ua,defaultWidth:"wide"}),day:O({values:ma,defaultWidth:"wide"}),dayPeriod:O({values:fa,defaultWidth:"wide",formattingValues:pa,defaultFormattingWidth:"wide"})},ha=/^(\d+)(\.)?/i,ya=/\d+/i,ba={narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},ka={any:[/^v/i,/^n/i]},wa={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},Ba={any:[/1/i,/2/i,/3/i,/4/i]},Ca={narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},Va={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ea={narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},$a={any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},Sa={narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},Na={any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},Ma={ordinalNumber:De({matchPattern:ha,parsePattern:ya,valueCallback:t=>parseInt(t)}),era:H({matchPatterns:ba,defaultMatchWidth:"wide",parsePatterns:ka,defaultParseWidth:"any"}),quarter:H({matchPatterns:wa,defaultMatchWidth:"wide",parsePatterns:Ba,defaultParseWidth:"any",valueCallback:t=>t+1}),month:H({matchPatterns:Ca,defaultMatchWidth:"wide",parsePatterns:Va,defaultParseWidth:"any"}),day:H({matchPatterns:Ea,defaultMatchWidth:"wide",parsePatterns:$a,defaultParseWidth:"any"}),dayPeriod:H({matchPatterns:Sa,defaultMatchWidth:"wide",parsePatterns:Na,defaultParseWidth:"any"})},Da={code:"de",formatDistance:na,formatLong:ra,formatRelative:sa,localize:ga,match:Ma,options:{weekStartsOn:1,firstWeekContainsDate:4}},va={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},La=(t,d,l)=>{let o;const n=va[t];return typeof n=="string"?o=n:d===1?o=n.one:o=n.other.replace("{{count}}",d.toString()),l?.addSuffix?l.comparison&&l.comparison>0?"in "+o:o+" ago":o},Ia={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Pa=(t,d,l,o)=>Ia[t],Ta={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},xa={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},za={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ra={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Qa={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Fa={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Oa={ordinalNumber:(t,d)=>{const l=Number(t),o=l%100;if(o>20||o<10)switch(o%10){case 1:return l+"st";case 2:return l+"nd";case 3:return l+"rd"}return l+"th"},era:O({values:Ta,defaultWidth:"wide"}),quarter:O({values:xa,defaultWidth:"wide",argumentCallback:t=>t-1}),month:O({values:za,defaultWidth:"wide"}),day:O({values:Ra,defaultWidth:"wide"}),dayPeriod:O({values:Qa,defaultWidth:"wide",formattingValues:Fa,defaultFormattingWidth:"wide"})},Ha=/^(\d+)(th|st|nd|rd)?/i,Wa=/\d+/i,Ua={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},qa={any:[/^b/i,/^(a|c)/i]},ja={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ja={any:[/1/i,/2/i,/3/i,/4/i]},_a={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ga={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ya={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ka={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Za={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Xa={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},en={ordinalNumber:De({matchPattern:Ha,parsePattern:Wa,valueCallback:t=>parseInt(t,10)}),era:H({matchPatterns:Ua,defaultMatchWidth:"wide",parsePatterns:qa,defaultParseWidth:"any"}),quarter:H({matchPatterns:ja,defaultMatchWidth:"wide",parsePatterns:Ja,defaultParseWidth:"any",valueCallback:t=>t+1}),month:H({matchPatterns:_a,defaultMatchWidth:"wide",parsePatterns:Ga,defaultParseWidth:"any"}),day:H({matchPatterns:Ya,defaultMatchWidth:"wide",parsePatterns:Ka,defaultParseWidth:"any"}),dayPeriod:H({matchPatterns:Za,defaultMatchWidth:"any",parsePatterns:Xa,defaultParseWidth:"any"})},tn={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},an={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},nn={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ln={date:Z({formats:tn,defaultWidth:"full"}),time:Z({formats:an,defaultWidth:"full"}),dateTime:Z({formats:nn,defaultWidth:"full"})},He={code:"en-US",formatDistance:La,formatLong:ln,formatRelative:Pa,localize:Oa,match:en,options:{weekStartsOn:0,firstWeekContainsDate:1}},on={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},rn=(t,d,l)=>{let o;const n=on[t];return typeof n=="string"?o=n:d===1?o=n.one:o=n.other.replace("{{count}}",String(d)),l?.addSuffix?l.comparison&&l.comparison>0?"dans "+o:"il y a "+o:o},An={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},sn={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},cn={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dn={date:Z({formats:An,defaultWidth:"full"}),time:Z({formats:sn,defaultWidth:"full"}),dateTime:Z({formats:cn,defaultWidth:"full"})},un={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},mn=(t,d,l,o)=>un[t],fn={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},pn={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},gn={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},hn={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},yn={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},bn=(t,d)=>{const l=Number(t),o=d?.unit;if(l===0)return"0";const n=["year","week","hour","minute","second"];let a;return l===1?a=o&&n.includes(o)?"ère":"er":a="ème",l+a},kn=["MMM","MMMM"],wn={preprocessor:(t,d)=>t.getDate()===1||!d.some(o=>o.isToken&&kn.includes(o.value))?d:d.map(o=>o.isToken&&o.value==="do"?{isToken:!0,value:"d"}:o),ordinalNumber:bn,era:O({values:fn,defaultWidth:"wide"}),quarter:O({values:pn,defaultWidth:"wide",argumentCallback:t=>t-1}),month:O({values:gn,defaultWidth:"wide"}),day:O({values:hn,defaultWidth:"wide"}),dayPeriod:O({values:yn,defaultWidth:"wide"})},Bn=/^(\d+)(ième|ère|ème|er|e)?/i,Cn=/\d+/i,Vn={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},En={any:[/^av/i,/^ap/i]},$n={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},Sn={any:[/1/i,/2/i,/3/i,/4/i]},Nn={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},Mn={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},Dn={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},vn={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},Ln={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},In={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},Pn={ordinalNumber:De({matchPattern:Bn,parsePattern:Cn,valueCallback:t=>parseInt(t)}),era:H({matchPatterns:Vn,defaultMatchWidth:"wide",parsePatterns:En,defaultParseWidth:"any"}),quarter:H({matchPatterns:$n,defaultMatchWidth:"wide",parsePatterns:Sn,defaultParseWidth:"any",valueCallback:t=>t+1}),month:H({matchPatterns:Nn,defaultMatchWidth:"wide",parsePatterns:Mn,defaultParseWidth:"any"}),day:H({matchPatterns:Dn,defaultMatchWidth:"wide",parsePatterns:vn,defaultParseWidth:"any"}),dayPeriod:H({matchPatterns:Ln,defaultMatchWidth:"any",parsePatterns:In,defaultParseWidth:"any"})},Tn={code:"fr",formatDistance:rn,formatLong:dn,formatRelative:mn,localize:wn,match:Pn,options:{weekStartsOn:1,firstWeekContainsDate:4}},xn={class:"row"},zn={class:"col-12"},Rn=["for","innerHTML"],Qn={key:0},Fn={class:"input-group justify-content-center"},On={key:0,class:"row"},Hn={class:"col-12 col-md-6"},Wn={class:"col-12 col-md-6"},Un={key:1,class:"row"},qn={class:"col-12"},jn=e.defineComponent({__name:"input-datepicker",props:{modelValue:{type:null,default:""},from:{type:[String,Number,Boolean,Date],default:""},to:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"datetime-local"},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},label:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},range:{type:Boolean,default:!1},textRange:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},textInput:{type:Boolean,default:!0},picker:{type:Boolean,default:!0},locale:{type:String,default:"en"},utcStore:{type:Boolean,default:!1}},emits:["update:modelValue","update:from","update:to"],setup(t,{emit:d}){const l=e.shallowRef(null);e.onMounted(async()=>{const{VueDatePicker:y}=await import("@vuepic/vue-datepicker");l.value=y});const o=t,n=d,{t:a,locale:i}=Ne.useI18n(),r={en:He,de:Da,fr:Tn},s=e.computed(()=>{const y=o.locale||i.value;return r[y]||He}),u=e.computed(()=>o.inline||!o.picker?{openMenu:!1,format:s.value}:!0),c=e.computed({get(){if(o.range){let y=o.from||(Array.isArray(o.modelValue)?o.modelValue[0]:null),g=o.to||(Array.isArray(o.modelValue)?o.modelValue[1]:null);return o.utcStore?(y=y?h(y):null,g=g?h(g):null):(y=y?new Date(`${y}Z`).toISOString().replace("Z",""):null,g=g?new Date(`${g}Z`).toISOString().replace("Z",""):null),[...y?[y]:[],...g?[g]:[]]}else{if(o.utcStore){const w=o.modelValue;return w&&h(w)||""}const y=o.modelValue?new Date(`${o.modelValue}Z`):null,g=y&&y.toISOString();return g&&g.replace("Z","")}},set(y){if(o.range&&Array.isArray(y)){let[g,w]=y;o.utcStore?(g=b(g)||null,w=b(w)||null):(g=g&&new Date(g),g?.setUTCHours(g.getHours()),g=g?.toISOString()?.replace("Z",""),w=w&&new Date(w),w?.setUTCHours(w.getHours()),w=w?.toISOString()?.replace("Z","")),n("update:modelValue",[g,w]),n("update:from",g),n("update:to",w)}else if(o.utcStore){const g=b(y);n("update:modelValue",g)}else{const g=y&&new Date(y);g?.setUTCHours(g?.getHours()),y=g&&g.toISOString(),n("update:modelValue",y&&y.replace("Z",""))}}}),A=e.computed({get(){return Array.isArray(c.value)?c.value[0]:c.value},set(y){c.value=Array.isArray(c.value)?[y,c.value[0]]:y}}),m=e.computed({get(){return Array.isArray(c.value)?c.value[1]:c.value},set(y){c.value=Array.isArray(c.value)?[c.value[0],y]:y}});e.watch(()=>[A.value,m.value],(y,g)=>{o.range&&y.some(w=>w===void 0)&&g.every(Boolean)&&(c.value=[])});function f(y){if(!y)return;const g=y.getDate(),w=y.getMonth()+1,D=y.getFullYear(),B=y.getMinutes(),$=y.getHours();switch(s.value){case"de":return`${g}.${w}.${D} ${$<10?"0"+$:$}:${B<10?"0"+B:B}`;case"fr":return`${g}/${w}/${D} ${$<10?"0"+$:$}:${B<10?"0"+B:B}`;default:return`${w}/${g}/${D} ${$<10?"0"+$:$}:${B<10?"0"+B:B}`}}function h(y){if(!y)return null;const g=y instanceof Date?new Date(y):new Date(`${y}Z`),w=g.getFullYear(),D=String(g.getMonth()+1).padStart(2,"0"),B=String(g.getDate()).padStart(2,"0"),$=String(g.getHours()).padStart(2,"0"),q=String(g.getMinutes()).padStart(2,"0"),X=String(g.getSeconds()).padStart(2,"0");return`${w}-${D}-${B}T${$}:${q}:${X}`}function b(y){return y?(y instanceof Date?new Date(y):new Date(String(y))).toISOString().split(".")[0]:null}const N=y=>(Array.isArray(y)?y=y.map(g=>f(g)).join(" - "):y=f(y),y);return(y,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input","input--datepicker"])},[e.renderSlot(y.$slots,"label",{},()=>[e.createElementVNode("div",xn,[e.createElementVNode("div",zn,[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id,class:"input__label",innerHTML:e.unref(F)(`${t.label}${t.required?" *":""}`)},null,8,Rn)):e.createCommentVNode("",!0)])])]),t.textInput?(e.openBlock(),e.createElementBlock("div",Qn,[e.createElementVNode("div",Fn,[e.renderSlot(y.$slots,"input-prepend",{slotScope:"props"}),t.range&&!t.textRange?(e.openBlock(),e.createElementBlock("div",On,[e.createElementVNode("div",Hn,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{uid:`${t.id}-from`,modelValue:A.value,"onUpdate:modelValue":g[0]||(g[0]=w=>A.value=w),locale:s.value,format:N,"text-input":u.value,disabled:t.disabled,"read-only":t.readOnly,required:t.required,"auto-apply":!0},null,8,["uid","modelValue","locale","text-input","disabled","read-only","required"]))]),e.createElementVNode("div",Wn,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{uid:`${t.id}-to`,modelValue:m.value,"onUpdate:modelValue":g[1]||(g[1]=w=>m.value=w),locale:s.value,format:N,"text-input":u.value,disabled:t.disabled,"read-only":t.readOnly,required:t.required,"auto-apply":!0},null,8,["uid","modelValue","locale","text-input","disabled","read-only","required"]))])])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{key:1,uid:`${t.id}-input-to`,modelValue:c.value,"onUpdate:modelValue":g[2]||(g[2]=w=>c.value=w),format:N,locale:s.value,range:t.textRange,"text-input":u.value,disabled:t.disabled,"read-only":t.readOnly,required:t.required,"auto-apply":!0},null,8,["uid","modelValue","locale","range","text-input","disabled","read-only","required"])),e.renderSlot(y.$slots,"input-append",{slotScope:"props"})])])):e.createCommentVNode("",!0),t.inline?(e.openBlock(),e.createElementBlock("div",Un,[e.createElementVNode("div",qn,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{uid:`${t.id}-inline`,modelValue:c.value,"onUpdate:modelValue":g[3]||(g[3]=w=>c.value=w),locale:s.value,cancelText:"abbrechen",selectText:"auswählen",range:t.range,"multi-calendars":t.range,inline:{input:!1},"auto-apply":!0,"partial-range":t.range,"partial-flow":!0,"start-time":{hours:0,minutes:0},class:"justify-content-center",disabled:t.disabled,"read-only":t.readOnly,required:t.required,"month-name-format":"long"},null,8,["uid","modelValue","locale","range","multi-calendars","partial-range","disabled","read-only","required"]))])])):e.createCommentVNode("",!0)]))}}),Jn={class:"input-group input__input-group"},We=e.defineComponent({__name:"input-password",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},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},role:{type:String,default:"presentation"},autocomplete:{type:String,default:"off"},password:{type:String,default:""},confirm:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:d}){const l=t,o=d,n=e.computed({get(){return l.modelValue},set(a){l.password===a||!l.password?o("update:modelValue",a):o("update:modelValue","")}});return(a,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input","input-password"])},[e.createElementVNode("div",Jn,[e.createVNode(Ae,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r),type:"password",placeholder:t.placeholder,disabled:t.disabled,readonly:t.readOnly,required:t.required,label:t.label},{"input-prepend":e.withCtx(r=>[e.renderSlot(a.$slots,"input-prepend",{slotScope:"props"})]),"input-append":e.withCtx(r=>[e.renderSlot(a.$slots,"input-append",{slotScope:"props"},()=>[t.confirm&&t.modelValue===t.password?(e.openBlock(),e.createBlock(M,{key:0,symbol:"check",class:"ms-2"})):e.createCommentVNode("",!0)])]),_:3},8,["modelValue","placeholder","disabled","readonly","required","label"])])]))}}),_n={class:"input-group input__input-group"},Gn=["onUpdate:modelValue","disabled","readonly","onPaste","onInput","onKeydown"],Yn=e.defineComponent({__name:"input-passcode",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},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},role:{type:String,default:"presentation"},autocomplete:{type:String,default:"off"},passcodeMatch:{type:String,default:""},confirm:{type:Boolean,default:!1},splitInput:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:d}){const l=e.ref([]),o=e.ref([]),n=t,a=d,i=e.computed({get(){return n.modelValue},set(c){n.passcodeMatch===c||!n.passcodeMatch?a("update:modelValue",c):a("update:modelValue","")}});e.watch(()=>n.modelValue,c=>{const A=c?.toString()||"";for(o.value=A.split("").slice(0,n.passcodeMatch?.length||6);o.value.length<(n.passcodeMatch?.length||6);)o.value.push("")},{immediate:!0}),e.watch(()=>o.value,c=>{const A=c.join("");n.passcodeMatch===A||!n.passcodeMatch?a("update:modelValue",A):a("update:modelValue","")},{deep:!0});const r=(c,A)=>{c.preventDefault();const m=c.clipboardData?.getData("text")||"";console.log("Paste detected:",m);const f=m.split(""),h=n.passcodeMatch?.length||6;f.forEach((N,y)=>{const g=A+y;g<h&&(o.value[g]=N)});const b=Math.min(A+f.length,h-1);setTimeout(()=>l.value[b]?.focus(),0)},s=(c,A)=>{n.passcodeMatch?.length,c.key==="Backspace"&&!o.value[A]&&A>0&&l.value[A-1]?.focus()},u=(c,A)=>{let f=c.target.value;f.length>1&&(f=f.slice(-1)),o.value[A]=f;const h=n.passcodeMatch?.length||6;f&&A<h-1&&setTimeout(()=>l.value[A+1]?.focus(),0)};return(c,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input","input-passcode"])},[e.createElementVNode("div",_n,[t.splitInput?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.passcodeMatch,(m,f)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:f,"onUpdate:modelValue":h=>o.value[f]=h,type:"text",ref_for:!0,ref:h=>l.value[f]=h,maxlength:1,disabled:t.disabled,readonly:t.readOnly,onPaste:h=>r(h,f),onInput:h=>u(h,f),onKeydown:h=>s(h,f),size:"1",class:"form-control text-center"},null,40,Gn)),[[e.vModelText,o.value[f]]])),128)):(e.openBlock(),e.createBlock(We,{key:0,modelValue:i.value,"onUpdate:modelValue":A[0]||(A[0]=m=>i.value=m),type:t.type,placeholder:t.placeholder,disabled:t.disabled,readonly:t.readOnly,required:t.required,label:t.label},null,8,["modelValue","type","placeholder","disabled","readonly","required","label"]))])]))}}),Kn={class:"check-group"},Zn=["id","name","value","disabled","read-only","required"],Xn=["for","innerHTML"],el=e.defineComponent({__name:"check-group",props:{modelValue:{type:null,default:()=>[]},options:{type:Array,required:!0},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},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:d}){const l=t,o=d;e.ref([]);const n=e.computed({get(){return l.modelValue},set(i){o("update:modelValue",i)}}),a=e.computed(()=>l.options&&l.options.map(i=>(i=typeof i=="string"?{text:i,value:i}:i,{...i,active:l.modelValue&&l.modelValue.includes(i.value)})));return(i,r)=>(e.openBlock(),e.createElementBlock("div",Kn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(s,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"form-check"},[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":r[0]||(r[0]=c=>n.value=c),id:`${t.id}-${u}`,name:t.name,class:"form-check-input",value:s.value||s,disabled:t.disabled,"read-only":t.readOnly,required:t.required},null,8,Zn),[[e.vModelCheckbox,n.value]]),e.createElementVNode("label",{class:"form-check-label",for:`${t.id}-${u}`,innerHTML:s.text},null,8,Xn)]))),128))]))}}),tl={class:"input radio-group"},al=["id","name","value","checked","disabled","read-only","required","onChange"],nl=["for","innerHTML"],ll=["for"],be=e.defineComponent({__name:"radio-group",props:{modelValue:{type:null},options:{type:Array,default:[]},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},label:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},keyOption:{type:null},itemClass:{type:String,default:""}},emits:["change","update:modelValue"],setup(t,{emit:d}){const l=d;function o(n){l("update:modelValue",n)}return(n,a)=>(e.openBlock(),e.createElementBlock("div",tl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,(i,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:e.normalizeClass(["form-check",t.itemClass])},[e.createElementVNode("input",{type:"radio",id:`${t.id}-${r}`,name:t.name,class:e.normalizeClass(["form-check-input",`
|
|
2
|
+
${r===t.keyOption||i.key?"form-check-input--key":""}
|
|
3
|
+
${(r===t.keyOption||i.key)&&i.value===t.modelValue?.value?"form-check-input--match":""}
|
|
4
|
+
`]),value:i.value||i,checked:i.value?i.value===t.modelValue?.value:i===t.modelValue,disabled:t.disabled,"read-only":t.readOnly,required:t.required,onChange:s=>o(i)},null,42,al),e.renderSlot(n.$slots,"option-label",{option:i,index:r},()=>[e.createElementVNode("label",{class:"form-check-label",for:`${t.id}-${r}`,innerHTML:e.unref(F)(i.text||"")},null,8,nl)])],2))),128)),e.renderSlot(n.$slots,"label",{},()=>[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:t.id},e.toDisplayString(t.label),9,ll)):e.createCommentVNode("",!0)])]))}}),ol={class:"radio-buttons"},il=["for"],rl=e.defineComponent({__name:"radio-buttons",props:{modelValue:{type:null,default:""},options:{type:Array,default:[]},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},label:{type:String},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},keyOption:{type:null},itemClass:{type:String,default:""}},emits:["update:modelValue","update:selection"],setup(t,{emit:d}){const l=t,o=d,n=e.computed({get(){return l.modelValue},set(a){o("update:modelValue",a)}});return(a,i)=>(e.openBlock(),e.createElementBlock("div",ol,[e.createVNode(be,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r),options:t.options,name:t.name,id:t.id,disabled:t.disabled,required:t.required,class:"d-flex flex-column gap-3 justify-content-center"},{"option-label":e.withCtx(r=>[e.createElementVNode("label",{for:`${t.id}-${r.index}`,class:"d-block btn btn-outline-primary p-3 fw-bold",role:"button"},e.toDisplayString(r.option.text),9,il)]),_:1},8,["modelValue","options","name","id","disabled","required"])]))}}),Al=["id","name","multiple","accept","disabled"],sl={class:"input__input-group input-group"},cl=["value","id","name","disabled"],dl=["for","disabled"],ul={class:"btn btn-outline-contrast"},ml=["for"],fl=["innerHTML"],Le=e.defineComponent({__name:"input-file",props:{modelValue:{type:Array,default:[]},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},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},maxFileSize:{type:Number,default:0},dropzone:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:d}){const l=t,o=d;function n(s){const u=s.target&&s.target.files;u&&(i.splice(0,i.length),Array.from(u).forEach(c=>{if(l.maxFileSize&&c.size>l.maxFileSize){console.warn(`File ${c.name} exceeds the ${l.maxFileSize} bytes size limit and will not be added.`);return}i.push(c)}))}const a=e.ref(),i=e.reactive([]),r=e.computed(()=>i&&i.map(s=>s.name));return e.watch(()=>l.modelValue,(s,u)=>{s.length===0&&(a.value.value=null)},{deep:!0}),e.watch(()=>i,(s,u)=>{o("update:modelValue",s)},{deep:!0}),(s,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input input-file","input-file--primary"])},[e.createElementVNode("input",{ref_key:"input",ref:a,type:"file",id:t.id,name:t.name,class:"d-none",onChange:n,multiple:t.multiple,accept:t.accept,disabled:t.disabled},null,40,Al),e.createElementVNode("div",sl,[e.renderSlot(s.$slots,"input-prepend"),e.createElementVNode("input",{type:"text",value:r.value,id:t.id,name:t.name,class:"form-control",disabled:t.disabled},null,8,cl),e.renderSlot(s.$slots,"input-append",{},()=>[e.createElementVNode("label",{for:t.id,disabled:t.disabled},[e.renderSlot(s.$slots,"button",{},()=>[e.createElementVNode("span",ul,e.toDisplayString(s.$t("common.selectFile")),1)])],8,dl)])]),e.createElementVNode("label",{for:t.id},[e.renderSlot(s.$slots,"label",{},()=>[e.createElementVNode("span",{class:"input__label",innerHTML:e.unref(F)(`${t.label}${t.required?" *":""}`)},null,8,fl)])],8,ml)]))}}),pl={key:0,class:"custom-html"},gl=["innerHTML"],hl=e.defineComponent({__name:"custom-html",props:{content:{}},setup(t){const d=e.ref(!1);return e.onMounted(()=>{window!==void 0&&(d.value=!0)}),(l,o)=>d.value?(e.openBlock(),e.createElementBlock("div",pl,[e.renderSlot(l.$slots,"default",{},()=>[e.createElementVNode("div",{class:"custom-html__content",innerHTML:t.content},null,8,gl)])])):e.createCommentVNode("",!0)}}),yl={class:"select-media"},bl=["for"],kl=e.defineComponent({__name:"select-media",props:{modelValue:{type:null,default:""},assets:{type:Array,default:[]},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},label:{type:String},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},emitKey:{type:String,default:"src"}},emits:["update:modelValue","update:selection"],setup(t,{emit:d}){const l=t,o=d,n=e.computed({get(){return l.modelValue},set(a){const i=l.assets.find(r=>r.id===a);o("update:modelValue",l.emitKey?i[l.emitKey]:i),l.emitKey&&l.emitKey!=="id"&&o("update:selection",i.id)}});return(a,i)=>(e.openBlock(),e.createElementBlock("div",yl,[e.createVNode(be,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r),options:t.assets.map(r=>r.id),name:t.name,id:t.id,disabled:t.disabled,required:t.required,class:"d-flex flex-wrap flex-row justify-content-center",itemClass:"col-6 p-2"},{"option-label":e.withCtx(r=>[e.createElementVNode("label",{for:`${t.id}-${r.index}`,class:e.normalizeClass(["w-100",{"is-active":t.assets[r.index].id===n.value}]),role:"button"},[t.assets[r.index].thumbnail?(e.openBlock(),e.createBlock(oe,{key:0,src:t.assets[r.index].thumbnail,alt:t.assets[r.index].id},null,8,["src","alt"])):e.createCommentVNode("",!0)],10,bl)]),_:1},8,["modelValue","options","name","id","disabled","required"])]))}}),wl={class:"rte-editor"},Bl={key:0,class:"rte-editor__controls mb-2"},Cl=["disabled"],Vl=["disabled"],El={class:"btn-group"},$l=["disabled"],Sl=["disabled"],Nl={class:"btn-group"},Ml={class:"dropdown"},Dl={class:"btn dropdown-toggle btn-light","data-bs-toggle":"dropdown",role:"button",type:"button"},vl={class:"dropdown-menu"},Ll={class:"dropdown"},Il={class:"btn dropdown-toggle btn-light","data-bs-toggle":"dropdown",role:"button",type:"button"},Pl={class:"dropdown-menu"},Tl={class:"btn-group"},xl=["disabled"],zl=["disabled"],Rl=e.defineComponent({__name:"rte-editor",props:{modelValue:{type:String,default:""},disabled:{type:Boolean,default:!1},iconBasePath:{type:String,default:"/rte-icons-defs.svg"}},emits:["update:modelValue"],setup(t,{emit:d}){const l=t,o=d,n=e.ref(!1),a=e.shallowRef(void 0),i=e.shallowRef(null);e.onMounted(async()=>{const[{Editor:c,mergeAttributes:A},{EditorContent:m},{default:f},{default:h},{default:b},{default:N},{default:y}]=await Promise.all([import("@tiptap/core"),import("@tiptap/vue-3"),import("@tiptap/extension-highlight"),import("@tiptap/extension-text-align"),import("@tiptap/extension-link"),import("@tiptap/starter-kit"),import("@tiptap/extension-bold")]);i.value=m,a.value=new c({content:l.modelValue,onUpdate:()=>{o("update:modelValue",a.value?.getHTML())},extensions:[N.configure({bold:!1}),y.extend({addAttributes(){return{class:{default:null}}},parseHTML(){return[{tag:"strong"},{tag:"b"}]},renderHTML({HTMLAttributes:g}){return["strong",A(this.options.HTMLAttributes,g),0]}}),h.configure({types:["heading","paragraph"]}),f,b.extend({addAttributes(){return{...this.parent?.(),class:{default:null},id:{default:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:g=>({href:g.getAttribute("href"),target:g.getAttribute("target"),rel:g.getAttribute("rel"),class:g.getAttribute("class"),id:g.getAttribute("id"),title:g.getAttribute("title")})},{tag:"a:not([href])",getAttrs:g=>({href:null,target:g.getAttribute("target"),rel:g.getAttribute("rel"),class:g.getAttribute("class"),id:g.getAttribute("id"),title:g.getAttribute("title")})}]},renderHTML({HTMLAttributes:g}){if(!g.href){const{href:w,target:D,rel:B,...$}=g;return["a",A($),0]}return["a",A(this.options.HTMLAttributes,g),0]}}).configure({openOnClick:!1,autolink:!0,defaultProtocol:"https",protocols:["http","https"],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}})]})}),e.onBeforeUnmount(()=>{a.value?.destroy()}),e.watch(()=>l.modelValue,(c,A)=>{if(a.value){if(a.value.getHTML()===c)return;a.value.commands.setContent(c)}});function r(){const c=a.value?.getAttributes("link").href,A=window.prompt("URL",c);if(A!==null){if(A===""){a.value?.chain().focus().extendMarkRange("link").unsetLink().run();return}try{a.value?.chain().focus().extendMarkRange("link").setLink({href:A}).run()}catch(m){alert(m.message)}}}const s=()=>{a.value?.commands.setContent(`<textarea>${a.value.getHTML()}</textarea>`),n.value=!0},u=()=>{a.value?.commands.setContent(a.value.getText()),n.value=!1};return(c,A)=>(e.openBlock(),e.createElementBlock("div",wl,[a.value?(e.openBlock(),e.createElementBlock("div",Bl,[n.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"btn btn-sm btn-light is-active",onClick:u,disabled:!a.value.can().chain().focus().toggleCode().run(),title:"Toggle Source"},[e.createVNode(M,{symbol:"source","base-path":t.iconBasePath},null,8,["base-path"])],8,Vl)):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive("code")}]),onClick:s,disabled:!a.value.can().chain().focus().toggleCode().run(),title:"Toggle Source"},[e.createVNode(M,{symbol:"source","base-path":t.iconBasePath},null,8,["base-path"])],10,Cl)),e.createElementVNode("div",El,[e.createElementVNode("button",{class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive("bold")}]),onClick:A[0]||(A[0]=m=>a.value?.chain().focus().toggleBold().run()),disabled:!a.value.can().chain().focus().toggleBold().run(),title:"Toggle Bold"},[e.createVNode(M,{symbol:"bold","base-path":t.iconBasePath},null,8,["base-path"])],10,$l),e.createElementVNode("button",{class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive("italic")}]),onClick:A[1]||(A[1]=m=>a.value?.chain().focus().toggleItalic().run()),disabled:!a.value.can().chain().focus().toggleItalic().run(),title:"Toggle Italic"},[e.createVNode(M,{symbol:"italic","base-path":t.iconBasePath},null,8,["base-path"])],10,Sl)]),e.createElementVNode("div",Nl,[e.createElementVNode("div",Ml,[e.createElementVNode("button",Dl,[a.value.isActive("heading",{level:1})?(e.openBlock(),e.createBlock(M,{key:0,symbol:"h1","base-path":t.iconBasePath},null,8,["base-path"])):a.value.isActive("heading",{level:2})?(e.openBlock(),e.createBlock(M,{key:1,symbol:"h2","base-path":t.iconBasePath},null,8,["base-path"])):a.value.isActive("heading",{level:3})?(e.openBlock(),e.createBlock(M,{key:2,symbol:"h3","base-path":t.iconBasePath},null,8,["base-path"])):a.value.isActive("heading",{level:4})?(e.openBlock(),e.createBlock(M,{key:3,symbol:"h4","base-path":t.iconBasePath},null,8,["base-path"])):(e.openBlock(),e.createBlock(M,{key:4,symbol:"headline","base-path":t.iconBasePath},null,8,["base-path"]))]),e.createElementVNode("ul",vl,[e.createElementVNode("li",null,[e.createElementVNode("button",{class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive("heading",{level:1})}]),onClick:A[2]||(A[2]=m=>a.value?.chain().focus().setHeading({level:1}).run()),title:"Set Heading 1"},[e.createVNode(M,{symbol:"h1","base-path":t.iconBasePath},null,8,["base-path"])],2)]),e.createElementVNode("li",null,[e.createElementVNode("button",{class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive("heading",{level:2})}]),onClick:A[3]||(A[3]=m=>a.value?.chain().focus().setHeading({level:2}).run()),title:"Set Heading 2"},[e.createVNode(M,{symbol:"h2","base-path":t.iconBasePath},null,8,["base-path"])],2)]),e.createElementVNode("li",null,[e.createElementVNode("button",{class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive("heading",{level:3})}]),onClick:A[4]||(A[4]=m=>a.value?.chain().focus().setHeading({level:3}).run()),title:"Set Heading 3"},[e.createVNode(M,{symbol:"h3","base-path":t.iconBasePath},null,8,["base-path"])],2)]),e.createElementVNode("li",null,[e.createElementVNode("button",{class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive("heading",{level:4})}]),onClick:A[5]||(A[5]=m=>a.value?.chain().focus().setHeading({level:4}).run()),title:"Set Heading 4"},[e.createVNode(M,{symbol:"h4","base-path":t.iconBasePath},null,8,["base-path"])],2)])])]),e.createElementVNode("button",{class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive("paragraph")}]),onClick:A[6]||(A[6]=m=>a.value?.chain().focus().setParagraph().run()),title:"Set Paragraph"},[e.createVNode(M,{symbol:"paragraph","base-path":t.iconBasePath},null,8,["base-path"])],2),e.createElementVNode("button",{class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive("bulletList")}]),onClick:A[7]||(A[7]=m=>a.value?.chain().focus().toggleBulletList().run()),title:"Toggle Bullet List"},[e.createVNode(M,{symbol:"list","base-path":t.iconBasePath},null,8,["base-path"])],2),e.createElementVNode("button",{class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive("orderedList")}]),onClick:A[8]||(A[8]=m=>a.value?.chain().focus().toggleOrderedList().run()),title:"Toggle Ordered List"},[e.createVNode(M,{symbol:"ordered-list","base-path":t.iconBasePath},null,8,["base-path"])],2)]),e.createElementVNode("div",Ll,[e.createElementVNode("button",Il,[a.value.isActive({textAlign:"center"})?(e.openBlock(),e.createBlock(M,{key:0,symbol:"align-center","base-path":t.iconBasePath},null,8,["base-path"])):a.value.isActive({textAlign:"left"})?(e.openBlock(),e.createBlock(M,{key:1,symbol:"align-left","base-path":t.iconBasePath},null,8,["base-path"])):a.value.isActive({textAlign:"right"})?(e.openBlock(),e.createBlock(M,{key:2,symbol:"align-right","base-path":t.iconBasePath},null,8,["base-path"])):(e.openBlock(),e.createBlock(M,{key:3,symbol:"align-justify","base-path":t.iconBasePath},null,8,["base-path"]))]),e.createElementVNode("ul",Pl,[e.createElementVNode("li",null,[e.createElementVNode("button",{class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive({textAlign:"left"})}]),onClick:A[9]||(A[9]=m=>a.value?.chain().focus().setTextAlign("left").run())},[e.createVNode(M,{symbol:"align-left","base-path":t.iconBasePath},null,8,["base-path"])],2)]),e.createElementVNode("li",null,[e.createElementVNode("button",{class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive({textAlign:"center"})}]),onClick:A[10]||(A[10]=m=>a.value?.chain().focus().setTextAlign("center").run())},[e.createVNode(M,{symbol:"align-center","base-path":t.iconBasePath},null,8,["base-path"])],2)]),e.createElementVNode("li",null,[e.createElementVNode("button",{class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive({textAlign:"right"})}]),onClick:A[11]||(A[11]=m=>a.value?.chain().focus().setTextAlign("right").run())},[e.createVNode(M,{symbol:"align-right","base-path":t.iconBasePath},null,8,["base-path"])],2)]),e.createElementVNode("li",null,[e.createElementVNode("button",{class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive({textAlign:"pretty"})}]),onClick:A[12]||(A[12]=m=>a.value?.chain().focus().setTextAlign("right").run())},[e.createVNode(M,{symbol:"align-justify","base-path":t.iconBasePath},null,8,["base-path"])],2)])])]),a.value.isActive("link")?(e.openBlock(),e.createElementBlock("button",{key:3,class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive("link")}]),onClick:A[13]||(A[13]=m=>a.value.chain().focus().unsetLink().run()),title:"Unset Link"},[e.createVNode(M,{symbol:"unlink","base-path":t.iconBasePath},null,8,["base-path"])],2)):(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(["btn btn-sm btn-light",{"is-active":a.value.isActive("link")}]),onClick:r,title:"Set Link"},[e.createVNode(M,{symbol:"link","base-path":t.iconBasePath},null,8,["base-path"])],2)),e.createElementVNode("div",Tl,[e.createElementVNode("button",{class:"btn btn-sm btn-light",onClick:A[14]||(A[14]=m=>a.value?.chain().focus().undo().run()),disabled:!a.value.can().chain().focus().undo().run(),title:"Undo"},[e.createVNode(M,{symbol:"undo","base-path":t.iconBasePath},null,8,["base-path"])],8,xl),e.createElementVNode("button",{class:"btn btn-sm btn-light",onClick:A[15]||(A[15]=m=>a.value?.chain().focus().redo().run()),disabled:!a.value.can().chain().focus().redo().run(),title:"Redo"},[e.createVNode(M,{symbol:"redo","base-path":t.iconBasePath},null,8,["base-path"])],8,zl)])])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value),{class:"rte-editor__content",editor:a.value},null,8,["editor"]))]))}}),Ql={class:"input-color"},Fl={class:"base-input__color-swatch"},Ol=["name","id","disabled","read-only","required","aria-label"],Hl=e.defineComponent({__name:"input-color",props:{modelValue:{type:[String,Number,Boolean,Date],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},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}},emits:["update:modelValue"],setup(t,{emit:d}){const l=t,o=d,n=e.computed({get(){return l.modelValue},set(a){o("update:modelValue",a)}});return(a,i)=>(e.openBlock(),e.createElementBlock("div",Ql,[e.createVNode(Ae,{modelValue:n.value,"onUpdate:modelValue":i[1]||(i[1]=r=>n.value=r),type:t.type==="color"?"text":t.type,id:t.id,name:t.name,placeholder:t.placeholder,pattern:t.pattern,label:t.label,disabled:t.disabled,"read-only":t.readOnly,required:t.required,maxlength:t.maxlength},{"input-append":e.withCtx(r=>[e.createElementVNode("span",Fl,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=s=>n.value=s),type:"color",name:`${t.name}-color`,id:`${t.id}-color`,disabled:t.disabled,"read-only":t.readOnly,required:t.required,class:"form-control","aria-label":t.label},null,8,Ol),[[e.vModelText,n.value]])])]),_:1},8,["modelValue","type","id","name","placeholder","pattern","label","disabled","read-only","required","maxlength"])]))}}),Wl={class:"color-palette"},Ul=["for"],ql=e.defineComponent({__name:"color-palette",props:{modelValue:{type:[String],default:""},colors:{type:Array,default:["#000000","#FFFFFF"]},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},label:{type:String},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:d}){const l=t,o=d,n=e.computed({get(){return l.modelValue},set(a){o("update:modelValue",a)}});return(a,i)=>(e.openBlock(),e.createElementBlock("div",Wl,[e.createVNode(be,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r),options:t.colors,name:t.name,id:t.id,label:t.label,disabled:t.disabled,required:t.required,class:"d-flex flex-wrap flex-row gap-2"},{"option-label":e.withCtx(r=>[e.createElementVNode("label",{for:`${t.id}-${r.index}`,class:"d-block rounded-circle",style:e.normalizeStyle({backgroundColor:r.option})},null,12,Ul)]),_:1},8,["modelValue","options","name","id","label","disabled","required"])]))}}),jl=["id"],Jl=["for","innerHTML"],_l={class:"dropdown"},Gl={class:"caption"},Yl=["innerHTML"],Kl={class:"caption__text"},Zl={class:"d-block text-truncate"},Xl={class:"dropdown-menu"},eo={class:"form-check d-flex"},to=["value","id","name","label","required","disabled"],ao=["value","id","name","label","required","disabled"],no=["for"],ke=e.defineComponent({__name:"input-dropdown",props:{id:{type:String},name:{type:String,default:()=>`dropdown-${I()}`},label:{type:String},error:{type:String},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},modelValue:{type:null},options:{type:Array,required:!0},multiple:{type:Boolean,default:!1},showSelectionCount:{type:Boolean,default:!1},toggleCaption:{type:String},placeholder:{type:String,default:""},icon:{default:"chevron-down",type:String},variant:{type:String,default:""},color:{type:String,default:""},outlined:{type:Boolean,default:!1},exactMatch:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:d}){const{t:l}=Ne.useI18n(),o=t,n=d,a=e.computed({get(){return o.multiple&&!o.modelValue?[]:o.modelValue},set(s){n("update:modelValue",s)}}),i=e.computed(()=>o.options&&o.options.map(s=>(s=typeof s=="string"?{text:s,value:s}:s,{...s,active:o.modelValue&&s.value&&(o.exactMatch?o.modelValue===s.value:o.multiple?o.modelValue.includes(s.value):o.modelValue===s.value)}))),r=e.computed(()=>{if(!o.modelValue)return o.placeholder||`${l("common.select")}`;if(o.multiple&&Array.isArray(o.modelValue)&&o.modelValue.length)return i.value.reduce((s,u)=>o.modelValue.includes(u.value)?`${s}${s?", ":""}${u.text}`:s,"");if(!o.multiple){const s=i.value.find(u=>typeof u.value=="object"&&u.value!==null?JSON.stringify(u.value)===JSON.stringify(o.modelValue):u.value===o.modelValue);return s?s.text:o.placeholder||`${l("common.select")}`}return o.placeholder||`${l("common.select")}`});return(s,u)=>(e.openBlock(),e.createElementBlock("div",{class:"input input-dropdown",id:`${t.id||t.name}`},[e.renderSlot(s.$slots,"label",{},()=>[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:`${t.id||t.name}--dropdown-toggle`,class:"input__label",innerHTML:`${t.label}${t.required?" *":""}`},null,8,Jl)):e.createCommentVNode("",!0)]),e.createElementVNode("div",_l,[e.createVNode(Fe,{id:`${t.id||t.name}--dropdown-toggle`,"data-bs-toggle":"dropdown",role:"button",type:"button",title:r.value,class:"btn dropdown-toggle",color:t.color,outlined:t.outlined,disabled:t.disabled},{default:e.withCtx(()=>[e.createElementVNode("span",Gl,[e.createVNode(e.Transition,{name:"bounce"},{default:e.withCtx(()=>[t.showSelectionCount&&t.modelValue.length?(e.openBlock(),e.createElementBlock("i",{key:0,class:"caption__count",innerHTML:t.modelValue.length},null,8,Yl)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("span",Kl,[e.createElementVNode("span",Zl,e.toDisplayString(t.toggleCaption||r.value),1)])])]),_:1},8,["id","title","color","outlined","disabled"]),e.createElementVNode("ul",Xl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(c,A)=>(e.openBlock(),e.createElementBlock("li",{key:`${c.value}-${A}`},[e.createElementVNode("div",{class:e.normalizeClass(["dropdown-item",c.active&&"active"])},[e.createElementVNode("div",eo,[t.multiple?e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"checkbox","onUpdate:modelValue":u[0]||(u[0]=m=>a.value=m),value:c.value,key:`${t.name}-${c.value}-${A}__if`,id:`${t.name}-${c.value}-${A}`,name:t.name,label:c.text,required:t.required,disabled:c.selectable===!1,class:"form-check-input"},null,8,to)),[[e.vModelCheckbox,a.value]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"radio","onUpdate:modelValue":u[1]||(u[1]=m=>a.value=m),value:c.value,key:`${t.name}-${c.value}-${A}__else`,id:`${t.name}-${c.value}-${A}`,name:t.name,label:c.text,required:t.required,disabled:c.selectable===!1,class:"form-check-input visually-hidden"},null,8,ao)),[[e.vModelRadio,a.value]]),e.createElementVNode("label",{class:"form-check-label flex-grow-1",onclick:"event.stopPropagation",for:`${t.name}-${c.value}-${A}`},e.toDisplayString(c.text),9,no)])],2)]))),128))])])],8,jl))}}),lo={key:0,class:"auto-suggest__suggestions position-relative"},oo={class:"suggestions dropdown-menu show w-100 mt-2"},io=["onClick"],ro=["innerHTML"],Ue=e.defineComponent({__name:"auto-suggest",props:{modelValue:{type:String},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},options:{type:Array,default:[]},placeholder:{type:String,default:""},color:{type:String,default:""},outlined:{type:Boolean,default:!1},selection:{type:String}},emits:["update:modelValue","update:selection"],setup(t,{emit:d}){const l=t,o=d,n=e.ref(),a=e.ref(!1),i=e.computed({get(){return l.modelValue},set(f){o("update:modelValue",f)}}),r=e.computed(()=>{const f=new RegExp(`(${i.value})`,"i");return i.value?l.options.filter(h=>f.test(h)):l.options}),s=e.computed(()=>{const f=new RegExp(`(${i.value})`,"i");return r.value.map(h=>{const b=h.replace(f,"<strong>$1</strong>");return F(b)})});e.watch(()=>l.options,(f,h)=>{f.length&&(a.value=!0)},{deep:!0});function u(){l.options.length&&(a.value=!0)}function c(f){a.value=!1;const h=r.value[f];o("update:modelValue",h),o("update:selection",h)}const A=e.ref();function m(f){const h=f.target;a.value&&h&&!n.value.contains(h)&&(a.value=!1)}return e.onBeforeMount(()=>{A.value=document.addEventListener("click",m)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",A.value)}),(f,h)=>(e.openBlock(),e.createElementBlock("div",{class:"auto-suggest",ref_key:"container",ref:n},[e.createElementVNode("div",{class:"auto-suggest__input",onFocusCapture:u},[e.renderSlot(f.$slots,"default",{},()=>[e.createVNode(Ae,e.mergeProps({modelValue:i.value,"onUpdate:modelValue":h[0]||(h[0]=b=>i.value=b)},f.$props),null,16,["modelValue"])])],32),a.value&&r.value.length?(e.openBlock(),e.createElementBlock("div",lo,[e.createElementVNode("ul",oo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(b,N)=>(e.openBlock(),e.createElementBlock("li",{key:b,class:"suggestions__item dropdown-item",onClick:e.withModifiers(y=>c(N),["prevent"])},[e.createElementVNode("p",{class:"text-truncate my-2",innerHTML:b},null,8,ro)],8,io))),128))])])):e.createCommentVNode("",!0)],512))}});function qe(t){const d=e.computed(()=>{if(!t.tintColor)return null;const i=t.tintColor.replace("#",""),r=parseInt(i.substring(0,2),16),s=parseInt(i.substring(2,4),16),u=parseInt(i.substring(4,6),16);return{r,g:s,b:u}});function l(i,r,s){if(t.filter==="none"&&!t.tintColor)return;const u=i.getImageData(0,0,r,s),c=u.data;if(t.filter==="grayscale")for(let A=0;A<c.length;A+=4){const m=.299*c[A]+.587*c[A+1]+.114*c[A+2];c[A]=m,c[A+1]=m,c[A+2]=m}else if(t.filter==="sepia")for(let A=0;A<c.length;A+=4){const m=c[A],f=c[A+1],h=c[A+2];c[A]=Math.min(255,.393*m+.769*f+.189*h),c[A+1]=Math.min(255,.349*m+.686*f+.168*h),c[A+2]=Math.min(255,.272*m+.534*f+.131*h)}if(t.tintColor&&d.value){const{r:A,g:m,b:f}=d.value,h=t.tintIntensity;for(let b=0;b<c.length;b+=4){const N=c[b],y=c[b+1],g=c[b+2],w=N*A/255,D=y*m/255,B=g*f/255;c[b]=N+(w-N)*h,c[b+1]=y+(D-y)*h,c[b+2]=g+(B-g)*h}}i.putImageData(u,0,0)}async function o(i){if(typeof i!="string")return i.complete&&i.naturalWidth>0||await new Promise((s,u)=>{i.onload=()=>s(),i.onerror=()=>u(new Error("Failed to load image element"))}),i;const r=new Image;return await new Promise((s,u)=>{r.onload=()=>s(),r.onerror=()=>u(new Error("Failed to load image source")),r.src=i}),r}async function n(i,r={}){const s=await o(i),u=document.createElement("canvas"),c=r.width||s.naturalWidth||s.width,A=r.height||s.naturalHeight||s.height;u.width=c,u.height=A;const m=u.getContext("2d");if(!m)throw new Error("Could not create canvas context");return m.drawImage(s,0,0,c,A),l(m,c,A),u.toDataURL(r.mimeType||"image/png",r.quality)}async function a(i,r={}){const s=await n(i,r);return(await fetch(s)).blob()}return{tintRgb:d,applyFilterToCanvas:l,applyFilterToImage:n,applyFilterToImageBlob:a}}const Ao="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAYAAAB/HSuDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAHkJJREFUeNrs3Q1u8zaXgNHS8JK4/xVwTyzytgnS1HZsixR/7jlAgZkMBl+hT6Z1H1FyqrX+BQAAAOzt4hAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAEA0V4cAANaTc64j//NLKcl/CwCwllRrdRQAwJDfjDgAAHPyCAAAGP79uwOAAAAAAAAIAAAAAIAAAAAAAAgAAAAAwEn8CgAATOq3l+mNetv+rP9eAIAAAAAAAOF5BAAAAAAEAAAAAEAAAAAAAJZwdQgA2N2tl9Z5UZ1zwjkBQDReAghAmAHPwIdzA4DI7AAAINxwB8+eR0IAADuxAwCA0IO/Ac954jwBQAAAgE2HOUOd88Z5A0BEHgEAINwABy3OPyEAgNXYAQBAyMHf8OZcci4BIAAAwKbDmkEN5xcAAgAAGMxwvjnfABAAAGC1QcwQhnMQAAQAAAxd4JwEQAAAAEMWOEcBEAAAYKrBylCF8xUABAAANh2kDFE4hwFAAADA0ATOaQC44eIQAGBQgvcdOTdb/fQgADzDDgAADP7gXAdAAACAMQORYQjnPQAIAAAYgMDnAAAEAAAMPLD+58JnAgABAADDP/h8AIAAAMA6w43BBp8VnxUABAAADDPgs+OzA0BDF4cAgDMZYMBnAYAxrg4BAIYdGPu5ePf9AADwCjsAADD8g88IAAHYAQCAoQYm+rzYDQBAL3YAAGD4B58dAALwKwAANPF519LwAj5XAAgAAAAAwCAeAQAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAiyznXj38cCcA6A8AjqVZrOcCqF+S3/l5KSY4OYJ0B4Cc7AAA2uigHsAYBIAAAuDAHsJYACAAAuCgHsBYBCAAALHPB7dlcoIVn1hIRAEAAAGDQ8A9gbQJAAAAIcIHt7j/Q0rNriggAIAAAMOGFOoC1BUAAAGBCnvsHVogAdgEACAAAGP4BEQAAAQAAAAAQAAACc/cfmI1dAAACAACGf0AEEAEABAAADP+ACACAAAAAAAAIAACRuPsPrMIuAAABAADDPyACiAAAAgAAAAAgAAAE5e4/sCq7AAAEAAAM/4AIIAIACAAAAACAAAAQhLv/wC7sAgAQAADofEENYM0CQAAAmJg7YYC1DwABAMAFsDtpwJI8CgAgAADQ+AIawBoGgAAAMDF3vgCshQACAADunAHWMgAEAIDVueMFYE0EEAAAXOi6YwZsxQsBAQQAAAz/gLUNAAEAYD/ucAFYIwEEAADcIQOscQAIAACrc2cLwFoJIAAA4M4YYK0DQAAAWJ07WgDWTAABAAB3xABrHgACAMDq3MkCsHYCCAAAuBMGWPsAEAAAVvfbHSwXwIAI8P4aCoAAAAAAAAgAAHNw9x/AWgggAAAAAAACAMDq3PECsCYCCAAAAABAN6lWL1kF6OXzTdbucgFYLwEEAAAAAKA7jwAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAACgEMAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAIAAAAAAAAgAAJHknOvHP44EgHUaYGWpVmslwL0Lyp9/K6UkRwbAWg2wIjsAAJ68oHz0dwCs1QACAAAAACAAAAAAAAIAwOlsHQWwlgMIAADBebEUAAACAAAAnEiUBRAAAAAAAAEA4D7PjAJY0wEEAAAAAEAAANidZ00BrM0AAgAAAAAgAAAAAAACAMAUvCwKwNoOIAAAAAAAAgDA7rxkCsAaDSAAAAAAAAIAAAAAIAAATMFLogCs8QACAAAAACAAAOzOy6UArNUAAgAAAAAgAAAAAAACAAAAACAAAJzD26EBrPUAAgAAAAAgAADszlulAazZAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAEAjfhYKwJoPIAAAAAAAAgDA7vycFIC1G0AAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAPiSc66OAoC1H0AAAAjM70gDWMMBBAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAAAQAAAAAAABACCMUkpyFACs5QACAICLQwCs/QDLSbVWRwEAAAA2ZwcAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgADgEAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAABAc1eHAIgs51x//q2UkhwZAGs8wG7sAABcGD75dwCs8QACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAFH5nWgAaziAAACwiVJKchQArP0AAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAIAAAMC/cs7VUQCwdgMIAAAbKKUkRwHAmg8gAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAA04fekAazZAAIAwCb8LjSAtR5AAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAABoxu9KA1irAQQAgE34fWgAAAQAAABYmMgLIAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAMBu/Lw1gjQYQAAA24WeiAKztAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAwEv8XBSANR1AAABwEQmANRpgWanW6igAAADA5uwAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAABACHAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAgLNdHQKA1+Wc6+f/XEpJjgiAtRdgdqnW6igAvHHx+Z0LUQDrL8DsPAIA0PHCFABrLIAAAAAAAAgAAAAAgAAAAAAACAAAAOzA8/8AAgCAi1QAABAAAPrwc1MA1mQAAQAAAAAQAAAAAAABAAAAABAAANbgRYAA1lQAAQBgE146BWAtBhAAAAAAAAEAAAAAEAAAtuCZVQBrKYAAAAAAAAgAAKvw8ikAazCAAAAAAAAIAAAAAIAAALAFL68CsIYCCAAAAACAAACwCi+hArD2AggAAAAAgAAAAAAACAAAW/ASKwBrJ4AAALAJz6ICWHMBBAAAAABAAAAAAAAEAIAteJYVwJoJIAAAAAAAAgDAKryUCsBaCyAAAAAAAAIAQASeaQWwVgIIAAAAAIAAALAKz6YCWGMBBAAAAABAAACIwLOtAAAIAAAAhCaSAggAAEvxjCqAtRVAAAAAAAAEAAAAAEAAANiCZ1wBrI0AAgDAJjyrCmBNBRAAAAAAAAEAIAJbXQGsiQACAAAAACAAAKzCM6sA1lIAAQAAAAAQAAAAAAABAGAZ97au2tIKYK0EEAAANr+wdUELYK0EGCnV6tdXAAAAYHd2AAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAKAQwAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAgAAAAAAACAAAAACAAADAQTnn+vGPIwFYvwBoJdVqfQaY6cL51t9LKcnRAaxfABxhBwAAAAAIAADMwHZawBoFgAAAAAAACAAAu3CHDbA2ASAAAAAAAAIAwCq8LRuwpgEgAABgqy1gTQJAAAAAAAAEAIBl2DILWMsAEAAAsOUWsBYBIAAAAAAAAgDAMn7bOuvOGzDSb2uQ7f8AAgAAAAAgAAAAAAACAEAwHgMAZmT7P4AAAAAAAAgAALzDnTTAmgWAAACAxwAAaw4AAgAAAAAgAAAsw8sAgRl4+R+AAAAAAAAIAAC04M4aYI0CQAAAwGMAgDUGAAEAAAAAEAAAluFlgMAIXv4HIAAAAAAAAgAAPdgFAJzJ3X8AAQAAAAAQAAAAAAABAIBDPAYAnMH2fwABAAAAABAAADiDXQBAT+7+AwgAAAAAgAAAwJnsAgB6cPcfQAAAAAAABAAAAABAAACgC48BAC3Z/g8gAAAAAAACAAAj2QUAtODuP4AAAAAAAAgAAMzALgDgCHf/AQQAAAAAQAAAYCZ2AQDvcPcfQAAAAAAABAAAZuROHWBNAUAAAAAAAAEAAAAAEAAAWIYtu4C1BIBbUq1eCg0AAAC7swMAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAAAQABwCAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAEAAD4JudcP/5xJMDnE4B1pVp9XwBwf7D4+bdSSnJkwGcUgPXYAQDA04PFo78DPqMACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAAAgAAQfkZMfAZBkAAAAAAAAQAAHZXSkmOAvgsAiAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAABAHDnn6igAIAAAYGgAABAAAOA2vzsOPpMACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAfMk5V0cBfKYBEAAACMzvjYPPJgACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAABf/F44+GwDIAAAAAAAAgAAuyulJEcBfEYBEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAA+CPnXB0F8BkHQAAAIDC/Lw4+qwAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAA8xc+Kgc8sAAIAAAAAsJBUa3UUAPgj5/z1peBOIvgsAyAAAAAAAIvxCAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAADAIVeHAGAeOef682+llOTIANYwAI5KtVZHAWCSC+V7XEAD1jQAjrIDAGCyC2OAiGuiKAAgAAAY9AECr5/CAIAAAGDQBwi83goDAAIAgCEfIPgaLQ4A3OYlgICLyMkHfReygPXUegogAABsdGHqAhWw7lp3AQQAABeeANZl6zKAAACwykWmi0qANdZs6zWwIy8BBHDhCDDdmulFrAACAIAhHyD4GisOAAgAAAZ9gMDrsjAAIAAAGPQBAq/jwgDAP7wEENjWvQs+gz4AvicAAQAAAADY0sUhAAAAAAEAAAAAEAAAAACAFfgVAOBXt16S5AVJAOC7GViLlwACT11U3OJCAwB8TwPrsAMA8PvIABDg+10QAAQAcEEAAAgCgAAAGPgBAEEAEAAAAz8AIAgAS/ASQDD0v8VFAQD43gcEAGDDL35f/gDgmsA1AQgAgC93AMA1AyAAAL68AQDXFIAAAPhyBgBccwACAPjy9eULALgmAQQA8CXryxUAcK0CCAAQ6wvVlygA4PoFuOfqEMC6fGECAGdfb4x4ZAAQAMDADwAgCAACABj4AQAEAeCTdwDAyR59KRr4AQDXPoAAAAAAALzt4hAAAACAAAAAAAAIAAAAAIAAACf4eLGMt80CAOB6Ex7zEkCWXIAf/d+9TRYAANed8H9Xh4AdFl8AABh5jSoGIACAoR8AADEABAAw9AMAIAaAAIChHwAAxAAQADD0AwCAGADP8isAbDH0W0ABAHAtCwIAFkoAAHCNiwAgALDSomhBBADAdS8IAFj8AADA9TAIAKy00FnkAABwjewaGQGATRc1CxoAAK6bXTcjAGDxAgAA19OupxEAWGmhskgBAIBrbAQALEoAAOCa2zU3AgCrLUIWIAAAcB2OAIAFBwAAcF2OAMBqi4zFBQAAXKczr6tDwFEWFAAA6H+93foXBBAAwOAPAABCAAIAGPwBAEAIYEXeAcB/3FtEDP0AAOA6HgGAjRcPCwYAALiWRwAAAAAAFnFxCAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAACAG64OwRg55/r5P5dSkiMCAACYgegp1VodhUEn/Xc+AAAAgDmInjwCMMFJDwAAYEaiN48AOKkBAACGz0t2A/RnB4DhHwAAwOwkAOAEBgAAMEMJADQ5cW11AQAAdvbKzCMC9ONXAAYO/oZ/AADAvGReOosdAE5mAACAU7w6A9kNIAAY/gEAAEQAXuQRgJOHf4M/AACAWWoEOwCcsAAAAEN4OaAAYPgHAAAQAUQAAcDwDwAAIALwKu8A6Dj4G/4BAADMWwLA5iejExEAAMDsNROPADgBAQAApuKRAAHA8A8AACACiAACgOEfAABABEAAMPwDAACIAAIAhn8AAAARQAAw/Bv+AQAARAABwPAPAACACCAAGP4BAAAQAQQAwz8AAAAigABg+AcAAEAEEAAM/wAAACKACCAAGP4BAABEABEgcgAw/AMAAIgAAgCGfwAAALObALC6Z4uPEwgAAGC/CBB1F0C4AGD4BwAAEAEiRoBQAcDwDwAAIAJEjQBhAoDhHwAAQASIHAG8BNDwDwAAYMYTAJwYAAAAmPUEACcEAAAAZj4BwIkAAACA2U8AGP5fthMAAAAgdgSINBemWquzAAAAADbnHQAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAACAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAAAgAAAAAgAAAAAAACAAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAIAA4BAAAACAAAAAAAAIAAAAAIAAAAAAAAgAAAAAgAAAAAAANHId/S+Qc64//1ZKSf6rAQAAYFUzzrqX2Q7Io78DAADAisP/DLOuRwAAAAAggGEBwF1+AAAAohk5C9sBAAAAAAEMCQC/FQ8vAQQAAGBXo3YB2AEAAAAADc16U/v0AODuPwAAANEjwIhdAHYAAAAAQACnBgB3/wEAAIhitl0AdgAAAABAAKcFAHf/AQAAiGamXQB2AAAAAEAApwQAd/8BAACIapZdAHYAAAAAQADdA8CI3zYEAACAlZwxOw/fAWD7PwAAALubYfb1CAAAAAAE0DUAePkfAAAAPDcD934MwA4AAAAACKBbAHD3HwAAAF6bhXvuArADAAAAAAIYEgDc/QcAACCqUTNxlwBwxu8XAgAAwI56zdQeAQAAAIAAmgcAL/8DAACAx0a8DNAOAAAAAAjg1ADg7j8AAACMmZGbBgAv/wMAAIA5Z2yPAAAAAEAApwUA2/8BAABg3KzcLADY/g8AAABttZy1PQIAAAAAAZwSAGz/BwAAgLEzc5MAYPs/AAAA9NFq5vYIAAAAAATQPQDY/g8AAADjZ+fDAcD2fwAAAOirxeztEQAAAAAIoGsAsP0fAAAA5pihDwUA2/8BAADgHEdncI8AAAAAQADdAoDt/wAAADDPLG0HAAAAAATwdgDw/D8AAACc68gsbgcAAAAABNAlAHj+HwAAAOaaqe0AAAAAgADeDgD3ioS7/wAAAHBMj5n70vJfyPAPAAAAfSLA0Zk71epl/gAAALA77wAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAEAIcAAAAABAAAAABAAAAAAAAEAAAAAEAAAAAAAAQAAAAAQAAAAAAABAAAAABAAAAAAAABAAAAABAAAAAAAAEAAAAAEAAAAACAs13f+X/KOdfv/3spJTmUAAAA0EeLOfxy9D/03t8AAACA9sP/u3O4RwAAAAAggJcCgDv9AAAAMIdXZ3Q7AAAAACAAAQAAAAAEAAAAAEAAAADgb3bsWAAAAABgkL/1IPYWRgAgAAAAAAABAAAAAAgAAAAAQAAAAAAAAgAAAAAQAAAAACAAAAAAAAEAAAAACAAAAABAAAAAAAACAAAAABAAAAAAgAAAAAAABAAAAAAIAAAAAEAAAAAAAAIAAAAAEAAAAACAAAAAAAAEAAAAALAkwACd6iSVhnRezwAAAABJRU5ErkJggg==",so={class:"camera__preview"},co={key:0,class:"camera__bg-notification"},uo=["innerHTML"],mo=["width","height"],fo={key:1,class:"camera__countdown-overlay"},po=["innerHTML","data-countdown"],go=["src"],ho={class:"camera__controls"},yo={class:"container"},bo={class:"row"},ko={class:"col"},wo={class:"btn-group"},Bo={key:0},Co={key:1},Vo={key:0,class:"camera__switch-cam"},Eo={key:1,class:"base-camera__devices"},$o={name:"BaseCamera",inheritAttrs:!1},je={"1x1":{width:720,height:720},"2x3":{width:720,height:1080},"3x2":{width:1080,height:720},"3x4":{width:720,height:960},"4x3":{width:960,height:720},"4x5":{width:960,height:1200},"5x4":{width:1200,height:960},"16x9":{width:1280,height:720},"9x16":{width:720,height:1280}},So=e.defineComponent({...$o,props:{modelValue:{type:null},enableSwitchCamera:{type:Boolean,default:!0},defaultRearCamera:{type:Boolean,default:!1},enableMirrorCamera:{type:Boolean,default:!1},enableGuide:{type:Boolean,default:!0},guideSrc:{type:String,default:()=>Ao},countdown:{type:Number,default:0},ratio:{type:String,default:""},filter:{type:String,default:"none",validator:t=>["none","grayscale","sepia"].includes(t)},tintColor:{type:String,default:""},tintIntensity:{type:Number,default:.3},enableAudio:{type:Boolean,default:!1},enableSelectDevice:{type:Boolean,default:!1},enableCropImage:{type:Boolean,default:!0},resolutions:{type:Object,default:()=>je}},emits:["update:modelValue"],setup(t,{expose:d,emit:l}){const o=t,n=l,a=e.ref(),i=e.ref(),r=e.ref(!1),s=e.ref([]),u=e.ref(),c=e.ref(),A=e.ref(!1),m=e.ref(!1),f=e.ref(0),h=e.ref(0),b=e.ref(),N=e.computed(()=>({...je,...o.resolutions})),y=e.computed(()=>Object.values(N.value)[0]);function g(V){return String(V||"").trim().toLowerCase().replace(/\s+/g,"").replace(/[:/]/g,"x")}const w=e.computed(()=>{if(N.value[o.ratio])return o.ratio;const V=g(o.ratio);if(N.value[V])return V}),D=e.computed(()=>w.value?N.value[w.value]:y.value),B=e.computed(()=>{const V=w.value?N.value[w.value]:void 0;return V?`${V.width} / ${V.height}`:void 0}),$=e.computed(()=>s.value.filter(V=>V.kind==="videoinput")),q=e.computed(()=>s.value.filter(V=>V.kind==="audioinput")),X=e.computed({get(){return u.value&&u.value.deviceId},set(V){u.value=$.value.find(L=>L.deviceId===V)}}),j=e.computed({get(){return c.value&&c.value.deviceId},set(V){c.value=q.value.find(L=>L.deviceId===V)}}),ee=e.computed(()=>{const V=u.value&&$.value.findIndex(L=>L.deviceId===u.value.deviceId);return o.enableMirrorCamera&&V===0?"mirror-cam":""}),de=e.computed(()=>{const V=u.value&&s.value.findIndex(L=>L.deviceId===u.value.deviceId);return ee.value?`${ee.value} mirror-device-${V}`:""}),{tintRgb:Be,applyFilterToCanvas:x}=qe(o);function ie(){if(w.value&&D.value){f.value=D.value.width,h.value=D.value.height;return}f.value=a.value.parentElement&&a.value.parentElement.clientWidth,h.value=a.value.parentElement&&a.value.parentElement.clientHeight}const E=Me.debounce(()=>{ie()},300,{trailing:!0,leading:!1});async function v(){const V=D.value?{width:D.value.width,height:D.value.height}:void 0,L=V?V.width/V.height:void 0,z={audio:o.enableAudio&&{...c.value?{deviceId:c.value.deviceId}:{}},video:{...u.value?{deviceId:u.value.deviceId}:{},width:{ideal:V?.width},...w.value&&V?.height?{height:{ideal:V.height}}:{},...w.value&&L?{aspectRatio:{ideal:L}}:{}}};return navigator.mediaDevices.getUserMedia(z).catch(W=>{console.error(W,"navigator.mediaDevices.getUserMedia: failed")})}function P(){a.value&&a.value.srcObject&&a.value.srcObject.getTracks().forEach(L=>{L.stop()})}async function Q(){return a.value.srcObject=await v(),s.value=await navigator.mediaDevices.enumerateDevices(),{stream:a.value.srcObject,devices:s.value}}function G(){A.value?(A.value=!1,m.value=!1,P()):(A.value=!0,Q())}function ue(){s.value.length>1&&(P(),u.value=u.value&&u.value.deviceId===$.value[0].deviceId?$.value[$.value.length-1]:$.value[0],Q())}async function Ce(V,L){P(),V&&(!L||V.deviceId!==L.deviceId)&&await Q()}e.watch(()=>u.value,Ce),e.watch(()=>c.value,Ce);function me(){o.countdown?(b.value=b.value?b.value-1:o.countdown,b.value?setTimeout(me,1e3):Ve()):Ve()}d({onCapture:me,camera:a.value});function Ve(){m.value=!0;const V=i.value.getContext("2d"),L=a.value,z=L&&L.srcObject&&L.srcObject.getTracks(),{aspectRatio:W,width:Ee,height:re}=z.length&&z[0].getSettings(),J=L?.videoWidth||Ee||f.value,U=L?.videoHeight||re||h.value,Y=J&&U?J/U:W,te=D.value||{width:J,height:U},fe=te?.width||J,$e=w.value?te?.height||U:Math.round(fe/Y),ae=fe/$e;if(i.value.width=fe,i.value.height=$e,!J||!U||!Y)return;if(V.save(),ee.value&&(V.translate(i.value.width,0),V.scale(-1,1)),o.enableCropImage){let _=0,ne=0,K=J,le=U;Y>ae?(K=U*ae,_=(J-K)/2):Y<ae&&(le=J/ae,ne=(U-le)/2),V.drawImage(L,_,ne,K,le,0,0,i.value.width,i.value.height)}else{let _=i.value.width,ne=i.value.height,K=0,le=0;Y>ae?(ne=i.value.width/Y,le=(i.value.height-ne)/2):Y<ae&&(_=i.value.height*Y,K=(i.value.width-_)/2),ee.value&&(K=i.value.width-K-_),V.drawImage(L,0,0,J,U,K,le,_,ne)}V.restore(),x(V,i.value.width,i.value.height);const se=i.value.toDataURL("image/png");R(se)}function R(V){const L=Bt(V);n("update:modelValue",{name:`cam-pic-${new Date().toISOString()}`,id:`cam-pic-${new Date().toISOString()}`,blob:L,size:L.size})}return e.onMounted(async()=>{P(),await Q(),u.value=$.value[0],o.enableAudio&&(c.value=q.value[0]),navigator.mediaDevices.addEventListener("devicechange",async V=>{await Q()}),o.defaultRearCamera&&ue(),G(),window.addEventListener("resize",E),ie(),await e.nextTick(),r.value=!0}),e.onBeforeUnmount(()=>{A.value=!1,m.value=!1,P(),window.removeEventListener("resize",E)}),(V,L)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["camera",de.value])},[e.createElementVNode("div",so,[r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",co,[e.createVNode(ge,{color:"#000"},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass("d-block text-center"),innerHTML:V.$t("camera.waitForCameraNotification")},null,8,uo)]),_:1})])),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["camera__video-wrapper",w.value?`aspect-ratio--${w.value}`:""]),style:e.normalizeStyle(B.value?{aspectRatio:B.value}:void 0)},[e.createElementVNode("video",{ref_key:"camera",ref:a,class:"camera__video",style:e.normalizeStyle({filter:o.filter==="grayscale"?"grayscale(100%)":o.filter==="sepia"?"sepia(100%)":"none"}),autoplay:"",playsinline:""},null,4),t.tintColor?(e.openBlock(),e.createElementBlock("div",{key:0,class:"camera__tint-overlay",style:e.normalizeStyle({backgroundColor:t.tintColor,opacity:t.tintIntensity,mixBlendMode:"multiply"})},null,4)):e.createCommentVNode("",!0)],6),[[e.vShow,r.value]]),e.withDirectives(e.createElementVNode("canvas",{ref_key:"canvas",ref:i,class:"camera__canvas",width:f.value,height:h.value},null,8,mo),[[e.vShow,m.value]]),b.value?(e.openBlock(),e.createElementBlock("div",fo,[(e.openBlock(),e.createElementBlock("p",{class:"countdown",key:b.value,innerHTML:b.value,"data-countdown":b.value},null,8,po))])):e.createCommentVNode("",!0),t.enableGuide&&A.value&&r.value?(e.openBlock(),e.createElementBlock("img",{key:2,class:"camera__guide",src:t.guideSrc},null,8,go)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ho,[e.createElementVNode("div",yo,[e.createElementVNode("div",bo,[e.createElementVNode("div",ko,[e.createElementVNode("div",wo,[e.createElementVNode("button",{type:"button",class:"camera__toggle btn btn-primary",onClick:G},[A.value?(e.openBlock(),e.createElementBlock("span",Co,e.toDisplayString(V.$t("common.pause")),1)):(e.openBlock(),e.createElementBlock("span",Bo,e.toDisplayString(V.$t("common.play")),1))]),e.createElementVNode("button",{type:"button",class:"camera__capture btn btn-primary",onClick:me},e.toDisplayString(V.$t("camera.capture")),1)])])])])]),t.enableSwitchCamera&&$.value&&$.value.length>1?(e.openBlock(),e.createElementBlock("div",Vo,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(ue,["prevent"])},[e.createVNode(M,{symbol:"switch-camera"})])])):e.createCommentVNode("",!0),t.enableSelectDevice?(e.openBlock(),e.createElementBlock("div",Eo,[q.value.length&&c.value?(e.openBlock(),e.createBlock(ke,{key:0,modelValue:j.value,"onUpdate:modelValue":L[0]||(L[0]=z=>j.value=z),options:q.value.map((z,W)=>({text:z.label||`Microphone ${W+1}`,value:z.deviceId}))},null,8,["modelValue","options"])):e.createCommentVNode("",!0),$.value.length?(e.openBlock(),e.createBlock(ke,{key:1,modelValue:X.value,"onUpdate:modelValue":L[1]||(L[1]=z=>X.value=z),options:$.value.map((z,W)=>({text:z.label||`Camera ${W+1}`,value:z.deviceId}))},null,8,["modelValue","options"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),No={class:"base-map"},Mo={key:0,class:"base-map__label"},Do={key:0,class:"base-map__hint"},Je=e.defineComponent({__name:"base-map",props:{label:{type:String,default:""},modelValue:{type:Object,default:null},center:{type:Object,default:()=>({lat:48.8566,lng:2.3522})},zoom:{type:Number,default:13},markers:{type:Array,default:()=>[]},routeCoordinates:{type:Array,default:()=>[]},routeColor:{type:String,default:"#2563eb"},routeWeight:{type:Number,default:5},selectionRadius:{type:Number,default:0},selectionRadiusCenter:{type:Object,default:null},selectionRadiusColor:{type:String,default:"#2563eb"},selectionRadiusFillColor:{type:String,default:"#60a5fa"},selectionRadiusFillOpacity:{type:Number,default:.14},selectionRadiusOpacity:{type:Number,default:.65},selectionRadiusStrokeWeight:{type:Number,default:2},userLocation:{type:Object,default:null},userLocationLabel:{type:String,default:"Your location"},selectedLocationLabel:{type:String,default:"Selected location"},height:{type:String,default:"20rem"},interactive:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},showSelectedMarker:{type:Boolean,default:!0},helperText:{type:String,default:""},mapStyle:{type:String,default:"streets"},tileLayerUrl:{type:String,default:""},tileLayerAttribution:{type:String,default:""}},emits:["update:modelValue","update:center","update:zoom","map-click","marker-click"],setup(t,{emit:d}){function l(E,v){return v({className:"base-map__marker-wrapper",html:`<span class="base-map__marker-pin base-map__marker-pin--${E}"><span class="base-map__marker-core"></span></span>`,iconSize:[24,24],iconAnchor:[12,24],popupAnchor:[0,-20]})}const o={lat:48.8566,lng:2.3522},n={streets:{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'},light:{url:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>'},dark:{url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>'},minimal:{url:"https://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}{r}.png",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>'},popover:{url:"https://{s}.basemaps.cartocdn.com/rastertiles/voyager_nolabels/{z}/{x}/{y}{r}.png",attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>'}},a=t,i=d,r=e.shallowRef(null),s=e.ref(null),u=e.ref(null),c=e.ref(a.zoom),A=e.ref(B(a.modelValue));e.onMounted(async()=>{if(typeof window>"u")return;const[E,v]=await Promise.all([import("@vue-leaflet/vue-leaflet"),import("leaflet")]);r.value=e.markRaw({LCircle:e.markRaw(E.LCircle),LMap:e.markRaw(E.LMap),LMarker:e.markRaw(E.LMarker),LPopup:e.markRaw(E.LPopup),LPolyline:e.markRaw(E.LPolyline),LTileLayer:e.markRaw(E.LTileLayer)}),s.value={list:l("list",v.divIcon),selected:l("selected",v.divIcon),search:l("search",v.divIcon),user:l("user",v.divIcon)}}),e.watch(()=>a.zoom,E=>{c.value=E}),e.watch(()=>a.modelValue,E=>{A.value=B(E)}),e.watch(()=>a.center,E=>{const v=B(E);v&&j(v)},{deep:!0}),e.watch(()=>[a.height,a.markers.length,a.routeCoordinates.length,a.center?.lat,a.center?.lng,a.modelValue?.lat,a.modelValue?.lng,a.userLocation?.lat,a.userLocation?.lng],()=>{X()},{flush:"post"});const m=e.computed(()=>B(a.userLocation)),f=e.computed(()=>B(a.selectionRadiusCenter)||A.value),h=e.computed(()=>{const E=(a.markers||[]).map(v=>{const P=B(v);return P?{...v,...P,type:v.type||(A.value&&q(v,A.value)?"selected":"list")}:null}).filter(v=>!!v);return a.showSelectedMarker&&A.value&&!E.some(v=>q(v,A.value))&&E.push({id:"selected-location",label:a.selectedLocationLabel,type:"search",...A.value}),E}),b=e.computed(()=>(a.routeCoordinates||[]).map(E=>$(E)).filter(E=>!!E)),N=e.computed(()=>{const E=B(a.center)||A.value||B(a.markers[0])||o;return[E.lat,E.lng]}),y=e.computed(()=>{if(a.tileLayerUrl.trim())return a.tileLayerUrl;const E=a.mapStyle==="custom"?"streets":a.mapStyle;return n[E].url}),g=e.computed(()=>{if(a.tileLayerAttribution.trim())return a.tileLayerAttribution;const E=a.mapStyle==="custom"?"streets":a.mapStyle;return n[E].attribution});function w(E="list"){if(s.value)return s.value[E]||s.value.list}function D(E="list"){switch(E){case"user":return 450;case"selected":return 350;case"search":return 250;default:return 150}}function B(E){if(!E)return null;const v=Number(E.lat),P=Number(E.lng);return Number.isNaN(v)||Number.isNaN(P)?null:{lat:v,lng:P}}function $(E){if(Array.isArray(E)){const P=Number(E[0]),Q=Number(E[1]);return Number.isFinite(P)&&Number.isFinite(Q)?[P,Q]:null}const v=B(E);return v?[v.lat,v.lng]:null}function q(E,v){const P=B(E),Q=B(v);return!P||!Q?!1:Math.abs(P.lat-Q.lat)<1e-6&&Math.abs(P.lng-Q.lng)<1e-6}async function X(){await e.nextTick(),u.value?.invalidateSize()}function j(E){u.value?.panTo([E.lat,E.lng])}function ee(E){u.value=E,j(B(a.center)||A.value||o),X()}function de(E){c.value=E,i("update:zoom",E)}function Be(E){const v=B(E);v&&(j(v),i("update:center",v))}function x(E){if(!a.interactive||a.disabled)return;const v={lat:Number(E.latlng.lat.toFixed(6)),lng:Number(E.latlng.lng.toFixed(6))};A.value=v,j(v),i("update:modelValue",v),i("update:center",v),i("map-click",v)}function ie(E){A.value={lat:Number(E.lat),lng:Number(E.lng)},j(A.value),i("update:modelValue",A.value),i("update:center",A.value),i("marker-click",E)}return(E,v)=>(e.openBlock(),e.createElementBlock("div",No,[e.renderSlot(E.$slots,"label",{},()=>[t.label?(e.openBlock(),e.createElementBlock("label",Mo,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["base-map__frame",{"base-map__frame--interactive":t.interactive&&!t.disabled,"base-map__frame--disabled":t.disabled}]),style:e.normalizeStyle({height:t.height}),"data-testid":"base-map"},[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value?.LMap),{key:0,class:"base-map__canvas","use-global-leaflet":!1,zoom:c.value,center:N.value,onReady:ee,onClick:x,"onUpdate:zoom":de,"onUpdate:center":Be},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.LTileLayer),{url:y.value,attribution:g.value,"layer-type":"base",name:"OpenStreetMap"},null,8,["url","attribution"])),b.value.length>1?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.LPolyline),{key:0,"lat-lngs":b.value,color:t.routeColor,weight:t.routeWeight},null,8,["lat-lngs","color","weight"])):e.createCommentVNode("",!0),f.value&&t.selectionRadius>0?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.LCircle),{key:1,"lat-lng":[f.value.lat,f.value.lng],radius:t.selectionRadius,color:t.selectionRadiusColor,"fill-color":t.selectionRadiusFillColor,"fill-opacity":t.selectionRadiusFillOpacity,opacity:t.selectionRadiusOpacity,weight:t.selectionRadiusStrokeWeight},null,8,["lat-lng","radius","color","fill-color","fill-opacity","opacity","weight"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(P,Q)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.LMarker),{key:P.id??`${P.lat}-${P.lng}-${Q}`,"lat-lng":[P.lat,P.lng],icon:w(P.type),"z-index-offset":D(P.type),onClick:G=>ie(P)},{default:e.withCtx(()=>[P.label?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.LPopup),{key:0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(P.label),1)]),_:2},1024)):e.createCommentVNode("",!0)]),_:2},1032,["lat-lng","icon","z-index-offset","onClick"]))),128)),m.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.LMarker),{key:2,"lat-lng":[m.value.lat,m.value.lng],icon:w("user"),"z-index-offset":D("user"),onClick:v[0]||(v[0]=P=>ie({id:"user-location",label:t.userLocationLabel,type:"user",...m.value}))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.LPopup),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.userLocationLabel),1)]),_:1}))]),_:1},8,["lat-lng","icon","z-index-offset"])):e.createCommentVNode("",!0)]),_:1},40,["zoom","center"])):e.createCommentVNode("",!0)],6),t.interactive&&t.helperText?(e.openBlock(),e.createElementBlock("p",Do,e.toDisplayString(t.helperText),1)):e.createCommentVNode("",!0)]))}}),vo={class:"location-list","data-testid":"location-list"},Lo={key:0,class:"location-list__label"},Io={key:1,class:"location-list__items"},Po=["data-testid","onClick"],To={class:"location-list__title"},xo={key:0,class:"location-list__description"},zo={key:1,class:"location-list__distance"},Ro={key:2,class:"location-list__empty"},_e=e.defineComponent({__name:"location-list",props:{modelValue:{type:null,default:null},locations:{type:Array,default:()=>[]},label:{type:String,default:""},titleKey:{type:String,default:"title"},descriptionKey:{type:String,default:"address"},emptyText:{type:String,default:"No locations found."},showDistance:{type:Boolean,default:!0}},emits:["update:modelValue","select"],setup(t,{emit:d}){const l=t,o=d;function n(A){return A?.[l.titleKey]||A?.label||A?.name||"Location"}function a(A){return A?.[l.descriptionKey]||A?.description||A?.subtitle||""}function i(A,m=0){return A?typeof A!="object"?A:A.id??A.value??n(A)??m:m}function r(A,m=0){return`${i(A,m)}`.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function s(A,m=0){return i(l.modelValue)===i(A,m)}function u(A){return Number.isFinite(A)?A>=1e3?`${(A/1e3).toFixed(1)} km`:`${Math.round(A)} m`:"—"}function c(A){o("update:modelValue",A),o("select",A)}return(A,m)=>(e.openBlock(),e.createElementBlock("div",vo,[t.label?(e.openBlock(),e.createElementBlock("p",Lo,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),t.locations.length?(e.openBlock(),e.createElementBlock("div",Io,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.locations,(f,h)=>(e.openBlock(),e.createElementBlock("button",{key:i(f,h),type:"button",class:e.normalizeClass(["location-list__item",{"location-list__item--active":s(f,h)}]),"data-testid":`location-option-${r(f,h)}`,onClick:b=>c(f)},[e.createElementVNode("strong",To,e.toDisplayString(n(f)),1),a(f)?(e.openBlock(),e.createElementBlock("small",xo,e.toDisplayString(a(f)),1)):e.createCommentVNode("",!0),t.showDistance&&f?.distance!==void 0&&f?.distance!==null?(e.openBlock(),e.createElementBlock("small",zo,e.toDisplayString(u(Number(f.distance)))+" away ",1)):e.createCommentVNode("",!0)],10,Po))),128))])):(e.openBlock(),e.createElementBlock("p",Ro,e.toDisplayString(t.emptyText),1))]))}});function Ge(t=null,d){const l=e.ref(!1),o=e.ref([]),n=e.ref([]),a=e.ref(!1),i=e.ref(!1),r=e.computed(()=>t.modelValue?.length?t.modelValue:t.src?[{type:"",src:t.src}]:n.value);async function s(b){const N=new FormData;N.append("file",b),l.value=!0;const g=await(t.customFetch||pe.ofetch)(t.endpoint,{method:"POST",...t.customFetch?{}:{headers:{Accept:"application/json",...t.authToken?{Authorization:`Bearer ${t.authToken}`}:{}}},body:N}).catch(D=>{console.error("Error",D)});return l.value=!1,`${t.baseResponsePath||"/api/v1/assets"}/${g.path}`}function u(b){const N=typeof b=="string"?parseInt(b,10):b,y=Array.isArray(t.modelValue)&&t.modelValue.length>0,g=Array.isArray(n.value)&&n.value.length>0;if(g&&N<n.value.length&&n.value.splice(N,1),y){const w=[...t.modelValue];N<w.length&&w.splice(N,1),d?.("update:modelValue",w),t.multiple||d?.("update:src",w[0]?.src||"")}else if(g){const w=t.multiple?n.value:n.value[0];d?.("update:modelValue",w),t.multiple||d?.("update:src",n.value[0]?.src||"")}else d?.("update:modelValue",t.multiple?[]:void 0),d?.("update:src","");o.value.splice(N,1),a.value=!1}function c(b){b.preventDefault(),i.value=!0}function A(b){b.preventDefault(),i.value=!1}function m(b){b.preventDefault(),i.value=!1;const N=b.dataTransfer,y=N&&Array.from(N.files||[]);o.value=y||[]}function f(){t.dropFiles&&(["dragenter","dragover"].forEach(b=>{document.body.addEventListener(b,c,!1)}),["dragleave","drop"].forEach(b=>{document.body.addEventListener(b,A,!1)}),document.body.addEventListener("drop",m,!1))}function h(){t.dropFiles&&(["dragenter","dragover"].forEach(b=>{document.body.removeEventListener(b,c,!1)}),["dragleave","drop"].forEach(b=>{document.body.removeEventListener(b,A,!1)}),document.body.removeEventListener("drop",m,!1))}return e.onMounted(()=>{f()}),e.onBeforeUnmount(()=>{h()}),{pending:l,files:o,dataUrls:n,imgLoaded:a,isDragging:i,thumbnails:r,uploadFile:s,removeFile:u,dragStart:c,dragStop:A,dragDrop:m,setupDragAndDrop:f,cleanupDragAndDrop:h}}const Qo=["src"],Fo=["onClick"],Oo=["onClick"],Ho=["for"],Wo=["innerHTML"],Uo={key:0,class:"file-upload__loading-spinner"},Ye=e.defineComponent({__name:"file-upload",props:{modelValue:{type:Array,default:[]},src:{type:String},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},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},maxFileSize:{type:Number,default:0},endpoint:{type:String,default:""},toDataUrl:{type:Boolean,default:!0},authToken:{type:String,default:""},customFetch:null,baseResponsePath:{type:String,default:"/api/v1/assets"},enablePreview:{type:Boolean,default:!0},previewWidth:{type:Number,default:0},dropFiles:{type:Boolean,default:!1}},emits:["update:modelValue","update:src"],setup(t,{emit:d}){const l=t,o=d,{pending:n,files:a,dataUrls:i,isDragging:r,thumbnails:s,uploadFile:u,removeFile:c}=Ge(l,o);return e.watch(()=>a.value,async A=>{i.value=await Promise.all(A.map(async m=>({src:l.toDataUrl?await ye(m):await u(m),type:m.type})))},{deep:!0}),e.watch(()=>i.value,async A=>{const m=l.multiple?A:A[0];o("update:modelValue",m),l.multiple||o("update:src",A[0]&&A[0].src)},{deep:!0}),(A,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["file-upload",{"has-dragging":t.dropFiles,"is-dragging":e.unref(r)}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),(f,h)=>(e.openBlock(),e.createElementBlock("div",{key:f.src,class:e.normalizeClass(t.enablePreview?"file-upload__thumbnail":"file-upload__reset")},[t.enablePreview?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("img",{src:`${f.src}${t.previewWidth?`?width=${t.previewWidth}`:""}`,class:"img-thumbnail rounded"},null,8,Qo),e.createElementVNode("button",{onClick:e.withModifiers(b=>e.unref(c)(h),["prevent"]),class:"btn btn--close"},[e.createVNode(M,{symbol:"x"})],8,Fo)],64)):(e.openBlock(),e.createElementBlock("button",{key:1,onClick:e.withModifiers(b=>e.unref(c)(h),["prevent"]),class:"btn btn--close btn-outline-contrast"},[e.createVNode(M,{symbol:"x"})],8,Oo))],2))),128)),e.createVNode(Le,{modelValue:e.unref(a),"onUpdate:modelValue":m[0]||(m[0]=f=>e.isRef(a)?a.value=f:null),id:t.id,name:t.name,accept:t.accept,"max-file-size":t.maxFileSize,class:"d-none"},null,8,["modelValue","id","name","accept","max-file-size"]),e.createElementVNode("label",{for:t.id,class:"file-upload__label"},[e.renderSlot(A.$slots,"button",{},()=>[e.createElementVNode("span",{class:"btn btn-outline-contrast",innerHTML:t.label||A.$t("common.selectFile")},null,8,Wo)]),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(n)?(e.openBlock(),e.createElementBlock("span",Uo,[...m[1]||(m[1]=[e.createElementVNode("span",{class:"spinner-border",role:"status"},[e.createElementVNode("span",{class:"visually-hidden"},"Loading...")],-1)])])):e.createCommentVNode("",!0)]),_:1})],8,Ho)],2))}}),qo=["onDragenter","onDragover","onDragleave","onDragend","onDrop","innerHTML"],jo=["onDragstart","onDrag","onDragenter","onDragover","onDragleave","onDragend","onDrop"],Jo={key:0,class:"sortable-list__drag-handle"},_o={type:"button",class:"btn",draggable:"true"},Go={key:0,class:"sortable-list__item"},Ke=e.defineComponent({__name:"sortable-list",props:{modelValue:{type:Array,default:()=>[]},config:{type:Object,default:null},messages:{type:Object,default:{}},vertical:{type:Boolean,default:!0},showDragHandle:{type:Boolean,default:!1},showPreview:{type:Boolean,default:!0}},emits:["update:modelValue","update:isDragging","update:dragIndex","update:dragOverIndex"],setup(t,{emit:d}){const l=t,o=e.ref(!1),n=e.ref(null),a=e.ref(null),i=d,r=e.computed({get(){return l.modelValue},set(g){i("update:modelValue",g)}}),s=e.computed(()=>{const g=document.querySelector(".is-drag-item")?.outerHTML;return g?F(g):""}),u=e.useSlots(),c=e.computed(()=>u["list-append"]);function A(g,w){g.dataTransfer&&(g.dataTransfer.dropEffect="move",g.dataTransfer.effectAllowed="move",g.dataTransfer.setData("index",w.toLocaleString()),o.value=!0,n.value=w)}function m(g,w){o.value=!1,n.value=null,a.value=null}function f(g,w){}function h(g,w){a.value=n.value!==w?w:null}function b(g,w){a.value=n.value!==w?w:null}function N(g,w){}function y(g,w){if(g.dataTransfer){g.preventDefault();const D=Number(g.dataTransfer.getData("index")),B=w,$=[...r.value];(B||B===0)&&(D||D===0)&&$.splice(B,0,$.splice(D,1)[0]),r.value=$}}return e.watch(()=>o.value,g=>{i("update:isDragging",g)},{immediate:!0}),e.watch(()=>n.value,g=>{i("update:dragIndex",g)},{immediate:!0}),e.watch(()=>a.value,g=>{i("update:dragOverIndex",g)},{immediate:!0}),(g,w)=>(e.openBlock(),e.createBlock(e.TransitionGroup,{name:"list",tag:"ul",class:e.normalizeClass(["sortable-list p-0 d-flex gap-2",{"flex-column":t.vertical,"flex-row flex-wrap":!t.vertical}]),onDragover:w[0]||(w[0]=e.withModifiers(()=>{},["prevent"])),onDragenter:w[1]||(w[1]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(D,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B},[t.showPreview&&o.value&&a.value===B?(e.openBlock(),e.createElementBlock("li",{key:0,class:"sortable-list__item is-drop-target",onDragenter:$=>h($,B),onDragover:$=>b($,B),onDragleave:$=>void 0,onDragend:$=>m(),onDrop:$=>y($,B),innerHTML:s.value},null,40,qo)):e.createCommentVNode("",!0),e.createElementVNode("li",{class:e.normalizeClass(["sortable-list__item d-flex",{"is-drag-item":o.value&&n.value===B,"is-drop-target":o.value&&a.value===B&&!t.showPreview,"align-items-center gap-2":t.vertical}]),draggable:!0,onDragstart:$=>A($,B),onDrag:$=>void 0,onDragenter:$=>h($,B),onDragover:$=>b($,B),onDragleave:$=>void 0,onDragend:$=>m(),onDrop:$=>y($,B)},[t.showDragHandle?(e.openBlock(),e.createElementBlock("div",Jo,[e.createElementVNode("button",_o,[e.createVNode(M,{symbol:"drag"})])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["sortable-list__item-content",{"flex-grow-1":t.vertical}])},[e.renderSlot(g.$slots,"list-item",{item:D,index:B},()=>[e.createTextVNode(e.toDisplayString(D),1)])],2)],42,jo)],64))),128)),c.value?(e.openBlock(),e.createElementBlock("li",Go,[e.renderSlot(g.$slots,"list-append")])):e.createCommentVNode("",!0)]),_:3},8,["class"]))}}),Yo={key:0,class:"image-editor position-relative"},Ko={class:"row mb-3"},Zo={class:"col"},Xo={class:"row gap-2 mb-4"},ei={class:"col-12"},ti={class:"input mb-2"},ai={class:"col"},ni={class:"input mb-0"},li={class:"col"},oi={class:"input mb-0"},ii={class:"row"},ri={class:"col d-flex justify-content-end gap-2"},Ai=["disabled"],Ze=e.defineComponent({__name:"image-resize",props:{modelValue:{type:String,default:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>',required:!0},spinner:{type:Boolean,default:!1},ready:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:d}){const l=d,o=e.useTemplateRef("image"),n=e.ref(1),a=e.ref(0),i=e.ref(0),r=e.ref(null),s=e.ref(0),u=e.ref(0);function c(){r.value&&(l("update:modelValue",r.value),n.value=1)}const A=()=>{if(!s.value||!u.value)return;a.value=Math.round(s.value*n.value);const f=u.value/s.value;i.value=Math.round(a.value*f);const h=o.value?.$el;if(!h)return;const b=h.querySelector("img");b&&(r.value=Re(b,a.value,i.value,"image/png"))},m=Me.debounce(A,300);return e.watch(n,()=>{s.value&&(a.value=Math.round(s.value*n.value),m())}),e.watch(a,()=>{if(!s.value||a.value===0)return;const f=a.value/s.value;Math.abs(f-n.value)>1e-4&&(n.value=Number(f.toFixed(4)));const h=u.value/s.value;i.value=Math.round(a.value*h),m()}),e.watch(i,()=>{if(!u.value||i.value===0)return;const f=i.value/u.value;Math.abs(f-n.value)>1e-4&&(n.value=Number(f.toFixed(4)));const h=s.value/u.value;a.value=Math.round(i.value*h),m()}),e.onMounted(()=>{const f=o.value?.$el;if(!f)return;const h=f.querySelector("img");if(!h)return;const b=()=>{s.value=h.naturalWidth,u.value=h.naturalHeight,A()};h.complete?b():h.addEventListener("load",b)}),(f,h)=>t.modelValue?(e.openBlock(),e.createElementBlock("div",Yo,[e.createElementVNode("div",Ko,[e.createElementVNode("div",Zo,[e.createVNode(oe,{ref_key:"image",ref:o,class:"d-none",src:t.modelValue,animate:!1},null,8,["src"]),r.value?(e.openBlock(),e.createBlock(oe,{key:0,ref:"targetImage",class:"",src:r.value,animate:!1},null,8,["src"])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Xo,[e.createElementVNode("div",ei,[e.createElementVNode("div",ti,[e.withDirectives(e.createElementVNode("input",{type:"range",class:"form-range",id:"scaleRange","onUpdate:modelValue":h[0]||(h[0]=b=>n.value=b),min:"0",max:"2",step:"0.0001"},null,512),[[e.vModelText,n.value]])])]),e.createElementVNode("div",ai,[e.createElementVNode("div",ni,[e.createVNode(Ae,{type:"number",class:"form-input mb-0",id:"targetWidth",modelValue:a.value,"onUpdate:modelValue":h[1]||(h[1]=b=>a.value=b)},null,8,["modelValue"])])]),h[3]||(h[3]=e.createElementVNode("div",{class:"col-auto d-flex align-items-center"},[e.createElementVNode("output",null,"×")],-1)),e.createElementVNode("div",li,[e.createElementVNode("div",oi,[e.createVNode(Ae,{type:"number",class:"form-input mb-0",id:"targetHeight",modelValue:i.value,"onUpdate:modelValue":h[2]||(h[2]=b=>i.value=b)},null,8,["modelValue"])])])]),e.createElementVNode("div",ii,[e.createElementVNode("div",ri,[e.renderSlot(f.$slots,"actions"),e.createElementVNode("button",{class:"btn btn-sm btn-primary",disabled:!r.value,onClick:e.withModifiers(c,["prevent","stop"])},e.toDisplayString(f.$t("common.apply")),9,Ai)])])])):e.createCommentVNode("",!0)}}),si={key:0,class:"image-crop"},ci={class:"row mb-4"},di={class:"col"},ui={class:"row"},mi={class:"col d-flex gap-2 justify-content-end gap-2"},Xe=e.defineComponent({__name:"image-crop",props:{modelValue:{type:String,default:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>',required:!0},spinner:{type:Boolean,default:!1},ready:{type:Boolean,default:!1},aspectRatioOptions:{type:Array,default:()=>[{value:0,text:"Free"},{value:1,text:"1:1"},{value:4/3,text:"4:3"},{value:16/9,text:"16:9"},{value:3/4,text:"3:4"},{value:9/16,text:"9:16"}]},suggestedAspectRatio:Number},emits:["update:modelValue"],setup(t,{emit:d}){const l=t,o=d,n=e.useTemplateRef("cropper"),a=e.ref(0);function i(){const{canvas:r}=n.value?.getResult(),s=r.toDataURL();o("update:modelValue",s)}return e.onBeforeMount(()=>{a.value=l.suggestedAspectRatio||0}),(r,s)=>t.modelValue?(e.openBlock(),e.createElementBlock("div",si,[e.createElementVNode("div",ci,[e.createElementVNode("div",di,[e.createVNode(e.unref(ut.Cropper),{ref:"cropper",class:"cropper",src:t.modelValue,"stencil-props":{...a.value!==0?{aspectRatio:a.value}:{}},"resize-image":!1},null,8,["src","stencil-props"])])]),s[1]||(s[1]=e.createElementVNode("hr",null,null,-1)),e.createElementVNode("div",ui,[e.createElementVNode("div",mi,[e.createVNode(ke,{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=u=>a.value=u),options:t.aspectRatioOptions,class:"mb-0"},null,8,["modelValue","options"]),e.renderSlot(r.$slots,"actions"),e.createElementVNode("button",{class:"btn btn-sm btn-primary",onClick:e.withModifiers(i,["prevent","stop"])},e.toDisplayString(r.$t("common.apply")),1)])])])):e.createCommentVNode("",!0)}}),fi={key:0,class:"image-crop-resize position-relative"},pi={class:"row"},gi={class:"col"},hi={key:3,class:"alert alert-warning mt-4 small p-2"},yi={key:4},bi={class:"row"},ki={class:"col-12"},wi={class:"d-flex"},Bi={key:0,class:"d-flex gap-3"},Ci={class:"caption"},Vi={class:"caption"},Ei={key:1,class:"ms-auto"},et=e.defineComponent({__name:"image-crop-resize",props:{modelValue:{type:String,default:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>',required:!0},spinner:{type:Boolean,default:!1},ready:{type:Boolean,default:!1},aspectRatio:Number},emits:["update:modelValue"],setup(t,{emit:d}){const l=t,o=d,n=e.ref(!1),a=e.ref(!1),i=e.computed({get:()=>l.modelValue,set:s=>o("update:modelValue",s)}),r=e.computed(()=>l.modelValue.startsWith("data:image/svg+xml"));return e.watch(()=>[n.value,i.value],(s,u)=>{s[0]&&s[0]===u[0]&&(n.value=!1)}),e.watch(()=>[a.value,i.value],(s,u)=>{s[0]&&s[0]===u[0]&&(a.value=!1)}),e.onMounted(()=>{}),(s,u)=>t.modelValue?(e.openBlock(),e.createElementBlock("div",fi,[e.createElementVNode("div",pi,[e.createElementVNode("div",gi,[n.value||a.value?n.value?(e.openBlock(),e.createBlock(Ze,{key:1,modelValue:i.value,"onUpdate:modelValue":u[1]||(u[1]=c=>i.value=c)},{actions:e.withCtx(()=>[e.createElementVNode("button",{class:"btn btn-outline-ccontrast",onClick:u[0]||(u[0]=e.withModifiers(c=>n.value=!1,["prevent","stop"]))},e.toDisplayString(s.$t("common.cancel")),1)]),_:1},8,["modelValue"])):a.value?(e.openBlock(),e.createBlock(Xe,{key:2,modelValue:i.value,"onUpdate:modelValue":u[3]||(u[3]=c=>i.value=c),"suggested-aspect-ratio":t.aspectRatio},{actions:e.withCtx(()=>[e.createElementVNode("button",{class:"btn btn-sm btn-outline-ccontrast",onClick:u[2]||(u[2]=e.withModifiers(c=>a.value=!1,["prevent","stop"]))},e.toDisplayString(s.$t("common.cancel")),1)]),_:1},8,["modelValue","suggested-aspect-ratio"])):e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(oe,{key:0,ref:"targetImage",class:"",animate:!1,src:t.modelValue},null,8,["src"])),r.value?(e.openBlock(),e.createElementBlock("div",hi,e.toDisplayString(s.$t("common.svgWarning")),1)):e.createCommentVNode("",!0),!a.value&&!n.value?(e.openBlock(),e.createElementBlock("hr",yi)):e.createCommentVNode("",!0),e.createElementVNode("div",bi,[e.createElementVNode("div",ki,[e.createElementVNode("div",wi,[!a.value&&!n.value?(e.openBlock(),e.createElementBlock("div",Bi,[e.createElementVNode("button",{type:"button",class:"btn btn-light",onClick:u[4]||(u[4]=e.withModifiers(c=>a.value=!a.value,["prevent","stop"]))},[e.createVNode(M,{symbol:"crop"}),e.createElementVNode("span",Ci,e.toDisplayString(s.$t("common.crop")),1)]),e.createElementVNode("button",{type:"button",class:"btn btn-light",onClick:u[5]||(u[5]=e.withModifiers(c=>n.value=!n.value,["prevent","stop"]))},[e.createVNode(M,{symbol:"image-upscale"}),e.createElementVNode("span",Vi,e.toDisplayString(s.$t("common.resize")),1)])])):e.createCommentVNode("",!0),!a.value&&!n.value?(e.openBlock(),e.createElementBlock("div",Ei,[e.renderSlot(s.$slots,"submit")])):e.createCommentVNode("",!0)])])])])])])):e.createCommentVNode("",!0)}}),$i={class:"modal-dialog__content d-flex flex-column"},Si={class:"modal-dialog__header d-flex p-3 border-bottom"},Ni={key:0,class:"modal-dialog__title",id:"exampleModalLabel"},Mi={class:"modal-dialog__body"},Di={key:0,class:"modal-dialog__footer d-flex p-3 border-top"},tt=e.defineComponent({__name:"modal-dialog",props:{modelValue:{type:Boolean,default:!1},modal:{type:Boolean,default:!0},size:{type:String,default:"md"},dismiss:{type:Boolean,default:!0},title:{type:String,default:""},footer:{type:Boolean,default:!0},classes:{type:String,default:""}},emits:["update:modelValue","confirm","cancel"],setup(t,{expose:d,emit:l}){const o=t,n=l,a=e.ref();function i(){document.documentElement.style.setProperty("--scroll-position",`${Math.round(document.documentElement.scrollTop)}px`),o.modal?a.value?.showModal():a.value?.show(),n("update:modelValue",!0)}function r(){const m=a.value&&new KeyframeEffect(a.value,[{translate:"0 -100%",opacity:"0"}],{duration:320,easing:"ease",direction:"normal"}),f=new Animation(m,document.timeline);f.play(),f.addEventListener("finish",()=>{a.value?.close(),s()}),n("update:modelValue",!1)}function s(){const m=getComputedStyle(document.documentElement).getPropertyValue("--scroll-position");document.documentElement.scrollTo({top:parseInt(m,10),behavior:"instant"}),n("update:modelValue",!1)}function u(m){i(),n("confirm",m)}function c(){r(),n("cancel")}function A(m){const f=m.target;f&&f.nodeName==="DIALOG"&&r()}return e.watch(()=>o.modelValue,(m,f)=>{m&&m!==f?i():f&&r()},{immediate:!0}),e.onMounted(()=>{a.value?.addEventListener("cancel",m=>{m.preventDefault(),r()}),o.dismiss&&document.addEventListener("click",A),o.modelValue&&i()}),e.onBeforeUnmount(()=>{o.dismiss&&document.removeEventListener("click",A)}),d({show:i,close:r,confirm:u,cancel:c}),(m,f)=>(e.openBlock(),e.createElementBlock("dialog",{ref_key:"dialog",ref:a,class:e.normalizeClass(["modal-dialog",{[`modal-dialog--${t.size}`]:t.size}]),onClose:s},[e.createElementVNode("div",$i,[e.createElementVNode("div",Si,[t.title?(e.openBlock(),e.createElementBlock("h5",Ni,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"btn-close ms-auto border-radius-none","aria-label":"Close",onClick:r})]),e.createElementVNode("div",Mi,[e.renderSlot(m.$slots,"default")]),t.footer?(e.openBlock(),e.createElementBlock("div",Di,[e.renderSlot(m.$slots,"footer"),e.createElementVNode("button",{type:"button",class:"btn ms-auto",onClick:r},e.toDisplayString(m.$t("common.close")),1)])):e.createCommentVNode("",!0)])],34))}}),vi={class:"image-upload__controls"},Li={class:"d-flex gap-1 align-items-center"},Ii={key:1,class:"image-upload__controls"},Pi=["for"],Ti=["innerHTML"],xi={key:0,class:"image-upload__loading-spinner"},at=e.defineComponent({__name:"image-upload",props:{modelValue:{type:Object,default:void 0},src:{type:String},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},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},accept:{type:String,default:"image/*"},maxFileSize:{type:Number,default:0},endpoint:{type:String,default:""},toDataUrl:{type:Boolean,default:!0},authToken:{type:String,default:""},customFetch:null,baseResponsePath:{type:String,default:"/api/v1/assets"},enablePreview:{type:Boolean,default:!0},previewWidth:{type:Number,default:0},dropFiles:{type:Boolean,default:!1},enableReview:{type:Boolean,default:!0},maxImageWidth:{type:Number,default:4096},aspectRatio:Number},emits:["update:modelValue","update:src"],setup(t,{emit:d}){const l=t,o=d,n=e.ref(!1),a=e.ref(null),i=e.ref(null),r=e.ref(null),{pending:s,files:u,imgLoaded:c,isDragging:A,uploadFile:m,setupDragAndDrop:f,cleanupDragAndDrop:h}=Ge(l,o),b=e.computed(()=>l.modelValue?l.modelValue:l.src?{type:"",src:l.src}:a.value);function N(){a.value=null,u.value=[],c.value=!1,o("update:modelValue",void 0),o("update:src","")}function y(){N()}e.watch(()=>u.value,async D=>{if(!D||!D.length||!D[0])return;c.value=!1;const B=await Et(D[0],l.maxImageWidth);l.enableReview?(i.value={src:await ye(B),type:B.type},n.value=!0):a.value={src:l.toDataUrl?await ye(B):await m(B),type:B.type}}),e.watch(()=>a.value,D=>{o("update:modelValue",D||void 0),o("update:src",D?.src||"")}),e.watch(()=>r.value,async D=>{D&&(a.value={src:await m(D),type:D.type},r.value=null)}),e.watch(()=>n.value,(D,B)=>{!D&&B&&i.value&&(i.value=null,y())}),e.watch(()=>l.src,D=>{!D&&a.value&&y()});function g(D,B){i.value={src:D,type:B},n.value=!0}async function w(){i.value&&(r.value=await ze(i.value.src,"file",i.value.type)),i.value=null,n.value=!1}return e.onMounted(()=>{f()}),e.onBeforeUnmount(()=>{h()}),(D,B)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["image-upload",{"has-dragging":t.dropFiles,"is-dragging":e.unref(A)}])},[!n.value&&b.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mb-2",t.enablePreview?"image-upload__thumbnail":"image-upload__reset"])},[t.enablePreview?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(oe,{src:`${b.value.src}${t.previewWidth?`?width=${t.previewWidth}`:""}`,class:"img-thumbnail rounded",ready:e.unref(c),"onUpdate:ready":B[0]||(B[0]=$=>e.isRef(c)?c.value=$:null),animate:!1,style:e.normalizeStyle({maxWidth:t.previewWidth?`${t.previewWidth}px`:"auto",height:"auto"})},null,8,["src","ready","style"]),e.createElementVNode("div",vi,[e.createElementVNode("div",Li,[e.createElementVNode("button",{type:"button",onClick:B[1]||(B[1]=e.withModifiers($=>g(b.value.src,b.value.type),["prevent","stop"])),class:"btn btn--edit btn-sm btn-light"},[e.createVNode(M,{symbol:"edit-2"})]),e.createElementVNode("button",{type:"button",onClick:B[2]||(B[2]=e.withModifiers($=>N(),["prevent","stop"])),class:"btn btn--close btn-sm btn-light"},[e.createVNode(M,{symbol:"x"})])])])],64)):(e.openBlock(),e.createElementBlock("div",Ii,[e.createElementVNode("button",{onClick:B[3]||(B[3]=e.withModifiers($=>N(),["prevent","stop"])),class:"btn btn--close btn-outline-contrast"},[e.createVNode(M,{symbol:"x"})])]))],2)):e.createCommentVNode("",!0),e.createVNode(Le,{modelValue:e.unref(u),"onUpdate:modelValue":B[4]||(B[4]=$=>e.isRef(u)?u.value=$:null),id:t.id,name:t.name,accept:t.accept,"max-file-size":t.maxFileSize,class:"d-none"},null,8,["modelValue","id","name","accept","max-file-size"]),t.src?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",{key:1,for:t.id,class:"image-upload__label"},[e.renderSlot(D.$slots,"button",{},()=>[e.createElementVNode("span",{class:"btn btn-outline-contrast",innerHTML:t.label||D.$t("common.selectFile")},null,8,Ti)]),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(s)?(e.openBlock(),e.createElementBlock("span",xi,[...B[7]||(B[7]=[e.createElementVNode("span",{class:"spinner-border",role:"status"},[e.createElementVNode("span",{class:"visually-hidden"},"Loading...")],-1)])])):e.createCommentVNode("",!0)]),_:1})],8,Pi)),e.createVNode(tt,{modelValue:n.value,"onUpdate:modelValue":B[6]||(B[6]=$=>n.value=$),footer:!1},{default:e.withCtx(()=>[n.value&&i.value?(e.openBlock(),e.createBlock(et,{key:0,modelValue:i.value.src,"onUpdate:modelValue":B[5]||(B[5]=$=>i.value.src=$),"aspect-ratio":t.aspectRatio},{submit:e.withCtx(()=>[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(w,["prevent","stop"])},e.toDisplayString(D.$t("common.save")),1)]),_:1},8,["modelValue","aspect-ratio"])):e.createCommentVNode("",!0)]),_:1},8,["modelValue"])],2))}}),zi={class:"upload-group"},Ri=["innerHTML"],Qi={class:"upload-group__list"},Fi={class:"img-container"},Oi=["src"],Hi=["onClick"],Wi={role:"button",class:"img-thumbnail d-flex justify-content-center align-items-center"},Ui={role:"button",class:"img-thumbnail d-flex justify-content-center align-items-center"},nt=e.defineComponent({__name:"upload-group",props:{modelValue:{type:Array,default:()=>[]},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},label:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},accept:{type:String},maxFileSize:{type:Number,default:0},endpoint:{type:String,default:""},authToken:{type:String,default:""},customFetch:null,baseResponsePath:{type:String,default:"/api/v1/assets"},previewWidth:{type:Number,default:0},useImageUpload:{type:Boolean,default:!1},maxImageWidth:{type:Number,default:0},aspectRatio:Number},emits:["update:modelValue"],setup(t,{emit:d}){const l=t,o=d,n=e.ref(""),a=e.computed({get(){return l.modelValue},set(r){o("update:modelValue",r)}});function i(r){a.value.splice(r,1),o("update:modelValue",a.value)}return e.watch(n,async(r,s)=>{r&&s!==r&&(o("update:modelValue",[...a.value,r]),await e.nextTick(),n.value="")}),(r,s)=>(e.openBlock(),e.createElementBlock("div",zi,[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,innerHTML:e.unref(F)(t.label)},null,8,Ri)):e.createCommentVNode("",!0),e.createElementVNode("div",Qi,[e.createVNode(Ke,{modelValue:a.value,"onUpdate:modelValue":s[2]||(s[2]=u=>a.value=u),vertical:!1,class:"mb-3"},{"list-item":e.withCtx(({item:u,index:c})=>[e.createElementVNode("div",Fi,[e.createElementVNode("img",{src:`${u}${t.previewWidth?`?width=${t.previewWidth}`:""}`,class:"img-thumbnail"},null,8,Oi),e.createElementVNode("button",{onClick:e.withModifiers(A=>i(c),["prevent"]),class:"btn btn--close"},[e.createVNode(M,{symbol:"x"})],8,Hi)])]),"list-append":e.withCtx(()=>[t.useImageUpload?(e.openBlock(),e.createBlock(at,{key:0,src:n.value,"onUpdate:src":s[0]||(s[0]=u=>n.value=u),endpoint:t.endpoint,"custom-fetch":t.customFetch,"to-data-url":!t.endpoint,"auth-token":t.authToken,disabled:t.disabled,"base-response-path":t.baseResponsePath,accept:t.accept,"max-file-size":t.maxFileSize,"max-image-width":t.maxImageWidth,"enable-preview":!1,"aspect-ratio":t.aspectRatio},{button:e.withCtx(()=>[e.createElementVNode("span",Wi,[e.createVNode(M,{symbol:"plus"})])]),_:1},8,["src","endpoint","custom-fetch","to-data-url","auth-token","disabled","base-response-path","accept","max-file-size","max-image-width","aspect-ratio"])):(e.openBlock(),e.createBlock(Ye,{key:1,src:n.value,"onUpdate:src":s[1]||(s[1]=u=>n.value=u),multiple:!1,endpoint:t.endpoint,"custom-fetch":t.customFetch,"to-data-url":!t.endpoint,"auth-token":t.authToken,disabled:t.disabled,"base-response-path":t.baseResponsePath,accept:t.accept,"max-file-size":t.maxFileSize,"max-image-width":t.maxImageWidth},{button:e.withCtx(()=>[e.createElementVNode("span",Ui,[e.createVNode(M,{symbol:"plus"})])]),_:1},8,["src","endpoint","custom-fetch","to-data-url","auth-token","disabled","base-response-path","accept","max-file-size","max-image-width"]))]),_:1},8,["modelValue"])])]))}}),qi={class:"asset-uploader"},ji=["innerHTML"],Ji=e.defineComponent({__name:"asset-uploader",props:{modelValue:{type:Array,default:()=>[]},name:{type:String,default:()=>I()},id:{type:String,default:()=>I()},type:{type:String,default:""},label:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},accept:{type:String},maxFileSize:{type:Number,default:0},endpoint:{type:String,default:""},authToken:{type:String,default:""},customFetch:null,mediaTypeMap:{type:Object,default:()=>({svg:"Svg",png:"Image",jpg:"Image"})},baseResponsePath:{type:String,default:"/api/v1/assets"},previewWidth:{type:Number,default:0},useImageUpload:{type:Boolean,default:!1},maxImageWidth:{type:Number,default:0},aspectRatio:Number},emits:["update:modelValue"],setup(t,{emit:d}){const l=t,o=d,n=e.computed({get(){return l.modelValue.map(a=>a.src)},set(a){o("update:modelValue",a.map((i,r)=>({mediaType:l.modelValue[r]&&l.modelValue[r].mediaType||i.includes("data:image")?i.includes("data:image/svg")?"Svg":"Image":l.mediaTypeMap[i.split(".")[1]],src:i,name:l.modelValue[r]&&l.modelValue[r].name||`${l.name}-${r}`,...l.type?{type:l.type}:{}})))}});return(a,i)=>(e.openBlock(),e.createElementBlock("div",qi,[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,innerHTML:e.unref(F)(t.label)},null,8,ji)):e.createCommentVNode("",!0),e.createVNode(nt,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r),endpoint:t.endpoint,"custom-fetch":t.customFetch,"auth-token":t.authToken,disabled:t.disabled,"preview-width":t.previewWidth,"base-response-path":t.baseResponsePath,accept:t.accept,"max-file-size":t.maxFileSize,"use-image-upload":t.useImageUpload,"max-image-width":t.maxImageWidth,"aspect-ratio":t.aspectRatio},null,8,["modelValue","endpoint","custom-fetch","auth-token","disabled","preview-width","base-response-path","accept","max-file-size","use-image-upload","max-image-width","aspect-ratio"])]))}}),_i="https://router.project-osrm.org/route/v1";function lt(){const t=e.ref([]),d=e.ref(null),l=e.ref(null),o=e.ref([]),n=e.ref(!1),a=e.ref(""),i=e.computed(()=>t.value.length>1);function r(){t.value=[],d.value=null,l.value=null,o.value=[],a.value=""}async function s(u,c,A={}){if(!u||!c)return r(),null;n.value=!0;const m=A.customFetch||pe.ofetch,f=(A.endpoint||_i).replace(/\/$/,""),h=A.profile||"driving";try{const N=(await m(`${f}/${h}/${u.lng},${u.lat};${c.lng},${c.lat}`,{method:"GET",query:{alternatives:!1,overview:"full",steps:!0,geometries:"geojson"}}))?.routes?.[0];if(!N)throw new Error("No route available for these points.");return t.value=Array.isArray(N?.geometry?.coordinates)?N.geometry.coordinates.map(y=>[Number(y[1]),Number(y[0])]).filter(y=>Number.isFinite(y[0])&&Number.isFinite(y[1])):[],d.value=Number.isFinite(N?.distance)?Number(N.distance):null,l.value=Number.isFinite(N?.duration)?Number(N.duration):null,o.value=Array.isArray(N?.legs)?N.legs.flatMap(y=>Array.isArray(y?.steps)?y.steps.map(g=>Gi(g)):[]):[],a.value="",N}catch(b){return r(),a.value=b?.message||"Unable to load directions right now.",null}finally{n.value=!1}}return{routeCoordinates:t,distanceMeters:d,durationSeconds:l,steps:o,pending:n,error:a,hasRoute:i,fetchRoute:s,clearRoute:r}}function Gi(t){const d=`${t?.maneuver?.type||"continue"}`,l=t?.maneuver?.modifier?` ${t.maneuver.modifier}`:"",o=`${t?.name||""}`;return{instruction:`${Yi(d)}${l}${o?` on ${o}`:""}`.trim(),name:o,distance:Number.isFinite(t?.distance)?Number(t.distance):0,duration:Number.isFinite(t?.duration)?Number(t.duration):0}}function Yi(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Ki="https://nominatim.openstreetmap.org/search",Zi="https://nominatim.openstreetmap.org/reverse";function ot(){const t=e.ref([]),d=e.ref(!1),l=e.ref("");function o(){t.value=[],l.value=""}async function n(i,r={}){if(!i.trim())return o(),[];d.value=!0;const s=r.customFetch||pe.ofetch;try{const u=await s(r.endpoint||Ki,{method:"GET",headers:{Accept:"application/json",...r.language?{"Accept-Language":r.language}:{}},query:{q:i,format:"jsonv2",addressdetails:1,limit:r.limit||5}});return t.value=Array.isArray(u)?u.map((c,A)=>it(c,A,"geocoder")).filter(c=>!!c):[],l.value="",t.value}catch(u){return l.value=u?.message||"Unable to search locations right now.",t.value=[],[]}finally{d.value=!1}}async function a(i,r={}){d.value=!0;const s=r.customFetch||pe.ofetch;try{const u=await s(r.reverseEndpoint||Zi,{method:"GET",headers:{Accept:"application/json",...r.language?{"Accept-Language":r.language}:{}},query:{lat:i.lat,lon:i.lng,format:"jsonv2",addressdetails:1}}),c=it(u,0,"reverse-geocoder");return l.value="",c}catch(u){return l.value=u?.message||"Unable to resolve this location right now.",null}finally{d.value=!1}}return{results:t,pending:d,error:l,search:n,reverse:a,clearResults:o}}function it(t,d,l){const o=Number(t?.lat),n=Number(t?.lon??t?.lng);if(!Number.isFinite(o)||!Number.isFinite(n))return null;const a=`${t?.display_name||t?.name||"Location"}`,i=`${t?.name||a.split(",")[0]||"Location"}`.trim();return{id:`${l==="reverse-geocoder"?"reverse":"geo"}-${t?.place_id??d}`,title:i,address:a,lat:o,lng:n,source:l,raw:t}}function rt(t={}){const d=e.ref(null),l=e.ref(""),o=e.ref(!1),n=e.ref(!1),a=typeof window<"u"&&typeof navigator<"u"&&"geolocation"in navigator,i={enableHighAccuracy:!0,timeout:1e4,maximumAge:1e4,...t};let r=null;function s(f){d.value={lat:Number(f.latitude),lng:Number(f.longitude),accuracy:Number.isFinite(f.accuracy)?Number(f.accuracy):null},o.value=!1,l.value=""}function u(f){l.value=typeof f=="string"?f:f instanceof Error?f.message:f.message||"Unable to retrieve your location.",o.value=!1}async function c(){return a?(o.value=!0,new Promise(f=>{navigator.geolocation.getCurrentPosition(({coords:h})=>{s(h),f(d.value)},h=>{u(h),f(null)},i)})):(u("Geolocation is not supported in this browser."),null)}function A(){if(!a){u("Geolocation is not supported in this browser.");return}r===null&&(o.value=!0,n.value=!0,r=navigator.geolocation.watchPosition(({coords:f})=>{s(f)},f=>{u(f),n.value=!1},i))}function m(){if(!a||r===null){n.value=!1,o.value=!1;return}navigator.geolocation.clearWatch(r),r=null,n.value=!1,o.value=!1}return e.onBeforeUnmount(()=>{m()}),{supported:a,position:e.computed(()=>d.value),accuracy:e.computed(()=>d.value?.accuracy??null),error:l,pending:o,isTracking:n,locate:c,startTracking:A,stopTracking:m}}const Xi={class:"location-finder","data-testid":"location-finder"},er={class:"location-finder__actions"},tr=["disabled"],ar={key:1,class:"location-finder__notice","data-testid":"location-finder-error"},nr={class:"location-finder__map-panel"},lr=["aria-label"],or={class:"location-finder__legend-item"},ir={class:"location-finder__legend-item"},rr={class:"location-finder__legend-item"},Ar={class:"location-finder__legend-item"},sr={key:0,class:"location-finder__sidebar"},cr={key:1,class:"location-finder__summary","data-testid":"location-finder-directions"},dr={class:"location-finder__summary-title"},ur={key:0,class:"location-finder__summary-copy"},mr={class:"location-finder__summary-grid"},fr={class:"location-finder__summary-label"},pr={"data-testid":"location-finder-distance"},gr={class:"location-finder__summary-label"},hr={"data-testid":"location-finder-duration"},yr={key:0,class:"location-finder__steps"},br={key:0},kr={key:2,class:"location-finder__summary-copy"},wr=e.defineComponent({__name:"location-finder",props:{modelValue:{type:Object,default:null},locations:{type:Array,default:()=>[]},center:{type:Object,default:null},distance:{type:Number,default:null},userLocation:{type:Object,default:null},messages:{type:Object,default:()=>({})},mapHeight:{type:String,default:"26rem"},searchLabel:{type:String,default:""},searchPlaceholder:{type:String,default:""},resultsLabel:{type:String,default:""},emptyText:{type:String,default:""},locateButtonLabel:{type:String,default:""},stopTrackingLabel:{type:String,default:""},mapHelperText:{type:String,default:""},enableGeocoding:{type:Boolean,default:!1},geocodingEndpoint:{type:String,default:"https://nominatim.openstreetmap.org/search"},reverseGeocodingEndpoint:{type:String,default:"https://nominatim.openstreetmap.org/reverse"},geocodingLimit:{type:Number,default:5},geocodingMinQueryLength:{type:Number,default:3},customGeocodingFetch:null,enableDirections:{type:Boolean,default:!1},directionsEndpoint:{type:String,default:"https://router.project-osrm.org/route/v1"},routeProfile:{type:String,default:"driving"},customDirectionsFetch:null,showDirectionsSummary:{type:Boolean,default:!0},showDirectionsSteps:{type:Boolean,default:!0},directionsTitle:{type:String,default:""},directionsEmptyText:{type:String,default:""},distanceLabel:{type:String,default:""},durationLabel:{type:String,default:""},routeColor:{type:String,default:"#2563eb"},routeWeight:{type:Number,default:5},selectionRadius:{type:Number,default:0},selectionRadiusColor:{type:String,default:"#2563eb"},selectionRadiusFillColor:{type:String,default:"#60a5fa"},mapStyle:{type:String,default:"streets"},tileLayerUrl:{type:String,default:""},tileLayerAttribution:{type:String,default:""},disabled:{type:Boolean,default:!1},interactive:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!0},showLegend:{type:Boolean,default:!0},showSidebar:{type:Boolean,default:!0},showTrackButton:{type:Boolean,default:!0},trackUser:{type:Boolean,default:!0},autoLocate:{type:Boolean,default:!1}},emits:["update:modelValue","update:distance","select","search","track-user"],setup(t,{emit:d}){const l={lat:48.8566,lng:2.3522},o={searchLabel:"Search locations",searchPlaceholder:"Search by name or address",resultsLabel:"Locations",emptyText:"No locations found.",locateButtonLabel:"Use my location",stopTrackingLabel:"Stop tracking",mapHelperText:"Select a location from the list or use the map.",directionsTitle:"Directions",directionsEmptyText:"Select a destination and share your location to preview a route.",distanceLabel:"Distance",durationLabel:"ETA",loadingRoute:"Loading route…",legendAriaLabel:"Map marker types",legendLocations:"Locations",legendSelected:"Selected",legendSearchResult:"Search result",userLocationLabel:"Your location",pinnedLocationTitle:"Pinned location",selectedLocationLabel:"Selected location"},n=t,a=d,{t:i,te:r}=Ne.useI18n({useScope:"global"}),s=rt(),u=ot(),c=lt(),A=e.ref(""),m=e.ref(W(L(n.modelValue))),f=e.ref(W(L(n.modelValue))?null:L(n.modelValue)),h=e.ref(V(n.modelValue)||V(n.center)||V(n.locations[0])||l),b=e.ref(!1),N=e.computed(()=>V(n.userLocation)),y=e.computed(()=>s.position.value||N.value),g=e.computed(()=>V(f.value)),w=e.computed(()=>V(m.value)),D=e.computed(()=>y.value||g.value),B=e.computed(()=>!D.value||!w.value?null:fe(D.value,w.value)),$=e.computed(()=>V(n.modelValue)||g.value||w.value),q=e.computed(()=>s.error.value||u.error.value||c.error.value||""),X=e.computed(()=>n.showSearch||n.trackUser&&n.showTrackButton),j=e.computed(()=>n.enableDirections&&n.showDirectionsSummary),ee=e.computed(()=>n.showSidebar||j.value),de=e.computed(()=>$e(c.distanceMeters.value)),Be=e.computed(()=>ae(c.durationSeconds.value)),x=e.computed(()=>({searchLabel:R("searchLabel",n.searchLabel),searchPlaceholder:R("searchPlaceholder",n.searchPlaceholder),resultsLabel:R("resultsLabel",n.resultsLabel),emptyText:R("emptyText",n.emptyText),locateButtonLabel:R("locateButtonLabel",n.locateButtonLabel),stopTrackingLabel:R("stopTrackingLabel",n.stopTrackingLabel),mapHelperText:R("mapHelperText",n.mapHelperText),directionsTitle:R("directionsTitle",n.directionsTitle),directionsEmptyText:R("directionsEmptyText",n.directionsEmptyText),distanceLabel:R("distanceLabel",n.distanceLabel),durationLabel:R("durationLabel",n.durationLabel),loadingRoute:R("loadingRoute"),legendAriaLabel:R("legendAriaLabel"),legendLocations:R("legendLocations"),legendSelected:R("legendSelected"),legendSearchResult:R("legendSearchResult"),userLocationLabel:R("userLocationLabel"),pinnedLocationTitle:R("pinnedLocationTitle"),selectedLocationLabel:R("selectedLocationLabel")})),ie=e.computed(()=>f.value?re(f.value):x.value.selectedLocationLabel),E=e.computed(()=>s.isTracking.value&&b.value?x.value.stopTrackingLabel:x.value.locateButtonLabel);e.watch(()=>n.modelValue,p=>{const k=L(p),S=W(k);S?(m.value=S,f.value=null):k&&(f.value=k);const T=V(p);T&&(h.value=T)},{immediate:!0}),e.watch(()=>n.center,p=>{const k=V(p);k&&(h.value=k)},{deep:!0}),e.watch(y,p=>{p&&b.value&&(h.value=p)},{deep:!0}),e.watch(B,p=>{a("update:distance",p)},{immediate:!0}),e.watch(A,async p=>{if(a("search",p),!n.enableGeocoding){u.clearResults();return}const k=p.trim();if(k.length<n.geocodingMinQueryLength){u.clearResults();return}await u.search(k,{endpoint:n.geocodingEndpoint,customFetch:n.customGeocodingFetch,limit:n.geocodingLimit})}),e.watch(()=>({enabled:n.enableDirections,origin:y.value,destination:$.value,profile:n.routeProfile}),async({enabled:p,origin:k,destination:S,profile:T})=>{if(!p||!k||!S||te(k,S)){c.clearRoute();return}await c.fetchRoute(k,S,{endpoint:n.directionsEndpoint,profile:T,customFetch:n.customDirectionsFetch})},{immediate:!0,deep:!0}),e.onMounted(async()=>{n.autoLocate&&n.trackUser&&await ct()});const v=e.computed(()=>{const p=Ee(A.value).trim();return p?n.locations.filter(k=>[re(k),J(k)].filter(Boolean).some(S=>Ee(S).includes(p))):n.locations}),P=e.computed(()=>u.results.value.map(p=>({id:p.id,title:p.title,address:p.address,lat:p.lat,lng:p.lng,source:p.source}))),Q=e.computed(()=>{if(!A.value.trim())return n.locations;const p=v.value;return p.length?p:n.locations}),G=e.computed(()=>Q.value),ue=e.computed(()=>Y(Q.value,n.enableGeocoding?P.value:[])),Ce=e.computed(()=>Array.from(new Set(ue.value.map(p=>U(p))))),me=e.computed(()=>G.value.map(p=>{const k=V(p);return k?{id:z(p),label:re(p),...k,type:w.value&&te(k,w.value)?"selected":"list"}:null}).filter(p=>!!p)),Ve=e.computed(()=>b.value&&y.value?y.value:h.value||$.value||y.value||V(G.value[0])||l);function R(p,k){const S=n.messages?.[p];if(typeof S=="string"&&S.trim())return S;if(typeof k=="string"&&k.trim())return k;const T=`locationFinder.${String(p)}`;return r(T)?String(i(T)):o[p]}function V(p){if(!p)return null;const k=Number(p.lat),S=Number(p.lng);return!Number.isFinite(k)||!Number.isFinite(S)?null:{lat:k,lng:S}}function L(p){if(!p)return null;const k=V(p);return k?{...p,...k}:null}function z(p){return p?typeof p!="object"?p:p.id??p.value??U(p):null}function W(p){return p&&n.locations.find(k=>z(k)===z(p)||te(V(k),V(p)))||null}function Ee(p){return`${p??""}`.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function re(p){return`${p.title||p.label||p.name||"Location"}`}function J(p){return`${p.address||p.description||p.subtitle||""}`}function U(p){const k=re(p),S=J(p);return S?`${k} — ${S}`:k}function Y(p,k){const S=[...p];return k.forEach(T=>{S.some(Se=>z(Se)===z(T)||te(V(Se),V(T)))||S.push(T)}),S}function te(p,k){return!p||!k?!1:Math.abs(p.lat-k.lat)<1e-6&&Math.abs(p.lng-k.lng)<1e-6}function fe(p,k){const S=_A=>_A*(Math.PI/180),ce=S(k.lat-p.lat),Se=S(k.lng-p.lng),qA=S(p.lat),jA=S(k.lat),dt=Math.sin(ce/2)**2+Math.cos(qA)*Math.cos(jA)*Math.sin(Se/2)**2,JA=2*Math.atan2(Math.sqrt(dt),Math.sqrt(1-dt));return Math.round(6371e3*JA)}function $e(p){return p===null||!Number.isFinite(p)?"—":p>=1e3?`${(p/1e3).toFixed(1)} km`:`${Math.round(p)} m`}function ae(p){if(p===null||!Number.isFinite(p))return"—";const k=Math.max(1,Math.round(p/60));if(k<60)return`${k} min`;const S=Math.floor(k/60),T=k%60;return T?`${S} h ${T} min`:`${S} h`}function se(p){const k=L(p),S=W(k);if(b.value=!1,!k){a("update:modelValue",null);return}m.value=S||k;const T=V(k);T&&(h.value=T),a("update:modelValue",k),a("select",k)}function _(p){const k=L(p),S=W(k);if(b.value=!1,!k){a("update:modelValue",null);return}S?(m.value=S,f.value=null):f.value=k;const T=V(k);T&&(h.value=T),a("update:modelValue",k),a("select",k)}function ne(p){const k=ue.value.find(S=>U(S)===p||re(S)===p);if(k){if(W(k)){se(k),f.value=null;return}_(k)}}function K(p){se(p)}function le(p){if(p.id==="user-location"&&y.value){h.value=y.value,b.value=!0,a("track-user",y.value);return}const k=G.value.find(S=>z(S)===p.id)||G.value.find(S=>{const T=V(S);return T&&Math.abs(T.lat-p.lat)<1e-6&&Math.abs(T.lng-p.lng)<1e-6});if(k){se(k);return}f.value&&(z(f.value)===p.id||te(V(f.value),{lat:p.lat,lng:p.lng}))&&_(f.value)}async function WA(p){if(h.value=p,b.value=!1,!n.interactive)return;const k=G.value.find(T=>{const ce=V(T);return ce&&Math.abs(ce.lat-p.lat)<1e-6&&Math.abs(ce.lng-p.lng)<1e-6});if(k){se(k);return}const S=await UA(p,x.value.pinnedLocationTitle);_(S)}async function UA(p,k){if(!n.enableGeocoding)return{id:`pin-${p.lat}-${p.lng}`,title:k,lat:p.lat,lng:p.lng};const S=await u.reverse(p,{reverseEndpoint:n.reverseGeocodingEndpoint,customFetch:n.customGeocodingFetch});return S?{id:S.id,title:S.title||k,address:S.address,lat:S.lat,lng:S.lng,source:S.source}:{id:`pin-${p.lat}-${p.lng}`,title:k,lat:p.lat,lng:p.lng}}async function ct(){if(s.isTracking.value&&b.value){s.stopTracking(),b.value=!1;return}if(y.value){h.value=y.value,b.value=!0,a("track-user",y.value),!s.isTracking.value&&!N.value&&s.startTracking();return}const p=await s.locate();p&&(h.value=p,b.value=!0,a("track-user",p),s.startTracking())}return(p,k)=>(e.openBlock(),e.createElementBlock("div",Xi,[X.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["location-finder__toolbar",{"location-finder__toolbar--actions-only":!n.showSearch}])},[n.showSearch?(e.openBlock(),e.createBlock(Ue,{key:0,modelValue:A.value,"onUpdate:modelValue":k[0]||(k[0]=S=>A.value=S),class:"location-finder__search",label:x.value.searchLabel,placeholder:x.value.searchPlaceholder,options:Ce.value,disabled:t.disabled,"onUpdate:selection":ne},null,8,["modelValue","label","placeholder","options","disabled"])):e.createCommentVNode("",!0),e.createElementVNode("div",er,[t.trackUser&&n.showTrackButton?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn-outline-primary btn-sm location-finder__locate",disabled:t.disabled||e.unref(s).pending.value,"data-testid":"location-finder-locate",onClick:ct},e.toDisplayString(E.value),9,tr)):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0),q.value?(e.openBlock(),e.createElementBlock("p",ar,e.toDisplayString(q.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["location-finder__layout",{"location-finder__layout--with-summary":j.value,"location-finder__layout--full-width":!ee.value}])},[e.createElementVNode("div",nr,[e.createVNode(Je,{class:"location-finder__map",center:Ve.value,markers:me.value,"model-value":g.value,"user-location":y.value,"user-location-label":x.value.userLocationLabel,"selected-location-label":ie.value,"route-coordinates":e.unref(c).routeCoordinates.value,"route-color":t.routeColor,"route-weight":t.routeWeight,"selection-radius":t.selectionRadius,"selection-radius-center":$.value,"selection-radius-color":t.selectionRadiusColor,"selection-radius-fill-color":t.selectionRadiusFillColor,"map-style":t.mapStyle,"tile-layer-url":t.tileLayerUrl,"tile-layer-attribution":t.tileLayerAttribution,height:t.mapHeight,interactive:t.interactive,disabled:t.disabled,"helper-text":x.value.mapHelperText,"onUpdate:modelValue":WA,onMarkerClick:le},null,8,["center","markers","model-value","user-location","user-location-label","selected-location-label","route-coordinates","route-color","route-weight","selection-radius","selection-radius-center","selection-radius-color","selection-radius-fill-color","map-style","tile-layer-url","tile-layer-attribution","height","interactive","disabled","helper-text"]),n.showLegend?(e.openBlock(),e.createElementBlock("div",{key:0,class:"location-finder__legend","data-testid":"location-finder-legend","aria-label":x.value.legendAriaLabel},[e.createElementVNode("span",or,[k[2]||(k[2]=e.createElementVNode("span",{class:"location-finder__legend-swatch location-finder__legend-swatch--list"},null,-1)),e.createTextVNode(" "+e.toDisplayString(x.value.legendLocations),1)]),e.createElementVNode("span",ir,[k[3]||(k[3]=e.createElementVNode("span",{class:"location-finder__legend-swatch location-finder__legend-swatch--selected"},null,-1)),e.createTextVNode(" "+e.toDisplayString(x.value.legendSelected),1)]),e.createElementVNode("span",rr,[k[4]||(k[4]=e.createElementVNode("span",{class:"location-finder__legend-swatch location-finder__legend-swatch--search"},null,-1)),e.createTextVNode(" "+e.toDisplayString(x.value.legendSearchResult),1)]),e.createElementVNode("span",Ar,[k[5]||(k[5]=e.createElementVNode("span",{class:"location-finder__legend-swatch location-finder__legend-swatch--user"},null,-1)),e.createTextVNode(" "+e.toDisplayString(x.value.userLocationLabel),1)])],8,lr)):e.createCommentVNode("",!0)]),ee.value?(e.openBlock(),e.createElementBlock("aside",sr,[n.showSidebar?(e.openBlock(),e.createBlock(_e,{key:0,modelValue:m.value,"onUpdate:modelValue":k[1]||(k[1]=S=>m.value=S),class:"location-finder__results",locations:G.value,label:x.value.resultsLabel,"empty-text":x.value.emptyText,onSelect:K},null,8,["modelValue","locations","label","empty-text"])):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("div",cr,[e.createElementVNode("p",dr,e.toDisplayString(x.value.directionsTitle),1),e.unref(c).pending.value?(e.openBlock(),e.createElementBlock("p",ur,e.toDisplayString(x.value.loadingRoute),1)):e.unref(c).hasRoute.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",mr,[e.createElementVNode("div",null,[e.createElementVNode("p",fr,e.toDisplayString(x.value.distanceLabel),1),e.createElementVNode("strong",pr,e.toDisplayString(de.value),1)]),e.createElementVNode("div",null,[e.createElementVNode("p",gr,e.toDisplayString(x.value.durationLabel),1),e.createElementVNode("strong",hr,e.toDisplayString(Be.value),1)])]),t.showDirectionsSteps&&e.unref(c).steps.value.length?(e.openBlock(),e.createElementBlock("ol",yr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c).steps.value.slice(0,5),(S,T)=>(e.openBlock(),e.createElementBlock("li",{key:`${S.instruction}-${T}`},[e.createElementVNode("span",null,e.toDisplayString(S.instruction),1),S.name?(e.openBlock(),e.createElementBlock("small",br,e.toDisplayString(S.name),1)):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("p",kr,e.toDisplayString(x.value.directionsEmptyText),1))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2)]))}}),Br={class:"carousel d-flex"},Cr=["onClick"],At=e.defineComponent({__name:"base-carousel",props:{modelValue:{type:Number,default:-1},config:{type:Object,default:null},messages:{type:Object,default:{}},items:{type:Array,default:[]},navigation:{type:Boolean,default:!0}},emits:["update:modelValue","select"],setup(t,{emit:d}){const l=d,o=e.ref(),n=e.ref();function a(){o.value.scrollTo({top:0,left:o.value.scrollLeft-o.value.clientWidth>0?o.value.scrollLeft-o.value.clientWidth:0,behavior:"smooth"})}function i(){o.value.scrollTo({top:0,left:o.value.scrollLeft-o.value.clientWidth<=n.value.clientWidth?o.value.scrollLeft+o.value.clientWidth:n.value.clientWidth,behavior:"smooth"})}function r(s){l("update:modelValue",s)}return(s,u)=>(e.openBlock(),e.createElementBlock("div",Br,[t.navigation?(e.openBlock(),e.createElementBlock("button",{key:0,class:"carousel__control btn btn-link text-light",type:"button",onClick:e.withModifiers(a,["prevent","stop"])},[e.createVNode(M,{symbol:"chevron-left"})])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"viewport",ref:o,class:"carousel__viewport flex-grow-1"},[e.createElementVNode("div",{ref_key:"track",ref:n,class:"carousel__track d-flex justify-center align-items-center"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(c,A)=>e.renderSlot(s.$slots,"carousel-item",{key:c.src,item:c,index:A},()=>[e.createElementVNode("div",{class:e.normalizeClass(["carousel__item",A===t.modelValue?"selected":""]),onClick:m=>r(A)},e.toDisplayString(c),11,Cr)])),128))],512)],512),t.navigation?(e.openBlock(),e.createElementBlock("button",{key:1,class:"carousel__control btn btn-link text-light",type:"button",onClick:e.withModifiers(i,["prevent","stop"])},[e.createVNode(M,{symbol:"chevron-right"})])):e.createCommentVNode("",!0)]))}}),Vr={class:"media-thumbnails"},Er=["onClick"],$r={class:"img-container"},Sr=e.defineComponent({__name:"media-thumbnails",props:{modelValue:{default:null},config:{type:Object,default:null},messages:{type:Object,default:{}},assets:{type:Array,default:[]}},emits:["update:modelValue","select"],setup(t,{emit:d}){const l=d,o=e.ref(-1);function n(a){o.value=a,l("update:modelValue",a),l("select",a)}return(a,i)=>(e.openBlock(),e.createElementBlock("div",Vr,[e.createVNode(At,{items:t.assets},{"carousel-item":e.withCtx(r=>[e.createElementVNode("a",{role:"button",class:e.normalizeClass(["carousel__item media-thumbnails__thumbnail",r.index===t.modelValue||r.index===o.value?"is-active":""]),onClick:s=>n(r.index)},[e.createElementVNode("div",$r,[e.createVNode(oe,{src:r.item.thumbnail||r.item.src,class:"img-fluid"},null,8,["src"])])],10,Er)]),_:1},8,["items"])]))}}),Nr={class:"progress-steps"},Mr={class:"progress-steps__list"},Dr={class:"progress-step"},vr=["checked","id","value","disabled","read-only","required","onChange"],Lr=["for"],Ir=["innerHTML"],Pr=["for"],Tr=["innerHTML"],xr=e.defineComponent({__name:"progress-steps",props:{modelValue:{type:Number,default:0},progress:{type:Number,default:0},steps:{type:Array},label:{type:String,default:""},reveal:{type:Boolean,default:!1}},emits:["update:modelValue","update:progress"],setup(t,{emit:d}){const l=t,o=d;function n(a){o("update:modelValue",a),a>=l.progress&&o("update:progress",a)}return(a,i)=>(e.openBlock(),e.createElementBlock("div",Nr,[e.createElementVNode("ul",Mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.steps,(r,s)=>(e.openBlock(),e.createElementBlock("li",{key:s,class:e.normalizeClass(["progress-steps__step",{"progress-steps__step--disabled":s>t.progress+(t.reveal?1:0),"progress-steps__step--active":s===(t.modelValue||0)}])},[e.renderSlot(a.$slots,"step",{},()=>[e.createElementVNode("div",Dr,[e.createElementVNode("input",{type:"radio",checked:s<=(t.progress||0),id:`step-${s}`,name:"step",class:"form-check-input",value:r.value,disabled:r.disabled||s>t.progress+(t.reveal?1:0),"read-only":r.readOnly,required:r.required,onChange:u=>n(s)},null,40,vr),e.createElementVNode("label",{for:`step-${s}`},[e.renderSlot(a.$slots,"button",{step:r},()=>[e.createElementVNode("span",{class:"btn rounded-circle",innerHTML:e.unref(F)(r.text||"")},null,8,Ir)])],8,Lr),e.createElementVNode("label",{for:`step-${s}`},[e.renderSlot(a.$slots,"label",{step:r},()=>[e.createElementVNode("span",{class:"form-check-label",innerHTML:e.unref(F)(r.label||"")},null,8,Tr)])],8,Pr)])])],2))),128))])]))}}),zr={class:"hint-system"},Rr=["innerHTML"],Qr=["innerHTML"],Fr={key:1,class:"hint-system__hint-content"},Or=["disabled"],Hr=e.defineComponent({__name:"hint-system",props:{modelValue:{type:Number,default:0},hints:{type:Array,default:()=>[]},penalty:{type:Number,default:1},maxHints:{type:Number,default:void 0},htmlContent:{type:Boolean,default:!1},label:{type:String,default:"Show hint"},description:{type:String,default:""}},emits:["update:modelValue","hint-revealed"],setup(t,{emit:d}){const l=t,o=d,n=e.ref(l.modelValue);e.watch(()=>l.modelValue,u=>{n.value=u});const a=e.computed(()=>l.maxHints!==void 0?l.maxHints:l.hints.length),i=e.computed(()=>n.value<a.value),r=e.computed(()=>l.hints.slice(0,n.value));function s(){if(!i.value)return;const u=n.value;n.value++,o("update:modelValue",n.value),o("hint-revealed",{hint:l.hints[u],index:u,penaltyTotal:n.value*l.penalty})}return(u,c)=>(e.openBlock(),e.createElementBlock("div",zr,[t.description?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:e.unref(F)(t.description),class:"hint-system__description"},null,8,Rr)):e.createCommentVNode("",!0),r.value.length?(e.openBlock(),e.createBlock(e.TransitionGroup,{key:1,name:"hint-reveal",tag:"ol",class:"hint-system__list"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(A,m)=>(e.openBlock(),e.createElementBlock("li",{key:m,class:"hint-system__hint"},[e.renderSlot(u.$slots,"hint",{hint:A,index:m,isNew:m===n.value-1},()=>[t.htmlContent?(e.openBlock(),e.createElementBlock("div",{key:0,class:"hint-system__hint-content",innerHTML:e.unref(F)(A.content||"")},null,8,Qr)):(e.openBlock(),e.createElementBlock("div",Fr,e.toDisplayString(A.content),1))])]))),128))]),_:3})):e.createCommentVNode("",!0),i.value?e.renderSlot(u.$slots,"trigger",{key:2,revealNext:s,canReveal:i.value,revealedCount:n.value,total:a.value},()=>[e.createElementVNode("button",{type:"button",class:"hint-system__trigger d-block w-100 text-center",disabled:!i.value,onClick:s},e.toDisplayString(t.label),9,Or)]):e.createCommentVNode("",!0)]))}}),Wr=["id","popover"],Ie=e.defineComponent({__name:"popover-dialog",props:{modelValue:{type:Boolean,default:!1},type:{type:String,default:"auto"},id:{type:String,default:()=>`popover-dialog-${Math.random().toString(36).substr(2,9)}`},title:{type:String,default:""},header:{type:Boolean,default:!1},footer:{type:Boolean,default:!1},classes:{type:String,default:""},hover:{type:Boolean,default:!1},hoverDelay:{type:Number,default:400},closeTimeout:{type:Number,default:0}},emits:["update:modelValue"],setup(t,{emit:d}){const l=t,o=d,n=e.ref(),a=e.ref(),i=e.ref(!1),r=e.computed(()=>"ontouchstart"in window||navigator.maxTouchPoints>0);function s(){clearTimeout(a.value),l.hover&&n.value?.showPopover()}function u(){i.value=!0,clearTimeout(a.value),s()}function c(){i.value=!1,(l.hover||l.closeTimeout)&&(a.value=setTimeout(()=>{n.value?.hidePopover()},l.closeTimeout||l.hoverDelay))}e.watch(()=>l.modelValue,(m,f)=>{m&&!f?n.value?.matches(":popover-open")||n.value?.showPopover():!m&&f&&n.value?.matches(":popover-open")&&n.value?.hidePopover()});function A(m){m.newState==="open"?(l.closeTimeout&&!i.value&&(clearTimeout(a.value),a.value=setTimeout(()=>{i.value||n.value?.hidePopover()},l.closeTimeout)),l.modelValue||o("update:modelValue",!0)):m.newState==="closed"&&(i.value=!1,l.modelValue&&o("update:modelValue",!1))}return e.onMounted(()=>{if(n.value?.addEventListener("toggle",A),l.modelValue&&n.value?.showPopover(),!r.value){n.value?.addEventListener("mouseenter",u),n.value?.addEventListener("mouseleave",c);const m=document.querySelector(`[popovertarget="${l.id}"]`);m&&(m.addEventListener("mouseenter",u),m.addEventListener("mouseleave",c))}}),e.onBeforeUnmount(()=>{if(clearTimeout(a.value),n.value?.removeEventListener("toggle",A),!r.value){n.value?.removeEventListener("mouseenter",u),n.value?.removeEventListener("mouseleave",c);const m=document.querySelector(`[popovertarget="${l.id}"]`);m&&(m.removeEventListener("mouseenter",u),m.removeEventListener("mouseleave",c))}}),(m,f)=>(e.openBlock(),e.createElementBlock("span",{class:"popover-dialog",id:t.id,popover:t.type,ref_key:"popover",ref:n},[e.renderSlot(m.$slots,"default",{},()=>[f[0]||(f[0]=e.createTextVNode(" Popover content goes here. ",-1))])],8,Wr))}}),Ur={class:"popover-tooltip"},qr=["popovertarget","disabled","aria-describedby","aria-label"],jr={class:"popover-tooltip__content d-flex flex-column"},Jr={key:0,class:"popover-tooltip__header d-flex p-3 border-bottom"},_r=["innerHTML"],Gr={class:"popover-tooltip__body"},Yr=["innerHTML"],Kr={key:1,class:"popover-tooltip__footer d-flex p-3 border-top"},Zr=e.defineComponent({__name:"popover-tooltip",props:{modelValue:{type:Boolean,default:!1},id:{type:String,default:()=>`popover-tooltip-${Math.random().toString(36).substr(2,9)}`},size:{type:String},exclusive:{type:Boolean,default:!0},header:{type:Boolean,default:!1},footer:{type:Boolean,default:!1},title:{type:String,default:""},content:{type:String,default:""},hover:{type:Boolean,default:!0},hoverDelay:{type:Number,default:400},disabled:{type:Boolean,default:!1},ariaLabel:{type:String,default:""}},emits:["update:modelValue","confirm","cancel"],setup(t,{emit:d}){const l=t,o=d,n=he(()=>l.title),a=he(()=>l.content),i=e.computed({get(){return l.modelValue},set(u){o("update:modelValue",u)}}),r=e.ref(),s=e.ref();return(u,c)=>(e.openBlock(),e.createElementBlock("span",Ur,[e.createElementVNode("button",{type:"button",popovertarget:t.id,disabled:t.disabled,"aria-describedby":t.id,"aria-label":t.ariaLabel||u.$te("common.moreInfo")?u.$t("common.moreInfo"):void 0,ref_key:"trigger",ref:r},[e.renderSlot(u.$slots,"button",{},()=>[c[3]||(c[3]=e.createElementVNode("span",{class:"popover-tooltip__trigger"}," i ",-1))])],8,qr),e.createVNode(Ie,{id:t.id,modelValue:i.value,"onUpdate:modelValue":c[2]||(c[2]=A=>i.value=A),hover:t.hover,"hover-delay":t.hoverDelay,ref_key:"dialog",ref:s,role:"tooltip",class:e.normalizeClass(t.size?`popover-tooltip--${t.size}`:"")},{default:e.withCtx(()=>[e.createElementVNode("div",jr,[t.header?(e.openBlock(),e.createElementBlock("div",Jr,[t.title?(e.openBlock(),e.createElementBlock("h5",{key:0,class:"popover-tooltip__title",innerHTML:e.unref(n)},null,8,_r)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"btn-close ms-auto border-radius-none","aria-label":"Close",onClick:c[0]||(c[0]=A=>i.value=!1)})])):e.createCommentVNode("",!0),e.createElementVNode("div",Gr,[e.renderSlot(u.$slots,"default",{},()=>[e.createElementVNode("span",{innerHTML:e.unref(a)},null,8,Yr)])]),t.footer?(e.openBlock(),e.createElementBlock("div",Kr,[e.renderSlot(u.$slots,"footer"),e.createElementVNode("button",{type:"button",class:"btn ms-auto",onClick:c[1]||(c[1]=A=>i.value=!1)},e.toDisplayString(u.$t("common.close")),1)])):e.createCommentVNode("",!0)])]),_:3},8,["id","modelValue","hover","hover-delay","class"])]))}}),Xr={class:"popover-notification__header d-flex justify-content-between mb-2"},eA={class:"popover-notification__title"},tA=["onClick"],aA=["innerHTML"],nA=e.defineComponent({__name:"popover-notifications",props:{modelValue:{type:Boolean,default:!1},id:{type:String,default:()=>`popover-notifications-${Math.random().toString(36).substr(2,9)}`},items:{type:Array,default:()=>[]},debounceItem:{type:Number,default:0},closeTimeout:{type:Number,default:8e3},collapsible:{type:Boolean,default:!0}},setup(t,{expose:d}){const l=t,o=e.ref([]),n=e.ref([]),a=e.computed(()=>o.value.map(m=>({...m,content:F(m.content||"")}))),i=e.ref(!1),r=e.computed(()=>l.collapsible&&o.value.length>3);function s(m,f){o.value=o.value.filter(h=>h.id!==m.id)}e.watch(()=>l.items,(m,f)=>{const h=m.filter(b=>!f.some(N=>N.id===b.id));n.value=[...n.value,...h]});function u(){setTimeout(()=>{const m=n.value.shift();m&&o.value.push({...m,closeTimeout:l.closeTimeout,visible:!0}),n.value.length>0&&u()},o.value.length?l.debounceItem:0)}function c(m){r.value&&(m.preventDefault(),m.stopPropagation(),i.value=!i.value)}function A(m){console.log("Adding item:",m),n.value.push(m),u()}return e.onMounted(()=>{n.value=l.items,n.value.length>3&&(i.value=!0),u()}),d({addItem:A}),(m,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["popover-notifications",{"popover-notifications--collapsed":i.value}]),style:{anchorName:"--popover-notifications"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(h,b)=>(e.openBlock(),e.createBlock(Ie,{key:h.id,id:h.id,"close-timeout":h.closeTimeout,type:"manual",class:"popover-notification",modelValue:h.visible,"onUpdate:modelValue":[N=>h.visible=N,N=>s(h)],onClick:c},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"item",{item:h},()=>[e.createElementVNode("div",Xr,[e.createElementVNode("span",eA,e.toDisplayString(h.title),1),e.createElementVNode("button",{type:"button",class:"btn btn-close p-0",onClick:e.withModifiers(N=>h.visible=!1,["stop"]),"aria-label":"Close notification"},null,8,tA)]),e.createElementVNode("span",{innerHTML:h.content},null,8,aA)])]),_:2},1032,["id","close-timeout","modelValue","onUpdate:modelValue"]))),128))],2))}}),lA=e.defineComponent({__name:"dom-renderer",props:{modelValue:{type:String,default:""},fixedWidth:{type:Number,default:0},renderUpdates:{type:Boolean,default:!1},exportToSvg:{type:Boolean,default:!1},options:{type:Object,default:()=>({})},pending:{type:Boolean,default:!1},emitPending:{type:Boolean,default:!1},debug:{type:Boolean,default:!1}},emits:["update:modelValue","update:pending"],setup(t,{emit:d}){const l=t,o=d,n=e.ref(),a=e.ref(""),i=e.ref(),r=e.ref(!0);async function s(){if(!n.value||!r.value)return"";const c=n.value;if(!c.isConnected)return"";try{l.emitPending&&o("update:pending",!0);const A=c.firstElementChild;if(!A)return"";const m=await mt(A,{backgroundColor:"rgba(0, 0, 0, 0)",scale:1,...l.options});if(!r.value||!n.value||!c.isConnected)return"";const f=m.toDataURL();if(o("update:modelValue",f),l.emitPending&&o("update:pending",!1),l.debug){const h=new Image;h.src=f,document.body.appendChild(h)}return f}catch(A){return r.value&&l.emitPending&&o("update:pending",!1),console.warn("dom-renderer: Render failed",A),""}}const u=Me.debounce(async()=>{a.value=await s()},300,{trailing:!0,leading:!1});return e.onMounted(()=>{const c=n.value;l.renderUpdates&&(i.value=new MutationObserver(async A=>{!r.value||!c.isConnected||(l.emitPending&&o("update:pending",!0),u())}),i.value.observe(c,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),setTimeout(()=>{l.emitPending&&o("update:pending",!0),u()},500)}),e.onBeforeUnmount(()=>{r.value=!1,i.value&&i.value.disconnect(),u.cancel()}),(c,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dom-renderer",{"off-screen":!t.debug}]),ref_key:"renderer",ref:n,style:e.normalizeStyle(t.fixedWidth>0?{width:`${t.fixedWidth}px`}:{})},[e.renderSlot(c.$slots,"default")],6))}}),oA={class:"qr-code"},iA=["innerHTML"],rA=e.defineComponent({__name:"qr-code",props:{data:null,image:null,download:{type:Boolean,default:!1},filename:{type:String,default:"qr-code"}},emits:["update:dataUrl"],setup(t,{expose:d,emit:l}){const o=t,n=e.ref(),a=e.computed(()=>({width:300,height:300,type:"canvas",data:o.data,...o.image?{image:o.image}:{},margin:10,qrOptions:{typeNumber:0,mode:"Byte",errorCorrectionLevel:"Q"},imageOptions:{hideBackgroundDots:!0,imageSize:.4,margin:20,crossOrigin:"anonymous"},dotsOptions:{type:"rounded"},backgroundOptions:{color:"#ffffff"},cornersSquareOptions:{color:"#333333",type:"extra-rounded"},cornersDotOptions:{color:"#333333",type:"dot"}}));function i(s=null,u=null){typeof window<"u"&&(n.value&&(n.value.innerHTML=""),new xe(s||a.value).append(n.value))}function r(){new xe({...a.value,width:1200,height:1200}).download({name:o.filename,extension:"png"})}return e.watch(()=>a.value,i,{deep:!0,immediate:!0}),e.onMounted(()=>{typeof window<"u"&&i()}),d({download:r}),(s,u)=>(e.openBlock(),e.createElementBlock("div",oA,[o.download?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn btn-outline-contrast mb-3",onClick:r,innerHTML:s.$t("qrlink.download")},null,8,iA)):(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"canvas",ref:n},null,512))]))}}),AA={class:"link-sharing"},sA={key:0,class:"link-sharing__links container"},cA={class:"row"},dA={key:0,class:"col-12 col-md-6"},uA=["href"],mA={class:"caption"},fA={key:1,class:"col-12 col-md-6"},pA=["href"],gA={class:"caption"},hA={key:2,class:"col-12 col-md-6"},yA={class:"caption"},bA={key:3,class:"col-12 col-md-6"},kA=["href"],wA={class:"caption"},BA={key:4,class:"col-12 col-md-6"},CA=["href"],VA={class:"caption"},EA={key:5,class:"col-12 col-md-6"},$A={class:"caption"},SA={key:6,class:"col-12 col-md-6"},NA=["href"],MA={class:"caption"},DA={key:1,class:"link-sharing__instructions pt-5"},vA={class:"row"},LA={class:"col-12 text-center py-0"},IA={class:"mb-5"},PA=t=>t.replace(/<(?:.|\n)*?>/gm,""),TA=e.defineComponent({__name:"link-sharing",props:{url:{type:String,default:""},subject:{type:String,default:""},hashtags:Array,text:{type:String,default:""},media:{type:String,default:""},services:{type:Object,default:{facebook:!0,instagram:!0,linkedin:!0,whatsapp:!0,mailto:!0,clipboard:!0,bluesky:!0}}},setup(t){const d=t,l=e.ref(!1),o=e.computed(()=>encodeURIComponent(d.url));e.computed(()=>encodeURIComponent(d.media));const n=e.computed(()=>PA(d.text)),a=e.computed(()=>!!(navigator&&navigator.userAgent&&/Mobi|Android/i.test(navigator.userAgent)));async function i(){const r=document.createElement("textarea");document.body.appendChild(r),r.value=d.url,r.select(),r.setSelectionRange(0,99999),navigator.clipboard.writeText(r.value),document.body.removeChild(r)}return(r,s)=>(e.openBlock(),e.createElementBlock("div",AA,[l.value?(e.openBlock(),e.createElementBlock("div",DA,[e.createElementVNode("div",vA,[e.createElementVNode("div",LA,[e.createElementVNode("div",IA,[e.createElementVNode("p",null,e.toDisplayString(r.$t("sharing.instructions",{service:"Instagram"})),1),e.createElementVNode("p",null,[e.createElementVNode("strong",null,e.toDisplayString(Array.isArray(t.hashtags)?t.hashtags.join(", "):t.hashtags),1)]),e.createElementVNode("button",{type:"button",class:"btn btn-text",onClick:s[1]||(s[1]=e.withModifiers(u=>l.value=!l.value,["prevent"]))},[e.createVNode(M,{symbol:"arrow-left"}),e.createTextVNode(" "+e.toDisplayString(r.$t("common.back")),1)])])])])])):(e.openBlock(),e.createElementBlock("div",sA,[e.createElementVNode("div",cA,[t.services.facebook?(e.openBlock(),e.createElementBlock("div",dA,[e.createElementVNode("a",{class:"link-sharing__link btn btn-primary",href:`https://www.facebook.com/sharer.php?u=${o.value}`,target:"_blank",rel:"noopener"},[e.createVNode(M,{symbol:"facebook"}),e.createElementVNode("span",mA,e.toDisplayString(r.$t("sharing.facebook")),1)],8,uA)])):e.createCommentVNode("",!0),t.services.bluesky?(e.openBlock(),e.createElementBlock("div",fA,[e.createElementVNode("a",{class:"link-sharing__link btn btn-primary",href:`https://bsky.app/intent/compose?text=${n.value}${n.value?"%20":""}${t.url}`,target:"_blank",rel:"noopener"},[e.createVNode(M,{symbol:"bluesky-logo"}),e.createElementVNode("span",gA,e.toDisplayString(r.$t("sharing.bluesky")),1)],8,pA)])):e.createCommentVNode("",!0),t.services.instagram?(e.openBlock(),e.createElementBlock("div",hA,[e.createElementVNode("button",{type:"button",class:"link-sharing__link btn btn-primary",onClick:s[0]||(s[0]=e.withModifiers(u=>l.value=!l.value,["prevent"]))},[e.createVNode(M,{symbol:"instagram"}),e.createElementVNode("span",yA,e.toDisplayString(r.$t("sharing.instagram")),1)])])):e.createCommentVNode("",!0),t.services.linkedin?(e.openBlock(),e.createElementBlock("div",bA,[e.createElementVNode("a",{class:"link-sharing__link btn btn-primary",href:`https://www.linkedin.com/shareArticle?mini=true&url=${o.value}&title=${t.subject}`,target:"_blank",rel:"noopener"},[e.createVNode(M,{symbol:"linkedin"}),e.createElementVNode("span",wA,e.toDisplayString(r.$t("sharing.linkedin")),1)],8,kA)])):e.createCommentVNode("",!0),t.services.whatsapp&&a.value?(e.openBlock(),e.createElementBlock("div",BA,[e.createElementVNode("a",{class:"link-sharing__link btn btn-primary",href:`whatsapp://send?text=${o.value}`,target:"_blank",rel:"noopener"},[e.createVNode(M,{symbol:"whatsapp"}),e.createElementVNode("span",VA,e.toDisplayString(r.$t("sharing.whatsapp")),1)],8,CA)])):e.createCommentVNode("",!0),t.services.clipboard?(e.openBlock(),e.createElementBlock("div",EA,[e.createElementVNode("button",{type:"button",class:"link-sharing__link btn btn-primary",onClick:e.withModifiers(i,["prevent","stop"])},[e.createVNode(M,{symbol:"copy"}),e.createElementVNode("span",$A,e.toDisplayString(r.$t("sharing.clipboard")),1)])])):e.createCommentVNode("",!0),t.services.mailto?(e.openBlock(),e.createElementBlock("div",SA,[e.createElementVNode("a",{class:"link-sharing__link btn btn-primary",href:`mailto:?subject=${t.subject}&body=${n.value}%0D%0A${t.url}`,target:"_blank",rel:"noopener"},[e.createVNode(M,{symbol:"mail"}),e.createElementVNode("span",MA,e.toDisplayString(r.$t("sharing.mailto")),1)],8,NA)])):e.createCommentVNode("",!0)])]))]))}}),xA={class:"base-form"},zA=e.defineComponent({__name:"base-form",props:{id:{},name:{},variant:{},disabled:{type:Boolean},pending:{type:Boolean}},setup(t){function d(n){console.log("input",n)}function l(n){console.log("reset",n)}function o(n){console.log("submit",n)}return(n,a)=>(e.openBlock(),e.createElementBlock("div",xA,[e.createElementVNode("form",{ref:"form",onInput:d,onReset:l,onSubmit:e.withModifiers(o,["prevent"])},[e.renderSlot(n.$slots,"default")],544)]))}}),RA={class:"touch-wrapper__controls"},QA={class:"btn-group",role:"group"},FA=e.defineComponent({__name:"touch-wrapper",props:{modelValue:{type:Number,default:1}},emits:["update:modelValue"],setup(t,{emit:d}){const l=e.getCurrentInstance(),o=l&&l.appContext.config.globalProperties.$config,n=t,a=d,i=e.ref();function r(c){const A=n.modelValue+c;a("update:modelValue",c===0?1:A>=1?A:1)}function s(c){if(c.ctrlKey){c.preventDefault();const A=0-c.deltaY*.01;r(A)}}function u(c){c.preventDefault();const{scale:A}=c,m=A>1?A*.01:0-A;r(m)}return e.onMounted(()=>{i.value&&(i.value.addEventListener("wheel",s,!1),i.value.addEventListener("gesturestart",u,!1),i.value.addEventListener("gesturechange",u,!1),i.value.addEventListener("gestureend",u,!1))}),(c,A)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"touchElement",ref:i,class:"touch-wrapper"},[e.renderSlot(c.$slots,"controls",{on:{setScale:r}},()=>[e.createElementVNode("div",RA,[e.createElementVNode("div",QA,[e.createElementVNode("button",{type:"button",class:"btn",onClick:A[0]||(A[0]=m=>r(-1))},[e.createVNode(M,{symbol:"minus","base-path":e.unref(o).iconSprite},null,8,["base-path"])]),e.createElementVNode("button",{type:"button",class:"btn",onClick:A[1]||(A[1]=m=>r(0))},[e.createVNode(M,{symbol:"maximize","base-path":e.unref(o).iconSprite},null,8,["base-path"])]),e.createElementVNode("button",{type:"button",class:"btn",onClick:A[2]||(A[2]=m=>r(1))},[e.createVNode(M,{symbol:"plus","base-path":e.unref(o).iconSprite},null,8,["base-path"])])])])]),e.renderSlot(c.$slots,"default")],512))}});let we=null;async function OA(){if(typeof window>"u")return null;if(we)return we;const t=await import("canvas-confetti");return we=t.default||t,we}const st={default:{items:[{particleCount:80,spread:120,origin:{y:.625,x:.5}},{timeout:400,particleCount:80,spread:120,origin:{y:.625,x:.625}},{timeout:800,particleCount:80,spread:120,origin:{y:.625,x:.375}}]},randomDirection:{items:[{angle:Pe(55,125),spread:Pe(50,70),particleCount:Pe(50,100),origin:{y:.6}}]},pride:{items:[{timeout:20,particleCount:2,spread:32,origin:{x:0},colors:["#ff0000"]},{timeout:20,particleCount:2,spread:32,origin:{x:1},colors:["#ff0000"]}]}};function Pe(t,d){return Math.random()*(d-t)+t}const HA=e.defineComponent({__name:"canvas-confetti",props:{preset:{type:String,default:"default"},items:{default:()=>[{}]},colors:{type:Array,default:()=>[]},loop:{type:Boolean,default:!1}},setup(t){const d=t,l=e.ref(null),o=e.computed(()=>({...st[d.preset],items:st[d.preset].items.map((i,r)=>({...i,...d.items[r],...d.colors.length?{colors:d.colors}:{}}))}));async function n(i){return new Promise(r=>{(typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):u=>setTimeout(u,16))(()=>l.value?.confetti?.(JSON.parse(JSON.stringify(i)))),setTimeout(()=>r(),0)})}async function a(){await Promise.all(o.value.items.map(i=>new Promise(r=>setTimeout(()=>{r(n(i))},i.timeout||0)))),d.loop&&a()}return e.onMounted(async()=>{if(typeof window<"u"&&l.value){const i=await OA();if(!i)return;l.value.confetti=l.value?.confetti||i.create(l.value,{resize:!0}),a()}}),(i,r)=>(e.openBlock(),e.createElementBlock("canvas",{class:"canvas-confetti",ref_key:"canvas",ref:l},null,512))}});C.Accordion=zt,C.AccordionItem=Lt,C.AssetUploader=Ji,C.AutoSuggest=Ue,C.BaseButton=Fe,C.BaseCamera=So,C.BaseCarousel=At,C.BaseForm=zA,C.BaseHeadline=bt,C.BaseImage=oe,C.BaseInput=Ae,C.BaseMap=Je,C.BaseParagraph=wt,C.CanvasConfetti=HA,C.CheckGroup=el,C.ColorPalette=ql,C.CustomHtml=hl,C.DomRenderer=lA,C.FileUpload=Ye,C.HintSystem=Hr,C.ImageCrop=Xe,C.ImageCropResize=et,C.ImageResize=Ze,C.ImageUpload=at,C.InputCheckbox=Yt,C.InputColor=Hl,C.InputDatepicker=jn,C.InputDatetime=ea,C.InputDropdown=ke,C.InputFile=Le,C.InputPasscode=Yn,C.InputPassword=We,C.InputTextarea=jt,C.LinkSharing=TA,C.LoadingSpinner=ge,C.LocationFinder=wr,C.LocationList=_e,C.MediaThumbnails=Sr,C.ModalDialog=tt,C.PopoverDialog=Ie,C.PopoverNotifications=nA,C.PopoverTooltip=Zr,C.ProgressSteps=xr,C.QrCode=rA,C.RadioButtons=rl,C.RadioGroup=be,C.RteEditor=Rl,C.SelectMedia=kl,C.SortableList=Ke,C.SvgIcon=M,C.TouchWrapper=FA,C.UploadGroup=nt,C.useCameraFilter=qe,C.useDirections=lt,C.useGeocoding=ot,C.useGeolocation=rt,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}));
|